badge icon

This article was automatically translated from the original Turkish version.

Article

UDP Communication Protocol

User Datagram Protocol (UDP) is a lightweight transport layer protocol within the TCP/IP protocol suite that operates in a connectionless manner. UDP enables direct data transmission between applications without establishing a connection, providing no error control or delivery guarantee during transmission. This characteristic makes it a fast but unreliable protocol【1】.


UDP’s header structure is extremely simple, consisting of only 8 bytes and containing four fundamental fields: source port, destination port, length, and a checksum field used for error detection【2】. This simplicity provides a significant advantage in applications requiring low-latency data flow.


UDP resides at the Transport Layer (Layer 4) of the OSI model. It works alongside the IP protocol to route data packets (datagrams) across the network. However, unlike TCP, UDP does not guarantee the order of received data or its retransmission【3】.


Due to these characteristics, UDP is preferred in applications where data integrity is not critical but speed is essential. Examples include DNS queries, real-time audio/video transmission, online gaming, and IoT applications.

History of UDP

UDP was defined in 1980 by David P. Reed and officially published the same year via RFC 768【4】. Reed recognized that TCP’s complex error control and flow control mechanisms consumed excessive resources for simple network applications and designed a simpler protocol to meet this need. The purpose of UDP is to provide the minimal structure necessary for direct application-to-application data exchange over IP.


During the time UDP was developed, many applications running on early networks such as ARPANET required low resource consumption and fast data transmission. This need was addressed by UDP’s simple design. Fundamental internet services such as DNS, TFTP, and NTP have used UDP as their primary communication protocol since their inception【5】.


Today, UDP continues to form the foundation of more advanced protocols such as WebRTC and QUIC . These newer protocols leverage UDP’s connectionless structure while adding their own layers of reliability and encryption【6】.

Technical Features and Structure of UDP

UDP (User Datagram Protocol) is defined in RFC 768 and works with the IP protocol to transmit data packets in a connectionless manner【7】. Unlike TCP, UDP is a “lightweight” protocol; it does not establish a connection prior to data transmission and does not include an acknowledgment mechanism (ACK) to confirm successful delivery.


This structure ensures low latency and low processing overhead during data transmission. UDP’s simplicity makes it frequently preferred in high-performance systems such as real-time media streaming or sensor network communication.


Since UDP sends data as individual and independent packets, packets may arrive out of order, be lost, or be duplicated. Therefore, applications using UDP typically implement their own error control mechanisms.

UDP Header Packet

The header structure of UDP data packets is extremely simple and consists of only 8 bytes:

UDP Header Packet

The header structure of UDP data packets consists of:


  • Source Port (16 bits): The port number of the application sending the data. It is not mandatory to fill.
  • Destination Port (16 bits): The port number of the application to which the data is sent.
  • Length (16 bits): The total length of the UDP header and data.
  • Checksum (16 bits): Optional error detection (mandatory in IPv6).

Source Port (16 bits)

This field specifies the port number of the sending application. It is not mandatory. If unused, the value can be set to 0. It typically contains the client’s port number and is used to determine where the response should be directed.


Example: When a DNS client sends a query, it sets the source port to a random value to ensure the response reaches the same client.

Destination Port (16 bits)

This field contains the port number of the receiving application. It plays a critical role in directing the UDP segment to the correct application.

It is mandatory. It is typically defined as a server port.


Example ports:

  • DNS: 53
  • TFTP: 69
  • SNMP: 161

Length (16 bits)

This field specifies the total length in bytes of all data carried with the UDP header.


  • Minimum length: 8 bytes (header only)
  • Maximum length: Theoretically 65,535 bytes (limited by IPv4 packet size). However, since the header is 8 bytes and the IP header is 20 bytes, the maximum data payload is 65,507 bytes.


This field is used to determine the size of the data field included in the UDP header and can assist some systems in verifying packet integrity.

Checksum (16 bits)

The checksum is used to verify the integrity of the UDP segment. It attempts to detect whether the data contains errors. However, its usage differs between IPv4 and IPv6:


  • IPv4: Optional. Systems may choose not to calculate it.
  • IPv6: Mandatory. It must always be calculated.
  • The UDP checksum is computed using additional information from the IP layer, known as the “pseudo header”:
    • Source IP address
    • Destination IP address
    • Protocol number (17 for UDP)
    • UDP length


This process aims to detect transport layer errors more reliably.


Example UDP Header Value (Hex format)

  • Source Port: 0x0035 = 53 (DNS)
  • Destination Port: 0x1F90 = 8080
  • Length: 0x002C = 44 bytes
  • Checksum: 0x9C4D

UDP’s Position in the OSI Model

UDP (User Datagram Protocol) operates at the Transport Layer (Layer 4) of the OSI (Open Systems Interconnection) model. This layer is responsible for establishing end-to-end communication between applications sending and receiving data over the network. Unlike other transport protocols such as TCP, UDP does not establish a connection and does not provide services such as data sequencing, error control, or retransmission during transmission.


