A method, device and product for dynamically measuring link bandwidth
By adjusting the length and proportion of the congestion window and combining with the dynamic measurement method of RTT time, the problems of long link bandwidth measurement time and inaccurate results in the prior art are solved, and fast and accurate link bandwidth estimation is achieved.
Patent Information
- Application Number
- CN202310808988.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-07-03
AI Technical Summary
The congestion control algorithm based on packet loss determination in the prior art has problems such as long measurement time and inaccurate measurement results in link bandwidth measurement, especially in high-speed or high-latency network environments.
By gradually increasing the congestion window length during the startup phase, reducing the congestion window length during the emptying phase, and adjusting the congestion window ratio according to the real-time link status during the dynamic measurement phase until the link bottleneck bandwidth is stable, a dynamic measurement method based on RTT time is adopted.
Faster and more accurate link bandwidth measurements are achieved, measurement time is shortened, real-time and accuracy of link bandwidth measurements are improved, and the changes in modern network environments are adapted to the changes.
Smart Images

Figure CN116633826B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bandwidth measurement, and particularly to a method, device, and product for dynamically measuring link bandwidth. Background Art
[0002] With the rapid development of computer network technology, computer link bandwidth measurement, as a key technology for evaluating network performance, is crucial for the user experience of network applications. In the prior art, link bandwidth measurement is mainly achieved based on congestion control algorithms. Congestion control algorithms use packet loss as the basis for congestion judgment and adjust the sending rate of the sender through mechanisms such as slow start, congestion avoidance, fast retransmission, and fast recovery.
[0003] However, during the bandwidth measurement process, if such congestion control algorithms based on packet loss to determine congestion are used, it may lead to a relatively conservative probing strategy and require a long time to approach the true link capacity. Moreover, due to relying on packet loss as a signal of network congestion, inaccurate link capacity estimation may occur in high-speed or high-latency network environments.
[0004] Therefore, it is necessary to develop a method, device, and product for dynamically measuring link bandwidth to improve the accuracy and real-time performance of link bandwidth measurement. Summary of the Invention
[0005] In view of the above problems, embodiments of the present application provide a method, device, and product for dynamically measuring link bandwidth to overcome or at least partially solve the above problems.
[0006] A first aspect of the embodiments of the present application provides a method for dynamically measuring link bandwidth, the method including:
[0007] In the startup phase, every time an RTT elapses, control the length of the congestion window to increase by the target packet length until the increase in the throughput of the congestion window is less than the first threshold, and enter the drainage phase;
[0008] In the drainage phase, every time an RTT elapses, control the length of the congestion window to decrease by the target multiple until the decrease in the RTT of the congestion window is less than the second threshold, and enter the dynamic measurement phase;
[0009] In the dynamic measurement phase, every time an RTT elapses, determine the adjustment ratio of the congestion window at the current RTT, and adjust the length of the congestion window according to the adjustment ratio of the congestion window;
[0010] Adjust the length of the congestion window multiple times until the change amount of the length of the congestion window is within the target range within multiple consecutive RTT times, and determine the link bottleneck bandwidth according to the length of the congestion window within the last RTT time.
[0011] In an alternative embodiment, every time an RTT time elapses, control the length of the congestion window to increase by the target packet length until the increase amount of the throughput of the congestion window is less than the first threshold, including:
[0012] Set the length of the initial congestion window to one MSS;
[0013] Every time an RTT time elapses, control the length of the congestion window to increase by one MSS;
[0014] Every time an RTT time elapses, calculate the throughput of the congestion window corresponding to this RTT time according to the number of ACK packets received by the congestion window within this RTT time;
[0015] Determine whether the increase amount of the throughput of the congestion window is less than the first threshold according to the difference between the throughput of the congestion window corresponding to this RTT time and the throughput of the congestion window corresponding to the previous RTT time;
[0016] In the case where the increase amount is greater than or equal to the first threshold, continue to expand the length of the congestion window;
[0017] In the case where the increase amount is less than the first threshold, stop expanding the length of the congestion window and enter the emptying phase.
[0018] In an alternative embodiment, every time an RTT time elapses, control the length of the congestion window to decrease at the target multiple until the decrease amount of the RTT time of the congestion window is less than the second threshold, including:
[0019] Every time an RTT time elapses, control the length of the congestion window to decrease at a multiple of ln2 / 2 and record this RTT time;
[0020] Determine whether the decrease amount of the RTT time of the congestion window is less than the second threshold according to the difference between this RTT time and the previous RTT time;
[0021] In the case where the decrease amount is greater than or equal to the second threshold, continue to decrease the length of the congestion window;
[0022] In the case where the decrease amount is less than the second threshold, stop decreasing the length of the congestion window and enter the dynamic measurement phase.
[0023] In an alternative embodiment, determining the congestion window adjustment ratio for the current RTT time every time an RTT time elapses includes:
[0024] Every time an RTT time elapses, determine the first throughput and the second throughput for that RTT time;
[0025] Based on the first throughput and the second throughput, determine the congestion window adjustment ratio for the current RTT time.
[0026] In an alternative embodiment, determining the first throughput and the second throughput for that RTT time every time an RTT time elapses includes:
[0027] Every time an RTT time elapses, determine the throughput corresponding to each ACK packet according to the ACK packets received by the congestion window during that RTT time;
[0028] Determine the average value of the throughputs of all ACK packets received by the congestion window during that RTT time as the first throughput;
[0029] Determine the maximum value among the throughputs of all the ACK packets during that RTT time as the second throughput.
[0030] In an alternative embodiment, determining the congestion window adjustment ratio for the current RTT time based on the first throughput and the second throughput includes:
[0031] Every time an RTT time elapses, determine whether the first throughput for that RTT time is greater than the first throughput for the previous RTT time;
[0032] In the case where the first throughput for that RTT time is greater than the first throughput for the previous RTT time, determine the congestion window adjustment ratio for the current RTT time using the first growth model based on the first throughput and the second throughput for that RTT time;
[0033] In the case where the first throughput for that RTT time is less than or equal to the first throughput for the previous RTT time, determine the congestion window adjustment ratio for the current RTT time using the second growth model based on the first throughput and the second throughput for that RTT time.
[0034] In an alternative embodiment, determining the congestion window adjustment ratio for the current RTT time using the first growth model includes:
[0035] Calculate the congestion window adjustment ratio according to the following formula:
[0036]
[0037] Among them, WAF i represents the congestion window adjustment ratio at the i-th RTT time, and WAF max represents the set maximum value of 2 / ln2, and T m represents the second throughput at the (i - 1)-th RTT time, and T i-1 represents the first throughput at the (i - 1)-th RTT time. Among them, when i = 1, the initial WAF is set to WAF max ;
[0038] The method for determining the congestion window adjustment ratio at the current RTT time by using the second growth model includes:
[0039] Calculating the congestion window adjustment ratio according to the following formula:
[0040]
[0041] In the second aspect of the embodiments of the present application, a link bandwidth dynamic measurement device is further provided. The device includes:
[0042] A start module, configured to, in the start phase, every time an RTT time elapses, control the length of the congestion window to increase by a target packet length until the increase amount of the throughput of the congestion window is less than a first threshold, and enter the emptying phase;
[0043] An emptying module, configured to, in the emptying phase, every time an RTT time elapses, control the length of the congestion window to decrease by a target multiple until the decrease amount of the RTT time of the congestion window is less than a second threshold, and enter the dynamic measurement phase;
[0044] A dynamic measurement module, configured to, in the dynamic measurement phase, every time an RTT time elapses, determine the congestion window adjustment ratio at the current RTT time, and adjust the length of the congestion window according to the congestion window adjustment ratio;
[0045] A bandwidth determination module, configured to adjust the length of the congestion window multiple times until the change amount of the length of the congestion window is within a target range within a continuous plurality of RTT times, and determine the link bottleneck bandwidth according to the length of the congestion window in the last RTT time.
[0046] In an optional implementation manner, the emptying module includes:
[0047] An initialization sub-module, configured to set the length of the initial congestion window to one MSS;
[0048] An increase sub-module, configured to, every time an RTT time elapses, control the length of the congestion window to increase by one MSS;
[0049] A throughput calculation sub-module, which is used to calculate the throughput of the congestion window corresponding to each RTT time according to the number of ACK packets received by the congestion window within the RTT time every time an RTT time elapses;
[0050] A first determination sub-module, which is used to determine whether the increase in the throughput of the congestion window is less than the first threshold according to the difference between the throughput of the congestion window corresponding to the RTT time and the throughput of the congestion window corresponding to the previous RTT time;
[0051] A first loop sub-module, which is used to continue to expand the length of the congestion window when the increase is greater than or equal to the first threshold;
[0052] A first stop sub-module, which is used to stop expanding the length of the congestion window and enter the emptying phase when the increase is less than the first threshold.
[0053] In an alternative embodiment, the emptying module includes:
[0054] A reduction sub-module, which is used to control the length of the congestion window to be reduced at a rate of ln2 / 2 every time an RTT time elapses, and record the RTT time;
[0055] A second determination sub-module, which is used to determine whether the decrease in the RTT time of the congestion window is less than the second threshold according to the difference between the RTT time and the previous RTT time;
[0056] A second loop sub-module, which is used to continue to reduce the length of the congestion window when the decrease is greater than or equal to the second threshold;
[0057] A second stop sub-module, which is used to stop reducing the length of the congestion window and enter the dynamic measurement phase when the decrease is less than the second threshold.
[0058] In an alternative embodiment, the dynamic measurement module includes:
[0059] A third determination sub-module, which is used to determine the first throughput and the second throughput of each RTT time every time an RTT time elapses;
[0060] A ratio determination sub-module, which is used to determine the adjustment ratio of the congestion window for the current RTT time according to the first throughput and the second throughput.
[0061] In an alternative embodiment, the third determination sub-module includes:
[0062] A throughput determination unit, configured to determine the throughput corresponding to each ACK packet according to the ACK packets received by the congestion window within each RTT time;
[0063] A first throughput determination unit, configured to determine the average value of the throughputs of all ACK packets received by the congestion window within this RTT time as the first throughput;
[0064] A second throughput determination unit, configured to determine the maximum value among the throughputs of all the ACK packets within this RTT time as the second throughput.
[0065] In an optional implementation manner, the ratio determination sub-module includes:
[0066] A judgment unit, configured to judge whether the first throughput of this RTT time is greater than the first throughput of the previous RTT time every time an RTT time elapses;
[0067] A first adjustment unit, configured to, when the first throughput of this RTT time is greater than the first throughput of the previous RTT time, determine the adjustment ratio of the congestion window for the current RTT time by using a first growth model according to the first throughput and the second throughput of this RTT time;
[0068] A second adjustment unit, configured to, when the first throughput of this RTT time is less than or equal to the first throughput of the previous RTT time, determine the adjustment ratio of the congestion window for the current RTT time by using a second growth model according to the first throughput and the second throughput of this RTT time.
[0069] In an optional implementation manner, the first adjustment unit includes: a first calculation sub-unit, configured to determine the adjustment ratio of the congestion window according to the following formula:
[0070]
[0071] where WAF i represents the adjustment ratio of the congestion window for the i-th RTT time, WAF max represents the set maximum value of 2 / ln2, T m represents the second throughput of the (i - 1)-th RTT time, T i-1 represents the first throughput of the (i - 1)-th RTT time, where when i = 1, the initial WAF is set to WAF max ;
[0072] The second adjustment unit includes: a second calculation sub-unit, configured to determine the adjustment ratio of the congestion window according to the following formula:
[0073]
[0074] In the third aspect of the embodiments of the present application, a client is further provided, and the client is used to execute the steps of any one of the link bandwidth dynamic measurement methods in the first aspect of this embodiment.
[0075] In the fourth aspect of the embodiments of the present application, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the link bandwidth dynamic measurement method as described in any one of the first aspects of this embodiment are implemented.
[0076] In the fifth aspect of the embodiments of the present application, a computer-readable storage medium is further provided, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, the steps of a link bandwidth dynamic measurement method disclosed in the embodiments of the present application are implemented.
[0077] A link bandwidth dynamic measurement method provided by the embodiments of the present application is applied to a target client. The method includes: in the startup phase, every time an RTT time elapses, controlling the length of the congestion window to increase by a target packet length until the increase in the throughput of the congestion window is less than a first threshold, and entering the drainage phase; in the drainage phase, every time an RTT time elapses, controlling the length of the congestion window to decrease by a target multiple until the decrease in the RTT time of the congestion window is less than a second threshold, and entering the dynamic measurement phase; in the dynamic measurement phase, every time an RTT time elapses, determining the adjustment ratio of the congestion window for the current RTT time, and adjusting the length of the congestion window according to the adjustment ratio of the congestion window; adjusting the length of the congestion window multiple times until the change amount of the length of the congestion window is within a target range within a continuous plurality of RTT times, and determining the link bottleneck bandwidth according to the length of the congestion window within the last RTT time.
[0078] The beneficial effects are as follows:
[0079] On the one hand, the measurement speed of the link bandwidth dynamic measurement method proposed in the embodiments of the present application is faster. Based on the real-time growth model under different link states, every time an RTT time elapses, the adjustment ratio of the congestion window for the current RTT time is determined, so as to adjust the congestion window using the adjustment ratio most suitable for the real link situation, quickly approaching the bandwidth bottleneck of the link, detecting the true capacity of the link in a shorter time, and shortening the bandwidth measurement time.
[0080] On the other hand, the measurement of the link bandwidth dynamic measurement method proposed in the embodiments of the present application is more accurate. The embodiments of the present application fully consider the characteristics of the network environment, break through the shackles of the congestion control strategy that uses packet loss as the congestion judgment logic in the past, exclude the interference of some irrelevant factors on the measurement results, and make the estimation of the link capacity more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0082] Figure 1 is a flowchart of the steps of a link bandwidth dynamic measurement method provided by an embodiment of the present application;
[0083] Figure 2 is a schematic diagram of the change curve of the throughput size provided by an embodiment of the present application;
[0084] Figure 3 is a schematic structural diagram of a link bandwidth dynamic measurement device provided by an embodiment of the present application;
[0085] Figure 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0086] The following will more specifically describe the exemplary embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0087] The development of computer network technology is changing with each passing day. Link bandwidth measurement, as a key technology for evaluating network performance, is crucial for the user experience of network applications. The congestion control algorithm is a core part of the network transmission protocol. By dynamically adjusting the sending rate to match the current network environment, it maximizes the utilization rate of network resources while maintaining network stability. In related technologies, the congestion control algorithm uses packet loss as the congestion judgment basis and usually adjusts the sending rate of the sender through mechanisms such as slow start, congestion avoidance, fast retransmission, and fast recovery. Existing bandwidth measurements generally use such algorithms.
[0088] However, the above method can no longer well adapt to complex modern network conditions. Moreover, since the design of congestion control algorithms is to improve the long-term stable data transmission performance, it does not quite fit the scenario of link bandwidth measurement. During the bandwidth measurement process, if such congestion control algorithms based on packet loss to determine congestion are used, it may lead to a relatively conservative probing strategy and require a long time to approach the true link capacity. Also, due to relying on packet loss as a signal of network congestion, inaccurate link capacity estimation may occur in high-speed or high-latency network environments.
[0089] To overcome the problems of long measurement time and inaccurate measurement results mentioned above, the embodiments of this application propose a method, device, and product for dynamic link bandwidth measurement, aiming to improve the accuracy and real-time performance of link bandwidth measurement. The following will, in combination with the accompanying drawings, elaborate on the method for dynamic link bandwidth measurement provided by the embodiments of this application through some embodiments and their application scenarios.
[0090] This embodiment proposes a method for dynamic link bandwidth measurement, referring to Figure 1 , Figure 1 which shows a flowchart of the steps of a method for dynamic link bandwidth measurement, as Figure 1 shown, the method includes:
[0091] Step S101, in the startup phase, every time an RTT time elapses, control the length of the congestion window to increase by the target packet length until the increase in the throughput of the congestion window is less than the first threshold, and enter the drainage phase.
[0092] The round-trip time (RTT) is the total time elapsed from when the sender starts sending data until the sender receives an acknowledgment (such as an ACK packet) from the receiver. The size of the RTT time is mainly determined by three parts: the propagation time of the link, the processing time of the end system, and the queuing and processing time in the router's cache. The values of the first two parts are relatively fixed for a TCP connection, and the queuing and processing time in the router's cache will change with the degree of network congestion. Therefore, the change in the RTT time reflects the change in the degree of network congestion to a certain extent.
[0093] A link refers to the channel for data interaction between a sender and a receiver. In this embodiment, the sender and the receiver can be any terminals, electronic devices, clients, and servers, which are not restricted in this embodiment. The congestion window refers to the maximum size of data packets that the sender of the link can send within one RTT time, used to prevent the link from being overloaded due to excessive traffic. Correspondingly, the throughput refers to the amount of data successfully transmitted by a device or port per unit time. Therefore, the larger the congestion window, the larger the throughput; the smaller the congestion window, the smaller the throughput. However, the throughput is limited by the bottleneck bandwidth of the link, that is, when the congestion window is too large, resulting in too much data being sent per unit time, exceeding the bottleneck bandwidth of the link, it is easy to cause data to queue in the buffer of the link or packet loss, and the data sending and receiving cannot be completed immediately. At this time, the throughput will not increase with the expansion of the congestion window.
[0094] In this embodiment, during the startup phase, the congestion window is gradually expanded at a certain rate, that is, every time an RTT time elapses, the length of the congestion window is increased by the length of the target packet, so that the data sending rate of the congestion window gradually increases. Correspondingly, the throughput gradually rises until it reaches the bottleneck bandwidth of the link, and the growth rate of the throughput slows down. Eventually, when the size of the data sent exceeds the bottleneck bandwidth of the link, queuing will occur in the buffer of the link, and at this time, the throughput stops rising.
[0095] In a possible implementation manner, step S101, every time an RTT time elapses, controlling the length of the congestion window to increase by the length of the target packet until the increase amount of the throughput of the congestion window is less than the first threshold, includes:
[0096] Step S1011, setting the length of the initial congestion window to one MSS.
[0097] In specific implementation, the congestion window starts from 1 MSS (Maximum Segment Size) and gradually expands.
[0098] Step S1012, every time an RTT time elapses, controlling the length of the congestion window to increase by one MSS;
[0099] Specifically, every time the sender receives an ACK packet, it controls the length of the congestion window to increase by 1 MSS, that is, every time 1 RTT time elapses, the length of the congestion window is doubled. Thus, the congestion window can gradually expand at a relatively fast rate, saving the time required in this startup phase.
[0100] Step S1013: Every time an RTT elapses, calculate the throughput of the congestion window corresponding to this RTT based on the number of ACK packets received by the congestion window during this RTT.
[0101] Specifically, gradually expand the congestion window, so that the size of the sent data packets gradually increases and the throughput shows an upward trend. Every time an RTT elapses, calculate the throughput within this RTT based on the number of received ACK packets. This throughput represents the amount of data successfully transmitted per unit time corresponding to this RTT. For example, this throughput can be the average value of the data of the ACK packets received during this RTT.
[0102] Step S1014: Determine whether the increase in the throughput of the congestion window is less than the first threshold based on the difference between the throughput of the congestion window corresponding to this RTT and the throughput of the congestion window corresponding to the previous RTT.
[0103] Step S1015: When the increase is greater than or equal to the first threshold, continue to expand the length of the congestion window;
[0104] Step S1016: When the increase is less than the first threshold, stop expanding the length of the congestion window and enter the emptying stage.
[0105] In specific implementation, as the congestion window is gradually expanded, the throughput gradually rises, approaching the link bottleneck bandwidth, and the rising rate gradually decreases until queuing occurs in the buffer at the bottleneck and the throughput stops rising. In this embodiment, the first threshold can be a preset fixed value. When the increase in throughput is less than the first threshold, it means that the rising rate of throughput has decreased to the expected value. For example, when the first threshold is 0, it means that when the throughput no longer increases, stop expanding the length of the congestion window and enter the emptying stage. In this embodiment, the throughput peak value Tp at the startup stage can also be recorded, and this throughput peak value is a value close to the link bottleneck bandwidth.
[0106] Step S102: In the emptying stage, every time an RTT elapses, control the length of the congestion window to decrease by a target multiple until the decrease in the RTT of the congestion window is less than the second threshold, and then enter the dynamic measurement stage.
[0107] The emptying stage is to clear the excess data in the cache area of this link. Specifically, reducing the congestion window by the target multiple can slow down the data sending rate to be lower than the link bottleneck bandwidth, eliminate the queued data in the buffer area, and prepare for subsequent bandwidth measurement.
[0108] In a possible implementation, in step S102, every time an RTT elapses, the length of the congestion window is controlled to decrease at a target ratio until the decrease in the RTT of the congestion window is less than a second threshold, which includes:
[0109] Step S1021, every time an RTT elapses, control the length of the congestion window to decrease at a ratio of ln2 / 2, and record this RTT.
[0110] Step S1022, determine whether the decrease in the RTT of the congestion window is less than the second threshold according to the difference between this RTT and the previous RTT.
[0111] Step S1023, when the decrease is greater than or equal to the second threshold, continue to decrease the length of the congestion window.
[0112] Step S1024, when the decrease is less than the second threshold, stop decreasing the length of the congestion window and enter the dynamic measurement stage.
[0113] In this embodiment, in order to clear the excessive data sent to the network during the startup phase, every time an RTT elapses, the length of the congestion window is controlled to decrease at a ratio of ln2 / 2, and this RTT is recorded. The RTT will change with the change of the congestion degree of the link. When there is congestion in the link, the more queued data in the buffer of the link, the longer the RTT will be, and the less queued data in the buffer of the link, the shorter the RTT will be. In this embodiment, when the length of the congestion window is controlled to decrease at a ratio of ln2 / 2, the RTT will decrease accordingly. When the decrease in the RTT is less than the second threshold, it means that the congestion situation in the link has been alleviated or completely cleared, and the dynamic measurement stage can be entered. For example, if the second threshold is 0, it means that the excessive data in the link has been completely emptied, the RTT is the minimum value and no longer decreases. At this time, there is no congestion in the link and the dynamic measurement stage can be entered.
[0114] Step S103, in the dynamic measurement stage, every time an RTT elapses, determine the congestion window adjustment ratio of the current RTT, and adjust the length of the congestion window according to the congestion window adjustment ratio.
[0115] In this embodiment, during the dynamic measurement phase, every time an RTT elapses, the congestion window adjustment ratio for the current RTT is determined (for example, after the K-th RTT has elapsed, the congestion window adjustment ratio for the (K + 1)-th RTT is determined). This congestion window adjustment ratio is the ratio most suitable for the current actual link condition. The embodiments of the present application can enable the size of the congestion window to quickly and smoothly approach the bandwidth bottleneck of the link, detect the actual capacity of the link in a shorter time, and achieve the purpose of quickly measuring the link bandwidth.
[0116] In an alternative implementation, step S103, every time an RTT elapses, determining the congestion window adjustment ratio for the current RTT, includes:
[0117] Step S1031, every time an RTT elapses, determining the first throughput and the second throughput for this RTT.
[0118] In this embodiment, the first throughput T i represents the throughput for the elapsed RTT, and the second throughput T m represents the maximum value of the throughput for the elapsed RTT. That is, in this embodiment, based on the throughput for the K-th RTT and the maximum throughput within the K-th RTT, the congestion window adjustment ratio for the (K + 1)-th RTT is calculated. Define the congestion window adjustment ratio for each RTT as WAF (Window Adjusting Factor), indicating that within this RTT, the adjustment ratio will adaptively and dynamically change according to the deviation between the current throughput and the link bottleneck bandwidth, so as to obtain the ratio most suitable for the current actual link condition.
[0119] In an alternative implementation, step S1031, every time an RTT elapses, determining the first throughput and the second throughput for this RTT, includes:
[0120] Step S1031-a, every time an RTT elapses, based on the ACK packets received by the congestion window within this RTT, determining the throughput of each of the ACK packets.
[0121] In this embodiment, after the K-th RTT has elapsed, determining the throughput of each ACK packet within this RTT, that is, the instantaneous throughput for each received ACK packet.
[0122] Step S1031-b, taking the average value of the throughputs of all the ACK packets received by the congestion window within this RTT as the first throughput.
[0123] In this embodiment, calculating the first throughput T for the K-th RTTi At this time, according to the instantaneous throughput of multiple ACK packets received within the Kth RTT time and the size of this RTT time, the average throughput is determined, that is, the amount of data successfully transmitted per unit time.
[0124] Step S1031-c: Determine the maximum value among the throughputs of all the ACK packets within this RTT time as the second throughput.
[0125] In this embodiment, after the Kth RTT time, calculate the second throughput T of this Kth RTT time m , specifically, according to the instantaneous throughputs corresponding to multiple ACK packets received within the Kth RTT time, determine the maximum value therefrom and use it as the second throughput T m . In the first RTT time, use the throughput peak value Tp determined in the startup phase as the second throughput of the first RTT time.
[0126] Step S1032: Determine the congestion window adjustment ratio for the current RTT time according to the first throughput and the second throughput.
[0127] In this embodiment, the first throughput represents the current throughput, the second throughput represents the link bottleneck bandwidth, and the adjustment ratio will adjust the values of the first throughput and the second throughput according to the deviation between the current throughput and the link bottleneck bandwidth, so as to achieve adaptive dynamic changes. During the detection process, it can control the congestion window to quickly and smoothly approach the link bandwidth according to the actual link situation, improving the link bandwidth measurement efficiency.
[0128] In an alternative embodiment, in the step S1032 of determining the congestion window adjustment ratio for the current RTT time according to the first throughput and the second throughput, it includes:
[0129] Step S1032-a: Every time an RTT time passes, determine whether the first throughput of this RTT time is greater than the first throughput of the previous RTT time.
[0130] In this embodiment, according to whether the first throughput of this RTT time is greater than the first throughput of the previous RTT time, determine whether the current throughput is in an increasing trend, a stable trend or a decreasing trend, so as to determine the congestion degree of the current link. According to different situations, select the corresponding growth model to calculate the congestion window adjustment ratio.
[0131] Step S1032-b, when the first throughput at this RTT time is greater than the first throughput at the previous RTT time, determine the congestion window adjustment ratio at the current RTT time according to the first throughput and the second throughput at this RTT time by using a first growth model.
[0132] In an alternative embodiment, the determining the congestion window adjustment ratio at the current RTT time by using a first growth model includes:
[0133] Calculate the congestion window adjustment ratio according to the following formula:
[0134]
[0135] where WAF i represents the congestion window adjustment ratio at the i-th RTT time, WAF max represents the set maximum value of 2 / ln2, T m represents the second throughput at the (i - 1)-th RTT time, T i-1 represents the first throughput at the (i - 1)-th RTT time, where when i = 1, the initial WAF is set to WAF max . According to this formula, it can be obtained that the congestion window adjustment ratio does not exceed the set maximum value of 2 / ln2 at most. In this embodiment, setting a limit on the maximum value is to prevent the congestion window from suddenly becoming too large.
[0136] The congestion window determines the number of segments that the sender can send within an RTT time. Therefore, the larger the length of the congestion window, the greater the sending rate. In this embodiment, since after the drain phase, the sending rate at the beginning of the dynamic measurement phase should be less than the link bottleneck bandwidth. To approach the bottleneck bandwidth, the congestion window adjustment ratio should be greater than 1.0, so that the data sending rate increases as the congestion window expands and approaches the link bottleneck bandwidth. During this process, when the sending rate is low (the difference between the second throughput and the first throughput is large), the adjustment ratio is large, and the length of the congestion window will increase rapidly to reduce the probing time. When the sending rate approaches the estimated bottleneck bandwidth (the difference between the second throughput and the first throughput is small), the adjustment ratio is small, the increase rate of the length of the congestion window slows down, and the sending rate will gradually stabilize.
[0137] Step S1032-c, when the first throughput at this RTT time is less than or equal to the first throughput at the previous RTT time, determine the congestion window adjustment ratio at the current RTT time according to the first throughput and the second throughput at this RTT time by using a second growth model.
[0138] In an alternative embodiment, the step of determining the adjustment ratio of the congestion window for the current RTT time by using the second growth model includes:
[0139] Calculating the adjustment ratio of the congestion window according to the following formula:
[0140]
[0141] In this embodiment, when the throughput no longer increases (the first throughput at this RTT time is less than or equal to the first throughput at the previous RTT time), it can be considered that in this case, the sending rate has exceeded the bottleneck bandwidth, and queuing occurs in the buffer of the link. To approach the bottleneck bandwidth, the adjustment ratio of the congestion window should be made less than 1.0, and the congestion window should be appropriately reduced, so that the data sending rate decreases as the congestion window is reduced. The dynamic measurement method proposed in the embodiments of the present application takes observing the difference between the real-time bandwidth and the peak bandwidth as the basic starting point, and designs different growth models (the first growth model and the second growth model) for the adjustment of the sending rate according to the size of the difference. During the measurement process, switching between different growth models can be performed according to the real-time throughput to achieve the best approximation effect for the link bandwidth.
[0142] Step S104, adjusting the length of the congestion window multiple times until the change amount of the length of the congestion window is within the target range within consecutive multiple RTT times, and determining the link bottleneck bandwidth according to the length of the congestion window within the last RTT time.
[0143] In specific implementation, the two states of increasing and decreasing the length of the congestion window will be adaptively switched according to whether there is queuing in the buffer in the link, and always remain relatively stable near the real bottleneck bandwidth of the link. After the sending rate is quickly stabilized at the link bottleneck bandwidth, it can be regarded as the end of the measurement, and the value of the link bottleneck bandwidth is determined according to the length of the congestion window within the last RTT time. Refer to Figure 2 , Figure 2 shows a schematic diagram of the change curve of the throughput size. As Figure 2 shown, the abscissa represents time, and the ordinate represents the size of the throughput. In the startup stage, the throughput gradually increases until the throughput no longer increases and reaches the peak value Tp. Then it enters the emptying stage, where the throughput decreases as the length of the congestion window decreases. After clearing the excessive data, it enters the dynamic measurement stage, where the throughput increases as the length of the congestion control window increases and decreases as the length of the congestion control window decreases, until it reaches a stable state and maintains within the target range of the link bottleneck bandwidth.
[0144] In this embodiment, there is no limitation on the specific method for determining stability. Exemplarily, when the congestion window adjustment ratio remains within the first threshold range (such as 0.98 - 1.02) within consecutive N RTT times, it is determined that the stable state has been reached. In this case, the bottleneck bandwidth of the link can be determined according to the length of the congestion window at the last RTT time. Exemplarily, the throughput at the last RTT time can be used as the bottleneck bandwidth of the link, or the average value of the throughput at the last m RTT times can be taken as the bottleneck bandwidth of the link.
[0145] As can be seen from the above embodiments, the link bandwidth measurement method proposed in this application is based on a real-time growth model under different link states, has a high adaptability to the actual link situation, can detect the true capacity of the link in a shorter time, thereby shortening the time for bandwidth measurement and achieving a faster bandwidth measurement speed. Moreover, the measurement method proposed in this application comprehensively considers the characteristics of the modern network environment, breaks through the shackles of the congestion control strategy that uses packet loss as the congestion judgment logic in the past, excludes the interference of some irrelevant factors on the measurement results, and makes the estimation of the link capacity more accurate. Thanks to the adjustment of the link bandwidth approximation strategy in this application, the time consumed in the measurement process is reduced, so the traffic usage can be reduced. In summary, by adjusting the basic logic of the congestion control algorithm, this application effectively overcomes the deficiencies of existing methods in link bandwidth measurement, realizes fast, accurate, and low-cost link bandwidth estimation, and provides a reliable and efficient link bandwidth measurement method for modern network applications.
[0146] Based on the same inventive concept, the second aspect of the embodiments of this application also provides a link bandwidth dynamic measurement device. Referring to Figure 3 , Figure 3 shows a schematic structural diagram of a link bandwidth dynamic measurement device. As shown in Figure 3 , the device includes:
[0147] A start module, configured to control the length of the congestion window to increase by the target packet length every RTT time during the start phase until the increase amount of the throughput of the congestion window is less than the first threshold, and enter the emptying phase;
[0148] An emptying module, configured to control the length of the congestion window to decrease at the target multiple every RTT time during the emptying phase until the decrease amount of the RTT time of the congestion window is less than the second threshold, and enter the dynamic measurement phase;
[0149] A dynamic measurement module, configured to determine the congestion window adjustment ratio at the current RTT time every RTT time during the dynamic measurement phase, and adjust the length of the congestion window according to the congestion window adjustment ratio;
[0150] A bandwidth determination module, which is configured to adjust the length of the congestion window multiple times until the change amount of the length of the congestion window is within a target range within a plurality of consecutive RTT times, and determine the link bottleneck bandwidth according to the length of the congestion window within the last RTT time.
[0151] In an alternative embodiment, the emptying module includes:
[0152] An initialization sub-module, which is configured to set the length of the initial congestion window to one MSS;
[0153] An increment sub-module, which is configured to control the length of the congestion window to increase by one MSS every time an RTT time elapses;
[0154] A throughput calculation sub-module, which is configured to calculate the throughput of the congestion window corresponding to this RTT time according to the number of ACK packets received by the congestion window within this RTT time every time an RTT time elapses;
[0155] A first determination sub-module, which is configured to determine whether the increase amount of the throughput of the congestion window is less than the first threshold according to the difference between the throughput of the congestion window corresponding to this RTT time and the throughput of the congestion window corresponding to the previous RTT time;
[0156] A first loop sub-module, which is configured to continue to expand the length of the congestion window when the increase amount is greater than or equal to the first threshold;
[0157] A first stop sub-module, which is configured to stop expanding the length of the congestion window and enter the emptying phase when the increase amount is less than the first threshold.
[0158] In an alternative embodiment, the emptying module includes:
[0159] A reduction sub-module, which is configured to control the length of the congestion window to decrease at a rate of ln2 / 2 every time an RTT time elapses, and record this RTT time;
[0160] A second determination sub-module, which is configured to determine whether the decrease amount of the RTT time of the congestion window is less than the second threshold according to the difference between this RTT time and the previous RTT time;
[0161] A second loop sub-module, which is configured to continue to reduce the length of the congestion window when the decrease amount is greater than or equal to the second threshold;
[0162] A second stop sub-module, which is configured to stop reducing the length of the congestion window and enter the dynamic measurement phase when the decrease amount is less than the second threshold.
[0163] In an alternative embodiment, the dynamic measurement module includes:
[0164] A third determination sub-module, configured to determine a first throughput and a second throughput for each RTT time;
[0165] A ratio determination sub-module, configured to determine an adjustment ratio of the congestion window for the current RTT time according to the first throughput and the second throughput.
[0166] In an alternative embodiment, the third determination sub-module includes:
[0167] A throughput determination unit, configured to determine, for each RTT time, a throughput corresponding to each ACK packet according to the ACK packets received by the congestion window during the RTT time;
[0168] A first throughput determination unit, configured to determine an average value of the throughputs of all ACK packets received by the congestion window during the RTT time as the first throughput;
[0169] A second throughput determination unit, configured to determine a maximum value among the throughputs of all the ACK packets during the RTT time as the second throughput.
[0170] In an alternative embodiment, the ratio determination sub-module includes:
[0171] A judgment unit, configured to judge, for each RTT time, whether the first throughput of the RTT time is greater than the first throughput of the previous RTT time;
[0172] A first adjustment unit, configured to, when the first throughput of the RTT time is greater than the first throughput of the previous RTT time, determine an adjustment ratio of the congestion window for the current RTT time according to the first throughput and the second throughput of the RTT time by using a first growth model;
[0173] A second adjustment unit, configured to, when the first throughput of the RTT time is less than or equal to the first throughput of the previous RTT time, determine an adjustment ratio of the congestion window for the current RTT time according to the first throughput and the second throughput of the RTT time by using a second growth model.
[0174] In an alternative embodiment, the first adjustment unit includes: a first calculation sub-unit, configured to determine the adjustment ratio of the congestion window according to the following formula:
[0175] In an alternative embodiment, the first adjustment unit includes: a first calculation subunit, configured to determine the congestion window adjustment ratio according to the following formula:
[0176]
[0177] where WAF i represents the congestion window adjustment ratio at the i-th RTT time, and WAF max represents the set maximum value of 2 / ln2, T m represents the second throughput at the (i - 1)-th RTT time, and T i-1 represents the first throughput at the (i - 1)-th RTT time. When i = 1, the initial WAF is set to WAF max ;
[0178] The second adjustment unit includes: a second calculation subunit, configured to determine the congestion window adjustment ratio according to the following formula:
[0179]
[0180] Based on the same inventive concept, this embodiment further provides a client, which is configured to execute the steps of the link bandwidth dynamic measurement method according to any one of the first aspects of this embodiment.
[0181] This application embodiment further provides an electronic device. Referring to Figure 4 ,, Figure 4 is a schematic structural diagram of the electronic device proposed in this application embodiment. As shown in Figure 4 , the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 is communicatively connected to the processor 120 through a bus. A computer program is stored in the memory 110, and the computer program can run on the processor 120, thereby implementing the steps of a link bandwidth dynamic measurement method disclosed in this application embodiment.
[0182] This application embodiment further provides a computer-readable storage medium, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, the steps of a link bandwidth dynamic measurement method disclosed in this application embodiment are implemented.
[0183] This application embodiment further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of a link bandwidth dynamic measurement method disclosed in this application embodiment are implemented.
[0184] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0185] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing terminal devices generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.
[0186] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0187] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or terminal device comprising the element.
[0188] The above provides a detailed introduction to a method, apparatus, and product for dynamically measuring link bandwidth of the present application. Specific examples are used in this text to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for dynamically measuring link bandwidth, characterized in that, The method includes: In the startup phase, every time an RTT elapses, control the length of the congestion window to increase by the length of the target packet until the increase in the throughput of the congestion window is less than the first threshold, and enter the drainage phase; In the drainage phase, every time an RTT elapses, control the length of the congestion window to decrease by the target ratio until the decrease in the RTT time of the congestion window is less than the second threshold, and enter the dynamic measurement phase; In the dynamic measurement phase, every time an RTT elapses, determine the congestion window adjustment ratio for the current RTT time, and adjust the length of the congestion window according to the congestion window adjustment ratio; Adjust the length of the congestion window multiple times until, within a continuous plurality of RTT times, the change in the length of the congestion window is within the target range, and determine the link bottleneck bandwidth based on the length of the congestion window in the last RTT time.
2. The link bandwidth dynamic measurement method according to claim 1, characterized in that The step of, every time an RTT elapses, controlling the length of the congestion window to increase by the length of the target packet until the increase in the throughput of the congestion window is less than the first threshold, includes: Set the length of the initial congestion window to one MSS; Every time an RTT elapses, control the length of the congestion window to increase by one MSS; Every time an RTT elapses, calculate the throughput of the congestion window corresponding to this RTT time according to the number of ACK packets received by the congestion window within this RTT time; Determine whether the increase in the throughput of the congestion window is less than the first threshold according to the difference between the throughput of the congestion window corresponding to this RTT time and the throughput of the congestion window corresponding to the previous RTT time; In the case where the increase is greater than or equal to the first threshold, continue to expand the length of the congestion window; In the case where the increase is less than the first threshold, stop expanding the length of the congestion window and enter the drainage phase.
3. The link bandwidth dynamic measurement method according to claim 1, characterized in that The step of, every time an RTT elapses, controlling the length of the congestion window to decrease by the target ratio until the decrease in the RTT time of the congestion window is less than the second threshold, includes: Every time an RTT elapses, control the length of the congestion window to decrease at a ratio of ln2 / 2, and record this RTT time; Determine whether the decrease in the RTT time of the congestion window is less than the second threshold according to the difference between this RTT time and the previous RTT time; In the case where the decrease is greater than or equal to the second threshold, continue to decrease the length of the congestion window; In the case where the decrease is less than the second threshold, stop decreasing the length of the congestion window and enter the dynamic measurement phase.
4. The method for dynamically measuring link bandwidth according to claim 1, characterized in that, The step of, every time an RTT elapses, determining the congestion window adjustment ratio for the current RTT time, includes: Every time an RTT elapses, determine the first throughput and the second throughput for this RTT time; Determine the congestion window adjustment ratio for the current RTT time according to the first throughput and the second throughput.
5. The link bandwidth dynamic measurement method according to claim 4, characterized in that The step of, every time an RTT elapses, determining the first throughput and the second throughput for this RTT time, includes: Every time an RTT elapses, based on the ACK packets received by the congestion window during this RTT, determine the throughput corresponding to each of the ACK packets; Determine the average value of the throughputs of all the ACK packets received by the congestion window during this RTT as the first throughput; Determine the maximum value among the throughputs of all the ACK packets during this RTT as the second throughput.
6. The method for dynamically measuring link bandwidth according to claim 4, wherein The determining of the adjustment ratio of the congestion window for the current RTT based on the first throughput and the second throughput includes: Every time an RTT elapses, determine whether the first throughput of this RTT is greater than the first throughput of the previous RTT; When the first throughput of this RTT is greater than the first throughput of the previous RTT, based on the first throughput and the second throughput of this RTT, use the first growth model to determine the adjustment ratio of the congestion window for the current RTT; When the first throughput of this RTT is less than or equal to the first throughput of the previous RTT, based on the first throughput and the second throughput of this RTT, use the second growth model to determine the adjustment ratio of the congestion window for the current RTT.
7. The method for dynamically measuring link bandwidth according to claim 6, wherein The using of the first growth model to determine the adjustment ratio of the congestion window for the current RTT includes: Calculate the adjustment ratio of the congestion window according to the following formula: Among them, WAF i represents the congestion window adjustment ratio at the i-th RTT time, WAF max represents the set maximum value of 2 / ln2, T m represents the second throughput at the (i - 1)-th RTT time, T i-1 represents the first throughput at the (i - 1)-th RTT time. Among them, when i = 1, the initial WAF is set to WAF max ; The using of the second growth model to determine the adjustment ratio of the congestion window for the current RTT includes: Calculate the adjustment ratio of the congestion window according to the following formula:
8. A link bandwidth dynamic measurement device, characterized in that The device includes: A start module, used for, during the start phase, every time an RTT elapses, control the length of the congestion window to increase by the target packet length until the increase amount of the throughput of the congestion window is less than the first threshold, and enter the emptying phase; An emptying module, used for, during the emptying phase, every time an RTT elapses, control the length of the congestion window to decrease by the target multiple until the decrease amount of the RTT of the congestion window is less than the second threshold, and enter the dynamic measurement phase; A dynamic measurement module, used for, during the dynamic measurement phase, every time an RTT elapses, determine the adjustment ratio of the congestion window for the current RTT, and adjust the length of the congestion window according to the adjustment ratio of the congestion window; A bandwidth determination module, used for adjusting the length of the congestion window multiple times until, within a continuous plurality of RTTs, the change amount of the length of the congestion window is within the target range, and determine the link bottleneck bandwidth according to the length of the congestion window during the last RTT.
9. A client, characterized in that, The client is used to execute the steps of the link bandwidth dynamic measurement method according to any one of claims 1-7.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the link bandwidth dynamic measurement method according to any one of claims 1-7.
Citation Information
Patent Citations
Bandwidth detection method and device, electronic equipment and storage medium
CN115348196A
Optimization method for data retransmission of BBR congestion control algorithm
CN116155825A