The following guide illustrates how to set up an IPv6 multicast router using PIM-SM (Protocol Independent Multicast in Sparse Mode) with your own personal multicast prefix.
cd /usr/src git clone https://github.com/troglobit/pim6sd.git cd pim6sd ./autogen.sh ./configure make
Calculate your personal, embedded-RP multicast prefix matching your network prefix via RFC3956
48 == 0x30
0xf, for instance
Create a dummy interface to hold your calculated unicast Rendezvous Point address. This one needs to be reachable from within dn42. Also set "multicast on" on this dummy interface. Example:
# /etc/network/interfaces.d/pim6sd auto pim-router-id iface pim-router-id inet manual pre-up ip link add name $IFACE type dummy post-up ip link set multicast on dev $IFACE post-up ip -6 a a fd00:2001:db8::2/128 dev $IFACE post-down ip link del $IFACE
Create the configuration file:
# /etc/pim6sd.conf # disable all interfaces by default default_phyint_status disable; # enable the pim-router-id interface first to acquire the correct primary address phyint pim-router-id enable; # add multicast-capable peer interfaces below phyint dn42-peer1 enable; # configure rendezvous point for the personal multicast prefix cand_rp pim-router-id; group_prefix ff7e:230:fd00:2001:db8::/96;
phyint statement enables PIM and MLD on the target interface - by default all interfaces are in the disable state. Enable an interface if it is directed towards a multicast-capable peer or other multicast-capable routers in your autonomous system. Also enable it for downstream network segments with multicast listeners and senders, like for example your home (W)LAN segments.
group_prefix statements you can configure this router as a Rendezvous Point (RP) for your personal multicast group prefix. The address on the interface given as
cand_rp will be used as the primary address for your RP, it therefore must be routable.
On your router:
allow-hotplug pim-ns0 iface pim-ns0 inet manual pre-up ip link add pim-ns0 type veth peer name pim-ns1 post-up ip netns add pim-ns0 post-up ip link set addr 02:11:22:00:00:02 netns pim-ns0 name pim-ns0 up dev pim-ns1 post-up ip link set addr 02:11:22:00:00:01 up dev pim-ns0 post-up ip -6 a a fdd5:69d5:c530:1::1/64 dev pim-ns0 post-up ip netns exec pim-ns0 ip -6 a a fdd5:69d5:c530:1::2/64 dev pim-ns0 post-up ip netns exec pim-ns0 ip -6 r a default via fdd5:69d5:c530:1::1 post-down ip link del pim-ns0 post-down ip netns del pim-ns0
You can now switch into this test network namespace via "ip netns exec /bin/bash". Inside this network namespace you can try:
$ socat -u UDP6-RECV:1234,reuseaddr,ipv6-join-group="[ff7e:230:fdd5:69d5:c530::123]:eth0" -
First select which interface should be the default one for your multicast traffic. Then send multicast packets via ICMPv6:
$ ip -6 route add ff7e:230:fdd5:69d5:c530::/96 dev eth0 table local $ ping6 -t 16 ff7e:230:fdd5:69d5:c530::123
The "-t 16", a hop-limit of 16, is important here as by default all multicast traffic is usually send with a hop-limit of just 1.
Router that collects multicast group information from all RP in the network and advertises it across the network.
Router where senders and receivers will meet for a certain multicast address. Senders must send their data to it, after which it will be forwarded to receivers. As soon as a receivers DR learns of the sender it will ask their router to forward data along a direct path between sender and receiver.
First-hop router that stand in for sender and receiver on their downstream networks. The senders DR sends their data towards the RP encapsulated in PIM Register packets. The receivers DR will send join and prune messages to the RP, managing the group subscription.
Before RFC3956 (embedded RP addresses) personal, network prefix based multicast prefixes were calculated via RFC3306. Example:
48 == 0x30
However you can usually just announce and use both RFC3306 and RFC3956 based multicast prefixes, if you want to. pim6sd allows adding multiple
If you want to be participate as a bootstrap router candidate, please read up on how PIM works first. If you join with a bootstrap router candidate add it here below with contact information and join #dn42-multicast on HackInt:
Next to personal multicast prefixes generated by network prefix (RFC3306 or RFC3956) there can also be multicast addresses not owned by a specific AS. In general any one can just set up a multicast sender or listener for those. However to work, they need a reliable RP for coordination.
If you want to offer an RP candidate for a shared multicast address, please read up on how PIM works first. If you join with an RP candidate for a shared multicast address add it here below with contact information and join #dn42-multicast on HackInt:
Last edited by DN42 Wiki (BURBLE-MNT), 2020-11-04 22:31:27