What Is a Three-Way Handshake?

Written by Coursera Staff • Updated on

Learn what a three-way handshake is and why it’s important in network communications.

[Featured image] An IT support professional wearing glasses works on her laptop in a server room.

A three-way handshake is a three-step process in networking that creates a transmission control protocol (TCP) connection between a server and a client. It’s similar to a handshake exchanged by two people, in which one person extends their hand, the other person shakes it, and then the first person acknowledges and retracts their hand. In this article, we will explore more of the intricacies of the three-way handshake, how it’s performed, and why it’s essential in network communications.

Steps of a three-way handshake

In networking, a three-way handshake is a process that's used to initiate a connection in a transmission control protocol/internet protocol (TCP/IP) network. TCP is responsible for ensuring data is delivered correctly between computers on an internet network. The three-way handshake involves the following three steps: synchronize (SYN), synchronize-acknowledge (SYN-ACK), and acknowledge (ACK).

Here's how it works:

1. SYN: The initiating computer (or active client) sends a synchronize sequence number (SYN) packet to the receiving computer (usually a server) with the value 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, acknowledging 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.

Why is a three-way handshake important?

The three-way handshake is a cornerstone of the TCP protocol because it establishes the connection parameters between two computers before actual data transmission begins. Much of our online activity uses three-way handshakes. 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.

Start learning on Coursera

Build your networking knowledge with top-rated courses, Specializations, and Professional Certificates on Coursera. For a comprehensive introduction to information technology and digital security, consider completing the Google IT Support Professional Certificate to build job-ready skills in under six months.

Keep reading

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.