When a node creates a packet and sends its copy to every node present in the same network even if they don’t want it, it is called broadcast routing. It can lead to flooding in the network. Flooding is a practice where when a node receives a packet, it ends a copy to all its neighbours thereby creating cycles and broadcast storm. It can lead to congestion in network and reduce the quality of the network.
One of the ways to solve this problem is reverse path forwarding. Reverse path forwarding (RPF) is a technique used in modern routers to ensure loop-free forwarding of packets in broadcast routing. There are two types of reverse path forwarding- Unicast RPF (uRPF) and Multicast RPF.
Unicast reverse path forwarding :
It is an evolution of the concept that traffic from known invalid networks should not be accepted on interfaces from which they should never have originated and should block traffic on an interface if it is sourced from forged IP addresses. All routers must have to do their jobs using their routing information base (RIB) or forwarding information base (FIB) to help further restrict the possible sources addresses that should be seen on an interface.
Packets are only forwarded in unicast reverse path forwarding if they come from a router's best route to the source of a packet, ensuring that: 1.)packets coming into an interface come from (potentially) valid hosts, as indicated by the corresponding entry in the routing table. 2.)Packets with source addresses that could not be reached via the input interface can be dropped without disruption to normal use, as they are probably from a misconfigured or malicious source.
There are three modes of uRPF:-
(1.)Strict mode
In strict mode each incoming packet is tested against the FIB and if the incoming interface is not the best reverse path the packet check will fail. By default failed packets are discarded.
(2.)Feasible mode
The FIB maintains alternate routes to a given ip address. If the incoming interface matches with any of the routes associated with the IP address, then the packet is forwarded. Otherwise the packet is dropped.
(3.)Loose mode
In loose mode each incoming packet’s source address is tested against the FIB. The packet is dropped only if the source address is not reachable via any interface on that router.
Multicast reverse path forwarding :
The basic steps followed by the router during Multicast reverse path forwarding are:- 1.)When a router receives a broadcast packet with a given source address, it transmits the packet on all of its outgoing links (except the one on which it was received) only if the packet arrived on the link that is on its own shortest path back to the source. 2.)Otherwise, the router simply discards the incoming packet without forwarding it on any of its outgoing links.
Such a packet can be dropped because the router knows it either will receive or has already received a copy of this packet on the link that is on its own shortest path back to the sender.

In the given diagram, A is the source node broadcasting a packet to every node in the network (namely B, C and D).
Arrows signify the direction of the transmission. The tail of the arrow signifies the sender and the head denotes the receiver. The bold arrow denotes the packet that a given node chose to broadcast further. So in this example, Source A send a packet to B and C. Since B has received the packet from the link from the shortest distance to the source, it chooses to forward this packet to its neighbours C and D. As for node C, it receives copies of the packet from A, B and D. But C chooses the packet from A to forward it to its neighbours and discards the copies received from B and D.