Interactive engineering lab

Nagle and delayed ACK: a write-write-read timeline

Nagle and delayed ACK: a write-write-read timeline. Step through every segment of a request sent as two small writes.

By Sandeep Belgavi · Published 2026-11-07

Synthetic fixtures computed locally. No model or production service is contacted.

Experiment workspace

Decision trace

    The question this experiment answers

    A client sends one small request as two writes, a header and then a body, and waits for the reply. Why can that take one delayed-ACK interval longer than sending it in one write? The sender holds the second small segment under Nagle while the first is unacknowledged, and the receiver delays its ACK because the request is incomplete and it has nothing to send yet. Change the sender rule, the receiver timer and the write pattern and watch every segment.

    Change one assumption at a time

    Start from write_write_read. Switch the sender rule to TCP_NODELAY or replace the two lines with one line of 100 bytes and the stall disappears. Turn quick-ACK on at the receiver and the hold lasts one round trip instead of the timer. Raise the timer to 200 ms and the response takes 201 ms. In large_body, raise the ACK-every count to 3 and the stall returns. Write lines have the form 0 40, milliseconds then bytes.

    Expected outcomes

    write_write_read: 41 ms, which is four one-way delays plus the 40 ms timer, against 0.5 ms with no hold. nodelay, coalesced and cork: 0.5 ms with no pure ACK. quickack_server: 1 ms. delack_200: 201 ms. large_body: 1 ms, because two full-sized segments make the receiver ACK at once and release the small remainder. wan: 200 ms against 80 ms. These match the companion Python model.

    Read the table and the trace

    The metrics show the response time, the time with no hold, the difference, when the request became complete and how many data and pure ACK segments crossed the wire. The table lists every segment with its send and arrival time, direction, size and kind. The trace explains each hold, send, delayed ACK and arrival and ends with a summary.

    Reset and export

    Reset inputs restores the selected preset and recomputes. Export JSON downloads the inputs, every segment, the metrics, the trace and the stated limits.

    Limits

    A rule model, not a TCP stack: no loss, retransmission, congestion window or receive window, a fixed one-way delay and instant application processing. Linux uses a 40 ms minimum delayed-ACK timer and adapts it per connection, RFC 1122 allows up to 500 ms, and other systems use other values. On Windows 11 loopback the companion probe did not reproduce the stall, so the numbers come from the model, not a measurement.

    Views are my own and do not represent any employer, past or present.