
can reappear at inopportune moments. To deal with them, three-way handshakes are needed
to establish connections. Releasing a connection is easier than establishing one but is still far
from trivial due to the two-army problem.
Even when the network layer is completely reliable, the transport layer has plenty of work to
do. It must handle all the service primitives, manage connections and timers, and allocate and
utilize credits.
The Internet has two main transport protocols: UDP and TCP. UDP is a connectionless protocol
that is mainly a wrapper for IP packets with the additional feature of multiplexing and
demultiplexing multiple processes using a single IP address. UDP can be used for client-server
interactions, for example, using RPC. It can also be used for building real-time protocols such
as RTP.
The main Internet transport protocol is TCP. It provides a reliable bidirectional byte stream. It
uses a 20-byte header on all segments. Segments can be fragmented by routers within the
Internet, so hosts must be prepared to do reassembly. A great deal of work has gone into
optimizing TCP performance, using algorithms from Nagle, Clark, Jacobson, Karn, and others.
Wireless links add a variety of complications to TCP. Transactional TCP is an extension to TCP
that handles client-server interactions with a reduced number of packets.
Network performance is typically dominated by protocol and TPDU processing overhead, and
this situation gets worse at higher speeds. Protocols should be designed to minimize the
number of TPDUs, context switches, and times each TPDU is copied. For gigabit networks,
simple protocols are called for.
Problems
1. In our example transport primitives of Fig. 6-2, LISTEN is a blocking call. Is this strictly
necessary? If not, explain how a nonblocking primitive could be used. What advantage
would this have over the scheme described in the text?
2. In the model underlying
Fig. 6-4, it is assumed that packets may be lost by the network
layer and thus must be individually acknowledged. Suppose that the network layer is
100 percent reliable and never loses packets. What changes, if any, are needed to
Fig.
6-4?
3. In both parts of
Fig. 6-6, there is a comment that the value of SERVER_PORT must be
the same in both client and server. Why is this so important?
4. Suppose that the clock-driven scheme for generating initial sequence numbers is used
with a 15-bit wide clock counter. The clock ticks once every 100 msec, and the
maximum packet lifetime is 60 sec. How often need resynchronization take place
a. (a) in the worst case?
b. (b) when the data consumes 240 sequence numbers/min?
5. Why does the maximum packet lifetime,
T, have to be large enough to ensure that not
only the packet but also its acknowledgements have vanished?
6. Imagine that a two-way handshake rather than a three-way handshake were used to
set up connections. In other words, the third message was not required. Are deadlocks
now possible? Give an example or show that none exist.
7. Imagine a generalized
n-army problem, in which the agreement of any two of the blue
armies is sufficient for victory. Does a protocol exist that allows blue to win?
8. Consider the problem of recovering from host crashes (i.e.,
Fig. 6-18). If the interval
between writing and sending an acknowledgement, or vice versa, can be made
relatively small, what are the two best sender-receiver strategies for minimizing the
chance of a protocol failure?
9. Are deadlocks possible with the transport entity described in the text (
Fig. 6-20)?
10. Out of curiosity, the implementer of the transport entity of
Fig. 6-20 has decided to put
counters inside the
sleep procedure to collect statistics about the conn array. Among
these are the number of connections in each of the seven possible states,
n
i
(i = 1, ...