When does passive roaming occur?

Hello! @brocaar
I have conducted research on LoRa and LoRaWAN. I would like to understand when passive roaming occurs in the overlapping coverage of two different ChirpStack networks.
Does passive roaming occur based on the downlink-gateway-selection algorithm, which utilizes RSSI and SNR? Or are there other rules, such as location, involved?

In my understanding:

the fNS has no knowledge of whether it is overlapping with the sNS or not, therefore any packets the fNS receives it will attempt to forward to the sNS, regardless of whether the sNS has already received that packet on its own gateway.

So there is no algorithm to decide when to begin passive roaming on a device with an active session, if the gateway receives the packet, it forwards it.

Perhaps you are confusing passive roaming with handover roaming, where an active session is made with the fNS.

I apologize for any confusion. Please refer to the figure I have uploaded. In cases where there are multiple overlapped gateways controlled under the home network and gateways under visited network, I would like to understand how to select the downlink gateway to send the packet labeled “8” in the figure. If there are gateways controlled under the home network and gateways under the visited network within the same coverage area, the home network server needs to select the gateway for sending a downlink packet. How does ChirpStack choose the downlink gateway in this scenario?