UDP (User Datagram Protocol) guarantees nothing in terms of delivery. It is a connectionless and unreliable protocol.
UDP's Unreliability Explained
Unlike TCP, UDP doesn't establish a connection before sending data. It simply sends packets (called datagrams) to the destination without any guarantee that they will arrive, arrive in order, or arrive without errors. There is no acknowledgment mechanism, error correction, or retransmission.
Why Use UDP Then?
While its unreliability might seem like a significant drawback, UDP has its uses. Its simplicity and lack of overhead make it suitable for applications where:
- Speed is critical: UDP's connectionless nature means it doesn't spend time establishing or maintaining connections, making it faster than TCP.
- Occasional packet loss is acceptable: Some applications, such as streaming video or online gaming, can tolerate some packet loss without significant impact on the user experience.
- Broadcast or multicast is required: UDP easily supports sending data to multiple recipients simultaneously, which is difficult to achieve with TCP.
UDP Characteristics Summarized
Feature | UDP |
---|---|
Connection | Connectionless |
Reliability | Unreliable |
Error Checking | Limited checksum only |
Ordering | No guaranteed order |
Retransmission | No retransmission |
Use Cases | Streaming, gaming, DNS |
In essence, UDP offers speed and efficiency at the cost of guaranteed delivery. Applications using UDP must implement their own mechanisms for reliability if it is required.