Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how are DHCP responses received

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
0
0
IE
I don't really know where to put this question, but I think this is the best forum I can find for it as it's not technically DHCP related.

Basically, when a machine is turned on and sends a broadcast out for a DHCP server to give it an IP address, how does the DHCP server respond? It can't use broadcast can it, because then everybody'd get it, and it can't use unicast (to the best of my knowledge) because the host doesn't yet have an IP address. so how does it happen then?

obviously this isn't a need to know thing, just something that occurred to me recently, and curiosity getting the better of me !!
 
Once the DHCP server receives the DHCPDISCOVER packet from the client or relay agent he places an available address for the requested LAN in the packet and sends it back to either the client - if they're on the same LAN - or the relay agent (router) which sent it.

An RFC exists for this protocol and can be found at:

 
Maybe I phrased the question badly. What's bugging me is, what destination IP address does the DHCP server use to send the IP address back to the client?

Also, wouldn't I be corrct in saying that the DHCP server couldn't receive the broadcast from a router because router's dont forward broadcasts?

thanks again for your reply
 
thanks for your replies.

Maybe I phrased the question badly. What's bugging me is, what destination IP address does the DHCP server use to send the IP address back to the client?

Also, wouldn't I be corrct in saying that the DHCP server couldn't receive the broadcast from a router because router's dont forward broadcasts?
 
for obvious reasons the dhcp server can't communicate via an ip addresses with the host. So it replies to the mac address (the dhcp server receives the request from the mac address as well) of the host giving it an ip address.
By default routers do not forward broadcasts, thats correct. By using the ip helper-address, routers do forward certain broadcasts, like, dhcp, dns, tftp (and 5 others i believe)
hope that helps.
 
1. If the host is on a different subnet the server responds to the IP address of the relay agent (router) which forwarded it the request and the router sends it to the requesting node.

2. If the host is on the same subnet the server responds to the source MAC of the requesting host.

3. Routers do not forward broadcasts and that is why routers have to act as relay agents. The router picks up the broadcast and directs it to the DCHP server configured with the IP helper-address command (Cisco) by placing the address of the DHCP server in the destination address field. The router also places his LAN IP in the packet as source IP.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top