TCP 3-Way Handshake Diagram

EVENT DIAGRAM
Host A sends a TCP SYNchronize packet to Host B Host B receives A's SYN Host B sends a SYNchronize-ACKnowledgement Host A receives B's SYN-ACK Host A sends ACKnowledge Host B receives ACK. TCP socket connection is ESTABLISHED.

SYNchronize and ACKnowledge messages are indicated by a either the SYN bit, or the ACK bit inside theTCP header, and the SYN-ACK message has both the SYN and the ACK bits turned on (set to 1) in the TCP header.

TCP knows whether the networkTCP socket connection is opening, synchronizing, established by using the SYNchronize and ACKnowledge messages when establishing a networkTCP socket connection.

When the communication between twocomputersends, another 3-way communication is performed to tear down theTCPsocket connection. This setup and teardown of aTCP socketconnection is part of what qualifiesTCPareliableprotocol. TCP also acknowledges that data is successfully received and guarantees the data is reassenbled in the correct order.

Note thatUDPis connectionless. That meansUDPdoesn't establish connections asTCPdoes, soUDPdoes not perform this 3-way handshake and for this reason, it is referred to as anunreliable protocol. That doesn't mean UDP can't transfer data, it just doesn't negotiate how the conneciton will work, UDP just transmits and hopes for the best.

Protocols Encapsulated in TCP

Note thatFTP,Telnet,HTTP,HTTPS,SMTP,POP3,IMAP,SSHand any other protocol that rides overTCPalso has a three way handshake performed as connection is opened.HTTPweb requests,SMTPemails,FTPfile transfers all manage the messages they each send. TCP handles the transmission of those messages.

TCP'rides' on top ofInternet Protocol (IP)in the protocol stack, which is why the combined pair of Internet protocols is calledTCP/IP(TCPover IP).TCPsegments are passed_inside_the payload section of theIPpackets.IPhandlesIP addressingandroutingand gets the packets from one place to another, butTCPmanages the actual communication sockets between endpoints (computersat either end of thenetworkorinternetconnection).

results matching ""

    No results matching ""