CN116089053A - Data processing method, device and storage medium - Google Patents

Data processing method, device and storage medium Download PDF

Info

Publication number
CN116089053A
CN116089053A CN202111313489.4A CN202111313489A CN116089053A CN 116089053 A CN116089053 A CN 116089053A CN 202111313489 A CN202111313489 A CN 202111313489A CN 116089053 A CN116089053 A CN 116089053A
Authority
CN
China
Prior art keywords
information
processed
session
processing
forwarding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111313489.4A
Other languages
Chinese (zh)
Inventor
谭跃辉
王燕
陆俊华
蒋贤强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111313489.4A priority Critical patent/CN116089053A/en
Publication of CN116089053A publication Critical patent/CN116089053A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data processing method, which is applied to processing equipment comprising a Field Programmable Gate Array (FPGA), and is characterized by comprising the following steps: determining the data type of information to be processed; when the data type of the information to be processed is a service message, forwarding the information to be processed according to a preset table; and when the data type of the information to be processed is a control message, the information to be processed is sent to a virtual server for processing by the virtual server. In the data processing process, the forwarding operation of the service message is executed by the processing equipment comprising the field programmable gate array FPGA, the control message needing complex logic processing is processed by the virtual server, the computing resource of the server software side is released, the forwarding rate of the data packet is greatly improved, and the server cost of the load balancer is reduced.

Description

