FPGA Hardware Offloading Method and System for Supporting Multiple Application Loads of TCP / IP Protocol Stack

By designing a cross-connect module and a TCP connection quadruple record table on the FPGA, the TCP/IP protocol stack hardware offloading for multiple application workloads was realized, solving the problem that existing technologies cannot support multiple application workloads and enabling efficient network communication in multi-tenant and virtualized environments.

CN116800862BActive Publication Date: 2026-03-10INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

The existing TCP/IP protocol stack on FPGAs cannot support the simultaneous use of multiple hardware accelerators or software applications, and cannot meet the requirements of multi-tenancy and virtualization.

Method used

Design a method and system for FPGA hardware offloading of TCP/IP protocol stack that supports multiple application loads. By implementing a cross-connect module and a TCP connection quadruple record table on the FPGA, network packets are split according to TCP and IP header information, and data is sent to the correct application load through out-of-band signals and cross-connect bus.

Benefits of technology

It enables multiple hardware accelerators and multiple software applications to use the TCP/IP protocol stack simultaneously, expanding the application scenarios of the TCP/IP hardware protocol stack and supporting multi-tenant and virtualized environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800862B_ABST
    Figure CN116800862B_ABST
Patent Text Reader

Abstract

This invention proposes a method and system for FPGA hardware offloading of the TCP / IP protocol stack that supports multiple application loads. The invention optimizes the TCP / IP hardware protocol stack implemented on the FPGA by performing packet splitting in the network data receiving hardware logic. It determines the correspondence between the currently received network packets and the application loads based on the information in the TCP and IP headers, and by adding out-of-band signals and cross-connect buses to the packet data transmission path, the packet data is split to the correct application load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, and more specifically to a TCP / IP protocol stack processing system that supports multiple applications on an FPGA chip. Background Technology

[0002] Transmission Control Protocol (TCP) and Internet Protocol (IP) are the most widely used transport and network layer protocols in data networks, respectively, ensuring reliable data transmission between communicating parties. Statistics show that TCP / IP is currently deployed in 95% of wide area networks (WANs) and over 50% of data center networks. In recent years, with the continuous increase in network physical bandwidth, the TCP / IP software protocol stack implemented using general-purpose processors (CPUs) is increasingly unable to meet the high-bandwidth, low-latency, and low-overhead network data processing requirements of network-intensive applications. To address the performance bottleneck of general-purpose processors in handling high-bandwidth networks, the use of dedicated processing units in network interface cards (NICs) for direct protocol stack acceleration, thus building smart NICs, has become a hot topic in academic research and industrial applications. Due to the high complexity of the TCP protocol and its defined configurable parameter options, TCP / IP protocol stacks implemented using application-specific integrated circuits (ASICs) struggle to flexibly meet the complex and ever-changing usage requirements of existing TCP protocol stacks. Therefore, TCP / IP protocol stacks implemented using programmable gate arrays (FPGAs), with their flexible reconfigurable configuration, high bandwidth, and low latency, are gradually becoming an effective solution for TCP / IP protocol stacks in data centers.

[0003] like Figure 1 As shown, the application workload can be implemented in two ways: using a TCP / IP hardware protocol stack implemented on an FPGA to process network data.

[0004] Format 1: The software application is deployed in a general-purpose processor CPU: The FPGA hardware protocol stack transmits the processed TCP packets to the software application via a high-speed bus (such as PCI Express) between the smart network card and the host. Figure 1 (Left side)

[0005] Format 2: Hardware application accelerators are deployed in programmable gate arrays (FPGAs): The FPGA hardware protocol stack directly transmits the processed TCP packets to a hardware application accelerator located within the same FPGA chip via the on-chip interconnect protocol. Figure 1 (Right side). TCP packets can contain any data. Data obtained from the hardware accelerator can be used as the data portion of a TCP packet.

[0006] Currently, FPGA-based TCP / IP protocol stack hardware offloading engines can meet network physical bandwidth requirements of 10Gbps and 100Gbps, providing TCP protocol processing capabilities close to theoretical bandwidth. However, existing TCP / IP hardware protocol stacks can only support a single application accelerator implemented within the FPGA, and cannot yet achieve application-characteristic-aware network packet offloading, failing to meet the needs of multiple hardware application accelerators or software applications using the network protocol stack simultaneously. Current TCP / IP hardware protocol stack designs cannot support shared use of application workloads of various forms (software programs or hardware accelerators), and cannot meet the future needs of FPGA multi-tenancy and virtualization. Summary of the Invention

