DPU-based message forwarding method and system, user-mode protocol stack and IP core

By combining hardware and software offloading technology in the DPU and using the user-mode protocol stack to dynamically create and update IPSec software entries, the problem of DPU's IPSec tunnel specification scalability and high concurrency requirements is solved, and efficient IPSec tunnel transmission and protection are achieved. .

CN117424739BActive Publication Date: 2024-10-18YUSUR TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311434149.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2024-10-18
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

Existing DPUs have scalability limitations and high costs in achieving high concurrency of IPSec tunnels and dynamic expansion of tunnel specifications, and cannot meet the needs of data center tenants as they grow in scale.

Method used

By combining hardware offloading and software offloading technology in the DPU, using the user mode protocol stack to perform message forwarding methods, and adding dynamic creation and updating of IPSec software table entries, the scalability of IPSec tunnel specifications can be improved, taking into account high throughput and high concurrency requirements. .

Benefits of technology

It effectively expands the number of IPSec tunnel specifications supported by the DPU, improves the scalability of the tunnel specifications, meets tenant growth requirements for high concurrency of IPSec tunnels supported by the DPU, and achieves efficient data transmission and protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117424739B_ABST
    Figure CN117424739B_ABST
Patent Text Reader

Abstract

The present invention provides a message forwarding method and system based on DPU, a user-mode protocol stack and an IP core, the method comprising: matching a target message received by DPU with an SP in an IPSec hardware table item in an IP core of the DPU; for the target message that successfully matches the IPSec hardware table item, forwarding the target message to a corresponding target host through the IP core; for the target message that fails to match the IPSec hardware table item, matching the target message with an SP in an IPSec software table item in a user-mode protocol stack of the DPU, and forwarding the target message that successfully matches the IPSec software table item to the target host through the user-mode protocol stack. The present invention can effectively expand the number of specifications of IPSec tunnels supported by DPU and realize high concurrency of IPSec tunnels by realizing the coexistence of IP core hardware unloading and user-mode protocol stack software unloading on DPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data communication, and in particular to a DPU-based message forwarding method and system, a user-mode protocol stack and an IP core. Background Art

[0002] With the rapid development of fields such as artificial intelligence, big data analysis, and network security, traditional general-purpose processors (CPUs) face performance bottlenecks and energy efficiency challenges when processing these data-intensive tasks. In order to improve the efficiency and performance of data processing, hardware accelerators optimized for data processing tasks have gradually emerged, including DPU (Data Processing Unit), which is a hardware accelerator dedicated to data processing. DPUs usually work in parallel with central processing units (CPUs) and graphics processing units (GPUs) to accelerate various data-intensive tasks, such as machine learning, deep learning, network security, and data center applications.

[0003] IPSec VPN is a tunnel technology that uses IPSec (IP Security) protocol to achieve secure data transmission based on public network infrastructure. IPSec protocol is not a separate protocol. As a network layer tunneling protocol, it is a set of security protocol suites developed by the Internet Engineering Task Force (IETF). It provides high-quality, interoperable, cryptographic-based security for IP datagrams. Its system structure includes: Security Association (SA), security protocol, key management, operation mode, authentication algorithm, encryption algorithm and security policy (SP).

[0004] In large data centers or cloud platforms, network security requirements are becoming increasingly urgent. In view of the trend of explosive growth in the scale of data center tenants, the IPSec tunnel specifications supported by the DPU have become an important indicator of concern to users. Currently, in the solutions based on smart network cards and traditional DPUs to implement IPSec offloading, the SA and SP policies are offloaded to the hardware through the IP core xfrm architecture (extensible functional framework), and the hardware processes and transmits data packets based on the SA and SP. However, due to the limitations of hardware manufacturing processes and network card size, the hardware table items for IPSec offloading have certain specification limitations, and there is a problem that it cannot support unlimited expansion or the expansion cost is extremely high, resulting in the DPU being unable to achieve high concurrency of IPSec tunnels and dynamic expansion of tunnel specifications. Summary of the invention

[0005] In view of this, the embodiments of the present invention provide a DPU-based message forwarding method and system, a user-mode protocol stack and an IP core to eliminate or improve one or more defects existing in the prior art.

[0006] One aspect of the present invention provides a DPU-based message forwarding method executed by a user-mode protocol stack, comprising:

