TCP acknowledgement optimization method and device, network equipment and storage medium
By employing active ACK suppression and passive ACK filtering mechanisms, the problem of TCP acknowledgment packet overhead limitation is alleviated, data throughput is improved, and it is suitable for high-speed wireless network environments.
Patent Information
- Application Number
- CN202511800322.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-02-24
AI Technical Summary
The data throughput limitation caused by the TCP acknowledgment mechanism in high-speed wireless networks is mainly due to the generation and sending of redundant ACK packets, which is difficult to solve effectively with existing technologies.
On the data receiving path, the active ACK suppression module buffers data packets and sends them in batches, while the passive ACK filtering module filters redundant ACK packets. A non-destructive timing scheduling and state filtering mechanism is used to reduce the generation and transmission of redundant ACKs.
It effectively reduces TCP acknowledgment packet overhead, improves data throughput, has strong compatibility, is suitable for scenarios where LRO/GRO is disabled, and improves the utilization efficiency of wireless channels.
Smart Images

Figure CN121567283A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a TCP acknowledgment optimization method, apparatus, network device, and storage medium. Background Technology
[0002] With the rapid development of high-speed wireless network technologies such as Wi-Fi 6, network transmission speeds have been significantly improved. However, the inherent acknowledgment mechanism of the TCP (Transmission Control Protocol) protocol has gradually become a key bottleneck restricting data throughput.
[0003] In the traditional TCP / IP (Internet Protocol) protocol stack, the receiver acknowledges received data by sending ACK (Acknowledgement) packets. This mechanism limits data throughput due to the overhead of TCP acknowledgment packets for the following reasons: 1. Over-generation of ACKs: The TCP protocol stack of the receiving host overreacts to high-speed, micro-burst data packet streams, resulting in the generation of a large number of redundant ACK packets; 2. Sending of redundant ACKs: Even if the protocol stack generates multiple ACKs with incrementing sequence numbers (SEQ) in a short period of time (such as ACK(seq=100) and ACK(seq=500)) due to kernel scheduling jitter, the existing mechanism cannot prevent these ACK packets from being sent sequentially to the wireless channel, resulting in a waste of channel resources.
[0004] Existing solutions mainly revolve around three directions: TCP delayed ACK mechanism attempts to reduce the number of ACKs by accumulating acknowledgments (waiting about 200ms, hoping to use one ACK to acknowledge multiple data packets), but in high-speed network environments, the unstable arrival interval of data packets (such as high concurrency, high speed, and kernel scheduling jitter scenarios) often leads to timer mis-triggers, thus generating redundant ACKs; LRO (Large Receive Offload) / GRO (Generic Receive Offload) technology reduces protocol stack processing overhead by merging received data packets at the network card driver layer (creating super data packets by modifying data packets and splicing payloads), but its destructive data packet modification characteristics lead to poor compatibility with routing devices; sender-side scheduling optimization schemes attempt to control the sending rhythm of data packets at the sender, but are difficult to implement due to the lack of control over remote servers. Especially in data center and cloud computing scenarios, when network devices disable LRO / GRO functions, the TCP protocol stack needs to process a massive number of small ACK packets. This not only consumes a lot of CPU (Central Processing Unit) resources, but also causes high-speed wireless channels to be crowded out by frequent ACK transmissions, severely limiting the throughput of effective data. Summary of the Invention
[0005] The purpose of this invention is to provide a TCP acknowledgment optimization method, apparatus, network device, and storage medium to alleviate the problem of data throughput being limited by TCP acknowledgment packet overhead.
[0006] In a first aspect, the present invention provides a TCP acknowledgment optimization method, comprising: The system intercepts incoming raw data packets on the data receiving path, buffers multiple raw data packets from the same data stream that arrive within a preset time period in a temporary buffer, and sends all raw data packets in the temporary buffer to the TCP / IP protocol stack sequentially when the preset time period is reached or the temporary buffer is full; wherein, the preset time period is less than 200ms. The system intercepts the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and performs redundant filtering and enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
[0007] In an optional implementation, the preset duration includes 5ms.
[0008] In an optional implementation, multiple raw data packets arriving within a preset time period from the same data stream are buffered in a temporary buffer, including: The data stream to which each raw data packet belongs is determined based on the 5-tuple information, and each raw data packet is cached in the temporary buffer corresponding to its data stream. When the first raw data packet of the first data stream is stored in the first temporary buffer, a batch processing timer of a preset duration is started. During the period of the batch processing timer, the data packets of the first data stream that arrive subsequently are stored in the first temporary buffer.
[0009] In an optional implementation, all raw data packets in the temporary buffer are sequentially sent to the TCP / IP protocol stack, including: Iterate through all raw data packets in the temporary buffer; Each raw data packet encountered during the iteration is sent sequentially to the TCP / IP protocol stack; After the traversal is complete, clear the temporary buffer and stop the batch processing timer for the preset duration.
[0010] In an optional implementation, based on the sequence number and data stream to which the current ACK packet belongs, redundant filtering of the current ACK packet is performed in the sending queue, including: Based on the five-tuple information of the current ACK packet, the ACK sending status of the data stream to which the current ACK packet belongs is found in the preset buffer. The ACK sending status includes a pointer to an old ACK packet that is already in the sending queue and is waiting to be sent, and the sequence number of the old ACK packet. Based on the sequence number and ACK sending status of the current ACK packet, perform redundant filtering enqueueing of the current ACK packet.
[0011] In an optional implementation, redundant filtering of the current ACK packet is performed for enqueuing based on its sequence number and ACK sending status, including: When no old ACK packet exists, the current ACK packet is added to the sending queue, and the pointer and sequence number corresponding to the current ACK packet are stored in the preset buffer. If the sequence number of the current ACK packet is less than or equal to the sequence number of the old ACK packet, the current ACK packet is discarded. When the sequence number of the current ACK packet is greater than that of the old ACK packet, the old ACK packet is removed from the sending queue and discarded through the pointer corresponding to the old ACK packet, and the current ACK packet is added to the sending queue. The pointer and sequence number corresponding to the current ACK packet are stored in the preset buffer.
[0012] In a second aspect, the present invention provides a TCP acknowledgment optimization apparatus, comprising: The active ACK suppression module is used to intercept incoming raw data packets on the data receiving path, buffer multiple raw data packets from the same data stream that arrive within a preset time period in a temporary buffer, and send all raw data packets in the temporary buffer to the TCP / IP protocol stack in sequence when the preset time period is reached or the temporary buffer is full; wherein, the preset time period is less than 200ms; The passive ACK filtering module is used to intercept the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and to perform redundant filtering and enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
[0013] In an optional implementation, the passive ACK filtering module is specifically used to: search for the ACK sending status of the data stream to which the current ACK packet belongs in a preset buffer based on the five-tuple information of the current ACK packet. The ACK sending status includes a pointer to an old ACK packet that is already in the sending queue and is waiting to be sent, and the sequence number of the old ACK packet; and perform redundant filtering enqueueing of the current ACK packet based on the sequence number and ACK sending status of the current ACK packet.
[0014] Thirdly, the present invention provides a network device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the TCP acknowledgment optimization method of any of the foregoing embodiments.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the TCP acknowledgment optimization method of any of the foregoing embodiments.
[0016] The TCP acknowledgment optimization method, apparatus, network device, and storage medium provided by this invention include: intercepting arriving raw data packets on the data receiving path; buffering multiple raw data packets arriving within a preset time period from the same data stream in a temporary buffer; and sequentially sending all raw data packets in the temporary buffer to the TCP / IP protocol stack when the preset time period is reached or the temporary buffer is full; wherein the preset time period is less than 200ms; intercepting the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and performing redundant filtering enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs. By intercepting raw data packets on the data receiving path and using a non-destructive batch delivery method, the TCP / IP protocol stack can reduce the generation of redundant ACKs. Furthermore, intercepting ACK packets on the ACK sending path and performing redundant filtering enqueueing can filter out redundant ACK packets in real time, thereby overcoming LRO / GRO defects and alleviating the problem of data throughput being limited by TCP acknowledgment packet overhead. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a TCP acknowledgment optimization method provided in an embodiment of the present invention; Figure 2 A system schematic diagram of a TCP acknowledgment optimization method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an active ACK suppression process provided in an embodiment of the present invention; Figure 4 A schematic diagram of a passive ACK filtering process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a TCP acknowledgment optimization device provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a network device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] To address the limitation of data throughput caused by TCP acknowledgment packet overhead, embodiments of the present invention provide a TCP acknowledgment optimization method, apparatus, network device, and storage medium. This method employs a non-destructive, highly compatible, and dual-protection ACK optimization scheme, achieving the following objectives: Objective 1 (Active Suppression): In scenarios where LRO / GRO is disabled, a new "time-sequence scheduling" mechanism is provided to actively "guide" the TCP protocol stack to reduce ACK generation from the source through non-destructive batch delivery.
[0021] Objective 2 (Passive Filtering): Provide a "safety net" mechanism to filter out any redundant ACKs in real time on the ACK transmission path, ensuring that only the ACK with the highest sequence number is transmitted on the wireless channel.
[0022] To facilitate understanding of this embodiment, a TCP acknowledgment optimization method disclosed in this embodiment of the invention will first be described in detail.
[0023] This invention provides a TCP acknowledgment optimization method, which can be executed by a network device, such as a data receiving host or a server. The network device can be, but is not limited to, a network interface card (NIC) using the PCIe (Peripheral Component Interconnect Express) bus standard. The method includes two cooperating phases: An active suppression phase, implemented on the data receiving path, is used to reduce the generation of redundant ACKs; A passive filtering stage, implemented on the ACK sending path, is used to eliminate the sending of redundant ACKs that have already been generated.
[0024] See Figure 1 The diagram shows a TCP acknowledgment optimization method, which mainly includes the following steps S110 to S120: Step S110: Intercept the arriving raw data packets on the data receiving path, buffer multiple raw data packets arriving within a preset time period from the same data stream into a temporary buffer, and when the preset time period is reached or the temporary buffer is full, send all the raw data packets in the temporary buffer to the TCP / IP protocol stack in sequence; wherein, the preset time period is less than 200ms.
[0025] This invention employs an active suppression mechanism on the data receiving path, which can be executed by an active ACK suppression module to reduce the generation of redundant ACKs without modifying the data packet content or merging the data packet payload. Specifically, a temporary buffer is set up for each data stream on the data receiving path. After a short time (≤200ms) aggregation of the original data packets of the same data stream, non-destructive batch processing and delivery are performed: multiple original data packets arriving within a preset time are temporarily stored in the corresponding temporary buffers. When either the preset time is reached or the temporary buffer is full, all the buffered original data packets are submitted as a batch to the TCP / IP protocol stack in sequence.
[0026] The preset duration can be much shorter than the 200ms duration of the TCP ACK delay timer, and can be set according to actual needs. Optionally, the preset duration can range from 3ms to 20ms; for example, the preset duration can be 5ms.
[0027] In some possible embodiments, the step of caching multiple raw data packets arriving within a preset time period from the same data stream in a temporary buffer can be implemented by the following process: determining the data stream to which each raw data packet belongs based on the 5-tuple information, and caching each raw data packet into the temporary buffer corresponding to its data stream; wherein, when the first raw data packet of the first data stream is stored in the first temporary buffer, a batch processing timer of a preset time period is started, and subsequent data packets of the first data stream arriving within the period of the batch processing timer are stored in the first temporary buffer.
[0028] The aforementioned 5-tuple information may include the source IP, destination IP, source port, destination port, and protocol number. This 5-tuple information can be used to locate data streams; in practice, the hash value of the 5-tuple information can be used to quickly locate the temporary buffer corresponding to the data stream.
[0029] In some possible embodiments, the step of sequentially sending all raw data packets in the temporary buffer to the TCP / IP protocol stack can be implemented as follows: traverse all raw data packets in the temporary buffer; sequentially send each traversed raw data packet to the TCP / IP protocol stack; after traversal, clear the temporary buffer and stop the batch processing timer for a preset duration. This process does not modify any data packets, and the integrity of the original data packets is 100% preserved. Therefore, this mechanism can be used in scenarios where LRO / GRO is disabled, such as IP forwarding.
[0030] Step S120: Intercept the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and perform redundant filtering enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
[0031] This invention employs a passive filtering mechanism on the ACK transmission path, which can be executed by a passive ACK filtering module to eliminate the transmission of already generated redundant ACKs: On the ACK transmission path, the current ACK packet to be sent by the TCP / IP protocol stack is intercepted; then, based on the sequence number of this ACK packet (the sequence number is generated in an incrementing manner) and its corresponding data stream, redundant filtering is performed in the ACK packet transmission queue, that is, only the ACK packet with the largest sequence number is retained under the same data stream, to avoid redundant or invalid ACK packets occupying transmission resources.
[0032] In some possible embodiments, the ACK sending status of each data stream can be stored in a preset buffer. This ACK sending status includes at least a pointer to an ACK packet already in the sending queue and awaiting transmission, and the sequence number of that ACK packet. This allows for redundant filtering of the current ACK packet by looking up the ACK sending status of its respective data stream. Based on this, the step of redundant filtering of the current ACK packet in the sending queue according to its sequence number and its data stream can be implemented as follows: Based on the five-tuple information of the current ACK packet, look up the ACK sending status of the data stream to which the current ACK packet belongs in the preset buffer. This ACK sending status includes a pointer to an old ACK packet already in the sending queue and awaiting transmission, and the sequence number of that old ACK packet. Then, redundancy filtering of the current ACK packet is performed based on its sequence number and ACK sending status.
[0033] In one possible implementation, the redundancy filtering and queuing of the current ACK packet based on its sequence number and transmission status can include: adding the current ACK packet to the transmission queue when no old ACK packet exists, and storing the pointer and sequence number corresponding to the current ACK packet in a preset buffer; discarding the current ACK packet when its sequence number is less than or equal to the sequence number of the old ACK packet; removing and discarding the old ACK packet from the transmission queue using the pointer corresponding to the old ACK packet when its sequence number is greater than the sequence number of the old ACK packet; and adding the current ACK packet to the transmission queue and storing the pointer and sequence number corresponding to the current ACK packet in a preset buffer.
[0034] The TCP acknowledgment optimization method provided in this invention intercepts arriving raw data packets on the data receiving path, buffers multiple raw data packets arriving within a preset time period from the same data stream in a temporary buffer, and sequentially sends all raw data packets in the temporary buffer to the TCP / IP protocol stack when the preset time period is reached or the temporary buffer is full; wherein the preset time period is less than 200ms; on the ACK sending path, it intercepts the current ACK packet sent by the TCP / IP protocol stack, and performs redundant filtering enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs. In this way, intercepting raw data packets on the data receiving path and using a non-destructive batch delivery method can reduce the generation of redundant ACKs by the TCP / IP protocol stack, and intercepting ACK packets on the ACK sending path and performing redundant filtering enqueueing can filter out redundant ACK packets in real time, thereby overcoming the LRO / GRO defects and alleviating the problem of data throughput being limited by TCP acknowledgment packet overhead.
[0035] To facilitate understanding, the system principle of the above TCP acknowledgment optimization method will be introduced below.
[0036] like Figure 2 As shown, the above TCP acknowledgment optimization method is implemented by two modules deployed on the data receiving host: an Active Acknowledgment Suppression Module (AASM) and a Passive Acknowledgment Filtering Module (PAFM). This host serves as both the data receiver and the ACK sender. The specific implementation process is as follows: 1. Receive uplink data streams on Wi-Fi wireless channels; 2. The network device driver (NIC driver) receives data packets from the Wi-Fi wireless channel; 3. The active ACK suppression module located in the receive (RX) path classifies the data packets according to the data stream by the five-tuple information of the data packets and stores them in the corresponding buffer, and starts the batch processing timer; 4. Once the buffer is full or the batch processing timer expires, data packets are sequentially sent to the TCP / IP protocol stack; 5. After receiving the data packet, the TCP / IP protocol stack generates a TCP ACK and sends it to the driver. 6. Before being sent to the driver, the passive ACK filtering module located on the ACK transmission (TX) path intercepts and filters ACKs; ACK filtering includes classifying ACKs by an ACK classifier, obtaining the sequence number (Last_SEQ) of the ACK of the same data stream in the last saved transmission queue through the stream state buffer (i.e., the preset buffer), and discarding redundant ACKs through the redundant ACK discarding logic related to the sequence number. 7. Send the filtered ACK to the network device driver; 8. The network device driver sends the filtered downlink ACK stream to the Wi-Fi wireless channel.
[0037] To facilitate understanding, the active ACK suppression module and its process, as well as the passive ACK filtering module and its process, will be described in detail below.
[0038] I. Active ACK Suppression Module (AASM).
[0039] Location: Located in the receive (RX) path of the network device driver, before the data packet is delivered to the TCP / IP protocol stack.
[0040] The core idea is to use "reservoirs" and "batch processing" to non-destructively control the timing of data packet delivery.
[0041] The workflow is as follows: 1. Interception: AASM intercepts every data packet received by the driver.
[0042] 2. Classification: By hashing the 5-tuple (source IP, destination IP, source port, destination port, protocol number, i.e., the 5-tuple), the micro-buffer (i.e., temporary buffer) corresponding to each data stream can be quickly located.
[0043] 3. Buffering and timing: a. When the first data packet (Pkt 1) arrives in the data stream, AASM stores it in a buffer and starts a very short suppression timer (i.e., a batch timer, T_suppress, for example, 5ms, which is much shorter than TCP's 200ms delay ACK timer).
[0044] b. During the T_suppress period, subsequent data packets (Pkt 2, 3, 4...) arriving in this data stream are successively stored in this buffer.
[0045] 4. Batch processing delivery: a. When the T_suppress timer times out or the buffer is full, the AASM “batch delivery” procedure is triggered.
[0046] b. The "batch delivery" procedure does not merge these packets. Instead, it delivers all the raw packets (Pkt 1, Pkt 2, 3, 4...) in the buffer sequentially and rapidly to the TCP / IP protocol stack in a tight loop.
[0047] Effect: The TCP protocol stack receives Pkt 1 to Pkt 4 consecutively within a very short processing cycle (usually within the same soft interrupt context). The internal logic of the protocol stack recognizes that the sequence numbers are consecutive, and therefore naturally sets a delayed ACK timer for this batch of packets, thus generating only one ACK from the source.
[0048] Unlike LRO / GRO: This process does not modify any data packets, and the integrity of Pkt 1-4 is 100% preserved. Therefore, this mechanism can be used in scenarios where LRO / GRO is disabled, such as IP forwarding.
[0049] like Figure 3 As shown, the implementation process of active ACK suppression is as follows: The driver receives a data packet; parses the 5-tuple and identifies the data stream as Flow A; searches for each flow micro-buffer corresponding to Flow A in the AASM hash table; checks if the buffer exists; if not (i.e., the buffer does not exist), creates a buffer for Flow A, stores the data packet in the buffer, and starts the suppression timer; if yes (i.e., the buffer exists), stores the data packet in the existing buffer, and then checks if the buffer is full; if no (i.e., the buffer is not full), the process ends; if yes (i.e., the buffer is full) or a suppression timer timeout event occurs, executes the "batch delivery" program. The "batch delivery" program includes: 1. Traversing all data packets (pkt 1,2..N) in the buffer; 2. (Looping) delivering Pkts sequentially to the TCP / IP protocol stack; 3. Clearing the buffer and stopping the timer.
[0050] II. Passive Acknowledgment Filtering Module (PAFM).
[0051] Location: Located in the host's ACK sending (TX) path, before the TCP / IP protocol stack generates the ACK packet and delivers it to the driver.
[0052] The core idea is a "safety net" to ensure absolute security, allowing only the highest SEQ ACK to be sent.
[0053] The workflow is as follows: 1. Interception: PAFM intercepts all ACK packets that the TCP / IP protocol stack attempts to send.
[0054] 2. Classification and Caching: The ACK sending status of the data stream is quickly retrieved using a 5-tuple hash (source IP, destination IP, source port, destination port, protocol number). This ACK sending status must contain at least: Pointer_to_Queued_ACK: A pointer to the ACK packet that is already in the queue and waiting to be sent; Queued_ACK_SEQ: The sequence number of the ACK packet.
[0055] 3. Filtering logic: a. When a new ACK packet (New_ACK) arrives, PAFM looks up its flow status.
[0056] b. Case 1 (Queue Empty): There is no ACK for this data stream in the buffer. New_ACK is enqueued normally, and its pointer and SEQ number are stored in the buffer.
[0057] c. Case 2 (New Packet Redundancy): Old_ACK exists in the cache. Comparison reveals that New_ACK.SEQ ≤ Old_ACK.SEQ.
[0058] Action: New_ACK is redundant, so discard New_ACK immediately.
[0059] d. Case 3 (Old Packet Redundancy): Old_ACK exists in the cache. Comparison reveals that New_ACK.SEQ > Old_ACK.SEQ.
[0060] Action: Old_ACK is obsolete. PAFM removes and discards Old_ACK from the send queue via the pointer Pointer_to_Queued_ACK; then it adds New_ACK to the send queue and updates the cached pointer and SEQ to New_ACK.
[0061] Effect: Regardless of how many "leaked" ACKs are generated by the protocol stack due to scheduling jitter, the PAFM module ensures that at any given time, each data stream has at most one ACK packet in the sending queue, and it must be the one with the largest sequence number.
[0062] like Figure 4As shown, the implementation process of passive ACK filtering is as follows: The TCP protocol stack generates an ACK packet (New_ACK); the PAFM module intercepts New_ACK; it parses the 5-tuple, identifies the data stream, and obtains New_TCP.SEQ; it checks whether Old_ACK exists in the buffer; if not (i.e., Old_ACK does not exist), New_ACK is enqueued, and its SEQ and Pkt_Ptr are stored in the buffer, after which the process ends; if yes (i.e., Old_ACK exists), the stream state buffer is searched, Old_ACK.SEQ and Old_Pkt_Ptr are obtained, and it is determined whether New_ACK.SEQ > Old_ACK.SEQ; if not (i.e., New_ACK.SEQ ≤ Old_ACK.SEQ), New_ACK is discarded, and the process ends; if yes (i.e., New_ACK.SEQ > Old_ACK.SEQ), Old_ACK is removed from the queue and discarded through Old_Pkt_Ptr, New_ACK is enqueued, the buffer is updated with New_ACK information, and the process ends.
[0063] In summary, the embodiments of the present invention have the following advantages: 1. Overcomes the fundamental shortcomings of LRO / GRO: The Active Suppression (AASM) mechanism is non-destructive, preserving the integrity of all original packets, and therefore can be safely used in IP forwarding (gateways, routers) and high-performance server scenarios, where LRO / GRO is typically disabled. This is a significant, albeit non-obvious, advantage.
[0064] 2. Dual protection, extremely robust: AASM solves the problem at the "source" (generation), while PAFM provides 100% backup protection at the "exit" (transmission). This dual mechanism is far more reliable and efficient than any single mechanism (such as LRO / GRO or TX scheduling).
[0065] 3. High compatibility: Purely software implemented, it can be deployed in drivers or kernel modules. It does not depend on the cooperation of the sender, nor on specific network card hardware (superior to LRO / GRO).
[0066] 4. The solution of this invention is not a simple "packet loss" or "merging" logic, but a sophisticated, cross-layer (driver layer L2 and protocol stack L4) collaborative system based on "timing scheduling" and "state filtering", which solves the compatibility and reliability problems that existing technologies cannot solve.
[0067] Corresponding to the TCP acknowledgment optimization method described above, this embodiment of the invention also provides a TCP acknowledgment optimization apparatus. See [link to previous document]. Figure 5 The diagram shown illustrates the structure of a TCP acknowledgment optimization device, which includes: The active ACK suppression module 501 is used to intercept the incoming raw data packets on the data receiving path, buffer multiple raw data packets arriving within a preset time period from the same data stream into a temporary buffer, and send all the raw data packets in the temporary buffer to the TCP / IP protocol stack in sequence when the preset time period is reached or the temporary buffer is full; wherein, the preset time period is less than 200ms; The passive ACK filtering module 502 is used to intercept the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and to perform redundant filtering and enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
[0068] The TCP acknowledgment optimization apparatus provided in this invention can intercept arriving raw data packets on the data receiving path, buffer multiple raw data packets arriving within a preset time period from the same data stream into a temporary buffer, and sequentially send all raw data packets in the temporary buffer to the TCP / IP protocol stack when the preset time period is reached or the temporary buffer is full; wherein the preset time period is less than 200ms; intercepting the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and performing redundant filtering enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs. In this way, intercepting raw data packets on the data receiving path and using a non-destructive batch delivery method can reduce the generation of redundant ACKs by the TCP / IP protocol stack, and intercepting ACK packets on the ACK sending path and performing redundant filtering enqueueing can filter out redundant ACK packets in real time, thereby overcoming the LRO / GRO defects and alleviating the problem of data throughput being limited by TCP acknowledgment packet overhead.
[0069] Furthermore, the aforementioned preset duration includes 5ms.
[0070] Furthermore, the aforementioned active ACK suppression module 501 is specifically used to: determine the data stream to which each original data packet belongs based on the five-tuple information, and cache each original data packet in the temporary buffer corresponding to the data stream to which it belongs; wherein, when the first original data packet of the first data stream is stored in the first temporary buffer, a batch processing timer of a preset duration is started, and the data packets of the first data stream that arrive subsequently are stored in the first temporary buffer within the period of the batch processing timer.
[0071] Furthermore, the aforementioned active ACK suppression module 501 is also used to: traverse all raw data packets in the temporary buffer; send each raw data packet encountered sequentially to the TCP / IP protocol stack; after traversal is completed, clear the temporary buffer and stop the batch processing timer for a preset duration.
[0072] Furthermore, the aforementioned passive ACK filtering module 502 is specifically used to: search for the ACK sending status of the data stream to which the current ACK packet belongs in the preset buffer based on the five-tuple information of the current ACK packet. The ACK sending status includes a pointer to an old ACK packet that is already in the sending queue and is waiting to be sent, and the sequence number of the old ACK packet; and perform redundant filtering enqueueing of the current ACK packet based on the sequence number and ACK sending status of the current ACK packet.
[0073] Furthermore, the passive ACK filtering module 502 is also used to: add the current ACK packet to the sending queue when no old ACK packet exists, and store the pointer and sequence number corresponding to the current ACK packet in a preset buffer; discard the current ACK packet when the sequence number of the current ACK packet is less than or equal to the sequence number of the old ACK packet; remove the old ACK packet from the sending queue and discard it through the pointer corresponding to the old ACK packet when the sequence number of the current ACK packet is greater than the sequence number of the old ACK packet; and add the current ACK packet to the sending queue and store the pointer and sequence number corresponding to the current ACK packet in a preset buffer.
[0074] The TCP acknowledgment optimization device provided in this embodiment has the same implementation principle and technical effect as the aforementioned TCP acknowledgment optimization method embodiment. For the sake of brevity, any parts not mentioned in the TCP acknowledgment optimization device embodiment can be referred to the corresponding content in the aforementioned TCP acknowledgment optimization method embodiment.
[0075] like Figure 6 As shown, an embodiment of the present invention provides a network device 600, including a processor 601, a memory 602, and a bus. The memory 602 stores a computer program that can run on the processor 601. When the network device 600 is running, the processor 601 and the memory 602 communicate through the bus, and the processor 601 executes the computer program to implement the above-mentioned TCP acknowledgment optimization method.
[0076] Specifically, the memory 602 and processor 601 mentioned above can be general-purpose memory and processor, without any specific limitations here.
[0077] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the TCP acknowledgment optimization method described in the preceding method embodiments. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, external hard drive, read-only memory (ROM), RAM, magnetic disk, or optical disk.
[0078] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0079] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.
[0080] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive 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, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0082] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0083] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A TCP acknowledgment optimization method, characterized in that, include: The system intercepts incoming raw data packets on the data receiving path, buffers multiple raw data packets from the same data stream that arrive within a preset time period in a temporary buffer, and when the preset time period is reached or the temporary buffer is full, sends all the raw data packets in the temporary buffer to the TCP / IP protocol stack in sequence; wherein, the preset time period is less than 200ms; The current ACK packet sent by the TCP / IP protocol stack is intercepted on the ACK sending path, and redundant filtering of the current ACK packet is performed in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
2. The TCP acknowledgment optimization method according to claim 1, characterized in that, The preset duration includes 5ms.
3. The TCP acknowledgment optimization method according to claim 1, characterized in that, The step of caching multiple original data packets arriving within a preset time period from the same data stream in a temporary buffer includes: The data stream to which each of the original data packets belongs is determined based on the 5-tuple information, and each of the original data packets is cached in the temporary buffer corresponding to its respective data stream; wherein, when the first original data packet of the first data stream is stored in the first temporary buffer, the preset duration batch processing timer is started, and the subsequent data packets of the first data stream are stored in the first temporary buffer within the period of the batch processing timer.
4. The TCP acknowledgment optimization method according to claim 1, characterized in that, The step of sequentially sending all the original data packets in the temporary buffer to the TCP / IP protocol stack includes: Iterate through all the original data packets in the temporary buffer; Each of the original data packets encountered during the traversal is sent sequentially to the TCP / IP protocol stack; After the traversal is complete, the temporary buffer is cleared and the batch processing timer of the preset duration is stopped.
5. The TCP acknowledgment optimization method according to claim 1, characterized in that, The step of performing redundant filtering enqueueing of the current ACK packet in the sending queue based on the sequence number and data stream to which the current ACK packet belongs includes: Based on the five-tuple information of the current ACK packet, the ACK sending status of the data stream to which the current ACK packet belongs is searched in the preset buffer. The ACK sending status includes a pointer to an old ACK packet that is already in the sending queue and is waiting to be sent, and the sequence number of the old ACK packet. Based on the sequence number of the current ACK packet and the ACK sending status, the current ACK packet is redundantly filtered and enqueued.
6. The TCP acknowledgment optimization method according to claim 5, characterized in that, The step of performing redundant filtering enqueueing of the current ACK packet based on the sequence number of the current ACK packet and the ACK sending status includes: When the old ACK packet does not exist, the current ACK packet is added to the sending queue, and the pointer and sequence number corresponding to the current ACK packet are stored in the preset buffer. If the sequence number of the current ACK packet is less than or equal to the sequence number of the old ACK packet, the current ACK packet is discarded. When the sequence number of the current ACK packet is greater than the sequence number of the old ACK packet, the old ACK packet is removed from the sending queue and discarded through the pointer corresponding to the old ACK packet, and the current ACK packet is added to the sending queue. The pointer and sequence number corresponding to the current ACK packet are stored in the preset buffer.
7. A TCP acknowledgment optimization device, characterized in that, include: The active ACK suppression module is used to intercept incoming raw data packets on the data receiving path, buffer multiple raw data packets arriving within a preset time period from the same data stream into a temporary buffer, and when the preset time period is reached or the temporary buffer is full, send all the raw data packets in the temporary buffer to the TCP / IP protocol stack in sequence; wherein, the preset time period is less than 200ms; The passive ACK filtering module is used to intercept the current ACK packet sent by the TCP / IP protocol stack on the ACK sending path, and to perform redundant filtering enqueueing of the current ACK packet in the sending queue according to the sequence number and data stream to which the current ACK packet belongs.
8. The TCP acknowledgment optimization apparatus according to claim 7, characterized in that, The passive ACK filtering module is specifically used to: search for the ACK sending status of the data stream to which the current ACK packet belongs in a preset buffer based on the five-tuple information of the current ACK packet, wherein the ACK sending status includes a pointer to an old ACK packet that is already in the sending queue and is waiting to be sent, and the sequence number of the old ACK packet; and perform redundant filtering enqueueing of the current ACK packet based on the sequence number of the current ACK packet and the ACK sending status.
9. A network device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the TCP acknowledgment optimization method as described in any one of claims 1-6.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by the processor to perform the TCP acknowledgment optimization method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data transmission method and device
CN102006283A
Embedded network protocol stack construction method and device based on Rust
CN119127493A
Protocol accelerator and method of using same
US7912060B1