0% found this document useful (0 votes)
0 views

Three Way Handshake

The three-way handshake is a process in TCP that establishes a reliable connection between a client and a server through three steps: SYN, SYN-ACK, and ACK. This process ensures synchronization of sequence numbers, reliability of communication, and security against unauthorized connections. After data transmission, a four-way handshake is used to terminate the connection.

Uploaded by

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

Three Way Handshake

The three-way handshake is a process in TCP that establishes a reliable connection between a client and a server through three steps: SYN, SYN-ACK, and ACK. This process ensures synchronization of sequence numbers, reliability of communication, and security against unauthorized connections. After data transmission, a four-way handshake is used to terminate the connection.

Uploaded by

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

The **three-way handshake** is a process used in the **Transmission Control Protocol (TCP)** to

establish a reliable connection between a client and a server before data transmission begins. It ensures
that both devices are ready to communicate and synchronize their sequence numbers for proper data
exchange. The process involves three steps, hence the name "three-way handshake."

---

### Steps in the Three-Way Handshake:

1. **SYN (Synchronize)**:

- The client initiates the connection by sending a **SYN** packet to the server. This packet includes:

- A random **sequence number** (e.g., `x`) for the client.

- The SYN flag set to `1` (indicating a connection request).

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

- The server responds with a **SYN-ACK** packet. This packet includes:

- Its own random **sequence number** (e.g., `y`).

- An **acknowledgment number** set to `x + 1` (confirming receipt of the client's SYN).

- Both the SYN and ACK flags set to `1`.

3. **ACK (Acknowledge)**:

- The client sends an **ACK** packet to the server. This packet includes:

- An **acknowledgment number** set to `y + 1` (confirming receipt of the server's SYN-ACK).

- The ACK flag set to `1`.

Once the three-way handshake is complete, the connection is established, and data transmission can
begin.

---

### Why is the Three-Way Handshake Important?


1. **Synchronization**:

- It ensures that both the client and server agree on initial sequence numbers for reliable data transfer.

2. **Reliability**:

- By confirming each step, the handshake ensures that both devices are ready and capable of
communicating.

3. **Security**:

- It prevents unauthorized or half-open connections from being established.

---

### Example of a Three-Way Handshake:

1. **Client → Server**: SYN (Sequence Number = `x`)

2. **Server → Client**: SYN-ACK (Sequence Number = `y`, Acknowledgment Number = `x + 1`)

3. **Client → Server**: ACK (Acknowledgment Number = `y + 1`)

---

### Connection Termination:

After data transmission, the connection is terminated using a **four-way handshake**:

1. **FIN** (Finish) from one device.

2. **ACK** from the other device.

3. **FIN** from the other device.

4. **ACK** from the first device.

---
In summary, the three-way handshake is a fundamental part of TCP that ensures reliable and
synchronized communication between devices. It is a critical step in establishing connections for
applications like web browsing, email, and file transfers.

You might also like