2

I'm on Linux and I want to ping fe80::1234:56ff:fe12:3456%eth0 which is connected to the same Ethernet switch as my eth0 interface. I haven't yet communicated with fe80::1234:56ff:fe12:3456 so I don't have its MAC address cached (it's not in ip neigh list). When I run

ping fe80::1234:56ff:fe12:3456%eth0

I send

  • ICMP neighbor solicitation packet inside
  • IPv6 datagram with multicast destination address ff02::1:ff12:3456 inside
  • Ethernet frame with multicast destination address 33:33:ff:12:34:56.

I get that ff02::1:ff12:3456 is constructed from lower 24 bits of MAC address and nodes sharing the same bits all listen on this multicast address. But why is it specified this way? Why not just send the ICMP packet to the destination IPv6 address directly letting the multicast MAC address take care of distributing it to possible candidates? Like this:

  • ICMP neighbor solicitation packet inside
  • IPv6 datagram with unicast destination address fe80::1234:56ff:fe12:3456 inside
  • Ethernet frame with multicast destination address 33:33:ff:12:34:56.
woky
  • 235
  • 3
  • 9
  • 1
    Sending a unicast network address to a data-link protocol will result in the datalink protocol needing a unicast data-link address. The data-link protocol, which is independent of the network protocol, has no way to know if a packet with the unicast `fe80::1234:56ff:fe12:3456` address is meant to be multicast. You can certainly send unicast packets to that address for legitimate reasons. How should the data-link protocol know which packets should be unicast or multicast? – Ron Maupin Apr 24 '22 at 23:59
  • Also, Ipv6 probably has multiple addresses on an interface, and in the original idea, the IID would be the same for all the addresses on the interface. NDP using the multicast address could populate its tables for all the addresses with a single multicast packet. – Ron Maupin Apr 25 '22 at 00:04

1 Answers1

1

Ethernet, while everywhere, is not the only layer 2 technology.

Scrolling through "IPv6 Packets over" RFCs will reveal diverse link layers including Bluetooth low energy ITU-T G.9959 personal area networks, fibre channel. Also obsolete alternatives like Token Ring or FDDI.

Link layers that implement multicast map IPv6 multicast addresses to their implementations. Those that do not work around that. Perhaps point to point links let a router track of multicast listeners. Or perhaps a broadcast implementation, although sending to all nodes like ARP is not ideal.

Neighbor discovery in the IP stack has the advantage of a consistent abstraction and code reuse. A targeted IP packet can be created to get the link layer address. Including over hardware unimagined at the time the layer 3 code was written.

See also: Why do you need IPv6 Neighbor Solicitation to get the MAC address?

John Mahowald
  • 30,009
  • 1
  • 17
  • 32