TCP is "connection-oriented". Before a single byte of application data is sent, the client and server must agree on sequence numbers and window sizes through a Three-Way Handshake.

The Three Steps

  1. SYN (Synchronize): The client sends a packet with a random "Initial Sequence Number" (ISN).
  2. SYN-ACK: The server acknowledges the client's SYN and sends its own SYN with its own ISN.
  3. ACK (Acknowledge): The client acknowledges the server's SYN.

Why Three Steps?

A two-way handshake isn't enough to prevent Race Conditions or old/delayed packets from creating "ghost" connections. The three-way exchange ensures both sides are ready and in sync.

The Latency Cost

This process takes 1 full Round Trip Time (RTT). This "TCP start-up cost" is exactly why protocols like QUIC are now replacing TCP for high-performance web traffic.