Glossary

UDP (User Datagram Protocol)

UDP sends independent messages called datagrams from one port to another with no handshake, no delivery guarantee and no ordering, leaving those choices to the application.

What does UDP leave out compared with TCP?

Almost everything except addressing and a checksum. The header is eight bytes: source port, destination port, length and checksum. There is no connection setup, so the first datagram can carry useful data immediately. There are no acknowledgments, so the sender never learns whether a message arrived. There is no reordering, no retransmission and no congestion control in the protocol itself. That sounds like a list of weaknesses, but for many jobs it is exactly what you want: a late voice sample or game position is useless, and resending it would only delay the next one. TCP explains what TCP does instead.

Which services run on UDP?

ServicePortWhy UDP fits
DNS queries53One small question, one small answer, no handshake overhead
NTP time sync123Tiny packets where timing accuracy matters
WireGuard51820 by defaultCarries tunneled packets that have their own reliability
QUIC and HTTP/3443Builds its own reliable streams in user space
Game serversVaries, often 27015 or 7777Frequent state updates where the newest one matters most
VoIP media (RTP)High ranges such as 10000 to 20000Real-time audio that cannot wait for retransmits
Syslog, SNMP, DHCP514, 161, 67/68Simple request or fire-and-forget messages

How do applications cope with loss?

Each protocol picks its own strategy. DNS clients just retry after a timeout. Games send the full state often enough that a missing update is replaced a few milliseconds later, and they interpolate between positions. Voice codecs hide small gaps and use jitter buffers. QUIC rebuilds most of TCP inside the application: acknowledgments, retransmission and congestion control per stream, so one lost packet only stalls the stream it belongs to. The common thread is that the application, not the kernel, decides what reliability means.

Why do UDP servers need larger buffers?

With TCP, a slow reader makes the sender wait. With UDP, datagrams that arrive while the receive buffer is full are simply dropped. A busy game server, DNS resolver or log collector can lose packets on a burst even though the link and CPU are fine. Check for this and raise the limits:

nstat -az | grep -E 'UdpRcvbufErrors|UdpInErrors|UdpSndbufErrors'
sysctl -w net.core.rmem_max=33554432
sysctl -w net.core.rmem_default=8388608
echo 'net.core.rmem_max = 33554432' > /etc/sysctl.d/62-udp-buffers.conf

A rising UdpRcvbufErrors counter means datagrams were thrown away for lack of buffer space. Many servers also set their own socket buffer size with SO_RCVBUF, which the max value above caps.

How do I test whether a UDP port is reachable?

There is no handshake to observe, so testing is less direct than with TCP. Listen on the server and send from outside:

# on the server
nc -u -l 40100
# from your workstation
echo probe-from-laptop | nc -u -w2 203.0.113.95 40100
# list UDP listeners on the server
ss -ulnp

If the text appears on the server, the path and firewall are open. For real services, use a protocol-aware client: dig @203.0.113.95 example.org for DNS, the game's own query tool, or wg show handshake times for WireGuard. Note that nc flags differ slightly between the OpenBSD and traditional versions installed on different distributions.

How does UDP fragmentation cause trouble?

A datagram larger than the path MTU must be split into IP fragments, and if any one fragment is lost, the whole datagram is gone. Many firewalls and middleboxes also drop fragments outright. That is why DNS limits answers over UDP to around 1232 bytes these days and switches to TCP for anything bigger, and why QUIC and WireGuard keep their packets under the MTU on purpose. If you write your own UDP protocol, keep messages below roughly 1200 bytes of payload and split larger data in the application rather than relying on IP fragmentation.

What should the firewall do with UDP?

Allow only the ports your services use, and let connection tracking handle replies to outbound queries such as DNS lookups. Stateful firewalls treat a UDP exchange as a flow with a timeout, so answers to your own queries pass through without extra rules. Avoid opening wide ranges unless the software really needs them; VoIP media is the usual exception, and in that case limit the range in the PBX config to match the firewall. Open UDP services such as public DNS resolvers or NTP servers that answer anyone can be abused for amplification attacks, so restrict them to your own clients. Firewall covers the general rules.

Which machines suit UDP-heavy work?

Game and voice servers want high clock speed for their main loop and a steady network. The S11 with the Intel Core i9-14900K is a strong game host, and the S2 at $58.39 a month handles a large PBX. Game servers and VoIP and PBX servers size those jobs in detail.

Machines for Game, Voice and DNS Servers

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
S2Intel Xeon E-2356G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$58.39$58.39 (1 month)
S6Intel Xeon E-2288G8 / 1664 GB DDR42x 1 TB NVMe2x 10 Gbps$89.92$89.92 (1 month)
S11Intel Core i9-14900K24 / 32128 GB DDR52x 2 TB NVMe2x 10 Gbps$149.39$149.39 (1 month)
S14AMD EPYC 4565P16 / 32192 GB DDR52x 4 TB NVMe2x 25 Gbps$317.89$317.89 (1 month)

Keep Reading

TCP

The protocol behind reliable connections on the internet: handshakes, sequence numbers, windows and congestion control, with tuning notes for fast links.

Open

Game servers

High-clock cores for tick-heavy game servers, DDoS filtering at the edge and a city near your players.

Open

VoIP and PBX servers

Asterisk or FreeSWITCH on a public IPv4 with no NAT in the way, sized by concurrent calls and codecs.

Open

Firewall

What a firewall does, packet filters versus stateful and application firewalls, and the Linux tools that set the rules on a dedicated machine.

Open

FAQ

Quick Answers

It has no handshake and no waiting for acknowledgments, so it starts sooner and adds less delay, but it does not recover lost data by itself.

Most queries and answers fit in one small packet, so a handshake would double the time. DNS falls back to TCP for large answers.

Watch the UdpRcvbufErrors counter with nstat. If it grows, raise the receive buffer limits or the application socket buffer.

No, telnet uses TCP. Use nc with the -u flag or a client for the specific protocol.

Yes. HTTP/3 runs over QUIC, which uses UDP port 443 and implements reliability in the application.