Fact-checked by Grok 2 weeks ago

User Datagram Protocol

The User Datagram Protocol (UDP) is a connectionless, transport-layer protocol in the that provides a minimal mechanism for applications to exchange datagrams over IP networks without establishing a connection, guaranteeing delivery, ensuring ordering, or protecting against duplicates. Defined in August 1980, UDP operates at Layer 4 of the and is designed for simple, transaction-oriented communication where low overhead and speed are prioritized over reliability. UDP datagrams consist of a header and optional , with the header being only 8 bytes long to minimize processing requirements. The header includes four 16-bit fields: (identifying the sending application), destination port (specifying the receiving application), length (indicating the total size of the in bytes), and (for basic error detection, covering the header, , and a pseudo-header with IP details). When a UDP datagram is sent, it is encapsulated in an and transmitted directly to the destination and port, with no handshaking or acknowledgment process; the receiving application must handle any errors or losses independently. This stateless approach enables efficient and multicasting, making UDP suitable for scenarios where occasional is acceptable. In contrast to the Transmission Control Protocol (TCP), which provides reliable, ordered delivery through connection establishment, retransmissions, and flow control, UDP offers with significantly lower and overhead, consuming fewer resources on both sender and receiver. Its primary advantages include high speed for time-sensitive data and simplicity for applications that implement their own reliability if needed, but disadvantages encompass vulnerability to , out-of-order arrival, and exploitation in denial-of-service attacks due to the lack of built-in validation. UDP is widely used in applications requiring real-time performance, such as (DNS) queries for resolving hostnames, (DHCP) for IP address assignment, (SNMP) for network monitoring, (VoIP) for telephony, online gaming for low-latency interactions, and video/audio streaming where minor losses do not severely impact quality.

Overview

Key Characteristics

The User Datagram Protocol (UDP) is a minimal designed to enable application programs to send messages to other programs with the least possible overhead. It operates on a model, providing no guarantees for message delivery, duplication protection, or ordering, which makes it suitable for applications where speed is prioritized over reliability. UDP exhibits several core attributes that define its lightweight nature: it is stateless, requiring no maintenance of connection state between sender and receiver; it involves no handshakes or connection establishment procedures; its header is fixed at 8 bytes; and it supports , , and broadcast transmission modes through underlying capabilities. These features allow UDP to function efficiently in scenarios demanding low latency, such as streaming or simple request-response interactions. For multiple applications over a single network interface, UDP employs 16-bit numbers to identify and destination endpoints. Transmission in UDP is datagram-oriented, meaning each packet is treated as a self-contained, independent unit without reliance on prior or subsequent packets for reassembly or sequencing. This independence simplifies implementation but shifts responsibility for error handling or retransmission to the if needed. Regarding size, UDP datagrams have a theoretical maximum length of bytes, as specified by the 16-bit field in the header, though the practical payload is reduced by the 8-byte header and IP encapsulation overhead. In practice, datagram sizes are constrained by the path (MTU), with common limits such as 1,472 bytes or less for IPv4 over Ethernet (accounting for 20-byte IP and 8-byte UDP headers within a 1,500-byte MTU) to avoid fragmentation; applications are advised to and the path MTU for reliable .

Role in the TCP/IP Model

The operates at the (Layer 4) of the TCP/IP model, positioned directly atop the (Layer 3) where the resides. This placement allows UDP to provide a simple, end-to-end delivery service over IP's best-effort, connectionless network service, encapsulating application data into datagrams that IP then routes across interconnected networks. In this architecture, UDP facilitates demultiplexing of incoming datagrams to the appropriate applications on the destination host through the use of source and destination port numbers, while handles the core addressing, fragmentation, and functions to direct packets between hosts. This division of responsibilities enables to focus on host-to-host transport without the overhead of connection management or error correction, relying on for network-level delivery. Unlike the Transmission Control Protocol (TCP), which also resides at Layer 4 but provides reliable, ordered, and connection-oriented delivery with mechanisms for error recovery and flow control, UDP offers an unreliable, connectionless alternative optimized for low-overhead scenarios where speed and simplicity outweigh the need for guaranteed delivery. Applications can thus select UDP when the protocol's minimal processing and absence of acknowledgments reduce latency, as in real-time or broadcast communications, complementing TCP's more robust features within the same transport layer. Historically, UDP was defined in August 1980 through 768 by to address simple communication needs in the evolving environment, providing a lightweight counterpart to the more complex (specified in 793), and most recently updated by 9868 in October 2025 to support transport options, thereby expanding the suite's versatility for diverse network applications.

