What is the difference between UDP and TCP internet protocols?

Posted on in Categories , , , last updated December 16, 2007

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

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

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

112 comment

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

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

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

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

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

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

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

  1. ==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_sam[email protected]

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

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

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

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

Leave a Comment