background image
220
Chapter 5: Network Protocols
Table 5-2 summarizes the socket connections as shown in Figure 5-3.
In this context, multiplexing is defined as the process of choosing which application receives
the data after it is received by lower-layer protocols. Consider that definition with the four
socket connections in Table 5-2, for packets destined to the server (Curly). All destination
socket information is for 10.1.1.3, with TCP, but the use of different port numbers allows Curly
to choose the correct service to which to pass the data. Also notice that the port numbers do not
have to be unique. The FTP client on Moe and the Telnet Client 1 on Larry both use port 1027,
but their sockets are unique because each uses a different IP address. Also, when the Telnet
servers send data back to Clients 1 and 2, Larry knows how to multiplex to the correct client
application because each uses a unique port number on Larry.
Error Recovery (Reliability)
Reliable data transfer is one of the most important and most typically remembered features
of TCP. To accomplish reliability, data bytes are numbered using the sequence and acknowl-
edgment fields in the TCP header. TCP achieves reliability in both directions, using the
sequence number field of one direction combined with the acknowledgment field in the
opposite direction. Figure 5-4 shows the basic operation.
Figure 5-4
TCP Acknowledgment Without Errors
In Figure 5-4, the acknowledgment field in the TCP header sent by the Web server implies the
next byte to be received; this is called
forward acknowledgment
. The sequence number reflects
the number of the first byte in the segment. In this case, each TCP segment is 1000 bytes in
length; the sequence and acknowledgment fields count the number of bytes.
Table 5-2
TCP Connections from Figure 5-3
Connection
Client Socket
Server Socket
Telnet client 1 to server
(10.1.1.1, TCP, 1027)
(10.1.1.3, TCP, 23)
Telnet client 2 to server
(10.1.1.1, TCP, 1028)
(10.1.1.3, TCP, 23)
FTP client to FTP server
(10.1.1.2, TCP, 1027)
(10.1.1.3, TCP, 21)
Web client to Web server
(10.1.1.2, TCP, 1029)
(10.1.1.3, TCP, 80)
Web
Client
Web
Server
SEQ=1000
SEQ=2000
SEQ=3000
ACK=4000
ch05.fm Page 220 Monday, March 20, 2000 5:06 PM