IPv6 Application Services-DHCPv6

The Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is a technology that dynamically manages and configures IPv6 addresses in a centralized manner. It is designed to assign IPv6 addresses and other network configuration parameters to hosts. DHCPv6 uses the client/server model. A client requests configurations such as the IPv6 address and DNS server address from the server, the server replies with requested configurations based on policies.

In stateless address auto-configuration (SLAAC), routers do not record the IPv6 addresses of the hosts, therefore stateless address auto-configuration has poor manageability. In addition, hosts configured with stateless address autoconfiguration cannot obtain other configuration parameters such as the DNS server address. ISPs do not provide instructions for automatic allocation of IPv6 prefixes for routers. Users therefore need to manually configure IPv6 addresses for devices during IPv6 network deployment.

As a stateful protocol for configuring IPv6 addresses automatically, DHCPv6 solves this problem. During stateful address configuration, the DHCPv6 server assigns a complete IPv6 address to a host and provides other configuration. Parameters such as the DNS server address and domain name. A relay agent may be used to forward DHCPv6 packets, however lies outside of the scope of this material. The DHCPv6 server binds the IPv6 address to a client, improving overall network manageability.

Clients and servers exchange DHCP messages using UDP. The client uses a linklocal address, determined through other mechanisms for transmitting and receiving DHCP messages. Clients listen for DHCP messages on UDP port 546, whilst servers (and relay agents) listen for DHCP messages on UDP port 547

Prior to the allocation of addresses, it should be clearly understood that an IPv6 node (client) is required to generate a link-local address and be successfully evaluated by the Duplicate Address Detection (DAD) process. Following this, a link router discovery process is involved, for which the IPv6 client node broadcasts a Router Solicitation (RS) message, and the link router responds with a Router Advertisement (RA) message after receiving the RS message. 

Contained within the RA message are numerous fields containing configuration parameters for the local network. One field in particular referred to as the Autoconfig Flags field, is an 8 bit field that contains two specific bit values to determine the auto-configuration process for the local network. A “managed address configuration flag” (M) is a 1 bit value that is for defining whether stateful address configuration should be used, commonly applied in the presence of a DHCPv6 server on the local network. Where the value is set to 1, stateful addressing should be implemented, meaning the IPv6 client should obtain IPv6 addressing through stateful DHCPv6. 

The other stateful configuration flag (O) represents the second flag bit value in the Autoconfig Flags field, and defines whether other network configuration parameters such as DNS and SNTP (for time management servers) should be determined through stateful DHCPv6. RFC2462 defines that where the M bit is true (a value of 1), the O bit must also be implicitly true, however in practice the M bit and the O bit may be defined interchangeably to support stateless addressing services in DHCPv6, in which an IPv6 address is not assigned but configuration parameters are.

It should also be noted that the managed address flag and other configuration flag is managed through VRP on the router, and is not set in the RA message by default. In order to set these flags, the commands ipv6 nd autoconfig managedaddress-flag and ipv6 nd autoconfig other-flag should be configured on the gateway responsible for generating RA messages.

Client nodes initiated on a network supporting stateful addressing may be serviced by one or more DHCPv6 servers. The IPv6 client uses a link-local address assigned to the interface for which it is requesting configuration information as the source address in the header of the IPv6 datagram.

The multicast address FF02::1:2 is a reserved multicast address that represents “All_DHCP_Relay_Agents_and_Servers”, and is used by a client to communicate with neighboring servers. All servers (and relay agents) are members of this multicast group. For any client sending a DHCP message to the All_DHCP_Relay_Agents_and_Servers address, it is expected that the client send the message through the interface for which configuration information is being requested, however exceptions may occur to this rule where two interfaces on the client are associated with the same link, for which it is possible for the alternative interface to be used. In either case the link local address of the forwarding interface must be used as the source address.

Obtaining stateful addressing and other parameters from a DHCPv6 server requires a series of messages be sent. A client initially sends a solicit message to locate servers, from which addressing and configuration parameters can be received.

Following the solicit message, a DHCPv6 server supporting the link will generate an advertise message in response to the solicit message, that indicates to the client, the IPv6 address of the server, providing the required DHCPv6 service. The client is then capable of using this IPv6 address to reference the DHCPv6 server and generate a request message. Where multiple servers respond to the solicit message, the client will need to decide which DHCPv6 server should be used, typically defined by a server preference value defined by the DHCPv6 administrator on the server, and carried in the advertise message. Additionally the server may carry options including a server unicast option which enables the client to use the IPv6 address of the DHCPv6 server to transmit further correspondence with this server as unicast messages.

