This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ck program, we run it as a server on port 6666 and connect to it
from a client on the host bsdi. The client's ephemeral port number is 1098. We terminate the
server so it does the active close. This causes the 4-tuple of 126.96.36.199 (local IP address),
6666 (local port number), 188.8.131.52 (foreign IP address), and 1098 (foreign port number)
to enter the 2MSL wait on the server host.
The second time we run the program, we run it as a client and try to specify the local port
number as 6666 and connect to host bsdi on port 1098. But the program gets an error when it
tries to assign itself the local port number of 6666, because that port number is part of the 4tuple that is in the 2MSL wait state.
To try and get around this error we run the program again, specifying the -A option, which
enables the SO_REUSEADDR option that we mentioned. This lets the program assign itself the
port number 6666, but we then get an error when it tries to issue the active open. Even though it
can assign itself the port number 6666, it cannot create a connection to port 1098 on the host
bsdi, because the socket pair defining that connection is in the 2MSL wait state.
What if we try to establish the connection from the other host? First we must restart the server
on sun with the -A flag, since the local port it needs (6666) is part of a connection that is in the
sun % sock -A -s 6666 start as server, listening on port 6666 Then, before the 2MSL wait is over on sun, we start the client on bsdi:
bsdi % sock -bl098 sun 6666
connected on 184.108.40.206.1098 to 220.127.116.11.6666
Unfortunately it works! This is a violation of the TCP specification, but is supported by most
Berkeley-derived implementations. These implementations allow a new connection request to
arrive for a connection that is in the TIME_WAIT state, if the new sequence number is greater
than the final sequence number from the previous incarnation of this connection. In this case
the ISN for the new incarnation is set to the final sequence number from the previous fil...
View Full Document
- Spring '12