The DORA Process
DHCP uses a four-step DORA process for IP address assignment using UDP ports 67 (server) and 68 (client): (1) Discover: client broadcasts DHCPDISCOVER to 255.255.255.255 — 'Is there a DHCP server?' (2) Offer: DHCP server responds with DHCPOFFER containing an available IP address, subnet mask, default gateway, DNS servers, and lease time. (3) Request: client broadcasts DHCPREQUEST accepting the offer — 'I'll take that IP.' (4) Acknowledge: server sends DHCPACK confirming the assignment. The client now has its IP configuration.
The process uses broadcasts because the client has no IP address at the start — it cannot send a unicast packet. This is also why DHCP uses UDP (broadcasts cannot use TCP's connection-oriented handshake).
DHCP Scope Configuration
A DHCP scope defines the pool of IP addresses and configuration parameters the server will assign. Key scope settings: address range (start and end IP), subnet mask, default gateway, DNS server addresses, lease duration, exclusion ranges (IPs reserved for static assignment — printers, servers, network devices), and options (NTP server, WINS, domain name).
DHCP reservations: binding a specific IP address to a specific client MAC address — the client always receives the same IP from DHCP. Useful for printers, servers, or cameras that need a consistent IP without full static configuration. Different from exclusions (exclusions prevent IPs from being assigned; reservations assign a specific IP to a specific MAC).
Lease duration: how long a client holds its assigned IP before needing to renew. At 50% of lease duration, the client attempts renewal with the original DHCP server (unicast). At 87.5%, it broadcasts a renewal to any DHCP server. Default lease times: home routers often 24 hours; enterprise may use 8 hours; wireless often shorter (1–2 hours) for high-churn environments.
DHCP Relay and Failover
DHCP relay agent (IP helper): allows DHCP to work across routed network segments. Broadcasts don't cross routers — without relay, each subnet would need its own DHCP server. A DHCP relay agent (configured on the router interface) forwards client DHCP broadcasts as unicast to the DHCP server, then relays the server's response back to the client.
DHCP failover: two DHCP servers configured to share a scope for redundancy. If one server fails, the other continues assigning addresses. Active-active failover (load balancing) or active-passive (hot standby). Without failover, a single DHCP server failure means clients cannot renew leases — those with expiring leases lose connectivity.