All guides
Term

UDP

A connectionless transport layer protocol that transmits data without handshakes or delivery guarantees, minimizing latency.

UDP (User Datagram Protocol) is a connectionless transport layer protocol that transmits data without handshakes or delivery guarantees, minimizing latency. Unlike TCP, it does not track connection states, manage packet sequencing, or acknowledge receipt of data. Instead, information is sent as independent datagrams that may arrive out of order or be dropped entirely without triggering automatic retransmissions.

How it works

UDP strips away session management to pass data directly from the application layer to the IP layer with minimal overhead. Each packet carries a fixed 8-byte header containing only four fields: source port, destination port, packet length, and an optional checksum for basic error detection.

Because the protocol lacks built-in flow control and congestion management, the operating system does not throttle outgoing traffic or wait for acknowledgments before sending the next packet. Applications can transmit datagrams at the full rate supported by the network interface, making UDP ideal for real-time media like VoIP, live video streaming, and multiplayer gaming, as well as lightweight infrastructure services like DNS, DHCP, and SNMP. Modern protocols like QUIC also use UDP as a foundation to implement custom congestion control and eliminate head-of-line blocking in HTTP/3.

Example

You can test UDP connectivity and inspect packet behavior between two servers using netcat. On the receiving server, start a UDP listener on port 5005:

nc -u -l -p 5005

On the sending machine, transmit a datagram directly to the target IP address without establishing a session:

echo "healthcheck" | nc -u -w 1 203.0.113.10 5005

If a firewall drops the packet or the listening service is offline, the sender receives no protocol-level error unless the remote host explicitly returns an ICMP Port Unreachable message.

What matters when choosing a server or hosting

  • DDoS protection and rate limiting: Because UDP does not verify source IP addresses via a handshake, it is frequently exploited for reflection and amplification attacks. Ensure your provider offers volumetric DDoS mitigation capable of scrubbing malicious UDP floods without dropping legitimate traffic.
  • Network path and routing quality: Since UDP does not retransmit lost packets, physical network stability matters more than raw bandwidth. Look for hosting providers with low-jitter peering, redundant transit routes, and minimal packet loss.
  • Firewall and NAT traversal support: Cloud security groups and stateless firewalls must explicitly permit inbound and outbound UDP traffic on your required ports. If your workloads sit behind NAT, verify that connection tracking timeouts are long enough to keep UDP state mappings open.
  • CPU packet-per-second throughput: High-frequency UDP workloads generate heavy interrupt loads. Choose instances with modern network interface cards that support kernel bypass or multi-queue packet processing.

Common mistakes

  • Assuming delivery or ordering: Developers sometimes rely on UDP for small state updates without building sequence numbers or retry logic into the application layer, leading to corrupted state during minor network congestion.
  • Overlooking MTU fragmentation: Sending UDP datagrams larger than the network path's Maximum Transmission Unit (typically 1500 bytes) forces IP fragmentation. If a single fragment is dropped, the entire datagram is discarded.
  • Using standard HTTP load balancers: Layer 7 reverse proxies cannot route raw UDP traffic. Workloads such as game servers or custom telemetry collectors require a Layer 4 network load balancer that supports UDP forwarding.

FAQ

When should I choose UDP over TCP?

Use UDP when low latency matters more than guaranteed delivery, such as in voice calls, live broadcasts, and fast-paced games where waiting for a retransmitted packet makes the data obsolete. Use TCP when every byte must arrive intact and in order, such as for file transfers, web pages, and database queries.

Is UDP inherently insecure?

UDP provides no built-in encryption or authentication, meaning payloads travel in plaintext unless secured at a higher layer. To protect UDP traffic, applications typically wrap datagrams in DTLS (Datagram Transport Layer Security) or use encrypted tunnels like WireGuard.

Why do firewalls often block UDP by default?

Because UDP is stateless, firewalls cannot easily distinguish legitimate reply packets from unsolicited traffic without maintaining temporary state tables. Strict firewall policies block unused UDP ports to reduce attack surface and prevent amplification abuse.

All glossary terms

Glossary

Related terms

Full glossary

New guides every week.

A digest of the best pieces on servers, VPN and self-hosted software. No ads, no spam.

1 email a weekOne-click unsubscribeRU · EN
Only slipjar.app articles, nothing else.