A method and system for intelligent network card oriented four-layer load balancer acceleration

CN119520434BActive Publication Date: 2026-09-18INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311059768.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-22
Publication Date
2026-09-18
Estimated Expiration
2043-08-22

AI Technical Summary

Technical Problem

[0005]现有的基于智能网卡的加速方法,大多是在完成目的地址分配后就直接将对应的包处理规则进行卸载,该类方法在面对大量新建连接时(后文简称为重负载场景)可能会出现待卸载规则的生成速度超过规则卸载的速度的情况

Benefits of technology

[0022] This invention is a method for accelerating a Layer 4 load balancer applied to a smart network interface card (NIC). The smart NIC and the corresponding x86 server jointly provide Layer 4 load balancing functionality. In heavy load scenarios with a large number of newly established connections, long-running traffic is preferentially offloaded, thereby improving forwarding performance in such scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520434B_ABST
    Figure CN119520434B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of computer network, and relates to a method and system for four-layer load balancer acceleration oriented to intelligent network card. The method takes the intelligent network card and the x86 server corresponding to the intelligent network card as a data plane to jointly process the packet processing and forwarding task of the four-layer load balancer; the flow table is managed in the control plane, and the control plane decides whether the network flow is processed by the intelligent network card or on the x86 server corresponding to the intelligent network card. The present application adopts the idea of priority control, controls the execution order of unloading according to the length of the flow, jointly provides the four-layer load balancing function to the outside by the intelligent network card and the x86 server corresponding to the network card, and preferentially unloads the long flow when facing the heavy load scene with a large number of newly established connections, thereby improving the forwarding performance in the scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention presents a method and system for accelerating a four-layer load balancer based on a smart network interface card (NIC), belonging to the field of computer networks. Background Technology

[0002] A Layer 4 load balancer sits between the user and the application server. It distributes requests to different application servers based on the transport layer information of network packets, thereby improving network throughput, reducing network latency, and providing users with high-quality network services.

[0003] A smart network interface card (NIC) is a network device that provides programmable and configurable hardware acceleration units to improve forwarding performance and reduce CPU load. It can perform various functions such as network virtualization, load balancing, security encryption, and deep packet inspection.

[0004] The forwarding performance of a Layer 4 load balancer can be improved by offloading the packet processing rules that the load balancer needs to execute to a smart network interface card (NIC). When using a smart NIC to accelerate a Layer 4 load balancer, when a new network packet arrives, the destination address needs to be allocated in the control plane first. After allocation, the corresponding packet processing rules are offloaded to the smart NIC, which then quickly forwards subsequent traffic.

[0005] Existing acceleration methods based on smart NICs mostly offload the corresponding packet processing rules directly after destination address allocation. When faced with a large number of new connections (hereinafter referred to as heavy load scenarios), this type of method may encounter a situation where the generation rate of rules to be offloaded exceeds the rule offloading rate. Furthermore, each flow is distinguished as long or short (generally, flows with more packets are considered long flows, and flows with fewer packets are considered short flows). Existing Layer 4 load balancers based on smart NICs may experience untimely offloading of long flows in heavy load scenarios, thus affecting the overall forwarding performance of the Layer 4 load balancer. Summary of the Invention

[0006] To address the aforementioned problems, this invention provides a method and system for accelerating the offloading of a Layer 4 load balancer in heavy-load scenarios with a large number of newly established connections. It adopts the concept of priority control, which controls the execution order of offloading according to the length of the flow, thereby improving the forwarding performance of the Layer 4 load balancer in heavy-load scenarios.

[0007] The technical solution adopted in this invention is as follows:

[0008] A method for accelerating a Layer 4 load balancer for smart network interface cards (NICs) includes the following steps:

[0009] The smart network interface card and the 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 in 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 interface card (NIC) includes a matching operation unit. When network traffic first arrives at the smart NIC, if the matching operation unit has processing rules for the traffic, it is processed and forwarded on the smart NIC; otherwise, it is processed and forwarded on the x86 server corresponding to the NIC.

[0012] Furthermore, the data plane processes network traffic using the following steps:

[0013] When traffic arrives, it first enters the matching operation unit of the smart network card for matching. During matching, it searches the matching operation table. If there is a corresponding matching item in the matching operation table, the data packet of the traffic will perform the corresponding address translation operation on the smart network card and complete the forwarding.

[0014] If the lookup in the matching operation table fails, the data packet of the traffic is sent to the x86 server corresponding to the network card. The x86 server's package handler searches for the packet. If there is a corresponding processing rule in the traffic connection table, the data packet performs the corresponding address translation operation according to the connection information recorded in the traffic connection table and completes the forwarding.

