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.

Send one small packet, batch the rest until ACK

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.

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

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.

FOLLOW THE EVIDENCE

The sources

  1. RFC 896: Congestion Control in IP/TCP Internetworks IETF · rfc-editor.org
  2. RFC 1122: Requirements for Internet Hosts - Communication Layers IETF · rfc-editor.org