Take the 2-minute tour ×
Network Engineering Stack Exchange is a question and answer site for network engineers. It's 100% free, no registration required.

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

share|improve this question
    
ty Ryan... looks like i have to take eng grammar class :D, Hey why this site is not using auto correct feature ? –  dillip_beta Jul 11 at 11:16

2 Answers 2

up vote 9 down vote accepted

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
share|improve this answer
    
So these two are the most followed procedures used by DHCP ? or is there any other way to detect about existing IP ? –  dillip_beta Jul 11 at 10:16
    
Yes Gerry, its been mentioned like that, Ty Very much for your help. –  dillip_beta Jul 11 at 11:19
    
Minor Addition: Most DHCP Servers will neither ARP or PING any IP address before they give that IP to a client. They save all information about their leases in a database which makes sense because a DHCP lease can have a longer lifespan than the device is switched on. A lease does not become invalid if you turn off a device. So most DHCP servers will determine which IP address is available by relying on their database. Using ICMP Echo would fail if the device currently owning that IP has a strict firewall that blocks them, which could result in giving out the same lease twice. –  konqi Jul 11 at 12:55
1  
@JoSo Your first comment above makes quite a claim without and backup to that claim "Most DHCP Servers will neither ARP or PING" I know that Microsoft DHCP server does and it is important managing split scopes and DHCP server failures. I don't think we can can deny that M$ DHCP server is in use on thousands of netowrs world wide. Be careful with your wording :) –  jwbensley Jul 11 at 15:16
2  
@jwbensley Aggreed, the wording should probably be something like this: Most DHCP Servers will mostly rely on their databses containing dhcp lease information when handing out ip addresses to clients. A DHCP lease can have a longer lifespan than the device is switched on. A lease does not become invalid if you turn off a device. So most DHCP servers will determine which IP address is available by relying on their database. Using ICMP Echo would fail if the device currently owning that IP has a strict firewall that blocks them, which could result in giving out the same lease twice. –  konqi Jul 14 at 7:44

Please see the ICMP codes section of the this link ICMP Codes.

Some operating systems only show "time-out" whenever a code is returned other than reply or host unreachable, remember this is just a catchall. So a well-programmed DHCP server can make assumptions based on the specific codes returned. For instance, if you have devices with a firewall installed the ICMP code 10 (Communication with Destination Host is Administratively Prohibited) would be returned. At this point the DHCP server can reliable assume the address is in use and not assign it to another device.

Since ARP is a layer 2 protocol it is only useful if the DHCP Server is on the same network segment. A DHCP server would send out an ARP request asking who is address x.x.x.x. If no response is given then the server know the address is free and can be allocated.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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