CN111371694B - Shunting method, device and system, processing equipment and storage medium - Google Patents

Shunting method, device and system, processing equipment and storage medium Download PDF

Info

Publication number
CN111371694B
CN111371694B CN201811602922.4A CN201811602922A CN111371694B CN 111371694 B CN111371694 B CN 111371694B CN 201811602922 A CN201811602922 A CN 201811602922A CN 111371694 B CN111371694 B CN 111371694B
Authority
CN
China
Prior art keywords
processed
network card
message
shunting
receiving
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.)
Active
Application number
CN201811602922.4A
Other languages
Chinese (zh)
Other versions
CN111371694A (en
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201811602922.4A priority Critical patent/CN111371694B/en
Priority to PCT/CN2019/103682 priority patent/WO2020134153A1/en
Publication of CN111371694A publication Critical patent/CN111371694A/en
Application granted granted Critical
Publication of CN111371694B publication Critical patent/CN111371694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/351Switches specially adapted for specific applications for local area network [LAN], e.g. Ethernet switches
    • H04L49/352Gigabit ethernet switching [GBPS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a streaming method, a streaming device, a streaming system, a processing device and a storage medium, wherein the method comprises the following steps: receiving a message to be processed from a target network card; distributing the message to be processed to a plurality of processing threads through software; and receiving messages processed by a plurality of processing threads, and sending the processed messages out through the target network card. By the scheme, the technical effect that the multi-core advantage can be utilized while the network IO performance is utilized can be achieved.

Description

Shunting method, device and system, processing equipment and storage medium
Technical Field
The present application relates to the field of mobile communications, and in particular, to a streaming method, apparatus and system, a processing device, and a storage medium.
Background
With the introduction of a tera network card and an intelligent network card and the continuous Development of hardware virtualization technology, 40G, 100G and other optical ports can realize low-delay linear forwarding on a general server under the application of a DPDK (Data Plane Development Kit) suite, and can obtain performance similar to that of a traditional special device.
Although the performance of the hardware shunting of the network card is high, the hardware shunting of the network card generally cannot meet the requirements of various scenes, the shunting strategy cannot be customized, and part of the network card does not support the requirements of multiple queues and the like, so that the network card has great limitation.
An effective solution is not provided at present aiming at how to fully utilize the IO performance of a network card and the multi-core advantage of a CPU.
Disclosure of Invention
To solve the above technical problem or at least partially solve the above technical problem, the present application provides a streaming method, apparatus and system, a processing device, and a storage medium.
In a first aspect, the present application provides a streaming method, including:
receiving a message to be processed from a target network card;
distributing the message to be processed to a plurality of processing threads through software;
and receiving messages processed by the multiple processing threads, and sending out the processed messages through the target network card.
In one embodiment, the receiving the message to be processed from the target network card includes:
and receiving the message to be processed after the target network card performs the shunting processing through hardware, wherein the target network card shunts the message to be processed according to the number of the supported receiving queues.
In one embodiment, sending the processed message through the target network card includes:
mounting the processed message on a sending queue;
and sending the processed message out through the target network card.
In one embodiment, the distributing the packet to be processed to a plurality of processing threads by software includes:
and distributing the message to be processed to a plurality of processing threads according to a load balancing strategy through software.
In one embodiment, the distributing the packet to be processed to a plurality of processing threads according to a load balancing policy includes:
calculating the characteristic value of the message to be processed according to a preset shunting strategy;
and according to the characteristic value and a load balancing strategy, distributing the message to be processed to a plurality of processing threads.
In one embodiment, the above method further comprises:
receiving a configuration instruction of the preset shunting strategy;
and responding to the configuration instruction, and configuring the preset shunting strategy.
In one embodiment, the target network card includes at least one of: network cards supporting multiple queues and network cards not supporting multiple queues.
In a second aspect, a flow splitting apparatus is provided, including:
the receiving module is used for receiving the message to be processed from the target network card;
the shunting module is used for shunting the message to be processed to a plurality of processing threads through software;
and the processing module is used for receiving the messages processed by the plurality of processing threads and sending the processed messages out through the target network card.
In one embodiment, the receiving module is specifically configured to receive a to-be-processed packet after the target network card performs a flow splitting process through hardware, where the target network card splits the to-be-processed packet according to the number of the receiving queues supported by the target network card.
In one embodiment, the processing module comprises:
the mounting unit is used for mounting the processed message onto the sending queue;
and the sending unit is used for sending the processed message out through the target network card.
In an embodiment, the offloading module is specifically configured to offload the to-be-processed packet to multiple processing threads according to a load balancing policy.
In a third aspect, a streaming system is provided, which includes: the network card, the shunting device and the processing thread.
In a fourth aspect, there is provided a processing device comprising a processor and a memory for storing processor-executable instructions, the instructions when executed by the processor performing the steps of:
receiving a message to be processed from a target network card;
distributing the message to be processed to a plurality of processing threads through software;
and receiving messages processed by the multiple processing threads, and sending out the processed messages through the target network card.
In a fifth aspect, there is provided a computer readable storage medium having stored thereon computer instructions that, when executed, perform the steps of:
receiving a message to be processed from a target network card;
distributing the message to be processed to a plurality of processing threads through software;
and receiving messages processed by a plurality of processing threads, and sending the processed messages out through the target network card.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: the message to be processed from the network is shunted to a plurality of processing threads through software, namely shunted to the multi-core processing equipment for processing, so that the problem that the shunting effect is poor due to the fact that the current shunting is performed only through the length of a receiving and sending queue supported by a network card can be solved, the IO performance of the network card cannot be utilized, the requirement of the multi-core advantage of a CPU can be fully utilized, and the technical effect that the multi-core advantage can be utilized while the network IO performance is utilized is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
FIG. 1 is a schematic diagram of a model of network card hardware offload;
fig. 2 is a flowchart of a method of a shunting method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an SR-IOV architecture;
fig. 4 is a schematic diagram of a single RSS shunt model according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a multi-RSS distribution model according to an embodiment of the present invention;
fig. 6 is a code diagram of configuration of a cut-through network card in a configuration file of a virtual machine according to an embodiment of the present application;
fig. 7 is a schematic setting code diagram of an interface mode according to an embodiment of the present application;
fig. 8 is a schematic diagram of a offloading policy for software offloading provided in an embodiment of the present application;
fig. 9 is a schematic diagram illustrating a packet transceiving situation for each forwarding instance viewed through a diagnostic command according to an embodiment of the present application;
fig. 10 is a schematic diagram of configuration codes of an SR-IOV network card in a configuration file of a virtual machine according to an embodiment of the present application;
fig. 11 is a code diagram of setting a VLAN for a VF according to the embodiment of the present application;
fig. 12 is a block diagram of a shunting device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
As shown in fig. 1, for an example of a hardware offload model of an existing network card, 2 network cards respectively create 3 receive queues and 4 transmit queues, the hardware offload to different WORKs, and after the WORKs are processed, a message is transmitted. Therefore, in this example, a distribution policy configured by a command is proposed, and a message feature value is calculated according to the policy, and then the message is distributed to different forwarding threads. The method has better expansibility, can meet the requirements of more scenes through the matching of software and hardware flow distribution, and realizes the high-performance receiving and sending packets and load balance of the network card in different application scenes.
Specifically, as shown in fig. 2, the present embodiment provides a shunting method, which includes the following steps:
step 201: receiving a message to be processed from a target network card;
if the target network card is a network card supporting multiple transceiving queues, the target network card is firstly shunted to different shunting devices (the shunting devices can be RSSs) through the network card, and then the shunting devices are shunted to different processing threads (namely, WORKs) through software. If the target network card does not support the network card with multiple receiving and transmitting queues, software is directly shunted to different processing threads through the shunting device.
Therefore, the received message to be processed from the target network card may or may not have been shunted by the network card, which may be determined by the type of the network card.
Step 202: distributing the message to be processed to a plurality of processing threads through software;
for example, the message from the network card 1 may be distributed to the processing thread 1, the processing thread 2, and the processing thread 3 by software and the message from the network card 2 may be distributed to the processing thread 5 and the processing thread 6 by software and processed. Among them, the processing thread 1, the processing thread 2, the processing thread 3, the processing thread 5, and the processing thread 6 may correspond to different processing cores. The specific software distribution policy is configured in advance, for example, a developer configures through a policy configuration interface. Namely, the shunting processing of the message to be processed is realized through software.
Step 203: and receiving messages processed by a plurality of processing threads, and sending the processed messages out through the target network card.
In the above example, the to-be-processed message from the network is distributed to the multiple processing threads through software, that is, distributed to the multi-core processing device for processing, so that the problem that the distribution effect is poor due to the fact that the distribution is only performed through the length of the receiving and sending queue supported by the network card, the IO performance of the network card cannot be met, the requirement of the multi-core advantage of the CPU can be fully utilized, and the technical effect that the multi-core advantage can be utilized while the IO performance of the network is utilized is achieved.
Considering that if software shunting (namely shunting is performed through software) and hardware shunting (namely shunting is performed through hardware, namely shunting is performed based on the number of the receiving and sending queues supported by the network card), shunting efficiency can be improved, and shunting is more reasonable. Therefore, when receiving the to-be-processed message from the target network card in step 101, the to-be-processed message may be received after the target network card performs the shunting processing through hardware shunting, where the target network card shunts the to-be-processed message according to the number of the supported receiving queues. That is, hardware shunting is performed through the network card, for example, the network card supports two receiving threads, so that the network card can shunt the message to be processed to the two shunting devices, and then the shunting devices shunt the message to the processing threads through software.
In order to realize effective sending of the processed message, because a software and hardware set shunting mode is adopted when the processed message is transmitted into the processing thread, correspondingly, when the processed message is sent out, the message needs to return to the network card according to the original route, and the message is sent out through the network card. Therefore, sending the processed message through the target network card may include: mounting the processed message on a sending queue; and sending the processed message out through the target network card. The sending queue is a sending queue on the shunting device, namely, after the processing thread is processed, the processed message is firstly mounted on the sending queue of the shunting device, and then the message is sent through the network card, so that the message can be sequentially processed and sent.
When the to-be-processed packet is distributed to a plurality of processing threads through software, the to-be-processed packet may be distributed to the plurality of processing threads through software according to a load balancing policy. By adopting a load balancing shunting mode, each processing thread can be ensured to have approximate processing capacity, on one hand, the effective utilization of resources can be realized, and on the other hand, the efficiency of message processing can be improved.
Specifically, when the message to be processed is distributed to multiple processing threads according to a load balancing policy, the feature value of the message to be processed may be calculated according to a preset distribution policy; and distributing the message to be processed to a plurality of processing threads according to the characteristic value and a load balancing strategy. Namely, the distribution is performed by calculating the characteristic value, so that the distribution is performed based on the content and the characteristics of the message, and the accuracy is higher.
For the preset shunting policy, the configuration may be configured by a developer, for example, a configuration instruction for the preset shunting policy may be received; and responding to the configuration instruction, and configuring the preset shunting strategy. Specifically, a policy for software offloading may be set on a CLI (Command-Line Interface), and an inner-layer-based or outer-layer packet offloading may be selected first, and then a specific offloading policy may be selected. The specific configuration mode may be selected according to actual situations, which is not limited in this application.
The target network card may include, but is not limited to, at least one of the following: network cards supporting multiple queues and network cards not supporting multiple queues.
The above method is described below with reference to a specific example, however, it should be noted that the specific example is only for better describing the present application and is not to be construed as limiting the present application.
In this example, the devices involved may be: the virtual devices such as routers, telecommunication gateways, user access, address conversion, firewalls and the like in the field of wired and wireless communication; the rapid iteration and delivery of the requirements are realized through the generalized equipment of the X86 server; the method has wide application in SDN/NFV networks, cloud computing and data centers.
The multi-queue network card is originally used to solve the problem of quality of service (QoS) of network IO, and later, with the continuous increase of bandwidth of network IO, a single-core Central Processing Unit (CPU) cannot completely meet the requirement of the network card. Therefore, through the support of the multi-queue network card drive, each queue is bound to different cores through interruption so as to meet the requirement of the network card, and simultaneously, the load of a single CPU can be reduced, and the computing capacity of the system is improved.
Considering that when a service chain is complex, hardware offloading may encounter a bottleneck, an offloading policy supported by hardware cannot be customized, and some scenarios cannot achieve load balancing. And the forwarding thread is strongly related to the queue number of the network card, so that multi-core resources cannot be fully utilized, and in addition, the shunting strategy of hardware is only suitable for outer-layer packets, and cannot be realized if inner-layer packet shunting is based. For example: the outer layer is a tunnel, so that it cannot be satisfied if the packet is desired to be shunted based on the inner layer. In this example, if a layer of RSS (Receive Side Scaling) is added between the forwarding thread and the Network card (NIC), which is a Network card driving technology capable of efficiently distributing received messages among multiple CPUs in a multiprocessor system, flow is distributed and sent through software, and the bandwidth of the Network card is adapted to multiple cores, so as to meet the requirements of users to the maximum extent.
Specifically, in this example, the customizable splitting is implemented by using command configuration, which is described by taking software and hardware as an example, and may include the following steps:
s1: determining a performance requirement according to an application scene;
specifically, the specification of the server may be determined according to the traffic bandwidth and the service characteristics, for example, the network card model of the server, the core number of the CPU, the memory size, and the like are determined;
s2: the appropriate hardware and installed software is allocated.
The service can be deployed on a bare computer or a virtual machine, and during implementation, appropriate hardware resources can be allocated according to service characteristics, and an operating system or virtualization management software can be installed.
S3: allocating CPU resources;
because the forwarding domain has high requirement on time delay, in order to reduce switching between cores, the forwarding thread needs to be bound and exclusive by the cores; if the environment is a virtualized environment, the CPU and the vCPU need to be bound, and the CPU is set on a node of the same NUMA (Non Uniform Memory Access Architecture) to improve performance.
S4: allocating memory resources;
the virtualization environment needs to assign NUMA nodes to a virtual machine memory and allocate megapages to improve performance; the receiving and sending packet is a DPDK suite, and the operating system needs to reserve a macro page for the DPDK.
S5: distributing network card resources;
the network cards are more in type, some network cards support multiple queues, and some network cards do not support; the drive and firmware are also different, and the command presentation is also different; the network card is typically monopolized on the bare computer, and on the virtual machine, the network card may be a kernel virtual network card, may be a direct-through network card, or may be shared by multiple virtual machines in an IO virtualization manner. In the cloud platform, the cloud host can share the network card in a Single-root I/O virtualization (SR-IOV) mode so as to fully utilize the hardware capability of the network card.
Fig. 3 is a schematic diagram of an SR-IOV, in which a VF (Virtual Function) is a Function associated with a physical Function, and is a lightweight PCIe (peripheral component interconnect express) Function, and may share one or more physical resources with the physical Function and other VFs associated with the same physical Function. With SR-IOV enabled in the PF (Physical Function), the PCI configuration space of each VF can be accessed through the PF's bus, device and Function number (route ID). Each VF has a PCI memory space to map its set of registers. The VF device driver operates on the register set to enable its functionality and appears as an actual existing PCI device.
Specifically, the PF (Physical Function) is a PCI Function for supporting the SR-IOV Function, and the PF includes a SR-IOV Function structure for managing the SR-IOV Function. The PF is a full-function PCIe function that can be discovered, managed, and processed like any other PCIe device, and the PF has full configuration resources that can be used to configure or control the PCIe device.
VF (Virtual Function) is a Function that is associated with a physical Function. A VF is a lightweight PCIe function that may share one or more physical resources with a physical function and other VFs associated with the same physical function, the VF only allowing possession of configuration resources for its own behavior.
Each SR-IOV device may have one physical function PF and each PF may have up to 64,000 virtual functions VF associated with it. The PF may create the VF through registers designed with attributes specific to this purpose. Once the SR-IOV is enabled in the PF, the PCI configuration space of each VF may be accessed through the PF's bus, device and function number (route ID). Each VF has a PCI memory space to map its set of registers.
S6: setting the queue number and the shunting strategy of the network card;
in a Linux system, the number of the network card queues and the hardware shunting strategy of the network cards can be checked through an eththool tool; the DPDK suite transmits the number of queues, shunting strategies and the like to the drive of the DPDK of the network card when the network card is bound during initialization so as to complete setting;
s7: checking whether the shunting is successful and uniform;
in a Linux system, the number of queues and the packet receiving and sending conditions of each queue can be checked through ethtopool; the DPDK suite can check the packet receiving and sending conditions of each queue and determine whether the shunting is uniform or not through a CLI interface of the system;
the method in the above example is flexible, simple in command configuration and convenient to deploy, different shunting models are selected according to different performance requirements, and an upper shunting strategy is configured, so that most application scenarios can be basically met.
Specifically, the software offloading may be a special case of software and hardware offloading in combination as shown in fig. 4, and a hardware offloading without a network card is required. As shown in fig. 4, the two network cards do not support multiple queues, after the traffic is received by RSS, the software branches to different WORKs, after the WORKs are processed, the message is hung to the sending queue of RSS, and then the RSS sends the message through the network cards. The software distribution is suitable for the condition that the network card does not support multiple queues and has more core resources. However, the limitation of a single RSS is obvious, software distribution becomes a bottleneck, the RSS peak is probably 8MPPS, the network card bandwidth is about 20G, and a single RSS cannot meet the limitation when the RSS peak exceeds the limitation.
As shown in fig. 5, the soft and hard cooperation distribution may be performed by distributing to different RSS through network card hardware, then distributing to different WORK threads in RSS software, after the WORK is completed, hanging the packet to a sending queue, and then sending out the message through different network cards by RSS. Under the conditions of large network card bandwidth and a lot of core resources, the software and hardware cooperation shunting method can exert the potential of hardware to the maximum extent, and can easily realize linear forwarding of more than 100G in a software and hardware cooperation mode. As shown in fig. 5, in the multi-RSS splitting model example, two network cards each have two transceiving queues, the two network cards are first split into different RSS through hardware, the RSS is split into different WORKs through software, after the WORKs are processed, the messages are hung on the RSS sending queues, and then each RSS sends the messages through the network card.
For the implementation of the virtual machine network card direct connection, 2 network cards of 20G and the virtual machine direct connection are taken as examples, the distribution implemented by software and hardware is introduced, the receiving and sending packets use a DPDK suite, the RSS software distribution is introduced, and the implementation model is shown in fig. 5.
S1: as shown in fig. 6, the pass-through mode is set in the configuration file of the virtual machine:
s2: when the DPDK is initialized, the number of queues and a shunting strategy are set, wherein the number of the queues of the receiving and sending packets is equal to twice of that of an RSS instance, and the shunting strategy is related to a network card and is controlled by a macro switch.
S3: setting a software shunting strategy on a CLI interface, firstly selecting inner layer or outer layer packet based shunting, and then selecting a specific shunting strategy, as shown in fig. 7 and 8, the command can be configured according to the following steps:
# enter virtualized configuration mode
# enter interface configuration mode
# enable GRE based inner layer message distribution
The # selection is based on the splitting of the source IP and destination ports.
Specifically, whether the interface mode is based on inner-layer packet shunting is selected, and the default mode is based on outer-layer packet shunting; after enabling the inner layer packet to be shunted, the shunting rule takes effect on the inner layer packet. During software offloading, a default offload is based on an SIP (Session Initiation Protocol), which can be flexibly set by a command and configured on each interface.
S4: whether the forwarding instance is shunted evenly or not is checked, specifically, the shunting condition and where the performance bottleneck is can be checked through the diagnosis command, that is, as shown in fig. 9, the packet receiving and sending condition of each forwarding instance is checked through the diagnosis command, and whether the shunting is even or not can be judged.
For the implementation manner of the SR-IOV of the virtual machine, 2 100G network cards and a VF network card of the virtual machine are taken as an example for description, the SR-IOV adopts a software and hardware combined shunting manner, and since the bandwidth of the network cards is shared, it is assumed that the virtual machine needs to support 40G performance, and the main difference from the direct-through manner is that:
the configuration file of the virtual machine sets the configuration of the SR-IOV, and as shown in fig. 10, the configuration of the SR-IOV network card in the configuration file of the virtual machine is shown, where the upper line is the PCI of VF and the lower line is the mapped network card MAC address;
the VLAN of the VF is set by a command, as shown in fig. 11, which can be set and viewed on the host through an ip link command;
the PF network card forwards the flow according to the MAC and VLAN of the VF;
and setting the queue number and shunting strategy during DPDK initialization.
Based on the same inventive concept, the embodiment of the present invention further provides a flow dividing apparatus, as described in the following embodiments. Because the principle of the shunting device for solving the problems is similar to that of the shunting method, the implementation of the shunting device can refer to the implementation of the shunting method, and repeated details are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated. Fig. 12 is a block diagram of a shunt device according to an embodiment of the present invention, and as shown in fig. 12, the shunt device includes: the receiving module 1201, the splitting module 1202, and the sending module 1203, the structure of which will be described below.
A receiving module 1201, configured to receive a message to be processed from a target network card;
a shunting module 1202, configured to shunt the to-be-processed packet to multiple processing threads through software;
the sending module 1203 is configured to receive the messages processed by the multiple processing threads, and send the processed messages out through the target network card.
In an embodiment, the offloading module 1202 may specifically receive the to-be-processed packet after the target network card performs offloading processing through hardware, where the target network card offloads the to-be-processed packet according to the number of the receiving queues supported by the target network card.
In one embodiment, the sending module 1203 may specifically mount the processed packet on a sending queue; and sending the processed message out through the target network card.
In an embodiment, the distribution module 1202 may specifically distribute, through software, the to-be-processed packet to a plurality of processing threads according to a load balancing policy.
In an embodiment, the offloading module 1202 may specifically calculate a feature value of the to-be-processed packet according to a preset offloading policy; and distributing the message to be processed to a plurality of processing threads according to the characteristic value and a load balancing strategy.
In an embodiment, a configuration instruction for the preset offloading policy may also be received; and responding to the configuration instruction, and configuring the preset shunting strategy.
In one embodiment, the target network card may include, but is not limited to, at least one of the following: the network card supporting multiple queues and the network card not supporting multiple queues.
An embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the shunting method in the foregoing embodiment, where the electronic device specifically includes the following contents:
a processor 1, a memory, a communication interface and a bus;
the processor, the memory and the communication interface complete mutual communication through the bus; the processor is configured to call a computer program in the memory, and when executing the computer program, the processor implements all the steps in the shunting method in the foregoing embodiments, for example, when executing the computer program, the processor implements the following steps:
step 1: receiving a message to be processed from a target network card;
step 2: distributing the message to be processed to a plurality of processing threads through software;
and step 3: and receiving messages processed by a plurality of processing threads, and sending the processed messages out through the target network card.
As can be seen from the above description, in the embodiment of the present application, the to-be-processed packet from the network is shunted to the multiple processing threads through software, that is, shunted to the multi-core processing device for processing, so that the problem that the shunting effect is poor due to the fact that the shunting is performed only through the length of the receiving and sending queue supported by the network card itself in the prior art can be solved, the IO performance of the network card cannot be met, and the requirement of the multi-core advantage of the CPU can be fully utilized, thereby achieving the technical effect of utilizing the multi-core advantage while utilizing the IO performance of the network.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the shunting method in the foregoing embodiment, where the computer-readable storage medium stores a computer program, and the computer program implements all the steps of the shunting method in the foregoing embodiment when executed by a processor, for example, the processor implements the following steps when executing the computer program:
step 1: receiving a message to be processed from a target network card;
and 2, step: distributing the message to be processed to a plurality of processing threads through software;
and 3, step 3: and receiving messages processed by a plurality of processing threads, and sending the processed messages out through the target network card.
As can be seen from the above description, in the embodiment of the present application, the to-be-processed packet from the network is shunted to the multiple processing threads through software, that is, shunted to the multi-core processing device for processing, so that the problem that the current shunting effect is poor due to shunting only through the length of the transceiving queue supported by the network card itself cannot be solved, the requirement of utilizing the multi-core advantage of the CPU can be fully utilized while the IO performance of the network card is utilized is met, and the technical effect of utilizing the multi-core advantage while the IO performance of the network is utilized can be achieved.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A streaming method, comprising:
receiving a message to be processed from a target network card;
distributing the message to be processed to a plurality of processing threads through software;
receiving the messages processed by the plurality of processing threads, and sending out the processed messages through the target network card; wherein, the receiving the message to be processed from the target network card comprises:
and receiving the message to be processed after the target network card performs the shunting processing through hardware, wherein the target network card shunts the message to be processed according to the number of the supported receiving queues.
2. The method of claim 1, wherein sending the processed message through the target network card comprises:
mounting the processed message on a sending queue;
and sending the processed message out through the target network card.
3. The method of claim 1, wherein shunting the packet to be processed to a plurality of processing threads by software comprises:
and distributing the message to be processed to a plurality of processing threads according to a load balancing strategy through software.
4. The method of claim 3, wherein shunting the packets to be processed to a plurality of processing threads according to a load balancing policy comprises:
calculating the characteristic value of the message to be processed according to a preset shunting strategy;
and distributing the message to be processed to a plurality of processing threads according to the characteristic value and a load balancing strategy.
5. The method of claim 3, further comprising:
receiving a configuration instruction of a preset shunting strategy;
and responding to the configuration instruction, and configuring the preset shunting strategy.
6. The method of claim 1, wherein the target network card comprises at least one of: network cards supporting multiple queues and network cards not supporting multiple queues.
7. A flow diversion apparatus, comprising:
the receiving module is used for receiving the message to be processed from the target network card;
the shunting module is used for shunting the message to be processed to a plurality of processing threads through software;
the processing module is used for receiving the messages processed by the plurality of processing threads and sending the processed messages out through the target network card;
wherein, the receiving the message to be processed from the target network card comprises:
and receiving the message to be processed after the target network card performs the shunting processing through hardware, wherein the target network card shunts the message to be processed according to the number of the supported receiving queues.
8. A flow diversion system, comprising: network card, processing thread, shunting device of claim 7.
9. A processing device comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any of claims 1 to 6.
10. A computer readable storage medium having stored thereon computer instructions which, when executed, implement the steps of the method of any one of claims 1 to 6.
CN201811602922.4A 2018-12-26 2018-12-26 Shunting method, device and system, processing equipment and storage medium Active CN111371694B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811602922.4A CN111371694B (en) 2018-12-26 2018-12-26 Shunting method, device and system, processing equipment and storage medium
PCT/CN2019/103682 WO2020134153A1 (en) 2018-12-26 2019-08-30 Distribution method, system and processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811602922.4A CN111371694B (en) 2018-12-26 2018-12-26 Shunting method, device and system, processing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111371694A CN111371694A (en) 2020-07-03
CN111371694B true CN111371694B (en) 2022-10-04

Family

ID=71129611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811602922.4A Active CN111371694B (en) 2018-12-26 2018-12-26 Shunting method, device and system, processing equipment and storage medium

Country Status (2)

Country Link
CN (1) CN111371694B (en)
WO (1) WO2020134153A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073327B (en) * 2020-08-19 2023-02-24 广东省新一代通信与网络创新研究院 Anti-congestion software distribution method, device and storage medium
CN112235213B (en) * 2020-12-16 2021-04-06 金锐同创(北京)科技股份有限公司 SDN switch shunting method, system, terminal and storage medium
CN114095251B (en) * 2021-11-19 2024-02-13 南瑞集团有限公司 SSLVPN implementation method based on DPDK and VPP
CN115002046B (en) * 2022-05-26 2024-01-23 北京天融信网络安全技术有限公司 Message processing method, NUMA node, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104753814A (en) * 2013-12-31 2015-07-01 国家计算机网络与信息安全管理中心 Packet dispersion method based on network adapter
CN105871741A (en) * 2015-01-23 2016-08-17 阿里巴巴集团控股有限公司 Packet dispersion method and device
CN106713185A (en) * 2016-12-06 2017-05-24 瑞斯康达科技发展股份有限公司 Load balancing method and apparatus of multi-core CPU
WO2018099384A1 (en) * 2016-11-29 2018-06-07 中兴通讯股份有限公司 Packet load balancing method, apparatus and system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497322A (en) * 2011-12-19 2012-06-13 曙光信息产业(北京)有限公司 High-speed packet filtering device and method realized based on shunting network card and multi-core CPU (Central Processing Unit)
CN104811400B (en) * 2014-01-26 2018-04-06 杭州迪普科技股份有限公司 A kind of distributed network equipment
CN106487683A (en) * 2015-08-27 2017-03-08 中兴通讯股份有限公司 A kind of processing method and processing device of message
CN105577567B (en) * 2016-01-29 2018-11-02 国家电网公司 Network packet method for parallel processing based on Intel DPDK
US10432531B2 (en) * 2016-06-28 2019-10-01 Paypal, Inc. Tapping network data to perform load balancing
US10469386B2 (en) * 2017-05-17 2019-11-05 General Electric Company Network shunt with bypass
CN108092913B (en) * 2017-12-27 2022-01-25 杭州迪普科技股份有限公司 Message distribution method and multi-core CPU network equipment
CN108667733A (en) * 2018-03-29 2018-10-16 新华三信息安全技术有限公司 A kind of network equipment and message processing method
CN108984327B (en) * 2018-07-27 2020-12-01 新华三技术有限公司 Message forwarding method, multi-core CPU and network equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104753814A (en) * 2013-12-31 2015-07-01 国家计算机网络与信息安全管理中心 Packet dispersion method based on network adapter
CN105871741A (en) * 2015-01-23 2016-08-17 阿里巴巴集团控股有限公司 Packet dispersion method and device
WO2018099384A1 (en) * 2016-11-29 2018-06-07 中兴通讯股份有限公司 Packet load balancing method, apparatus and system
CN106713185A (en) * 2016-12-06 2017-05-24 瑞斯康达科技发展股份有限公司 Load balancing method and apparatus of multi-core CPU

Also Published As

Publication number Publication date
WO2020134153A1 (en) 2020-07-02
CN111371694A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
US11005755B2 (en) Packet processing method in cloud computing system, host, and system
US10491517B2 (en) Packet processing method in cloud computing system, host, and system
CN111371694B (en) Shunting method, device and system, processing equipment and storage medium
CN110113441B (en) Computer equipment, system and method for realizing load balance
US20100287262A1 (en) Method and system for guaranteed end-to-end data flows in a local networking domain
WO2016015559A1 (en) Bearer resource allocation method, apparatus and system for cloudified data center network
CN108401492B (en) Routing method, device and server based on mixed resources
US20180357086A1 (en) Container virtual switching
EP3629162B1 (en) Technologies for control plane separation at a network interface controller
EP3310011A1 (en) Load sharing method and related apparatus
CN105556929A (en) Network element and method of running applications in a cloud computing system
US11412059B2 (en) Technologies for paravirtual network device queue and memory management
WO2018057165A1 (en) Technologies for dynamically transitioning network traffic host buffer queues
US11271897B2 (en) Electronic apparatus for providing fast packet forwarding with reference to additional network address translation table
EP3652980B1 (en) Virtual anchoring in anchorless mobile networks
EP4111307A1 (en) Dynamic distributed local breakout determination
KR20170057770A (en) Method for controlling transsion of packet in virtual switch
CN110875823B (en) Data processing system and method for service plane
WO2024069219A1 (en) Receive side application auto-scaling
CN112988320A (en) Method and device for creating virtual machine
KAMALESWARI et al. AN EFFECTIVE CROSS RATE PACKET AGGREGATION SCHEME FOR VIRTUALIZED NETWORK CLOUD COMPUTING.

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
GR01 Patent grant
GR01 Patent grant