Congestion control congestion for TCP (congestion)
At some time, if the demand for a resource in the network exceeds the available parts that the resource can provide, the performance of the network will become worse.
Congestion control
Congestion control is to prevent excessive data from being injected into the network, so that routers or links in the network are not overloaded.
, the horizontal axis is the provided load (offered load), which represents the number of packets entered into the network in unit time. Ordinate is the throughput (throughput) that represents the number of packets that are output from the network in unit time.
Ideal: Before the throughput saturation, the network throughput should be equal to the provided load , so the throughput curve is a 45-degree slash. However, when the load exceeds a certain limit, because the network resource is limited, the throughput is no longer growing and remains as a horizontal line, that is, the throughput is saturated.
Actual state: As the load provided increases, the rate of increase in network throughput decreases gradually. That is, when the network throughput has not reached saturation, a portion of the input groupings have been discarded. When the network throughput is significantly less than the ideal throughput, the network enters a state of mild congestion . When a given load reaches a certain value, the network's throughput decreases with the load it provides, and the network is in a congested state . When the supplied load continues to increase to a certain value, the network throughput drops to 0 and the network does not work, which is known as a deadlock (deadlock).
Several methods of congestion control
Slow Start (Slow-start)
The sender maintains a state variable called the congestion window CWnd (congestion windows). The size of the congestion window depends on the degree of congestion of the network and is dynamically changing.
The slow-start algorithm is this:
If a large number of data bytes are injected into the network immediately, it is possible to cause network congestion, so from small to large gradually increase the number of the sending window , that is, from small to large gradually increase the congestion window value .
First set CWnd = 1, send the first message segment M1, the receiving party after receiving confirmation M1. After the sender receives confirmation of the M1, it increases the CWnd from 1 to 2, and the sender then sends the M2 and M3 two pieces of message. The receiving party receives and sends back the confirmation to M2 and M3. Each sender receives a new message segment Confirmation , the sender's congestion window plus 1, so the sender received two confirmation, CWnd from 2 to 4, and can send m4-m7 a total of 4 message segments. Therefore, with the slow-start algorithm, the congestion window is doubled each pass through a transmission round.
A slow-start threshold ssthresh State variable is also required to prevent congestion in the case of a congested window CWnd that grows too large to cause network congestion. Use the following
When Cwnd<ssthresh, use the slow-start algorithm described above.
When Cwnd>ssthresh, stop using the slow start algorithm and use the congestion avoidance algorithm instead.
When Cwnd=ssthresh, you can use either the slow-start algorithm or the congestion avoidance algorithm.
Congestion avoidance algorithm (congestion avoidance)
Algorithm ideas:
Let the congestion window CWnd slowly increase, that is, every round trip time RTT will send the sender of the congestion window CWnd plus 1, instead of doubling. In this way, the congestion window CWnd grows slowly by linear law , and the congestion window grows much slower than the slow start of short hair.
Instance:
(1) In order to facilitate understanding, the window unit on the way without using bytes and the number of message segments. The initial value of the slow start threshold is set to 16 message segments. That is ssthresh=16.
(2) When performing a slow-start algorithm, the initial value of the congestion window CWnd is 1. The congestion window CWnd increases exponentially with the transmission rounds. When the congestion window CWnd grows to the slow-start threshold Ssthresh, it executes the congestion avoidance algorithm instead, and the congestion window grows linearly.
(3) Assuming that the value of the congestion window increases to 24 o'clock, the network time-out occurs. The updated Ssthresh value becomes 12 (that is, half of 24), the Congestion window is set to 1, and the slow start algorithm begins. When the cwnd=ssthresh=12 is implemented instead of congestion avoidance algorithm, the congestion window grows linearly.
Fast retransmission (Fast retransmit)
Algorithm ideas:
The receiver sends a duplicate confirmation immediately after receiving an out -of-sequence message segment and does not wait for the data to be sent for confirmation. , the receiving party received the M1 and M2 respectively issued a confirmation. It is assumed that the receiving party did not receive the M3, but received the M4. Obviously, the receiver cannot confirm the M4 because M4 is an out-of-sequence segment. According to the principle of reliable transmission, the receiver can do nothing, or at the appropriate time to send a confirmation of the M2. However, in the fast retransmission rules, the receiver should send a duplicate confirmation of the M2 in a timely manner, so that the sender can know earlier that the message segment M3 did not reach the receiving party. The sender then sends M5 and M6. Once received, the receiving party also has to issue a duplicate confirmation of the M2. In this way, the sender should immediately re-transmit the message segment M3 that the other party has not received as long as it receives three duplicate confirmations in a row, without waiting for the retransmission timer to expire.
Fast recovery (Fast recovery)
Algorithm idea:
When the sender receives three duplicate acknowledgments consecutively, the slow start algorithm is not executed, because the sender now thinks that the network is likely not to be congested, so, unlike slow start, the slow start algorithm is not performed now, but the CWnd value is set to the value of the slow start threshold ssthresh halved. The congestion avoidance algorithm is then started and the congestion window is slowly increasing linearly. , theTCP Reno version uses the fast recovery algorithm after fast retransmission, rather than the slow start algorithm .
Congestion Control of computer network (-----TCP)