L3 · multicast · reviewed
PIM-DM
Protocol Independent Multicast — Dense Mode
Floods every group to every router and waits to be told to stop. The opposite assumption to sparse mode, and it is wrong almost everywhere.
Presenter modeEmbed this figure
Why it exists
Dense mode answers the question "where should this stream go?" with "everywhere, unless told otherwise". Building a distribution tree that way needs no rendezvous point, no registration and no shared tree — the tree is whatever is left after the uninterested branches have pruned themselves off. PIM-DM Protocol OverviewRFC 3973 · EXPERIMENTAL · January 2005
That is a real simplification, and it is the right trade only when receivers genuinely are dense — a campus where every segment wants the stream. Everywhere else the cost is paid by every branch that does not want it, repeatedly.
RFC 3973 is Experimental, not Standards Track. The mode still appears in production for one specific reason: Auto-RP floods its announce and discovery groups, 224.0.1.39 and 224.0.1.40, in dense mode, which is why sparse-dense mode exists.
Flood first, ask later
Dense mode assumes every router wants the group, sends it there, and prunes back the branches that say no. Then the prunes expire.
The source sends to 239.1.1.1. Nobody has asked for it anywhere; dense mode does not wait to be asked. Source · 10.1.1.5: Sending 239.1.1.1. R1 · first hop. R2 · has a receiver. R3 · no receivers. Receiver.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Source · 10.1.1.5 | host | Sending: 239.1.1.1 |
| R1 · first hop | router | — |
| R2 · has a receiver | router | — |
| R3 · no receivers | router | — |
| Receiver | host | — |
| Source · 10.1.1.5 — R1 · first hop | link | up |
| R1 · first hop — R2 · has a receiver | link | up |
| R1 · first hop — R3 · no receivers | link | up |
| R2 · has a receiver — Receiver | link | up |
The source sends to 239.1.1.1. Nobody has asked for it anywhere; dense mode does not wait to be asked.
What changed
- Source · 10.1.1.5: Sending → 239.1.1.1
- Emphasis on Source · 10.1.1.5 ↔ R1 · first hop
- (S,G): Source · 10.1.1.5 → R1 · first hop
How it works
A datagram is accepted only on the interface the unicast route to its source points out of, and flooded out every other PIM interface. That is the same RPF rule sparse mode uses and it is what keeps the flood from looping. Data Packet Forwarding RulesRFC 3973 · EXPERIMENTAL · January 2005
A router with nothing downstream sends a Prune upstream. Prune state is timed — 210 seconds by default — so the branch is re-flooded and re-pruned on a cycle unless State Refresh is running. A Graft rejoins a pruned branch immediately, and it is the one message that is acknowledged. PIM-DM Prune, Join, and Graft MessagesRFC 3973 · EXPERIMENTAL · January 2005
On a shared segment two routers can both consider themselves the forwarder. Assert resolves it on administrative distance, then metric, then highest IP address — and the loser keeps its state so it can take over when the winner goes away. Assert MetricsRFC 3973 · EXPERIMENTAL · January 2005
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 multicast works until this is on, and its absence produces silence rather than an error.
interface GigabitEthernet1 ip pim dense-modeDense mode is a per-interface setting, not a global one. An interface without it is not part of the tree and will not appear in any outgoing interface list.
RFC 3973 §3
ip pim state-refresh origination-interval 60Originates State Refresh from this router, which must be the one connected to the source. Every router on the path also has to forward it, and that is a property of the platform rather than of this configuration.
Common mistake: Configuring origination on a mid-path router. Only the first hop originates; everywhere else the command is accepted and does nothing.
RFC 3973 §4.5.2
interface GigabitEthernet2 ip pim sparse-dense-modeThe Auto-RP compromise: sparse for groups with a known RP, dense for 224.0.1.39 and 224.0.1.40 so routers can learn where the RP is. BSR removes the need for this entirely.
ip access-list standard NO-LEAK deny 239.0.0.0 0.255.255.255 permit any interface GigabitEthernet3 ip multicast boundary NO-LEAKA dense-mode group floods to every PIM-enabled interface, including the one facing a partner. A boundary is the only thing that stops it.
Verify
show ip mroute 239.1.1.1- The outgoing interface list, and which branches are pruned.
show ip pim interface state-refresh- Whether each neighbour will carry the refresh.
show ip rpf 10.1.1.5- Which interface the RPF check expects traffic on.
Caveats
- State Refresh has to be supported by every router on the path; one that does not forward it puts everything behind it back on prune expiry.
- A dense-mode group floods out every PIM interface. Without a boundary that includes interfaces facing other organisations.
When it breaks
Symptom first, because that is what you have when it happens.
A quiet link carries a burst of multicast every three minutes for a group nobody on it has asked for.
Narrow it down
- Check whether the group is running in dense mode rather than sparse.
- Look at the prune expiry timer on the upstream router.
- Check whether State Refresh is being originated and forwarded along the whole path.
Cause
Prune state is timed. When it expires the upstream forwards again and the downstream re-prunes, which is the protocol working as specified.
Fix
Enable State Refresh on every router in the path, or move the group to sparse mode, which never floods to a router that did not ask.
PIM-DM Prune, Join, and Graft MessagesRFC 3973 · EXPERIMENTAL · January 2005State Refresh is configured and part of the network still re-floods.
Narrow it down
- Walk the path hop by hop and check the State Refresh Capable option in each Hello.
- Confirm the first-hop router is originating rather than only forwarding.
- Find the first router that does not forward the message — everything past it re-floods.
Cause
The capability is per-hop. One router that does not forward the refresh reinstates prune expiry for the whole subtree behind it.
Fix
Upgrade or replace the router that breaks the chain. There is no way to tunnel the refresh past it.
State Refresh Capable OptionRFC 3973 · EXPERIMENTAL · January 2005Receivers on a shared segment see every multicast packet twice.
Narrow it down
- Check how many routers on that LAN have the group in a forwarding state.
- Look for Assert messages on the segment.
- Compare the two routers’ administrative distance and metric to the source.
Cause
Two routers both treated the LAN as a downstream branch. Assert resolves it, but only once each has seen the other’s traffic on its own downstream interface.
Fix
Let Assert settle it, and if the wrong router keeps winning, change the metric rather than the addresses. The address is only the last tie-break.
Assert MetricsRFC 3973 · EXPERIMENTAL · January 2005Multicast is dropped on a router that clearly has a route to the source.
Narrow it down
- Compare the incoming interface with the interface the unicast route to the source points out of.
- Check for asymmetric routing or a separate multicast RIB.
- Confirm which table the RPF lookup uses on that platform.
Cause
The RPF check failed. Having a route is not enough — the datagram has to arrive on the interface that route points out of.
Fix
Fix the asymmetry, or add a static multicast route so the RPF lookup resolves toward the interface the traffic actually uses.
Data Packet Forwarding RulesRFC 3973 · EXPERIMENTAL · January 2005A group appears on a link to a partner or a DMZ that was never meant to carry multicast.
Narrow it down
- List every interface with PIM enabled and compare against the intended domain.
- Check for a multicast boundary or scope on the interfaces at the edge.
- Confirm whether the group is running dense mode rather than sparse.
Cause
A dense-mode group floods out every PIM-enabled interface by default. There is no join to be absent — the traffic arrives first and waits to be pruned, and a partner who does not run PIM will never prune it.
Fix
Put a multicast boundary on every edge interface. Enabling PIM on an interface is enabling flooding to it, which is the part that does not read that way in the configuration.
PIM-DM Protocol OverviewRFC 3973 · EXPERIMENTAL · January 2005
Design notes
Do not choose dense mode because it looks simpler to configure. The configuration is simpler and the behaviour is not: the flood-and-prune cycle is invisible until someone captures a quiet link and finds a burst of unwanted multicast every three minutes.
If dense mode is unavoidable, enable State Refresh on every router in the path. It is a per-hop capability advertised in the Hello, so one router without it silently reinstates the cycle for everything downstream. State RefreshRFC 3973 · EXPERIMENTAL · January 2005
Sparse-dense mode was the common compromise for Auto-RP: sparse for real groups, dense for the two Auto-RP groups. BSR carries RP information inside PIM itself and removes the need for it, which is the better answer where both are available.
Misconceptions
- “Dense mode is the simple choice for a small network.”
- Its configuration is simpler; its behaviour is not. It floods to every router and depends on prune state that expires, so a small network with a few uninterested branches pays a permanent, invisible cost that sparse mode never incurs.
- “Nobody runs dense mode any more.”
- Auto-RP announces itself on 224.0.1.39 and 224.0.1.40 in dense mode, which is why sparse-dense mode exists and why the flood-and-prune behaviour still turns up in networks whose operators believe they run pure sparse mode.
- “The Assert winner is the router with the lowest IP address.”
- It is the highest, and only as a final tie-break after administrative distance and metric. Assuming it matches the DR election or the STP root is a reliable way to predict the wrong winner. Assert MetricsRFC 3973 · EXPERIMENTAL · January 2005
- “Enabling State Refresh on the first-hop router stops the flooding.”
- Only the first hop originates it, but every router on the path has to forward it. The first router that does not puts everything behind it back on prune expiry. Forwarding of State Refresh MessagesRFC 3973 · EXPERIMENTAL · January 2005
More walkthroughs
Stopping the three-minute re-flooddesign-choice
State Refresh keeps prune state alive from the first hop, so the periodic flood stops. Every router on the path has to support it.
Without State Refresh the cost is structural: every pruned branch carries a burst of traffic every 210 seconds, forever, for every group. R1 · first hop. R2. R3 · pruned.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| R1 · first hop | router | — |
| R2 | router | — |
| R3 · pruned | router | — |
| R1 · first hop — R2 | link | up |
| R2 — R3 · pruned | link | blocking |
Without State Refresh the cost is structural: every pruned branch carries a burst of traffic every 210 seconds, forever, for every group.
What changed
- Emphasis: Re-floods every 210 s
Two routers forwarding the same stream onto one LANfailure
Duplicate multicast on a shared segment until Assert elects one forwarder — and the tie-break is not the one people expect.
Both routers have the stream and both have the LAN as a downstream branch. Both forward. The receiver gets every packet twice. RA · metric 20. RB · metric 20. Shared LAN. Receiver.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| RA · metric 20 | router | — |
| RB · metric 20 | router | — |
| Shared LAN | zone | — |
| Receiver | host | — |
| RA · metric 20 — Shared LAN | link | up |
| RB · metric 20 — Shared LAN | link | up |
| Shared LAN — Receiver | link | up |
Both routers have the stream and both have the LAN as a downstream branch. Both forward. The receiver gets every packet twice.
The application usually survives this and the symptom is bandwidth, not breakage — which is why it can sit unnoticed on a segment for a long time.
What changed
- Emphasis on RA · metric 20 ↔ Shared LAN
- Emphasis on RB · metric 20 ↔ Shared LAN
- Every packet twice
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.
- Flood and prune
- The dense-mode model: send the group to every router, and remove the branches that object. Prune state is timed, so the flood repeats until State Refresh keeps it alive.
- State Refresh
- A message originated by the first-hop router and forwarded hop by hop, resetting prune timers so a pruned branch never re-floods. Every router on the path has to forward it.
- PIM Assert
- The election that picks one forwarder when two routers send the same group onto a shared LAN. Administrative distance, then metric, then highest IP address — not lowest.