SYN · SYN-ACK · ACK

TCP handshake: follow both endpoints

A sent ACK is not yet a received ACK. Inspect the difference.

One connection · explicit packets and timers

Packet ledger

    Exact connection evidence

    Inspect packets, timers and state transitions

    A connection is two local state machines

    This experiment begins with one active client opening one server connection. Each endpoint has its own state, initial sequence number, next sequence number and expected incoming sequence. SYN occupies one sequence position even though it contains no application payload. The client and server therefore acknowledge initial sequence plus one, wrapping modulo two to the power of thirty-two. Watch the endpoints separately: the client establishes after receiving a valid SYN-ACK, while the server establishes only after receiving the final ACK. A global animation stage cannot represent this distinction.

    Choose the path and opening attempt

    One-way delay sets a fixed transit time of one through four logical ticks in either direction. Initial retry timer chooses two through twelve ticks. Retry limit permits zero through four timer-driven retransmissions after the initial attempt; each new timeout interval doubles. These are teaching settings, not operating-system TCP defaults. Client initial sequence and Server initial sequence accept integers from zero through 4294967295. Server listening chooses a passive listener or a closed port. Editing any input rebuilds and pauses the entire scenario, so a change never silently alters an already delivered packet.

    Target a particular lost message

    Drop packet type chooses none, SYN, SYN-ACK or ACK. With Drop every matching packet disabled, only the first occurrence of that type is dropped. Enabling it drops every occurrence, including retransmissions. A dropped packet still appears in the ledger, but it cannot trigger a receiving transition. Timer expiry and duplicate messages may produce new transmissions; the packet list distinguishes those from the original attempt. A closed server returns a reset acknowledging the client SYN. No real network request is sent, and the initial sequence values are user-selected examples rather than secure random production values.

    Try the ordinary exchange

    Restore defaults: one-way delay two, initial timer six, three retries, client sequence one hundred and server sequence seven hundred. The SYN leaves at tick zero and reaches the listening server at two. The SYN-ACK carries sequence seven hundred and acknowledgement one hundred one. It reaches the client at four; the client is established but the server is still SYN-RECEIVED. The final ACK has sequence one hundred one and acknowledgement seven hundred one. At six, both ends are established. Inspect those packet fields and endpoint states together instead of reading only the final success badge.

    Lose the final ACK and follow recovery

    Select ACK loss and leave persistent loss off. At tick six the final ACK is dropped. The client does not start an ACK retransmission timer. Instead, the server’s pending SYN-ACK timer expires at eight and sends another SYN-ACK. The already-established client acknowledges that duplicate at ten; this second ACK reaches the server at twelve. Enable persistent ACK loss and inspect again: the server never receives the evidence needed to establish, even though the client may remain locally established. Reduce the retry limit or increase delay beyond the initial timer to inspect premature timeout, late packets and reset responses.

    Explore sequence boundaries and playback

    Set both initial sequences to 4294967295 and inspect the packet ledger. Both next sequence and acknowledgement values wrap to zero; SYN still consumes exactly one position. Play stretches the selected trace to sixty inspection seconds. Pause holds it, Next tick advances one logical tick, Restart rewinds and Speed changes viewing pace. Inspect time scrubs the same recorded states, while Show final result exposes the horizon. Restore defaults resets network, loss and sequence settings. The visible horizon follows the final meaningful event plus a short inspection tail, capped at sixty logical ticks; an unfinished retry sequence remains explicitly pending.

    Limits of this opening-only fixture

    The model handles one fixed endpoint pair, one active opener and an optional passive listener. Delivery is FIFO for equal transit delays; due messages are processed before timers at the same tick. Duplicate SYN requests can elicit another SYN-ACK, and late replies after an aborted open can elicit a reset. Retries are bounded by the selected teaching policy. There is no application data, simultaneous open, SYN cookie, backlog exhaustion, negotiated TCP option, receive-window dynamics, congestion controller, connection close or adaptive RTT estimator. Handshake completion is not authentication or encryption. Use TLS to study those separate properties; this lab cannot measure production connection latency or promise successful recovery under every loss schedule.

    Protocol reference: TCP specification, RFC 9293.

    Views are my own and do not represent any employer, past or present.

    Search