[0007] "Hardware offloading" refers to transferring functions performed by a general-purpose processor (CPU) to dedicated hardware. The TCP / IP network protocol stack was originally implemented by CPU software code; this application proposes a method for hardware-based network packet processing. This invention proposes an optimization method for the TCP / IP hardware protocol stack, applicable to... Figure 1 The two application implementations shown can support several different application workloads to use the network processing capabilities provided by the hardware protocol stack at the same time.

[0008] This invention addresses the problem that current TCP / IP protocol stacks on FPGAs cannot support network communication for multiple application workloads. It proposes a TCP / IP protocol stack processing system that supports various types of application workloads. The protocol stack's functions include receiving TCP network packets, parsing the Ethernet header, IP header, and TCP header, delivering the TCP data to the correct software or hardware application, and encapsulating data sent by the application within TCP packets, adding TCP headers, IP headers, and Ethernet headers, and then sending them out.

[0009] Specifically, this invention proposes a TCP / IP protocol stack FPGA hardware offloading method that supports multiple application workloads, including:

[0010] Step 1: The application payload sends a new connection request to establish a connection with the TCP server. This new connection request includes a TCP connection quadruple consisting of the source IP address, source TCP port number, destination IP address, and destination TCP port number, as well as the application payload number.

[0011] Step 2: The application load balancer forwards the new connection request to the TCP connection four-tuple record table;

[0012] Step 3: The four-tuple record table records the TCP connection four-tuple and the number, and returns the ID number of the newly created connection for the application load balancing interface;

[0013] Step 4: After receiving the ID number, the application load balancer interface sends a TCP SYN request to the network packet sending module.

[0014] Step 5: The network packet sending module queries the four-tuple record table based on the connection ID number in the new connection request, constructs a TCP SYN packet, and sends it to the remote TCP endpoint.

[0015] Step 6: After receiving the TCP SYN packet, the remote TCP endpoint returns a TCP SYN-ACK packet according to the TCP protocol;

[0016] Step 7: When the network packet receiving module receives the TCP SYN-ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID, and notifies the application load interface that a connection has been established for this connection ID.

[0017] Step 8: The application interface module queries the four-tuple record table based on the connection ID to obtain the application number, and notifies the application that the load connection has been established.

[0018] The aforementioned FPGA hardware offloading method for supporting multiple application workloads of the TCP / IP protocol stack includes:

[0019] Step 9: When the application load balancer acts as a server, it listens on a specific port and waits for a remote TCP client to establish a connection.

[0020] Step 10: When the network packet receiving module receives the TCP SYN packet, it queries the TCP port allocation table based on the destination port in the TCP header to confirm whether there is an application load listening on this port. If so, it sends a new TCP connection request to the TCP connection four-tuple record table. The request includes the received TCP four-tuple information and the application load number obtained from the query. If not, it notifies the network data sending module to send an RST packet to the other end.

[0021] Step 11: Record the TCP connection quadruple record table with the quadruple and application load ID information of the TCP connection, notify the application load interface of the newly established connection ID, and notify the TCP connection status record table that the current connection ID is in the SYN state.

[0022] Step 12: After receiving the notification, the application interface module sends a TCP SYN-ACK request to the network packet sending module.

[0023] Step 13: The network packet sending module queries the four-tuple record table based on the ID number of the newly established connection of the application load interface, constructs a TCP SYN-ACK packet, and sends it.

[0024] Step 14: After receiving the TCP SYN-ACK packet, the remote TCP endpoint returns a TCP ACK packet according to the TCP protocol.

[0025] Step 15: When the network packet receiving module receives the TCP ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID; it queries the TCP state table, and if the current connection state is SYN-RECV, it changes it to the established connection state; it notifies the application load interface that the connection ID has been established.

[0026] Step 16: The application interface module queries the quadruple record table based on the connection ID to obtain the application number, and notifies the application that the load connection has been established.

[0027] The described FPGA hardware offloading method for supporting multiple application loads of the TCP / IP protocol stack includes a network packet receiving module that processes all received Ethernet data frames. The network packet receiving module verifies whether the received packet is a TCP packet; if so, it verifies the validity of the TCP checksum; if it is not a TCP packet or is an invalid TCP packet, it discards it directly. It verifies whether the destination port in the TCP packet is open by querying the port record table. If open, it obtains the corresponding network application number; if closed, according to the TCP protocol, it notifies the network packet sending module to send a reset RST packet to the peer. It reads the flag bits of the TCP packet and notifies the network packet sending module to send an appropriate acknowledgment packet according to the TCP protocol. If the TCP packet contains data, it notifies the corresponding application load according to the application load number and writes the data into the received data buffer. After receiving the new data notification, the application load sends a read data request to the application load interface. The application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

