TCP/IP & the 3-Way Handshake
How two devices agree to start a reliable connection.
What is TCP?
TCP (Transmission Control Protocol) is a connection-oriented protocol that guarantees reliable, ordered delivery of data â used for web browsing, email, and file transfers where accuracy matters more than raw speed.
The 3-Way Handshake
Before sending data, TCP establishes a connection in 3 steps: 1) Client sends SYN (synchronize), 2) Server responds with SYN-ACK (synchronize-acknowledge), 3) Client sends ACK (acknowledge). After this, the connection is established.
Why It Matters
This handshake ensures both sides are ready and agree on initial sequence numbers before any real data flows, preventing issues like duplicate or out-of-order packets going unnoticed.
đ Real-World Use
Every time you load a website over HTTPS, your browser performs a TCP 3-way handshake with the server FIRST, before any webpage data is exchanged â you can see this delay as the 'connecting...' phase in slow networks.
đĄ Pro Tip
A frequently asked follow-up question: 'why not just 2 steps?' â because the client also needs to confirm it received the server's SYN-ACK, ensuring BOTH sides agree the connection is ready, not just one.
đ§Ē Quick Self-Test
Check what you just learned â no pressure, just practice.
1. What is the first message in the TCP handshake?
2. How many steps are in the TCP 3-way handshake?