[0015] If the lookup in the traffic connection table fails, the traffic data packet is handed over to the path selection function to assign a destination address to the data packet in order to complete the connection establishment. After the connection is established, the corresponding address translation operation is performed on the x86 server corresponding to the network card and the forwarding is completed.

[0016] Furthermore, the control plane includes an offloading engine and an aging engine for flow table coordination. The offloading engine includes an offloading control unit, an offloading queue, and an offloading processing unit. The offloading control unit receives packet processing rules to be offloaded and puts them into the offloading queue. The offloading processing unit continuously pulls rules to be offloaded from the offloading queue and inserts the rules into the matching operation table of the smart network interface card through the rule offloading interface. The aging engine adopts a timeout deletion method. When a rule on the smart network interface card has not been accessed for a period of time, it reports an aging request to the x86 server. The aging engine receives the aging request reported by the smart network interface card and deletes the corresponding rule from the matching operation table of the smart network interface card through the rule deletion interface.

[0017] Furthermore, the unloading engine sets up a priority queue and uses a priority calculation method to determine the execution order of unloading based on the access frequency of each flow under heavy load, thereby prioritizing the unloading of long flows.

[0018] Furthermore, a hybrid queue combining a first-in-first-out queue and a priority queue, along with a matching priority control method, is adopted. Short streams are placed in the first-in-first-out queue, while long streams are placed in the priority queue. The packet length and priority of each stream are mapped, with long streams having a higher priority in the offloading queue. In heavy-load scenarios, long streams are retrieved in a higher priority order.

[0019] Furthermore, when accessing the traffic connection table, the number of accesses for the traffic is updated, and it is determined whether the priority needs to be increased based on the current priority. If no increase is needed, the forwarding continues; if an increase is needed, the processing rules for the traffic are notified to the unload control unit, and then the forwarding is completed.

[0020] A system for accelerating a Layer 4 load balancer for smart network interface cards (NICs) includes a data plane module and a control plane module. The data plane module contains the smart NIC and the corresponding x86 server, which jointly handle the packet processing and forwarding tasks of the Layer 4 load balancer. The control plane module manages flow tables and determines whether network traffic is processed by the smart NIC or by the corresponding x86 server.

[0021] The beneficial effects of this invention are as follows:

[0022] This invention is a method for accelerating a Layer 4 load balancer applied to a smart network interface card (NIC). The smart NIC and the corresponding x86 server jointly provide Layer 4 load balancing functionality. In heavy load scenarios with a large number of newly established connections, long-running traffic is preferentially offloaded, thereby improving forwarding performance in such scenarios. Attached Figure Description

[0023] Figure 1 This is the 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 five-tuple of received traffic into a new five-tuple for forwarding; aging is the process of deleting traffic processing rules from the smart network card's matching operation table because some rules have not been accessed for a long time; port switching forwarding is the process of forwarding 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 This is a flowchart of the priority calculation method.

[0026] Figure 4 This is a schematic diagram of the input and output of the priority calculation method. Detailed Implementation

[0027] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0028] The main contents of this invention are: 1) Design of a four-layer load balancer system based on intelligent network card acceleration; 2) Offloading acceleration method based on priority queue management.

[0029] This invention provides a system and method for accelerating a Layer 4 load balancer for smart network interface cards (NICs). The system uses the smart NIC and its corresponding x86 server as the data plane to jointly handle packet processing and forwarding tasks for the Layer 4 load balancer. A control plane is also designed to manage flow tables, determining whether each flow is processed by the smart NIC or on the corresponding x86 server. Here, "plane" refers to a combination of software and / or hardware modules that implement specific functions.

[0030] The design of a Layer 4 load balancer based on smart network interface card acceleration is as follows:

[0031] This invention first designs a four-layer load balancer system architecture based on smart network interface card (NIC) acceleration. The system's data packet processing flow is as follows: when network traffic arrives, the traffic first reaches the smart NIC. If the smart NIC's matching operation unit has processing rules for the traffic, it is processed and forwarded on the smart NIC; otherwise, it is sent to the x86 server corresponding to the NIC for processing and forwarding.

[0032] Based on this, the present invention designs an offloading engine and an aging engine in the control plane for flow table coordination. The offloading engine adopts an asynchronous processing design, dividing the offloading function into three parts: an offloading control unit, an offloading queue, and an offloading processing unit. The offloading control unit receives packet processing rules to be offloaded and puts them into the offloading queue. The offloading processing unit continuously pulls rules to be offloaded from the offloading queue and inserts the rules into the matching operation table of the smart network interface card through the rule offloading interface. The aging engine adopts a timeout deletion design. When a rule on the smart network interface card has not been accessed for a period of time, it will report an aging request to the x86 server. The aging engine receives the aging request reported by the smart network interface card and deletes the corresponding rule from the matching operation table of the smart network interface card through the rule deletion interface.

