DHCP Process
[!NOTE] This module explores the core principles of DHCP Process, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.
1. What is DHCP?
Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks to automatically assign IP addresses and other communication parameters to devices.
Without DHCP, you would have to manually enter your IP, Subnet Mask, Default Gateway, and DNS server into every phone, laptop, and smart bulb you own.
2. The DORA Process
When a device joins a network, it performs a 4-step handshake:
| Step | Message | Description |
|---|---|---|
| D | Discover | Client sends a broadcast: “I’m new! Is there a DHCP server here?” |
| O | Offer | Server replies: “Yes, I am here. You can use IP 192.168.1.50.” |
| R | Request | Client replies: “Great! I’ll take that IP.” |
| A | Acknowledgement | Server replies: “Confirmed. It’s yours for the next 24 hours.” |
3. DHCP Lease
IP addresses are not given forever; they are Leased.
- Lease Time: The duration the client is allowed to use the IP.
- Renewal: At 50% of the lease time, the client attempts to renew the lease with the server.
- Relinquish: If the client leaves the network (or shuts down gracefully), it should theoretically release the IP back to the pool.
4. Interactive: DHCP Handshake
Watch the messages exchange.
📱
Client
DHCP SERVER
Waiting for connection...
5. What else does DHCP provide?
A DHCP response typically contains:
- IP Address
- Subnet Mask
- Default Gateway (The router’s IP)
- DNS Servers
- NTP Servers (Time synchronization)