Unformatted text preview: the connection is closed,
instead of the normal FIN. We'll connect to a server version of our sock program on svr4 and
type one line of input:
bsdi % sock -LO svr4 8888 this is the client; server shown later
type one line of input that's sent to other end
type end-of-file character to terminate client
Figure 18.15 shows the tcpdump output for this example. (We have deleted all the window
advertisements in this figure, since they add nothing to the discussion.) 1 0.0 2 0.004975
(4.5014) bsdi.1099 > svr4.8888: S
svr4.8888 > bsdi.1099; S
ack 671112194 <mss 1024>
bsdi.1099 > svr4.8888: . ack 1
bsdi.1099 > svr4.8888: P 1:14(13) ack 1
svr4.8888 > bsdi.1099: . ack 14
bsdi.1099 > svr4.8888: R 14:14(0) ack 1 Figure 18.15 Aborting a connection with a reset (RST) instead of a FIN.
Lines 1-3 show the normal connection establishment. Line 4 sends the data line that we typed
(12 characters plus the Unix newline character), and line 5 is the acknowledgment of the
Line 6 corresponds to our typing the end-of-file character (Control-D) to terminate the client.
Since we specified an abort instead of a normal close (the -L0 command-line option), the TCP
on bsdi sends an RST instead of the normal FIN. The RST segment contains a sequence file:///D|/Documents%20and%20Settings/bigini/Docu...homenet2run/tcpip/tcp-ip-illustrated/tcp_conn.htm (20 of 37) [12/09/2001 14.47.16] Chapter 18. TCP Connection Establishment and Termination number and acknowledgment number. Also notice that the RST segment elicits no response
from the other end-it is not acknowledged at all. The receiver of the reset aborts the connection
and advises the application that the connection was reset. We get the following error on the
server for this exchange:
run as server, listen on-port 8888
svr4 % sock -s 8888
this is what the client sent over
read error: Connection reset by peer
This server reads from the network and copies whatever it receives to stand...
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