Routing (Sections 8.7, 8.8)

May 15, 2026 · View on GitHub

← Home

Routing (Sections 8.7, 8.8)

Per draft-thain-ipv8-02 Sections 8.7 and 8.8.

Two-tier routing table (Section 8.7)

TierScopeLookup keyPurpose
1Globalr.r.r.rRoutes to correct AS border router
2Localn.n.n.nIdentical to existing IPv4 routing table

When r.r.r.r = 0.0.0.0 the Tier 1 lookup is bypassed — standard IPv4 rules apply.

Tier 2 supports /8, /16, /24 prefix matching.

Route table config

routes:
  - destination_prefix: "0.0.251.240"
    next_hop: "router-a"
    interface: "lab0"

  - destination_prefix: "0.0.251.241"
    next_hop: "router-b"
    interface: "lab1"

  - destination_prefix: "0.0.0.0"
    next_hop: "ipv4-gateway"
    interface: "ipv4"

VRF — Virtual Routing and Forwarding (Section 8.8)

VRF is mandatory for all IPv8 L3 devices:

VRFVLANPurpose
management4090Device management traffic
oob4091Out-of-band management
defaultGlobal/default routing table

VRF isolation is a routing table property — each VRF has its own independent RouteTable.

Mesh network simulation

The simulator supports multi-hop mesh topologies with cycle detection:

ipv8lab route simulate --config examples/three_asn_mesh.yaml

Packet tracing shows each hop through the network.

BGP8 path selection with CF metric (Section 8.4)

BGP8PathSelector maintains a per-prefix RIB and selects the best path using accumulated Cost Factor:

StepCriterion
1Filter invalid prefixes (/16 min for eBGP8), reject AS-path loops
2Lowest CF_total = CF_external + CF_intrazone
3Shortest AS-path (tie-break)
4Lowest origin ASN (further tie-break)

CF anomalies are flagged when measured RTT is faster than the physics floor (speed of light in fibre over great-circle distance).

Withdraw a prefix → second-best path automatically becomes best.