I. general principle of congestion control
Congestion: the demand for a certain resource in the network exceeds the availability of the resource.
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.
Traffic control usually refers to point-to-point traffic control, which is an end-to-end problem.
Ii. Four Congestion Control Algorithms
1. Slow Start and congestion avoidance
The sender maintains a state variable named cwnd In the congestion window. The size of the congestion window depends on the degree of network congestion and changes dynamically. The sender makes the sending window equal to the congestion window.
Slow Start Algorithm: after a slow start algorithm is used, the congestion window doubles every transmission round.
To prevent network congestion caused by excessive congestion window growth, you need to set a slow start threshold ssthresh.
When cwnd <ssthresh is used, the preceding slow start algorithm is used;
When cwnd> ssthresh, use the congestion avoidance algorithm;
When cwnd = ssthresh, both can be used;
Congestion Avoidance algorithm: adds the congestion window of the sender to 1 for every round-trip RTT, so that the congestion window grows slowly with a linear law.
Whether in the slow start or congestion avoidance phase, as long as the sender determines that the network is congested (according to the failure to receive confirmation on time ), set the slow start threshold ssthresh to half of the sending window value when congestion occurs (cannot be less than 2), set the congestion window cwnd to 1, and run the slow start algorithm.