AlgoPlus//networking / tcp-handshake
Read the theory

TCP 3-Way Handshake

SYN, SYN-ACK, ACK to agree on sequence numbers — then data, then a clean teardown.

Client
Server
Legend
SYN / FIN
ACK
Data
AI Tutor Workspace
In a nutshell
TCP gives a reliable, ordered byte stream, so before any data moves both sides agree on starting sequence numbers. The client sends a SYN with its number, the server replies SYN-ACK (its own SYN plus an acknowledgement), and the client ACKs. This three-way handshake costs one round trip; closing takes a four-way FIN exchange.
Ready
Press play to begin the cinematic walkthrough.
Before trusting a stranger with an ordered byte stream, both sides swap starting sequence numbers and confirm they heard each other — that's the SYN / SYN-ACK / ACK dance.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for TCP 3-Way Handshake.