TCP congestion Control-slow start, congestion avoidance, fast retransmission, fast start

Source: Internet
Author: User
Tags ack time interval

General principles: The cause of congestion control: the need for resources (bandwidth, cache of switching nodes, processor) > available resources.

Role: Congestion control is to prevent excessive data injection into the network, so that the network can not overload the router or link. Congestion control has to do with a premise: the network can withstand the existing network load.

Contrast flow control: Congestion control is a global process that involves all the hosts, routers, and all the factors that reduce network correlation. Flow control often directs the control of point traffic. is an end-to-end problem.


Congestion window : The sender is a dynamically changing window called a congestion window, and the size of the congested window depends on how congested the network is. The sender let its own sending window = Congestion window, but the sending window is not always equal to the congestion window, when the network situation is good, the congestion window increases continuously, the sender's window naturally increases, but the receiver's acceptance capacity is limited, when the sender's window reaches a certain size is not changed.

If the sender knows the network is congested. when the sender sends some segments of the message, if the sender does not receive the acknowledgment segment of the receiver within the time interval, it can be congested for the network.

The idea of slow-start algorithm : The host development sends the datagram, if the large amount of data is injected into the network immediately, the network congestion may occur. The slow start algorithm is when the host is just beginning to send a datagram to detect the status of the network, if the network is in good condition, the sender of each send the text segment can be correctly accepted the confirmation message segment. Then increase the size of the congestion window from small to large, that is, increase the size of the sending window.

Example: start the sender first set CWnd (congestion window) = 1, send the first message segment M1, after the receiver receives the M1, the sender receives the acknowledgment of the receiver, adds the CWnd to 2, then the sender sends M2, M3, When the sender receives the acknowledgment sent by the receiver, the CWnd increases to 4, and the slow-start algorithm doubles the congestion window when it passes through a transmission pass (that the sender succeeds in receiving confirmation from the receiving party).


congestion avoidance: in order to prevent the network congestion caused by the increase of CWnd, it is necessary to set a slow-start threshold ssthresh state variable (I do not know what this is, I think he is a congestion control of the identity), its usage:

1. When CWnd < Ssthresh, use the slow-start algorithm,

2. When CWnd > Ssthresh, use the Congestion control algorithm to deactivate the slow-start algorithm.

3. When CWnd = Ssthresh, both algorithms are available.


the idea of congestion avoidance : To make CWnd slow to increase rather than multiply, to increase the CWnd by 1 per round trip, rather than doubling it, so that a slow increase in CWnd is much slower than a slow start.

Either the slow-start algorithm or the congestion avoidance algorithm, as long as the network congestion is determined, it is necessary to set the slow start threshold (Ssthresh) to set to half of the sending window (>=2), CWnd (congestion window) set to 1, and then use the slow-start algorithm, The purpose of this is to quickly reduce the host to the network to transfer data, so that the congestion of the router can be stacked in the queue to complete the packet processing. The congestion window is growing in accordance with the linear law, and the congestion window grows more blocks than the slow-start algorithm.

Example: 1. When the TCP connection is initialized, cwnd=1,ssthresh=16.

2. At the beginning of the slow start algorithm, the initial value of CWnd is 1, each time the sender receives an ACK congestion window increases 1, when the Ssthresh =cwnd, the Congestion control algorithm is started, congestion window increases according to the law,

3. When cwnd=24, the network has a time-out, the sender does not receive acknowledgment ack, at this time set ssthresh=12, (One-second CWnd), set cwnd=1, and then start the slow start algorithm, when cwnd=ssthresh=12, slow start algorithm into congestion control algorithm, CWnd grows at a linear rate.

AIMD (addition increase multiplication decrease)

1. Multiplication decreased: either during the slow-start phase or during the congestion control phase, as long as the network times out, the CWnd is set to 1,ssthresh to half of CWnd, and then the slow-start algorithm (Cwnd<ssthresh) is started.

2. Addition increase: When the network frequency has a time-out situation, the Ssthresh is very fast, in order to reduce the number of packets injected into the network, and the addition of the increase refers to the implementation of congestion avoidance algorithm, congestion window is slow to increase, to prevent the network too early congestion.

The combination of these two is the AIMD algorithm, which is the most widely used algorithm. Congestion avoidance algorithm can not completely avoid network congestion, by controlling the size of the congestion window can only make the network less prone to congestion.

Fast re-transmission:

The fast retransmission algorithm requires that the receiving party receive an out-of-order message segment immediately after sending a duplicate confirmation, instead of waiting for the data to be sent. The receiver successfully accepted the sender sent the M1, M2 and sent the ACK respectively, now the receiver did not receive M3, and received the M4, obviously the receiver can not confirm M4, because M4 is out of order message segment. If the receiver is not doing anything according to the principle of reliability transmission, but according to the fast retransmission algorithm, when receiving M4, M5 and other message segments, the sender is repeatedly sent M2 ack, if the receiver receives three duplicate ACK, then the sender does not have to wait for the retransmission timer expires, As soon as the sender re-transmits the unacknowledged message segment.

Fast recovery:

1. When sending a continuous receive three acknowledgements, the multiplication reduction algorithm is performed, the slow start threshold (Ssthresh) is halved, but the slow start algorithm is not executed next.

2. Instead of performing the slow-start algorithm, the CWnd is set to half the Ssthresh, then the congestion avoidance algorithm is executed, and the congestion window increases slowly.

Excerpt from: Computer Network (Shehiren Fifth edition).





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.