process is complete, the client chooses the lease that was acquired most recently and
enters the
INIT-REBOOT state. In this state, the client broadcasts a DHCPREQUEST
message to ensure that the address in the selected lease is still valid for the network
segment to which the host is connected. If the client gets no response, it re-sends
the
DHCPREQUEST message. If the client receives no response after a certain period of
time elapses, it tries to use the IP address in the lease.
When they fail to confirm their lease during the
INIT-REBOOT state, most DHCP
clients simply use the IP address they tried to confirm. If the ISC DHCP client fails to
confirm its lease by using a broadcast
DHCPREQUEST message, it tries to confirm that
the address is appropriate for the subnet to which it is attached. It does this by
configuring its network connection with that address and sending an ICMP echo
request to its default router. If it gets a response, it uses the old address; otherwise, it
tries to determine whether any of the other unexpired addresses work on the current
subnet. If the client can’t contact the default router with any of its unexpired
addresses, the client reverts to the
TIMEOUT state.
As DHCP is specified in RFC 2131, a client is expected to start in the INIT state if it
has no unexpired leases. Many clients implement this behavior and immediately
broadcast a
DHCPDISCOVER message when starting with no unexpired leases. Some
implementors have interpreted the text in RFC 2131 to permit a client to first try to
renew an expired lease and then revert to the
INIT state if the renewal fails. This
behavior is widely agreed to be incorrect, but some older clients do operate this way.
If the ISC client receives no response to its broadcast message in the
INIT state, it
continues retransmitting
DHCPDISCOVER messages for some configurable period of
time (usually 60 seconds). If it doesn’t find a valid lease within that time period, it
reverts to the
TIMEOUT state.
When the Client Fails to Get an Address
The TIMEOUT state mentioned in the preceding section is not included in the protocol
specification, but many DHCP client implementors added it (or something like it) to
their state machines. The purpose of the
TIMEOUT state is to enable the client to “give
up” and notify the user in some way that it failed to acquire an IP address.
When the ISC DHCP client is started, it runs in the foreground until it has either
found an IP address or entered the
TIMEOUT state. This enables daemons that are
started after the client is started to assume that the network is configured before they
begin, but it prevents the client from holding up the system startup indefinitely.
After the purpose of the
TIMEOUT state is fulfilled, the client waits for a configurable
interval and then reverts to the
INIT state.
If the Microsoft or Apple DHCP client reaches the TIMEOUT state, it uses Automated
Private IP Addressing (APIPA) to assign an address to the interface that is being
configured. When using APIPA, the DHCP client chooses an IP address out of the
CHAPTER 21 DHCP Clients356
025 3273 CH21 10/3/02 4:57 PM Page 356