EN
Back to the archive

The encyclopedia · Engineering & Operations · Technical decision · 1984–1989

Nagle's algorithm batched tiny TCP segments to stop small-packet floods

Nagle let TCP send one small segment at a time and held the rest until an ACK returned, stopping a flood of one-byte packets.

Ford Aerospace

the move

Keyboard traffic over TCP sends a tiny payload per packet: a single keystroke becomes a segment of a few dozen bytes wrapped in a 40-byte header. On slow links this floods the network with packets that carry almost no data, the problem Nagle called the small-packet or silly-window disease.

The naive fixes are to send immediately (which wastes bandwidth) or to wait until a full segment is buffered (which adds latency). Nagle's rule sits between the two: keep one small segment outstanding and batch the rest behind its acknowledgment.

The batching is natural because TCP already waits for that acknowledgment; the algorithm just makes it a rule instead of an accident, and interactive apps get low latency at a fraction of the packet count.

why it works

  • One-byte packets waste most of their bytes on headers.
  • Batching behind an ACK adds no new fixed wait.
  • It cuts packet count without the latency of full-segment buffering.
the payoffSend one small packet, batch the rest until ACKneat

what transfers

To fix waste, allow one small unit and batch the rest behind its acknowledgement, bounding the cost by a wait you were already doing.

what came after

Specified in RFC 1122 as an important TCP requirement, Nagle's algorithm shipped in virtually every TCP stack and became a classic example of trading a little latency for a large drop in load.

references

spotted an error? The archive wants to know.

same kind of clever