UDP
User Datagram Protocol
ELI5 — The Vibe Check
UDP is like shouting information across a room — fast but no guarantee anyone heard you. There's no handshake, no confirmation. Data just flies out and hopefully arrives. Great for video calls and games where speed matters more than perfection.
Real Talk
UDP is a connectionless transport-layer protocol that sends datagrams without establishing a connection or guaranteeing delivery, ordering, or error correction. It has very low overhead, making it ideal for real-time applications like DNS, VoIP, and gaming.
Show Me The Code
// Node.js UDP server
const dgram = require('dgram');
const server = dgram.createSocket('udp4');
server.on('message', (msg, rinfo) => {
console.log(`Got: ${msg} from ${rinfo.address}:${rinfo.port}`);
});
server.bind(41234);
When You'll Hear This
"DNS queries use UDP." / "We use UDP for the game's position updates because losing a frame doesn't matter."
Related Terms
IP (Internet Protocol)
IP is the postal system of the internet. Every device gets an address (an IP address) and all data gets wrapped in envelopes called packets.
Latency
Latency is the delay before data starts moving — the time it takes for a request to go from your device to the server and back.
Packet
A packet is a small chunk of data with an envelope around it.
QUIC (Quick UDP Internet Connections)
QUIC is Google's invention that takes the speed of UDP and adds the reliability of TCP, all while encrypting everything.
TCP (Transmission Control Protocol)
TCP is like sending a package with delivery confirmation.