Flow Control Using Windowing 1
Flow Control Using Windowing 1
TCP implements flow control by using a window concept that is applied to the
amount of
data that can be outstanding and awaiting acknowledgment at any one point in time.
The
window concept lets the receiving host tell the sender how much data it can receive
right
now, giving the receiving host a way to make the sending host slow down or speed
up. The
receiver can slide the window size up and down—called a sliding window or dynamic
window—
to change how much data the sending host can send.
The sliding window mechanism makes much more sense with an example. The
example,
shown in Figure 1-9, uses the same basic rules as the examples in the previous few
figures.
In this case, none of the TCP segments have errors, and the discussion begins one
TCP segment
earlier than in the previous two figures.
Begin with the first segment, sent by the server to the PC. The Acknowledgment field
should be familiar by now: it tells the PC that the server expects a segment with
Continuing the example, the server not only acknowledges receiving the data
(without
any loss), but the server decides to slide the window size a little higher. Note that
second
message flowing right to left in the figure, this time with a window of 4000. Once the
PC
receives this TCP segment, the PC realizes it can send another 4000 bytes (a
slightly larger
window than the previous value).
Note that while the last few figures show examples for the purpose of explaining how
the
mechanisms work, the examples might give you the impression that TCP makes the
hosts
sit there and wait for acknowledgments a lot. TCP does not want to make the
sending host
have to wait to send data. For instance, if an acknowledgment is received before the
window
is exhausted, a new window begins, and the sender continues sending data until the
current window is exhausted. Often times, in a network that has few problems, few
lost segments, and little congestion, the TCP windows stay relatively large with hosts
seldom waiting to send.