A TCP Server application is programmed to listen on port P on Host S. A TCP…
2022
A TCP Server application is programmed to listen on port P on Host S. A TCP Client is connected to the TCP Server over the network. Considered that while TCP Connection is active the server is crashed and rebooted. Assume that the client does not use TCP keepalive timer. Which of the following behaviours is/are possible?
Statement I:
If client is waiting to receive a packet, it may wait indefinitely
Statement II:
If the client sends a packet after the server reboot, it will receive the FIN segment
In the light of the above statements, choose the correct answer from the options given below
- A.
Both Statement I and Statement II are true
- B.
Both Statement I and Statement II are false
- C.
Statement I is true but Statement II is false
- D.
Statement I is false but Statement II is true
Attempted by 153 students.
Show answer & explanation
Correct answer: C
Answer: Statement I is true; Statement II is false.
Why Statement I is true: When the server crashes and reboots it loses all TCP connection state and cannot perform an orderly close (no FIN is sent). If the client is simply blocked waiting to receive and does not send data (and there is no TCP keepalive or application heartbeat), the client will not be informed of the crash and may wait indefinitely.
Why Statement II is false: A crash does not produce a FIN. If the client sends data after the server has rebooted, the rebooted host has no record of the previous connection tuple and will usually respond with a TCP RST (connection reset). The client therefore observes a reset, not an orderly FIN.
Additional notes: TCP keepalive or application-level heartbeats would allow the client to detect the peer loss eventually. Any new connection accepted by the server after reboot would be a brand new TCP connection, not a continuation of the old one.
A video solution is available for this question — log in and enroll to watch it.