In unicast routing and forwarding, unicast packets are transmitted along a point-to-point path. Routers only need to know the destination address of a packet to find the outbound interface. In multicast routing and forwarding, however, routers cannot know the location of a specific receiver because the destination address of a multicast packet identifies a group of receivers. Because routers can find out the source of a multicast packet based on the source address, they can check the source addresses of multicast packets to ensure correct forwarding paths. The process of checking the forwarding path based on the source address is a reverse path forwarding (RPF) check.
When a router receives a multicast packet, it searches the unicast routing table for the route to the source address of the packet. After finding the route, the router checks whether the outbound interface for the route is the same as the inbound interface of the multicast packet. If they are the same, the router considers that the multicast packet has been received from a correct interface. This ensures correct forwarding paths for multicast packets.
The correct interface is called an RPF interface.
When a router receives the first multicast packet of a stream, it selects an optimal route from the unicast routing table based on the source address of the packet. The outbound interface of the unicast route is an RPF interface, and the next hop of the route is the RPF neighbor. The router compares the inbound interface of the packet with the RPF interface of the selected RPF route. If the inbound interface is the same as the RPF interface, the router considers that the packet has arrived on the correct path from the source and forwards the packet downstream. If the inbound interface is different from the RPF interface, the packet fails the RPF check. The router considers that the packet is received from an incorrect interface and discards the packet.
Multicast routing protocols determine upstream and downstream neighbors and create multicast routing entries based on unicast routes. The RPF check mechanism enables multicast data streams to be transmitted along the multicast distribution tree and prevents loops on forwarding paths.
If a router searches the unicast routing table to perform an RPF check on every multicast data packet received, many system resources are consumed. To save system resources, a router first searches for the matching (S, G) entry after receiving a data packet sent from a source to a group.