Data processing method, device and storage medium
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a data processing method, a data processing device, and a storage medium.
Background
With the rapid development of the fourth generation mobile information system (4th Generation Mobile Communication Technology,4G) and the fifth generation mobile information system technology (5th Generation Mobile Communication Technology,5G), the emerging internet services such as short video and live broadcast of the mobile client presents an explosive development situation, and the characteristics of high concurrency and large flow put forward higher requirements on the performance of an application server, so that the traditional single server cannot meet the requirements of the emerging situation. The four-layer soft load equalizer is popular with the vast users and widely applied due to the flexible and extensible deployment mode and the functional characteristic of large-flow distribution.
However, the existing four-layer soft load equalizer still has the problems that the processing of a large bandwidth and an ultra-large packet forwarding rate (Packet Per Second, PPS) cannot be satisfied.
Disclosure of Invention
The invention provides a data processing method, a data processing device and a storage medium for solving the problems.
The technical scheme of the invention is realized as follows:
the invention provides a data processing method, which is applied to processing equipment comprising a Field Programmable Gate Array (FPGA), and comprises the following steps:
determining the data type of information to be processed;
when the data type of the information to be processed is a service message, forwarding the information to be processed according to a preset table;
and when the data type of the information to be processed is a control message, the information to be processed is sent to a virtual server for processing by the virtual server.
The invention provides a data processing method, which is applied to a virtual server and comprises the following steps:
receiving information to be processed sent by processing equipment comprising a Field Programmable Gate Array (FPGA);
determining the data type of the information to be processed;
if the data type of the information to be processed is a service message, determining a forwarding strategy corresponding to the information to be processed, creating a session corresponding to the information to be processed, and sending the forwarding strategy to the processing equipment;
And if the data type of the information to be processed is a control message, processing the information to be processed.
The invention provides a data processing device, which is applied to processing equipment comprising a Field Programmable Gate Array (FPGA), and comprises:
a determining unit for determining a data type of the information to be processed;
the processing unit is used for forwarding the information to be processed according to a preset table when the data type of the information to be processed is a service message;
and the sending unit is used for sending the information to be processed to the virtual server for processing when the data type of the information to be processed is a control message.
The invention provides a data processing device, which is applied to a virtual server and comprises:
the communication unit is used for receiving information to be processed sent by processing equipment comprising a Field Programmable Gate Array (FPGA);
the judging unit is used for determining the data type of the information to be processed;
the execution unit is used for determining a forwarding strategy corresponding to the information to be processed if the data type of the information to be processed is a service message, creating a session corresponding to the information to be processed and sending the forwarding strategy to the processing equipment; and if the data type of the information to be processed is a control message, processing the information to be processed.
The present invention provides a computer storage medium storing a computer program which, when executed by a processor, enables implementation of the data processing method provided by one or more of the foregoing aspects.
According to the data processing method, the device and the computer storage medium provided by the embodiment of the invention, the control message with higher complex logic cost is processed by the virtual server software, and the lookup table forwarding of the service data is processed by the FPGA, so that the separation of the data plane and the control plane is realized.
Drawings
Fig. 1 is a flow chart of a data processing method applied to a processing device including a field programmable gate array FPGA according to an embodiment of the present invention;
FIG. 2 is a flowchart of another data processing method applied to a virtual server according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data processing apparatus for a processing device including a field programmable gate array FPGA according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data processing apparatus applied to a virtual server according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer storage medium according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an LVS working principle according to an embodiment of the present invention;
fig. 7 is a schematic diagram of lvs+dpdk principle according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a soft load balancing system based on hardware acceleration according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a software portion of a soft load balancing method based on hardware acceleration according to an embodiment of the present invention;
fig. 10 is a hardware part architecture diagram of a soft load balancing method based on hardware acceleration according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a software equalization method based on hardware acceleration according to an embodiment of the present invention.
Detailed Description
The present invention will be further described in detail with reference to the accompanying drawings, for the purpose of making the objects, technical solutions and advantages of the present invention more apparent, and the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by those skilled in the art without making any inventive effort are within the scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
In the following description, the terms "first", "second", "third" and the like are merely used to distinguish similar objects and do not represent a specific ordering of the objects, it being understood that the "first", "second", "third" may be interchanged with a specific order or sequence, as permitted, to enable embodiments of the invention described herein to be practiced otherwise than as illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
The technical scheme of the invention is further elaborated below by referring to the drawings in the specification and the specific embodiments.
As shown in fig. 1, the present embodiment provides a data processing method applied to a processing apparatus including a field programmable gate array FPGA, including:
Step S110: determining the data type of information to be processed;
step S120: when the data type of the information to be processed is a service message, forwarding the information to be processed according to a preset table;
step S130: and when the data type of the information to be processed is a control message, the information to be processed is sent to a virtual server for processing by the virtual server.
In this embodiment, the processing device provides a portal for receiving and sending messages, receives information to be processed, analyzes the received information to be processed, and determines a data type of the information to be processed, where the data type includes, but is not limited to: control messages and control messages.
And when the information to be processed is a service message, inquiring a preset table, matching the information to be processed with the preset table, and if the matching is successful, forwarding the information to be processed.
When the information to be processed is a control message, the processing equipment directly sends the information to be processed to the virtual server for processing.
In an embodiment, the preset table includes session information and a forwarding policy corresponding to the session information. The session information includes, but is not limited to: interface and address of data, for example: MAC address (Media Access Control Address, medium access control address), IP address (Internet Protocol Address ), PORT address (PORT address), etc.
In an embodiment, the forwarding policy is used to indicate a processing manner corresponding to the to-be-processed information matching the session information, including but not limited to: forwarding mode, algorithm, destination IP port for forwarding, etc.
In an embodiment, after receiving the information to be processed, the processing device analyzes the information to be processed first, determines a data type of the information to be processed, matches session information carried by the information to be processed with a preset table if the information to be processed is a service message, and forwards the information to be processed based on a forwarding policy obtained by matching if the matching is successful.
The data processing method provided by the embodiment can be applied to a scenario of load balancing of ultra-large bandwidth, ultra-large PPS and ultra-high concurrency, and the virtual server may include: soft load balancer. And processing the service message by the FPGA and processing the control message by the soft load equalizer.
According to the data processing method, the control message with high complex logic cost is processed by the virtual server software, and the lookup table forwarding of service data is submitted to the FPGA for processing, so that separation of a data plane and the control plane is achieved.
In some embodiments, the forwarding the data to be processed according to a preset table includes:
if the session information corresponding to the information to be processed exists in the preset table, forwarding the information to be processed according to the session information and the preset table;
and if the session information corresponding to the information to be processed does not exist in the preset table, the information to be processed is sent to the virtual server.
In an embodiment, if the information to be processed is a service message and no session information corresponding to the information to be processed exists in the preset table, it may be determined that a data packet of the information to be processed is a first packet and no session has been established between the sending device and the receiving device corresponding to the information to be processed. At this time, the processing device directly sends the information to be processed to the virtual server, after the virtual server receives the information to be processed, the information to be processed is parsed, if the information to be processed is determined to be service information, session information carried by the information to be processed is matched with a forwarding policy in the virtual server, a session corresponding to the information to be processed is newly established, and the forwarding policy corresponding to the session information of the information to be processed is sent to the processing device.
In some embodiments, the method further comprises:
and receiving a forwarding strategy corresponding to the session information sent by the virtual server, and storing the forwarding strategy in the preset table.
In an embodiment, if the virtual server newly creates a session, the virtual server sends a forwarding policy corresponding to session information of the newly created session to the processing device, and after receiving the forwarding policy corresponding to the session information, the processing device stores the forwarding policy corresponding to the session information in a preset table. When the processing equipment receives the information to be processed carrying the session information again, the corresponding forwarding strategy can be determined to forward the information to be processed by matching with the preset table.
In some embodiments, the method further comprises:
and deleting the session information corresponding to the session deletion information in the preset table according to the session deletion information issued by the virtual server.
In an embodiment, the session deletion information is used to instruct the processing device to delete the relevant information of the specified session.
In an embodiment, after receiving the session deletion information, the processing device deletes session information related to the deleted session indicated by the session deletion information and a forwarding policy corresponding to the session information. When the information to be processed carrying the session information is received again, the processing device does not directly perform forwarding operation.
In another embodiment, the session deletion information is used to instruct the processing device to stop forwarding the information to be processed corresponding to the specified session. After receiving the session deletion information, the processing device stops forwarding the information to be processed corresponding to the session deletion information according to the session deletion information.
In some embodiments, the method further comprises:
timing a session corresponding to the session control information according to the session control information indicated by the preset table;
and when the timing duration is greater than a control threshold indicated by the session control information, executing control operation corresponding to the session control information in a preset table.
In an embodiment, the preset table stores session control information, where the session control information may be session control information issued by the virtual server, or may be preset session control information, and may be set arbitrarily according to a user requirement. The session control information is used to indicate a control policy corresponding to the session, where the control policy includes, but is not limited to: timeout control, bandwidth limitations, connection limitations, etc.
Taking timeout control as an example: if the session control information is available to indicate when the session duration exceeds a preset threshold, the session is closed. The FPGA will count the time of the session, and discard the received message when the session duration exceeds the preset threshold.
In some embodiments, when the data type of the information to be processed is a service packet, forwarding the information to be processed according to a preset table includes:
inquiring the preset table according to the five-tuple information of the information to be processed, and determining whether information matched with the five-tuple information exists in the preset table; wherein the five-tuple information includes: a source internet protocol (Internet Protocol, IP) address, a destination IP address, a source port number, a destination port number, and a protocol type;
if the matching is successful, forwarding the information to be processed based on the matched information in the preset table.
In an embodiment, the preset table may be used as a hash table, after the service packet is processed, the service packet is directly queried according to the five-tuple information of the packet, if there is information matched with the five-tuple information in the preset table, a forwarding policy matched with the five-tuple information may be determined, and the service packet is forwarded according to the forwarding policy. According to the embodiment, the matching efficiency of the forwarding strategy corresponding to the data to be processed is accelerated in the form of the hash table, and the data processing efficiency is further improved.
As shown in fig. 2, the present embodiment provides a data processing method, which is applied to a virtual server, and includes:
Step S210: receiving information to be processed sent by processing equipment comprising a Field Programmable Gate Array (FPGA);
step S220: determining the data type of the information to be processed;
step S230: if the data type of the information to be processed is a service message, determining a forwarding strategy corresponding to the information to be processed, creating a session corresponding to the information to be processed, and sending the forwarding strategy to the processing equipment;
step S240: and if the data type of the information to be processed is a control message, processing the information to be processed.
In one embodiment, the virtual server includes: soft load balancer. After receiving the information to be processed, the virtual server analyzes the information to be processed first and judges that the data type is a service message or a control message. In one embodiment, the virtual server determines the data type of the information to be processed according to conditions such as TCP (Transport Control Protocol, transmission control protocol)/UDP (User Data Protocol, user datagram protocol) destination port, message type (ARP, etc.).
In an embodiment, a preset table is stored in the virtual server, where the preset table includes session information and a forwarding policy corresponding to the session information.
In one embodiment, when the information to be processed is a control message, the virtual server delivers the information to be processed to an application program monitoring a kernel protocol stack for processing.
In some embodiments, the creating a session corresponding to the information to be processed includes:
determining the working mode of the virtual server according to a preset rule;
and creating a session corresponding to the information to be processed according to the working mode and a scheduling algorithm.
In one embodiment, the virtual server includes: LVS (linux virtual server ) load balancer.
In an embodiment, the operation mode and the scheduling algorithm are an LVS operation mode and an LVS scheduling algorithm, respectively. And after receiving the information to be processed as the service message, the virtual server forwards the information to be processed to the LVS processing program. Specifically, the LVS processing program obtains an LVS working mode according to a preset rule, and creates a session according to the obtained LVS working mode and the converted IP, port and other information determined by the scheduling algorithm.
In one embodiment, the LVS mode of operation includes: load balancing mode based on network address translation (Network Address Translation, NAT), load balancing mode based on Direct Routing (DR), load balancing mode based on TUN (IP tunneling), and the like.
The preset rules comprise: mapping relationship between communication protocol and LVS operation mode. In another embodiment, the preset rule may be to preferentially employ a DR-based load balancing mode. In one embodiment, the preset rules may be set according to the user's needs.
In an embodiment, the virtual server further comprises: DPDK (Data Plane Development Kit ). The virtual server receives data from the processing device through the DPDK driver.
In an embodiment, after receiving information to be processed sent by a processing device, the DPDK determines a data type of the information to be processed, and if the information to be processed is a control message, the information to be processed is directly sent to the KNI (Kernel NIC Interface ), and is processed by an application program listening on a kernel protocol stack, for example: program of BGP protocol. And if the information to be processed is the service message, the information to be processed is sent to LVS processing logic for processing.
In an embodiment, if the information to be processed is a service message, the virtual server matches the information to be processed with a forwarding policy configured in the LVS, and determines the forwarding policy corresponding to the information to be processed.
In some embodiments, the sending, to the processing device, a forwarding policy corresponding to session information of the session includes:
if the service message is a TCP message, judging the session state of the session;
and when the session state is a data transmission state, transmitting a forwarding strategy corresponding to the session information to the processing equipment.
In some embodiments, the method further comprises: and if the session stopping information is received, deleting the session corresponding to the session stopping information, and sending session deleting information to the processing equipment. The session deletion information is used for indicating the processing equipment to delete the related information of the session.
In an embodiment, the stop session information includes a reset message.
In an embodiment, the method further comprises: and if the session duration exceeds the control threshold of the timeout control indicated by the session control information, deleting the session and sending session deletion information to the processing equipment.
In some embodiments, the method further comprises: setting control information of a session corresponding to the information to be processed, and sending the session control information to the processing equipment.
In an embodiment, the session control information is used to indicate a control policy corresponding to the session, where the control policy includes, but is not limited to: timeout control, bandwidth limitations, connection limitations, etc.
In this embodiment, the virtual server performs complex logic processing on the information to be processed when the information to be processed is a control message, creates a session using a load balancer when the information to be processed is a service message, and determines a forwarding policy to send to the processing device, so that the processing device forwards the information to be processed belonging to the session according to the created session and the forwarding policy. According to the embodiment, the control plane and the data plane are separated by processing the control message and the service message by the virtual server and the processing equipment comprising the FPGA, so that the data forwarding performance is improved.
As shown in fig. 3, the present embodiment provides a data processing apparatus 300 applied to a processing device including a field programmable gate array FPGA, including:
a determining unit 310, configured to determine a data type of the information to be processed;
the processing unit 320 is configured to forward the information to be processed according to a preset table when the data type of the information to be processed is a service message;
And the sending unit 330 sends the information to be processed to the virtual server for processing when the data type of the information to be processed is a control message.
In some embodiments, the processing unit is specifically configured to:
if the session information corresponding to the information to be processed exists in the preset table, forwarding the information to be processed according to the session information and the preset table;
and if the session information corresponding to the information to be processed does not exist in the preset table, the information to be processed is sent to the virtual server.
In some embodiments, the apparatus further comprises: and the receiving unit is used for receiving the forwarding strategy corresponding to the session information sent by the virtual server and storing the forwarding strategy in the preset table.
In some embodiments, the processing unit is further configured to delete session information corresponding to the session deletion information in the preset table according to the session deletion information issued by the virtual server.
In some embodiments, the processing unit is further configured to:
timing a session corresponding to the session control information according to the session control information indicated by the preset table;
And when the timing duration is greater than a control threshold indicated by the session control information, executing control operation corresponding to the session control information in a preset table.
In some embodiments, the processing unit is further configured to:
inquiring the preset table according to the five-tuple information of the information to be processed, and determining whether information matched with the five-tuple information exists in the preset table; wherein the five-tuple information includes: a source internet protocol (Internet Protocol, IP) address, a destination IP address, a source port number, a destination port number, and a protocol type;
if the matching is successful, forwarding the information to be processed based on the matched information in the preset table.
As shown in fig. 4, the present embodiment provides a data processing apparatus 400, applied to a virtual server, including:
a communication unit 410, configured to receive information to be processed sent by a processing device including a field programmable gate array FPGA;
a judging unit 420, configured to determine a data type of the information to be processed;
an execution unit 430, configured to determine a forwarding policy corresponding to the information to be processed if the data type of the information to be processed is a service packet, create a session corresponding to the information to be processed, and send the forwarding policy to the processing device; and if the data type of the information to be processed is a control message, processing the information to be processed.
In some embodiments, the executing unit is further configured to determine a working mode of the virtual server according to a preset rule; and creating a session corresponding to the information to be processed according to the working mode and a scheduling algorithm.
In some embodiments, the executing unit is further configured to determine a session state of the session if the service packet is a TCP packet; and when the session state is a data transmission state, transmitting a forwarding strategy corresponding to the session information to the processing equipment.
In some embodiments, the communication unit is further configured to delete a session corresponding to the stop session information if the stop session information is received, and send session deletion information to the processing device. The session deletion information is used for indicating the processing equipment to delete the related information of the session.
In some embodiments, the apparatus further comprises: and the setting unit is used for setting the control information of the session corresponding to the information to be processed and sending the session control information to the processing equipment.
The embodiment of the present invention further provides a computer storage medium, where the computer storage medium 500 stores a computer program, where the computer program can implement the data processing method provided by one or more of the foregoing technical solutions after being executed by a processor.
As shown in fig. 5, a computer storage medium 500 provided by an embodiment of the present invention includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes. Alternatively, the computer storage medium may be a non-transitory storage medium.
A specific example is provided below in connection with the above embodiments:
LVS (Linux Virtual Server ) is a default soft load equalizer of Linux system, is realized based on netfilter, and provides four-layer soft load equalizer functions based on Linux kernel protocol stack.
The schematic diagram of the LVS operation is shown in fig. 6. When a client's request reaches the kernel space of the soft load balancer, the PREROUTING chain is reached first. When the core finds that the destination address of the requested packet is local, the packet is sent to the INPUT chain. When a packet reaches the INPUT chain, it is first checked by IPVS, and if the destination address and port in the packet are not in the IPVS rule, the packet is released to user space. If the destination address and port in the packet are in the IPVS rule, the destination address of the packet is modified to be the backend server (DNAT) selected by the responsible balancing algorithm and sent to the POSROUTING chain. And finally, the server is sent to a back-end server through a POSTROUTING chain.
The open source LVS version has 3 working modes, the working principles of each mode are quite different, each mode has own advantages and disadvantages, and the open source LVS version is suitable for different application scenes respectively, but the final essential function is that balanced flow scheduling and good expansibility can be realized. It mainly comprises the following three modes: the advantages of adopting the LVS method are that the linux kernel is self-contained and can be used without installing additional packets, but in the scenes of large bandwidth, low delay and high concurrency, the LVS can not meet the requirements, and the lengthy protocol stack and the complex scheduling logic of the LVS can easily form performance bottlenecks.
Based on the above problems, researchers have proposed a DPDK acceleration scheme of LVS, which uses techniques such as core binding of DPDK, lock-free queues, custom lightweight IP protocol stacks, etc., and all messages are handled in user state. And the complex and cumbersome processing flow of the kernel protocol stack is bypassed.
The schematic diagram of lvs+dpdk principle is shown in fig. 7. The message processing flow is as follows: hardware interrupt-abort interrupt flow-get packet through Poll Mode Driver-get user layer protocol stack-logical layer-business layer. The DPDK accelerated LVS native inherits the three large modes (DR, NAT, TUN) of the LVS, but because the DPDK takes over the network card, no protocol stack exists, the configuration and management aspects are different, and the performance is greatly improved on the basis of the native. However, once the bandwidth exceeds 50Gbps, when the packet occupancy is relatively large, the CPU (Central Processing Unit ) may easily become a bottleneck, because the larger the bandwidth, the smaller the packet, the larger the PPS (Packet Per Second, packets per second) will be, while the DPDK is a polling-based mechanism, the rate of packet reception depends on the CPU time slice size, and the PPS needs to process the CPU time slice, so once the PPS exceeds a certain value, the PPS will cause indiscriminate packet loss.
Disadvantages of the prior art:
as shown in fig. 6, the LVS of the open source version is implemented in the linux kernel protocol stack based on netfilter, the call chain is complex, one message needs to pass through multiple chains, and the performance of the netfilter is poor under the condition of large flow, and the message enters the kernel protocol stack, cannot be forwarded by adopting a fast path of the network card, and cannot meet the processing of large bandwidth and oversized PPS (Packet Per Second).
As shown in fig. 7, DPDK accelerated LVS has improved a lot of performance compared to the open source LVS of fig. 6, and DPDK is also a comparatively popular acceleration technique. However, the DPDK relies on the forwarding capability of the CPU, and when the packet is in a super-large bandwidth scenario (above 40G), the PPS is very large, so that the performance of the packet is poor because the CPU cannot forward the packet, and the DPDK needs to monopolize the network card, so that the packet cannot go to the kernel mode after the network card is taken over by the DPDK, which is difficult to maintain and manage, and the analysis of the network packet is a great problem.
In order to solve the above problems, this example proposes a method that bypasses the kernel protocol stack, does not depend on the CPU forwarding performance, promotes forwarding PPS, does not occupy the kernel network card, and avoids the drawbacks of fig. 6 and fig. 7, and adopts hardware acceleration. The service data does not pass through the kernel protocol stack, the CPU is not moved, and the forwarding performance is extremely high and does not depend on the network card.
The embodiment proposes a soft load balancing method based on hardware acceleration, which is suitable for balancing the ultra-large bandwidth, ultra-large PPS and ultra-high concurrency scenes, and solves the performance bottleneck problem caused by a pure software scheme. The method is divided into a software part and a hardware FPGA part: the software part is realized by adopting DPDK, adopts a lightweight IP protocol stack, is responsible for establishing session, destroying session, managing configuration, realizing control protocol, FPGA operation and the like, and is a slow channel; the hardware part is only responsible for service forwarding and is a fast path. According to the method, the FPGA card provides the network port, the service message is directly forwarded from the fast channel, no special network card is required to be additionally configured, and the problems of performance bottleneck and overlong delay caused by forwarding the ultra-large bandwidth message from the PCIE to the FPGA card are avoided.
The present disclosure is further described below in terms of both software scheduling and hardware processing logic, respectively.
The specific implementation of the scheme provided in this example is described as follows:
the software part of the scheme provided by the example is responsible for the control plane, and the specific implementation is as follows:
the solution software part of this example was developed secondarily on the basis of lvs+dpdk. The LVS is responsible for algorithm control, configuration management and logic function provision; the DPDK is responsible for receiving the first packet to establish a session, controlling the acquisition of the message and sending the message to the KNI (kernel Network Interface of DPDK) port to satisfy the specific protocol.
The architecture diagram of the software portion of the software load balancing method based on hardware acceleration is provided in this example, as shown in fig. 9. The Client is a service initiator and needs to walk control messages and service messages, and the method provides a network port by the FPGA to forward the messages without depending on an independent network card. The FPGA is responsible for table lookup forwarding, if the session table is not in the FPGA, the message is sent to the DPDK, and the DPDK judges whether the TCP protocol or the UDP protocol is adopted, and different treatments are carried out. If the packet is the UDP first packet, immediately creating a session and transmitting the session to the FPGA, carrying out table lookup forwarding on a subsequent message by the FPGA, and carrying out overtime deleting on the session by a timer. If the session is a TCP message, the session is issued to the FPGA only when the data transmission state of the ESTABLISB is entered, the CPU is sent up when the FIN/RST message (closing request) is received, the CPU deletes the session, and if the FIN/RST message is not received, the timer deletes the session after overtime.
After the DPDK receives the message, filtering the message through conditions such as TCP/UDP destination port and message type (ARP, etc.), if the message is found to be a control protocol message, sending the control protocol message to the KNI interface, sending the message to the kernel protocol stack by the KNI, and handing the message to an application program monitoring on the kernel protocol stack for processing, for example: a program that handles the BGP protocol. If the service message is the service message, forwarding the service message to LVS processing logic, and if the service message is matched with a forwarding strategy configured in LVS, performing session creation and forwarding service traffic.
After receiving the service message, the LVS acquires the LVS working mode, the scheduling algorithm, the converted information such as IP, port and the like according to the configured rule, performs session creation, and after the session creation is completed, issues the session to the FPGA interface, and the session is stored in the FPGA as a flow table and a flow table is stored locally.
The hardware part of the scheme provided by the example is responsible for the data plane, and the specific implementation is as follows:
the method adopts the FPGA to realize the functions of message receiving and sending, message processing, rule issuing, rule inquiring, message uploading and the like, and the FPGA is used as a quick path and is provided with a DDR (Double Data Rate) memory, so that the improvement of forwarding performance is realized.
The hardware part architecture diagram of the soft load balancing method based on hardware acceleration is provided in this example, as shown in fig. 10. The service message is received through a 100G physical network port and sent to a message analysis module; if the control message is a control message, the control message is directly sent to a polling mode driver of the DPDK through DMA, and the DPDK is sent to an application program monitoring a kernel protocol stack through a KNI interface for processing; if the service message is sent, a preset table in the DDR is inquired, wherein the preset table comprises a flow table rule, if no related session information exists in the preset table, the message is sent to a CPU (Central processing Unit) to a DPDK, the DPDK adopts logic of LVS to newly establish a session, acquires a forwarding mode, an algorithm, a converted IP port and the like according to the issued rule, defines a flow table format, calls an FPGA (field programmable gate array) flow table setting interface, and sets the flow table rule into the preset table of the FPGA. The preset table of the FPGA takes the rule of the flow table as a hash table, performs session timing processing and judges the overtime state; when the message is not the control message and then enters the FPGA, the message processing module of the FPGA can use the five-tuple of the message to inquire the hash table, quickly match the rule, process the rule, and directly forward the message to realize a fast path.
As shown in fig. 10, the control plane and the data plane are separated and implemented by different parts respectively: the software part is responsible for controlling a plane, realizes logic of a soft load equalizer and is a slow channel; the hardware part is responsible for a data plane, table lookup and forwarding, and is a fast channel; different planes are responsible for different functions. The message forwarding is carried out through the data plane, so that the CPU is only used in the control plane, the calculation resource of the CPU is released, the DPDK drive is adopted, the use and the transplantation are convenient, and a developer does not need to additionally develop the drive.
The software load balancing method based on hardware acceleration provided by the example is applied to a software load balancing system based on hardware acceleration, as shown in fig. 8, and fig. 8 is a structural diagram of the software load balancing system based on hardware acceleration. The system comprises: FPGAs and soft load balancers (which include DPDK and LVS handlers).
Fig. 11 is a schematic diagram of a software equalization method based on hardware acceleration provided in this example. The soft load balancing method based on hardware acceleration provided by the example comprises the following steps:
1. And the FPGA receives the information of the data to be processed, inquires a preset table for forwarding, and if the table lookup fails, uploads the information to be processed to the CPU for processing by a DPDK driver. If the session information exists in the preset table, the fast channel is walked, the FPGA directly repacks the data information to be processed according to the preset table, and the message is rewritten.
Specifically, when VIP traffic (message) is sent to the FPGA, the FPGA queries a preset table stored in the FPGA to perform table lookup forwarding, and if no matching information is found in the preset table, the message is sent to the CPU if the table lookup fails, i.e., the message is sent to the control plane. If the table lookup is successful, forwarding the message according to the matched information of the preset table.
2. After receiving the message, the CPU judges whether the message is a control message, if the message is the control message, the control message is directly processed by utilizing control logic, if the message is a data message (service message), a new session is established, and a forwarding strategy corresponding to the session information is sent to the FPGA.
Specifically, after the control plane receives the message, if the message is a control message, the control plane goes through the control logic, and processes the message through lvs+dpdk, for example: OSPF, BGP, VRRP and the like, and the messages can be sent to a kernel protocol stack for processing through KNI and other interfaces. If the message is a service message (data message), the message is judged to be the first packet, and the message belongs to a new session. The CPU will go to new the session corresponding to the message, then set the session information and the forwarding strategy corresponding to the session information to the preset table of the FPGA, and after the new session is established, package the corresponding message and send it to the client.
3. The FPGA counts the time-out information, bandwidth limitation, connection limitation and the like set by a control plane in a preset table, performs timing statistics on the session, performs related operation, closes the session if the threshold value is exceeded, or discards the message, wherein the specific operation can be set to the preset table according to the requirement and judged by the FPGA.
4. When the session is overtime or the information indicating the disconnection of the session such as the reset message is received, the CPU calls the interface of the control plane, updates the session table of the software and deletes the corresponding session.
The present example proposes a hardware accelerated soft load balancing method. Compared with the method that the LVS or the LVS+DPDK is adopted at present, depending on software processing of the LVS, the message is required to pass through a CPU and a network card, and the session table occupies memory. In the embodiment, the DPDK Driver is used as a control plane message path, processing logic of LVS is only needed when a session is established and a control message is processed, register call, hardware setting and the like of the FPGA are transparent to an upper layer, modification of a software layer is small, and adaptation of a Poll Mode Driver of the DPDK is only needed. This approach is an open source approach that has never been considered and involved.
On the one hand, in the software layer, the code of LVS+DPDK is still used, only a little modification is needed, FPGA development and Poll Mode Driver realization can be taken charge of by a professional team, and the soft load equalizer can complete code development only by adapting the Poll Mode Driver of the FPGA. The present example proposes that software and hardware decoupling can be achieved with less development of soft load balancers. On the other hand, the method of separating the control plane from the data plane is adopted in the present example, the control plane is responsible for the processing of the control message and the packet receiving and session establishing message of the slow path, the CPU only has load when the new session is large, compared with the traditional soft load balancing, the method completely depends on the CPU and the software to forward the message, and the CPU is easy to have bottleneck. The data plane is processed by software because of the use of hardware, the complex logic cost is high, and the FPGA only realizes simple table lookup forwarding and realizes a fast path. The method greatly improves the processing bandwidth and PPS of the load balancing system, releases the CPU of the server, enables the CPU to realize mixed deployment, and reduces the cost of the server of the load balancing system.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing module, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. A data processing method applied to a processing device including a field programmable gate array FPGA, comprising:
determining the data type of information to be processed;
when the data type of the information to be processed is a service message, forwarding the information to be processed according to a preset table;
and when the data type of the information to be processed is a control message, the information to be processed is sent to a virtual server for processing by the virtual server.
2. The method according to claim 1, wherein forwarding the data to be processed according to a preset table comprises:
if the session information corresponding to the information to be processed exists in the preset table, forwarding the information to be processed according to the session information and the preset table;
And if the session information corresponding to the information to be processed does not exist in the preset table, the information to be processed is sent to the virtual server.
3. The method according to claim 1, wherein the method further comprises:
and receiving a forwarding strategy corresponding to the session information sent by the virtual server, and storing the forwarding strategy in the preset table.
4. The method according to claim 1, wherein the method further comprises:
and deleting the session information corresponding to the session deletion information in the preset table according to the session deletion information issued by the virtual server.
5. The method according to claim 1, wherein the method further comprises:
timing a session corresponding to the session control information according to the session control information indicated by the preset table;
and when the timing duration is greater than a control threshold indicated by the session control information, executing control operation corresponding to the session control information in a preset table.
6. The method according to claim 1, wherein when the data type of the information to be processed is a service message, forwarding the information to be processed according to a preset table includes:
Inquiring the preset table according to the five-tuple of the information to be processed, and determining whether session information corresponding to the information to be processed exists in the preset table; wherein the five-tuple comprises: source internet protocol IP address, destination IP address, source port number, destination port number, and protocol type.
7. A data processing method applied to a virtual server, comprising:
receiving information to be processed sent by processing equipment comprising a Field Programmable Gate Array (FPGA);
determining the data type of the information to be processed;
if the data type of the information to be processed is a service message, determining a forwarding strategy corresponding to the information to be processed, creating a session corresponding to the information to be processed, and sending the forwarding strategy to the processing equipment;
and if the data type of the information to be processed is a control message, processing the information to be processed.
8. The method of claim 7, wherein the creating a session corresponding to the information to be processed comprises:
determining the working mode of the virtual server according to a preset rule;
and creating a session corresponding to the information to be processed according to the working mode and a scheduling algorithm.
9. The method of claim 7, wherein the method further comprises: setting session control information of a session corresponding to the information to be processed, and sending the session control information to the processing equipment.
10. The method of claim 7, wherein the method further comprises: and if the session stopping information is received, deleting the session corresponding to the session stopping information, and sending session deleting information to the processing equipment.
11. A data processing apparatus for use in a processing device comprising a field programmable gate array FPGA, comprising:
a determining unit for determining a data type of the information to be processed;
the processing unit is used for forwarding the information to be processed according to a preset table when the data type of the information to be processed is a service message;
and the sending unit is used for sending the information to be processed to the virtual server for processing when the data type of the information to be processed is a control message.
12. A data processing apparatus for use with a virtual server, comprising:
the communication unit is used for receiving information to be processed sent by processing equipment comprising a Field Programmable Gate Array (FPGA);
The judging unit is used for determining the data type of the information to be processed;
the execution unit is used for determining a forwarding strategy corresponding to the information to be processed if the data type of the information to be processed is a service message, creating a session corresponding to the information to be processed and sending the forwarding strategy to the processing equipment; and if the data type of the information to be processed is a control message, processing the information to be processed.
13. A computer storage medium storing a computer program which, when executed by a processor, is capable of carrying out the method of any one of claims 1 to 10.
CN202111313489.4A 2021-11-08 2021-11-08 Data processing method, device and storage medium Pending CN116089053A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111313489.4A CN116089053A (en) 2021-11-08 2021-11-08 Data processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111313489.4A CN116089053A (en) 2021-11-08 2021-11-08 Data processing method, device and storage medium

