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
sun % netstat -a -n -f inet
Active Internet connections (including servers)
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 (126.96.36.199) that connects to this server.
Here are the relevant lines from the netstat output: Proto
0 SendForeign Address
188.8.131.52.23 184.108.40.206.1029 ESTABLISHED
View Full Document
This test prep was uploaded on 04/04/2014 for the course ECE EL5373 taught by Professor Guoyang during the Spring '12 term at NYU Poly.
- Spring '12