Bitkernel · CS Fundamentals
Analyze TCP three-way handshake states
TrueInterview
October 7, 2026 · 2 min read
During TCP connection establishment (the three-way handshake), exactly one of the following statements is correct. Identify which one, and be prepared to explain why each of the other three is wrong. Options:
- A. The server waits after receiving the client's
SYNsegment, then entersSYN_SENT. - B. The server transitions to
SYN_RCVDwhen it receives the client'sACKsegment. - C. The client can be in
ESTABLISHEDwhile the server is still inSYN_RCVD. - D. If the client's final
ACKnever reaches the server, the server waits and then closes the connection directly.
Hint — Where to start: Go through the handshake segment by segment, noting each endpoint's state after every send or receive. The two sides never change state at the same moment. Hint — State ownership:
SYN_SENTis the state of the initiating side (the client), whileSYN_RCVDis the state of the responding side (the server). Be alert for options that reverse these roles. Hint — Where 2MSL actually lives: The wait andTIME_WAITtimer belong to connection teardown, specifically for the side that actively closes, not to establishment. Any option that places in the setup phase is a distractor.
Constraints & Assumptions
- Standard TCP as defined by RFC 793 / RFC 9293; no
TCP_DEFER_ACCEPT, no TCP Fast Open, and no simultaneous open. - Exactly one option is correct; this is a single-answer multiple-choice question.
- The client is the active opener, and the server is the passive listener waiting on a port in the
LISTENstate. MSLstands for Maximum Segment Lifetime, and2MSLis twice that duration.
What a Strong Answer Covers
- The correct choice (C), along with the exact state of each endpoint after each of the three segments.
- The complete state progression: client
CLOSED→SYN_SENT→ESTABLISHED; serverLISTEN→SYN_RCVD→ESTABLISHED. - Why the client reaches
ESTABLISHEDbefore the server does—the asymmetry that makes C correct. - A sound rebuttal for each incorrect option: A swaps the client and server states and misapplies ; B mistakes what triggers
SYN_RCVD; D wrongly assigns the /TIME_WAITmechanism and overlooksSYN+ACKretransmission. - Where actually belongs: the
TIME_WAITstate of the active closer during teardown.
Follow-up Questions
- If the client's final
ACKis lost, what actually happens on the server? Describe the retransmission behavior and how the half-open connection ultimately resolves. - Why does the active closer wait
2MSLinTIME_WAIT, and which two problems does that wait avoid? - How does a SYN flood take advantage of the
SYN_RCVDstate, and how do SYN cookies protect against it without storing per-connection state? - In a simultaneous open, where both peers send
SYNfirst, what state path do the endpoints follow, and which option's premise would change? Overview: This question tests understanding of TCP connection establishment and the TCP state machine, checking whether you can recognize correct state transitions during the three-way handshake and related transport-layer behavior.