Congestion control method, electronic device and readable storage medium
By determining the transmission rate and data amount every time the ACK packet is received in the transmitting device, the problem of high accuracy requirements of timer in the prior art is solved, and equipment that does not have high-precision timers supports pacing transmission, which improves the scope of application and reduces costs.
Patent Information
- Application Number
- CN202210705865.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-06-21
AI Technical Summary
In the prior art, the congestion control method has high requirements for the timer accuracy, which leads to electronic devices that do not have high-precision timers that cannot support pacing transmission, which limits the scope of application of pacing transmission method.
By determining the transmission rate after each ACK packet is received in the transmitting device, and determining the data amount according to the transmission rate and the time interval of the adjacent two rounds of transmission, the smooth transmission of data packets is achieved. This method does not need to support high-precision timers, but only supports millisecond-level timers.
It realizes that electronic devices that do not have high-precision timers can also support pacing transmission, which improves the scope of application of pacing transmission methods, reduces the cost of supporting smooth transmission, and reduces network jitter and packet loss.
Smart Images

Figure CN115277556B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a congestion control method, an electronic device and a readable storage medium. Background Art
[0002] With the rapid development of Internet technology, network bandwidth and user scale have exploded. Network data has changed from the initial text transmission and web browsing to audio and video transmission, game audio and video, etc., and network data is becoming increasingly complex.
[0003] During network data transmission, network data congestion often occurs due to reasons such as excessive network data volume or network transmission bandwidth limitation, which affects network transmission performance. In order to solve the problem of network data congestion, the bottleneck bandwidth and round-trip propagation time (BBR) congestion control method is usually used to adjust the amount of data sent by the sender. Based on the BBR congestion control method, the sender device dynamically adjusts the congestion window (CWND) and packet sending rate (pacing rate) during network transmission by measuring the bottleneck bandwidth and round-trip propagation delay.
[0004] The above-mentioned BBR congestion control method has high requirements on the accuracy of the timer, requiring the timer accuracy to be at least at the microsecond level. However, many electronic devices such as mobile phones and tablets cannot provide high-precision timers, resulting in the inability to perform congestion control. Summary of the invention
[0005] The present application provides a congestion control method, an electronic device and a readable storage medium. Since the requirements for timer accuracy are relatively low, electronic devices that do not have a high-precision timer can also support pacing sending, thereby improving the scope of application of the pacing sending method.
[0006] In a first aspect, an embodiment of the present application provides a congestion control method, which is applied to a sending end device, and the method includes:
[0007] After each ACK packet is received, the sending rate is determined;
[0008] Determine a time interval between a first moment and a second moment, wherein the first moment and the second moment are initial moments of each round of transmission in two adjacent rounds of transmission, the second moment is a moment when the transmitting end device first sends a data packet after receiving the ACK packet, and the time interval is a time interval in milliseconds;
[0009] Determining the data volume according to the time interval and the sending rate;
[0010] At the second time, a data packet is sent according to the data amount.
[0011] In a second aspect, an embodiment of the present application provides a congestion control device, including:
[0012] A first determination module, configured to determine a transmission rate after the transmitting end device receives an ACK packet each time;
[0013] A second determining module is used to determine a time interval between a first moment and a second moment, wherein the first moment and the second moment are the initial moments of each round of transmission in two adjacent rounds of transmission, and the second moment is the moment when the transmitting end device first sends a data packet after receiving the ACK packet, and the time interval is a time interval in milliseconds;
[0014] A processing module, used for determining the data volume according to the time interval and the sending rate;
[0015] A transceiver module is used to send a data packet according to the data volume at the second moment.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method described in the first aspect or various possible implementation methods of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement the method described in the first aspect or various possible implementation methods of the first aspect.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computing program, and when the computer program is executed by a processor, the method described in the first aspect or various possible implementation methods of the first aspect is implemented.
[0019] The congestion control method, electronic device and readable storage medium provided by the embodiment of the present application, after each time the sending end device receives an ACK packet, it determines a new sending rate, and determines the amount of data to be sent in a new round of sending according to the sending rate and the time interval between two adjacent rounds of sending. Afterwards, when the current time reaches the second moment, that is, the moment of a new round of sending, the data packets are sent at a uniform speed according to the sending rate and the amount of data, so that the sending of these data packets can be sent smoothly. With this solution, there is no need for the sending end device to support a high-precision timer, but only supports a millisecond-level timer to ensure the smooth sending of the data packet, reducing the cost of the sending device to support smooth sending. Moreover, compared with burst sending, it can reduce network jitter and packet loss, and can reduce the queuing time of the data packet. In addition, there is no need for the electronic device to process high-precision timing tasks, which is conducive to reducing the power consumption of the electronic device and improving the endurance of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 It is a schematic diagram of the network architecture of the congestion control method provided in the embodiment of the present application;
[0022] Figure 2 is a flow chart of a congestion control method provided by an embodiment of the present application;
[0023] Figure 3 is another flow chart of the congestion control method provided by an embodiment of the present application;
[0024] Figure 4 It is a flow chart of parameter setting after each data packet is sent in the congestion control method provided in an embodiment of the present application;
[0025] Figure 5 It is a flow chart of a sending end device determining bandwidth according to ACK in a congestion control method provided in an embodiment of the present application;
[0026] Figure 6 This is a flow chart of determining a sending rate in a congestion control method provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of a congestion control device provided in an embodiment of the present application;
[0028] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0030] Compared with burst transmission, pacing transmission is a stable transmission. Based on pacing transmission, the sending device sends data to the receiving end at a uniform rate over a period of time. Currently, many network transmission protocols support pacing transmission. Pacing transmission has the following advantages:
[0031] 1. Reduce network jitter and packet loss caused by burst data;
[0032] 2. Reduce the queuing time of data in the intermediate router cache;
[0033] 3. More friendly to other streams transmitted in the network.
[0034] Obviously, pacing sending can improve end-to-end bandwidth utilization and quality of service (QoS).
[0035] Usually, pacing transmission requires high timer accuracy. For example, BBR pacing transmission of Transmission Control Protocol (TCP) requires the timer accuracy to be at least microsecond level. Therefore, this type of pacing transmission can only be used for devices with high hardware performance, such as Linux devices. The Linux device kernel uses high-precision hardware timers for pacing transmission, and the timer accuracy is at nanosecond level.
[0036] However, many devices currently have poor hardware performance and are unable to provide nanosecond-level timers, which results in these devices being unable to support pacing sending.
[0037] Moreover, even if an electronic device can provide a nanosecond-level timer, the frequent processing of high-precision timing tasks consumes a lot of battery power of the electronic device, making it impossible for the electronic device to frequently run a high-precision timer.
[0038] Furthermore, for Hyper Text Transfer Protocol (HTTP) or other application layer transmission protocols, scheduling delays may also cause the pacing to be unable to be sent in time.
[0039] Obviously, the current pacing sending method, due to the high requirements on timer accuracy, makes it impossible for some electronic devices with low timer accuracy to implement pacing sending. Moreover, even if an electronic device supports a high-precision timer, the frequent processing of timer tasks consumes a lot of battery power, so the current pacing sending method cannot be frequently run on devices with high-precision timers.
[0040] Based on this, the embodiment of the present application provides a congestion control method, an electronic device and a readable storage medium. Since the requirements for timer accuracy are relatively low, electronic devices that do not have high-precision timers can also support pacing transmission, thereby increasing the scope of application of the pacing transmission method and ensuring the smooth transmission of data packets. Moreover, there is no need for electronic devices to process high-precision timing tasks, which is conducive to reducing the power consumption of electronic devices and improving the endurance of electronic devices.
[0041] Figure 1 This is a schematic diagram of the network architecture of the congestion control method provided in the embodiment of the present application. Figure 1 The network architecture includes a sending end device 11 and a receiving end device 12. A network connection is established between the sending end device 11 and the receiving end device 12.
[0042] The sending end device 11 has a built-in low-precision timer, and the precision of the timer is, for example, at the millisecond level. The sending end device 11 can be a mobile phone, tablet computer, personal computer, e-book reader, laptop computer, desktop computer, etc., which is installed with an Android operating system, a Microsoft operating system, a Symbian operating system, a Linux operating system, or an Apple iOS operating system. Alternatively, the sending end device 11 can also be a server, etc.
[0043] The receiving device 12 has computing capability, storage capability, etc., and can respond to the sending device 11. For example, the receiving device 12 is a server, etc. For another example, the receiving device 12 is a mobile phone, etc.
[0044] In the embodiment of the present application, the sending device 11 and the receiving device 12 are relative. For example, when device A sends a data packet to device B, device A is the sending device and device B is the receiving device. When device B sends data to device A, device B is the sending device and device A is the receiving device.
[0045] It should be understood that Figure 1 The number of the sending end device 11 and the receiving end device 12 in the embodiment is only for illustration. In actual implementation, any number of the sending end device 11 and the receiving end device 12 may be deployed according to actual requirements. Moreover, there may be multiple network nodes between the sending end device 11 and the receiving end device 12.
[0046] Below, based on Figure 1 The network architecture shown in the figure is used to describe in detail the congestion control method provided in the embodiment of the present application. Figure 2 . Figure 2 1 is a flow chart of a congestion control method provided by an embodiment of the present application. This embodiment is described from the perspective of a transmitting device, and this embodiment includes:
[0047] 201. After receiving an ACK packet each time, determine the sending rate.
[0048] In the embodiment of the present application, the transmitting device sends data packets to the receiving device in batches. A batch is also called a round. There are multiple data packets to be sent in a batch. In a round of transmission, the transmitting device sends data packets according to the determined transmission rate (pacing rate). For example, if 10 data packets are sent in a round, the transmitting device sends these 10 data packets to the receiving device at a uniform speed according to the pacing rate.
[0049] From the perspective of the sending device, after a data packet is sent, it may be in three states:
[0050] The first type is that the sending device receives an acknowledgement (ACK) packet from the receiving device within a preset time period. This data packet is called a confirmed or delivered data packet, or also called a correct packet.
[0051] Second, if the receiving device does not receive the ACK packet after the preset time, packet loss occurs.
[0052] The third type is that if the sending device has not received the ACK packet within the preset time, this data packet is called in-flight data.
[0053] In addition, in the embodiment of the present application, an ACK packet indicates that at least one data packet is correctly received. For example, in one round of transmission, the transmitting end device sends 10 data packets, namely, data packet 1 to data packet 10. No ACK packet is received during the process of sending these 10 data packets. After sending data packet 10, an ACK packet is received. The ACK packet is used to indicate a data packet that has been correctly received by the receiving end.
[0054] If the ACK packet indicates that data packets 1 to 10 are all received, it means that the flight data is 0.
[0055] If the ACK packet indicates that data packets 1 to 5 are received, it means that there is flying data, and the flying data is data packets 6 to 10.
[0056] For another example, in the first round of transmission, the transmitting device transmits data packets 1 to 10, and in the second round of transmission, the transmitting device transmits data packets 11 to 15. When transmitting data packet 11, the transmitting device receives ACK packet a, which indicates that the receiving device correctly receives data packets 1 to 5. After transmitting data packet 15, the transmitting device receives ACK packet b, which indicates that the receiving device correctly receives data packets 6 to 12.
[0057] Each time the sending device receives an ACK, it re-determines the sending rate.
[0058] 202. Determine the time interval between a first moment and a second moment, wherein the first moment and the second moment are the initial moments of each round of transmission in two adjacent rounds of transmission, and the second moment is the moment when the transmitting device first sends a data packet after receiving the ACK packet, and the time interval is a time interval in milliseconds.
[0059] Exemplarily, there is a time interval between two adjacent rounds of transmission, and the time interval has no necessary connection with the reception and processing of the ACK packet. Assuming that the two adjacent rounds of transmission are the first round and the second round, the initial moment of sending the data packet in the first round is the first moment, the initial moment of sending the data packet in the second round is the second moment, and there is a time interval between the first moment and the second moment. This time interval can be a time interval at the millisecond level. For example, if the first moment is 11:00 and the time interval is 30 milliseconds, the time of sending the data packet next time, that is, the second moment is 11:00:00:30. Among them, the time interval can be expressed as pacing_interval.
[0060] 203. Determine a data amount according to the time interval and the sending rate.
[0061] For example, the sending device determines the data volume according to the product of the time interval and the sending rate, and this data volume is the number of data packets to be sent in the next round.
[0062] For another example, the sending device considers the current network conditions, sets some coefficients for different network conditions, and determines the data volume based on the coefficients, time intervals, and sending rates.
[0063] Since the time interval is a millisecond-level time interval, the data volume determined according to the time interval and the transmission rate can enable a transmitting device with a millisecond-level timer to transmit on time.
[0064] 204. Send a data packet according to the data volume at the second moment.
[0065] After the sending end device determines the time interval, it counts down according to the time interval, and when the countdown ends, it indicates that the current moment is the second moment. At this time, the sending end device starts sending a new round of data packets at the second moment.
[0066] The congestion control method provided by the embodiment of the present application is that after the sending end device receives an ACK packet each time, it determines a new sending rate, and determines the amount of data to be sent in a new round of sending according to the sending rate and the time interval between two adjacent rounds of sending. Afterwards, when the current time reaches the second moment, that is, the moment of a new round of sending, the data packets are sent at a uniform speed according to the sending rate and the amount of data, so that the sending of these data packets can be sent smoothly. With this solution, there is no need for the sending end device to support a high-precision timer, but only to support a millisecond-level timer to ensure the smooth sending of the data packet, thereby reducing the cost of the sending device to support smooth sending. Moreover, compared with burst sending, network jitter and packet loss can be reduced, and the queuing time of the data packet can be reduced. In addition, there is no need for electronic devices to process high-precision timing tasks, which is conducive to reducing the power consumption of electronic devices and improving the endurance of electronic devices.
[0067] Optionally, in the above embodiment, in the process of determining the time interval between the first moment and the second moment, the transmitting end device first updates the network state parameter according to the ACK packet. Then, the time interval is determined according to the updated network state parameter. The network state parameter includes bandwidth, congestion window, round-trip time (RTT), packet loss rate, etc.
[0068] In the embodiment of the present application, the updated network status parameter reflects the current network status to a certain extent. The transmitting end device can determine the time interval according to one or more network status parameters.
[0069] For example, if the updated network status parameters include bandwidth (BW) and maximum segment size (MSS), the sending device determines the packet per second (PPS) based on the bandwidth and MSS. Then, a time interval is determined based on the PPS. For example, BW=200KBps, MSS=1400, then PPS=BW / MSS=146. The sending device pre-stores a mapping table that stores the corresponding relationship between PPS and time interval. The sending device can find out from the PPS table that the time interval is 10 milliseconds.
[0070] For another example, the updated network status parameters include RTT. If the RTT is relatively large, the time interval is increased; if the RTT is relatively small, the time interval is decreased.
[0071] For another example, the updated network status parameters include the packet loss rate. If the packet loss rate is relatively large, the time interval is increased; if the packet loss rate is relatively small, the time interval is decreased.
[0072] For another example, the updated network status parameters include RTT and bandwidth. If both RTT and bandwidth are relatively large, the time interval is reduced; if both RTT and bandwidth are relatively small, the time interval is increased.
[0073] Although in the above examples, the transmitting end device determines the time interval according to one or two network status parameters of bandwidth, RTT or packet loss rate, however, the embodiment of the present application is not limited, and in other feasible implementations, the transmitting end device can determine the time interval according to three or more network status parameters.
[0074] With this solution, the sending device determines the time interval based on the updated network status parameters, and then determines the time for the next data packet transmission, with high accuracy and high speed.
[0075] Optionally, in the above embodiment, when the transmitting end device sends a data packet according to the data volume at the second moment, first, the size of the congestion window is determined according to the ACK packet. Then, it is determined whether the flight data volume is less than the congestion window, and the flight data volume is the flight data volume determined after the transmitting end device receives the ACK packet. If the flight data volume is less than the congestion window, a timer is set according to the timeout interval. Then, when the timer times out, a data packet is sent according to the data volume.
[0076] Exemplarily, each time the sending end device receives an ACK packet, it updates the network status parameters, determines a sending rate based on the updated network status parameters, sets a timer based on the time interval, and calculates a data volume based on the sending rate and the time interval. At the same time, the sending end device determines whether the amount of flight data after processing the ACK packet is less than the updated congestion window. If the amount of flight data is less than the congestion window, it means that the network is not congested and data can still be sent. Therefore, after the timer times out, the sending end device sends a data packet based on the data volume. If the amount of flight data is greater than or equal to the congestion window, it means that the network is congested and no data can be sent. Therefore, even if the timer times out, the data packet is not sent.
[0077] With this solution, the sending device needs to determine whether the network is congested every time it starts the timer according to the time interval. Only when the network is not congested, the data packet is sent when the timer times out, which can effectively avoid network congestion and ensure network quality.
[0078] Figure 3 is another flow chart of the congestion control method provided by an embodiment of the present application. This embodiment includes:
[0079] 301. The sending device receives an ACK packet.
[0080] 302. The sending device updates the network status parameters according to the ACK packet.
[0081] Network status parameters include bandwidth, CWND, RTT, etc.
[0082] 303. The sending device determines a sending rate according to the updated network status parameters.
[0083] 304. The transmitting device determines the time interval between the first moment and the second moment.
[0084] The first moment and the second moment are the initial moments of each round of transmission in two adjacent rounds of transmission, the second moment is the moment when the transmitting end device first sends a data packet after receiving the ACK packet, and the time interval is a millisecond-level time interval.
[0085] 305. Determine the data volume according to the time interval and the sending rate.
[0086] 306. The sending end device determines whether the amount of flight data after processing the ACK packet is less than the congestion window. If the amount of flight data is less than the congestion window, execute step 306; if the first amount of flight data is greater than or equal to the congestion window, end.
[0087] The congestion window is the congestion window updated according to the ACK packet after the sending device receives the ACK packet.
[0088] 307. Set a timer according to a time interval.
[0089] 308. When the timer times out, send the data packet according to the data volume. The time when the timer times out is the second time.
[0090] For example, the first moment is 11:00. After processing the ACK packet, the sending device determines that the amount of flight data is less than CWND. If the time interval is 30 milliseconds, that is, the second moment is 11:00:00:30 milliseconds, the sending device starts a 30-millisecond timer at the first moment. After the timer expires, that is, at the second moment, the data packet is sent.
[0091] Optionally, in the above embodiment, after the transmitting end device sends the data packet according to the data volume at the second moment, it needs to set parameters such as timestamp after each data packet is sent. Figure 4 .
[0092] Figure 4 This is a flow chart of parameter settings after each data packet is sent in the congestion control method provided in an embodiment of the present application. This embodiment includes:
[0093] 401. The sending end device sends a data packet P at the second moment.
[0094] The sending device determines the data volume according to the sending rate and the time interval. After the timer times out, that is, at the second moment, the sending device sends a data packet according to the data volume. Assuming that the data volume is 10, 10 data packets need to be sent, and data packet P is any one of the 10 data packets.
[0095] 402. The transmitting end device determines whether the amount of flight data before the second moment is 0. If the amount of flight data is 0, execute step 403; if the amount of flight data is not 0, execute step 404.
[0096] Exemplarily, each time after the transmitting end device sends a data packet P, it determines whether the amount of flight data before sending the data packet P, that is, before the second moment, is 0.
[0097] In the embodiment of the present application, the amount of flight data is represented by a variable, such as inflight. The value of inflight is different at different times. In general, as data transmission proceeds, the value of inflight increases after the sending device sends a data packet. The value of inflight decreases after the sending device processes the ACK. The value of inflight also decreases after the sending device determines that a packet is lost.
[0098] 403. Set the global reference sending time and the global reference ACK time as the sending time of the data packet. Then, execute step 404.
[0099] Exemplarily, assuming that the sending time of the data packet P is p.sent.time, the global reference sending time is cn.first_tx_time, and the global reference ACK time is cn.delievered_time, then cn.first_tx_time=p.sent.time, cn.delievered_time=p.sent.time.
[0100] For example, if the sending time p.sent.time of data packet P is 11 o'clock, then cn.first_tx_time=p.sent.time=11 o'clock, and cn.delievered_time= p.sent.time=11 o'clock.
[0101] 404. For each data packet P, set a reference sending time of the data packet P and a reference ACK time of the data packet P.
[0102] The base sending time of data packet P is p.first_tx_time=cn.first_tx_time;
[0103] The base ACK time of data packet P is p.delievered_time = cn.delievered_time.
[0104] Continuing with the above example, since the global reference sending time cn.first_tx_time is 11 o'clock and the global reference ACK time cn.delievered_time is also 11 o'clock, the reference sending time p.first_tx_time of data packet P = cn.first_tx_time = 11 o'clock, and the reference ACK time p.delievered_time of data packet P = cn.delievered_time = 11 o'clock.
[0105] For each data packet P, it has a reference transmission time of the data packet P and a reference ACK time of the data packet P, which are collectively referred to as the timestamp of the data packet P. The sending end device records the timestamp of each data packet P. After receiving the ACK packet at the second moment, the sending end device determines the correct packet that has been correctly received by the receiving end device according to the ACK packet. According to the timestamp of the correct packet, the round corresponding to the correct packet can be determined, that is, the correct packet is the data packet sent by the sending end device in which round.
[0106] In the embodiment of the present application, from the perspective of the transmitting device, the sending of the data packet and the processing of the ACK packet are serial. The transmission modes include the following two:
[0107] The first transmission mode: in each round of transmission, the second flight data volume is 0.
[0108] For example, in the first round of transmission, the transmitting device performs the following two steps in sequence:
[0109] Step a, sending data packets 1 to 10;
[0110] Step b, receiving and processing an ACK packet, wherein the ACK packet indicates that the receiving device correctly receives data packets 1 to 10;
[0111] In the second round of transmission, the sending device performs the following two steps in sequence:
[0112] Step c, sending data packets 11-20;
[0113] Step d, receiving and processing an ACK packet, the ACK packet indicating that the receiving device correctly receives data packets 11 to 20;
[0114] In the third round and subsequent transmissions, before each round of transmission, the amount of second flight data is 0, that is, inflight=0, and there is no flight data.
[0115] The second transmission mode: starting from the second round, there is a situation where the amount of second flight data is not zero.
[0116] For example, in the first round of transmission, the transmitting device performs the following two steps in sequence:
[0117] Step e, sending data packets 1 to 10;
[0118] Step f, receiving and processing an ACK packet, wherein the ACK packet indicates that the receiving device correctly receives data packets 1 to 5;
[0119] In the second round of transmission, the sending device performs the following two steps in sequence:
[0120] Step e, sending data packets 11 to 15;
[0121] Step f, receiving and processing an ACK packet, wherein the ACK packet indicates that the receiving device correctly receives data packets 6 to 13;
[0122] Obviously, starting from the second round, the second flight data volume is not 0, and in subsequent rounds, the second flight data volume may be 0 or not 0.
[0123] In the second transmission mode, the correct packet indicated by the ACK packet includes part of the data packets sent by the transmitting device in the round corresponding to the first moment. Since the first transmission mode is an ideal mode and the second transmission mode is a universal mode, the universality of the congestion control method provided in the embodiment of the present application can be ensured.
[0124] After each data packet is sent, the transmitting device sets some timestamps according to the second flight data volume before sending the data packet, such as the global reference sending time, the global reference ACK time, the reference sending time of data packet P, the reference ACK time of data packet P, etc. In this way, after receiving the ACK packet, the transmitting device can determine in which round a data packet P is sent. Furthermore, when processing the ACK packet, the transmitting device calculates the sampling bandwidth based on the round.
[0125] With this solution, each time the sending device sends a data packet P, it will set some parameters to facilitate determining the round of the correct packet indicated by the ACK packet, thereby facilitating the subsequent accurate calculation of the bandwidth.
[0126] Optionally, in the above embodiment, after the transmitting end device receives an ACK packet each time, in the process of determining the transmission rate, a correct packet is determined according to the ACK packet, the correct packet is a data packet indicated by the ACK packet and correctly received by the receiving end device, and there is at least one correct packet. Afterwards, the bandwidth is determined according to the correct packet, and then the transmission rate is determined according to the bandwidth.
[0127] Exemplarily, an ACK packet indicates one or more data packets correctly received by the receiving device. For example, in a round of transmission, the transmitting device sends data packets 1 to 10, and then receives an ACK packet. The transmitting device determines that the receiving device correctly receives data packets 1 to 5 based on the ACK packet.
[0128] After the transmitting device determines the data packets that have been correctly received by the receiving device based on the ACK packet, it regards these data packets as correct packets. For each correct packet, the transmitting device updates the transmission information based on the correct packet. The transmission information includes but is not limited to rate sample parameters, global reference transmission time (cn.first_tx_time), global reference ACK time (cn.delievered_time), etc. The rate sample parameters include sample size (rs.prior_delivered_size), sample time (rs.prior_delivered_tome), etc.
[0129] After the transmitting device updates the transmission information, the bandwidth is determined according to the updated transmission information, and then the transmission rate can be determined according to the bandwidth.
[0130] With this solution, the sending device updates the bandwidth each time it receives an ACK, thereby achieving the purpose of accurately determining the sending rate.
[0131] Figure 5 This is a flow chart of a sending end device determining bandwidth according to ACK in a congestion control method provided in an embodiment of the present application. This embodiment includes:
[0132] 501. The sending device receives an ACK packet and initializes rate sample parameters.
[0133] The rate sample parameters include sample size (rs.prior_delivered_size) and sample time (rs.prior_delivered_time). After initialization, the sample size (rs.prior_delivered_size) is 0 and the sample time (rs.prior_delivered_time) is 0.
[0134] 502. Update transmission parameters according to each correct packet.
[0135] The sending device can determine the data packets correctly received by the receiving device based on the ACK packet, and these data packets are called correct packets. For example, the sending device sends data packets 1 to 10, and receives an ACK packet after sending data packet 10. The sending device determines that the data packets correctly received by the receiving device include data packets 1 to 5 based on the ACK packet, and these 5 data packets are correct packets.
[0136] For each correct packet, the process of the transmitting device updating the transmission parameters includes step 5021, step 5022, and step 5023.
[0137] 5021. Update the global confirmed data volume.
[0138] The global confirmed data size cn.delievered_size = cn.delievered_size + p.data_size.
[0139] Continuing with the above example, before receiving the ACK packet, the global confirmed data volume cn.delievered_size = 0, and after the sending end device receives the ACK packet, the global confirmed data volume cn.delievered_size = cn.delievered_size + 1 = 1. Obviously, since the sending end device determines that the receiving end device has correctly received data packets 1 to 5 according to the ACK packet, the sending end device executes steps 5021 to 5023 for each of the 5 data packets, and the global confirmed data volume cn.delievered_size = 5.
[0140] 5022. The sending end device determines whether the global confirmed data volume (p.delivered_size) is greater than the sample size (rs.prior_delivered_size) when sending data packet P. If p.delivered_size>rs.prior_delivered_size, execute step 5023; if p.delivered_size≤rs.prior_delivered_size, execute step 503.
[0141] Exemplarily, p.delivered_size indicates the amount of globally confirmed data when data packet P is sent.
[0142] 5023. The sending device updates the current round of transmission information.
[0143] Updates to the transfer information include:
[0144] A. Sample size rs.prior_delivered_size = p.delivered_size;
[0145] B. Sample time rs.prior_delivered_tome = p.delivered_time;
[0146] C. Global reference sending time cn.first_tx_time=p.sent_time;
[0147] D. Global benchmark ACK time cn.delievered_time = now, where now represents the current time;
[0148] E. Send interval duration send_interval = global reference send time cn.first_tx_time - reference send time p.first_tx_time of data packet p;
[0149] F. ACK interval duration ack_interval = global benchmark ACK time cn.delievered_time - sample time rs.prior_delivered_time.
[0150] 503. The sending end device determines whether there are any unprocessed correct packets. If there are any unprocessed correct packets, the process returns to step 5021. If there are no unprocessed correct packets, the process proceeds to step 504.
[0151] Exemplarily, for each correct packet, for example, an ACK packet indicates that data packet 1 to data packet 5 are correctly received, then the transmitting device executes the above steps 5021 to 5023 for each of the five correct packets.
[0152] 504. The sending end device determines whether the sample size (rs.prior_delivered_size) is greater than 0. If the sample size (rs.prior_delivered_size) is greater than 0, execute step 505; if the sample size (rs.prior_delivered_size) is less than or equal to 0, end.
[0153] 505. The sending device calculates the bandwidth.
[0154] The specific determination process is as follows:
[0155] First, the sending device calculates the amount of data confirmed in this round, rs.delivered_size.
[0156] For example, rs.delivered_size = global confirmed data size cn.delievered_size - sample size (rs.prior_delivered_size).
[0157] Next, the transmitting device determines the sampling interval rs.interval.
[0158] Sampling interval rs.interval = max (send interval send_interval, ACK interval ack_interval)
[0159] Finally, the transmitting device determines the bandwidth rs.bw_sample.
[0160] Bandwidth rs.bw_sample = the amount of data confirmed in this round rs.delivered_size / sampling interval rs.interval.
[0161] With this solution, the sending device determines the bandwidth based on the amount of data confirmed in this round and the sampling interval, thereby achieving the purpose of accurately determining the bandwidth.
[0162] Figure 6 This is a flow chart of determining the sending rate in the congestion control method provided in an embodiment of the present application. This embodiment includes:
[0163] 601. The transmitting end device determines whether there is bandwidth. If there is bandwidth, execute step 602; if there is no bandwidth, execute step 603.
[0164] Exemplarily, each time the transmitting device receives an ACK packet, it determines whether the bandwidth can be calculated based on the ACK packet.
[0165] The embodiments of the present application are applicable to all wireless communication systems using pacing technology. The transmission protocol can be replaced with the TCP protocol using pacing, and the network can be replaced with the universal mobile telecommunications system (UMTS), high speed downlink package access (HSDPA), wireless local area network (WLAN), etc. The transmission protocol can use different congestion control algorithms. For example, for the Linux TCP protocol, if the BBR algorithm is used, the bandwidth will be calculated. If the CUBIC algorithm is used, the bandwidth will not be calculated.
[0166] 602. The sending device determines a sending rate according to the bandwidth.
[0167] For example, the pacing rate = bw × gain. Where bw is, for example, the above Figure 5 The bandwidth determined by the scheme shown is the currently measured and estimated bandwidth. gain identifies the transmission rate gain.
[0168] 603. The sending end device determines the sending rate according to at least one of the congestion window CWND, the maximum segment size MSS, the smoothed connection RTT, or the sending rate gain.
[0169] For example, pacing rate = (CWND × MSS / srtt) × gain. Among them, cwnd represents the congestion window obtained by the sending device receiving and processing ACK packets, MSS represents the maximum segment size, srtt represents the smoothed connection RTT, and gain represents the sending rate gain.
[0170] In this way, when the sending device cannot determine the bandwidth according to the ACK packet, the sending rate is determined according to other parameters, which has high flexibility and high accuracy.
[0171] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0172] Figure 7 A schematic diagram of a congestion control device provided in an embodiment of the present application. The congestion control device 700 includes: a first determination module 71 , a second determination module 72 , a processing module 73 and a transceiver module 74 .
[0173] A first determination module 71, configured to determine a transmission rate after the transmitting end device receives an ACK packet each time;
[0174] A second determining module 72 is used to determine a time interval between a first moment and a second moment, wherein the first moment and the second moment are the initial moments of each round of transmission in two adjacent rounds of transmission, and the second moment is the moment when the transmitting end device first sends a data packet after receiving the ACK packet, and the time interval is a time interval in milliseconds;
[0175] A processing module 73, configured to determine the data volume according to the time interval and the sending rate;
[0176] The transceiver module 74 is used to send a data packet according to the data volume at the second moment.
[0177] In a feasible implementation, the second determination module 72 is used to update the network status parameters according to the ACK packet, and the network status parameters include at least one of the following parameters: bandwidth, congestion window CWND, round-trip time RTT, packet loss rate; and determine the time interval according to the network status parameters.
[0178] In a feasible implementation, the processing module 73 is further used to determine the size of the congestion window according to the ACK packet; if the amount of flight data is less than the congestion window, a timer is set according to the time interval, and the amount of flight data is the amount of flight data after the sending end device processes the ACK packet;
[0179] The transceiver module 74 is used to send a data packet according to the data volume when the timer times out.
[0180] In a feasible implementation, after the transceiver module 74 sends the data packet according to the data volume at the second moment, the processing module 73 is also used to record a timestamp for each data packet sent from the second moment, and the timestamp is used by the sending end device to determine the round of data packets indicated by the ACK packet received after the second moment.
[0181] In a feasible implementation, the first determination module 71 is used to determine the correct packet based on the ACK packet each time the transceiver module 74 receives an ACK packet, wherein the correct packet is a data packet indicated by the ACK packet and has been correctly received by the receiving device, and there is at least one correct packet; determine the bandwidth based on each correct packet; and determine the sending rate based on the bandwidth.
[0182] In a feasible implementation, when the first determination module 71 determines the bandwidth based on each correct packet, it is used to determine the round to which the correct packet belongs based on each correct packet; determine the number of confirmed data packets and the sampling interval of the round to which the correct packet belongs; and determine the bandwidth based on the number of confirmed data packets and the sampling interval.
[0183] In a feasible implementation, the first determination module 71 is further used to determine the sending rate according to at least one of a congestion window CWND, a maximum segment length MSS, a smoothed connection RTT or a sending rate gain when the bandwidth cannot be determined.
[0184] In a feasible implementation, the correct packet indicated by the ACK packet includes part of the data packets sent by the sending device in the round corresponding to the first moment.
[0185] The congestion control device provided in the embodiment of the present application can execute the actions of the sending device in the above embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0186] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 is, for example, the above-mentioned transmitting end device, and the electronic device 800 includes:
[0187] Processor 81 and memory 82;
[0188] The memory 82 stores computer instructions;
[0189] The processor 81 executes the computer instructions stored in the memory 82, so that the processor 81 executes the congestion control method implemented by the sending end device as above.
[0190] The specific implementation process of the processor 81 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0191] Optionally, the electronic device 800 further includes a communication component 83 , wherein the processor 81 , the memory 82 and the communication component 83 may be connected via a bus 84 .
[0192] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement a congestion control method implemented by a sending device.
[0193] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the congestion control method implemented by the sending end device as above.
[0194] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0195] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A congestion control method, characterized in that: Applied to a transmitting device, the method comprises: After sending multiple data packets in the round corresponding to the first moment, after receiving an ACK packet each time, determining the sending rate of the round corresponding to the second moment, wherein the correct packet indicated by the ACK packet includes part of the data packets sent by the transmitting end device in the round corresponding to the first moment; Determine a time interval between a first moment and a second moment, wherein the first moment and the second moment are initial moments of each round of transmission in two adjacent rounds of transmission, the second moment is a moment when the transmitting end device first transmits a data packet after receiving the ACK packet, the time interval is a time interval in milliseconds, and multiple data packets are transmitted in each round of the two adjacent rounds of transmission; Determine, according to the time interval and the sending rate, the amount of data packets to be sent in the round corresponding to the second moment; Sending a data packet according to the data volume at the second moment; After sending a plurality of data packets in a round corresponding to the first moment, determining a round sending rate corresponding to the second moment after receiving an ACK packet each time, comprises: After receiving an ACK packet each time, determine a correct packet according to the ACK packet, wherein the correct packet is a data packet indicated by the ACK packet and has been correctly received by the receiving end device, and there is at least one correct packet; Determine the bandwidth according to each correct packet; Determining the sending rate according to the bandwidth; The determining of the bandwidth according to each correct packet includes: According to each correct package, determining the round to which the correct package belongs; Determine the number and sampling interval of confirmed data packets of the round to which the correct packet belongs; The bandwidth is determined according to the number of the confirmed data packets and the sampling interval.
2. The method according to claim 1, characterized in that Determining the time interval between the first moment and the second moment includes: Update the network status parameters according to the ACK packet, wherein the network status parameters include at least one of the following parameters: bandwidth, congestion window CWND, round trip time RTT, and packet loss rate; The time interval is determined according to the network status parameter.
3. The method according to claim 1, characterized in that The sending of the data packet according to the data volume at the second moment includes: Determine the size of the congestion window according to the ACK packet; If the amount of flight data is less than the congestion window, setting a timer according to the time interval, the amount of flight data being the amount of flight data after the transmitting end device processes the ACK packet; When the timer times out, a data packet is sent according to the data volume.
4. The method according to claim 1 or 2, characterized in that: After sending the data packet according to the data volume at the second moment, the method further includes: For each data packet sent from the second moment, a timestamp is recorded, and the timestamp is used by the sending end device to determine the round of the data packet indicated by the ACK packet received after the second moment.
5. The method according to claim 1, characterized in that Also includes: When the bandwidth cannot be determined, the sending rate is determined according to at least one of a congestion window CWND, a maximum segment size MSS, a smoothed connection RTT, or a sending rate gain.
6. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for controlling network congestion and related device
CN113872870A