The primary function of the transport layer is to establish logical connections between applications. UDP accomplishes this with minimal control and overhead, providing an ideal structure for applications requiring fast and low-latency communication. For example, real-time video/audio transmission, online gaming, and IoT devices benefit from this aspect of UDP.

UDP is typically configured to provide direct access to application layer protocols. This structure allows protocols such as DNS or NTP to perform network communication rapidly over UDP. Application layer protocols (Layer 7) above UDP generally include their own error detection or data retransmission mechanisms.

UDP Usage with IPv4 and IPv6

UDP operates compatibly with both IPv4 and IPv6 protocol stacks. UDP packets are placed within the transport field of IP packets and routed across the network to the destination device. However, the different structures provided by IPv4 and IPv6 can affect certain aspects of UDP’s operation.


In IPv4, the UDP header follows the IPv4 header, and data transmission often occurs without using the optional error detection (checksum) field. However, in IPv6, this is different: the UDP checksum field is mandatory under IPv6 because IPv6 headers do not include error detection. This places greater responsibility on UDP’s own header for ensuring data integrity during transmission.


Additionally, IPv6 offers a larger addressing capacity (128 bits) compared to IPv4. This enables systems using UDP to communicate with a significantly greater number of endpoints. This expansion allows IoT devices and sensor networks using IPv6 to be designed in a scalable manner based on UDP.


UDP’s ability to work with both IPv4 and IPv6 makes it highly valuable during network transition periods and in multi-protocol environments.


The structure used by UDP when communicating over IPv4 consists of three main components:


  1. IP Header (IPv4 Header)
  2. UDP Header (UDP Header)
  3. Data (Payload/Data)


Together, these components form a UDP/IP datagram.

IPv4 Header

The IPv4 header is the beginning portion of the IP packet carrying the UDP segment. It is 20 bytes long (excluding optional fields) and contains the information necessary for routing and delivery between networks. An example of operation with the IPv4 protocol is shown below.


Important Fields in the IPv4 Header

In IPv4, a 32-byte UDP header combined with data is transmitted over IP as UDP datagrams.

Advantages of UDP

UDP offers significant advantages for specific applications. One of its most important advantages is its ability to transmit data with minimum latency. This feature makes UDP stand out in time-sensitive applications.


Its main advantages include:


  • Connectionless Transmission: No connection needs to be established before sending data, reducing transmission time.
  • Low Latency and High Performance: Due to its simple header structure, processing overhead is minimal.
  • Suitability for Real-Time Applications: In applications such as video conferencing, VoIP, and online gaming, timely packet delivery is more important than complete delivery.
  • Support for Multicast and Broadcast: UDP supports sending data to multiple destinations simultaneously.
  • Simplicity: The absence of complex error correction and control mechanisms allows application developers to intervene at the protocol level.


These advantages have made UDP the preferred protocol in systems that are insensitive to data loss but sensitive to timing【8】.

Disadvantages of UDP

UDP’s architecture, focused on speed and simplicity, brings significant limitations in certain scenarios. Its most important disadvantage is its lack of reliability.


Its main disadvantages include:


  • No Reliability: There is no check to confirm whether packets reach their destination. The application must provide this control.
  • No Order Preservation: Packets may not arrive in the order they were sent. Packet sequencing is left to the application layer.
  • No Flow Control: The sender does not consider the receiver’s capacity, which can lead to buffer overflows on the receiver side.
  • No Error Correction: It is not checked whether packets are corrupted. Even if a checksum is used, it only detects corrupted packets, not corrects them.
  • Susceptible to Network Congestion: If the application layer misuses this protocol, UDP can generate high traffic and cause network congestion【9】.


These limitations often lead to the preference of more reliable protocols such as TCP over UDP in applications requiring secure and complete data transmission.

UDP Use Cases

UDP is widely preferred in many areas due to its connectionless nature and ability to provide low-latency communication. It is often chosen over TCP in applications where speed and real-time performance are critical.

Real-Time Applications

UDP is commonly used in audio and video communication applications where minimizing delay is vital【10】. Examples include:


  • VoIP (Voice over IP) services (e.g., Zoom, Skype)
  • Live video streaming and live sports broadcasts
  • Online multiplayer games, which require uninterrupted transmission of player position and movement data (e.g., CS:GO, Fortnite)


In such applications, timely delivery of data packets is more important than complete delivery. Even if some packets are lost, the stream continues because retransmission would introduce unacceptable delays.

Sensor Networks and IoT Systems

UDP is used in a large portion of IoT (Internet of Things) devices because these devices typically operate in systems with limited bandwidth and low power consumption. UDP’s simple structure is ideal for such embedded systems.


  • Sensor data transmission: Low-latency transfer of environmental data such as temperature, pressure, or motion
  • Digital signal processing applications

