TCP 3-Way Handshake (SYN, SYN-ACK,ACK)

What Is TCP Three-Way HandShake?

THREE-WAY HANDSHAKE or a TCP 3-way handshake is a process which is used in a TCP/IP network to make a connection between the server and client. It is a three-step process that requires both the client and server to exchange synchronization and acknowledgment packets before the real data communication process starts.

Three-way handshake process is designed in such a way that both ends help you to initiate, negotiate, and separate TCP socket connections at the same time. It allows you to transfer multiple TCP socket connections in both directions at the same time.

In this Networking tutorial, we will explain:

TCP message types

Message Description
Syn Used to initiate and establish a connection. It also helps you to synchronize sequence numbers between devices.
ACK Helps to confirm to the other side that it has received the SYN.
SYN-ACK SYN message from local device and ACK of the earlier packet.
FIN Used to terminate a connection.

TCP Three-Way Handshake Process

TCP traffic begins with a three-way handshake. In this TCP handshake process, a client needs to initiate the conversation by requesting a communication session with the Server:

Three-Way Handshake Process
3 way Handshake Diagram

Real-world Example

Here is a simple example of the three-way handshake process that is consists of three steps:

After the data transmission process is over, TCP automatically terminates the connection between two separate endpoints.

Summary

 

YOU MIGHT LIKE: