A video call over patchy Wi-Fi
You are on a video call, and a few packets are lost on your Wi-Fi link. The application may conceal a short audio gap, reduce video quality, recover some loss or discard late data. Those are application decisions, not guarantees supplied by UDP. TCP delivers an ordered byte stream, which can delay later bytes behind a missing earlier byte; whether that matters depends on the application and its deadline.
Connectionless, with an 8-byte header
Compare two DNS messages: a query from 192.168.1.20:53000 to 192.168.1.53:53, then a reply with those endpoints reversed. The UDP header supplies ports, a length and a checksum; it has no sequence or acknowledgement fields. If the reply is lost, a DNS client can retry after its own timeout. UDP does not automatically perform that retry.
No UDP handshake does not mean the application has no state or cannot provide reliability. QUIC, used by HTTP/3, runs over UDP and supplies its own connection, recovery and congestion-control mechanisms. Similarly, an operating system can associate a UDP socket with a peer without exchanging a TCP-style handshake.
UDP (User Datagram Protocol) is the simpler of the two main transport protocols. It is connectionless: UDP itself has no connection handshake or closing exchange. Each message, called a datagram, is sent on its own. UDP does not number datagrams, confirm them or resend them. This is called best-effort delivery.
Read each row from left to right. The ruler gives bit positions 0–31 within that row; field sizes are labelled in bits or bytes.
| Field | Job |
|---|---|
| Source port | The sending application; replies are sent back to this port |
| Destination port | The receiving application, for example 53 for DNS |
| Length | Size of the header plus data, in bytes; at least 8 |
| Checksum | Detects damaged datagrams; optional in IPv4, required in IPv6 |
UDP preserves datagram boundaries and supplies endpoint ports, length and checksum information. It does not supply TCP's delivery acknowledgements, ordering, retransmission or windows. Additional recovery and traffic control belong to the application or another protocol layered over UDP.
Device key: IP phone A, IP phone B (desk phone) · R1, R2 (router)
Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type. Blocked: forwarding prevented by a port or policy. Down: failed link. Read the step for the cause.
Reading the addresses
IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.
An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.
- IP phone A: IP 10.10.1.21
- IP phone B: IP 10.20.1.35
- 1. Every 20 ms phone A sends a small UDP datagram containing a slice of sound.
- 2. One is lost on the WAN. UDP does not notice that it is missing, and nothing asks for it again.
- 3. The next one plays. Phone B hides the 20 ms gap and keeps playing. A late resend would be worse than a tiny gap.
Voice, DNS, DHCP and other UDP users
| Application | Why UDP suits it |
|---|---|
| Voice and video calls | Late data is useless; skipping is better than waiting |
| Online games | Only the newest position matters |
| DNS | One small question, one small answer; the client simply asks again if it is lost |
| DHCP | The client has no IP address yet and must send broadcasts |
| NTP, SNMP, syslog | Small, regular messages; one lost message does little harm |
| Streaming to many receivers | Multicast needs UDP, because TCP cannot hold a handshake with every receiver |
Some applications want reliability but not TCP's exact rules, so they build their own on top of UDP. QUIC, used by HTTP/3 on UDP port 443, is the best-known example: it provides its own encryption, retransmission and ordering.
What UDP gains by doing less
Less work means less delay. There is no handshake, so the first datagram already carries real data. There is no waiting for ACKs, and no stall when one datagram is lost. The small header also saves bandwidth: a voice packet may carry only 20 to 160 bytes of sound, so saving 12 bytes on every packet adds up. The cost is that the application must deal with loss, duplicates and out-of-order data itself.
UDP counters on a Cisco router
show ip traffic includes UDP counters for traffic sent to and from the router itself. The output below is based on Cisco documentation, not captured from a lab device, and shows only the UDP part.
R1#show ip traffic | section UDP UDP statistics: Rcvd: 4093 total, 0 checksum errors, 312 no port, 0 finput Sent: 2240 total, 0 forwarded broadcasts
Because there is no handshake, a blocked UDP service is harder to diagnose than a blocked TCP one. A firewall that drops the traffic and a server that simply does not answer look the same from the client: silence. A packet capture on each side is often the quickest way to tell them apart.
Test yourself on UDP
You compare a DNS query in a packet capture with a TCP segment. How big is the UDP header in the DNS query?
A UDP datagram carrying part of a voice call is lost on a WAN link. What does UDP do?
You are writing a firewall rule that allows only UDP traffic to a web server. Which of these services runs over UDP?
Technical references
RFC 768: UDP fields; RFC 8085: application responsibilities over UDP; RFC 9000: QUIC over UDP.