• ↑↓ pour naviguer
  • pour ouvrir
  • pour sélectionner
  • ⌘ ⌥ ↵ pour ouvrir dans un panneau
  • ←→ pour naviguer
  • esc pour rejeter
⌘ '
raccourcis clavier

The Problem

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.

Core Idea

A three-message exchange (SYN, SYN-ACK, ACK) that establishes a TCP connection by synchronizing sequence numbers and confirming both sides are ready.

How It Works

  1. Client sends SYN packet with initial sequence number to server
  2. Server responds with SYN-ACK packet containing its own sequence number and acknowledging client’s SYN
  3. Client sends ACK packet acknowledging server’s SYN-ACK
  4. Connection is now established and data transfer can begin

Visual Explanation

G Client Client Server Server Client->Server 1. SYN (seq=x) Client->Server 3. ACK (ack=y+1) Established Connection Established Server->Client 2. SYN-ACK (seq=y, ack=x+1)

Key Properties

  • Synchronizes sequence numbers in both directions
  • Confirms both client and server are reachable
  • Negotiates connection parameters
  • Prevents old duplicate connection initiations from causing confusion

Connections

Edge Cases & Gotchas

  • 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