CN116886621B - Message forwarding control method, DPU and related equipment - Google Patents

Message forwarding control method, DPU and related equipment Download PDF

Info

Publication number
CN116886621B
CN116886621B CN202311146023.9A CN202311146023A CN116886621B CN 116886621 B CN116886621 B CN 116886621B CN 202311146023 A CN202311146023 A CN 202311146023A CN 116886621 B CN116886621 B CN 116886621B
Authority
CN
China
Prior art keywords
message
hash value
hardware
forwarding
processor
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
CN202311146023.9A
Other languages
Chinese (zh)
Other versions
CN116886621A (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.)
Zhuhai Xingyun Zhilian Technology Co Ltd
Original Assignee
Zhuhai Xingyun Zhilian 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 Zhuhai Xingyun Zhilian Technology Co Ltd filed Critical Zhuhai Xingyun Zhilian Technology Co Ltd
Priority to CN202311146023.9A priority Critical patent/CN116886621B/en
Publication of CN116886621A publication Critical patent/CN116886621A/en
Application granted granted Critical
Publication of CN116886621B publication Critical patent/CN116886621B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing

Abstract

The application discloses a message forwarding control method, a DPU and related equipment, wherein the method comprises the following steps: the processor receives a first message sent by a network side and matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of a first message calculated by hardware is obtained, the first hash value is put into an extension head, the first message and the extension head are forwarded to a virtual switch, the virtual switch obtains the first hash value through the extension head, and the first hash value is used for binding first related information of the first message. By adopting the method and the device, consistency of Hash values used by software and hardware can be ensured in the message forwarding process.

Description

