Skip to content

Multicast Routing (layer 3)

T-X edited this page Jan 22, 2025 · 2 revisions

Multicast applications are often not that interesting with only a few listeners. The strength of multicast over unicast unfolds the more multicast listeners participate. On the other hand multicast applications are still niche, leading to a chicken and egg problem.

One way to address this issue could be to make sure multicast packets in one Freifunk Gluon domain can reach any other domain or even other Freifunk community. A protocol which can achieve this is PIM, Protocol Independent Multicast. The following describes the setup of how this was achieved in a test between Freifunk Lübeck (currently uses a 200 nodes single domain setup) and a domain at Freifunk Vogtland via pim6sd.

pim-gluon-setup pim-gluon-setup.svg

Configuration

systemd-networkd

/etc/systemd/network/20-eth0-pim-router-id.network:

# /etc/systemd/network/20-eth0-pim-router-id.network
[Match]
Name=eth0

[Network]
Address=2001:67c:2d50::2/128

/etc/systemd/network/25-pim-router-id.netdev:

# /etc/systemd/network/25-pim-router-id.netdev
[NetDev]
Name=pim-router-id
Kind=dummy

25-pim-router-id.network:

# /etc/systemd/network/25-pim-router-id.network
[Match]
Name=pim-router-id

[Network]
Address=2001:67c:2d50::2/128

[Link]
Multicast=true

25-ff_hl_v_mc_link.network:

# /etc/systemd/network/25-ff_hl_v_mc_link.network
[Match]
Name=ff_hl_v_mc_link

Babel

Babel will take care of learning unicast addresses from neighbors and neighbors' neighbors on ff_hl_v_mc_link.

/etc/default/babeld:

# Defaults for babeld initscript
# sourced by /etc/init.d/babeld

# List of interfaces on which the protocol should operate
INTERFACES="ff_hl_v_mc_link"

# Additional arguments
DAEMON_ARGS="-S /var/lib/babeld/state"

/etc/pim6sd.conf:

# /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;

# Even with "nolistener", MLD reports will be parsed.
# However this allows disabling the MLD querier.
# Gluon provides the querier and we use mrdisc to
# announce ourself via MRD.
phyint eth0 nolistener mld_version any enable;

# This one is for PIM / routing, not listeners / MLD.
# Add more interfaces as required below
phyint ff_hl_v_mc_link nolistener enable;

# configure rendezvous point for the personal multicast prefix
cand_rp pim-router-id;
group_prefix ff7e:240:2001:67c:2d50::/96;

mrdisc

Announce our own multicast router to upstream / our Gluon node.f

/etc/systemd/system/mrdisc@.service:

# /etc/systemd/system/mrdisc@.service
# https://github.com/troglobit/mrdisc
# enable like this for instance: $ systemctl enable mrdisc@eth0.service
[Unit]
Description=Multicast Router Discovery daemon (RFC4286)
BindsTo=pim6sd.service

[Service]
Type=exec
RestartSteps=10
RestartMaxDelaySec=30
Restart=always
ExecStart=mrdisc -6 %i

[Install]
WantedBy=multi-user.target

Then run:

  • systemctl enable mrdisc@eth0.service
Clone this wiki locally