What is the difference between UDP and TCP internet protocols?

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.

ADVERTISEMENTS

Difference between TCP and UDP

TCPUDP
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

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
112 comments… add one
  • John Feb 18, 2008 @ 11:40

    Is there a difference in security maximums between TCP and UDP?

    • deepak singh Jan 1, 2014 @ 1:41

      it is a really great difference b/w them ……
      by reading the difference i can conclude that
      TCP is more advantageous a UDP ..

      • deepak singh Jan 1, 2014 @ 1:42

        TCP is more advantageous than a UDP

    • gaurav Feb 7, 2014 @ 6:47

      udp is more advantageous than tcp

    • sumit munje Jul 11, 2014 @ 5:04

      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

      • Arun Jun 5, 2016 @ 10:31

        Thanks for the explanation :)

      • jones xavier Jan 27, 2017 @ 9:54

        finding your comment useful ,than that mentioned above

    • Abhishek Gupta May 8, 2016 @ 4:30

      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.

  • Erasmus Omusei Jan 12, 2009 @ 5:27

    Everything about networking

  • sha_bajrai Mar 30, 2009 @ 2:54

    i think there’s an error in this notes…
    datagrams is under the TCp and streaming under UDP..is it right??

    • Elm Oct 4, 2012 @ 6:57

      Yes baby

    • nikunj Jan 27, 2013 @ 12:54

      no u r wrong….

      • Arslan Nov 30, 2014 @ 18:27

        you are wrong

        • seriously May 1, 2016 @ 14:26

          you are wrong

    • Benjamin Nov 24, 2014 @ 22:13

      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.)

    • talha Apr 27, 2016 @ 11:19

      yes it is problem TCP is used for streaming

  • jagdish Jun 26, 2009 @ 12:09

    plz send me noptes of tcp and udp protocols.

    • Hasan Feb 3, 2011 @ 6:38

      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.

  • walusimbi denniswise Jul 1, 2009 @ 8:46

    please try to update me every time there a new brochure about udp and tcp

    • Stevie P Apr 26, 2014 @ 1:57

      Yes of course, sir. Will there be anything else sir?

    • Internet Corp Jun 17, 2014 @ 12:44

      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.

  • Girish Aug 25, 2009 @ 5:26

    At which layer of OSI, UDP and TCP works?

    • yogesh Nov 9, 2010 @ 4:10

      Transport layer

    • mwenesi Jun 30, 2011 @ 14:40

      Transport layer

      • muhammad waqas Sep 6, 2011 @ 7:47

        transport layer oneof the layers of tcp/ip

      • ali sofiani Apr 13, 2014 @ 15:34

        Transport Layer

    • Harish Yemula Jul 14, 2011 @ 9:07

      Transport Layer of the OSI Model.

    • pardeep Jun 5, 2014 @ 11:56

      network

  • dheeraj singh Nov 9, 2009 @ 10:43

    give the full information on tcp and udp

    • gopinath Dec 16, 2010 @ 12:38

      TCP—Transmission control Protocal and user data gram protocol

    • Hasan Feb 3, 2011 @ 6:39

      transmition control protocol,user data protocol

      • jeyalakshmi Jun 17, 2013 @ 9:52

        TCP:Transfer Control protocol

        UDp:User Defined Protocol

  • udaya Nov 10, 2009 @ 7:15

    For every opening a web page there should be a ack to the server?

    • ali sofiani Apr 13, 2014 @ 15:37

      yeah

  • Rupali Mar 18, 2010 @ 4:27

    plz send me difference between TCP & UDP

    • Raghu May 6, 2010 @ 8:38

      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

      • Lorato Oct 19, 2011 @ 8:49

        Thanx a lot i lent a lot, very useful

      • sasi Feb 19, 2012 @ 7:07

        thnxxx

      • Vincent Aug 13, 2012 @ 3:02

        Thanks a lot Raghu!

        Exellent Explanation.

        • AYSHA Oct 20, 2012 @ 22:24

          THANX A LOT
          NICE EXPLANATION

    • vaibhav Sep 1, 2010 @ 15:30

      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.

      • Lorato Oct 19, 2011 @ 8:59

        Very useful thanx these are some of topics that want to crash my head u no.

        Thanx

      • CHAVEZ Oct 13, 2013 @ 14:59

        no 2 is incorrect please TCP and udp it is in transport layer

      • ali sofiani Apr 13, 2014 @ 15:39

        no no no ..it work’s onTransport Layer of OSI Layer

      • Folley Apr 28, 2015 @ 12:53

        is a transport layer not session layer of the OSI model

    • vikas Oct 18, 2010 @ 7:43

      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 ……

    • Harish Yemula Jul 14, 2011 @ 9:11

      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.

      • sonic Oct 31, 2014 @ 7:29

        yes ua right yemula…:)

  • Faraz Kadri Apr 28, 2010 @ 13:05

    Please send me the complete Notes for the CCNA Certification, also send me the Distinguish between all the Protocols

    • PanditSoft Sep 8, 2014 @ 10:39

      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.

  • Rosa Zheng Jul 18, 2010 @ 21:00

    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?

  • deepika Aug 9, 2010 @ 12:18

    hey just explain it little brifely

    • MD KHADER Feb 14, 2011 @ 6:38

      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

      • kennedy gikonyo Aug 3, 2012 @ 9:56

        Am increased by your knowledge…pliz send mi the differences btw handshake protocols via my Email.

  • vaibhav Sep 1, 2010 @ 15:34

    Hey !There is nothing to explain more than above.
    Please give the diff. between the OSI layer and SONET layer.

  • Haris Dec 11, 2010 @ 6:02

    Thanks for the Information.! Excellent Explanation.

  • pankaj Jan 6, 2011 @ 12:04

    why DNS use two port 53 or 57?

  • Anirudh Mar 27, 2011 @ 14:09

    what is the diff betwen tcp and upd.
    detail of osi layers

    • tcp dude Oct 3, 2012 @ 5:42

      gadha sala. itna dekhne ke bad bhi nai samja to chhod de. tere bas ki baat nahi hain..

  • Umer Baloch Mar 29, 2011 @ 8:55

    ==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

  • Adam Apr 14, 2011 @ 9:58

    real helpful stuff thanx

  • Olushola Michael May 19, 2011 @ 0:37

    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.

    • Hamid Sep 29, 2011 @ 11:14

      so great and nice

  • sagar May 21, 2011 @ 11:05

    baahut achha tutorial he, very nice

  • Vaunn May 23, 2011 @ 9:05

    thanks real helpful summary there by Umer. I appreciate it.

  • Ritchie Jun 7, 2011 @ 7:57

    nice explanation,thanks.

  • nandini Aug 12, 2011 @ 9:19

    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

  • anil kumar Aug 27, 2011 @ 6:30

    very useful

  • udaya Sep 14, 2011 @ 13:30

    very useful thanks

  • Lorato Oct 19, 2011 @ 8:47

    Please give me details on Signal- encoding strategies under topic ( NETWORKING TECHNOLOGY)

  • menka Oct 20, 2011 @ 6:23

    thax alot 4 evry1 its very useful explanation……..

    • sundeep Jan 24, 2012 @ 8:28

      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

      • usha Dec 10, 2012 @ 16:12

        really informative

  • Ratan priya Oct 20, 2011 @ 16:22

    thanx alot for useful article .

  • Priya Dec 16, 2011 @ 11:04

    can any 1 tell me abt how the addressing types(physical addressing,logical,port,special addressing) are related with OSI layers

  • junaid Jan 2, 2012 @ 8:29

    any have idea of Bandwidth Calculation..

  • Thangaraj Jan 7, 2012 @ 2:32

    Very Nice.. Thanks

  • Sarita Bishnoi Feb 9, 2012 @ 9:55

    thanks……………

  • sejal Feb 9, 2012 @ 15:09

    Plz someone tell d port no. of TCP and UDP

  • sejal Feb 9, 2012 @ 15:10

    port no. of tcp and udp??????????

    • vishnnu Feb 13, 2012 @ 12:18

      Tcp port no is 6.
      Udp port no is 17..

  • Sagar May 23, 2012 @ 13:24

    hey can any one help me in telling me about the applications of UDP…..a detail is needed urgently plzzz frnd…

  • nisam v Jun 22, 2012 @ 4:44

    give information about tcp,udp algorithms and its application

  • Mohd asif khan Jul 18, 2012 @ 18:13

    TCP UDP
    relible unrelible
    delivery report no delivery reprt
    slow fast
    etc etc

  • Nii Sep 18, 2012 @ 6:06

    I like the explanation here but the “English” you guys are using is so terrible and very depressing.

  • sarwar Oct 3, 2012 @ 3:29

    Thanks for a consise explanation

  • manish Oct 8, 2012 @ 13:30

    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

  • Piyush kumar bugalia Nov 21, 2012 @ 8:05

    Thanx for your useful artical.

  • Aaron Jun 11, 2013 @ 18:44

    thanx very useful explanation

  • Amar Verma Jun 28, 2013 @ 18:32

    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.

    • Ankit Oct 21, 2014 @ 18:44

      Thanks simple and sort note
      Can u send me difference bw point to point and broadcasting

  • duaa Aug 1, 2013 @ 15:18

    thank you as much ,,, it’s really useful information about them :)

  • hasan Oct 11, 2013 @ 1:45

    Good Points… It proves to be useful to me..

  • Jamal Jan 28, 2014 @ 16:53

    I like the fact that my computer network teacher brought me here ;)
    i totally found your comments and explanations very useful tho .

  • imtiyaz Feb 13, 2014 @ 1:21

    diff is very usefull
    thanks

  • imtiyaz Feb 13, 2014 @ 1:22

    tkx for exp

  • jaysell Feb 18, 2014 @ 7:20

    thank alot…

    very useful one…

  • kiran Feb 24, 2014 @ 16:04

    plz send me difference between sip and h323

  • prayag budhathoki Mar 9, 2014 @ 1:53

    please send me diffrences between internet and protocol

  • Boniface Halinga May 5, 2014 @ 2:15

    Very educative and to the point staff. It has really helped me.

  • ratan May 8, 2014 @ 4:06

    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

  • swaibu ssendagire May 15, 2014 @ 19:30

    i need to know the definitions of TCP and UDP and similarities

  • nagesh Jul 15, 2014 @ 10:07

    wowwwww greatttttttttttttt

  • Wasim Sep 8, 2014 @ 13:19

    nice explaination

  • APPOLONARIO Oct 30, 2014 @ 14:16

    how do you late TCP and UDF?

  • arunkuamr Nov 11, 2014 @ 9:30

    which protocol find the shortest path TCP or UDP

  • aditya bothh Mar 20, 2015 @ 9:53

    i want to know that . which protocol find the shortest path TCP or UDP

  • achyut Jul 6, 2015 @ 16:23

    thank for greatly inform about tcp and udp

  • mohamed Jul 28, 2015 @ 21:54

    thanks for explaining tcp and udp

  • Aziz ullah Aug 6, 2015 @ 6:40

    The MAin difference between TCP and UDP is guarantee and speed issues

  • sanjev Sep 10, 2015 @ 11:22

    Hi
    can any one explain , how to ports are communicating

  • hafiz ur rehman Oct 6, 2015 @ 9:30

    please help me . why we use logical address instead of physical address in UDP( user datagram protocol).

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.