Back to Transport Layer

UDP Protocol

User Datagram Protocol - Connectionless transport layer protocol

Protocol Type

Connectionless, unreliable transport

Header Size

8 bytes - minimal overhead

Use Cases

DNS, DHCP, gaming, streaming

UDP Packet Simulator

UDP Header Structure

Source Port
16 bits
Destination Port
16 bits
Length
16 bits
Checksum
16 bits
Data (Variable Length)
Application data payload

TCP vs UDP Comparison

FeatureTCPUDPBetter For
Connection Setup3-way handshake requiredNo connection setupUDP
ReliabilityGuaranteed deliveryBest effortTCP
SpeedSlower due to overheadFaster transmissionUDP
Header Size20+ bytes8 bytesUDP
Flow ControlBuilt-in flow controlNo flow controlTCP
Error DetectionError detection & correctionBasic checksum onlyTCP
Use CaseFile transfer, web browsingGaming, streaming, DNSDepends
OverheadHigh overheadLow overheadUDP

UDP Characteristics

Advantages

  • • Fast transmission (no connection setup)
  • • Low overhead (8-byte header)
  • • Simple protocol implementation
  • • Suitable for real-time applications
  • • Supports broadcast/multicast
  • • No connection state maintenance

Disadvantages

  • • No guarantee of delivery
  • • No ordering of packets
  • • No flow control mechanism
  • • No congestion control
  • • Limited error detection
  • • Application must handle reliability

Common UDP Use Cases

DNS (Domain Name System)

Quick name resolution queries where speed matters more than reliability

Online Gaming

Real-time multiplayer games requiring low latency over reliability

Video Streaming

Live video/audio streams where occasional packet loss is acceptable

DHCP

Dynamic Host Configuration Protocol for IP address assignment

SNMP

Simple Network Management Protocol for network monitoring

NTP

Network Time Protocol for clock synchronization across networks