...
- select the best_ni to send from, by going through all the local_nis that can reach any of the networks the peer is on
- consider local_ni health in the selection by selecting the local_ni with the best health value.
- If this is a resend do not select a local_ni that has already been used.
- select the best_peer_ni that can be reached by the best_ni selected in the previous step
- If this is a resend and the resend peer_ni is specified, then select this peer_ni if it is healthy, otherwise continue with the algorithm.
- If this is a resend and the resend peer_ni is not specified do not consider a peer_ni that has already been used for sending.
- send the message over that path.
...
- find
peer_ni
usingdst_nid
(non-MR, so this is the onlypeer_ni
candidate)- no issue if
peer_ni
is healthy - try this
peer_ni
even if it is unhealthy if this is the 1st attempt to send this message - fail if resending to an unhealthy
peer_ni
- no issue if
- pick the preferred local_NI for this
peer_ni
if set- otherwise pick a healthy If the preferred local_NI is not healthy, then find a healty local NI and make set it to be the preferred local_NI for this
peer_ni
- otherwise pick a healthy If the preferred local_NI is not healthy, then find a healty local NI and make set it to be the preferred local_NI for this
- send over this path
B2D - src any, route dst, nmr dst
- find the router you can reach the dst_nid on (router selection already considers router health using the existing mechanism. Currently a router is alive or dead, discovered via router pings and controlled by tunables such as asynchronous route failure)
- If this is a resend and the peer_ni is unhealthy fail the send
- If this is an original send, then use the peer_ni even if it's not healthy.
- select the best_ni to send from by going through all the local nis that can reach the router NID
- consider local_ni health in the selection by selecting the local_ni with the best health value.
- If this is a resend do not select a local_ni that has already been used.
- send over that path
- find the router you can reach the dst_nid on (router selection already considers router health using the existing mechanism. Currently a router is alive or dead, discovered via router pings and controlled by tunables such as asynchronous route failure)
...
- this NMR peer.
- TODO: What are the impact of switching the preferred NI?
- The NMR peer might think that this message is coming from a different peer. Would that lead to the failure of the RPC message?
- IF so, should we fail the re-sending the message if the preferred NI is set and not healthy?
- TODO: What are the impact of switching the preferred NI?
- otherwise if preferred local_NI is not set, then pick a healthy local NI and make it the preferred NI for this
peer_ni
- this NMR peer.
- send over this path
B2D - src any, route dst, nmr dst
- find route to
dst_nid
- find
peer_ni
of router- no issue if
peer_ni
is healthy - try this
peer_ni
even if it is unhealthy if this is the 1st attempt to send this message - fail if resending to an unhealthy
peer_ni
- no issue if
- pick the preferred local_NI for the
dst_nid
if set- TODO: Same question as above.
- otherwise pick a healthy local NI and make it the preferred NI for this
dst_nid
- send over this path
...