Congestion avoidance method, device, data sending device, program product and medium
By statistically analyzing the maximum number of consecutive duplicate acknowledgment requests between the sending and receiving devices, the congestion window value is dynamically adjusted, solving the problem of unreliable congestion windows in existing technologies and achieving more efficient congestion avoidance and data transmission stability.
Patent Information
- Application Number
- CN202410726395.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-06-06
AI Technical Summary
In existing technologies, the data transmitting device fails to effectively consider the actual network conditions between the data transmitting device and the data receiving device during the congestion avoidance phase, resulting in an unreliable congestion window and increasing the probability of fast retransmission.
By statistically analyzing the maximum number of consecutive duplicate acknowledgment requests received between the data sending and receiving devices, the congestion window value is dynamically adjusted to ensure it aligns with network conditions. This includes increasing, maintaining, or decreasing the congestion window value.
It improves the reliability of congestion avoidance, reduces the probability of fast retransmission, and enhances the stability and efficiency of data transmission.
Smart Images

Figure CN118337710B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network technology, and in particular to a congestion avoidance method, apparatus, data transmission device, program product, and medium. Background Technology
[0002] Congestion avoidance is a common operation in the Transmission Control Protocol (TCP) to prevent congestion in network environments. In related technologies, when a data sending device is in the congestion avoidance phase, if it determines that no fast retransmission has occurred in the current transmission round, it increments the congestion window value by 1 after each transmission round. Fast retransmission refers to the retransmission operation performed by the data sending device when severe packet loss occurs between the data sending and receiving devices. The congestion window limits the maximum number of packets that the data sending device can send to the data receiving device in a round-trip time (RTT). The RTT refers to the time from when the data sending device sends a packet to when the data receiving device responds to that packet. However, the above congestion avoidance method does not consider the actual network communication conditions between the data sending and receiving devices, which can easily lead to unreliable congestion windows and thus increase the probability of fast retransmission. Summary of the Invention
[0003] The purpose of this invention is to provide a congestion avoidance method, apparatus, data transmission device, program product, and medium that can dynamically adjust the congestion window value according to the actual network status between the data transmission device and the data receiving device, thereby ensuring that the congestion window value matches the network status and thus improving the reliability of congestion avoidance.
[0004] To address the aforementioned technical problems, this invention provides a congestion avoidance method applied to a data transmission device, the method comprising:
[0005] During the congestion avoidance phase, the data packet transmission for the current transmission round is performed to the data receiving device according to the congestion window value, and the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted.
[0006] When the current transmission round is determined to have ended normally, the congestion window value is increased, maintained, or decreased based on the network status between the data sending device and the data receiving device as represented by the maximum consecutive number.
[0007] The data packet is transmitted to the data receiving device for the next transmission round based on the adjusted congestion window value.
[0008] Optionally, the data packet transmission for the current transmission round is performed to the data receiving device according to the congestion window value, and the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted, including:
[0009] According to the congestion window value, the data receiving device sequentially sends multiple data packets and receives confirmation requests returned by the data receiving device when confirming the receipt of each data packet; wherein, when the data receiving device determines that the data packet received at the current time is not continuous with the data packets received before the current time, it will repeatedly return the confirmation request corresponding to the last continuous data packet received before the current time.
[0010] Determine whether the currently received confirmation request is a duplicate of the previously received confirmation request;
[0011] If so, increment the consecutive quantity by 1; wherein the initial value of the consecutive quantity is 0;
[0012] If not, then the consecutive quantity is cleared to zero;
[0013] When it is determined that the current transmission round has ended normally, the maximum value of the consecutive number is set as the maximum consecutive number.
[0014] Optionally, the congestion window value can be increased, maintained, or decreased based on the network state between the data transmitting device and the data receiving device, as represented by the maximum consecutive number, including:
[0015] When the maximum consecutive number is determined to be zero, the congestion window value is increased;
[0016] When the maximum consecutive number is determined to be one, the congestion window value is maintained;
[0017] When the maximum consecutive number is determined to be two, the congestion window value is reduced.
[0018] Optionally, increasing the congestion window value includes:
[0019] Increment the state hold round value by 1, and accumulate the square of the adjusted state hold round value to the congestion window value; wherein, the initial value of the state hold round value is 0;
[0020] Reducing the congestion window value includes:
[0021] Determine whether the state holding cycle value is zero;
[0022] If so, then the congestion window value is maintained;
[0023] If not, then the state remains unchanged with the round value decremented by one, and the congestion window value is rolled back to the initial value corresponding to the last increase.
[0024] Optionally, before incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value, the method further includes:
[0025] Determine whether the size of the congestion window value has reached the size of the historical congestion window value corresponding to the last time a fast retransmission operation was triggered;
[0026] If so, then the congestion window value is increased by a preset value;
[0027] If not, proceed to the step of incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value.
[0028] Optionally, it also includes:
[0029] When it is determined that the current transmission round triggers fast retransmission, all historical slow start thresholds smaller than the congestion window value are set as slow start thresholds to be evaluated.
[0030] Obtain the average number of normal ending rounds corresponding to each of the slow start thresholds to be evaluated; wherein, the number of normal ending rounds is the number of transmission rounds that the data sending device continuously and normally ends under the condition of the slow start threshold, and the average number of normal ending rounds is the average of the number of all normal ending rounds corresponding to the slow start threshold.
[0031] Set the slow start threshold corresponding to the average number of normal ending rounds to be evaluated as the center value, and set the center value and the congestion window values around the center value as candidate values.
[0032] A new slow start threshold is selected from the candidate values, and the congestion window value is adjusted to the new slow start threshold so that the data packet transmission for the next transmission round is performed to the data receiving device according to the adjusted congestion window value.
[0033] Optionally, a new slow start threshold is selected from the candidate values, including:
[0034] The candidate value corresponding to the minimum average number of normal rounds is set as the new slow start threshold; wherein, if the candidate value does not belong to the historical slow start threshold, the average number of normal rounds of the candidate value is 0.
[0035] Optionally, it also includes:
[0036] When there are multiple candidate values corresponding to the minimum average number of normal rounds, the number of records for the number of normal rounds corresponding to each candidate value is obtained; wherein, if a candidate value does not belong to the historical slow start threshold, the number of records for the candidate value is 0;
[0037] The candidate values corresponding to the average number of minimum normal rounds and the minimum number of records are set as the new slow start threshold.
[0038] Optionally, it also includes:
[0039] When all candidate values correspond to the same average number of normal ending rounds and the same number of records, the new slow start threshold is randomly selected from the candidate values.
[0040] Optionally, it also includes:
[0041] When there are multiple slow start thresholds to be evaluated corresponding to the average number of normal end rounds, obtain the number of records corresponding to the number of normal end rounds for each of the slow start thresholds to be evaluated;
[0042] The slow start threshold to be evaluated, which corresponds to the average number of the maximum number of normal rounds completed and the minimum number of records, is set as the central value.
[0043] Optionally, after selecting a new slow start threshold from the candidate values, the method further includes:
[0044] Determine if the number of records corresponding to the new slow start threshold is greater than the preset number;
[0045] If so, remove the earliest normal end round number corresponding to the previous slow start threshold.
[0046] Optionally, after selecting a new slow start threshold from the candidate values, the method further includes:
[0047] Among all the normal end rounds corresponding to the new slow start threshold, determine whether there are any expired normal end rounds to be removed;
[0048] If they exist, then the number of normally completed rounds to be removed will be removed.
[0049] Optionally, after determining that the current transmission round has ended normally, the method further includes:
[0050] Increment the number of normal rounds corresponding to the current slow start threshold by 1; wherein the initial value of the number of normal rounds is 0.
[0051] Optionally, before incrementing the number of normal ending rounds corresponding to the current slow start threshold by 1, the method further includes:
[0052] Determine whether the number of normally completed rounds corresponding to the current slow start threshold is greater than the preset threshold;
[0053] If so, then the number of normal ending rounds corresponding to the current slow start threshold is not incremented by 1;
[0054] If not, proceed to the step of incrementing the number of normal ending rounds corresponding to the current slow start threshold by 1.
[0055] Optionally, determining that the current transmission round triggers fast retransmission includes:
[0056] When the maximum number of consecutive transmissions corresponding to the current transmission round reaches a preset threshold, the current transmission round is determined to trigger fast retransmission.
[0057] The present invention also provides a congestion avoidance device applied to a data transmission device, the device comprising:
[0058] The statistics module is used to perform data packet transmission for the current transmission round to the data receiving device according to the congestion window value when the congestion avoidance phase is in progress, and to count the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round.
[0059] An adjustment module is used to, upon determining that the current transmission round has ended normally, increase, maintain, or decrease the congestion window value based on the network status between the data sending device and the data receiving device as represented by the maximum consecutive number.
[0060] The loop control module is used to perform the next transmission round of data packet transmission to the data receiving device according to the adjusted congestion window value.
[0061] The present invention also provides a data transmission device, comprising:
[0062] Memory, used to store computer programs;
[0063] A processor for implementing the congestion avoidance method as described above when executing the computer program.
[0064] Optionally, the data transmission device is a smart network interface card (NIC).
[0065] The present invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the congestion avoidance method described above.
[0066] The present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the congestion avoidance method described above.
[0067] This invention provides a congestion avoidance method applied to a data transmitting device. The method includes: during a congestion avoidance phase, transmitting data packets for the current transmission round to a data receiving device according to a congestion window value, and counting the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round; upon determining that the current transmission round has ended normally, increasing, maintaining, or decreasing the congestion window value based on the network state between the data transmitting device and the data receiving device as represented by the maximum consecutive number; and transmitting data packets for the next transmission round to the data receiving device according to the adjusted congestion window value.
[0068] The beneficial effects of this invention are as follows: When the data transmitting device is in the congestion avoidance phase, it can transmit data packets for the current transmission round to the data receiving device according to the congestion window value, and can count the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round. Subsequently, upon determining that the current transmission round has ended normally, the data transmitting device can increase, maintain, or decrease the congestion window value according to the network state between the data transmitting device and the data receiving device represented by the maximum consecutive number, and can transmit data packets for the next transmission round to the data receiving device according to the adjusted congestion window value. That is, it can determine the actual network state between the data transmitting device and the data receiving device based on the maximum consecutive number, and dynamically adjust the congestion window value in each transmission round according to the network state, thereby ensuring that the congestion window value matches the network state, thus improving the reliability of congestion avoidance and reducing the probability of fast retransmission. This invention also provides a congestion avoidance device, electronic device, computer program product, and computer-readable storage medium, which have the above-mentioned beneficial effects. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0070] Figure 1 A flowchart of a congestion avoidance method provided in an embodiment of the present invention;
[0071] Figure 2 This is a schematic diagram of a fast retransmission mechanism provided in an embodiment of the present invention;
[0072] Figure 3 This is a structural block diagram of a congestion avoidance device provided in an embodiment of the present invention;
[0073] Figure 4 This is a structural block diagram of a data transmission device provided in an embodiment of the present invention;
[0074] Figure 5 This is a schematic diagram illustrating an implementation method of a smart network interface card (NIC) provided in an embodiment of the present invention. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, 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.
[0076] Congestion avoidance is a common operation in the Transmission Control Protocol (TCP) used to prevent congestion in network environments. In related technologies, when a data transmitting device is in the congestion avoidance phase, if it determines that no fast retransmission has occurred in the current transmission round, it increments the congestion window value by 1 after each transmission round. Fast retransmission refers to the retransmission operation performed by the data transmitting device on lost data packets when severe packet loss occurs between the data transmitting and data receiving devices. The congestion window limits the maximum number of data packets that the data transmitting device can send to the data receiving device in a round-trip time (RTT). The RTT refers to the time from when the data transmitting device sends a data packet to when the data receiving device responds to that packet. However, the above congestion avoidance method does not consider the actual network communication conditions between the data transmitting and data receiving devices, which can easily lead to unreliable congestion windows and thus increase the probability of fast retransmission. In view of this, the present invention provides a congestion avoidance method that can dynamically adjust the congestion window value according to the actual network state between the data sending device and the data receiving device, thereby ensuring that the congestion window value matches the network state and thus improving the reliability of congestion avoidance.
[0077] It should be noted that the embodiments of the present invention do not limit the type of hardware device executing this method. For example, it can be executed by a host (such as a personal computer, server, mobile device, etc.) or by a dedicated network device (such as a smart network card), and can be set according to actual application requirements. When this method is executed by a smart network card, it is understood that the network card should contain a processing unit of type FPGA (Field Programmable Gate Array) for specifically executing the steps of this method. It is worth pointing out that when this method is executed by a smart network card, the execution subject of the congestion avoidance step can be transferred from the host CPU to the smart network card, thereby reducing the load on the host CPU and improving the overall operating efficiency of the host.
[0078] Please refer to Figure 1 , Figure 1 A flowchart of a congestion avoidance method provided in an embodiment of the present invention, the method being applied to a data transmission device, may include:
[0079] S101. During the congestion avoidance phase, the data packet transmission for the current transmission round is performed to the data receiving device according to the congestion window value, and the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted.
[0080] In this embodiment of the invention, when the data sending device is in the congestion avoidance phase, in addition to transmitting data packets for the current transmission round to the data receiving device according to the congestion window value (cwnd), it will also additionally count the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round. To facilitate understanding of the principle behind this step, this embodiment of the invention will next provide a brief introduction to the duplicate acknowledgment mechanism and fast retransmission mechanism of the TCP protocol.
[0081] When a data transmitting device performs data packet transmission in each round, it typically sends multiple data packets marked with a specific order. The data receiving device, when receiving these data packets, also receives them sequentially according to this order information. However, fluctuations in the network environment between the data transmitting and receiving devices can cause transmission delays or loss of data packets sent from the transmitting device to the receiving device, thus preventing the receiving device from receiving the data packets sequentially. In this case, when the receiving device determines that the currently received data packet is not consecutive to the last received consecutive data packet, it will repeatedly send an acknowledgment request corresponding to the last consecutive data packet to the transmitting device. This acknowledgment request is sent to the transmitting device every time a non-consecutive data packet is received.
[0082] For easier understanding, please refer to Figure 2 , Figure 2 This diagram illustrates a fast retransmission mechanism provided by an embodiment of the present invention. In this diagram, the sender needs to sequentially send data segments 1 to 6 (i.e., M1 to M6, where each segment is equivalent to a data packet) to the receiver. First, the sender can send data segment 1; after receiving data segment 1, the receiver can return an acknowledgment for data segment 1 to the sender. Since message transmission between the sender and receiver can be performed asynchronously, the sender can also send data segment 2 within the sending window before receiving the acknowledgment for data segment 1; and after receiving data segment 2, the receiver can return an acknowledgment for data segment 2 to the sender. Similarly, before receiving the acknowledgment for data segment 2, the sender can also send data segment 3 within the sending window. At this point, assuming that data segment 3 is lost due to network fluctuations, the receiver will not send an acknowledgment for data segment 3 to the sender. Before receiving the acknowledgment message for data segment 3, the sender can continue sending data segment 4 within its sending window. Upon receiving data segment 4, the receiver discovers it is not an out-of-order segment and therefore resends a duplicate acknowledgment for data segment 2 (because data segment 2 is the last consecutive data segment), indicating that it expected to receive data segment 3. However, it does not receive data segment 3, but instead receives the out-of-order segment (i.e., data segment 4). The sender can still continue sending data segment 5 within its sending window. Upon receiving data segment 5, the receiver again discovers it is not an out-of-order segment and resends a duplicate acknowledgment for data segment 2, indicating that it expected to receive data segment 3. However, it does not receive data segment 3, but instead receives the out-of-order segment. At this point, the sender can still send the last data segment in its sending window, data segment 6. After receiving data segment 6, the receiver finds that it is still not an out-of-order segment. Therefore, it continues to send duplicate acknowledgments to the sender for data segment 2, indicating that it expects to receive data segment 3. However, it does not receive data segment 3, but instead receives out-of-order segments. At this point, since the sender has received three consecutive duplicate acknowledgments for data segment 2, it immediately retransmits data segment 3. When the receiver receives data segment 3, it sends an acknowledgment back to the sender for data segment 6, indicating that segments with sequence numbers 3 to 6 have been received. This prevents the sender from encountering a retransmission timeout (RTO) for data segment 3, and instead receives the retransmission early.
[0083] The above describes how data receiving and sending devices handle packet loss. However, in reality, packets may not be lost, but only experience transmission delays, and fast retransmission may not be triggered. For example, if the receiver receives data segment 3 after receiving data segment 4 and before receiving data segment 5, it will only return one duplicate acknowledgment request for data segment 2 to the sender; if the receiver receives data segment 3 after receiving data segment 5 and before receiving data segment 6, it will only return two duplicate acknowledgment requests for data segment 2 to the sender. In both cases, although the sender receives duplicate acknowledgment requests from the receiver, the number of duplicate acknowledgment requests has not accumulated to a certain level, so the sender will not trigger fast retransmission. In related technologies, if the sender confirms that fast retransmission has not occurred in this transmission round, it will expand the congestion window. Even a small number of duplicate acknowledgment requests can indicate network fluctuations between the data sending and receiving devices. Although no data packet loss occurred in the current transmission round, there is a high probability of subsequent data packet loss, making the expansion of the congestion window unreliable. Therefore, this embodiment of the invention will count the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in each transmission round, and determine the network condition between the data sending and receiving devices based on this maximum number of consecutive requests. This will determine whether and how to adjust the congestion window.
[0084] Understandably, during the process of receiving acknowledgment requests, the data sending device can increment the consecutive count of acknowledgment requests by 1 if it determines that the current acknowledgment request is a duplicate of the previously received acknowledgment request; if it determines that the current acknowledgment request is not a duplicate of the previously received acknowledgment request, it can reset the consecutive count to zero. Therefore, when completing the transmission of data packets in the current transmission round, the data sending device only needs to set the maximum consecutive count to the maximum consecutive count.
[0085] Based on this, the data packet transmission for the current transmission round is performed to the data receiving device according to the congestion window value, and the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted, which may include:
[0086] Step 11: Send multiple data packets sequentially to the data receiving device according to the congestion window value, and receive the confirmation request returned by the data receiving device when confirming the receipt of each data packet; wherein, when the data receiving device determines that the data packet received at the current time is not continuous with the data packets received before the current time, it will repeatedly return the confirmation request corresponding to the last continuous data packet received before the current time.
[0087] Step 12: Determine whether the currently received confirmation request is a duplicate of the previously received confirmation request; if yes, proceed to step 13; if no, proceed to step 14.
[0088] Step 13: Increment the consecutive counts by 1; where the initial value of the consecutive counts is 0;
[0089] Step 14: Clear consecutive quantities to zero;
[0090] Step 15: When the current transmission round is determined to have ended normally, set the maximum number of consecutive numbers to the maximum number of consecutive numbers.
[0091] It should be noted that the embodiments of the present invention do not limit how many data packets will be transmitted in each transmission round, nor do they limit how data packets are sent according to the congestion window value. For reference, please refer to the relevant technologies of the TCP protocol.
[0092] S102. When it is determined that the current transmission round has ended normally, the congestion window value is increased, maintained, or decreased according to the network status between the data sending device and the data receiving device represented by the maximum number of consecutive transmissions.
[0093] As described above, the data transmitting device only triggers fast retransmission when it determines that the cumulative number of duplicate acknowledgment requests for the same data packet has reached a specified number; otherwise, fast retransmission is not triggered. Therefore, this embodiment of the invention uses a range of duplicate acknowledgment request counts from 0 to a specified number (excluding the specified number) to evaluate the network condition between the data receiving device and the data transmitting device, thereby determining how to adjust the congestion window value. Specifically, when it is determined that the current transmission round has ended normally (i.e., no fast retransmission has occurred), the data transmitting device can increase, maintain, or decrease the congestion window value based on the network condition between the data transmitting device and the data receiving device represented by the maximum consecutive number. For example, when the network condition is determined to be good, the congestion window value can be increased; when the network condition is determined to be average, the congestion window value can be maintained; and when the network condition is determined to be poor, the congestion window value can be decreased. To differentiate between different network conditions, the range from 0 to a specified number (excluding the specified number) can be divided into three sub-intervals. The sub-interval with the smallest value (i.e., the first sub-interval) corresponds to a better network condition, the sub-interval with a middle value (i.e., the second sub-interval) corresponds to a normal network condition, and the sub-interval with the largest value (i.e., the third sub-interval) corresponds to a worse network condition. Therefore, by simply determining the sub-interval containing the largest consecutive number, the corresponding network condition and congestion window adjustment method can be identified.
[0094] However, considering that the existing TCP protocol triggers fast retransmission when the cumulative number of duplicate acknowledgment requests for the same data packet reaches 3, this invention can set the number of duplicate acknowledgment requests (0, 1, 2) to correspond to a better network condition, a normal network condition, and a worse network condition, respectively. In other words, 0 corresponds to the first sub-interval mentioned above, 1 corresponds to the second sub-interval mentioned above, and 2 corresponds to the third sub-interval mentioned above. Furthermore, when the maximum consecutive number is determined to be zero, the congestion window value can be increased; when the maximum consecutive number is determined to be one, the congestion window value can be maintained; and when the maximum consecutive number is determined to be two, the congestion window value can be decreased.
[0095] Based on this, adjusting the congestion window value according to the network state between the data transmitting and receiving devices, as represented by the maximum consecutive number, can include:
[0096] Step 21: When the maximum consecutive number is determined to be zero, increase the congestion window size;
[0097] Step 22: When the maximum consecutive number is determined to be one, maintain the congestion window value;
[0098] Step 23: When the maximum consecutive number is determined to be two, the congestion window value is reduced.
[0099] It should be noted that the embodiments of the present invention do not limit how the congestion window value is increased; for example, it can be increased linearly or non-linearly. Considering that after a fast retransmission occurs, the congestion window value will be adjusted from its initial value before the fast retransmission to a smaller value than that initial value, and this smaller value will easily affect the data transmission rate between devices, it is of great significance to quickly restore the congestion window value to its initial value at the time of the last fast retransmission for quickly restoring high-speed transmission between the data sending device and the data receiving device. Therefore, in the embodiments of the present invention, the increase of the congestion window value can be non-linear.
[0100] Furthermore, the embodiments of the present invention do not limit how the congestion window value is increased non-linearly, and any non-linear method can be used. Preferably, to ensure that the increase of the congestion window value is correlated with the network condition, the embodiments of the present invention can set a state maintenance round and accumulate the square of the state maintenance round to the congestion window value to increase the congestion window value non-linearly. The state maintenance round represents the number of transmission rounds in which the network condition is maintained in a good state (i.e., the maximum consecutive number is zero). Its initial value is 0, and the initial value is set when the fast retransmission ends. The accumulation method of the state maintenance round is to accumulate 1 as soon as the maximum consecutive number corresponding to a transmission round is determined to be 0.
[0101] It should be noted that the embodiments of the present invention do not limit how the congestion window value is reduced; for example, it can be reduced linearly or non-linearly. Furthermore, the method of reducing the congestion window value can be the same as or different from the method of increasing it, and can be set according to actual application requirements. Considering that the purpose of reducing the congestion window value is to avoid fast retransmission, and that a greater avoidance force can significantly reduce the probability of fast retransmission, the reduction of the congestion window value in the present invention can also be non-linear.
[0102] Furthermore, this embodiment of the invention does not limit how the congestion window value is non-linearly reduced; any non-linear method can be used. Preferably, to ensure that the reduction of the congestion window value is relevant to the network condition, this embodiment of the invention can revert the congestion window value to the initial value corresponding to the last increase, and decrease the state maintenance round by one. For example, the initial congestion window value before the last increase was 12, the state maintenance round after the last increase was 2, and the initial congestion window value after the last increase was 16 (12+2). 2 If the initial value of the congestion window before this reduction is 16, the state maintenance round after this reduction is 1, and the congestion window value after this reduction is 12.
[0103] Furthermore, it should be noted that if the state holding round value is equal to 0 during the process of reducing the congestion window, it means that the congestion window has reverted to the smaller value corresponding to the congestion window after the last fast retransmission. In this case, other mechanisms need to be used to adjust the congestion window, so it is not necessary to reduce the congestion window.
[0104] Based on this, increasing the congestion window size can include:
[0105] Step 31: Increment the state hold round value by 1, and accumulate the square of the adjusted state hold round value to the congestion window value; wherein, the initial value of the state hold round value is 0;
[0106] Based on this, reducing the congestion window size can include:
[0107] Step 41: Determine if the state hold cycle value is zero; if yes, proceed to step 42; if no, proceed to step 43.
[0108] Step 42: Maintain the congestion window value;
[0109] Step 43: Decrement the state holding round value by one and roll back the congestion window value to the starting value corresponding to the last increase.
[0110] Furthermore, the increase in the congestion window size can be done in stages. The first stage uses a non-linear increase, and the second stage uses a linear increase, with the historical congestion window size corresponding to the last trigger of the fast retransmission operation serving as the dividing line between the two stages. This is because the probability of fast retransmission is low before the congestion window recovers to the historical congestion window size corresponding to the last trigger of the fast retransmission operation. At this time, it is necessary to quickly restore the congestion window to reduce the impact on the transmission rate. However, after the congestion window recovers to the historical congestion window size corresponding to the last trigger of the fast retransmission operation, the probability of fast retransmission is still relatively low. Continuing to increase the congestion window by a large scale can easily lead to fast retransmission. Therefore, it is necessary to control the increase of the congestion window linearly to avoid fast retransmission.
[0111] Based on this, before incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value, the following may also be included:
[0112] Step 51: Determine whether the size of the congestion window has reached the historical congestion window size corresponding to the last time the fast retransmission operation was triggered; if yes, proceed to step 52; if no, proceed to step 53.
[0113] Step 52: Increase the congestion window value by a preset value;
[0114] Step 53: Proceed to the step of incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value.
[0115] It should be noted that the embodiments of the present invention do not limit the specific value of the preset value, and can be set according to actual application needs, for example, it can be 1.
[0116] S103. Based on the adjusted congestion window value, perform the next transmission round of data packet transmission to the data receiving device.
[0117] As can be seen, since the next transmission round can be based on the adjusted congestion window value, the embodiments of the present invention can analyze the network status at the end of each transmission round and adjust the congestion window value according to the analysis results to ensure that the congestion window value adapts well to changes in network status. This not only improves the reliability of congestion avoidance but also reduces the probability of fast retransmission, thereby effectively ensuring the data transmission quality between the data sending device and the data receiving device.
[0118] Based on the above embodiments, when the data transmitting device in the congestion avoidance phase is in progress, it can transmit data packets for the current transmission round to the data receiving device according to the congestion window value, and can count the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round. Subsequently, upon determining that the current transmission round has ended normally, the data transmitting device can increase, maintain, or decrease the congestion window value according to the network state between the data transmitting device and the data receiving device as represented by the maximum consecutive number, and can transmit data packets for the next transmission round to the data receiving device according to the adjusted congestion window value. That is, it can determine the actual network state between the data transmitting device and the data receiving device based on the maximum consecutive number, and dynamically adjust the congestion window value in each transmission round according to the network state, thereby ensuring that the congestion window value matches the network state, thus improving the reliability of congestion avoidance and reducing the probability of fast retransmission.
[0119] Based on the above embodiments, as described above, when fast retransmission occurs, the congestion window value usually needs to be adjusted to a smaller value so that congestion avoidance can restart from that smaller value. This smaller value is also known as the slow start threshold (ssthresh) in the TCP protocol, meaning the slow start threshold is the initial value of the congestion window at the start of the congestion avoidance phase. In related technologies, when fast retransmission occurs, the current congestion window is usually directly divided by 2 to obtain a new slow start threshold. However, this method of determining the slow start threshold is rather simple and crude, and cannot achieve a slow start threshold with better recovery effects. Therefore, embodiments of the present invention can further improve the method of determining the slow start threshold to enhance its effectiveness and improve the recovery effect of the congestion avoidance phase. Based on this, the method may further include:
[0120] S201. When it is determined that fast retransmission is triggered in the current transmission round, all historical slow start thresholds smaller than the congestion window value are set as slow start thresholds to be evaluated.
[0121] In this embodiment of the invention, when fast retransmission is triggered in the current transmission round, the data sending device can set all historical slow start thresholds smaller than the current congestion window value as the slow start threshold to be evaluated. These historical slow start thresholds are slow start thresholds previously used by the data sending device. Since the slow start thresholds have initial values, and in this embodiment of the invention, the data sending device may select multiple slow start thresholds, the number of historical slow start thresholds can be one or more. This embodiment of the invention will use these historical slow start thresholds as a starting point to select a new slow start threshold. For example, when fast retransmission is triggered, if the current congestion window is 14, and the historical slow start thresholds are 12 and 16, then the slow start threshold to be evaluated can be 12.
[0122] As mentioned above, fast retransmission typically occurs when the maximum consecutive number of duplicate acknowledgment requests accumulated for the same data packet in the current transmission round reaches a specified value.
[0123] Based on this, determining the current transmission round to trigger fast retransmission can include:
[0124] Step 61: When it is determined that the maximum number of consecutive transmissions corresponding to the current transmission round reaches a preset threshold, the current transmission round is determined to trigger fast retransmission.
[0125] It should be noted that the embodiments of the present invention do not limit the specific value of the preset threshold; for example, it can generally be 3.
[0126] S202. Obtain the average number of normal ending rounds corresponding to each slow start threshold to be evaluated; wherein, the number of normal ending rounds is the number of transmission rounds that the data sending device continuously and normally ends under the condition of the slow start threshold, and the average number of normal ending rounds is the average of the number of all normal ending rounds corresponding to the slow start threshold.
[0127] After determining the slow start threshold to be evaluated, this embodiment of the invention also needs to obtain the average number of normal completion rounds corresponding to each slow start threshold. The number of normal completion rounds is the number of consecutive normal completion rounds that the data transmitting device can complete under the slow start threshold conditions. For example, if the data transmitting device can complete 15 consecutive normal completion rounds with a slow start threshold of 12, then the number of normal completion rounds corresponding to slow start threshold 12 is 15 rounds. Each slow start threshold can correspond to one or more records of the number of normal completion rounds; for example, the record of the number of normal completion rounds corresponding to slow start threshold 12 can be 15 rounds, 13 rounds, 17 rounds, etc. The average number of normal completion rounds is the average of all normal completion rounds corresponding to the slow start threshold. For example, the average number of normal completion rounds for slow start threshold 12 can be (15+13+17) / 3=15 rounds. Therefore, the number of normal completion rounds and the average number of normal completion rounds characterize the historical performance of data transmission between the data transmitting device and the data receiving device under various slow start threshold conditions. Therefore, based on the average number of rounds that end normally, the embodiments of the present invention are more likely to select a more suitable new slow start threshold.
[0128] Understandably, the record of the number of rounds that end normally occurs when each transmission round ends normally. That is, for each transmission round completed, the number of rounds that end normally corresponding to the current slow start threshold is incremented by 1.
[0129] Based on this, after confirming that the current transmission round has ended normally, it may also include:
[0130] Step 71: Increment the number of normal rounds corresponding to the current slow start threshold by 1; where the initial value of the number of normal rounds is 0.
[0131] Furthermore, since the number of normal ending rounds corresponding to a certain slow start threshold may be very large, and an excessively large number of normal ending rounds does not significantly contribute to the reliability of evaluating the slow start threshold and is likely to waste computing resources, once it is determined that the number of normal ending rounds corresponding to the current slow start threshold is greater than the preset threshold, the number of normal ending rounds of that threshold may not be accumulated.
[0132] Based on this, before incrementing the number of normal completion rounds corresponding to the current slow start threshold by 1, it may also include:
[0133] Step 81: Determine whether the number of normal ending rounds corresponding to the current slow start threshold is greater than the preset threshold; if yes, proceed to step 82; if no, proceed to step 83.
[0134] Step 82: Do not increment the number of normal completion rounds corresponding to the current slow start threshold by 1;
[0135] Step 83: Proceed to the step of incrementing the number of normal ending rounds corresponding to the current slow start threshold by 1.
[0136] S203. Set the slow start threshold to be evaluated, which corresponds to the average number of normal ending rounds, as the center value, and set the center value and the number of congestion window values around the center value as candidate values.
[0137] In this step, the slow-start threshold corresponding to the average number of maximum normal rounds is not directly used as the new slow-start threshold. Instead, this slow-start threshold is used as the center value, and the center value and a preset number of congestion window values around it are used as candidate values. The final new slow-start threshold is then selected from these candidate values. For example, if the slow-start threshold corresponding to the average number of maximum normal rounds is 14, then it and the values 1 above and below it (i.e., 13 and 15) can all be used as candidate values. This not only avoids selecting a new slow-start threshold from only a few historical slow-start thresholds and expands the selection coverage of slow-start thresholds, ensuring that more congestion window values can be used as slow-start thresholds and recorded in historical data, but also further increases the probability of selecting a better slow-start threshold, thereby improving the reliability of the slow-start threshold. In other words, the center value is used to determine the central position of the optimal slow-start threshold, and the candidate values are used to determine the numerical range of the optimal slow-start threshold. Within this numerical range, at least a suboptimal slow-start threshold can be selected, and the optimal slow-start threshold is more likely to be selected.
[0138] It should be noted that the embodiments of the present invention do not limit the specific value of the above-mentioned preset quantity, and can be set according to actual application needs, for example, it can be 1.
[0139] Furthermore, when selecting the center value, there may be multiple slow start thresholds with the largest average number of normal ending rounds. In this case, to increase the number of times the slow start threshold with fewer records is evaluated, and thus accumulate more historical records, the slow start threshold with the largest average number of normal ending rounds and the smallest number of records can be set as the center value.
[0140] Based on this, the method may also include:
[0141] Step 91: When there are multiple slow start thresholds to be evaluated corresponding to the average number of normal end rounds, obtain the number of records of the number of normal end rounds corresponding to each slow start threshold to be evaluated.
[0142] Step 92: Set the slow start threshold to be evaluated, which corresponds to the average number of maximum normal rounds and the minimum number of records, as the center value.
[0143] S204. Select a new slow start threshold from the candidate values, adjust the congestion window value to the new slow start threshold, and perform the next transmission round of data packet transmission to the data receiving device according to the adjusted congestion window value.
[0144] It should be noted that the embodiments of the present invention do not limit how to select a new slow-start threshold from multiple candidate values. To avoid always selecting the slow-start threshold with the best historical performance, which could affect the participation of other slow-start thresholds, the embodiments of the present invention may prioritize selecting the value with the worst historical performance (such as the lowest average number of rounds ending normally or the lowest number of records of rounds ending normally) from the candidate values as the new slow-start threshold. As mentioned above, at least a suboptimal slow-start threshold can be selected from the range formed by the candidate values. Therefore, selecting a value with the worst historical performance as the new slow-start threshold will not reduce the reliability of the slow-start threshold. When each candidate value has accumulated a certain amount of historical data (i.e., the number of rounds ending normally), the performance of each candidate value will converge. At this time, selecting any candidate value as the new slow-start threshold is reliable, thereby ensuring the reliability of the slow-start threshold selection.
[0145] Specifically, when selecting a new slow start threshold from the candidate values, the candidate value corresponding to the minimum average number of rounds that end normally can be set as the new slow start threshold to increase the performance chance of the candidate value, thereby supplementing its average number of rounds that end normally as much as possible and improving the accuracy of the evaluation.
[0146] Based on this, selecting a new slow start threshold from the candidate values can include:
[0147] Step 1001: Set the candidate value corresponding to the minimum average number of normal end rounds as the new slow start threshold; wherein, if the candidate value does not belong to the historical slow start threshold, the average number of normal end rounds of the candidate value is 0.
[0148] Subsequently, if there are multiple candidate values corresponding to the minimum average number of normal rounds ending, the candidate value with the minimum average number of normal rounds ending and the fewest records can be set as the new slow start threshold to increase the number of times that candidate value is displayed, thereby improving the evaluation accuracy.
[0149] Based on this, the method may also include:
[0150] Step 1101: When there are multiple candidate values corresponding to the minimum average number of normal ending rounds, obtain the number of records of the number of normal ending rounds corresponding to each candidate value; where, if a candidate value does not belong to the historical slow start threshold, the number of records of the candidate value is 0.
[0151] Step 1101: Set the candidate value of the minimum average number of normal rounds and the minimum number of records as the new slow start threshold.
[0152] Finally, if all candidate values correspond to the same average number of normal ending rounds and the same number of records, then all of these candidate values perform well. Therefore, a new slow start threshold can be randomly selected from these candidate values.
[0153] Based on this, the method may also include:
[0154] Step 1201: When all candidate values correspond to the same average number of normal ending rounds and the same number of records, randomly select a new slow start threshold from the candidate values.
[0155] Furthermore, after selecting the new slow start threshold, a new record for the number of normal completion rounds is added. At this point, the new slow start threshold may already have an excessive number of records for the number of normal completion rounds, or the records for the number of normal completion rounds of the new slow start threshold may contain premature or unreliable records. Therefore, after selecting the new slow start threshold, it is also necessary to determine whether to remove records for the number of normal completion rounds of the new slow start threshold. Specifically, it can be determined whether the number of records corresponding to the new slow start threshold is greater than a preset number. If it is, the earliest record for the number of normal completion rounds corresponding to the new slow start threshold can be removed to avoid excessive records consuming excessive storage resources.
[0156] Based on this, after selecting a new slow start threshold from the candidate values, it can also include:
[0157] Step 1301: Determine if the number of records corresponding to the new slow start threshold is greater than the preset number; if yes, proceed to step 1302; otherwise, ignore.
[0158] Step 1302: Remove the earliest number of normal rounds corresponding to the new slow start threshold.
[0159] In addition, it is possible to determine whether there are any expired normal ending rounds to be removed among all the normal ending rounds corresponding to the new slow start threshold. If so, the normal ending rounds to be removed can be removed to promptly clear expired and unreliable records.
[0160] Based on this, after selecting a new slow start threshold from the candidate values, it can also include:
[0161] Step 1401: Among all the normal end rounds corresponding to the new slow start threshold, determine whether there are any expired normal end rounds to be removed; if so, proceed to step 1302; if not, ignore.
[0162] Step 1402: Remove the number of rounds that have ended normally.
[0163] It should be noted that the embodiments of the present invention do not limit the specific value of the preset number of records (for example, it can be 100 records), nor do they limit the period used to determine whether a record has expired (for example, it can be one month), and can be set according to actual application needs.
[0164] Based on the above embodiments, the congestion avoidance method described above will be fully introduced below with specific examples. This invention consists of two parts: a slow start threshold determination part and a congestion avoidance part.
[0165] The logic for determining the slow start threshold is as follows:
[0166] 1. Check if the conditions for fast retransmission have been met. If so, proceed to step 2; otherwise, proceed to step 3.
[0167] 2. Determine the current congestion window value (e.g., 24), and use historical slow start thresholds smaller than the current congestion window as the slow start thresholds to be analyzed (search within the range of 1-23). Determine the average number of normal completion rounds corresponding to each slow start threshold to be analyzed (average normal operation value of each record). Determine the slow start threshold to be analyzed corresponding to the highest average value (if multiple values are the same, select the one with the fewest records; if both of the above two values are the same, select the maximum value) (e.g., 14), and the values corresponding to the differences of 1 above and below it (13, 15) as candidate values. Compare the average normal operation value and the number of records of the three, and select the final new slow start threshold as follows:
[0168] a) Select the candidate value corresponding to the minimum average value of rounds that end normally.
[0169] b) If the average number of rounds ending normally is the same, select the candidate value with the fewest records.
[0170] c) If both of the above values are the same, then randomly select any one of the three values.
[0171] After determining the new slow start threshold in the above manner, if the number of times the record is up-to-date exceeds the limit (e.g., 100), the earliest record data is discarded.
[0172] 3. Update the number of normal completion rounds corresponding to the slow start threshold selected during the last fast retransmission (increase by 1 round). If the maximum value is exceeded (e.g., 1000), stop accumulating.
[0173] After the slow start threshold is determined, the congestion avoidance phase begins (the congestion window cwnd is gradually restored to its size at the time of the last retransmission). Traditional methods involve gradually increasing the cwnd (by 1 in each step). This proposal suggests a novel congestion avoidance method, including the following logic:
[0174] 1. If no duplicate acknowledgment requests are received for any packets, cwnd is incremented by x for each round in which this state is maintained. 2 (x is the number of rounds to maintain state 1) until it recovers to (or exceeds) the congestion window value at the time of the last retransmission.
[0175] 2. If a duplicate acknowledgment request is received for any packet, stop increasing cwnd until either condition 1 or 2 occurs, while keeping x unchanged.
[0176] 3. If two duplicate acknowledgment requests are received for any packet (they do not need to be duplicate acknowledgment requests for the same packet), for each step held in this state, roll back the last increment (x) in state 1. 2 Meanwhile, x is decremented by one for each round. This continues until the congestion avoidance starting state is restored (x=0).
[0177] The congestion avoidance device, data transmission device, computer program product, and computer-readable storage medium provided in the embodiments of the present invention will be described below. The congestion avoidance device, data transmission device, computer program product, and computer-readable storage medium described below can be referred to in correspondence with the congestion avoidance method described above.
[0178] Please refer to Figure 3 , Figure 3 This is a structural block diagram of a congestion avoidance device provided in an embodiment of the present invention. The device is applied to a data transmission equipment and may include:
[0179] The statistics module 301 is used to perform data packet transmission for the current transmission round to the data receiving device according to the congestion window value when the congestion avoidance phase is in progress, and to count the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round.
[0180] The adjustment module 302 is used to increase, maintain, or decrease the congestion window value based on the network status between the data sending device and the data receiving device, as represented by the maximum number of consecutive data transmissions, when it is determined that the current transmission round has ended normally.
[0181] The loop control module 303 is used to perform the next transmission round of data packet transmission to the data receiving device according to the adjusted congestion window value.
[0182] Optionally, the statistics module 301 may include:
[0183] The transmission submodule is used to sequentially send multiple data packets to the data receiving device according to the congestion window value, and to receive the acknowledgment request returned by the data receiving device when confirming the receipt of each data packet; wherein, when the data receiving device determines that the data packet received at the current moment is not continuous with the data packets received before the current moment, it will repeatedly return the acknowledgment request corresponding to the last continuous data packet received before the current moment.
[0184] The counting submodule is used to determine whether the currently received confirmation request is a duplicate of the previously received confirmation request; if so, the consecutive count is incremented by 1; where the initial value of the consecutive count is 0; if not, the consecutive count is cleared to zero.
[0185] The configuration submodule is used to set the maximum consecutive number to the maximum consecutive number when the current transmission round is determined to have ended normally.
[0186] Optionally, the adjustment module 302 may include:
[0187] The enlargement submodule is used to increase the congestion window value when the maximum consecutive number is determined to be zero;
[0188] The hold submodule is used to hold the congestion window value when the maximum number of consecutive elements is determined to be one.
[0189] The decrease submodule is used to decrease the congestion window value when the maximum consecutive number is determined to be two.
[0190] Optionally, increasing the size of the submodule may include:
[0191] An increment unit is used to increment the state hold round value by 1 and accumulate the square of the adjusted state hold round value to the congestion window value; wherein the initial value of the state hold round value is 0;
[0192] The reduction submodule may include:
[0193] The decrement unit is used to determine whether the state hold round value is zero; if so, the congestion window value is maintained; if not, the state hold round value is decremented by one, and the congestion window value is rolled back to the initial value corresponding to the last increase.
[0194] Optionally, increasing the size of the submodule may also include:
[0195] The judgment unit is used to determine whether the size of the congestion window value has reached the size of the historical congestion window value corresponding to the last time the fast retransmission operation was triggered; if so, the congestion window value is increased by a preset value.
[0196] If not, the increment unit is called to enter the steps of incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value.
[0197] Optionally, the device may further include:
[0198] The threshold adjustment triggering module is used to set all historical slow start thresholds smaller than the congestion window value as the slow start threshold to be evaluated when fast retransmission is triggered in the current transmission round.
[0199] The acquisition module is used to acquire the average number of normal ending rounds corresponding to each slow start threshold to be evaluated; wherein, the number of normal ending rounds is the number of consecutive normal ending transmission rounds that the data sending device has completed under the condition of the slow start threshold, and the average number of normal ending rounds is the average of the number of all normal ending rounds corresponding to the slow start threshold.
[0200] The candidate value setting module is used to set the slow start threshold to be evaluated, which corresponds to the average number of normal ending rounds, as the center value, and set the center value and the congestion window values around the center value as candidate values.
[0201] The threshold adjustment module is used to select a new slow start threshold from the candidate values, adjust the congestion window value to the new slow start threshold, and then perform the next transmission round of data packet transmission to the data receiving device according to the adjusted congestion window value.
[0202] Optionally, the threshold adjustment module may include:
[0203] The first adjustment submodule is used to set the candidate value corresponding to the minimum average number of normal end rounds as the new slow start threshold; wherein, if the candidate value does not belong to the historical slow start threshold, the average number of normal end rounds of the candidate value is 0.
[0204] Optionally, the threshold adjustment module may further include:
[0205] The second adjustment submodule is used to obtain the number of records of the number of normal ending rounds corresponding to each candidate value when there are multiple candidate values for the minimum average number of normal ending rounds; wherein, if the candidate value does not belong to the historical slow start threshold, the number of records of the candidate value is 0.
[0206] Set the candidate values corresponding to the minimum average number of normal rounds and the minimum number of records as the new slow start threshold.
[0207] Optionally, the threshold adjustment module may further include:
[0208] The third adjustment submodule is used to randomly select a new slow start threshold from the candidate values when all candidate values correspond to the same average number of normal end rounds and the same number of records.
[0209] Optionally, the candidate value setting module may also include:
[0210] The sub-unit is used to obtain the number of records corresponding to the number of normal ending rounds for each slow start threshold when there are multiple slow start thresholds for the maximum average number of normal ending rounds.
[0211] The center value setting sub-unit is used to set the slow start threshold to be evaluated, which corresponds to the average number of the maximum number of normal ending rounds and the minimum number of records, as the center value.
[0212] Optionally, the device may further include:
[0213] The first removal module is used to determine whether the number of records corresponding to the new slow start threshold is greater than the preset number; if so, the earliest normal end round number corresponding to the new slow start threshold is removed.
[0214] Optionally, the device may further include:
[0215] The second removal module is used to determine whether there are any expired normal end rounds to be removed among all normal end rounds corresponding to the new slow start threshold; if so, the normal end rounds to be removed are removed.
[0216] Optionally, the device may further include:
[0217] The round counting module is used to increment the number of normally completed rounds corresponding to the current slow start threshold by 1; the initial value of the number of normally completed rounds is 0.
[0218] Optionally, the round counting module may also include:
[0219] The counting and judgment submodule is used to determine whether the number of normal ending rounds corresponding to the current slow start threshold is greater than the preset threshold; if yes, the number of normal ending rounds corresponding to the current slow start threshold is not incremented by 1; if no, the step of incrementing the number of normal ending rounds corresponding to the current slow start threshold by 1 is performed.
[0220] Optionally, the device may further include:
[0221] The fast retransmission trigger module is used to determine the current transmission round and trigger fast retransmission when the maximum number of consecutive transmissions corresponding to the current transmission round reaches a preset threshold.
[0222] Please refer to Figure 4 , Figure 4 This is a structural block diagram of a data transmission device provided in an embodiment of the present invention. The present invention provides a data transmission device 40, including a processor 41 and a memory 42; wherein, the memory 42 is used to store a computer program; the processor 41 is used to execute the congestion avoidance method provided in the foregoing embodiment when executing the computer program.
[0223] For details regarding the specific process of the above congestion avoidance method, please refer to the relevant content provided in the foregoing embodiments, which will not be repeated here.
[0224] Furthermore, the memory 42, as a carrier for resource storage, can be a read-only memory, random access memory, disk, or optical disk, and the storage method can be temporary storage or permanent storage.
[0225] In addition, the data transmitting device 40 also includes a power supply 43, a communication interface 44, an input / output interface 45, and a communication bus 46; wherein, the power supply 43 is used to provide operating voltage for each hardware device on the data transmitting device 40; the communication interface 44 can create a data transmission channel between the data transmitting device 40 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this invention, and is not specifically limited here; the input / output interface 45 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0226] Optionally, the data transmitting device can be a smart network interface card (NIC). Please refer to [reference needed]. Figure 5 , Figure 5 This is a schematic diagram illustrating an embodiment of a smart network interface card (NIC) provided by this invention. Compared to traditional NICs, smart NICs can offload compression / decompression, storage, and network functions that would otherwise be handled by the host CPU to their own processing. This eliminates the need for the host CPU to perform compression / decompression, storage, and network processing on network data packets, thus saving host CPU resources. The NIC communicates with the outside world via a network port (Ethernet) and with the host CPU via a PCIe interface (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard).
[0227] This invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the congestion avoidance method described in the above embodiments.
[0228] Since the embodiments of the computer program product section correspond to the embodiments of the congestion avoidance method section, please refer to the description of the embodiments of the congestion avoidance method section for the embodiments of the computer program product section, and they will not be repeated here.
[0229] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the congestion avoidance method described in the above embodiments.
[0230] Since the embodiments of the computer-readable storage medium portion correspond to the embodiments of the congestion avoidance method portion, the embodiments of the storage medium portion are described in the description of the embodiments of the congestion avoidance method portion, and will not be repeated here.
[0231] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0232] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0233] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0234] The congestion avoidance method, apparatus, data transmission device, program product, and medium provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A congestion avoidance method, characterized in that, Applied to a data transmission device, the method includes: During the congestion avoidance phase, the data packet transmission for the current transmission round is performed to the data receiving device according to the congestion window value, and the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted. When the current transmission round is determined to have ended normally, the congestion window value is increased, maintained, or decreased based on the network status between the data sending device and the data receiving device as represented by the maximum consecutive number. The data packet is transmitted to the data receiving device for the next transmission round based on the adjusted congestion window value; Based on the network state between the data transmitting device and the data receiving device, as represented by the maximum consecutive number, the congestion window value is increased, maintained, or decreased, including: When the maximum consecutive number is determined to be 0, the state hold round value is incremented by 1, and the square of the adjusted state hold round value is accumulated to the congestion window value; wherein, the initial value of the state hold round value is 0, and the state hold round represents the number of transmission rounds in which the network state is maintained in a good state; When the maximum consecutive number is determined to be 1, the congestion window value is maintained; When the maximum consecutive number is determined to be 2, it is determined whether the state holding round value is 0; If so, then the congestion window value is maintained; If not, then the state is maintained at round number decremented by 1, and the congestion window value is rolled back to the starting value corresponding to the last increase.
2. The congestion avoidance method according to claim 1, characterized in that, Based on the congestion window value, the data packet is transmitted to the data receiving device for the current transmission round, and the maximum consecutive number of duplicate acknowledgment requests received from the data receiving device in the current transmission round is counted, including: According to the congestion window value, the data receiving device sequentially sends multiple data packets and receives confirmation requests returned by the data receiving device when confirming the receipt of each data packet; wherein, when the data receiving device determines that the data packet received at the current time is not continuous with the data packets received before the current time, it will repeatedly return the confirmation request corresponding to the last continuous data packet received before the current time. Determine whether the currently received confirmation request is a duplicate of the previously received confirmation request; If so, increment the consecutive quantity by 1; wherein the initial value of the consecutive quantity is 0; If not, then the consecutive quantity is cleared to zero; When it is determined that the current transmission round has ended normally, the maximum value of the consecutive number is set as the maximum consecutive number.
3. The congestion avoidance method according to claim 1, characterized in that, Before incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value, the method further includes: Determine whether the size of the congestion window value has reached the size of the historical congestion window value corresponding to the last time a fast retransmission operation was triggered; If so, then the congestion window value is increased by a preset value; If not, proceed to the step of incrementing the state hold round value by 1 and accumulating the square of the adjusted state hold round value to the congestion window value.
4. The congestion avoidance method according to any one of claims 1 to 3, characterized in that, Also includes: When it is determined that the current transmission round triggers fast retransmission, all historical slow start thresholds smaller than the congestion window value are set as slow start thresholds to be evaluated. Obtain the average number of normal ending rounds corresponding to each of the slow start thresholds to be evaluated; wherein, the number of normal ending rounds is the number of transmission rounds that the data sending device continuously and normally ends under the condition of the slow start threshold, and the average number of normal ending rounds is the average of the number of all normal ending rounds corresponding to the slow start threshold. Set the slow start threshold corresponding to the average number of normal ending rounds to be evaluated as the center value, and set the center value and the congestion window values around the center value as candidate values. A new slow start threshold is selected from the candidate values, and the congestion window value is adjusted to the new slow start threshold so that the data packet transmission for the next transmission round is performed to the data receiving device according to the adjusted congestion window value.
5. The congestion avoidance method according to claim 4, characterized in that, Select a new slow start threshold from the candidate values, including: The candidate value corresponding to the minimum average number of normal rounds is set as the new slow start threshold; wherein, if the candidate value does not belong to the historical slow start threshold, the average number of normal rounds of the candidate value is 0.
6. The congestion avoidance method according to claim 5, characterized in that, Also includes: When there are multiple candidate values corresponding to the minimum average number of normal rounds, the number of records for the number of normal rounds corresponding to each candidate value is obtained; wherein, if a candidate value does not belong to the historical slow start threshold, the number of records for the candidate value is 0; The candidate values corresponding to the average number of minimum normal rounds and the minimum number of records are set as the new slow start threshold.
7. The congestion avoidance method according to claim 6, characterized in that, Also includes: When all candidate values correspond to the same average number of normal ending rounds and the same number of records, the new slow start threshold is randomly selected from the candidate values.
8. The congestion avoidance method according to claim 4, characterized in that, Also includes: When there are multiple slow start thresholds to be evaluated corresponding to the average number of normal end rounds, obtain the number of records corresponding to the number of normal end rounds for each of the slow start thresholds to be evaluated; The slow start threshold to be evaluated, which corresponds to the average number of the maximum number of normal rounds completed and the minimum number of records, is set as the central value.
9. The congestion avoidance method according to claim 8, characterized in that, After selecting a new slow start threshold from the candidate values, the following steps are also included: Determine if the number of records corresponding to the new slow start threshold is greater than the preset number; If so, remove the earliest normal end round number corresponding to the new slow start threshold.
10. The congestion avoidance method according to claim 8, characterized in that, After selecting a new slow start threshold from the candidate values, the following steps are also included: Among all the normal end rounds corresponding to the new slow start threshold, determine whether there are any expired normal end rounds to be removed; If they exist, then the number of normally completed rounds to be removed will be removed.
11. The congestion avoidance method according to claim 4, characterized in that, After confirming that the current transmission round has ended normally, the process also includes: Increment the number of normal rounds corresponding to the current slow start threshold by 1; wherein the initial value of the number of normal rounds is 0.
12. The congestion avoidance method according to claim 11, characterized in that, Before incrementing the number of normal rounds corresponding to the current slow start threshold by 1, the following is also included: Determine whether the number of normally completed rounds corresponding to the current slow start threshold is greater than the preset threshold; If so, then the number of normal ending rounds corresponding to the current slow start threshold is not incremented by 1; If not, proceed to the step of incrementing the number of normal ending rounds corresponding to the current slow start threshold by 1.
13. The congestion avoidance method according to claim 4, characterized in that, Determining the current transmission round to trigger fast retransmission includes: When the maximum number of consecutive transmissions corresponding to the current transmission round reaches a preset threshold, the current transmission round is determined to trigger fast retransmission.
14. A congestion avoidance device, characterized in that, Applied to a data transmission device, the device includes: The statistics module is used to perform data packet transmission for the current transmission round to the data receiving device according to the congestion window value when the congestion avoidance phase is in progress, and to count the maximum number of consecutive duplicate acknowledgment requests received from the data receiving device in the current transmission round. An adjustment module is used to, upon determining that the current transmission round has ended normally, increase, maintain, or decrease the congestion window value based on the network status between the data sending device and the data receiving device as represented by the maximum consecutive number. The loop control module is used to perform the next transmission round of data packet transmission to the data receiving device according to the adjusted congestion window value; Adjustment modules include: An increase submodule is used to increase the congestion window value when the maximum consecutive number is determined to be 0; The holding submodule is used to hold the congestion window value when the maximum consecutive number is determined to be 1; The reduction submodule is used to reduce the congestion window value when the maximum consecutive number is determined to be 2. The enlargement submodule includes: An increment unit is used to increment the state hold round value by 1 and accumulate the square of the adjusted state hold round value to the congestion window value; wherein, the initial value of the state hold round value is 0, and the state hold round represents the number of transmission rounds in which the network state remains in a good state; Reduce submodules, including: The reduction unit is used to determine whether the state holding round value is 0; if so, the congestion window value is maintained; if not, the state holding round value is decremented by 1, and the congestion window value is rolled back to the starting value corresponding to the last increase.
15. A data transmission device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the congestion avoidance method as described in any one of claims 1 to 13 when executing the computer program.
16. The data transmission device according to claim 15, characterized in that, The data transmission device is a smart network card.
17. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the congestion avoidance method according to any one of claims 1 to 13.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the congestion avoidance method as described in any one of claims 1 to 13.