IPv6 NDP Explained: Router Solicitation and Router Advertisement
Router Discovery enables hosts to discover routers on the network and obtain relevant routing information.
- When Host A joins a network, it may send a Router Solicitation (RS) message to the all-routers multicast address.
- Routers on the network respond to the RS message with Router Advertisement (RA) messages.
- RA messages contain important information such as the default gateway address, prefix information, and other configuration options.
- Host A processes the RA messages to determine the default router and configure its own networking parameters accordingly.
It’s important to note that NDP operates on the link layer, making use of ICMPv6 (Internet Control Message Protocol for IPv6) messages to perform various tasks. These ICMPv6 messages carry NDP-specific options and information.
The Router Solicitation (RS) and Router Advertisement (RA) messages are key components of the IPv6 Neighbor Discovery Protocol (NDP) and serve the purpose of router discovery and configuration on the network.
I- Router Solicitation (RS)
Router Solicitation (RS): The RS message is sent by a host to discover routers on the network. It is an ICMPv6 message sent to the all-routers multicast address (ff02::2).
- Hosts use RS messages to determine the presence and availability of routers on the network.
- RS messages trigger routers to respond with RA messages, providing important configuration information.
Example: Suppose a new host, Host A, joins a network and wants to discover routers. It sends an RS message as a multicast packet to the all-routers multicast address.
II- Router Advertisement (RA)
Router Advertisement (RA): The RA message is sent by routers in response to RS messages or periodically to provide configuration information to hosts on the network. It is an ICMPv6 message sent to the all-nodes multicast address (ff02::1) or as a unicast message to a specific host.
- Routers use RA messages to announce their presence, network parameters, and other configuration options to hosts.
- Hosts use RA messages to learn about the default router, network prefixes, and other relevant network information.
The RA message contains various configuration options such as:
- Default router information: The IPv6 address of the router serving as the default gateway for the network.
- Prefix information: The IPv6 network prefix used on the network.
- MTU (Maximum Transmission Unit): The maximum packet size that hosts should use for transmission on the network.
- Other network configuration options: Such as DNS server addresses, time servers, and more.
Upon receiving the RA message, Hosts processes it and learns about the router’s presence, default gateway, network prefix, and other configuration information. Host A can then configure its own network parameters accordingly.
Router Advertisement Flags:
Router Advertisement (RA) messages are used by routers to inform neighboring devices about network configuration parameters. These RA messages can include various options, including prefix options, which provide information about IPv6 address prefixes and their associated flags. Here are the detailed explanations of the prefix flags commonly used in IPv6 RA options:
- On-link Flag (L): This flag indicates whether a given prefix is considered on-link or not. If the L flag is set, it means that hosts can use addresses within that prefix to communicate directly with other hosts on the same link. If the flag is not set, hosts should use a router to reach hosts in that prefix.
- Autonomous Address-Configuration Flag (A): This flag indicates whether a given prefix can be used by hosts for autonomous address configuration using mechanisms like stateless address autoconfiguration (SLAAC). When the A flag is set, hosts can generate their own addresses within the prefix. If the flag is not set, hosts should not use that prefix for address configuration.
- Router Address Flag (R): This flag indicates whether the prefix can be used for assigning addresses to routers. If the R flag is set, hosts can assign the prefix to an interface on the device acting as a router. This flag is typically used by routers to advertise the prefixes they can serve as a default gateway for.
- Home Agent Flag (H): This flag is used to indicate that the advertised prefix is a home network prefix, specifically for Mobile IPv6. The H flag is used by routers to indicate that they can act as a home agent for Mobile IPv6, providing services to mobile nodes.
- Router Preference (Prf): This field represents the preference level of the router that is sending the RA message. It is used to convey the desirability of using a specific router as the default gateway. The Prf field can have three values: High (0x00), Medium (0x40), or Low (0x80). Routers with a higher preference value are preferred over routers with lower values.
These flags and options provide important information to hosts and devices on the network, allowing them to configure their addresses and make routing decisions accordingly. The combination of these flags helps in controlling address allocation, routing behavior, and network topology in an IPv6 environment.
For more details and Wireshark capture of the process, please refer to the following post: