Quiz Entry - updated: 2026.07.14
What is the TCP three-way handshake?
A three-step connection setup: (1) client → server SYN, (2) server → client SYN+ACK, (3) client → server ACK. It synchronizes sequence numbers and confirms both sides are ready.
* SYN, SYN+ACK, ACK: three segments synchronize sequence numbers and open the connection. *
TCP Three-Way Handshake (Connection Establishment):
Client Server
│ │
│──────── SYN (SEQ=100) ───────────→│ Step 1
│ │
│←─── SYN+ACK (SEQ=300,ACK=101) ────│ Step 2
│ │
│──────── ACK (ACK=301) ───────────→│ Step 3
│ │
│ Connection Established │
Three Steps:
| Step | Direction | Flags | Purpose |
|---|---|---|---|
| 1 | Client → Server | SYN | Client requests session, sends initial sequence number |
| 2 | Server → Client | SYN + ACK | Server acknowledges and sends its own sequence number |
| 3 | Client → Server | ACK | Client acknowledges server's sequence number |
What the handshake accomplishes:
- Verifies the destination device is present on the network
- Confirms the destination has an active service on the port
- Informs the destination of the client's intent to establish a session
- Synchronizes sequence numbers between devices
Focus on Step 2 (SYN+ACK): The server combines two flags in one segment - the ACK acknowledges the client's sequence number ("I received your SYN"), and the SYN carries the server's own initial sequence number ("here is mine"). This "meeting in the middle" is why connection setup needs only three segments.
Go deeper:
How TCP really works // Three-way handshake — David Bombal walks the SYN / SYN-ACK / ACK exchange in Wireshark.
RFC 9293 §3.5 — Establishing a Connection — the authoritative handshake state machine and sequence-number rules.
TCP — Connection establishment — Wikipedia's step-by-step with the SYN/ACK numbering.