How do you discover neighbors in an IPv6 network?
This issue shares IPv6-related knowledge with you.
ICMPv6 Protocol Overview
ICMPv6 is one of the important basic protocols in IPv6;
ICMPv6 is mainly used for network diagnosis, error message delivery, neighbor discovery, multicast discovery, IPv6 stateless address configuration, etc.;
The following is the basic format of ICMPv6 packets:
The Type field defines the message type of the ICMPv6 packet;
The Code field depends on the Type value and can be used to break down the ICMPv6 packet into more specific uses.lThe following are some important uses and classifications of ICMPv6 packets, among which neighbor discovery is the most important part and the basis for IPv6 neighbor nodes to communicate with each other.
Determine the neighbor link layer address
The first function of neighbor discovery is to determine the neighbor's link layer address. The IPv6 protocol system eliminates ARP and uses ICMPv6 to discover the neighbor's link layer address;
Determine the neighbor link layer address through the interaction of NS and NA, where NS stands for Neighbor Solicitation (neighbor discovery) and NA stands for Neighbor Advertisement (neighbor announcement);
The workflow for determining the neighbor link layer address is as follows:
Duplicate Address Detection
Another function of neighbor discovery is duplicate address detection (DAD);
Duplicate address detection is also achieved through the interaction between NS and NA;
The working principle of duplicate address detection is as follows:
Router discovery
The routers in the network can also be discovered through neighbor discovery messages;
Router discovery is achieved through the interaction between RA and RS, where RA stands for Router Solicitation.
RS stands for Router Advertisement
The working principle of router discovery is as follows:
IPv6 address automatic configuration
IPv6 address automatic configuration can be divided into stateless address automatic configuration (SLAAC) and stateful address automatic configuration (DHCPv6);
Whether to use stateless address automatic configuration or stateful address automatic configuration is determined by the server;
The client determines whether to use stateless or stateful address configuration through the M and O flags in the RA packet replied by the server;
Since IPv6 address resources are sufficient, in actual applications, the terminals can obtain IPv6 public network addresses.
(1) SLAAC: Stateless Address Autoconfiguration
The Stateless Address Autoconfiguration (SLAAC) protocol is applicable to scenarios where the server does not need to strictly control the IPv6 address used by the client.
The SLAAC protocol is implemented through the interaction between RA and RS. The detailed process is as follows:
(2) DHCPv6: Stateful Address Automatic Configuration
Dynamic Host Configuration Protocol for IPv6, abbreviated as DHCPv6, is a protocol dedicated to automatic configuration of IPv6 addresses. Obtaining IPv6 addresses through DHCPv6 is also called stateful address automatic configuration.
DHCPv6 defines multiple packet types (Msg-type). The most important address application is mainly implemented by four types of packet interactions: Solicit, Advertise, Request, and Reply.
Stateful address autoconfiguration is suitable for scenarios where the server needs to strictly control the IPv6 addresses used by the client;
Stateful address autoconfiguration address acquisition is mainly achieved through DHCPv6 interaction, which also involves the process of router discovery and duplicate address detection. The main process is as follows: