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 tcpipguide.com". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||tcpipguide.com^$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!

Enjoy The TCP/IP Guide? Get the complete PDF!
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 Fundamentals and General Operation

Previous Topic/Section
TCP Data Handling and Processing: Streams, Segments and Sequence Numbers
Previous Page
Pages in Current Topic/Section
1234567
8
9
Next Page
TCP Ports, Connections and Connection Identification
Next Topic/Section

TCP Sliding Window Acknowledgment System For Data Transport, Reliability and Flow Control
(Page 8 of 9)

Processing Acknowledgments and Sliding the Send Window

Some time later, the destination device sends back a message to the sender providing an acknowledgment. It will not specifically list out the bytes that have been acknowledged, because as we said before, doing this would be inefficient. Instead, it will acknowledge a range of bytes that represents the longest contiguous sequence of bytes received since the ones it had previously acknowledged.

For example, let's suppose that the bytes already sent but not yet acknowledged at the start of the example (32 to 45) were transmitted in four different segments. These segments carried bytes 32 to 34, 35 to 36, 37 to 41 and 42 to 45 respectively. The first, second and fourth segments arrived, but the third did not. The receiver will send back an acknowledgment only for bytes 32 to 36 (32-34 and 35-36). It will hold bytes 42 to 45 but not acknowledge them, because this would imply receipt of bytes 37 to 41, which have not shown up yet. This is necessary because TCP is a cumulative acknowledgment system, which can only use a single number to acknowledge data, the number of the last contiguous byte in the stream successfully received. Let's also say the destination keeps the window size the same, at 20 bytes.

Note: An optional feature called selective acknowledgments does allow non-contiguous blocks of data to be acknowledged. This is explained in a separate topic in a later section; we'll ignore this complication for now.


When the sending device receives this acknowledgment, it will be able to transfer some of the bytes from Category #2 to Category #1, since they have now been acknowledged. When it does so, something interesting will happen. Since five bytes have been acknowledged, and the window size didn't change, the sender is allowed to send five more bytes. In effect, the window shifts, or slides, over to the right in the timeline. At the same time five bytes move from Category #2 to Category #1, five bytes move from Category #4 to Category #3, creating a new usable window for subsequent transmission. So, after receipt of the acknowledgment, the groups will look like this (Figure 209):

  1. Bytes Sent And Acknowledged: Bytes 1 to 36.

  2. Bytes Sent But Not Yet Acknowledged: Bytes 37 to 51.

  3. Bytes Not Yet Sent For Which Recipient Is Ready: Bytes 52 to 56.

  4. Bytes Not Yet Sent For Which Recipient Is Not Ready: Bytes 57 to 95.

This process will occur each time an acknowledgment is received, causing the window to slide across the entire stream to be transmitted. And thus, ladies and gentlemen, we have the TCP sliding window acknowledgment system. It is a very powerful technique, which allows TCP to easily acknowledge an arbitrary number of bytes using a single acknowledgment number, thus providing reliability to the byte-oriented protocol without spending time on an excessive number of acknowledgments. For simplicity, the example above leaves the window size constant, but in reality it can be adjusted to allow a recipient to control the rate at which data is sent, enabling flow control and congestion handling.


Figure 209: Sliding The TCP Send Window

After receiving acknowledgment for bytes 32 to 36, they move from category #2 to #1. The send window of Figure 208 slides right by five bytes; shifting five bytes from category #4 to #3, opening a new usable window.

 


Key Concept: When a device gets an acknowledgment for a range of bytes, it knows they have been successfully received by their destination. It moves them from the “sent but unacknowledged” to the “sent and acknowledged” category. This causes the send window to slide to the right, allowing the device to send more data.



Previous Topic/Section
TCP Data Handling and Processing: Streams, Segments and Sequence Numbers
Previous Page
Pages in Current Topic/Section
1234567
8
9
Next Page
TCP Ports, Connections and Connection Identification
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 (http://www.TCPIPGuide.com)
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.