Embedded RP, with IPv6 multicast, is a very cool trick. It simply embeds the RP IPv6 address as part of the multicast group address. This way, when a multicast router sees the group address, it can extract the RP and begin to use it for the shared tree immediately. The only thing that has to be hard coded on a router is to tell the RP that he is the RP, and that’s it. All the other routers in the network dynamically learn the RP address from the group address. So here is the problem: A 128 bit RP address can’t be embedded into a 128 bit group address and still leave space for the group identity, can it?

The answer has two parts. First, recall that an IPv6 multicast group address has a 112-bit Group ID field. This field can identify trillions of multicast groups, far more than would ever be needed. So why not boorow some of the bits of the Group ID to embed the IPv6 address of the RP?

You are probably saying by now, well that’s great, but we still have 128 bits of an RP address to stuff into 112 bit Group ID field? How can we get past that? The answer is the way in which we use compression in IPv6 addresses. By carefully selecting the address of your RPs, you can identify them with far fewer bits that 112. The key is using RP addresses with long strings of zeros.

We know that an IPv6 address requires a 64-bit prefix. There is no workaround for that. But how many RPs do you really have on the network. Let’s say you have 16 RPs. Those 16 RPs can be represented with a 4 $(2^4)$ bit identifier called the RP Interface Identifier (RIID). SO as long as that number of RPs works for you, you can squeeze a 128-bit identifier into a 70-bit space, assuming the rest of the bits are zeroes.

How does this actually fit into an IPv6 multicast group address? Here is the complete mapping.

  • 8 bits = Multicast (0xFF) 1111 1111
  • 4 bits = Flags (0x7) 0111
  • 4 bits = Scope (0xE) 1110
  • 4 bits = Reserved (0) 0000
  • 4 bits = RIID (0x6) 0110
  • 8 bits = Prefix Length (0x40) 0100 0000
  • 64 bits = Network Prefix (0x2002:6666:0:0)
  • 32 bits Group ID (0x0:1)

FF7E:0640:2002:6666:0:0::1 is the resulting multicast address.

Reverse engineering this to find the IPv6 address of the RP is simple. It is the Network Prefix tagged with the RIID at the end. So in the example above our RP address represented by the multicast address FF7E:0640:2002:6666:0:0::1 is 2002:6666:0:0::6.