Skip to the workspace
Pebellslearn by building
Network Devices and Services  ›  Lesson

DHCP — Addresses on Arrival

DHCP 14 minDHCP automatically lends a new host its IP address, subnet mask, gateway and DNS servers through the Discover, Offer, Request and Acknowledge exchange.

network engineer / DHCP — Addresses on Arrival

Explore each scene at your own pace.

01 · The rule

The rule

DHCP — Addresses on Arrival

A new designer joins Kite Studio, opens her laptop, connects to the Wi-Fi and is online within seconds. Nobody typed an IP address, a mask, a gateway or a DNS server into her laptop. A service called DHCP handed her all four, on loan.

The rule

DHCP lends settings in four steps: Discover, Offer, Request, Acknowledge.

The job. DHCP (Dynamic Host Configuration Protocol) automatically gives each new host its network settings:

  • an IP address from a pool (Kite Studio's pool is 192.168.10.100 to 192.168.10.199);
  • the subnet mask (255.255.255.0);
  • the default gateway (192.168.10.1);
  • the DNS servers to use;
  • a lease time, after which the address must be renewed or returned.

At Kite Studio the router runs the DHCP server. Devices that must never move, such as files (.20) and the printer (.30), get fixed addresses outside the pool, either typed in by hand or as a reservation that always hands the same address to the same MAC.

The four steps (DORA). A brand-new laptop has no address and does not know where the server is, so it starts by shouting:

  1. Discover — the client broadcasts "is there a DHCP server?"
  2. Offer — the server offers a free address and settings.
  3. Request — the client asks formally for that offer (also by broadcast, so any other server that made an offer knows it was declined).
  4. Acknowledge — the server confirms, and the lease starts.

DHCP runs over UDP: servers listen on port 67, clients on port 68. Because Discover is a broadcast, it stops at the router; a network without its own DHCP server needs a relay on the router to forward requests to one.

No server? A laptop that gets no answer gives itself a link-local address from 169.254.0.0/16. It can then talk only to neighbours on the same link — a clear sign DHCP failed.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.