UDP·Lesson 2 of 9
Features of UDP
What Makes UDP, UDP
UDP (User Datagram Protocol) is defined by what it leaves out. It's a protocol — its job is to carry data from a program on one machine to a program on another — but it does that job with the bare minimum of machinery. A handful of features flow from that one design choice: stay simple, stay fast.
The theme behind every feature
UDP does as little as possible. Every feature below is either something it deliberately skips (setup, acknowledgements, ordering) or a direct result of skipping it (speed, a tiny header).
The Features at a Glance
Here are the traits that define UDP. We'll unpack the most important ones right after this overview.
Connectionless
No setup and no handshake. UDP sends data straight away without first agreeing on a connection with the other side.
Best-effort delivery
No guarantee data arrives, arrives in order, or arrives only once. Lost datagrams are simply lost as far as UDP is concerned.
Message-oriented
Each send is one self-contained message. UDP preserves the boundaries of each message instead of blending everything into one stream.
Tiny header
Just 8 bytes of header per datagram, versus at least 20 for TCP. Less overhead means more of each packet is your actual data.
No flow or congestion control
UDP sends as fast as the app hands it data. It never slows itself down to protect the receiver or the network.
Supports broadcast and multicast
One datagram can be aimed at every device on a network or a whole group at once — something TCP cannot do.
Connectionless
Connectionless means UDP never establishes a connection before sending. There's no opening — no exchange of setup messages to confirm both sides are ready. The sender just addresses a datagram and sends it. This saves time (nothing happens before the first byte goes out) but it also means UDP has no memory of who it's talking to — every datagram stands entirely on its own.
Best-Effort (Unreliable) Delivery
UDP hands each datagram to the network and hopes for the best. It does not number datagrams, does not wait for an acknowledgement, and does not resend anything that goes missing. So three things can happen without UDP ever noticing: a datagram can be lost, datagrams can arrive out of order, or a datagram can be duplicated. "Unreliable" is just the technical name for "makes no delivery guarantee" — it doesn't mean UDP is flaky, only that catching these problems is left to the application if it cares.
Message-Oriented
UDP is message-oriented, which means it keeps the boundaries of each message intact. If your program sends one 100-byte message and then one 50-byte message, the receiver gets them as two separate datagrams — one of 100 bytes and one of 50. Compare that with TCP, which is a byte stream: TCP treats everything you send as one continuous flow of bytes, so the receiver might read the two messages glued together or split apart, and the app has to figure out where one ends and the next begins. With UDP, one send equals one receive.
No Flow or Congestion Control
Two safety brakes that TCP has, UDP leaves out. stops a fast sender from overwhelming a slow receiver. backs off when the network in the middle is getting overloaded. UDP does neither — it simply sends at whatever rate the application asks. That keeps UDP simple and fast, but it also means a careless UDP app can flood a slow receiver or make network congestion worse, so well-behaved UDP apps pace themselves.
“"Connectionless means UDP can't have a back-and-forth conversation."”
Q:Name the key features of UDP an interviewer expects to hear.
A: Connectionless (no handshake), unreliable or best-effort (no delivery, ordering, or duplicate guarantees), message-oriented (preserves message boundaries), a tiny 8-byte header, no flow or congestion control, and support for broadcast and multicast.
Quick Revision Cheat Sheet
Connectionless: No handshake — send immediately, keep no connection state
Best-effort: No guarantee of delivery, order, or no-duplicates
Message-oriented: One send = one datagram; boundaries preserved
Header: Just 8 bytes — minimal overhead
No brakes: No flow control and no congestion control
Broadcast/multicast: Can target many receivers at once (TCP cannot)