The TCP/IP Guide - Version 3.0 (Contents) ` 930 _ © 2001-2005 Charles M. Kozierok. All Rights Reserved.
Sometime later, the server receives the 140 bytes and puts them in the buffer. Now, in an
“ideal world”, the 140 bytes go into the buffer, are acknowledged and immediately removed
from the buffer. Another way of thinking of this is that the buffer is of “infinite size” and can
hold as much as the client can send. The buffer's free space remains 360 bytes in size, so
the same window size can be advertised back to the client. This was the “simplification” in
the previous example.
As long as the server can process the data as fast as it comes in, it will keep the window
size at 360 bytes. The client, upon receipt of the acknowledgment of 140 bytes and the
same window size it had before, “slides” the full 360-byte window 140 bytes to the right.
Since there are now 0 unacknowledged bytes, the client can now once again send 360
bytes of data. These correspond to the 220 bytes that were formerly in the usable window,
plus 140 new bytes for the ones that were just acknowledged.
In the “real world”, however, that server might be dealing with dozens, hundreds or even
thousands of TCP connections. The TCP might not be able to process the data immedi-
ately. Alternately, it is possible the application itself might not be ready for the 140 bytes for
whatever reason. In either case, the server's TCP may not be able to immediately remove
all 140 bytes from the buffer. If so, upon sending an acknowledgment back to the client, will
want to change the window size that it advertises to the client, to reflect the fact that the
buffer is partially filled.
Suppose that we receive 140 bytes as above, but are able to send only 40 bytes to the
application, leaving 100 bytes in the buffer. When we send back the acknowledgment for
the 140 bytes, the server can reduce its send window by 100, to 260. When the client
receives this segment from the server it will see the acknowledgment of the 140 bytes sent
and slide its window 140 bytes to the right. However, as it slides this window, it reduces its
size to only 260 bytes. We can consider this like sliding the left edge of the window 140
bytes, but the right edge only 40 bytes. The new, smaller window ensures that the server
receives a maximum of 260 bytes from the client, which will fit in the 260 bytes remaining in
its receive buffer. This is illustrated in the first exchange of messages (Steps #1 through #3)
at the top of Figure 226.
Reducing Send Window Size To Stop The Sending of New Data
What if the server is so bogged down that it can't process any of the bytes received? Let’s
suppose that the next transmission from the client is 180 bytes in size, but the server is so
busy it can’t remove any of them. It could buffer the 180 bytes and in the acknowledgment it
sends for those bytes, reduce the window size by the same amount: from 260 to 80. When
the client received the acknowledgment for 180 bytes it would see the window size had
reduced by 180 bytes as well. It would “slide” its window by the same amount as the
window size was reduced! This is effectively like the server saying “I acknowledge receipt of
180 bytes, but I am not allowing you to send any new bytes to replace them”.
Another way of looking at this is that the left edge of the window slides 180 bytes while the
right edge remained fixed. And as long as the right edge of the window doesn't move, the
client can't send any more data than it could before receipt of the acknowledgment. This is
the middle exchange (Steps #4 to #6) in Figure 226.