DHCP's DORA Process, Explained Packet by Packet
6 min read
DHCP (Dynamic Host Configuration Protocol) is how devices get an IP address, subnet mask, gateway and DNS servers automatically when they join a network. The core exchange is four packets remembered by the acronym DORA: Discover, Offer, Request, Acknowledge. This article walks through each packet, what is inside it, and what happens around the edges — renewals, failures, and relay agents.
In simple words
DHCP is the hotel reception desk of a network. When you arrive, you do not pick your own room — you check in, and the desk hands you a room number, the Wi-Fi password, and tells you where breakfast is. A new device does the same: it asks, the DHCP server hands it an IP address, a mask, a gateway and DNS servers — its room number and house rules — for a fixed stay (the lease).
Discover: "Is there a DHCP server out there?"
A client with no address has nothing to send *from*, so it broadcasts. The DHCPDISCOVER packet goes from 0.0.0.0 to 255.255.255.255 (limited broadcast — it does not cross routers), UDP source port 68 to destination port 67. The client's MAC address is in the chaddr field, and a random transaction ID (xid) ties the whole conversation together. DHCP message type 1, carried in option 53.
Offer: "Here is what I can give you"
Each DHCP server that hears the Discover responds with a DHCPOFFER (message type 2) proposing an address. The offer includes the proposed address in the yiaddr ("your IP") field, the subnet mask (option 1), the lease duration (option 51), the server's own address (option 54, server identifier), plus gateway (option 3) and DNS servers (option 6). The offer is typically broadcast so the client — which still has no usable unicast address — will receive it.
Request: "I'll take that one"
The client chooses one offer (usually the first) and broadcasts a DHCPREQUEST (message type 3) naming its choice via the server identifier and requested-address options. Broadcasting the Request — rather than unicasting it to the chosen server — serves a purpose: every other server that made an offer hears it and knows its offer was declined, so it can return that address to its pool.
Acknowledge: "It's yours"
The chosen server replies with a DHCPACK (message type 5), confirming the address and repeating the full configuration: address, mask, lease time, gateway, DNS. The client configures its interface and the address is leased. (If the server cannot honour the request — the address is gone — it sends a DHCPNAK instead, and the client starts over at Discover.)
Renewal: the lease lifecycle
A lease is temporary. At 50% of the lease time (T1) the client tries to renew directly with the original server via unicast. If that fails, at 87.5% (T2) it broadcasts a renewal request to any server. If the lease expires with no renewal, the client must stop using the address and start over with Discover. A client can also voluntarily give up its address with a DHCPRELEASE.
Options beyond the basics
The address, mask, gateway and DNS cover everyday clients, but DHCP options carry much more. Option 66 (TFTP server name) and option 67 (bootfile name) enable PXE boot: a diskless workstation learns where its boot image lives and downloads it before any OS is running — how enterprises deploy hundreds of machines without touching them. Option 150 gives Cisco IP phones their TFTP server; option 43 carries vendor-specific data (access points use it to find their wireless controller); option 12 sets the client's hostname; option 51 sets the lease time itself. When a phone or access point fails to provision on a network where laptops work fine, the missing option is the usual culprit — the device got an address (DORA succeeded) but never received the one extra parameter it needed. Debugging DHCP therefore means checking two things: did the address get leased, and did all the required options arrive with it?
Crossing subnets: the relay agent
Broadcasts do not cross routers, so a DHCP server usually sits on a different subnet from its clients. The router interface facing the clients is configured as a DHCP relay (Cisco's ip helper-address), which converts the broadcast Discover into a unicast packet to the server, recording its own address in the giaddr (gateway IP) field so the server knows which subnet's pool to allocate from.
Worked example
A laptop joins the office LAN (subnet 192.168.10.0/24, server at 192.168.10.1):
- Discover:
0.0.0.0:68 → 255.255.255.255:67, xid0x3A7F, chaddr = laptop MAC, option 53 = 1. - Offer: server offers
192.168.10.100, mask255.255.255.0, lease 86400 s (24 h), gateway192.168.10.1, DNS192.168.10.1, option 54 =192.168.10.1. - Request: client broadcasts acceptance of
192.168.10.100from server192.168.10.1, option 53 = 3. - ACK: server confirms. At 12 hours the laptop unicasts a renewal to
192.168.10.1; the lease extends without any user noticing.
A laptop with no address yet and a DHCP server.
- A laptop with no address yet and a DHCP server.
- 1. DISCOVER — any server out there?
- 2. OFFER — take 192.168.10.100
- 3. REQUEST — yes, I'll take it
- 4. ACK — it's yours for 24 hours
- 192.168.10.100 — gateway and DNS set. Renewal at 12 h (T1), broadcast renewal at 21 h (T2).
DHCP snooping: the switch fights back
DHCP's trust model is naive — any device can answer a Discover. A rogue DHCP server (a misconfigured home router plugged into the office LAN is the classic) hands out wrong gateways and DNS, silently redirecting traffic. DHCP snooping is the switch-level defence: the switch classifies ports as trusted (uplinks toward the real server) or untrusted (access ports), and drops DHCP *server* messages — Offer, ACK — arriving on untrusted ports. It also builds a binding table of legitimate leases, which feeds two more features: Dynamic ARP Inspection (which drops ARP packets that don't match a binding) and IP Source Guard (which drops traffic from unexpected source addresses). One misbehaving device can take down a VLAN; snooping contains it at the port.
At a glance: why, where, when, how
- Why: configuring addresses by hand on every device is slow and error-prone; DHCP does it automatically and consistently.
- Where: every home, office, campus and coffee-shop network — if a device "just connects", DHCP did it.
- When: every time a device joins a network, and again each time its lease comes up for renewal.
- How: the four-packet DORA exchange — Discover, Offer, Request, Acknowledge — walked through packet by packet in this article.
Advantages and disadvantages
Advantages
- Zero-touch: devices configure themselves; users just connect.
- No duplicates: the server is the single record of who has which address.
- Easy changes: update DNS or gateway once on the server, and every device picks it up at renewal.
Disadvantages
- A single point of failure: if the server is down, new devices get no address (fixed with split scopes or failover).
- Rogue servers cause chaos: any device can answer a Discover, which is why switches offer DHCP snooping.
- Addresses change: a device's address can differ after renewal, which is why servers that need fixed addresses use reservations or static configuration.
Real-life example
You walk into a coffee shop and join the Wi-Fi. Before you can open a page, your phone has silently done DORA: it shouted "any server here?", the shop's router offered it an address, your phone accepted, and the router confirmed — along with the gateway and DNS that make the internet work. The whole check-in took less than a second, and it happens again, invisibly, every time the lease renews.
FAQ
What happens if there is no DHCP server?
The client assigns itself a link-local address from 169.254.0.0/16 (APIPA). It can talk to other link-local devices on the same segment, but it gets no gateway and no DNS — effectively, no internet.
Why broadcast the Request instead of unicasting to the chosen server?
So that all the *other* servers that offered an address hear the decision and release their offers back into their pools. It is a courtesy broadcast that keeps address pools accurate.
Can two DHCP servers serve the same subnet?
Yes, with split scopes — each server is given a non-overlapping portion of the range (for example 80/20). Without that, both could offer the same address and cause conflicts.
Related: DHCP (DORA)