TCP connections: the three-way handshake
The three-way handshake in Transmission Control Protocol (also called the three message handshake) is the method used to establish and tear down network connections. this handshaking technique is referred to as the 3-way handshake or as "SYN-SYN-ACK" (or more accurately SYN, SYN-ACK, ACK ). the TCP handshaking mechanic is designed so that two computers attempting to communicate can negotiate the parameters of the network connection before beginning communication. this process is also designed so that both ends can initiate and negotiate separate connections at the same time.
3-way handshake description
Below is a (very) simplified description of the TCP 3-way handshake process. Refer to the distrion the right as you examine the list of events on the left.
Event |
Digoal |
HostSendsA TCPSYNChronize packet to host B Host B takes es a'sSYN Host BSendsASYNChronize-ACKNowledgement Host a takes es B'sSYN-ACK HostSends ACKNowledge Host B EsACK.TCP connection is established. |
|
SYNChronize andACKNowledge messages are indicated by a bit inside the TCP Header of the segment.
TCP knows whether the network connection is opening, synchronizing or established by usingSYNChronize andACKNowledge messages when establishing a network connection.
When the communication between two computers ends, another 3-way communication is already med to tear down the TCP connection. This setup and teardown of a TCP connection is part of what qualifies TCP a reliable protocol.
Note that UDP does not perform this 3-way handshake and for this reason, it is referred to as an unreliable protocol.
Protocols encapsulated in TCP
Note that FTP, telnet, HTTP, https, SMTP, POP3, IMAP, ssh and any other protocol that rides over TCP also has a thway handshake stored med as connection is opened. HTTP Web requests, SMTP emails, FTP file transfers all manage the messages they each send. TCP handles the transmission of those messages.
TCP rides on top of Internet protocol (IP) which is why it is called TCP/IP (TCP/IP). TCP segments are passedInsideThe payload section of the IP packets. IP handles addressing and Routing