Skip to content

UDP

User Datagram Protocol

Medium — good to knowNetworking

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."

Made with passive-aggressive love by manoga.digital. Powered by Claude.