Why SNMP, TFTP & DNS use UDP?

SurferdudeHBSurferdudeHB Member Posts: 199 ■■■□□□□□□□
I understand that UDP is an "unreliable" protocol, can someone explain to me why SNMP, TFTP & DNS use UDP?

I would think applications that are "fault" tolerant like online gaming use UDP.

Comments

  • SlowhandSlowhand Mod Posts: 5,161 Mod
    The reason is simple, all the protocols you listed are fairly light-weight and don't need the overhead of TCP. Have a look at the following diagrams:
    TCP HEADER
    TCPHeader.png
    That's a lot of data for some applications to be passing in every single packet.

    UDP HEADER
    UDPHeader.png
    Much less data in the header, which makes it ideal for applications that either don't care about receiving a confirmation about the packet getting there and leaves the request to re-send up to the recipient, or has other fault-tolerance checks built into them.

    I'm a little rusty on the protocol-specifics, but it's important to remember that "unreliable" doesn't mean that the packets are going to be lost forever and never re-sent, it simply means that TCP uses several mechanisms for the sender to confirm that the recipient received the data as it transmits, and UDP simply transmits entire segments without waiting for a response making it more light-weight and boosts performance.

    Free Microsoft Training: Microsoft Learn
    Free PowerShell Resources: Top PowerShell Blogs
    Free DevOps/Azure Resources: Visual Studio Dev Essentials

    Let it never be said that I didn't do the very least I could do.
  • ChooseLifeChooseLife Member Posts: 941 ■■■■■■■□□□
    I understand that UDP is an "unreliable" protocol, can someone explain to me why SNMP, TFTP & DNS use UDP?
    Cause it's a waste of electronic trees to transmit 7 or 8 packets to deliver 1 or 2 packets worth of data...
    “You don’t become great by trying to be great. You become great by wanting to do something, and then doing it so hard that you become great in the process.” (c) xkcd #896

    GetCertified4Less
    - discounted vouchers for certs
  • instant000instant000 Member Posts: 1,745
    Slowhand wrote:
    Have a look at the following diagrams:
    TCP HEADER
    TCPHeader.png
    That's a lot of data for some applications to be passing in every single packet.

    UDP HEADER
    UDPHeader.png

    Now look at these diagrams:
    (Cisco - UDP Packet)


    24148.jpg

    (Cisco - TCP Packet)
    S1344.jpg


    As if technical material isn't hard enough, we get documentation that I, personally, disagree with.

    From my perspective a "header" would not include "payload/data"

    Wikipedia- TCP Header - correct
    Wikipedia - UDP Header - wrong
    Cisco - TCP Packet - wrong
    Cisco - UDP Packet - wrong

    First off, Cisco shouldn't use the term "packet" to refer to the upper-level protocol data, they should use the term "segment" to refer to the layer 4 unit, and if not that, they should generically call it a protocol data unit (PDU). OK, so if Cisco had used the term TCP Segment, that would be a more correct answer.

    The Cisco - UDP Packet (even if they called it UDP Segment) would still be wrong, specifically because they have illustrated the four fields of the UDP header.

    The Wikipedia - UDP Header is wrong, because they are including the payload, which is NOT part of the header. Compare this one, to the so -called "Cisco - UDP Packet" that I critiqued earlier for being more of a header than a segment.

    The Wikipedia - TCP Header is okay.

    These may seem like minor points to you, and to someone really experienced, they know the general concept around how TCP and UDP works, but for a neophyte, getting poorly written diagrams can set a foundation for learning the wrong thing.

    What is so bad to me is that the RFC for TCP includes the "data" in the picture of a TCP header, which can be misleading to someone who does a copy/paste ...

    http://www.ietf.org/rfc/rfc0793.txt (RFC for TCP)

    In fact, if you read the text, you get informaton specifically telling you that the padding is the end of the header:
    Padding: variable

    The TCP header padding is used to ensure that the TCP header ends
    and data begins on a 32 bit boundary. The padding is composed of
    zeros.

    also, look at this one for UDP:

    http://www.ietf.org/rfc/rfc0768.txt (at least it uses ellipsis for the data portion so you can tell it's not part of the header.)

    I think the drawings get the point across, but I just want to make sure they don't lead to further confusion.

    NOTE: The Cisco images I used came from the Cisco "DocWiki" which might be a source of information for someone new to networking.

    I hope this post helps.
    Currently Working: CCIE R&S
    LinkedIn: http://www.linkedin.com/in/lewislampkin (Please connect: Just say you're from TechExams.Net!)
  • instant000instant000 Member Posts: 1,745
    I understand that UDP is an "unreliable" protocol, can someone explain to me why SNMP, TFTP & DNS use UDP?

    I would think applications that are "fault" tolerant like online gaming use UDP.

    With SNMP and DNS data, you don't care too much about using the additional overhead and traffic necessary to transmit network management information via TCP.

    With TFTP, you get a pretty quick file transfer method. It is a no frills way to transfer files.

    According to the RFC for UDP:
    This protocol provides a procedure for application programs to send
    messages to other programs with a minimum of protocol mechanism. The
    protocol is transaction oriented, and delivery and duplicate protection
    are not guaranteed. Applications requiring ordered reliable delivery of
    streams of data should use the Transmission Control Protocol

    And additionally:
    Protocol Application

    The major uses of this protocol is the Internet Name Server, and the
    Trivial File Transfer.


    Please note that the RFC for UDP is 3 pages. The RFC for TCP is 85 pages.

    References:
    http://www.ietf.org/rfc/rfc0768.txt
    http://www.ietf.org/rfc/rfc0793.txt
    Currently Working: CCIE R&S
    LinkedIn: http://www.linkedin.com/in/lewislampkin (Please connect: Just say you're from TechExams.Net!)
  • SurferdudeHBSurferdudeHB Member Posts: 199 ■■■□□□□□□□
    Ok thx guys, especially the waste of electronic trees lol..
Sign In or Register to comment.