Data forwarding method and device based on a stateful network element forwarding platform

By leveraging the three-layer forwarding architecture of the stateful network element forwarding platform and utilizing the advantages of different layers of hardware, table entry offloading is accelerated, solving the performance and cost disadvantages of stateful gateway devices and providing an efficient and low-cost data forwarding solution.

CN122120195APending Publication Date: 2026-05-29BEIJING VOLCANO ENGINE TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING VOLCANO ENGINE TECH CO LTD
Filing Date
2024-11-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the implementation of stateful gateway devices is mostly based on software on servers, resulting in significant disadvantages in performance and cost. Providing a universal, high-performance, and low-cost solution is an urgent need for the development of network infrastructure.

Method used

A three-layer forwarding architecture based on a stateful network element forwarding platform is adopted. The first-layer forwarding unit does not store table entries, while the second-layer forwarding unit stores all table entries of the third-layer forwarding unit. The session table management of the multi-layer forwarding units is simplified, and the advantages of their respective hardware are utilized to accelerate table offloading.

Benefits of technology

It improves data forwarding efficiency, reduces forwarding costs, and provides an overall optimal solution with ultra-high bandwidth, microsecond-level low latency, and complex logic processing capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120195A_ABST
    Figure CN122120195A_ABST
Patent Text Reader

Abstract

The method comprises the following steps: receiving and analyzing an original data packet sent by a first computing node by a first layer forwarding element in a stateful network element forwarding platform to obtain a data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first layer forwarding element does not store a table item, a second layer forwarding element stores all table items of a third layer forwarding element, and is used for table item offloading acceleration; if the data packet type does not belong to a preset data packet type, the first layer forwarding element encapsulates a message header on the original data packet and forwards the original data packet to the second layer forwarding element for session table lookup to obtain message encapsulation details, and performs message forwarding based on the message encapsulation details. The method can improve the data forwarding efficiency and reduce the data forwarding cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of cloud network technology, and in particular to a data forwarding method and device based on a stateful network element forwarding platform. Background Technology

[0002] Building a high-performance, flexible, and scalable network infrastructure to support business operations is a strong requirement for all large-scale cloud vendors and service providers. Stateful gateway devices, such as load balancers and NAT (Network Address Translation) devices, are an important component of this network infrastructure.

[0003] Currently, most stateful network elements are implemented in software on servers, i.e., software gateway technology. While software gateways offer maximum flexibility and agility, they suffer from significant performance and cost disadvantages. Therefore, providing a universal, high-performance, and low-cost solution is an urgent issue that needs to be addressed in the development of network infrastructure. Summary of the Invention

[0004] This disclosure provides a data forwarding method and device based on a stateful network element forwarding platform, which can improve data forwarding efficiency and reduce data forwarding costs.

[0005] In a first aspect, embodiments of this disclosure provide a data forwarding method based on a stateful network element forwarding platform, including:

[0006] The stateful network element forwarding platform receives and parses the original data packets sent by the first computing node through the first-layer forwarding unit to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration;

[0007] If the data packet type does not belong to the preset data packet type, the first layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forwards the message based on the message encapsulation details;

[0008] If the data packet type belongs to the preset data packet type, the original data packet is encapsulated with a message header by the first layer forwarding unit and forwarded to the third layer forwarding unit to obtain message encapsulation details, and message forwarding is performed based on the message encapsulation details.

[0009] Secondly, embodiments of this disclosure provide a data forwarding device based on a stateful network element forwarding platform, comprising:

[0010] The receiving unit is used to receive and parse the original data packet sent by the first computing node through the first-layer forwarding unit in the stateful network element forwarding platform to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration;

[0011] The first forwarding unit is configured to, if the data packet type does not belong to a preset data packet type, encapsulate the original data packet with a message header through the first-layer forwarding unit and forward it to the second-layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forward the message based on the message encapsulation details;

[0012] The second forwarding unit is configured to, if the data packet type belongs to the preset data packet type, encapsulate the original data packet header through the first-layer forwarding unit and forward it to the third-layer forwarding unit to obtain the packet encapsulation details, and then forward the packet based on the packet encapsulation details.

[0013] Thirdly, embodiments of this disclosure provide an electronic device, including: a processor and a memory;

[0014] The memory stores computer-executed instructions;

[0015] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect.

