Three-Way Handshake
ELI5 — The Vibe Check
The three-way handshake is the official name for how TCP sets up a connection in exactly three steps: SYN, SYN-ACK, ACK. It's like calling someone: you dial (SYN), they pick up and say hello (SYN-ACK), you say hi back (ACK). Now you're connected and talking.
Real Talk
The three-way handshake is TCP's connection establishment mechanism: (1) Client sends SYN with its initial sequence number, (2) Server responds with SYN-ACK acknowledging the client's SYN and sending its own sequence number, (3) Client sends ACK completing the connection setup.
Show Me The Code
# Visualize TCP handshake with tcpdump
tcpdump -i eth0 'tcp[tcpflags] & (tcp-syn|tcp-ack) != 0' -n
# You'll see:
# client > server: Flags [S] (SYN)
# server > client: Flags [S.] (SYN-ACK)
# client > server: Flags [.] (ACK)
When You'll Hear This
"The three-way handshake must complete before HTTP data is sent." / "QUIC eliminates the need for a separate three-way handshake."
Related Terms
Latency
Latency is the delay before data starts moving — the time it takes for a request to go from your device to the server and back.
TCP (Transmission Control Protocol)
TCP is like sending a package with delivery confirmation.
TCP Handshake
The TCP handshake is the 'are you ready?' dance before TCP data flows. It's a three-step process: your computer says 'SYN' (hello?