What is DHCP and how does it assign IPs?
· Category: Networking
Short answer
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses and network configuration parameters to devices when they join a network.
How it works
The DHCP process follows a four-step DORA sequence:
- Discover: The client broadcasts a DHCP Discover message to find available servers.
- Offer: A DHCP server responds with an Offer containing a proposed IP address and lease duration.
- Request: The client broadcasts a Request to accept the offer.
- Acknowledge: The server sends an Acknowledgment confirming the assignment.
The client receives an IP address, subnet mask, default gateway, and DNS server addresses. The lease expires after a set time, at which point the client must renew.
Example
When your smartphone connects to Wi-Fi, it uses DHCP to obtain an IP automatically. You do not need to manually configure anything.
Why it matters
DHCP eliminates manual IP management, reduces conflicts, and allows centralized control. Administrators can change DNS or gateway settings from a single server without touching every device.