How does the computer know which device on the network to query? How does the default gateway factor into this? Pretty much, what is the chain of events that occurs when a computer tries to obtain an IP address using DHCP?

The reason I ask is because I'm trying to figure out how to best set up a redundant DHCP server, in case the original fails for whatever reason.

4 Answers
4

It doesn't know what device to query. Thus it broadcasts its request to the entire subnet. The DHCP server is listening for a certain type of communication and when it hears that specific broadcast it begins the DHCP conversation with the device that broadcasted its request. Take a look at the DORA process for more information.

As for the gateway, it can come into play only if it explicitly forwards DHCP traffic to another subnet. That feature is usually called DHCP Relay. Otherwise the gateway ignores the broadcast DHCP message just like it ignores every other broadcast message.

Here is a question, usually there is a broadcast address associated with every subnet, not knowing anything about the network how does the network card formulate the message so that the DHCP server (and any switches inbetween) gets it?
–
crasicAug 9 '11 at 6:31

The reason I ask is because I'm trying to figure out how to best set up a redundant DHCP server, in case the original fails for whatever reason.

First, I laud your interest in learning more about the protocol. That is a good plan.

Second, I thank you for explaining your goal; I think it will help you get a good answer.

Finally, my answer:

For whichever DHCP server you choose to go with, there is likely a failover / redundancy configuration that permits you to set up a redundant DHCP server that can take over automatically (I believe Windows has such, and I know the ISC's DHCP server can). That would be my first choice, as it typically addresses issues with leases given out by the primary DHCP server before its failure, and because it recovers automatically and quickly.

Second choice would be to fully duplicate the configuration on another machine so that you can bring the other machine up manually in case of failure of the first. This isn't as optimal because you'll lose existing lease information and because of the implicit down-time between the first DHCP server failing and when you bring up the replacemnt.

I see the point of the 80/20 rule... if server 80 fails, then there's still server 20 to give out IP addresses. But this doesn't provide any kind of support for an extended downtime, since eventually all of the clients will want to renew their lease, but with only 20% of the previous address range available. I like your suggestion of "real" redundancy, but using a second Windows machine would not be an option in my scenario (the hardware firewall would be the other DHCP server). I guess I could manually reconfigure server 20 to be server 100? ;)
–
Bigbio2002Aug 9 '11 at 15:42