TCP congestion control
The bandwidth in the computer network, the cache in the exchange node, and the processor are all network resources. In a certain period of time, if the demand for a certain resource on the network exceeds the available part of the resource, the network performance will deteriorate. This is called congestion.
Congestion Control is to prevent too much data from being injected into the network, so that the routers or links in the network are not overloaded. Congestion Control is a global process. Unlike traffic control, traffic control refers to point-to-point traffic control.
What is the difference between congestion control and traffic control?
1. Congestion Control: congestion control acts on the network. It prevents too much data from being injected into the network to avoid excessive network load;
2. Traffic Control: traffic control acts on the receiver. It controls the sender's transmission speed so that the receiver can receive the message in time.
PS: congestion control is for the network. It prevents too many groups from being written into the network, leading to network congestion. Traffic Control is for the receiver, it ensures that the receiver can receive the message in time by controlling the sender's sending speed.
What is the purpose of congestion control?
1. Ease Network Pressure
2. Ensure that the group arrives on time
Slow Start algorithm and congestion avoidance Algorithm
the sender maintains a sending window. The size of the sending window varies dynamically depending on the network congestion and the size of the receiving window.
the sender also maintains a slow start threshold
sending window sending WINDOW> slow start threshold: use the congestion avoidance algorithm
sending window = slow start threshold: Use the slow start algorithm or congestion avoidance algorithm
specific process of the algorithm:
when the communication starts, the sender's sending window is set to 1, and the first group M1 is sent.
after receiving the M1, the receiver returns a confirmation response. At this time, the sender's sending window is doubled, and send M2 and M3; (that is, each time the sender receives a confirmation response, the sending window is set to twice the current value)
If the sending WINDOW> slow start threshold, this algorithm is used to avoid congestion. After receiving a confirmation response, the sending window is added to 1.
If the sender times out and re-transmits the message, the network is congested:
A) the slow start threshold is set to half of the current sending window.
B) The sending window is set to 1.
C) the congestion avoidance algorithm is enabled;
PS: When the sending times out, the sending window may have exceeded the slow start threshold or not exceeded. In this case, all Enable the congestion avoidance algorithm and perform the preceding three steps!
slow start algorithm: the slow start algorithm expands the sending window from small to exponential, avoiding the congestion caused by injecting too many groups into the network from the beginning; the process of slowly expanding the window is actually detecting network congestion. When congestion is detected, the transmission speed is reduced in time to reduce network congestion.
the function of the congestion avoidance algorithm is to prevent the algorithm from linearly increasing the sending window rather than exponentially increasing, making the network more vulnerable to congestion.
AIMD algorithm (addition-increasing multiplication-reducing algorithm)
the slow start algorithm and congestion-avoiding algorithm are also named "addition-increasing multiplication-reducing algorithm 』.
addition increase: this refers to congestion avoidance algorithm, which increases the sending window linearly.
multiplication decreases: whether the slow start algorithm is used or the congestion avoidance algorithm is used, the slow start threshold is half of the current window when congestion occurs.
fast retransmission algorithm and fast recovery algorithm
The above slow start algorithm and congestion avoidance algorithm can ensure corresponding processing when the network is congested. Fast retransmission and fast recovery are a congestion prevention method, and the network may not be congested at this time, but there are signs of congestion, so we need to take some preventive measures.
Fast retransmission principle: Because TCP has the accumulative validation capability, the receiver does not send a response immediately when receiving a group. It may need to wait for multiple groups to send a cumulative confirmation at the same time. However, the fast retransmission algorithm requires that, if the receiver receives a disordered group, it must immediately send a confirmation response from the previous correct group, this allows the sender to know as early as possible that a group may be lost.
Fast recovery principle: When the sender receives three Confirmation responses from the same group, the sender can basically determine that the group has been lost. In this case, the sender does not need to wait for the timeout to directly execute multiplication to reduce the addition increase 』:
Halving the slow start threshold;
Halved the sending window (not set to 1 );
Use congestion avoidance algorithms;
---------------------
Linglan stars
Source: csdn
Original: 55006347
Copyright Disclaimer: This article is an original article by the blogger. For more information, see the blog post link!
Computer network overview transport layer TCP congestion control