routing – How does a PIM router know which neighbour is the upstream router?

I perceive that sure PIM messages akin to Be a part of/Prune and Graft have a discipline known as ‘Upstream Neighbour Handle’ used to point the recipient of the message, which is the upstream router for a selected multicast visitors stream.
Say I’ve a community phase with 4 routers, and one in every of them is forwarding multicast visitors on the mentioned phase, visitors sourced in one other community. If one of many different 3 routers would ship a Prune message in direction of the forwarding router, how does it know from which router is the multicast visitors incoming? Is it based mostly on the reverse path to the supply? Or one thing easier, such because the supply MAC of the multicast visitors?