TCP prevents loss of data, duplication, and damage. It ensures that the sent message isn't out of order. These characteristics make it a reliable protocol, unlike UDP.
TCP synchronizes using a three-way handshake. Synchronization between two nodes begins when a TCP segment is sent with the SYN
(0x02)
flag set.
TCP sockets are one-to-one. A source node transmits messages to the destination node.
A three-way handshake allows TCP to prevent out-of-order message delivery and duplicated transmission.
Transmission begins when the
SYN
(0x02)
flag is set in a packet and is sent to the destination.The destination receives the packet with the
SYN
(0x02)
flag and sends an acknowledgement to the source by setting theACK
(0x10)
flag in the reply. This stage is called SYN-ACK.The source receives the SYN-ACK message and sends an
ACK
segment, which...