cancel
Showing results for 
Search instead for 
Did you mean: 

Why is UDP needed?

ericfjchen
Regular Advisor

Why is UDP needed?

TCP is more safe than UDP. Why is UDP needed?

Thanks

Eric
15 REPLIES
Olivier Decorse
Respected Contributor

Re: Why is UDP needed?

How !
What a big question !
TCP and UDP are so different, that sometimes, the first is better, and sometimes, is is the second.

For example, redirecting syslog to a central server is possible (only) via udp : it is quickly (just a message) and don't have to be secure : if the message don't arrive to the server, it is not so important ...

Olivier.
They say "install windows 2k, xp or better", so i install unix !
Michael Selvesteen_2
Trusted Contributor

Re: Why is UDP needed?

Some advantages:

1.An UDP datagram is used in Network File System (NFS), DNS, SNMP, TFTP etc.

2. It has no handshaking or flow control

3. It not even has windowing capability

4. It is a fire and forget type protocol.

5. Real time application like video conferenicing needs udp (B'coz it's faster)

6.An application can use a UDP port number and another application can use the same port number for a TCP session from the same IP address.

it has it's own advantages other than lack of sequencing, error control and more


RFC 768 describes UDP in detail.

Eric Antunes
Honored Contributor

Re: Why is UDP needed?

Hi Eric,

UDP is used, for exemple, by the web listeners in Oracle E-Business Suite...
Each and every day is a good day to learn.
Muthukumar_5
Honored Contributor

Re: Why is UDP needed?

Transmission control protocol is reliable and safer over User Datagram protocol as,

1. Checking aknowledgement
2. Sending steam data's and using policy of "Positive aknowledgement and Retransmission method"
3. Flawless packet transmission
4. Flow controlled data transcation

UDP is needed for,

1. Minimal amount of header informations for every packet
2. Efficient packet transmission
3. Minimal system call usage for operations


see man tcp / udp for this more.
Easy to suggest when don't know about the problem!
R. Sri Ram Kishore_1
Respected Contributor

Re: Why is UDP needed?

Hi Eric,

Take a look at these links:

[broken links removed on <4/7/2017> by Mod]


HTH.

Regards,
Sri Ram

"What goes up must come down. Ask any system administrator."
Dave Olker
HPE Pro

Re: Why is UDP needed?

Hi Eric,

Do the above responses answer your questions or is there some other specific information about UDP that you're still looking for?

As stated above, the main reasons why some application implementers (like the original NFS design team) used UDP was because of it's speed and low overhead. As TCP implementations improved over the years, most applications have switched to using TCP but some still offer a UDP variant.

If there is some specific piece of information you're looking for regarding UDP vs. TCP please let me know.

Regards,

Dave
rick jones
Honored Contributor

Re: Why is UDP needed?

Why do we need UDP? Because there are applications that do not need, or even want, the in-order, guaranteed notification of failure, byte-stream semantics of TCP.

As for multimedia stuff - they want UDP not because UDP is faster - sometimes UDP isn't really faster - but because they can tolerate the occasional unrecovered packet loss, but cannot tolerate a 500 millisecond or more "hiccup" in the data flow that a TCP retransmission would take.
there is no rest for the wicked yet the virtuous have no pillows
ericfjchen
Regular Advisor

Re: Why is UDP needed?

Thanks for your reply. I would like to update the question. The whole problem is ....why is UDP needed? Why can't a user program directly access IP?
This problem is from Entrance Exam of MIS. I don't know the relation between first and second. Do you have any idea?
malay boy
Trusted Contributor

Re: Why is UDP needed?

Eric,
You should check "Seven Layer OSI".UDP/TCP is working on transport layer which are layer 4 and IP is working on network layer which are layer 3.
Basically you need to unserstabd the concept of this seven layer.

regards
mB
There are three person in my team-Me ,myself and I.
ericfjchen
Regular Advisor

Re: Why is UDP needed?

The key point is "Why can't a user program directly access IP?"...even if I fully understand OSI, I can't answer the question. Pls kindly share your opinion.
rick jones
Honored Contributor

Re: Why is UDP needed?

To answer why we need UDP and don't just use IP directly, you need to go back and refresh yourself on how IP "demultiplexes" the incoming datagrams between TCP, UDP and the like and the implications that would have for many applications on a given host/IP address wanting to communicate at the same time.
there is no rest for the wicked yet the virtuous have no pillows
Elmar P. Kolkman
Honored Contributor

Re: Why is UDP needed?

If you communicate directly to IP, you would have one stream of data between two servers, because you only can define both IP addresses (from and to address) for the communciation, nothing more, nothing less.
By using a protocol on top of that, like UDP, you can use a seperate identifier, the serviceport. In TCP, you even use 2 serviceports, one on the server, and one on the client. This results in a lot of possible connections between two servers.

Also, for instance inetd uses these ports to determine which program needs to be started for which port.

By talking directly to IP, which is possible, you would have to do this all by yourself.
Every problem has at least one solution. Only some solutions are harder to find.
rick jones
Honored Contributor

Re: Why is UDP needed?

Elmar is partially correct - basically, the "demux" abilities are limited in IP - IP uses the "protocol" field of the IP header to determine the ULP (Upper Layer Protocol) to which a datagram should be given. The protocol field in the IP header is IIRC only 8 bits, so there can be only so many concurrent "protocols"

Both TCP and UDP expand on this with their source and destination port numbers - the values used for "demux" by TCP and UDP.
there is no rest for the wicked yet the virtuous have no pillows
Olivier Decorse
Respected Contributor

Re: Why is UDP needed?

Eric,
UDP is needed for the transmission of data in which delivery of the data is more important than accuracy. UDP reduces overhead because it does not add flow control, error control, or sequence delivery unlike connectionoriented services. UDP can be used in real-time applications, where TCP cannot !
They say "install windows 2k, xp or better", so i install unix !
iqra
Occasional Visitor

Re: Why is UDP needed?

When using UDP, packets are just sent to the recipient. The sender won’t wait to make sure the recipient received the packet — it will just continue sending the next packets. If you’re the recipient and you miss some UDP packets, too bad — you can’t ask for those packets again. There’s no guarantee you’re getting all the packets and there’s no way to ask for a packet again if you miss it, but losing all this overhead means the computers can communicate more quickly.

UDP is used when speed is desirable and error correction isn’t necessary. For example, UDP is frequently used for live broadcasts and online games.

For example, let’s say you’re watching a live video stream. Live streams are often broadcast using UDP instead of TCP. The server just sends a constant stream of UDP packets to computers watching. If you lose your connection for a few seconds, the video will freeze for a moment and then jump to the current bit of the broadcast, skipping the bits you missed. If you experience minor packet-loss, the video or audio may be distorted for a moment as the video continues to play without the missing data.