This tutorial explains the IPv6 stateless address autoconfiguration process in detail. Learn what the autoconfiguration process is, how it works, and what the autoconfiguration states are.
Every node in the network requires a unique IP address to communicate and exchange data with other notes. There are multiple ways to configure IP addresses on nodes. One such way is the address autoconfiguration. The address autoconfiguration is a feature of IPv6. It allows nodes to automatically configure IPv6 addresses for them.
The IPv6 address consists of 128 binary bits. These bits are divided into two equal portions. The first 64 bits are known as the network ID (network address) and the last 64 bits are known as the interface ID (host address). An interface ID identifies the interface in the subnet. A network ID identifies a group of interfaces in the network.
The address autoconfiguration process automatically creates the network ID and interface ID of the address based on several factors. Let's discuss these factors and how the autoconfiguration process works in detail.
Autoconfiguration process
When we start an IPv6 interface, the interface checks whether a valid IP configuration exists. If a valid IP configuration does not exist, the interface automatically initiates the address autoconfiguration process.
In the first step, the autoconfiguration process creates a link-local address. A link-local address allows the interface to communicate with other interfaces on the same link. To create a link-local address, the interface uses the following procedure.
To create the network ID, the first 10 bits are set to 1111 1110 10 and the remaining 54 bits are set to 0. In hexadecimal notation, the binary number 1111111010 is written as the FE80. In IPv6, a continuous set of 0 can be abbreviated as double colons (::). Because of these two rules, the network ID of the link-local address always remains as FE80::/64.
To create the interface ID, the interface uses the EUI-64 algorithm. This algorithm uses the hardware address (MAC) of the interface. The hardware address consists of 48 bits. The first 24 bits identify the company while the last 24 bits identify the interface. The EUI-64 algorithm inserts the hexadecimal value FFFE (16 bits in binary) between the company identifier and the interface identifier. It also sets the 7th bit of the MAC address to 1 which indicates that the address is locally defined.
Let's take an example. Suppose the MAC address of an interface is AC:62:E8:49:5F:62. Then the link-local address created by the autoconfiguration process will be FE80::AE62:E8FF:FE49:5F62. In this address, FE80:: is the network ID (address) and AE62:E8FF:FE49:5F62 is the interface ID (address).
The following image shows how the interface ID is calculated in this address.
No two interfaces can use the same address. Before assigning the created address to the interface, the autoconfiguration process verifies that the created address is unique. An address that uniqueness is not verified is known as a tentative address.
To verify the uniqueness of the address, the autoconfiguration process starts the second phase.
In the second phase, the host sends a Neighbor Solicitation message to the address created in the first phase. If the created address is already used, the interface that is using the address replies with a Neighbor Advertisement message.
To learn IPv6 message types and their meaning in detail, you can the following tutorial.
If the host receives a Neighbor Advertisement message in the response to the sent Neighbor Solicitation message, it indicates that the address is already used. If the host does not receive any response to the sent Neighbor Solicitation message, it indicates that the address is not used.
If the created address is already used, the host stops the autoconfiguration process. At this point, manual configuration needs to be performed on the node. If the created address is not used, the host assigns the address to the interface. At this point, the interface can communicate with other interfaces on the same link.
After assigning the link-local address, the host starts the third phase of the autoconfiguration to acquire the site-local and global addresses. Before we learn the third phase of autoconfiguration, let briefly discuss two related terms. These terms are stateful autoconfiguration and stateless autoconfiguration.
In stateful autoconfiguration, a node receives an IP configuration or some part of the IP configuration from a DHCP server. In the stateless autoconfiguration, a node automatically configures its IP configuration either based on several factors or based on the information received from an IPv6 router.
A link-local address configured by the autoconfiguration process is an example of a stateless configuration. A site-local and global address can be configured from both methods. To configure these addresses through the stateful method, configure a DCHP server to provide IP configuration and configure nodes to obtain IP configuration from the DHCP server.
In this tutorial, we will discuss only the stateless configuration. We will discuss stateful configuration separately in the next tutorial.
In the third phase of the autoconfiguration process, the host sends router solicitation messages. If routers present on the link, they reply with router advertisement messages. A router advertisement specifies how the third phase of autoconfiguration should be performed.
Router advertisements contain information about the prefix and options. The most common options are the hop limit, reachable time, retransmission timer, and maximum transmission unit. If the options are set in the advertisement, the host configures the corresponding parameters accordingly.
The following image shows the steps of the autoconfiguration process that have been explained so far.
The prefix information is used to generate site-local and global addresses. The advertisement may contain zero, one, or more prefix information. For each prefix information, the host takes the following action.
It checks the autonomous address-configuration flag. If the value of this flag is set to 1, the host can use the information available in the advertisement to generate addresses by using the stateless configuration method.
If the autonomous address-configuration flag is set 1, the host checks another options in the prefix. These options are the subnet prefix and the lifetime values of the subnet prefix. The lifetime values indicate how long addresses that are generated from the subnet prefix remain valid.
The subnet prefix is used to generate site-local and global addresses. The process of generating the new address is the same. To generate the network ID, the subnet prefix is used. To generate the interface ID, the hardware address of an appropriate interface and EUI-64 algorithm is used.
Once the address is created, to verify the uniqueness of the address, the host uses the same steps that it uses to verify the uniqueness of the link-local address. The following image shows how the prefix information is used to create the site-local and global addresses.
Address autoconfiguration states
An address created through the address autoconfiguration process goes through the five states. The following image shows these states.
Tentative
Any address created through the autoconfiguration process remains in the tentative state until the uniqueness of the address is verified. In the tentative state, a node can't use the address to receive unicast traffic. However, it can use the address to receive and process Neighbor Advertisement messages received in response to the Neighbor Solicitation messages.
Preferred
Once the uniqueness of the address is verified, the address enters the preferred state. In the preferred state, the address can be used for unlimited communications. A node uses the preferred address to send and receive unicast traffic. The preferred lifetime field in the prefix information option of a router advertisement message defines the period of time that an address can remain in the tentative and preferred state.
Deprecated
From the preferred state, the address enters the deprecated state. In this state, the node can use the address for existing communication sessions but it can't use the address to start the new communication.
Valid
The valid state represents how long an address can be used for unicast communication. Since an address can be used for unicast communication in both the preferred and deprecated state, the valid state includes both states. The Valid lifetime field in the prefix information option of a router advertisement message defines the sum of the times that an address can remain in the tentative, preferred, and deprecated states.
Invalid
From the preferred state, the address enters in the invalid state. In this state, the address can no longer be used to send and receive unicast traffic. An invalid address indicates that the valid lifetime of the address has expired.
That's all for this tutorial. If you like this tutorial, please share it with friends via your favorite social networking sites and subscribe to our YouTube channel.