[0007] receiving, in the DPU, a target message sent by an IP core in the DPU and failing to match a message identifier in an IPSec hardware entry, wherein the IPSec hardware entry is set in the IP core;

[0008] The target message is matched with the message identifier in the local IPSec software table item, and when or after the target message successfully matches the IPSec software table item, the target message is forwarded to the target host.

[0009] In some embodiments of the present invention, the step of receiving in the DPU a target message sent by an IP core in the DPU and failing to match a message identifier in an IPSec hardware entry further includes:

[0010] Receiving configuration information obtained by an IPSec process in the DPU, wherein the configuration information is obtained in advance by the IPSec process from the target host side via a management channel;

[0011] The local IPSec software table entry is created or updated according to the configuration information, wherein the configuration information is also forwarded by the IPSec process to the IP core, so that the IP core creates or updates the IPSec hardware table entry therein according to the configuration information.

[0012] In some embodiments of the present invention, matching the target message with a message identifier in a local IPSec software table entry includes:

[0013] The message type of the target message is determined. If the message type of the target message is an authentication header protocol message or an encapsulating security payload protocol message, the target message is matched with a message identifier in a local IPSec software table entry.

[0014] In some embodiments of the present invention, the configuration information includes a corresponding message identifier and a tunnel negotiation strategy;

[0015] Correspondingly, when or after the target message successfully matches the IPSec software entry, forwarding the target message to the target host includes:

[0016] If the target message successfully matches the message identifier in the IPSec software table entry, the target message is processed according to the tunnel negotiation policy corresponding to the message identifier in the IPSec software table entry that matches the target message, and the processed target message is sent to the target host.

[0017] Another aspect of the present invention provides a user mode protocol stack, comprising:

[0018] A message receiving module, used for receiving in a DPU a target message sent by an IP core in the DPU and failing to match a message identifier in an IPSec hardware entry, wherein the IPSec hardware entry is set in the IP core;

[0019] The second message matching module is used to match the target message with the message identifier in the local IPSec software table item, and forward the target message to the target host when or after the target message successfully matches the IPSec software table item.

[0020] Another aspect of the present invention provides a DPU-based message forwarding method executed by an IP core, comprising:

[0021] Match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry;

[0022] If the target message fails to match the IPSec hardware table entry, the target message is sent to the user-mode protocol stack in the same DPU as itself, so that the user-mode protocol stack matches the target message with the message identifier in the IPSec software table entry in its local user-mode protocol stack, and forwards the target message to the target host when or after the target message successfully matches the IPSec software table entry.

[0023] Another aspect of the present invention provides an IP core, comprising:

[0024] A first message matching module, used to match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry;

[0025] The message forwarding module is used to send the target message to the user-mode protocol stack in the same DPU as itself when the target message fails to match the IPSec hardware table item, so that the user-mode protocol stack matches the target message with the message identifier in the IPSec software table item in its local user-mode protocol stack, and forward the target message to the target host when or after the target message successfully matches the IPSec software table item.

[0026] Another aspect of the present invention provides a DPU-based message forwarding system, which is arranged on the DPU, and the message forwarding system includes: a user-mode protocol stack and an IP core that are communicatively connected to each other;

[0027] The user state protocol stack is used to execute the DPU-based message forwarding method executed by the user state protocol stack;

[0028] The IP core is used to execute the above-mentioned DPU-based message forwarding method executed by the IP core.

[0029] Another aspect of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the electronic device implements the DPU-based message forwarding method executed by the user-mode protocol stack or the DPU-based message forwarding method executed by the IP core.

[0030] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the DPU-based message forwarding method executed by the user-mode protocol stack or the DPU-based message forwarding method executed by the IP core.

[0031] The DPU-based message forwarding method executed by the user-mode protocol stack of the present invention can effectively expand the number of specifications of IPSec tunnels supported by the DPU and improve the scalability of tunnel specifications by increasing software unloading by using the user-mode protocol stack on the DPU.

[0032] The DPU-based message forwarding method executed by the IP core of the present invention adds a software unloading method of the message executed by the user-mode protocol stack on the basis of the hardware unloading method of the message executed by the IP core in the DPU, integrating the technical advantages of the two unloading methods, and can effectively improve the scalability of the unloading tunnel specifications, thereby enabling the DPU to take into account both high-throughput and high-concurrency tunnels, perfectly solving the high-concurrency demand of the IPSec tunnel supported by the DPU due to the increase in tenants.

