🌐

UDP Overview and Operations

Sep 7, 2025

Overview

This lecture covers the User Datagram Protocol (UDP), discussing its basic operations, segment format, use of the internet checksum for error detection, and reasons why UDP is used despite its simplicity.

UDP Basics

  • UDP stands for User Datagram Protocol and provides a simple, connectionless, best-effort transport service.
  • UDP does not guarantee delivery, order, or error-free transmission of segments.
  • There is no connection setup or shared state between sender and receiver in UDP.
  • Each UDP segment is handled independently by the network.

Reasons to Use UDP

  • No connection establishment delay, allowing immediate data transmission.
  • Minimal protocol overhead due to simple headers.
  • Lacks congestion control, so senders can transmit at any desired rate, even in congested networks.
  • Useful for applications like streaming media, DNS, and SNMP, which tolerate some loss and need speed.
  • Application-level reliability can be built on top of UDP if needed (e.g., HTTP/3).

UDP Sender and Receiver Actions

  • The application hands data to UDP, which adds a UDP header to form a segment.
  • UDP sends the segment to IP for network delivery.
  • On receiving, UDP checks the checksum, extracts the payload, and delivers it to the right application socket.

UDP Segment Format

  • UDP header has four fields: Source Port, Destination Port, Length, and Checksum.
  • Source and destination ports enable multiplexing/demultiplexing.
  • Length field specifies the total segment size.
  • Checksum is used for error detection.

The Internet Checksum

  • UDP checksum helps detect bit errors in the header and data during transmission.
  • Sender calculates the checksum over header, payload, and IP addresses as 16-bit integers, using one's complement addition.
  • Receiver recalculates the checksum; if different from the received checksum, an error is detected.
  • Not all errors are detected—some bit flips can go unnoticed.

Limitations and Reliability

  • UDP's checksum is not foolproof; undetected errors are possible.
  • Stronger error detection and correction mechanisms exist at other layers.
  • For full reliability, use TCP or add reliability services at the application level.

Key Terms & Definitions

  • UDP (User Datagram Protocol) — A simple, connectionless transport protocol offering best-effort data delivery.
  • Checksum — A value for error detection, calculated by summing data as 16-bit integers using one's complement math.
  • Connectionless — No prior setup or maintained state between sender and receiver.
  • Multiplexing/Demultiplexing — Process of directing data to the correct receiving application using port numbers.

Action Items / Next Steps

  • Read RFC 768 to understand the simple UDP protocol specification.
  • Review upcoming material on reliable data transfer and TCP.