</>
ShikshaCSLearn. Code. Grow.
🔍
☕ Support Us
ShikshaCSâ€ēNotesâ€ēComputer Networks
Computer Networks
🕒 7 min read

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?

← Back to all Notes