[0033] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0034] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.

[0036] Figure 1 The flowchart of DPU-based message forwarding executed by the user-mode protocol stack is shown in FIG.

[0037] Figure 2 This is a diagram of a DPU-based message forwarding structure in one embodiment of the present invention.

[0038] Figure 3 Figure 2 is a flow chart of DPU-based message forwarding performed by the IP core.

[0039] Figure 4 The figure is a message forwarding flow chart of a DPU-based message forwarding system for encrypted messages.

[0040] Figure 5 The figure is a message forwarding flow chart of a DPU-based message forwarding system for plaintext messages. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0042] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0043] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0044] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection with an intermediate.

[0045] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0046] There are two common IPSec offloading methods for data center servers in the prior art:

[0047] First, the unloaded IPSec tunnel in the smart NIC. In the smart NIC solution, the IPSec management plane runs in the CPU server. Users can create IPSec tunnels by statically configuring xfrm or running IPSec user-mode software, and synchronize the negotiation results of the tunnel to the kernel xfrm framework. If the smart NIC turns on the IPSec unloading function, the corresponding SA and SP will be synchronized to the hardware table of the smart NIC, thereby providing more efficient data transmission and protection through the encryption or decryption function of the hardware, reducing the burden of the host CPU to process ciphertext data, and providing lower network latency and higher throughput.

[0048] Second, the unloaded IPSec tunnel in the DPU. In the DPU, the IPSec management plane runs on the DPU side. Users can create tunnels by statically configuring xfrm on the DPU side or running IPSec user-mode software, and synchronize the tunnel negotiation results to the kernel xfrm framework. They can also configure IPSec tunnels through the SDK interface. During this process, users are not aware of the tunnel negotiation process. The tunnel negotiation and message encryption and decryption are all completed by the DPU. The kernel's xfrm module will synchronize SA and SP to the DPU's IP core, so that the IP core can provide more efficient data transmission and protection through hardware-accelerated encryption and decryption functions, reduce the burden on the user host CPU to process ciphertext data, and provide lower network latency and higher throughput.

[0049] The above-mentioned IPSec offloading technologies in the prior art all perform data transmission and protection during message forwarding through IPSec tunnels created by hardware. However, since the expansion of IPSec tunnels in hardware is limited by the hardware process or the size of the network card, the specifications of the IPSec tunnels created by hardware are increasingly difficult to meet the growing needs of the scale of tenants in the data center.

[0050] In response to the technical problem that tunnel expansion in IPSec offloading technology in the prior art is limited by hardware process and network card size, and cannot support wireless expansion of tunnel specifications or the expansion cost is extremely high, the present application proposes a message forwarding method and system based on DPU. By adding a software offloading method executed by a user-mode protocol stack on the basis of a hardware offloading method executed by an IP core, the DPU can take into account both high-throughput and high-concurrency tunnel transmission, thereby meeting the high concurrency demand of tenant growth for IPSec forwarding tunnels supported by the DPU.

[0051] The details are described in detail through the following examples.

[0052] The embodiment of the present application provides a DPU-based message forwarding method that can be executed by a user-mode protocol stack, such as Figure 1 As shown, steps S110-S120 are included:

[0053] Step S110: receiving in the DPU a target message sent by the IP core in the DPU and failing to match the message identifier in the IPSec hardware entry.

[0054] Wherein, the IPSec hardware table entry is set in the IP core to indicate the message that the IP core performs IPSec unloading. The IPSec hardware table entry in the IP core includes the configuration information of each target host obtained by the IPSec negotiation process in the DPU to which the IP core belongs and different target hosts, and the configuration information of each target host in the IP core is sent down according to the tunnel type of the configuration information; wherein, the configuration information of each target host obtained by the IPSec negotiation process and different target hosts is also sent down to the user-mode protocol stack set in the same DPU as the IP core according to the tunnel type in the configuration information, forming the IPSec software table entry in the user-mode protocol stack, and the configuration information sent down to the target host in the IP core and the user-mode protocol stack set in the same DPU is different. Wherein, the configuration information of the target host includes a message identifier for message matching with the target message, and a tunnel negotiation strategy for indicating the processing algorithm of the target message obtained by the tunnel negotiation, and the message identifier includes a five-tuple of the message to indicate the source IP address, source port, destination IP address, destination port and secure transmission protocol of the message.