Addressing and Multiplexing

Port Numbers

UDP utilizes 16-bit fields for both the source port and destination port in its header, supporting values ranging from 0 to 65,535. The source port identifies the sending process and is optional; if not used, it is set to zero, indicating that replies should not be directed to a specific port. The destination port specifies the receiving process within the context of the target IP address. Port number 0 is reserved and must not be assigned for use in communications. The (IANA) oversees the global management and assignment of UDP port numbers to ensure orderly allocation and prevent conflicts. Ports are divided into three primary ranges: well-known ports (0–1023), which are reserved for standard system services requiring privileged access; registered ports (–49151), assigned for specific user-level applications upon request; and dynamic or ephemeral ports (49152–), intended for temporary, short-lived allocations by client-side processes. Representative examples of well-known ports include port 53 for the (DNS), which handles domain-to-IP resolution queries, and port 123 for the Network Time Protocol (NTP), used for synchronizing clocks across networks. Port numbers facilitate over IP, enabling a single host to support multiple concurrent applications by distinguishing between them; the same port can be reused across different IP addresses, allowing independent flows without interference.

Socket Pairing

In User Datagram Protocol (UDP), a is defined as a unique identifier formed by the combination of source , source number, destination , and destination number, commonly referred to as a 4-tuple. This structure enables precise identification of communication endpoints without establishing a persistent , distinguishing UDP from connection-oriented protocols. The source identifies the sending on the originating , while the destination specifies the receiving on the target , with both ports being 16-bit values ranging from 0 to 65535. The primary role of this socket pairing is to facilitate demultiplexing of incoming s at the receiving host, ensuring that each packet is delivered to the correct application process. Upon receipt, the layer passes the to the layer, which examines the destination and to route it appropriately; the source details allow the application to associate replies correctly. This mechanism supports multiple applications on a single host communicating simultaneously over , as each pair uniquely scopes the exchange. UDP implementations often support wildcard sockets to simplify binding, where an application can bind to INADDR_ANY ( in ) as the source , allowing the to listen on all available network without specifying a particular one. This wildcard binding is particularly useful for servers handling traffic from any client , as the operating system selects the appropriate source based on the outgoing during transmission. For , the equivalent is in6addr_any (::/0), providing analogous flexibility. Socket pairing has significant implications for (NAT) traversal and configurations. In NAT environments, devices perform port translation by mapping an internal socket pair to a modified external pair, preserving the ability to route return traffic while concealing private addresses. Endpoint-independent mapping, where the same external port is reused across destinations, is recommended to ease traversal for UDP-based applications like VoIP or gaming, reducing the need for keep-alives or hole-punching techniques. may inspect or translate these pairs to enforce policies, but consistent handling ensures bidirectional communication without explicit connection setup.

Datagram Structure

Header Format

The User Datagram Protocol (UDP) employs a fixed-length header consisting of eight bytes, positioned immediately following the Internet Protocol (IP) header in a network packet. This header comprises four 16-bit fields, transmitted in network byte order (big-endian), which ensures consistent interpretation across diverse host architectures. The first field is the source port, a 16-bit unsigned integer that optionally identifies the port number of the sending process; it is set to zero if not used. The second field, the destination port, is another 16-bit unsigned integer specifying the port for the receiving process, meaningful in the context of the destination IP address. These ports facilitate demultiplexing of datagrams to appropriate applications. The third field, , is a 16-bit unsigned representing the total size of the datagram in bytes, including both the eight-byte header and any attached data payload; the minimum value is eight bytes for a header-only datagram. The final field is the , a 16-bit field used for error detection; in IPv4, it is optional and may be set to zero to indicate no checksum is present. In , the checksum is mandatory and must not be set to zero. The bit-level layout of the UDP header is as follows:
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          [Source Port](/page/Source_port)          |       Destination Port        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            [Length](/page/Length)             |           [Checksum](/page/Checksum)            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
This structure aligns the fields across two 32-bit words for efficient processing in network stacks.

Payload Handling

