The Handshake#
When two computers want to talk to each other (the client and the server), and they know to use TCP ahead of time, they establish a connection using a three-way handshake. It goes a little something like this:
SYN
: The client sends aSYN
TCP packet to the serverSYN-ACK
: In response, the server replies with aSYN-ACK
TCP packetACK
: Finally, the client sends anACK
TCP packet back to the server
There are three steps, which is why it's called the three-way handshake.