326
ENTERPRISE NETWORKS II: WIDE AREA NETWORKS
the transmission media with superfluous segments. In TCP, the timeout is expected to
be dynamically adjusted to approximate the segment round-trip time plus a factor for
internal processing; otherwise performance degradation may occur. TCP uses a simple
checksum to detect segments damaged in transit. Such segments are discarded without
being acknowledged. Hence, damaged segments are treated identically to lost segments
and are compensated for by the PAR mechanism. TCP assigns sequence numbers to iden-
tify each octet of the data stream. These enable a receiving TCP to detect duplicate and
out-of-order segments. Sequence numbers are also used to extend the PAR mechanism
by allowing a single acknowledgment to cover many segments worth of data. Thus, a
sending TCP can still send new data, although previous data have not been acknowledged.
Flow Control Mechanism. TCP's flow control mechanism enables a receiving TCP to
govern the amount of data dispatched by a sending TCP. The mechanism is based on a
window, which defines a contiguous interval of acceptable sequence-numbered data. As
data are accepted, TCP slides the window upward in the sequence number space. This
window is carried in every segment, enabling peer TCPs to maintain up-to-date window
information.
Multiplexing Mechanism. TCP employs a multiplexing mechanism to allow multiple
ULPs within a single host and multiple processes in a ULP to use TCP simultaneously.
This mechanism associates identifiers, called ports, to ULP processes accessing TCP
services. A ULP connection is uniquely identified with a socket, the concatenation of
a port and an Internet address. Each connection is uniquely named with a socket pair.
This naming scheme allows a single ULP to support connections to multiple remote
ULPs. ULPs which provide popular resources are assigned permanent sockets, called
well-known sockets.
12.3.4.3
ULP Synchronization
. When two ULPs (upper-layer protocols) wish to
communicate (see Figure 12.4), they instruct their TCPs to initialize and synchronize the
mechanism information on each to open the connection. However, the potentially unre-
liable network layer (i.e., the IP layer) can complicate the process of synchronization.
Delayed or duplicate segments from previous connection attempts might be mistaken for
new ones. A handshake procedure with clock-based sequence numbers is used in connec-
tion opening to reduce the possibility of such false connections. In the simplest handshake,
the TCP pair synchronizes sequence numbers by exchanging three segments, the name
three-way handshake.
12.3.4.4
ULP Modes
. A ULP can open a connection in one of two modes: passive
or active. With a passive open, a ULP instructs its TCP to be receptive to connections
with other ULPs. With an active open, a ULP instructs its TCP to actually initiate a
three-way handshake to connect to another ULP. Usually an active open is targeted to
a passive open. This active/passive model supports server-oriented applications where a
permanent resource, such as a database management process, can always be accessed
by remote users. However, the three-way handshake also coordinates two simultaneous
active opens to open a connection. Over an open connection, the ULP pair can exchange
a continuous stream of data in both directions. Normally, TCP groups the data into TCP
segments for transmission at its own convenience. However, a ULP can exercise a push
service to force TCP to package and send data passed up to that point without waiting
for additional data. This mechanism is intended to prevent possible deadlock situations