Answers · The network and the web
Why does a download start slow and then speed up?
In shortThe sender starts with about fourteen kilobytes in flight and doubles that each round trip until something is lost, so the opening round trips measure the path rather than move data.
Nothing is warming up, and nobody is throttling you. A sender has no measurement of the path in front of it, so it begins with a deliberately small amount of data outstanding, about fourteen kilobytes, and doubles that amount at the end of every round trip in which nothing was lost. What you are watching is a measurement being taken.
Here is how many bytes the sender will allow to be unacknowledged at once, is the starting allowance of roughly fourteen kilobytes, and is the number of round trips completed without loss. The sender cannot look at its own link and learn anything useful, because the path to you passes through whichever link is narrowest and that link tells it nothing. So fourteen kilobytes go out, they are acknowledged a round trip later, and only then does the allowance become twenty eight.
| round trip completed | allowed in flight, kilobytes | delivered so far, kilobytes |
|---|---|---|
| 1 | 14 | 14 |
| 2 | 28 | 42 |
| 3 | 56 | 98 |
| 4 | 112 | 210 |
| 5 | 224 | 434 |
The second column doubles and the third accumulates: , then , then , then , then . Growth looks dramatic in percentages and is painful in absolute terms. Five round trips, and the sender still has less than half a megabyte to show for them.
Take a 200 kilobyte response over a path with an 80 millisecond round trip. After three round trips 98 kilobytes have arrived, so 102 remain, and the fourth round trip's allowance of 112 kilobytes covers it: the download ends inside the fourth round trip, 320 milliseconds after it started. That is 1,600,000 bits in 0.320 seconds, about 5 megabits per second. A hundred megabit link carries 12.5 megabytes a second, so 200 kilobytes at full rate would take seconds, or 16 milliseconds. The ramp cost twenty times the transfer. Shrink the file to 100 kilobytes and it still needs four round trips, since three round trips yield only 98, so 320 milliseconds for 800,000 bits: 2.5 megabits per second, against the 8 milliseconds the link alone would have taken. Below a few hundred kilobytes the file size barely enters the arithmetic. The round trip count does.
What it is not
The tempting picture is of a fixed start-up cost, a second of nothing while something negotiates, or a server being stingy with a connection it could easily fill. Neither survives two tests. A fixed delay would not end where this ends, at the first lost packet, and it would not be remembered: the next response on a connection that has already carried traffic starts at the rate the previous one finished at, because the sender already holds its estimate. A throttle would be a rate the sender held itself to, whereas what is observable is a rate that climbs and stops climbing exactly when loss appears, doubling while nothing is dropped and cut sharply the moment something is. That is a probe, not a tariff. It also explains the shape of a slow start in the literal sense: it is not slow because the sender is being careful in a vague way, it is slow because each increase costs a full round trip to discover.
Why a faster line barely shortens it
Because the doubling happens once per round trip, its cost is counted in round trips rather than bytes, and widening the pipe does not shorten it. On a hundred megabit link with an 80 millisecond round trip the sender needs 1,000,000 bytes outstanding to fill it: 12,500,000 bytes a second times 0.08 seconds. Running the doublings out from 14: 28, 56, 112, 224, 448, 896, 1792. The allowance passes a megabyte only at the seventh doubling, so the path is filled after seven round trips, which is 560 milliseconds, and across those the sender delivered at most kilobytes. That is 14,565,376 bits over 0.56 seconds, an average of about 26 megabits per second on a link that calls itself a hundred. Give the same path a gigabit and the crossing point moves from the seventh doubling to the tenth: three round trips bought by ten times the bandwidth.
Where the doubling stops
Two limits end the picture, and they are easy to confuse. The doubling lasts only until the first loss; after that the allowance is halved and growth becomes far slower, which is what lets many senders share one path roughly fairly. Separately, the receiver advertises its own buffer limit in every acknowledgement, and the smaller of the two numbers governs. If the receiver's buffer is 64 kilobytes while the path could carry 512, the transfer sits flat at 64 and nothing done at the sending end moves it. That flatness is the diagnostic: a rate that climbs and collapses and climbs again is the network estimate doing its job, while a rate that is identical on a fast path and a slow one is a receiver cap. Once neither limit binds, the ramp is finished and the link rate governs for the remainder, which on anything past a few hundred kilobytes is most of the transfer.
Worth keeping
- A sender's only way to learn what a path can carry is to increase the amount in flight until a packet is lost, so the first round trips of any transfer measure rather than transfer.
- The ramp is counted in round trips, not bits, so a faster link barely shortens it; a shorter distance or a connection that already knows the answer does.
- For responses under about a hundred kilobytes the sender never finishes the ramp, and the duration is set by round trips rather than by bandwidth.
Where this goes next
This question is one step of From an Address to a Page, a course that works through its subject from the beginning. The page that teaches this part of it is Deciding How Fast to Send, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- Why does a DNS lookup sometimes have to ask several servers before it gets an answer?Because when no cache already holds the address, the resolver has to ask one server at a time down the hierarchy, and each reply only tells it who to ask next.
- Why does opening a connection take three messages instead of two?Three messages are needed because the server must also learn that its own reply arrived; the third message is that proof, not a formality.
- What does a CDN actually change about my request?A CDN puts a machine near the reader that answers the request itself, so your origin often never sees it and the address it logs is not the reader's.
- Where should a session ID be stored so JavaScript can't read it?Store it in an HttpOnly cookie set by the server; that is the only browser storage JavaScript running on the page cannot read.
- What does it mean for an API method to be safe?A safe method is one that changes nothing on the server when it is called, so a caller may repeat it freely and a cache or a crawler may use it without anything being altered.
- Does signing out actually invalidate my token on the server?No. Signing out clears your browser's copy of the token, but the server keeps accepting that token until it expires.