Usually,DHCP is preferred over static IPsas you do not have to worry about individually assigning addresses to each device on the network. That’s also why DHCP is enabled (by default) on most systems today.
One thing to note here is that the IP isonly leasedfor a certain time and willexpire if not renewed. When this happens, the IP returns back to the DHCP pool. Now, this address becomes available for the DHCP server to lease to newer devices in the network.
If you’re keen to know more, here’s a detailed guide that discusses how a DHCP server leases IP to different devices on the network, its renewal process, and whether or not you may modify the lease duration.
Basics to DHCP Lease Time
DHCP lease time indicateshow long your device keeps the same IPbefore its renewal or expiry. During this period, theDHCP serverreserves this IP for that specific device and won’t assign it to any other client, preventing possible conflicts.
For example, 1 hour lease time means the device can hold the allocated IP address for 1 hour. The client canrenew the IPanytime during the lease period by sending a renewal request message. But if the criterion is reached and the device fails to renew its configuration, it may lose the IP and has to restart the process to get a new IP.
The main purpose of DHCP lease time is tospecify a durationuntil which a client can utilize the IP address. This ensures that no device will hold the address for an indefinite time.
On an enterprise network, the network administrator configures the DHCP lease time. On a typical SOHO router, if you have access to therouter settings, you get the option to change the default lease time.
How Does DHCP Lease Time Generation & Renewal Work?
The client device receives the lease time, IP address, and other additional information, like Default Gateway, Subnet Mask,DNS servers, etc. This process is called the DHCP lease negotiation or the DORA process.
The process starts after a client requests an IP by sending aDiscovermessage. It is usually a broadcast message. One or more DHCP servers canofferthe device with an IP.
Now, the client sends afinal request(as a broadcast message) to claim the offered IP and related configurations. Once theDHCP server acknowledgesthis request, the client finally gets the IP for a certain period (lease time).
The client keeps using the leased IP address forhalf of its validity time(50%). Then, it attempts to renew its lease by sending a unicast message to the DHCP server. Only if the request is acknowledged its timers get refreshed.
However, if the DHCP server sends aNAK message, the client has to reinitiate the lease negotiation process to get a new IP address. In case the server doesn’t respond or is offline, the device keeps using the IP address until therebinding time(at 87.5%).
The same process repeats in this state—the only difference is that the device sends abroadcast message. Now, every other DHCP server in the network can acknowledge the lease extension request.