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 their laptop in a server room.

A three-way handshake, or TCP 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 establishing a reliable connection for network communications.

Google

professional certificate

Google IT Support

The launchpad to a career in IT. This program is designed to take beginner learners to job readiness in about three-to-six months.

4.8

(187,565 ratings)

1,867,328 already enrolled

Beginner level

Average time: 3 month(s)

Learn at your own pace

Skills you'll build:

Professional Development, IT Infrastructure, TCP/IP, Applicant Tracking Systems, Computer Networking, Technical Support, Package and Software Management, Network Security, Microsoft Windows, Computer Security, Network Troubleshooting, Network Architecture, Cloud Infrastructure, Systems Administration, Computer Hardware, Desktop Support, Interviewing Skills, Application Security, Information Systems Security, File Systems, Prompt Engineering, Generative AI, Personal Attributes, Communication, Problem Solving, Active Directory, Disaster Recovery, Servers, Virtualization, Lightweight Directory Access Protocols, System Configuration, Server Administration, User Accounts, Cloud Computing, Technical Support and Services, Data Storage Technologies, Encryption, Firewall, Malware Protection, Security Awareness, Cryptography, Hardening, Security Management, Authorization (Computing), Cybersecurity, Data Security, Security Controls, Threat Management, Security Strategy, Information Technology, Identity and Access Management, Threat Detection, Linux Commands, File Management, Software Installation, System Monitoring, Remote Access Systems, OS Process Management, Operating Systems, Linux, Command-Line Interface, Linux Administration, Network Protocols, Network Model, Data Integrity, Dynamic Host Configuration Protocol (DHCP), Virtual Private Networks (VPN), Wireless Networks, OSI Models, Network Routing, Network Infrastructure, Hardware Troubleshooting, Help Desk Support, Technical Communication, End User Training and Support, Technical Documentation, Computer Architecture, Software Documentation, Customer Support

What is 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.

Three-way handshake protocol: What is the correct sequence of the three-way handshake?

It 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). The SYN packet value is 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. This ACK packet is an acknowledgement of 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 is established, and data transmission can begin.

These steps acknowledge the connection parameters on each side, stabilize the connection, and verify the serial numbers of each device. Each side must acknowledge a sequence number that is one larger than the one sent because the acknowledgement field relies on the next sequence number expected, which in turn acknowledges all of the earlier sequence numbers.

What is a four-way handshake?

Where the three-way handshake creates a connection allowing two computers to seamlessly pass information back and forth, a four-way handshake terminates that connection with a pair of finish (FIN) and ACK messages. 

Why is a TCP three-way handshake important?

The three-way handshake is a cornerstone of the TCP protocol because it establishes the connection parameters and reliable communication between two computers before actual data transmission begins. Much of our online activity uses three-way handshakes. It's a key mechanism for creating a secure connection over a TCP/IP network. 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. Without proper synchronization, malicious actors such as black hat hackers could establish connections to vulnerable systems.

You can learn about TCP connection, OSI models, and how devices communicate from the experts at Microsoft by enrolling in the online course Introduction to Secure Networking.

Microsoft

course

Introduction to Secure Networking

This course has been designed for individuals seeking entry-level positions in IT support. Whether you're a recent graduate, a career changer, or someone ...

4.8

(240 ratings)

15,445 already enrolled

Beginner level

Average time: 25 hour(s)

Learn at your own pace

Skills you'll build:

Microsoft Azure, Virtualization, Cloud Computing, Firewall, Local Area Networks, Network Monitoring, OSI Models, General Networking, Network Protocols, Networking Hardware, Network Infrastructure, TCP/IP, Network Security, Network Architecture, Computer Networking, Virtual Machines, Software As A Service

Read more: 6 Networking Certifications for Your IT Career

Strengthen your knowledge of network communications with Coursera

If you're looking to start your career in information technology, you can gain a comprehensive introduction to networking and digital security by completing the Google IT Support Professional Certificate. You can build job-ready skills with an industry leader in under six months.

Google

professional certificate

Google IT Support

The launchpad to a career in IT. This program is designed to take beginner learners to job readiness in about three-to-six months.

4.8

(187,565 ratings)

1,867,328 already enrolled

Beginner level

Average time: 3 month(s)

Learn at your own pace

Skills you'll build:

Professional Development, IT Infrastructure, TCP/IP, Applicant Tracking Systems, Computer Networking, Technical Support, Package and Software Management, Network Security, Microsoft Windows, Computer Security, Network Troubleshooting, Network Architecture, Cloud Infrastructure, Systems Administration, Computer Hardware, Desktop Support, Interviewing Skills, Application Security, Information Systems Security, File Systems, Prompt Engineering, Generative AI, Personal Attributes, Communication, Problem Solving, Active Directory, Disaster Recovery, Servers, Virtualization, Lightweight Directory Access Protocols, System Configuration, Server Administration, User Accounts, Cloud Computing, Technical Support and Services, Data Storage Technologies, Encryption, Firewall, Malware Protection, Security Awareness, Cryptography, Hardening, Security Management, Authorization (Computing), Cybersecurity, Data Security, Security Controls, Threat Management, Security Strategy, Information Technology, Identity and Access Management, Threat Detection, Linux Commands, File Management, Software Installation, System Monitoring, Remote Access Systems, OS Process Management, Operating Systems, Linux, Command-Line Interface, Linux Administration, Network Protocols, Network Model, Data Integrity, Dynamic Host Configuration Protocol (DHCP), Virtual Private Networks (VPN), Wireless Networks, OSI Models, Network Routing, Network Infrastructure, Hardware Troubleshooting, Help Desk Support, Technical Communication, End User Training and Support, Technical Documentation, Computer Architecture, Software Documentation, Customer Support

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.

Advance in your career with recognized credentials across levels.

Subscribe to earn unlimited certificates and build job-ready skills from top organizations.