[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect.

[0017] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect.

[0018] This embodiment provides a data forwarding method and device based on a stateful network element forwarding platform. The method includes: receiving and parsing the original data packet sent by the first computing node through the first-layer forwarding unit in the stateful network element forwarding platform to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration; if the data packet type does not belong to a preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second-layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forwards the message based on the message encapsulation details; if the data packet type belongs to a preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the third-layer forwarding unit to obtain message encapsulation details, and forwards the message based on the message encapsulation details. In this technical solution, the first-layer forwarding unit provides ultra-high bandwidth forwarding capabilities, the second-layer forwarding unit provides microsecond-level low-latency forwarding and table lookup capabilities, and the third-layer forwarding unit provides general-purpose complex logic processing capabilities. The session table management of the multi-layer forwarding units is simplified; no tables are stored in the first-layer forwarding unit, while all tables from the third-layer forwarding unit are stored in the intermediate second-layer forwarding unit for table offloading acceleration. This achieves extreme performance optimization of the core function (data forwarding capability) of the first-layer forwarding unit. Furthermore, storing all tables from the third-layer forwarding unit in the second-layer forwarding unit fully utilizes its low-latency forwarding and table lookup capabilities. Therefore, when implementing data forwarding based on a three-layer hardware forwarding architecture, the hardware offloading function is achieved through the second-layer forwarding unit. By leveraging the respective advantages of different hardware layers, the overall effect in terms of capacity, performance, and cost is optimal, improving data forwarding efficiency and reducing data forwarding costs. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic diagram illustrating an application scenario of the data forwarding method based on a stateful network element forwarding platform provided in this embodiment of the disclosure.

[0021] Figure 2 The flow chart of the data forwarding method based on a stateful network element forwarding platform provided in the embodiments of this disclosure Figure 1 ;

[0022] Figure 3 A schematic diagram of a data forwarding method based on a stateful network element forwarding platform provided in this embodiment of the present disclosure. Figure 1 ;

[0023] Figure 4 This is a schematic diagram of encapsulating a message header into a raw data packet, provided as an embodiment of the present disclosure. Figure 1 ;

[0024] Figure 5 This is a schematic diagram of modifying the original data packet header provided in an embodiment of the present disclosure. Figure 1 ;

[0025] Figure 6 A schematic diagram of the structure of a data forwarding device based on a stateful network element forwarding platform provided in this embodiment of the disclosure;

[0026] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0029] Building a high-performance, flexible, and scalable network infrastructure to support business operations is a strong requirement for all large-scale cloud vendors and service providers. Stateful gateway devices, such as load balancers and routing devices, are a crucial component of this network infrastructure.

[0030] Stateful network elements maintain state information about each session or connection when processing network traffic. They track the state of each data packet, such as the establishment, transmission, and termination of a TCP connection. Stateful network elements can perform state-related operations, such as session timeout, traffic shaping, and congestion control. They typically require more memory and processing power to maintain state information. Examples of stateful network elements include traditional routers, firewalls, and load balancers.

[0031] Currently, most stateful network elements are implemented in software on servers, i.e., software gateway technology. While software gateway technology offers high flexibility and agility, it suffers from significant disadvantages in performance and cost. Therefore, providing a universal, high-performance, and low-cost solution is an urgent issue that needs to be addressed in the development of network infrastructure.

[0032] To address the technical problems in existing technologies, the inventors' technical concept is as follows: a cloud gateway fast path forwarding platform based on multi-layer forwarding units fully leverages the advantages of different forwarding units. It achieves an overall optimal solution in terms of capacity, performance, and cost. Taking a hardware architecture comprising three forwarding units—a first-layer forwarding unit, a second-layer forwarding unit, and a third-layer forwarding unit—as an example, the first-layer forwarding unit can provide ultra-high bandwidth forwarding capabilities, the second-layer forwarding unit can provide microsecond-level low-latency forwarding and entry lookup capabilities, and the third-layer forwarding unit can provide general-purpose complex logic processing capabilities. In this embodiment, entry management is simplified: the first-layer forwarding unit does not store any entries, fully utilizing its ultra-high bandwidth forwarding capabilities. The second-layer forwarding unit contains all the entries managed by the third-layer forwarding unit, fully utilizing its low-latency forwarding and entry lookup capabilities. Furthermore, packet encapsulation details can be obtained through the third-layer forwarding unit and sent to the second-layer forwarding unit, fully utilizing its complex logic processing capabilities. Therefore, this logical design is very simple and results in minimal performance loss, achieving an overall optimal solution in terms of capacity, performance, and cost.

[0033] Accordingly, the specific steps include: First, the stateful network element forwarding platform receives and parses the original data packet sent by the first computing node through the first-layer forwarding unit to obtain the data packet type corresponding to the original data packet. The stateful network element forwarding platform adopts a three-layer forwarding architecture, where the first-layer forwarding unit does not store entries, and the second-layer forwarding unit stores all entries of the third-layer forwarding unit for entry offloading acceleration. Then, if the data packet type does not belong to the preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second-layer forwarding unit for session table lookup to obtain message encapsulation details, and forwards the packet based on the message encapsulation details. Finally, if the data packet type belongs to the preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the third-layer forwarding unit to obtain message encapsulation details, and forwards the packet based on the message encapsulation details.

[0034] In this technical solution, the first-layer forwarding unit provides ultra-high bandwidth forwarding capabilities, the second-layer forwarding unit provides microsecond-level low-latency forwarding and table lookup capabilities, and the third-layer forwarding unit provides general-purpose complex logic processing capabilities. The session table management of the multi-layer forwarding units is simplified; no tables are stored in the first-layer forwarding unit, while all tables from the third-layer forwarding unit are stored in the intermediate second-layer forwarding unit for table offloading acceleration. This achieves extreme performance optimization of the core function (data forwarding capability) of the first-layer forwarding unit. Furthermore, storing all tables from the third-layer forwarding unit in the second-layer forwarding unit fully utilizes its low-latency forwarding and table lookup capabilities. Therefore, when implementing data forwarding based on a three-layer hardware forwarding architecture, the hardware offloading function is achieved through the second-layer forwarding unit. By leveraging the respective advantages of different hardware layers, the overall effect in terms of capacity, performance, and cost is optimal, improving data forwarding efficiency and reducing data forwarding costs.

[0035] The application scenarios of the embodiments of this disclosure are explained below:

