19

This is the process of DHCP operation, enter image description here

My question is at the 3rd step why does the Client send a Broadcast and not a Unicast as after the previous two operations the address of the DHCP server / Relay server should be known?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Apr 1 '18 at 21:51
30

https://tools.ietf.org/html/rfc2131#page-13

The servers receive the DHCPREQUEST broadcast from the client. Those servers not selected by the DHCPREQUEST message use the message as notification that the client has declined that server's offer.

The protocol assumes there may be multiple DHCP servers. By broadcasting the request message, all servers that may have issued an offer can be aware of the client's choice.

11

You can potentially have multiple DHCP servers - the request is sent as broadcast to notify the other DHCP servers that have potentially sent offers that their offer isn't taken.

7

Because until the server sends the DHCPACK, the client still doesn’t have an IP address. It is possible for a DHCP server to respond to a request with a DHCPNACK.

  • Why would that imply that broadcast would need to be used?The client knows the server's MAC address from the DHCPOFFER message, so it could send the DHCPREQUEST unicast to that server - there's no need for an IP address for that to happen. – psmears Mar 6 '18 at 13:51
  • 1
    @psmears, because L3 broadcasts are sent as L2 broadcasts. DHCP is not a L2 protocol, so you are bound to rules as the data is passed from L3 to L2. – YLearn Mar 6 '18 at 16:27
  • 2
    @YLearn: You also need a source and destination IP for an L3 multicast or broadcast packet, too, so that's clearly not the issue :) There's no theoretical reason why the DHCPREQUEST packet couldn't be sent with the destination IP and MAC of the server, and (as with the broadcast packet) a source IP of 0.0.0.0. The reason for the broadcast is to let other DHCP servers (if any) know that the client is declining their offers. – psmears Mar 6 '18 at 17:01
  • 1
    @psmears, the destination of a L3 broadcast is 255.255.255.255. You can source a L3 broadcast from 0.0.0.0. However, you cannot source a L3 unicast from 0.0.0.0. – YLearn Mar 6 '18 at 17:20
  • 2
    @YLearn: You can certainly send a packet with the bytes for the source address set to zero! That may be forbidden by some RFC though - do you know of one? RFC1700 says 0.0.0.0 "may only be used as a source address" (but nothing about unicast/broadcast); RFC1122 says 0.0.0.0 "MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its own IP address" (again, no uni/broadcast restriction). Is this mandated somewhere else? – psmears Mar 6 '18 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.