[0028] The aforementioned FPGA hardware offloading method for supporting multiple application loads of the TCP / IP protocol stack includes a network packet sending module for constructing TCP packets to be sent; the network packet sending module constructs and sends a TCP packet without data according to a request from the network packet receiving module to acknowledge that the other party has received the data; and accepts requests from application loads to send data, reads the data sending buffer, reads the four-tuple record table, constructs and sends a TCP packet containing data.

[0029] This invention also proposes an FPGA hardware offloading system for the TCP / IP protocol stack that supports multiple application workloads, including:

[0030] Module 1: The application load balancer sends a new connection request to establish a connection with the TCP server. This new connection request includes a TCP connection quadruple consisting of the source IP address, source TCP port number, destination IP address, and destination TCP port number, as well as the application load balancer's ID.

[0031] Module 2, the application load balancing interface forwards new connection requests to the TCP connection four-tuple record table;

[0032] Module 3: The four-tuple record table records the TCP connection four-tuple and its number, and returns the ID number of the newly created connection for the application load balancing interface;

[0033] Module 4: After receiving the ID number, the application load balancing interface will send a TCP SYN request to the network packet sending module.

[0034] Module 5: The network packet sending module queries the four-tuple record table based on the connection ID number in the new connection request, constructs a TCP SYN packet, and sends it to the remote TCP endpoint.

[0035] Module 6: After receiving a TCP SYN packet, the remote TCP endpoint returns a TCP SYN-ACK packet according to the TCP protocol;

[0036] Module 7: When the network packet receiving module receives the TCP SYN-ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID, and notifies the application load interface that a connection has been established for this connection ID.

[0037] Module 8, the Application Programming Interface module, queries the four-tuple record table based on the connection ID to obtain the application's ID and notifies the application that the load connection has been established.

[0038] The aforementioned TCP / IP protocol stack FPGA hardware offloading system supporting multiple application workloads includes:

[0039] Module 9: When the application load is used as a server, it listens on a specific port and waits for a remote TCP client to establish a connection.

[0040] Module 10: When the network packet receiving module receives a TCP SYN packet, it queries the TCP port allocation table based on the destination port in the TCP header to confirm whether there is an application load listening on this port. If so, it sends a new TCP connection request to the TCP connection four-tuple record table. The request includes the received TCP four-tuple information and the application load number obtained from the query. If not, it notifies the network data sending module to send an RST packet to the other end.

[0041] Module 11, the TCP connection four-tuple record table records the four-tuple and application load ID information of the TCP connection, notifies the application load interface of the ID number of the newly established connection; and notifies the TCP connection status record table that the current connection ID is in the SYN state.

[0042] Module 12: After receiving the notification, the application interface module will send a TCP SYN-ACK type request to the network packet sending module;

[0043] Module 13: This network packet sending module queries the four-tuple record table based on the ID number of the newly established connection of the application load interface, constructs a TCP SYN-ACK packet, and sends it.

[0044] Module 14: After receiving the TCP SYN-ACK packet, the remote TCP endpoint returns a TCP ACK packet according to the TCP protocol.

[0045] Module 15: When the network packet receiving module receives a TCP ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID; it queries the TCP state table, and if the current connection state is SYN-RECV, it changes it to the established connection state; it notifies the application load interface that the connection ID has been established.

[0046] Module 16: This application interface module queries the four-tuple record table based on the connection ID to obtain the application's number and notifies the application that the load connection has been established.

[0047] The aforementioned FPGA hardware offloading system for the TCP / IP protocol stack supporting multiple application loads includes a network packet receiving module that processes all received Ethernet data frames. This module verifies whether a received packet is a TCP packet; if so, it verifies the validity of the TCP checksum; otherwise, it discards the packet. It also verifies whether the destination port in the TCP packet is open by querying a port record table. If open, it obtains the corresponding network application number; if closed, it notifies the network packet sending module to send a reset RST packet to the peer according to the TCP protocol. The module reads the flag bits of the TCP packet and notifies the network packet sending module to send an appropriate acknowledgment packet according to the TCP protocol. If the TCP packet contains data, it notifies the corresponding application load based on the application load number and writes the data into the receive data buffer. Upon receiving the new data notification, the application load sends a read data request to the application load interface. The application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

[0048] The aforementioned FPGA hardware offloading system for the TCP / IP protocol stack supporting multiple application loads includes a network packet sending module for constructing TCP packets to be sent; the network packet sending module constructs and sends a TCP packet without data based on a request from the network packet receiving module, in response to the other party having received the data; and accepts requests from application loads to send data, reads the data sending buffer, reads the four-tuple record table, constructs and sends a TCP packet containing data.

[0049] The present invention also proposes a storage medium for storing a program that executes any of the TCP / IP protocol stack FPGA hardware offloading methods supporting multiple application workloads.

[0050] This invention also proposes a client for any TCP / IP protocol stack FPGA hardware offloading system that supports multiple application workloads.

