The TCP 3-Way Handshake: What It Is and Why It's Important

Shubham DeulkarShubham Deulkar
3 min read

Have you ever talked to a friend on the phone? Before you start talking, you both say "Hello!" to make sure you can hear each other, right? That is just like the way computers talk to each other using something called TCP. Today, I will tell you about the "TCP 3-Way Handshake" in a very simple way!

What is TCP?

TCP stands for Transmission Control Protocol. It is like a rulebook that helps computers talk to each other over the internet. Imagine you want to send a message to your friend, but you want to make sure they got it. TCP helps make sure messages are not lost and that they arrive in the right order.

What is a Handshake?

A handshake is a way to say "Hello" before starting a conversation. When you meet someone, you shake their hand to greet them. Computers do the same thing before sharing information. This handshake makes sure both computers are ready to talk.

The 3-Way Handshake

The "3-Way Handshake" is the special way computers say hello before sharing messages. It has three steps, just like a small conversation:

  1. SYN (Hello, can we talk?)

  2. SYN-ACK (Yes, we can talk!)

  3. ACK (Great! Let’s start talking.)

Now, let's understand this with a simple example!

A Simple Real-World Example

Imagine you are calling your friend on the phone. The conversation might go like this:

  1. You: "Hello! Can you hear me?" (SYN)

  2. Your Friend: "Yes! I can hear you. Can you hear me?" (SYN-ACK)

  3. You: "Yes! Now we can talk." (ACK)

After this, you both start talking and sharing stories. Computers do the same thing when they send data over the internet!

How Does It Work with Computers?

Let’s say you are opening a website on your computer. Your computer needs to talk to the website's server (a big computer that stores websites). The 3-Way Handshake happens like this:

  1. Your Computer: "Hello, website! Can we talk?" (SYN)

  2. Website Server: "Hello! Yes, we can talk. Can you hear me?" (SYN-ACK)

  3. Your Computer: "Yes! Now send me the website." (ACK)

After this, the website loads on your screen!

Why is the 3-Way Handshake Important?

The 3-Way Handshake is important because:

  1. It makes sure both computers are ready to talk.

  2. It prevents lost messages. If we don’t check, some messages might get lost.

  3. It helps computers talk in the right order. Just like when we talk, we need to listen first before we answer!

What Happens If There is No Handshake?

Imagine if you called your friend, but they didn’t answer. You might start talking, but they wouldn't hear anything! That would be a big problem. Without a handshake, computers might send messages that never reach the other computer.

Fun Fact: The Internet Uses This All the Time!

Every time you send a message, open a website, or watch a video, the TCP 3-Way Handshake happens in the background. It happens millions of times every second all over the world!

Conclusion

The TCP 3-Way Handshake is like saying "Hello!" before a conversation. It helps computers check if they can talk, makes sure messages don’t get lost, and keeps things in order. Next time you open a website, remember that your computer is doing a little handshake behind the scenes!

Just like talking to a friend, computers need to say hello first. So now you know—computers do handshakes too!

0
Subscribe to my newsletter

Read articles from Shubham Deulkar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shubham Deulkar
Shubham Deulkar