Free — no signup required

DHCP: Getting an Identity

3 min read

The DORA Process

When you connect a new device to a network — plugging in a laptop, joining Wi-Fi, spinning up a cloud VM — it has no IP address, no knowledge of the router, and no DNS server configured. It needs all of this information before it can communicate. DHCP (Dynamic Host Configuration Protocol) automates this entire configuration process.

DHCP uses UDP (port 67 for the server, port 68 for the client) because the client has no IP address yet and cannot establish a TCP connection. The process follows four steps, remembered by the acronym DORA:

  1. Discover: The client broadcasts a DHCP Discover message to 255.255.255.255 (the broadcast address) from source IP 0.0.0.0 (it has no IP yet). The message says: "I need network configuration. Is there a DHCP server?"

  2. Offer: A DHCP server on the network receives the broadcast and responds with a DHCP Offer: "I can give you IP 192.168.1.50, valid for 24 hours. Here is my server ID so you know who is offering."

  3. Request: The client broadcasts a DHCP Request: "I accept the offer from server 192.168.1.1. I would like IP 192.168.1.50." This is broadcast (not unicast) so that other DHCP servers on the network know their offers were declined.

  4. Acknowledge: The server sends a DHCP Acknowledge, finalizing the assignment and providing the full configuration: IP address, subnet mask, default gateway, DNS server addresses, and the lease time (how long the client may use this IP before it must renew).

DHCP Lease Renewal
The lease time is critical. Before the lease expires (typically at 50% of the lease time), the client sends a unicast DHCP Request directly to the server to renew. If the server is unavailable, the client retries at 87.5% of the lease time. If the lease expires entirely without renewal, the client must restart the full DORA process and may receive a different IP address.

DHCP in Production: Static vs. Dynamic
In home networks, DHCP assigns IPs dynamically from a pool. In production infrastructure, servers typically use either static IP assignment (configured directly on the OS) or DHCP reservations — where the DHCP server is configured to always assign the same IP to a specific MAC address. This gives the operational simplicity of DHCP with the predictability of static IPs.

Key Point: A 169.254.x.x IP address (APIPA — Automatic Private IP Addressing) means the DORA process failed completely. The client sent Discover messages and received no Offer. The OS assigned itself a link-local address so it can communicate with other APIPA devices on the same segment, but it cannot reach the internet. This is almost always caused by a DHCP server being down, a misconfigured network, or a VLAN configuration error.

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free