What is User Datagram Protocol (UDP)?
What is User Datagram Protocol (UDP)?
User Datagram Protocol (UDP) is a communication protocol, or set of rules, for connectionless communication over the internet. In network communication, a connection is established when two devices authenticate each other before exchanging data. However, UDP allows one device to send data to another without any restrictions or preconditions. It is ideal for low-latency workloads like online gaming, real-time streaming, and IoT sensor data. While data transfer is quick, communication is unreliable and prone to security risks.
What are the benefits of UDP?
User Datagram Protocol delivers several benefits for users, including the following:
Low communication overhead
UDP uses a minimal packet structure—this eliminates the need for session establishment and reduces the amount of data that needs to be sent. It also does not establish a connection when it receives UDP user requests. There is no need for the three-way handshake (requiring both the client and server to exchange synchronization and acknowledgment packets before data communication). Hence, UDP packets are smaller than those sent using other types of communication protocols.
High speed
UDP does not wait for acknowledgment of data before sending the next packet. It also does not use the same type of flow control, error correction, and reliability features found in other protocols like TCP. This lack of protocol overhead allows for faster data transmission, as less time is spent on data processing and management.
Efficient broadcasting
UDP is well suited for broadcasts because it is connectionless. Users can send single messages for all intended recipients to receive simultaneously. Broadcast is fast, as no connections require establishing between sender and receivers. UDP can broadcast to hundreds of receivers at once.
What are the use cases for UDP?
There are several applications that are well suited to UDP. These include:
Streaming and video
UDP is suitable for streaming and video because it is a connectionless protocol that doesn’t require the overhead of other protocols, such as TCP. This makes it ideal for applications that need to send and receive large amounts of data quickly, such as streaming video and audio, VoIP, and video conferencing.

DNS lookups
UDP enables DNS queries to be sent quickly, without the need for handshaking. UDP is a lightweight, faster, and more efficient protocol than TCP protocol for DNS lookups.
Network time protocol (NTP) synchronization
UDP is well suited for NTP synchronization as it facilitates quick transmission of time-sensitive data between two hosts. In addition, UDP does not require the overhead of establishing a connection, and allows for fast and reliable transmission of time-sensitive data with minimal latency.
How does UDP work?
Network communication works by sending data in the form of packets. The actual message content is wrapped with a header to give additional information to the receiver. In UDP, the data packets are also called UDP datagrams. Each UDP datagram consists of an 8-byte header followed by the data.
UDP header
The datagram header includes information about:
-
Source and destination address
-
Protocol name
-
Data length
-
Optional checksum
The header is checked when the destination receives a datagram to determine the source and destination address. The protocol field is then checked to ensure that the correct data type has been sent. Finally, the checksum is used to verify that the data has not been corrupted and is complete. If data is corrupted or incomplete, the datagram is discarded, and the receiver notifies the sender. In this instance, the sender simply resends the data. The process repeats until the receiver gets the entire message.
What is the difference between UDP and TCP?
Transmission Control Protocol (TCP) and UDP are two of the most commonly used protocols in computer networking for sending data over the internet, but they work differently. The two protocols are suited to different user requests. Key differences are explained below.
Port numbers
UDP port numbers are typically in the range of 0 to 1023. The most common UDP destination port numbers are 21 (FTP), 23 (Telnet), 25 (SMTP), 80 (HTTP), 110 (POP3), and 520 (Routing Information Protocol). TCP port numbers range from 0 to 65535, and commonly include 21 (FTP), 25 (SMTP), 53 (DNS), 80 (HTTP), and 443 (HTTPS).
Data packet transmission
With UDP, data packets are sent independently, without any knowledge of the state of the network or other packets being sent. TCP is a connection-oriented protocol, which means packets of data are sent in a specific order. The sender keeps track of the packets as they are sent and received.
Reliability
With UDP, there is no guarantee that the packets will arrive in the same order as they were sent. This makes UDP fast and efficient, but it also has the potential to be unreliable. TCP is more reliable than UDP, as it is guaranteed that the packets will arrive in chronological order.
Speed
TCP communication is slower than UDP as it sends several additional data packets to establish and monitor the connection. TCP sacrifices speed for greater security and reliability.
The table below summarizes the key differences between the two protocols:
| UDP | TCP |
|---|---|
| Can be unsecure | Secure |
| Connectionless | Connection-oriented |
| No guarantee of data delivery | Reliable delivery |
| Small header size (8 bytes) | Large header size (20 bytes) |
| Basic error detection and correction | Advanced error detection and correction |
| No flow control | Flow control |
| No handshake mechanism | Three-way handshake |
| No packet reorder | Packet reorder |
| No sender acknowledgement | Sender acknowledgement needed |
What are the limitations of UDP?
While UDP has its advantages, there are some things to be wary of depending on your use case. We go through some of the limitations of UDP below.
Unreliable
UDP is commonly considered an unreliable form of communication protocol. UDP does not provide reliability or error-checking mechanisms. This means data sent via UDP may not reach its destination, or may be corrupted or lost in transit. There is also no guarantee that packets will be delivered in the same order they were sent. A further limitation of UDP is that it does not acknowledge transmitted data, or alert senders if there is missing data, data loss, or lost packets.
Prone to DDoS attacks
UDP is prone to DDoS attacks because it does not provide any built-in mechanisms for verifying the source of data packets. This vulnerability means that users can spoof the source IP address of UDP packets, making it appear as though it has come from a legitimate source. It increases the risk of large-scale network flooding with unsafe traffic, causing performance issues or even a complete denial of service.
How can AWS support your UDP requirements?
AWS has several networking and content delivery services that support UDP protocol. For example:
-
Elastic Load Balancing is ideal for load-balancing TCP and UDP traffic. It can handle millions of requests per second while maintaining ultra-low latencies.
-
AWS Shield maximizes application availability and responsiveness with managed DDoS protection. It automatically detects and mitigates DDoS events, and integrates with AWS WAF to enable customizable application protection.
Make your UDP protocol more secure today with a free AWS trial!
Browse all cloud computing concepts
Browse all cloud computing concepts content here:
Did you find what you were looking for today?
Let us know so we can improve the quality of the content on our pages