Options

Why use UDP ?

ratneshnagoriratneshnagori Member Posts: 26 ■□□□□□□□□□
hi,

Can anyone please help with a questions that if I have a reliable TCP protocol, why would I use UDP which is connectionless and unreliable?

Thanks in advance
Ratnesh
Ratnesh

Comments

  • Options
    Bl8ckr0uterBl8ckr0uter Inactive Imported Users Posts: 5,031 ■■■■■■■■□□
    hi,

    Can anyone please help with a questions that if I have a reliable TCP protocol, why would I use UDP which is connectionless and unreliable?

    Thanks in advance
    Ratnesh

    You would use udp for things that need to be speedy and do not need to be verified.

    I should say, "you" don't really use the protocol, the developer uses the protocol and you use whatever they choose.

    TCP vs. UDP

    Hope this helps.
  • Options
    eMeSeMeS Member Posts: 1,875 ■■■■■■■■■□
    You would use UDP if error-correction is not important, or if error-correction would make things worse.

    I believe (someone who knows more can clarify) that VOIP services use UDP as the underlying protocol, because resending voice information would likely screw up your conversation.

    Having worked in mission-critical monitoring environments, it always puzzled me when someone wanted to do some highly critical monitoring using SNMP....

    MS
  • Options
    dont let the word unreliable fool you, it doesn't mean it is a piece of crap it just means no checking. Think about this if we are using VoIP and we transmit what would happen if we had errors and had to retransmit the signal again. In voice we have to us UDP because we are better off losing a few bits than have things arrive out of sequence this is just one example
    Go EVERTON

    evertonfc-crest.gif
  • Options
    SysAdmin4066SysAdmin4066 Member Posts: 443
    UDP is fast, TCP is more reliable, but definitely slower. So applications that require speed and can stand some packet loss will use UDP. Those that dont need blazing speed, and cant tolerate loss as much, will use TCP. The developers choose what their transport layer protocol will be, so sometimes it's for arbitrary reasons, like "I always use TCP" lol.
    In Progress: CCIE R&S Written Scheduled July 17th (Tentative)

    Next Up: CCIE R&S Lab
  • Options
    SephStormSephStorm Member Posts: 1,731 ■■■■■■■□□□
    The above user is correct, establishing connections for everything would saturate internet connections as well.
  • Options
    networker050184networker050184 Mod Posts: 11,962 Mod
    Most applications that use UDP will have application layer reliability features if needed and do not need the TCP functions. As an example, SNMP as mentioned above uses UDP, but it can use a reliable inform message rather than a trap which must be acknowledged or it will be retransmitted.

    And as others have pointed out some applications just really don't need to retransmit missed segments.
    An expert is a man who has made all the mistakes which can be made.
  • Options
    jjbrogjjbrog Member Posts: 149
    hi,

    Can anyone please help with a questions that if I have a reliable TCP protocol, why would I use UDP which is connectionless and unreliable?

    Thanks in advance
    Ratnesh

    Like everyone pointed out. Imagine if everything ran tcp, especially this age in video and voip transmission. When youtube/hulu, etc etc etc sends you your video file. Imagine if it needed ack from you? it would be very choppy with all the syn-ack and lag like a mofo. sure the picture would be 100% perfect, but it would never play at a decent speed. With UDP sometimes the picture isn't perfect(some missing pixels, and what not) cause of minor packet loss but at least it plays without lag(assuming there isn't a slow connection for other reasons).
    Started a forum for networking students, its new and needs people!
    http://netadminstudents.zxq.net/phpBB3/
    HTC students encouraged to join :)
  • Options
    miller811miller811 Member Posts: 897
    dont let the word unreliable fool you, it doesn't mean it is a piece of crap it just means no checking. =/QUOTE]


    Thanks for the chuckle...icon_cheers.gif
    I don't claim to be an expert, but I sure would like to become one someday.

    Quest for 11K pages read in 2011
    Page Count total to date - 1283
  • Options
    ratneshnagoriratneshnagori Member Posts: 26 ■□□□□□□□□□
    thanks to all of you for such a quick response

    Ratnesh
    Ratnesh
  • Options
    APAAPA Member Posts: 959
    eMeS wrote: »
    I believe (someone who knows more can clarify) that VOIP services use UDP as the underlying protocol, because resending voice information would likely screw up your conversation.
    MS


    Spot on.... with VoIP, UDP is often relying on RTP... as UDP natively doesn't have sequencing\timing information.

    All other reasons have been covered in this thread already (speed, no need for three-way handshake, no need for error recovery as the transport mechanism must be as quick as possible etc...) :)

    CCNA | CCNA:Security | CCNP | CCIP
    JNCIA:JUNOS | JNCIA:EX | JNCIS:ENT | JNCIS:SEC
    JNCIS:SP | JNCIP:SP
Sign In or Register to comment.