AlgoMaster Logo

UDP Internals

Medium Priority21 min readUpdated August 14, 2026

A UDP sender can report that it successfully sent 1200 bytes even when the receiving application never sees them.

The apparent contradiction comes from what a UDP send means. The operating system accepted one application message, wrapped it in a UDP header, and handed the resulting datagram to IP. The send operation does not wait for an acknowledgment, reserve receive-buffer space on the destination, or confirm that a process is listening there.

UDP has a small 8-byte header, but the complete data path still involves several decisions. The sending kernel chooses addresses and ports, validates the message size, calculates a checksum, and queues a packet. The receiving host validates the datagram, selects a socket, and either queues the complete message or discards it.

Understanding those decisions explains several common symptoms:

  • small messages work while large ones disappear,
  • packet captures report invalid checksums on the sending host,
  • one busy receiver loses datagrams while the network remains healthy,
  • a successful sendto() is followed by an asynchronous error, and
  • an application receives a shorter message than the sender transmitted.

Premium Content

Subscribe to unlock full access to this content and more premium articles.