In UDP, the payload consists of the raw application data provided by the upper-layer protocol, encapsulated directly as a sequence of octets following the 8-byte header. This data is treated as an opaque byte stream, with no interpretation or modification performed by the layer itself. The length of the UDP datagram, which includes the 8-byte header and the , is specified in a 16-bit field and can range from a minimum of 8 octets (zero-length ) to a theoretical maximum of octets. However, when carried over IPv4, the practical maximum size is 65,507 bytes, accounting for the minimum 20-byte IPv4 header and the overall IP limit of octets. Applications must ensure their data fits within these constraints to avoid issues during transmission. UDP transmits the entire as a single, atomic unit; there is no segmentation or reassembly mechanism at the , meaning the is either delivered intact to the destination application or dropped entirely if transmission fails. If the exceeds the path's (MTU), fragmentation and subsequent reassembly are handled exclusively by the layer, which may introduce delays or losses without UDP's involvement. UDP does not add any to the for purposes; the application is sent exactly as provided, and any necessary or formatting for protocol-specific requirements must be managed by the application itself. For computation, an implicit zero octet may be appended internally if the length is odd, but this does not alter the transmitted .

Error Detection

Checksum Computation

The UDP checksum is a 16-bit field designed to detect errors in transmission by verifying the integrity of the . It is computed as the one's complement of the one's complement sum of the UDP header, the (), and a pseudo-header derived from the , ensuring protection against bit errors, misdelivery, and truncation. To perform the computation, the is first divided into 16-bit words; if the total is odd, a zero octet is appended as to form an even number of octets. The calculation proceeds in steps: all 16-bit words are summed using one's complement arithmetic, where any carry from the most significant bit is added back to the least significant bit (end-around carry addition), potentially requiring multiple folds if the sum exceeds 16 bits. The result of this sum is then inverted (one's complement) to produce the checksum value, which is inserted into the UDP header. At the receiver, the same process is applied, including the received checksum, and a correct transmission yields a result of all ones (0xFFFF in one's complement). If the computed sum is zero, the transmitted checksum is set to all ones to distinguish it from the all-zero value, which indicates that no checksum was generated. In IPv4, a zero checksum is permitted, though not recommended due to reduced error detection, allowing implementations to skip computation for simplicity or debugging. However, in IPv6, the UDP checksum is mandatory and must not be zero, as the protocol requires it for all datagrams to ensure robust error detection in environments without optional checksumming. This checksum covers the UDP header and payload but does not extend protection beyond the IP layer, relying on the pseudo-header solely to bind it to the specific IP datagram.

Pseudo-Header Construction

In the computation of the , a pseudo-header is constructed to incorporate selected fields from the , ensuring that the check is bound to layer. This protects against being misrouted or delivered to incorrect destinations by including in the calculation. For IPv4, the pseudo-header is 12 bytes long and consists of the following fields: a 32-bit source , a 32-bit destination , an 8-bit zero field (set to 0), an 8-bit field (set to 17 for ), and a 16-bit UDP length field indicating the total length of the UDP header and payload. This design leverages the 32-bit addressing of IPv4 while reserving space for the protocol identifier and length to tie the transport-layer to the underlying datagram. In contrast, the IPv6 pseudo-header is 40 bytes in length to accommodate the expanded address space and related fields: a 128-bit source , a 128-bit destination , a 32-bit upper-layer packet (equivalent to the UDP ), a 24-bit zero field (set to 0), an 8-bit next header field (set to 17 for UDP). The longer fields reflect 's 128-bit addresses, and the absence of a direct equivalent to IPv4's single 8-bit zero field is replaced by the 24-bit zero padding after the , with the next header serving a similar identification role. This adaptation ensures compatibility with 's header structure while maintaining the binding to the IP layer for error detection. The primary purpose of these pseudo-headers is to prevent off-path attacks by requiring that any forged must correctly match the IP addresses (and other fields) for the to validate, thereby enhancing security against blind spoofing without relying solely on the header and .

Reliability Aspects

Absence of Reliability Features

Unlike connection-oriented protocols such as , deliberately omits mechanisms for ensuring reliable data delivery, including acknowledgments, retransmissions, and sequence numbers. In , the sender transmits s without any confirmation of receipt from the receiver; if a is lost due to issues, it is silently discarded by the receiving or intermediate routers, with no notification sent back to the source. This absence of feedback loops means that applications using must implement their own reliability measures if guaranteed delivery is required, as the protocol itself provides none. UDP also lacks flow control or windowing mechanisms to regulate the rate of data transmission based on the receiver's capacity. The sender can transmit datagrams at any pace, independent of the receiver's processing speed or availability, potentially leading to at the destination if not managed by the . Furthermore, without sequence numbers, UDP offers no built-in detection or handling of duplicate datagrams; if duplicates arrive, they are treated as distinct packets, requiring applications to add their own identifiers or checks for deduplication. These omissions stem from UDP's design philosophy of providing a minimal protocol with low overhead to support applications where speed and simplicity outweigh the need for reliability. The UDP header is fixed at 8 bytes, significantly less than TCP's minimum 20 bytes, which reduces processing and transmission costs but shifts the burden of any reliability features to higher-layer protocols or applications. The protocol's optional 16-bit serves only for basic error detection in the header and , not for correction or , further underscoring its non-reliable nature.

Congestion Control Limitations

Unlike TCP, which incorporates congestion avoidance algorithms such as slow start and congestion avoidance, UDP provides no built-in mechanisms for backoff or , allowing senders to transmit datagrams at arbitrary rates without regard to network conditions. This absence can lead to unresponsive flows that exacerbate , particularly in scenarios like UDP floods where high-volume traffic overwhelms links, contributing to congestion collapse by preventing other traffic from utilizing available . For instance, simulations demonstrate that even a single UDP flow operating at a fraction above link capacity can reduce the throughput of competing TCP flows from nearly full utilization to under 3%, highlighting UDP's potential to starve responsive protocols. UDP relies indirectly on the underlying layer for feedback, primarily through ICMP messages such as Destination Unreachable or Time Exceeded, which may indicate or path issues. However, this feedback is unreliable and non-adaptive, as ICMP messages can be lost, rate-limited, or filtered by intermediate devices, providing no mechanism for senders to throttle transmission dynamically. Without explicit signals like those in TCP's congestion window adjustments, UDP applications cannot inherently respond to growing delays or packet drops, leaving management entirely to external interventions. To address these limitations, modern implementations often incorporate application-level congestion controls, such as TCP-Friendly Rate Control (TFRC), which emulates TCP's throughput behavior while preserving UDP's low latency, or circuit breakers that terminate flows exceeding predefined rate thresholds during severe . At the operating system level, tunings like packet pacing—spreading bursts over time to avoid microbursts—or socket options that batch small datagrams (e.g., UDP_CORK in to hold packets until an MTU-sized buffer is filled) help mitigate bursty transmissions that trigger . These approaches, while effective, require deliberate design and do not alter UDP's core protocol behavior. Historically, UDP's lack of congestion control contributed significantly to early congestion problems in the and 1990s, where uncontrolled traffic from applications like network file systems and real-time protocols amplified router queue overflows, leading to widespread and the near-collapse of the . This prompted the development and preference of TCP's algorithms for bulk data transfers, as they ensure network stability by responsively reducing rates during overload, a feature absent in UDP that necessitated guidelines for UDP usage to prevent recurrence.

Applications

Real-Time and Broadcast Uses

UDP's low latency characteristics make it particularly suitable for real-time applications such as (VoIP) and video streaming, where timely delivery is paramount over absolute reliability. In these scenarios, the protocol's connectionless nature avoids the overhead of handshakes, enabling rapid packet transmission that supports interactive communication. For instance, the (RTP), which carries audio and video payloads, operates atop UDP to facilitate end-to-end transport for multimedia conferences and streaming sessions, tolerating minor packet losses that do not significantly degrade since retransmissions would introduce unacceptable delays. Broadcast and multicast applications leverage UDP's efficiency in one-to-many communications, particularly through mechanisms that deliver datagrams to host groups using a single destination address, eliminating the need for redundant transmissions to each receiver. This approach minimizes network overhead by relying on routers to forward packets across interconnected networks, ensuring scalable group delivery without per-receiver acknowledgments or state maintenance. UDP's integration with supports dynamic group membership and , making it ideal for distributing data to multiple endpoints simultaneously. In online and live events, prioritizes speed and responsiveness, where the impact of dropped packets—such as brief visual glitches or missed updates—is far less disruptive than the introduced by error recovery mechanisms. simulation data in multiplayer environments benefits from UDP's ability to handle out-of-order arrivals and losses gracefully, allowing continuous flow without interruptions. This focus on low-jitter transmission ensures immersive experiences in time-sensitive contexts like competitive gaming or broadcast events. Key advantages of UDP in these domains include the absence of connection setup delays, which reduces initial to near-zero, and its inherent for handling high-volume streams of low-fidelity , such as updates or notifications, where complete accuracy is secondary to volume and speed. By maintaining minimal end-system state, UDP enables efficient across ports for concurrent flows, further enhancing its applicability in bandwidth-constrained or high-participant scenarios.

Specific Protocol Examples

The Domain Name System (DNS) utilizes UDP on port 53 for the majority of its queries and responses, enabling the efficient exchange of small, stateless messages where the protocol's built-in retry mechanisms handle occasional packet loss at low cost. This choice leverages UDP's lower overhead compared to connection-oriented protocols, making it ideal for the high-volume, low-latency nature of name resolution in the Internet. Dynamic Host Configuration Protocol (DHCP) operates over UDP using ports 67 for servers and 68 for clients, facilitating broadcast-based discovery and configuration of IP addresses without the need for persistent connections. UDP's support for broadcasting is particularly suited to DHCP's initial stages, where clients lack assigned IP addresses and require rapid, lightweight communication across subnets via relay agents. Simple Network Management Protocol (SNMP) employs on port 161 for its management operations, allowing simple, request-response queries for monitoring and configuring network devices. The protocol's reliance on ensures broad and minimal overhead for infrequent, poll-based interactions in environments. (TFTP) runs over on port , providing a basic mechanism for file transfers primarily in local networks where reliability is managed at the application level rather than through transport-layer acknowledgments. Designed for simplicity and ease of implementation, TFTP uses to minimize complexity in resource-constrained environments like diskless workstations booting over the network. In the 2020s, has emerged as a significant UDP-based , serving as the foundation for to deliver reliable, secure web transport while retaining UDP's deployment advantages in existing networks. Standardized in 2021, QUIC encapsulates its multiplexed streams and congestion control within UDP datagrams to avoid TCP's limitations, enabling faster connection establishment and reduced latency for web applications.

Comparison to TCP

Functional Differences

The User Datagram Protocol (UDP) operates as a connectionless transport protocol, meaning it does not establish a virtual connection between endpoints before transmitting data. In contrast, the is connection-oriented, requiring a three-way involving and segments to synchronize sequence numbers and establish connection state at both ends. This fundamental difference reflects UDP's design philosophy of minimal overhead for simple, message delivery, while TCP prioritizes setup to ensure coordinated communication. UDP provides an unreliable service, treating each as an independent, self-contained unit without guarantees of delivery or protection against duplicates. It preserves message boundaries, where the length field in the header specifies the exact size of each in octets, allowing applications to receive complete messages as sent. , however, delivers as a reliable byte-stream, abstracting away individual message boundaries and reassembling bytes into a continuous sequence regardless of how the sender segmented the . This stream-oriented approach in enables seamless handling of arbitrary data sizes but requires additional mechanisms to maintain integrity. Unlike , UDP includes no mechanisms for ordering datagrams or detecting and eliminating duplicates, relying instead on the underlying network to forward packets without sequence tracking. addresses these issues through sequence numbers assigned to each byte and cumulative acknowledgments that confirm receipt up to a specific point, allowing the receiver to reorder segments and discard duplicates as needed. Consequently, UDP's lack of such features simplifies its operation but shifts responsibility for reliability entirely to the . UDP's header is fixed at a minimal 8 bytes, consisting of source and destination numbers (16 bits each), a length field (16 bits), and a (16 bits), with no provisions for options. TCP's header, by comparison, is in length—typically 20 bytes but extensible up to 60 bytes—incorporating fields for and numbers (32 bits each), flags, size, and optional parameters that can be padded to align on 32-bit boundaries. This header simplicity in UDP underscores its emphasis on efficiency over extensibility, differing sharply from TCP's more complex structure designed to support robust and adaptation.

Performance Considerations

UDP exhibits lower protocol overhead compared to TCP primarily due to its fixed 8-byte header and absence of acknowledgment mechanisms, resulting in approximately 5-10% reduced usage for small payloads where header contributions are significant. In contrast, TCP's minimum 20-byte header, combined with sequence numbers, flags, and separate packets, increases transmission costs, particularly in scenarios with frequent small data exchanges. This overhead difference becomes negligible for large payloads approaching the (MTU) of 1500 bytes but remains advantageous for UDP in resource-constrained or high-frequency applications. In lossy networks, UDP can achieve higher throughput for bursty traffic patterns, as it does not invoke TCP's congestion control mechanisms, such as the congestion window reduction triggered by misinterpreted as . For instance, in environments with collision-induced losses, TCP throughput may drop to 30% of UDP's peak rates (e.g., 0.54 Mbps versus 1.8 Mbps for large packets), while UDP maintains higher effective delivery without retransmission delays. However, this advantage relies on application-layer handling of losses, as UDP provides no built-in , potentially leading to degraded performance without such mitigations. UDP minimizes latency by eliminating the three-way handshake required by TCP, avoiding an initial round-trip time (RTT) delay that can exceed 100 ms in wide-area networks, making it suitable for applications demanding sub-100 ms response times. Measurements in congested networks show UDP's 90th delays ranging from 12 ms to 274 ms for voice traffic, often outperforming TCP's 33 ms to over 17 seconds due to the latter's retransmission overhead. This low-latency profile supports time-sensitive uses like VoIP, where even minor delays from TCP's reliability features can disrupt . UDP supports , allowing a single packet to serve multiple receivers and providing up to Nx bandwidth savings for N recipients compared to TCP's approach, which requires separate connections per recipient. This makes UDP more efficient for group communications, though it remains vulnerable to losses in error-prone links, necessitating application-level error correction to match TCP's reliability in settings.

Standards

Core RFC Specifications

The (UDP) was originally specified in RFC 768, authored by and published on August 28, 1980. This document defines UDP as a minimal protocol that provides an unreliable service over [Internet Protocol](/page/Internet Protocol) (IP), enabling applications to send messages to other programs with a procedure that includes minimal protocol mechanisms such as addressing and an optional . The specification emphasizes UDP's role in supporting transaction-oriented communication without guarantees of delivery, ordering, or duplicate protection, recommending the () for applications needing reliable stream delivery. RFC 768 outlines the UDP header, which consists of four fields: a 16-bit (optional, set to zero if unused), a 16-bit destination port (contextual to the destination ), a 16-bit field indicating the total octets of the (minimum 8), and a 16-bit computed as the one's complement sum of a pseudo-header (including source and destination addresses, protocol number, and ), the header, and the . The serves to detect errors in , including protection against misdelivery to the wrong destination; it is optional, with a value of all zeros indicating no checksum computation, though uses all ones for that case. Semantically, datagrams are connectionless and independent, with no handshaking or retransmission; each datagram carries user up to the maximum unit size, and the assumes the underlying layer handles fragmentation if needed. The specification includes notes on portability and implementation to ensure broad applicability across diverse systems, stating that UDP should support primitives for creating receive ports, receiving datagrams with source port and address information, and sending datagrams specifying destination address and ports. It stresses simplicity as a core design principle, noting that "this protocol provides a procedure for application programs to send messages to other programs with a minimum of protocol mechanism," thereby facilitating easy implementation without complex state management. These elements promote UDP's use in environments requiring low overhead, such as real-time applications. Subsequent clarification of UDP requirements for Internet hosts appears in RFC 1122, edited by Robert Braden and published in October 1989, which categorizes implementation mandates under the "MUST," "SHOULD," and "MAY" framework for communication layers including over IPv4. This document requires hosts to fully implement as defined in RFC 768, including generating and validating checksums by default, while allowing applications to optionally disable checksum generation if they provide their own integrity checks; however, hosts must silently discard datagrams with invalid non-zero checksums and are advised to enable checksums for reliability. It further mandates passing IP options, specific destination addresses, and relevant ICMP error messages (such as Port Unreachable) to the , ensuring proper demultiplexing via port numbers and handling of end-to-end issues by applications rather than the protocol itself. The core UDP datagram model established in RFC 768 has remained largely unchanged since 1980, with updates such as RFC 9868 adding support for transport options while preserving its foundational simplicity and unreliable delivery paradigm.

Extensions and Updates

Over time, the () has seen several extensions and updates through () () to adapt it to evolving network environments, particularly and specialized applications. One significant update involved integrating with , as specified in RFC 2460, which outlined the transmission of packets over networks. This integration required modifications to the pseudo-header used in computation, incorporating 128-bit addresses instead of 32-bit IPv4 addresses, and mandated the use of the field—previously optional in IPv4—to enhance error detection in environments. RFC 2460, published in December 1998, was later obsoleted by RFC 8200 in July 2017, which retained these -over- provisions while updating the broader specification. To address scenarios where partial data integrity is preferable over complete packet discard, such as in error-prone links for media, RFC 3828 introduced UDP-Lite in July 2004. UDP-Lite extends UDP by adding a Coverage field in the header, allowing applications to specify the portion of the packet (e.g., just the header) covered by the , thereby tolerating errors in unprotected payload sections without dropping the entire . This makes it suitable for robust applications like voice codecs (e.g., Adaptive Multi-Rate) and video streaming over (RTP), where minor payload corruption is less disruptive than latency from retransmissions. As a standards-track , UDP-Lite provides a lightweight alternative to full-checksum UDP for bandwidth-constrained or lossy channels. Application designers received further guidance on UDP usage through RFC 5405, published in November 2008 as a Best Current Practice (BCP 145). This document emphasized considerations for encapsulation, recommending that UDP-based tunnels avoid exacerbating by inheriting control from inner protocols when possible, and advised limiting sizes to prevent fragmentation—such as capping at 576 bytes for IPv4 or 1280 bytes for paths. It also covered (MTU) discovery to mitigate path MTU issues and stressed enabling checksums to improve reliability. Building on these, RFC 8085, issued in March 2017 and obsoleting RFC 5405, provided updated UDP usage guidelines with a focus on tunneling and contemporary challenges. It addresses gaps in security by recommending end-to-end protections like (DTLS) or , since UDP inherently lacks or , and advises randomizing source ports to thwart off-path attacks. For tunnels, the RFC mandates processing (ECN) fields from inner headers and cautions against relying on ICMP messages due to middlebox filtering, while extending guidelines to scenarios to ensure fair network resource use. These updates reflect UDP's adaptation to modern infrastructures, including increased tunneling in virtual private networks and content delivery. In October 2025, RFC 9868, authored by J. Touch and C. Heard, updated RFC 768 to define transport options for . It specifies a "surplus area" in the payload after the length field but before the end of the datagram for optional extensions in a type-length-value (TLV) format, supporting features such as , fragmentation offload, and coverage adjustments. Options are categorized as safe (ignorable by legacy implementations) or unsafe (requiring processing), ensuring while enabling enhancements for contemporary networks without altering 's connectionless, unreliable semantics.

References

  1. [1]
    RFC 768: User Datagram Protocol
    ### Key Definition and Description of UDP
  2. [2]
    UDP - Cisco Community
    Jun 10, 2009 · The User Datagram Protocol (UDP) is a connectionless transport-layer protocol (Layer 4) that belongs to the Internet protocol family.
  3. [3]
    What is the User Datagram Protocol (UDP)? Full Guide - TechTarget
    Mar 17, 2025 · UDP applications and use cases · Lossless data transmission. · Gaming, voice and video. · Services that don't need fixed packet transmission.How Udp Works · Tcp Vs. Udp · Udp Applications And Use...<|control11|><|separator|>
  4. [4]
    What is the User Datagram Protocol (UDP)? - Cloudflare
    UDP is commonly used in time-sensitive communications where occasionally dropping packets is better than waiting. Voice and video traffic are often sent using ...
  5. [5]
    User Datagram Protocol (UDP) - F5
    Common applications of UDP include: DNS for querying domain name servers; DHCP for automatic IP address assignment; SNMP for managing network devices; SSDP for ...
  6. [6]
  7. [7]
    TCP/IP Model - GeeksforGeeks
    Sep 19, 2025 · Transport Layer (TCP/UDP): Breaks data into segments and ensures reliable (TCP) or fast (UDP) delivery. Internet Layer (IP): Adds IP ...
  8. [8]
    Service Name and Transport Protocol Port Number Registry
    ### Summary of Port Number Ranges for UDP/TCP
  9. [9]
    RFC 6353 - Transport Layer Security (TLS) Transport Model for the ...
    Like TCP, DTLS over UDP uses the four-tuple <source IP, destination IP, source port, destination port> for identifying the connection (and relevant DTLS ...
  10. [10]
    RFC 6773 - DCCP-UDP: A Datagram Congestion Control Protocol ...
    ... UDP 4-tuple. In this method, the endpoint MUST then associate each 6-tuple with a single DCCP connection. If an endpoint is unable to demultiplex the 6-tuple ...
  11. [11]
    RFC 3493: Basic Socket Interface Extensions for IPv6
    ### Summary of Wildcard Addresses (INADDR_ANY) for UDP Socket Binding in RFC 3493
  12. [12]
    RFC 4787 - Network Address Translation (NAT) Behavioral ...
    This document defines basic terminology for describing different types of Network Address Translation (NAT) behavior when handling Unicast UDP.Missing: socket | Show results with:socket
  13. [13]
    RFC 768: User Datagram Protocol
    User Datagram Header Format Fields ------ Source Port is an optional field, when meaningful, it indicates the port of the sending process, and may be ...
  14. [14]
    RFC 768 - User Datagram Protocol (UDP) - IETF
    This User Datagram Protocol (UDP) is defined to make available a datagram mode of packet-switched computer communication in the environment of an interconnected ...
  15. [15]
    RFC 1071 - Computing the Internet checksum - IETF Datatracker
    This memo discusses methods for efficiently computing the Internet checksum that is used by the standard Internet protocols IP, UDP, and TCP.
  16. [16]
    RFC 8200 - Internet Protocol, Version 6 (IPv6) Specification
    ... IPv6 node is that the UDP checksum is not optional. That is, whenever originating a UDP packet, an IPv6 node must compute a UDP checksum over the packet and ...Missing: mandatory | Show results with:mandatory
  17. [17]
    RFC 8085: UDP Usage Guidelines
    This document provides guidelines on the use of UDP for the designers of applications, tunnels, and other protocols that use UDP.
  18. [18]
  19. [19]
  20. [20]
  21. [21]
  22. [22]
  23. [23]
    RFC 3550 - RTP: A Transport Protocol for Real-Time Applications
    RTP provides end-to-end network transport functions suitable for applications transmitting real-time data, such as audio, video or simulation data.
  24. [24]
    RFC 1112: Host extensions for IP multicasting
    ### Summary of IP Multicast with UDP and Efficiency for Group Delivery (RFC 1112)
  25. [25]
    RFC 8085: UDP Usage Guidelines
    Summary of each segment:
  26. [26]
    RFC 1035 - Domain names - implementation and specification
    The Internet supports name server access using TCP [RFC-793] on server port 53 (decimal) as well as datagram access using UDP [RFC-768] on UDP port 53 (decimal) ...
  27. [27]
    RFC 2131 - Dynamic Host Configuration Protocol - IETF Datatracker
    The Dynamic Host Configuration Protocol (DHCP) provides a framework for passing configuration information to hosts on a TCPIP network.
  28. [28]
    RFC 3417 - Transport Mappings for the Simple Network ...
    This document defines the transport of Simple Network Management Protocol (SNMP) messages over various protocols. This document obsoletes RFC 1906.
  29. [29]
    RFC 1350 - The TFTP Protocol (Revision 2) - IETF Datatracker
    TFTP is a very simple protocol used to transfer files. It is from this that its name comes, Trivial File Transfer Protocol or TFTP.
  30. [30]
    RFC 9000 - QUIC: A UDP-Based Multiplexed and Secure Transport
    RFC 9000 defines QUIC, a secure, UDP-based transport protocol for structured communication, low-latency connections, and network path migration.
  31. [31]
  32. [32]
    [PDF] TCP and UDP Performance over a Wireless LAN - Computer Science
    We uncover multiple problems with TCP and UDP performance in this system. We investigate the causes of these problems (radio hardware, device drivers, network.
  33. [33]
    [PDF] Experimental Study of TCP and UDP Protocols for Future Distributed ...
    The purpose of these experiments was to measure and compare data communication performance of TCP and UDP on a LAN for 1) short messages in traditional ...
  34. [34]
    RFC 1122 - Requirements for Internet Hosts - Communication Layers
    This is one RFC of a pair that defines and discusses the requirements for Internet host software. This RFC covers the communications protocol layers.
  35. [35]
    RFC 2460 - Internet Protocol, Version 6 (IPv6) Specification
    This document specifies version 6 of the Internet Protocol (IPv6), also sometimes referred to as IP Next Generation or IPng.
  36. [36]
  37. [37]
    RFC 3828 - The Lightweight User Datagram Protocol (UDP-Lite)
    This document describes a new transport protocol, UDP-Lite, (also known as UDPLite). This new protocol is based on three observations.
  38. [38]
  39. [39]
  40. [40]
    RFC 5405: Unicast UDP Usage Guidelines for Application Designers
    **RFC 5405 Summary: Unicast UDP Usage Guidelines for Application Designers**
  41. [41]
  42. [42]
  43. [43]
  44. [44]