Manual allocation: The network administrator assigns an IP address to a client like a WWW server,
and DHCP conveys the assigned address to the client.
Automatic allocation: DHCP assigns a permanent IP address to a client.
Dynamic allocation: DHCP assigns an IP address to a client for a limited period of time, which is
called a lease. Most DHCP clients obtain their addresses in this way.
Dynamic IP address allocation process
Figure 233 Dynamic IP address allocation process
As shown in
The client broadcasts a DHCP-DISCOVER message to locate a DHCP server.
1.
A DHCP server offers configuration parameters such as an IP address to the client in a
2.
DHCP-OFFER message. The sending mode of the DHCP-OFFER is determined by the flag field in
the DHCP-DISCOVER message.
If several DHCP servers send offers to the client, the client accepts the first received offer, and
3.
broadcasts it in a DHCP-REQUEST message to request the IP address formally.
All DHCP servers receive the DHCP-REQUEST message, but only the server from which the client
4.
accepts the offered IP address returns a DHCP-ACK message to the client, confirming that the IP
address has been allocated to the client, or a DHCP-NAK unicast message, denying the IP address
allocation.
NOTE:
After the client receives the DHCP-ACK message, it will probe whether the IP address assigned by the
server is in use by broadcasting a gratuitous ARP packet. If the client receives no response within the
specified time, the client can use this IP address. Otherwise, the client sends a DHCP-DECLINE message
to the server and requests an IP address again.
IP addresses offered by other DHCP servers are still assignable to other clients.
IP address lease extension
The IP address dynamically allocated by a DHCP server to a client has a lease. When the lease expires,
the DHCP server will reclaim the IP address. If the client wants to use the IP address longer, it has to
extend the lease duration.
Figure
233, a DHCP client obtains an IP address from a DHCP server via four steps:
268