Message forwarding control method, DPU and related equipment
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a packet forwarding control method, a DPU, and related devices.
Background
The complex and variable traffic in the cloud computing data center requires that the network support many functions to ensure traffic transmission, including load sharing, semi-offloading, egress port queue selection, computation of the source port of the tunnel packet outer user datagram protocol (user datagram protocol, UDP), etc., which all require that the packet be first subjected to a Hash computation, with the Hash value being used to identify a particular flow.
In practical application, when forwarding equipment forwards under the load sharing and port-out queue selection scene, if only software Hash is adopted, the correctness of message forwarding can be ensured. The correctness is reflected in that for the fragmented messages, forwarding equipment needs to ensure that all the fragmented messages travel the same forwarding path, otherwise, disorder of the messages is caused; for non-fragmented packets, the forwarding device needs to ensure that traffic is hashed evenly onto different transmit queues or different physical forwarding paths of the egress port. However, when the forwarding device performs hardware unloading to achieve hardware acceleration, inconsistent Hash values calculated by the software and the hardware can occur, which can cause that the corresponding forwarding action cannot be found in the software by the Hash value calculated by the hardware, so that the error forwarding is caused, and therefore, how to ensure the consistency of the Hash values used by the software and the hardware in the message forwarding process is needed to be solved.
Disclosure of Invention
The application provides a message forwarding control method, a DPU and related equipment, which can ensure consistency of Hash values used by software and hardware in a message forwarding process.
In a first aspect, the present application provides a packet forwarding control method applied to a data processor DPU, where the DPU includes a processor and a controller, and the controller includes a virtual switch, and the method includes:
The processor receives a first message sent by a network side;
the processor matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message;
the virtual switch obtains the first hash value through the extension head, forwards the first message, calculates a first port number of a first output port of the first message according to the first hash value, wherein the first hash value is used for binding first related information of the first message, and the first related information comprises at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; and the UDP source port number of the outer layer tunnel is the identification of the first message.
In a second aspect, the present application provides a data processor DPU comprising a processor and a controller, the controller comprising a virtual switch, wherein,
the processor is used for receiving a first message sent by a network side;
The processor is used for matching a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message;
the virtual switch is configured to obtain the first hash value through the extension header, forward the first packet, calculate a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used to bind first related information of the first packet, and the first related information includes at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; and the UDP source port number of the outer layer tunnel is the identification of the first message.
In a third aspect, the present application provides an electronic device comprising a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the first aspect of the present application, the electronic device comprising a data processing unit DPU.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform part or all of the steps as described in the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform part or all of the steps as described in the first aspect of the present application. The computer program product may be a software installation package.
By implementing the application, the method has the following beneficial effects:
it can be seen that the packet forwarding control method, the DPU and the related device described in the present application are applied to a data processor DPU, where the DPU includes a processor and a controller, the controller includes a virtual switch, the processor receives a first packet sent by a network side, the processor obtains a first hash value of the first packet calculated by hardware according to a first packet matching flow table, if the hardware flow table is not hit, the first hash value is put into an extension header, the first packet and the extension header are forwarded to the virtual switch, so as to forward the first packet in software, the virtual switch obtains the first hash value through the extension header, forwards the first packet, calculates a first port number of a first output port of the first packet according to the first hash value, the first hash value is used for binding first related information of the first packet, and the first related information includes at least one of: the method comprises the steps of a forwarding queue of a first output port, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading, wherein the external layer tunnel UDP source port number is the identifier of a first message. When the hardware receives the message, the Hash value is calculated, and the calculation method and the byte order of the Hash value can be configured by hardware default equipment or software. The software does not participate in the calculation of the Hash value, when the first packet of hardware is sent to the software, the Hash value calculated by the hardware is brought to the software through an extension head of a message, and the software uses the Hash value to carry out load sharing and send queue Hash or semi-unloading, so that the consistency of the Hash value used by the software and the hardware in the message forwarding process is ensured, namely the uniqueness of a Hash value data source in forwarding equipment is ensured, and the situations of disorder of fragmented messages, uneven load sharing and error of a semi-unloading behavior field (Action) are avoided.
Drawings
In order to more clearly illustrate the technical solutions of the present application or the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the prior art descriptions, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a packet forwarding control method of method 1 in the related art provided in the present application;
fig. 2 is a flow chart of a packet forwarding control method of method 2 in the related art provided in the present application;
fig. 3 is a schematic structural diagram of a DPU of a data processor provided in the present application;
fig. 4 is a flow chart of a message forwarding control method provided in the present application;
fig. 5 is a flow chart of another packet forwarding control method provided in the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in the present application;
fig. 7 is a block diagram of the functional unit components of yet another DPU provided in the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a detailed description of the present application will be provided below, with reference to the accompanying drawings, wherein it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims of the present application and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In a specific implementation, the electronic device referred to in the present application may be any electronic device including a DPU, where the electronic device may include, but is not limited to: smart phones, tablet computers, smart robots, smart projectors, conferencing devices, in-vehicle devices, wearable devices, servers, networking devices, computing devices, or other processing devices connected to wireless modems, as well as various forms of User Equipment (UE), mobile Stations (MSs), terminal devices (terminalservices), etc., without limitation.
In the implementation of the tunnel technology, the tunnel message header is added outside the original message sent by the OverLay network, so that the tunnel message is transmitted through the underway network. The tunnel header has a VNI field to identify different tenants. On a VTEP device for establishing a tunnel, when the tunnel is packaged in the outgoing direction, the information of different tenants is mapped into different VNIs for tunnel message packaging, and when the tunnel is unpacked in the incoming direction, the information is sent to different tenants according to the VNIs of the tunnel message. When the OVS forwards the tunnel message, the entering direction can generate a tunnel decapsulation table for tunnel decapsulation, and the exiting direction can generate a tunnel encapsulation table for tunnel encapsulation. And after the original message is matched with the OVS flow table, adding a tunnel message header in the generated tunnel encapsulation table to the outside of the original message to generate a tunnel message.
In this application, OVS (OpenvSwitch): openvSwitch is an open virtual switching standard. In particular, openvSwitch is a multi-layer virtual switching standard of product-level quality under the apache2.0 license of an open source. It aims to automate (configure, manage, maintain) a huge network through programming extensions while also supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, RSPAN, CLI, LACP,802.1 ag). In general, it is designed to support a vNet distributed vSwitch distributed across multiple physical servers, e.g., VMware or Cisco's Nexus1000V. Virtual switching is the formation of switch elements by means of software using virtual platforms.
In this application, DPDK, i.e., inteldataplanedevelopment kit, is a data plane development tool set provided by intel, and provides support for library functions and drivers for user space efficient packet processing under the Intel Architecture (IA) processor architecture. DPDK is understood as a software library used to accelerate packet data processing.
In this application, the data processor (data processing Unit, DPU): it is a major class of special purpose processors that has been developed recently, the third important computational power chip in data center scenarios following the CPU, GPU, to provide a compute engine for high bandwidth, low latency, data intensive computing scenarios. The DPU will act as an offload engine for the CPU, releasing the CPU's computing power to the upper layer applications.
Network virtualization is to be implemented in a cloud computing data center, and the most basic technology is layering. Currently, mainstream tunneling divides networks into underway and OverLay. Wherein, underway refers to a physical network, and consists of physical devices and physical links. OverLay is a tunneling technique, VXLAN, NVGRE and GENEVE are typical of three tunneling techniques, all of which are tunneling techniques that achieve over Lay two-layer network isolation. The principle of the tunneling technology is that after the original two-layer data frames of the OverLay are packaged, the data frames are transmitted through the UnderLay, and under the condition that the existing physical network is not modified, a plurality of virtual networks are created on the existing physical network through the tunneling technology, so that automation and intellectualization of the data center are realized.
In this application, there are also many methods for calculating Hash values, including a message digest algorithm (message digest algorithm, MD 5), a secure Hash algorithm (secure Hash algorithm, SHA), and a cryptographic algorithm SM3, and in a network system, only one algorithm is generally selected to calculate all the messages so as to ensure that the Hash value can identify a characteristic flow. When the output port queue is selected, different Hash values obtained by the forwarding device through Hash of the flow can be used for hashing the flow onto different queues, so that a plurality of queues are guaranteed to uniformly forward the message, and the message forwarding efficiency is improved; under the load sharing scene, different Hash values obtained by the forwarding device in the process of carrying out Hash on the common traffic can be used for selecting different forwarding paths, so that the traffic forwarding bandwidth is improved; for an inner layer message to be subjected to tunnel encapsulation, forwarding equipment needs to calculate an outer layer UDP source port according to different Hash values obtained by carrying out Hash on the inner layer message, and an underway network carries out Hash again through a five-tuple of the tunnel outer layer message, so that load sharing of the tunnel messages encapsulated by the different inner layer messages in the underway network is ensured; the forwarding equipment needs hardware to identify specific flow according to the Hash value calculated by the flow meter during semi-unloading, software finds out forwarding actions to be sent out for direct forwarding according to the Hash value, and software does not need to perform flow table matching searching forwarding according to the message.
In practical application, the OVS flow table is unloaded and started, when the forwarding device performs hardware unloading to achieve hardware acceleration, the first packet performs Hash calculation by software, and the subsequent message performs Hash calculation by hardware. If the matching is not good, the Hash values calculated by the software and the hardware are inconsistent with each other with a certain probability, and when the calculated Hash values are inconsistent, the problems of disorder of the fragmented messages, uneven Hash of the non-fragmented messages and the like are caused. After the OVS hardware is started to unload, similar problems exist in semi-unloading, and if the Hash value calculated by the software is inconsistent with the Hash value calculated by the hardware, the Hash value calculated by the hardware is likely to be unable to find a corresponding forwarding action in the software, so that erroneous forwarding is caused.
Aiming at the situation, after the OVS starts hardware unloading, an algorithm for requiring software and hardware to calculate the Hash value is required to be consistent with the obtained Hash calculation result, and the algorithm for calculating the Hash is selected and issued to the hardware when the forwarding equipment performs software initialization so as to ensure that the software and the hardware of the algorithm for calculating the Hash are consistent. However, the problem of size on the network device still exists, which results in that the Hash values obtained by the software and the hardware are not completely consistent.
In order to solve the problem of inconsistent size of software and hardware, the following 2 methods are adopted in the related technology.
Method 1: the software judges whether the running environment is large-end equipment or small-end equipment, and performs byte order conversion when the Hash is calculated by the first package according to different conditions, so that the byte order is consistent with the byte order of hardware operation, and the hardware does not need to convert the byte order.
Method 2: the software judges whether the running environment is a large-end device or a small-end device and informs the hardware, byte order conversion is not carried out when the first package calculates the Hash, and the hardware calculates the Hash value after byte order conversion according to the size of the software running device.
Referring to fig. 1, fig. 1 is a schematic flow chart of a packet forwarding control method of method 1 in the related art, as shown in fig. 1, in a specific implementation, after unloading of hardware is started, software judges a size end of an operating device, and issues hardware software to perform algorithm type selection of Hash calculation; after the hardware receives the first packet, soft switching is carried out, namely: hardware first package, detect if hit flow table? If not, the software forwards, the size end is judged, after the byte order conversion, the Hash value is calculated, namely, after the software receives the message, the byte order conversion is carried out according to the size end, the Hash value is calculated, the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating the UDP source port number of the outer layer tunnel and the identification semi-offload message; unloading the flow table to hardware, namely unloading the hardware flow table; if yes, obtaining a flow table action, forwarding by hardware, calculating a Hash value, namely, hard forwarding of a subsequent message is received by the hardware, and calculating the Hash value without byte order conversion, wherein the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating a UDP source port number of an outer layer tunnel and a semi-offload message.
Referring to fig. 2, fig. 2 is a flow chart of a method 2 for controlling message forwarding in the related art, as shown in fig. 2, in a specific implementation, software judges a size end of an operating device, and issues hardware software to perform algorithm type selection of Hash calculation and size end selection of the operating device; after the hardware receives the first packet, soft switching is carried out, namely: hardware first package, detect if hit flow table? If not, the software forwards, directly carries out Hash calculation, namely, the software directly calculates a Hash value after receiving the message, the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating the UDP source port number of the outer layer tunnel and the identification semi-offload message; unloading the flow table to hardware; if yes, obtaining a flow table action, forwarding by hardware, judging a size end, calculating a Hash value after byte order conversion, namely, receiving a subsequent message by the hardware, performing byte order conversion according to the size end condition issued by software, calculating the Hash value, wherein the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating an outer layer tunnel UDP source port number and an identification semi-offload message.
The above 2 methods in the related art all need to select a Hash algorithm and judge the size of the software running end equipment to ensure the consistency of software and hardware computing Hash values, and if configuration errors occur, the situation that the fragmented messages are disordered, load sharing is uneven and semi-unloading Action fields (actions) are wrong can be caused.
To solve the drawbacks of the related art, the present application provides a packet forwarding control method applied to a data processor DPU, where the DPU includes a processor and a controller, and the controller includes a virtual switch, and the method includes:
the processor receives a first message sent by a network side;
the processor matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message;
the virtual switch obtains the first hash value through the extension head, forwards the first message, calculates a first port number of a first output port of the first message according to the first hash value, wherein the first hash value is used for binding first related information of the first message, and the first related information comprises at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; and the UDP source port number of the outer layer tunnel is the identification of the first message.
By adopting the method, the problem of inconsistent calculated Hash values caused by inconsistent software and hardware size ends can be solved by the method of transmitting the Hash values calculated by hardware to software. When the hardware receives the message, the Hash value is calculated, and the calculation method and the byte order of the Hash value can be configured by hardware default equipment or software. The software does not participate in the calculation of the Hash value, when the first packet of hardware is sent to the software, the Hash value calculated by the hardware is brought to the software through the extension head of the message, the software uses the Hash value to carry out load sharing and send queue Hash or semi-unload, thereby ensuring the consistency of the Hash value used by the software and the hardware in the message forwarding process.
Referring to fig. 3, a schematic diagram of a data processor DPU10 is provided, where the DPU10 may include a controller 130 and a processor 120, and the controller 130 may include a virtual switch 131. The controller 130 is connected to the processor 120, and the processor receives a message (a first message, a second message, etc.) through the first network port 110, and the virtual switch 131 is used for performing a software forwarding process and a hardware unloading process.
In a specific implementation, as shown in paths 1 to 4 in fig. 3, in path 1, a processor receives a message during software forwarding, then performs flow table matching according to the message, if the corresponding flow table is not matched, the message is a first packet, a hash value of the message calculated by hardware is obtained, the hash value is put into an expansion header, and the message and the expansion header are forwarded to a virtual switch; in path 2, the virtual switch 131 receives the message through the first rep port (rep 1 in fig. 3), acquires the first hash value through the extension header, forwards the message, calculates the port number of the output port of the message according to the first hash value, and uses the hash value to bind the relevant information of the message, where the relevant information includes at least one of the following: the unique message identifier of the forwarding queue of the output port, the load sharing path, the UDP source port number of the outer layer tunnel and the semi-unloading; in path 3, the virtual switch sends the encapsulated packet to the processor 120 through the second rep port (rep 2 in fig. 3); in path 4, the processor 120 forwards the packet to the external network by forwarding it over the second port 140 (ethernet port).
In path 4, when the hardware is unloaded, the virtual switch 131 generates an accurate flow table, where the accurate flow table includes an action field, and the action field may include at least one of the following: port number of the output port, encapsulation action and encapsulation index; the exact flow table is offloaded to the processor 120. As shown in path 5 and path 6, in path 5, the processor 120 receives a packet, matches the packet to a flow table, directly forwards the packet in hardware, obtains a hash value of the packet calculated by hardware, and uses the hash value to bind second related information of the packet, and obtains an action field of the hit hardware flow table, where the action field includes at least one of: port number of the output port of the message, encapsulation operation, encapsulation index. Acquiring a corresponding tunnel encapsulation table according to the encapsulation index under a tunnel forwarding scene, forwarding the message, namely adding encapsulation content outside the message after indexing the encapsulation content in the tunnel encapsulation table according to the encapsulation index to obtain a tunnel message; directly finding out an output port for forwarding without editing the message under a common forwarding scene; in path 6, the processor 120 sends the tunnel message to the second portal 140, and the second portal 140 forwards the tunnel message to the external network.
For example, in a specific implementation, the method may include the following steps:
s1, as in path 1: and the hardware (processor) receives the first packet flow sent by the virtio-net, and forwards the first packet by the soft part according to the message matching flow table if the message is not hit, and forwards the first packet. When the first packet is sent up, the Hash value calculated by hardware is required to be put into an expansion head;
s2, as in path 2: the software obtains a Hash value calculated by hardware through an extension head, the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating a UDP source port number of an outer layer tunnel and a semi-offload message;
s3, as in path 3: the virtual-netrep 1 port of the software of the virtual switch receives the message and forwards the message, and the message output port is calculated as an eth rep2 port by the OVS;
s4, as in path 4: the OVS generates a flow table to be unloaded to hardware;
s5, as in path 5: the hardware receives the subsequent message, calculates a Hash value, the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, and calculating the UDP source port number of the outer layer tunnel and the identification semi-offload message;
s6, as in path 6: and inquiring the hit of the flow table, wherein the message output port is the second network port 140 (eth port), and sending the message out of the second network port 140 (eth port).
The present application is described in detail below.
Referring to fig. 4, fig. 4 is a flow chart of a message forwarding control method provided in the present application, which is applied to a data processor DPU shown in fig. 3, where the DPU includes a processor and a controller, and the controller includes a virtual switch, and the message forwarding control method may include the following steps:
s401, the processor receives a first message sent by a network side.
In this application, a data processor DPU may include a processor and a controller, the controller including a virtual switch. In a specific implementation, the network side may be understood as the network device side between the DPUs.
In a specific implementation, the first packet may be a first packet. The processor may receive a first packet sent by the network side, specifically, a traffic initiated from the virtio-net is called a downlink traffic.
S402, the processor matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, the first message and the extension head are forwarded to the virtual switch, and software forwarding is carried out on the first message.
The first hash value of the first message may be obtained by hardware calculation, that is, the hash value calculation is completed by the processor.
According to the method, the processor can match the flow table according to the first message, if the first message does not hit the hardware flow table, the first message is the first packet, the first hash value of the first message calculated by hardware is obtained, the first hash value is put into the extension head, and then the first message and the extension head are forwarded to the virtual switch, so that software forwarding of the first message is completed.
S403, the virtual switch acquires the first hash value through the extension head, forwards the first message, calculates a first port number of a first output port of the first message according to the first hash value, wherein the first hash value is used for binding first related information of the first message, and the first related information comprises at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; and the UDP source port number of the outer layer tunnel is the identification of the first message.
In this application, the first hash value may be used to bind first related information of the first packet, where the first related information may include at least one of the following: the forwarding queue of the first egress port, the load sharing path, the UDP source port number of the external layer tunnel, the unique identifier of the packet during semi-offloading, etc., which are not limited herein, where the UDP source port number of the external layer tunnel is the identifier of the first packet.
In a specific implementation, the virtual switch may obtain a first hash value through the extension header, forward the first message, and calculate a first port number of a first output port of the first message according to the first hash value.
Optionally, the method further comprises the following steps:
when the first output port has a plurality of forwarding queues, a corresponding target forwarding queue is selected according to the first hash value, and a message forwarding function is realized through the target forwarding queue.
In the application, aiming at forwarding queue selection, when a virtual switch has a plurality of queues at an output port, the forwarding performance of each queue is fixed, and as the Hash value can uniquely identify the message, in order to ensure that the message is uniformly forwarded at each queue during forwarding, the queues are selected through the Hash value, the messages with the same characteristics are sent to the fixed queues, and the messages with different characteristics are hashed to different queues as much as possible, so that the forwarding performance can be ensured to be exerted to the maximum.
Optionally, the method further comprises the following steps:
when the load sharing paths comprise a plurality of paths, selecting a corresponding target load sharing path according to the first hash value, and realizing a message forwarding function through the load sharing path.
In the present application, load sharing path selection refers to a function of sharing and sharing workload between a network device and a service processing entity, that is, a link load at a certain moment is relatively heavy, and loads of other links adjacent to the network are relatively light, where load sharing is used to distribute a user service request in the network to multiple links relatively evenly for processing, so as to avoid system breakdown caused by overload of a certain link. In a specific implementation, when the load sharing path includes multiple paths, the virtual switch selects a corresponding target load sharing path according to the first Hash value, and implements a message forwarding function through the load sharing path, and because the Hash value can uniquely identify a message, it is necessary to ensure that messages with the same characteristics walk a fixed link according to the Hash value, and the messages with different characteristics Hash to different links as much as possible.
Optionally, the method further comprises the following steps:
the virtual switch generates an accurate flow table; the precision flow table includes a first action field including at least one of: the first port number, the first encapsulation action, and the first encapsulation index;
the virtual switch offloads the precise flow table to the processor according to the first related information.
In a specific implementation, the port is directly found out for forwarding under a common forwarding scene.
In a specific implementation, a corresponding tunnel encapsulation table is obtained according to an encapsulation index in a tunnel forwarding scene, and a message is forwarded, namely after encapsulation content is indexed in the tunnel encapsulation table according to the encapsulation index, the encapsulation content is added outside the message, and a tunnel message is obtained. The hardware receives the message and calculates a Hash value, the Hash value is sent to the controller through the message expansion head, the controller encapsulates the inner layer message when a tunnel encapsulation scene exists, and the UDP source port number contained in the encapsulated tunnel head is obtained by converting after calculating the Hash value.
In a specific implementation, the UDP source port number is associated with a Hash value in the extension header, and the tunnel encapsulation table associated with the first encapsulation index does not necessarily include the UDP source port number. The Hash value is calculated by hardware and put into the extension header, and the controller directly extracts the Hash value from the extension header.
In this application, for half offloading, the first packet: the hardware gives the Hash value to the virtual switch, the virtual switch generates a flow table and guides forwarding, the flow table and the Hash value are unloaded to the hardware when the flow table is unloaded, and meanwhile the virtual switch generates a flow table action corresponding to the Hash value; the subsequent message hits the hard transfer table, the Hash value and the hit hardware flow table are marked to the virtual switch, and after the virtual switch checks the hit hardware flow table, the virtual switch checks the Hash value to obtain the action corresponding to the flow, and the forwarding is carried out.
In this application, the precision flow table may include a first action field (action), which may include at least one of: the first port number, the first encapsulation action, and the first encapsulation index are not limited herein.
In particular implementations, the virtual switch may generate an exact flow table. The virtual switch can unload the accurate flow table to the processor according to the first related information, namely, in the unloading process, the forwarding queue of the port, the load sharing path, the calculation of the UDP source port number of the outer layer tunnel and the unique message identification in the semi-unloading process can be selected to finish the unloading of the accurate flow table to the processor.
In the application, a Hash value calculated by hardware is put in an extension head and sent to software, and a software receiving packet acquires the Hash value from the extension head and is used for selecting a forwarding queue of a port, a load sharing path, calculation of an external layer tunnel UDP source port number and a unique message identifier in semi-unloading. In the forwarding equipment system, the data source of the Hash value can only be hardware, so that the uniqueness of the data is guaranteed, and the consistency of the Hash values of software and hardware is guaranteed through multiple measures.
Optionally, the method may include the following steps:
the processor acquires the environmental parameters of the target application; the processor determines a target hash algorithm configuration parameter corresponding to the target application environment parameter, the target hash algorithm configuration parameter comprising at least one of: a target hash algorithm, algorithm control parameters of the target hash algorithm; and the processor calculates the hash value of the first message according to the hardware of the configuration parameter of the target hash algorithm.
In the present application, the target application environment parameter is used to describe a parameter of the running environment, and the target application environment parameter may include at least one of the following: network rate, network bandwidth, hardware model, operating current, operating voltage, operating power, operating temperature, memory size, etc., are not limited herein. The hash algorithm configuration parameters may include at least one of: the hash algorithm and the algorithm control parameter of the target hash algorithm can comprise at least one of the following: MD5, SHA, SM3, etc., are not limited herein. The algorithm control parameters of the hash algorithm are used for controlling the operation effect of the hash algorithm, and the hash values obtained by the algorithm control parameters of different hash algorithms may be different, or the calculation efficiency of the hash values may be different.
In a specific implementation, a mapping relation between a preset application environment parameter and a hash algorithm configuration parameter may be stored in advance, and further, a target hash algorithm configuration parameter corresponding to the target application environment parameter may be determined according to the mapping relation, where the target hash algorithm configuration parameter includes at least one of the following: the processor may configure parameter hardware to calculate the hash value of the first message according to the target hash algorithm.
Optionally, the method further comprises the following steps:
the processor receives a second message sent by a network side; the processor matches a flow table according to the second message; if the hardware flow table is hit, the processor acquires a second hash value of the second message calculated by hardware, wherein the second hash value is used for binding second related information of the second message, and the second related information comprises at least one of the following: a forwarding queue of a second output port of the second message, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading; the UDP source port number of the outer layer tunnel is the identifier of the second message;
obtaining a second action field of the hit hardware flow table, the second action field comprising at least one of: a second port number of the output port of the second message, a second encapsulation operation and a second encapsulation index; and acquiring a corresponding tunnel encapsulation table according to the second encapsulation index in a tunnel forwarding scene to encapsulate the second message, wherein editing of the second message is not required in a common forwarding scene, and forwarding the second message by combining the second related information.
In the application, the processor receives a second message sent by the network side, and if the processor hits the hardware flow table according to the second message matching flow table, it is explained that the second message is not a first packet, and then the processor obtains a second hash value of the second message calculated by hardware, where the second hash value is used to bind second related information of the second message, and the second related information includes at least one of the following: a forwarding queue of a second output port of the second message, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading; the UDP source port number of the outer layer tunnel is the identification of the second message.
Further, a second action field of the hit hardware flow table may be obtained, the second action field comprising at least one of: the method comprises the steps of obtaining a corresponding tunnel encapsulation table and second related information according to a second encapsulation index, directly forwarding the second message, specifically, adding encapsulation content outside the second message after the encapsulation content is indexed in the tunnel encapsulation table according to the second encapsulation index in a tunnel forwarding scene to obtain a tunnel message, sending the tunnel message to an output port of the second message by a processor, and directly sending the second message to the output port of the second message without editing the second message in a common forwarding scene, and forwarding the tunnel message to an external network by the output port of the second message.
In the application, when the hardware performs message uploading in case of table lookup miss, the Hash value calculated by the hardware is required to be put in an extension head and sent to software, and the software receives a packet to obtain the Hash value from the extension head and is used for selecting a forwarding queue of a port, a load sharing path, calculation of a UDP source port number of an outer layer tunnel and unique message identification in case of semi-unloading. In the forwarding equipment system, the data source of the Hash value can only be hardware, so that the uniqueness of the data is guaranteed, and the consistency of the Hash values of software and hardware is guaranteed through multiple measures.
By way of illustration, as shown in fig. 5, detect whether or not software configures the Hash algorithm? If yes, issue the Hash algorithm type to hardware, the hardware first package, calculate the Hash value, detect the hit stream table? If not, putting the Hash value into an expansion head, receiving a packet by software, taking the Hash value from the expansion head, unloading a hardware flow table, and if so, acquiring the flow table action and forwarding by hardware.
In specific implementation, during initialization, whether the software needs to perform Hash algorithm configuration on hardware or not can be determined according to an application scene, if not, a hardware default Hash algorithm is used, and if so, the software issues the selected Hash algorithm to the hardware; the hardware receives the first packet, carries out Hash calculation on the message, searches for the missing of the flow table, and carries out uploading on the message. When the message is sent, the calculated Hash value is placed behind the extension head and is inserted in front of the message, and then the message with the extension head is placed in the descriptor; the packet receiving module receives the message from the descriptor, shifts the message, and then receives the Hash value in front of the message, the Hash value is used for selecting a forwarding queue of a port, selecting a load sharing path, calculating an outer layer tunnel UDP source port number and an identification semi-offload message, the OVS receives the message, performing soft transfer, generating a flow table, if the flow table hardware offload is started, offloading the flow table to the hardware, the hardware receives a subsequent message, calculating the Hash value, the Hash value is used for selecting the forwarding queue of the port, selecting the load sharing path, and calculating the outer layer tunnel UDP source port number and the identification semi-offload message. The hardware queries the flow table, hits the flow table unloaded before, and carries out the hardware forwarding of the flow table.
In the method, the calculation of the Hash value is uniformly completed by hardware, and then the Hash value is sent to the software through the message extension head, so that the software does not participate in the calculation of the Hash, and the consistency of the use of the Hash value by the software and the hardware is ensured.
In the specific implementation, after the OVS flow table is unloaded, hardware puts the calculated Hash value into an extension header of a message to send software, after the software acquires the Hash value from the extension header, the software selects a forwarding queue of a port, selects a load sharing path, calculates the number of a UDP source port of an outer layer tunnel, identifies a semi-unloaded message and other information, and the subsequent message directly carries out hardware forwarding in the hardware hit flow table.
It can be seen that the packet forwarding control method described in the present application is applied to a data processor DPU, where the DPU includes a processor and a controller, the controller includes a virtual switch, the processor receives a first packet sent by a network side, the processor matches a flow table according to the first packet, if the flow table is not hit, obtains a first hash value of the first packet calculated by hardware, places the first hash value in an extension header, forwards the first packet and the extension header to the virtual switch, so as to forward the first packet in software, the virtual switch obtains the first hash value through the extension header, forwards the first packet, calculates a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used for binding first related information of the first packet, and the first related information includes at least one of: the method comprises the steps that a forwarding queue of a first output port, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading are identified, the external layer tunnel UDP source port number is the identifier of the first message, a Hash value is calculated when a message is received by hardware, and a calculation method and a byte order of the Hash value can be configured by hardware default equipment or software. The software does not participate in the calculation of the Hash value, when the first packet of hardware is sent to the software, the Hash value calculated by the hardware is brought to the software through the extension head of the message, the software uses the Hash value to carry out load sharing and send queue Hash or semi-unloading, so that the consistency of the Hash value used by the software and the hardware in the message forwarding process is ensured, namely the uniqueness of a Hash value data source in forwarding equipment is ensured, and the situations of disorder of fragmented messages, uneven load sharing and semi-unloading Action errors are avoided.
In accordance with the above embodiments, referring to fig. 6, fig. 6 is a schematic structural diagram of an electronic device provided in the present application, where the electronic device includes a DPU, and the DPU includes a processor and a controller, and the controller includes a virtual switch, and further includes a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and where the programs include instructions for performing the following steps:
the processor receives a first message sent by a network side;
the processor matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message;
the virtual switch obtains the first hash value through the extension head, forwards the first message, calculates a first port number of a first output port of the first message according to the first hash value, wherein the first hash value is used for binding first related information of the first message, and the first related information comprises at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; and the UDP source port number of the outer layer tunnel is the identification of the first message.
Optionally, the above program further comprises instructions for performing the steps of:
when the first output port has a plurality of forwarding queues, a corresponding target forwarding queue is selected according to the first hash value, and a message forwarding function is realized through the target forwarding queue.
Optionally, the above program further comprises instructions for performing the steps of:
when the load sharing paths comprise a plurality of paths, selecting a corresponding target load sharing path according to the first hash value, and realizing a message forwarding function through the load sharing path.
Optionally, the above program further comprises instructions for performing the steps of:
the virtual switch generates an accurate flow table; the precision flow table includes a first action field including at least one of: the first port number, the first encapsulation action, and the first encapsulation index;
the virtual switch offloads the precise flow table to the processor according to the first related information.
Optionally, the above program further comprises instructions for performing the steps of:
the processor acquires the environmental parameters of the target application;
the processor determines a target hash algorithm configuration parameter corresponding to the target application environment parameter, the target hash algorithm configuration parameter comprising at least one of: a target hash algorithm, algorithm control parameters of the target hash algorithm;
And the processor calculates the hash value of the first message according to the hardware of the configuration parameter of the target hash algorithm.
Optionally, the above program further comprises instructions for performing the steps of:
the processor receives a second message sent by a network side;
the processor matches a flow table according to the second message;
if the hardware flow table is hit, the processor acquires a second hash value of the second message calculated by hardware, wherein the second hash value is used for binding second related information of the second message, and the second related information comprises at least one of the following: a forwarding queue of a second output port of the second message, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading; the UDP source port number of the outer layer tunnel is the identifier of the second message;
obtaining a second action field of the hit hardware flow table, the second action field comprising at least one of: a second port number of the output port of the second message, a second encapsulation operation and a second encapsulation index; and acquiring a corresponding tunnel encapsulation table according to the second encapsulation index in a tunnel forwarding scene to encapsulate the second message, wherein editing of the second message is not required in a common forwarding scene, and forwarding the second message by combining the second related information.
It can be seen that, in the electronic device described in the present application, the electronic device includes a data processor DPU, where the DPU includes a processor and a controller, the controller includes a virtual switch, the processor receives a first packet sent by a network side, the processor matches a flow table according to the first packet, if the flow table is not hit by hardware, obtains a first hash value of the first packet calculated by the hardware, places the first hash value in an extension header, forwards the first packet and the extension header to the virtual switch, so as to forward the first packet in software, the virtual switch obtains the first hash value by the extension header, forwards the first packet, calculates a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used for binding first related information of the first packet, and the first related information includes at least one of: the method comprises the steps that a forwarding queue of a first output port, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading are identified, the external layer tunnel UDP source port number is the identifier of the first message, a Hash value is calculated when a message is received by hardware, and a calculation method and a byte order of the Hash value can be configured by hardware default equipment or software. The software does not participate in the calculation of the Hash value, when the first packet of hardware is sent to the software, the Hash value calculated by the hardware is brought to the software through the extension head of the message, the software uses the Hash value to carry out load sharing and send queue Hash or semi-unloading, so that the consistency of the Hash value used by the software and the hardware in the message forwarding process is ensured, namely the uniqueness of a Hash value data source in forwarding equipment is ensured, and the situations of disorder of fragmented messages, uneven load sharing and semi-unloading Action errors are avoided.
Fig. 7 is a functional unit block diagram of still another DPU10 referred to in the present application. The DPU10 comprises a processor 120 and a controller, which comprises a virtual switch 131, wherein,
the processor 120 is configured to receive a first packet sent by a network side;
the processor 120 is configured to match a flow table according to the first packet; if the hardware flow table is not hit, acquiring a first hash value of the first message calculated by hardware, putting the first hash value into an extension header, and forwarding the first message and the extension header to the virtual switch 131 so as to perform software forwarding on the first message;
the virtual switch 131 is configured to obtain the first hash value through the extension header, forward the first packet, calculate a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used to bind first related information of the first packet, and the first related information includes at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; the UDP source port number of the outer layer tunnel is the identification of the first message;
Optionally, the DPU10 may also be used to implement the following functions:
when the first output port has a plurality of forwarding queues, a corresponding target forwarding queue is selected according to the first hash value, and a message forwarding function is realized through the target forwarding queue.
Optionally, the DPU10 may also be used to implement the following functions:
when the load sharing paths comprise a plurality of paths, selecting a corresponding target load sharing path according to the first hash value, and realizing a message forwarding function through the load sharing path.
Optionally, the DPU10 may also be used to implement the following functions:
the virtual switch generates an accurate flow table; the precision flow table includes a first action field including at least one of: the first port number, the first encapsulation action, and the first encapsulation index;
the virtual switch offloads the precise flow table to the processor according to the first related information.
Optionally, the DPU10 may also be used to implement the following functions:
the processor 120 is configured to obtain a target application environment parameter;
the processor 120 is configured to determine a target hash algorithm configuration parameter corresponding to the target application environment parameter, where the target hash algorithm configuration parameter includes at least one of: a target hash algorithm, algorithm control parameters of the target hash algorithm;
The processor 120 is configured to calculate a hash value of the first packet according to the target hash algorithm configuration parameter hardware.
Optionally, the DPU10 may also be used to implement the following functions:
the processor 120 is configured to receive a second packet sent by the network side;
the processor 120 is configured to match a flow table according to the second packet;
if the hardware flow table is hit, the processor 120 is configured to obtain a second hash value of the second packet calculated by hardware, where the second hash value is used to bind second related information of the second packet, and the second related information includes at least one of the following: a forwarding queue of a second output port of the second message, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading; the UDP source port number of the outer layer tunnel is the identifier of the second message;
obtaining a second action field of the hit hardware flow table, the second action field comprising at least one of: a second port number of the output port of the second message, a second encapsulation operation and a second encapsulation index; and acquiring a corresponding tunnel encapsulation table according to the second encapsulation index in a tunnel forwarding scene to encapsulate the second message, wherein editing of the second message is not required in a common forwarding scene, and forwarding the second message by combining the second related information.
It can be seen that, the data processor DPU described in the present application includes a processor and a controller, where the controller includes a virtual switch, the processor receives a first packet sent by a network side, the processor obtains a first hash value of the first packet calculated by hardware according to a first packet matching flow table if the hardware flow table is not hit, and forwards the first packet and the extension header to the virtual switch to perform software forwarding on the first packet, the virtual switch obtains the first hash value through the extension header, forwards the first packet, calculates a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used to bind first related information of the first packet, and the first related information includes at least one of: the method comprises the steps of a forwarding queue of a first output port, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading, wherein the external layer tunnel UDP source port number is the identifier of the first message, a Hash value is calculated when a message is received by hardware, and a calculation method and a byte order of the Hash value can be configured by hardware default equipment or software. The software does not participate in the calculation of the Hash value, when the first packet of hardware is sent to the software, the Hash value calculated by the hardware is brought to the software through the extension head of the message, the software uses the Hash value to carry out load sharing and send queue Hash or semi-unloading, so that the consistency of the Hash value used by the software and the hardware in the message forwarding process is ensured, namely the uniqueness of a Hash value data source in forwarding equipment is ensured, and the situations of disorder of fragmented messages, uneven load sharing and semi-unloading Action errors are avoided.
It may be understood that the functions of each program module of the DPU of the present embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not repeated herein.
The present application also provides a computer storage medium storing a computer program for electronic data exchange, the computer program causing a computer to perform part or all of the steps of any one of the methods described in the method embodiments above, the computer including a DPU.
The present application also provides a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform part or all of the steps of any one of the methods described in the method embodiments above. The computer program product may be a software installation package, said computer comprising a DPU.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, such as the above-described division of units, merely a division of logic functions, and there may be additional manners of dividing in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over 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 application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a memory, including several instructions for causing a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the above-mentioned method of the various embodiments of the present application. And the aforementioned memory includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program that instructs associated hardware, and the program may be stored in a computer readable memory, which may include: flash disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing has outlined rather broadly the more detailed description of the present application, wherein specific examples have been provided to illustrate the principles and embodiments of the present application, the description of the examples being provided solely to assist in the understanding of the method of the present application and the core concepts thereof; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. The message forwarding control method is characterized by being applied to a Data Processor (DPU), wherein the DPU comprises a processor and a controller, the controller comprises a virtual switch, the DPU is used for carrying a Hash value calculated by hardware to software through an extension head of a message when the DPU is sent to the software on first packet hardware, the software uses the Hash value to carry out load sharing, and a sending queue hashes or semi-uninstallation so as to ensure consistency of the Hash value used by the software and the hardware in the message forwarding process; the method comprises the following steps:
The processor receives a first message sent by a network side;
the processor matches a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message; the first hash value of the first message is obtained by means of hardware calculation;
the virtual switch obtains the first hash value through the extension head, forwards the first message, calculates a first port number of a first output port of the first message according to the first hash value, wherein the first hash value is used for binding first related information of the first message, and the first related information comprises at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; the UDP source port number of the outer layer tunnel is the identification of the first message;
wherein the method further comprises:
the processor acquires the environmental parameters of the target application; the target application environment parameters include at least one of: network rate, network bandwidth, hardware model, operating current, operating voltage, operating power, operating temperature, and memory size;
The processor determines a target hash algorithm configuration parameter corresponding to the target application environment parameter, the target hash algorithm configuration parameter comprising at least one of: a target hash algorithm, algorithm control parameters of the target hash algorithm; the algorithm control parameters of the target hash algorithm are used for controlling the operation effect of the target hash algorithm;
and the processor calculates the hash value of the first message according to the hardware of the configuration parameter of the target hash algorithm.
2. The method according to claim 1, wherein the method further comprises:
when the first output port has a plurality of forwarding queues, a corresponding target forwarding queue is selected according to the first hash value, and a message forwarding function is realized through the target forwarding queue.
3. The method according to claim 1, wherein the method further comprises:
when the load sharing paths comprise a plurality of paths, selecting a corresponding target load sharing path according to the first hash value, and realizing a message forwarding function through the load sharing path.
4. The method according to claim 1, wherein the method further comprises:
The virtual switch generates an accurate flow table; the precision flow table includes a first action field including at least one of: the first port number, the first encapsulation action, and the first encapsulation index;
the virtual switch offloads the precise flow table to the processor according to the first related information.
5. The method according to claim 1, wherein the method further comprises:
the processor receives a second message sent by a network side;
the processor matches a flow table according to the second message;
if the hardware flow table is hit, the processor acquires a second hash value of the second message calculated by hardware, wherein the second hash value is used for binding second related information of the second message, and the second related information comprises at least one of the following: a forwarding queue of a second output port of the second message, a load sharing path, an external layer tunnel UDP source port number and a message unique identifier in semi-unloading; the UDP source port number of the outer layer tunnel is the identifier of the second message;
obtaining a second action field of the hit hardware flow table, the second action field comprising at least one of: a second port number of the output port of the second message, a second encapsulation operation and a second encapsulation index; and acquiring a corresponding tunnel encapsulation table according to the second encapsulation index in a tunnel forwarding scene to encapsulate the second message, wherein editing of the second message is not required in a common forwarding scene, and forwarding the second message by combining the second related information.
6. The DPU is used for carrying out load sharing by the software through a Hash value calculated by the hardware by an expansion head of a message when the DPU is sent to the software on first packet hardware, and sending queue Hash or semi-unloading by the software so as to ensure consistency of the Hash value used by the software and the hardware in the message forwarding process; wherein,
the processor is used for receiving a first message sent by a network side;
the processor is used for matching a flow table according to the first message; if the hardware flow table is not hit, a first hash value of the first message calculated by hardware is obtained, the first hash value is put into an extension head, and the first message and the extension head are forwarded to the virtual switch so as to carry out software forwarding on the first message;
the virtual switch is configured to obtain the first hash value through the extension header, forward the first packet, calculate a first port number of a first output port of the first packet according to the first hash value, where the first hash value is used to bind first related information of the first packet, and the first related information includes at least one of the following: the forwarding queue of the first output port, the load sharing path, the UDP source port number of the outer layer tunnel and the unique message identifier in semi-unloading are identified; the UDP source port number of the outer layer tunnel is the identification of the first message;
Wherein, the DPU is also specifically used for:
the processor acquires the environmental parameters of the target application; the target application environment parameters include at least one of: network rate, network bandwidth, hardware model, operating current, operating voltage, operating power, operating temperature, and memory size;
the processor determines a target hash algorithm configuration parameter corresponding to the target application environment parameter, the target hash algorithm configuration parameter comprising at least one of: a target hash algorithm, algorithm control parameters of the target hash algorithm; the algorithm control parameters of the target hash algorithm are used for controlling the operation effect of the target hash algorithm;
and the processor calculates the hash value of the first message according to the hardware of the configuration parameter of the target hash algorithm.
7. The DPU of claim 6, wherein the DPU is further specifically configured to:
when the first output port has a plurality of forwarding queues, a corresponding target forwarding queue is selected according to the first hash value, and a message forwarding function is realized through the target forwarding queue.
8. An electronic device comprising a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
9. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-5.
CN202311146023.9A 2023-09-07 2023-09-07 Message forwarding control method, DPU and related equipment Active CN116886621B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311146023.9A CN116886621B (en) 2023-09-07 2023-09-07 Message forwarding control method, DPU and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311146023.9A CN116886621B (en) 2023-09-07 2023-09-07 Message forwarding control method, DPU and related equipment