[0055] Corresponding to the configuration information of each target host in the above-mentioned IPSec hardware table item and IPSec software table item, before the above-mentioned step S110, it also includes: the steps of creating and updating the IPSec software table item and the IPSec hardware table item, specifically including: receiving the configuration information obtained by the IPSec negotiation process in the DPU, wherein the configuration information is obtained in advance from the target host side by the IPSec negotiation process through the management channel; creating or updating the local IPSec software table item according to the configuration information. In addition, the configuration information is also forwarded by the IPSec process to the IP core, so that the IP core creates or updates the IPSec hardware table item therein according to the configuration information.

[0056] Corresponding to the above-mentioned DPU-based message forwarding method executed by the user-mode protocol stack, in one or more DPU-based message forwarding embodiments of the present application, the IPSec negotiation process in the DPU that executes message forwarding will, according to the tunnel type of the configuration information of each target host, send the configuration information of each target host to the user-mode protocol stack or IP core set in the same DPU as the IPSec negotiation process, thereby forming IPSec software table entries in the user-mode protocol stack and IPSec hardware table entries in the IP core.

[0057] The IPSec offloading methods used to implement the message offloading function include the IPSec hardware offloading method of the message implemented by the IP core and the IPSec software offloading method of the message implemented by the user-mode protocol stack. Among them, the IPSec hardware offloading method has good performance of the offloading function, but the cost is high and the tunnel specification scalability is poor; the IPSec software offloading method has poor performance of the offloading function, but the tunnel specification scalability is better.

[0058] Based on the unloading performance of the above-mentioned IPSec hardware unloading mode and IPSec software unloading mode, corresponding to the above-mentioned DPU-based message forwarding method executed by the user-mode protocol stack, in one or more DPU-based message forwarding embodiments of the present application, based on the service throughput of the target host, a throughput threshold is pre-set, and the IPSec negotiation process in the DPU that performs message forwarding sets the tunnel type of the configuration information of the target host whose service throughput is greater than the throughput threshold to tunnel mode (tunnel mode, a working mode of the IPSec protocol family), and uses the IPSec hardware unloading unloading mode to perform message unloading for the target message corresponding to the target host with a tunnel type of tunnel mode; sets the tunnel type in the configuration information of the target host whose service throughput is less than or equal to the throughput threshold to transport mode (transport mode, another working mode of the IPSec protocol family), and uses the IPSec software unloading unloading mode to perform message unloading for the target message corresponding to the target host with a tunnel type of transport mode, thereby not only utilizing the extended performance of the IPSec software unloading mode to improve the concurrency of data transmission, but also utilizing the IPSec hardware unloading mode to take into account the high throughput of data transmission. In a corresponding embodiment, the IPSec negotiation process sends the configuration information of the target host whose tunnel type is tunnel mode to the IP core that is set in the same DPU as the IPSec negotiation process, forming an IPSec hardware table entry in the IP core; and sends the configuration information of the target host whose tunnel type is transport mode to the user-mode protocol stack that is set in the same DPU as the IPSec negotiation process, forming an IPSec software table entry in the user-mode protocol stack.

[0059] In one or more DPU-based message forwarding embodiments of the present application, the IPSec negotiation process in the DPU can adjust the unloading mode of the target host by managing the configuration parameter loadType (tunnel type) in the configuration information of the target host.

[0060] The target message received by the user-mode protocol stack is a target message received from a source network port by an IP core set in the same DPU as the user-mode protocol stack, and is obtained after matching the IPSec hardware table entry in the IP core, and the target message fails to match the message identifier in the IPSec hardware table entry.

[0061] Corresponding to the target message received by the user-mode protocol stack, in one or more DPU-based message forwarding embodiments of the present application, the connection relationship between the IP in the DPU and the user-mode protocol stack is as follows: Figure 2 As shown, the user-mode protocol stack is connected to the source network port of the target message via the IP core. If there is a message identifier matching the target message received by the IP core from the source network port in the IPSec hardware table entry in the IP core, the IP core directly forwards the target message; if there is no message identifier matching the target message received by the IP core from the source network port in the IPSec hardware table entry in the IP core, the IP core forwards the target message to the user-mode protocol stack set in the same DPU as the IP core, so that the user-mode protocol stack receives the target message.

[0062] Step S120, matching the target message with the message identifier in the local IPSec software entry, and forwarding the target message to the target host when or after the target message successfully matches the IPSec software entry.

