What are the sequence of steps for DHCP?
A brief walk-through for DHCP and how it works.
💡
This is part of a new on-going series in networking foundations. Check the networking 101 article tag index from time to time for more content.
Today's topic is very brief but essential for modern networking as we know it. Let's unpack the process and major steps for Dynamic Host Configuration Protocol (DHCP).
- Discover - When a new host connects to the network (and is configured for DHCP), it will send a broadcast to the local subnet to see if a DHCP server is available to work with.
- Offer - A DHCP server will see this request and respond back with an "offer". This set of data will typically contain relevant network address details including:
- IP Address that the client can use for itself.
- Subnet Mask
- Default Gateway
- DNS Server(s)
- Lease time (how long the client can use the IP address before it needs to renew it)
- Additional miscellaneous DHCP options (see below) - Request - After reviewing the request, the client system will send back a formal request to the DHCP server essentially saying "cool, I like the IP address you offered me and want to use it".
- Acknowledgement - The DHCP server sends a final acknowledgement to confirm that the DHCP lease is now in effect and the client now temporarily has that IP address.
Additional tidbits
While we're at it, here's a few additional things to note:
- While the data points I listed in step #2 (offer) are the most common, that's by no means an exhaustive list. There are actually a LOT of various things that DHCP can provide to a host. These are called "DHCP Options" and can include other elements like:
- Time synchronization details
- Log servers
- Boot file names
- Vendor-specific options
- Host names
- Static routes
- Etc, etc
- It's possible for DHCP to work even if there isn't a local DHCP server on the local subnet. In that scenario, a router or gateway on the local subnet can see the DHCP discover request and pass it along to a DHCP server located elsewhere (via a feature called "DHCP Relay"). This is more common in larger enterprise networks which have lots of segmentation and subnets.
For more information on this topic, check out the following resources: