Third refinement: Pruning
By careful application of rules such as those above, it is possible for the routers to agree on a spanning-tree for the whole network. However, we are still wasting effort in forwarding datagrams to RF when it has no group members. The solution is to introduce special prune messages.
When a router such as RF receives a datagram for a multicast group which has no members on its attached LAN, it sends a prune message back to the router which forwarded the datagram. This router (RD in this case) now adjusts its routing database to remove RF from the tree. If we are in the situation of b), RD will now know it has no-one to forward to, in which case it can, itself, send a prune message to RS. With the addition of pruning, RPB becomes reverse path multicasting (RPM). We need to have a method of restoring pruned links in case a host the other side of the link joins the group. We can either let prunes time-out (at which point the flow is restored and then, maybe, pruned again) or we can add explicit graft messages to the protocol. The former mechanism is a use of soft-state which is applied extensively in Internet protocols. Anticipating that state information is perishable in this way and building in mechanisms to restore it is fundamental to the operation of the Internet. It is key concept in making the Internet robust.
By using all these refinements, we can arrive at a reasonably efficient spanning tree. The two possibilities are shown. Both of these use shortest path routes from the source router (RS) to RB and RE. On the face of it, the tree in diagram b) is more efficient since it involves one fewer transmission hop. However, this is not necessarily so since the network cloud might might be a LAN. If it is, then RS can reach RB and RC with one transmission. We may then prefer diagram b) since it shares the forwarding load between the two routers.