[0051] As can be seen from the above solutions, the advantages of the present invention are:

[0052] The method described in this invention expands the application scenarios of the TCP / IP hardware protocol stack. Current TCP / IP hardware protocol stacks can only use a single hardware accelerator or accelerate only software applications. The TCP / IP hardware protocol stack described in this invention can support 1) multiple hardware accelerators; 2) multiple software applications; and 3) the simultaneous use of multiple hardware accelerators and multiple software applications. Attached Figure Description

[0053] Figure 1 Schematic diagrams of two forms of network data processing using the TCP / IP protocol stack in the FPGA for application workloads;

[0054] Figure 2 A schematic diagram of the overall architecture of the TCP / IP protocol stack FPGA hardware offloading engine to support multiple application workloads;

[0055] Figure 3 Design diagram of FPGA hardware offloading engine structure for TCP / IP protocol stack to support multi-application load sharing. Detailed Implementation

[0056] To address the aforementioned technical problems, this invention optimizes the TCP / IP hardware protocol stack implemented on an FPGA. In the network data receiving hardware logic, packet offloading is performed. Based on the information in the TCP and IP headers, the correspondence between the currently received network packets and the application load is determined. Furthermore, by adding out-of-band signals and a crossbar to the packet data transmission path, packet data is offloaded to the correct application load. The overall architecture of the TCP / IP protocol stack FPGA hardware offloading engine is as follows: Figure 2 As shown. To achieve the above-mentioned technical effects, the present invention includes the following core technical points:

[0057] Key Point 1: Each application workload has a fixed number and serves as an out-of-band signal for the data signal. The cross-connect module distributes the data signal according to the application workload's number and sends it to the different application workloads.

[0058] Key Point Two: Design a TCP port record table in the TCP / IP hardware protocol stack to record the mapping between TCP port numbers and application numbers. Upon receiving a network packet, the TCP port record table is consulted based on the destination port in the TCP header to obtain the application payload number, which is then written into an out-of-band signal. This signal is then transmitted to the respective application payloads via a cross-connect module, achieving network packet distribution.

[0059] Key Point 3: The TCP connection four-tuple record table in the TCP / IP protocol stack records the mapping between each TCP connection ID and the application load number. If the current connection state changes, the TCP / IP hardware protocol stack needs to notify the application load. At this time, the hardware protocol stack obtains the application load number by querying the TCP connection four-tuple record table, writes it into the out-of-band signal, sends it to the application load interface, and then sends the current TCP connection state to each application load through the cross-connect module.

[0060] To make the above features and effects of the present invention clearer and easier to understand, specific embodiments are described below, and detailed descriptions are provided in conjunction with the accompanying drawings.

[0061] The following describes the design of a TCP / IP protocol stack processing system that supports multiple application workloads. Its structure is as follows: Figure 3 As shown.

[0062] First, let's introduce the functions of the important components involved in the structural diagram:

[0063] 1. Application Load Interface: Forwards data received from the network stack to various application loads, or writes the data to be sent by each application load into the sending data buffer.

[0064] 2. Network packet receiving module: Receives all Ethernet data frame packets received from the Ethernet transceiver module and processes them in accordance with the TCP standard.

[0065] 3. TCP connection timer: Each TCP connection has a timer. If a connection's timer expires and no acknowledgment message is received from the other end, it needs to be retransmitted.

[0066] 4. TCP Connection State Table: Records the state of each TCP connection. There are a total of 11 TCP connection states: Client-specific: SYN_SENT, FIN_WAIT1, FIN_WAIT2, CLOSING, TIME_WAIT; Server-specific: LISTEN, SYN_RCVD, CLOSE_WAIT, LAST_ACK; Common to both server and client: CLOSED, ESTABLISHED.

[0067] 5. TCP Port Allocation Table: Records which TCP ports are currently being loaded by the software and hardware applications, and records the mapping from port number to application load number.

[0068] 6. TCP Connection Quadruple Record Table: Within the protocol stack, a TCP connection is uniquely identified by a TCP connection quadruple (source IP address, source TCP port number, destination IP address, destination TCP port number). This protocol stack maps each quadruple to a 16-bit TCP connection ID. The TCP connection quadruple record table maintains all TCP connections currently in the TCP protocol stack that are not in the CLOSED or LISTEN state. It contains three mapping tables: a mapping from TCP connection ID to TCP connection quadruple, a mapping from TCP connection quadruple to TCP connection ID, and a mapping from TCP connection ID to application payload number.

[0069] 7. Network packet sending module: Constructs network packets according to the TCP standard and sends them to the Ethernet transceiver module.

