PIM-DM overview
PIM-DM uses the push mode for multicast forwarding, and is suitable for small-sized networks with densely distributed multicast members.
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. When a pruned branch has new receivers, the graft mechanism turns the pruned branch into a forwarding branch.
In PIM-DM, the multicast forwarding paths for a multicast group constitutes a forwarding tree. The forwarding tree is rooted at the multicast source and has multicast group members as its "leaves." Because the forwarding 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 PIM interface 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, the multicast data from the multicast source S to the multicast group G is flooded throughout the domain. A router performs an RPF check on the multicast data. If the RPF check succeeds, the router creates an (S, G) entry and forwards the data to all downstream nodes on 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 multicasts a prune message to all PIM routers on the subnet. When an upstream node receives the prune message, it removes the receiving interface 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 41, 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 41: 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 to 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 42: Assert mechanism
As shown in Figure 42, 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. In addition, both Router A and Router B, on their 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/MBGP 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 metric preference to the multicast source wins.
If both routers have the same metric preference, 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.