Networked systems commonly face congestion due to traffic overload on links beyond their capacity. It results in the loss of packets in the network and, as a result, can severely damage the user's experience. Although it is impossible to avoid congestion entirely, mechanisms exist to manage it proactively to prevent damaging effects.
A congestion control protocol must have the following features:
Before we can understand how TCP implements congestion control, there are two ideas that need clear understanding:
It is known to the sender, and the bytes sent should never exceed the congestion window size. If the sending rate goes over the congestion window size, packets are lost and the sender is forced to retransmit them.
It is an advertisement from the receiver about the number of bytes it can receive before dropping packets. As such, the sender must always send bytes less than or equal to the receiver window size to avoid retransmission of packets.
Hence, the formula for sender window size is:
Sender window size = Min(Congestion window size, Receiver window size)
TCP's mechanism for congestion control comprises three phases:
The sender starts by setting the congestion window equal to the maximum segment size (1 MSS) and increases its size by one after each acknowledgment is received. The size of the congestion window hence increases exponentially in this phase, as shown below:
The illustration shows how the congestion window size changes exponentially during the slow-start phase. The slow-start phase continues until the slow-start threshold is reached, which is defined as follows:
This phase starts once the slow-start threshold is reached and continues until the congestion window becomes equal to the receiver window size. In this phase, the sender cautiously increases the congestion window by one after receiving an acknowledgment to avoid congestion. The congestion window increments as follows:
The progression of transmission up until now is shown below:
In the last phase, TCP promptly acts when a packet loss is detected. Its reaction is based on the two types of congestion given below:
Congestion is mild when the sender receives three duplicate acknowledgments (ACKs) from the receiver. It indicates the possibility of only a few packets being dropped, which can be perceived through the ACKs received. When this happens, the following happens:
This case occurs when the retransmission timer of the sender expires. When this happens, the following happens:
View all Courses