Definition
UDP (User Datagram Protocol) is a core transport layer protocol in the TCP/IP suite. It provides a minimal, connectionless communication service with no reliability guarantees, ordering, or flow control mechanisms.
Protocol Characteristics
- Connectionless: No handshake required before data transmission.
- Unreliable: No acknowledgment of packet receipt or retransmission.
- Low overhead: 8-byte header versus TCP’s 20-byte header.
- No congestion control: Packets may be dropped under heavy traffic.
- Stateless: Each datagram is processed independently.
UDP Header Structure (8 bytes)
0 7 8 15 16 23 24 31
+--------+--------+--------+--------+
| Source Port | Destination Port|
+--------+--------+--------+--------+
| Length | Checksum |
+--------+--------+--------+--------+
| Data... |
+----------------------------------+
Common Applications
- Real-time services: VoIP (e.g., SIP/RTP), video streaming
- DNS queries: Fast resolution with single-packet exchanges
- Online gaming: Latency-critical player position updates
- IoT/Sensor data: Periodic status reports where loss is tolerable
- Multicast/broadcast: Efficient one-to-many transmissions
Advantages vs. TCP
Feature | UDP | TCP |
---|---|---|
Speed | Faster (no handshake/ACK) | Slower (connection setup) |
Reliability | None (best-effort delivery) | Guaranteed delivery |
Ordering | No sequence enforcement | Strict byte-stream order |
Congestion Ctrl | None | Adaptive window scaling |
Performance Considerations
- Packet loss: Tolerable in real-time apps (e.g., missing VoIP packets)
- Jitter handling: Applications must implement own buffering
- MTU awareness: Large datagrams may fragment at IP layer
- Checksum optional: IPv4 allows zero checksum (risk of corrupt data)
You May Also Like