DHCP layer 2 broadcast


(sumant S) #1

Hi
Just confused with broadcast and unicast messages happening between client and server in dora process.
Considering this scenario…
If 2 client devices are requesting ip from server then when the server will send back the offer back to clients…if this offer is broadcast at layer 2 ghen how would both clients will come to know that who is the intended recipient of this offer…as dest port will be 68 for both clinets…
Just spanning my head to understand how clients will understand that coming offer is for them with layer 2 bradcast…
Same story with dhcp acknowlegement…how how 2 clients will come to know who is the intended receipent of the frame if both of them are listening at port 68 at same time…

Thanks…any example would help…


(Alexander F) #2

Hi,

considering it’s DHCP traffic only in the same broadcast Domain(DHCP Server on same VLAN):

All traffic from Clients to DHCP-Server is broadcast on Layer 2 FF:FF:FF:FF:FF:FF and on Layer 3 (255.255.255.255)
All traffic from DHPC-Server to Clients is Unicast to the MAC Address of the Client on Layer 2 and to the IP Address offered to the Client on Layer 3.
So Client distinction is made on Layer 2. And now the important Thing:

The Server knows the destination to send to from the fields “Client Identifier” and chaddr (Client Hardware address).

Also the Transaction ID is used to differentiate, but as i know its used by the Server to differentiate when an ip helper/dhcp relays at Layer 3 are used as the Layer 2 address(MAC address of relay, e.g. SVI interface of Switch) will be the same for all Clients.
RFC:
“Transaction ID, a random number chosen by the client, used by the client and server to associate messages and responses between a client and a server.”




With an ip helper in between its quite different

Hope that helps


(sumant S) #3

Hi Alex

Thanks for the explanation…i got it now that how clients and server differentiate different sessions by using transaction id…

But in the network analyzer captures it uses the destination ip for the client as the one it is offering in the dhcp offer and dhcp acknowlegement .wasnt it supposed to be layer 3 broadcast as the client does not configure itself with ip address until the end of dora process…???

Thanks


(sumant S) #4

Sorry its dhcp offer and dhcp acknowlegement…


(Lazaros Agapides) #5

Hello Sumant

@alex.fritzsche had an excellent answer for you and clarifies most of the issues involved. Just one note:

Typically, a DHCP DISCOVERY message is indeed multicast with a destination MAC address of FF:FF:FF:FF:FF:FF:FF. However, there are cases where DHCP OFFER which is the response to the DISCOVERY is also a broadcast. Take a look at the following post concerning this:

Even in such a case, if two clients ask for an IP address at the same time, they will be able to distinguish which DHCP response is for them and which is not from the “Client Identifier” and chaddr (Client Hardware address) fields.

I hope this has been helpful!

Laz


(Alexander F) #6

Hey Sumant and all,

as I think Lagapides also explains, the problem is mostly just a question about the OSI layers, which means that:
if a protocol is able to distinguish endpoints on layer 2 it does it that way and this is a very robust way, but in extend all other Layers can be involved. So is Layer 4 with Port 68 and a Transaction ID in the upper layers and so on. It really depends on the protocol.
As a network engineer just keep in mind wich layers are involved or altered (ip dhcp snooping Option 82…) and how the protocol is implemented in your environment.
It’s just that easy,