04 Try it yourself Interactive

Step both endpoints through the whole lifecycle

Both state machines at once. Each press moves one segment: the box in the middle is what is on the wire with its flags, its seq, its ack and its payload length, and the two boxes on either side are the states, with the state that just changed outlined in indigo. Ten steps take you from CLOSED and LISTEN through the handshake, one data exchange, all four teardown segments, and the wait at the end. Lost final ACK runs the same connection but drops the very last segment, so you can watch the peer retransmit its FIN and watch TIME_WAIT earn its keep. The initial sequence numbers and the payload size are yours to change, and every number on screen is recomputed from them. Nothing plays on its own: Next, Back and Reset, or the arrow keys.

Clean run · x=1000 y=5000
nothing sent yet
Three numbers: client ISN, server ISN, payload bytes. ISNs 0 to 4000000000, payload 1 to 1460.
Press Next to begin. Each press sends one segment.


      
Segments0
Client stateCLOSED
Server stateLISTEN
Bytes ACKed0
step 0 / 0