 Hello and welcome to the session on TCP's congestion control. At the end of this session, students will be able to uniquely identify the congestion control in TCP. Congestion control in TCP is based on both open loop and closed loop mechanisms. TCP uses congestion window and congestion policy that avoid congestion and detect and elevate congestion after it has occurred. In the previous session, we talked about the flow control and tried to discuss the solutions when the receiver is overflow with data. The sender window size is determined by the available buffer space in the receiver. In other words, it is only the receiver that can dictate to the sender the size of the sender's window. Here, we totally ignored another entity, the network. If the network cannot deliver the data as fast as it is created by the sender, it must tell the sender to slow down. In other words, in addition to the receiver, the network is the second entity that determines the size of the sender's window. The sender has two pieces of information. The receiver advertises window size and the congestion window size. The actual size of the window is the minimum of these two, that is, the minimum of receiver window and congestion window. TCP's general policy for handling congestion is based on three phases. Slow start, congestion avoidance, and congestion detection. In the slow start phase, the sender starts with a slow rate of transmission but increases the rate rapidly to reach the threshold. When the threshold is reached, the rate of increase is reduced. Finally, if ever congestion is detected, the sender goes back to the slow start or congestion avoidance phase based on how the congestion is detected. The slow start algorithm is based on the idea that the size of the congestion window starts with one maximum segment size, that is, MSS. The MSS is determined during connection establishment using an option of the same name. The size of the window increases one MSS each time one acknowledgement arrives. As the name implies, algorithm starts slowly but grows exponentially. Here look at the figure. The receiver window is much longer than congestion window so that the sender window size always equals to congestion window. For simplicity, here ignore the delayed acknowledgement policy and assume that each segment is acknowledged individually. The sender starts with congestion window equal to one MSS. This means that the sender can send only one segment. After the first acknowledgement receives, the size of the congestion window is increased by one which means that the congestion window is now two. Now two more segments can be sent. When the two more ACKs are received, the size of the window is increased by one MSS for each ACK which means congestion window is now four. When four ACK arrives, the size of the window increased by four which means that the congestion window is now eight. If we look at the size of the congestion window in terms of round trip times that is RTT, we find that the growth rate is exponential. That is when it starts, the congestion window size is one. After one RTT, the congestion window size is two. After second RTT, the congestion window size is four. And after third RTT, the congestion window size is eight. Here pause the video and think. However, the slow start strategy is lower in case of delayed acknowledgements. Remember for each ACK, the congestion window is decreased by only one MSS. Hence, if three segments are acknowledged accumulatively, the size of the congestion window increases by only one MSS not three MSS. The growth is still exponential but it is not a power of two. With one ACK for every two segments, the power is closer to 1.5. Slow start cannot continue indefinitely. There must be a threshold to stop this phase. The sender keeps the track of a variable named slow start threshold that is SS threshold. When the size of the window invites reaches this threshold, slow start stops and the next phase starts. If we start with the slow start algorithm, the size of the congestion window increases exponentially. To avoid congestion before it happens, one must slow down this exponential growth. When the size of the congestion window reaches the slow start threshold, the slow start phase stops and the additive phase begins. In this algorithm, each time the whole window of segments is acknowledged. The size of the congestion window is increased by one. A window is the number of segments transmitted during RTT. The increase is based on RTT, not on the number of arrived ACKs. Here, this algorithm is the same scenario as slow start. In this case, after the sender has received acknowledgments for a complete window size of segments, the size of the window is increased by one. If we look at the size of the congestion window in terms of round trip time, we find that the rate is additive. Means that when it starts, the congestion window is equal to i. After one RTT, congestion window is equal to i plus one. After second RTT, the congestion window is equal to i plus two. Likewise, the additive increases. If congestion occurs, the congestion window size must be decreased. The only way a sender can guess that the congestion has occurred is the need of retransmit of a segment. This is a major assumption made by TCP. The retransmission is needed to recover a missing packet, which is assumed to have been dropped by a router that had so many incoming packets that had to drop the missing segment by the router or network which become overloaded or congested. However, retransmission can occur in one of two cases when the RTO timers out of or when the three duplicate ACKs are received. In both the cases, the size of the threshold is dropped to half i.e. multiplicative decrease. Most of the TCP implementations have two reactions. First one, if a timeout occurs, there is a stronger possibility of congestion. A segment has probably been dropped in the network and there is no news about the following sent segment. In this case, TCP reacts strongly. It sets the value of the threshold to half of the current window size. It reduces the congestion window back to one segment. It starts the slow start phase again. In second reaction, if three duplicate ACKs are received, there is a weaker possibility of congestion. A segment may have been dropped but some segments after that have arrived safely since three duplicate ACKs are received. This is called a fast retransmission and fast recovery. In this case, TCP has a weaker reaction like it sets the value of the threshold to half of the current window size. It sets congestion window to the value of the threshold. It starts the congestion avoidance phase. Here in this figure, you can see the congestion policy of TCP and the relationships between the three phases. Now the congestion example. Here we assume that the maximum window size is initially 32 segments. The threshold is initially set to 16 segments, half of the initial maximum size window. In the slow start phase, the window size starts from 1 and grows exponentially until it reaches the threshold. After reaching the threshold, the congestion avoidance that is additive increase procedure allows the window size to increase linearly until a timeout occurs or the maximum window size is reached. In this figure, the timeout occurs when the window size is 20. At this moment, the multiplicative decrease procedure or algorithm takes over and reduces the threshold to half of the window size. The window size was 20 when the timeout happened, so the new threshold is now 10. TCP moves to slow start and starts with a window size of 1 and moves to additive increase when the new threshold is reached. When the window size is 12, three ACKs event happen. The multiplicative decrease procedure takes over again. The threshold and window size set to 6 and TCP enters the additive increase phase this time. TCP remains in this phase until another timeout or another timeout. Here are the references. Thank you.