Multicast (PIM-SM)
See how PIM Sparse Mode builds shared trees, registers sources, and switches to shortest-path trees.
How PIM Sparse Mode Works
PIM Sparse Mode is a multicast routing protocol designed for networks where receivers are sparsely distributed — not every router needs to receive every group's traffic. Instead of flooding data everywhere, PIM-SM builds distribution trees only where there are interested receivers.
The key concept is the Rendezvous Point (RP) — a designated router that acts as a meeting point. Sources and receivers don't need to know about each other directly; they just need to know the RP.
Shared Tree (*,G)
When a receiver wants to join a multicast group, its local router sends a PIM Join message hop-by-hop toward the RP. Each router along the path installs (*,G) state — "any source, this group" — creating branches of a shared tree rooted at the RP. The * means this tree carries traffic from any source for the group.
Source Registration
When a source starts sending, its first-hop router doesn't know about the shared tree. It encapsulates the data in a PIM Register message and unicasts it directly to the RP. The RP decapsulates the data and forwards it down the shared tree to all receivers. Simultaneously, the RP sends a PIM Join back toward the source to build a native path, and once data flows natively, sends a Register-Stop to tell the first-hop router to stop encapsulating.
Source Tree (S,G) and SPT Switchover
The shared tree works but isn't always optimal — data might travel a longer path through the RP when a shorter direct path exists. A last-hop router can decide to switch to a shortest-path tree (SPT) by sending an (S,G) Join directly toward the source. This builds a source-specific tree that bypasses the RP entirely. After switching, the router sends a Prune toward the RP to stop receiving duplicate data on the shared tree.
In this simulation, notice how Rcv2's data path shrinks dramatically after SPT switchover: from 5 hops through the RP down to just 2 hops on the direct source tree.