Publications (2)

Publication Number Publication Date
CN116886621A CN116886621A (en) 2023-10-13
CN116886621B true CN116886621B (en) 2023-12-19

Family

ID=88272077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311146023.9A Active CN116886621B (en) 2023-09-07 2023-09-07 Message forwarding control method, DPU and related equipment

Country Status (1)

Country Link
CN (1) CN116886621B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180127859A (en) * 2017-05-22 2018-11-30 아토리서치(주) Method, apparatus and computer program for distributing traffic to in-line virtual network function in software defined networking environment
CN113965518A (en) * 2020-07-03 2022-01-21 华为技术有限公司 Message processing method and device
CN115134315A (en) * 2022-09-01 2022-09-30 珠海星云智联科技有限公司 Message forwarding method and related device
CN115941598A (en) * 2023-03-09 2023-04-07 珠海星云智联科技有限公司 Flow table semi-uninstalling method, device and medium
WO2023110025A1 (en) * 2021-12-13 2023-06-22 Continental Automotive Technologies GmbH Method and processor circuit for securing a code against manipulation by application software, motor vehicle control unit, and motor vehicle having a control unit of this type
CN116455836A (en) * 2023-03-20 2023-07-18 阿里巴巴(中国)有限公司 Intelligent network card, cloud server and traffic forwarding method
CN116545921A (en) * 2023-05-31 2023-08-04 珠海星云智联科技有限公司 Message forwarding method, device, equipment and storage medium based on ECMP

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220114270A1 (en) * 2020-12-26 2022-04-14 Intel Corporation Hardware offload circuitry

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180127859A (en) * 2017-05-22 2018-11-30 아토리서치(주) Method, apparatus and computer program for distributing traffic to in-line virtual network function in software defined networking environment
CN113965518A (en) * 2020-07-03 2022-01-21 华为技术有限公司 Message processing method and device
WO2023110025A1 (en) * 2021-12-13 2023-06-22 Continental Automotive Technologies GmbH Method and processor circuit for securing a code against manipulation by application software, motor vehicle control unit, and motor vehicle having a control unit of this type
CN115134315A (en) * 2022-09-01 2022-09-30 珠海星云智联科技有限公司 Message forwarding method and related device
CN115941598A (en) * 2023-03-09 2023-04-07 珠海星云智联科技有限公司 Flow table semi-uninstalling method, device and medium
CN116455836A (en) * 2023-03-20 2023-07-18 阿里巴巴(中国)有限公司 Intelligent network card, cloud server and traffic forwarding method
CN116545921A (en) * 2023-05-31 2023-08-04 珠海星云智联科技有限公司 Message forwarding method, device, equipment and storage medium based on ECMP

