cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2475
Views
35
Helpful
14
Replies

DHCP and ARP requset

mautez_mah
Level 1
Level 1

HI , 
when we connect PC to Router in order to get IP ( Router is DHCP server ) , I did wireshark 
I realize that all DHCP MSG ( DORA ) is BROADCAST so all will be Dest IP is 255.255 and dest MAC is 255.255 , right or wrong ?
now after PC GOT IP so if it needs to reach internet why should send ARP requset , he already know Dest mac for Router right as already there is MSG between them , I saw in wireshark ARP so I am confuse , 

14 Replies 14

balaji.bandi
Hall of Fame
Hall of Fame

The client, Host PC, sends a DHCPDISCOVER broadcast message to locate a DHCP server. A relay agent forwards the packets between the DHCP client and the server. A DHCP server offers configuration parameters (such as an IP address, a MAC address, a domain name, and a lease for the IP address) to the client in a DHCPOFFER unicast message.

 

now after PC GOT IP so if it needs to reach internet why should send ARP requset , he already know Dest mac for Router right as already there is MSG between them , I saw in wireshark ARP so I am confuse , 

If you like to go to the internet example google.com, the client does not know where google.com, It looks for gateway and routing table.

based on your routing the request will be addressed.

 

we are not sure what messages you see on Wireshark if you can share them here we can clarify.

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

mautez_mah
Level 1
Level 1

@balaji.bandi 
DHCP offer is Brodcase MSG I did Wireshark and I found it ,
My question now As this msg already between server and client , why a client should send ARP to know mac address of server ? 

As you point out the DHCP request is sent as a broadcast. Assuming that DHCP negotiation is successful the device will learns its IP address and its gateway. The gateway is not necessarily the same as the device acting as DHCP server. So to access remote networks the device will need to arp for the address of its gateway.

HTH

Rick

@Richard Burts 
many thanks , so you agree with me that all DHCP MSGS are broadcast, ( first points )
second one you are totally right , so now no need for arp if Getway is same DCHP server ? 

". . . so now no need for arp if Getway is same DCHP server ? "

If the DHCP server is the actual GW router (which is possible), then, it depends, on how "clever or smart" host is.

Yes, host has all the information it needs, and, in theory, "knows" the MAC for the GW's IP.  Don't know what the RFCs say on this situation. My guess would be, host loads ARP cache with ANY received IP (packet) and MAC (frame), but doesn't "care" IP in received packet matches GW IP in DHCP info.  Why?  Because, if the ARP was populated by received packet/frame, as soon as host attempts to use GW IP, host will check its ARP cache and "see" GW MAC.  I.e. no ARP required, not because DHCP GW IP and responding host IP are the same, but because received packet/frame already populated ARP cache with IP/MAC.

 

 

@Joseph W. Doherty 
really perfect and agree with you totally , and I guess DHCP server as well when send Offer msg to host , even it is broadcast it may contain destination mac for host , right as he know about it 

Joseph W. Doherty
Hall of Fame
Hall of Fame

(NB: I might be using DHCP terminology incorrectly regarding requests, and offers, etc.)

As noted by other posters, GW router could be different from the router relaying a DHCP request, which, remember, if DHCP server is on same L2 domain, a router wouldn't be involved at all.

Further, when a router forwards a DHCP broadcast request, and returns a DHCP server's offer, I recall the return packet's information, from the transit router, doesn't contain the IP of the transit router, it should be the IP of the DHCP server.  Yes, the DHCP offer (within the packet) would provide the router's IP, if it's also the gateway (more often than not, probably is), and yes, the physical frame from the that router has its GW MAC, but, the original host doesn't "know" that the GW IP (in the DHCP server offer) and the GW router's physical frame's MAC belong together until it ARPs for the GW's IP.

@Joseph W. Doherty 
many thanks , so know if DHCP server same GW ( router in our case ) , host doesn't know that  DHCP same as GW even if it seem its mac so host will not save in arp cash and forward arp requset 

gateway IP address as Router op 3

This is op that include in dhcp offer, send to host,

Host will send arp if the getaway is different than server ip op in dhcp offer.

Hello


@mautez_mah wrote:

, so you agree with me that all DHCP MSGS are broadcast, ( first points )


The dhcp offer is EITHER unicast or broadcast

Unicast if the offer is via a relay agent, broadcast if its via the subnet the server & client reside

 

 


@mautez_mah wrote:

second one you are totally right , so now no need for arp if Getway is same DCHP server ? 


That arp would only be a consistency arp check to validate its received address before acknowledging the dhcp offer


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

@paul driver 
Thanks could you please explain more "Unicast if the offer is via a relay agent, broadcast if its via the subnet the server & client reside" 
what do u mean by relay agent

if offer is brocase will dest mac will be FF or dest of client as server has already know about from first MSG 

Hello


@mautez_mah wrote:

 what do u mean by relay agent


Ip helper addressing < when the the dhcp server does not not reside on a locally attached network and the dhcp messages then need to travel between client/server via this designated relay

 

 

Edited- Apologies---


@mautez_mah wrote:

if offer is brocase will dest mac will be FF or dest of client as server has already know about from first MSG 


It will be broadcasted/unicasted towards the dhcp server or relay (Discovery), and the returning( Offer) can be either unicasted/broadcasted depending on the above

 

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

mautez_mah
Level 1
Level 1

@paul driver  Thanks 
what is Dest MAC when server send Offer to client _ if it send Brodcast Offer  , ok we know msg is brodcast so Dest IP will be 255.255.255.255 but know server knows about client MAC right ? 

Hello


@mautez_mah wrote:

what is Dest MAC when server send Offer to client _ if it send Broadcast Offer  , ok we know msg is broadcast so Dest IP will be 255.255.255.255 but know server knows about client MAC right ? 


If is broadcasted i would say the dhcp server/client are on the same subnet however the server at this stage it doesn’t actually know where that client that sent the discovery (no ip address) actually resides hence the broadcast

If its unicasted, then its towards the relay and then its broadcasted via the relay towards the client.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card