[0033] Meanwhile, in order to achieve timely unloading of long flows in heavy load scenarios, this invention introduces a priority queue and designs a priority calculation method in the unloading engine. Under heavy load, the execution order of unloading can be determined according to the access frequency of each flow, thereby prioritizing the unloading of long flows.

[0034] In summary, this invention designs a system and method for accelerating a Layer 4 load balancer based on smart network interface cards (NICs), and ultimately improves the forwarding performance of the Layer 4 load balancer based on smart NIC acceleration in heavy load scenarios.

[0035] In one embodiment of the present invention, the flowchart of the entire system is as follows: Figure 1 As shown, it mainly includes the data plane and control plane of a 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 Layer 4 load balancer based on smart NIC acceleration uses both the smart NIC and its corresponding x86 server to process received network traffic, serving as the data plane. The specific traffic processing and flow table coordination processes are as follows: Figure 2 As shown, it includes the following steps:

[0038] 1) When traffic arrives, it first enters the matching operation unit of the smart network card for matching. During matching, it will search the matching operation table. If there is a corresponding matching item in the matching operation table, the data packet will perform the corresponding address translation and other operations on the smart network card and complete the forwarding.

[0039] 2) If the lookup in the matching operation table fails, the data packet of the traffic is sent to the x86 server corresponding to the network card. The x86 server's package processing program will search for the data packet. If there is a corresponding processing rule in the traffic connection table, the data packet will perform the corresponding address translation and other operations according to the connection information recorded in the traffic connection table and complete the forwarding.

[0040] 3) If the lookup in the traffic connection table fails, the data packet is handed over to the path selection function to assign a destination address to the packet, thus establishing a connection. After the connection is established, the corresponding address translation and other operations are performed on the x86 server corresponding to the network card, and forwarding is completed. The path selection function, which is the method of maintaining the address translation mapping rules, is a common function of load balancers.

[0041] (2) Unloading process of the control plane

[0042] This invention adopts the design concept of asynchronous processing, and divides the uninstallation engine into three parts: uninstallation control unit, uninstallation queue and uninstallation processing unit.

[0043] 1) The package handler records the count information of the forwarded traffic while forwarding. When the count information meets the set trigger conditions (the trigger conditions are set by the priority control method), the unloading control unit puts the rules for processing the flow into the unloading queue to complete the enqueueing.

[0044] 2) The unloading processing unit pulls the data from the unloading queue, completes the dequeueing, and calls the rule unloading interface according to the information pulled to complete the unloading, that is, inserts the rule into the matching operation table of the smart network card through the rule unloading interface.

[0045] (3) Aging process of control plane

[0046] When traffic is processed and forwarded in a smart network interface card (NIC), the NIC also provides some statistical functions, including counting, sampling, and timeout aging. This invention is based on the aging operation and combines it with a rule deletion interface to delete rules with low access frequency.

[0047] 1) This invention adds an aging operation to the operation set during rule unloading. During unloading, an aging time is set for the aging operation, and a receiving core is specified, such as... Figure 2 As shown;

[0048] 2) An aging operation matching rule has been added, which will send an aging request to the receiving core of the x86 server if the server has not been accessed for a set period of time.

[0049] 3) After receiving an aging request, the aging engine will use the rule deletion interface to delete the corresponding rules on the smart network card based on the information in the request.

[0050] Building upon this foundation, this invention also designs a hybrid queue combining a First-In-First-Out (FIFO) queue and a Priority-In-First-Out (PIFO) queue, along with a matching priority control method. Shorter flows are placed in the FIFO queue, while longer flows are placed in the priority queue. This ensures the efficiency of the offloading engine in low-load scenarios while enabling rapid offloading of longer flows in heavy-load scenarios. Simultaneously, a mapping is established between the packet length and priority of each flow, with longer flows having a higher priority in the offloading queue. In heavy-load scenarios, longer flows are retrieved with a higher priority order.

[0051] When accessing the traffic connection table, the access count for that traffic is updated simultaneously. Based on the current priority, it's determined whether a priority increase is needed. If no increase is required, forwarding continues. If an increase is needed, the processing rules for that flow are notified to the offloading control unit, and then forwarding is completed. Figure 3As shown. Since offloading rules need to be executed sequentially from generation to execution, there is a certain time interval. Therefore, the present invention uses priority to control the execution order of different offloading rules. Generally speaking, priority is positively correlated with the access frequency of the corresponding traffic, that is, the higher the access frequency of the traffic, the higher the offloading execution order (priority) of the corresponding rule.

[0052] The working process of the priority control method is Figure 4 shown below, and includes the following steps:

[0053] 1) The offloading control unit receives the number of packets x of a flow as an 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), put it into the FIFO queue; if the priority f(x) is higher than the lowest priority (f(x)<K), put it into the PIFO queue.

