TCP uses a three-way handshake to make a reliable connection. The connection is duplex, and the two sides synchronize (SYN) and acknowledge (ACK) with each other. This exchange of four flags takes place in three steps – SYN, SYN-ACK, and ACK.
As soon as the connection is established, data is transferred between the devices. As soon as the data transfer is complete and the connection must be disconnected, this is done using a three-way handshake process as well.
Alternatively, it is a 3-step process in which the client and server exchange synchronization and acknowledgment packets before the actual data communication process begin.
The 3-way handshake process is designed so that both sides initiate, negotiate, and tear down a TCP connection at the same time. This allows us to send multiple TCP socket connections in both directions at the same time.