EN
返回档案库

案例库 · 工程与运营 · 技术决策 · 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

那一手

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.

为什么管用

  • 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.
值了多少Send one small packet, batch the rest until ACK利落

可以搬走什么

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.

资料来源

发现哪里写错了?告诉我们。

同一路聪明