CN115348340B - Data forwarding method, device, equipment and storage medium - Google Patents

Data forwarding method, device, equipment and storage medium Download PDF

Info

Publication number
CN115348340B
CN115348340B CN202210976357.8A CN202210976357A CN115348340B CN 115348340 B CN115348340 B CN 115348340B CN 202210976357 A CN202210976357 A CN 202210976357A CN 115348340 B CN115348340 B CN 115348340B
Authority
CN
China
Prior art keywords
data
forwarding
data packet
load
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210976357.8A
Other languages
Chinese (zh)
Other versions
CN115348340A (en
Inventor
李军飞
伊鹏
董永吉
崔鹏帅
胡宇翔
邬江兴
王钰
张汝云
肖戈扬
梁元
邹涛
黄培龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information Engineering University of PLA Strategic Support Force
Zhejiang Lab
Original Assignee
Information Engineering University of PLA Strategic Support Force
Zhejiang Lab
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Information Engineering University of PLA Strategic Support Force , Zhejiang Lab filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN202210976357.8A priority Critical patent/CN115348340B/en
Publication of CN115348340A publication Critical patent/CN115348340A/en
Application granted granted Critical
Publication of CN115348340B publication Critical patent/CN115348340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The data forwarding method, the device, the equipment and the storage medium provided by the invention can analyze the received data packet based on the preset analysis rule to obtain the data field and the load of the data packet, wherein the data field at least comprises the protocol header data of the data packet. And then screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions. And calculating the target load associated with the target data based on a preset calculation rule to obtain a new load. The data field and the new payload are reassembled into a new data packet. And obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding a new data packet to the forwarding port. The data forwarding method can forward data according to different data forwarding requirements of users, has the computing capability of data packet load, and can meet the personalized forwarding requirements of the users.

Description

Data forwarding method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a data forwarding method, apparatus, device, and storage medium.
Background
With the rapid development of science and technology, services such as cloud computing, distributed machine learning and the like are applied in a large scale in a data center, which also puts higher demands on the functions and performances of a network of the data center, such as rapid and flexible data packet analysis, in-band aggregation computing and the like. Traditional network equipment of the data center can only forward data according to the existing protocol specifications, and cannot meet the increasingly personalized forwarding demands of users.
Therefore, how to provide a forwarding method capable of meeting different forwarding requirements of users has become a technical problem to be solved.
Disclosure of Invention
In order to solve the problems of fixed data forwarding format and incapability of meeting user requirements in the prior art, the invention provides a data forwarding method, a device, equipment and a storage medium, which have the characteristics of flexibly forwarding data, meeting the user requirements and the like
According to the invention, the data forwarding method comprises the following steps:
analyzing the received data packet based on a preset analysis rule to obtain a data field and a load of the data packet, wherein the data field at least comprises protocol header data of the data packet;
screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions;
calculating a target load associated with the target data based on a preset calculation rule to obtain a new load;
recombining the data field and the new payload into a new data packet;
and obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding the new data packet to the forwarding port.
Further, the parsing the received data packet based on the preset parsing rule to obtain a data field and a load of the data packet includes:
and analyzing the data packet layer by layer based on the jump condition among the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained.
Further, the skip condition includes a skip flag bit between adjacent network protocols, and the parsing the data packet layer by layer based on the skip condition between the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained includes:
and starting from the network protocol of the highest layer, identifying a skip zone bit in the network protocol, and skipping to the target network protocol based on the target network protocol represented by the identified skip zone bit to carry out the skip zone bit until the network protocol of the lowest layer is skipped to obtain the data domain and the load of the data packet.
Further, the screening the data field based on the matching condition to obtain target data meeting the matching condition includes:
extracting target data characterized by a target position in the matching condition from the data field;
comparing the target data with example data in the matching condition to obtain a matching identifier, wherein the matching identifier at least has two states, the first state representation is matched, and the second state representation is not matched;
and identifying the matching identifier, and taking the data field as the target data if the matching identifier is in the second state.
Further, the calculating the target load associated with the target data based on the preset calculation rule to obtain a new load includes:
acquiring at least two groups of data to be calculated from the target load based on a data distribution relation specified by a user;
and inputting each group of data to be calculated into an associated calculation function, and calculating based on the calling relation among the functions to obtain the new load.
Further, the reorganizing the data field and the new payload into a new data packet includes:
and splicing the data field and the new load in sequence based on the position and the arrangement relation between the data field and the original load.
Further, the obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, forwarding the new data packet to the forwarding port, includes:
using the network address obtained from the protocol header data as a keyword, and searching a key value associated with the keyword in a preset key value storage system;
and forwarding the new data packet to a forwarding port corresponding to the key value.
According to an embodiment of the present invention, a data forwarding device includes:
the analysis module is used for analyzing the received data packet based on a preset analysis rule to obtain a data field and a load of the data packet, wherein the data field at least comprises protocol header data of the data packet;
the screening module is used for screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions;
the load module is used for calculating the target load associated with the target data based on a preset calculation rule to obtain a new load;
a reorganization module, configured to reorganize the data field and the new payload into a new data packet; and
and the forwarding module is used for obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule and forwarding the new data packet to the forwarding port.
According to an embodiment of the present invention, there is provided an apparatus comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the steps of the data forwarding method as described above.
A storage medium having stored thereon a computer program according to an embodiment of the present invention, which when executed by a processor, implements the steps of the data forwarding method as described above.
The data forwarding method provided by the invention can analyze the received data packet based on the preset analysis rule to obtain the data field and the load of the data packet, wherein the data field at least comprises the protocol header data of the data packet. And then screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions. And calculating the target load associated with the target data based on a preset calculation rule to obtain a new load. The data field and the new payload are reassembled into a new data packet. And obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding a new data packet to the forwarding port. The data forwarding method can forward data according to different data forwarding requirements of users, has the computing capability of data packet load, and can meet the personalized forwarding requirements of the users.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data forwarding method provided in accordance with an exemplary embodiment;
FIG. 2 is a flow chart of data domain screening provided in accordance with an exemplary embodiment;
FIG. 3 is a new load determination flow chart provided in accordance with an exemplary embodiment;
fig. 4 is a block diagram of a data forwarding apparatus provided according to an exemplary embodiment;
fig. 5 is a block diagram of an apparatus provided according to an exemplary embodiment.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, an embodiment of the present invention provides a data forwarding method, which may include the steps of:
101. and analyzing the received data packet based on a preset analysis rule to obtain a data field and a load of the data packet, wherein the data field at least comprises protocol header data of the data packet.
The data packet transmitted in the network can be divided into a message header and a load, wherein a data set extracted from the message header according to a certain rule is a data field, the data field can comprise a protocol header data part to acquire all data, and a user can extract the data according to the need. The extraction user of the data field can acquire the protocol header data required by the user based on the self-defined analysis function, and the invention is not repeated here.
102. And screening the data domain based on the matching condition to obtain target data conforming to the matching condition.
The user can screen the obtained data fields according to the required matching condition, so as to obtain the target data wanted by the user, wherein the data set in the data fields is { a, b, c, d }, but a=1 in some network messages, a=2 in some network messages and the like, and when the condition of the user wanted to screen is a=1, the user only needs to screen the data messages of a=1 in the data fields and then perform subsequent calculation without considering other screening conditions.
103. And calculating the target load associated with the target data based on a preset calculation rule to obtain a new load.
After target data wanted by a user are obtained, target load corresponding to the target data can be calculated according to calculation rules set by the user, and the user can carry out data processing such as logic operation, comparison operation and the like on the load data according to the length of the load to obtain the load data wanted by the user. The calculation is a user-defined function, and the user-defined function comprises an input data format, a calculation method and an output data format. For example, it is defined that the first 4 bytes and the subsequent 4 bytes in the payload are added to obtain a 4-byte calculation result, and the 8 bytes in the original payload are replaced by the calculation result. The condition is defined by user, the data of the data field is taken as input, and the operation rule is defined, if the output 1 indicates that the condition is met, and 0 indicates that the condition is not met.
104. The data field and the new payload are reassembled into a new data packet.
After the load calculation is completed to obtain a new load, splicing the obtained new load and the data field according to the position relation between the message head and the load to obtain a new data packet.
105. And obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding the new data packet to the forwarding port.
The forwarding operation commonly used in the sending of network packets takes some elements in the data domain as input, and performs port lookup in a lookup table (similar to a dictionary structure), and outputs the labels of the ports that need to perform data forwarding, such as 1 port, 2 ports, 3 ports, and the like.
The data forwarding method realizes flexible data packet analysis, user-defined forwarding, in-band aggregation calculation and the like. Compared with the traditional network equipment which can only support the existing standard protocol, the method can meet the personalized requirements of users and enhance the operability of data forwarding colors.
As a possible implementation manner of the foregoing embodiment, the specific process of parsing the received data packet based on the preset parsing rule to obtain the data field and the load of the data packet may include:
and analyzing the data packet layer by layer based on the jump condition among the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained.
The jump condition may include a jump flag bit between adjacent network protocols, and the analyzing the data packet layer by layer based on the jump condition between the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained includes:
and starting from the network protocol of the highest layer, identifying the skip zone bit in the network protocol, and skipping to the target network protocol to carry out the skip zone bit based on the target network protocol represented by the identified skip zone bit until the network protocol of the lowest layer is skipped to obtain the data field and the load of the data packet.
Specifically, the data packet sequentially completes the analysis processing of the data packet according to the jump condition of the protocol tree. According to the subordinate relations among network protocols in each layer in the network structure, the jump zone bit in the layer-by-layer extraction network protocol obtains the network protocol of the next layer to be jumped, which is characterized by the jump zone bit, according to the filling value of the jump zone bit, and further realizes the layer-by-layer jump. For example, the structure of a network is ethernet, virtual local area network, network transmission protocol (IPv 4), and finally Transmission Control Protocol (TCP) and user packet protocol (UDP) at the same level from top to bottom, then the data parsing process may be:
when the ethernet Eth is parsed, when the skip flag bit ethtype=0x9100, the next layer of message protocol is VLAN, and the next step is to skip to VLAN (virtual local area network) for execution.
When ethtype=0x0800, the next layer message protocol is IPv4, and the next step is to skip to IPv4 execution.
When the VLAN is analyzed, when the skip flag bit type=0x0800, the next layer of message protocol is IPv4, and the next step is to skip to IPv4 for execution.
When the IPv4 is resolved, when the skip flag protocol=6, the next layer of message protocol is TCP, and the next step is to skip to TCP for execution.
When the skip flag protocol=17, the next layer of message protocol is UDP, and the next step is to skip to UDP execution.
It will be appreciated that those skilled in the art may select other parsing modes to parse the network protocol as needed, and the present invention is not limited herein.
Referring to fig. 2, in some embodiments of the present invention, the data fields are filtered based on the matching condition to obtain the target data meeting the matching condition, which may include the following steps:
201. target data characterized by target locations in the matching conditions are extracted from the data field.
202. And comparing the target data with example data in the matching condition to obtain a matching identifier, wherein the matching identifier has at least two states, the first state represents that the first state is matched, and the second state represents that the second state is not matched.
203. And identifying the matching identification, and taking the data domain as target data if the matching identification is in the second state.
Specifically, the transmission direction of the data can be determined according to the network address in the data field, and data can be screened according to the transmission direction, for example, the condition of screening the data field is that the data field is sent to the user a, the transmission direction can be used as a screening condition, the transmission direction is respectively used as corresponding matching identifiers, the matching state is characterized, and the network data packet meeting the condition is subjected to subsequent calculation.
Further, referring to fig. 3, calculating the target load associated with the target data based on the preset calculation rule to obtain a new load may include:
301. and acquiring at least two groups of data to be calculated from the target load based on the data distribution relation specified by the user.
302. And inputting each group of data to be calculated into the associated calculation function, and calculating based on the calling relation among the functions to obtain a new load.
Specifically, the calculation of the target load may be performed based on symbolic programming, with the user specifying the input data, calculation steps and methods, and output data in advance. Symbol programming is suitable for processing of data streams and can be used as a custom for network packet processing. For example:
A=Variable('A')
B=Variable('B')
C=B*A
D=C+Constant(1)
#compiles the function
f=compile(D)
d=f(A=np.ones(10),B=np.ones(10)*2)。
the calculation process means that the obtained A and B are added to obtain C, the C and the 1 are added as an input function to obtain D, and then the D is subjected to the next calculation.
Reassembling the data field and the new payload into a new data packet may specifically include:
and splicing the data field and the new load in sequence based on the position and the arrangement relation between the data field and the original load. Because the positions between the data fields and the loads and the respective occupied digits in the same network protocol are determined, the new data is correspondingly filled and spliced to obtain a new data packet.
Further preferably, the obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding the new data packet to the forwarding port includes:
and searching a key value associated with the key word in a preset key value storage system by taking the network address acquired from the protocol header data as the key word.
And then forwarding the new data packet to a forwarding port corresponding to the key value.
The determination of the forwarding port can be performed according to a lookup table, the lookup table is stored in a key-value form, part of data in a data field can be used as a key, and the value can be obtained from the lookup table, and the value contains information of the forwarding port. The forwarding port may be a number, for example, 1-48 is a serial number of the front panel of the switch, and then a corresponding forwarding end can be found according to the corresponding relationship between the forwarding port and the serial number for forwarding.
Referring to fig. 4 based on the same design concept, an embodiment of the present invention further provides a data forwarding device, which may perform each step of the data forwarding method described in the foregoing embodiment, and the device may include:
the parsing module 401 is configured to parse the received data packet based on a preset parsing rule to obtain a data field and a payload of the data packet, where the data field at least includes protocol header data of the data packet.
And a screening module 402, configured to screen the data domain based on the matching condition, so as to obtain target data that meets the matching condition.
The load module 403 is configured to calculate a target load associated with the target data based on a preset calculation rule, so as to obtain a new load.
A reassembly module 404, configured to reassemble the data field and the new payload into a new data packet. And
And the forwarding module 405 is configured to obtain a forwarding port from the protocol header data in the data domain based on a preset forwarding rule, and forward a new data packet to the forwarding port.
The device has the same beneficial effects as the data forwarding method described in the above embodiment when running, and the specific implementation manner of the device can refer to the implementation process of the data forwarding method provided in the above embodiment, and the invention is not repeated here.
The embodiment of the invention shown with reference to fig. 5 also provides an apparatus that may include: a memory 501 and a processor 502.
Wherein the memory 501 is used for storing programs.
A processor 502 for executing the program to implement the steps of the data forwarding method as described above.
Embodiments of the present invention also provide a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the data forwarding method described in the above embodiments.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present invention is not limited by the order of acts, as some steps may, in accordance with the present invention, occur in other orders or concurrently. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
The steps in the method of each embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs, and the technical features described in each embodiment can be replaced or combined.
The modules and the submodules in the device and the terminal of the embodiments of the invention can be combined, divided and deleted according to actual needs.
In the embodiments provided in the present invention, it should be understood that the disclosed terminal, apparatus and method may be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of modules or sub-modules is merely a logical function division, and there may be other manners of division in actual implementation, for example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or modules, which may be in electrical, mechanical, or other forms.
The modules or sub-modules illustrated as separate components may or may not be physically separate, and components that are modules or sub-modules may or may not be physical modules or sub-modules, i.e., may be located in one place, or may be distributed over multiple network modules or sub-modules. Some or all of the modules or sub-modules may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional module or sub-module in the embodiments of the present invention may be integrated in one processing module, or each module or sub-module may exist alone physically, or two or more modules or sub-modules may be integrated in one module. The integrated modules or sub-modules may be implemented in hardware or in software functional modules or sub-modules.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software unit executed by a processor, or in a combination of the two. The software elements may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (4)

1. A data forwarding method, comprising:
analyzing the received data packet based on a preset analysis rule to obtain a data field and a load of the data packet, wherein the data field at least comprises protocol header data of the data packet;
screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions;
calculating a target load associated with the target data based on a preset calculation rule to obtain a new load, wherein the calculation is a user-defined function, and the user-defined function comprises an input data format, a calculation method and an output data format;
recombining the data field and the new payload into a new data packet;
obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, and forwarding the new data packet to the forwarding port;
the data forwarding method realizes flexible data packet analysis, user-defined forwarding and in-band aggregation calculation, and can meet the personalized forwarding requirement of the user compared with the traditional network equipment which can only support the existing standard protocol;
the parsing of the received data packet based on the preset parsing rule to obtain the data field and the load of the data packet includes:
analyzing the data packet layer by layer based on the jump condition among the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained;
the jump condition includes a jump flag bit between adjacent network protocols, and the step of analyzing the data packet layer by layer based on the jump condition between the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained includes:
identifying a skip zone bit in a network protocol from the highest-level network protocol, and skipping to the target network protocol to carry out the skip zone bit based on the target network protocol represented by the identified skip zone bit until the network protocol which is skipped to the lowest-level network protocol obtains the data domain and the load of the data packet;
the step of screening the data field based on the matching condition to obtain target data conforming to the matching condition includes:
extracting target data characterized by a target position in the matching condition from the data field;
comparing the target data with example data in the matching condition to obtain a matching identifier, wherein the matching identifier at least has two states, the first state representation is matched, and the second state representation is not matched;
identifying the matching identifier, and taking the data field as the target data if the matching identifier is in the second state;
the calculating the target load associated with the target data based on the preset calculating rule to obtain a new load includes:
acquiring at least two groups of data to be calculated from the target load based on a data distribution relation specified by a user;
inputting each group of data to be calculated into an associated calculation function, and calculating based on the calling relation among the functions to obtain the new load;
wherein said reorganizing said data field and said new payload into a new data packet comprises:
based on the position and the arrangement relation between the data field and the original load, splicing the data field and the new load in sequence;
the obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, forwarding the new data packet to the forwarding port, includes:
using the network address obtained from the protocol header data as a keyword, and searching a key value associated with the keyword in a preset key value storage system;
and forwarding the new data packet to a forwarding port corresponding to the key value.
2. A data forwarding apparatus, comprising:
the analysis module is used for analyzing the received data packet based on a preset analysis rule to obtain a data field and a load of the data packet, wherein the data field at least comprises protocol header data of the data packet;
the screening module is used for screening the data fields based on the matching conditions to obtain target data conforming to the matching conditions;
the load module is used for calculating the target load associated with the target data based on a preset calculation rule to obtain a new load, wherein the calculation is a user-defined function, and the user-defined function comprises an input data format, a calculation method and an output data format;
a reorganization module, configured to reorganize the data field and the new payload into a new data packet; and
the forwarding module is used for obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule and forwarding the new data packet to the forwarding port;
the data forwarding device realizes flexible data packet analysis, user-defined forwarding and in-band aggregation calculation, and can meet the personalized forwarding requirement of a user compared with the traditional network equipment which can only support the existing standard protocol;
the parsing of the received data packet based on the preset parsing rule to obtain the data field and the load of the data packet includes:
analyzing the data packet layer by layer based on the jump condition among the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained;
the jump condition includes a jump flag bit between adjacent network protocols, and the step of analyzing the data packet layer by layer based on the jump condition between the network protocols of each layer of the data packet until the data field and the load of the data packet under the network protocol of the lowest layer are obtained includes:
identifying a skip zone bit in a network protocol from the highest-level network protocol, and skipping to the target network protocol to carry out the skip zone bit based on the target network protocol represented by the identified skip zone bit until the network protocol which is skipped to the lowest-level network protocol obtains the data domain and the load of the data packet;
the step of screening the data field based on the matching condition to obtain target data conforming to the matching condition includes:
extracting target data characterized by a target position in the matching condition from the data field;
comparing the target data with example data in the matching condition to obtain a matching identifier, wherein the matching identifier at least has two states, the first state representation is matched, and the second state representation is not matched;
identifying the matching identifier, and taking the data field as the target data if the matching identifier is in the second state;
the calculating the target load associated with the target data based on the preset calculating rule to obtain a new load includes:
acquiring at least two groups of data to be calculated from the target load based on a data distribution relation specified by a user;
inputting each group of data to be calculated into an associated calculation function, and calculating based on the calling relation among the functions to obtain the new load;
wherein said reorganizing said data field and said new payload into a new data packet comprises:
based on the position and the arrangement relation between the data field and the original load, splicing the data field and the new load in sequence;
the obtaining a forwarding port from the protocol header data of the data domain based on a preset forwarding rule, forwarding the new data packet to the forwarding port, includes:
using the network address obtained from the protocol header data as a keyword, and searching a key value associated with the keyword in a preset key value storage system;
and forwarding the new data packet to a forwarding port corresponding to the key value.
3. An apparatus, comprising: a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the steps of the data forwarding method according to claim 1.
4. A storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the data forwarding method of claim 1.
CN202210976357.8A 2022-08-15 2022-08-15 Data forwarding method, device, equipment and storage medium Active CN115348340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210976357.8A CN115348340B (en) 2022-08-15 2022-08-15 Data forwarding method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210976357.8A CN115348340B (en) 2022-08-15 2022-08-15 Data forwarding method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115348340A CN115348340A (en) 2022-11-15
CN115348340B true CN115348340B (en) 2024-03-08

Family

ID=83951064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210976357.8A Active CN115348340B (en) 2022-08-15 2022-08-15 Data forwarding method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115348340B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972288A (en) * 2006-09-25 2007-05-30 北京启明星辰信息技术有限公司 A customizable IDS communication method and system
CN107113239A (en) * 2015-02-27 2017-08-29 华为技术有限公司 Bag is obscured and wraps forwarding
CN108141416A (en) * 2016-09-30 2018-06-08 华为技术有限公司 A kind of message processing method, computing device and message process device
WO2018195112A1 (en) * 2017-04-17 2018-10-25 Fractal Industries, Inc. Regulation based switching system for electronic message routing
CN111782140A (en) * 2020-06-18 2020-10-16 杭州安恒信息技术股份有限公司 Network data packet storage method and device, computer equipment and storage medium
CN112437012A (en) * 2020-10-10 2021-03-02 网络通信与安全紫金山实验室 Traffic scheduling method, VNF cluster capacity reduction and expansion method and related device
WO2021082812A1 (en) * 2019-10-28 2021-05-06 华为技术有限公司 Message sending method and first network device
CN113114648A (en) * 2021-04-01 2021-07-13 山东高云半导体科技有限公司 Method and device for realizing encrypted communication
CN114363258A (en) * 2022-03-17 2022-04-15 中国人民解放军国防科技大学 Message processing device
CN114598378A (en) * 2022-02-25 2022-06-07 中国人民解放军63921部队 Spacecraft load data distribution device and method
CN114885047A (en) * 2022-07-12 2022-08-09 之江实验室 Protocol analysis method, system and readable storage medium for programmable network

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972288A (en) * 2006-09-25 2007-05-30 北京启明星辰信息技术有限公司 A customizable IDS communication method and system
CN107113239A (en) * 2015-02-27 2017-08-29 华为技术有限公司 Bag is obscured and wraps forwarding
CN108141416A (en) * 2016-09-30 2018-06-08 华为技术有限公司 A kind of message processing method, computing device and message process device
WO2018195112A1 (en) * 2017-04-17 2018-10-25 Fractal Industries, Inc. Regulation based switching system for electronic message routing
WO2021082812A1 (en) * 2019-10-28 2021-05-06 华为技术有限公司 Message sending method and first network device
CN111782140A (en) * 2020-06-18 2020-10-16 杭州安恒信息技术股份有限公司 Network data packet storage method and device, computer equipment and storage medium
CN112437012A (en) * 2020-10-10 2021-03-02 网络通信与安全紫金山实验室 Traffic scheduling method, VNF cluster capacity reduction and expansion method and related device
CN113114648A (en) * 2021-04-01 2021-07-13 山东高云半导体科技有限公司 Method and device for realizing encrypted communication
CN114598378A (en) * 2022-02-25 2022-06-07 中国人民解放军63921部队 Spacecraft load data distribution device and method
CN114363258A (en) * 2022-03-17 2022-04-15 中国人民解放军国防科技大学 Message processing device
CN114885047A (en) * 2022-07-12 2022-08-09 之江实验室 Protocol analysis method, system and readable storage medium for programmable network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Yue Wu ; Zhiwu Huang ; Hongtao Liao ; Yanhui Zhou ; Yongjie Liu ; Heng Li ; Xiaoyong Zhang ; Jun Peng. An Improved Feed-Forward Load Compensation Method for Hybrid Energy Storage Systems.2019 IEEE Energy Conversion Congress and Exposition (ECCE).2019,全文. *
千兆网络数据包分析过滤采集系统设计;明幼林;吴谨;;信息技术(第09期);全文 *
应用于协议无感知转发交换机的流缓存方法;曹作伟;陈晓;倪宏;叶晓舟;;电子与信息学报(第11期);全文 *

Also Published As

Publication number Publication date
CN115348340A (en) 2022-11-15

Similar Documents

Publication Publication Date Title
Bossert et al. Towards automated protocol reverse engineering using semantic information
CN110381054B (en) Message analysis method, device, equipment and computer readable storage medium
US8417803B2 (en) Interfacing between a command line interface-based application program and a remote network device
US8819286B2 (en) Methods, systems, and apparatus for processing messaging data sets using structured data sets
AU2017345769B2 (en) Systems and methods for scalable network modeling
CN109842629A (en) The implementation method of custom protocol based on protocol analysis frame
CN109714408B (en) Semantic industrial network service interface system based on Handle identification
US10958770B2 (en) Realization of a programmable forwarding pipeline through packet header summaries in a data processing unit
US20110138030A1 (en) Method and System for Creating an Overlay Structure for Management Information Bases
CN115242896B (en) Dynamic message parsing method and device, electronic equipment and computer readable storage medium
CN107483341B (en) Method and device for rapidly forwarding firewall-crossing messages
CN115348340B (en) Data forwarding method, device, equipment and storage medium
US20070064603A1 (en) Method of provisioning network elements to perform a service
US11354491B1 (en) Systems and methods for improved data modeling and translation
CA2523687A1 (en) Communication path analysis
US9191286B2 (en) Adaptive centralized collection of performance management data using a metamodel
CN111680288A (en) Command execution method, device and equipment for container and storage medium
CN115174474B (en) SRv 6-based SFC implementation method and device in private cloud
JP4429173B2 (en) Method and computer system for triggering action based on digital communication data
KR100720190B1 (en) Fast rule lookup with arbitrary ip range configurations
US7792055B2 (en) Method and system for determining the topology of a network
CN115250254B (en) Netflow message distribution processing method and device
CN111614575B (en) Deep packet inspection method, system and storage medium based on internet flow
CN113055287B (en) Data packet processing method and device and computer readable storage medium
US20180248775A1 (en) Certification tool gap analyzer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant