ContentsThe library

From an Address to a Page

Four Round Trips Before the First Useful Byte, and Every One of Them Is the Speed of Light Doing Its Job

Last timeTurning a Name Into a Number

Setting up a connection is an exchange of messages that must happen before any request is sent. Counting them explains why distance beats bandwidth for most pages.

The three messages

The address is known. Nothing useful can be sent yet, because the two machines

have never spoken and neither knows anything about the other.

FIG 1Opening a connection
Three messages, one and a half round trips as measured at the client, and nothing has been asked for yet. The third message can carry the first request alongside it, which is why the practical cost at the client is one round trip rather than one and a half.

Why it takes three

The usual question is why two messages do not suffice, and the answer is a

small piece of reasoning worth doing properly.

Suppose only two messages: the client proposes, the server acknowledges. At the

end of that, the client has evidence that the server received something, since

it got a reply. The server has no such evidence about itself. It sent an

acknowledgement and does not know whether it arrived. If it did not, the server

is holding a connection the client knows nothing about, and will hold it until

something times out.

Each side needs one piece of evidence: that something it sent was received.

That requires an acknowledgement travelling in each direction, and since the

middle message can carry both the acknowledgement one way and the proposal the

other, three is the minimum. It is not a convention and it is not historical

accident; two cannot do it.

The starting numbers matter for the same reason. Both sides agree on where

counting begins so that every later message can be identified by position,

which is what makes loss detectable at all, and that agreement is what the

exchange produces.

The second handshake

Everything above establishes a reliable channel. It does not establish a

private one, and almost everything is private now, so there is a second

negotiation on top.

The lesson stops here

3 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Before Anything Can Be Sent, Something Has to Find Out Where to Send It, and Usually That Costs Nothing
  2. 02Four Round Trips Before the First Useful Byte, and Every One of Them Is the Speed of Light Doing Its Jobyou are here
  3. 03The Network Will Lose Some of Your Packets and Tell Nobody, So Everything Above It Is Built on Noticingopening only
  4. 04Your Connection Is a Hundred Megabits and the First Thing It Sends Is Fourteen Kilobytes, on Purposeopening only
  5. 05After Four Round Trips of Machinery, What Finally Goes Down the Wire Is a Few Lines of Text You Could Have Typedopening only
  6. 06The Fastest Request Is the One That Is Never Sent, and Whether It Is Sent Was Decided by a Line of Text Last Weekopening only
  7. 07You Think You Are Talking to a Server, and You Are Talking to Four Machines That Have Agreed Not to Mention Itopening only
  8. 08The Page Took Two and a Half Seconds, and Four Hundred Milliseconds of That Was Your Codeopening only

Read alongside