nx_route_probe.nx
buildroot/runtime/nx_route_probe.nx
about
nx_route_probe.nx -- latency-probed multi-path relay selection.
Primitive 2 of NISHI_S_CLASS_ROUTING_ROADMAP: at call start, probe
every candidate relay's RTT live, combine with packet loss + a
jurisdiction penalty, and pick the lowest-cost path -- so a
Texas<->Belarus call prefers a Frankfurt relay over a US one even
when the US one is a hair faster (avoid US/adversary-jurisdiction
transit by policy). All Nishi: composes nx_udp_rv + sys_now_us;
the relays are our own nx_turn_relay (which answers STUN BINDING).
cost(path) = rtt_ms + 30 * loss_pct + jurisdiction_penalty_ms
The jurisdiction penalty is POLICY (operator-editable), not a magic
number baked in source -- the caller passes the avoid-jurisdiction
from ~/.nishi/jurisdiction config per
[[feedback-no-hardcoded-secrets-config-driven]].
dependencies 1 imports · 0 importers
imports: nx_udp_rv.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 20 | const NX_ROUTE_JUR_PENALTY_MS: i64 = 50 // policy weight; caller may override |
functions
| 23 | func nx_route_cost(rtt_ms: i64, loss_pct: i64, jur_penalty_ms: i64) -> i64 |
| 28 | func nx_route_select(costs: *i64, n: i64) -> i64 |
| 42 | func nx_route_jur_penalty(relay_jur: i64, avoid_jur: i64) -> i64 |
| 47 | func _rp_pfd_set_fd(buf: *u8, fd: i64) -> i64 called by 1: nx_route_probe_rtt |
| 51 | func _rp_pfd_set_events(buf: *u8, ev: i64) -> i64 called by 1: nx_route_probe_rtt |
| 57 | func _rp_stun_binding(out: *u8, tx: *u8) -> i64 called by 1: nx_route_probe_rtt |
| 68 | func nx_route_probe_rtt(fd: i64, relay16: *u8, timeout_ms: i64) -> i64 |