The unit of communication
UDP carries datagrams between applications. Unlike a TCP byte stream, its communication unit has a message boundary. The socket API still matters: a receive buffer that is too small may truncate a datagram instead of supplying the remainder in a later read.
The UDP header contains source and destination ports, a length and a checksum. IP addresses identify network endpoints, while ports select communication endpoints within a host. Keeping these roles separate helps when checking routing, firewall rules and application bindings.
Loss and ordering in an example
Suppose a game sends positions numbered 100, 101 and 102. Position 101 can be lost, and 102 can arrive before an older update. If current position matters more than stale history, the application can attach sequence numbers and discard old updates rather than retransmitting every message.
A file transfer has a different requirement: every byte must be reconstructed. That application needs missing-data detection, recovery and ordering, or a higher-level protocol providing them. Choosing UDP selects where such guarantees are implemented; it does not provide them automatically.
Design message size and pacing
Oversized datagrams interact with path MTU and IP fragmentation. If one datagram is split into several fragments, losing one fragment can prevent reconstruction of the complete datagram. A message size that works on one local network may therefore fail on another path.
UDP itself does not supply TCP-style congestion control for a connection. Applications or their higher-level protocol must pace traffic and react to capacity, loss and receiver limitations. Removing transport machinery does not remove the shared-network resource constraints that machinery addresses.
Higher-level guarantees and limits
A protocol such as QUIC adds encryption, stream handling and recovery above UDP. Consequently, saying that a system uses UDP does not fully describe its end-to-end guarantees. Inspect both the datagram layer and the protocol built on top of it.
A checksum helps detect accidental corruption; it does not authenticate a peer or replace cryptographic integrity protection. Successful local transmission is also not delivery confirmation. An application needing acknowledgments, authorization or authenticated data must explicitly supply those properties.