Communication Networks · Visualized

DHCP

Addressing & Names

How devices get numbers, find each other on the LAN, and turn human-readable names into addresses.

7 interactive subtopics — each one animated, step-through and explained.

DHCP

Addressing & Names

DHCP (Dynamic Host Configuration Protocol) hands out network configuration automatically: IP address, subnet mask, default gateway and DNS servers, all with a lease time. A newcomer broadcasts a DORA exchange — Discover, Offer, Request, Acknowledge — and is online before you finish reading the Wi-Fi icon. Without it, every device would need manual static configuration.

How DHCP Works

  1. D-Discover: the new host broadcasts a UDP discover packet — it has no address yet, so it uses 0.0.0.0 → 255.255.255.255.
  2. O-Offer: one or more DHCP servers reply with an offered lease (IP + mask + gateway + DNS + lease time).
  3. R-Request: the host broadcasts its choice — every server sees it, so unchosen offers are released.
  4. A-Ack: the chosen server confirms the lease; the host does a gratuitous ARP to verify the address is free.
  5. At 50% of the lease time the host tries to renew unicast; on failure it rebroadcasts near expiry.

DHCP Worked Example

Try it: Plug in a laptop and watch the DORA broadcast exchange.

Discover floods the LAN; two servers offer .100 and .200; the laptop requests .100; that server ACKs a 24-hour lease and records the reservation. Half a day later the laptop quietly renews with the same server — no user-visible event.

New laptop0.0.0.0 :68DHCP server Aoffers .100DHCP server Boffers .200LAN broadcast: 255.255.255.255DISCOVER (broadcast)D — Discover
broadcast unicast offer/ack final lease
Stage 1 / 5
DISCOVER — the new host has no address, so it broadcasts from 0.0.0.0 → 255.255.255.255 (UDP 68 → 67): "any DHCP server out there?"

DHCP: Key Facts to Remember

DORADiscover → Offer → Request → Ack — all UDP ports 67 (server) and 68 (client)
Leasetemporary ownership — renewal at T1 (50%); rebinding at T2 (87.5%)
Beyond IPsalso pushes NTP servers, boot filename (PXE netboot), and DNS suffixes

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.