Error Checking Transport Protocol

www.pragsoft.com Chapter 5: The Transport Layer 71

5.3.1. TCP

The Transmission Control Protocol TCP originated in ARPANET, and was designed to cope with Type C networks. Consequently, the CCITT Class 4 protocol has borrowed many of its concepts. TCP sits directly on top of IP see Chapter 4 and is well suited to internetworking. The combination is commonly referred to as TCPIP. TCP accepts arbitrary size messages from a service user and, if necessary, segments them into smaller blocks. Figure 5.62 depicts the general structure of a TCP block. The block is constructed in two stages. First, a TCP header is added to user data; this header is essentially a transport-layer-style header. Next, a datagram header is added to the result to prepare it for a datagram network service. Given the unreliable network service expectations of TCP Type C, blocks may be corrupted, lost, duplicated, or out of sequence. TCP uses sequence numbers and resequences blocks when necessary. Unlike other protocols, sequencing is performed on an octet rather than block basis. The sequence numbers for the octets in a block are determined by the Sequence Number and the Total Length fields. Flow control is also octet-oriented. It is based on a credit-style sliding window, where the window size determines how many octets may be transmitted. Figure 5.62 General structure of a TCP block. Field Description Version Datagram protocol version. Header Length Datagram header length. Service Type Type of service expected of the network layer. Total Length Total length of the block. Datagram Segment Owner The sequence number of the owner datagram. Segment Flags Segmentation-related flags. Header Segment Offset Offset to where segment begins in owner datagram. Lifetime Block lifetime in seconds. Checksum Simple checksum for the datagram header. Addresses Source and destination network+host addresses. Options Various options for errors, routing, security, etc. Ports Source and destination ports. Sequence Number Sequences every octet of data. Acknowledgment Used for piggyback acknowledgment of data. TCP Header Length Length of the TCP header. Flags Flags for SYN, ACK, segmentation, reset, etc. Header Window Window size in octets. Checksum Simple checksum for the TCP header. Expedited Offset to where expedited data is located. Options Various TCP-related options, e.g., buffer sizes. User Data Actual transport service user data. Corrupted and lost blocks are retransmitted the T1 timer is used for detecting lost blocks. Delayed duplicate control blocks for establishing connections are dealt with