TCP Handshake & State Machine Visualizer

Step through a normal TCP active open and close with two endpoint states, segment direction, sequence numbers, acknowledgments and TIME-WAIT.

Tcp State Machine · Client runtimeSandboxed
Formatted results will render here in real time.

About this tcp handshake & state machine visualizer

Step through a normal TCP active open and close with two endpoint states, segment direction, sequence numbers, acknowledgments and TIME-WAIT Performs protocol inspection, IP calculation, and network analysis client-side without sending probes or exposing network topology.

Protocol mechanics & network logic

Advance one illustrated segment at a time, then advance the symbolic 2MSL expiry. The lanes show endpoint states after the illustrated send/receive, following RFC 9293 examples. Reset restarts at CLOSED/LISTEN. The original state/event lookup remains below.

Worked network diagnostic scenario

Scenario: Model a local TCP transition from ESTABLISHED on RST.

Sample input:

State: ESTABLISHED | Event: RST

Processing: Normalize the two text values and consult the bundled transition rule. SYN SEQ 1000 is acknowledged by ACK 1001. Server SYN SEQ 9000 is acknowledged by ACK 9001. After the two FINs, the last ACK uses SEQ 1002 and ACK 9002.

Illustrative output:

{ "state": "ESTABLISHED", "event": "RST", "nextState": "CLOSED", "valid": true, "explanation": "Received RST segment; connection terminated per RFC 9293." }

Addressing limits & protocol boundaries

A fixed TCP teaching sequence: client ISN 1000, server ISN 9000, no data. Normal active open and client-initiated close only. No loss, retransmission, simultaneous open/close, window, congestion or real timer simulation. No packets are sent. The separate lookup below retains its documented subset, including RST.

Addressing calculations and subnet models in TCP Handshake & State Machine Visualizer follow IETF RFC definitions. Ensure subnet masks and CIDR prefixes match your network topology.

Offline network inspection boundary

Address parsing and CIDR calculations in TCP Handshake & State Machine Visualizer run entirely client-side without probing external IP networks or transmitting routing data.

IETF RFC specifications & IANA registries

IETF Request for Comments (RFC) standards and IANA registry references:

TCP Handshake & State Machine Visualizer verification · Audit standards

How to use it

  1. Enter, paste, or select your input data into the TCP Handshake & State Machine Visualizer workspace controls.
  2. SYN and FIN each occupy one sequence number. A pure ACK consumes none. ACK gives the next expected sequence number. The first SYN has no valid ACK field (—).
  3. No packets are sent.

Frequently asked questions

What does this TCP state tool model?+

It evaluates the bundled state-transition table for text state and event values. For example CLOSED plus SYN returns valid SYN-SENT, LISTEN plus SYN returns SYN-RECEIVED, and ESTABLISHED plus RST returns CLOSED. It is an educational local model, not packet capture, a socket, a network scan, or a complete TCP implementation.

Which inputs and normalizations apply?+

Enter a state and an event, then run locally. Inputs are trimmed and uppercased; spaces in a state become hyphens. Empty state defaults to CLOSED and empty event to SYN. The supported table has named TCP lifecycle states and events such as SYN, SYN-ACK, ACK, FIN and RST; it does not parse packets, sequence numbers, options, timers, ports or payloads.

How are invalid transitions handled?+

For table lookup, state text is trimmed, uppercased and internal spaces become hyphens. The returned state and an invalid transition's nextState retain the trimmed, uppercased input, including its spaces; valid transitions return a table state. A missing transition marks valid false. RST from non-CLOSED is special: SYN-RECEIVED goes to LISTEN; other states go to CLOSED. This local model does not prove a remote peer response. No packets are sent.

What result does the worked example produce?+

Independent checks matched LISTEN plus SYN to SYN-RECEIVED, ESTABLISHED plus RST to CLOSED, and CLOSED plus FIN as invalid. In the worked example, the tool runs also matched CLOSED plus SYN to SYN-SENT and ESTABLISHED plus RST to CLOSED. Those runs establish this local page path only; they do not inspect or send traffic. The active closer remains in TIME-WAIT for 2MSL, allowing old duplicates to expire and the final ACK to be resent if a FIN is repeated. Here expiry is a manual teaching step; MSL is not assumed to be a fixed wall-clock duration and retransmissions are not simulated.