Q. Can you explain the difference between UDP and TCP internet protocol (IP) traffic and its usage with an example?
A. Transmission Control Protocol (TCP) and User Datagram Protocol (UDP)is a transportation protocol that is one of the core protocols of the Internet protocol suite. Both TCP and UDP work at transport layer TCP/IP model and both have very different usage.
Difference between TCP and UDP
TCP | UDP |
Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message. | Reliability: UDP is connectionless protocol. When you a send a data or message, you don’t know if it’ll get there, it could get lost on the way. There may be corruption while transferring a message. |
Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don’t have to worry about data arriving in the wrong order. | Ordered: If you send two messages out, you don’t know what order they’ll arrive in i.e. no ordered |
Heavyweight: – when the low level parts of the TCP “stream” arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together. | Lightweight: No ordering of messages, no tracking connections, etc. It’s just fire and forget! This means it’s a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets. |
Streaming: Data is read as a “stream,” with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call. | Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call. |
Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc. | Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc |
Further readings
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 112 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Is there a difference in security maximums between TCP and UDP?
it is a really great difference b/w them ……
by reading the difference i can conclude that
TCP is more advantageous a UDP ..
TCP is more advantageous than a UDP
udp is more advantageous than tcp
TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client re-requests the packet from the server until the whole packet is complete and is identical to its original.
UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality
Thanks for the explanation :)
finding your comment useful ,than that mentioned above
TCP is more secure as compare to the UDP since it is connection-oriented.
There would be no loss of data packets in TCP as it acknowledged when the data gets transferred.
Everything about networking
i think there’s an error in this notes…
datagrams is under the TCp and streaming under UDP..is it right??
Yes baby
no u r wrong….
you are wrong
you are wrong
Just in case someone else comes by and sees this, or even if you get this reply…
The reason it says “streaming” under TCP and datagram under UDP is pretty understandable once you think about it for a while. (Though I agree with it being a bit ambiguous.)
See, TCP sends a stream of ordered bytes over the connection. (Much like a stream in any programming language.)
Where as UDP sends a “stream” of datagram packages without connection or validation.
Since UDP is connectionless, it’s more often used for streaming-services, since it just mows out a bunch of data, and hopes all of it goes according to plan, whereas TCP requires an active connection to the client, using a lot more resources. (Imagine if YouTube had to hold a connection for every person viewing a viral video, making sure every bit of data got through in the right order.)
yes it is problem TCP is used for streaming
plz send me noptes of tcp and udp protocols.
UDP is connectionless protocol,when you send data it has no conformation data has been received or not.only send data
TCP is connection oriented protocol,when you send data it has confirmation.
please try to update me every time there a new brochure about udp and tcp
Yes of course, sir. Will there be anything else sir?
Internet Corp will be publishing a new brochure soon. The brochure describes our new “UDP Deluxe” packets. These exclusive packets feature more head and leg room for your payload, faster transmission via Cisco(TM) Express Queuing, and guaranteed delivery (conditions apply).
UDP Deluxe packets cost a little more but give you peace of mind. And every UDP Deluxe packet sent earns you frequent flyer points, redeemable on all major VPNs.
(c) Internet Corp.
At which layer of OSI, UDP and TCP works?
Transport layer
Transport layer
transport layer oneof the layers of tcp/ip
Transport Layer
Transport Layer of the OSI Model.
network
give the full information on tcp and udp
TCP—Transmission control Protocal and user data gram protocol
transmition control protocol,user data protocol
TCP:Transfer Control protocol
UDp:User Defined Protocol
For every opening a web page there should be a ack to the server?
yeah
plz send me difference between TCP & UDP
Hi Rupali,
The diffrence between TCP and UDP
TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client re-requests the packet from the server until the whole packet is complete and is identical to its original.
UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality
Thanx a lot i lent a lot, very useful
thnxxx
Thanks a lot Raghu!
Exellent Explanation.
THANX A LOT
NICE EXPLANATION
1.TCP and UDP both are core part of internet protocol.
2.Both TCP and UDP are act at the session layer of OSI reference model.
Very useful thanx these are some of topics that want to crash my head u no.
Thanx
no 2 is incorrect please TCP and udp it is in transport layer
no no no ..it work’s onTransport Layer of OSI Layer
is a transport layer not session layer of the OSI model
mostily we are useing tcp becoz we come to know our data is send or not becoz we get reply in tcp. But in case of utp we cant get any information about our data ……
Before you learn a lot on the TCP and UDP Protocols Just Think of the simple Logis is that TCP Is more reliable then UDP But, UDP is More faster then TCP ok.
yes ua right yemula…:)
Please send me the complete Notes for the CCNA Certification, also send me the Distinguish between all the Protocols
Certainly Sir, please provide your home address and telephone number so we can send you the notes you have requested. We accept American Express, Visa and Paypal.
This is very helpful. A follow-up question is: what is the max data transfer speed of UDP vs. that of TCP/IP if a 1.0Gbps Ethernet port is used?
hey just explain it little brifely
TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. TCP IS DOING THIS WITH HELP OF ACK PACKET ,
UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc,BUT UDP IS FASTER THEN TCP
Am increased by your knowledge…pliz send mi the differences btw handshake protocols via my Email.
Hey !There is nothing to explain more than above.
Please give the diff. between the OSI layer and SONET layer.
Thanks for the Information.! Excellent Explanation.
why DNS use two port 53 or 57?
what is the diff betwen tcp and upd.
detail of osi layers
gadha sala. itna dekhne ke bad bhi nai samja to chhod de. tere bas ki baat nahi hain..
==TCP( Transmission Control Protocol)
* Transport Layered
* Suit Protocol
* Acknowledgment
* Error Detection and Correction
* Relaible
* Slow
* Handshakes
* Connection Oriented
* 1 – 65,535 logical Ports
* 1 – 1024 well reserved ports
* 90% used for Data Communication
==UDP ( User Datagram Protocol )
* Transport Layered
* Suit Protocol
* No Acknowledgment
* No Error Detection and Correction
* No relaiblity
* Fast
* Connectionless
* 1 – 65,535 logical Ports
* 1 – 1024 well reserved ports
* 90% of Voice Communcation uses the UDP
CAN ANYONE TELL ME ABOUT ( TCP OPTIMIZATION, TCP WINDOWING and BANDWIDTH OPTIMIZATION)
you can find me here,
mereen_sameer@yahoo.com
real helpful stuff thanx
This is a useful article explaining it all in full details. Other things left are the other protocols that are available or used on the internet.
so great and nice
baahut achha tutorial he, very nice
thanks real helpful summary there by Umer. I appreciate it.
nice explanation,thanks.
Thanks for the information it is very helpful to me and can any one give the differences between tcp/ip reference model and osi reference model
very useful
very useful thanks
Please give me details on Signal- encoding strategies under topic ( NETWORKING TECHNOLOGY)
thax alot 4 evry1 its very useful explanation……..
TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. This works because if a packet of data is sent, a collision may occur. When this happens, the client re-requests the packet from the server until the whole packet is complete and is identical to its original.
UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc; UDP is commonly used for streaming audio and video. Streaming media such as Windows Media audio files (.WMA) , Real Player (.RM), and others use UDP because it offers speed! The reason UDP is faster than TCP is because there is no form of flow control or error correction. The data sent over the Internet is affected by collisions, and errors will be present. Remember that UDP is only concerned with speed. This is the main reason why streaming media is not high quality
really informative
thanx alot for useful article .
can any 1 tell me abt how the addressing types(physical addressing,logical,port,special addressing) are related with OSI layers
any have idea of Bandwidth Calculation..
Very Nice.. Thanks
thanks……………
Plz someone tell d port no. of TCP and UDP
port no. of tcp and udp??????????
Tcp port no is 6.
Udp port no is 17..
hey can any one help me in telling me about the applications of UDP…..a detail is needed urgently plzzz frnd…
give information about tcp,udp algorithms and its application
TCP UDP
relible unrelible
delivery report no delivery reprt
slow fast
etc etc
I like the explanation here but the “English” you guys are using is so terrible and very depressing.
Thanks for a consise explanation
Q1. on which protocal TCP/ UDP both are working at a time
Q2. how many states in MSTP??
Q3. i have 2 router A & B i want to connect both router. and protocol is running OSPF..
and i got error INIT so what is correct ans…
ANY ONE CAN TELL ME PLZ ……I HAVE ANS JUST FOR ANY OR IP MISSMATCH
Thanx for your useful artical.
thanx very useful explanation
TCP (Transmission Control Protocol) it is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message.
UDP (User Datagram Protocol) it is connectionless protocol. When you a send a data or message, you don’t know if it’ll get there, it could get lost on the way. There may be corruption while transferring a message.
Thanks simple and sort note
Can u send me difference bw point to point and broadcasting
thank you as much ,,, it’s really useful information about them :)
Good Points… It proves to be useful to me..
I like the fact that my computer network teacher brought me here ;)
i totally found your comments and explanations very useful tho .
diff is very usefull
thanks
tkx for exp
thank alot…
very useful one…
plz send me difference between sip and h323
please send me diffrences between internet and protocol
Very educative and to the point staff. It has really helped me.
TCP (Transmission Control Protocol) is the most commonly used protocol on the Internet. The reason for this is because TCP offers error correction. When the TCP protocol is used there is a “guaranteed delivery.” This is due largely in part to a method called “flow control.” Flow control determines when data needs to be re-sent, and stops the flow of data until previous packets are successfully transferred. TCP IS DOING THIS WITH HELP OF ACK PACKET ,
UDP (User Datagram Protocol) is anther commonly used protocol on the Internet. However, UDP is never used to send important data such as webpages, database information, etc,BUT UDP IS FASTER THEN TCP
i need to know the definitions of TCP and UDP and similarities
wowwwww greatttttttttttttt
nice explaination
how do you late TCP and UDF?
which protocol find the shortest path TCP or UDP
i want to know that . which protocol find the shortest path TCP or UDP
thank for greatly inform about tcp and udp
thanks for explaining tcp and udp
The MAin difference between TCP and UDP is guarantee and speed issues
Hi
can any one explain , how to ports are communicating
please help me . why we use logical address instead of physical address in UDP( user datagram protocol).