What you’ll get
Send one short UDP datagram to three ports on the same server — open (5353), closed (5354), and blocked by
an nftables drop rule (5355) — and watch the response in tcpdump:
sudo tcpdump -nn -i eth0 'udp or icmp'
# Open port 5353 — request and reply in two packets, no handshake:
# 19:17:07.469182 IP 10.0.10.20.35591 > 10.0.10.10.5353: UDP, length 4
# 19:17:07.469300 IP 10.0.10.10.5353 > 10.0.10.20.35591: UDP, length 4
# Closed port 5354 — server kernel replies with ICMP (type 3, code 3):
# 19:17:07.469429 IP 10.0.10.20.54321 > 10.0.10.10.5354: UDP, length 4
# 19:17:07.469448 IP 10.0.10.10 > 10.0.10.20: ICMP 10.0.10.10 udp port 5354 unreachable, length 40
# Port 5355 behind an nftables drop rule — silence and timeout:
# 19:17:07.469522 IP 10.0.10.20.36620 > 10.0.10.10.5355: UDP, length 4
Diagnosing a closed UDP port comes down to that single ICMP reply line (ICMP and MTU):
UDP header: 8 bytes and why an unverified transport exists
The UDP header (RFC 768) consists of four 2-byte fields — 8 bytes compared to TCP’s 20-byte minimum
(TCP: flags and states). It carries no seq/ack numbers, handshake flags, window size, or retransmission logic. Each
sendto() call becomes a single datagram with preserved message boundaries: it arrives whole, disappears,
or arrives out of order.
17 tells the kernel to pass the payload to UDPNo kernel connection state: ss -ulnp always shows UNCONN, and ordering or retries live in the application if needed.
0 if no reply is expected)QUIC relies on UDP to traverse legacy routers and NAT, while handling delivery, streams, and encryption itself.
Skipping delivery guarantees in UDP is a deliberate trade-off for four workloads:
- Short request/response (DNS, NTP, DHCP). One packet out, one packet back. Spending three packets on a TCP handshake and four on teardown just to fetch a 60-byte answer adds latency to every page load.
- Real-time media (VoIP, video calls, online games). If a voice frame from 200 milliseconds ago goes missing, retransmitting it makes no sense — the conversation has moved on. Dropping one slice beats freezing the whole stream for stale audio.
- VPN tunnels (WireGuard, OpenVPN over UDP). Traffic inside a tunnel is mostly TCP already. Tunneling TCP inside another TCP causes both layers to retransmit and throttle simultaneously on packet loss (“TCP meltdown”). UDP forwards packets directly and lets the inner TCP handle retries.
- New transport protocols (QUIC). Rolling out a brand-new IP protocol number to replace TCP is impractical because millions of routers and corporate firewalls pass only TCP and UDP. Building the new transport on top of UDP bypasses that barrier.
Why UDP port checks mislead you
With TCP, results are clear-cut: an open port returns SYN-ACK, a closed port returns RST, and a firewall
DROP times out. With UDP, the three cases look different:
- Client✓ UDP :5353 (4 B)
- Server :5353✓ received and replied
- Client✓ received PONG
19:17:07.469182 IP 10.0.10.20.35591 > 10.0.10.10.5353: UDP, length 4 19:17:07.469300 IP 10.0.10.10.5353 > 10.0.10.20.35591: UDP, length 4
The service understood the packet and answered. Many protocols (DNS, WireGuard) stay silent on arbitrary text payloads.
Protocol check: dig @10.0.10.10 example.org or sudo wg show
- Client✓ UDP :5354
- Server kernel✕ no socket
- ICMP reply✕ udp port 5354 unreachable
- Client socket✕ Connection refused
19:17:07.469429 IP 10.0.10.20.54321 > 10.0.10.10.5354: UDP, length 4 19:17:07.469448 IP 10.0.10.10 > 10.0.10.20: ICMP 10.0.10.10 udp port 5354 unreachable, length 40
Nothing listens on the port and the firewall did not strip the ICMP error — the only case where you know for sure the UDP port is closed.
sudo ss -ulnp 'sport = :5354' on the server
- Client✓ UDP :5355
- Firewall / WireGuard— no reply
- Client✕ TimeoutError
19:17:07.469522 IP 10.0.10.20.36620 > 10.0.10.10.5355: UDP, length 4 # Silence: from outside, identical to WireGuard dropping an unauthenticated packet
A firewall DROP and an open but silent UDP service look identical to the client — nothing comes back.
sudo tcpdump -nn -i eth0 'udp port 5355' directly on the server
QUIC and HTTP/3: why transport moved onto UDP
HTTP/2 over TCP (TCP: flags and states) solved parallel downloads over one connection, yet kept three TCP limitations:
- Two sequential handshakes. First 1 RTT for TCP (
SYN/SYN-ACK), then 1–2 RTT for TLS, and only then does the first HTTP request go out. - Head-of-Line Blocking. To the kernel, TCP is one flat byte stream. If a single packet for an image drops, the kernel withholds already-received packets for adjacent scripts and stylesheets until that missing segment is retransmitted.
- IP address binding. A TCP connection is locked to its 5-tuple (
IP:port). When a phone walks off Wi-Fi onto cellular, its IP changes and every TCP connection breaks.
QUIC (RFC 9000) moves delivery control and multiplexing out of the kernel into user space over UDP :443,
removing all three bottlenecks:
| Property | TCP (+ TLS 1.3) | UDP | QUIC (basis of HTTP/3) |
|---|---|---|---|
| Handshake before data | 2 RTT (TCP + TLS) | 0 RTT (none) | 1 RTT (0 RTT on repeat visits) |
| Ordering and retries | Single kernel byte stream | None | Independent streams over UDP |
| Single packet loss | Stalls the entire HTTP/2 connection | Packet lost | Stalls only one stream |
| Network switch (Wi-Fi / LTE) | Connection drops | Stateless | Connection ID migrates without dropping |
| Header encryption | Payload only (TLS) | None | Nearly the entire transport header is encrypted |
Browsers discover HTTP/3 support through the Alt-Svc header returned on the initial 443/tcp request:
curl -sI https://cloudflare.com | grep -iE '^HTTP/|alt-svc'
# HTTP/2 301
# alt-svc: h3=":443"; ma=86400
The browser caches that hint for 24 hours (ma=86400 seconds) and attempts QUIC on 443/udp for follow-up
requests, falling back to TCP silently if UDP is blocked.
If it doesn’t work
A UDP port check via nc -zuv or a script times out, leaving it unclear whether a firewall blocks the port or the service stays silent
- Cause
- UDP has no
SYN/SYN-ACKhandshake. On a closed port the kernel returnsICMP Port Unreachable(type 3, code 3), while a firewallDROPrule — or a silent protocol like WireGuard — produces total silence. - Fix
- Test UDP with a protocol-aware query (
digfor DNS,wg showfor WireGuard) and watchtcpdump -nn 'udp or icmp'on the server to confirm packets arrive and replies leave.
HTTP/3 is enabled on the web server and the alt-svc: h3=":443" header is present, yet browsers still open the site over HTTP/2
- Cause
- The server, hosting provider, or client network firewall opens only
443/tcpand blocks443/udp. Browsers try QUIC and silently fall back to TCP. - Fix
- Add
udp dport 443 acceptinnftables/ufwand your hosting firewall, then verify on the server withsudo ss -ulnp 'sport = :443'andsudo tcpdump -nn 'udp port 443'.
A WireGuard tunnel works, then stops accepting incoming packets after a minute of idle time behind NAT
- Cause
- UDP entries in a router's
conntracktable (NAT, DNAT, and conntrack) expire quickly — around 30 seconds without traffic, compared to hours for TCP. Once evicted, the router drops incoming packets. - Fix
- Set
PersistentKeepalive = 25on the client behind NAT so it refreshes the NAT mapping every 25 seconds.
Voice calls or large UDP DNS responses drop over a VPN, even though TCP sites with MSS clamping load fine
- Cause
- UDP has no TCP
SYNheader orMSSoption, so MSS clamping rules never touch it (ICMP and MTU). Packets larger than the tunnel MTU with theDFbit set vanish when ICMP is blocked. - Fix
- Configure the right MTU on the tunnel interface (for example
1420for WireGuard) and permitICMP Fragmentation Needed/ICMPv6 Packet Too Big.
ss -tulnp shows UDP services in state UNCONN instead of LISTEN
- Cause
- UDP does not establish kernel-level connections: a socket accepts datagrams from any sender immediately after
bind(), with noLISTENqueue. - Fix
- This is the expected state for a running UDP server. Check only its bind address (
0.0.0.0:53rather than127.0.0.1:53, Ports and sockets).