DHCPv6 Relay Agent Implementation
Figure 1 shows the working process of a DHCPv6 relay agent. A DHCPv6
client sends packets to a DHCPv6 server through a DHCPv6 relay agent
to obtain IPv6 addresses, prefixes, and other network configuration
parameters, such as IPv6 addresses of DNS servers.
Figure 1 DHCPv6 relay agent implementation
The working process of a DHCPv6 relay agent is as follows:
- A DHCPv6 client sends DHCPv6 Request packets with the destination
multicast address FF02::1:2 to all DHCPv6 servers and DHCPv6 relay
agents.
A DHCPv6 relay agent processes packets in the following two
ways:
If a DHCPv6 relay agent and a DHCPv6 client are located on
the same link, that is, the DHCPv6 relay agent is the first-hop relay
agent of the DHCPv6 client, the DHCPv6 relay agent is the IPv6 gateway
of the DHCPv6 client. After receiving a packet from the DHCPv6 client,
the DHCPv6 relay agent encapsulates the packet in the Relay Message
option of a Relay-Forward packet. Then the DHCPv6 relay agent sends
the Relay-forward packet to a DHCPv6 server or the next hop relay
agent.
- If the DHCPv6 relay agent and DHCPv6 client are on different links,
the DHCPv6 relay agent receives Relay-Forward packets sent from other
relay agents. The DHCPv6 relay agent constructs a new Relay-Forward
packet and sends the packet to the DHCPv6 server or the next hop relay
agent.
- The DHCPv6 server parses the request of the DHCPv6 client in the
Relay-Forward packet and selects IPv6 addresses and other network
configuration parameters to construct a reply packet. Then the DHCPv6
server encapsulates the reply packet in the Relay Message option in
a Relay-Reply packet and sends the Relay-reply packet to the DHCPv6
relay agent.
- The DHCPv6 relay agent parses the reply packet of the DHCPv6 server
in the Relay-Reply packet and forwards the reply packet to the DHCPv6
client. If the DHCPv6 client receives reply packets from multiple
DHCPv6 servers, the DHCPv6 client selects the DHCPv6 server with the
highest priority, and obtains the IPv6 address and other network configuration
parameters from the DHCPv6 server.