Week 8 · Lesson 7

UDP — User Datagram Protocol

For all its reliability, TCP is heavyweight: a handshake, timers, and a twenty-byte header. When an application would rather have speed and low overhead than guaranteed delivery, it reaches for UDP. This lesson covers the eight-byte header, the best-effort model, and exactly when each transport protocol is the right tool.

CCNA 200-301 Domain 1.4 Transport Verified 2026-10-11
Part 1

Connectionless by design

UDP is defined in RFC 768, and it fits on a single page because it does almost nothing. It takes the application’s data, adds ports so the receiver knows which service and socket the data belongs to, adds a length and a checksum, and hands the result to IP. There is no conversation, no state, and no second-guessing of the network.

Definition — UDP UDP is a connectionless, best-effort transport protocol. It sends each datagram independently, with no handshake, no sequence numbers, no acknowledgments, and no retransmission. Delivery, ordering, and duplicate suppression are not guaranteed.
Part 2

The UDP header (8 bytes)

The whole header is four 16-bit fields — two words — for a total of 8 bytes. Compare that with the TCP base header’s 20 bytes and the difference in philosophy is obvious.

                         UDP Header (RFC 768)

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Source Port          |       Destination Port        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Length             |           Checksum            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             Data ...                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 Header total = 2 + 2 + 2 + 2 = 8 bytes.  Length covers header + data.
Exam tip The UDP header is 8 bytes, fixed. There is no Data Offset field because there are no options to account for. TCP is 20 bytes minimum and variable; UDP never changes size.
Length calculator · move the slider

Part 3

Field-by-field reference

Select any field in the explorer below to see its width and its job.

UDP header explorer · select a field
Two 32-bit words · four 16-bit fields

Source Port

FieldBitsBytesPurpose
Source Port162Identifies the sending application or socket. Optional in one direction; if unused it is set to 0.
Destination Port162Identifies the service on the receiver (e.g. 53 for DNS).
Length162The length of the entire datagram in bytes: header + data. Minimum value is 8.
Checksum162Error check over a pseudo-header, the UDP header, and the data. Optional in IPv4; mandatory in IPv6.

Notice the Length field counts the header too. A datagram carrying 100 bytes of payload has a Length of 108 (100 + 8). Because the field is 16 bits, the theoretical maximum datagram length is 65,535 bytes, although the practical size is dictated by the IP layer and the link MTU. The smallest possible datagram is the bare header: Length = 8, zero data.

Note — no sequence and no ACK There is no sequence number and no acknowledgment field in the UDP header. That absence is the point: UDP does not track a byte stream, so there is nothing to order and nothing to confirm.
Part 4

Checksum and error handling

UDP does include a checksum, but its error handling is blunt. The receiver computes the checksum and compares it with the field:

If the application cares about the loss, the application must detect it and retry — for example, DNS resends a query after a timeout, and a VoIP codec conceals a missing packet. In IPv4 the checksum is optional: a value of zero means “not computed.” In IPv6 there is no IP header checksum, so the UDP checksum is mandatory.

Why drop rather than retry? Best-effort is a deliberate trade. Retrying costs time and state, which is exactly what real-time applications cannot afford. A late voice packet is worse than a lost one, so dropping is the right answer for UDP’s use cases.
What happens to the datagram? · select the outcome

Part 5

When UDP is the right choice

UDP wins whenever the conversation is short (a single request and reply), bandwidth-efficient, or time-sensitive (a retransmission would arrive too late anyway). Select a service to see why it fits.

Pick the transport · select a service

ServicePort(s)Why UDP fits
DNS53One tiny query, one tiny reply; the app resends if there is no answer.
DHCP / DHCPv667 (server), 68 (client)Broadcast discovery before the client has an address; no connection can be set up yet.
TFTP69Trivial file transfer where the application implements its own light acknowledgment.
SNMP161 (agent), 162 (traps)Management polling is lightweight and periodic.
NTP123Time sync tolerates loss and prefers a fresh sample over an old retransmission.
syslog514Log messages are sent and forgotten.
VoIP / RTPRTP uses a dynamic port (commonly 16384–32767)Real-time audio; a late packet is useless, so retransmission is pointless.
Streaming media, online gamesVariesContinuous real-time flow where an occasional glitch beats added delay.
Exam tip — the port-and-protocol pairs Learn these: DNS 53, DHCP 67/68, TFTP 69, SNMP 161/162, NTP 123. DNS also uses TCP (for large answers and zone transfers on port 53), but the everyday query is UDP. When an exam question pairs a service with “UDP port,” these are the answers.
Part 6

TCP vs UDP

TCP and UDP are two answers to the same question: how should applications share the network? TCP optimises for correctness; UDP optimises for timeliness and simplicity.

PropertyTCPUDP
ConnectionConnection-oriented (3-way handshake)Connectionless (no handshake)
ReliabilityReliable — acknowledgments and retransmissionBest-effort — no retransmission
OrderingIn-order delivery via sequence numbersNo ordering; datagrams may arrive out of order
Flow controlYes (window size)No
Congestion controlYesNo
Header size20 bytes base (up to 60)8 bytes
Duplicate detectionYesNo
Speed / overheadSlower setup, higher overheadFaster, minimal overhead
Typical usesWeb, email, file transfer, SSH, databaseDNS, DHCP, TFTP, SNMP, VoIP, streaming, gaming
One-line memory hook TCP is a registered parcel: tracked, signed for, resent if lost. UDP is a postcard: cheap, fast, and no one tells you whether it arrived.

Handshake vs blind send

The figure contrasts the two transports side by side. On the left, TCP spends three messages agreeing on the connection before a single byte of data moves. On the right, UDP sends its data immediately, with no preamble and no acknowledgment — it does not even know whether a listener exists.

TCP: three-way handshake Client Server 1. SYN 2. SYN-ACK 3. ACK data flows only now connection state kept at both ends UDP: blind send Client Server data (sent at once) more data reply appears, out of order is fine no ACK, no retransmission, no state kept lost datagrams simply disappear

Common pitfalls

Key terms

TermMeaning
UDPUser Datagram Protocol; connectionless, best-effort transport defined in RFC 768.
DatagramA UDP data unit (header + data); the UDP equivalent of a TCP segment.
ConnectionlessNo handshake or connection state; every datagram is independent.
Best-effortNo guarantee of delivery, ordering, or duplicate suppression.
Length field16-bit UDP field giving header + data size; minimum 8.
RTPReal-time Transport Protocol; carries voice/video over UDP, usually on a dynamic port.
Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. Postel, J. RFC 768: User Datagram Protocol (1980) — the entire specification, including the header format. rfc-editor.org/rfc/rfc768.
  2. Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989), Section 4.1.3 (UDP requirements, including the checksum). rfc-editor.org/rfc/rfc1122.
  3. Deering, S. & Hinden, R. RFC 8200: Internet Protocol, Version 6 (IPv6) Specification (2017) — the 40-byte fixed header and mandatory UDP checksum context. rfc-editor.org/rfc/rfc8200.
  4. IANA. Service Name and Transport Protocol Port Number Registry. iana.org.
  5. Cisco. CCNA (200-301) Exam Topics, TCP/IP transport. cisco.com.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.