Congestion Control

Informal definition
Congestion is when too many sources are sending too much data too fast for the network to handle.

Right. So why do we care?
We want to be able to utilize network capacity. If we cause network congestion then we will suffer from lost packets (buffer overflow in routers) and long delays (queueing in router buffers).

End-to-end congestion control
No support from the network itself. End-points must themselves figure out that congestion is in fact happening by observing network behavior (packet loss and delay), and consequently take action to address the problem.

Network-assisted congestion control.
With this approach, network-layer components (routers) provide explicit feedback to senders about the congestion state in the network. The router may either send a choke packet to the sender, essentially saying "I'm congested!", or it may mark an outgoing packet so that the other end is notified, which then sends a notification back to the sender in a new packet.

TCP Congestion Control
TCP throttles its transmission rate to avoid congesting the network. For each connection, TCP maintains a congestion window which limits the number of unacknowledged packets that may be in transit at once, similar to the sliding window used for Flow Control.

TCP Slow Start
A TCP connection begins using Slow Start. Transmission rate is increased exponentially until first loss. The CWND (Congestion Window) begins at 1 MSS (Maximum-Sized Segment) and increases by 1 MSS for every ACK received, meaning it will double every RTT (Round-Trip Time). The value of CWND when the loss occurs is cut in half (CWND/2) and stored in a variable ssthresh (Slow Start Threshold), and then slow

start resets CWND to 1 MSS. When CWND then reaches ssthresh again it will change into congestion-avoidance mode.

Congestion Avoidance
When TCP is in congestion-avoidance mode, CWND increases linearly by 1 MSS every RTT until loss occurs. A loss is detected by a timeout or by a triple duplicate ACK.

TCP Tahoe
Early version of TCP. Triple duplicate ACKS are treated the same as a timeout. Tahoe will then store half the value of CWND in ssthresh, reset CWND to 1 MSS, and then re-enter Slow Start.

TCP Reno
If three duplicate ACKs are received (i.e., four ACKs acknowledging the same packet, which are not piggybacked on data, and do not change the receiver's advertised window), Reno will halve the congestion window, perform a fast retransmit, and enter a phase called Fast Recovery. If an ACK times out, slow start is used as it is with Tahoe.

Fast Recovery
In this state, TCP retransmits the missing packet that was signaled by three duplicate ACKs, and waits for an acknowledgment of the entire transmit window before returning to congestion avoidance. If there is no acknowledgment, TCP Reno experiences a timeout and enters the slow-start state.