0% found this document useful (0 votes)
62 views3 pages

3 Way Handshaking

The three-way handshake in TCP establishes a reliable connection between a client and server through three steps: SYN, SYN-ACK, and ACK. The client initiates the connection by sending a SYN packet, the server responds with a SYN-ACK packet to acknowledge the request, and finally, the client sends an ACK packet to confirm the connection. This process ensures both parties are synchronized and ready for data transmission.

Uploaded by

SUBASREE G S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views3 pages

3 Way Handshaking

The three-way handshake in TCP establishes a reliable connection between a client and server through three steps: SYN, SYN-ACK, and ACK. The client initiates the connection by sending a SYN packet, the server responds with a SYN-ACK packet to acknowledge the request, and finally, the client sends an ACK packet to confirm the connection. This process ensures both parties are synchronized and ready for data transmission.

Uploaded by

SUBASREE G S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

The three-way handshake in TCP is a crucial process for establishing a reliable connection

between a client and a server. This process ensures that both sides are synchronized and ready to
begin transmitting data, while also verifying that the network path is functioning correctly.

Detailed Explanation with Block Diagram:

Let's break down each step of the three-way handshake and visualize it using a simple block
diagram.

Step 1: SYN (Client → Server)

1. The client sends a SYN (synchronize) packet to the server.


2. This packet contains a randomly generated sequence number (Seq = x), which is used to
start tracking the data flow from the client to the server.
3. The purpose of this packet is to initiate a connection by informing the server that the
client wants to establish a TCP connection.

 Packet content:
o SYN flag set.
o Seq = x (client's initial sequence number).

Step 2: SYN-ACK (Server → Client)

1. The server responds to the client with a SYN-ACK packet after receiving the SYN
packet.
2. The SYN-ACK packet serves two purposes:
o SYN: The server generates and sends its own randomly chosen sequence
number (Seq = y) for communication from the server to the client.
o ACK: The server acknowledges the receipt of the client's SYN by setting the
acknowledgment number (Ack = x + 1). This confirms the server has received
the client’s SYN packet and is ready to establish communication.

 Packet content:
o SYN flag set (server's initiation).
o ACK flag set (acknowledging the client's SYN).
o Seq = y (server's initial sequence number).
o Ack = x + 1 (acknowledging client's sequence number).

Step 3: ACK (Client → Server)


1. Upon receiving the SYN-ACK packet from the server, the client sends an ACK packet to
the server.
2. This ACK packet confirms that the client has received the server's SYN-ACK. The client
sets the acknowledgment number to y + 1, which acknowledges the server’s sequence
number.
3. At this point, the connection is fully established, and the client and server are ready to
exchange data.

 Packet content:
o ACK flag set (acknowledging server's SYN).
o Ack = y + 1 (acknowledging the server's sequence number).

Block Diagram of the Three-Way Handshake:


plaintext
Copy code
Client Server
------ ------
| |
|------ SYN (Seq = x) --------------------->| Step 1: Client sends SYN
| |
|<----- SYN-ACK (Seq = y, Ack = x + 1) -----| Step 2: Server responds
with SYN-ACK
| |
|------ ACK (Ack = y + 1) ----------------->| Step 3: Client sends ACK
| |
Connection established, data transfer can begin

Detailed Working of the Three-Way Handshake:

1. Step 1 (SYN):
o The client sends a SYN packet to the server. This packet essentially means: “I
would like to start a conversation, here is my initial sequence number.”
2. Step 2 (SYN-ACK):
o When the server receives the SYN packet, it replies with a SYN-ACK. This is the
server saying: “I acknowledge your request and I’m ready to communicate. Here
is my sequence number, and I acknowledge your sequence number.”
3. Step 3 (ACK):
o The client receives the SYN-ACK packet and sends an ACK back to the server.
This final step confirms that both the client and server agree to the connection and
are now synchronized. The connection is established and ready for data transfer.

Key Points:
 SYN: Initiates the connection.
 SYN-ACK: Acknowledges the initiation and sets up server’s sequence number.
 ACK: Finalizes the handshake and confirms readiness.
 Both client and server now have each other's sequence numbers, ensuring reliable
communication.

This reliable connection process ensures that both parties are synchronized before actual data
transmission begins, making TCP a reliable protocol for network communication.

4o

You might also like