04 Try it yourself Interactive
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.