DHCP – Use of ICMP Echo Request in DHCP

arpdhcpicmp

In RFC2131 (page 12) it's been mentioned that

The server should use whatever information is available in the
configuration information repository to choose an address to reuse.
For example, the server may choose the least recently assigned
address. As a consistency check, the allocating server SHOULD probe
the reused address before allocating the address, e.g., with an ICMP
echo request
, and the client SHOULD probe the newly received
address, e.g., with ARP.

Can you please explain to me how ICMP echo requests and ARPs are helpful in DHCP?

Thank You

Best Answer

An ICMP Echo request from the DHCP server to the IP address its about to allocate is used to determine if the IP address about to be assigned is already in use on the network. If a response is received from that IP the DHCP server will assign a different address.

The ARP request on the newly received address from the client would do the same, check if another device is using that address and responding to ARP. If so it knows the address it received is already in use.

The RFC you linked to does mention later on:

Servers need not reserve the offered network address, although the protocol will
work more efficiently if the server avoids allocating the offered
network address to another client.  When allocating a new address,
servers SHOULD check that the offered network address is not
already in use; e.g., the server may probe the offered address
with an ICMP Echo Request.  Servers SHOULD be implemented so that
network administrators MAY choose to disable probes of newly
allocated addresses.

I am not certain if all DHCP servers implement this requirement but as far as I am aware there is no other way a DHCP server could reliably become aware of another device using an IP that is available in its DHCP pool.

Also from the same RFC regarding ARP from the clients:

if the client is on a network that
supports ARP, the client may issue an ARP request for the suggested
request.  ...  If the network address appears to be in use, the client MUST send a
DHCPDECLINE message to the server