156 CHAPTER 5 NETWORK AND TRANSPORT LAYERS
Once the connection is established, the segments flow between the sender and
receiver. TCP uses the continuous ARQ (sliding window) technique described in
Chapter 4 to make sure that all segments arrive and to provide flow control.
When the transmission is complete, the session is terminated using a four-way
handshake. Because TCP/IP connection is a full-duplex connection, each side of the
session has to terminate the connection independently. The sender (i.e., the client) will
start by sending with a FIN to inform the receiver (i.e., the server) that is finished sending
data. The server acknowledges the FIN sending an ACK. Then the server sends a FIN to
the client. The connection is successfully terminated when the server receives the ACK
for its FIN.
Connectionless Messaging Connectionless messaging means each packet is treated
separately and makes its own way through the network. Unlike connection-oriented
routing, no connection is established. The sender simply sends the packets as sepa-
rate, unrelated entities, and it is possible that different packets will take different routes
through the network, depending on the type of routing used and the amount of traf-
fic. Because packets following different routes may travel at different speeds, they may
arrive out of sequence at their destination. The sender’s network layer, therefore, puts a
sequence number on each packet, in addition to information about the message stream to
which the packet belongs. The network layer must reassemble them in the correct order
before passing the message to the application layer.
Transmission Control Protocol/Internet Protocol can operate either as
connection-oriented or connectionless. When connection-oriented messaging is
desired, TCP is used. When connectionless messaging is desired, the TCP segment
is replaced with a User Datagram Protocol (UDP) packet. The UDP packet is much
smaller than the TCP packet (only 8 bytes).
Connectionless is most commonly used when the application data or message can fit
into one single message. One might expect, for example, that because HTTP requests are
often very short, they might use UDP connectionless rather than TCP connection-oriented
messaging. However, HTTP always uses TCP. All of the application layer software we
have discussed so far uses TCP (HTTP, SMTP, FTP, Telnet). UDP is most commonly
used for control messages such as addressing (DHCP [Dynamic Host Configuration Proto-
col], discussed later in this chapter), routing control messages (RIP [Routing Information
Protocol], discussed later in this chapter), and network management (SNMP [Simple
Network Management Protocol], discussed in Chapter 12).
Quality of Service Quality of Service (QoS) routing is a special type of
connection-oriented messaging in which different connections are assigned different
priorities. For example, videoconferencing requires fast delivery of packets to ensure
that the images and voices appear smooth and continuous; they are very time dependent
because delays in routing seriously affect the quality of the service provided. Email
packets, on the other hand, have no such requirements. Although everyone would like to
receive email as fast as possible, a 10-second delay in transmitting an email message does
not have the same consequences as a 10-second delay in a videoconferencing packet.
With QoS routing, different classes of service are defined, each with different
priorities. For example, a packet of videoconferencing images would likely get higher
priority than would an SMTP packet with an email message and thus be routed first.