[0070] 8. Bus Transmission Module: Transmits all software application data to the CPU-side memory via a high-speed bus protocol, or sends software application data from the CPU-side memory to the application load interface.

[0071] 9. Software-driven: Distribute all software application data to the corresponding software application according to the application load number.

[0072] Next, we will introduce the specific principles of network communication across multiple application loads:

[0073] The process of establishing a connection between the application load and a remote TCP node:

[0074] 1. Connection establishment process when the application load acts as a TCP client

[0075] 1.1 When the application load balancer acts as a client, it proactively sends a connection establishment request to another TCP server. The request includes the TCP connection four-tuple and the application load balancer ID. This request is sent to the application load balancer interface.

[0076] 1.2 The application load balancing interface forwards new connection requests to the TCP connection four-tuple record table module;

[0077] 1.3 The TCP connection four-tuple record table records the four-tuple and application load number information of the TCP connection, and returns the ID number of the newly established connection to the application load interface;

[0078] 1.4 After receiving the new connection ID number, the application programming interface module will send a TCP SYN request to the network packet sending module;

[0079] The 1.5 network packet sending module will look up the four-tuple record table using the connection ID number in the TCP SYN request, construct a TCPSYN packet, and send it.

[0080] 1.6 After receiving a TCP SYN packet, the remote TCP endpoint needs to return a TCP SYN-ACK packet according to the TCP protocol.

[0081] 1.7 When the network packet receiving module receives the TCP SYN-ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID, and notifies the application load interface that a connection has been established for this connection ID.

[0082] The 1.8 Application Programming Interface (API) module queries the four-tuple record table based on the connection ID to obtain the application's ID and notifies the corresponding application payload that the connection has been established. Only after the connection is established can network data be sent and received according to the TCP / IP protocol stack's process of receiving / sending network packets.

[0083] 2. Connection establishment process when the application load is acting as a TCP server:

[0084] 2.1 When the application load balancer acts as a server, it needs to listen on a specific port and wait for the remote TCP client to establish a connection; the port being listened on can be arbitrarily specified by the application load balancer.

[0085] 2.2 When the network packet receiving module receives a TCP SYN packet, it queries the TCP port allocation table based on the destination port in the TCP header to confirm whether any application load is currently listening on this port. If so, it sends a new TCP connection request to the TCP connection four-tuple record table, including the received TCP four-tuple information and the obtained application load number; otherwise, it notifies the network data sending module to send an RST packet to the peer.

[0086] 2.3 After receiving a new connection request containing a TCP connection quadruple and application load number information, the TCP connection quadruple record table notifies the application load interface of the new connection ID number; and notifies the TCP connection status record table that the current connection ID is in the SYN-RECV (SYN received) state.

[0087] 2.4 After receiving the notification, the application programming interface module will send a TCP SYN-ACK request to the network packet sending module;

[0088] 2.5 The network packet sending module will query the four-tuple record table based on the connection ID number passed from the application load interface, construct a TCP SYN-ACK packet and send it;

[0089] 2.6 After receiving a TCP SYN-ACK packet, the remote TCP endpoint is required to return a TCP ACK packet according to the TCP protocol.

[0090] 2.7 When the network packet receiving module receives the TCP ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID; it then queries the TCP state table, and if the current connection state is SYN-RECV, it changes it to ESTABLISHED (connection established) state. At this point, the TCP connection has been successfully established; the application load balancer is notified that the connection ID has been established.

[0091] 2.8 The application programming interface module queries the four-tuple record table based on the connection ID to obtain the application number, and notifies the corresponding application that the load connection has been established.

[0092] The process after the TCP / IP protocol stack receives a network packet:

[0093] The network packet receiving module processes all received Ethernet data frames and has the following functions: 1) Verifying whether the received packet is a TCP packet. If so, verifying the validity of the TCP checksum. If it is not a TCP packet or is an invalid TCP packet, it is discarded. 2) Verifying whether the destination port in the TCP packet is open. This can be done by querying the port record table. If open, the corresponding network application number is obtained. If closed, according to the TCP protocol, the network packet sending module needs to be notified to send a reset RST packet to the other end. 3) Reading the flag bits of the TCP packet and notifying the network packet sending module to send an appropriate acknowledgment packet according to the TCP protocol. 4) If the TCP packet contains data, the corresponding application load is notified according to the application load number obtained in step 2), and the data is written to the receive data buffer. After receiving the new data notification, the application load sends a read data request to the application load interface. The application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

[0094] The process of the TCP / IP protocol stack sending network packets:

