Three-way handshake process in TCP means?

 The three-way handshake is a fundamental process used by the Transmission Control Protocol (TCP) to establish a connection between two devices over an IP network, such as the internet. It ensures that both devices agree to communicate and sets up parameters for the subsequent data exchange. The three steps involved in the handshake are:


1. **Step 1: SYN (Synchronize)**

   - The initiating device (referred to as the client) sends a TCP segment with the SYN flag (SYN packet) set to the receiving device (referred to as the server).

   - This packet is used to request the establishment of a connection and includes a randomly chosen initial sequence number (ISN) to identify the subsequent data segments.


2. **Step 2: SYN-ACK (Synchronize-Acknowledge)**

   - Upon receiving the SYN packet, the server responds with a TCP segment that has both the SYN and ACK (acknowledge) flags set (SYN-ACK packet).

   - The server acknowledges the client's request for connection and also selects its own ISN for the connection.

   - The acknowledgment number (ACK number) in the packet is set to the client's ISN plus 1, indicating that the server has received the client's SYN packet and is ready to establish a connection.


3. **Step 3: ACK (Acknowledge)**

   - The client receives the SYN-ACK packet from the server and responds with an ACK packet.

   - The ACK packet has the ACK flag set and acknowledges the server's ISN plus 1. This indicates that the client has received the server's SYN-ACK and is ready to start data transmission.


Once this three-way handshake process is complete, a TCP connection is established between the client and the server. Both devices have agreed upon initial sequence numbers, and they can begin sending data segments to each other while ensuring reliable and ordered communication.


It's important to note that the three-way handshake is a crucial part of TCP's reliability mechanism. It helps prevent accidental or unauthorized connections and ensures that both devices are in sync before data transmission begins. Additionally, the three-way handshake is also used to terminate a TCP connection, with a similar process involving the exchange of FIN (finish) flags.

Comments

Popular posts from this blog

What is INSTANCES in AWS

What is Subnets in Virtual Private cloud?

What is the connection in between VPC, EC2, SECURITY GROUPS, SUBNETS AND INSTANCES