[0063] The above step S120 specifically includes: matching the target message with the message identifier in the local IPSec software table entry, if the target message matches the message identifier in the IPSec software table entry successfully, processing the target message according to the tunnel negotiation policy corresponding to the message identifier in the IPSec software table entry that matches the target message, and sending the processed target message to the target host. If the target message fails to match the message identifier in the IPSec software table entry, directly discarding the target message.

[0064] Since the IPSec offloading technology realizes the secure transmission of message data through two secure transmission protocols, AH (Authentication Header Protocol) and ESP (Encapsulating Security Payload Protocol), the user-mode protocol stack needs to determine the message type of the target message before matching the target message with the message identifier in the local IPSec software table item. Only when the message type of the target message is an AH message and an ESP message, the user-mode protocol stack can perform IPSec offloading on the target message. Correspondingly, before matching the target message with the message identifier in the local IPSec software table item, it includes: determining the message type of the target message. If the message type of the target message is an AH message or an ESP message, matching the target message with the message identifier in the local IPSec software table item; if the message type of the target message does not belong to any of the AH message and the ESP message, forwarding the target message to other task modules to perform message offloading.

[0065] In one or more DPU-based message forwarding embodiments of the present application, the configuration information obtained by the IPSec negotiation process in the DPU that performs message forwarding and different target hosts through negotiation includes an SP policy and an SA policy, wherein the SP policy is a message identifier used for message matching with the target message, and the SA policy is a tunnel negotiation policy used to indicate the processing algorithm of the target message. The configuration information sent to the user-mode protocol stack and the IP core is stored in the corresponding IPSec policy library. Corresponding to the above-mentioned DPU-based message forwarding method executed by the user-mode protocol stack, the forwarding process of the target message received from the source network port in the DPU includes: first, the IP core queries the IPSce policy library in the IP core based on the quintuple of the target message to see whether there is an SP policy that matches the quintuple of the target message, and if so, the IP core directly executes the IPSec unloading of the target message. If it does not exist, the IP core sends the target message to the user-mode protocol stack in the same DPU, and the user-mode protocol stack determines the message type of the target message. For the target message whose message type is an AH message or an ESP message, the user-mode protocol stack queries the IPSec policy library in the user-mode protocol stack based on the five-tuple of the target message to see if there is an SP policy that matches the five-tuple of the target message. If it does exist, the user-mode protocol stack directly performs IPSec unloading of the target message; if it does not exist, the target message is directly discarded. For the target message whose message type is not an AH message or an ESP message, the user-mode protocol stack forwards the target message to other message processing modules for message unloading.

[0066] In one or more DPU-based message forwarding embodiments corresponding to the above embodiments, the target message is an encrypted message, and correspondingly, the user-mode protocol stack performs IPSec unloading of the target message, including: decrypting and decapsulating the target message using the tunnel negotiation strategy corresponding to the message identifier that successfully matches the target message in the IPSec software table, and forwarding the decapsulated target message to the target host. The IP core performs IPSec unloading of the target message, including: decrypting and decapsulating the target message using the tunnel negotiation strategy corresponding to the message identifier that successfully matches the target message in the IPSec hardware table, and forwarding the decapsulated target message to the target host.

[0067] In another one or more DPU-based message forwarding embodiments corresponding to the above embodiments, the target message is a plaintext message, and correspondingly, the user-mode protocol stack performs IPSec unloading of the target message, including: encrypting and encapsulating the target message using the tunnel negotiation strategy corresponding to the message identifier that successfully matches the target message in the IPSec software table, and forwarding the encapsulated target message to the target host. The IP core performs IPSec unloading of the target message, including: encrypting and encapsulating the target message using the tunnel negotiation strategy corresponding to the message identifier that successfully matches the target message in the IPSec hardware table, and forwarding the encapsulated target message to the target host.

[0068] From the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack, the IPSec unloading of messages is realized by the user-mode protocol stack using the IPSec software unloading method, which can realize the dynamic expansion of the number of IPSec tunnel specifications of the DPU, and the unloading performance based on the IPSec software unloading method and the IPSec hardware unloading method. The IPSec unloading that coexists with the IPSec hardware unloading method and the IPSec software unloading method can enable the target host to dynamically select the unloading method of the target message corresponding to the target host according to its own business throughput, so that the IPSec unloading tunnel of the DPU can take into account the tunnel requirements of high throughput and high concurrency at the same time, thereby solving the high concurrency demand of users for IPSec tunnels.

[0069] The present application also provides a user-mode protocol stack for executing the DPU-based message forwarding method that can be executed by the user-mode protocol stack, including:

[0070] The message receiving module is used to receive in the DPU a target message sent by the IP core in the DPU that fails to match the message identifier in the IPSec hardware table entry, wherein the IPSec hardware table entry is set in the IP core.

[0071] The second message matching module is used to match the target message with the message identifier in the local IPSec software table item, and forward the target message to the target host when or after the target message successfully matches the IPSec software table item.

[0072] The second message matching module includes an IPSec software table entry and an encryption and decryption module; wherein the IPSec software table entry is used to store the configuration information of the target host for IPSec unloading of messages by the user-mode protocol stack using the IPSec software unloading method; the encryption and decryption module is used to process the target message according to the tunnel negotiation policy corresponding to the message identifier matching the target message in the local IPSec software table entry, and send the processed target message to the target host.

[0073] The embodiment of the above-mentioned user-mode protocol stack can specifically execute the processing flow of the DPU-based message forwarding embodiment in the above-mentioned embodiment corresponding to the DPU-based message forwarding method that can be executed by the user-mode protocol stack. Its functions are no longer repeated here, and reference can be made to the detailed description of the DPU-based message forwarding embodiment corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack.

[0074] Corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack, the present application also provides a DPU-based message forwarding method that can be executed by the IP core, such as Figure 3 As shown, steps S210-S220 are included:

[0075] Step S210: Match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry.

[0076] Wherein, the IPSec hardware table entry is set in the IP core to indicate the message that is unloaded by the IP core. The IPSec hardware table entry in the IP core includes the configuration information of each target host obtained by negotiation between the IPSec negotiation process in the DPU to which the IP core belongs and different target hosts, and the configuration information of each target host in the IP core is sent down according to the tunnel type of the configuration information. Wherein, the configuration information of the target host includes a message identifier for message matching with the target message, and a tunnel negotiation strategy negotiated by the tunnel to indicate the processing algorithm of the target message, and the message identifier includes a five-tuple of the message to indicate the source IP address, source port, destination IP address, destination port and secure transmission protocol of the message.

[0077] Step S220, if the target message fails to match the IPSec hardware table entry, the target message is sent to the user-mode protocol stack in the same DPU as itself, so that the user-mode protocol stack matches the target message with the message identifier in the IPSec software table entry in its local user-mode protocol stack, and forwards the target message to the target host when or after the target message successfully matches the IPSec software table entry.

[0078] The above step S220 also includes: if the target message successfully matches the IPSec hardware entry, the IP core forwards the target message to the target host. Correspondingly, for the target message successfully matching the message identifier in the IPSec hardware entry, the IP core forwards the target message to the target host including: processing the target message according to the tunnel negotiation policy corresponding to the message identifier in the IPSec hardware entry that matches the target message, and sending the processed target message to the target host.

[0079] In one or more embodiments of the present application, the connection relationship between the IP in the DPU and the user-mode protocol stack is as follows: Figure 2 As shown, the user-mode protocol stack is connected to the source network port of the target message via the IP core. If there is a message identifier matching the target message received by the IP core from the source network port in the IPSec hardware table entry in the IP core, the IP core directly forwards the target message; if there is no message identifier matching the target message received by the IP core from the source network port in the IPSec hardware table entry in the IP core, the IP core forwards the target message to the user-mode protocol stack set in the same DPU as the IP core, so that the user-mode protocol stack receives the target message.

[0080] Corresponding to the configuration information of each target host in the above-mentioned IPSec hardware table items and IPSec software table items, before the above-mentioned step S210, it also includes: the steps of creating and updating the IPSec software table items and IPSec hardware table items in the DPU, specifically including: receiving the configuration information obtained by the IPSec negotiation process in the DPU, wherein the configuration information is obtained in advance by the IPSec negotiation process from the target host side via the management channel; creating or updating the IPSec software table items in the IP core and the IPSec hardware table items in the user-mode protocol stack according to the configuration information.

[0081] The DPU-based message forwarding embodiment corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the IP core can specifically execute the processing flow of the DPU-based message forwarding embodiment corresponding to the DPU-based message forwarding method that can be executed by the user-state protocol stack in the above-mentioned embodiment. Its functions are not repeated here, and reference can be made to the detailed description of the DPU-based message forwarding embodiment corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the user-state protocol stack.

