LOGBOOK

HELP

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.

TCP three-way handshake sequence

* 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:

  1. Verifies the destination device is present on the network
  2. Confirms the destination has an active service on the port
  3. Informs the destination of the client's intent to establish a session
  4. 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:

From Quiz: NETW1 / Transport Layer | Updated: Jul 14, 2026