Simple protocol stack realized based on DPDK and order preserving method
By designing a simple protocol stack and order-preserving method in the DPDK scenario, the private protocol traffic carried by UDP is solved, and the efficiency bottleneck of general equipment is solved when processing special equipment protocol traffic, and the orderly processing of private protocol traffic and the improvement of network connectivity efficiency is achieved.
Patent Information
- Application Number
- CN202311256494.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-28
AI Technical Summary
In the DPDK scenario, it is difficult for the prior art to effectively process and adapt the UDP bearer of dedicated equipment to private protocol traffic, resulting in users facing bottlenecks in network connectivity and data processing efficiency when using general-purpose equipment.
A simple protocol stack and order-saving method based on DPDK are designed to realize protocol identification and response through the IP address provided by the configuration file, and the characteristic fields in UDP traffic are processed through lock-free arrays and port hash tables to ensure the order of messages, and finally implement order-saving function in the DPDK framework.
It realizes orderly processing of private protocol traffic, meets users' network traffic processing needs for dedicated equipment, improves network connectivity efficiency, and provides a modular usage solution in various data-plan software-defined network applications.
Smart Images

Figure CN119728795A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to a simple protocol stack and an order preservation method based on DPDK. Background Art
[0002] With the rapid development of network technology, the network has penetrated into thousands of households, bringing many conveniences to people's work and life. At present, in mainstream applications, the main network devices basically use Intel's DPDK technology, which uses user-mode, polling mode network card driver (PMD) to implement the packet processing process, greatly improving the packet processing performance of the processor. However, as the application scenarios people need continue to increase and become increasingly complex, no interruption, zero copy, save a lot of time, greatly improve the ability of general servers to handle network loads, and meet the performance requirements of high-speed network cards. However, in actual applications, business requirements are ever-changing and increasingly complex, and the performance improvement of general-purpose devices has entered a bottleneck period, and it is increasingly unable to meet the needs of users. Especially in the scenario where users use customized special equipment, the processing strategy of general-purpose equipment for private protocol traffic specified by users cannot meet the actual needs of special equipment, which seriously affects the work efficiency and results of users. Therefore, the existing implementation scheme can no longer meet the needs of most customers, and there is an urgent need to adapt the protocol traffic processing method of special equipment. To solve this problem, how to achieve network connectivity in the DPDK scenario and orderly process private protocol traffic carried by UDP is a difficult point. Summary of the invention
[0003] To solve the above problems, the present invention proposes a simple protocol stack and order preservation method based on DPDK. According to the IP address provided by the configuration file, the protocol identification, extraction and matching of the input traffic are realized, and the passive response reply message is realized for the ARP or ICMP request message matching the IP. The reply message flips the source MAC and destination MAC of the request message, and the source MAC is filled with the MAC address configured in the configuration file, thereby realizing a simple protocol stack for basic network connectivity status response in DPDK; according to the user-provided multiple destination port information and the total number of sequence numbers specified by the private protocol, the lock-free array of the total number of sequence numbers is applied to correspond to the port hash table, and the two-byte feature field at a specific position of the payload of the private protocol traffic carried by UDP entering the DPDK network port is extracted. The feature field identifies the order of the message, and the feature field is stored as an array subscript in the input message, and a thread for sorting multiple streams is opened, and the sequential messages stored in the lock-free array are obtained in turn and put into the packet fetching queue applied by the upper-layer application, thereby realizing the order preservation function based on the DPDK framework.
[0004] The specific steps are as follows: Step 1: A simple protocol stack and order preservation method based on DPDK include a simple protocol stack module and a UDP order preservation module. The simple protocol stack module implements basic network connectivity status response so that the peer server can address and forward private protocol traffic carried by UDP. The UDP order preservation module implements the order preservation function based on the DPDK framework.
[0005] Step 2: The simple protocol stack module loads the IP and MAC addresses in the configuration file, completes the response to the ARP / ICMP addressing request of the peer server, and the peer server is successfully addressed and forwards the private protocol traffic carried by UDP. The UDP order preservation module applies for a lock-free array with a total size of multiple sequence numbers that corresponds one-to-one to multiple ports in the hash table, and extracts a two-byte feature field at a specific position of the payload of the private protocol traffic carried by UDP. This feature field identifies the order of the message.
[0006] Step 2: The simple protocol stack module loads the IP and MAC addresses in the configuration file, completes the response to the ARP / ICMP addressing request of the peer server, and the peer server is successfully addressed and forwards the private protocol traffic carried by UDP. The UDP order preservation module applies for a lock-free array with a total size of multiple sequence numbers that corresponds one-to-one to multiple ports in the hash table, and extracts a two-byte feature field at a specific position of the payload of the private protocol traffic carried by UDP. This feature field identifies the order of the message.
[0007] Step 4: Set the maximum number of delays, open a thread for sorting multiple flows, and the sorting thread determines in turn whether the value corresponding to the lock-free array consumption index subscript is empty. When the value is empty, if the number of productions minus the number of consumptions is greater than the maximum number of delays, the consumption index is incremented and the message with the sequence number is discarded, otherwise the sorting thread processes other flows added to the hash table. When the value is not empty, sequential messages stored in the lock-free array of multiple flows are obtained in turn, the number of consumptions is incremented, and the messages are placed in the packet fetching queue of multiple flows requested by the upper-layer application, so that the upper-layer application can extract traffic in order according to the port keyword.
[0008] Compared with the prior art, the technical solution of the present invention has the following significant beneficial effects: 1. The system can process private protocol traffic in an orderly manner according to customer needs, which is convenient and fast.
[0009] 2. Implement DPDK hardware acceleration while ensuring network connectivity.
[0010] 3. Convenient for modular use in various data plane software-defined network applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings are not intended to be drawn to scale. In the drawings, each identical or nearly identical component shown in various figures may be represented by the same reference numeral. For clarity, not every component is labeled in every figure. Embodiments of various aspects of the present invention will now be described by way of example and with reference to the accompanying drawings, in which: Figure 1 It is an overall flow chart of a simple protocol stack and an order preservation method implemented based on DPDK of the present invention.
[0012] Figure 2 The present invention is a simple protocol stack based on DPDK and an order-preserving method. DETAILED DESCRIPTION
[0013] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0014] Combination Figure 1 Overall flow chart and Figure 2 Schematic diagram of the order preservation process. The present invention proposes a simple protocol stack and order preservation method based on DPDK. According to the IP address provided by the configuration file, the protocol identification, extraction and matching of the input traffic are realized, and a passive response reply message is realized for the ARP or ICMP request message matching the IP. The reply message flips the source MAC and destination MAC of the request message, and the source MAC is filled with the MAC address configured in the configuration file, thereby realizing a simple protocol stack for basic network connectivity status response in DPDK; according to the user-provided multiple destination port information and the total number of sequence numbers specified by the private protocol, a lock-free array of the total number of sequence numbers is applied for to correspond to the port hash table, and a two-byte feature field at a specific position of the payload is extracted for the private protocol traffic carried by UDP entering the DPDK network port. The feature field identifies the order of the message, and the feature field is stored in the input message as an array subscript, and a thread for sorting multiple streams is opened, and the sequential messages stored in the lock-free array are obtained in turn and put into the packet fetching queue applied for by the upper-layer application, thereby realizing the order preservation function based on the DPDK framework.
[0015] This solution effectively solves the problem of network connectivity and orderly processing of private protocol traffic carried by UDP in the DPDK scenario, and can process network traffic based on user-customized dedicated equipment.
[0016] The specific steps of this embodiment are as follows: Step 1: A simple protocol stack and order preservation method based on DPDK include a simple protocol stack module and a UDP order preservation module. The simple protocol stack module implements basic network connectivity status response so that the peer server can address and forward private protocol traffic carried by UDP. The UDP order preservation module implements the order preservation function based on the DPDK framework.
[0017] Step 2: The simple protocol stack module loads the IP and MAC addresses in the configuration file, completes the response to the ARP / ICMP addressing request of the peer server, and the peer server is successfully addressed and forwards the private protocol traffic carried by UDP. The UDP order preservation module applies for a lock-free array with a total size of multiple sequence numbers that corresponds one-to-one to multiple ports in the hash table, and extracts a two-byte feature field at a specific position of the payload of the private protocol traffic carried by UDP. This feature field identifies the order of the message.
[0018] Step 3: Get the UDP destination port information, use the port as the keyword to query the hash table to see if the flow exists. If it does exist, use the characteristic field as the array subscript to store the input message, and the production times are incremented.
[0019] Step 4: Set the maximum number of delays, open a thread for sorting multiple flows, and the sorting thread determines in turn whether the value corresponding to the lock-free array consumption index subscript is empty. When the value is empty, if the number of productions minus the number of consumptions is greater than the maximum number of delays, the consumption index is incremented and the message with the sequence number is discarded, otherwise the sorting thread processes other flows added to the hash table. When the value is not empty, sequential messages stored in the lock-free array of multiple flows are obtained in turn, the number of consumptions is incremented, and the messages are placed in the packet fetching queue of multiple flows requested by the upper-layer application, so that the upper-layer application can extract traffic in order according to the port keyword.
[0020] Various aspects of the present invention are described in this disclosure with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present disclosure are not necessarily defined to include all aspects of the present invention. It should be understood that the various concepts and embodiments introduced above, as well as those described in more detail below, can be implemented in any of many ways, because the concepts and embodiments disclosed by the present invention are not limited to any implementation. In addition, some aspects disclosed by the present invention can be used alone, or in any appropriate combination with other aspects disclosed by the present invention.
[0021] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.
Claims
1. A simple protocol stack and order preservation method based on DPDK, characterized in that: The function implements protocol identification, extraction and matching of input traffic according to the IP address provided by the configuration file, implements passive response reply message for ARP or ICMP request message matching the IP, and the reply message flips the source MAC and destination MAC of the request message, and fills in the MAC address configured in the configuration file with the source MAC, thereby implementing a simple protocol stack for basic network connectivity status response in DPDK; according to the user-provided multiple destination port information and the total number of sequence numbers specified by the private protocol, applies for a lock-free array of the total number size corresponding to the port hash table, extracts a two-byte feature field at a specific position of the payload for the private protocol traffic carried by UDP entering the DPDK network port, the feature field identifies the order of the message, and stores the feature field as an array subscript in the input message, opens a thread for sorting multiple streams, and sequentially obtains the sequential messages stored in the lock-free array and puts them into the packet fetching queue applied for by the upper-layer application, thereby implementing the order preservation function based on the DPDK framework.
2. According to the simplified protocol stack and order preservation method based on DPDK according to claim 1, the specific steps are as follows: Step 1: A simple protocol stack and order preservation method based on DPDK includes a simple protocol stack module and a UDP order preservation module. The simple protocol stack module implements basic network connectivity status response so that the peer server can address and forward private protocol traffic carried by UDP. The UDP order preservation module implements the order preservation function based on the DPDK framework. Step 2: The simple protocol stack module loads the IP and MAC addresses in the configuration file, completes the response to the ARP / ICMP addressing request of the peer server, the peer server is successfully addressed and forwards the private protocol traffic carried by UDP, the UDP order preservation module applies for a lock-free array of the total number size corresponding to multiple ports in the hash table, and extracts a two-byte feature field at a specific position of the payload of the private protocol traffic carried by UDP, which identifies the order of the message; Step 3: Get the UDP destination port information, use the port as the keyword to query whether the flow exists in the hash table, if it exists, store the characteristic field as the array subscript into the input message, and increase the number of production times; Step 4: Set the maximum number of delays, open a thread for sorting multiple flows, and the sorting thread determines in turn whether the value corresponding to the lock-free array consumption index subscript is empty. When the value is empty, if the number of productions minus the number of consumptions is greater than the maximum number of delays, the consumption index is incremented and the message with the sequence number is discarded, otherwise the sorting thread processes other flows added to the hash table. When the value is not empty, sequential messages stored in the lock-free array of multiple flows are obtained in turn, the number of consumptions is incremented, and the messages are placed in the packet fetching queue of multiple flows requested by the upper-layer application, so that the upper-layer application can extract traffic in order according to the port keyword.