reuse_lease: lease age logs

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

reuse_lease: lease age logs

Teja
Hi 
In the log messages of the dhcpd I see few strange messages like 
reuse_lease: lease age 173843 (secs) under 25% threshold, reply with unaltered, existing lease for 192.168.1.6
 reuse_lease: lease age 713 (secs) under 25% threshold, reply with unaltered, existing lease for 192.168.1.81
Does any one has any idea what does this reuse lease means ?
Just FYI: I have added a statement one-lease-per-client true; to my conf recently as i am facing no free lease issues because of roaming clients, does this impact the environment and cause problem which leading the above log messages? 



Thanks in advance 

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

Re: reuse_lease: lease age logs

glenn.satchell
Hi Surya,

It's a server optimisation for when only a small amount of the lease
time has passed. Rather than go through the whole process to creatge a
new lease and update the leases file, the server replies with the
existing lease information and the time remaining. It makes no real
difference to the client, but for a busy server it can save a lot of I/O
and processing as the lease file doesn't need to be updated. It's
probably unrelated to the one-lease-per-client setting.

regards,
Glenn

On 2019-10-28 18:40, Surya Teja wrote:

> Hi
> In the log messages of the dhcpd I see few strange messages like
> reuse_lease: lease age 173843 (secs) under 25% threshold, reply with
> unaltered, existing lease for 192.168.1.6
>  reuse_lease: lease age 713 (secs) under 25% threshold, reply with
> unaltered, existing lease for 192.168.1.81
>
> Does any one has any idea what does this reuse lease means ?
> Just FYI: I have added a statement one-lease-per-client true; to my
> conf recently as i am facing no free lease issues because of roaming
> clients, does this impact the environment and cause problem which
> leading the above log messages?
>
> Thanks in advance
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: reuse_lease: lease age logs

Teja
Hi Glenn
Thanks for reply but I have few basic doubts, 
when only a small amount of the lease time has passed ---->
when can we see this type of situation ?
FYI: The lease time for the scopes is one hour in my config,
Do I need to add any config statement in dhcpd.conf or increase lease-time to stabilize the environment 

Thanks in advance

On Mon, Oct 28, 2019 at 1:41 PM <[hidden email]> wrote:
Hi Surya,

It's a server optimisation for when only a small amount of the lease
time has passed. Rather than go through the whole process to creatge a
new lease and update the leases file, the server replies with the
existing lease information and the time remaining. It makes no real
difference to the client, but for a busy server it can save a lot of I/O
and processing as the lease file doesn't need to be updated. It's
probably unrelated to the one-lease-per-client setting.

regards,
Glenn

On 2019-10-28 18:40, Surya Teja wrote:
> Hi
> In the log messages of the dhcpd I see few strange messages like
> reuse_lease: lease age 173843 (secs) under 25% threshold, reply with
> unaltered, existing lease for 192.168.1.6
>  reuse_lease: lease age 713 (secs) under 25% threshold, reply with
> unaltered, existing lease for 192.168.1.81
>
> Does any one has any idea what does this reuse lease means ?
> Just FYI: I have added a statement one-lease-per-client true; to my
> conf recently as i am facing no free lease issues because of roaming
> clients, does this impact the environment and cause problem which
> leading the above log messages?
>
> Thanks in advance
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: reuse_lease: lease age logs

glenn.satchell
This is not de-stabilising your environment, it is improving it.

Most dhcp clients request an update when 50% of the lease time has
passed. In your case of a one hour lease this would be every 30 minutes.
But say the client decided to renew after 5 minutes. The dhcp server
recognises this and responds with the lease information and an expiry
time of 55 minutes (the remaining time since the lease was originally
issued). The client now has a lease with 55 minutes remaining, which is
the exact same amount of time as it would have had, if it didn't renew.
When 50% of this time passes the client tries to renew again and this
time get a new one hour lease.

The only difference is that for the early renew the dhcp server did not
need to go through the full cycle to obtain a new lease, update the
lease file, etc.

If the client only renews when 50% of the lease has expires you will
probably never see this. You don't need to do anything about it.

You can adjust this by setting dhcp-cache-threshold in dhcpd.conf.
Please read the dhcpd.conf man page for details on the setting.

