| Communication protocol | |
| Abbreviation | DHCPv6 |
|---|---|
| Purpose | Provide IPv6 addresses and additional network configuration parameters to clients in an IPv6 network. |
| Developer(s) | Michael Carney Charles E. Perkins Bernie Volz Ted Lemon Jim Bound |
| Introduction | June 2003 |
| Based on | Dynamic Host Configuration Protocol for IPv4 |
| OSI layer | Layer 7 Application |
| Port(s) | UDP port 546, for Clients. UDP port 547, for Servers and relay agents. |
| RFC(s) | 8415, 3319, 3646, 4704, 5007, 6355, 6939, 7653 |
| Internet protocol suite |
|---|
| Application layer |
| Transport layer |
| Internet layer |
| Link layer |
The Dynamic Host Configuration Protocol version 6 (DHCPv6) is a network protocol for configuring Internet Protocol version 6 (IPv6) hosts with IP addresses, IP prefixes, and other configuration data required to operate in an IPv6 network. It is not just the IPv6 equivalent of the Dynamic Host Configuration Protocol for IPv4.
IPv6 hosts may automatically generate IP addresses internally using stateless address autoconfiguration (SLAAC), or they may be assigned configuration data with DHCPv6, or both.
DHCPv6 and SLAAC are complementary services. Unlike the Neighbor Discovery Protocol (NDP) used by SLAAC, DHCPv6 can not only assign single unicast addresses, but also entire prefixes in prefix delegation. For example, an ISP's router can provide a prefix to a customer's router via DHCPv6 so that the customer's router can assign addresses to the customer's many devices via either DHCPv6 or SLAAC. This allows routers for residential networks to be configured with no operator intervention.
DHCPv6 also allows the distribution of information other than what SLAAC/NDP provides on a given network: this works even without DHCPv6 managing the distribution of network addresses. The standard method for a SLAAC/NDP network to hand out Domain Name System (DNS) server settings is via setting a flag in the Router Advertisement (RA) message telling the clients to ask for such settings over DHCPv6, [1] : §4.2 although this specific use case is being replaced via a nonstandard extension of the RA message. [2] Still, there remains a plethora of DHCPv6 options for providing additional information not handled by SLAAC/NDP, much like the wide range of information conveyed by legacy DHCP options. [3]
Finally, DHCPv6 also offers a stateful approach, which provides more control over SLAAC's stateless approach.
DHCPv6 uses IPv6 multicast addresses to enable communication between clients, relay agents, and servers when unicast addresses are not yet known. RFC 8415 defines two well-known multicast groups for this purpose.
| Multicast address | Name | Scope | Used by | Purpose |
|---|---|---|---|---|
| ff02::1:2 | All_DHCP_Relay_Agents_and_Servers | Link-local | Clients | Discover on-link DHCPv6 servers and relay agents |
| ff05::1:3 | All_DHCP_Servers | Site-local | Relay agents | Forward client messages to all DHCPv6 servers within a site |
All DHCPv6 servers and relay agents must join the appropriate multicast groups on relevant interfaces.
Notes
Clients listen for DHCP messages on UDP port 546. Servers and relay agents listen for DHCP messages on UDP port 547. [4] : §7.2
The DHCP unique identifier (DUID) is used by a client to get an IP address from a DHCPv6 server. It has a 2-byte DUID type field, and a variable-length identifier field up to 128 bytes. Its actual length depends on its type. The server compares the DUID with its database and delivers configuration data (address, lease times, DNS servers, etc.) to the client.
Four DUID types are identified: [4] : §11
| Type | Name | Description |
|---|---|---|
| 1 | DUID-LLT | link-layer address plus time |
| 2 | DUID-EN | Vendor-assigned identifier based on Enterprise Number |
| 3 | DUID-LL | link-layer address |
| 4 | DUID-UUID | Universally Unique Identifier (UUID) |
DUID-LLT (Type 1) consists of:
The time component reduces the likelihood of collisions if the same link-layer address is reused on another device. Devices using DUID-LLT must store the generated identifier in stable, non-volatile storage and continue using it even if the original network interface is removed.
This type is recommended for general-purpose computing devices such as desktops, laptops, and printers, that provide writable persistent storage.
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | DUID-Type (1) | hardware type | ||||||||||||||||||||||||||||||
| 4 | 32 | time | |||||||||||||||||||||||||||||||
| 8 | 64 | link-layer address (variable length) | |||||||||||||||||||||||||||||||
| 12 | 96 | ||||||||||||||||||||||||||||||||
| 16 | 128 | ||||||||||||||||||||||||||||||||
| 20 | 160 | ||||||||||||||||||||||||||||||||
DUID-EN (Type 2) is assigned by the device vendor and consists of:
The identifier must be unique per device and stored in non-volatile storage. This type is commonly assigned during manufacturing or at first boot in virtualized environments.
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | DUID-Type (2) | enterprise-number | ||||||||||||||||||||||||||||||
| 4 | 32 | enterprise-number (cont.) | |||||||||||||||||||||||||||||||
| 8 | 64 | identifier (variable length) | |||||||||||||||||||||||||||||||
| ⋮ | ⋮ | ||||||||||||||||||||||||||||||||
| 34 | 272 | ||||||||||||||||||||||||||||||||
DUID-LL (Type 3) consists of:
Unlike DUID-LLT, no time value is included. This type is intended for devices with a permanently attached network interface and no writable persistent storage. It should not be used if the permanence of the interface cannot be guaranteed.
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | DUID-Type (3) | hardware type | ||||||||||||||||||||||||||||||
| 4 | 32 | link-layer address (variable length) | |||||||||||||||||||||||||||||||
| 8 | 64 | ||||||||||||||||||||||||||||||||
| 12 | 96 | ||||||||||||||||||||||||||||||||
| 16 | 128 | ||||||||||||||||||||||||||||||||
DUID-UUID (Type 4) uses a 128-bit UUID as its identifier.
DUID-UUID consists of:
Its usage and UUID selection rules are defined in RFC 6355. This type is suitable for devices that already store a UUID in firmware or platform configuration.
| Offset | Octet | 0 | 1 | 2 | 3 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Octet | Bit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 0 | 0 | DUID-Type (4) | |||||||||||||||||||||||||||||||
| 4 | 32 | Universally Unique Identifier | |||||||||||||||||||||||||||||||
| 8 | 64 | ||||||||||||||||||||||||||||||||
| 12 | 96 | ||||||||||||||||||||||||||||||||
| 16 | 128 | ||||||||||||||||||||||||||||||||
Due to the fact that it is difficult to manage multiple identifiers in a dual-stack environment, and the fact that DUIDs are simply not optimal for some situations, RFC 6939 was released, giving a way to identify a host based on its MAC address. It defines a way for a DHCPv6 relay to pass that information to a DHCPv6 server.
In this example, without rapid-commit present, the server's link-local address is fe80::0011:22ff:fe33:5566 and the client's link-local address is fe80::aabb:ccff:fedd:eeff.
This table lists the DHCPv6 message types.
| Code | Name | RFC |
|---|---|---|
| 1 | SOLICIT | RFC 8415 |
| 2 | ADVERTISE | RFC 8415 |
| 3 | REQUEST | RFC 8415 |
| 4 | CONFIRM | RFC 8415 |
| 5 | RENEW | RFC 8415 |
| 6 | REBIND | RFC 8415 |
| 7 | REPLY | RFC 8415 |
| 8 | RELEASE | RFC 8415 |
| 9 | DECLINE | RFC 8415 |
| 10 | RECONFIGURE | RFC 8415 |
| 11 | INFORMATION-REQUEST | RFC 8415 |
| 12 | RELAY-FORW | RFC 8415 |
| 13 | RELAY-REPL | RFC 8415 |
| 14 | LEASEQUERY | RFC 5007 |
| 15 | LEASEQUERY-REPLY | RFC 5007 |
| 16 | LEASEQUERY-DONE | RFC 5460 |
| 17 | LEASEQUERY-DATA | RFC 5460 |
| 18 | RECONFIGURE-REQUEST | RFC 6977 |
| 19 | RECONFIGURE-REPLY | RFC 6977 |
| 20 | DHCPV4-QUERY | RFC 7341 |
| 21 | DHCPV4-RESPONSE | RFC 7341 |
| 22 | ACTIVELEASEQUERY | RFC 7653 |
| 23 | STARTTLS | RFC 7653 |