Asymmetric Lease for DHCPv4 Relay

Restrictions for Asymmetric Lease for DHCPv4 Relay

  • Asymmetric lease is supported only for the DHCP relay agent. It is not applicable to DHCP Server.

  • When there is a failover from Active to Standby RP on the short lease configured relay agent, the short lease data is lost, and the relay agent only forwards DHCP messages.

  • Liveness detection of clients by the relay agent is not supported.

  • Notifications to server by relay agent about inactive clients is not supported.

  • The server allotted T1 or T2 values should not be zero and the configured short lease value must be less than server allotted T1 value.

  • The minimum short lease value on DHCP relay agent must be 60 seconds.

  • Clients connected before activating short lease on relay come outside the purview of this feature. Clients connected after activation will be the short lease clients.

Information about Asymmetric Lease for DHCPv4 Relay

Asymmetric lease or short lease is an assigned lease that is shorter than the actual lease granted by the server. You can configure the short lease on a relay agent, which will cause the relay agent to act as the DHCP server proxy for a certain interval. The short lease provides a rebinding or restarting solution for quick failure detection and failover of relay agent. Additionally, short lease is an option to force a lease renewal for clients before the original lease expires. It detects the lease expiry early and helps to keep the clients status live.

DHCPv4 IP Assignment with Asymmetric Lease

On receiving an ACK message, the relay agent does the following:

  1. Extracts and stores the server assigned the T1 and T2 values.

  2. Validates the configured short lease value with the server that is assigned the T1 and T2 values.

  3. Modifies the ACK message and replaces the T1 and T2 values with new values defined as per short lease configuration.

Derivation of Short Lease T1’ and T2’ values

The T1 also referred to as Renew Timer is the time at which the client renews the lease. T2 or Rebind Timer represents the time at which client tries to rebind. The client sends the renewal message to the server which in turn provides the client with its addresses and configuration parameters.

The rebind message is sent after a client receives no response to a renewal message. Both T1 and T2 are time duration relative to the current time expressed in units of seconds.

On the DHCPv4 Relay Agent, the minimum allowed short lease value is 60 seconds. The T1’ can be assigned with the configured short lease value. T2’ is derived from T1’ as shown below:

T2’ = minimum (2 * T1 * 0.8, DHCPv4 Server assigned T2 value)

Renewing and Rebinding Scenarios

The relay agent modifies the ACK received from server, includes the short lease value configured on relay instead of the actual lease value and forwards the modified packet to the client.

When DHCP client requests for a short lease renewal, the relay agent does not pass the request directly to the server. Instead, the relay agent creates and sends an acknowledgement packet by adding a short lease value from the saved information.

The relay agents will continue to reply to the client renew requests until the actual lease renewal time (T1) expires. When the actual lease renewal time expires, the short lease value is no longer valid, and any subsequent renewals are directly forwarded to the server.

If the server acknowledges the request, the lease is extended, and the process starts with the relay agent responding to client’s short lease renewals with ACK packets.

When a renewal request fails, the client starts sending rebind request messages and the relay agent acknowledges these messages until actual lease rebind time (T2) expires. This creates an acknowledgement and extends the short lease. If the packet arrives after T2 expires, the short lease value is invalidated, and the packet is forwarded to the server. When the server acknowledges the request, the lease is extended, and the relay agent responds to the client’s short lease renewals with ACK packets.

The following sequence diagrams depicts the short lease renewal and rebinding in various scenarios:

Figure 1. Short lease renewal before the server assigned T1 expires
Sequence diagram depicting short lease renewal before Server assigned T1
Figure 2. Short lease renewal after the server assigned T1 expiry
Sequence diagram depicting short lease renewal after Server assigned T1 expires
Figure 3. Short lease rebind scenario
Sequence diagram depicting short lease rebind scenario
Figure 4. Short lease when the server is down
Sequence diagram depicting server failure case
Figure 5. Short lease renew and rebind handling when the Relay Agent is down
Sequence diagram depicting relay failure case

SSO and ISSU Support


Note


Only short-lease Configuration is synchronized between the active and the standby and short-lease operational data is not synchronized to standby.


The DHCP relay agent detects when the active RP is failing over to the standby RP and keeps the states related to interfaces. Only when configuration sync happens, operational data including the binding is not synchronised. Hence, any subsequent Renew or Rebind request from a client will be forwarded to the Server. Relay (new Active) will create the binding and establish short lease data for each client when server responds with ACK just like new clients.

Configuring Asymmetric Lease for DHCPv4 Relay

You can apply the Asymmetric lease configuration on per interface or globally for all interfaces.

  • Configuring Asymmetric Lease on an Interface

  • Configuring Asymmetric Lease in Global Configuration Mode

Configuring Asymmetric Lease on an Interface for DHCPv4 Relay

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. interface type number
  4. ip dhcp relay shortlease time in seconds
  5. end

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Device# configure terminal

