TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two protocols that run on the forth layer of OSI layers. There are many advantages of using TCP over UDP. TCP as we know is a connection based protocol, meaning that a connection needs to be setup before the transfer of data can start. To be able to do that TCP has been designed with the 3-way handshake system. In this system a user who wants to send data initializes the connection and is acknowledged by the receiving end. Once acknowledged, the sender acknowledges the Acknowledgement, thus completing the 3-way handshake. In this way, TCP can establish a connection.
TCP is a reliable protocol, meaning that the data that is sent is reached by the receiving party, which is not an entity in UDP. Data packets that are lost are resent again, if the connection fails then the data is re-requested, thus making sure that data is received at the other end.
TCP enables data to be received in an ordered way, meaning if 5 data packets are sent, then data packet 1 should be received before data packet 2. This doesn't happen in UDP which is a connection less and works on the principle of shoot the data. The working principle of UDP is to send the data without taking care whether it reaches its destination or not. The TCP protocol is considered to be a complete protocol and therefore is used many times over in systems than the unreliable UDP.
TCP is a reliable protocol, meaning that the data that is sent is reached by the receiving party, which is not an entity in UDP. Data packets that are lost are resent again, if the connection fails then the data is re-requested, thus making sure that data is received at the other end.
TCP enables data to be received in an ordered way, meaning if 5 data packets are sent, then data packet 1 should be received before data packet 2. This doesn't happen in UDP which is a connection less and works on the principle of shoot the data. The working principle of UDP is to send the data without taking care whether it reaches its destination or not. The TCP protocol is considered to be a complete protocol and therefore is used many times over in systems than the unreliable UDP.