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.
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):
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.
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.