background image
218
Chapter 5: Network Protocols
Figure 5-2
TCP Header Fields
Ordered Data Transfer
As with other functions in any protocol stack, TCP provides service for the next-higher layer.
The TCP/IP protocol stack has only four layers, so TCP's next-higher layer is the application
layer. Therefore, TCP data transfer implies delivering data from one application to another.
(The TCP/IP application layer performs functions similar to the upper three layers of the OSI
model.) Applications use TCP services by issuing programmatic calls to TCP, supplying the
data to be sent, the destination IP address, and a port number that identifies the application that
should receive the data. The port number, along with the destination IP address and the name
of the transport layer protocol (TCP), form a socket.
TCP accomplishes data transfer by establishing a connection between a socket on each of the
endpoint computers.
Applications use TCP services by opening a socket; TCP manages the
delivery of the data to the other socket.
A socket source/destination pair uniquely identifies a
relationship between two applications in a network. TCP manages the ordered transfer of data
between these two sockets, using IP services to deliver the data.
Multiplexing
In this context, multiplexing refers to the choices made upon receipt of data. TCP's
multiplexing task is to decide which application layer process to give the data to, after the data
is received. For example, in Figure 5-3, Larry is a multiuser system in which two users have
Bit 0
Header
Length (4)
Sequence Number (32)
Destination Port (16)
Source Port (16)
Bit 31
Bit 16
Bit 15
Reserved (6) Code Bits (6)
Window (16)
Checksum (16)
Urgent (16)
Options (0 or 32 if any)
Data (Varies)
Acknowledgement Number (32)
20
Bytes
ch05.fm Page 218 Monday, March 20, 2000 5:06 PM