[0095] The network packet sending module is used to construct all TCP packets that need to be sent. It has the following functions: 1) Based on the request from the network packet receiving module, it constructs and sends a TCP packet without data to acknowledge receipt of the data; 2) It accepts requests from the application payload to send data, reads the sending data buffer, reads the four-tuple record table, constructs a TCP packet containing data, and sends it. Specifically, this includes: the application payload requests data transmission from the application payload interface; the application payload interface queries the TCP sending buffer table based on the TCP connection identifier; if the sending buffer has sufficient space, it notifies the application payload that data can be sent; after the application payload sends data to the application interface, the application payload interface writes the data to the buffer according to the starting address of the sending buffer and notifies the TCP packet sending module to send the data; the network packet sending module processes the application payload interface's data sending request, reads the sending data buffer, reads the four-tuple record table, constructs a TCP / IP packet containing data, and sends it.

[0096] The following are system embodiments corresponding to the above method embodiments. This embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0097] This invention also proposes an FPGA hardware offloading system for the TCP / IP protocol stack that supports multiple application workloads, including:

[0098] Module 1: The application load balancer sends a new connection request to establish a connection with the TCP server. This new connection request includes a TCP connection quadruple consisting of the source IP address, source TCP port number, destination IP address, and destination TCP port number, as well as the application load balancer's ID.

[0099] Module 2, the application load balancing interface forwards new connection requests to the TCP connection four-tuple record table;

[0100] Module 3: The four-tuple record table records the TCP connection four-tuple and its number, and returns the ID number of the newly created connection for the application load balancing interface;

[0101] Module 4: After receiving the ID number, the application load balancing interface will send a TCP SYN request to the network packet sending module.

[0102] Module 5: The network packet sending module queries the four-tuple record table based on the connection ID number in the new connection request, constructs a TCP SYN packet, and sends it to the remote TCP endpoint.

[0103] Module 6: After receiving a TCP SYN packet, the remote TCP endpoint returns a TCP SYN-ACK packet according to the TCP protocol;

[0104] Module 7: When the network packet receiving module receives the TCP SYN-ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID, and notifies the application load interface that a connection has been established for this connection ID.

[0105] Module 8, the Application Programming Interface module, queries the four-tuple record table based on the connection ID to obtain the application's ID and notifies the application that the load connection has been established.

[0106] The aforementioned TCP / IP protocol stack FPGA hardware offloading system supporting multiple application workloads includes:

[0107] Module 9: When the application load is used as a server, it listens on a specific port and waits for a remote TCP client to establish a connection.

[0108] Module 10: When the network packet receiving module receives a TCP SYN packet, it queries the TCP port allocation table based on the destination port in the TCP header to confirm whether there is an application load listening on this port. If so, it sends a new TCP connection request to the TCP connection four-tuple record table. The request includes the received TCP four-tuple information and the application load number obtained from the query. If not, it notifies the network data sending module to send an RST packet to the other end.

[0109] Module 11, the TCP connection four-tuple record table records the four-tuple and application load ID information of the TCP connection, notifies the application load interface of the ID number of the newly established connection; and notifies the TCP connection status record table that the current connection ID is in the SYN state.

[0110] Module 12: After receiving the notification, the application interface module will send a TCP SYN-ACK type request to the network packet sending module;

[0111] Module 13: This network packet sending module queries the four-tuple record table based on the ID number of the newly established connection of the application load interface, constructs a TCP SYN-ACK packet, and sends it.

[0112] Module 14: After receiving the TCP SYN-ACK packet, the remote TCP endpoint returns a TCP ACK packet according to the TCP protocol.

[0113] Module 15: When the network packet receiving module receives a TCP ACK packet, it queries the TCP connection four-tuple record table based on the four-tuple information in the TCP / IP header to obtain the corresponding connection ID; it queries the TCP state table, and if the current connection state is SYN-RECV, it changes it to the established connection state; it notifies the application load interface that the connection ID has been established.

[0114] Module 16: This application interface module queries the four-tuple record table based on the connection ID to obtain the application's number and notifies the application that the load connection has been established.

[0115] The aforementioned FPGA hardware offloading system for the TCP / IP protocol stack supporting multiple application loads includes a network packet receiving module that processes all received Ethernet data frames. This module verifies whether a received packet is a TCP packet; if so, it verifies the validity of the TCP checksum; otherwise, it discards the packet. It also verifies whether the destination port in the TCP packet is open by querying a port record table. If open, it obtains the corresponding network application number; if closed, it notifies the network packet sending module to send a reset RST packet to the peer according to the TCP protocol. The module reads the flag bits of the TCP packet and notifies the network packet sending module to send an appropriate acknowledgment packet according to the TCP protocol. If the TCP packet contains data, it notifies the corresponding application load based on the application load number and writes the data into the receive data buffer. Upon receiving the new data notification, the application load sends a read data request to the application load interface. The application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

