The handshake is also an ordered state path. The timeline ties each state label to the segment that moves the client or server forward.

highlighted = computed this step

Why order is the state machine

The visible states are not separate facts from the messages. Each transition is tied to the next segment in the ordered timeline.

messages=3\text{messages}=3
Handshake statesA TCP handshake timeline recomputed from exact sequence and acknowledgment numbers.Handshake statesClientCLOSEDSYN-SENTESTABLISHEDServerLISTENSYN-RECEIVEDESTABLISHEDSYN seq=1000 SYNSYN-ACK seq=3000 ack=1001 SYN, ACKACK seq=1001 ack=3001 ACK

Client path

The client starts CLOSED, sends SYN, waits in SYN-SENT, and reaches ESTABLISHED after the final ACK. The sequence numbers still pin the ordered steps.

100010011000\to1001
Handshake statesA TCP handshake timeline recomputed from exact sequence and acknowledgment numbers.Handshake statesClientCLOSEDSYN-SENTESTABLISHEDServerLISTENSYN-RECEIVEDESTABLISHEDSYN seq=1000 SYNSYN-ACK seq=3000 ack=1001 SYN, ACKACK seq=1001 ack=3001 ACK

Server path

The server starts in LISTEN, receives the SYN, replies from SYN-RECEIVED, and ends ESTABLISHED. Its SYN at 3000 is acknowledged by 3001.

3000+1=30013000+1=3001
Handshake statesA TCP handshake timeline recomputed from exact sequence and acknowledgment numbers.Handshake statesClientCLOSEDSYN-SENTESTABLISHEDServerLISTENSYN-RECEIVEDESTABLISHEDSYN seq=1000 SYNSYN-ACK seq=3000 ack=1001 SYN, ACKACK seq=1001 ack=3001 ACK

Each transition has a segment

The state labels line up with SYN, SYN-ACK, and ACK. This is ordering, not a timer or retry model.

segments=3\text{segments}=3
Handshake statesA TCP handshake timeline recomputed from exact sequence and acknowledgment numbers.Handshake statesClientCLOSEDSYN-SENTESTABLISHEDServerLISTENSYN-RECEIVEDESTABLISHEDSYN seq=1000 SYNSYN-ACK seq=3000 ack=1001 SYN, ACKACK seq=1001 ack=3001 ACK

Summary

The state machine is the ordered path CLOSED to SYN-SENT to ESTABLISHED on the client and LISTEN to SYN-RECEIVED to ESTABLISHED on the server. Connection setup ordering and exact sequence numbers only; timing, retransmission, and round-trip time are not modeled here.

final ack=3001\text{final ack}=3001
Handshake statesA TCP handshake timeline recomputed from exact sequence and acknowledgment numbers.Handshake statesClientCLOSEDSYN-SENTESTABLISHEDServerLISTENSYN-RECEIVEDESTABLISHEDSYN seq=1000 SYNSYN-ACK seq=3000 ack=1001 SYN, ACKACK seq=1001 ack=3001 ACK