regards,
-glenn

On 2019-10-28 20:08, Surya Teja wrote:

> Hi Glenn
> Thanks for reply but I have few basic doubts,
> when only a small amount of the lease time has passed ---->
> when can we see this type of situation ?
> FYI: The lease time for the scopes is one hour in my config,
> Do I need to add any config statement in dhcpd.conf or increase
> lease-time to stabilize the environment
>
> Thanks in advance
>
> On Mon, Oct 28, 2019 at 1:41 PM <[hidden email]> wrote:
>
>> Hi Surya,
>>
>> It's a server optimisation for when only a small amount of the lease
>>
>> time has passed. Rather than go through the whole process to creatge
>> a
>> new lease and update the leases file, the server replies with the
>> existing lease information and the time remaining. It makes no real
>> difference to the client, but for a busy server it can save a lot of
>> I/O
>> and processing as the lease file doesn't need to be updated. It's
>> probably unrelated to the one-lease-per-client setting.
>>
>> regards,
>> Glenn
>>
>> On 2019-10-28 18:40, Surya Teja wrote:
>>> Hi
>>> In the log messages of the dhcpd I see few strange messages like
>>> reuse_lease: lease age 173843 (secs) under 25% threshold, reply
>> with
>>> unaltered, existing lease for 192.168.1.6
>>> reuse_lease: lease age 713 (secs) under 25% threshold, reply with
>>> unaltered, existing lease for 192.168.1.81
>>>
>>> Does any one has any idea what does this reuse lease means ?
>>> Just FYI: I have added a statement one-lease-per-client true; to
>> my
>>> conf recently as i am facing no free lease issues because of
>> roaming
>>> clients, does this impact the environment and cause problem which
>>> leading the above log messages?
>>>
>>> Thanks in advance
>>> _______________________________________________
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: reuse_lease: lease age logs

Teja
Thanks for detail explanation Glenn,
I have observed one more different thing, Initially I have put my lease time as 180 seconds (just for testing purpose)
Oct 29 09:08:30 server1 dhcpd[21530]: { "Operation":"Lease" ,"MSG_TYPE":"DHCP_IPV4" , "ip_address":"192.168.0.29" , "starts":"2 2019/10/29 09:07:37;" , "ends":"2 2019/10/29 09:10:37;" , "tstp":"2 2019/10/29 09:12:07;" , "tsfp":"2 2019/10/29 09:12:07;" , "atsfp":"2 2019/10/29 09:12:07;" , "cltt":"2 2019/10/29 09:07:37;" , "binding state":"active" , "next binding state":"expired" , "rewind binding state":"Ignore" , "mac_address":"xx:xx:xx:xx:xx:xx"  , "client_hostname":"dell" }
Now, I changed the lease time value to one hour (3600)
 default-lease-time 3600;
=====================
I performed renew now after changing the lease time but i got lease time as totally different (not one hour nor 3 min ) it gave me 43 minutes.
Oct 29 09:09:07 server1 dhcpd[21530]: DHCPREQUEST for 192.168.0.29 from xx:xx:xx:xx:xx:xx (dell) via eth0
Oct 29 09:09:07 server1 dhcpd[21530]: { "Operation":"Lease" ,"MSG_TYPE":"DHCP_IPV4" , "ip_address":"192.168.0.29" , "starts":"2 2019/10/29 09:09:07;" , "ends":"2 2019/10/29 09:42:07;" , "tstp":"2 2019/10/29 10:25:37;" , "tsfp":"2 2019/10/29 09:12:07;" , "atsfp":"Ignore" , "cltt":"2 2019/10/29 09:09:07;" , "binding state":"active" , "next binding state":"expired" , "rewind binding state":"Ignore" , "mac_address":"xx:xx:xx:xx:xx:xx"  , "client_hostname":"dell" }

