Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide

NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Searchable, convenient, complete TCP/IP information.
The TCP/IP Guide

Custom Search

Table Of Contents  The TCP/IP Guide
 9  TCP/IP Lower-Layer (Interface, Internet and Transport) Protocols (OSI Layers 2, 3 and 4)
      9  TCP/IP Transport Layer Protocols
           9  Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)
                9  TCP/IP Transmission Control Protocol (TCP)
                     9  TCP Reliability and Flow Control Features and Protocol Modifications

Previous Topic/Section
TCP Segment Retransmission Timers and the Retransmission Queue
Previous Page
Pages in Current Topic/Section
Next Page
TCP Adaptive Retransmission and Retransmission Timer Calculations
Next Topic/Section

TCP Non-Contiguous Acknowledgment Handling and Selective Acknowledgment (SACK)
(Page 4 of 4)

A Better Solution: Selective Acknowledgment (SACK)

It is in fact this lack of knowledge about non-contiguous segments that is the core of the problem with non-contiguous segments. The solution is to extend the basic TCP sliding window algorithm with an optional feature that allows a device to acknowledge non-contiguous segments individually. This feature, introduced in RFC 1072 and refined in RFC 2018, is called TCP selective acknowledgment, abbreviated SACK.

To use SACK, the two devices on the connection must both support the feature, and must enable it by negotiating the Selective Acknowledge Permitted (SACK-Permitted) option in the SYN segment they use to establish the connection. Assuming this is done, either device is then permitted to include in a regular TCP segment a Selective Acknowledgment (SACK) option. This option contains a list of sequence number ranges of segments of data that have been received but have not been acknowledged since they are non-contiguous.

Each device modifies its retransmission queue so that each segment includes a flag that is set to 1 if the segment has been selectively acknowledged—the SACK bit. The device then uses a modified version of the “aggressive” method above, where upon retransmission of a segment all later segments are also retransmitted unless their SACK bits are set to 1.

For example, in our four-segment case, if the client receives Segment #4 but not Segment #3, when it sends back a segment with an Acknowledgment Number field value of 201 (for #1 and #2), it can include a SACK option that specifies “I have received bytes 361 through 500, but they are not yet acknowledged”. This can also be done in a second acknowledgment segment if Segment #4 arrives well after #1 and #2. The server recognizes this as the range of bytes for Segment #4, and turns on the SACK bit for Segment #4. When Segment #3 is retransmitted, the server sees the SACK bit for Segment #4 on and does not retransmit it. This is illustrated in Figure 225.

After Segment #3 is retransmitted, the SACK bit for Segment #4 is cleared. This is done for robustness, to handle cases where for whatever reason the client “changes its mind” about having received Segment #4. The client should send an acknowledgment with an Acknowledgment Number of 501 or higher, indicating “official” receipt of Segments #3 and #4. If this does not happen, the server must receive another selective acknowledge for Segment #4 to turn its SACK bit back on. Otherwise it will be automatically re-sent when its timer expires, or when Segment #3 is retransmitted.

Figure 225: TCP Retransmission With Selective Acknowledgment (SACK)

This is the example from Figure 223 and Figure 224, changed to use the optional selective acknowledge feature. After receiving Parts 1, 2 and 4 of the file, the client sends an Acknowledgment for 1 and 2 that includes a SACK for Part 4. This tells the server not to re-send Part 4 when Part 3’s timer expires.


Key Concept: The optional TCP selective acknowledgment feature provides a more elegant way of handling subsequent segments when a retransmission timer expires. When a device receives a non-contiguous segment it includes a special Selective Acknowledgment (SACK) option in its regular acknowledgment that identifies non-contiguous segments that have already been received, even if they are not yet acknowledged. This saves the original sender from having to retransmit them.

Previous Topic/Section
TCP Segment Retransmission Timers and the Retransmission Queue
Previous Page
Pages in Current Topic/Section
Next Page
TCP Adaptive Retransmission and Retransmission Timer Calculations
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $

Home - Table Of Contents - Contact Us

The TCP/IP Guide (
Version 3.0 - Version Date: September 20, 2005

Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.