Enters global configuration mode.

Step 3

interface type number

Example:


Device(config)# interface Ethernet 0/0

Specifies an interface type and number, and enters interface configuration mode.

Step 4

ip dhcp relay shortlease time in seconds

Example:


Router(config-if)# ip dhcp relay short-lease 500

Sets and enables the short lease for the client on the interface. You can set the lease time in seconds. The range is from 60 to 3600 seconds.

Step 5

end

Example:


Device(config-if)# end

Returns to privileged EXEC mode.

Configuring Asymmetric Lease in Global Configuration Mode for DHCPv4 Relay

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. ip dhcp-relay short-lease time in seconds
  4. end

DETAILED STEPS

  Command or Action Purpose

Step 1

enable

Example:


Device> enable

Enables privileged EXEC mode.

  • Enter your password if prompted.

Step 2

configure terminal

Example:


Device# configure terminal

Enters global configuration mode.

Step 3

ip dhcp-relay short-lease time in seconds

Example:


Router(config-if)# ip dhcp relay short-lease 500

Sets and enables the short lease for the client globally. You can set the lease time in seconds. The range is from 60 to 3600 seconds.

Step 4

end

Example:


Device(config-if)# end

Returns to privileged EXEC mode.

Configuration Examples for the Asymmetric Lease for DHCPv4 Relay

Example: Configuring the Asymmetric Lease on an Interface for DHCPv4 Relay

The following example demonstrates the configuration of the ‘ip dhcp relay short-lease’ command to allow short lease configuration on an interface level:
Router # configure terminal
Enter configuration commands, one per line. 
End with CNTL/Z.
Router (config)# interface Ethernet0/0.100
Router (config-subif)# ip dhcp relay ?
information DHCP relay information option sourceinterface
Set source interface for relayed messages short-lease
Set and enable short lease for clients
Router(config-if)#ip dhcp relay short-lease ?
<60-3600> Short Lease in Seconds
Router(config-if)#ip dhcp relay short-lease 500 ?
<cr> <cr>

Example: Configuring the Asymmetric Lease in Global Configuration Mode for DHCPv4 Relay

The following example demonstrates the configuration of the ‘ip dhcp relay short-lease’ command to allow short lease configuration on a global level:

Router# configure terminal
Enter configuration commands, one per line. 
End with CNTL/Z.
Router(config)#ip dhcp-relay ? information Relay agent
information option global configuration source-interface 
Set source
interface for relayed messages short-lease 
Set and enable Short
Lease for Client
Router(config)#ip dhcp-relay short-lease ?
<60-3600> Short Lease in Seconds
Router(config)#ip dhcp-relay short-lease 300 ?
<cr> <cr>
Router# show running-config | sec short-lease ip
dhcp-relay short-lease 300

Verifying the Configuration

To verify the short lease configuration, enable both the debug ip dhcp server events and debug ip dhcp server packet details commands on the relay device.

The following logs will be generated when the DHCP client requests IP address:

*Jun 22 03:06:57.686: DHCPD: forwarding BOOTREPLY to client
0063.6973.636f.2d61.6162.622e.6363.3030.2e30.3330.302d.4574.30
2f.30.
*Jun 22 03:06:57.686: DHCPD: Forwarding reply while saving
lease state
*Jun 22 03:06:57.686: DHCPD: Keeping state: Received DHCPACK
*Jun 22 03:06:57.686: DHCPD: lease time = 7200
*Jun 22 03:06:57.686: DHCPD: Server ID saved in Binding =
10.0.0.1
*Jun 22 03:06:57.686: DHCPD: Giaddr Address = 20.0.0.1
*Jun 22 03:06:57.686: DHCPD: Updated short lease data
T1' = 500, T2' = 800 T1 = 3600 T2 = 6300 Lease = 7200
*Jun 22 03:06:57.686: DHCPD: Updated short-lease T1 to 500 and
T2 to 800 in BOOTREPLY
The highlighted logs show that T1 and T2 values were updated to
user configured values (T1' = 500, T2' = 800). 
the `show ip dhcp binding` command displays the relay binding created for the short lease.
Router#show ip dhcp binding Bindings from all
pools not associated with VRF:
IP address Client-ID/ Lease expiration
Type State Interface
Hardware address/
User name
20.0.0.2 aabb.cc00.0300 Jun 22 2022 10:36 AM
Relay Active Ethernet0/1 Router#

Feature Information for Asymmetric Lease for DHCPv4 Relay

The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.

Table 1. Feature Information for Asymmetric Lease for DHCPv4 Relay

Feature Name

Releases

Feature Information

Asymmetric Lease for DHCPv4 Relay

This feature allows you to manage or change the lease renewal. It provides options to force renewal of lease and also detects when the lease is nearing the expiry date.