[0082] Corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack, the present application also provides a method:

[0083] The present application also provides an IP core for executing the above-mentioned DPU-based message forwarding method that can be executed by the IP core, including:

[0084] A first message matching module, used to match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry;

[0085] The message forwarding module is used to send the target message to the user-mode protocol stack in the same DPU as itself when the target message fails to match the IPSec hardware table item, so that the user-mode protocol stack matches the target message with the message identifier in the IPSec software table item in its local user-mode protocol stack, and forward the target message to the target host when or after the target message successfully matches the IPSec software table item.

[0086] The first message matching module includes an IPSec hardware table entry and an encryption and decryption module; wherein the IPSec hardware table entry is used to store the configuration information of the target host for IPSec unloading of messages by the IP core using the IPSec hardware unloading method; the encryption and decryption module is used to process the target message according to the tunnel negotiation policy corresponding to the message identifier matching the target message in the local IPSec hardware table entry, and send the processed target message to the target host.

[0087] The above-mentioned IP core embodiment can specifically execute the processing flow of the DPU-based message forwarding embodiment corresponding to the DPU-based message forwarding method that can be executed by the IP core in the above-mentioned embodiment. Its functions are not repeated here, and reference can be made to the detailed description of the DPU message forwarding embodiment corresponding to the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack.

[0088] The present application also provides a DPU-based message forwarding system, which is arranged on the DPU, and the message forwarding system comprises: a user-mode protocol stack and an IP core that are communicatively connected to each other;

[0089] The user-mode protocol stack is used to execute the above-mentioned DPU-based message forwarding method that can be executed by the user-mode protocol stack; the IP core is used to execute the above-mentioned DPU-based message forwarding method that can be executed by the IP core.

[0090] In one or more embodiments of the present application, the configuration information obtained by the IPSec negotiation process through negotiation with different target hosts includes an SP policy and an SA policy, wherein the SP policy is a message identifier used to match the target message, and the SA policy is a tunnel negotiation policy used to indicate the processing algorithm of the target message. The configuration information sent to the user-mode protocol stack and the IP core is stored in the corresponding IPSec policy library. Correspondingly, the steps of executing message forwarding in the message forwarding system are as follows: Figure 4 or Figure 5As shown: first, the IP core queries from the IPSce policy library in the IP core whether there is an SP policy that matches the quintuple of the target message according to the quintuple of the target message. If so, the IP core directly executes the IPSec unloading of the target message, wherein, if the target message is an encrypted message, the IP core executes the IPSec unloading of the target message, including: decrypting and decapsulating the target message using the SA policy corresponding to the SP policy that successfully matches the target message in the IPSec hardware table item, and forwarding the decapsulated target message to the target host; if the target message is a plaintext message, the IP core executes the IPSec unloading of the target message, including: encrypting and encapsulating the target message using the SA policy corresponding to the SP policy that successfully matches the target message in the IPSec hardware table item, and forwarding the encapsulated target message to the target host. If not, the IP core sends the target message to the user-state protocol stack set in the same DPU, and the user-state protocol stack determines the message type of the target message. For the target message whose message type is an AH message or an ESP message, the user-state protocol stack queries whether there is an SP policy matching the quintuple of the target message from the IPSec policy library in the user-state protocol stack according to the quintuple of the target message. If so, the user-state protocol stack directly performs IPSec unloading of the target message, wherein, if the target message is an encrypted message, the user-state protocol stack checks whether there is an SP policy matching the quintuple of the target message from the IPSec policy library in the user-state protocol stack. The protocol stack performs IPSec unloading of the target message, including: using the SA policy corresponding to the SP policy that successfully matches the target message in the IPSec software table to decrypt and decapsulate the target message, and forwarding the decapsulated target message to the target host; if the target message is a plaintext message, the user-mode protocol stack performs IPSec unloading of the target message, including: using the SA policy corresponding to the SP that successfully matches the target message in the IPSec software table to decrypt and decapsulate the target message, and forwarding the decapsulated target message to the target host; if it does not exist, the target message is directly discarded. For target messages whose message types do not belong to either AH messages or ESP messages, the user-mode protocol stack forwards the target message to other message processing modules for message unloading.

