Both the client and the server need to know that they can send and receive, so a three-way handshake is required.

Simplify the three-way handshake

From the picture, we can see that the three-way handshake can be simplified as: C initiates the connection request, S confirms the connection, and C confirms the connection. Let’s look at the function of each handshake:

First handshake: S can only accept the packet segment sent by C

Second handshake: C can confirm that S has received the packet segment and can accept the packet segment sent by S

Third handshake: S can confirm that C has received the packet segment