Automatic address assignment follows the principle of „plug and play“. Devices request configuration data (local or global IPv6 addresses, additional important parameter values on demand). This is important for mobile users (like notebooks, mobile phones, smartphones, etc.) too. This functionality reduces the management effort.
Two versions are defined:
- Stateless automatic configuration
- Stateful automatic configuration (using e.g. Dynamic Host Configuration Protocol (DHCP))
Offers „plug and play“ for network elements. During initialization a network element may request following data:
- IPv6 prefix
- Default IPv6 router address
- Hop limit
- (Link-local) Maximum Transmission Unit (MTU) size
- Validity period of data
- No DNS addresses
Note: RFC 6106 IPv6 Router Advertisement Options for DNS Configuration describes a method to advertise DNS data. Take care of implemented solutions. In dual stack operation, IPv4 DNS addresses may be requested using DHCPv4.
Hosts may automatically receive IPv6 addresses in a multi-step procedure (defined in RFC 4862, IPv6 Stateless Address Autoconfiguration, SLAAC)
Routers have to be configured manually or use the IPv6 Prefix Option (RFC 3633) for automatic prefix assignment using DHCPv6.
A server should be configured manually.
IPv6 Link-local addresses (these are IPv6 addresses used for e.g. point-to-point links) are normally configured automatically.
Renumbering (RFC 4862)
Renumbering is defined as the allocation of a new prefix to an interface. This mechanism is used to change IPv6 addresses (e.g. in case of provider changes).
In case of autoconfigured IPv6 addresses, a host receives its new IPv6 prefix by prefix announcements of another system (e.g. router).
See RFC 4192 Procedures for Renumbering an IPv6 Network without a Flag Day.
Note: check for implementation of this function in your router or firewall.
Stateful automatic configuration is defined in RFC 3315 and describes a client/server protocol. It should be used where no router was found or a router allows the use of DHCPv6.
DHCPv6v servers „listen“ for certain multicast IPv6 addresses:
- All_DHCP_Relay_Agents_and_Servers (ff02::1:2)
- All_DHCP_Servers (ff05::1:3)
DHCPv6 relay stations „listen“ for requests to IPv6 address ff02::1:2 and forward requests of clients to the DHCPv6 server.
Note #1: Updates to RFC 3315 can be found in RFC 4361, RFC 5494, RFC 6221, RFC 6422, RFC 6644
Note #2: a „stateless“ DHCPv6 (RFC 3736) is defined as well, in this case, configuration data (e.g. DNS or SIP server addresses,…) are assigned to stations, but no IPv6 addresses.
Three Types of Autoconfiguration
Stateless: a node receives configuration data in ICMP Router Advertisement messages (with Prefix Information option and Autonomous Flag = 1, Managed Address Configuration Flag = 0 and other Stateful Configuration Flag = 0).
Stateful: a node requests configuration data using DHCPv6, in cases where ICMP-Router Advertisement messages were received without Prefix Information option and Managed Address Configuration or Other Stateful Configuration Flag = 1.
Both versions: a node receives configuration data in ICMP Router Advertisement messages (with Prefix Information option and Autonomous Flag = 1 and Managed Address Configuration or Other Stateful Configuration Flag = 1).
The same holds true for all three versions: an IPv6 link-local address will always be automatically configured.
Process of Autoconfiguration
The interface will be initialized at system startup or enabled by system management and attached to a link.
Use of a link-local address (according to RFC 4862):
Creation of link-local address:
- Creation of link-local- prefix fe80:: (according to RFC 4291).
- The address bits to the right of the link-local prefix are set to all zeroes. If the length of the interface identifier is N bits, the right-most N bits of the address are replaced by the interface identifier.
- If the sum of the link-local prefix length and N is larger than 128 autoconfiguration fails and manual configuration is required.
Note: the interface identifier is typically the EUI-64 address.
Duplicate Address Detection:
Duplicate Address Detection is performed to check the use of the same IPv6 address in other nodes. A node sends a Neighbor Solicitation message with a destination address of the calculated link-local address. If a Neighbor Advertisement response is received, autoconfiguration is aborted and the device must be manually configured. If no response is received, the IPv6 address gets assigned to the interface.
Creation of „global“ IPv6 addresses:
A node sends Router Advertisement messages periodically (max. 3 times) to the all-nodes multicast address and waits for an immediate response.
If no response was received, the node uses an address configuration protocol to obtain an IPv6 address and other configuration parameters.
If a node receives a Router Advertisement message it copies Hop Limit, Reachable Time, Retransmission Timer and MTU (if present) into the local configuration.
For each Prefix-Information option in Router Advertisement, the following is performed:
If On-Link flag = 1, prefix is copied into the prefix list.
If Autonomous flag = 1, the node creates an address of prefix and interface identifier.
After successful duplicate address check with Duplicate Address Detection, the IPv6 address gets initialized (including valid and preferred lifetime fields based on values of Valid Lifetime and Preferred Lifetime fields in Prefix-Information option).
If Managed Address Configuration Flag = 1, the node uses an address configuration protocol to obtain additional addresses.
If Other Stateful Configuration Flag = 1, the node uses an address configuration protocol to obtain additional configuration parameters.
Attention: each node in a network may get assigned a valid IPv6 address to communicate in the network! See RFC 3756, 3971, 6494, 6495 (Secure Neighbor Discovery) for more details.
About the Author:
Ronald Schlager is an independent trainer, consultant and blogger focusing on communications technologies and their application.