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).
30 lines
1.0 KiB
Bash
Executable File
30 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build docs/TOPOLOGY_EXAMPLES.pdf from the Graphviz sources and HTML
|
|
# template under docs/topology_pdf/.
|
|
#
|
|
# Dependencies:
|
|
# - graphviz (dot, circo, neato)
|
|
# - weasyprint
|
|
#
|
|
# The Markdown source (docs/TOPOLOGY_EXAMPLES.md) is independent — this
|
|
# script does not consume it. Update both if you change the prose.
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/topology_pdf"
|
|
|
|
echo "[1/3] Rendering SVG diagrams"
|
|
circo -Tsvg 01_intl_mesh.dot -o 01_intl_mesh.svg
|
|
neato -Tsvg 02_flat_mesh.dot -o 02_flat_mesh.svg
|
|
dot -Tsvg 03_satellite_tree.dot -o 03_satellite_tree.svg
|
|
neato -Tsvg 04_hybrid.dot -o 04_hybrid.svg
|
|
neato -Tsvg 05_twin_pair.dot -o 05_twin_pair.svg
|
|
|
|
echo "[2/3] Building PDF with WeasyPrint"
|
|
BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M UTC")
|
|
sed "s|__BUILD_DATE__|$BUILD_DATE|g" topology.html > topology.rendered.html
|
|
weasyprint topology.rendered.html ../TOPOLOGY_EXAMPLES.pdf
|
|
rm topology.rendered.html
|
|
|
|
echo "[3/3] Done — wrote docs/TOPOLOGY_EXAMPLES.pdf ($(stat -c%s ../TOPOLOGY_EXAMPLES.pdf) bytes)"
|