Intelligent network card-oriented four-layer load balancer acceleration method and system
By introducing priority control and aging engine into the four-layer load balancer accelerated intelligent network card, the problem of untimely unloading in heavy load scenarios is solved, and the forwarding performance is improved.
Patent Information
- Application Number
- CN202311059768.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2043-08-22
AI Technical Summary
In heavy load scenarios, the existing four-layer load balancer based on intelligent network card acceleration may have problems of untimely unloading for long-flows, affecting the overall forwarding performance.
Adopting the idea of priority control, by setting the priority queue and aging engine in the unloading engine, the execution order of the unloading is controlled according to the length of the flow, ensuring that long-term flow is preferred unloaded.
In heavy load scenarios, by prioritizing the unloading of long streams, the forwarding performance of the four-layer load balancer is significantly improved, avoiding the problem of untimely unloading of long streams.
Smart Images

Figure CN119520434A_ABST
Abstract
Description
Technical Field
[0001] The invention designs a method and system for accelerating a four-layer load balancer based on an intelligent network card, and belongs to the field of computer networks. Background Art
[0002] The four-layer load balancer is located between the user and the application server. It distributes requests to different application servers based on the transport layer information of the network data packet, thereby improving network throughput and reducing network latency, thereby providing users with high-quality network services.
[0003] A smart network card is a network device that can provide programmable and configurable hardware acceleration units to improve forwarding performance and reduce CPU load. Various functions such as network virtualization, load balancing, security encryption, and deep packet inspection can be performed on the smart network card.
[0004] The forwarding performance of the layer-4 load balancer can be improved by offloading the packet processing rules that the layer-4 load balancer needs to execute to the smart network card. When using the smart network card to accelerate the layer-4 load balancer, the destination address allocation must be completed in the control plane when facing a new network data packet. After the allocation is completed, the corresponding packet processing rules are offloaded to the smart network card, and the smart network card quickly forwards the subsequent traffic.
[0005] Most of the existing intelligent network card-based acceleration methods directly unload the corresponding packet processing rules after completing the destination address allocation. When facing a large number of new connections (hereinafter referred to as heavy load scenarios), this type of method may cause the generation speed of the rules to be unloaded to exceed the speed of rule unloading. At the same time, each flow is also divided into long flows and short flows (generally, flows with a large number of packets are considered long flows, and flows with a small number of packets are considered short flows). The existing four-layer load balancer based on intelligent network card acceleration may have the problem of untimely unloading of long flows in heavy load scenarios, which in turn affects the overall forwarding performance of the four-layer load balancer. Summary of the invention
[0006] In response to the above problems, the present invention provides a method and system for accelerating the unloading of a four-layer load balancer in heavy load scenarios with a large number of newly created connections. The method adopts the idea of priority control and controls the execution order of unloading according to the length of the flow, thereby improving the forwarding performance of the four-layer load balancer in heavy load scenarios.
[0007] The technical solution adopted by the present invention is as follows:
[0008] A method for accelerating a four-layer load balancer for a smart network card comprises the following steps:
[0009] The Smart NIC and its corresponding x86 server are used as the data plane to jointly handle the packet processing and forwarding tasks of the Layer 4 load balancer;
[0010] The flow table is managed on the control plane, which determines whether network traffic is processed by the Smart NIC or on the x86 server corresponding to the Smart NIC.
[0011] Furthermore, the smart network card includes a matching operation unit. The network traffic first reaches the smart network card. If there is a processing rule for the traffic in the matching operation unit, it is processed and forwarded on the smart network card. Otherwise, it is processed and forwarded on the x86 server corresponding to the network card.
[0012] Furthermore, the data plane processes the network traffic by the following steps:
[0013] When traffic arrives, it first enters the matching operation unit of the smart network card for matching. When matching, it searches in the matching operation table. If there is a corresponding match in the matching operation table, the data packet of the traffic performs the corresponding address translation operation on the smart network card and completes forwarding;
[0014] If the search in the matching operation table fails, the data packet of the flow is sent to the x86 server corresponding to the network card, and is searched in the software package processing program of the x86 server. If there is a corresponding processing rule in the flow connection table, the data packet performs the corresponding address translation operation according to the connection information recorded in the flow connection table and completes the forwarding;
[0015] If the search in the flow connection table fails, the data packet of the flow is handed over to the path selection function to assign a destination address to the data packet to complete the connection establishment. After the connection is established, the corresponding address conversion operation is performed in the x86 server corresponding to the network card and the forwarding is completed.
[0016] Furthermore, the control plane includes an unloading engine and an aging engine for flow table collaboration; the unloading engine includes an unloading control unit, an unloading queue and an unloading processing unit, the unloading control unit receives the packet processing rules to be unloaded and puts them into the unloading queue, the unloading processing unit continuously pulls the rules to be unloaded from the unloading queue and inserts the rules into the matching operation table of the smart network card through the rule unloading interface; the aging engine adopts a timeout and deletion method, when a rule on the smart network card has not been accessed for a period of time, an aging request is reported to the x86 server, the aging engine receives the aging request reported by the smart network card, and deletes the corresponding rule from the matching operation table of the smart network card through the rule deletion interface.
[0017] Furthermore, a priority queue is set in the offloading engine, and a priority calculation method is used to determine the execution order of offloading according to the access frequency of each flow under heavy load, thereby giving priority to offloading long flows.
[0018] Furthermore, a hybrid queue combining a first-in-first-out queue and a priority queue and a matching priority control method are adopted to put short flows into a first-in-first-out queue and long flows into a priority queue, and map the packet length and priority corresponding to the flows. Long flows have a higher priority in the unloading queue. In heavy load scenarios, long flows are taken out in a higher priority order.
[0019] Furthermore, when accessing the traffic connection table, the number of traffic accesses is updated, and whether the priority needs to be increased is determined based on the current priority. If it does not need to be increased, the forwarding is continued; if it needs to be increased, the processing rules of the traffic will be notified to the unloading control unit, and then the forwarding is completed.
[0020] A system for accelerating a four-layer load balancer for an intelligent network card includes a data plane module and a control plane module. The data plane module includes an intelligent network card and an x86 server corresponding to the intelligent network card, and jointly processes packet processing and forwarding tasks of the four-layer load balancer; the control plane module manages the flow table and determines whether network traffic is processed by the intelligent network card or on the x86 server corresponding to the intelligent network card.
[0021] The beneficial effects of the present invention are as follows:
[0022] The present invention is a method for accelerating a four-layer load balancer applied to an intelligent network card, in which the intelligent network card and the x86 server corresponding to the network card jointly provide a four-layer load balancing function to the outside; when facing a heavy load scenario with a large number of new connections, long flows are preferentially unloaded, thereby improving the forwarding performance in this scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a system architecture diagram of the present invention.
[0024] Figure 2 This is a flow table coordination diagram. Address translation is the process of converting the received traffic quintuple into a new set of quintuples for forwarding; aging is the process of deleting the traffic processing rules from the matching operation table of the smart network card because some rules have not been accessed for a long time; port forwarding is the process of forwarding the received traffic from any specified network port; RSS is the process of reporting the traffic received by the network card to the host server.
[0025] Figure 3 It is a priority calculation method judgment flow chart.
[0026] Figure 4 This is a schematic diagram of the input and output of the priority calculation method. DETAILED DESCRIPTION
[0027] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below through specific embodiments and drawings.
[0028] The main contents of the present invention are: 1) a four-layer load balancer system design based on intelligent network card acceleration; 2) an unloading acceleration method based on priority queue management.
[0029] The present invention provides a system and method for accelerating a four-layer load balancer for an intelligent network card, wherein the intelligent network card and the x86 server corresponding to the network card serve as a data plane to jointly process the packet processing and forwarding tasks of the four-layer load balancer; and a control plane is designed to manage the flow table, and the control plane determines whether each flow is handled by the intelligent network card or on the x86 server corresponding to the network card. The plane refers to a combination of software modules and / or hardware modules that implement specific functions.
[0030] The design of the four-layer load balancer based on SmartNIC acceleration is as follows:
[0031] The present invention first designs a four-layer load balancer system architecture based on intelligent network card acceleration. The data packet processing flow of the system is: when network traffic arrives, the traffic will first reach the intelligent network card. If there is a processing rule for the traffic in the matching operation unit of the intelligent network card, it will be processed and forwarded on the intelligent network card; if not, it will be sent to the x86 server corresponding to the network card for processing and forwarding.
[0032] On this basis, the present invention designs an unloading engine and an aging engine for flow table collaboration in the control plane. The unloading engine adopts the design concept of asynchronous processing, and divides the unloading function into three parts: an unloading control unit, an unloading queue, and an unloading processing unit. The unloading control unit receives the packet processing rules to be unloaded and puts them into the unloading queue. The unloading processing unit continuously pulls the rules to be unloaded from the unloading queue and inserts the rules into the matching operation table of the smart network card through the rule unloading interface; the aging engine adopts the design concept of timeout and deletion. When a rule on the smart network card has not been accessed for a period of time, an aging request will be reported to the x86 server. The aging engine receives the aging request reported by the smart network card, and deletes the corresponding rule from the matching operation table of the smart network card through the rule deletion interface.
[0033] At the same time, in order to achieve timely unloading of long flows in heavy load scenarios, the present invention introduces a priority queue in the unloading engine and designs a priority calculation method, which can determine the execution order of unloading according to the access frequency of each flow under heavy load, and then give priority to unloading long flows.
[0034] In summary, the present invention designs a system and method for accelerating a four-layer load balancer for a smart network card, and ultimately improves the forwarding performance of the four-layer load balancer based on smart network card acceleration in heavy load scenarios.
[0035] In one embodiment of the present invention, the flow chart of the entire system is as follows: Figure 1 As shown, it mainly includes the data plane and control plane of the four-layer load balancer based on smart network card acceleration. The components of the control plane can be divided into two parts: the offloading engine and the aging engine.
[0036] (1) Data plane workflow
[0037] The four-layer load balancer based on Smart NIC acceleration is composed of Smart NIC and the x86 server corresponding to the NIC to jointly process the received network traffic as the data plane. The specific traffic processing process and flow table coordination process are as follows: Figure 2 As shown, the following steps are included:
[0038] 1) When traffic arrives, it will first enter the matching operation unit of the smart network card for matching. When matching, it will search in the matching operation table. If there is a corresponding match in the matching operation table, the data packet will perform corresponding operations such as address translation on the smart network card and complete forwarding;
[0039] 2) If the search in the matching operation table fails, the data packet of the flow is sent to the x86 server corresponding to the network card, and is searched in the software package processing program of the x86 server. If there is a corresponding processing rule in the flow connection table, the data packet will perform corresponding operations such as address translation according to the connection information recorded in the flow connection table and complete the forwarding;
[0040] 3) If the search in the flow connection table fails, the data packet of the flow is handed over to the path selection function to assign a destination address to the data packet to complete the connection establishment. After the connection is established, the corresponding address conversion and other operations are performed in the x86 server corresponding to the network card and the forwarding is completed. The path selection function is also a method of maintaining the mapping rules of address conversion, which is a common function of the load balancer.
[0041] (2) Control plane offloading workflow
[0042] The present invention adopts the design concept of asynchronous processing and divides the unloading engine into three parts: an unloading control unit, an unloading queue and an unloading processing unit.
[0043] 1) The software package processing program records the counting information of the forwarded traffic while forwarding. When the counting information meets the set trigger condition (the trigger condition is set by the priority control method), the unloading control unit puts the rule for processing the flow into the unloading queue to complete the queueing;
[0044] 2) The offload processing unit pulls from the offload queue, completes the dequeue, and calls the rule offload interface according to the pulled information to complete the offload, that is, inserts the rule into the matching operation table of the smart network card through the rule offload interface.
[0045] (3) Control plane aging workflow
[0046] When the traffic is processed and forwarded in the smart network card, the smart network card also provides some statistical functions, including counting, sampling, timeout aging, etc. The present invention is based on the aging operation and combines the rule deletion interface to complete the deletion of rules with low access frequency.
[0047] 1) The present invention adds an aging operation to the operation set when the rule is unloaded, sets an aging time for the aging operation and specifies a receiving core when unloading, such as Figure 2 As shown;
[0048] 2) When the matching operation rule with aging operation is not accessed for a set period of time, an aging request will be sent to the receiving core of the x86 server;
[0049] 3) After receiving the aging request, the aging engine will use the rule deletion interface to delete the corresponding rule on the smart network card according to the information in the request.
[0050] On this basis, the present invention also designs a hybrid queue combining a first-in-first-out queue (FIFO queue) and a priority queue (PIFO queue) and a priority control method matched therewith, which puts short flows into a first-in-first-out queue and long flows into a priority queue, thereby ensuring the working efficiency of the unloading engine in low-load scenarios and realizing fast unloading of long flows in heavy-load scenarios. At the same time, the packet length and priority corresponding to the flow are mapped, and the long flow has a higher priority in the unloading queue. In heavy-load scenarios, the long flow will be taken out in a higher priority order.
[0051] When accessing the flow connection table, the access count of the flow will be updated at the same time, and according to the current priority, it is determined whether the priority needs to be increased. If it does not need to be increased, the forwarding will continue; if it needs to be increased, the processing rule of the flow will be notified to the unloading control unit, and then the forwarding will be completed. Figure 3As shown in the figure. Since the unloading rules need to be executed sequentially from generation to execution, there is a certain time interval. Therefore, the present invention uses priorities to control the execution order of different unloading rules. Generally speaking, the priority is positively correlated with the access frequency of its corresponding traffic. That is, for traffic with a high access frequency, the unloading execution order (priority) of its corresponding rule is higher.
[0052] The working process of the priority control method is as Figure 4 shown, and includes the following steps:
[0053] 1) The unloading control unit receives the number of packets x of the flow as input;
[0054] 2) Calculate the corresponding priority f(x) according to the number of packets x of the flow. If the priority f(x) belongs to the lowest priority (f(x) = K), it is put into the FIFO queue; if the priority f(x) is higher than the lowest priority (f(x) < K), it is put into the PIFO queue.
[0055] For the calculation method of the priority f(x), the present invention combines the traffic distribution situation of the production environment and fits the corresponding priority calculation function. Generally speaking, the present invention divides the priority into eight levels, decreasing in order from priority 0 to priority 7. When calculating, it is necessary to input the number of packets x of the traffic to obtain the result of the corresponding priority f(x).
[0056] 3) The unloading processing unit preferentially pulls the rules to be unloaded from the PIFO queue and inserts the rules into the matching operation table of the smart network card through the rule unloading interface.
[0057] Another embodiment of the present invention provides a system for accelerating a four-layer load balancer for a smart network card implemented by the method of the present invention, which includes a data plane module and a control plane module. The data plane module includes a smart network card and an x86 server corresponding to the smart network card, and jointly processes the packet processing and forwarding tasks of the four-layer load balancer; the control plane module manages the flow table and decides whether the network traffic is processed by the smart network card or on the x86 server corresponding to the smart network card. The specific implementation process is as described in the previous description of the method of the present invention.
[0058] Another embodiment of the present invention provides a computer device (such as a computer, a server, a smart phone, etc.), which includes a memory and a processor. The memory stores a computer program, and the computer program is configured to be executed by the processor. The computer program includes instructions for executing the steps in the method of the present invention.
[0059] Another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk), wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the steps of the method of the present invention are implemented.
[0060] The specific embodiments of the present invention disclosed above are intended to help understand the content of the present invention and implement it accordingly. It can be understood by those skilled in the art that various replacements, changes and modifications are possible without departing from the spirit and scope of the present invention. The present invention should not be limited to the contents disclosed in the embodiments of this specification, and the scope of protection of the present invention shall be subject to the scope defined in the claims.
Claims
1. A method for accelerating a four-layer load balancer for a smart network card, characterized in that: The following steps are involved: The Smart NIC and the x86 server corresponding to the Smart NIC are used as the data plane to jointly handle the packet processing and forwarding tasks of the four-layer load balancer; The flow table is managed on the control plane, which determines whether network traffic is processed by the Smart NIC or on the x86 server corresponding to the Smart NIC.
2. The method according to claim 1, characterized in that The smart network card includes a matching operation unit. Network traffic first reaches the smart network card. If there is a processing rule for the traffic in the matching operation unit, it is processed and forwarded on the smart network card. Otherwise, it is processed and forwarded on the x86 server corresponding to the network card.
3. The method according to claim 2, characterized in that The data plane processes network traffic using the following steps: When traffic arrives, it first enters the matching operation unit of the smart network card for matching. When matching, it searches in the matching operation table. If there is a corresponding match in the matching operation table, the data packet of the traffic performs the corresponding address translation operation on the smart network card and completes forwarding; If the search in the matching operation table fails, the data packet of the flow is sent to the x86 server corresponding to the network card, and is searched in the software package processing program of the x86 server. If there is a corresponding processing rule in the flow connection table, the data packet performs the corresponding address translation operation according to the connection information recorded in the flow connection table and completes the forwarding; If the search in the flow connection table fails, the data packet of the flow is handed over to the path selection function to assign a destination address to the data packet to complete the connection establishment. After the connection is established, the corresponding address conversion operation is performed in the x86 server corresponding to the network card and the forwarding is completed.
4. The method according to claim 1, characterized in that The control plane includes an unloading engine and an aging engine for flow table collaboration; the unloading engine includes an unloading control unit, an unloading queue and an unloading processing unit, the unloading control unit receives the packet processing rules to be unloaded and puts them into the unloading queue, the unloading processing unit continuously pulls the rules to be unloaded from the unloading queue and inserts the rules into the matching operation table of the smart network card through the rule unloading interface; the aging engine adopts a timeout and deletion method, when a rule on the smart network card has not been accessed for a period of time, an aging request is reported to the x86 server, the aging engine receives the aging request reported by the smart network card, and deletes the corresponding rule from the matching operation table of the smart network card through the rule deletion interface.
5. The method according to claim 4, characterized in that The unloading engine is provided with a priority queue, and adopts a priority calculation method to determine the execution order of unloading according to the access frequency of each flow under heavy load, thereby giving priority to unloading long flows.
6. The method according to claim 5, characterized in that A hybrid queue that combines a first-in-first-out queue and a priority queue and a matching priority control method are used to put short flows into a first-in-first-out queue and long flows into a priority queue. The packet length and priority of the flows are mapped. Long flows have a higher priority in the unloading queue. In heavy load scenarios, long flows are taken out in a higher priority order.
7. The method according to claim 5, characterized in that When accessing the traffic connection table, the access count of the traffic is updated, and it is determined whether the priority needs to be increased according to the current priority. If it does not need to be increased, the forwarding is continued; If promotion is required, the processing rules for the traffic will be notified to the offload control unit, and then the forwarding will be completed.
8. A system for accelerating a four-layer load balancer for a smart network card, characterized in that: It includes a data plane module and a control plane module. The data plane module includes an intelligent network card and an x86 server corresponding to the intelligent network card, which jointly handle the packet processing and forwarding tasks of the four-layer load balancer; The control plane module manages the flow table and determines whether the network traffic is processed by the smart network card or on the x86 server corresponding to the smart network card.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Robotic system
CA3236117A1
Load balancing software architecture based on multi-core platform and method therefor
CN101631139A
Flow load balancing method for intelligent network card
CN102769575A
Method and apparatus for processing data streams
CN109005126A
Software and hardware combined network load balancing implementation system and process method
CN111262924A