[0036] The data forwarding method based on a stateful network element forwarding platform provided in this disclosure can be applied to forwarding platforms of various multi-layer forwarding units. For example, such as... Figure 1As shown, a hardware forwarding platform based on the XLT (eXtra Large Table) architecture can fully leverage the advantages of multi-layer forwarding units. The XLT architecture is a three-layer hardware forwarding architecture, comprising: an ASIC (Application-Specific Integrated Circuit) forwarding unit, an FPGA (Field-Programmable Gate Array) forwarding unit, and a forwarding server (e.g., an x86 server).

[0037] In this system, the x86 server communicates with the ASIC forwarding unit and the FPGA forwarding unit via a PCIe (Peripheral Component Interconnect Express) interface on the control plane. The FPGA forwarding unit is a highly programmable device; all entries stored in the FPGA need to be distributed and managed by the SlowPath application on the x86 server using the corresponding DMA (Direct Memory Access) driver. For example... Figure 1 As shown, the DMA driver on the x86 server can be the fpga_lib driver. The x86 server can interact with the ASIC forwarding unit based on the network transport protocol's API (Application Programming Interface).

[0038] The hardware forwarding platform based on the XLT architecture can provide general-purpose complex logic processing capabilities through the forwarding server. The FPGA forwarding unit can provide microsecond-level low-latency forwarding and accelerated entry lookup. The ASIC forwarding unit can provide ultra-high bandwidth forwarding capabilities. The following detailed examples illustrate the data forwarding method based on the stateful network element forwarding platform:

[0039] Figure 2 The data forwarding method flow based on a stateful network element forwarding platform provided in the embodiments of this disclosure Figure 1 In this embodiment of the disclosure, the entity executing the data forwarding method can be an electronic device, which can be a terminal or a server. Figure 2 As shown, the data forwarding method based on a stateful network element forwarding platform includes:

[0040] S201. The stateful network element forwarding platform receives and parses the original data packets sent by the first computing node through the first-layer forwarding unit to obtain the data packet type corresponding to the original data packets. The stateful network element forwarding platform adopts a three-layer forwarding architecture, in which the first-layer forwarding unit does not store table entries, and the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration.

[0041] In this embodiment of the disclosure, the first-layer forwarding unit is a forwarding device that provides ultra-high bandwidth forwarding capabilities. For example, such as... Figure 3 As shown, the first-layer forwarding unit can be an ASIC forwarding unit.

[0042] The second-layer forwarding unit can be a forwarding device that provides microsecond-level low-latency forwarding and accelerated entry lookup. Optionally, the second-layer forwarding unit includes a DPU (Data Processing Unit) or a Field-Programmable Gate Array (FPGA). For example, Figure 3 As shown, the first-layer forwarding unit can be an FPGA forwarding unit.

[0043] The third-layer forwarding unit can be a device that provides general-purpose complex logic processing capabilities. For example... Figure 3 As shown, the third-layer forwarding unit can be an x86 server.

[0044] In this embodiment of the disclosure, data packet types can be classified according to transmission protocol, including protocol data packets and non-protocol data packets. Data packet types can also be classified according to forwarding time, including data packets forwarded for the first time and data packets forwarded multiple times.

[0045] S202. If the data packet type does not belong to the preset data packet type, the original data packet is encapsulated with a message header by the first-layer forwarding unit and forwarded to the second-layer forwarding unit for session table lookup to obtain message encapsulation details, and the message is forwarded based on the message encapsulation details.

[0046] In this embodiment of the disclosure, the preset data packet type includes: protocol data packets and / or data packets forwarded for the first time.

[0047] In some embodiments, the preset data packet type includes: protocol data packets. Optionally, the protocol data packets may be network protocol data packets such as ARP data packets, ICMP data packets, and BGP data packets, or data packets that require special processing, such as TCP SYN data packets, TCP FIN data packets, TCP RST data packets, and fragmented data packets.

[0048] Optionally, when a data packet from the first computing node arrives at the first-layer forwarding unit, it is received and parsed to determine the data packet type corresponding to the original data packet. If it is a protocol data packet or a data packet containing a specific flag, the data packet is forwarded to the third-layer forwarding unit for processing. If it is not a protocol data packet (i.e., a normal data packet), the data packet is forwarded to the second-layer forwarding unit for session table lookup. The specific flag can be any preset flag.

[0049] For example, such as Figure 3 As shown, when the ASIC forwarding unit (first-layer forwarding unit) receives the raw data packet sent by the first computing node, it parses the protocol header of the raw data packet through the parsing module to determine the data packet type corresponding to the raw data packet. If the data packet type is a preset data packet type, it is forwarded to the x86 server; otherwise, it is forwarded to the FPGA forwarding unit.

[0050] The message obtained by encapsulating the original data packet with a message header through the first-layer forwarding unit is as follows: Figure 4 As shown. This message includes: a 64-byte header and n bytes of raw data. The 64-byte header includes table lookup request information (42 bytes).

[0051] It should be noted that different stateful network element forwarding platforms support different network scenarios and fast path forwarding requirements. In this application, as... Figure 3 As shown, different forwarding configuration information can be configured for different types of stateful network element forwarding platforms through the third-layer forwarding unit (x86 server) to realize the corresponding functions of the stateful network element forwarding platform. For example, if the stateful network element forwarding platform is a load balancer, the forwarding configuration information configured for the load balancer includes: rate limiting information, ECMP (Equal Cost Multi-Path Routing) information, and ACL (Access Control List) information.

