lease length

Jeff Haran jharan at Brocade.COM
Wed Feb 3 23:12:37 UTC 2010


> -----Original Message-----
> From: dhcp-users-bounces+jharan=brocade.com at lists.isc.org 
> [mailto:dhcp-users-bounces+jharan=brocade.com at lists.isc.org] 
> On Behalf Of Simon Hobson
> Sent: Wednesday, February 03, 2010 10:51 AM
> To: Users of ISC DHCP
> Subject: RE: lease length
> 
> Jeff Haran wrote:
> 
> >However, based on my testing it would appear that the leases offered 
> >by dhcpd wont be quite that long.
> >
> >What I found was that the longest lease dhcpd would offer to a 
> >client extends to the end of the Unix epoch in 2038.
> 
> Which makes sense, since there is no way to encode lease end times 
> past then in the space available.
> 

The lease time in the packet is an unsigned 32 bit number of seconds that contains the duration of the lease, not the time at which the lease will expire in the Unix epoch (seconds since 1/1/1970). So even if there is no special meaning to lease time == 0xffffffff, that puts the max date of expiration of a lease that is granted today (I think I got this right, not accounting for leap years) in the year 2146.

> >A long time, but not infinite.
> 
> True, but in practical terms it can't make a huge amount of 
> difference. Hand up anyone who genuinely thinks that they'll have a 
> system in use for the next 14 years without a single reboot (or 
> interface going down) and where a lease renewal an half the lease 
> time is likely to cause a problem ?
> 
> -- 
> Simon Hobson

All I can say, as somebody who wrote plenty of Y2K uncompliant code back in the 70s because everybody around me said those systems wouldn't be in use long enough for it to make a difference, is "never say never". 8^)

DHCP is being used in places outside of corporate LANs where the Windoze PC clients need to be rebooted every other day just to keep them running sanely between reboots. Who knows how long an intelligent power meter nailed to the side of your house that reports your electric usage to the power company via a DHCP assigned IP address is going to be up?

The source code for the version of the dhcpcd client Brocade uses in it's FibreChannel switches includes the following snippet:

  if ( *(unsigned int *)DhcpOptions.val[dhcpIPaddrLeaseTime] == 0xffffffff )
    {
      syslog(LOG_INFO,"infinite IP address lease time. Exiting\n");
      exit(0);
    }

We didn't add that. That was in the open source package. It would be nice if we could ask for an "infinite" lease and get one back from the server and conclude that because we know we will never have to renew the lease we can just terminate the client and thus use the memory it was running in for other embedded systems purposes.

Granted, there appears to be nothing in the IPv4 DHCP RFCs to justify this intepretation of 0xffffffff as infinite, but it would be a handy extension for some applications.

Jeff Haran
Brocade Communications



More information about the dhcp-users mailing list