tinct hosts2 on networks and sets of interconnected networks. TCP operates successfully in an environment where the loss, damage, duplication or misorder of data, and network congestion can occur. This robust- ness in spite of unreliable communications media makes TCP well-suited to support commercial, military, and government applications. TCP appears at the transport layer of the protocol hierarchy. Here, TCP provides connection-oriented data transfer that is 2The IEEE (Ref. 10) defines a host as "a device to which other devices (peripherals) are connected and that generally controls those devices" and defines a host computer (IEEE) as "a computer, attached to a network, providing primary services such as computation, data base access or special programs or programming languages." 12.3 TCP/IP AND RELATED PROTOCOLS Application Application Presentation Presentation Session Session Peer-to-peer Communications Gateway A Gateway B Data Link Data Link Data Link Data Link Physical Physical Physical Physical Network #1 Network #2 Network #3 Figure 12.6 Protocol layers showing the relationship of TCP with other layered protocols. reliable, ordered, full duplex, and flow controlled. TCP is designed to support a wide range of upper-layer protocols (ULPs). The ULP can channel continuous streams of data through TCP for delivery to peer ULPs. The TCP breaks the streams into portions that are encapsulated together with appropriate addressing and control information to form a segment-the unit of exchange between TCPs. In turn, the TCP passes the segments to the network layer for transmission through the communication system to the peer TCP. As shown in Figure 12.6, the layer below the TCP in the protocol hierarchy is com- monly the IP layer. The IP layer provides a way for the TCP to send and receive variable-length segments of information enclosed in Internet datagram "envelopes." The Internet datagram provides a means for addressing source and destination TCPs in dif- ferent networks. The IP also deals with fragmentation or 