DHCP for IPv6


The Dynamic Host Configuration Protocol for IPv6(DHCPv6) has been standardized by the IETF through RFC3315. The Dynamic Host Configuration Protocol for IPv6 (DHCP) enables DHCP servers to pass configuration parameters, such as IPv6 network addresses, to IPv6 nodes. It offers the capability of automatic allocation of reusable network addresses and additional configuration flexibility. This protocol is a stateful counterpart to "IPv6 Stateless Address Autoconfiguration" (RFC 2462), and can beused separately, or concurrently with the latter, to obtain configuration parameters.
The basic DHCPv6 client-server concept is similar to using DHCP for IPv4. If a client wishes to receive configuration parameters,it will send out a request on the attached local network to detect available DHCPv6 servers. This done through the “Solicit” and “Advertise” messages. Well known DHCPv6 Multicast addresses are used for this process. Next, the DHCPv6 client will ”Request” parameters from an available server which will respond with the requested information with a “Reply” message. The diagram below demonstrates the sequence of events: 

The DHCPv6 client will know when it wants to use DHCPv6, either based upon instruction of an attached router, or when no default gateway is present. The default gateway has two configurable bits in an Router Advertisement (RA) available for this purpose:

• ‘O’ bit—When this bit is set, the client can use DHCPv6 to retrieve Other configuration parameters (ie: DNS addresses)
• ‘M’ bit—When this bit is set, the client may use DHCPv6 to retrieve a Managed IPv6 address from a  DHCPv6 server

When a router sends an RA with ‘O’ bit set, but does not set the ‘M’ bit, the client can do Stateless Address Autoconfiguration (SLAAC) to obtain its IPv6 address, and use DHCPv6 for obtaining additional information. (An example of additional information is DNS). This mechanism is well known as Stateless DHCPv6, because the DHCPv6 server does not need to keep track of the client address bindings.

DHCPv6 uses an architecture concept of “options” to carry additional parameters and information within DHCPv6 messages. These options are aligned in Type- Length-Value (TLV) structure. Each Type and Length field has a length of 16 bits, with a variable length available for the Value field.



Table 1 DHCPv6 vs. DHCPv4 Message Type Comparison

New DHCPv6 Message Type Overview CONFIRM (4)
A client sends a Confirm message to any available server to determine whether the addresses it was assigned are still appropriate to the link to which the client is connected.

RELAY-FORW (12)
A relay agent sends a Relay-forward message to relay messages to servers, either directly or through another relay agent.

RELAY-REPL (13)
A server sends a Relay-reply message to a relay agent containing a message that the relay agent delivers to a client.


DHCPv6 performs on the assumption that the DHCPv6 server is directly attached to the LAN segment of the client. If this is not the situation (which is the case in most deployments), then the DHCPv6 server can be replaced by a DHCPv6 Relay agent. This Relay agent will encapsulate the received messages from the directly connected DHCPv6 client, and forward these encapsulated DHCPv6 packets towards the DHCPv6 server. In the opposite direction, the Relay Agent will decapsulate the packets received from the central DHCPv6 Server.

Well known multicast addresses commonly used with DHCPv6 are:
• “ff02:::1:2” (All DHCPv6 relay agents and servers)
• “ff05::1:3” (All DHCPv6 Servers)

Well known port numbers:
• Clients listen for DHCP messages on UDP port 546
• Servers and relay agents listen for DHCP messages
on UDP port 547

Note:
DHCP Unique Identifier (DUID)—Each DHCPv6 component has a DUID (DHCPv6 Unique Identifier) which is used to identify the device when exchanging DHCPv6 messages.
 IA_NA Option—Options related to an IPv6 Address hop-count—Number of relay agents that have relayed this message
link-address—A global or site-local address that will be used by the server to identify the link on which the client is located.
peer-address—The address of the client or relay agent from which the message to be relayed was received.