TCP Congestion control on network protocol

Source: Internet
Author: User

There are several main TCP congestion control: slow start , congestion avoidance , fast retransmission, and fast recovery .


Slow start

To prevent network congestion, TCP uses a slow-start algorithm to control the amount of data sent. In order to adjust the amount of data sent by the sender, the Congestion window is introduced, the Congestion window is set to 1 packets to send the data at slow start, and then every acknowledgment response is received, and the value of the congestion window is added with 1 message segments. When sending a packet, compare the size of the congested window with the window size of the receiving host notification and select a smaller value to control the amount of data sent. The Congestion window is the traffic control used by the sending side, while the advertisement window is the traffic control used by the receiving end.

The slow start algorithm steps are as follows (CWnd full name congestion Window):

    1. The initialization of CWnd = 1, indicating that a MSS-sized data can be transmitted;
    2. Whenever a ack,cwnd++ is received, which increases by 1, it rises linearly;
    3. Whenever a rtt,cwnd = cwnd*2, it is exponential to rise;
    4. Ssthresh (slow start threshold), is an upper limit, when CWnd >= Ssthresh, it will enter the "Congestion Avoidance algorithm" (the algorithm will be said later);

Congestion avoidance

Congestion avoidance algorithm is to let the congestion window increase slowly, after receiving each round of confirmation, the congestion window of the value of 1, rather than doubling, so that the congestion window values in accordance with the linear law slowly increase. In a slow boot, when CWnd >= Ssthresh, it enters the "congestion avoidance algorithm". In general, the value of Ssthresh is 65535, the unit is byte, and when CWnd reaches this value, the algorithm is as follows:

    1. When an ACK is received, CWnd = CWnd + 1/cwnd;
    2. When each over a RTT, CWnd = CWnd + 1;

Fast re-transmission and fast recovery

The fast retransmission algorithm first requires the receiving party to send a repeat acknowledgment every time an out-of-order segment is received (the acknowledgement of the previous ordered part is repeated), rather than waiting for the data to be sent for a piggyback acknowledgement, or a cumulative acknowledgement if the sender receives three duplicate confirmations consecutively. It should be immediately re-transmission of the message received by the other party (there is a duplicate confirmation, indicating that the following message section is served, only the middle of the missing message segment is not delivered).

The fast recovery algorithm is used in conjunction with the Fast retransmission algorithm:

    1. When the sender receives three duplicate acknowledgments consecutively, the slow-start threshold Ssthresh is set to half of the current congested window CWnd. Re-transmit the missing message segment. Set CWnd to Ssthresh plus 3 times times the message segment size;
    2. Each time another duplicate ACK is received, CWnd increases the size of 1 segments and sends 1 packets;
    3. When the next acknowledgment of the new data is reached, the CWnd is set to Ssthresh (as in the 1th step). This ACK should be the confirmation of retransmission in step 1 within a round trip time after the retransmission. In addition, this ACK should also be the acknowledgment of the intermediate message segment between the missing packet and the first duplicate ACK received. This step uses the congestion avoidance algorithm.


Resources:

"TC/IP detailed"

Congestion control mechanism of TCP

TCP Congestion control on network protocol

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.