Core Network Protocols such as DNS and DHCP

Many fundamental network protocols are built on UDP【11】:


  • DNS (Domain Name System) queries operate over UDP because they typically involve small data sizes and require fast responses.
  • DHCP (Dynamic Host Configuration Protocol) uses UDP to assign IP addresses to clients.
  • SNMP (Simple Network Management Protocol) uses UDP to transmit status information about network devices.

Broadcast and Multicast Systems

UDP is used in broadcast and multicast systems that enable sending data to multiple destinations simultaneously. Examples include:


  • IPTV systems
  • Network discovery protocols (e.g., SSDP – Simple Service Discovery Protocol)


These structures allow data to be sent to all targets in a single transmission, using bandwidth more efficiently.

Embedded Systems

UDP is frequently preferred in embedded software systems due to its simplicity, low resource consumption, and low latency. Embedded systems typically have limited processing power and memory capacity; therefore, UDP is favored over TCP, which requires complex connection rules【12】.

Real-Time Performance and Low Latency

Many embedded systems are real-time systems that collect and process data from the external environment at specific intervals. Examples include:


  • Engine control units (ECUs)
  • Sensor and servo motor systems
  • Devices collecting sensor data
  • Remotely controlled robots


Using UDP for data transmission facilitates the system’s ability to respond within predetermined time intervals because it does not involve time-consuming processes such as handshaking.

Simplicity and Code Portability

Due to its simple header structure, UDP reduces code size, which is a significant advantage in embedded systems. Additionally, it requires fewer system calls (syscalls) than TCP, making code portability and hardware-specific implementation easier.


Many embedded operating systems (RTOS) or bare-metal software platforms support UDP:


  • FreeRTOS + lwIP
  • Embedded Linux (Yocto, Buildroot)
  • Zephyr RTOS
  • VxWorks


UDP maintains a widespread and important role in modern network communication due to its advantages of flexibility, low latency, and efficient use of system resources. UDP’s lightweight【13】, connectionless, and fast【14】 structure provides advantages in various use cases such as audio, video, gaming, IoT systems, and network services.

Citations

  • [1]

    Kurose, J.F. & Ross, K.W. (2017). Computer Networking: A Top-Down Approach (7th ed.). Pearson Education. 

  • [2]

    https://www.rfc-editor.org/rfc/rfc768#ref-1

  • [3]

    https://books.google.com.tr/books/about/Internetworking_with_TCP_IP_Volume_One.html?id=seaaAAAAQBAJ&redir_esc=y

  • [4]

    https://www.rfc-editor.org/rfc/rfc768#ref-1

  • [5]

    Postel, J. (1980). DoD Internet Protocol Specification. DARPA Internet Program.

  • [6]

    Iyengar, J. & Thomson, M. (2021). QUIC: A UDP-Based Multiplexed and Secure Transport. RFC 9000.

  • [7]

    Kurose, J.F. & Ross, K.W. (2017). Computer Networking: A Top-Down Approach (7th ed.). Pearson Education. 

  • [8]

    Kurose, J. F., & Ross, K. W. (2020). Computer Networking: A Top-Down Approach (7th Edition). Pearson Education. 

  • [9]

    Tanenbaum, A. S., & Wetherall, D. J. (2011). Computer Networks (5th Edition). Pearson.

  • [10]

    Kurose, J.F. & Ross, K.W. (2017). Computer Networking: A Top-Down Approach (7th ed.). Pearson Education.

  • [11]

    Forouzan, B. A. (2013). Data Communications and Networking (5th ed.). McGraw-Hill Education. 

  • [12]

    Tanenbaum, A. S., & Wetherall, D. J. (2010). Computer Networks (5th ed.). Pearson Education.

  • [13]

    Forouzan, B. A. (2013). Data Communications and Networking (5th ed.). McGraw-Hill Education. 

  • [14]

    Stevens, W. R. (1994).TCP/IP Illustrated, Volume 1, Addison-Wesley.

Author Information

Avatar
AuthorHüseyin HanlıDecember 5, 2025 at 8:01 AM

Discussions

No Discussion Added Yet

Start discussion for "UDP Communication Protocol" article

View Discussions

Contents

  • History of UDP

  • Technical Features and Structure of UDP

  • UDP Header Packet

    • Source Port (16 bits)

    • Destination Port (16 bits)

    • Length (16 bits)

    • Checksum (16 bits)

  • UDP’s Position in the OSI Model

  • UDP Usage with IPv4 and IPv6

  • IPv4 Header

    • Important Fields in the IPv4 Header

  • Advantages of UDP

  • Disadvantages of UDP

  • UDP Use Cases

  • Real-Time Applications

    • Sensor Networks and IoT Systems

      • Core Network Protocols such as DNS and DHCP

  • Broadcast and Multicast Systems

  • Embedded Systems

    • Real-Time Performance and Low Latency

    • Simplicity and Code Portability

Ask to Küre