Before exchanging data, two endpoints need to agree on connection parameters and establish synchronization. Without a handshake, both sides wouldn’t know if the other is ready or what sequence numbers to expect.
A three-message exchange (SYN, SYN-ACK, ACK) that establishes a TCP connection by synchronizing sequence numbers and confirming both sides are ready.
- Client sends SYN packet with initial sequence number to server
- Server responds with SYN-ACK packet containing its own sequence number and acknowledging client’s SYN
- Client sends ACK packet acknowledging server’s SYN-ACK
- Connection is now established and data transfer can begin
- Synchronizes sequence numbers in both directions
- Confirms both client and server are reachable
- Negotiates connection parameters
- Prevents old duplicate connection initiations from causing confusion
- Built from: TCP — the protocol that uses this handshake
- Builds into: Connection-Oriented Service — enables reliable connections
- Related: Sequence Numbers — synchronized during handshake
- Related: Acknowledgment — used in SYN-ACK and ACK
- SYN flood attacks can exhaust server resources with half-open connections
- Retransmission of SYN occurs if timeout expires without SYN-ACK
- Simultaneous open (both sides send SYN first) is handled by TCP as a special case