ContentsThe library

From an Address to a Page

The Network Will Lose Some of Your Packets and Tell Nobody, So Everything Above It Is Built on Noticing

Last timeOpening a Conversation

Reliability is numbering, acknowledging, and resending what was not acknowledged. The mechanism is simple, and its cost is why a little loss hurts far more than it sounds.

Numbering and acknowledging

The network underneath makes no promises. A packet may be dropped by any router

along the way, usually because a queue was full, and nothing informs either

end. It may also arrive out of order, or twice. Reliability is not a property

of the network; it is something the two ends construct on top of an unreliable

one.

The construction has two parts. Every byte sent has a position in the stream,

agreed during the handshake. And the receiver reports, continuously, the

position up to which it has everything.

That second part is cleverer than it looks. The receiver does not describe what

arrived. It names one number: the first position it is still missing.

Everything below that number is known to have arrived, in one small field, no

matter how much has been sent.

FIG 1One loss, seen from both ends
steppacket sentwhat the receiver haswhat it reportswhat the sender concludeswhat happened
1bytes 1 to 1001 to 100next I need 101all goodThe ordinary case. One number summarises everything, and the sender advances.
2bytes 101 to 200, lost1 to 100nothing to report yetstill waitingNothing announces the loss. The router that dropped it does not tell anybody, and the sender has no reason yet to suspect.
3bytes 201 to 3001 to 100, and 201 to 300 set asidenext I need 101a repeat, suspiciousThe receiver cannot report 301, because 101 to 200 is missing and the report means everything below. So it repeats the old number, and that repetition is the signal.
4bytes 301 to 4001 to 100, and 201 to 400 set asidenext I need 101, againthat is three, resend itThree repeats of the same number is the conventional threshold. The sender resends the missing range immediately rather than waiting for a timer.
4 steps
The signal that something was lost is not a message saying so. It is the absence of progress in a number that should have advanced, repeated enough times to rule out simple reordering. The threshold of three exists because packets do sometimes arrive out of order, and reacting to the first repeat would cause needless resending.

Two ways to notice

The sequence above is the good case, and it depends on something: later packets

kept arriving. That is what produced the repeated reports.

When nothing arrives after the loss, there is no signal at all. The sender has

sent something and heard nothing, and silence is indistinguishable from a slow

network. The only remaining mechanism is a timer.

FIG 2The two detection paths
detected by repeated repcost in round tripsdetected only by a timerthe sender waits in sile
loss in the middle of a 1100
loss of the last packet 0411
loss when the receiver c1100
loss on a connection wit0711
The two marked rows are the expensive cases and they share a cause: no later traffic exists to produce the repeated reports. That is why loss at the very end of a transfer, or on a connection carrying one small request, is far more costly than loss in the middle of a stream.

The timer cannot be set to the average round trip. If it were, ordinary

variation would make it fire when nothing was lost, and the sender would resend

data that is merely in flight, wasting capacity exactly when the network is

busy enough to be slow. So the timeout is built from a running estimate of the

round trip plus several times the observed variation in it, and it is floored

at a value well above any plausible round trip.

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 Jobopening only
  3. 03The Network Will Lose Some of Your Packets and Tell Nobody, So Everything Above It Is Built on Noticingyou are here
  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