A diagram illustrating the TCP 3-way handshake between a Host and a Server. The steps include: Step-1 with Host sending SYN (Seq=x), Server receiving SYN; Step-2 with Server sending SYN ACK (Seq=x, ACK=x+1), Host receiving SYN ACK; and Step-3 with Host sending ACK (ACK=y+1), enabling data transfer with binary data shown.

Master TCP 3-Way Handshake and Boost Your Skills (Updated 2025)

The TCP 3-way handshake is also known as the TCP handshake. It contains three message handshakes or SYN, SYN-ACK, and ACK. It is the method for TCP/IP connection over an IP-based network. TCP’s 3-way handshaking is often called the SYN, SYN-ACK, ACK technique because there are three messages transmitted by TCP to negotiate and start a TCP session between two hosts.

Hosts on the network read all data segments within a session and exchange information about what data is received using the information in the TCP header. TCP is a full-duplex protocol, where each logical connection represents two one-way communication streams or sessions. To set up the connection, the hosts do a TCP 3-way handshake. Control bits in the TCP header show the progress and status of the connection.

The TCP handshake method is designed for hosts attempting to communicate and can negotiate the limits of the TCP socket connection before transmitting data. This is the 3-way handshake process, also designed for both ends can start and negotiate separate TCP socket connections at the same time.

It is being able to negotiate multiple TCP socket connections in both directions at the same time allows a single physical network interface, such as Ethernet, to be multiplexed to transfer multiple streams of TCP data simultaneously. The figure below illustrates the TCP 3-way handshake.

TCP 3-way Handshake
Master TCP 3-Way Handshake and Boost Your Skills (Updated 2025) 3

The steps of the TCP 3-way handshake are as follows:-

  1. The host sends a TCP SYNchronize packet to the server
  2. The server receives Host’s SYN
  3. The server sends a SYNchronize-ACKnowledgement to the host
  4. The host receives the server’s SYN-ACK
  5. The host sends ACKnowledge to the servers
  6. The server receives ACK.
  7. Both are sending data.

When data sending is complete then the sessions are going to close because of finishing sending data. The connection and session mechanisms also enable TCP’s reliability. For termination of the connection, another 3-way communication is going to be performed and the TCP socket.

This setup and teardown of a TCP socket connection is part of what qualifies TCP as a reliable protocol. TCP also acknowledges successful data receiving and guarantees the data is reassembled in the correct order.

FAQs

  • What is the TCP 3-way handshake?

    The TCP 3-way handshake is a method to establish a reliable connection between a Host and Server. It involves three steps: SYN, SYN ACK, and ACK, ensuring both sides are ready for data transfer.

  • What role do sequence numbers play in the TCP handshake?

    Sequence numbers, like Seq=x, track the order of data segments. They are exchanged during the handshake to synchronize and ensure reliable data delivery between Host and Server.

  • How does the acknowledgment number work in TCP?

    The acknowledgment number, like ACK=x+1, confirms receipt of data and indicates the next expected sequence number. It ensures error-free communication during the handshake process.

  • Why is the 3-way handshake important for TCP?

    The 3-way handshake is vital for initializing a connection with synchronized sequence numbers. It prevents data loss and establishes a stable communication channel for data transfer.

     

  • What happens after the TCP 3-way handshake is complete?

    After the handshake, the connection is established, and data transfer begins. Binary data is exchanged between Host and Server, with acknowledgment numbers ensuring reliable delivery.

Avatar of Asad Ijaz

Asad Ijaz

NetworkUstad's lead networking architect with CCIE certification. Specializes in CCNA exam preparation and enterprise network design. Authored 2,800+ technical guides on Cisco systems, BGP routing, and network security protocols since 2018. Picture this: I'm not just someone who writes about tech; I'm a certified expert in the field. I proudly hold the titles of Cisco Certified Network Professional (CCNP) and Cisco Certified Network Associate (CCNA). So, when I talk about networking, I'm not just whistling in the dark; I know my stuff! My website is like a treasure trove of knowledge. You'll find a plethora of articles and tutorials covering a wide range of topics related to networking and cybersecurity. It's not just a website; it's a learning hub for anyone who's eager to dive into the world of bits, bytes, and secure connections. And here's a fun fact: I'm not a lone wolf in this journey. I'm a proud member and Editor of Team NetworkUstad. Together, we're on a mission to empower people with the knowledge they need to navigate the digital landscape safely and effectively. So, if you're ready to embark on a tech-savvy adventure, stick around with me, Asad Ijaz Khattak. We're going to unravel the mysteries of technology, one article at a time!"