Data communication and network notes-TCP congestion control

Source: Internet
Author: User
Document directory
  • 1. congestion window
  • 2. Congestion Policy
1. congestion window

The size of the sender's window depends not only on the receiver, but also on network congestion.

The sender has two types of information: the size of the window advertised by the receiver and the size of the congestion window. the actual size of the window is the smallest of the two.

Actual window size = min (rwnd, cwnd)

Rwnd: the size of the receiving window.

Cwnd: the size of the congestion window.

2. the congestion policy TCP processes congestion generally based on three phases: slow start, congestion avoidance, and congestion detection. 2. 1. slow Start: An algorithm used for exponential growth of TCP congestion control is called slow start. This algorithm is based on the idea that, at the beginning, it sets the congestion window size (cwnd) to a maximum segment length (MSS). Each time a confirmation is received, the window size increases by an MSS value. Window is started slowly, but the index-based rule increases. Describes the slow start process. (In the figure, it is assumed that rwnd is much larger than cwnd, so that the sender's window size is always equal to cwnd, and each segment is separately confirmed.) Start: cwnd = 1 after the first transmission: cwnd = 2 after the second transmission: cwnd = 4 after the third transmission: cwnd = 8 after the slow start cannot continue, reaching the threshold must stop this stage. The sender saves a variable called ssthresh (slow start threshold). When the byte in the congestion window reaches this threshold, the slow start phase ends and the next stage begins. In most implementations, The ssthresh value is 65536 bytes.. Congestion avoidance: Adding. If we start with a slow startup algorithm, the congestion window size increases exponentially. To avoid congestion before it occurs, the exponential growth rate must be reduced. TCP defines another algorithm called congestion avoidance, which is an additive increase instead of an exponential increase. When the size of the congestion window reaches the threshold of slow start, the slow start stage stops and the addition stage starts. In this algorithm, the congestion window is increased by 1 every time all the segments in the entire window are confirmed (one transmission. This process is described. Start: cwnd = 1 after the first transmission: cwnd = 2 after the second transmission: cwnd = 3 after the third transmission: cwnd = 42. 3. congestion detection: If the multiplication is reduced, the congestion window size must be reduced. The only way for the sender to predict congestion is to pass the retransmission segment. However, retransmission occurs in two cases: when the retransmission timer reaches or receives three ACK packets. In this case, the threshold is halved, that is, the multiplication reduction (multiplicative decrease ). Most TCP implementations have two responses: 1. If the timer arrives, there is a possibility of serious congestion; a segment may have been lost in the network. In this case, TCP makes a strong response. A. Set the threshold to half the current congestion window size. B. Set cwnd to the size of a segment. C. Start the slow startup phase. 2. If three ACK packets are received, there is a possibility of mild congestion. A segment may have been lost, but some segments may have arrived safely after receiving 3 ACK, which is called fast transfer and fast recovery. In this case, TCP has a mild response. A. Set the threshold to half the current congestion window size. B. Set cwnd as the threshold (some implementations add three segments) C. Start the congestion avoidance phase. An example is provided. Assume that the maximum window is 32 segments and the threshold value is 16 segments (half of the maximum window). In the slow start phase, the window size increases exponentially from 1 to know that it has reached the threshold. When the threshold value is reached, the congestion avoidance (increased addition) process allows the window size to grow linearly to know the size of the timer reaching or reaching the maximum window. On the way, when the window is 20, the timer arrives. At this time. In the process of reducing multiplication, set the threshold to half of the current window size. When the timer reaches, the current window size is 10, so the current threshold is 10. TCP starts slowly again, and sets the window size to 1. When the new threshold (10) is reached, TCP enters the addition stage. When the window size is 12, three ack events occur, and the multiplication and reduction process is started again. The threshold value is set to 6. At this time, TCP enters the addition and adding stage, this phase is maintained until another timer or three other ACK events occur.

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: 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.