L3 · multicast · reviewed
PIM-SM
Protocol Independent Multicast — Sparse Mode
Builds multicast trees only where receivers ask for them, meeting sources and receivers at a rendezvous point and then getting out of the way.
Presenter modeEmbed this figure
Why it exists
Dense mode assumes receivers are everywhere and floods until told otherwise. Sparse mode assumes the opposite: build nothing until somebody asks, which is right for almost every real network.
That creates a discovery problem. A receiver knows a group and not a source; a source knows it is sending and not to whom. The rendezvous point is a place they can both be told about in advance, so they can find each other without either knowing the other exists. PIM Register MessagesRFC 7761 · INTERNET STANDARD · March 2016
"Protocol independent" means it does not run its own routing protocol — it uses whatever the unicast table already knows. Which is also why a unicast routing problem that causes no unicast symptom breaks multicast completely.
Meeting at a point neither end chose
The receiver knows a group and not a source. The source knows it is sending and not to whom. The rendezvous point is how they find each other.
How it works
Forwarding is decided by where a datagram came from. It is accepted only on the interface the unicast route toward its source points out of, and discarded otherwise — the reverse-path check, and the entire loop-prevention mechanism. Data Packet Forwarding RulesRFC 7761 · INTERNET STANDARD · March 2016
Receivers join toward the rendezvous point with a (*,G) join. A source’s designated router, having nowhere to send yet, encapsulates its first packets in unicast Register messages to the RP; the RP joins the source natively and then tells it to stop. Sending Register Messages from the DRRFC 7761 · INTERNET STANDARD · March 2016
Once the last-hop router has seen a packet it knows the source, and may join the shortest path directly. It joins first and prunes the shared tree second, absorbing the brief duplication with the RPF check. Last-Hop Switchover to the SPTRFC 7761 · INTERNET STANDARD · March 2016
A (*,G) join and an (S,G) join are the same message with different bits. The wildcard and RPT bits in the encoded source entry decide whether the address in it is a source or the rendezvous point. Encoded Source and Group Address FormatsRFC 7761 · INTERNET STANDARD · March 2016
Try it
Check RPF
Change the arrival interface. Only the reverse-path interface toward the source is a pass.
RPF failure · expected gi0/0
RPF failure: 192.0.2.10 matches 192.0.2.0/24 out gi0/0, but the datagram arrived on gi0/1. RFC 7761 §4.2 drops it.
On the wire
Constructed examples, encoded from the field table below them — not captured traffic.
- IPv4
- Protocol 103, multicast to 224.0.0.13 (ALL-PIM-ROUTERS) with TTL 1. The source is the link-local address of the sending interface. RFC 7761
- PIM header
- Version, type, reserved and checksum — common to every PIM message. RFC 7761
- Join/Prune body
- Upstream neighbour, holdtime, and one group set per group, each with its joined and pruned source lists. RFC 7761
Configure it
ip multicast-routing distributedNothing works without it and its absence produces silence rather than an error — no log line, no counter, just no state.
interface GigabitEthernet1 ip pim sparse-mode ip igmp version 3Sparse mode per interface. An interface without it is not in the tree and will not appear in any outgoing interface list, which reads as a routing problem.
RFC 7761 §4.2
ip pim rp-address 10.255.0.1 MCAST-GROUPS override ip access-list standard MCAST-GROUPS permit 239.0.0.0 0.255.255.255The RP, and it must be the same on every router in the domain. `override` makes this static entry win over anything learned — which is the right choice when static is the chosen mechanism and a trap when it is a leftover.
Common mistake: Configuring the RP on the last-hop routers only. Every router a join traverses resolves the RP itself, and one that disagrees sends the join somewhere else.
RFC 7761 §4.7
ip pim spt-threshold infinity group-list MANY-SMALL-GROUPSKeeps these groups on the shared tree rather than switching. Right for many low-rate groups where the state cost outweighs the path length; wrong for a few high-rate ones.
RFC 7761 §4.2.1
ip mroute 198.51.100.0 255.255.255.0 10.0.0.6A route used only by the RPF check. It fixes an asymmetric path precisely, and leaves a second table that has to be kept in step with the first — worth saying out loud before choosing it.
RFC 7761 §4.2
ip multicast route-limit 5000 ip pim register-rate-limit 100A state ceiling and a cap on register encapsulation. Registers are often handled in software, so a source registering continuously because the RP cannot build native state is a CPU problem before it is a multicast problem.
RFC 7761 §4.4.1
Verify
show ip rpf 198.51.100.7- The interface the check expects — compare with where traffic arrives.
show ip mroute 239.1.1.1- Incoming interface, outgoing list, and the flags that show SPT state.
show ip pim rp mapping- Which RP this router resolves, and whether it was static or learned.
show ip pim interface- Which interfaces are actually in sparse mode.
Caveats
- The RP must be identical on every router a join traverses, not just on the last hop.
- A static mroute creates a second table consulted only by RPF; it will drift from the unicast one.
- Register encapsulation is often software-switched, so a stuck register is a CPU incident.
When it breaks
Symptom first, because that is what you have when it happens.
A receiver joins a group and gets nothing, while the source is definitely sending.
Narrow it down
- Check the RPF interface for the source on every router in the path.
- Confirm the unicast route toward the source points out the interface multicast is arriving on.
- Look for an asymmetric path, or a static route added for unicast only.
Cause
The reverse-path check failed. A router accepts multicast only on the interface its unicast table would use to reach the source, and any asymmetry between the two silently drops the traffic.
Fix
Make the unicast path symmetric, or add a static multicast route so the RPF lookup resolves the way the traffic actually arrives.
Data Packet Forwarding RulesRFC 7761 · INTERNET STANDARD · March 2016Multicast works for a moment when a receiver joins and then stops.
Narrow it down
- Check whether the shared tree formed and whether the switch to the shortest path completed.
- Do the RPF check for the source separately from the RPF check for the rendezvous point.
- Confirm the last-hop router has a route to the source, not only to the RP.
Cause
Traffic flowed down the shared tree, then the last-hop router switched to the source tree and the RPF check toward the source failed. The RP was reachable; the source was not, by the path the check demands.
Fix
Fix the path to the source, or raise the switchover threshold to keep traffic on the shared tree while the routing is corrected.
Last-Hop Switchover to the SPTRFC 7761 · INTERNET STANDARD · March 2016No multicast anywhere, and no router has any state for the group.
Narrow it down
- Check that every router agrees on who the rendezvous point is.
- Verify the RP address is reachable from each of them.
- If discovery is dynamic, confirm the mapping is being distributed.
Cause
Without an RP there is no shared tree and nothing to join. Disagreement about the RP is the same failure as absence: routers build state toward different points and never meet.
Fix
Configure the RP consistently, and prefer anycast RP so its loss is not a network-wide outage.
PIM Bootstrap and RP DiscoveryRFC 7761 · INTERNET STANDARD · March 2016Duplicate multicast packets arrive on a segment with more than one router on it.
Narrow it down
- Check whether assert messages are being exchanged on that segment.
- Compare the administrative distance and metric each router reports toward the source.
- Look for a router that has just restarted and not yet lost the assert.
Cause
Two routers are both forwarding onto the shared segment. Assert is supposed to elect one, and it has either not run yet or is being reset repeatedly.
Fix
Let assert settle, and investigate why it keeps re-running — usually a flapping route changing the metric being compared.
Assert MetricsRFC 7761 · INTERNET STANDARD · March 2016The source’s designated router shows a permanently active register tunnel, and its CPU is high.
Narrow it down
- Check whether the RP is receiving the Register messages at all.
- Confirm the RP can build native (S,G) state toward the source — its own RPF check.
- Look for Register-Stop messages arriving back at the DR.
Cause
Registers stop when the RP has native state toward the source. If the RP’s own RPF check toward the source fails, it never gets that state, so it never sends Register-Stop and the DR encapsulates every packet in software indefinitely.
Fix
Fix the RP’s path to the source. The symptom is at the DR and the cause is at the RP, which is what makes this one slow to find.
Receiving Register Messages at the RPRFC 7761 · INTERNET STANDARD · March 2016
Design notes
Check RPF before anything else. The commands that show the RPF interface and the arrival interface answer most multicast incidents in two lines, and no amount of looking at the group or the receiver will.
Use anycast RP. The RP carries little traffic after switchover, so its capacity rarely matters and its availability always does — losing it is a network-wide outage for every group that has not yet switched.
Decide the switchover threshold deliberately. Zero is right for a few high-rate groups; keeping everything on the shared tree is right for many low-rate ones, and the trade is path length against state. Last-Hop Switchover to the SPTRFC 7761 · INTERNET STANDARD · March 2016
If the traffic is one-to-many and receivers can learn the source another way, use SSM instead. It removes the RP, the register, the shared tree and the switchover — and with them most of the failures below. Source-Specific MulticastRFC 7761 · INTERNET STANDARD · March 2016
Misconceptions
- “Multicast routing follows the unicast routing table.”
- It uses the unicast table backwards. Forwarding is decided by checking the interface a packet arrived on against the route toward its source, not by looking up its destination. That inversion is why asymmetric routing breaks multicast and not unicast. Data Packet Forwarding RulesRFC 7761 · INTERNET STANDARD · March 2016
- “All traffic flows through the rendezvous point.”
- Only until the last-hop router learns the source. It then joins the shortest path directly and prunes itself from the shared tree, so the RP carries the first packets and usually nothing after that. Last-Hop Switchover to the SPTRFC 7761 · INTERNET STANDARD · March 2016
- “The rendezvous point must be powerful because all the traffic goes through it.”
- It is a control-plane role. After switchover it forwards little or nothing, and the reason to worry about it is availability rather than throughput — which is what anycast RP addresses.
- “A router holds either (*,G) state or (S,G) state for a group.”
- There is a third: (S,G,rpt), meaning "on the shared tree, except for this source". It is what a last-hop router creates when it moves one source to the shortest path while keeping the rest of the group on the RP tree. (S,G,rpt) StateRFC 7761 · INTERNET STANDARD · March 2016
More walkthroughs
Leaving the rendezvous point behinddesign-choice
Once a receiver’s router knows the source it stops needing the RP, and moving off the shared tree means running two trees at once for a moment.
The shared tree works and takes a detour. Traffic goes to the RP and back out, when a direct path exists. Source. RP. Direct path. Last-hop router.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Source | host | — |
| RP | router | — |
| Direct path | router | — |
| Last-hop router | router | — |
| Source — RP | link | up |
| RP — Last-hop router | link | up |
| Source — Direct path | link | standby |
| Direct path — Last-hop router | link | standby |
The shared tree works and takes a detour. Traffic goes to the RP and back out, when a direct path exists.
What changed
- Emphasis on Source ↔ RP
- Emphasis on RP ↔ Last-hop router
- Emphasis: Shorter, unused
Unicast is fine, so multicast must be finefailure
A path that works perfectly in both directions for unicast can drop every multicast packet, because multicast checks where a packet came from.
The receiver gets nothing. The source is sending, every interface is up, and a ping to the source succeeds from the last-hop router. Source · 198.51.100.7. Path A · cost 10. Path B · cost 20. Last-hop router: Ping to source succeeds.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Source · 198.51.100.7 | host | — |
| Path A · cost 10 | router | — |
| Path B · cost 20 | router | — |
| Last-hop router | router | Ping to source: succeeds |
| Source · 198.51.100.7 — Path A · cost 10 | link | up |
| Source · 198.51.100.7 — Path B · cost 20 | link | up |
| Path A · cost 10 — Last-hop router | link | up |
| Path B · cost 20 — Last-hop router | link | up |
The receiver gets nothing. The source is sending, every interface is up, and a ping to the source succeeds from the last-hop router.
What changed
- Emphasis: No traffic
- Last-hop router: Ping to source → succeeds
Terms
- RPF check
- Forward a multicast datagram only if it arrived on the reverse-path interface toward the source (or the RP for (*,G)). Any other interface is an RPF failure.
- Shared tree
- The (*,G) tree rooted at the rendezvous point, which every receiver joins before it knows any source. Traffic uses it until a last-hop router learns a source and builds a direct path instead.
- SPT threshold
- The local policy deciding when a last-hop router leaves the shared tree for the shortest path. Zero means immediately; infinity means never. It is not negotiated, so two routers may legitimately differ.