The use of dynamic address allocation in DHCP means a whole new way of thinking about addresses. A client no longer owns an address, but rather leases it. This means that when a client machine is set to use DHCP dynamic addressing, it can never assume that it has an address on a permanent basis. Each time it powers up, it must engage in communications with a DHCP server to begin or confirm the lease of an address. It also must perform other activities over time to manage this lease and possibly terminate it.
The DHCP Lease "Life Cycle"Calling dynamic address assignments leases is a good analogy, because a DHCP IP address lease is similar to a “real world” lease in a number of respects. For example, when you rent an apartment, you sign the lease. Then you use the apartment for a period of time. Typically, assuming you are happy with the place, you will renew the lease before it expires, so you can keep using it. If by the time you get near the end of the lease the owner of the apartment has not allowed you to renew it, you will probably lease a different apartment to ensure you have somewhere to live. And if you decide, say, to move out of the country, you may terminate the lease and not get another at all.
DHCP leases follow a similar lease “life cycle”, which generally consists of the following phases:
Figure 259: DHCP “Life Cycle” Example
In this example, the initial lease has a duration of eight days and begins at Day 0. The T1 and T2 timers are set for 4 days and 7 days respectively. When the T1 timer expires the client enters the renewal period, and successfully renews at Day 5 with a new 8-day lease. When this second lease’s T1 timer expires, the client is unable to renew with the original server. It enters the rebinding period when its T2 timer goes off, and is granted a renewed 8-day lease with a different server. Three days into this lease it is moved to a different network and no longer needs its leased address, so it voluntarily releases it.
Renewal and Rebinding Timers
The processes of renewal and rebinding are designed to ensure that a client's lease can be extended before it is scheduled to end, so no loss of functionality or interruption occurs to the user of the client machine. Each time an address is allocated or reallocated, the client starts two timers that control the renewal and rebinding process:
Naturally, if the client successfully renews the lease when the T1 timer expires, this will result in a “fresh lease”, and both timers will be reset. T2only comes into play if the renewal is not successful. It is possible to change the amount of time to which these timers are set, but obviously T1must expire before T2, which must in turn expire before the lease itself ends. These usually are not changed from the default, but may be modified in certain circumstances.
Key Concept: DHCP leases follow a conceptual life cycle. The lease is first assigned to the client through a process of allocation; if the device later reboots it will reallocate the lease. After a period of time controlled by the renewal timer (T1), the device will attempt to renewits lease with the server that allocated it. If this fails, the rebinding timer (T2) will go off and the device will attempt to rebind the lease with any available server. The client may also release its IP address if it no longer needs it.
The lease life cycle is described in the DHCP standards in the form of states that the client moves through as it acquires a lease, uses it, and then either renews or ends it. The next section on DHCP configuration describes these states and the specific exchanges of messages between a client and server to accomplish different lease activities.