QUIC-based ACK Frame Processing Method, Apparatus, Device, and Medium
By batch reading and merging ACK frames in the QUIC protocol and dynamically adjusting the ACK frame transmission frequency of the client, the high CPU overhead problem of the QUIC protocol during ACK frame processing is solved, and network throughput is improved.
Patent Information
- Application Number
- CN202410925514.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2024-06-21
- Filing Date
- 2024-07-11
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-07-11
AI Technical Summary
When the QUIC protocol is processed in ACK frames, frequent system calls and switching between user state and kernel state lead to high CPU overhead, especially in a weak network environment, which affects network throughput.
By batch reading of UDP packets carrying ACK frames, combining multiple ACK frames and processing them once, dynamically update the frequency of the client sending ACK frames, and adjusting them according to the average number of ACK frames obtained by each reading packet in a historical period.
It significantly reduces CPU overhead, increases network throughput under limited CPU resources, and ensures that throughput will not be affected in a weak network environment.
Smart Images

Figure CN119071242B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer networks, and particularly relates to a method for processing ACK frames based on QUIC. Background Art
[0002] The QUIC protocol is the underlying transport protocol of HTTP / 3. Its core advantage lies in the more flexible control of transmission strategies in the user space by leveraging the fast transmission characteristics of UDP packets. Compared with TCP, the QUIC protocol reduces problems such as head-of-line blocking through optimization, and shows significant transmission efficiency especially in weak network environments. In addition, the QUIC protocol introduces new features such as the 0-RTT mode, further enhancing the user experience of the client. However, since the QUIC protocol uses UDP as the transport layer protocol, there are obvious differences in the CPU overhead of ACK processing compared with TCP. In the TCP protocol, ACK processing is mainly completed in the kernel space, while ACK frames in the QUIC protocol are carried by UDP packets. Each time an ACK frame is processed, the packet needs to be read from the kernel space to the user space and the ACK frame needs to be parsed. This frequent system call and the switch between the user space and the kernel space result in a relatively high CPU overhead.
[0003] On the other hand, since QUIC packets are usually small, the frequency of the client sending ACK frames is relatively high. When the server processes each ACK frame, it needs to traverse the sent queue and remove the packets that have been confirmed to be received. This process of traversing the sent queue multiple times also brings a relatively large CPU overhead. Therefore, optimizing the ACK processing method of the QUIC protocol to reduce the CPU overhead and improve the network throughput under limited CPU resources has become an urgent problem to be solved. Summary of the Invention
[0004] To solve the above technical problems, the present invention provides an efficient method for processing ACK frames based on the QUIC protocol, so as to achieve the purpose of being able to batch read packets from the client to obtain ACK frames at the server side, process the ACK frames after merging multiple ACK frames, and dynamically update the frequency of the client sending ACK frames according to the average value of the number of ACK frames obtained each time when reading packets within a certain historical period, ensuring that the throughput is not affected.
[0005] To achieve the above purpose, the first aspect of the present invention proposes an efficient method for processing ACK frames based on the QUIC protocol, which is applied to the server side and includes:
[0006] S1. Batch read QUIC packets from the client, where the QUIC packets carry ACK frames;
[0007] S2. Merge the ACK frames carried in the QUIC packets in S1, process the merged ACK frame as a normal ACK frame, and calculate the total number ACK of the ACK frames carried in the read QUIC packets. cnt ;
[0008] S3. Divide time windows according to the round-trip time of the QUIC packets, and when a new time window arrives, calculate the average value ACK of the number of ACK frames obtained from each read of the QUIC packets in the previous time window. avg ;
[0009] S4. Notify the client to update the frequency of sending ACK frames, calculate the value T of the updated ACK frame frequency according to ACK avg and create an ACK_FREQUENCY frame and send it to the client. new , create an ACK_FREQUENCY frame and send it to the client.
[0010] Further, in S1, the batch reading of QUIC packets includes:
[0011] Use the recvmmsg() system call to batch read UDP packets from the client from the socket; parse the QUIC packets from the UDP packets.
[0012] Further, in S2, merging the ACK frames carried in the QUIC packets in S1 includes: merging the ACK frames carried in the QUIC packets with the same QUIC connection and the same packet number space.
[0013] Further, the method for judging QUIC packets with the same QUIC connection and the same packet number space includes:
[0014] Parse the header information of the QUIC packet;
[0015] Judge whether the QUIC connections are the same according to the header information and determine the packet type;
[0016] Judge whether the packet number spaces are the same according to the packet type of the QUIC packet.
[0017] Further, in S2, merging the ACK frames carried in the QUIC packets in S1 includes:
[0018] Obtain the ACK frames carried in the QUIC packets with the same QUIC connection and the same packet number space;
[0019] Calculate the maximum acknowledged packet number in the merged ACK frame;
[0020] Calculate the acknowledgement range in the merged ACK frame.
[0021] Further, the value of the largest acknowledgment packet number in the merged ACK frame is the maximum value of the largest acknowledgment packet numbers of the ACK frames carried by the QUIC data packets with the same QUIC connection and the same packet number space. The specific calculation method is as follows: Largest Δ = max 1≤i≤n Largest i , where Largest Δ is the largest acknowledgment packet number of the merged ACK frame, n is the number of ACK frames carried by the QUIC data packets with the same QUIC connection and the same packet number space, and Largest i is the largest acknowledgment packet number of the i-th ACK frame among them.
[0022] Further, the calculation method of the acknowledgment range in the merged ACK frame is to take the intersection of all the acknowledgment ranges of the ACK frames carried by the QUIC data packets with the same QUIC connection and the same packet number space, where each ACK frame includes at least one acknowledgment range.
[0023] Further, the total number of ACK frames carried by the QUIC data packets read this time, ACK cnt calculated in S2 is the total number of ACK frames carried by the QUIC data packets of all QUIC connections and packet number spaces. Further, the method for dividing the time window in S3 is as follows:
[0024] When a new time window arrives, record the total amount of data S transmitted at this time;
[0025] When sending a data packet, record the total amount of data P transmitted when sending this data packet;
[0026] When receiving the acknowledgment of a data packet, obtain the total amount of data P transmitted when sending this data packet. If P ≥ S, enter a new time window.
[0027] Further, the calculation method of ACK avg in S3 is as follows:
[0028]
[0029] where m is the number of times of reading data packets in the previous time window, is the number of ACK frames carried by the k-th read QUIC data packet.
[0030] Further, the calculation method of T new in S4 is as follows:
[0031]
[0032] where T oldis the frequency at which the client sends ACK frames before the update, T new is the updated frequency, indicating that the client is notified to send an ACK frame every time it receives T new data packets.
[0033] Furthermore, creating the ACK_FREQUENCY frame and sending it to the client includes:
[0034] Setting the ACK frequency threshold T of the ACK_FREQUENCY frame new ;
[0035] Adding the ACK_FREQUENCY frame to the server's sending queue.
[0036] Furthermore, creating the ACK_FREQUENCY frame and sending it to the client also includes setting the sequence number of the ACK_FREQUENCY frame, and its calculation method is as follows:
[0037] SN i = SN i-1 + 1
[0038] In the formula, SN i is the sequence number of the currently created ACK_FREQUENCY frame, and SN i is the sequence number of the previous ACK_FREQUENCY frame. When the sequence number of the ACK_FREQUENCY frame received by the client is less than the maximum value of the sequence numbers already received, the ACK_FREQUENCY frame is ignored.
[0039] The second aspect of the present invention proposes an efficient ACK frame processing device based on the QUIC protocol, which is applied to the server. The device includes:
[0040] A data receiving module for batch receiving QUIC data packets carrying ACK frames from the client, where the QUIC data packets carry ACK frames;
[0041] A data processing module for merging the ACK frames in the QUIC data packets received by the data receiving module, performing normal ACK frame processing on the merged ACK frames, and calculating the total number of QUIC data packets carrying ACK frames read;
[0042] A calculation module for dividing a time window according to the round-trip time of the QUIC data packets, and calculating the average value of the number of ACK frames obtained each time a QUIC data packet is read within the previous time window when a new time window is reached;
[0043] A notification module, which is used to notify the client to update the frequency of sending ACK frames. According to the calculated value of the updated ACK frame frequency, an ACK_FREQUENCY frame is created and sent to the client.
[0044] A computer device includes at least one processor and a computer-readable medium storing a computer program. When the computer program is read and run by the processor, the steps of the method described in the first aspect above are implemented.
[0045] A computer-readable medium has a computer program stored thereon. When the computer program is read and run by a processor, the steps of the method described in the first aspect above are implemented.
[0046] Compared with the prior art, the beneficial effects of this application are as follows:
[0047] (1) By batch reading UDP packets carrying ACK frames, the present invention avoids the switching between user mode and kernel mode caused by frequent system calls, and significantly reduces the CPU overhead.
[0048] (2) By merging the read ACK frames, compared with the existing QUIC protocol that needs to process each ACK frame, the present invention only needs to process the merged ACK frame once, reducing the CPU overhead of ACK frame processing and improving the throughput when the CPU resources are insufficient.
[0049] (3) According to the average value of the number of ACK frames obtained by reading QUIC packets each time within a certain historical period, the present invention dynamically adjusts the frequency of the client sending ACK frames. Compared with some existing methods that directly reduce the frequency of the client sending ACK frames, it can increase the frequency when the network condition is poor, so as to ensure that the throughput will not be affected in a weak network environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.
[0051] Figure 1 It is a schematic flowchart of an efficient ACK frame processing method based on the QUIC protocol disclosed in the embodiments of the present invention.
[0052] Figure 2 It is a comparison diagram between the method of the server batch reading packets and merging ACK frames in an efficient ACK frame processing method based on the QUIC protocol disclosed in the embodiments of the present invention and the existing method.
[0053] Figure 3 It is a schematic diagram of the fields of the QUIC protocol ACK frame.
[0054] Figure 4 A schematic diagram of a specific instance of a QUIC protocol ACK frame.
[0055] Figure 5 A schematic diagram of an instance of server-side merging of ACK frames in an efficient ACK frame processing method based on the QUIC protocol disclosed in an embodiment of the present invention.
[0056] Figure 6 A throughput comparison chart of the optimized QUIC implementation (LiteQUIC) of the present invention and various current QUIC implementations. Detailed implementation manners
[0057] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.
[0058] The present invention provides an efficient ACK frame processing method based on the QUIC protocol, as Figure 1 shown, including the following steps:
[0059] S1. Batch read QUIC data packets from the client. The QUIC data packets carry ACK frames. recvmsg() is a system call for receiving a single data packet. It receives data from a socket and places the data in a specified buffer. It is part of the traditional UNIX socket API and is commonly used for protocols such as TCP and UDP.
[0060] recvmmsg() is a Linux-specific system call that allows receiving multiple data packets from a socket at once. This is very useful in scenarios that require high performance, such as for network servers that handle a large number of data packets. By receiving multiple data packets with a single system call, recvmmsg() can not only reduce the overhead of context switching and improve performance, but also reduce the need for multiple recvmsg() calls in the application, thus simplifying the code.
[0061] In the existing QUIC protocol server, the recvmsg() system call is used to receive data packets, so only one data packet can be read each time. However, in the server of the present application, recvmmsg() can be used to batch read data packets. By receiving multiple data packets with a single system call to achieve batch reading, it is possible to avoid the frequent use of system calls to read data packets, which causes the switching between the user mode and the kernel mode, effectively reduce the number of system calls, reduce the CPU overhead, and improve the data processing efficiency. Especially in a high-load environment, it can also improve the performance and throughput of the server.
[0062] In the S1, batch reading of QUIC data packets includes:
[0063] Use the recvmmsg() system call to batch read UDP packets from the client from the socket; parse the QUIC packets from the UDP packets.
[0064] In an actual scenario, the server may accumulate a large number of UDP packets from the client, and the UDP packets contain QUIC packets. The existing method of using recvmsg() to read each UDP packet in sequence will cause frequent user-space and kernel-space switches, resulting in relatively high CPU overhead. However, in the embodiment, the server uses recvmmsg() to read multiple UDP packets from the socket at one time, reducing the number of user-space and kernel-space switches, thereby reducing the CPU overhead and improving the server performance.
[0065] S2. Merge the ACK frames carried in the QUIC packets in S1, perform normal processing on the merged ACK frame, and calculate the total number ACK of the QUIC packets carrying ACK frames read. cnt . By merging the ACK frames, multiple read ACK frames can be merged into one, and only one ACK frame needs to be processed, reducing the number of ACK frame processing times. This can not only reduce the CPU overhead of processing ACK frames, but also improve the data processing efficiency. At the same time, calculate ACK cnt for calculating the updated frequency of the client sending ACK frames later, so that the client can dynamically adjust the ACK frame sending frequency, optimize the utilization of CPU resources, and improve the throughput of the system under various network conditions.
[0066] Figure 2 Shows a comparison diagram of the method for the server of the present invention to merge ACK frames and the method for the existing QUIC protocol to process ACK frames. On the left of the figure is the method for the existing QUIC protocol to process ACK frames. The server needs to first use the recvmsg() system call to read the packets from the kernel space to the user space. Each system call can only read one packet. Then, parse the ACK frames from the packets and process the ACK frames in sequence. Since the QUIC packets are relatively fragmented, there will be a large number of ACK frames in the actual data transmission process. This frequent system call and ACK frame processing will cause too high CPU overhead. On the right of the figure is the method for the server of the present invention to merge ACK frames. The server can use recvmmsg() to batch read multiple packets through one system call, parse the ACK frames from the packets and merge them into one ACK frame. The server only needs to process this one ACK frame, thereby reducing the switching frequency between the user space and the kernel space, and further reducing the CPU overhead.
[0067] The merging of ACK frames carried by the QUIC data packets in S1 in S2 includes: merging ACK frames carried by QUIC data packets of the same QUIC connection and the same packet number space.
[0068] Among them, because the server can handle multiple client connections at the same time, there are three packet number spaces in each connection, and the ACK frames of each connection and packet number space are independent of each other. The server can only merge ACK frames of the same connection and the same packet number space.
[0069] The method for determining QUIC data packets in the same QUIC connection and the same packet number space includes:
[0070] Parse the header information of the QUIC data packet;
[0071] Determine whether the QUIC connections are the same and determine the data packet type according to the packet header information;
[0072] Whether the packet number space is the same is determined according to the packet type of the QUIC packet.
[0073] Among them, the QUIC header information contains a SCID field. SCID represents the client connection ID of the QUIC connection to which it belongs. The same SCID field in the data packet represents the same QUIC connection. The data packet type is determined by the highest bit of the first byte of the packet header. If it is 0, it is a 1-RTT data packet. When the highest bit of the first byte of the packet header is 1, it is determined according to the Long Packet Type field in the header information. When this field is 0x0, the data packet is an Initial data packet, 0x1 is a 0-RTT data packet, and 0x2 is a Handshake data packet. Among them, the Initial data packet is the first packet number space, the Handshake data packet is the second packet number space, and the 0-RTT data packet and the 1-RTT data packet are the third packet number space. The ACK frames carried by data packets of different QUIC connections or different packet number spaces are independent of each other. QUIC data packets that obtain the same QUIC connection and the same packet number space can merge the ACK frames they carry.
[0074] The ACK frame carried by the QUIC data packet in S1 in S2 includes:
[0075] Get the ACK frame carried by the QUIC data packet of the same QUIC connection and the same packet number space;
[0076] Calculate the maximum acknowledgment packet number in the combined ACK frame;
[0077] Calculate the confirmation interval in the combined ACK frame.
[0078] Among them, the acknowledgment range of the ACK frame is the range of packet numbers that the client notifies the server has been received. In this way, the client notifies the server which packets have been confirmed to be received. Each ACK frame contains a maximum acknowledgment packet number and several acknowledgment ranges. When the server processes each acknowledgment range, it needs to traverse the send queue once, and the number of ranges can be reduced by merging the ranges. The maximum acknowledgment packet number is the maximum number of the packets to be acknowledged. The acknowledgment range of the ACK frame is obtained from the starting position, the current range length, and the interval to the next range. The server starts from the maximum acknowledgment packet number and obtains each acknowledgment range in descending order according to the current range length and the interval to the next range. For example, if the maximum acknowledgment packet number is 10, the current range length is 3, and the interval to the next range is 2, then the current range is [10, 8], and the next range starts from 5. Then, each acknowledgment range is obtained based on the length and interval of each subsequent range.
[0079] The value of the maximum acknowledgment packet number in the merged ACK frame is the maximum value of the maximum acknowledgment packet numbers of the ACK frames carried by the QUIC packets with the same QUIC connection and the same packet number space. The specific calculation method is as follows:
[0080] Largest Δ =max 1≤i≤n Largest i where Largest Δ is the maximum acknowledgment packet number of the merged ACK frame, n is the number of ACK frames carried by the QUIC packets with the same QUIC connection and the same packet number space, and Largest i is the maximum acknowledgment packet number of the i-th ACK frame among them.
[0081] Among them, after the ACK frames are merged, the server only needs to process one merged ACK frame. The maximum acknowledgment packet number of the merged ACK frame represents the maximum number of the packets to be acknowledged by this ACK frame, and also the maximum number of the packets to be acknowledged by all the ACK frames to be merged.
[0082] Furthermore, the calculation method of the acknowledgment range in the merged ACK frame is to take the intersection of all the acknowledgment ranges of the ACK frames carried by the QUIC packets with the same QUIC connection and the same packet number space. Among them, each ACK frame includes at least one acknowledgment range.
[0083] Among them, each ACK frame contains several acknowledgment ranges, and there are intersections among some ranges. The ranges with intersections are merged to reduce the number of acknowledgment ranges and thus reduce the CPU overhead when the server processes the ACK frames.
[0084] Figure 3It is a schematic diagram of the fields of a QUIC protocol ACK frame. The meanings of its main fields are as follows: Type: indicates that this frame is an ACK frame; Max ACK: the largest packet number to be acknowledged; ACK Delay: the processing delay of the client; Number of Intervals: the number of remaining acknowledgment intervals; First Interval: represents the length of the first interval of the packets to be acknowledged (acknowledged in descending order of numbers); ACK Interval: a list of acknowledgment intervals, where the gap represents the gap with the next interval, and the interval length represents the length of the interval to be acknowledged; ECN Mark: ECK feedback in the network.
[0085] Figure 4 It is a schematic diagram of a specific instance of a QUIC protocol ACK frame. In this ACK frame, the packet numbers to be acknowledged start from 10. The length of the first acknowledgment interval is 2, that is, the interval [10, 9]. Then there are three more acknowledgment intervals. The gap between the first acknowledgment interval and the next interval is 1, that is, starting from 7, with a length of 1, that is, the first acknowledgment interval is [7]. Similarly, the next two acknowledgment intervals are [5, 4] and [1]. Finally, this ACK frame represents that the client has received the packet numbers [[10, 9], [7], [5, 4], [1]]. An ACK frame may contain multiple acknowledgment intervals, and the existing QUIC protocol traverses the send queue for each interval when processing. Therefore, to reduce the overhead of ACK frame processing, when using recvmmsg() to read multiple packets to obtain multiple ACK frames, their acknowledgment intervals are merged to obtain a merged frame, and the server only processes this one merged frame.
[0086] Figure 5 It is a schematic diagram of an instance of the server merging ACK frames for an efficient ACK frame processing method based on the QUIC protocol disclosed in an embodiment of the present invention. In this instance, the server obtains 3 ACK frames simultaneously. Their acknowledgment intervals are [20, 19], [18, 17], and [13, 12] respectively. After merging the ACK frames, a merged frame containing two acknowledgment intervals is obtained, and its acknowledgment intervals are [20, 17] and [13, 12]. The server only needs to process one merged ACK frame, and its acknowledgment intervals are [[20, 17], [13, 12]].
[0087] In step S2, calculate the total number of ACK frames carried in the QUIC packets read this time, ACK cnt is the total number of ACK frames carried in the QUIC packets for all QUIC connections and packet number spaces.
[0088] Among them, in order to determine whether the server CPU is sufficient, calculate the number of ACK frames carried in the packets each time the packets are read.
[0089] S3. Divide time windows according to the round-trip time of QUIC data packets, and when a new time window is reached, calculate the average value ACK of the number of ACK frames obtained each time a QUIC data packet is read within the previous time window. avg . Determine whether the CPU resources of the server are sufficient according to the number of ACK frames obtained each time a QUIC data packet is read within the previous time window. If the CPU resources of the server are sufficient, the server can process the arrived ACK frames in a timely manner. Therefore, the value of the ACK frame obtained each time a data packet is read will be relatively small. If the CPU resources are insufficient, the speed at which the server processes ACK frames is less than the speed at which ACK frames arrive, and ACK frames will accumulate on the server. The value of the ACK frame obtained each time a data packet is read will be relatively large. At this time, the client should be notified to reduce the frequency of sending ACK frames.
[0090] The method for dividing time windows in S3 is as follows:
[0091] When a new time window is reached, record the total amount of data S transmitted at this time;
[0092] When sending a data packet, record the total amount of data P transmitted when sending this data packet;
[0093] When receiving the confirmation of a data packet, obtain the total amount of data P transmitted when this data packet was sent. If, enter a new time window.
[0094] Among them, the actual round-trip time is used to divide time windows. The above P≥S means that this data packet was sent within the current time window. From the transmission of the data packet to the client to receiving the confirmation from the client, it has gone through a round trip in the network link, representing the actual round-trip time. This can dynamically adapt to network changes compared to directly setting a fixed time window.
[0095] The ACK in S3 avg is calculated as follows:
[0096]
[0097] In the formula, m is the number of times of reading data packets within the previous time window, is the number of ACK frames carried by the kth read QUIC data packet.
[0098] Among them, dividing the total number of ACK frames obtained when reading data packets in the previous time window by the number of times of reading data packets can obtain the average value ACK of the number of ACK frames carried by each read data packet in the previous time window. avg , Judging whether the CPU resources of the server are sufficient according to the average value of the number of ACK frames read over a period of history can avoid errors.
[0099] S4, notify the client to update the frequency of sending ACK frames, according to ACK avg Calculate the updated ACK frame frequency value T new , according to T new Create an ACK_FREQUENCY frame and send it to the client. Compared with the existing method of directly reducing the frequency of the client sending ACK frames, the present invention can dynamically adjust the frequency of sending ACK frames through historical information, reduce the frequency of the client sending ACK frames when CPU resources are insufficient, and increase the frequency when CPU resources are sufficient, so as to avoid a decrease in throughput due to too low ACK frame frequency when CPU resources are sufficient.
[0100] The S4 in T new The calculation method is as follows:
[0101]
[0102] Where, T old is the frequency at which the client sends ACK frames before updating, T new The updated frequency means that the client is notified every time T new After each packet, an ACK frame is sent.
[0103] Among them, when ACK avg When it is greater than or equal to 2, it means that the server CPU resources are insufficient and cannot process the ACK frames from the client in time. ACK frames are accumulated on the server, and multiple ACK frames can be obtained when reading data packets. avg Reduce the number of ACK frames sent by the client, and change the original number of ACK frames received per T old Send an ACK frame for each packet received T old ×ACK avg The goal is to get only one ACK frame for each data packet read. avg When it is less than 2, the CPU resources are sufficient. At this time, you can tentatively increase the frequency of the client sending ACK frames to avoid a decrease in throughput due to a too low ACK frame frequency.
[0104] Further, the creating an ACK_FREQUENCY frame and sending it to the client includes:
[0105] Set the ACK frequency threshold T of the ACK_FREQUENCY frame new ;
[0106] Add the ACK_FREQUENCY frame to the server's send queue.
[0107] Among them, the ACK_FREQUENCY frame contains an Ack-Eliciting Threshold field. By setting the Ack-Eliciting Threshold field to the calculated T above new Notify the client to modify the frequency of sending ACK frames.
[0108] Furthermore, creating the ACK_FREQUENCY frame and sending it to the client also includes setting the sequence number of the ACK_FREQUENCY frame. The sequence number of the ACK_FREQUENCY frame is a monotonically increasing number used to enable the client to ignore expired ACK_FREQUENCY frames. Its calculation method is as follows:
[0109] SN i = SN i-1 + 1
[0110] In the formula, SN i is the sequence number of the currently created ACK_FREQUENCY frame, and SN i is the sequence number of the previous ACK_FREQUENCY frame. When the sequence number of the ACK_FREQUENCY frame received by the client is less than the maximum value of the sequence numbers already received, the ACK_FREQUENCY frame will be ignored.
[0111] Among them, the sequence number of the ACK_FREQUENCY frame sent by the server is incremented by 1 each time. If the sequence number of the ACK_FREQUENCY frame received by the client is less than the maximum value of the sequence numbers already received, the ACK_FREQUENCY frame will be ignored. This can avoid processing expired ACK_FREQUENCY frames that were sent by the server before but arrived late due to network latency and other reasons.
[0112] Figure 6 Shows the throughput comparison between the optimized QUIC protocol of the present invention and various current QUIC implementations. Here, comparison method 1 is the QUIC protocol before optimization; comparison method 2 is the QUIC protocol optimized using the GSO technology; comparison method 3 is the QUIC protocol using the PicoTLS encryption library; comparison method 4 is picoquic, a lightweight QUIC protocol implementation widely used currently; comparison method 5 is the QUIC protocol implementation of Alibaba; comparison method 6 is the QUIC protocol implementation of Microsoft; comparison method 7 is the QUIC protocol implementation of fackbook. In the experiment, the server and the client are connected through a network link with a bandwidth of 10 Gbps, and the throughput of data transmission is limited by CPU resources. It can be seen that the throughput of this method is higher than various current QUIC implementation methods.
[0113] An efficient ACK frame processing device based on the QUIC protocol, characterized by comprising:
[0114] A data receiving module, configured to batch receive QUIC data packets carrying ACK frames from a client, where the QUIC data packets carry ACK frames;
[0115] A data processing module, configured to merge the ACK frames in the QUIC data packets received by the data receiving module, perform normal processing on the merged ACK frames, and calculate the total number of QUIC data packets carrying ACK frames read;
[0116] A calculation module, configured to divide a time window according to the round-trip time of the QUIC data packets, and when a new time window arrives, calculate the average value of the number of ACK frames obtained each time a QUIC data packet is read in the previous time window;
[0117] A notification module, configured to notify the client to update the frequency of sending ACK frames, and create an ACK_FREQUENCY frame to send to the client according to the calculated updated value of the ACK frame frequency.
[0118] A computer device, characterized by comprising at least one processor and a computer-readable medium storing a computer program, where when the computer program is read and run by the processor, the method described in this application is implemented.
[0119] A computer-readable medium, characterized in that the computer-readable medium stores a computer program, and when the computer program is read and run by a processor, the method described in this application is implemented.
[0120] Those of ordinary skill in the art will understand that all or part of the processes of implementing the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in this application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus dynamic random access memory (Rambus DRAM, abbreviated as RDRAM), and interface dynamic random access memory (DRDRAM), etc.
[0121] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Thus, the invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A QUIC-based ACK frame processing method, characterized in that: The following steps are involved: S1. Batch read QUIC data packets from the client, where the QUIC data packets carry ACK frames; S2. Merge the ACK frames carried by the QUIC data packets in S1, perform normal ACK frame processing on the merged ACK frames, and calculate the total number of ACK frames carried by the read QUIC data packets. cnt ; The merging of the ACK frames carried by the QUIC data packets in S1 in S2 includes: merging the ACK frames carried by the QUIC data packets of the same QUIC connection and the same packet number space; The method for determining QUIC data packets in the same QUIC connection and the same packet number space includes: Parse the header information of the QUIC data packet; Determine whether the QUIC connections are the same and determine the data packet type according to the packet header information; Determining whether the packet number spaces are the same according to the packet type of the QUIC packet; The value of the maximum acknowledgment packet number in the merged ACK frame is the maximum value of the maximum acknowledgment packet number of the ACK frame carried by the QUIC data packets in the same QUIC connection and the same packet number space. The specific calculation method is: In the formula, Largest Δ is the maximum acknowledgment packet number of the merged ACK frame, n is the number of ACK frames carried by QUIC data packets in the same QUIC connection and the same packet number space, Largest i is the maximum confirmation packet number of the i-th ACK frame; S3. Divide the time window according to the round-trip time of the QUIC data packet, and when a new time window is reached, calculate the average value ACK of the number of ACK frames obtained by reading the QUIC data packet each time in the previous time window. avg ; S4, notifying the client to update the frequency of sending the ACK frame, according to the ACK avg Calculate the updated ACK frame frequency value T new , create an ACK_FREQUENCY frame and send it to the client; T new The calculation method is as follows: Where, T old is the frequency at which the client sends ACK frames before updating, T new The updated frequency means that the client is notified every time T new After each packet, an ACK frame is sent.
2. The QUIC-based ACK frame processing method according to claim 1, characterized in that: In S1, batch reading of the QUIC data packets includes: The UDP data packets from the client are read in batches from the socket using the recvmmsg() system call; and the QUIC data packets are parsed from the UDP data packets.
3. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The ACK frame carried by the QUIC data packet in S1 in S2 includes: Get the ACK frame carried by the QUIC data packet of the same QUIC connection and the same packet number space; Calculate the maximum acknowledgment packet number in the combined ACK frame; Calculate the confirmation interval in the combined ACK frame.
4. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The confirmation interval in the merged ACK frame is calculated by taking the intersection of all confirmation intervals of the ACK frames carried by all QUIC data packets of the same QUIC connection and the same packet number space, wherein each ACK frame includes at least one confirmation interval.
5. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The total number of ACK frames carried in the QUIC data packet read this time is calculated in S2 cnt The total number of ACK frames carried by QUIC packets for all QUIC connections and packet number spaces.
6. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The method for dividing the time window in S3 is: When a new time window is reached, the total amount of data S transmitted at this time is recorded; When sending a data packet, record the total amount of data P transmitted when sending the data packet; When receiving the confirmation of the data packet, obtain the total amount of data P transmitted when the data packet is sent. If P ≥ S, enter a new time window.
7. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The S3 ACK avg The calculation method is as follows: Where m is the number of times data packets are read in the previous time window. The number of ACK frames carried by the k-th QUIC packet read.
8. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The creating of the ACK_FREQUENCY frame and sending it to the client comprises: Set the ACK frequency threshold T of the ACK_FREQUENCY frame new , according to the ACK frequency threshold T new Creating the ACK_FREQUENCY frame; The ACK_FREQUENCY frame is added to the sending queue.
9. The QUIC-based ACK frame processing method according to claim 1, characterized in that: The step of creating an ACK_FREQUENCY frame and sending it to the client also includes setting a sequence number of the ACK_FREQUENCY frame, which is calculated as follows: SN i =SN i-1 +1 Where, SN i Is the sequence number of the currently created ACK_FREQUENCY frame, SN i-1 It is the sequence number of the previous ACK_FREQUENCY frame; So that the client ignores the current ACK_FREQUENCY frame when the sequence number of the current ACK_FREQUENCY frame received is smaller than the maximum value of the sequence numbers of the received ACK_FREQUENCY frames.
10. A QUIC-based ACK frame processing device, characterized in that: The method according to any one of claims 1 to 9 comprises: A data receiving module, configured to receive in batches QUIC data packets carrying ACK frames from a client, wherein the QUIC data packets carry ACK frames; A data processing module, used to merge the ACK frames in the QUIC data packets received by the data receiving module, perform normal ACK frame processing on the merged ACK frames, and calculate the total number of ACK frames carried in the read QUIC data packets; A calculation module is used to divide the time window according to the round-trip time of the QUIC data packet, and when a new time window is reached, calculate the average number of ACK frames obtained by each reading of the QUIC data packet in the previous time window; The notification module is used to notify the client to update the frequency of sending ACK frames, and create an ACK_FREQUENCY frame based on the value of the updated ACK frame frequency calculated and sent to the client.
11. A computer device, characterized in that: The invention comprises at least one processor and a computer-readable medium storing a computer program, wherein when the computer program is read and executed by the processor, the method according to any one of claims 1 to 9 is implemented.
12. A computer readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is read and executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
QUIC-based data transmission control method, system and equipment
CN114726933A
Video transmission method, electronic equipment and computer storage medium
CN117354559A