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

Data Packet Forwarding RulesRFC 7761 · INTERNET STANDARD · March 2016PIM Register MessagesRFC 7761 · INTERNET STANDARD · March 2016Last-Hop Switchover to the SPTRFC 7761 · INTERNET STANDARD · March 2016PIM Assert MessagesRFC 7761 · INTERNET STANDARD · March 2016

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.

The receiver reports membership of 239.1.1.1 by IGMP. It names a group and no source, because in this model it has no way to know one. Source · 198.51.100.7. Source’s DR. RP · 10.255.0.1. Last-hop router. Receiver: Wants 239.1.1.1.

Source · 198.51.100.7Source’s DRRP · 10.255.0.1Last-hop routerReceiverWants: 239.1.1.1
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Source · 198.51.100.7host
Source’s DRrouter
RP · 10.255.0.1router
Last-hop routerrouter
ReceiverhostWants: 239.1.1.1
Source · 198.51.100.7Source’s DRlinkup
Source’s DRRP · 10.255.0.1linkup
RP · 10.255.0.1Last-hop routerlinkup
Last-hop routerReceiverlinkup
1 / 6

The receiver reports membership of 239.1.1.1 by IGMP. It names a group and no source, because in this model it has no way to know one.

What changed

  • Receiver: Wants → 239.1.1.1
  • Emphasis on Last-hop router ↔ Receiver

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.

Datagram for 232.1.1.1 from 192.0.2.10

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.

A shared-tree join. The wildcard and RPT bits are both set, so the address in the source field is the RP, not a source — one bit is the entire difference from the message below.

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

Sparse mode with an anycast RP and a deliberate switchover policy.

Cisco IOS-XE 17.12 · Catalyst 9500, Catalyst 8500, ISR 4451draft

  1. ip multicast-routing distributed

    Nothing works without it and its absence produces silence rather than an error — no log line, no counter, just no state.

  2. interface GigabitEthernet1
     ip pim sparse-mode
     ip igmp version 3

    Sparse 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

  3. 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.255

    The 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

  4. ip pim spt-threshold infinity group-list MANY-SMALL-GROUPS

    Keeps 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

  5. ip mroute 198.51.100.0 255.255.255.0 10.0.0.6

    A 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

  6. ip multicast route-limit 5000
    ip pim register-rate-limit 100

    A 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.

  1. A receiver joins a group and gets nothing, while the source is definitely sending.

    Narrow it down

    1. Check the RPF interface for the source on every router in the path.
    2. Confirm the unicast route toward the source points out the interface multicast is arriving on.
    3. 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 2016
  2. Multicast works for a moment when a receiver joins and then stops.

    Narrow it down

    1. Check whether the shared tree formed and whether the switch to the shortest path completed.
    2. Do the RPF check for the source separately from the RPF check for the rendezvous point.
    3. 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 2016
  3. No multicast anywhere, and no router has any state for the group.

    Narrow it down

    1. Check that every router agrees on who the rendezvous point is.
    2. Verify the RP address is reachable from each of them.
    3. 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 2016
  4. Duplicate multicast packets arrive on a segment with more than one router on it.

    Narrow it down

    1. Check whether assert messages are being exchanged on that segment.
    2. Compare the administrative distance and metric each router reports toward the source.
    3. 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 2016
  5. The source’s designated router shows a permanently active register tunnel, and its CPU is high.

    Narrow it down

    1. Check whether the RP is receiving the Register messages at all.
    2. Confirm the RP can build native (S,G) state toward the source — its own RPF check.
    3. 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.

SourceRPDirect pathShorter, unusedLast-hop router
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Sourcehost
RProuter
Direct pathrouter
Last-hop routerrouter
SourceRPlinkup
RPLast-hop routerlinkup
SourceDirect pathlinkstandby
Direct pathLast-hop routerlinkstandby
1 / 6

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.

Source · 198.51.100.7Path A · cost 10Path B · cost 20Last-hop routerNo trafficPing to source: succeeds
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Source · 198.51.100.7host
Path A · cost 10router
Path B · cost 20router
Last-hop routerrouterPing to source: succeeds
Source · 198.51.100.7Path A · cost 10linkup
Source · 198.51.100.7Path B · cost 20linkup
Path A · cost 10Last-hop routerlinkup
Path B · cost 20Last-hop routerlinkup
1 / 5

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.

Check yourself

  • A receiver joins and gets nothing, though the source is sending. What do you check first?
  • Traffic flows briefly then stops. What has most likely happened?
  • How much traffic does the rendezvous point carry in steady state?
  • Two routers on one segment both forward the same group. What resolves it?
  • Why does a source’s designated router encapsulate the first packets to the RP?
  • What distinguishes a (*,G) join from an (S,G) join on the wire?
  • Which router sends the Register messages for a source?
  • A last-hop router has moved one source to the shortest path but keeps the group on the shared tree. What state is that?