Implement greedy routing with bloom filter priority

Add the full next-hop routing algorithm to Node::find_next_hop():
- Local delivery, direct peer, bloom filter candidates, greedy tree
  routing fallback, with (link_cost, tree_distance, node_addr) ordering
- select_best_candidate() scores by peer→dest distance (not us→peer)
  with self-distance check to prevent routing loops
- TreeState::find_next_hop() for greedy tree routing with progress
  guarantee
- ActivePeer::link_cost() placeholder (constant 1.0) for future link
  quality metrics

Add routing tests including 100-node all-pairs reachability simulation
(9900/9900 delivered, 0 loops, avg 4.0 hops, max 8).

Update fips-routing.md to reflect bloom filter routing as the primary
forwarding mechanism, with greedy tree routing as fallback during
convergence windows.
This commit is contained in:
Johnathan Corgan
2026-02-11 16:55:14 +00:00
parent 066865ddd7
commit 2f8e97c0ab
6 changed files with 942 additions and 74 deletions
+1
View File
@@ -6,6 +6,7 @@ use std::time::Duration;
mod bloom;
mod handshake;
mod routing;
mod spanning_tree;
mod unit;