Skip to content

GATE CS 2017 Set 1 Q14 — Transport Layer: Flow Control, Congestion Control, UDP, TCP, Sockets

Explain with AI

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)\text{(RFC 793)}, in which state does the client-side TCP connection wait for the FIN from the server-side TCP?

Choose one option
View worked solution

Answer: D

To determine the correct state, let's trace the TCP connection termination states for the active closer (the client):

  1. ESTABLISHED → FIN-WAIT-1: The client application calls close(), which prompts the client-side TCP to send a FIN segment to the server. The client transitions to the FIN-WAIT-1 state.
  2. FIN-WAIT-1 → FIN-WAIT-2: The client waits in FIN-WAIT-1 for an acknowledgment (ACK) of its FIN segment. Once this ACK is received, the client transitions to the FIN-WAIT-2 state.
  3. FIN-WAIT-2 → TIME-WAIT: While in the FIN-WAIT-2 state, the client-side TCP waits for the FIN segment from the server-side TCP (which indicates that the server has also finished sending data and is closing). Upon receiving this FIN, the client sends an ACK and transitions to the TIME-WAIT state.

Thus, the state in which the client-side TCP waits for the FIN from the server-side TCP is FIN-WAIT-2.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Transport Layer: Flow Control, Congestion Control, UDP, TCP, Sockets questions