Static and Dynamic Allocation of IP Addresses
Let's continue with the DHCP server
Policies for IP address allocation (RFC 2131)
Different hosts may have different requirements for the IP address lease. For servers, a fixed IP address is required for a long term; for some hosts, a certain IP address that is dynamically assigned is needed for a long term; for some PCs, an IP address that is temporarily assigned on demand.
To meet the preceding requirements, the DHCP server provides the following address allocation policies:
Manual address allocation: An administrator assigns fixed IP addresses to a few specific hosts, such as the WWW server.
Automatic address allocation: The server assigns fixed IP addresses to some hosts when they are connected to the network for the first time. These IP addresses can be used by the hosts for a long time.
Dynamic address allocation: The server assigns IP addresses with leases to clients. The clients need to apply for new IP addresses when the leases expire. This address allocation policy is widely accepted by most clients.
Sequence of IP address allocation (RFC 2131)
The DHCP server allocates IP addresses to clients in the following sequence:
IP address that is in the database of the DHCP server and is statically bound to the client's MAC address
IP address assigned to the client before, that is, the IP address in the requested IP Address option of the DHCP DISCOVER packet sent by the client
IP address first found when the server searches for available IP addresses in the DHCP address pool
If the DHCP address pool has no available IP address, the DHCP server searches for the expired IP addresses and conflicting IP addresses in turn for an available IP address. If an available address is found, the server allocates the IP address to the client; otherwise, the server sends an error message.