Also Published As

Publication number Publication date
CN116886621A (en) 2023-10-13

Similar Documents

Publication Publication Date Title
US11716409B2 (en) Packet transmission method and apparatus
US10263916B2 (en) System and method for message handling in a network device
WO2022088743A1 (en) Flow table processing method and related device
WO2017025021A1 (en) Method and device for processing flow table
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
TWI721103B (en) Cluster accurate speed limiting method and device
US20150188824A1 (en) Link aggregation (lag) information exchange protocol
CN109936492B (en) Method, device and system for transmitting message through tunnel
KR102025680B1 (en) SDN based ARP implementation method and device
US20210359952A1 (en) Technologies for protocol-agnostic network packet segmentation
CN105531967B (en) Message transmission method, device and communication system
CN111193756B (en) VXLAN tunnel load balancing method and related equipment
CN117240790A (en) Flow table rule management method, flow management system and storage medium
US20210092058A1 (en) Transmission of high-throughput streams through a network using packet fragmentation and port aggregation
CN116886621B (en) Message forwarding control method, DPU and related equipment
CN112087382B (en) Service routing method and device
US10374944B2 (en) Quality of service for data transmission
WO2019084805A1 (en) Method and apparatus for distributing message
US20220166721A1 (en) Traffic balancing method, network device, and electronic device
WO2015096734A1 (en) Downlink transmission method for service data, and packet data gateway
WO2015039616A1 (en) Method and device for packet processing
CN116319535A (en) Path switching method, path switching device, network equipment and network system
CN113497767A (en) Method and device for transmitting data, computing equipment and storage medium
WO2023078144A1 (en) Message processing method, apparatus and system
CN116996478A (en) Tunnel encapsulation table resource management method, DPU and related equipment

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