CN113691554A - Method for improving data forwarding performance of network equipment - Google Patents
Method for improving data forwarding performance of network equipment Download PDFInfo
- Publication number
- CN113691554A CN113691554A CN202111018513.1A CN202111018513A CN113691554A CN 113691554 A CN113691554 A CN 113691554A CN 202111018513 A CN202111018513 A CN 202111018513A CN 113691554 A CN113691554 A CN 113691554A
- Authority
- CN
- China
- Prior art keywords
- data
- network
- processing
- data message
- updating
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000001133 acceleration Effects 0.000 claims abstract description 6
- 230000001360 synchronised effect Effects 0.000 claims description 3
- 238000004904 shortening Methods 0.000 abstract description 5
- 238000004891 communication Methods 0.000 abstract description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/30—Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
- H04L63/306—Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information intercepting packet switched data communications, e.g. Web, Internet or IMS communications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Technology Law (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the technical field of communication application, and discloses a method for improving data forwarding performance of network equipment, which comprises the following steps: driving a registration message interceptor to a network card; the network card receives the data message and enters the acceleration module through the interceptor; analyzing the characteristics of the data message, judging whether the data message needs to be quickly forwarded, if so, inquiring a data flow table, updating the data message information, otherwise, entering a TCP/IP protocol stack for processing, and updating the data flow table; and sending the data message. The method for improving the data forwarding performance of the network equipment can improve the network throughput and improve the forwarding performance of the network equipment by shortening the network data message forwarding path.
Description
Technical Field
The invention relates to the technical field of communication application, in particular to a method for improving data forwarding performance of network equipment.
Background
With the rise of short video applications, the requirement of users on network bandwidth is higher and higher, and the data forwarding performance of the network device, which is used as an inlet of traffic, becomes an important factor influencing the internet experience.
At present, most network equipment adopts a Linux operating system, in order to be compatible with all protocols, data forwarding is processed through a Linux TCP/IP protocol stack, and the TCP/IP protocol stack is wide in related range, so that more CPU performance is consumed.
Disclosure of Invention
Technical problem to be solved
Aiming at the defects of the prior art, the invention provides a method for improving the data forwarding performance of network equipment, which has the advantages of improving the network throughput and improving the forwarding performance of the network equipment by shortening the network data message forwarding path, and solves the problem that most of the existing network equipment adopts a Linux operating system, and in order to be compatible with all protocols, data forwarding is processed through a Linux TCP/IP protocol stack, and more CPU performance can be consumed because the TCP/IP protocol stack is wide in related range.
(II) technical scheme
In order to achieve the purposes of improving the network throughput and improving the forwarding performance of network equipment by shortening the network data message forwarding path, the invention provides the following technical scheme: a method for improving data forwarding performance of network equipment comprises the following steps,
s1: driving a registration message interceptor to a network card;
s2: the network card receives the data message and enters the acceleration module through the interceptor;
s3: analyzing the characteristics of the data message, judging whether the data message needs to be rapidly forwarded, if so, executing a step S5 for processing, otherwise, executing a step S4 for processing;
s4: entering a TCP/IP protocol stack for processing, and updating a data flow table;
s5: inquiring a data flow table and updating data message information;
s6: and sending the data message through the network card.
Preferably, the message interceptor in S1 registers in a hook function manner, and is configured to intercept a data message forwarded by a network card driver, where the network card driver includes, but is not limited to, a wired network card, a wireless network card, and a 5G network card, and when the network device includes multiple network cards, the multiple interceptors are synchronously registered.
Preferably, after receiving the data packet, the network card in S2 enters the fast forwarding module through the registered interceptor to process, and marks the source network interface of the data packet.
Preferably, the analyzing the data packet characteristics in S3 specifically includes the following steps:
a1: judging whether the skip buffer has enough ip head space through the pskb _ may _ pull, if the space is insufficient, returning to the protocol stack for processing, and if not, entering the step A2 for processing;
a2: analyzing the header information of the ip layer, judging whether the ip version is correct or not, wherein the ip version number is ipv4 or ipv6, if the version is wrong, returning to the protocol stack for processing, and otherwise, entering the step A3 for processing;
a3: calculating the checksum of the ip header through the ip _ fast _ csum, returning to the protocol stack for processing if the checksum is wrong, and otherwise, entering the step A4 for processing;
a4: analyzing the type of a transport layer protocol, if the protocol is a TCP or UDP protocol, analyzing the information of a source port and a destination port of the transport layer, and if the protocol is not the TCP or UDP protocol, returning the information to a protocol stack for processing;
a5: and the data message enters fast forwarding processing.
Preferably, the TCP/IP stack processing in S4, updating the data flow table specifically includes the following steps:
b1: the data message is driven from the network card to reach a system TCP/IP protocol stack;
b2: after the route is inquired, nat processing is carried out through a netfilter frame, nf _ nat _ packet is finally called to carry out nat rule updating, and the nat rule updating is synchronized to a data flow table of the fast forwarding module through an interceptor;
b3: and when the nat rule of the TCP/IP protocol stack is overtime, synchronously deleting the data flow table of the fast forwarding module through the interceptor.
Preferably, the querying a data flow table in S5, and updating data message information specifically includes the following steps:
c1: acquiring five-tuple (protocol, source ip, destination ip, source port and destination port) of the data message and source network interface information;
c2: hash is carried out through the quintuple and the network interface information, and data flow information corresponding to the data message is inquired;
c3: extracting a destination ip and a destination port of the data stream, updating the destination ip and the destination port into a skip buff, and calculating the checksum of the ip header;
c4: extracting a source mac and a destination mac of the data stream, and updating the source mac and the destination mac into skbbuff;
c5: and extracting a network sending interface and updating the interface into the skbbuff.
Preferably, in S6, the system function dev _ queue _ xmit is called to send the data packet through the destination network interface, where the network interface includes a wired interface and a wireless interface.
(III) advantageous effects
Compared with the prior art, the invention provides a method for improving the data forwarding performance of network equipment, which has the following beneficial effects:
the method for improving the data forwarding performance of the network equipment drives a registration message interceptor to a network card; receiving a data message at a network card, and entering an acceleration module through an interceptor; analyzing the characteristics of the data message, judging whether the data message needs to be rapidly forwarded, if so, inquiring a data flow table, updating data message information for processing, and if not, entering a TCP/IP protocol stack for processing, and updating the data flow table for processing; and then the network card is used for sending the data message, so that the network throughput can be improved and the forwarding performance of the network equipment can be improved by shortening the network data message forwarding path.
Drawings
Fig. 1 is a schematic flow chart of a method for improving data forwarding performance of a network device according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a method for improving data forwarding performance of a network device includes the following steps,
s1: driving a registration message interceptor to a network card;
s2: the network card receives the data message and enters the acceleration module through the interceptor;
s3: analyzing the characteristics of the data message, judging whether the data message needs to be rapidly forwarded, if so, executing a step S5 for processing, otherwise, executing a step S4 for processing;
s4: entering a TCP/IP protocol stack for processing, and updating a data flow table;
s5: inquiring a data flow table and updating data message information;
s6: and sending the data message through the network card.
The message interceptors in S1 are registered in a hook function manner, and are configured to intercept data messages forwarded by a network card driver, where the network card driver includes, but is not limited to, a wired network card, a wireless network card, and a 5G network card, and when the network device includes multiple network cards, the multiple interceptors are synchronously registered.
And after receiving the data message, the network card in the S2 enters the fast forwarding module through the registered interceptor to process, and marks the source network interface of the data message.
The analyzing the data message characteristics in S3 specifically includes the following steps:
a1: judging whether the skip buffer has enough ip head space through the pskb _ may _ pull, if the space is insufficient, returning to the protocol stack for processing, and if not, entering the step A2 for processing;
a2: analyzing the header information of the ip layer, judging whether the ip version is correct or not, wherein the ip version number is ipv4 or ipv6, if the version is wrong, returning to the protocol stack for processing, and otherwise, entering the step A3 for processing;
a3: calculating the checksum of the ip header through the ip _ fast _ csum, returning to the protocol stack for processing if the checksum is wrong, and otherwise, entering the step A4 for processing;
a4: analyzing the type of a transport layer protocol, if the protocol is a TCP or UDP protocol, analyzing the information of a source port and a destination port of the transport layer, and if the protocol is not the TCP or UDP protocol, returning the information to a protocol stack for processing;
a5: and the data message enters fast forwarding processing.
The TCP/IP stack processing in S4, updating the data flow table specifically includes the following steps:
b1: the data message is driven from the network card to reach a system TCP/IP protocol stack;
b2: after the route is inquired, nat processing is carried out through a netfilter frame, nf _ nat _ packet is finally called to carry out nat rule updating, and the nat rule updating is synchronized to a data flow table of the fast forwarding module through an interceptor;
b3: and when the nat rule of the TCP/IP protocol stack is overtime, synchronously deleting the data flow table of the fast forwarding module through the interceptor.
Querying a data flow table in S5, and updating data message information specifically includes the following steps:
c1: acquiring five-tuple (protocol, source ip, destination ip, source port and destination port) of the data message and source network interface information;
c2: hash is carried out through the quintuple and the network interface information, and data flow information corresponding to the data message is inquired;
c3: extracting a destination ip and a destination port of the data stream, updating the destination ip and the destination port into a skip buff, and calculating the checksum of the ip header;
c4: extracting a source mac and a destination mac of the data stream, and updating the source mac and the destination mac into skbbuff;
c5: and extracting a network sending interface and updating the interface into the skbbuff.
And in the step S6, calling a system function dev _ queue _ xmit to send a data message through a destination network interface, wherein the network interface comprises a wired interface and a wireless interface.
In summary, in the method for improving the data forwarding performance of the network device, the registration message interceptor is driven to the network card; receiving a data message at a network card, and entering an acceleration module through an interceptor; analyzing the characteristics of the data message, judging whether the data message needs to be rapidly forwarded, if so, inquiring a data flow table, updating data message information for processing, and if not, entering a TCP/IP protocol stack for processing, and updating the data flow table for processing; and then the network card is used for sending the data message, so that the network throughput can be improved and the forwarding performance of the network equipment can be improved by shortening the network data message forwarding path.
It is to be noted that 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (7)
1. A method for improving data forwarding performance of network equipment is characterized in that: comprises the following steps of (a) carrying out,
s1: driving a registration message interceptor to a network card;
s2: the network card receives the data message and enters the acceleration module through the interceptor;
s3: analyzing the characteristics of the data message, judging whether the data message needs to be rapidly forwarded, if so, executing a step S5 for processing, otherwise, executing a step S4 for processing;
s4: entering a TCP/IP protocol stack for processing, and updating a data flow table;
s5: inquiring a data flow table and updating data message information;
s6: and sending the data message through the network card.
2. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: the message interceptors in S1 are registered in a hook function manner, and are configured to intercept data messages forwarded by a network card driver, where the network card driver includes, but is not limited to, a wired network card, a wireless network card, and a 5G network card, and when the network device includes multiple network cards, the multiple interceptors are synchronously registered.
3. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: and after receiving the data message, the network card in the S2 enters the fast forwarding module through the registered interceptor to process, and marks a source network interface of the data message.
4. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: the analyzing the data packet characteristics in S3 specifically includes the following steps:
a1: judging whether the skip buffer has enough ip header space or not through the pskb _ may _ pull, if the space is insufficient, returning to the protocol stack for processing, and if not, entering the step A2 for processing;
a2: analyzing the header information of the ip layer, judging whether the ip version is correct or not, wherein the ip version number is ipv4 or ipv6, if the version is wrong, returning to the protocol stack for processing, and otherwise, entering the step A3 for processing;
a3: calculating the checksum of the ip header through the ip _ fast _ csum, returning to the protocol stack for processing if the checksum is wrong, and otherwise, entering the step A4 for processing;
a4: analyzing the type of a transport layer protocol, if the protocol is a TCP or UDP protocol, analyzing the information of a source port and a destination port of the transport layer, and if the protocol is not the TCP or UDP protocol, returning the information to a protocol stack for processing;
a5: and the data message enters fast forwarding processing.
5. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: the TCP/IP protocol stack processing in S4, updating the data flow table specifically includes the following steps:
b1: the data message is driven from the network card to reach a system TCP/IP protocol stack;
b2: after the route is inquired, nat processing is carried out through a netfilter frame, nf _ nat _ packet is finally called to carry out nat rule updating, and the nat rule updating is synchronized to a data flow table of the fast forwarding module through an interceptor;
b3: and when the nat rule of the TCP/IP protocol stack is overtime, synchronously deleting the data flow table of the fast forwarding module through the interceptor.
6. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: the querying a data flow table in S5, and updating data message information specifically includes the following steps:
c1: acquiring five-tuple (protocol, source ip, destination ip, source port and destination port) of the data message and source network interface information;
c2: hash is carried out through the quintuple and the network interface information, and data flow information corresponding to the data message is inquired;
c3: extracting a destination ip and a destination port of the data stream, updating the destination ip and the destination port into a skip buff, and calculating the checksum of the ip header;
c4: extracting a source mac and a destination mac of the data stream, and updating the source mac and the destination mac into a skb buff;
c5: and extracting a network sending interface and updating the interface into the skb buff.
7. The method of claim 1, wherein the method for improving data forwarding performance of the network device comprises: and in the step S6, calling a system function dev _ queue _ xmit to send the data packet through a destination network interface, where the network interface includes a wired interface and a wireless interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111018513.1A CN113691554A (en) | 2021-09-01 | 2021-09-01 | Method for improving data forwarding performance of network equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111018513.1A CN113691554A (en) | 2021-09-01 | 2021-09-01 | Method for improving data forwarding performance of network equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113691554A true CN113691554A (en) | 2021-11-23 |
Family
ID=78584644
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111018513.1A Pending CN113691554A (en) | 2021-09-01 | 2021-09-01 | Method for improving data forwarding performance of network equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113691554A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016391A (en) * | 2022-12-29 | 2023-04-25 | 天翼云科技有限公司 | Message forwarding method and system based on NAT gateway |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957600A (en) * | 2011-08-19 | 2013-03-06 | 中兴通讯股份有限公司 | Method and device for data message forwarding |
CN103347014A (en) * | 2013-06-25 | 2013-10-09 | 深圳市共进电子股份有限公司 | Network fast forwarding module and network fast forwarding achieving method |
CN109587082A (en) * | 2019-01-10 | 2019-04-05 | 烽火通信科技股份有限公司 | A kind of asynchronous repeater system of message based on (SuSE) Linux OS and method |
CN110278225A (en) * | 2018-03-15 | 2019-09-24 | 中兴通讯股份有限公司 | Message processing method, device and equipment, computer readable storage medium |
CN110300081A (en) * | 2018-03-21 | 2019-10-01 | 大唐移动通信设备有限公司 | A kind of method and apparatus of data transmission |
CN111404817A (en) * | 2020-03-24 | 2020-07-10 | 深圳市吉祥腾达科技有限公司 | Method and system for improving fragment data packet forwarding performance of network communication equipment |
-
2021
- 2021-09-01 CN CN202111018513.1A patent/CN113691554A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957600A (en) * | 2011-08-19 | 2013-03-06 | 中兴通讯股份有限公司 | Method and device for data message forwarding |
CN103347014A (en) * | 2013-06-25 | 2013-10-09 | 深圳市共进电子股份有限公司 | Network fast forwarding module and network fast forwarding achieving method |
CN110278225A (en) * | 2018-03-15 | 2019-09-24 | 中兴通讯股份有限公司 | Message processing method, device and equipment, computer readable storage medium |
CN110300081A (en) * | 2018-03-21 | 2019-10-01 | 大唐移动通信设备有限公司 | A kind of method and apparatus of data transmission |
CN109587082A (en) * | 2019-01-10 | 2019-04-05 | 烽火通信科技股份有限公司 | A kind of asynchronous repeater system of message based on (SuSE) Linux OS and method |
CN111404817A (en) * | 2020-03-24 | 2020-07-10 | 深圳市吉祥腾达科技有限公司 | Method and system for improving fragment data packet forwarding performance of network communication equipment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116016391A (en) * | 2022-12-29 | 2023-04-25 | 天翼云科技有限公司 | Message forwarding method and system based on NAT gateway |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015074324A1 (en) | Data packet express forwarding method and apparatus | |
JP4627669B2 (en) | Packet transfer apparatus and transfer control method thereof | |
EP3958521A1 (en) | Method and apparatus for providing service for service flow | |
US7200116B2 (en) | Communication device and method, and system | |
US10742777B2 (en) | UDP protocol acceleration method and system | |
EP1924028B1 (en) | Method and system for providing qos service | |
CN102571613B (en) | Method and network device for message forwarding | |
CN103532672A (en) | Processing method of disordered fragmentation messages in SDN and application | |
US10015091B2 (en) | Method of low-bandwidth data transport | |
RU2005136879A (en) | SOURCE ID FOR FINDING A MAC ADDRESS | |
CN102143035A (en) | Data traffic processing method, network device and network system | |
US8320249B2 (en) | Method and system for controlling network access on a per-flow basis | |
EP1865681A1 (en) | A method for traversing the network address conversion/firewall device | |
CN105591989B (en) | Chip implementation method for uploading protocol message to CPU | |
EP2830265A1 (en) | Control device, communication device, communication system, communication method, and program | |
WO2012083704A1 (en) | Method and system for updating border gateway protocol routes | |
US20080192740A1 (en) | Processing Realtime Media Streams | |
CN111866202B (en) | Message sending method and device, electronic equipment and storage medium | |
WO2012159525A1 (en) | Service control method and system for autonomous network | |
US8934489B2 (en) | Routing device and method for processing network packet thereof | |
EP3534575A1 (en) | Method for identifying single packet, and traffic guiding method | |
CN113691554A (en) | Method for improving data forwarding performance of network equipment | |
JP3950895B2 (en) | Communication system and communication method | |
US20090141712A1 (en) | Router device | |
JP2022120845A5 (en) |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20211123 |
|
WD01 | Invention patent application deemed withdrawn after publication |