▶ Interactive Lab

TCP 3-Way Handshake

Animated SYN / SYN-ACK / ACK between client and server, with sequence numbers.

Advertisement
Click Run handshake to send SYN.

What you're seeing

The TCP 3-way handshake establishes a reliable connection. Client picks a random initial sequence number (ISN_c) and sends SYN seq=X. Server replies with SYN-ACK seq=Y ack=X+1, both acknowledging the client's SYN and announcing its own ISN_s=Y. Client closes with ACK seq=X+1 ack=Y+1. Connection is now ESTABLISHED.

After this, both sides can send data with proper sequencing. Note the +1 rule: SYN consumes one sequence number even though it carries no payload.

★ KEY TAKEAWAY
TCP 3-way handshake: SYN → SYN-ACK → ACK. Both sides exchange ISNs and increment with the +1 rule.
▶ WHAT TO TRY
  • Click Run handshake and watch states transition.
  • Adjust Speed to slow down.
  • This handshake happens at the start of every HTTP/2, HTTPS, WebSocket connection.