[0116] The aforementioned FPGA hardware offloading system for the TCP / IP protocol stack supporting multiple application loads includes a network packet sending module for constructing TCP packets to be sent; the network packet sending module constructs and sends a TCP packet without data based on a request from the network packet receiving module, in response to the other party having received the data; and accepts requests from application loads to send data, reads the data sending buffer, reads the four-tuple record table, constructs and sends a TCP packet containing data.

[0117] The present invention also proposes a storage medium for storing a program that executes any of the TCP / IP protocol stack FPGA hardware offloading methods supporting multiple application workloads.

[0118] This invention also proposes a client for any TCP / IP protocol stack FPGA hardware offloading system that supports multiple application workloads.

Claims

1. A TCP / IP protocol stack FPGA hardware offload method supporting multi-application load, characterized in that, Comprising: Step 1, the application load sends a new connection request to establish a connection with the TCP server, the new connection request includes a TCP connection four-tuple composed of source IP address, source TCP port number, destination IP address and destination TCP port number, and the number of the application load: Step 2, the application load interface forwards the new connection request to the TCP connection four-tuple record table; Step 3, the four-tuple record table records the TCP connection four-tuple and the number, and returns the ID number of the new connection to the application load interface; Step 4, after receiving the ID number, the application load interface notifies the network message sending module of a TCP SYN type request; Step 5, the network message sending module queries the four-tuple record table according to the connection ID number in the new connection request, constructs a TCP SYN message and sends it to the remote TCP endpoint; Step 6, after receiving the TCP SYN message, the remote TCP endpoint returns a TCP SYN-ACK message according to the TCP protocol; Step 7, when the network message receiving module receives the TCP SYN-ACK message, it queries the TCP connection four-tuple record table according to the four-tuple information in the TCP / IP header, obtains the corresponding connection ID, and notifies the application load interface that the connection corresponding to the ID has been established; Step 8, the application program interface module queries the four-tuple record table according to the connection ID to obtain the number of the application program, and notifies the application load that the connection has been established; Step 9, when the application load is the server, it listens to a specific port and waits for the remote TCP client to establish a connection; Step 10, when the network message receiving module receives the TCP SYN message, it queries the TCP port allocation table according to the destination port in the TCP header to determine whether there is an application load application listening to this port; if there is, it sends a new TCP connection request to the TCP connection four-tuple record table, which contains the received TCP four-tuple information and the application load number obtained by querying; if not, it notifies the network data sending module to send an RST message to the opposite end; Step 11, the TCP connection four-tuple record table records the four-tuple and application load number information of the TCP connection, and notifies the application load interface of the ID number of the new connection; it notifies the TCP connection state record table that the state of the current connection ID is in the SYN state; Step 12, after receiving the notification, the application program interface module notifies the network message sending module of a TCP SYN-ACK type request; Step 13, the network message sending module queries the four-tuple record table according to the ID number of the new connection of the application load interface, constructs a TCP SYN-ACK message and sends it; Step 14, after receiving the TCP SYN-ACK message, the remote TCP endpoint returns a TCP ACK message according to the provisions of the TCP protocol; Step 15, when the network message receiving module receives the TCP ACK message, the corresponding connection ID is obtained by querying the TCP connection four-tuple record table according to the four-tuple information in the TCP / IP header; the TCP state table is queried, and if the current connection state is the SYN-RECV state, the established connection state is modified; The application load interface is notified that the connection corresponding to the ID has been established; Step 16, the application program interface module queries the four-tuple record table according to the connection ID to obtain the application program number, and notifies the application load connection that has been established.

2. The FPGA hardware offload method of supporting multi-application loads of TCP / IP protocol stack as claimed in claim 1, wherein, The network message receiving module is used for processing all received Ethernet data frames; the network message receiving module verifies whether the received message is a TCP message, and if so, verifies whether the TCP checksum is valid, and if it is not a TCP message or an invalid TCP message, it is discarded directly; it is verified whether the destination port in the TCP message is opened or not, and the opening or not of the destination port in the current message is obtained by querying the port record table, and if it is opened, the corresponding network application number is obtained, and if it is closed, according to the TCP protocol, the network message sending module needs to send a reset RST message to the opposite end; The flag bit of the TCP message is read, and the network message sending module is notified to send the appropriate reply message according to the TCP protocol; if the TCP message contains a data part, the corresponding application load is notified according to the application load number, and the data is written into the received data buffer; after receiving the new data notification, the application load sends a read data request to the application load interface, and the application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

3. The FPGA hardware offload method of supporting multi-application loads of TCP / IP protocol stack as claimed in claim 1, wherein, The network message sending module is used for constructing the TCP message to be sent; the network message sending module constructs the TCP message without data and sends it to reply that the data has been received by the opposite end according to the request from the network message receiving module. The request of the application load to send data is accepted, the sending data buffer is read, the four-tuple record table is read, and the TCP message containing the data is constructed and sent.

