Neighbor discovery uses ICMPv6 neighbor solicitation and neighbor advertisement messages. The figure depicts the neighbor discovery process, where host A wants to communicate with host B using IPv6. Since it does not know the data link layer address (MAC address) of host B, it sends a neighbor solicitation message, and host B replies with a neighbor advertisement message.
鄰居探索使用 ICMPv6 鄰居邀請與鄰居通告訊息。下圖描繪鄰居探索的過程,主機 A 想要使用 IPv6 與主機 B 通訊。由於它不知道主機 B 的資料鏈結層位址(MAC 位址),因此傳送鄰居邀請訊息,主機 B 則以鄰居通告訊息回覆。

Neighbor discovery is a process that enables these functions:
鄰居探索是一種能實現以下功能的程序:
- Determining the data link layer address of a neighbor on the same link, like Address Resolution Protocol (ARP) does in IPv4判斷同一鏈路上鄰居的資料鏈結層位址,如同 IPv4 中位址解析協定(ARP)的作用
- Finding neighbor routers on a link尋找鏈路上的鄰居路由器
- Keeping track of neighbors追蹤鄰居狀態
- Querying for duplicate addresses查詢重複位址
The neighbor discovery process uses solicited-node multicast addresses.
鄰居探索程序使用請求節點群播位址。
Solicited-Node Multicast Address
請求節點群播位址
The solicited-node address is a multicast address that has a link-local scope. All nodes must join the solicited-node multicast group that corresponds to each of its unicast and anycast addresses. The solicited-node address is composed of the ff02:0:0:0:0:1:ff00::/104 prefix, which is concatenated with the far right 24 bits of the corresponding unicast or anycast address.
請求節點位址是具有鏈路本地範圍的群播位址。所有節點都必須加入對應其每個單播與任播位址的請求節點群播群組。請求節點位址由 ff02:0:0:0:0:1:ff00::/104 前綴,串接對應單播或任播位址最右側 24 位元所組成。
The source node creates a solicited-node multicast address using the right-most 24 bits of the IPv6 address of the destination node, and sends a Neighbor Solicitation message to this multicast address. The corresponding node responds with its data link layer address in a Neighbor Advertisement message.
來源節點使用目的節點 IPv6 位址最右側的 24 位元建立請求節點群播位址,並將鄰居邀請訊息傳送到此群播位址。對應的節點會以包含其資料鏈結層位址的鄰居通告訊息回應。
Multicast Mapping over Ethernet
乙太網路上的群播對應
A packet destined to a solicited-node multicast address is put in a frame destined to an associated multicast MAC address.
傳送到請求節點群播位址的封包,會放入傳送到相關群播 MAC 位址的框架中。
If an IPv6 address is known, then the associated IPv6 solicited-node multicast address is known. The example in the figure gives the IPv6 address 2001:db8:1001:f:2c0:10ff:fe17:fc0f. The associated solicited-node multicast address is ff02::1:ff17:fc0f.
如果已知 IPv6 位址,就可以得知相關聯的 IPv6 請求節點群播位址。圖中的範例給出 IPv6 位址 2001:db8:1001:f:2c0:10ff:fe17:fc0f,其對應的請求節點群播位址為 ff02::1:ff17:fc0f。

