diagram.mmd — sequence
DHCP IP Assignment sequence diagram

DHCP (Dynamic Host Configuration Protocol, RFC 2131) automates the assignment of IP addresses, subnet masks, default gateways, and DNS server addresses to devices joining a network, eliminating the need for manual network configuration.

Without DHCP, every device connecting to a network would require manual IP address configuration — impractical at any scale. DHCP enables plug-and-play networking for everything from laptops joining a coffee shop WiFi to containers starting in a Kubernetes cluster.

DORA Process: DHCP assignment follows a four-message exchange known by the acronym DORA:

D — DISCOVER: The new client has no IP address, so it broadcasts a DHCPDISCOVER message on UDP port 67 to the limited broadcast address (255.255.255.255). The source IP is 0.0.0.0 since the client has no assigned address yet.

O — OFFER: One or more DHCP servers respond with a DHCPOFFER, proposing an available IP address, subnet mask, default gateway, DNS servers, and a lease duration. If multiple servers respond, the client typically uses the first offer received.

R — REQUEST: The client broadcasts a DHCPREQUEST specifying which server's offer it is accepting (by including the server identifier). This broadcast informs other servers that their offers were declined and allows them to return the offered addresses to their pools.

A — ACK: The selected server sends a DHCPACK confirming the lease. The client configures its network interface with the assigned parameters.

Lease Renewal: Before the lease expires (at 50% of lease time), the client sends a unicast DHCPREQUEST to renew. If renewal fails, it tries broadcast renewal at 87.5% of lease time before finally releasing the address. See ARP Resolution for how the client then discovers link-layer addresses on the network.

Free online editor
Edit this diagram in Graphlet
Fork, modify, and export to SVG or PNG. No sign-up required.
Open in Graphlet →

Frequently asked questions

DHCP (Dynamic Host Configuration Protocol) automates IP address assignment on a network. Without it, every device would need a manually configured IP address, subnet mask, default gateway, and DNS servers — impractical for large or frequently changing networks like enterprise offices, data centers, and home routers.
DORA is the four-step lease negotiation: Discover (client broadcasts with no IP), Offer (server proposes an IP and configuration), Request (client broadcasts its acceptance of one server's offer), and Acknowledge (the chosen server confirms the lease). After ACK, the client configures its network interface with the assigned parameters.
At 50% of the lease duration, the client sends a unicast renewal request to the original DHCP server. If that fails, it tries a broadcast renewal at 87.5% of the lease. If both fail, the client must release its IP and restart the DORA process from scratch, which briefly interrupts network connectivity.
mermaid
sequenceDiagram participant Client as DHCP Client\n(no IP yet) participant Server as DHCP Server note">Note over Client: Joins network\nNo IP address assigned Client->>Server: DHCPDISCOVER (broadcast)\nSrc: 0.0.0.0\nDst: 255.255.255.255\nClient MAC: aa:bb:cc:dd:ee:ff note">Note over Server: Select available IP\nfrom address pool Server-->>Client: DHCPOFFER (broadcast)\nOffered IP: 192.168.1.42\nSubnet: 255.255.255.0\nGateway: 192.168.1.1\nDNS: 8.8.8.8\nLease: 86400s Client->>Server: DHCPREQUEST (broadcast)\nRequesting: 192.168.1.42\nServer ID: 192.168.1.254 note">Note over Server: Reserve IP in pool\nConfirm lease Server-->>Client: DHCPACK\nIP: 192.168.1.42\nLease confirmed note">Note over Client: Configure interface:\nIP 192.168.1.42/24\nGateway 192.168.1.1\nDNS 8.8.8.8 note">Note over Client: At 50% lease time: send\nDHCPREQUEST to renew Client->>Server: DHCPREQUEST (unicast, renewal) Server-->>Client: DHCPACK (lease extended)
Copied to clipboard