TCP Slow Start

What is slow start?

Slow start is used by TCP to control the congestion inside a network. Slow start works by increasing the congestion window by the number of segments acknowledged. It will continue of doing so until it reaches the threshold (also known as sstresh) or until an acknowledgment is not received.

How does it work?

The TCP sender starts with congestion window size of 1 segment and increases it by 1 segment size for each ACK received. This cause the congestion window to double itself every RTT. The sender starts by transmitting one segment and waiting for its ACK. When that ACK is received, the congestion window is incremented from one to two, and two segments can be sent. When each of those two segments is acknowledged, the congestion window is increased to four. This provides an exponential growth. What happen when the threshold is reached? When the congestion window reaches the threshold a different algorithm is used (congestion avoidance) at this point, the window is increases by 1 segment size for each RTT. What happen if packet is lost? This depends on what version of TCP you are using. various of TCP will behave differently. The basic algorithm as described by RFC 2001 says that At some point the capacity of the internet can be reached, and an intermediate router will start discarding packets. This tells the sender that its congestion window has gotten too large. Early implementations performed slow start only if the other end was on a different network. Current implementations always perform slow start.

Simulation

The following slow start animation shows how TCP sender increases the congestion window every time it receives an ACK. The red point on congestion window chart shows the exponential growth of the congestion window every RTT. When cwnd (congestion window) reaches the threshold we stop transmitting but in reality we should continue to the next phase, congestion avoidance.

osischool.com

Embedding:
Do not change the code.