NETLEARN
Lesson 01Transport

TCP 3-Way Handshake

TCP can’t just start sending. Before any data flows, both ends have to agree that each is ready to receive. That is what these three messages are for.

Layer
Layer 4 · Transport
Reference
RFC 793 / RFC 9293
Steps
3
Clientbrowser
Serverweb server
legendrequestresponsecontrolmessage in flight

Common misunderstandings

  • Closing a connection uses its own separate wave (FIN/ACK): 4 steps, not 3.

Key notes

Why 3, not 2?
You need one message per direction to prove each pipe is alive, plus one to confirm.
Random ISN
The starting number is randomized so stale packets from an earlier connection aren’t mistaken for new ones.
Cost
One full round-trip (~1 RTT) before the first byte of data is sent.
Compare
UDP does none of this. It just sends, with no promises.