The request message is transmitted to the selected DHCP server to request configuration parameters and one or multiple IPv6 addresses to be assigned. Finally the DHCPv6 server responds with a Reply message that contains the confirmed addresses and network configuration parameters.

DHCP may also be employed to support stateless configuration in the event where a host is capable of retrieving IPv6 addressing information through stateless configuration means, and requires only specific configuration parameters from the DHCPv6 server. In such events Information-request messages are generated, and sent by clients to a server to request configuration parameters. The client is able to obtain configuration information such as server addresses and domain information, as a list of available configuration parameters, using only a single message and reply that is exchanged with a DHCP server.

The Information-Request message is sent to the “All_DHCP_Relay_Agents_and_Servers” multicast address following which servers respond with a Reply message containing the configuration information for the client. Since no dynamic state is being maintained (i.e. in the form of IPv6 address assignment) the allocation of configuration information is understood to be stateless.

A DHCP Unique Identifier (DUID) is a value that is used to distinguish between each client and DHCP server, for which only one DUID is present in each case. Clients may have one or multiple interfaces for which each will be assigned an IPv6 address along with other configuration parameters and is referenced using an Identity Association Identifier (IAID). These are used together with DUID to allow DHCPv6 servers to reference a client and the interface address/configuration parameters that should be assigned.

In the case of each client, the DUID will be used to identify a specific DHCP server with which a client wishes to communicate. The length of the DUID value can vary from anywhere in the range of 96bits (12 bytes) to 160 bits (20 bytes), depending on the format that is used. Three such formats exist, using either the link-layer (DUID-LL) address, a combination of the link-layer address and enterprise number (DUID-EN), a vendor assigned value at the point of device manufacture, or a combination of the link-layer address and a timestamp value (DUID-LLT) generated at the point of DUID creation in seconds from midnight Jan 1st 2000 (GMT), modulo 232.

The initial 16 bit values (00:01) represent the format used, where “00:01” denotes the DUID-LLT format, “00:02” the DUID-EN format and “00:03” the DUID-LL format. In the case of the DUID-LL and DUID-LLT formats, the 16 bits immediately after represent the hardware address based on IANA hardware type parameter assignments, with 00:01 representing Ethernet (10Mb) and 00:06 defining IEEE 802 network standards. A time stamp follows in the DUID-LLT format and finally the link layer address value. For DUID-LL only the link layer address follows.

The DUID format can be assigned through the dhcpv6 duid command, for which either the DUID-LL or DUID-LLT format can be applied. The DUID-LL format is applied by default. For the DUID-LLT, the timestamp value will reference the time from the point at which the dhcpv6 duid llt command is applied. The display dhcpv6 duid command can be used to verify the current format based primarily on the length of the DUID value, as well as the DUID value itself.

The implementation of stateful addressing requires that an address pool be defined with a typical address prefix defined for the given range, as well as pool specific parameters. The example demonstrates how a pool is created with the defining of a pool and associated pool name, as well as the address prefix from which the range of host addresses will be allocated.

Excluded addresses refer to addresses that comprise of the pool range however should not be allocated through DHCP since they are commonly used for other applications such as the interface address of the DHCP server. Additional configuration parameters will also be specified for a given pool with examples such as server addresses and domain names being specified for parameter allocation to DHCPv6 clients.

A created DHCPv6 pool is required to be associated with an interface through which it will service DHCP clients. An IPv6 address is assigned to the interface of the DHCPv6 server and the interface then associated with the address pool. In this case the excluded address value has been used to represent the interface address in order to ensure no attempts are made by the DHCPv6 server to assign the interface address to a DHCP client.

The resulting configuration of the DHCPv6 server can be clarified through the display dhcpv6 pool command, from which point the defined pool(s) can be identified and the address prefix associated with the pool determined. Additional information such as the lifetime can be viewed, for which the default lifetime of a leased address is 86400 seconds, or 1 day and can be reconfigured as necessary using the information-refresh command under the dhcpv6 pool <pool-name> view. Where active clients have leased addresses from the DHCP server, the related statistics can be found here.

The AR2200 series router is capable of supporting Link Layer (DUID-LL) and Link Layer with Time (DUID-LLT) formats.

When a router advertisement is received containing M and O bit values set to 1, the client will perform discovery of a DHCPv6 server for stateful address configuration. The configuration will include an IPv6 address and also other configuration information such as prefixes and addressing of servers providing services such as DNS.