[0052] For example, the packet encapsulation method is: NAT v6 / v4, enable bps limit, enable ppslimit, copy outer TOS to inner, copy inner TOS to outer, inner TTL decrease, DNAT, SNAT, drop, decap, encap_v6, encap_v4.

[0053] NAT v6 stands for IPv6 Network Address Translation, which is used to translate an IPv6 address into another IPv6 address.

[0054] NAT v4 stands for IPv4 Network Address Translation, used to translate an IPv4 address into another IPv4 address.

[0055] "enable bps limit" means enabling the bits per second (bps) limit to control the rate of network traffic.

[0056] Enable pps limit means enabling the packets per second (pps) limit, which is used to control the packet rate of network traffic.

[0057] "copy outer TOS to inner" means copying the Type of Service (TOS) field from the outer header (such as the IP header) to the inner header.

[0058] "copy inner TOS to outer" means copying the Type of Service (TOS) field from the inner header to the outer header.

[0059] Inner TTL decrease means reducing the Time-to-Live (TTL) value of the inner layer (such as the IP header), which is usually used to prevent loops.

[0060] DNAT stands for Destination Network Address Translation, used to change the destination address of data packets.

[0061] SNAT stands for Source Network Address Translation, which is used to change the source address of data packets.

[0062] "drop" means to discard the data packet without any processing.

[0063] decap means to remove the outermost encapsulation of a data packet; it is commonly used in tunneling technology.

[0064] encap_v6 means IPv6 encapsulation, which encapsulates data packets in an IPv6 header for use in IPv6 tunnels.

[0065] encap_v4 means IPv4 encapsulation, which encapsulates data packets in an IPv4 header for use in IPv4 tunnels.

[0066] In some embodiments, the process of encapsulating a packet header in the original data packet by a first-layer forwarding unit and forwarding it to a second-layer forwarding unit for session table lookup to obtain packet encapsulation details includes: encapsulating a packet header in the original data packet by a first-layer forwarding unit and forwarding it to a second-layer forwarding unit, so as to extract the six-tuple information corresponding to the original data packet by the second-layer forwarding unit, determine the hash value corresponding to the six-tuple information, and perform a session table lookup based on the hash value to obtain packet encapsulation details.

[0067] Optionally, the six-tuple information corresponding to the original data packet includes: source device IP, source interface, destination device IP, destination interface, transport protocol, and flag bits. The flag bits can be VNID, representing the ID defined in the VxLAN protocol.

[0068] It's important to note that the lookup efficiency of a hash table directly impacts search speed and resource utilization. To minimize the likelihood and cost of hash collisions, a two-level lookup method was designed and implemented. The first-level hash function determines the slots for entries stored in DRAM, with each slot holding a maximum of 8 entries. The second hash function generates a fingerprint, which is compared with all 8 entries in the slot. Entries matching the two hash functions can be located to a unique flow_id, and then the HBM is accessed to retrieve the entry's content. This design divides the total resources into 8 channels, which can accommodate 8 million * 8 hash collisions, i.e., each channel can hold 64 million hash collisions, effectively reducing the occurrence of add failures due to hash collisions.

[0069] In some embodiments, such as Figure 3 As shown, the second-layer forwarding unit includes a state management module for statistical data packets; correspondingly, the method also includes: using the state management module of the second-layer forwarding unit to count the number of packets and the amount of data in the original data packets, and reporting the statistical results to the third-layer forwarding unit.

[0070] It should be noted that if the packet encapsulation details corresponding to the original data packet are not found in the session table, the packet encapsulation details corresponding to the original data packet can be determined through the third-layer forwarding unit. Accordingly, the method also includes: if the packet encapsulation details are not found by searching the session table through the second-layer forwarding unit, the original data packet with the encapsulated packet header is forwarded to the third-layer forwarding unit to obtain the packet encapsulation details, and the packet is forwarded based on the packet encapsulation details.

[0071] The message obtained by adding message encapsulation details to the message header through the third-layer forwarding unit is as follows: Figure 5As shown. The message header is also 64 bytes, of which the message encapsulation details include 58 bytes. For example, the return identifier in the message header may include: 1 (success), 64 (invalid or no packet), 65 (table lookup failed), 66 (flow table cyclic redundancy check failed), 67 (flow table invalid), 68 (flow table match failed), 69 (virtual machine mismatch), 70 (flow table version mismatch).

[0072] It should be noted that adding message encapsulation details to the message header results in the original data packet and the message header with added encapsulation details forming a new message. Optionally, as... Figure 3 As shown, the encapsulated packet (the aforementioned new packet) is forwarded to the ASIC forwarding unit via the Slow Path APP in the x86 server. The encapsulation module of the ASIC forwarding unit re-encapsulates the original data packet according to the packet encapsulation details, and then forwards the encapsulated packet to the second computing node. In some embodiments, the operations performed on the original data packet include, but are not limited to: VxLAN tunnel encapsulation / decapsulation, SNAT / DNAT conversion, TTL update, and TOS modification.

[0073] In some embodiments, the packet encapsulation details corresponding to the original data packet are determined by the third-layer forwarding unit and can be sent to the second-layer forwarding unit for storage. Accordingly, the method further includes: sending the packet encapsulation details corresponding to the original data packet to the second-layer forwarding unit through the third-layer forwarding unit, so as to store the packet encapsulation details corresponding to the original data packet in the session table.

