UDP (User Datagram Protocol)
A lightweight communication protocol of the Internet Protocol Suite that provides fast, connectionless delivery of data between applications without guaranteeing reliability or ordering.
Key Characteristics:
UDP is a connectionless protocol, meaning it sends data without establishing a dedicated connection between sender and receiver. It operates at the transport layer (Layer 4) of the OSI model and transmits data packets (called datagrams) with minimal protocol overhead. Unlike TCP, UDP does not verify that packets arrive at their destination or maintain their order.
How It Works:
UDP simply sends datagrams from source to destination without any handshake process. There are no acknowledgments, no retransmissions of lost packets, and no flow control. This "fire and forget" approach makes UDP much faster than TCP but less reliable.
Common Uses:
- Live video streaming and video conferencing
- Online gaming
- Voice over IP (VoIP)
- DNS queries
- DHCP (Dynamic Host Configuration Protocol)
- Live broadcasts and real-time applications
Contrast with TCP:
Unlike TCP, UDP prioritizes speed and efficiency over reliability. It's ideal for applications where occasional packet loss is acceptable but low latency is critical. UDP has significantly less overhead since it doesn't maintain connection state or ensure delivery.
Port Numbers:
UDP uses port numbers (0-65535) to identify specific applications or services, with well-known ports like 53 (DNS), 67/68 (DHCP), and 123 (NTP).
When to Use UDP:
Choose UDP when real-time performance matters more than perfect data delivery, such as streaming media where a few dropped frames won't significantly impact user experience.