A TCP acceleration method, system
Patent Information
- Application Number
- CN202310676579.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-06-08
AI Technical Summary
[0003]国内外对于高速以太网环境下的TCP(Transmission Control Protocol,传输控制协议)的加速也一直是个热点,一般是两个方向:一是对于TCP加速的认识大都保持在学术研究层面,多数都是从理论上分析硬件实现协议栈的技术特点和应用前景;二是将整个软件协议栈全部卸载下来,具有很大的难度,有大量资源的消耗,一般使用专用处理器设计实现TCP/IP硬件协议栈,但往往是简单介绍,很难窥探其细节
[0004] Embodiments of this disclosure provide a TCP acceleration method and system designed to address one or more of the problems described above and other potential problems.
Smart Images

Figure CN116527786B_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of data communication technology, and in particular to a TCP acceleration method and system. Background Technology
[0002] With the rise of cloud services, the demand for network bandwidth is constantly increasing, placing a heavier burden on end systems to process protocols. How to improve network transmission speed while ensuring data accuracy and reliability with minimal processor overhead has always been a hot research topic.
[0003] Accelerating TCP (Transmission Control Protocol) in high-speed Ethernet environments has always been a hot topic both domestically and internationally, generally in two directions: First, the understanding of TCP acceleration is mostly at the academic research level, with most analyses focusing on the technical characteristics and application prospects of hardware-implemented protocol stacks; second, the entire software protocol stack is completely offloaded, which is very difficult and consumes a lot of resources. Dedicated processors are generally used to design and implement TCP / IP hardware protocol stacks, but these are often only briefly introduced, making it difficult to delve into the details. Summary of the Invention
[0004] Embodiments of this disclosure provide a TCP acceleration method and system designed to address one or more of the problems described above and other potential problems.
[0005] To achieve the above objectives, the following technical solution is provided:
[0006] According to a first aspect of this disclosure, a TCP acceleration system is provided, including a first interface for connecting to a first host, a second interface for connecting to a second host, and a protocol acceleration engine; the protocol acceleration engine offloads TCP states related to data transmission from the system protocol stack; the protocol acceleration engine is configured to process packets received by the first interface based on TCP states, and then synthesize the processed packets into TCP user data and send it to the second host via the second interface; the protocol acceleration engine is also configured to process TCP user data received by the second interface based on TCP states, and then synthesize the processed TCP user data into packets and send them to the first host via the first interface.
[0007] The system described in this disclosure is a hardware-based system. This disclosure offloads the processing of communication protocols previously handled by the CPU to the system itself, reducing the CPU load and allowing more CPU resources to be allocated to other system tasks. Furthermore, hardware offers significant advantages over software; besides faster execution speed, its parallelism is crucial, thus substantially improving system performance.
[0008] In some embodiments, the TCP states related to data transmission that the protocol acceleration engine unloads from the system protocol stack include ESTABLISHED, CLOSED, SYN-SENT, and SYN-RECEIVED.
[0009] In some embodiments, the protocol acceleration engine includes a message parsing and verification module, a connection matching module, a TCP protocol processing module, an entry storage module, and a storage control module;
[0010] The table entry storage module is used to store table entries containing key_rule and its corresponding hash value, as well as index;
[0011] The message parsing module is used to parse and verify the messages received by the first interface; the connection matching module is used to extract the message header information of the parsed and verified message to construct a tuple key, and match the tuple key with the table entries in the table entry storage module. If the match is successful, the index is obtained and sent to the TCP protocol processing module. If the match is unsuccessful, the message is sent to the second host through the message pass-through channel via the second interface.
[0012] The TCP protocol processing module generates Info control information after reordering the packets based on the index and sends the Info control information to the storage control module. The storage control module generates TCP user data based on the Info control information and sends the TCP user data to the second host via the second interface. The storage control module obtains Info control information based on the TCP user data received through the second interface. On the other hand, the TCP protocol processing module generates packets based on the Info control information and sends the packets to the first host via the first interface.
[0013] In some embodiments, the table entry storage module may be integrated within the protocol acceleration engine, or the table entry storage module may be externally attached to the protocol acceleration engine.
[0014] In some embodiments, the table entry storage module is a DDR storage module.
[0015] In some embodiments, the system is integrated into the network interface card (NIC).
[0016] In some embodiments, the first interface is an Ethernet interface and the second interface is a PCIe interface.
[0017] According to a second aspect of this disclosure, a TCP acceleration method is provided, comprising: when performing TCP connection establishment or disconnection operations, executing based on the TCP state regarding connection establishment or disconnection within the system protocol stack; and when performing TCP data transmission operations, executing based on the aforementioned TCP acceleration system.
[0018] This disclosure embodiment executes TCP in different states depending on the situation. For states involving TCP connection establishment or termination, execution is based on the system protocol stack, i.e., at the software level. For states involving TCP data transmission, execution is based on the TCP acceleration system of this disclosure embodiment, i.e., through specific hardware. This reduces the CPU load, allowing more CPU resources to be allocated to other system tasks.
[0019] In some embodiments, the data transmission operation is performed by the TCP acceleration system as follows: the protocol acceleration engine is used to process the packets received by the first interface based on the TCP state, and then synthesize the processed packets into TCP user data and send them to the second host through the second interface. It is also used to process the TCP user data received by the second interface based on the TCP state, and then synthesize the processed TCP user data into packets and send them to the first host through the first interface.
[0020] In some embodiments, the specific execution process of the protocol acceleration engine includes a receiving process and a sending process:
[0021] The receiving process is as follows:
[0022] The messages received by the first interface are parsed and verified;
[0023] Extract the message header information of the parsed and verified message to construct a tuple key, and match the tuple key with the table entries. If the match is successful, obtain the index; if the match is unsuccessful, send the message to the second host through the message pass-through channel via the second interface.
[0024] Based on the index, generate the out-of-order control information of the message, generate TCP user data based on the control information, and send the TCP user data to the second host through the second interface;
[0025] The sending process is as follows:
[0026] Based on the TCP user data received from the second interface, info control information is obtained, a message is generated based on the info control information, and the message is sent to the first host via the first interface. Attached Figure Description
[0027] The above and other objects, features, and advantages of embodiments of the present disclosure will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated in the drawings by way of example and not limitation.
[0028] Figure 1 A simplified framework diagram of a TCP acceleration system according to an embodiment of this disclosure is shown;
[0029] Figure 2 A detailed framework diagram of a TCP acceleration system according to an embodiment of this disclosure is shown;
[0030] Figure 3 This illustration shows a schematic diagram of the principle of data transmission between a protocol acceleration engine and a first interface in a TCP acceleration system according to an embodiment of the present disclosure;
[0031] Figure 4 A specific example diagram of a TCP acceleration system according to an embodiment of this disclosure is shown. Detailed Implementation
[0032] Preferred embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0033] The term "comprising" and its variations as used herein signify open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "at least partially based on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment".
[0034] With the rise of cloud services, the demand for network bandwidth is constantly increasing, placing a heavier burden on end systems for protocol processing. Existing TCP acceleration methods involve offloading the entire software protocol stack, a process that is difficult and resource-intensive, requiring the design of complex processors to implement the TCP / IP hardware protocol stack.
[0035] Based on this, the present disclosure proposes a TCP acceleration system that offloads data transmission to hardware implementation by offloading a limited set of TCP states.
[0036] like Figure 1The system includes a first interface for connecting to a first host, a second interface for connecting to a second host, and a protocol acceleration engine. The protocol acceleration engine offloads TCP states related to data transmission from the system protocol stack. The protocol acceleration engine is used to process packets received by the first interface based on TCP states, then synthesize the processed packets into TCP user data and send it to the second host via the second interface. It is also used to process TCP user data received by the second interface based on TCP states, then synthesize the processed TCP user data into packets and send them to the first host via the first interface.
[0037] The first host and the second host can act as the requester and the responder, respectively. For example, when the first host is the requester, it sends a request message to the second host, and the second host responds to the request message and sends a response message back to the first host.
[0038] The system can be implemented using an FPGA (Field Programmable Gate Array). This system is implemented within a cloud service system and can be integrated into the network interface card (NIC) (see [link]). Figure 4 The first interface is an Ethernet interface, such as a gigabit or 10G interface, and the first host connected to it can be a router or switch. The second interface is a PCIe interface, and the second host connected to it can be a data center server. The number of interfaces can be selected according to actual needs.
[0039] The TCP protocol has eleven states, including: (1) LISTEN, listening for connection requests from remote TCP ports; (2) SYN-SENT, waiting for a matching connection request after sending a connection request; (3) SYN-RECEIVED, waiting for confirmation of a connection request after receiving and sending one; (4) ESTABLISHED, representing an open connection where data can be transmitted to the user; (5) FIN-WAIT-1, waiting for a connection termination request from the remote TCP, or confirmation of a previous connection termination request; (6) FIN-WAIT-2, waiting for a connection termination request from the remote TCP; (7) CLOSE-WAIT, waiting for a connection termination request from the local user; (8) CLOSING, waiting for confirmation of the connection termination from the remote TCP; (9) LAST-ACK, waiting for confirmation of the connection termination request originally sent to the remote TCP; (10) TIME-WAIT, waiting for sufficient time to ensure that the remote TCP receives confirmation of the connection termination request; (11) CLOSED, no connection state. The TCP states related to data transmission that the protocol acceleration engine unloads from the system protocol stack include ESTABLISHED, CLOSED, SYN-SENT, and SYN-RECEIVED. Other states are TCP states involving connection termination and connection establishment operations.
[0040] In high-speed network environments, when transmitting large amounts of data over extended periods, TCP states involving connection establishment can impact TCP performance. However, once the transmission time is sufficiently long, the impact of connection establishment becomes negligible. Similarly, TCP states involving connection termination also have little impact on TCP performance. The TCP states involved in data transmission operations, however, are closely related to TCP transmission performance. The system in this embodiment can offload some TCP states, reducing CPU load and enabling efficient data transmission through simple hardware implementation.
[0041] Specifically, the protocol acceleration engine includes a message parsing and verification module, a connection matching module, a TCP protocol processing module, an entry storage module, and a storage control module.
[0042] The table entry storage module stores table entries containing a key_rule, its corresponding hash value (hash_rule), and an index (index). The action can be obtained through the index, allowing for corresponding editing of the message. The table entries are pre-deployed to the table entry storage module by the software. The table entry storage module can be integrated within the protocol acceleration engine, or it can be externally attached to the protocol acceleration engine. The table entry storage module can be a DDR storage module. When the system is implemented using an FPGA, which lacks sufficient internal cache space, it is preferable to externalize the table entry storage module to the protocol acceleration engine (e.g., ...). Figure 4 ).
[0043] The message parsing module is used to parse and verify messages received by the first interface. For example, the parser module uses a multi-stage pipelined approach to parse the message header, obtaining the source MAC address, destination MAC address, source IP address, destination IP address, protocol number, sequence number, acknowledgment number, etc. Specifically, message verification algorithms such as CRC and LRC are used for verification. Messages that fail verification are discarded, and messages that pass verification undergo MTU (Maximum Transmission Unit) checks. If the checked message bytes exceed the MTU (a preset 1500 bytes), the message is discarded.
[0044] The connection matching module extracts the header information of the parsed and verified message to construct a tuple key. It then matches the tuple key against entries in the entry storage module. If a match is successful, an index is obtained and sent to the TCP protocol processing module. If the match fails, the message is sent to the second host via the second interface of the message bypass channel. For example, if key = (source MAC + destination MAC + source IP + destination IP + protocol number), the matching process is as follows: first, hash(key) is calculated; then, hash(key) is checked against hash_rule. If the values are equal, key = key_rule is compared. If they are still equal, the match is successful; otherwise, it is considered a mismatch. Since the software distributes many key_rules to the entry storage module, performing hash matching first reduces the matching range of key_rules. After a successful match, an index is obtained in the entry of the entry storage module.
[0045] The storage control module includes a storage control subsystem, a TCP user data synthesis unit, a TCP receive control buffer pool, a TCP send control buffer pool, and a TCP packet synthesis unit.
[0046] The TCP protocol processing module performs protocol processing on the packets sent by the first host, and then converts them into TCP user data via the storage control module before sending them to the second host. Conversely, it converts the TCP user data sent by the second host into packets, processes them according to the protocol, and then sends them to the first host. Therefore, the TCP protocol processing module is primarily responsible for receiving and sending data (the receiving and sending methods described in this document are based on the first interface description, such as...). Figure 3 ).
[0047] From the perspective of receiving data, the TCP protocol processing module generates Info control information after the packet is rearranged based on the index, and sends the Info control information to the storage control module. The storage control module generates TCP user data based on the Info control information and sends the TCP user data to the second host through the second interface.
[0048] Specifically, see Figure 2 , 3 The system receives TCP packets from gigabit and 10G network interfaces. After parsing, extracting, hashing, and looking up data in a table, it obtains an index. Based on this index, it searches the TCP receive control buffer pool of the storage control module for the corresponding set of variables for the connection, obtains the action, and combines this with TCP field information extracted from previous packets. The packets are then rearranged according to sequence number and acknowledgment number, generating corresponding info information from the obtained data in the correct order. This embodiment implements the received TCP packet rearrangement process through hardware, which increases hardware complexity but improves overall system efficiency. Subsequently, the info control information is... Figure 2 The TCP receiving engine (part of the TCP protocol processing module) sends the data to the storage control subsystem, which then sends it to the TCP user data synthesis unit. Based on the info control information, the unit generates TCP user data and sends it to the second host via the second interface.
[0049] From the perspective of data transmission, the storage control module obtains info control information based on the TCP user data received through the second interface. The TCP protocol processing module generates a message based on the info control information and sends the message to the first host via the first interface.
[0050] Specifically, see Figure 2 , 3 The system receives TCP user data from the second host via the PCIe interface, then sends it to the storage control subsystem. This data is then sequentially sent to the TCP send control buffer in fixed data blocks (e.g., 512-bit segments), which uses a queue to store the data. After processing by subsequent built-in modules, this data generates corresponding packets based on control information. These built-in modules may include a lookup module for extracting tuple information, retrieving action values, and editing and assembling packets. The TCP send engine (part of the TCP protocol processing module) reads the packets, and the TCP packet synthesis unit sends the packets out from the first interface.
[0051] In the above process, the queue needs to update its local sending queue based on the acknowledgment sequence number obtained from the TCP receive portion, obtain the TCP window field to calculate the receiving window size of the peer, obtain the local reliable and ordered sequence number to generate the corresponding acknowledgment sequence number, and obtain the local remaining window space to construct the window field for sending packets. During this sending process, when the timer message arrives, packet retransmission and probe control are finally performed.
[0052] Both the receiving and transmitting sections utilize buffer pools in this disclosure, reducing the coupling between various hardware execution submodules. Furthermore, the system in this disclosure employs pipelining within the hardware, breaking down a complex editing action into several simpler actions, allowing the FPGA to perform these actions in each clock cycle. Compared to a CPU, this enables parallel operation.
[0053] This disclosure also provides a TCP acceleration method, including: when performing TCP connection establishment or disconnection operations, executing based on the TCP state regarding connection establishment or disconnection within the system protocol stack; and when performing TCP data transmission operations, executing based on the aforementioned TCP acceleration system.
[0054] The data transmission operation is performed by the TCP acceleration system as follows: The protocol acceleration engine is used to process the packets received by the first interface based on the TCP state, and then synthesize the processed packets into TCP user data and send them to the second host through the second interface. It is also used to process the TCP user data received by the second interface based on the TCP state, and then synthesize the processed TCP user data into packets and send them to the first host through the first interface.
[0055] The specific execution process of the protocol acceleration engine includes a receiving process and a sending process:
[0056] The receiving process is as follows:
[0057] The messages received by the first interface are parsed and verified;
[0058] Extract the header information of the parsed and verified message to construct a tuple key, and match the tuple key with the table entries in the table entry storage module. If the match is successful, obtain the index and send it to the TCP protocol processing module. If the match is unsuccessful, send the message to the second host through the message pass-through channel via the second interface.
[0059] Based on the index, generate the out-of-order control information of the message, generate TCP user data based on the control information, and send the TCP user data to the second host through the second interface;
[0060] The sending process is as follows: obtain info control information based on the TCP user data received from the second interface, generate a message based on the info control information, and send the message to the first host via the first interface.
[0061] While several specific implementation details are included in the foregoing 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 implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0062] Although the subject matter has been described using language specific to method 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.
[0063] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A TCP acceleration system, characterized in that, The system includes a first interface for connecting to a first host, a second interface for connecting to a second host, and a protocol acceleration engine. The protocol acceleration engine offloads TCP states related to data transmission from the system protocol stack. The protocol acceleration engine is used to process packets received by the first interface based on TCP states related to data transmission, and then synthesizes the processed packets into TCP user data and sends it to the second host via the second interface. It is also used to process TCP user data received by the second interface based on TCP states related to data transmission, and then synthesize the processed TCP user data into packets and send them to the first host via the first interface. The protocol acceleration engine includes a message parsing and verification module, a connection matching module, a TCP protocol processing module, an entry storage module, and a storage control module. The table entry storage module is used to store table entries containing key_rule and its corresponding hash value, as well as index; The message parsing module is used to parse and verify the messages received by the first interface; The connection matching module is used to extract the message header information of the parsed and verified message to construct a tuple key, and match the tuple key with the table entries in the table entry storage module. If the match is successful, the index is obtained and sent to the TCP protocol processing module. If the match is unsuccessful, the message is sent to the second host through the message pass-through channel via the second interface. The TCP protocol processing module generates Info control information after reordering the packets based on the index and sends the Info control information to the storage control module. The storage control module generates TCP user data based on the Info control information and sends the TCP user data to the second host via the second interface. The storage control module obtains Info control information based on the TCP user data received through the second interface. On the other hand, the TCP protocol processing module generates packets based on the Info control information and sends the packets to the first host via the first interface. The info control information generation process includes: searching for the corresponding set of variables in the TCP receive control buffer pool of the storage control module according to the index, obtaining the action, and combining it with the TCP field information extracted from previous messages. The data is then rearranged according to the sequence number and acknowledgment number to generate the corresponding info information from the obtained accurate order data. The process of generating a message based on info control information includes: receiving TCP user data and sending it to the storage control subsystem of the storage control module; sending it sequentially in fixed data blocks to the TCP transmission control buffer pool of the storage control module; the TCP transmission control buffer pool stores the data in a queue manner; these data are used by the lookup module to obtain the action, and the message can also be edited and assembled.
2. The TCP acceleration system according to claim 1, characterized in that, The TCP states related to data transmission that the protocol acceleration engine unloads from the system protocol stack include ESTABLISHED, CLOSED, SYN-SENT, and SYNRECEIVED.
3. The TCP acceleration system according to claim 1, characterized in that, The table entry storage module can be integrated into the protocol acceleration engine, or the table entry storage module can be externally attached to the protocol acceleration engine.
4. The TCP acceleration system according to claim 1, characterized in that, The table entry storage module is a DDR storage module.
5. A TCP acceleration system according to claim 1, characterized in that, The system is integrated into the network interface card (NIC).
6. A TCP acceleration system according to claim 1, characterized in that, The first interface is an Ethernet interface, and the second interface is a PCIe interface.
7. A TCP acceleration method, characterized in that, include: When performing TCP connection establishment or disconnection operations, the execution is based on the TCP state regarding connection establishment or disconnection within the system protocol stack; when performing TCP data transmission operations, the execution is based on the TCP acceleration system as described in any one of claims 1-6.
8. A TCP acceleration method according to claim 7, characterized in that, The data transmission operation is performed by the TCP acceleration system as follows: The protocol acceleration engine is used to process the packets received by the first interface based on the TCP state, and then synthesize the processed packets into TCP user data and send them to the second host through the second interface. It is also used to process the TCP user data received by the second interface based on the TCP state, and then synthesize the processed TCP user data into packets and send them to the first host through the first interface.
9. A TCP acceleration method according to claim 8, characterized in that, The specific execution process of the protocol acceleration engine includes a receiving process and a sending process: The receiving process is as follows: The messages received by the first interface are parsed and verified; Extract the message header information of the parsed and verified message to construct a tuple key, and match the tuple key with the table entries. If the match is successful, obtain the index; if the match is unsuccessful, send the message to the second host through the message pass-through channel via the second interface. Based on the index, generate the out-of-order control information of the message, generate TCP user data based on the control information, and send the TCP user data to the second host through the second interface; The sending process is as follows: Based on the TCP user data received from the second interface, info control information is obtained, a message is generated based on the info control information, and the message is sent to the first host via the first interface.
Citation Information
Patent Citations
FPGA-based TCP / IP hardware unloading system and implementation method thereof
CN114489840A