UDP (User Datagram Protocol) - Overview
UDP (User Datagram Protocol) is a connectionless transport layer protocol (Layer 4 of the OSI
model). It is used for applications that require fast, efficient transmission and can tolerate some data
loss.
Key Features of UDP:
- Connectionless: No need to establish a connection before data transfer.
- Unreliable: No error checking or acknowledgment – delivery is not guaranteed.
- Fast Transmission: Low latency, making it suitable for real-time applications.
- No Flow Control or Congestion Control: Sends data without managing rate or errors.
- Lightweight Header: Contains minimal fields, reducing overhead.
UDP Header Fields:
- Source Port: Identifies the sender's application.
- Destination Port: Identifies the receiver's application.
- Length: Specifies the length of the UDP header and data.
- Checksum: Provides basic error-checking (optional in IPv4, mandatory in IPv6).
Common Applications that Use UDP:
- DNS (Domain Name System)
- DHCP (Dynamic Host Configuration Protocol)
- VoIP (Voice over IP)
- Video/Audio Streaming
- Online Gaming
- TFTP (Trivial File Transfer Protocol)
Comparison with TCP:
- TCP is connection-oriented; UDP is connectionless.
- TCP ensures reliable delivery; UDP does not guarantee delivery.
- TCP has higher overhead; UDP is lightweight and faster.
- TCP is suitable for applications needing accuracy; UDP for speed-focused tasks.