The Hostto Host Layer

The IP host-to-host layer correlates loosely to the OSI Reference Model's session and transport layers. It consists of two protocol entities: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). A third entity is being defined to accommodate the increasingly transaction-oriented nature of the Internet. This protocol entity is tentatively called Transaction Transmission Control Protocol (T/TCP). T/TCP is currently languishing because it lacks the impetus afforded by market support. Unless support coalesces for this third entity, it will be relegated to little more than a footnote in the annals of the Internet.

Transmission Control Protocol

TCP provides a connection-oriented data transmission between two hosts, can support multiple data streams, and provides for flow and error control and even the reordering of packets that may have been received out of order.

Figure 5-2 illustrates the structure of the TCP protocol's header, as well as the sizes of its fields. Figure 5-2: TCP header structure.

10" ."il

1É-tJil

32-Wt

22-b'.

4-b:

L-LhI

e-bii

»SSL

rCIJ souce

TCP de«Hialioi

seiue"«

dala

»a served

W iKli^

ron

pon

njml}?-

rn-n-ljer

vM^el ■■3W

5JZ19 ■-?ici

The TCP protocol header is a minimum of 20 octets and contains the following fields:

• TCP Source Port---The 16-bit source port field contains the number of the port that initiates the communications session. The source port and source IP address function as the packet's return address.

• TCP Destination Port---The 16-bit destination port field is the address of the port for which the transmission is destined. This port contains the interface address of the application on the recipient's computer that the packet's data will be passed to.

• TCP Sequence Number---The 32-bit sequence number is used by the receiving computer to reconstruct the application's data back to its original form. In a dynamically routed network, it is quite possible for some of the packets to take different routes and, consequently, arrive out of order. This sequencing field compensates for this inconsistency of delivery.

• TCP Acknowledgment Number—TCP uses a 32-bit acknowledgment (ACK) of the first octet of data contained in the next expected segment. The number used to identify each ACK is the sequence number of the packet being acknowledged.

• Data Offset Field---This 4-bit field contains the size of the TCP header, measured in a 32-bit data structure known as a "word."

• Reserved Field---This 6-bit field is always set to 0. It is reserved for an as-yet-unspecified future use.

• Flags Field---The 6-bit flag field contains six 1-bit flags that allow the control functions of urgent field, acknowledgment of significant field, push, reset connection, synchronize sequence numbers, and finish sending data.

• Window Size Field—This 16-bit field is used by the destination machine to tell the source host how much data it is willing to accept.

• Checksum—The TCP header also contains a 16-bit error-checking field known as a checksum. The source host calculates a mathematical value, based on the segment's contents. The destination host performs the same calculation. If the content remains intact, the result of the two calculations is identical, and thereby prove the validity of the data.

• Padding---Extra zeros are added to this field to ensure that the TCP header is always a multiple of 32 bits.

User Datagram Protocol

UDP is IP's other host-to-host layer protocol (corresponding to the transport layer of the OSI Reference Model). UDP provides a basic, low-overhead data transmission. In essence, UDP provides a connectionless session between two end systems and does not provide for the acknowledgment of received datagrams. UDP's simplicity makes it inappropriate for some applications but perfect for more sophisticated applications that can provide their own connection-oriented functionality. Alternatively, there are applications whose data has an extremely high time value. One example would be a videoconference session. Such applications would prefer to use UDP because data delivered late or out of sequence is just discarded.

Note UDP raises an interesting and potentially contentious issue: What is the difference between a datagram and a packet? Both are Layer 3 data- bearing constructs, and both are supported by the IP networking protocol. The critical distinction is that datagrams do not require acknowledgment of receipt by the recipient.

This implies that all Layer 3 data-bearing constructs are inherently datagrams because Layer 3 internetworking is connectionless, best-effort service. Reliability is provided by Layer 4 transport protocols, such as TCP or SPX. Therefore, the term packet really only describes Layer 3 data-bearing constructs that also contain the segments of a reliable Layer 4 protocol. Otherwise, they are just datagrams.

Alternatively, UDP can be used for exchanges of such data as broadcasted NetBIOS names, system messages, and so forth, because these exchanges do not require flow control, acknowledgments, reordering, or any of the functionality that TCP provides.

Figure 5-3 illustrates the structure of the UDP header, as well as the sizes of its fields. Figure 5-3: The structure of a UDP header.

The UDP protocol header has the following fields:

• UDP Source Port Number—The 16-bit source port is the logical port number on the source computer. The source port and source IP address function as the packet's return address.

• UDP Destination Port Number—The 16-bit destination port is the connection number on the destination computer. The UDP destination port is used to forward the packet to the correct application after the packet arrives at the intended destination machine.

• UDP Message Length—The 16-bit UDP Message Length field informs the destination computer of the size of the message. This provides another mechanism for the destination computer to use in determining the message's validity.

• UDP Checksum---UDP Checksum is a 16-bit error-checking field that is calculated based on the contents of the datagram. The destination computer performs the same mathematical function as the originating host. A discrepancy in the two calculated values indicates that an error has occurred during the transmission of the packet.

The major functional difference between TCP and UDP is reliability. TCP is highly reliable, and UDP is a fast, but simple "best-effort" delivery mechanism. This fundamental difference results in vastly

Internet Protocols Versions different uses of the two host-to-host layer protocols. The primary functional similarity between TCP and UDP is that they both contain information that can only be used by the destination machine. Routers generally do not use any TCP or UDP information when calculating their routes or making forwarding decisions. Instead, routers rely extensively on the header information contained in Layer 3 data structures, such as the IP header.

0 0

Post a comment