DHCP
DHCP is the protocol that automatically hands out IP addresses and network configuration to devices joining a network. If your phone can reach the internet the moment it connects to Wi-Fi, you have DHCP to thank.
01Why DHCP?
Without DHCP, every device would need a manually assigned IP: slow, typo-prone, and worst of all — assign the same IP twice and you get an IP conflict.
With DHCP:
- A device gets an IP automatically the moment it joins
- Central management: the whole range is controlled from one place
- When a device leaves, its IP returns to the pool — nothing is wasted
02What DHCP provides
More than just an IP arrives in a single exchange:
| Item | Example |
|---|---|
| IP address | 192.168.1.100 |
| Subnet mask | 255.255.255.0 |
| Default gateway | 192.168.1.1 |
| DNS server | 8.8.8.8 |
| Lease time | 24 hours |
03The DORA process
DHCP works in four steps — the initials spell DORA:
1. Discover
Client → "Any DHCP server on this network? I need an IP!" → Broadcast
2. Offer
DHCP Server → "192.168.1.100 is free, want it?" → Client
3. Request
Client → "Yes, I'd like 192.168.1.100" → Server
4. Acknowledge
Server → "Done, it's yours for 24 hours" → Client
The client doesn't have an IP yet, so its first message goes out as a broadcast — it shouts to everyone on the network, and whichever server has an answer replies.
04IP lease
An IP address isn't granted forever, it's leased:
- Lease time — how long the IP is valid
- Renewal — halfway through, the device quietly asks to renew
- Release — if the device leaves, the IP returns to the pool
Example: a device with an 8-hour lease asks for renewal at hour 4; if renewed, the clock restarts.
05Where does the DHCP server live?
| Environment | Who serves DHCP |
|---|---|
| Home | A service inside your router |
| Office | A dedicated DHCP server |
| Large networks | Windows/Linux server clusters |
06Static vs dynamic IP
| Static | Dynamic (DHCP) |
|---|---|
| Assigned by hand | Assigned automatically |
| Never changes | May change when the lease ends |
| Servers, printers | Client devices |
There's a middle path too: DHCP reservation — a MAC address is paired with an IP, so the device always gets the same address while management stays central.
07Try it yourself
Sandbox · ProtocolDHCP SimulatorPlay through all four DORA steps with full lease details.Open tool08Summary
- DHCP = automatic IP and network configuration
- DORA = Discover, Offer, Request, Acknowledge
- IPs are leased and renewed at half-life
- At home your router does this; servers usually run static IPs