edited by
13,785 views
41 votes
41 votes

Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram $\text{(RFC 793)}$, in which state does the client-side TCP connection wait for the FIN from the server-side TCP?

  1. LAST-ACK
  2. TIME-WAIT
  3. FIN-WAIT-$1$
  4. FIN-WAIT-$2$
edited by

7 Answers

Best answer
42 votes
42 votes

Close Initiator  Represents the agent which first sent the request for closing the connection when previously it was in established state(Usually client).

Close Responder represents the agent which responds to FIN Segments(Usually the server).

Now, as we see in the diagram,

When the client sends the FIN segment to server,it moves to FIN-WAIT1 state where it waits for an Acknowledgement from the server for it's own FIN segment.

Now when the client receives ACK for its OWN FIN Segment, it moves to FIN-WAIT2. This state represents that the connection from client to server has been terminated but still the connection from server to client is open.(TCP supports full duplex connections).

Hence, answer is D.

Reference:

[1]http://tcpipguide.com/free/t_TCPOperationalOverviewandtheTCPFiniteStateMachineF-2.htm

edited by
16 votes
16 votes

This is from Tanenbaum,  read this line " Now both sides are closed , but TCP waits a time equal to the maximum packet lifetime , to guarantee that all packets from the connection has died off , just in case  the acknowledgement was lost " ... 

and this is in FIN WAIT 2  state...  

This question is taken directly from Tanenbaum book .

Answer:

Related questions

39 votes
39 votes
12 answers
2
34 votes
34 votes
3 answers
3