TCP Selective Acknowledgment: Repairing Lossy Connections Efficiently


The Cumulative Acknowledgment Problem

Traditional TCP uses cumulative acknowledgments: the receiver signals it has received all bytes up to a certain sequence number. When packet loss occurs, this model creates a bottleneck. If packets 1, 2, and 4 arrive but packet 3 is lost, the receiver can only acknowledge up to packet 2, even though it successfully received packet 4. The sender has no visibility into what arrived after the gap.

This forces TCP into conservative recovery modes. With multiple packet losses in a single transmission window, the protocol either waits for a retransmission timeout (RTO) or uses fast retransmit to resend one segment at a time. Both approaches are slow: RTOs can take hundreds of milliseconds, and fast retransmit drip-feeds repairs while the receiver waits with buffered out-of-order data.

How SACK Changes the Game

Selective Acknowledgment (SACK), defined in RFC 2018 and refined in RFC 2015, allows the receiver to report non-contiguous blocks of data it has successfully received. Instead of saying “I have everything up to byte X,” the receiver can say “I have bytes 1-1000, and also bytes 2001-3000, but I’m missing 1001-2000.”

This additional information transforms TCP from a protocol that can only acknowledge sequential data into one that provides a detailed map of what’s missing. The sender can then retransmit only the specific segments that were lost, rather than guessing or waiting.

SACK uses TCP option space to encode up to three or four blocks of received data per acknowledgment. Each block is described by its left and right edge in the sequence number space. The most recent out-of-order block is always listed first, giving the sender immediate feedback on what just arrived.

Selective Repeat Retransmission

With SACK data in hand, the sender switches from Go-Back-N behavior to selective repeat. When it detects loss—typically via duplicate acknowledgments or explicit SACK information showing gaps—it can retransmit just the missing segments without stalling the entire window.

The sender maintains a “scoreboard” that tracks which segments have been selectively acknowledged. When congestion control permits, it pulls from this scoreboard to retransmit lost data while continuing to send new segments. This keeps the pipe full and avoids the stop-and-wait pattern that plagues cumulative ACK-based recovery.

One complexity: the sender must infer when a segment is actually lost versus simply reordered. SACK helps by showing which later segments arrived. If three segments beyond a gap have been acknowledged, the missing segment is considered lost. Without SACK, TCP relies on duplicate ACK counts, which are less precise when multiple packets drop.

Implementation Subtleties

SACK is negotiated during the TCP handshake. If both sides support it, the option is enabled for the connection. This means SACK behavior is per-connection, not per-packet, and fallback to cumulative-only ACKs is seamless when talking to older stacks.

The receiver must buffer out-of-order data and track which ranges to report. This increases memory pressure compared to in-order-only delivery, but modern systems handle this easily. The sender’s scoreboard adds CPU overhead for tracking and deciding what to retransmit, but the performance gain from avoiding RTOs far outweighs the cost.

One footgun: SACK reneging, where a receiver reports data as received and later discards it due to buffer pressure. The protocol allows this, but it breaks sender assumptions. Most implementations avoid reneging unless memory is critically low, and senders are expected to handle it gracefully by treating reneged data as lost again.

Why It Matters

SACK is most valuable on paths with non-trivial loss rates or bursty loss patterns—wireless links, congested networks, and long-haul connections. On these paths, the ability to recover from multiple losses in a single round trip prevents throughput collapse.

Without SACK, losing two packets in a window often triggers an RTO, cutting throughput to near zero for hundreds of milliseconds. With SACK, the same scenario results in two targeted retransmissions and minimal disruption. The difference is visible in tail latency, throughput stability, and overall user experience on lossy links.

SACK is now widely deployed and enabled by default in nearly all modern operating systems. Its adoption was gradual, but the performance benefits on real-world networks made it essential infrastructure. Today, it’s rare to encounter a TCP stack that doesn’t support it, and the protocol’s resilience to packet loss is fundamentally better because of it.