User data packet protocol tunnel encapsulation unloading method, computer equipment and medium
The user packet protocol tunnel encapsulation is carried out through the software side and the five-tuple information is parsed by the hardware side to update the packaging table, which solves the problems of complex hardware processing logic and high software adaptability in the existing technology, and realizes efficient tunnel encapsulation and resources save.
Patent Information
- Application Number
- CN202411373010.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-10
AI Technical Summary
In the prior art, user packet protocol tunnel packaging operation has high requirements for hardware processing logic, resulting in complex software and hardware collaboration, high requirements for software and kernel version adaptability, and low-version kernels may not be able to support it, affecting system performance and resource utilization. .
User packet protocol tunnel packaging is performed through the software side, and the hardware side analyzes five-tuple information to update the tunnel message packaging table, reducing the hardware processing logic requirements, simplifying the software and hardware coupling, and improving tunnel packaging efficiency.
It reduces the adaptability requirements of software and kernel versions, simplifies the uninstallation complexity, improves the efficiency of user packet protocol tunnel packaging, saves resource overhead, has wider adaptability, and improves performance.
Smart Images

Figure CN119109884A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, computer equipment and medium for encapsulating and unloading a user data packet protocol tunnel. Background Art
[0002] User Datagram Protocol (UDP) is a connectionless and unreliable transport layer protocol. A large number of network interfaces use UDP to support routing and datagram encapsulation, and UDP tunnel encapsulation is developed based on UDP. Without any modification to the existing physical network, multiple virtual networks are created on the existing physical network through tunnel technology, realizing the automation and intelligence of the data center. Therefore, UDP tunnel encapsulation, also known as User Datagram Protocol tunnel encapsulation, is widely used in technical fields such as artificial intelligence large models, data centers, and cloud computing. In the prior art, in order to improve data transmission performance, all tunnel encapsulation operations are completed by hardware. However, this places high demands on the processing logic of the hardware, and also requires a high degree of collaboration between software and hardware, which leads to high requirements on the adaptability of software and kernel versions. The kernel version in some off-the-shelf products may not be supported because the version is too low.
[0003] To this end, the present application proposes a method, computer device and medium for encapsulating and unloading a user data packet protocol tunnel, which are used to address the technical difficulties in the prior art. Summary of the invention
[0004] In a first aspect, the present application provides a method for user datagram protocol tunnel encapsulation and unloading. The method comprises: performing user datagram protocol tunnel encapsulation on a first data packet through a software side of a host machine, thereby obtaining a first tunnel message, wherein an inner layer message of the first tunnel message is the first data message and an outer layer message of the first tunnel message comprises a first user datagram protocol source port, the first user datagram protocol source port is used to construct a first tunnel message encapsulation table, the first tunnel message encapsulation table is used to indicate the forwarding of the first tunnel message, the software side automatically fills in the first user datagram protocol source port as a preset value when constructing the first tunnel message encapsulation table; and parsing the first data packet through a hardware side connected to the host machine. A message is sent from the software side to the hardware side to determine whether the message type is a tunnel message obtained by performing user data packet protocol tunnel encapsulation, and, in response to detecting the first tunnel message, a first five-tuple information of an inner message of the first tunnel message is extracted, and the first user data packet protocol source port in the first tunnel message encapsulation table is updated from the preset value to a user data packet protocol source port update value calculated based on the first five-tuple information, thereby obtaining an updated first tunnel message encapsulation table and an updated first tunnel message, and then, the updated first tunnel message is forwarded using the updated first tunnel message encapsulation table.
[0005] Through the first aspect of the present application, an optimized design of software and hardware collaboration is achieved, the adaptability requirements for software and kernel versions are reduced, the coupling between software and hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the encapsulation efficiency of the user data packet protocol tunnel is improved, and resource overhead is saved.
[0006] In a possible implementation manner of the first aspect of the present application, the first five-tuple information corresponds to the first data packet, and the first five-tuple information is determined based on a communication protocol associated with the first data packet.
[0007] In a possible implementation of the first aspect of the present application, the communication protocol associated with the first data packet is the Transmission Control Protocol / Network Protocol, and the first five-tuple information includes the source network protocol address, source port, target network protocol address, target port, and transmission protocol associated with the first data packet.
[0008] In a possible implementation manner of the first aspect of the present application, the preset value is all zero.
[0009] In a possible implementation of the first aspect of the present application, the method also includes: when the hardware side detects that the message type of the message sent from the software side to the hardware side is not a tunnel message obtained by user data packet protocol tunnel encapsulation, directly forwarding the message.
[0010] In a possible implementation of the first aspect of the present application, the hardware side includes a message parsing unit for supporting receiving-end scaling offloading, transmission control protocol / network protocol offloading or checksum offloading, and the hardware side uses the message parsing unit to extract the first five-tuple information.
[0011] In a possible implementation of the first aspect of the present application, the message parsing unit includes a metadata data structure for storing the message parsing results of receiving-end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading, and the first five-tuple information is extracted and cached in the metadata data structure.
[0012] In a possible implementation of the first aspect of the present application, the software side, when performing user data packet protocol tunnel encapsulation on the first data packet to obtain the first tunnel message, automatically fills in the checksum of the inner layer message of the first tunnel message with all zeros, and the method also includes: through the hardware side, updating the checksum of the inner layer message of the first tunnel message to a checksum update value calculated based on the inner layer message of the first tunnel message, thereby obtaining the updated first tunnel message.
[0013] In a possible implementation manner of the first aspect of the present application, the message format of the first tunnel message is a virtual extended local area network format or a network virtualization format using general routing encapsulation.
[0014] In a possible implementation manner of the first aspect of the present application, the software side is user-mode software or a kernel-mode traffic controller.
[0015] In a second aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method according to any one of the implementation modes of any of the above aspects when executing the computer program.
[0016] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer program product, which includes instructions stored on a computer-readable storage medium, and when the instructions are executed on a computer device, the computer device executes a method according to any one of the implementation methods of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A flowchart of a method for user data packet protocol tunnel encapsulation and unloading provided in an embodiment of the present application;
[0020] Figure 2 References provided for the embodiments of this application Figure 1 A schematic diagram of a method for performing tunnel encapsulation unloading of a user datagram protocol tunnel encapsulation unloading shown;
[0021] Figure 3 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0023] It should be understood that, in the description of this application, "at least one" means one or more, and "a plurality of" means two or more. In addition, unless otherwise specified, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0024] Figure 1 A flow chart of a method for user data packet protocol tunnel encapsulation and unloading provided in an embodiment of the present application. Figure 1 As shown, the method includes the following steps.
[0025] Step S110: Through the software side of the host machine, the first data packet is encapsulated by the user data packet protocol tunnel to obtain a first tunnel message, wherein the inner message of the first tunnel message is the first data message and the outer message of the first tunnel message includes a first user data packet protocol source port, the first user data packet protocol source port is used to construct a first tunnel message encapsulation table, the first tunnel message encapsulation table is used to indicate the forwarding of the first tunnel message, and the software side automatically fills in the first user data packet protocol source port as a preset value when constructing the first tunnel message encapsulation table.
[0026] Step S120: parsing the message sent from the software side to the hardware side through the hardware side connected to the host machine to determine whether the message type is a tunnel message obtained by performing user data packet protocol tunnel encapsulation, and, in response to detecting the first tunnel message, extracting the first five-tuple information of the inner message of the first tunnel message, updating the first user data packet protocol source port in the first tunnel message encapsulation table from the preset value to the user data packet protocol source port update value calculated based on the first five-tuple information, thereby obtaining an updated first tunnel message encapsulation table and an updated first tunnel message, and then forwarding the updated first tunnel message using the updated first tunnel message encapsulation table.
[0027] Figure 1The method of user datagram protocol tunnel encapsulation and unloading shown can be applied to any application scenario that requires user datagram protocol (UDP) tunnel encapsulation. UDP is a connectionless unreliable transport layer protocol. A large number of network interfaces use UDP to support routing and datagram packet encapsulation, and UDP tunnel encapsulation is developed based on UDP. Using tunnel technology, multiple virtual networks are created on the existing physical network without any modification to the existing physical network, realizing the automation and intelligence of the data center. Tunnel technology involves the concepts of overlay and underlay. Overlay means that by superimposing a software-defined logical network on the existing network, the original network is not modified as much as possible, and the business logic is implemented by defining the logical network on it, solving the network problems of the original data center. For example, a network technology that transmits the (business) layer 2 network frame in the (existing network) layer 3 / layer 4 message. Common tunnel technologies and corresponding tunnel message formats include Virtual eXtensible Local Area Network (VXLAN) and Network Virtualization using Generic Routing Encapsulation (NVGRE). The basic principle is to encapsulate the Layer 2 message through tunnel encapsulation and then transparently transmit it in the existing network. After reaching the destination, the original message is decapsulated, which is equivalent to superimposing a large Layer 2 network on the existing network. The concept of the bearer layer is a bearer network composed of various physical devices, such as aggregation switches, core switches, load balancing devices, and firewall devices. Using tunnel technology, a logical network will be formed on the basis of the bearer layer network. In technical fields such as cloud computing and data centers, tunnel technology is widely used for layering to achieve network virtualization, that is, the original Layer 2 data frame of the superimposed layer is encapsulated and transmitted through the bearer layer. Therefore, combining the advantages of network virtualization brought by tunnel technology and the convenience of user datagram protocol in transmission, the data message is encapsulated by user datagram protocol tunnel to obtain the corresponding tunnel message, thereby realizing the encapsulation of data message and carrying user datagram protocol message, and using various existing networks for transmission, which is conducive to meeting the automation and intelligence needs of data centers. In addition, user datagram protocol tunnel encapsulation technology can be used for example for receive side scaling (RSS) and equivalent multi-path protocol to improve the overall system performance, and can also be used to implement operations such as verification and checking, so it has the potential for large-scale popularization in fields such as large artificial intelligence models and large data centers.However, in the face of encapsulated tunnel messages, it is necessary to determine the relevant information in the tunnel encapsulation table used to indicate how to forward the message, such as the User Datagram Protocol source port (Source Port, Sport). Here, if the necessary calculation and encapsulation are performed by software calculation, such as through a user-mode virtual switch or a kernel-mode traffic controller (Traffic Control, TC), the software will need to occupy a large amount of central processing unit (CPU) computing power when sending tunnel encapsulated messages, which is not conducive to improving the overall system performance. Moreover, it will bring a large system burden when the tunnel traffic is large. In addition, if all tunnel encapsulation operations are handed over to hardware through complete hardware unloading, this will place higher requirements on the hardware processing logic, and also require a high degree of cooperation between software and hardware, which will lead to higher requirements on the adaptability of software and kernel versions. The kernel version in some existing products may not be supported because the version is too low. The following is a detailed description in conjunction with the specific embodiments of the present application. Figure 1 The method of user data packet protocol tunnel encapsulation and unloading shown in the invention reduces the adaptability requirements for software and kernel versions, reduces the coupling degree between software and hardware, simplifies the unloading complexity, reduces the requirements for hardware processing logic, improves the encapsulation efficiency of user data packet protocol tunnel, and saves resource overhead through the optimized design of software and hardware collaboration.
[0028] See also Figure 1In step S110, the first data packet is encapsulated by the software side of the host machine through the user data packet protocol tunnel encapsulation, thereby obtaining the first tunnel message, wherein the inner layer message of the first tunnel message is the first data packet and the outer layer message of the first tunnel message includes the first user data packet protocol source port, the first user data packet protocol source port is used to construct the first tunnel message encapsulation table, the first tunnel message encapsulation table is used to indicate the forwarding of the first tunnel message, and the software side automatically fills in the first user data packet protocol source port as a preset value when constructing the first tunnel message encapsulation table. In this way, most of the user data packet protocol tunnel encapsulation is completed by software, and the software side automatically fills in the first user data packet protocol source port as a preset value when constructing the first tunnel message encapsulation table, which means that the software side does not need to invest precious computing resources to calculate the first user data packet protocol source port, and also saves the loss of related message parsing and information extraction. Moreover, because the user data packet protocol tunnel encapsulation operations other than calculating the first user data packet protocol source port are completed by software, therefore, unlike all tunnel encapsulation operations completed by hardware, there is no need to consider the difficulty of high software and hardware collaboration, which effectively reduces the coupling degree of software and hardware, and thus also reduces the adaptability requirements for software and kernel versions, and lower versions of kernel versions can also be supported. Here, the preset value is a predetermined value, which can be predetermined by negotiation between software and hardware, for example, all zeros can be used, or other agreed values can be used.
[0029] Continue reading Figure 1, in step S120, through the hardware side connected to the host machine, the message sent from the software side to the hardware side is parsed to determine whether the message type is a tunnel message obtained by performing user data packet protocol tunnel encapsulation, and, in response to detecting the first tunnel message, the first five-tuple information of the inner message of the first tunnel message is extracted, and the first user data packet protocol source port in the first tunnel message encapsulation table is updated from the preset value to the user data packet protocol source port update value calculated based on the first five-tuple information, thereby obtaining an updated first tunnel message encapsulation table and an updated first tunnel message, and then, the updated first tunnel message is forwarded using the updated first tunnel message encapsulation table. In this way, on the basis of having completed the user data packet protocol tunnel encapsulation operation except for calculating the first user data packet protocol source port by software, the first five-tuple information of the inner layer message of the first tunnel message is extracted by the hardware side, so that the user data packet protocol source port update value can be calculated based on the extracted first five-tuple information, so that the relevant information in the original tunnel message sent from the software side can be replaced, that is, the first user data packet protocol source port in the first tunnel message encapsulation table is updated from the preset value to the user data packet protocol source port update value calculated based on the first five-tuple information. This means that the calculation of the first user data packet protocol source port, the updating of the tunnel message encapsulation table and the updating of the tunnel message are completed by hardware unloading. In this way, unlike offloading the entire tunnel encapsulation and the entire tunnel unpacking to the hardware, which puts forward higher requirements on the hardware processing logic, because the user data packet protocol tunnel encapsulation operations other than calculating the first user data packet protocol source port are completed by software, the hardware offloading is only used to assist the software in completing the calculation of the first user data packet protocol source port, updating the tunnel message encapsulation table and updating the tunnel message, so the requirements for the hardware processing logic are easy to be met, and there is no need for complex chip internal processing logic. The requirements for extracting the five-tuple information and performing tunnel source port calculation can be met by using the offloading function of the general network card. For example, the network card generally has the ability to parse the message, can support the receiving side scaling offloading (Receive Side Scaling, RSS), the transmission control protocol / network protocol (Transmission Control Protocol / Internet Protocol, TCP / IP) offloading or the checksum offloading, and therefore has sufficient processing power to extract the five-tuple information of the message and perform hash calculation.Thus, through the above-mentioned optimized software-hardware collaborative design, the coupling degree of software-hardware is effectively reduced. Without the need for highly difficult software-hardware collaboration, tunnel message encapsulation that could only be achieved with complex hardware internal processing logic can be completed. Moreover, without occupying additional hardware resources, the message parsing capability of a general network card can be used to cooperate with the software side to complete the user data packet protocol tunnel encapsulation of data messages. Thus, through the optimized design of software-hardware collaboration, the compatibility requirements for software and kernel versions are reduced, the coupling degree of software-hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the efficiency of user data packet protocol tunnel encapsulation is improved, and resource overhead is saved.
[0030] Figure 2 References provided for the embodiments of this application Figure 1 The schematic diagram of the method for performing tunnel encapsulation unloading of the user datagram protocol tunnel encapsulation unloading shown in FIG. Figure 2 As shown, the first data message is encapsulated by the user data packet protocol tunnel through the software side 201 of the host machine, so as to obtain the first tunnel message 211. The inner message A213 of the first tunnel message 211 is the first data message and the outer message A215 of the first tunnel message 211 includes the first user data packet protocol source port 217. The software side 201 automatically fills in the first user data packet protocol source port 217 as a preset value when constructing the first tunnel message encapsulation table. Here, Figure 2 , the preset value is all zeros, that is, "000". In response to detecting the first tunnel message 211, the hardware side 203 connected to the host extracts the first five-tuple information of the inner message A213 of the first tunnel message 211, and updates the first user data packet protocol source port 217 in the first tunnel message encapsulation table from the preset value ("000") to the user data packet protocol source port update value ( Figure 2 , the updated value of the user data packet protocol source port is "378"), thereby obtaining the updated first tunnel message encapsulation table and the updated first tunnel message 221. Therefore, the inner message B223 of the updated first tunnel message 221 is the first data message, and the outer message B225 of the updated first tunnel message 221 includes the updated first user data packet protocol source port 227, and the updated first user data packet protocol source port 227 is the updated value of the user data packet protocol source port "378".
[0031] See also Figure 2It can be seen that, on the basis of completing the user data packet protocol tunnel encapsulation operations other than calculating the first user data packet protocol source port 217 through the software side 201, the first five-tuple information of the inner layer message A213 of the first tunnel message 211 is extracted through the hardware side 203, so that the user data packet protocol source port update value can be calculated based on the extracted first five-tuple information, so as to replace the relevant information in the original tunnel message sent from the software side 201, that is, the first user data packet protocol source port 217 in the first tunnel message encapsulation table is updated from the preset value to the user data packet protocol source port update value calculated based on the first five-tuple information, thereby obtaining the updated first user data packet protocol source port 227. Figure 2 It is exemplified in that the first user data packet protocol source port 217 in the outer message A215 of the first tunnel message 211 sent by the software side 201 is the preset value "000", which means that the software side 201 does not need to invest precious computing resources to calculate the first user data packet protocol source port 217, and also saves the loss of related message parsing and information extraction. Here, the preset value is a predetermined value, which can be predetermined by negotiation between software and hardware, for example, all zeros can be used, or other agreed values can be used. In this way, through the above-mentioned optimized software and hardware collaborative design, the coupling degree of software and hardware is effectively reduced, and the tunnel message encapsulation that can only be realized by the complex hardware internal processing logic can be completed without the high difficulty of software and hardware collaboration, and there is no need to occupy additional hardware resources. The message parsing capability of the general network card can be used to cooperate with the software side 201 to complete the user data packet protocol tunnel encapsulation of the data message. In this way, through the optimized design of software and hardware collaboration, the adaptability requirements for software and kernel versions are reduced, the coupling between software and hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the encapsulation efficiency of the user data packet protocol tunnel is improved, and resource overhead is saved.
[0032] See also Figure 1 and Figure 2 In a possible implementation, the first five-tuple information corresponds to the first data message, and the first five-tuple information is determined based on the communication protocol associated with the first data message. In this way, any suitable communication protocol can be adapted, such as the transmission control protocol / network protocol. Through the optimized design of software and hardware collaboration, the adaptability requirements for software and kernel versions are reduced, the coupling degree of software and hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the encapsulation efficiency of the user data packet protocol tunnel is improved, and resource overhead is saved.
[0033] In some embodiments, the communication protocol associated with the first data message is a transmission control protocol / network protocol, and the first five-tuple information includes a source network protocol address, a source port, a target network protocol address, a target port, and a transmission protocol associated with the first data message. In this way, through the optimized design of software and hardware collaboration, the adaptability requirements for software and kernel versions are reduced, the coupling degree of software and hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the encapsulation efficiency of the user data packet protocol tunnel is improved, and resource overhead is saved.
[0034] In a possible implementation, the preset value is all zeros. Here, the preset value is a predetermined value, which can be predetermined by negotiation between software and hardware, for example, all zeros can be used, or other agreed values can be used. In this way, flexibility is improved.
[0035] In a possible implementation, the method further includes: when the hardware side detects that the message type of the message sent from the software side to the hardware side is not a tunnel message obtained by performing user data packet protocol tunnel encapsulation, directly forwarding the message. In this way, the method for user data packet protocol tunnel encapsulation unloading proposed in the present application can be conveniently applied to existing products of hardware unloading, and the message type is determined by parsing the message. For tunnel messages that are not obtained by performing user data packet protocol tunnel encapsulation, the message can be directly forwarded, thereby improving resource utilization and system efficiency.
[0036] In a possible implementation, the hardware side includes a message parsing unit for supporting receiving-end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading, and the hardware side uses the message parsing unit to extract the first five-tuple information. The network card generally has a message parsing capability, which can support receiving-end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading, and therefore has sufficient processing power to extract the five-tuple information of the message and perform hash calculations. In this way, through the above-mentioned optimized software and hardware collaborative design, the coupling degree of software and hardware is effectively reduced, and the tunnel message encapsulation that can only be achieved by the complex hardware internal processing logic can be completed without the need for difficult software and hardware collaboration. Moreover, there is no need to occupy additional hardware resources. By utilizing the message parsing capability of a general network card, the user data packet protocol tunnel encapsulation of the data message can be completed in cooperation with the software side.
[0037] In some embodiments, the message parsing unit includes a metadata data structure for storing the message parsing results of the receiving end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading, and the first five-tuple information is cached in the metadata data structure after being extracted. The network card generally has the message parsing capability, and can support the receiving end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading, and stores the message parsing results of the receiving end scaling unloading, transmission control protocol / network protocol unloading or checksum unloading through the metadata data structure. Therefore, the metadata data structure can be used to cache the extracted five-tuple information. In this way, there is no need to occupy additional hardware resources, and the message parsing capability of the general network card can be used to cooperate with the software side to complete the user data packet protocol tunnel encapsulation of the data message.
[0038] In a possible implementation, the software side, when performing user data packet protocol tunnel encapsulation on the first data message to obtain the first tunnel message, automatically fills in the checksum of the inner message of the first tunnel message with all zeros, and the method also includes: updating the checksum of the inner message of the first tunnel message to the checksum update value calculated based on the inner message of the first tunnel message through the hardware side, thereby obtaining the updated first tunnel message. In this way, through the optimized design of software and hardware collaboration, the burden of checksum calculation is allocated to the hardware, reducing the computing power resource consumption of the software, so that the software does not need to fill in the checksum of the inner message when sending a packet, saving resource overhead.
[0039] In a possible implementation, the message format of the first tunnel message is a virtual extended local area network format or a network virtualization format using a general routing encapsulation. In this way, any message format based on user datagram protocol tunnel encapsulation can be designed through the above-mentioned optimized software and hardware collaboration, thereby improving the user datagram protocol tunnel encapsulation efficiency and saving resource overhead.
[0040] In a possible implementation, the software side is user-mode software or a kernel-mode flow controller. In this way, user-mode software such as a user-mode switch and a kernel-mode flow controller can encapsulate tunnel messages and then send them to the hardware for transmission. By using the above-mentioned optimized software-hardware collaborative design, the adaptability requirements for software and kernel versions are reduced, the coupling degree of software and hardware is reduced, the complexity of unloading is simplified, the requirements for hardware processing logic are reduced, the efficiency of user data packet protocol tunnel encapsulation is improved, and resource overhead is saved.
[0041] Figure 33 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 300 includes: one or more processors 310, a communication interface 320 and a memory 330. The processor 310, the communication interface 320 and the memory 330 are interconnected via a bus 340. Optionally, the computing device 300 may also include an input / output interface 350, and the input / output interface 350 is connected to an input / output device for receiving parameters set by a user, etc. The computing device 300 can be used to implement some or all of the functions of the device embodiment or system embodiment in the above-mentioned embodiment of the present application; the processor 310 can also be used to implement some or all of the operating steps of the method embodiment in the above-mentioned embodiment of the present application. For example, the specific implementation of the various operations performed by the computing device 300 can refer to the specific details in the above-mentioned embodiments, such as the processor 310 is used to perform some or all of the steps in the above-mentioned method embodiment or some or all of the operations in the above-mentioned method embodiment. For another example, in an embodiment of the present application, the computing device 300 may be used to implement part or all of the functions of one or more components in the above-mentioned apparatus embodiment. In addition, the communication interface 320 may be specifically used to perform the communication functions necessary to implement the functions of these apparatuses and components, and the processor 310 may be specifically used to perform the processing functions necessary to implement the functions of these apparatuses and components.
[0042] It should be understood that Figure 3 The computing device 300 may include one or more processors 310, and the multiple processors 310 may provide processing capabilities in a parallel connection mode, a serial connection mode, a serial-parallel connection mode, or any connection mode, or the multiple processors 310 may form a processor sequence or a processor array, or the multiple processors 310 may be divided into a main processor and an auxiliary processor, or the multiple processors 310 may have different architectures such as a heterogeneous computing architecture. In addition, Figure 3 The computing device 300 shown in the figure, and the related structural description and functional description are exemplary and non-limiting. In some exemplary embodiments, the computing device 300 may include Figure 3 More or fewer components may be shown, or some components may be combined or separated, or may have a different arrangement of components.
[0043] The processor 310 may have a variety of specific implementation forms. For example, the processor 310 may include a central processing unit (CPU), a graphic processing unit (GPU), a neural-network processing unit (NPU), a tensor processing unit (TPU) or a data processing unit (DPU), etc., and the embodiment of the present application does not specifically limit it. The processor 310 may also be a single-core processor or a multi-core processor. The processor 310 may be a combination of a CPU and a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof. The processor 310 may also be implemented using a logic device with built-in processing logic alone, such as an FPGA or a digital signal processor (DSP). The communication interface 320 may be a wired interface or a wireless interface for communicating with other modules or devices. The wired interface may be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface may be a cellular network interface or a wireless local area network interface, etc.
[0044] The memory 330 may be a non-volatile memory, such as a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The memory 330 may also be a volatile memory, which may be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 330 may also be used to store program codes and data, so that the processor 310 calls the program codes stored in the memory 330 to execute some or all of the operation steps in the above method embodiment, or to execute the corresponding functions in the above device embodiment. Figure 3 Show more or fewer components, or have different component configurations.
[0045] The bus 340 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 340 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 340 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0046] The method and device provided in the embodiments of the present application are based on the same inventive concept. Since the principles of solving the problems in the methods and devices are similar, the embodiments, implementation methods, examples or implementation methods of the methods and devices can refer to each other, and the repeated parts will not be repeated. The embodiments of the present application also provide a system, which includes multiple computing devices, and the structure of each computing device can refer to the structure of the computing device described above. The functions or operations that can be implemented by the system can refer to the specific implementation steps in the above method embodiments and / or the specific functions described in the above device embodiments, which will not be repeated here.
[0047] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer device (such as one or more processors), the method steps in the above method embodiment can be implemented. The specific implementation of the processor of the computer-readable storage medium in executing the above method steps can refer to the specific operations described in the above method embodiment and / or the specific functions described in the above device embodiment, which will not be repeated here.
[0048] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The present application may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program codes. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer-readable storage media can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media. Available media can be magnetic media (such as floppy disks, hard disks, tapes), optical media, or semiconductor media. Semiconductor media can be solid-state hard disks, random access memory, flash memory, read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only memory, registers, or any other form of suitable storage media.
[0049] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. Each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0050] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. The steps in the method of the embodiment of the present application can be adjusted in sequence, merged or deleted according to actual needs; the modules in the system of the embodiment of the present application can be divided, merged or deleted according to actual needs. If these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for user datagram protocol tunnel encapsulation and unloading, characterized in that: The method comprises: Through the software side of the host machine, a first data message is encapsulated in a user data packet protocol tunnel, thereby obtaining a first tunnel message, wherein an inner layer message of the first tunnel message is the first data message and an outer layer message of the first tunnel message includes a first user data packet protocol source port, the first user data packet protocol source port is used to construct a first tunnel message encapsulation table, the first tunnel message encapsulation table is used to indicate forwarding of the first tunnel message, and the software side automatically fills in the first user data packet protocol source port as a preset value when constructing the first tunnel message encapsulation table; Through the hardware side connected to the host machine, the message sent from the software side to the hardware side is parsed to determine whether the message type is a tunnel message obtained by performing user data packet protocol tunnel encapsulation, and, in response to detecting the first tunnel message, the first five-tuple information of the inner message of the first tunnel message is extracted, and the first user data packet protocol source port in the first tunnel message encapsulation table is updated from the preset value to the user data packet protocol source port update value calculated based on the first five-tuple information, thereby obtaining an updated first tunnel message encapsulation table and an updated first tunnel message, and then, the updated first tunnel message is forwarded using the updated first tunnel message encapsulation table.
2. The method according to claim 1, characterized in that The first five-tuple information corresponds to the first data message, and the first five-tuple information is determined based on a communication protocol associated with the first data message.
3. The method according to claim 2, characterized in that The communication protocol associated with the first data packet is the Transmission Control Protocol / Network Protocol, and the first five-tuple information includes the source network protocol address, source port, target network protocol address, target port, and transmission protocol associated with the first data packet.
4. The method according to claim 1, characterized in that: The preset value is all zeros.
5. The method according to claim 1, characterized in that The method further comprises: When the hardware side detects that the message type of the message sent from the software side to the hardware side is not a tunnel message obtained by performing user data packet protocol tunnel encapsulation, the message is directly forwarded.
6. The method according to claim 1, characterized in that The hardware side includes a message parsing unit for supporting receiving end scaling offloading, transmission control protocol / network protocol offloading or checksum offloading, and the hardware side uses the message parsing unit to extract the first five-tuple information.
7. The method according to claim 6, characterized in that The message parsing unit includes a metadata data structure for storing message parsing results of receiving end scaling offloading, transmission control protocol / network protocol offloading or checksum offloading, and the first five-tuple information is extracted and cached in the metadata data structure.
8. The method according to claim 1, characterized in that The software side, when performing user data packet protocol tunnel encapsulation on the first data message to obtain the first tunnel message, automatically fills in the checksum of the inner message of the first tunnel message as all zeros, and the method further includes: Through the hardware side, the checksum of the inner layer message of the first tunnel message is updated to a checksum update value calculated based on the inner layer message of the first tunnel message, thereby obtaining the updated first tunnel message.
9. The method according to claim 1, characterized in that: The message format of the first tunnel message is a virtual extended local area network format or a network virtualization format using general routing encapsulation.
10. The method according to claim 1, characterized in that The software side is user-mode software or a kernel-mode flow controller.
11. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 10 when executing the computer program.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, cause the computer device to perform the method according to any one of claims 1 to 10.