If an IPv6 solicited-node multicast address is known, then the associated MAC address is known, formed by concatenating the last 32 bits of the IPv6 solicited-node multicast address to 33:33
如果已知 IPv6 請求節點群播位址,就可以得知相關聯的 MAC 位址,其做法是將 IPv6 請求節點群播位址最後 32 位元串接到 33:33
As the figure shows, the IPv6 solicited-node multicast address is ff02::1:ff17:fc0f. The associated Ethernet MAC address is 33-33-ff-17-fc-0f.
如圖所示,IPv6 請求節點群播位址為 ff02::1:ff17:fc0f,對應的乙太網路 MAC 位址為 33-33-ff-17-fc-0f。
Understand that the resulting MAC address is a virtual MAC address: It is not burned into any Ethernet card. Depending on the IPv6 unicast address, which determines the IPv6 solicited-node multicast address, an Ethernet card may be instructed to listen to any of the 224 possible virtual MAC addresses that begin with 33-33-ff. In IPv6, Ethernet cards often listen to multiple virtual multicast MAC addresses and their own burned-in unicast MAC addresses.
請注意,產生的 MAC 位址是一個虛擬 MAC 位址,並未燒錄在任何乙太網路卡上。依據決定 IPv6 請求節點群播位址的 IPv6 單播位址,乙太網路卡可能會被指示監聽以 33-33-ff 開頭的 224 個可能虛擬 MAC 位址中的任何一個。在 IPv6 中,乙太網路卡通常會同時監聽多個虛擬群播 MAC 位址以及自身燒錄的單播 MAC 位址。
A solicited-node multicast is more efficient than an Ethernet broadcast used by IPv4 ARP. With ARP, all nodes receive and must therefore process the broadcast requests. By using IPv6 solicited-node multicast addresses, fewer devices receive the request. Therefore fewer frames need to be passed to an upper layer to determine whether they are intended for that specific host.
請求節點群播比 IPv4 ARP 所使用的乙太網路廣播更有效率。使用 ARP 時,所有節點都會收到並必須處理該廣播請求。透過使用 IPv6 請求節點群播位址,較少裝置會收到請求,因此需要向上層傳遞以判斷是否適用於該特定主機的框架也較少。
Look at the following figure. PC1 sends a Neighbor Solicitation to PC4. The IPv6 packet has the source IPv6 address of PC1 and the PC4 Solicited Node as the destination IPv6 address. The Layer 2 frame has the source MAC address of PC1 and the PC4 Solicited-Node Multicast MAC address as the destination. SW1 forwards this frame as an unknown unicast frame (this is a multicast frame, the solicited node MAC address is not used as the source MAC address, so the switch does not learn the MAC address associated to its interfaces). This frame reaches all the IPv6 nodes in the broadcast domain. PC2 drops the frame before opening it because PC2 is not the Layer 2 destination of this frame. PC3 and PC4 have the same solicited node addresses (Layer 3 and Layer 2) because the last 24 bits of the Global Unicast IPv6 address are the same. Because both devices have the same Layer 2 destination address, they both open the Layer 2 frame. The same happens at Layer 3. They both open the packet because the Layer 3 destination of the ICMPv6 packets is the same address. PC3 drops the frame after looking at the content of the packet. Because PC4 is the real destination of Neighbor Solicitation, it replies with a Neighbor Advertisement.
請看下圖。PC1 向 PC4 傳送鄰居邀請。此 IPv6 封包的來源 IPv6 位址是 PC1,目的 IPv6 位址則是 PC4 的請求節點位址。第 2 層框架的來源 MAC 位址是 PC1,目的位址則是 PC4 的請求節點群播 MAC 位址。SW1 將此框架以未知單播框架的方式轉送(這是一個群播框架,請求節點 MAC 位址不會被用作來源 MAC 位址,因此交換器不會學習到與其介面相關聯的 MAC 位址)。此框架會到達廣播網域中的所有 IPv6 節點。PC2 在開啟前就丟棄該框架,因為 PC2 不是此框架的第 2 層目的地。PC3 與 PC4 擁有相同的請求節點位址(第 3 層與第 2 層),因為其全球單播 IPv6 位址的最後 24 位元相同。由於兩台裝置擁有相同的第 2 層目的位址,因此兩者都會開啟該第 2 層框架。在第 3 層也發生相同的情況,兩者都會開啟該封包,因為 ICMPv6 封包的第 3 層目的地是相同位址。PC3 在檢視封包內容後丟棄該框架。因為 PC4 才是鄰居邀請的真正目的地,所以它會回覆鄰居通告。
By using the IPv4 ARP process, the PC2 would open the ARP request, because the ARP request MAC Address destination is a broadcast address, to determine that the ARP request was not for it. From a Layer 2 perspective, PC2 was a destination of the message as well. This is why using the Neighbor Discovery Protocol (NDP) multicast and solicited node addresses is more efficient than using the broadcast as the ARP process does.
若使用 IPv4 ARP 程序,PC2 會開啟該 ARP 請求,因為 ARP 請求的目的 MAC 位址是廣播位址,PC2 必須開啟才能判斷該 ARP 請求不是給它的。從第 2 層的角度來看,PC2 同樣是該訊息的目的地之一。這就是為什麼使用鄰居探索協定(NDP)的群播與請求節點位址,會比 ARP 所使用的廣播方式更有效率。

