DHCP Lease Renewals

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DHCP Lease Renewals

Bob McDonald
I understand the process of DHCP lease renewal. (Attempt to contact issuing DHCP server for lease renewal by client after expiration of T1, Attempt to contact ANY DHCP server for lease renewal by client after expiration of T2, lease expiration)

However, what happens if the client leaves the network before T1 and then returns before lease expiration? Does the client renew the existing lease? What's the sequence? (Probably clear to most, just not to me...)

I'm pondering a lease time of 20 hours. For subnets where the population of devices isn't guaranteed to be fairly static (e.g. laptops connecting via wires to networks) that is. This would allow a "normal" work shift to expire before the T1 of 10 hours and expire the lease before the next shift starts.

For totally mobile devices (i.e. wireless devices) shorter lease times. For more static populations (e.g. IPT devices) longer.

Does MCLT play into this at all? (MCLT is usually 3600 seconds, I think)

Any thoughts?

Bob

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP Lease Renewals

Steven Carr
On 15 July 2016 at 11:31, Bob McDonald <[hidden email]> wrote:
> However, what happens if the client leaves the network before T1 and then
> returns before lease expiration? Does the client renew the existing lease?
> What's the sequence? (Probably clear to most, just not to me...)

It's highly dependant on the client, some will do a DHCPREQUEST
unicast to renew, others broadcast, some will start back with a
DHCPDISCOVER. However on the server side the lease is still valid and
active (server doesn't really care about T1 or T2), so the server will
give the client the IP address again and extend the lease.

> Does MCLT play into this at all? (MCLT is usually 3600 seconds, I think)

No impact (unless the DHCP servers are in communications-interrupted state).
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: DHCP Lease Renewals

Simon Hobson
In reply to this post by Bob McDonald
Bob McDonald <[hidden email]> wrote:

> However, what happens if the client leaves the network before T1 and then returns before lease expiration? Does the client renew the existing lease? What's the sequence? (Probably clear to most, just not to me...)

As already said, it's highly implementation specific.
Devices (eg printers) without a real time clock, persistent storage, etc will simply startup "cold" and do a full DORA sequence. Most modern OSs on systems with real time clock etc will take some shortcuts. From observations, the steps taken seem to be some combination of :

- Try a broadcast renewal request.

- Do an ARP check and see if you have the same router - if you do, carry on using the same lease.

- Some other means of seeing if you seem to be on the same network (I suspect simply seeing if the gateway IP is active). I include this because I've seen issues with Windows laptops where the home network has the same subnet as the office network, and the laptop uses the lease it got from the home network in the office.

Generally, if you assume that most OSs will resume using an unexpired lease if they think they are on the same network - while also doing some DHCP broadcasts to check - you won't be far wrong.


> I'm pondering a lease time of 20 hours. For subnets where the population of devices isn't guaranteed to be fairly static (e.g. laptops connecting via wires to networks) that is. This would allow a "normal" work shift to expire before the T1 of 10 hours and expire the lease before the next shift starts.

There's no problem really. I generally use leases of several days, or even weeks.
If the lease end time hasn't passed, then the lease is still valid and the server won't give the address to another client. If the end time has passed, the client *shouldn't* attempt to continue using it until it's had a renewal. Using a longer lease such that it doesn't expire overnight (or across weekends) does generally allow clients to connect more quickly as they can take the shortcut (determine that they are on the same network) and connect while waiting for the DHCP service to renew the lease.

In terms of lease times, there's no "right" answer.
As long as you aren't short of addresses, longer leases will give stability and minimise DHCP server load. In high turnover situations, shorter lease times allow better use of addresses (no point tying up an address for that phone that passed through reception 2 days ago and isn't going to be seen again !)

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users