The GATE Grind

GATE 2017 CS – Question 24

Computer Networks · TCP: Flow Control, Congestion Control, Socket API · 1 mark · Multiple choice

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 (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

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) FIN-WAIT-2

Explanation

The client sends FIN and enters FIN-WAIT-1. When it receives the ACK for that FIN, it moves to FIN-WAIT-2 and waits there for the server's own FIN.