TCP slow start is an algorithm which balances the speed of a network connection. Slow start gradually increases the amount of data transmitted until it finds the network’s maximum carrying capacity.
One of the most common ways to optimize the speed of a connection is to increase the speed of the link (i.e. increase the amount of bandwidth). However, any link can become overloaded if a device tries to send out too much data. Oversaturating a link is known as congestion, and it can result in slow communications or even data loss.
Slow start prevents a network from becoming congested by regulating the amount of data that’s sent over it. It negotiates the connection between a sender and receiver by defining the amount of data that can be transmitted with each packet, and slowly increases the amount of data until the network’s capacity is reached. This ensures that as much data is transmitted as possible without clogging the network.
How TCP slow start works
TCP slow start is one of the first steps in the congestion control process. It balances the amount of data a sender can transmit (known as the congestion window) with the amount of data the receiver can accept (known as the receiver window). The lower of the two values becomes the maximum amount of data that the sender is allowed to transmit before receiving an acknowledgment from the receiver.
Step-by-step, here’s how slow start works:
- A sender attempts to communicate to a receiver. The sender’s initial packet contains a small congestion window, which is determined based on the sender’s maximum window.
- The receiver acknowledges the packet and responds with its own window size. If the receiver fails to respond, the sender knows not to continue sending data.
- After receiving the acknowledgement, the sender increases the next packet’s window size. The window size gradually increases until the receiver can no longer acknowledge each packet, or until either the sender or the receiver’s window limit is reached.
Once a limit has been determined, slow start’s job is done. Other congestion control algorithms take over to maintain the speed of the connection.
Example of TCP slow start
Content providers often adjust their slow start window to maximize performance. The initial congestion window parameter (initcwnd) can have a significant impact on the speed of a network. When the receiver has to send fewer acknowledgments to the sender, more data can be transmitted faster.
Most large CDN providers default to an initcwnd of 10, meaning the CDN will transmit 10 packets before requesting an acknowledgment. Cachefly has an initcwnd of 70, compared to Microsoft’s initcwnd of 2. For comparison, MaxCDN has an initcwnd of about 30. A good balance will be determined by the type of data transmitted and the general speed of the network.
Benefits of TCP slow start
Slow start ensures the speed and integrity of a network while protecting content providers and consumers.
- Users experience uninterrupted connections since packets are no longer dropped due to congestion.
- Users also experience faster downloads since slow start finds and uses the maximum connection speed.
- Enterprises see less network congestion since slow start regulates bandwidth and prevents the sender from having to continuously retransmit data.
The speed of an Internet connection doesn’t rely solely on bandwidth. In general, an increase from a 5Mbps connection to a 10Mbps connection only results in a 5% improvement in page load time. The key lies in the time it takes for a sender to transmit a message to a receiver, which is where slow start shines.
By optimizing bandwidth usage, slow start makes it easy for users to connect to web services without sacrificing their experience.