Publications (1)

Publication Number Publication Date
CN116089053A true CN116089053A (en) 2023-05-09

Family

ID=86210697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111313489.4A Pending CN116089053A (en) 2021-11-08 2021-11-08 Data processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN116089053A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116599892A (en) * 2023-07-17 2023-08-15 浪潮电子信息产业股份有限公司 Server system, routing method, routing device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116599892A (en) * 2023-07-17 2023-08-15 浪潮电子信息产业股份有限公司 Server system, routing method, routing device, electronic equipment and storage medium
CN116599892B (en) * 2023-07-17 2023-10-03 浪潮电子信息产业股份有限公司 Server system, routing method, routing device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20220393974A1 (en) Packet Processing System and Method, Machine-Readable Storage Medium, and Program Product
US10564994B2 (en) Network policy implementation with multiple interfaces
US8059562B2 (en) Listener mechanism in a distributed network system
JP4638658B2 (en) Method for uploading state object of offloaded network stack and method for synchronizing it
US7961733B2 (en) Method and apparatus for performing network processing functions
US7930349B2 (en) Method and apparatus for reducing host overhead in a socket server implementation
CN101217464B (en) UDP data package transmission method
US8094670B1 (en) Method and apparatus for performing network processing functions
CN101217493A (en) TCP data package transmission method
JP2003333076A (en) Offloading method of network stack
CN112929264B (en) Service flow transmission method, system and network equipment
CN111404817B (en) Method and system for improving fragment data packet forwarding performance of network communication equipment
WO2021008591A1 (en) Data transmission method, device, and system
US7469295B1 (en) Modified round robin load balancing technique based on IP identifier
CN113965521B (en) Data packet transmission method, server and storage medium
CN111740910A (en) Message processing method and device, network transmission equipment and message processing system
CN113726636B (en) Data forwarding method and system of software forwarding device and electronic device
CN116089053A (en) Data processing method, device and storage medium
US10298494B2 (en) Reducing short-packet overhead in computer clusters
CN114268518A (en) Method and system for realizing forwarding acceleration of sdwan data tunnel
WO2024037366A1 (en) Forwarding rule issuing method, and intelligent network interface card and storage medium
CN115827266A (en) Method and system for message forwarding framework in multi-CPU system heterogeneous computer system
CN111988154B (en) Method and device for accelerating network transmission and computer readable storage medium
WO2024113776A1 (en) Data transmission method and related device
CN110995680A (en) Virtual machine message receiving method, system, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination