What is the difference between UDP and TCP internet protocols?

by Vivek Gite on May 15, 2007 · 48 comments

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

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 48 comments… read them below or add one }

1 John February 18, 2008

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

Reply

2 Erasmus Omusei January 12, 2009

Everything about networking

Reply

3 jagdish June 26, 2009

plz send me noptes of tcp and udp protocols.

Reply

4 Hasan February 3, 2011

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.

Reply

5 walusimbi denniswise July 1, 2009

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

Reply

6 Girish August 25, 2009

At which layer of OSI, UDP and TCP works?

Reply

7 yogesh November 9, 2010

Transport layer

Reply

8 mwenesi June 30, 2011

Transport layer

Reply

9 muhammad waqas September 6, 2011

transport layer oneof the layers of tcp/ip

Reply

10 dheeraj singh November 9, 2009

give the full information on tcp and udp

Reply

11 gopinath December 16, 2010

TCP—Transmission control Protocal and user data gram protocol

Reply

12 Hasan February 3, 2011

transmition control protocol,user data protocol

Reply

13 udaya November 10, 2009

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

Reply

14 Rupali March 18, 2010

plz send me difference between TCP & UDP

Reply

15 Raghu May 6, 2010

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

Reply

16 Lorato October 19, 2011

Thanx a lot i lent a lot, very useful

Reply

17 vaibhav September 1, 2010

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.

Reply

18 Lorato October 19, 2011

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

Thanx

Reply

19 vikas October 18, 2010

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

Reply

20 Harish Yemula July 14, 2011

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.

Reply

21 Faraz Kadri April 28, 2010

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

Reply

22 Rosa Zheng July 18, 2010

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?

Reply

23 deepika August 9, 2010

hey just explain it little brifely

Reply

24 MD KHADER February 14, 2011

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

Reply

25 vaibhav September 1, 2010

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

Reply

26 Haris December 11, 2010

Thanks for the Information.! Excellent Explanation.

Reply

27 pankaj January 6, 2011

why DNS use two port 53 or 57?

Reply

28 Anirudh March 27, 2011

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

Reply

29 Umer Baloch March 29, 2011

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

Reply

30 Adam April 14, 2011

real helpful stuff thanx

Reply

31 Olushola Michael May 19, 2011

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.

Reply

32 Hamid September 29, 2011

so great and nice

Reply

33 sagar May 21, 2011

baahut achha tutorial he, very nice

Reply

34 Vaunn May 23, 2011

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

Reply

35 Ritchie June 7, 2011

nice explanation,thanks.

Reply

36 nandini August 12, 2011

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

Reply

37 anil kumar August 27, 2011

very useful

Reply

38 udaya September 14, 2011

very useful thanks

Reply

39 Lorato October 19, 2011

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

Reply

40 menka October 20, 2011

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

Reply

41 sundeep January 24, 2012

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

Reply

42 Ratan priya October 20, 2011

thanx alot for useful article .

Reply

43 Priya December 16, 2011

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

Reply

44 junaid January 2, 2012

any have idea of Bandwidth Calculation..

Reply

45 Thangaraj January 7, 2012

Very Nice.. Thanks

Reply

46 Sarita Bishnoi February 9, 2012

thanks……………

Reply

47 sejal February 9, 2012

Plz someone tell d port no. of TCP and UDP

Reply

48 sejal February 9, 2012

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

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 7 + 14 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: