The 3 way handshake
It is called as 3 way because minimum 3 packets are required for connection establishment.
- Server calls socket, bind and listen functions and becomes passive open.
- Client issues active open by calling connect, and sends SYN segment ( containing client's initial sequence no. ) to the server.
- Server sends SYN ( with sequence number ) and ACK in a single segment.
- Client acknowledges server's SYN.
TCP Options
The SYN segment contains not only synchronization field but also additional fields for options. Some options are -
MSS - Maximum Segment Size - The maximum size of the segment that can be used in connection.
Window Scale - New option, so should be supported by both ends ( client and server ). It specifies if the advertised window needs to be scaled, as faster connections or long delay paths requrie larger window size.
Timestamp - Timestamp to make sure delayed or duplicate segments are not processed.