TCP 3 way handshake
TCP starts a connection with a 3 way handshake to parse enough information to start the duplex communication:
- The connecting host sends an empty synchronise message with the SYN bit set to 1. It sets the initial sequence for the messages this host will be sending
client_isn
.- The receiving host sends an empty synchronise-acknowledgement message with the SYN and ACK bit set to 1. It sets the initial sequence number for the messages this host will be sending
server_isn
with the acknowledgement header set toclient_isn + 1
.- Lastly the connecting host sends an empty acknowledgement message with the ACK bit set to 1. The acknowledgement header is set to
server_isn + 1
.