Skip to content
EN
Get Started

UDP (User Datagram Protocol)

UDP (User Datagram Protocol) is a connectionless transport protocol that sends separate datagrams without delivery confirmation, ordering or retransmission.

Table of Contents (8 sections)

How UDP works

An application gives UDP a block of data. UDP adds an 8-byte header, passes the datagram to IP and sends it without first establishing a connection. The header contains source and destination ports, length and a checksum.

App → UDP source port 53000 → destination port 53 → 192.0.2.53
App ← UDP destination port 53000 ← DNS response ← 192.0.2.53

The receiving system uses the destination port to deliver the datagram to the right application. UDP preserves datagram boundaries, but it doesn’t acknowledge delivery or retransmit missing data. The checksum detects corruption. It is optional in IPv4 and required for ordinary UDP traffic over IPv6.

UDP vs TCP

UDP and TCP both carry application data over IP, but they provide different transport behavior.

Feature UDP TCP
Connection setup None Starts with a handshake
Lost data No built-in recovery Acknowledges and retransmits
Ordering Not provided Delivers an ordered byte stream
Data model Separate datagrams Continuous byte stream

UDP has less built-in overhead, but that doesn’t always make an application faster. An application may add its own reliability and congestion controls.

Common uses

  • DNS lookups: Traditional DNS commonly uses UDP for short queries and responses, switching to TCP when needed.
  • Voice, video and games: Late data may be less useful than a small amount of packet loss.
  • Network discovery: Protocols such as DHCP use UDP with broadcast traffic.
  • QUIC and HTTP/3: QUIC runs over UDP but adds reliability, encryption and congestion control itself.

Each application decides how to handle missing, duplicated or out-of-order datagrams.

UDP and proxies

A conventional HTTP proxy forwards HTTP requests or opens TCP tunnels, so it usually can’t relay arbitrary UDP traffic. SOCKS5 defines UDP relay through the UDP ASSOCIATE command, but support depends on the proxy service and client.

Check each traffic path separately. A tool may send web requests through a proxy while sending UDP-based DNS queries directly through the local network. Browsers may also send WebRTC traffic outside their configured web proxy, which can cause a WebRTC leak.

FAQ

Can UDP lose packets?

Yes. UDP doesn’t confirm delivery, retry lost datagrams or restore their order. The application must handle those tasks when needed.

Is UDP faster than TCP?

Not inherently. UDP has less built-in overhead, but application performance depends on required reliability, congestion control and network conditions.

Do proxies support UDP?

It depends on the proxy protocol and implementation. Conventional HTTP proxies generally don’t relay arbitrary UDP, while SOCKS5 can support it through UDP relay.

Related Terms

View All Terms