Three-Way Handshake
In short: The three-step connection setup in TCP: SYN → SYN-ACK → ACK, before the actual data transfer begins.
In more detail: In the process, client and server exchange their respective initial sequence numbers and confirm their readiness for the connection to each other. Only after these three packets is the connection considered “established” and payload is transferred. This overhead is one of the reasons why UDP is faster for latency-critical applications — it skips the handshake completely.
In Depth
The sequence in detail:
Client Server
|----------- SYN (seq=x) --------->| "I'd like a connection, my initial number is x"
|<------ SYN-ACK (seq=y, ack=x+1) -| "OK, acknowledged. My initial number is y"
|----------- ACK (ack=y+1) ------->| "Acknowledged. The connection is up."
After these three packets, both sides are in the “ESTABLISHED” state and can exchange payload. Incidentally, tearing down a TCP connection runs as a mirror image with four packets (FIN, ACK, FIN, ACK — a “four-way handshake” for connection teardown), because both sides have to signal independently of each other that they’re finished before the connection is completely closed.
The handshake’s additional latency (at least one complete round trip before any payload flows at all) is noticeable for short connections — modern optimisations such as TCP Fast Open try to send the first payload during the handshake itself for repeated connections to known servers, in order to reduce this overhead.