What is TCP And Why it's Important

Ashu SuhailAshu Suhail
2 min read

TCP Three way Handshake Process:-

The TCP 3-Way Handshake is a fundamental process that establishes a reliable connection between two devices over a Transmission Control Protocol (TCP)network. It involves three steps: SYN (Synchronize), SYN-ACK (Synchronize-Acknowledge), and ACK (Acknowledge). During the handshake, the client and server exchange initial sequence numbers and confirm the connection establishment. In this article, we will discuss the TCP 3-Way Handshake Process.

Three way Handshake Process:

It involves the following three steps: synchronize (SYN), synchronize-acknowledge (SYN-ACK), and acknowledge (ACK).

1. SYN: The initiating computer (or active client) sends a synchronize sequence number (SYN) packet to the receiving computer (usually a server). The SYN packet value is set to an arbitrary number (e.g. 100) to “ask” if any open connections are available.

2. SYN-ACK: If the receiving computer (also known as a passive client) has open ports that can accept the connection, it sends back a synchronize-acknowledge (SYN-ACK) packet to the initiating computer. The packet includes two numbers: the receiving computer’s own SYN, which can be any arbitrary number as well (e.g. 200), and the ACK number, which is the initiating computer’s SYN plus one (e.g. 101).

3. ACK: The initiating computer (active client) then sends an acknowledge sequence number (ACK) packet back to the receiving computer. This ACK packet is acknowledgement of receipt of the SYN-ACK packet. The packet value is set to the receiving computer’s SYN (sent in step two) plus one again (e.g. 201). With this final step, the connection establishes, and data transmission can begin.

These steps acknowledge the connection parameters on each side, stabilize the connection, and verify serial numbers of each device. Each side must acknowledge a sequence number that is one larger than the one sent because the acknowledgement field relies on the next sequence number expected, which in turn acknowleges all of the earlier sequence numbers.

Why is a three-way handshake important?

The three-way handshake is a cornerstone of the TCP protocol because it establishes the connection parameters and reliable communication between two computers before actual data transmission begins. Much of our online activity uses three-way handshakes. It's a key mechanism for creating a secure connection over a TCP/IP network. For example, when you open a web browser and search for something on the internet, a three-way handshake connects the client-facing web browser with the internet server. Without proper synchronization, malicious actors such as black hat hackers could establish connections to vulnerable systems.

0
Subscribe to my newsletter

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

Written by

Ashu Suhail
Ashu Suhail