DHCP Relay

A DHCP relay agent transparently transmits DHCP messages between a DHCP client and a DHCP server that reside on different network segments. The DHCP relay function allows DHCP clients and DHCP server that are not part of the same network to communicate.

DHCP relay is usually implemented on a specific interface of a router. This interface requires an IP relay address that is the IP address of the DHCP server specified on the DHCP relay agent. The DHCP relay-enabled interface sends the broadcast DHCP messages that it receives to the specified DHCP server.

DHCP Client Requesting an IP Address Through a DHCP Relay Agent for the First Time

The process of a DHCP client requesting an IP address through a DHCP relay agent for the first time varies according to the setting of the flags field value, as shown in Figure 1 and Figure 2.
  • If the flags field value is set to 1, the DHCP relay agent broadcasts DHCP reply messages to the DHCP client.

    Figure 1 DHCP client requesting an IP address through a DHCP relay agent for the first time (the flags field value is set to 1)
  • If the flags field value is set to 0, the DHCP relay agent unicasts DHCP reply messages to the DHCP client.
    Figure 2 DHCP client requesting an IP address through a DHCP relay agent for the first time (the flags field value is set to 0)
  1. When a DHCP client starts and initializes DHCP, it broadcasts a configuration request packet (DHCPDISCOVER message) onto a local network. After a DHCP relay agent connecting to the local network receives the broadcast packet, it processes and forwards the packet to the specified DHCP server on another network.

  2. After receiving the packet, the DHCP server sends the requested configuration parameters in a DHCPOFFER message to the DHCP client through the DHCP relay agent.

  3. The DHCP client replies to the DHCPOFFER message by broadcasting a DHCPREQUEST message.

    Upon receipt, the DHCP relay agent sends the DHCPREQUEST message in unicast mode to the DHCP server.

  4. The DHCP server responds with a unicast DHCPACK or DHCPNAK message through the DHCP relay agent.

DHCP Client Extending the IP Address Lease Through the DHCP Relay Agent

An IP address dynamically assigned to a DHCP client usually has a validity period. The DHCP server withdraws the IP address after the validity period expires. To continue using the IP address, the DHCP client must renew the IP address lease.

The DHCP client enters the binding state after obtaining an IP address. The DHCP client has three timers to control lease renewal, rebinding, and lease expiration. When assigning an IP address to the DHCP client, the DHCP server can specify timer values. If the DHCP server does not specify timer values, the default values are used. Table 1 describes the three timers.

Table 1 Timers

Timer

Description

Default Value

Lease renewal

When the lease renewal timer expires, the DHCP client automatically sends a DHCPREQUEST message to the DHCP server that has assigned an IP address to the DHCP client. The DHCP client then enters the update state, as shown in Figure 3.

If the IP address is valid, the DHCP server responds with a DHCPACK message to notify the DHCP client that the DHCP client has obtained a new IP address lease, and the DHCP client re-enters the binding state. If the IP address is invalid, the DHCP server responds with a DHCPNAK message, and the DHCP client enters the initializing state.

50% of the lease

Rebinding

After the DHCP client sends a DHCPREQUEST message for extending the lease, the DHCP client remains in the update state and waits for a response. If the DHCP client does not receive any responses from the server before the rebinding timer expires, it considers the original DHCP server unavailable and broadcasts a DHCPREQUEST message. Any DHCP server on the network shown in Figure 4 can reply to this request with a DHCPACK or DHCPNAK message.

If the DHCP client receives a DHCPACK message, it returns to the binding state and resets the lease renewal timer and rebinding timer, as shown in Figure 3. If the DHCP client receives a DHCPNAK message, it stops using the current IP address immediately and returns to the initializing state to apply for a new IP address.

87.5% of the lease

Lease expiration

When the lease expires, the DHCP client stops using the current IP address and returns to the initializing state to apply for a new IP address.

100% of the lease

Figure 3 DHCP client extending the IP address lease by 50% through the DHCP relay agent

Figure 4 DHCP client extending the IP address lease by 87.5% through the DHCP relay agent

DHCP Relay Agent Supporting VPN Instances

A DHCP relay agent must support VPN instances to transmit DHCP packets between VPNs. To ensure successful DHCP packet transmission between VPNs, there must be reachable VPN routes. If a DHCP server and a DHCP client reside on different VPNs, the DHCP relay agent can transmit a DHCP request message to the VPN where the DHCP server resides and transmit a DHCP reply message to the VPN where the DHCP client resides. A DHCP relay agent can be deployed in CE1-PE1-PE2-CE2 networking, where the DHCP server connects to one CE and the DHCP client connects to the other CE. Both CE1 and CE2 can belong to the same VPN or different VPNs.

DHCP Relay Agent Sending DHCPRELEASE Messages to the DHCP Server

A DHCP relay agent can send a DHCPRELEASE message, carrying an IP address to be released, to the DHCP server.

When a DHCP client cannot send requests to the DHCP server to release its IP address, you can configure the DHCP relay agent to release the IP address assigned by the DHCP server to the DHCP client.

DHCP Relay Agent Setting the Priority of a DHCP Reply Message and TTL Value of a DHCP Relay Message

  • A DHCP relay agent can set the priority of DHCP reply messages. The priority of low-priority DHCP reply messages can be raised so that they will not be discarded on access devices.
  • A DHCP relay agent can set the TTL value of DHCP relay messages. The TTL value of DHCP relay messages can be increased to prevent the messages from being discarded due to TTL becoming 0.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >