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. Analogy: The Restaurant Reservation
To understand DHCP better, think of it like going to a popular restaurant:
- Discover: You walk in and ask, “Are there any open tables?” (Client broadcast)
- Offer: The host replies, “Yes, we have Table 12 available.” (Server offer)
- Request: You say, “Great, I’ll take Table 12.” (Client request)
- Acknowledgement: The host notes it and says, “Table 12 is yours for the next 2 hours.” (Server ACK and Lease Time)
5. Interactive: DHCP Handshake
Watch the messages exchange.
6. 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)