$linuxjunkies
>

three-way handshake

also: TCP handshake, SYN-SYN-ACK-ACK, connection establishment

The three-step process by which TCP establishes a connection between a client and server: SYN, SYN-ACK, and ACK.

The three-way handshake is the mechanism TCP uses to initialize a reliable connection. The client sends a SYN (synchronize) packet with an initial sequence number, the server responds with a SYN-ACK packet acknowledging that number and sending its own, and finally the client sends an ACK (acknowledgment) packet to confirm the server's sequence number. Only after this exchange completes can data be transmitted reliably.

Example: when you open a browser and connect to a website, your computer initiates: (1) SYN to the web server, (2) receives SYN-ACK back, (3) sends ACK. Now the HTTP request can safely travel across the network.

This handshake ensures both sides agree on initial sequence numbers, which are used to track and order packets throughout the connection, enabling TCP's reliability guarantees like in-order delivery and duplicate detection.

Related terms