UDP (User Datagram Protocol)

UDP (User Datagram Protocol) is a connectionless transport layer protocol that allows fast, minimal-overhead transmission of data. Unlike TCP, UDP does not guarantee reliable delivery, order, or error correction, making it ideal for applications requiring low latency.

Key Features:

  • No connection setup – Data is sent without establishing a session.
  • Minimal header overhead – Only 8 bytes, making it lightweight.
  • No retransmissions – Lost packets are not resent.
  • Supports broadcasting and multicasting.

Common Uses:
Streaming media (video/audio), online gaming, VoIP (Voice over IP), DNS queries.

Key Terms in UDP

  • User Datagram Protocol (UDP) – A connectionless transport-layer protocol that enables fast, low-overhead data transmission.
  • Datagram – A self-contained, independent packet of data sent without setup or acknowledgments.
  • Connectionless – No persistent connection is required between sender and receiver.
  • Checksum – An error-detection mechanism in the UDP header to detect corruption in data.
  • Port Number – Identifies sending and receiving applications on the source and destination devices.
  • Minimal Header Overhead – Only an 8-byte header (compared to TCP’s 20+ bytes), making it lightweight.
  • Best-Effort Delivery – No guarantee of delivery, order, or duplicate prevention.
  • Broadcast & Multicast – Supports one-to-many transmission, unlike TCP, which is strictly one-to-one.
  • Low Latency – Suitable for real-time applications (gaming, voice calls, video streaming).

Breakdown of UDP Header Format

Unlike TCP, which is connection-oriented, UDP is a UDP is Stateless, connectionless (each packet is independent). The UDP header is much simpler compared to the TCP header.

UDP Format (Image Source: )

1. Source Port (16 bits)

  • Identifies the port number of the sender.
  • Used to determine where the response should be sent (if needed).

2. Destination Port (16 bits)

  • Identifies the port number of the receiver.
  • Helps in directing the datagram to the correct application on the receiving device.

3. Length (16 bits)

  • Specifies the total length of the UDP datagram, including both the header and the data.
  • Minimum value is 8 bytes (header-only), and the maximum is 65,535 bytes.

4. Checksum (16 bits)

  • Used for error detection.
  • It covers the UDP header, data, and parts of the pseudo-header (from the IP layer).
  • If not used, it may be set to 0.

5. Data (Variable length)

  • Contains the actual message being transmitted.
  • The size is determined by the Length field.

Summary

  • UDP is lightweight, requiring only 8 bytes for its header.
  • It lacks error correction, sequencing, and flow control, making it faster but less reliable than TCP.
  • Common applications using UDP include DNS, VoIP, video streaming, and gaming.

Philosophy behind UDP Development:

  • Simplicity and Speed: UDP is designed for applications that require quick data delivery without the need for error correction or retransmission.
  • Minimalism: Unlike TCP, UDP does not establish a connection or provide delivery guarantees.
  • Stateless Communication: It does not maintain session states between sender and receiver.
  • Best-Effort Transmission: It sends data without confirming receipt, making it suitable for time-sensitive applications.
×

Hello!

Click one of our engineer below to chat on WhatsApp

× Call/ Text Anytime