[0091] Corresponding to the above method, the present invention also provides an electronic device, including a processor and a memory, wherein the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the electronic device implements the DPU-based message forwarding method that can be executed by the user-mode protocol stack or the DPU-based message forwarding method that can be executed by the IP core as mentioned above.

[0092] Corresponding to the above method, the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the DPU-based message forwarding method that can be executed by the user-mode protocol stack or the DPU-based message forwarding method that can be executed by the IP core as described above is implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0093] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0094] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0095] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0096] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A message forwarding method based on DPU, characterized in that: include: receiving, in the DPU, a target message sent by an IP core in the DPU and failing to match a message identifier in an IPSec hardware entry, wherein the IPSec hardware entry is set in the IP core; Determine the message type of the target message. If the message type of the target message is an authentication header protocol message or an encapsulating security payload protocol message, match the target message with the message identifier in the local IPSec software table entry, and forward the target message to the target host when or after the target message successfully matches the IPSec software table entry.

2. The DPU-based message forwarding method according to claim 1, characterized in that: Before the receiving in the DPU a target message sent by the IP core in the DPU and failing to match the message identifier in the IPSec hardware entry, the method further includes: Receiving configuration information obtained by an IPSec process in the DPU, wherein the configuration information is obtained in advance by the IPSec process from the target host side via a management channel; The local IPSec software table entry is created or updated according to the configuration information, wherein the configuration information is also forwarded by the IPSec process to the IP core, so that the IP core creates or updates the IPSec hardware table entry therein according to the configuration information.

3. The DPU-based message forwarding method according to claim 2, characterized in that: The configuration information includes a corresponding message identifier and a tunnel negotiation strategy; Correspondingly, when or after the target message successfully matches the IPSec software entry, forwarding the target message to the target host includes: If the target message successfully matches the message identifier in the IPSec software table entry, the target message is processed according to the tunnel negotiation policy corresponding to the message identifier in the IPSec software table entry that successfully matches the target message, and the processed target message is sent to the target host.

4. A user-mode protocol stack product, characterized in that: include: A message receiving module, used for receiving in a DPU a target message sent by an IP core in the DPU and failing to match a message identifier in an IPSec hardware entry, wherein the IPSec hardware entry is set in the IP core; The second message matching module is used to determine the message type of the target message. If the message type of the target message is an authentication header protocol message or an encapsulation security payload protocol message, the target message is matched with the message identifier in the local IPSec software table item, and when or after the target message successfully matches the IPSec software table item, the target message is forwarded to the target host.

5. A message forwarding method based on DPU, characterized in that: include: Match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry; If the target message fails to match the IPSec hardware table entry, the target message is sent to the user-state protocol stack in the same DPU as itself, so that the user-state protocol stack determines the message type of the target message. If the message type of the target message is an authentication header protocol message or an encapsulation security payload protocol message, the target message is matched with the message identifier in the IPSec software table entry in its local user-state protocol stack, and the target message is forwarded to the target host when or after the target message successfully matches the IPSec software table entry.

6. An IP core product, characterized in that: include: A first message matching module, used to match the target message currently received in the DPU with the message identifier in the local IPSec hardware table entry; A message forwarding module is used to send the target message to a user-mode protocol stack in the same DPU as the user-mode protocol stack when the target message fails to match the IPSec hardware table item, so that the user-mode protocol stack determines the message type of the target message; if the message type of the target message is an authentication header protocol message or an encapsulation security payload protocol message, the target message is matched with the message identifier in the IPSec software table item in its local user-mode protocol stack, and the target message is forwarded to the target host when or after the target message successfully matches the IPSec software table item.

7. A message forwarding system based on DPU, characterized in that: Set up on the DPU, the message forwarding system includes: a user-mode protocol stack and an IP core that are communicatively connected to each other; The user-mode protocol stack is used to execute the DPU-based message forwarding method according to any one of claims 1 to 3; The IP core is used to execute the DPU-based message forwarding method described in claim 5.

8. An electronic device comprising a processor and a memory, characterized in that: The memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the electronic device implements the DPU-based message forwarding method as described in any one of claims 1 to 3 or the DPU-based message forwarding method as described in claim 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the DPU-based message forwarding method as described in any one of claims 1 to 3 or the DPU-based message forwarding method as described in claim 5 is implemented.

Citation Information

Patent Citations

  • Message processing method and device, medium and equipment

    CN112422453A

  • Message forwarding method and related device

    CN115134315A