4. A TCP / IP protocol stack FPGA hardware offload system supporting multi-application load, characterized in that, It comprises: Module 1, the application load sends a new connection request to establish a connection with the TCP server, which includes a TCP connection four-tuple composed of a source IP address, a source TCP port number, a destination IP address and a destination TCP port number, and a number of the application load: Module 2, the application load interface forwards the new connection request to the TCP connection four-tuple record table; Module 3, the four-tuple record table records the TCP connection four-tuple and the number, and returns the ID number of the new connection to the application load interface; Module 4, after receiving the ID number, the application load interface notifies the network message sending module of a TCP SYN type request; Module 5, the network message sending module queries the four-tuple record table according to the connection ID number in the new connection request, constructs a TCP SYN message and sends it to the remote TCP endpoint; Module 6, after receiving the TCP SYN message, the remote TCP endpoint returns a TCP SYN-ACK message according to the TCP protocol; Module 7, when the network message receiving module receives the TCP SYN-ACK message, the four-tuple information in the TCP / IP header is inquired from the TCP connection four-tuple record table to obtain the corresponding connection ID, and the application load interface is informed that the connection corresponding to the connection ID has been established; Module 8, the application program interface module inquires the four-tuple record table according to the connection ID to obtain the number of the application program, and informs that the application load connection has been established; Module 9, when the network message receiving module receives the TCP SYN message, the destination port in the TCP header is inquired from the TCP port allocation table to confirm whether the application load application currently listens to the port; if yes, a new TCP connection request is sent to the TCP connection four-tuple record table, and the received TCP four-tuple information and the inquired application load number are contained in the request; if no, the network data sending module is informed to send the RST message to the opposite end; Module 11, the TCP connection four-tuple record table records the four-tuple and the application load number information of the TCP connection, informs the application load interface of the ID number of the new connection, and informs the TCP connection state record table that the state of the current connection ID is the SYN-RECV state; Module 12, the application program interface module receives the notification and informs the network message sending module of a TCP SYN-ACK type request; Module 13, the network message sending module inquires the four-tuple record table according to the ID number of the new connection of the application load interface, constructs the TCP SYN-ACK message and sends it; Module 14, after the remote TCP endpoint receives the TCP SYN-ACK message, according to the TCP protocol, the TCP ACK message is returned; Module 15, when the network message receiving module receives the TCP ACK message, the four-tuple information in the TCP / IP header is inquired from the TCP connection four-tuple record table to obtain the corresponding connection ID; the TCP state table is inquired, and if the current connection state is the SYN-RECV state, it is modified to the established connection state; The application load interface is informed that the connection corresponding to the connection ID has been established; Module 16, the application program interface module inquires the four-tuple record table according to the connection ID to obtain the number of the application program, and informs that the application load connection has been established. The network message receiving module is used for processing all received Ethernet data frames; the network message receiving module verifies whether the received message is a TCP message, and if yes, verifies whether the TCP checksum is valid, and if not a TCP message or an invalid TCP message, it is directly discarded; whether the destination port in the TCP message is opened is verified, the destination port in the current message is opened or not is obtained by inquiring the port record table, if opened, the corresponding network application number is obtained, if closed, according to the TCP protocol, the network message sending module needs to send the reset RST message to the opposite end; 5. The TCP / IP protocol stack hardware offload system supporting multiple application loads of claim 4, wherein, ​ Read the TCP message flag, inform the network message sending module to send appropriate response message according to TCP protocol; if the TCP message contains data part, inform the corresponding application load according to the application load number, and write the data into the receiving data buffer; the application load sends a read data request to the application load interface after receiving the new data notification, and the application load interface reads the buffer content according to the buffer address and length and sends it to the corresponding application load.

6. The TCP / IP protocol stack hardware offload system supporting multiple application loads of claim 4, wherein, The network message sending module is used for constructing the TCP message to be sent; the network message sending module constructs the TCP message without data and sends it to answer the opposite party has received the data according to the request from the network message receiving module; Accept the request of the application load to send data, read the sending data buffer, read the four-tuple record table, construct the TCP message containing data and send it.

7. A storage medium for storing a program for executing any one of the FPGA hardware offloading methods of the TCP / IP protocol stack supporting multiple application loads as claimed in claims 1 to 3.

8. A client for any one of the FPGA hardware offloading systems of the TCP / IP protocol stack supporting multiple application loads as claimed in claims 4 to 6.

Citation Information

Patent Citations

  • Method and system for realizing TCP (Transmission Control Protocol) full-offload IP (Internet Protocol) cores for multi-connection management

    CN110535827A