TCP Congestion Control

Share it!

Packet loss results packet re-transmission and this many times causes network congestion. In order to avoid network congestion, there are some congestion control mechanisms.

Causes for network congestion are, but not limited to, fully utilized links and insufficient buffer size.There are two broad approaches to control congestion:

  • End-to-end congestion control (This is a necessary approach as IP layer provides no feedback to end systems)
  • Network-assisted congestion control

The basic principle behind TCP congestion control, is to make senders to limit their transmission rate in a rate that can be processed by the network or receiving host.

First of all, the sender should sense the congestion. When, in some point somewhere in the path, there is congestion, packets are dropped. When a packet is dropped trigger some loss events. The sender receives either three duplicated ACKs or a timeout. When one of those events is noted, the sender limits the transmission rate of packets to the destination. In order to control the rate, the sender uses the congestion window (cwnd).

Now, in order to control the congestion, the TCP congestion-control algorithm takes place. The algorithm has three components.

  1. Slow start (mandatory)
  2. Congestion avoidance (mandatory)
  3. Fast recovery

When the connection starts, the congestion window initializes the maximum segment size (MSS) – e.g. 1 MSS=500 bytes – and calculates the rate as a value MSS/RTT. Then, the slow start mechanism increases the transmitted segment by 1 MSS in order to find the available amount of bandwidth. When ACKs from the receiver reach the sender, then the rate is increased by 1 MSS for every acknowledged segment. This mechanism makes the rate to grow exponentially. When a packet loss is detected, a new variable is set. The variable ssthresh (slow start threshold) is set as the half of the congestion window when the loss was detected. Then the sender starts again by sending one MSS and increases the rate exponentially until the threshold value, where the rate is increased linearly after this point (congestion avoidance). In the case that 3 duplicated ACKs are received, the fast recovery mechanism takes place. Instead of starting from the beginning, sending 1 MSS and increasing exponentially, the fast recovery mechanism starts re-transmitting by the new ssthresh value (cwnd/2).


Share it!

notis

I am a network engineer since 2014. My main goal and the purpose of this site is to document whatever I learn so I can explain them better and of course transfer the knowledge in really simple words. Please feel free to contact me or visit my profiles for more information.