[0055] For the calculation method of priority f(x), the present invention combines the traffic distribution in the production environment and fits the corresponding priority calculation function. Overall, the present invention divides the priorities into eight levels, which decrease sequentially from priority 0 to priority 7. During calculation, the number of packets x of the traffic needs to be input, and the corresponding result of priority f(x) can be obtained.

[0056] 3) The offloading processing unit preferentially pulls rules to be offloaded from the PIFO queue and inserts the rules into the matching operation table of the smart network interface card through the rule offloading interface.

[0057] Another embodiment of the present invention provides a system for accelerating a four-layer load balancer oriented to a smart network interface card implemented by the method of the present invention, which comprises a data plane module and a control plane module. The data plane module comprises the smart network interface card and the corresponding x86 server, which jointly process the 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 smart network interface card or on the x86 server corresponding to the smart network interface card. The specific implementation process refers to the foregoing description of the method of the present invention.

[0058] Another embodiment of the present invention provides a computer device (computer, server, smart phone, etc.), which comprises a memory and a processor, 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 each step in the method of the present invention.

[0059] Another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, optical disk) storing a computer program that, when executed by a computer, implements the various steps of the method of the present invention.

[0060] The specific embodiments of the present invention disclosed above are intended to help understand the content of the present invention and to implement it accordingly. Those skilled in the art will understand that various substitutions, 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 content disclosed in the embodiments of this specification; the scope of protection of the present invention is defined by the claims.

Claims

1. A method for accelerating a Layer 4 load balancer for smart network interface cards, characterized in that, Includes the following steps: The smart network interface card and the corresponding x86 server are used as the data plane to jointly handle the packet processing and forwarding tasks of the Layer 4 load balancer. The flow table is managed in the control plane, which determines whether network traffic is processed by the smart NIC or on the x86 server corresponding to the smart NIC. 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. During matching, it searches the matching operation table. If there is a corresponding matching item in the matching operation table, the data packet of the traffic will perform the corresponding address translation operation on the smart network card and complete the forwarding. If the lookup in the matching operation table fails, the data packet of the traffic is sent to the x86 server corresponding to the network card. The x86 server's package handler searches for the packet. If there is a corresponding processing rule in the traffic connection table, the data packet performs the corresponding address translation operation according to the connection information recorded in the traffic connection table and completes the forwarding. If the lookup in the traffic connection table fails, the data packet of the traffic is handed over to the path selection function to assign a destination address to the data packet in order to complete the connection establishment. After the connection is established, the corresponding address translation operation is performed in the x86 server corresponding to the network card and the forwarding is completed. The control plane includes an offloading engine and an aging engine for flow table coordination. The offloading engine includes an offloading control unit, an offloading queue, and an offloading processing unit. The offloading control unit receives packet processing rules to be offloaded and puts them into the offloading queue. The offloading processing unit continuously pulls rules to be offloaded from the offloading queue and inserts the rules into the matching operation table of the smart network interface card through the rule offloading interface. The aging engine adopts a timeout deletion method. When a rule on the smart network interface card has not been accessed for a period of time, it reports an aging request to the x86 server. The aging engine receives the aging request reported by the smart network interface card and deletes the corresponding rule from the matching operation table of the smart network interface card through the rule deletion interface. The offloading engine sets up a priority queue and uses a priority calculation method to determine the execution order of offloading based on the access frequency of each flow under heavy load, thus prioritizing the offloading of long flows. The offloading engine uses a hybrid queue combining a first-in-first-out queue and a priority queue, along with a matching priority control method. Short flows are placed in the first-in-first-out queue, and long flows are placed in the priority queue. The engine also maps the packet length and priority of each flow, with long flows having a higher priority in the offloading queue. Under heavy load, long flows are retrieved with a higher priority. When accessing the traffic connection table, the access count of the traffic is updated, and the engine determines whether to increase the priority based on the current priority. If no increase is needed, forwarding continues. If an upgrade is needed, the processing rules for that traffic will be communicated to the offload control unit, and then forwarding will be completed.

2. A system for accelerating a Layer 4 load balancer for smart network interface cards using the method described in claim 1, characterized in that, It includes a data plane module and a control plane module. The data plane module includes a smart network interface card (NIC) and a corresponding x86 server, which together handle the packet processing and forwarding tasks of the Layer 4 load balancer. The control plane module manages the flow table and determines whether network traffic is processed by the smart network interface card (NIC) or on the x86 server corresponding to the smart NIC.

3. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the method of claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a computer, implements the method of claim 1.

Citation Information

Patent Citations

  • Software and hardware combined network load balancing implementation system and process method

    CN111262924A

  • Method for optimizing load balancing performance between servers based on intelligent network card

    CN114598746A