[0074] For example, the FPGA board has 8GB of HBM and 12GB of DDR32 memory. A reasonable hash algorithm and key-value allocation directly determine the FPGA's table lookup performance. HBM has a relatively small capacity but provides better read / write performance, while DRAM does the opposite. In read scenarios, the Index session table only requires one read operation. However, to support flow statistics, the Flow Table requires both a read and a write operation. Therefore, the design decides to place the Index session table in DRAM and the Flow Table in HBM. A complete entry stored in HBM contains flow_id, key, value, and stats parts; 128 bytes are sufficient to store all the necessary information. Therefore, the FPGA card can support a maximum of 8GB / 128 = 64 million entries. Considering only 6 MAC channels, the actual storage capacity is 48 million entries.

[0075] In some embodiments, the second-layer forwarding unit and the third-layer forwarding unit interact with each other through a direct memory access (DMA) driver; wherein, the second-layer forwarding unit provides DMA driver support through a multi-channel direct memory access module (MCDMA) IP, and the third-layer forwarding unit adapts to the DMA driver through a data plane development kit (DPDK) driver to realize data interaction between the second-layer forwarding unit and the third-layer forwarding unit.

[0076] It should be noted that, as Figure 3 As shown, the speed at which the x86 server (Layer 3 forwarding unit) sends packet encapsulation details to the FPGA forwarding unit (Layer 2 forwarding unit) directly determines the performance of the stateful network element forwarding platform. The x86 server can implement an asynchronous API framework on top of the driver and provide CRUD methods for objects. The session table configuration interface can be transmitted using a DMA driver.

[0077] Optionally, the session table configuration interface adopts a generic structure definition for DMA drivers, including:

[0078] opt_tag: A tag for each operation, used to associate the operation with the return value, and is recycled in a cyclical manner.

[0079] pipeline: The pipeline number, supporting 0 to 5.

[0080] object_id: Used to indicate which object (index table, stream table, etc.) is being operated on.

[0081] action: various operations, including add, del, etc.

[0082] In this embodiment, the intermediate layer (i.e., the second-layer forwarding unit) for entry offloading acceleration can be either a Field-Programmable Gate Array (FPGA) forwarding unit or any DPU device. From a platform perspective, to reduce unnecessary secondary development, a hardware abstraction layer is implemented to shield different hardware differences. This abstraction layer considers the differences between different hardware and provides a unified entry offloading API. If adaptation to different hardware is required, only the underlying hardware-related parts need to be developed (e.g., different DMA schemes), and the upper-layer network element application will not require any modifications.

[0083] S203. If the data packet type belongs to the preset data packet type, the original data packet is encapsulated with a message header by the first-layer forwarding unit and forwarded to the third-layer forwarding unit to obtain the message encapsulation details, and the message is forwarded based on the message encapsulation details.

[0084] In this embodiment of the disclosure, packet forwarding based on packet encapsulation details includes: re-encapsulating the original data packet according to the packet encapsulation details through a first-layer forwarding unit, and forwarding the re-encapsulated data packet to a second computing node; the packet encapsulation details include one or more of the following: source network address, destination network address, time to live, and type of service.

[0085] Optionally, the message encapsulation details include the source network address, destination network address, time to live, and type of service. Accordingly, the first-layer forwarding unit re-encapsulates the original data packet according to the message encapsulation details and forwards the re-encapsulated data packet to the second computing node. This includes: performing source network address translation, destination network address translation, setting time to live, and setting type of service on the original data packet according to the message encapsulation details by the first-layer forwarding unit to obtain the re-encapsulated data packet; and selecting an outgoing port according to the equal-cost multi-path routing by the first-layer forwarding unit and forwarding the re-encapsulated data packet to the second computing node through the outgoing port.

[0086] This disclosure provides a data forwarding method based on a stateful network element forwarding platform. First, the first-layer forwarding unit in the stateful network element forwarding platform receives and parses the original data packet sent by the first computing node to obtain the corresponding data packet type. The stateful network element forwarding platform adopts a three-layer forwarding architecture, where the first-layer forwarding unit does not store entries, and the second-layer forwarding unit stores all entries of the third-layer forwarding unit for entry offloading acceleration. Then, if the data packet type does not belong to a preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a header and forwards it to the second-layer forwarding unit for session table lookup to obtain the packet encapsulation details, and forwards the packet based on the packet encapsulation details. Finally, if the data packet type belongs to a preset data packet type, the first-layer forwarding unit encapsulates the original data packet with a header and forwards it to the third-layer forwarding unit to obtain the packet encapsulation details, and forwards the packet based on the packet encapsulation details. In this technical solution, the first-layer forwarding unit provides ultra-high bandwidth forwarding capabilities, the second-layer forwarding unit provides microsecond-level low-latency forwarding and table lookup capabilities, and the third-layer forwarding unit provides general-purpose complex logic processing capabilities. The session table management of the multi-layer forwarding units is simplified; no tables are stored in the first-layer forwarding unit, while all tables from the third-layer forwarding unit are stored in the intermediate second-layer forwarding unit for table offloading acceleration. This achieves extreme performance optimization of the core function (data forwarding capability) of the first-layer forwarding unit. Furthermore, storing all tables from the third-layer forwarding unit in the second-layer forwarding unit fully utilizes its low-latency forwarding and table lookup capabilities. Therefore, when implementing data forwarding based on a three-layer hardware forwarding architecture, the hardware offloading function is achieved through the second-layer forwarding unit. By leveraging the respective advantages of different hardware layers, the overall effect in terms of capacity, performance, and cost is optimal, improving data forwarding efficiency and reducing data forwarding costs.

