Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, August 27, 2012 1:50 AM
I noticed the lease duration to on our DHCP servers are set for 0 days 0 hours 0 minutes on the DHCP subnets that handle wireless access point users.
I assume the people who worked here in the past did this because they wanted the leases to expire as soon as the users leave, turn off their device or walk into a different subnet and are then assigned yet another IP address out of another scope's pool, but isn't 0 too short? Doesn't the clients normally try to renew leases at 50% of the lease duration? So what happens when the lease is 0? Constant renewal requests?
There must be some scenario where 0 is useful lease period or Microsoft would not have made zero a configurable choice.
All replies (7)
Monday, August 27, 2012 4:32 AM ✅Answered
A zero lease causes a lot of DHCP traffic. The 50% and 7/8% rule don't apply with a 0 day lease. The only useful reason is to make the IP immediately available as soon as they shutdown, disconnect from the network, etc.
The option to configure DHCP for a 0 day Lease is not a Microsoft implementation. It's a DHCP RFC industry implementation that all DHCP servers follow, including Microsoft, ISC, etc.
I believe DHCP is defined in the following RFCs:
2131
2132
3135
etc.
Here's a search on it that you can see some of the other RFCs that define it:
http://www.bing.com/search?q=DHCP+rfc&qs=n&form=QBRE&pq=dhcp+rfc&sc=4-8&sp=-1&sk=
https://www.google.com/search?q=dhcp+rfc&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.
Monday, August 27, 2012 2:33 PM ✅Answered
The way it works, is if there is a 0 lease length, as long as the client is never shut down, it always keeps the lease. When it shuts down properly, such as clicking on Start, Shutdown, and not simply powered off by holding the power button or unplugging it, the client will sned a DHCPRELEASE. If it's shut down hard, the way it handles it, depends on the operating system:
.
.
==================================
Restarting a Windows Vista, XP, 2003 and previous DHCP client:
If the DHCP Server is unreachable and the DHCP Client machine goes in the Rebinding State, it will not lose the IP until the lease expires; however, if we reboot the client machine or disable and enable the NIC it will lose the IP and goes in a discover stage.”
Related links for Windows Vista, 2008, XP, 2003 and older:
“If the DHCP Server is unreachable and the DHCP Client machine goes in the Rebinding State, it will not lose the IP till the lease expires; however, if we reboot the client machine or disable and enable the NIC it will lose the IP and goes in a discover stage.”
Windows Vista does not keep its DHCP IP address if a DHCP server is not available
http://support.microsoft.com/kb/958336
==================================
Restarting a Windows 7 or 2008 R2 DHCP client:
If the client had a current lease prior to the restart, upon restart, it will attempt the RA sequence. If a DHCP server doesn't respond with an ACK, it then attempts to ping the gateway address from it's previous configuration to see if the IP config it previously had is on the same network.
If the gateway responds, it will keep it's current lease for the remainder of the lease and continues on with the 50% and the 87.5% rule of the RA sequence.
If the gateway doesn't respond, the RA sequence kicks in, it releases its current configuration, and starts a fresh DORA sequence,
Related links for Windows 7 & 2008 R2:
DHCP Client States in the Lease Process (Vista, 7, 2008 & 2008 R2 and newer): Good link with a process flowchart.
http://technet.microsoft.com/en-us/library/cc958935.aspx
Restarting a DHCP Client http://technet.microsoft.com/en-us/library/cc958945.aspx
.
.
As far as the Zero Lease Length:
As for whether to use it or not, honestly this the first time I've ever seen a post on a 0 lease length. I don't think I know anyone that uses it. I would imagine the intentions are to have an unlimited lease length. And it's a possibility that an admin would implement it thinking to have a client hold a specific IP indefinitely for some purpose, such as something on the client that needs access to and wants to have it keep the same IP, etc. I would imagine a better solution is to implement a lease, implement DHCP credentials & add it to the DnsUpdateProxy group (to prevent duplicate records in DNS), and implement scavenging to keep the DNS records clean. And I can tell you one thing, if the lease time is less than 24 hours, scavenging will not work properly.
To add on this portion of the topic, here are my notes on it:
.
.
==================================
Scanvenging settings and DHCP Lease Periods
The scavenging period must be set less than the lease time. The way you have it currently set, you have two different settings but both are beyond the lease time. Due to both of these settings being different and beyond the lease time, is why you are getting inconsistencies, as I previously mentioned.
For example: The 7 and 7 day intervals work hand in hand with a default DHCP lease time of 8 days. DHCP renewals are half the lease interval right, whcih is 4 days. If it doesn't get renewed, then it waits until 87.5% of the lease time to renew, which is at the 7th day. If it doesn't get renewed, then the lease is lost, and the DHCP client will attempt to get a new lease. Once the lease is lost at the 7th day, then if you left scavenging set to default, it will clean out that old lease entry from DNS in all zones it existed in.
With your current settings, that is not happening. If you have an 8 hour lease, you'll need to set scavenging for 1 day, but that is not a recommended setting. It's simply too low. Also an 8 hour lease tries to renew at 50% of the lease time, and if unsuccessful, at 87.5% of the lease time, which is at the 7th hour. Scavening needs to be set below that, but scavenging settings are in days, which is at 24 hours intervals, so there's no possible way to set it below the lease time.
Also, a lease time of 8 hours, or even 4 hours, as I've heard some admins have set it to, is really an aggressively short lease and can cause other problems elsewhere, such as with WINS and replication partners. I've seen errors in WINS in a partnership scenario where the data is constantly changing and WINS simply couldn't keep up with the changes between partners.
My suggestion is at least that if you want to keep an aggressively short lease, to at least make the lease period 2 days and scavenging 1 day.
However, I've been in environments with the default 8 day lease and 7 day scavenging settings, along setting either using credentials so DHCP owns all records it updates, or using the DnsProxyUpdate group, and it works fine. If a laptop gets a record at 8am on a Monday, but unplugs and goes home and comes back on Thursday, the laptops will attempt to get the same lease. If the laptop doesn't come back until Tuesday the following week, it will get a new lease and new IP, since DHCP owns the record, it simply updates it in DNS for the forward and reverse zones.
To properly make it work using the DnsProxyUpdate group and using credentials, you must force DHCP to update ALL RECORDS, whether the client knows how to update or not or requests it or not (the bottom setting). This will force DHCP to own ALL records. If you do not set these settings, and the scavenging period is more than the lease, unexpected results will occur.
And here's what happens with a client with less than 24 hour period (such as a 0 lease):
Optimizing your network to keep your DNS squeaky clean
Quoted: "The customer’s VPN solution was a major brand name concentrator, which used IAS for user authentication. We dropped the leases for those pools down to 3 hours. That means that after 3 hours, the records will vanish from DNS if the client has not renewed the lease."
http://blogs.technet.com/b/networking/archive/2009/02/09/optimizing-your-network-to-keep-your-dns-squeaky-clean.aspx
.
How DNS Scavenging and the DHCP Lease Duration Relate,
Sean Ivey [MSFT], 6/3/2011
http://blogs.technet.com/b/askpfe/archive/2011/06/03/how-dns-scavenging-and-the-dhcp-lease-duration-relate.aspx
==================================
.
.
I'm only looking for information about this specific scenario and why you should or should not use 0 length lease duration for dhco scopes that have devices coming and going every few minutes.
At lease I hope I was able to answer the question as to why you wouldn't want to use a 0 lease length.
.
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.
Monday, August 27, 2012 4:39 AM
I do think they wanted the IP addresses to be made available to a different client as soon as they were off the network.
So if the 50% and 7/8th rule doesn't apply, how does the lease get renewed if it is set to 0 days?
What kind of traffic is there and what is a better way to handle cleaning out leases for wireless devices that come and go quickly?
Monday, August 27, 2012 6:13 AM
You'll still see DORA traffic for the client to get an IP, but there is no RA (renewal). At shutdown, the client will send a DHCPRELEASE to the DHCP server. DORA is discussed in this recent thread:
THread: "New DHCP install/cutover"
http://social.technet.microsoft.com/Forums/en-US/winserverNIS/thread/8e7f6165-4a8d-4af2-8e77-950024e2ae54
.
Complete process and what to look for if you're capturing traffic (DHCPOFFER, DHCPDISCOVER, etc):
How DHCP Technology Works
http://technet.microsoft.com/en-us/library/cc780760(v=ws.10).aspx
.
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.
Monday, August 27, 2012 6:24 AM
That sounds like LESS traffic if there are no renewal traffic on 0 minute leases.
There is not going to be a DHCP release if the client is simply taken out of range of WIFI rather than shut down gracefully while on the network,
How is the IP address released if there is no release comand from the client and how if the IP held if there is no renewal or specified lease length with this setting?
I'm only looking for information about this specific scenario and why you should or should not use 0 length lease duration for dhco scopes that have devices coming and going every few minutes.
Monday, August 27, 2012 5:02 PM
They did not want an unlimited lease length and we don't want that either. More like the opposite. They may have wanted the DHCP lease to instantly drop when the user's WIFI connection drops.
We want the IP addresses to be made available to the next person who connects to the wireless as quickly as possible even if the previous user of the IP address did not shut down gracefully through the start menu (no DHCP release ran before they left the network). Since they are mobile devices, some people will be walking around with smartphones on the WIFI and simply walk out of the building and their WIFI connection will just drop when they are out of range and their phones and iPads will lose the connection somewhere out in the parking lot. This is very common. A few users might also walk out of range with laptops connected to WIFI and not get a clean DHCPRELEASE.
You are saying that even in a very high turnover network, the DHCP leases should be minimum length of 2 days and 1 day scavenging. IP addresses from abruptly disconnected devices such as smartphones and tablets will be unavailable for redistribution for 24-48 hours even if the device was on that WIFI subnet for only a few minutes. That may be too long and there would be a risk of running out of IP addresses for that subnet.
On the subnets used for wireless, having an IP addresses available in DHCP is at a higher priority than the DNS host records being correct. In that scenario, does zero minute lease duration work as desired (drop the reservation instantly when the device drops its connection abruptly without issuing a DHCPRELEASE)?
I don't understand how it keeps its 0 day reservation at all if it is not sending out renewal requests at 50% and 7/8th like a normal length reservation unless it is doing something else to keep its reservation alive.
Monday, August 27, 2012 5:55 PM
There is no renewal requests with a 0 day. For two reasons, 50% or 7/8% of 0 is 0, and 0 means indefinite.
0 day just gives a client an IP, and DHCP is done with them. And it's not a reservation. It's a lease.
Maybe you can create a separate VLAN for the wireless clients and double the subnet size by adding a host bit, and not use a zero lease.
And make sure everything else is configured as discussed above and your other thread, which at this time, I think are related:
http://social.technet.microsoft.com/Forums/en-US/winserverNIS/thread/7c09f16a-426e-45cb-ab9f-a0b36bdbdc2e/
Ace Fekay
MVP, MCT, MCITP/EA, MCTS Windows 2008/R2 & Exchange 2007, Exchange 2010 EA, MCSE & MCSA 2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer
Microsoft MVP - Directory Services
Technical Blogs & Videos: http://www.delawarecountycomputerconsulting.com/
This post is provided AS-IS with no warranties or guarantees and confers no rights.