feat(reflector): gateway prefix routing via shouldRelayInbound
A non-owner reflector with two trunk legs (a country gateway sitting
between an international mesh and a national mesh) now forwards inbound
trunk traffic toward the actual prefix owner — automatically, via
longest-prefix-match in its own [TRUNK_x] table. Cluster TGs keep their
deliberate single-hop semantic to prevent loops in cyclic meshes.
Implementation
- Reflector::shouldRelayInbound(tg) composes the inbound relay decision:
* isLocalTG -> fan out (existing owner-relay)
* isClusterTG -> stop (anti-loop; cluster TGs broadcast outbound
from local clients only)
* hasPrefixRoute -> gateway forwarding via per-trunk isSharedTG
- The four isLocalTG gates in TrunkLink::handleMsgPeer{TalkerStart,
TalkerStop,Audio,Flush} are replaced by shouldRelayInbound. Source
exclusion in forwardTrunk*ToOtherTrunks plus per-link interest
tracking keep the topology naturally loop-free.
Tests
- topology.py: per-reflector `peers` filter for sparse layouts; new
reflector `d` (prefix 1219, trunked only to `b`) demonstrating
gateway-only reachability from `a` to `d`.
- generate_configs.py: honours the peers filter.
- test_trunk.py:
* setUpClass and test_01 skip non-existent pairs in sparse layouts.
* test_37_gateway_prefix_routing: a-client (122) <-> d-client (1219)
over TG 121950 in both directions, no CLUSTER_TGS.
* test_38_cluster_tg_local_client_broadcast: explicit coverage for
the outbound local-client cluster broadcast path.
- All previously passing tests still pass: 41/41 trunk + 7/7
mqtt-deltas + 14/14 twin.
Docs
- docs/TOPOLOGY_EXAMPLES.md (new) + .pdf + topology_pdf/ build sources +
build_topology_pdf.sh: visual cookbook of the five topology shapes
(international full-mesh, national mesh joined at gateway, satellite
tree, hybrid satellite-under-regional, HA twin pair). Includes an
MCC-range appendix with the recommendation to draw cluster TGs from
100-199 / 800-999 to avoid country-prefix collisions.
- docs/PEER_PROTOCOL.md: rewrote the "Owner-Relay Fanout" section as
"Inbound Relay (shouldRelayInbound)" with the three-regime
composition and clarified the single-mesh fanout caveat.
- README.md: feature bullet now describes gateway prefix routing and
links to TOPOLOGY_EXAMPLES.md (also added to the documentation list).
This commit is contained in:
1 parent
658a1b153f
commit
52b5e4f3cf
22 files changed
+2191
-38
No files matched your search
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.42.4 (0)
|
||||
-->
|
||||
<!-- Title: NationalMesh Pages: 1 -->
|
||||
<svg width="448pt" height="263pt"
|
||||
viewBox="21.60 21.60 426.13 241.62" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(25.6 237.62)">
|
||||
<title>NationalMesh</title>
|
||||
<!-- SE -->
|
||||
<g id="node1" class="node">
|
||||
<title>SE</title>
|
||||
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M60,-179.01C60,-179.01 12,-179.01 12,-179.01 6,-179.01 0,-173.01 0,-167.01 0,-167.01 0,-144.01 0,-144.01 0,-138.01 6,-132.01 12,-132.01 12,-132.01 60,-132.01 60,-132.01 66,-132.01 72,-138.01 72,-144.01 72,-144.01 72,-167.01 72,-167.01 72,-173.01 66,-179.01 60,-179.01"/>
|
||||
<text text-anchor="middle" x="36" y="-159.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">SE</text>
|
||||
<text text-anchor="middle" x="36" y="-145.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">240</text>
|
||||
</g>
|
||||
<!-- DE -->
|
||||
<g id="node2" class="node">
|
||||
<title>DE</title>
|
||||
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M60,-80C60,-80 12,-80 12,-80 6,-80 0,-74 0,-68 0,-68 0,-45 0,-45 0,-39 6,-33 12,-33 12,-33 60,-33 60,-33 66,-33 72,-39 72,-45 72,-45 72,-68 72,-68 72,-74 66,-80 60,-80"/>
|
||||
<text text-anchor="middle" x="36" y="-60.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">DE</text>
|
||||
<text text-anchor="middle" x="36" y="-46.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">262</text>
|
||||
</g>
|
||||
<!-- SE--DE -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>SE--DE</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M36,-131.8C36,-116.12 36,-95.66 36,-80.03"/>
|
||||
</g>
|
||||
<!-- IT -->
|
||||
<g id="node3" class="node">
|
||||
<title>IT</title>
|
||||
<path fill="#fde2d4" stroke="#c0531c" stroke-width="2" d="M214.02,-129.51C214.02,-129.51 166.02,-129.51 166.02,-129.51 160.02,-129.51 154.02,-123.51 154.02,-117.51 154.02,-117.51 154.02,-94.51 154.02,-94.51 154.02,-88.51 160.02,-82.51 166.02,-82.51 166.02,-82.51 214.02,-82.51 214.02,-82.51 220.02,-82.51 226.02,-88.51 226.02,-94.51 226.02,-94.51 226.02,-117.51 226.02,-117.51 226.02,-123.51 220.02,-129.51 214.02,-129.51"/>
|
||||
<text text-anchor="middle" x="190.02" y="-109.61" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT</text>
|
||||
<text text-anchor="middle" x="190.02" y="-95.61" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">222</text>
|
||||
</g>
|
||||
<!-- SE--IT -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>SE--IT</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M72.11,-143.91C96.74,-135.99 129.23,-125.55 153.87,-117.63"/>
|
||||
</g>
|
||||
<!-- DE--IT -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>DE--IT</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M72.11,-68.11C96.74,-76.03 129.23,-86.47 153.87,-94.39"/>
|
||||
</g>
|
||||
<!-- Z1 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Z1</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M357.03,-212.02C357.03,-212.02 309.03,-212.02 309.03,-212.02 303.03,-212.02 297.03,-206.02 297.03,-200.02 297.03,-200.02 297.03,-177.02 297.03,-177.02 297.03,-171.02 303.03,-165.02 309.03,-165.02 309.03,-165.02 357.03,-165.02 357.03,-165.02 363.03,-165.02 369.03,-171.02 369.03,-177.02 369.03,-177.02 369.03,-200.02 369.03,-200.02 369.03,-206.02 363.03,-212.02 357.03,-212.02"/>
|
||||
<text text-anchor="middle" x="333.03" y="-192.12" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z1</text>
|
||||
<text text-anchor="middle" x="333.03" y="-178.12" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2221</text>
|
||||
</g>
|
||||
<!-- IT--Z1 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>IT--Z1</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.1,-126.83C247.78,-139.34 275.27,-155.2 296.95,-167.7"/>
|
||||
</g>
|
||||
<!-- Z2 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Z2</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M384.53,-157.01C384.53,-157.01 336.53,-157.01 336.53,-157.01 330.53,-157.01 324.53,-151.01 324.53,-145.01 324.53,-145.01 324.53,-122.01 324.53,-122.01 324.53,-116.01 330.53,-110.01 336.53,-110.01 336.53,-110.01 384.53,-110.01 384.53,-110.01 390.53,-110.01 396.53,-116.01 396.53,-122.01 396.53,-122.01 396.53,-145.01 396.53,-145.01 396.53,-151.01 390.53,-157.01 384.53,-157.01"/>
|
||||
<text text-anchor="middle" x="360.53" y="-137.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z2</text>
|
||||
<text text-anchor="middle" x="360.53" y="-123.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2222</text>
|
||||
</g>
|
||||
<!-- IT--Z2 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>IT--Z2</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.18,-111.84C255.12,-116.51 295.5,-123.02 324.42,-127.69"/>
|
||||
</g>
|
||||
<!-- Z3 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Z3</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M384.53,-102.01C384.53,-102.01 336.53,-102.01 336.53,-102.01 330.53,-102.01 324.53,-96.01 324.53,-90.01 324.53,-90.01 324.53,-67.01 324.53,-67.01 324.53,-61.01 330.53,-55.01 336.53,-55.01 336.53,-55.01 384.53,-55.01 384.53,-55.01 390.53,-55.01 396.53,-61.01 396.53,-67.01 396.53,-67.01 396.53,-90.01 396.53,-90.01 396.53,-96.01 390.53,-102.01 384.53,-102.01"/>
|
||||
<text text-anchor="middle" x="360.53" y="-82.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z3</text>
|
||||
<text text-anchor="middle" x="360.53" y="-68.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2223</text>
|
||||
</g>
|
||||
<!-- IT--Z3 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>IT--Z3</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.18,-100.18C255.12,-95.51 295.5,-88.99 324.42,-84.33"/>
|
||||
</g>
|
||||
<!-- Z4 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Z4</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M357.03,-47C357.03,-47 309.03,-47 309.03,-47 303.03,-47 297.03,-41 297.03,-35 297.03,-35 297.03,-12 297.03,-12 297.03,-6 303.03,0 309.03,0 309.03,0 357.03,0 357.03,0 363.03,0 369.03,-6 369.03,-12 369.03,-12 369.03,-35 369.03,-35 369.03,-41 363.03,-47 357.03,-47"/>
|
||||
<text text-anchor="middle" x="333.03" y="-27.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z4</text>
|
||||
<text text-anchor="middle" x="333.03" y="-13.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2224</text>
|
||||
</g>
|
||||
<!-- IT--Z4 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>IT--Z4</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.1,-85.19C247.78,-72.68 275.27,-56.82 296.95,-44.31"/>
|
||||
</g>
|
||||
<!-- Z1--Z2 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Z1--Z2</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M344.85,-164.87C346.13,-162.31 347.44,-159.7 348.72,-157.14"/>
|
||||
</g>
|
||||
<!-- Z1--Z3 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Z1--Z3</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M322.5,-164.76C316.62,-147.76 312.13,-124.8 321.33,-106.81 322.17,-105.17 323.16,-103.6 324.26,-102.1"/>
|
||||
</g>
|
||||
<!-- Z1--Z4 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Z1--Z4</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M322.5,-164.94C322.04,-163.36 321.64,-161.78 321.33,-160.21 311.95,-112.95 311.95,-99.06 321.33,-51.81 321.64,-50.24 322.04,-48.65 322.5,-47.07"/>
|
||||
</g>
|
||||
<!-- Z2--Z3 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Z2--Z3</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M360.53,-109.86C360.53,-107.3 360.53,-104.69 360.53,-102.13"/>
|
||||
</g>
|
||||
<!-- Z2--Z4 -->
|
||||
<g id="edge12" class="edge">
|
||||
<title>Z2--Z4</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M324.26,-109.92C323.16,-108.42 322.17,-106.85 321.33,-105.21 312.13,-87.22 316.62,-64.26 322.5,-47.26"/>
|
||||
</g>
|
||||
<!-- Z3--Z4 -->
|
||||
<g id="edge13" class="edge">
|
||||
<title>Z3--Z4</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M348.71,-54.86C347.43,-52.3 346.12,-49.69 344.84,-47.13"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
Reference in new issue
Block a user