TCP IP Illustrated

Tcp connection establishment and termination tcp 0 0

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: lient, and what happens if multiple connection requests arrive at about the same time? TCP Server Port Numbers We can see how TCP handles the port numbers by watching any TCP server. We'll watch the Telnet server using the netstat command. The following output is on a system with no active Telnet connections. (We have deleted all the lines except the one showing the Telnet server.) sun % netstat -a -n -f inet Active Internet connections (including servers) Local Address Proto Recv-Q Send-Q Foreign Address (state) file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/tcp_conn.htm (27 of 37) [12/09/2001 14.47.16] Chapter 18. TCP Connection Establishment and Termination tcp 0 0 *.23 *.* LISTEN The -a flag reports on all network end points, not just those that are ESTABLISHED. The -n flag prints IP addresses as dotted-decimal numbers, instead of trying to use the DNS to convert the address to a name, and prints numeric port numbers (e.g., 23) instead of service names (e.g., Telnet). The -f inet option reports only TCP and UDP end points. The local address is output as *.23, where the asterisk is normally called the wildcard character. This means that an incoming connection request (i.e., a SYN) will be accepted on any local interface. If the host were multihomed, we could specify a single IP address for the local IP address (one of the host's IP addresses), and only connections received on that interface would be accepted. (We'll see an example of this later in this section.) The local port is 23, the well-known port number for Telnet. The foreign address is output as *.*, which means the foreign IP address and foreign port number are not known yet, because the end point is in the LISTEN state, waiting for a connection to arrive. We now start a Telnet client on the host slip (140.252.13.65) that connects to this server. Here are the relevant lines from the netstat output: Proto tcp tcp RecvQ 0 0 SendForeign Address Local Address (state) Q 140.252.13.33.23 140.252.13.65.1029 ESTABLISHED 0 *.23 LISTEN 0 *...
View Full Document

Ask a homework question - tutors are online