Skip to main content
InterviewHubPRO
Section Overview
Q33

Question 33 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

66%
Networking & Protocols (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

What is TCP TIME_WAIT state and why does it last for 2MSL?

senior Levelnetworking-protocolsAdvanced Internals

In Simple Words: After sending the final ACK during connection close, the client enters TIME_WAIT for 2 Maximum Segment Lifetimes (2MSL, typically 60 seconds):

  • Purposes:
    1. Ensures the final ACK arrived safely; if lost, the server retransmits FIN, and the client can re-ACK.
    2. Prevents delayed duplicate packets from an old closed connection from accidentally corrupting a newly established connection reusing the same port pair!