The three-way handshake establishes a TCP connection before application data is transmitted. It uses TCP header flags to coordinate both hosts. section 22.2.1
Follow the three-message sequence:
- SYN: The initiating host requests a connection and synchronizes its initial sequence number. section 22.2.1 section 22.3
- SYN-ACK: The receiving host acknowledges the request and sends its own synchronization information. section 22.2.1
- ACK: The initiating host acknowledges the response; the TCP connection is ready for data exchange. section 22.2.1 section 22.3
PC1 connects to SRV1
PC1 sends a TCP segment with SYN, SRV1 replies with SYN-ACK, and PC1 returns ACK. These three establishment segments carry no application data; they prepare the connection for later exchange. section 22.2.1
The handshake adds time and processing overhead compared with UDP, which sends data without first establishing a connection. TCP trades that overhead for connection-oriented, reliable communication and flow control. section 22.2.3
