← Back to Glossary

What is User Datagram Protocol (UDP)?

by Iwan Price-Evans on Web technology • May 26, 2022

User Datagram Protocol (UDP) is an alternative to the more common Transport Control Protocol (TCP). The primary reason for its use is that it's faster than TCP.

UDP is one of the two network protocols that transmit nearly all network traffic on the internet. UDP is one of the three protocols that make up the Internet protocol suite. User Datagram Protocol (UDP), Transport Control Protocol (TCP), and Internet Protocol (IP) are grouped in this suite which is commonly known as TCP/IP.

TCP/IP (Internet protocol suite) provides end-to-end communication over the internet and defines how data should be formatted, transmitted, and received. UDP is part of the Transport Layer of the TCP/IP suite and also forms part of the Transport Layer of the Open System Interconnection (OSI) model.

What Is The Difference Between UDP And TCP?

The UDP protocol enables computer applications to send messages, referred to as datagrams, to other systems on an IP (Internet Protocol) network. UDP is a minimal, connectionless protocol and doesn't require any handshake communication before setting up communication channels or data routes.

UDP prioritizes speed over reliability, whereas TCP is connection-oriented, meaning that it prioritizes connection integrity to ensure reliability. UDP does, however, check for data integrity and port numbers to perform functions at the source and destination of the message (datagram).

UDP is suitable for high-speed, minimal communication such as video streaming or gaming. Connection integrity is not required by UDP, and because it doesn't spend time establishing connections, it transfers data at faster speeds than TCP. Because it doesn't firmly establish a connection before data transfer, data packets can get lost, at which point there's no process to check if the message was delivered.

All of the major operating system vendors implement support for UDP.

How Does UDP Work?

UDP is a minimal protocol and so data transmission follows a simple process compared to other protocols. It will simply identify the destination computer and send the datagrams (data packets) to it. It doesn't specify in which order the packets arrive or check to see if they arrived at all.

UDP does check the data integrity and port numbers to help the sending and receiving systems determine their roles. Faulty UDP packets can be detected when using an optional checksum, which is mandatory when used in combination with IPv6.

UDP is suitable for applications that don't rely on guaranteed delivery. If you use video streaming services, you'll have noticed that they can often be glitchy or have missing sections of video. This is because the UDP protocol transferring the data has no controlling mechanism for ensuring the data arrives in the correct order. However, because a video streaming application may not need to check that the data arrives intact, it can transfer the data faster via UDP.

How Secure Is UDP?

UDP can cause data packets to get lost in transit. Unlike TCP, which ensures the integrity of the communication between the sender and recipient, UDP does not. This means there is no protection against the data being accessed or manipulated by a malicious third party. It also creates an opportunity for a malicious actor to execute a distributed denial-of-service (DDoS) attack.