[0087] Figure 6 A schematic diagram of the structure of a data forwarding device based on a stateful network element forwarding platform provided in this embodiment of the disclosure is shown below. Figure 6 As shown, the device includes:

[0088] The receiving unit 601 is used to receive and parse the original data packet sent by the first computing node through the first-layer forwarding unit in the stateful network element forwarding platform to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration;

[0089] The first forwarding unit 602 is used to, if the data packet type does not belong to a preset data packet type, encapsulate the original data packet with a message header through the first layer forwarding unit and forward it to the second layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forward the message based on the message encapsulation details;

[0090] The second forwarding unit 603 is used to, if the data packet type belongs to the preset data packet type, encapsulate the original data packet header through the first layer forwarding unit and forward it to the third layer forwarding unit to obtain the packet encapsulation details, and forward the packet based on the packet encapsulation details.

[0091] According to one or more embodiments of this disclosure, the preset data packet type includes: protocol data packets and / or data packets forwarded for the first time.

[0092] According to one or more embodiments of this disclosure, the first forwarding unit 602 encapsulates a header on the original data packet by the first-layer forwarding unit and forwards it to the second-layer forwarding unit for session table lookup to obtain packet encapsulation details. This includes: encapsulating a header on the original data packet by the first-layer forwarding unit and forwarding it to the second-layer forwarding unit, extracting the six-tuple information corresponding to the original data packet by the second-layer forwarding unit, determining the hash value corresponding to the six-tuple information, and performing a session table lookup based on the hash value to obtain packet encapsulation details.

[0093] According to one or more embodiments of this disclosure, the first forwarding unit 602 is further configured to forward the original data packet after encapsulating the packet header to the third-layer forwarding unit to obtain the packet encapsulation details if the packet encapsulation details are not found by the second-layer forwarding unit in the session table, and to perform packet forwarding based on the packet encapsulation details.

[0094] According to one or more embodiments of this disclosure, it further includes: a third forwarding unit, the third forwarding unit being configured to send the packet encapsulation details corresponding to the original data packet to the second layer forwarding unit through the third layer forwarding unit, so as to store the packet encapsulation details corresponding to the original data packet in the session table.

[0095] According to one or more embodiments of this disclosure, the second-layer forwarding unit and the third-layer forwarding unit interact with each other via a direct memory access (DMA) driver; wherein the second-layer forwarding unit provides DMA driver support through a multi-channel direct memory access module (MCDMA) IP, and the third-layer forwarding unit adapts to the DMA driver through a data plane development kit (DPDK) driver to realize data interaction between the second-layer forwarding unit and the third-layer forwarding unit.

[0096] According to one or more embodiments of this disclosure, the second forwarding unit 603 forwards packets based on packet encapsulation details, including: re-encapsulating the original data packet by the first-layer forwarding unit according to the packet encapsulation details, and forwarding the re-encapsulated data packet to the second computing node; the packet encapsulation details include one or more of the following: source network address, destination network address, time to live, and type of service.

[0097] According to one or more embodiments of this disclosure, the packet encapsulation details include a source network address, a destination network address, a time-to-live (TTL), and a service type. Correspondingly, the second forwarding unit 603, through the first-layer forwarding unit, re-encapsulates the original data packet according to the packet encapsulation details and forwards the re-encapsulated data packet to the second computing node. This includes: performing source network address translation, destination network address translation, setting the TTL, and setting the service type on the original data packet according to the packet encapsulation details by the first-layer forwarding unit to obtain the re-encapsulated data packet; selecting an outgoing port according to equal-cost multi-path routing by the first-layer forwarding unit, and forwarding the re-encapsulated data packet to the second computing node through the outgoing port.

[0098] According to one or more embodiments of this disclosure, the second-layer forwarding unit includes a data processor (DPU) or a field-programmable gate array (FPGA).

[0099] refer to Figure 7 The diagram illustrates a structural schematic of an electronic device 700 suitable for implementing embodiments of the present disclosure. The electronic device 700 can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0100] like Figure 7As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0101] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0102] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.

[0103] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0104] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0105] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.

[0106] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0108] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".

[0109] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0110] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0111] In a first aspect, according to one or more embodiments of this disclosure, a data forwarding method based on a stateful network element forwarding platform is provided, comprising:

[0112] The stateful network element forwarding platform receives and parses the original data packets sent by the first computing node through the first-layer forwarding unit to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration;

[0113] If the data packet type does not belong to the preset data packet type, the first layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forwards the message based on the message encapsulation details;

[0114] If the data packet type belongs to the preset data packet type, the original data packet is encapsulated with a message header by the first layer forwarding unit and forwarded to the third layer forwarding unit to obtain message encapsulation details, and message forwarding is performed based on the message encapsulation details.

[0115] According to one or more embodiments of this disclosure, the preset data packet type includes: protocol data packets and / or data packets forwarded for the first time.

[0116] According to one or more embodiments of this disclosure, the step of encapsulating the original data packet with a header by the first layer forwarding unit and forwarding it to the second layer forwarding unit for session table lookup to obtain packet encapsulation details includes:

[0117] The first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second-layer forwarding unit. The second-layer forwarding unit then extracts the six-tuple information corresponding to the original data packet, determines the hash value corresponding to the six-tuple information, and performs a session table lookup based on the hash value to obtain the message encapsulation details.

[0118] According to one or more embodiments of this disclosure, the method further includes:

[0119] If the packet encapsulation details are not found when the second-layer forwarding unit looks up the session table, the original data packet with the encapsulated packet header is forwarded to the third-layer forwarding unit to obtain the packet encapsulation details, and the packet is forwarded based on the packet encapsulation details.

[0120] According to one or more embodiments of this disclosure, it further includes:

[0121] The third-layer forwarding unit sends the packet encapsulation details corresponding to the original data packet to the second-layer forwarding unit, so as to store the packet encapsulation details corresponding to the original data packet in the session table.

[0122] According to one or more embodiments of this disclosure, the second-layer forwarding unit and the third-layer forwarding unit exchange data via a direct memory access (DMA) driver.

[0123] The second-layer forwarding unit provides DMA driver support through the Multi-Channel Direct Memory Access Module (MCDMA) IP, and the third-layer forwarding unit adapts to the DMA driver through the Data Plane Development Kit (DPDK) driver to realize data interaction between the second-layer forwarding unit and the third-layer forwarding unit.

[0124] According to one or more embodiments of this disclosure, the message forwarding based on message encapsulation details includes:

[0125] The first-layer forwarding unit re-encapsulates the original data packet according to the packet encapsulation details and forwards the re-encapsulated data packet to the second computing node; the packet encapsulation details include one or more of the following: source network address, destination network address, time to live, and service type.

[0126] According to one or more embodiments of this disclosure, the packet encapsulation details include a source network address, a destination network address, a time-to-live (TTL), and a service type. Correspondingly, the step of re-encapsulating the original data packet according to the packet encapsulation details using the first-layer forwarding unit and forwarding the re-encapsulated data packet to the second computing node includes: performing source network address translation, destination network address translation, setting the TTL, and setting the service type on the original data packet according to the packet encapsulation details using the first-layer forwarding unit to obtain the re-encapsulated data packet; selecting an outgoing port according to equal-cost multi-path routing using the first-layer forwarding unit, and forwarding the re-encapsulated data packet to the second computing node through the outgoing port.

[0127] According to one or more embodiments of this disclosure, the second-layer forwarding unit includes a data processor (DPU) or a field-programmable gate array (FPGA).

[0128] Secondly, according to one or more embodiments of this disclosure, a data forwarding device based on a stateful network element forwarding platform is provided, comprising:

[0129] The receiving unit is used to receive and parse the original data packet sent by the first computing node through the first-layer forwarding unit in the stateful network element forwarding platform to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration;

[0130] The first forwarding unit is configured to, if the data packet type does not belong to a preset data packet type, encapsulate the original data packet with a message header through the first-layer forwarding unit and forward it to the second-layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forward the message based on the message encapsulation details;

[0131] The second forwarding unit is configured to, if the data packet type belongs to the preset data packet type, encapsulate the original data packet header through the first-layer forwarding unit and forward it to the third-layer forwarding unit to obtain the packet encapsulation details, and then forward the packet based on the packet encapsulation details.

[0132] According to one or more embodiments of this disclosure, the preset data packet type includes: protocol data packets and / or data packets forwarded for the first time.

[0133] According to one or more embodiments of this disclosure, the first forwarding unit encapsulates a header on the original data packet and forwards it to the second layer forwarding unit for session table lookup to obtain packet encapsulation details, including: encapsulating a header on the original data packet and forwarding it to the second layer forwarding unit through the first layer forwarding unit, extracting the six-tuple information corresponding to the original data packet through the second layer forwarding unit, determining the hash value corresponding to the six-tuple information, and performing a session table lookup based on the hash value to obtain packet encapsulation details.

[0134] According to one or more embodiments of this disclosure, the first forwarding unit is further configured to forward the original data packet after encapsulating the packet header to the third forwarding unit to obtain the packet encapsulation details if the packet encapsulation details are not found by the second-layer forwarding unit in the session table, and to perform packet forwarding based on the packet encapsulation details.

[0135] According to one or more embodiments of this disclosure, it further includes: a third forwarding unit, the third forwarding unit being configured to send the packet encapsulation details corresponding to the original data packet to the second layer forwarding unit through the third layer forwarding unit, so as to store the packet encapsulation details corresponding to the original data packet in the session table.

[0136] According to one or more embodiments of this disclosure, the second-layer forwarding unit and the third-layer forwarding unit interact with each other via a direct memory access (DMA) driver; wherein the second-layer forwarding unit provides DMA driver support through a multi-channel direct memory access module (MCDMA) IP, and the third-layer forwarding unit adapts to the DMA driver through a data plane development kit (DPDK) driver to realize data interaction between the second-layer forwarding unit and the third-layer forwarding unit.

[0137] According to one or more embodiments of this disclosure, the second forwarding unit forwards packets based on packet encapsulation details, including: re-encapsulating the original data packet by the first-layer forwarding unit according to the packet encapsulation details, and forwarding the re-encapsulated data packet to the second computing node; the packet encapsulation details include one or more of source network address, destination network address, time to live, and type of service.

[0138] According to one or more embodiments of this disclosure, the packet encapsulation details include a source network address, a destination network address, a time-to-live (TTL), and a service type. Correspondingly, the second forwarding unit, through the first-layer forwarding unit, re-encapsulates the original data packet according to the packet encapsulation details and forwards the re-encapsulated data packet to the second computing node. This includes: performing source network address translation, destination network address translation, setting the TTL, and setting the service type on the original data packet according to the packet encapsulation details by the first-layer forwarding unit to obtain the re-encapsulated data packet; selecting an outgoing port according to equal-cost multi-path routing by the first-layer forwarding unit, and forwarding the re-encapsulated data packet to the second computing node through the outgoing port.

