RoCE Flow Control Method Based on Protocol Stack
By building a RoCE traffic control system based on the protocol stack, network traffic control for different applications is realized, and the problem that hardware traffic control algorithms in the prior art cannot perceive applications is solved, effectively avoiding network congestion and packet loss.
Patent Information
- Application Number
- CN202510470526.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-04-15
AI Technical Summary
The network traffic control algorithm implemented by hardware in the existing RoCE network cannot perceive applications, resulting in the inability to control network traffic for specific applications, and the inability to effectively avoid network congestion and packet loss.
By building a RoCE traffic control system based on the protocol stack, including a work request reception and analysis module, a work request sending control module, a work request sending module, a work request sending module, a current sending data update module and a current sending data clearing module, network traffic control for different applications is realized.
It realizes network traffic control for different applications, solves the problem that hardware traffic control algorithm cannot perceive applications, and effectively avoids network congestion and packet loss.
Smart Images

Figure CN119996329B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and particularly to a RoCE traffic control method based on a protocol stack. Background Art
[0002] The RoCE network is an Ethernet-based RDMA (Remote Direct Memory Access) network. The performance indicators such as the end-to-end delay and CPU resource utilization rate of the RoCE network are comparable to those of the Infiniband network, but its deployment cost is much lower than that of the Infiniband network. Therefore, it has been widely deployed and applied in data center networks for application scenarios such as AI and supercomputing that have high requirements for network latency and CPU utilization.
[0003] Currently, the network traffic control algorithms in the RoCE network field mainly include priority-based flow control (PFC), bandwidth delay product-based flow control (BDP-FC), credit-based flow control, and traffic dynamic programming algorithms.
[0004] The above algorithms are all implemented through hardware logic in the network card, and have the disadvantages of high resource consumption, high implementation cost, long development cycle, and inflexible algorithms. At the same time, since the network card cannot perceive the processes in the operating system, the network traffic control algorithms implemented in the network card can only perform traffic control based on network status and limited traffic priorities, and cannot perform network traffic control for specific application programs.
[0005] Therefore, it is an urgent problem for those skilled in the art to provide a RoCE traffic control method based on a protocol stack that can implement network traffic control for different application programs and avoid network congestion and packet loss. Summary of the Invention
[0006] The purpose of the present invention is to provide a RoCE traffic control method based on a protocol stack, which has clear logic, is safe, effective, reliable, and easy to operate, can implement network traffic control for different application programs, solve the problem that the hardware network traffic control algorithm in the network card cannot perceive the application, and effectively avoid network congestion and packet loss.
[0007] Based on the above purpose, the technical solution provided by the present invention is as follows:
[0008] The RoCE traffic control method based on a protocol stack includes the following steps:
[0009] Construct a RoCE traffic control system based on the protocol stack, which consists of a work request receiving and parsing module, a work request sending control module, a work request sending module, a current sent data volume updating module, and a current sent data volume clearing module;
[0010] The work request receiving and parsing module receives the work requests of the application program, parses the work requests to obtain the work request data size and the work request process ID;
[0011] The work request sending control module determines whether to send the work request according to the work request data size, the work request process ID, the current sent data volume of the work request process ID, and the preset maximum sent data volume per period;
[0012] If the judgment result is yes, the work request sending module sends the work request to the RoCE network card;
[0013] Before the work request sending module sends the work request to the RoCE network card, it further includes:
[0014] The current sent data volume updating module adds the work request data size to the current sent data volume of the process ID to update the current sent data volume of the process ID;
[0015] The current sent data volume clearing module clears the current sent data volume of different process IDs according to a preset period.
[0016] Preferably, the work request receiving and parsing module receives the work requests of the application program, parses the work requests to obtain the corresponding data size and process ID of the work requests, specifically:
[0017] The work request receiving and parsing module receives the work requests sent by the application program, and parses the work requests according to the RoCE network protocol stack data format to obtain the corresponding data size and process ID of the work requests.
[0018] Preferably, the work request sending control module determines whether to send the work request according to the work request data size, the work request process ID, the current sent data volume of the work request process ID, and the preset maximum sent data volume per period, specifically:
[0019] Judge whether the sum of the current sent data volume of the process ID and the work request data size is greater than the preset maximum sent data volume per period of the process ID;
[0020] If so, discard the work request;
[0021] If not, send the work request.
[0022] The RoCE flow control method based on the protocol stack provided by the present invention is specifically to construct a RoCE network flow control system composed of a work request receiving and parsing module, a work request sending control module, a work request sending module, a current sending data amount updating module and a current sending data amount clearing module. The application sends a work request to the RoCE network flow control system. After receiving the work request of the application, the work request receiving and parsing module parses the work request to obtain the data size and process ID corresponding to the work request; the work request sending control module receives the data size and the process ID, reads the current sending data amount of the process ID from the current sending data amount updating module, and determines whether to send the work request according to the data size, the current sending data amount of the process ID and the preset period maximum sending data amount of the process ID. If the judgment result is yes, the work request is sent to the work request sending module, and the work request sending module receives and sends the work request to the RoCE network card; before sending the work request, the work request sending module updates the current sending data amount of the process ID by the current sending data amount updating module; the current sending data amount clearing module clears the current sending data amounts of all process IDs according to the preset period.
[0023] Compared with the prior art, the present invention can realize network traffic control for different applications, solve the problem that the network traffic control algorithm implemented by the hardware in the network card cannot perceive the application, and pre-plan the network traffic distribution by this method, which can effectively avoid network congestion and packet loss. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flow chart of a RoCE traffic control method based on a protocol stack provided in an embodiment of the present invention;
[0026] Figure 2 A schematic diagram of the structure of a RoCE traffic control system based on a protocol stack provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0028] The embodiments of the present invention are written in a progressive manner.
[0029] The embodiments of the present invention provide a RoCE traffic control method based on a protocol stack, mainly solving the technical problem that in the prior art, the network traffic control algorithm implemented by network card hardware cannot perceive applications, resulting in network congestion and packet loss.
[0030] The RoCE traffic control method based on a protocol stack includes the following steps:
[0031] S1. Construct a RoCE traffic control system based on a protocol stack, which consists of a work request receiving and parsing module, a work request sending control module, a work request sending module, a current transmission data volume updating module, and a current transmission data volume clearing module;
[0032] S2. The work request receiving and parsing module receives the work request of the application program and parses the work request to obtain the work request data size and the work request process ID;
[0033] S3. The work request sending control module determines whether to send the work request according to the work request data size, the work request process ID, the current transmission data volume of the work request process ID, and the preset maximum transmission data volume per period;
[0034] S4. If the judgment result is yes, the work request sending module sends the work request to the RoCE network card;
[0035] Before the work request sending module sends the work request to the RoCE network card, it further includes:
[0036] The current transmission data volume updating module adds the work request data size to the current transmission data volume of the process ID to update the current transmission data volume of the process ID;
[0037] The current transmission data volume clearing module clears the current transmission data volume of different process IDs according to a preset period.
[0038] In step S1, a RoCE network traffic control system is constructed. This system runs on the RoCE network end system and is deployed together with the RoCE network protocol stack. In this system, there are a work request receiving and parsing module, a work request sending control module, a work request sending module, a current transmission data volume updating module, and a current transmission data volume clearing module;
[0039] In steps S2 to S4, the work request receiving and parsing module receives the work request from the application program, parses the work request to obtain the corresponding work request data size and work request process ID; queries the system configuration to obtain the current transmission data volume corresponding to the work request process ID and the preset maximum transmission data stream per period, and determines whether to send the work request; if the determination result is yes, it sends the work request to the work request sending module, and the work request sending module receives and sends the work request to the RoCE network card;
[0040] Before the work request sending module sends the work request, the current transmission data volume updating module adds the work request data size to the current transmission data volume of the process ID as the new current transmission data volume of the process ID for data volume update; after the update is completed, the current transmission data volume clearing module clears the current transmission data volume of all process IDs according to the preset period.
[0041] Preferably, step S2 is specifically:
[0042] The work request receiving and parsing module receives the work request sent by the application program, and parses the work request according to the RoCE network protocol stack data format to obtain the data size and process ID corresponding to the work request.
[0043] In the actual operation process, the work request receiving and parsing module receives the work request sent by the application program, parses the work request according to the RoCE network protocol stack data format (refer to https: / / github.com / linux-rdma / rdma-core.git), and extracts the corresponding data size and process ID from the work request.
[0044] Preferably, step S3 is specifically:
[0045] Determine whether the sum of the current transmission data volume of the process ID and the work request data size is greater than the preset maximum transmission data volume per period of the process ID;
[0046] If so, discard the work request;
[0047] If not, send the work request.
[0048] In the actual application process, the work request sending control module sums up the current data sending amount of the process ID and the traffic data size, and compares the summation result with the preset maximum data sending amount of the process ID. If the summation result is greater than the preset maximum data sending amount of the process ID, the corresponding work request is discarded; if it is less than the maximum data sending amount of the process ID, the work request is sent.
[0049] In the embodiments provided in the present application, it should be understood that the disclosed method can be implemented in other ways. The system embodiments described above are only illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0050] In addition, in each embodiment of the present invention, each functional module can be entirely integrated in a processor, or each module can be separately used as a device, or two or more modules can be integrated in a device; each functional module in each embodiment of the present invention can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0051] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed through program instructions and related hardware. The foregoing program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, the steps including the above method embodiments are executed; and the foregoing storage medium includes: various media such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical discs that can store program codes.
[0052] It should be understood that in the present application, if "system", "device", "unit", and / or "module" are used, it is only a method for distinguishing different components, elements, parts, portions, or assemblies at different levels. However, if other words can achieve the same purpose, that word can be replaced by other expressions.
[0053] As shown in this application and the claims, unless the context clearly indicates otherwise, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. A method or device may also include other steps or elements. An element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, product, or device that includes the element.
[0054] If a flowchart is used in this application, the flowchart is used to illustrate the operations performed by the system according to the embodiments of this application. It should be understood that the operations before or after may not necessarily be executed precisely in sequence. On the contrary, the steps can be processed in reverse order or simultaneously. At the same time, other operations can also be added to these processes, or one or several steps can be removed from these processes.
[0055] The above has introduced in detail the RoCE flow control method based on the protocol stack provided by the present invention. The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A RoCE flow control method based on a protocol stack, characterized in that: The steps include: Construct a RoCE traffic control system based on the protocol stack, which consists of a work request receiving and parsing module, a work request sending control module, a work request sending module, a current sending data volume update module, and a current sending data volume clearing module; The work request receiving and parsing module receives a work request from an application program, and parses the work request to obtain a work request data size and a work request process ID; The work request sending control module determines whether to send the work request according to the work request data size, the work request process ID, the current sending data volume of the work request process ID and the preset periodic maximum sending data volume; If the judgment result is yes, the work request sending module sends the work request to the RoCE network card; Before the work request sending module sends the work request to the RoCE network card, it also includes: The current sending data amount updating module adds the current sending data amount of the process ID to the work request data size to update the current sending data amount of the process ID; The current sending data volume clearing module clears the current sending data volume of different process IDs according to a preset period.
2. The RoCE flow control method based on the protocol stack as claimed in claim 1, characterized in that: The work request receiving and parsing module receives a work request from an application program and parses the work request to obtain a data size and a process ID corresponding to the work request, specifically: The work request receiving and parsing module receives a work request issued by an application, and parses the work request according to the RoCE network protocol stack data format to obtain a data size and a process ID corresponding to the work request.
3. The RoCE flow control method based on the protocol stack as claimed in claim 1, characterized in that: The work request sending control module determines whether to send the work request according to the work request data size, the work request process ID, the current sending data volume of the work request process ID, and the preset periodic maximum sending data volume, specifically: Determine whether the sum of the current sending data volume of the process ID and the work request data size is greater than the preset periodic maximum sending data volume of the process ID; If so, discard the work request; If not, the work request is sent.
Citation Information
Patent Citations
RDMA (Remote Direct Memory Access) service quality assurance method and system for multiple application scenes of data center
CN114124830A
Network flow control method of RDMA (Remote Direct Memory Access) network card and related device
CN119544628A