What is a three-way handshake?

A three-way handshake is a method used in a TCP/IP network to create a connection between a host and a client. It’s called a three-way handshake because it is a three-step method in which the client and server exchanges packets. The three steps are as follows:

  1. The client sends a SYN(Synchronize) packet to the server check if the server is up or has open ports
  2. The server sends SYN-ACK packet to the client if it has open ports
  3. The client acknowledges this and sends an ACK(Acknowledgment) packet back to the server