RPF check mechanism
A multicast routing protocol creates multicast routing entries based on the existing unicast routes or static multicast routes. During the process, the reverse path forwarding (RPF) check mechanism ensures the multicast data delivery along the correct paths and avoids data loops.
A multicast routing protocol uses the following tables to perform an RPF check:
Unicast routing table—Contains unicast routing information.
Static multicast routing table—Contains RPF routes that are manually configured.
Static multicast routing table is used for RPF check rather than multicast routing.
RPF check process
A multicast router performs the RPF check on a multicast packet as follows:
The router chooses an optimal route back to the packet source separately from the unicast routing table and the static multicast routing table.
The term "packet source" means different things in different situations:
For a packet that travels along the SPT, the packet source is the multicast source.
For a packet that travels along the RPT, the packet source is the RP.
For a bootstrap message originated from the BSR, the packet source is the BSR.
For more information about the concepts of SPT, RPT, source-side RPT, RP, and BSR, see "Configuring PIM."
The router selects one of the two optimal routes as the multicast RPF route as follows:
If the router uses the longest prefix match principle, the route with higher subnet mask becomes the RPF route. If the routes have the same mask, the route with higher route preference becomes the RPF route. If the routes have the same route preference, the unicast route becomes the RPF route.
For more information about the route preference, see Layer 3—IP Routing Configuration Guide.
If the router does not use the longest prefix match principle, the route with higher route preference becomes the RPF route. If the routes have the same preference, the unicast route becomes the RPF route.
The RPF route contains the RPF interface and RPF neighbor information.
If the RPF route is a unicast route, the outgoing interface is the RPF interface and the next hop is the RPF neighbor.
If the RPF route is a static multicast route, the RPF interface and RPF neighbor are specified in the route.
The router checks whether the packet arrived at the RPF interface. If yes, the RPF check succeeds and the packet is forwarded. If not, the RPF check fails and the packet is discarded.
RPF check implementation in multicast
Implementing an RPF check on each received multicast packet brings a big burden to the router. The use of a multicast forwarding table is the solution to this issue. When the router creates a multicast forwarding entry for a multicast packet, it sets the RPF interface of the packet as the incoming interface of the forwarding entry. After the router receives a multicast packet on an interface, it looks up its multicast forwarding table for a matching entry as follows:
If no match is found, the router first determines the RPF route back to the packet source. Then, it creates a forwarding entry with the RPF interface as the incoming interface and performs one of the following actions:
If the receiving interface is the RPF interface, the RPF check succeeds and the router forwards the packet out of all the outgoing interfaces.
If the receiving interface is not the RPF interface, the RPF check fails and the router discards the packet.
If a match is found and the receiving interface that received the packet is the incoming interface of the forwarding entry, the router forwards the packet out of all the outgoing interfaces.
If a match is found but the receiving interface is not the incoming interface of the forwarding entry, the router first determines the RPF route back to the packet source. Then, the router performs one of the following actions:
If the RPF interface is the incoming interface, the forwarding entry is correct but the packet traveled along a wrong path. The router discards the packet.
If the RPF interface is not the incoming interface, the forwarding entry has expired. The router replaces the incoming interface with the RPF interface. In this case, if the receiving interface is the RPF interface, the router forwards the packet out of all outgoing interfaces. Otherwise, it discards the packet.
Figure 15: RPF check process
As shown in Figure 15, assume that unicast routes are available in the network, and no static multicast routes have been configured on Switch C. A multicast packet (S, G) travels along the SPT from the multicast source to the receivers. The multicast forwarding table on Switch C contains the (S, G) entry, with VLAN-interface 20 as the incoming interface.
If a multicast packet arrives at Switch C on VLAN-interface 20, the receiving interface is the incoming interface of the (S, G) entry. Switch C forwards the packet out of all outgoing interfaces.
If a multicast packet arrives at Switch C on VLAN-interface 20, the receiving interface is not the incoming interface of the (S, G) entry. Switch C looks up its unicast routing table and finds that the outgoing interface to the source is VLAN-interface 20. It means that the (S, G) entry is correct, but the packet traveled along a wrong path. The packet fails the RPF check and Switch C discards the packet.