Skip to content

Three-Way Handshake

Medium — good to knowNetworking

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."

Made with passive-aggressive love by manoga.digital. Powered by Claude.