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,133 @@
|
||||
<?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: SatTree Pages: 1 -->
|
||||
<svg width="563pt" height="296pt"
|
||||
viewBox="21.60 21.60 541.60 274.61" 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 270.61)">
|
||||
<title>SatTree</title>
|
||||
<g id="clust1" class="cluster">
|
||||
<title>cluster_intl</title>
|
||||
<path fill="#f4f8ff" stroke="#1a4fa3" stroke-dasharray="5,2" d="M230,-134C230,-134 492,-134 492,-134 498,-134 504,-140 504,-146 504,-146 504,-190 504,-190 504,-196 498,-202 492,-202 492,-202 230,-202 230,-202 224,-202 218,-196 218,-190 218,-190 218,-146 218,-146 218,-140 224,-134 230,-134"/>
|
||||
<text text-anchor="middle" x="361" y="-188.4" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">International trunk mesh (port :5302)</text>
|
||||
</g>
|
||||
<g id="clust2" class="cluster">
|
||||
<title>cluster_sat</title>
|
||||
<path fill="#f5fbf6" stroke="#1e7d34" stroke-dasharray="5,2" d="M20,-8C20,-8 492,-8 492,-8 498,-8 504,-14 504,-20 504,-20 504,-78 504,-78 504,-84 498,-90 492,-90 492,-90 20,-90 20,-90 14,-90 8,-84 8,-78 8,-78 8,-20 8,-20 8,-14 14,-8 20,-8"/>
|
||||
<text text-anchor="middle" x="256" y="-76.4" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="12.00">Italian satellite tree (port :5303)</text>
|
||||
</g>
|
||||
<!-- SE -->
|
||||
<g id="node1" class="node">
|
||||
<title>SE</title>
|
||||
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M492,-181C492,-181 440,-181 440,-181 434,-181 428,-175 428,-169 428,-169 428,-146 428,-146 428,-140 434,-134 440,-134 440,-134 492,-134 492,-134 498,-134 504,-140 504,-146 504,-146 504,-169 504,-169 504,-175 498,-181 492,-181"/>
|
||||
<text text-anchor="middle" x="466" y="-161.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">SE</text>
|
||||
<text text-anchor="middle" x="466" y="-147.1" 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="M387,-181C387,-181 335,-181 335,-181 329,-181 323,-175 323,-169 323,-169 323,-146 323,-146 323,-140 329,-134 335,-134 335,-134 387,-134 387,-134 393,-134 399,-140 399,-146 399,-146 399,-169 399,-169 399,-175 393,-181 387,-181"/>
|
||||
<text text-anchor="middle" x="361" y="-161.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">DE</text>
|
||||
<text text-anchor="middle" x="361" y="-147.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.5" d="M427.87,-157.5C418.3,-157.5 408.72,-157.5 399.14,-157.5"/>
|
||||
</g>
|
||||
<!-- IT -->
|
||||
<g id="node3" class="node">
|
||||
<title>IT</title>
|
||||
<path fill="#fde2d4" stroke="#c0531c" stroke-width="2" d="M282,-181C282,-181 230,-181 230,-181 224,-181 218,-175 218,-169 218,-169 218,-146 218,-146 218,-140 224,-134 230,-134 230,-134 282,-134 282,-134 288,-134 294,-140 294,-146 294,-146 294,-169 294,-169 294,-175 288,-181 282,-181"/>
|
||||
<text text-anchor="middle" x="256" y="-161.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT</text>
|
||||
<text text-anchor="middle" x="256" y="-147.1" 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.5" d="M453.17,-181.24C441.78,-199.59 423.27,-223.62 399.5,-234.5 368.79,-248.56 354.27,-248.44 323.5,-234.5 299.54,-223.64 280.72,-199.6 269.11,-181.25"/>
|
||||
</g>
|
||||
<!-- DE->IT -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>DE->IT</title>
|
||||
<path fill="none" stroke="#5f6368" stroke-width="1.5" d="M322.87,-157.5C313.3,-157.5 303.72,-157.5 294.14,-157.5"/>
|
||||
</g>
|
||||
<!-- Z1 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Z1</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M492,-69C492,-69 440,-69 440,-69 434,-69 428,-63 428,-57 428,-57 428,-20 428,-20 428,-14 434,-8 440,-8 440,-8 492,-8 492,-8 498,-8 504,-14 504,-20 504,-20 504,-57 504,-57 504,-63 498,-69 492,-69"/>
|
||||
<text text-anchor="middle" x="466" y="-49.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z1</text>
|
||||
<text text-anchor="middle" x="466" y="-35.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2221</text>
|
||||
<text text-anchor="middle" x="466" y="-21.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2221</text>
|
||||
</g>
|
||||
<!-- IT->Z1 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>IT->Z1</title>
|
||||
<path fill="none" stroke="#c0531c" stroke-width="1.6" stroke-dasharray="5,2" d="M299.81,-137.88C302.92,-136.57 306.01,-135.26 309,-134 355.62,-114.34 371.78,-117.89 414,-90 421.25,-85.21 428.38,-79.33 434.91,-73.29"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="298.91,-135.98 294.2,-140.26 300.55,-139.85 298.91,-135.98"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="436.43,-74.75 439.34,-69.1 433.54,-71.7 436.43,-74.75"/>
|
||||
</g>
|
||||
<!-- Z2 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Z2</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M387,-69C387,-69 335,-69 335,-69 329,-69 323,-63 323,-57 323,-57 323,-20 323,-20 323,-14 329,-8 335,-8 335,-8 387,-8 387,-8 393,-8 399,-14 399,-20 399,-20 399,-57 399,-57 399,-63 393,-69 387,-69"/>
|
||||
<text text-anchor="middle" x="361" y="-49.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z2</text>
|
||||
<text text-anchor="middle" x="361" y="-35.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2222</text>
|
||||
<text text-anchor="middle" x="361" y="-21.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2222</text>
|
||||
</g>
|
||||
<!-- IT->Z2 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>IT->Z2</title>
|
||||
<path fill="none" stroke="#c0531c" stroke-width="1.6" stroke-dasharray="5,2" d="M280.66,-129.02C295.43,-112.56 314.34,-91.5 330.1,-73.93"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="278.69,-128.07 276.25,-133.94 281.82,-130.88 278.69,-128.07"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="332.01,-74.95 334.45,-69.08 328.88,-72.14 332.01,-74.95"/>
|
||||
</g>
|
||||
<!-- Z3 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Z3</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M282,-69C282,-69 230,-69 230,-69 224,-69 218,-63 218,-57 218,-57 218,-20 218,-20 218,-14 224,-8 230,-8 230,-8 282,-8 282,-8 288,-8 294,-14 294,-20 294,-20 294,-57 294,-57 294,-63 288,-69 282,-69"/>
|
||||
<text text-anchor="middle" x="256" y="-49.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z3</text>
|
||||
<text text-anchor="middle" x="256" y="-35.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2223</text>
|
||||
<text text-anchor="middle" x="256" y="-21.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2223</text>
|
||||
</g>
|
||||
<!-- IT->Z3 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>IT->Z3</title>
|
||||
<path fill="none" stroke="#c0531c" stroke-width="1.6" stroke-dasharray="5,2" d="M256,-127.62C256,-111.76 256,-91.95 256,-75.13"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="253.9,-127.94 256,-133.94 258.1,-127.94 253.9,-127.94"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="258.1,-75.08 256,-69.08 253.9,-75.08 258.1,-75.08"/>
|
||||
</g>
|
||||
<!-- Z4 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Z4</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M177,-69C177,-69 125,-69 125,-69 119,-69 113,-63 113,-57 113,-57 113,-20 113,-20 113,-14 119,-8 125,-8 125,-8 177,-8 177,-8 183,-8 189,-14 189,-20 189,-20 189,-57 189,-57 189,-63 183,-69 177,-69"/>
|
||||
<text text-anchor="middle" x="151" y="-49.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z4</text>
|
||||
<text text-anchor="middle" x="151" y="-35.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2224</text>
|
||||
<text text-anchor="middle" x="151" y="-21.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2224</text>
|
||||
</g>
|
||||
<!-- IT->Z4 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>IT->Z4</title>
|
||||
<path fill="none" stroke="#c0531c" stroke-width="1.6" stroke-dasharray="5,2" d="M231.34,-129.02C216.57,-112.56 197.66,-91.5 181.9,-73.93"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="230.18,-130.88 235.75,-133.94 233.31,-128.07 230.18,-130.88"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="183.12,-72.14 177.55,-69.08 179.99,-74.95 183.12,-72.14"/>
|
||||
</g>
|
||||
<!-- Z5 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Z5</title>
|
||||
<path fill="#dff3e0" stroke="#1e7d34" stroke-width="2" d="M72,-69C72,-69 20,-69 20,-69 14,-69 8,-63 8,-57 8,-57 8,-20 8,-20 8,-14 14,-8 20,-8 20,-8 72,-8 72,-8 78,-8 84,-14 84,-20 84,-20 84,-57 84,-57 84,-63 78,-69 72,-69"/>
|
||||
<text text-anchor="middle" x="46" y="-49.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT-Z5</text>
|
||||
<text text-anchor="middle" x="46" y="-35.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">2225</text>
|
||||
<text text-anchor="middle" x="46" y="-21.1" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2225</text>
|
||||
</g>
|
||||
<!-- IT->Z5 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>IT->Z5</title>
|
||||
<path fill="none" stroke="#c0531c" stroke-width="1.6" stroke-dasharray="5,2" d="M211.98,-142.67C179.29,-131.28 134.41,-113.25 99,-90 91.66,-85.18 84.43,-79.29 77.77,-73.25"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="211.59,-144.75 217.94,-144.72 212.95,-140.78 211.59,-144.75"/>
|
||||
<polygon fill="#c0531c" stroke="#c0531c" stroke-width="1.6" points="79.09,-71.61 73.26,-69.06 76.23,-74.68 79.09,-71.61"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.8 KiB |
Reference in new issue
Block a user