PIM-SM (Protocol Independent Multicast — Sparse Mode) is what runs in real multicast deployments: video distribution, market-data feeds, kiosk push-update fan-out. It builds two trees per group — a shared tree rooted at a Rendezvous Point (RP) that picks up new sources, and a per-source shortest-path tree that takes over once a receiver has identified a source. On Linux, FRR’s pimd is the modern implementation; the legacy standalone pimd and xorp exist but are mostly out of date. This article walks through PIM-SM concepts, an FRR config for a 3-router lab with one RP, and the operational checks.
How to verify
Inspect PIM state from FRR’s vtysh:
vtysh -c 'show ip pim interface'
vtysh -c 'show ip pim neighbor'
vtysh -c 'show ip pim rp-info'
vtysh -c 'show ip mroute'
vtysh -c 'show ip pim upstream'
vtysh -c 'show ip multicast'
show ip mroute is the equivalent of ip route for multicast: it shows the multicast forwarding table, with one entry per (source, group) tuple. If it is empty after starting traffic, the tree never got built — work upstream from receivers toward the RP.
What’s happening
Multicast routing uses one source and one destination address per group; the group address is in 224.0.0.0/4. Forwarding is reverse-path-based: a router accepts a multicast packet only if the source can be reached via the interface the packet arrived on (RPF check). The Multicast Forwarding Information Base (MFIB) maps (S,G) tuples to a list of outgoing interfaces.
PIM-SM has three actors:
- Source sends to a group, with no awareness of the multicast tree
- Last-hop router (LHR) receives IGMP joins from listeners and registers interest with the RP
- Rendezvous Point (RP) holds the list of active sources for each group; new joins go up the shared tree (RPT) to the RP, then switch to a source-specific shortest-path tree (SPT) once traffic flows
The lifecycle of a new flow:
- LHR receives IGMP
(*, G)join from a host wanting group G - LHR sends PIM
(*, G)join up the RPT toward the RP - Source starts sending to G; first-hop router encapsulates packets in PIM Register and unicasts them to the RP
- RP decapsulates, sends down RPT to interested LHRs
- LHR receives traffic, learns source S, sends PIM
(S, G)join along the SPT from itself to S - Once SPT is active, LHR prunes the (*, G) leg
Step 6 is the SPT switchover — controlled by spt-threshold. Default behaviour is to switch as soon as any traffic arrives; some implementations only switch above a rate threshold.
The procedure
-
Install FRR with PIM enabled.
apt install frr frr-pythontools sed -i 's/^pimd=no/pimd=yes/' /etc/frr/daemons systemctl restart frr -
Enable IP multicast routing in the kernel.
sysctl -w net.ipv4.conf.all.mc_forwarding=1 sysctl -w net.ipv4.conf.eth0.mc_forwarding=1 sysctl -w net.ipv4.conf.eth1.mc_forwarding=1 -
Pick an RP. A single static RP for a small deployment is the simplest choice; for resilience, use BSR (Bootstrap Router) or Anycast-RP. Static config in FRR on every router:
! frr.conf ip pim rp 10.0.0.1 224.0.0.0/4 -
Enable PIM and IGMP per interface. On the LHR facing receivers, enable IGMP. On every router-facing link, enable PIM:
interface eth0 ip pim sm ip igmp ip igmp version 3 ! interface eth1 ip pim sm -
Add unicast routes that pass RPF. Multicast forwarding relies on the unicast RIB for RPF; if
ip route get <source>does not return the interface you expected, multicast will silently drop. Confirm:vtysh -c 'show ip rpf 192.0.2.5' -
Test with a sender and a receiver. On a sender (any host):
iperf -c 239.10.10.10 -u -T 5 -t 60 -i 5On the receiver:
iperf -s -u -B 239.10.10.10 -i 5On the LHR’s vtysh:
show ip mroute show ip pim upstreamYou should see the
(*, G)and then(S, G)entries populate. -
Persist FRR config with
vtysh -c 'write memory'or by editing/etc/frr/frr.confdirectly.
Operational notes
- IGMP version mismatch silently kills joins. Default Linux client IGMPv3, but some old switches and CPE only do IGMPv2. Force IGMPv2 in FRR (
ip igmp version 2) if you have legacy receivers. - The RP is a unicast hot-spot during source bursts. PIM Register encapsulation hits the RP CPU first for every new (S,G) before the SPT switchover. Size accordingly.
- Anycast-RP via MSDP distributes RP load and provides resilience. FRR supports it; configure two routers with the same Anycast IP and run MSDP between them so they share active-source state.
- Bridges need IGMP snooping (see article) or they flood multicast to every port. The kernel bridge has snooping enabled by default; cheap switches do not.
- PIM hello timer defaults to 30 seconds; hold time is 105. A neighbour appears down after missing three hellos. For fast reconvergence, BFD support in FRR can sub-second the failure detection.
In the engagements we run, PIM-SM shows up when a client extends a video-distribution or trading-feed network across racks or sites. The FRR config above is the minimal viable shape; we add BSR or Anycast-RP, IGMP version control on the access side, and BFD on the PIM peerings as the deployment matures. The BGP routing piece and the OSPF piece are the unicast peers PIM relies on, and all three sit in the same FRR install that the managed-operations practice maintains.