This article explains what is the difference between TCP and UDP, what is TCP and UDP and also about their applications and functions.
Here are the points which covered in this article
Difference Between TCP and UDP
|Transmission Control Protocol.||User or Universal Datagram Protocol.|
|TCP is a connection-orientated protocol.||UDP is a connection-less protocol.|
| It is a reliable transmission protocol. It guarantees that delivery the data to the|
| It is an unreliable transmission protocol. It does not give any guarantees about|
|TCS is a bi-directional.||UPD is uni-directional.|
|Some other protocol uses by TCP are HTTPs, HTTP, SMTP, FTP, Telnet.||Some other protocol uses by UDP are DNS, DHCP, TFTP, SNMP, RIP, VOIP.|
|It recovers error bit.||It has no error recovery.|
|The speed of the TCP is slower than UDP.||The UDP is faster than TCP because UDP has no error recovery.|
|The header length of TCP is 20 -80 bytes. It varies.||The header length of UDP has fixed is of 8 bytes.|
What is the TCP?
Answer: The TCP (Transmission Control Protocol) is a connection-oriented protocol. The connection-orientation is the term in that the communicating medium will get establish the connection before transmitting the data, and it will close the connection after sending or transmitting the data.
TCP guarantees about delivering the data to the destination port because it is a reliable transmission protocol. TCP does not support broadcasting.
TCP has an error checking mechanisms. That’s why it provides acknowledgement and flow control of the data.
The one more important feature of the TCP is the sequencing of data, i.e. the order of packets in order at the receiver.
As compare to UDP, TCP has much more feature that makes it heavy and slower than UDP. HTTP, HTTPs, FTP, Telnet and SMTP are TCP uses. Along with it does not support broadcasting.
The header length of TCP is between 20-80 bytes. It is a three-way hand-shaking protocol.
Example of the TCP is messaging apps.
- HTTP (Hypertext Transfer Protocol),
- HTTPs (Hypertext Transfer Protocol Secure),
- FTP (File Transfer Protocol),
- SMTP (Simple Mail Transfer Protocol),
What is UDP?
Answer: The UPD (User Datagram Protocol) is a connection-less protocol. The term connectional-less defines that there is no need to open connection, maintain connection and close the connection. UDP is efficient for broadcasting and multicast type of networking.
UDP does not have a guarantee to delivering the data to the destination port because it is an unreliable transmission protocol.
UDP has basic error checking mechanisms. It only uses the checksum mechanism for error checking.
UDP does not support sequencing the data in UDP. If there is a need for ordering/sequencing, it will achieve by the application layer, the application layer will manage the sequencing of UDP.
UDP is much more faster than TCP because it not acknowledged, it just sends data like broadcasting. DNS, DHCP, SNMP, TFTP, RIP, and VoIP are uses by UDP.
The header length of UDP is fixed and it’s 8 bytes.
Example of UDP is video streaming in low quality.
- DNS (Domain Name Server),
- DHCP (Dynamic Host Configuration Protocol),
- SNMP (Simple Network Management Protocol)
- TFTP (Trivial File Transfer Protocol).
- RIP (Routing Information Protocol).
- BOOTP (Bootstrap Protocol).
Example of TCP and UPD:
Consider an example, if there are two houses HOUSE1 and HOUSE2 and river in between them. If you want to send data in the form of a letter from HOUSE1 to HOUSE2. Then you have two options, first one is by making the bridge and sends the data/letter from HOUSE1 to another HOUSE2, so it is reliable transmission hence we can say that this is an example of TCP.
The second option is to get delivered through the pigeon, in this case, either the pigeon will be delivered the letter or will be not delivered, so it is an unreliable transmission that does not have an assuring to deliver the letter hence we can say that this is an example of UDP.