Leases
When DHCP sends configuration information to a client, the information is sent with a lease time. This is the length of time that the client can use the IP address it has been assigned. The duration of the lease time can be changed according to your specific requirement.
During the lease time, the DHCP server cannot assign that IP address to any other clients. The purpose of a lease is to limit the length of time that a client can use an IP address. A lease prevents unused clients from taking up IP addresses when there are more clients than addresses. It also enables the administrator to make configuration changes to all of the clients on the network in a limited amount of time. When the lease expires, the client will request a new lease from DHCP. If the configuration data has changed, the new data will be sent to the client at that time.
Lease renewal
The client starts to renew a lease when half of the lease time has passed. For example, for a 24-hour lease, the client will attempt to renew the lease after 12 hours. The client requests the renewal by sending a DHCPREQUEST message to the server. The renewal request contains the current IP address and configuration information of the client.
If the server accepts the request, it will send an DHCPACK message back to the client. If the server does not respond to the request, the client can continue to use the IP address and configuration information until the lease expires. If the lease is still active, the client and server do not need to go through the DHCPDISCOVER and DHCPREQUEST process. When the lease has expired, the client must start over with the DHCPDISCOVER process.
If the server is unreachable, the client can continue to use the assigned address until the lease expires. In the previous example, the client has 12 hours from when it first tries to renew the lease until the lease expires. During a 12-hour outage, new users cannot get new leases, but no leases will expire for any computer turned on at the time that the outage starts.
Determining lease duration
The default lease time for the DHCP server is 24 hours. The duration for which you set the lease time on your DHCP server depends on several factors. You need to consider your goals, your site's usage patterns, and service arrangements for your DHCP server. The following questions can help you to decide on an appropriate lease time.
- Do you have more users than addresses?
- If so, the lease time should be short so that clients do not need to wait for unused leases to expire.
- Do you have a minimum amount of time that you need to support?
- If your typical user is on for an hour at minimum, that suggests an hour lease at minimum.
- How much DHCP message traffic can your network handle?
- If you have a large number of clients or slow communication lines over which the DHCP packets will run, network traffic might cause problems. The shorter the lease, the heavier traffic the server and network load from the renewal request on your network.
- What kind of service plan do you have in place, and to what extent can your network handle an outage?
- Consider any routine maintenance, and the potential impact of an outage. If the lease time is at least twice the server outage time, then running clients who already have leases will not lose them. If you have a good idea of your longest likely server outage, you can avoid such problems.
- What type of network environment is the DHCP server in? What does a typical client do?
- Consider what the clients do on the network that the DHCP server is servicing. For example, if you have an environment where the clients are primarily mobile, connecting to the network at varying times, and typically only once or twice a day to check their e-mail, you might want a relatively short lease time. In this case, it might not be necessary to have a single IP address set aside for each and every client. By limiting the lease time, you can use fewer IP addresses to support the mobile clients.
- How much does your network configuration change?
- If your network topology changes quite frequently, you might want to stay away from longer leases. Long leases can be disadvantageous in cases where you need to change a configuration parameter. The length of the lease can mean the difference between having to go to every affected client and restarting it, or merely waiting a certain amount of time for the leases to be renewed.
Parent topic:
DHCP conceptsRelated concepts
Network topology considerationsRelated reference
DHCP client/server interaction