IPv6 neighbor discovery, address duplication detection, and router discovery mechanisms, learn about them in one minute

IPv6 neighbor discovery, address duplication detection, and router discovery mechanisms, learn about them in one minute

1. IPv6 Basics

IPv6 (Internet Protocol Version 6) is the second-generation standard protocol of the network layer protocol, also known as IPng (IP Next Generation). It is a set of specifications designed by IETF (Internet Engineering Task Force) and is an upgraded version of IPv4. The most significant difference between IPv6 and IPv4 is that the length of the IP address increases from 32 bits to 128 bits.

2. Comparison between IPv6 and IPv4 packets

IPv6 messages are more concise

3. Introduction to IPv6 Neighbor Discovery Protocol

The IPv6 Neighbor Discovery (ND) protocol uses five types of ICMPv6 messages to implement the following functions: address resolution, verifying whether neighbors are reachable, duplicate address detection, router discovery/prefix discovery, address autoconfiguration, and redirection.

1. Address resolution

Obtain the link layer address of the neighbor node on the same link (the same as the ARP function of IPv4), which is achieved through the neighbor solicitation message NS and the neighbor advertisement message NA.

  • Node A sends NS message in multicast mode. The source address of NS message is the interface IPv6 address of node A, the destination address is the request node multicast address of node B, and the message content includes the link layer address of node A and the requested target address.
  • After receiving the NS message, node B determines whether the destination address of the message is its own IPv6 address. If so, node B can learn the link layer address of node A and return the NA message in unicast mode, which contains its own link layer address.
  • Node A can obtain the link layer address of node B from the received NA message.

2. Verify that the neighbor is reachable

After obtaining the link layer address of the neighbor node, the neighbor solicitation message NS and the neighbor advertisement message NA can be used to verify whether the neighbor node is reachable.

  • The node sends an NS message, where the destination address is the IPv6 address of the neighbor node.
  • If a confirmation message is received from a neighbor node, the neighbor is considered reachable; otherwise, the neighbor is considered unreachable.

3. Duplicate address detection

When a node obtains an IPv6 address, it needs to use the duplicate address detection function to determine whether the address has been used by other nodes (similar to the free ARP function of IPv4).

  • Node A sends an NS message. The source address of the NS message is the unspecified address ::, and the destination address is the requested node multicast address corresponding to the IPv6 address to be detected. The message content includes the IPv6 address to be detected.
  • If node B has already used this IPv6 address, it will return a NA message, which contains its own IPv6 address.
  • When node A receives the NA message from node B, it knows that the IPv6 address has been used. Otherwise, it means that the address is not used and node A can use this IPv6 address.

4. Router discovery/prefix discovery and stateless address autoconfiguration

Router discovery/prefix discovery refers to a node obtaining the prefix of neighbor routers and their networks, as well as other configuration parameters from the received RA messages.

Stateless address autoconfiguration means that a node automatically configures an IPv6 address based on the information obtained through router discovery/prefix discovery.

Router discovery/prefix discovery is achieved through router solicitation messages RS and router advertisement messages RA. The specific process is as follows:

  • When a node starts, it sends a request to the router through an RS message, requesting prefixes and other configuration information for use in node configuration.
  • The router returns an RA message, which includes the prefix information option (the router also periodically issues RA messages).
  • The node uses the address prefix and other configuration parameters in the RA message returned by the router to automatically configure the IPv6 address and other information of the interface.

The prefix information option includes not only the address prefix information, but also the preferred lifetime and valid lifetime of the address prefix. After receiving the periodically sent RA message, the node will update the preferred lifetime and valid lifetime of the prefix according to the message.

  • Valid life: indicates the validity period of the prefix. During the valid life, the address automatically generated by the prefix can be used normally; after the valid life expires, the address automatically generated by the prefix becomes invalid and will be deleted.
  • Preferred lifetime: Indicates the time for stateless automatic configuration of addresses through the prefix. After the preferred lifetime expires, the address automatically configured by the node through the prefix will be abolished. The node cannot use the abolished address to establish a new connection, but can still receive messages with the destination address as the abolished address. The preferred lifetime must be less than or equal to the valid lifetime.

5. Redirection function

When a host starts up, its routing table may have only one default route to the default gateway. When certain conditions are met, the default gateway will send an ICMPv6 redirect message to the source host, informing the host to select a better next hop for subsequent message transmission (the same function as the IPv4 ICMP redirect message).

The device sends an ICMPv6 redirect message when the following conditions are met at the same time:

  • The interface for receiving and forwarding data packets is the same interface;
  • The selected route itself has not been created or modified by the ICMPv6 redirect message;
  • The selected route is not the default route of the device;
  • The forwarded IPv6 datagram does not contain the routing extension header.

<<:  Crisis! Crisis! The epidemic is a “crisis”, 5G is an “opportunity”

>>:  5G will be fully rolled out in 2020. Are 5G network and 5G frequency band the same thing?

Recommend

5G technology is expected to make various contributions to Jordan’s GDP

Recently, Ericsson commissioned management consul...

Blockchain is not to blame for the ICO being strangled!

Recently, ICO has attracted a lot of attention. F...

In-depth analysis of SSL digital certificates to protect corporate websites

An SSL certificate is a type of digital certifica...

...

The 5G license has been issued, what should we do now?

The 5G license really came a bit suddenly. People...

iQIYI Annual Card + JD Plus Membership Annual Card 138 RMB

This year, the prices of various video and music ...

9 correct views on the cancellation of data roaming charges

On July 1, data roaming charges were officially c...