Selective acknowledgment (SACK) is a TCP option that allows a receiver to tell the sender exactly which non-contiguous blocks of data it has already received, so that the sender can retransmit only the missing segments instead of everything after the first gap. Among transport protocols in networking, SACK is one of the most important refinements of reliable delivery, because it turns loss recovery from a guessing game into a precise repair process.
SACK is defined in RFC 2018, with later extensions such as D-SACK in RFC 2883 and the SACK-based recovery algorithm in RFC 6675. It is negotiated during the TCP handshake and is enabled by default in virtually every modern operating system.
Why cumulative acknowledgment needs help
Classic TCP uses cumulative acknowledgment: the ACK number states the next byte the receiver expects, which implicitly confirms every byte before it. This design is simple and robust, but it carries no information about data received after a gap. When one segment in a window is lost, the receiver keeps repeating the same ACK number even though later segments arrived intact.
Without SACK, the sender faces a poor choice. It can retransmit one segment per round trip, which is slow when several segments are lost in the same window, or it can go back and resend everything after the gap, which wastes bandwidth on data the receiver already holds. On high-bandwidth, high-latency paths, both options cause a severe throughput collapse after a burst of losses.
The following table contrasts the information each acknowledgment style gives the sender.
| Aspect | Cumulative ACK only | Cumulative ACK with SACK |
|---|---|---|
| Information reported | Next expected byte | Next expected byte plus received blocks |
| Multiple losses per window | Recovered one per round trip | Recovered in about one round trip |
| Unnecessary retransmissions | Common with go-back-N behavior | Rare |
| Header cost | None beyond the base header | 8 bytes per block plus 2 bytes |
| Receiver buffering | Out-of-order data may be dropped | Out-of-order data must be kept |
How the SACK option works on the wire
SACK operation has two phases. During the three-way handshake, each side includes the SACK-Permitted option (kind 4) in its SYN segment. Only if both endpoints send it may SACK blocks be used for the rest of the connection; otherwise the connection falls back to cumulative acknowledgment.
Once permitted, the receiver attaches the SACK option (kind 5) to ACKs whenever it holds out-of-order data. Each SACK block is a pair of 32-bit sequence numbers: the left edge (first byte of the block) and the right edge (the byte after the last byte of the block). The most recently received block must appear first, so the sender always learns about the newest arrival even when older blocks are dropped from the option.
Because the TCP options field is limited to 40 bytes, the number of blocks is bounded. The table below shows the practical limits.
| Option combination | Bytes available for SACK | Maximum SACK blocks |
|---|---|---|
| SACK alone | 40 | 4 |
| SACK with timestamps | 30 | 3 |
| SACK with timestamps and other options | Fewer than 30 | 2 or fewer |
Since timestamps are almost always enabled on modern stacks, a typical ACK carries at most three SACK blocks. Senders therefore maintain a scoreboard, a per-connection record of which sequence ranges have been selectively acknowledged, built up from successive ACKs rather than from any single one.
SACK-based loss recovery at the sender
The scoreboard is what makes SACK valuable. Using the rules in RFC 6675, the sender marks a segment as lost when enough data above it has been selectively acknowledged, typically three segments or the equivalent byte count. It then fills the holes in order and estimates the amount of data still in flight, a quantity known as pipe, to decide when it may send more.
Modern stacks combine SACK with time-based detection. RACK-TLP (RFC 8985) uses the arrival times implied by SACK information to declare a segment lost when a later-sent segment has been acknowledged and a reordering window has passed. This approach handles packet reordering and lost retransmissions far better than counting duplicate ACKs.
Several related mechanisms build on the same option, and each solves a different problem.
| Mechanism | Specification | Purpose |
|---|---|---|
| SACK | RFC 2018 | Reports received non-contiguous blocks |
| D-SACK | RFC 2883 | Reports duplicate segments the receiver got |
| SACK-based recovery | RFC 6675 | Defines conservative loss recovery rules |
| RACK-TLP | RFC 8985 | Time-based loss detection using SACK data |
| Forward RTO-Recovery (F-RTO) | RFC 5682 | Detects spurious retransmission timeouts |
Duplicate SACK (D-SACK) deserves special mention. When the receiver gets a segment it already has, it reports that range in the first SACK block. The sender can then conclude that a retransmission was spurious, caused by reordering or a delayed ACK rather than real loss, and can undo an unnecessary congestion window reduction.
Interaction with congestion control and other transport protocols
SACK does not change how much a sender may transmit; that decision belongs to TCP congestion control algorithms such as CUBIC or BBR. SACK changes what the sender transmits during recovery, ensuring that the congestion window is spent on missing data rather than duplicates. The two work together: a precise loss signal lets the congestion controller react once per loss event instead of repeatedly.
Selective acknowledgment is also a design principle beyond TCP. SCTP has SACK chunks built into the protocol from the start, and QUIC uses ACK frames with ACK ranges that can describe many gaps, which removes the three-block limit that TCP inherited from its option space.
The receiver side of SACK has a cost as well. To report out-of-order blocks, the receiver must buffer data above the gap until the hole is filled, which consumes memory and contributes to head-of-line blocking for the application, because TCP still delivers bytes strictly in order.
Operational issues and common mistakes
In production networks, SACK rarely needs tuning, but several problems recur. The table below maps typical symptoms to their causes.
| Symptom | Likely cause | Recommended fix |
|---|---|---|
| Throughput collapse after any loss | Middlebox strips SACK-Permitted | Fix or bypass the middlebox |
| Retransmissions ignored by receiver | Firewall rewrites sequence numbers but not SACK edges | Update the firewall or disable randomization |
| Kernel crash or high CPU under attack | Unpatched SACK handling flaw | Apply vendor patches promptly |
| Slow recovery on lossy Wi-Fi | SACK disabled by an old tuning guide | Re-enable SACK in the TCP stack |
The most cited security incident is SACK Panic (CVE-2019-11477), a Linux flaw in which crafted SACK sequences combined with a very small MSS could trigger a kernel panic. The correct response was patching, not disabling SACK permanently; turning SACK off as a workaround degrades loss recovery for every connection on the host. A second classic mistake involves sequence number randomization on firewalls: if the device translates sequence numbers but leaves SACK block edges untouched, the sender sees nonsense ranges and recovery fails.
- Keep SACK enabled on servers and clients unless a specific, documented defect requires otherwise.
- Check packet captures for the SACK-Permitted option in both SYN and SYN-ACK when diagnosing slow recovery.
- Do not confuse SACK with flow control: SACK reports what arrived, while the receive window limits how much may be sent.
In simple terms
Imagine mailing a friend a book in twenty numbered envelopes. Envelopes 5 and 9 get lost. With plain acknowledgment, your friend can only report having everything up to 4. You do not know about the rest. So you might resend everything from 5 onward.
With selective acknowledgment, your friend lists every range received: 1 to 4, 6 to 8, and 10 to 20. You see that only envelopes 5 and 9 are missing. You resend just those two. The book is complete sooner, and no postage is wasted.
A practical example
A media company replicates large video files between data centers on two continents over a path with a round-trip time of about 150 milliseconds and a congestion window of several thousand segments. A brief burst of congestion on a transit link drops eight segments scattered across one window.
With SACK enabled, the receiver reports the received blocks within the first few ACKs, the sender’s scoreboard identifies all eight holes, and every missing segment is retransmitted within roughly one round trip. The congestion controller reduces the window once and growth resumes.
During an earlier incident, a misconfigured firewall had been stripping the SACK-Permitted option. The same loss pattern then took several round trips to repair, and transfers ran noticeably slower. After the firewall was corrected, packet captures confirmed SACK in both SYN segments, and transfer times returned to normal.