DHCP IP Assignment
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.
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.