|
by Tracy
Thomas
Start ı Data
Delivery ı Regulating Data ı Pros
and Cons ı Sources and PDF
REGULATING DATA
TCP regulates the data rate, or throughput,
with a sliding window. With TCP, a client cannot establish a connection
and blast the remote host with data at full speed. The data flow is
regulated by the requirement for acknowledgement of data and by the
TCP window. In each TCP segment, the host advertises the amount of
data itıs ready to accept. This amount is the TCP window (see Figure
1). The sliding window refers to the progression of data sequence
numbers as data is sent throughout a connection. The window size advertised
specifies the maximum amount of data the sender can have outstanding
(not acknowledged).
 |
| Figure 1ıThe TCP data window
slides to the right as data is sent and acknowledged. TCPıs
sliding window acts as a throttle on a connection to limit the
data rate to what the data receiver can actually handle. |
Data to the left of the current window
is in the past and canıt be resent. Data to the right of the current
window canıt be sent until the window moves. So, only data within
the sliding window may be sent to the remote host. The sliding window
moves to the right only when a data segment is acknowledged. Thus,
the acknowledgement of data along with the window keeps TCP from sending
data too fast.
For example, as shown in Figure 1, the
client can send segments 7, 8, and 9, while segments 4, 5, and 6 are
waiting for acknowledgement. When you receive an acknowledgement for
segment 4 and the window slides one place to the right, you can send
segment 10. This concept of the sliding window is also referred to
as flow control and limits the amount of traffic one host can place
on the network to the amount that the remote host is actually processing.
The remote host can close its window (advertise zero bytes can be
sent). If the remote window is closed, the client can no longer send
data to the remote host, but instead must probe the remote host to
discover when the window opens.
One important feature of TCP to understand
is that the data is delivered as a stream. If the client application
performs ten 128-byte writes, there is no way to know if the underlying
TCP will deliver ten 128-byte segments, or one 1280-byte segment.
Application developers note that an additional protocol often needs
to be used to mark the beginning, end, and type of data. FTP, Telnet,
and e-mail (SMTP) are common application examples that use protocol
headers in addition to TCP. When you design your own application with
TCP, youıll need a way to break up the stream of data into recognizable
parts.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |