What is UDP (User Datagram Protocol)?
Posted: (EET/GMT+2)
If you need to send data quickly without establishing a connection, UDP (User Datagram Protocol) provides a lightweight transport protocol on top of IP (Internet Protocol).
Unlike TCP (Transmission Control Protocol), UDP does not establish a connection before transmitting data.
A typical UDP communication looks like this:
Application > UDP Datagram > IP Network > Receiving Application
UDP does not guarantee that packets arrive, arrive in order, or are delivered only once. Because there is no connection setup or acknowledgement, UDP has less overhead than TCP.
Common protocols using UDP include:
- DNS
- SNMP
- DHCP
- Streaming audio/video.
Applications that require reliability must detect lost packets and perform re-transmission if needed.
When programming with WinSock APIs, UDP communication is typically performed using datagram sockets (SOCK_DGRAM).
UDP can be useful when applications need low latency and do not need guaranteed packet delivery. For details, see RFC 768 by J. Postel (!).
Hope this helps!