Router discovery is used to locate a neighboring device and learn the address prefix and configuration parameters related to address auto-configuration. IPv6 router discovery is implemented based on the following messages: -
Router Solicitation (RS) message When a host is not configured with a unicast address, for example, when the system is just started, it sends an RS message. An RS message helps the host to rapidly perform address auto-configuration without waiting for the RA message periodically sent by an IPv6 device. An RS message is an ICMPv6 message with the type of 133. -
Router Advertisement (RA) message Interfaces on each IPv6 device periodically send RA messages only when they are enabled to send IPv6 RA messages. After receiving the RS message of an IPv6 device on the local link, a device responds with an RA message. An RA message is sent to the all-nodes multicast address (FF02::1) or to the IPv6 unicast address of the node that sends the RS message. An RA message is an ICMPv6 message with the type of 134, containing the following information: - Whether to adopt address auto-configuration.
- Supported auto-configuration type: stateless or stateful.
- One or multiple on-link prefixes. On-link nodes can perform address auto-configuration by using these address prefixes.
- Lifetime of the advertised on-link prefixes
- Whether the device that sends an RA message can be used as a default device. If yes, the lifetime, expressed in seconds, of the default device is also included.
- Other information about the host, such as the hop limit and the MTU that specifies the maximum size of the packet initiated by a host.
After an IPv6 node on the local link receives the RA message, it extracts the preceding information to obtain the updated default device list, prefix list, and other configurations. Address Auto-configuration Through an RA message and the flag of each prefix, a device can instruct hosts on how to perform address auto-configuration. For example, the device can specify stateful or stateless address auto-configuration for the hosts. In the case of stateless address auto-configuration, after a host receives an RA message, it uses the prefix information in the message and local interface ID to automatically form an IPv6 address, and sets the default device according to the default device information in the message. Redirection Redirect messages are used to inform hosts of the optimal next-hop IPv6 address to the destination. Similar to IPv4, an IPv6 device sends a Redirect message only to reroute packets to a proper device. The node that receives the Redirect message then sends subsequent packets to the proper device. A device sends Redirect messages only for unicast traffic, and Redirect messages are sent to and processed by only the source node that triggers redirection. |