When a segment has been transmitted by the
sender, a timer is started. If this timer expires
before the data in that segment is acknowledged,
the segment is assumed lost and is to be retrans-
mitted. Which timer value to use could have a
major influence on the efficiency of the transfer.
Therefore, TCP estimates the round trip time by
measuring the time elapsed from sending the
segment until the segment is acknowledged.
This value can be adapted during the session,
as described in the next sections.
5.3 TCP Transmission Policy
The window field in the TCP header is used to
announce how much data the sender may trans-
mit on the connection without receiving an
acknowledgement. Setting this field by the
receiver informs the sender of the volume of
data that can be used. For instance, say that a
receiver has a 32 kbyte buffer. If the sender
transmits a 24 kbyte block, the receiver will
acknowledge this block and announce a window
of 8 kbyte. If the sender then transmits an 8
kbyte block, it will be acknowledged, but the
window size will now be set to 0 (assuming the
application in the receiver has not removed data
from the buffer). This means that the sender is
not allowed to transmit more to this receiver (for
this connection) until a higher window size is
announced (except for so-called urgent data).
Observe that the sender is not required to trans-
mit the data as soon as it appears in its buffer.
Neither is the receiver required to acknowledge
the data as soon as the data is received. This is to
avoid, for example, situations arising when Tel-
net is used to transfer keystrokes and responses.
In case the keystrokes were to be transferred
immediately, much overhead (TCP header and
IP header) would be associated with each key
that was pushed. Nagle’s algorithmhas been
devised addressing this:
When data appear at the sender one byte at a
time, just send the first byte and buffer all the
rest until the outstanding byte is acknowl-
edged. Then send all the buffered characters
in one TCP block and start buffering again
until they are all acknowledged.
This is assumed to balance the delay/waiting
time observed by the user and protocol/band-
width efficiency. The algorithm also allows a
new packet to be sent if enough data is present
to fill half the window of a maximum block.
Although often useful for keystrokes, Nagle’s
algorithm may be less useful for depicting
movements of a mouse that are controlled and
reflected from a remote host as the mouse cursor
could move rather erratically.
Another problem is the so-called silly window
syndrome. This may occur when data is passed
in large blocks, but an interactive application at
the receiving side reads the data in small por-
tions (e.g. single byte) at the time. So, when the
receiver’s buffer is full, a window size of 0 is
announced. Then, the application removes a
small unit, allowing for the receiver to announce
a window of the same small unit. This may
immediately trigger the sender to transmit a
small unit (with TCP header and IP header),
reducing the window size to 0 again. This leads
to low efficiency as small packets are trans-
ferred. A proposed solution is to prevent the
receiver from announcing window sizes of such
small units. For instance, the receiver may not
send a window update that is less than the maxi-
mum block size advertised during connection
establishment or its buffer is half full. In addi-
tion, the sender may also be restricted from
sending small packets, e.g. when the window fits
a full block or at least half the receiver’s buffer.
Much of the congestion management in today’s
IP-based networks is placed on capabilities of
the TCP. The congestion control applied adjusts
the transmission rate. Setting the window size
is central for this. The first step, however, is to
detect the congestion. For this lost packets are
used, e.g. detected by acknowledgements not
received before the timeout value has elapsed.
A suitable window size is assigned when a con-
nection is established. For instance, the receiver
can specify a window based on its buffer size.
When the sender keeps within this window,
packets should not be lost at the receiver side,
but rather to congestion/errors inside the net-
work. Basically, two potential problems could
occur; related to receiver and related to network.
Therefore, two windows could be thought of; the
window granted by the receiver and a congestion
window. Each of these windows gives the num-
ber of bytes that the sender may transfer. The
effective number of bytes that can be transmitted
before being acknowledged is the minimum of
the two window sizes. When a connection is
established the sender’s congestion window is
initialised to the size of the maximum segment
that can be used. It then sends one maximum
segment. If this segment is acknowledged before
timeout, the sender adds one segment (counted
in number of bytes) to the congestion window,
making it two maximum segment sizes. Then
two maximum segments can be sent. For each
of these segments acknowledged, the congestion
window is further increased by one segment
size. Therefore, when the congestion window is
ksegments, if all kare acknowledged on time,
the congestion window is increased by kseg-
ment sizes, that is, effectively doubled. This is