PIM-DM overview
PIM-DM uses the push mode for multicast forwarding, and is suitable for small-sized networks with densely distributed multicast members.
The following describes the basic implementation of PIM-DM:
PIM-DM assumes that all downstream nodes want to receive multicast data from a source, so multicast data is flooded to all downstream nodes on the network.
Branches without downstream receivers are pruned from the forwarding trees, leaving only those branches that contain receivers.
The pruned state of a branch has a finite holdtime timer. When the timer expires, multicast data is again forwarded to the pruned branch. This flood-and-prune cycle takes place periodically to maintain the forwarding branches.
The graft mechanism is used to reduce the latency for resuming the forwarding capability of a previously pruned branch.
In PIM-DM, the multicast forwarding paths for a multicast group constitutes a source tree, which is rooted at the multicast source and has multicast group members as its "leaves." Because the source tree consists of the shortest paths from the multicast source to the receivers, it is also called a "shortest path tree (SPT)."
Neighbor discovery
In a PIM domain, each interface that runs PIM on a router periodically multicasts PIM hello messages to all other PIM routers (identified by the address 224.0.0.13) on the local subnet. Through the exchanging of hello messages, all PIM routers on the subnet determine their PIM neighbors, maintain PIM neighboring relationship with other routers, and build and maintain SPTs.
SPT building
The process of building an SPT is the flood-and-prune process:
In a PIM-DM domain, when the multicast source S sends multicast data to the multicast group G, the multicast data is flooded throughout the domain. A router performs an RPF check for the multicast data. If the RPF check succeeds, the router creates an (S, G) entry and forwards the data to all downstream nodes in the network. In the flooding process, all the routers in the PIM-DM domain create the (S, G) entry.
The nodes without downstream receivers are pruned. A router that has no downstream receivers sends a prune message to the upstream node to remove the interface that receives the prune message from the (S, G) entry. In this way, the upstream stream node stops forwarding subsequent packets addressed to that multicast group down to this node.
NOTE:
An (S, G) entry contains a multicast source address S, a multicast group address G, an outgoing interface list, and an incoming interface.
A prune process is initiated by a leaf router. As shown in Figure 23, the router interface that does not have any downstream receivers initiates a prune process by sending a prune message toward the multicast source. This prune process goes on until only necessary branches are left in the PIM-DM domain, and these necessary branches constitute an SPT.
Figure 23: SPT building
The pruned state of a branch has a finite holdtime timer. When the timer expires, multicast data is again forwarded to the pruned branch. The flood-and-prune cycle takes place periodically to maintain the forwarding branches.
Graft
A previously pruned branch might have new downstream receivers. To reduce the latency for resuming the forwarding capability of this branch, a graft mechanism is used as follows:
The node that needs to receive the multicast data sends a graft message to its upstream node, telling it to rejoin the SPT.
After receiving this graft message on an interface, the upstream node adds the receiving interface into the outgoing interface list of the (S, G) entry. It also sends a graft-ack message to the graft sender.
If the graft sender receives a graft-ack message, the graft process finishes. Otherwise, the graft sender continues to send graft messages at a graft retry interval until it receives an acknowledgment from its upstream node.
Assert
On a subnet with more than one multicast router, the assert mechanism shuts off duplicate multicast flows to the network. It does this by electing a unique multicast forwarder for the subnet.
Figure 24: Assert mechanism
As shown in Figure 24, after Router A and Router B receive an (S, G) packet from the upstream node, they both forward the packet to the local subnet. As a result, the downstream node Router C receives two identical multicast packets. Both Router A and Router B, on their own downstream interfaces, receive a duplicate packet forwarded by the other. After detecting this condition, both routers send an assert message to all PIM routers (224.0.0.13) on the local subnet through the interface that received the packet. The assert message contains the multicast source address (S), the multicast group address (G), and the metric preference and metric of the unicast route/static multicast route to the multicast source. By comparing these parameters, either Router A or Router B becomes the unique forwarder of the subsequent (S, G) packets on the shared-media LAN. The comparison process is as follows:
The router with a higher preference to the multicast source wins.
If both routers have the same metric preference to the source, the router with a smaller metric wins.
If both routers have the same metric, the router with a higher IP address on the downstream interface wins.