UDP vs TCP - Two Ways Computers Send Data

Fast and loose vs slow and reliable

The Two Delivery Methods

When computers send data over a network, they use one of two main methods (called protocols). Think of them as two different postal services:

UDP - The Postcard

UDP (User Datagram Protocol) is like dropping a postcard in a letterbox. You send it and move on. You don't know if it arrived. There's no tracking, no confirmation.

Characteristics:

Used for:

TCP - The Registered Mail

TCP (Transmission Control Protocol) is like sending registered mail. Before sending, both sides agree to communicate (a "handshake"). Every packet is tracked, confirmed received, and resent if lost.

Characteristics:

Used for:

Why DHCP Uses UDP

This is an interesting case. TCP requires both sides to establish a connection first (a "three-way handshake"). But when your device first joins a network, it doesn't have an IP address yet - so it can't establish a TCP connection with anyone.

UDP doesn't need a connection. Your device can just broadcastSend a message to every device on the network at once. a message saying "I need an IP address!" without needing one first. It's a chicken-and-egg problem that UDP solves.

Side by Side

Feature      UDP      TCP
Speed       Fast      Slower
Reliability     No guarantee   Guaranteed
Order       No       Yes
Connection     Not needed    Required
Best for      Speed      Accuracy
Simple rule of thumb: If it's okay to lose a little data (video, gaming, voice) → UDP. If every byte matters (web pages, files, banking) → TCP.