Mindfulness

How Long is TCP Slow Start and How It Works

Updated · By the Relaxmid editors

Reading time
5 min
Sections
7
Topic
Mindfulness

Slow start lasts until the sender reaches the congestion window limit or detects a packet loss. The duration is measured in round-trip times (RTT), typically lasting from a few milliseconds to several seconds depending on network latency.

The Duration of the Slow Start Phase

Slow start does not have a fixed time limit in seconds because it depends entirely on the speed of the connection between the sender and the receiver. Instead, it is measured in round-trip times. A round-trip time is the amount of time it takes for a packet to travel from the sender to the receiver and for the acknowledgement (ACK) to return.

The phase continues as long as the sender receives successful acknowledgements for the data it sends. Every time a full window of data is acknowledged, the sender increases the amount of data it sends for the next round. This exponential growth means the phase is usually very short. In a local area network with an RTT of 1 millisecond, slow start might finish in a fraction of a second. On a transcontinental connection with an RTT of 150 milliseconds, it may take several seconds to reach full capacity.

The phase ends when one of three things happens. First, the congestion window (cwnd) reaches the slow start threshold (ssthresh), which is a predefined limit. Second, the network becomes congested, causing a packet to be dropped. Third, the receiver’s buffer becomes full, and it tells the sender to stop increasing the rate.

Why the Window Grows Exponentially

TCP uses slow start to avoid overwhelming a network with a sudden burst of data. If a sender immediately sent 100 megabytes of data into a narrow pipe, the network routers would drop most of the packets, leading to massive retransmissions and inefficiency. Slow start allows the sender to probe the network capacity gently.

The growth is exponential because for every single packet acknowledged, the sender increases the congestion window by one segment. If you start with a window of 1 segment, and that 1 segment is acknowledged, the window becomes 2. When those 2 segments are acknowledged, the window becomes 4. Then 8, then 16, and so on. This allows the connection to scale up from a cautious start to maximum throughput very quickly.

This mechanism ensures that the sender does not assume the network is empty. It treats the network as a black box and uses the arrival of ACKs as a signal that the path is clear. The exponential increase is the fastest way to find the available bandwidth without causing an immediate collapse of the connection.

Calculating the Growth Rate

To understand how long this takes, you can look at the math of the congestion window. Assume a starting congestion window (cwnd) of 10 segments, which is common in modern TCP implementations. The growth follows a power of two sequence relative to the number of round-trip times.

In the first RTT, the sender sends 10 segments. Upon receiving 10 ACKs, the cwnd doubles to 20 segments. In the second RTT, the sender sends 20 segments. Upon receiving 20 ACKs, the cwnd doubles to 40 segments. In the third RTT, the sender sends 40 segments, and the window grows to 80. By the fourth RTT, the window is 160 segments.

If the network capacity is 100 segments, the sender will hit a limit during the fourth RTT. If the RTT is 50 milliseconds, the slow start phase would last approximately 200 milliseconds (4 RTTs x 50ms). This demonstrates why the phase is called slow start even though the growth is actually very aggressive.

Packet Loss and Threshold Shifts

The most common way slow start ends is through packet loss. When a router’s queue fills up, it drops packets. The sender notices this when a timer expires without receiving an ACK or when it receives triple duplicate ACKs.

When loss occurs, TCP assumes the network is congested. It does not simply stop; it adjusts its strategy. It sets the slow start threshold (ssthresh) to half of the current congestion window. For example, if the window was 64 segments when the loss occurred, the new ssthresh becomes 32 segments. Depending on the version of TCP, the sender may then drop the window back to 1 segment and start the slow start process over again, or it may enter a congestion avoidance phase.

Congestion avoidance is a much slower growth phase. Instead of doubling the window every RTT, the sender increases the window by only one segment per RTT. This linear growth is designed to cautiously approach the network limit without overshooting it again. This cycle of exponential growth, packet loss, and linear recovery is the core of how TCP maintains stability across the internet.

Common Misconceptions About Speed

A frequent misconception is that slow start makes a connection feel slow for the entire duration of a file transfer. In reality, slow start only affects the beginning of a connection or the period immediately following a timeout. For a large file transfer, the slow start phase is a tiny fraction of the total time.

Another misconception is that slow start is a fixed timer. Some believe there is a setting in the operating system that says slow start lasts for 2 seconds. This is incorrect. The duration is dynamic. If you are downloading a small image that fits within the initial window, you may never actually leave the slow start phase before the transfer is complete. The process is governed by the flow of packets and acknowledgements, not by a clock.

Optimizing the Start Process

Because slow start can add latency to small requests, engineers use several techniques to mitigate its impact. One common method is TCP Fast Open. This allows the exchange of data during the initial handshake, reducing the number of round-trips required before data can flow at higher speeds.

Another approach is increasing the Initial Congestion Window (IW). Older systems started with an IW of 1 or 2 segments. Modern systems often start with an IW of 10 segments. This allows a web page to load its primary HTML and some CSS in the first round trip, rather than requiring 4 or 5 round trips to reach a usable speed. This significantly reduces the perceived load time for the end user.

You can observe these behaviors using network analysis tools. By capturing packets, you can see the window size increasing in the TCP header options. You will see the sequence numbers jump in larger increments after every successful set of acknowledgements, confirming the exponential growth in action.

TCP Slow Start for Short-Lived Connections

How does slow start affect a single API call? Since API responses are often small, the transfer may finish before the window ever reaches the threshold. This means the connection never reaches maximum theoretical speed.

Does a keep-alive connection avoid slow start? Yes, by reusing an existing TCP connection, the sender can maintain its current congestion window. This avoids the need to start from a small window for every new request, which is why HTTP/1.1 and HTTP/2 rely heavily on persistent connections.

What happens if the receiver is slower than the sender? The receiver uses a “receive window” to tell the sender how much space is left in its buffer. If the receive window is smaller than the congestion window, the sender must limit its speed to the receiver’s capacity, regardless of how fast the network is.

Related

General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more

Spotted an error? Tell us and we will correct it (corrections policy).