After few minutes I performed renew again, now i got exact lease duration 
Oct 29 09:17:46 server1 dhcpd[21530]: DHCPREQUEST for 192.168.0.29 from xx:xx:xx:xx:xx:xx (dell) via eth0
Oct 29 09:17:46 server1 dhcpd[21530]: { "Operation":"Lease" ,"MSG_TYPE":"DHCP_IPV4" , "ip_address":"192.168.0.29" , "starts":"2 2019/10/29 09:17:46;" , "ends":"2 2019/10/29 10:17:46;" , "tstp":"2 2019/10/29 10:47:46;" , "tsfp":"2 2019/10/29 10:25:37;" , "atsfp":"Ignore" , "cltt":"2 2019/10/29 09:17:46;" , "binding state":"active" , "next binding state":"expired" , "rewind binding state":"Ignore" , "mac_address":" xx:xx:xx:xx:xx:xx "  , "client_hostname":"dell" }
  please Ignore Mac I changed to xx:xx:xx:....  
Not sure why it didn't worked for first renew (I don't understand why it gave the lease time of 43 min which is totally different not half of the lease time of current  i.e(1/2 hour) nor the (1/2 hour+ 3 min) )
Did any one face same situation? or does dhcpd follow any other formula to handle this type of first renew after changing the lease time.


Thanks in advance 

On Tue, Oct 29, 2019 at 9:18 AM <[hidden email]> wrote:
This is not de-stabilising your environment, it is improving it.

Most dhcp clients request an update when 50% of the lease time has
passed. In your case of a one hour lease this would be every 30 minutes.
But say the client decided to renew after 5 minutes. The dhcp server
recognises this and responds with the lease information and an expiry
time of 55 minutes (the remaining time since the lease was originally
issued). The client now has a lease with 55 minutes remaining, which is
the exact same amount of time as it would have had, if it didn't renew.
When 50% of this time passes the client tries to renew again and this
time get a new one hour lease.

The only difference is that for the early renew the dhcp server did not
need to go through the full cycle to obtain a new lease, update the
lease file, etc.

If the client only renews when 50% of the lease has expires you will
probably never see this. You don't need to do anything about it.

You can adjust this by setting dhcp-cache-threshold in dhcpd.conf.
Please read the dhcpd.conf man page for details on the setting.

regards,
-glenn

On 2019-10-28 20:08, Surya Teja wrote:
> Hi Glenn
> Thanks for reply but I have few basic doubts,
> when only a small amount of the lease time has passed ---->
> when can we see this type of situation ?
> FYI: The lease time for the scopes is one hour in my config,
> Do I need to add any config statement in dhcpd.conf or increase
> lease-time to stabilize the environment
>
> Thanks in advance
>
> On Mon, Oct 28, 2019 at 1:41 PM <[hidden email]> wrote:
>
>> Hi Surya,
>>
>> It's a server optimisation for when only a small amount of the lease
>>
>> time has passed. Rather than go through the whole process to creatge
>> a
>> new lease and update the leases file, the server replies with the
>> existing lease information and the time remaining. It makes no real
>> difference to the client, but for a busy server it can save a lot of
>> I/O
>> and processing as the lease file doesn't need to be updated. It's
>> probably unrelated to the one-lease-per-client setting.
>>
>> regards,
>> Glenn
>>
>> On 2019-10-28 18:40, Surya Teja wrote:
>>> Hi
>>> In the log messages of the dhcpd I see few strange messages like
>>> reuse_lease: lease age 173843 (secs) under 25% threshold, reply
>> with
>>> unaltered, existing lease for 192.168.1.6
>>> reuse_lease: lease age 713 (secs) under 25% threshold, reply with
>>> unaltered, existing lease for 192.168.1.81
>>>
>>> Does any one has any idea what does this reuse lease means ?
>>> Just FYI: I have added a statement one-lease-per-client true; to
>> my
>>> conf recently as i am facing no free lease issues because of
>> roaming
>>> clients, does this impact the environment and cause problem which
>>> leading the above log messages?
>>>
>>> Thanks in advance
>>> _______________________________________________
>>> dhcp-users mailing list
>>> [hidden email]
>>> https://lists.isc.org/mailman/listinfo/dhcp-users
>> _______________________________________________
>> dhcp-users mailing list
>> [hidden email]
>> https://lists.isc.org/mailman/listinfo/dhcp-users
> _______________________________________________
> dhcp-users mailing list
> [hidden email]
> https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

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