[0139] According to one or more embodiments of this disclosure, the second-layer forwarding unit includes a data processor (DPU) or a field-programmable gate array (FPGA).

[0140] Thirdly, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory;

[0141] The memory stores computer-executed instructions;

[0142] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect.

[0143] Fourthly, according to one or more embodiments of this disclosure, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, and when a processor executes the computer-executable instructions, the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect is implemented.

[0144] Fifthly, according to one or more embodiments of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the data forwarding method based on a stateful network element forwarding platform as described in the first aspect and various possible designs of the first aspect.

[0145] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0146] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0147] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A data forwarding method based on a stateful network element forwarding platform, characterized in that, include: The stateful network element forwarding platform receives and parses the original data packets sent by the first computing node through the first-layer forwarding unit to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration; If the data packet type does not belong to the preset data packet type, the first layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forwards the message based on the message encapsulation details; If the data packet type belongs to the preset data packet type, the original data packet is encapsulated with a message header by the first layer forwarding unit and forwarded to the third layer forwarding unit to obtain message encapsulation details, and message forwarding is performed based on the message encapsulation details.

2. The data forwarding method according to claim 1, characterized in that, The preset data packet types include: protocol data packets and / or data packets forwarded for the first time.

3. The data forwarding method according to claim 2, characterized in that, The step of encapsulating the original data packet with a header through the first-layer forwarding unit and forwarding it to the second-layer forwarding unit for session table lookup to obtain packet encapsulation details includes: The first-layer forwarding unit encapsulates the original data packet with a message header and forwards it to the second-layer forwarding unit. The second-layer forwarding unit then extracts the six-tuple information corresponding to the original data packet, determines the hash value corresponding to the six-tuple information, and performs a session table lookup based on the hash value to obtain the message encapsulation details.

4. The data forwarding method according to claim 1, characterized in that, The method further includes: If the packet encapsulation details are not found when the second-layer forwarding unit looks up the session table, the original data packet with the encapsulated packet header is forwarded to the third-layer forwarding unit to obtain the packet encapsulation details, and the packet is forwarded based on the packet encapsulation details.

5. The data forwarding method according to claim 1, characterized in that, Also includes: The third-layer forwarding unit sends the packet encapsulation details corresponding to the original data packet to the second-layer forwarding unit, so as to store the packet encapsulation details corresponding to the original data packet in the session table.

6. The data forwarding method according to claim 1, characterized in that, The second-layer forwarding unit and the third-layer forwarding unit exchange data through a direct memory access (DMA) driver. The second-layer forwarding unit provides DMA driver support through the Multi-Channel Direct Memory Access Module (MCDMA) IP, and the third-layer forwarding unit adapts to the DMA driver through the Data Plane Development Kit (DPDK) driver to realize data interaction between the second-layer forwarding unit and the third-layer forwarding unit.

7. The data forwarding method according to claim 1, characterized in that, The message forwarding based on message encapsulation details includes: The first-layer forwarding unit re-encapsulates the original data packet according to the packet encapsulation details and forwards the re-encapsulated data packet to the second computing node; the packet encapsulation details include one or more of the following: source network address, destination network address, time to live, and service type.

8. The data forwarding method according to claim 7, characterized in that, The message encapsulation details include the source network address, destination network address, time to live, and service type. Accordingly, the step of re-encapsulating the original data packet according to the packet encapsulation details by the first-layer forwarding unit and forwarding the re-encapsulated data packet to the second computing node includes: The first-layer forwarding unit performs source network address translation, destination network address translation, time to live, and service type setting operations on the original data packet according to the packet encapsulation details, thereby obtaining a re-encapsulated data packet. The first-layer forwarding unit selects an outgoing port based on the equal-cost multipath route, and forwards the re-encapsulated data packet to the second computing node through the outgoing port.

9. The data forwarding method according to claim 1, characterized in that, The second-layer forwarding unit includes a data processor (DPU) or a field-programmable gate array (FPGA).

10. A data forwarding device based on a stateful network element forwarding platform, characterized in that, include: The receiving unit is used to receive and parse the original data packet sent by the first computing node through the first-layer forwarding unit in the stateful network element forwarding platform to obtain the data packet type corresponding to the original data packet; the stateful network element forwarding platform adopts a three-layer forwarding architecture, wherein the first-layer forwarding unit does not store table entries, the second-layer forwarding unit stores all table entries of the third-layer forwarding unit for table entry offloading acceleration; The first forwarding unit is configured to, if the data packet type does not belong to a preset data packet type, encapsulate the original data packet with a message header through the first-layer forwarding unit and forward it to the second-layer forwarding unit to perform a session table lookup to obtain message encapsulation details, and forward the message based on the message encapsulation details; The second forwarding unit is configured to, if the data packet type belongs to the preset data packet type, encapsulate the original data packet header through the first-layer forwarding unit and forward it to the third-layer forwarding unit to obtain the packet encapsulation details, and then forward the packet based on the packet encapsulation details.

11. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the data forwarding method based on a stateful network element forwarding platform as described in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by the processor, implement the data forwarding method based on a stateful network element forwarding platform as described in any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data forwarding method based on a stateful network element forwarding platform as described in any one of claims 1 to 9.