ND snooping listens on the ICMPv6-based ND packets to create the prefix management table and dynamic ND snooping binding table. The ND snooping enabled device manages IPv6 addresses of access users through the prefix management table and filters out invalid ND packets received by untrusted interfaces through the dynamic ND snooping binding table.
For a host that obtains an IPv6 address through stateless address autoconfiguration, the IPv6 address is generated based on the prefix in an RA packet. After ND snooping is enabled on a device, the device captures RA packets sent from the trusted interface and generates a prefix management table based on the RA packets. An entry in the prefix management table contains IPv6 address information, including the prefix, prefix length, and prefix lease. The information helps network administrators manage IPv6 addresses easily.
A dynamic ND snooping binding entry contains the source IPv6 address, source MAC address, VLAN ID, and inbound port of a packet. A device can check NA, NS, or RS packets against the dynamic ND snooping binding table to filter bogus NA, NS, or RS packets.
Entry Creation and Update Mechanism of the Dynamic ND Snooping Binding Table
After ND snooping is configured, a device creates entries in the dynamic ND snooping binding table by checking DAD NS packets and updates entries in the dynamic ND snooping binding table by checking NS packets (DAD NS and common NS packets) or NA packets.
The device creates and updates entries in the dynamic ND snooping binding table as follows:
Scenario 1: The device receives a DAD NS packet.
The device checks whether the corresponding prefix management entry exists based on the Target Address field in the packet.
Target Address indicates the destination IP address. It can be a link-local address, site-local address, or global address, but cannot be a multicast address.
If no such entry exists, the device discards the NS packet.
Scenario 2: The device receives a common NS packet.
The device checks whether the corresponding dynamic ND snooping binding entry exists based on the Source Address field in the packet.
If no such entry exists, the device checks whether ND packet validity check is enabled. If so, the device discards the packet. If not, the device forwards the packet.
Scenario 3: The device receives an NA packet.
Check whether the interface that receives the NA packet is one of the following interfaces: interface that has the dhcp snooping disable command configured, interface that has the dhcp snooping trust or nd snooping trust command configured, and interface that does not have the nd snooping check na enable command configured.
If so, the device forwards the NA packet.
After the device receives an NA packet conflicting with an ND snooping binding entry and user status detection is enabled, periodic user status detection is suspended.
Aging Mechanism of Dynamic ND Snooping Binding Entries
The aging mechanism of dynamic ND snooping binding entries is as follows:
If the address lease expires, the matching binding entry automatically ages out.