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:
Audric committed 2026-05-07 16:12:14 +02:00
1 parent 658a1b153f
commit 52b5e4f3cf
22 files changed
+2191 -38

No files matched your search

+18 -6
View File
@@ -40,12 +40,19 @@ automatically.
multiple prefix groups (e.g. `LOCAL_PREFIX=11,12,13`) multiple prefix groups (e.g. `LOCAL_PREFIX=11,12,13`)
- **Server-to-server trunk links** — persistent TCP connections between pairs of - **Server-to-server trunk links** — persistent TCP connections between pairs of
reflectors carry talker state and audio for shared TGs reflectors carry talker state and audio for shared TGs
- **Full-mesh topology** — any number of reflectors can be trunked together; - **Full-mesh topology with gateway prefix routing** — any number of
every pair has a direct link. Audio distribution uses **single-hop reflectors can be trunked together; every pair has a direct link inside a
owner-relay**: a non-owner sends to the TG's owner, and the owner fans the mesh. Audio distribution uses **owner-relay**: a non-owner sends to the
audio out to every other trunk peer with interest. No daisy-chain relaying, TG's owner, and the owner fans the audio out to every other trunk peer
so conversations on a shared TG work between clients on any two (or more) with interest. A reflector with two trunk legs (e.g. a country gateway
reflectors between an international mesh and a national mesh) automatically bridges
inbound traffic toward the longest-prefix-match owner via
`Reflector::shouldRelayInbound` — no `CLUSTER_TGS` hack required.
Cluster TGs keep an anti-loop single-hop semantic. See
[`docs/TOPOLOGY_EXAMPLES.md`](docs/TOPOLOGY_EXAMPLES.md) for a visual
cookbook of the five supported shapes (international full-mesh,
national mesh joined at gateway, satellite tree, hybrid
satellite-under-regional, HA twin pair)
- **Unlimited concurrent conversations** — the trunk TCP connection multiplexes - **Unlimited concurrent conversations** — the trunk TCP connection multiplexes
all active TGs simultaneously; the only per-TG rule is one talker at a time all active TGs simultaneously; the only per-TG rule is one talker at a time
- **Independent talker arbitration** — each reflector arbitrates its own clients; - **Independent talker arbitration** — each reflector arbitrates its own clients;
@@ -524,6 +531,11 @@ The PTY path is set by `COMMAND_PTY` in `[GLOBAL]` (default
- [`docs/PEER_PROTOCOL.md`](docs/PEER_PROTOCOL.md) — full wire protocol - [`docs/PEER_PROTOCOL.md`](docs/PEER_PROTOCOL.md) — full wire protocol
specification: message format, handshake sequence, talker arbitration specification: message format, handshake sequence, talker arbitration
tie-breaking, heartbeat, and the complete message type table tie-breaking, heartbeat, and the complete message type table
- [`docs/TOPOLOGY_EXAMPLES.md`](docs/TOPOLOGY_EXAMPLES.md) — visual
cookbook of the five supported topology shapes (international
full-mesh, national mesh joined at gateway, satellite tree, hybrid,
HA twin pair) with rendered diagrams; PDF version in
[`docs/TOPOLOGY_EXAMPLES.pdf`](docs/TOPOLOGY_EXAMPLES.pdf)
- [`docs/DEPLOYMENT_ITALY.md`](docs/DEPLOYMENT_ITALY.md) — complete national - [`docs/DEPLOYMENT_ITALY.md`](docs/DEPLOYMENT_ITALY.md) — complete national
deployment example for Italy (20 regions, full mesh) deployment example for Italy (20 regions, full mesh)
- [`docs/DEPLOYMENT_ITALY_IT.md`](docs/DEPLOYMENT_ITALY_IT.md) — same document - [`docs/DEPLOYMENT_ITALY_IT.md`](docs/DEPLOYMENT_ITALY_IT.md) — same document
+45 -16
View File
@@ -98,27 +98,54 @@ at reflector B and carries only TGs whose decimal string starts with B's prefix
hop is direct, and audio distribution across more than two reflectors is hop is direct, and audio distribution across more than two reflectors is
handled by owner-relay (see below), not by daisy-chain forwarding. handled by owner-relay (see below), not by daisy-chain forwarding.
### Owner-Relay Fanout ### Inbound Relay (`shouldRelayInbound`)
Prefix routing alone gets talker state and audio from a non-owner to the TG's Prefix routing alone gets talker state and audio from a non-owner to the TG's
owner, and from the owner to its local clients. But in a mesh of 3+ owner, and from the owner to its local clients. But in a mesh of 3+
reflectors, the owner is also the only reflector that sees every non-owner's reflectors, the owner is also the only reflector that sees every non-owner's
traffic on that TG — so for every non-owner to hear every other, the owner traffic on that TG — so for every non-owner to hear every other, the owner
must fan out. must fan out. Additionally, a reflector with two trunk legs (a *gateway*
between meshes) needs to bridge prefix-routed traffic from one leg to the
other.
When `TrunkLink::handleMsgPeerTalkerStart` / `handleMsgPeerTalkerStop` / `TrunkLink::handleMsgPeerTalkerStart` / `handleMsgPeerTalkerStop` /
`handleMsgPeerAudio` / `handleMsgPeerFlush` runs on the reflector that `handleMsgPeerAudio` / `handleMsgPeerFlush` invoke
**owns** the TG (`Reflector::isLocalTG(tg)`), after the existing local `Reflector::shouldRelayInbound(tg)` after local delivery to decide whether
delivery the event is re-forwarded to every **other** trunk peer through the to re-forward to other trunk peers via the same per-link filter
same per-link filter (`isSharedTG` / `isClusterTG` / `isPeerInterestedTG`). (`isSharedTG` / `isClusterTG` / `isPeerInterestedTG`). The source trunk is
The source trunk is excluded from the fanout. always excluded from the fanout.
This preserves the single-hop invariant: ```cpp
bool Reflector::shouldRelayInbound(uint32_t tg) const {
if (isLocalTG(tg)) return true; // owner-relay fanout
if (isClusterTG(tg)) return false; // anti-loop: cluster TGs stay single-hop
return hasPrefixRoute(tg); // gateway: have route, forward onward
}
```
- **Non-owners** receiving trunk audio deliver to local clients and stop — Three regimes follow:
they never relay to another trunk.
- **The owner** is the one and only relay. Because the source link is - **Owner relay (`isLocalTG`).** When we own the TG, we are the one and only
skipped, the fanout cannot echo back. relay for full-mesh fanout. Source-trunk exclusion prevents echo back.
- **Cluster TGs.** Cluster TGs received inbound on a trunk are delivered
locally and *not* re-forwarded to other trunks — this is deliberate.
Cluster TGs are broadcast outbound by every reflector's *local* clients
(the `isClusterTG` branch in `onLocalAudio`); transitive trunk-to-trunk
relay would loop in any cyclic mesh. The recipient still checks
`isClusterTG` on inbound to admit the frame for local delivery.
- **Gateway prefix routing.** When we are a non-owner of the TG but
`hasPrefixRoute(tg)` returns true — i.e. some prefix in `m_all_prefixes`
prefix-matches the TG — we forward onward through `onLocal*`. The
per-link `isSharedTG` filter (longest-prefix-match against the *remote*
prefix) selects the unique trunk whose `REMOTE_PREFIX` is the longest
match, so the relay goes toward the actual owner, not in all directions.
`isPeerInterestedTG` covers the return leg back through the same gateway.
Loop safety holds because **peer interest is populated only on direct receive**
(`TrunkLink.cpp:1025, 1111`). In any chain X→Y→Z, Z registers Y as
interested but never X — so when audio circulates back, Y's onward fanout
finds nothing matching for X (no `isSharedTG`, no interest), and stops. No
TTLs, no path lists.
Example (refA prefix `240`, refB prefix `262`, refC prefix `222`, mesh Example (refA prefix `240`, refB prefix `262`, refC prefix `222`, mesh
trunked, a client on each of refA and refC monitoring TG `2626` which is trunked, a client on each of refA and refC monitoring TG `2626` which is
@@ -132,12 +159,14 @@ refA client PTT on 2626
└─► refC broadcasts to local clients on 2626 (no further relay) └─► refC broadcasts to local clients on 2626 (no further relay)
``` ```
**Scales to any mesh size.** In a mesh of N reflectors with owner B and **Scales to any mesh size.** Inside a single mesh of N reflectors with
N−1 non-owners, when any non-owner talks: owner B and N−1 non-owners, when any non-owner talks:
- sender → B directly (prefix match) - sender → B directly (prefix match)
- B fans out to the other N−2 peers (source link excluded) - B fans out to the other N−2 peers (source link excluded)
- each non-owner delivers locally and stops - each non-owner delivers locally and stops *(unless it has a prefix route
into another mesh, in which case `shouldRelayInbound` bridges onward —
see the gateway case above)*
Complexity per audio frame on the owner is **O(N) TCP sends** — inherent to Complexity per audio frame on the owner is **O(N) TCP sends** — inherent to
any mesh fanout, not a new limitation. any mesh fanout, not a new limitation.
+471
View File
@@ -0,0 +1,471 @@
# Mesh Topology Examples
> **GeuReflector** — an extended fork of
> [SvxReflector](https://github.com/sm0svx/svxlink), drop-in compatible with
> the upstream `svxreflector` binary. Adds trunks, twins, satellites,
> filters and more.
>
> Built on the SvxLink project by SM0SVX
> (<https://github.com/sm0svx/svxlink>). Thanks to DG1FI, DJ1JAY, SA2BLV,
> UR3QJW, YO6NAM and others for their interest, testing, debugging,
> suggestions, and contributions.
>
> Project home: <https://github.com/audric/GeuReflector>.
A visual cookbook of the five topology shapes GeuReflector supports, using a
European running example: Italy as the focus country, with Sweden and Germany
as international neighbours. Italian regional sub-prefixes follow BrandMeister
Zone numbering (`222X` = Zone X).
For full production-grade walkthroughs see
[`DEPLOYMENT_ITALY.md`](DEPLOYMENT_ITALY.md) (national) and
[`WW_DEPLOYMENT.md`](WW_DEPLOYMENT.md) (worldwide). For protocol details see
[`PEER_PROTOCOL.md`](PEER_PROTOCOL.md). For the satellite design rationale see
[`DESIGN_SATELLITE_AND_CLUSTER.md`](DESIGN_SATELLITE_AND_CLUSTER.md).
> **PDF version:** a typeset version with rendered diagrams is at
> [`TOPOLOGY_EXAMPLES.pdf`](TOPOLOGY_EXAMPLES.pdf). Rebuild with
> `docs/build_topology_pdf.sh` (requires `graphviz` and `weasyprint`).
> Sources live under `docs/topology_pdf/`.
---
## Background you need before reading the diagrams
GeuReflector links separate reflector instances in two distinct ways:
**Trunk** (TCP `:5302`) — bidirectional, designed for full-mesh peering within
a chosen scope. Each peer owns one or more numeric prefixes. TG routing is by
**longest-prefix-match** against each reflector's *local* prefix table — built
from its own local prefix plus the `REMOTE_PREFIX` of each `[TRUNK_x]` it has.
Prefixes are **not** gossiped between peers, so a reflector only knows the
prefixes it's been explicitly configured to trunk to. Audio relay is
**single-hop**: only the prefix owner fans audio out to other interested
peers. Non-owners that receive trunk audio deliver it locally and stop. The
source peer is excluded from the owner's fanout to prevent loops.
**Satellite** (TCP `:5303`) — one-to-many star. A satellite reflector connects
out to a parent reflector and mirrors TGs in both directions. An optional
`SATELLITE_FILTER` on the satellite side scopes the mirrored set in **both**
directions: the satellite suppresses non-matching outbound, and the parent
learns the filter via `MsgPeerFilter` (type 122) and drops non-matching
forwards going down.
Two other behaviours show up repeatedly in the flow descriptions below:
- **Peer interest** is populated when a peer emits `PeerTalkerStart` /
`PeerAudio` for a TG. Until that happens, the owner doesn't know to
fan that TG back to that peer. Interest expires after **10 minutes** of
inactivity on that TG from that peer (or immediately on trunk disconnect).
- **MCC-style country prefixes** are used for the international mesh:
IT = `222`, SE = `240`, DE = `262`. Reusing the DMR MCC layout makes
ownership self-documenting.
---
## 1. International full-mesh
Country gateways only. Every reflector owns its country's MCC and trunks
directly to every other country.
```
INTERNATIONAL MESH (trunk full mesh, port :5302)
[IT 222]
╱ ╲
╱ ╲
[SE 240]──────[DE 262]
every pair = bidirectional TCP trunk + HMAC handshake
TG 240xx → SE · 222xx → IT · 262xx → DE
```
**Flow.** An SE client keys TG `22299`. SE's prefix table maps `222 → IT`,
so SE sends to IT. IT delivers locally and fans the audio out to DE (if it
has shown interest in `22299` recently); SE is excluded as the source.
This layer is the foundation. Everything else stacks on top of it.
---
## 2. National trunk mesh joined at the country gateway
Italy adds per-Zone reflectors that form a **national trunk mesh** together
with IT 222. Foreign countries see only IT 222 — the Zone prefixes are not
advertised internationally. The country gateway is the **hinge** between the
international and national meshes.
```
INTERNATIONAL DOMAIN NATIONAL DOMAIN
(trunk, port :5302) (trunk, port :5302)
[SE 240] [IT-Z1 2221]
│ ╱ │
│ ┌──── [IT 222] ────┐ ╱ │
│ │ country gateway │ [IT-Z2 2222]
│ │ (the hinge) │ │
│ └──── ........ ───┘ [IT-Z3 2223]
[DE 262] │
[IT-Z4 2224]
╲ │
full mesh
inside the
national domain
```
The two domains share a single node — IT 222 — which is the only Italian
reflector with `[TRUNK_x]` entries pointing at SE and DE.
Italian Zone prefixes follow BrandMeister:
| Prefix | Reflector | Coverage |
|---|---|---|
| `2221` | IT-Z1 | Nord-Ovest (Liguria, Piemonte, Val d'Aosta) |
| `2222` | IT-Z2 | Lombardia |
| `2223` | IT-Z3 | Triveneto (FVG, Trentino-AA, Veneto) |
| `2224` | IT-Z4 | Emilia-Romagna |
| `2225` | IT-Z5 | Toscana |
| `2226..2229` | IT-Z6..Z9 | Centro, Puglia, Sud, Sicilia |
**Ownership vs. reachability.** Each reflector's prefix table is built from
*its own* config — local prefix plus the `REMOTE_PREFIX` of each `[TRUNK_x]`
section. SE only knows the prefixes it has trunks for: `222` (IT) and `262`
(DE). SE has no idea that `2222` exists, even though Z2 owns it inside Italy.
| TG | Owner (globally) | SE's view | IT 222's view |
|---|---|---|---|
| `22221` | IT-Z2 (longest match `2222`) | only `222` matches → send to IT 222 | `2222` matches → Z2 is owner |
| `22299` | IT 222 (only `222` matches) | send to IT 222 | own this TG |
| `2629` | DE (only `262` matches) | send to DE | send to DE |
**Flow.**
- A **Z2 client** keying `22221` (Lombardia): Z2 owns `2222`, so it plays
locally and fans out on the trunk side to interested peers in the national
mesh — IT 222 and the other Zones. It does *not* trunk-forward to SE/DE
(it has no trunks to them).
- An **SE client** keying the same `22221`: SE's table has only `222` as a
match, so it sends to IT 222 thinking IT is the owner. IT 222 receives it,
sees that Z2 actually owns `2222` in its own trunk table, and **bridges
the frame onward to Z2** via the gateway-routing path
(`Reflector::shouldRelayInbound` returns true because IT has a prefix
route for `2222`). Z2 plays locally and fans the audio out to its national
peers (excluding IT as the source). The return leg works the same way:
audio from a Z3 client reaches SE because IT's `isPeerInterestedTG` for
`22221` was registered on the SE side when SE's PTT first arrived.
> **Cluster TGs are for unowned TGs, not for cross-mesh routing.**
> Gateway prefix routing handles foreign-to-regional reach automatically
> as long as IT 222 has a `[TRUNK_x]` section pointing at the regional
> reflector — regional TGs do not need to be listed in `CLUSTER_TGS`.
> `CLUSTER_TGS` is the right tool for TGs that **cannot** be resolved by
> prefix because no reflector owns them: TG `91` for worldwide chat
> (international domain), or `112` for nationwide broadcast inside a
> country (national domain). Configure those on every reflector that
> should join the broadcast.
**Trade-offs.**
- **Pro:** Zones only need inbound reachability from peers inside the
national mesh, not from the entire international Internet.
- **Pro:** Foreign reflectors carry no Italian internal prefix table; the
country presents one face upstream (`222`).
- **Pro:** the national mesh stays healthy if intl connectivity is degraded
— Zones keep talking to each other.
- **Pro:** foreign-to-regional reach works out of the box thanks to
gateway prefix routing on IT 222.
- **Con:** IT 222 is a single point of failure for any international reach
into or out of Italy — unless it's run as a twin pair (§5), which removes
this caveat.
---
## 3. Satellite tree — Zones as satellites of IT 222
Pull the Zones off the international mesh entirely. Only IT 222 is a trunk
peer; the Zones become satellites of IT 222.
> **Trust model — small-deployment / single-operator pattern.**
> Satellites were originally introduced as a development/check reflector — a
> small NAT'd instance hanging off a parent for testing. The use case has
> grown beyond that, but the authentication model has not yet caught up: the
> parent's `[SATELLITE] SECRET` is **a single shared string** used to
> validate every inbound satellite (`Reflector.cpp:2675-2701`). If the
> secret leaks, an attacker can connect as any `sat_id` and present any
> `SATELLITE_FILTER` of their choosing — there's no per-satellite scoping
> on the parent side. This makes §3 most appropriate for small deployments
> under one trusted operator. For multi-operator national meshes, prefer
> §2 (national trunk mesh) where each `[TRUNK_x]` has its own `SECRET`,
> or §4 (hybrid) for a single NAT'd downstream site. **Future work**:
> per-satellite secrets keyed by `sat_id`, mirroring how trunks already
> work — until then, treat the shared secret as a design constraint of
> this pattern.
```
INTERNATIONAL MESH (trunk full mesh, port :5302)
same as section 1 — only IT 222 represents Italy upstream
[IT 222]
╱ ╲
[SE 240]──────[DE 262]
SATELLITE TREE under IT 222 (port :5303, star)
[IT 222] ◄── parent (also intl peer)
┌──────┬──────┬─┴─┬──────┬──────┐
│ │ │ │ │ │
[Z1] [Z2] [Z3] [Z4] [Z5] [Z6..]
2221 2222 2223 2224 2225 …
↑ each satellite sets SATELLITE_FILTER to its own prefix
(e.g. Z2: SATELLITE_FILTER=2222)
Filter is bidirectional:
· satellite suppresses non-matching outbound
· parent (IT 222) drops non-matching forwards going down
(filter advertised via MsgPeerFilter, type 122)
```
**Flow.** An SE client keys `22241` (Emilia-Romagna). SE only knows
`222 → IT` (the Zone prefixes are not on the international mesh in this
variant), so SE→IT 222 over the trunk. IT 222 delivers locally and mirrors
down the satellite tree; only Z4's filter (`2224`) accepts `22241`, so Z4
receives it. Z1/Z2/Z3/Z5 see nothing because IT 222 dropped those forwards.
A Z3 client keying `2629` (DE) goes Z3 → IT 222 (satellite mirror up) →
DE (intl trunk forward). Two-hop cross-country path; no daisy-chain trunk
relay needed because the satellite hop is independent of the trunk
single-hop rule.
**Trade-offs vs. the national trunk mesh.**
| | National trunk mesh (§2) | Satellite tree (§3) |
|---|---|---|
| TCP connections per Zone | M − 1 within the national mesh (Zones + IT 222) | 1 (to IT 222) |
| NAT story | Zones need inbound reachability from other Zones + IT 222 | only IT 222 needs an inbound port |
| IT 222 outage | Zones keep talking to each other; international reach is lost | whole country offline |
| Foreign → regional TG reach | works automatically via gateway prefix routing on IT 222 (`shouldRelayInbound`) | works automatically via parent mirror + filter |
| Fanout cost on a busy Zone | O(other national peers) | O(0) — parent does it |
| Prefix advertised upstream | only `222` (Zones not visible to SE/DE) | only `222` (Zones hidden behind parent) |
---
## 4. Satellite under a regional reflector
Hybrid layout: keep the §2 two-domain structure (intl mesh + national mesh
joined at IT 222), and let one Zone host its own satellite reflector. The
Zone itself is *not* a satellite — it wears two hats: trunk peer in the
national mesh, parent to its own satellite. Two motivations apply, often
together:
- **NAT traversal.** The downstream site (e.g. a Milano club, MI) only
needs one outbound TCP connection to Z2. No port-forwarding, no public
IP — useful when the sub-group's site sits behind carrier-grade NAT or a
firewall the Zone admin doesn't control.
- **Administrative delegation.** The Zone admin (e.g. of IT-Z2 /
Lombardia) lets a sub-group bring up their own reflector with their own
user accounts and passwords, *without* sharing Z2's `[USERS]` /
`[PASSWORDS]` database. Z2 admin holds Z2's user DB and the
`[SATELLITE] SECRET` that MI presents to attach; MI admin holds MI's
own `[USERS]` / `[PASSWORDS]` — only MI's V2 clients authenticate
against it. Audio federates over the satellite link while authentication
state stays separated on each side.
```
INTL DOMAIN NATIONAL DOMAIN SATELLITE under Z2
(port :5302) (port :5302) (port :5303)
[SE 240] [IT-Z1 2221]
│ ╱ │
│ [IT 222] ──┤ [IT-Z2 2222] ─ ─ ─ ─ ─ [MI club]
│ (gateway) │ │ SATELLITE_OF=z2.host
│ ╲ [IT-Z3 2223] SATELLITE_FILTER=2222
[DE 262] ╲ │ (optional, see below)
[IT-Z4 2224]
(full mesh
inside the
national domain)
```
Z2 wears two hats simultaneously: trunk peer in the national mesh
(IT 222 / Z1 / Z3 / Z4 / Z5), and satellite parent to MI. These are
independent code paths. Mirroring inside Z2 happens between its trunk side
and its satellite side. Z2 has **no** trunks to SE/DE — those reach Z2
through the IT 222 hinge via gateway prefix routing (see §2).
**Flow.**
- **MI client keys `22221`**: MI mirrors up to Z2 (Lombardia). Z2 owns
`2222` — plays locally, fans on the trunk side to interested peers in the
*national* mesh (IT 222 / Z1 / Z3 / Z4 if they've shown interest), and
skips MI on the satellite side because MI is the source. Z2 does not
trunk-forward to SE/DE — it has no trunks to them.
- **SE client keys `22221`**: SE only knows `222 → IT`. SE→IT 222 over
the trunk. IT 222 isn't the owner of `2222`, but its gateway-routing
rule (`shouldRelayInbound` finds a `2222` route in IT's trunk table)
bridges the frame to Z2. Z2 plays locally and mirrors down to MI through
the satellite link (filter `2222` matches). The return leg works
symmetrically through `isPeerInterestedTG`.
- **MI client keys `22241`** (Emilia-Romagna, owned by Z4): MI→Z2
(satellite up). Z2 isn't the owner — its trunk-side forwarding sees
`2224` and trunk-sends to Z4. Z4 plays locally and fans to interested
peers, including Z2 *only if* Z2 has previously PTT'd on `22241`.
Consequence: the first MI→`22241` PTT works outbound but won't get
return audio until Z2 is registered as interested at Z4. The MI→Z2→Z4
PTT itself registers Z2's interest, so for the next ~10 min audio from
any other client on `22241` flows Z4→Z2→MI.
**Subtlety with `SATELLITE_FILTER`.** A restrictive filter like `2222`
prevents MI from reaching anything outside Lombardia: filter is bidirectional,
so MI suppresses non-`2222*` outbound and Z2 drops non-`2222*` forwards going
down. The MI→`22241` example above only works if the filter is broadened to
`222` (or unset). Use a tight filter only when the satellite truly is
single-purpose (e.g. a regional repeater that should never hear other Zones'
traffic).
---
## 5. HA twin pair
A **twin** is a purpose-built link type for running two reflector instances
as a redundant pair. Both nodes declare the *same* `LOCAL_PREFIX`, mirror
their full `TGHandler` state to each other over a `[TWIN]` link, and present
as a single logical reflector to the rest of the world. SvxLink nodes list
both endpoints in their `HOSTS` setting for transparent failover. See
[`TWIN_PROTOCOL.md`](TWIN_PROTOCOL.md) for the full design and tests.
```
INTERNATIONAL MESH HA TWIN PAIR (DE)
[SE 240] ┌─── [DE-A 262] ────┐
│ │ │
│ │ [TWIN] │
│ │ full-state │
│ │ mirror │
│ │ heartbeat 2s/5s │
│ │ │
[IT 222] ──────────────────────────┴─── [DE-B 262] ────┘
(both own LOCAL_PREFIX=262)
On IT and SE, the [TRUNK_DE] section has PAIRED=1 and
HOST=de-a,de-b. Each external peer holds two TCP sockets but
sticky-selects one per frame, with instant failover on socket failure.
```
**What's different from trunk and satellite.**
| Property | Trunk | Satellite | Twin |
|---|---|---|---|
| Directionality | symmetric | one-way bias (parent→sat) | symmetric |
| Prefix ownership | distinct per node | n/a | **identical** on both nodes |
| Filtering | `isSharedTG` / `isOwnedTG` | none | none (full mirror inside the pair) |
| Peers per section | 1 | many sats per parent | **exactly 1** (strictly pairwise) |
| External trunk ownership | each node holds its own | parent-only | both hold; external peer picks one socket per frame |
| Heartbeat cadence (TX = send interval, RX = silence timeout) | 10 s / 15 s | 10 s / 15 s | **2 s / 5 s** (LAN-close) |
**Flow.**
- **SvxLink client connects to DE-B** and PTTs on a German TG. DE-B handles
the audio locally (it owns `262`) and mirrors state to DE-A over the
twin link so DE-A's clients can't grab the same TG simultaneously. DE-B
forwards on its own external trunks; DE-A does *not* re-forward
(otherwise external peers would see duplicates).
- **An IT client keys a German TG**: IT's `[TRUNK_DE]` section has
`PAIRED=1` and `HOST=de-a,de-b`, so IT holds two TCP sockets but sends
each frame to its sticky-selected endpoint (say DE-A). DE-A delivers
locally, mirrors to DE-B over the twin link so DE-B's local clients
hear it too, and DE-B suppresses re-forwarding back out.
- **DE-A goes down**: IT's TCP socket to DE-A drops; IT's next frame
fails over to DE-B with no holdoff. DE-B keeps serving; its clients are
unaffected. When DE-A recovers, the twin handshake resyncs `TGHandler`
state.
- **Twin link itself goes down (split-brain)**: both twins keep operating
fully and independently. Cross-pair talker arbitration is lost for the
duration — duplicate-talker artifacts may appear if clients on both
nodes PTT the same TG simultaneously. External trunks remain healthy
in both directions.
**Cross-twin arbitration.** When both twins' clients PTT the same TG at the
same instant, the priority-nonce in `MsgPeerHello` tie-breaks (lower wins,
loser yields). This is the same mechanism trunks use for cross-site
arbitration — reused intra-pair. Two new message types
(`MsgTwinExtTalkerStart` / `Stop`, types 123/124) carry external-trunk
talker state across the twin so the partner won't let local clients key a
TG that's already busy on an external peer.
**When to use it.** Twin layout is the right answer when you need **HA
failover for clients** on a single reflector site — for instance, two
physical servers on the same LAN, both with public IPs, fronting a cluster
of SvxLink nodes. It composes with everything else: the twin pair can
simultaneously be a country gateway in the international mesh (§1), a
parent of regional satellites (§3), or a member of a national trunk mesh
(§2). Don't reach for twins just to share traffic across two boxes —
that's what plain trunks are for.
---
## Picking a topology
| Constraint | Use |
|---|---|
| Just one reflector per country, no regional split needed | International only (§1) |
| Each Zone has a public IP; want regional autonomy and resilience to gateway outage | National trunk mesh joined at the gateway (§2) |
| Most Zones are behind NAT; only the country gateway has a public IP; one trusted operator runs the lot | Satellite tree (§3) |
| §2 layout overall, plus a sub-group needs its own reflector — either NAT'd or with its own user DB to delegate (`[USERS]`/`[PASSWORDS]` separated) | Hybrid — satellite under a regional reflector (§4) |
| HA failover for SvxLink clients on a single site (two boxes, same LAN) | Twin pair (§5) — composes with §1–§4 |
The shapes compose: the international layer (§1) is always present, and §2,
§3, §4 are alternative ways to fan out *inside* a country. §5 is orthogonal
— any single reflector role above can be played by a twin pair instead.
## Appendix: MCC ranges and cluster-TG numbering
Talk-group prefixes align with the ITU-T E.212 Mobile Country Code (MCC)
plan, so prefix ownership is self-documenting and globally consistent.
| Range | Use |
|---|---|
| `0` | **Special.** TG `0` is a protocol sentinel meaning "no TG selected." V2 clients authenticate with `tg=0` and then select a real TG with `MsgSelectTG`. Audio is never sent or received on TG `0`. |
| `001`, other `0xx` | ITU test networks. Not assigned to any country. |
| `1xx` | Reserved by ITU. Not assigned to any country. |
| `2xx` | **Europe.** Lowest country MCC: `202` Greece. (`200`, `201` are unassigned.) |
| `3xx` | North America (incl. Greenland, Caribbean) |
| `4xx` | Asia, Middle East |
| `5xx` | Oceania |
| `6xx` | Africa |
| `7xx` | South & Central America |
| `8xx`, `9xx` | Reserved / non-country use (rare assignments) |
**Safe cluster-TG ranges: `100–199` and `800–999`.** Pick cluster TGs
(the kind that bypass prefix ownership — see §2) from these ranges:
- The `1xx` block is reserved by ITU and contains no country MCC.
- The `8xx` and `9xx` blocks are reserved / non-country (rare assignments
only).
A cluster TG drawn from either range cannot collide with any current or
future country prefix (countries live entirely in `200`–`799`). Combined
that's roughly 300 available numbers — more than enough for worldwide,
nationwide, and any thematic broadcast TGs you want to define.
Avoid `200`–`799` (country prefix collisions) and the `0xx`/`1`–`99`
ranges (the latter are technically safe but unconventional for DMR/SvxLink
TG numbering — short numbers are rare in practice). The well-known TG
`91` (worldwide chat) is a pre-existing convention that predates this
recommendation; new cluster-TG assignments should follow the `100–199` /
`800–999` rule.
---
## Properties that hold across all variants
- Longest-prefix-match decides the owner of any given TG, but only against
the prefixes a reflector has been explicitly configured to trunk to —
prefixes are not gossiped.
- Trunk relay is single-hop. Satellite mirror is independent of that rule.
- Owner fanout is gated by **peer interest** with a 10-minute idle window.
Interest is registered the first time a peer transmits on a TG.
- Source-side exclusion in the owner's fanout prevents echo loops.
- `SATELLITE_FILTER` is bidirectional and advertised to the parent.
- Talker arbitration uses the random 32-bit nonce exchanged in
`MsgPeerHello` — lower wins. The loser defers and blocks local clients
from interrupting.
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
#!/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)"
+18
View File
@@ -0,0 +1,18 @@
// International full-mesh — 3 European country gateways, all-to-all trunk.
graph IntlMesh {
layout = circo;
bgcolor = "transparent";
margin = 0.3;
node [shape=box, style="filled,rounded", fillcolor="#dde8fb",
color="#1a4fa3", fontname="Helvetica-Bold", fontsize=16, penwidth=2,
width=1.1, height=0.7, fixedsize=true];
edge [color="#5f6368", penwidth=1.6];
IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c"];
SE [label="SE\n240"];
DE [label="DE\n262"];
IT -- SE;
IT -- DE;
SE -- DE;
}
+48
View File
@@ -0,0 +1,48 @@
<?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: IntlMesh Pages: 1 -->
<svg width="238pt" height="226pt"
viewBox="21.60 21.60 216.75 204.48" 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 200.48)">
<title>IntlMesh</title>
<!-- IT -->
<g id="node1" class="node">
<title>IT</title>
<path fill="#fde2d4" stroke="#c0531c" stroke-width="2" d="M67,-50C67,-50 12,-50 12,-50 6,-50 0,-44 0,-38 0,-38 0,-12 0,-12 0,-6 6,0 12,0 12,0 67,0 67,0 73,0 79,-6 79,-12 79,-12 79,-38 79,-38 79,-44 73,-50 67,-50"/>
<text text-anchor="middle" x="39.5" y="-30.2" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">IT</text>
<text text-anchor="middle" x="39.5" y="-12.2" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">222</text>
</g>
<!-- SE -->
<g id="node2" class="node">
<title>SE</title>
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M67,-174.88C67,-174.88 12,-174.88 12,-174.88 6,-174.88 0,-168.88 0,-162.88 0,-162.88 0,-136.88 0,-136.88 0,-130.88 6,-124.88 12,-124.88 12,-124.88 67,-124.88 67,-124.88 73,-124.88 79,-130.88 79,-136.88 79,-136.88 79,-162.88 79,-162.88 79,-168.88 73,-174.88 67,-174.88"/>
<text text-anchor="middle" x="39.5" y="-155.08" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">SE</text>
<text text-anchor="middle" x="39.5" y="-137.08" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">240</text>
</g>
<!-- IT&#45;&#45;SE -->
<g id="edge1" class="edge">
<title>IT&#45;&#45;SE</title>
<path fill="none" stroke="#5f6368" stroke-width="1.6" d="M39.5,-50.27C39.5,-71.94 39.5,-102.99 39.5,-124.64"/>
</g>
<!-- DE -->
<g id="node3" class="node">
<title>DE</title>
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M175.15,-112.44C175.15,-112.44 120.15,-112.44 120.15,-112.44 114.15,-112.44 108.15,-106.44 108.15,-100.44 108.15,-100.44 108.15,-74.44 108.15,-74.44 108.15,-68.44 114.15,-62.44 120.15,-62.44 120.15,-62.44 175.15,-62.44 175.15,-62.44 181.15,-62.44 187.15,-68.44 187.15,-74.44 187.15,-74.44 187.15,-100.44 187.15,-100.44 187.15,-106.44 181.15,-112.44 175.15,-112.44"/>
<text text-anchor="middle" x="147.65" y="-92.64" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">DE</text>
<text text-anchor="middle" x="147.65" y="-74.64" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">262</text>
</g>
<!-- IT&#45;&#45;DE -->
<g id="edge2" class="edge">
<title>IT&#45;&#45;DE</title>
<path fill="none" stroke="#5f6368" stroke-width="1.6" d="M79.16,-47.9C88.56,-53.32 98.59,-59.12 108,-64.55"/>
</g>
<!-- SE&#45;&#45;DE -->
<g id="edge3" class="edge">
<title>SE&#45;&#45;DE</title>
<path fill="none" stroke="#5f6368" stroke-width="1.6" d="M79.16,-126.98C88.56,-121.55 98.59,-115.76 108,-110.33"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

+36
View File
@@ -0,0 +1,36 @@
// National trunk mesh joined at IT 222 — the country gateway is the only
// Italian reflector on the international mesh. Two domains sharing one node.
graph NationalMesh {
layout = neato;
bgcolor = "transparent";
margin = 0.3;
overlap = false;
splines = true;
node [shape=box, style="filled,rounded", fontname="Helvetica-Bold",
fontsize=13, penwidth=2, width=1.0, height=0.65, fixedsize=true];
// International domain on the left
SE [label="SE\n240", fillcolor="#dde8fb", color="#1a4fa3", pos="-2.8, 0.9!"];
DE [label="DE\n262", fillcolor="#dde8fb", color="#1a4fa3", pos="-2.8,-0.9!"];
// Country gateway in the middle (the hinge)
IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c", pos="0,0!"];
// National domain on the right
Z1 [label="IT-Z1\n2221", fillcolor="#dff3e0", color="#1e7d34", pos="2.6, 1.5!"];
Z2 [label="IT-Z2\n2222", fillcolor="#dff3e0", color="#1e7d34", pos="3.1, 0.5!"];
Z3 [label="IT-Z3\n2223", fillcolor="#dff3e0", color="#1e7d34", pos="3.1,-0.5!"];
Z4 [label="IT-Z4\n2224", fillcolor="#dff3e0", color="#1e7d34", pos="2.6,-1.5!"];
edge [color="#5f6368", penwidth=1.2];
// International domain (3 nodes, 3 edges)
SE -- DE; SE -- IT; DE -- IT;
// National domain (5 nodes, 10 edges)
IT -- Z1; IT -- Z2; IT -- Z3; IT -- Z4;
Z1 -- Z2; Z1 -- Z3; Z1 -- Z4;
Z2 -- Z3; Z2 -- Z4;
Z3 -- Z4;
}
+126
View File
@@ -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&#45;&#45;DE -->
<g id="edge1" class="edge">
<title>SE&#45;&#45;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&#45;&#45;IT -->
<g id="edge2" class="edge">
<title>SE&#45;&#45;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&#45;&#45;IT -->
<g id="edge3" class="edge">
<title>DE&#45;&#45;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&#45;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&#45;&#45;Z1 -->
<g id="edge4" class="edge">
<title>IT&#45;&#45;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&#45;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&#45;&#45;Z2 -->
<g id="edge5" class="edge">
<title>IT&#45;&#45;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&#45;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&#45;&#45;Z3 -->
<g id="edge6" class="edge">
<title>IT&#45;&#45;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&#45;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&#45;&#45;Z4 -->
<g id="edge7" class="edge">
<title>IT&#45;&#45;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&#45;&#45;Z2 -->
<g id="edge8" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z3 -->
<g id="edge9" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z4 -->
<g id="edge10" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z3 -->
<g id="edge11" class="edge">
<title>Z2&#45;&#45;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&#45;&#45;Z4 -->
<g id="edge12" class="edge">
<title>Z2&#45;&#45;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&#45;&#45;Z4 -->
<g id="edge13" class="edge">
<title>Z3&#45;&#45;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

+49
View File
@@ -0,0 +1,49 @@
// Satellite tree — Italian Zones are satellites of IT 222.
// Only IT 222 is on the international trunk mesh.
digraph SatTree {
layout = dot;
rankdir = TB;
bgcolor = "transparent";
margin = 0.3;
splines = true;
ranksep = 0.9;
nodesep = 0.4;
node [shape=box, style="filled,rounded", fontname="Helvetica-Bold",
fontsize=13, penwidth=2, width=1.05, height=0.65, fixedsize=true];
// Foreign country gateways (top row)
subgraph cluster_intl {
label = "International trunk mesh (port :5302)";
fontname = "Helvetica-Bold"; fontsize = 12; color = "#1a4fa3";
style = "rounded,dashed"; bgcolor = "#f4f8ff";
SE [label="SE\n240", fillcolor="#dde8fb", color="#1a4fa3"];
DE [label="DE\n262", fillcolor="#dde8fb", color="#1a4fa3"];
IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c"];
}
// Satellite zones hanging off IT 222
subgraph cluster_sat {
label = "Italian satellite tree (port :5303)";
fontname = "Helvetica-Bold"; fontsize = 12; color = "#1e7d34";
style = "rounded,dashed"; bgcolor = "#f5fbf6";
Z1 [label="IT-Z1\n2221\nfilter=2221", fillcolor="#dff3e0", color="#1e7d34", height=0.85];
Z2 [label="IT-Z2\n2222\nfilter=2222", fillcolor="#dff3e0", color="#1e7d34", height=0.85];
Z3 [label="IT-Z3\n2223\nfilter=2223", fillcolor="#dff3e0", color="#1e7d34", height=0.85];
Z4 [label="IT-Z4\n2224\nfilter=2224", fillcolor="#dff3e0", color="#1e7d34", height=0.85];
Z5 [label="IT-Z5\n2225\nfilter=2225", fillcolor="#dff3e0", color="#1e7d34", height=0.85];
}
// Trunk edges (intl full mesh)
edge [color="#5f6368", penwidth=1.5, dir=none, constraint=false];
SE -> DE; SE -> IT; DE -> IT;
// Satellite mirror edges (IT 222 ↔ each zone)
edge [color="#c0531c", penwidth=1.6, style=dashed, dir=both,
arrowhead=normal, arrowtail=normal, arrowsize=0.6, constraint=true];
IT -> Z1;
IT -> Z2;
IT -> Z3;
IT -> Z4;
IT -> Z5;
}
+133
View File
@@ -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&#45;&gt;DE -->
<g id="edge1" class="edge">
<title>SE&#45;&gt;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&#45;&gt;IT -->
<g id="edge2" class="edge">
<title>SE&#45;&gt;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&#45;&gt;IT -->
<g id="edge3" class="edge">
<title>DE&#45;&gt;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&#45;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&#45;&gt;Z1 -->
<g id="edge4" class="edge">
<title>IT&#45;&gt;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&#45;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&#45;&gt;Z2 -->
<g id="edge5" class="edge">
<title>IT&#45;&gt;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&#45;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&#45;&gt;Z3 -->
<g id="edge6" class="edge">
<title>IT&#45;&gt;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&#45;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&#45;&gt;Z4 -->
<g id="edge7" class="edge">
<title>IT&#45;&gt;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&#45;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&#45;&gt;Z5 -->
<g id="edge8" class="edge">
<title>IT&#45;&gt;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

+43
View File
@@ -0,0 +1,43 @@
// Hybrid — two-domain trunk topology (intl + national, joined at IT 222),
// plus an MI club satellite hanging off Z2 over port :5303.
graph Hybrid {
layout = neato;
bgcolor = "transparent";
margin = 0.3;
overlap = false;
splines = true;
node [shape=box, style="filled,rounded", fontname="Helvetica-Bold",
fontsize=13, penwidth=2, width=1.0, height=0.65, fixedsize=true];
// International domain on the left
SE [label="SE\n240", fillcolor="#dde8fb", color="#1a4fa3", pos="-2.8, 0.9!"];
DE [label="DE\n262", fillcolor="#dde8fb", color="#1a4fa3", pos="-2.8,-0.9!"];
// Country gateway (hinge)
IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c", pos="0,0!"];
// National domain on the right
Z1 [label="IT-Z1\n2221", fillcolor="#dff3e0", color="#1e7d34", pos="2.6, 1.5!"];
Z2 [label="IT-Z2\n2222", fillcolor="#dff3e0", color="#1e7d34", pos="3.1, 0.5!"];
Z3 [label="IT-Z3\n2223", fillcolor="#dff3e0", color="#1e7d34", pos="3.1,-0.5!"];
Z4 [label="IT-Z4\n2224", fillcolor="#dff3e0", color="#1e7d34", pos="2.6,-1.5!"];
// Satellite hanging off Z2 (NAT'd club reflector)
MI [label="MI club\n(satellite)\nfilter=2222",
fillcolor="#fff4d6", color="#a37300", style="filled,rounded,dashed",
height=0.95, width=1.4, pos="5.6, 0.5!"];
edge [color="#5f6368", penwidth=1.2];
// Two domains joined at IT
SE -- DE; SE -- IT; DE -- IT;
IT -- Z1; IT -- Z2; IT -- Z3; IT -- Z4;
Z1 -- Z2; Z1 -- Z3; Z1 -- Z4;
Z2 -- Z3; Z2 -- Z4;
Z3 -- Z4;
// Satellite mirror edge (Z2 ↔ MI)
edge [color="#a37300", penwidth=2.0, style=dashed];
Z2 -- MI;
}
+139
View File
@@ -0,0 +1,139 @@
<?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: Hybrid Pages: 1 -->
<svg width="600pt" height="263pt"
viewBox="21.60 21.60 578.15 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>Hybrid</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&#45;&#45;DE -->
<g id="edge1" class="edge">
<title>SE&#45;&#45;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&#45;&#45;IT -->
<g id="edge2" class="edge">
<title>SE&#45;&#45;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&#45;&#45;IT -->
<g id="edge3" class="edge">
<title>DE&#45;&#45;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&#45;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&#45;&#45;Z1 -->
<g id="edge4" class="edge">
<title>IT&#45;&#45;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&#45;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&#45;&#45;Z2 -->
<g id="edge5" class="edge">
<title>IT&#45;&#45;Z2</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.18,-111.84C255.11,-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&#45;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&#45;&#45;Z3 -->
<g id="edge6" class="edge">
<title>IT&#45;&#45;Z3</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M226.18,-100.18C255.11,-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&#45;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&#45;&#45;Z4 -->
<g id="edge7" class="edge">
<title>IT&#45;&#45;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&#45;&#45;Z2 -->
<g id="edge8" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z3 -->
<g id="edge9" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z4 -->
<g id="edge10" class="edge">
<title>Z1&#45;&#45;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&#45;&#45;Z3 -->
<g id="edge11" class="edge">
<title>Z2&#45;&#45;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&#45;&#45;Z4 -->
<g id="edge12" class="edge">
<title>Z2&#45;&#45;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>
<!-- MI -->
<g id="node8" class="node">
<title>MI</title>
<path fill="#fff4d6" stroke="#a37300" stroke-width="2" stroke-dasharray="5,2" d="M536.55,-167.51C536.55,-167.51 459.55,-167.51 459.55,-167.51 453.55,-167.51 447.55,-161.51 447.55,-155.51 447.55,-155.51 447.55,-111.51 447.55,-111.51 447.55,-105.51 453.55,-99.51 459.55,-99.51 459.55,-99.51 536.55,-99.51 536.55,-99.51 542.55,-99.51 548.55,-105.51 548.55,-111.51 548.55,-111.51 548.55,-155.51 548.55,-155.51 548.55,-161.51 542.55,-167.51 536.55,-167.51"/>
<text text-anchor="middle" x="498.05" y="-144.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">MI club</text>
<text text-anchor="middle" x="498.05" y="-130.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">(satellite)</text>
<text text-anchor="middle" x="498.05" y="-116.11" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">filter=2222</text>
</g>
<!-- Z2&#45;&#45;MI -->
<g id="edge14" class="edge">
<title>Z2&#45;&#45;MI</title>
<path fill="none" stroke="#a37300" stroke-width="2" stroke-dasharray="5,2" d="M396.66,-133.51C412.18,-133.51 430.58,-133.51 447.42,-133.51"/>
</g>
<!-- Z3&#45;&#45;Z4 -->
<g id="edge13" class="edge">
<title>Z3&#45;&#45;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: 9.2 KiB

+43
View File
@@ -0,0 +1,43 @@
// HA twin pair — DE is run as a twin pair (DE-A and DE-B both own
// LOCAL_PREFIX=262). External peers (IT, SE) hold one [TRUNK_x] section
// with PAIRED=1 and HOST=de-a,de-b — each frame is sticky-routed to one
// of the two TCP sockets with instant failover on socket failure.
graph TwinPair {
layout = neato;
bgcolor = "transparent";
margin = 0.3;
overlap = false;
splines = true;
node [shape=box, style="filled,rounded", fontname="Helvetica-Bold",
fontsize=13, penwidth=2, width=1.05, height=0.7, fixedsize=true];
// External peers on the left
SE [label="SE\n240", fillcolor="#dde8fb", color="#1a4fa3", pos="-3.5, 1.5!"];
IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c", pos="-3.5,-1.5!"];
// Twin pair on the right (both own LOCAL_PREFIX=262)
DEA [label="DE-A\n262", fillcolor="#e6dcff", color="#5430a8", pos="3.0, 1.5!"];
DEB [label="DE-B\n262", fillcolor="#e6dcff", color="#5430a8", pos="3.0,-1.5!"];
// Annotation node sitting to the right of the twin link
TWINANN [label="[TWIN] link\nfull-state mirror\nheartbeat:\n send every 2 s\n fail after 5 s silence",
shape=plaintext, fontsize=10, fontcolor="#5430a8",
fontname="Helvetica-Bold",
pos="5.6, 0!", width=2.0, height=1.4];
// External trunk edges — each external peer holds ONE [TRUNK_x] toward
// the pair, manifested as two TCP sockets (sticky, failover).
edge [color="#5f6368", penwidth=1.2];
IT -- SE;
IT -- DEA; IT -- DEB;
SE -- DEA; SE -- DEB;
// Twin link (purpose-built, symmetric, full-state mirror).
edge [color="#5430a8", penwidth=3.0, style=bold];
DEA -- DEB;
// Invisible edge to anchor the annotation near the twin link
edge [style=invis, len=0.5];
DEB -- TWINANN;
}
+81
View File
@@ -0,0 +1,81 @@
<?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: TwinPair Pages: 1 -->
<svg width="574pt" height="237pt"
viewBox="21.60 21.60 552.64 215.77" 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 211.77)">
<title>TwinPair</title>
<!-- SE -->
<g id="node1" class="node">
<title>SE</title>
<path fill="#dde8fb" stroke="#1a4fa3" stroke-width="2" d="M64,-186.17C64,-186.17 12,-186.17 12,-186.17 6,-186.17 0,-180.17 0,-174.17 0,-174.17 0,-148.17 0,-148.17 0,-142.17 6,-136.17 12,-136.17 12,-136.17 64,-136.17 64,-136.17 70,-136.17 76,-142.17 76,-148.17 76,-148.17 76,-174.17 76,-174.17 76,-180.17 70,-186.17 64,-186.17"/>
<text text-anchor="middle" x="38" y="-164.77" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">SE</text>
<text text-anchor="middle" x="38" y="-150.77" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">240</text>
</g>
<!-- DEA -->
<g id="node3" class="node">
<title>DEA</title>
<path fill="#e6dcff" stroke="#5430a8" stroke-width="2" d="M359.03,-186.17C359.03,-186.17 307.03,-186.17 307.03,-186.17 301.03,-186.17 295.03,-180.17 295.03,-174.17 295.03,-174.17 295.03,-148.17 295.03,-148.17 295.03,-142.17 301.03,-136.17 307.03,-136.17 307.03,-136.17 359.03,-136.17 359.03,-136.17 365.03,-136.17 371.03,-142.17 371.03,-148.17 371.03,-148.17 371.03,-174.17 371.03,-174.17 371.03,-180.17 365.03,-186.17 359.03,-186.17"/>
<text text-anchor="middle" x="333.03" y="-164.77" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">DE&#45;A</text>
<text text-anchor="middle" x="333.03" y="-150.77" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">262</text>
</g>
<!-- SE&#45;&#45;DEA -->
<g id="edge4" class="edge">
<title>SE&#45;&#45;DEA</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M76.27,-161.17C132.86,-161.17 238.27,-161.17 294.83,-161.17"/>
</g>
<!-- DEB -->
<g id="node4" class="node">
<title>DEB</title>
<path fill="#e6dcff" stroke="#5430a8" stroke-width="2" d="M359.03,-50C359.03,-50 307.03,-50 307.03,-50 301.03,-50 295.03,-44 295.03,-38 295.03,-38 295.03,-12 295.03,-12 295.03,-6 301.03,0 307.03,0 307.03,0 359.03,0 359.03,0 365.03,0 371.03,-6 371.03,-12 371.03,-12 371.03,-38 371.03,-38 371.03,-44 365.03,-50 359.03,-50"/>
<text text-anchor="middle" x="333.03" y="-28.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">DE&#45;B</text>
<text text-anchor="middle" x="333.03" y="-14.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">262</text>
</g>
<!-- SE&#45;&#45;DEB -->
<g id="edge5" class="edge">
<title>SE&#45;&#45;DEB</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M76.27,-143.51C132.86,-117.38 238.27,-68.73 294.83,-42.63"/>
</g>
<!-- IT -->
<g id="node2" class="node">
<title>IT</title>
<path fill="#fde2d4" stroke="#c0531c" stroke-width="2" d="M64,-50C64,-50 12,-50 12,-50 6,-50 0,-44 0,-38 0,-38 0,-12 0,-12 0,-6 6,0 12,0 12,0 64,0 64,0 70,0 76,-6 76,-12 76,-12 76,-38 76,-38 76,-44 70,-50 64,-50"/>
<text text-anchor="middle" x="38" y="-28.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">IT</text>
<text text-anchor="middle" x="38" y="-14.6" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="13.00">222</text>
</g>
<!-- IT&#45;&#45;SE -->
<g id="edge1" class="edge">
<title>IT&#45;&#45;SE</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M38,-50.29C38,-74.75 38,-111.6 38,-136.01"/>
</g>
<!-- IT&#45;&#45;DEA -->
<g id="edge2" class="edge">
<title>IT&#45;&#45;DEA</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M76.27,-42.66C132.86,-68.78 238.27,-117.43 294.83,-143.54"/>
</g>
<!-- IT&#45;&#45;DEB -->
<g id="edge3" class="edge">
<title>IT&#45;&#45;DEB</title>
<path fill="none" stroke="#5f6368" stroke-width="1.2" d="M76.27,-25C132.86,-25 238.27,-25 294.83,-25"/>
</g>
<!-- DEA&#45;&#45;DEB -->
<g id="edge6" class="edge">
<title>DEA&#45;&#45;DEB</title>
<path fill="none" stroke="#5430a8" stroke-width="3" d="M333.03,-135.87C333.03,-111.42 333.03,-74.57 333.03,-50.16"/>
</g>
<!-- TWINANN -->
<g id="node5" class="node">
<title>TWINANN</title>
<path fill="lightgrey" stroke="transparent" stroke-width="2" d="M511.04,-143.58C511.04,-143.58 391.04,-143.58 391.04,-143.58 385.04,-143.58 379.04,-137.58 379.04,-131.58 379.04,-131.58 379.04,-54.58 379.04,-54.58 379.04,-48.58 385.04,-42.58 391.04,-42.58 391.04,-42.58 511.04,-42.58 511.04,-42.58 517.04,-42.58 523.04,-48.58 523.04,-54.58 523.04,-54.58 523.04,-131.58 523.04,-131.58 523.04,-137.58 517.04,-143.58 511.04,-143.58"/>
<text text-anchor="middle" x="451.04" y="-112.58" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="10.00" fill="#5430a8">[TWIN] link</text>
<text text-anchor="middle" x="451.04" y="-101.58" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="10.00" fill="#5430a8">full&#45;state mirror</text>
<text text-anchor="middle" x="451.04" y="-90.58" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="10.00" fill="#5430a8">heartbeat:</text>
<text text-anchor="middle" x="451.04" y="-79.58" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="10.00" fill="#5430a8"> &#160;send every 2 s</text>
<text text-anchor="middle" x="451.04" y="-68.58" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="10.00" fill="#5430a8"> &#160;fail after 5 s silence</text>
</g>
<!-- DEB&#45;&#45;TWINANN -->
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

+674
View File
@@ -0,0 +1,674 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GeuReflector — Mesh Topology Examples</title>
<style>
@page {
size: A4;
margin: 22mm 18mm 20mm 18mm;
@bottom-left {
content: "GeuReflector — Mesh Topology Examples · PDF generated __BUILD_DATE__";
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 9pt;
color: #5f6368;
white-space: nowrap;
}
@bottom-right {
content: counter(page) " / " counter(pages);
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 9pt;
color: #5f6368;
}
}
@page :first {
margin: 0;
@bottom-left { content: ""; }
@bottom-right { content: ""; }
}
html { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
body { color: #202124; line-height: 1.55; font-size: 10.5pt; }
h1, h2, h3 { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #202124; line-height: 1.25; }
h1 { font-size: 22pt; margin: 0 0 6pt 0; }
h2 { font-size: 16pt; margin: 18pt 0 6pt 0;
border-bottom: 1pt solid #dadce0; padding-bottom: 3pt;
page-break-after: avoid; }
h3 { font-size: 12pt; margin: 14pt 0 4pt 0;
color: #1a4fa3; page-break-after: avoid; }
p { margin: 0 0 6pt 0; }
strong { color: #1a4fa3; }
code { font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
background: #f1f3f4; color: #c0531c;
padding: 0.5pt 3pt; border-radius: 3pt; font-size: 9pt; }
table { border-collapse: collapse; margin: 8pt 0 12pt 0; width: 100%;
font-size: 9.5pt; page-break-inside: avoid; }
th { background: #f4f8ff; color: #1a4fa3; text-align: left;
padding: 4pt 6pt; border-bottom: 1pt solid #1a4fa3; font-weight: 600; }
td { padding: 4pt 6pt; border-bottom: 0.5pt solid #e8eaed;
vertical-align: top; }
tr:last-child td { border-bottom: none; }
ul { margin: 4pt 0 8pt 18pt; padding: 0; }
li { margin-bottom: 3pt; }
/* Cover page */
.cover {
height: 297mm; width: 210mm;
margin: 0; padding: 0;
display: flex; flex-direction: column;
justify-content: center; align-items: center;
text-align: center;
background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
page-break-after: always;
box-sizing: border-box;
}
.cover .eyebrow {
text-transform: uppercase; letter-spacing: 4pt; font-size: 11pt;
color: #c0531c; font-weight: 600; margin-bottom: 24pt;
}
.cover h1 {
font-size: 36pt; margin: 0; max-width: 75%;
color: #1a4fa3; line-height: 1.15;
}
.cover .subtitle {
font-size: 14pt; color: #5f6368; margin-top: 18pt; max-width: 70%;
}
.cover .tagline {
font-size: 11.5pt; color: #c0531c; margin-top: 28pt; max-width: 72%;
font-style: italic;
}
.cover .credits {
font-size: 9.5pt; color: #5f6368; margin-top: 18pt; max-width: 72%;
line-height: 1.6;
}
.cover .credits a { color: #1a4fa3; text-decoration: none; }
.cover .footer {
position: absolute; bottom: 22mm; font-size: 9.5pt; color: #5f6368;
text-align: center; line-height: 1.5;
}
.cover .footer a { color: #1a4fa3; text-decoration: none; }
/* Diagram container */
figure {
margin: 10pt 0 10pt 0; text-align: center;
page-break-inside: avoid;
}
figure img { max-width: 100%; max-height: 110mm; }
figcaption {
font-size: 9pt; color: #5f6368; margin-top: 4pt;
font-style: italic;
}
/* Callouts */
.note {
background: #fff8e1; border-left: 3pt solid #f0a800;
padding: 8pt 12pt; margin: 10pt 0; font-size: 10pt;
border-radius: 2pt; page-break-inside: avoid;
}
.note .label {
display: inline-block; font-weight: 700; color: #a37300;
margin-right: 6pt; text-transform: uppercase; letter-spacing: 0.5pt;
font-size: 8.5pt;
}
.legend {
display: flex; flex-wrap: wrap; gap: 14pt; font-size: 9.5pt;
margin: 6pt 0 10pt 0; padding: 6pt 10pt;
background: #f8f9fa; border-radius: 4pt;
}
.legend .swatch {
display: inline-block; width: 14pt; height: 10pt; border-radius: 2pt;
vertical-align: middle; margin-right: 4pt; border: 1.5pt solid;
}
.legend .gw { background: #fde2d4; border-color: #c0531c; }
.legend .intl { background: #dde8fb; border-color: #1a4fa3; }
.legend .zone { background: #dff3e0; border-color: #1e7d34; }
.legend .sat { background: #fff4d6; border-color: #a37300;
border-style: dashed; }
.legend .twin { background: #e6dcff; border-color: #5430a8; }
.legend .trunk-line {
display: inline-block; width: 18pt; height: 2pt; background: #5f6368;
vertical-align: middle; margin-right: 4pt;
}
.legend .sat-line {
display: inline-block; width: 18pt; border-top: 2pt dashed #a37300;
vertical-align: middle; margin-right: 4pt;
}
.legend .twin-line {
display: inline-block; width: 18pt; height: 3pt; background: #5430a8;
vertical-align: middle; margin-right: 4pt;
}
section { page-break-inside: auto; }
section.topology { page-break-before: always; }
</style>
</head>
<body>
<div class="cover">
<div class="eyebrow">GeuReflector documentation</div>
<h1>Mesh Topology Examples</h1>
<div class="subtitle">
A visual cookbook of trunk and satellite layouts —
European running example with Italian BrandMeister Zone prefixes
</div>
<div class="tagline">
GeuReflector — an extended fork of SvxReflector. Drop-in replacement
for the upstream <code>svxreflector</code> that adds trunks, twins,
satellites, filters and more.
</div>
<div class="credits">
Built on the SvxLink project by SM0SVX —
<a href="https://github.com/sm0svx/svxlink">github.com/sm0svx/svxlink</a><br>
Thanks to DG1FI, DJ1JAY, SA2BLV, UR3QJW, YO6NAM and others for their
interest, testing, debugging, suggestions, and contributions.
</div>
<div class="footer">
PDF generated __BUILD_DATE__<br>
<a href="https://github.com/audric/GeuReflector">github.com/audric/GeuReflector</a>
</div>
</div>
<section>
<h2>Background</h2>
<p>GeuReflector links separate reflector instances in two distinct ways:</p>
<p><strong>Trunk</strong> (TCP <code>:5302</code>) — bidirectional, designed for
full-mesh peering. Each peer owns one or more numeric prefixes. TG routing is
by <strong>longest-prefix-match</strong> against the union of all prefixes in
the mesh (every <code>TrunkLink</code> learns the full table at startup).
Audio relay is <strong>single-hop</strong>: only the prefix owner fans audio
out to other interested peers. Non-owners that receive trunk audio deliver it
locally and stop. The source peer is excluded from the owner's fanout to
prevent loops.</p>
<p><strong>Satellite</strong> (TCP <code>:5303</code>) — one-to-many star.
A satellite reflector connects out to a parent reflector and mirrors TGs in
both directions. An optional <code>SATELLITE_FILTER</code> on the satellite
side scopes the mirrored set in <strong>both</strong> directions: the satellite
suppresses non-matching outbound, and the parent learns the filter via
<code>MsgPeerFilter</code> (type 122) and drops non-matching forwards going
down.</p>
<p>Two other behaviours show up repeatedly in the flow descriptions below:</p>
<ul>
<li><strong>Peer interest</strong> is populated when a peer emits
<code>PeerTalkerStart</code> / <code>PeerAudio</code> for a TG. Until
that happens, the owner doesn't know to fan that TG back to that peer.
Interest expires after <strong>10 minutes</strong> of inactivity on
that TG from that peer (or immediately on trunk disconnect).</li>
<li><strong>MCC-style country prefixes</strong> are used for the
international mesh: IT = <code>222</code>, SE = <code>240</code>,
DE = <code>262</code>. Reusing the DMR MCC layout makes ownership
self-documenting.</li>
</ul>
<div class="legend">
<span><span class="swatch gw"></span>Italian gateway (focus)</span>
<span><span class="swatch intl"></span>Foreign country gateway</span>
<span><span class="swatch zone"></span>Italian Zone reflector</span>
<span><span class="swatch sat"></span>Satellite reflector</span>
<span><span class="swatch twin"></span>Twin (HA pair)</span>
<span><span class="trunk-line"></span>Trunk link (port :5302)</span>
<span><span class="sat-line"></span>Satellite mirror (port :5303)</span>
<span><span class="twin-line"></span>Twin link</span>
</div>
</section>
<section class="topology">
<h2>1. International full-mesh</h2>
<p>Country gateways only. Every reflector owns its country's MCC and trunks
directly to every other country.</p>
<figure>
<img src="01_intl_mesh.svg" alt="International full mesh">
<figcaption>Diagram 1 — Three European country gateways in a full trunk mesh.
Every pair has a bidirectional trunk over port :5302 with HMAC handshake.</figcaption>
</figure>
<h3>Routing</h3>
<p>TG <code>240xx</code> → SE · TG <code>262xx</code> → DE ·
TG <code>222xx</code> → IT.</p>
<h3>Flow</h3>
<p>An SE client keys TG <code>22299</code>. SE's prefix table maps
<code>222 → IT</code>, so SE sends to IT. IT delivers locally and fans the
audio out to DE (if it has shown interest in <code>22299</code> recently);
SE is excluded as the source.</p>
<p>This layer is the foundation. Everything else stacks on top of it.</p>
</section>
<section class="topology">
<h2>2. National trunk mesh joined at the country gateway</h2>
<p>Italy adds per-Zone reflectors that form a <strong>national trunk
mesh</strong> together with IT 222. Foreign countries see only
IT 222 — the Zone prefixes are not advertised internationally. The country
gateway is the <strong>hinge</strong> between the international mesh and the
national mesh.</p>
<figure>
<img src="02_flat_mesh.svg" alt="National mesh joined at IT 222">
<figcaption>Diagram 2 — Two domains sharing a single node: the international
trunk mesh on the left and the Italian national trunk mesh on the right,
joined at IT 222. (Z5..Z9 omitted; same pattern.)</figcaption>
</figure>
<h3>Italian Zone prefixes (BrandMeister)</h3>
<table>
<tr><th>Prefix</th><th>Reflector</th><th>Coverage</th></tr>
<tr><td><code>2221</code></td><td>IT-Z1</td><td>Nord-Ovest (Liguria, Piemonte, Val d'Aosta)</td></tr>
<tr><td><code>2222</code></td><td>IT-Z2</td><td>Lombardia</td></tr>
<tr><td><code>2223</code></td><td>IT-Z3</td><td>Triveneto (FVG, Trentino-AA, Veneto)</td></tr>
<tr><td><code>2224</code></td><td>IT-Z4</td><td>Emilia-Romagna</td></tr>
<tr><td><code>2225</code></td><td>IT-Z5</td><td>Toscana</td></tr>
<tr><td><code>2226</code> – <code>2229</code></td><td>IT-Z6..Z9</td><td>Centro, Puglia, Sud, Sicilia</td></tr>
</table>
<h3>Ownership vs. reachability</h3>
<p>Each reflector's prefix table is built from <em>its own</em> config:
local prefix plus the <code>REMOTE_PREFIX</code> of each
<code>[TRUNK_x]</code> section. Prefixes are not gossiped between peers.
That means SE only knows the prefixes it has trunks for — namely
<code>222</code> (IT) and <code>262</code> (DE). SE has no idea that
<code>2222</code> exists, even though Z2 owns it inside Italy.</p>
<table>
<tr><th>TG</th><th>Owner (globally)</th><th>SE's view</th><th>IT 222's view</th></tr>
<tr><td><code>22221</code></td><td>IT-Z2 (longest match <code>2222</code>)</td>
<td>only <code>222</code> matches → send to IT 222</td>
<td><code>2222</code> matches → Z2 is owner</td></tr>
<tr><td><code>22299</code></td><td>IT 222 (only <code>222</code> matches)</td>
<td>send to IT 222</td><td>own this TG</td></tr>
<tr><td><code>2629</code></td><td>DE (only <code>262</code> matches)</td>
<td>send to DE</td><td>send to DE</td></tr>
</table>
<h3>Flow</h3>
<p>A <strong>Z2 client</strong> keying <code>22221</code> (Lombardia): Z2
owns <code>2222</code>, so it plays locally and fans out on the trunk side
to interested peers in the national mesh — IT 222 and the other Zones. It
does <em>not</em> trunk-forward to SE/DE (it has no trunks to them).</p>
<p>An <strong>SE client</strong> keying the same <code>22221</code>: SE's
table has only <code>222</code> as a match, so it sends to IT 222 thinking
IT is the owner. IT 222 receives it, sees that Z2 actually owns
<code>2222</code> in its own trunk table, and <strong>bridges the frame
onward to Z2</strong> via the gateway-routing path
(<code>Reflector::shouldRelayInbound</code> returns true because IT has a
prefix route for <code>2222</code>). Z2 plays locally and fans the audio
out to its national peers (excluding IT as the source). The return leg
works the same way: audio from a Z3 client reaches SE because IT's
<code>isPeerInterestedTG</code> for <code>22221</code> was registered on
the SE side when SE's PTT first arrived.</p>
<div class="note">
<span class="label">Cluster TGs are for unowned TGs, not cross-mesh routing</span>
Gateway prefix routing handles foreign-to-regional reach automatically
as long as IT 222 has a <code>[TRUNK_x]</code> section pointing at the
regional reflector — regional TGs do not need to be listed in
<code>CLUSTER_TGS</code>. <code>CLUSTER_TGS</code> is the right tool
for TGs that <strong>cannot</strong> be resolved by prefix because no
reflector owns them: TG <code>91</code> for worldwide chat
(international domain), or <code>112</code> for nationwide broadcast
inside a country (national domain). Configure those on every reflector
that should join the broadcast.
</div>
<h3>Trade-offs</h3>
<ul>
<li><strong>Pro:</strong> Zones only need inbound reachability from peers
inside the national mesh, not from the entire international Internet.</li>
<li><strong>Pro:</strong> Foreign reflectors carry no Italian internal
prefix table; the country presents one face upstream
(<code>222</code>).</li>
<li><strong>Pro:</strong> the national mesh stays healthy if intl
connectivity is degraded — Zones keep talking to each other.</li>
<li><strong>Pro:</strong> foreign-to-regional reach works out of the
box thanks to gateway prefix routing on IT 222.</li>
<li><strong>Con:</strong> IT 222 is a single point of failure for any
international reach into or out of Italy — unless it's run as a
twin pair (§5), which removes this caveat.</li>
</ul>
</section>
<section class="topology">
<h2>3. Satellite tree — Zones as satellites of IT 222</h2>
<p>Pull the Zones off the international mesh entirely. Only IT 222 is a trunk
peer; the Zones become satellites of IT 222.</p>
<div class="note">
<span class="label">Trust model</span>
<strong>Small-deployment / single-operator pattern.</strong> Satellites
were originally introduced as a development/check reflector — a small
NAT'd instance hanging off a parent for testing. The use case has grown
beyond that, but the authentication model has not yet caught up: the
parent's <code>[SATELLITE] SECRET</code> is <strong>a single shared
string</strong> used to validate every inbound satellite
(<code>Reflector.cpp:2675-2701</code>). If the secret leaks, an attacker
can connect as any <code>sat_id</code> and present any
<code>SATELLITE_FILTER</code> of their choosing — there's no per-satellite
scoping on the parent side. This makes §3 most appropriate for small
deployments under one trusted operator. For multi-operator national
meshes, prefer §2 (national trunk mesh) where each
<code>[TRUNK_x]</code> has its own <code>SECRET</code>, or §4 (hybrid)
for a single NAT'd downstream site. <strong>Future work</strong>:
per-satellite secrets keyed by <code>sat_id</code>, mirroring how trunks
already work — until then, treat the shared secret as a design constraint
of this pattern.
</div>
<figure>
<img src="03_satellite_tree.svg" alt="Satellite tree under IT 222">
<figcaption>Diagram 3 — IT 222 is the only Italian reflector on the
international trunk mesh. Zones hang off as satellites over port :5303,
each with <code>SATELLITE_FILTER</code> set to its own prefix.</figcaption>
</figure>
<h3>Flow</h3>
<p>An SE client keys <code>22241</code> (Emilia-Romagna). SE only knows
<code>222 → IT</code> (the Zone prefixes are not on the international mesh
in this variant), so SE→IT 222 over the trunk. IT 222 delivers locally and
mirrors down the satellite tree; only Z4's filter (<code>2224</code>) accepts
<code>22241</code>, so Z4 receives it. Z1/Z2/Z3/Z5 see nothing because
IT 222 dropped those forwards.</p>
<p>A Z3 client keying <code>2629</code> (DE) goes Z3 → IT 222
(satellite mirror up) → DE (intl trunk forward). Two-hop cross-country path;
no daisy-chain trunk relay needed because the satellite hop is independent
of the trunk single-hop rule.</p>
<h3>Trade-offs vs. the national trunk mesh</h3>
<table>
<tr><th>Property</th><th>National trunk mesh (§2)</th><th>Satellite tree (§3)</th></tr>
<tr><td>TCP connections per Zone</td>
<td>M − 1 within the national mesh (Zones + IT 222)</td>
<td>1 (to IT 222)</td></tr>
<tr><td>NAT story</td>
<td>Zones need inbound reachability from other Zones + IT 222</td>
<td>only IT 222 needs an inbound port</td></tr>
<tr><td>IT 222 outage</td>
<td>Zones keep talking to each other; international reach is lost</td>
<td>whole country offline</td></tr>
<tr><td>Foreign → regional TG reach</td>
<td>works automatically via gateway prefix routing on IT 222 (<code>shouldRelayInbound</code>)</td>
<td>works automatically via parent mirror + filter</td></tr>
<tr><td>Fanout cost on a busy Zone</td>
<td>O(other national peers)</td>
<td>O(0) — parent does it</td></tr>
<tr><td>Prefix advertised upstream</td>
<td>only <code>222</code> (Zones not visible to SE/DE)</td>
<td>only <code>222</code> (Zones hidden behind parent)</td></tr>
</table>
</section>
<section>
<h2>4. Satellite under a regional reflector</h2>
<p>Hybrid layout: keep the §2 two-domain structure (intl mesh + national mesh
joined at IT 222), and let one Zone host its own satellite reflector. The
Zone itself is <em>not</em> a satellite — it wears two hats: trunk peer in
the national mesh, parent to its own satellite. Two motivations apply,
often together:</p>
<ul>
<li><strong>NAT traversal.</strong> The downstream site (e.g. a Milano
club, MI) only needs one outbound TCP connection to Z2. No
port-forwarding, no public IP — useful when the sub-group's site
sits behind carrier-grade NAT or a firewall the Zone admin doesn't
control.</li>
<li><strong>Administrative delegation.</strong> The Zone admin (e.g. of
IT-Z2 / Lombardia) lets a sub-group bring up their own reflector
with their own user accounts and passwords, <em>without</em>
sharing Z2's <code>[USERS]</code> / <code>[PASSWORDS]</code>
database. Z2 admin holds Z2's user DB and the
<code>[SATELLITE] SECRET</code> that MI presents to attach; MI
admin holds MI's own <code>[USERS]</code> /
<code>[PASSWORDS]</code> — only MI's V2 clients authenticate
against it. Audio federates over the satellite link while
authentication state stays separated on each side.</li>
</ul>
<figure>
<img src="04_hybrid.svg" alt="Hybrid layout — two-domain trunk + a satellite under Z2">
<figcaption>Diagram 4 — International + national trunk mesh joined at IT 222,
plus a satellite reflector (MI club, NAT'd) hanging off Z2 over port :5303.
Z2 simultaneously serves as national trunk peer and satellite parent.</figcaption>
</figure>
<h3>Flow</h3>
<ul>
<li><strong>MI client keys <code>22221</code>:</strong> MI mirrors up to
Z2 (Lombardia). Z2 owns <code>2222</code> — plays locally, fans on the
trunk side to interested peers in the <em>national</em> mesh
(IT 222 / Z1 / Z3 / Z4 if they've shown interest), and skips MI on the
satellite side because MI is the source. Z2 does not trunk-forward to
SE/DE — it has no trunks to them.</li>
<li><strong>SE client keys <code>22221</code>:</strong> SE only knows
<code>222 → IT</code>. SE→IT 222 over the trunk. IT 222 isn't the
owner of <code>2222</code>, but its gateway-routing rule
(<code>shouldRelayInbound</code> finds a <code>2222</code> route in
IT's trunk table) bridges the frame to Z2. Z2 plays locally and
mirrors down to MI through the satellite link (filter <code>2222</code>
matches). The return leg works symmetrically through
<code>isPeerInterestedTG</code>.</li>
<li><strong>MI client keys <code>22241</code></strong> (Emilia-Romagna,
owned by Z4): MI→Z2 (satellite up). Z2 isn't the owner — its trunk-side
forwarding sees <code>2224</code> and trunk-sends to Z4. Z4 plays
locally and fans to interested peers, including Z2 <em>only if</em>
Z2 has previously PTT'd on <code>22241</code>. Consequence: the first
MI→<code>22241</code> PTT works outbound but won't get return audio
until Z2 is registered as interested at Z4. The MI→Z2→Z4 PTT itself
registers Z2's interest, so for the next ~10 min audio from any other
client on <code>22241</code> flows Z4→Z2→MI.</li>
</ul>
<div class="note">
<span class="label">Filter caveat</span>
A restrictive <code>SATELLITE_FILTER</code> like <code>2222</code> prevents
MI from reaching anything outside Lombardia: filter is bidirectional, so MI
suppresses non-<code>2222*</code> outbound and Z2 drops non-<code>2222*</code>
forwards going down. The MI→<code>22241</code> example above only works if
the filter is broadened to <code>222</code> (or unset). Use a tight filter
only when the satellite truly is single-purpose (e.g. a regional repeater
that should never hear other Zones' traffic).
</div>
</section>
<section class="topology">
<h2>5. HA twin pair</h2>
<p>A <strong>twin</strong> is a purpose-built link type for running two
reflector instances as a redundant pair. Both nodes declare the
<em>same</em> <code>LOCAL_PREFIX</code>, mirror their full <code>TGHandler</code>
state to each other over a <code>[TWIN]</code> link, and present as a single
logical reflector to the rest of the world. SvxLink nodes list both endpoints
in their <code>HOSTS</code> setting for transparent failover.</p>
<figure>
<img src="05_twin_pair.svg" alt="HA twin pair — DE as a twin">
<figcaption>Diagram 5 — DE is operated as a twin pair (DE-A and DE-B both
own <code>LOCAL_PREFIX=262</code>). External peers (IT, SE) hold one
<code>[TRUNK_x]</code> section with <code>PAIRED=1</code> and
<code>HOST=de-a,de-b</code>; each frame goes to one socket at a time,
sticky with failover. The bold purple <code>[TWIN]</code> link mirrors
full state symmetrically.</figcaption>
</figure>
<h3>What's different from trunk and satellite</h3>
<table>
<tr><th>Property</th><th>Trunk</th><th>Satellite</th><th>Twin</th></tr>
<tr><td>Directionality</td><td>symmetric</td>
<td>one-way bias (parent→satellite)</td><td>symmetric</td></tr>
<tr><td>Prefix ownership</td>
<td>distinct per node</td><td>n/a</td>
<td><strong>identical</strong> on both nodes</td></tr>
<tr><td>Filtering</td>
<td><code>isSharedTG</code> / <code>isOwnedTG</code></td>
<td>none (all TGs)</td>
<td>none (full mirror inside the pair)</td></tr>
<tr><td>Peers per section</td>
<td>1</td><td>many satellites per parent</td>
<td><strong>exactly 1</strong> (strictly pairwise)</td></tr>
<tr><td>External trunk ownership</td>
<td>each node holds its own</td><td>parent-only</td>
<td>both hold; external peer picks one socket per frame</td></tr>
<tr><td>Heartbeat cadence (TX = send interval, RX = silence timeout)</td>
<td>10 s / 15 s</td><td>10 s / 15 s</td>
<td><strong>2 s / 5 s</strong> (LAN-close)</td></tr>
</table>
<h3>Flow</h3>
<ul>
<li><strong>SvxLink client connects to DE-B</strong> and PTTs on a German
TG. DE-B handles the audio locally (it owns <code>262</code>) and
mirrors state to DE-A over the twin link so DE-A's clients can't
grab the same TG simultaneously. External trunks: DE-B forwards on
its own external trunks to interested peers; DE-A does <em>not</em>
re-forward (otherwise external peers would see duplicates).</li>
<li><strong>An IT client keys a German TG</strong>: IT's
<code>[TRUNK_DE]</code> section has <code>PAIRED=1</code> and
<code>HOST=de-a,de-b</code>, so IT holds two TCP sockets but sends
each frame to its sticky-selected endpoint (say DE-A). DE-A delivers
locally, mirrors to DE-B over the twin link so DE-B's local clients
hear it too, and DE-B suppresses re-forwarding back out.</li>
<li><strong>DE-A goes down</strong>: IT's TCP socket to DE-A drops; IT's
next frame fails over to DE-B with no holdoff. DE-B keeps serving;
its clients are unaffected. When DE-A recovers, the twin handshake
resyncs <code>TGHandler</code> state.</li>
<li><strong>Twin link itself goes down (split-brain)</strong>: both
twins keep operating fully and independently. Cross-pair talker
arbitration is lost for the duration — duplicate-talker artifacts
may appear if clients on both nodes PTT the same TG simultaneously.
External trunks remain healthy in both directions.</li>
</ul>
<div class="note">
<span class="label">Cross-twin arbitration</span>
When both twins' clients PTT the same TG at the same instant, the
priority-nonce in <code>MsgPeerHello</code> tie-breaks (lower wins,
loser yields). This is the same mechanism trunks use for cross-site
arbitration — reused intra-pair. Two new message types
(<code>MsgTwinExtTalkerStart</code> / <code>Stop</code>, types 123/124)
carry external-trunk talker state across the twin so the partner won't
let local clients key a TG that's already busy on an external peer.
</div>
<h3>When to use it</h3>
<p>Twin layout is the right answer when you need <strong>HA failover for
clients</strong> on a single reflector site — for instance, two physical
servers on the same LAN, both with public IPs, fronting a cluster of
SvxLink nodes. It composes with everything else: the twin pair can
simultaneously be a country gateway in the international mesh (§1), a
parent of regional satellites (§3), or a member of a national trunk mesh
(§2). Don't reach for twins just to share traffic across two boxes — that's
what plain trunks are for.</p>
</section>
<section>
<h2>Picking a topology</h2>
<table>
<tr><th>Constraint</th><th>Use</th></tr>
<tr><td>Just one reflector per country, no regional split needed</td>
<td>International only (§1)</td></tr>
<tr><td>Each Zone has a public IP; want regional autonomy and resilience to gateway outage</td>
<td>National trunk mesh joined at the gateway (§2)</td></tr>
<tr><td>Most Zones are behind NAT; only the country gateway has a public IP; one trusted operator runs the lot</td>
<td>Satellite tree (§3)</td></tr>
<tr><td>§2 layout overall, plus a sub-group needs its own reflector — either NAT'd or with its own user DB to delegate (<code>[USERS]</code>/<code>[PASSWORDS]</code> separated)</td>
<td>Hybrid — satellite under a regional reflector (§4)</td></tr>
<tr><td>HA failover for SvxLink clients on a single site (two boxes, same LAN)</td>
<td>Twin pair (§5) — composes with §1–§4</td></tr>
</table>
<p>The shapes compose: the international layer (§1) is always present,
and §2, §3, §4 are alternative ways to fan out <em>inside</em> a country. §5 is orthogonal — any single
reflector role above can be played by a twin pair instead.</p>
<h3>Appendix: MCC ranges and cluster-TG numbering</h3>
<p>Talk-group prefixes align with the ITU-T E.212 Mobile Country Code
(MCC) plan, so prefix ownership is self-documenting and globally
consistent.</p>
<table>
<tr><th>Range</th><th>Use</th></tr>
<tr><td><code>0</code></td>
<td><strong>Special.</strong> TG <code>0</code> is a protocol
sentinel meaning "no TG selected." V2 clients authenticate with
<code>tg=0</code> and then select a real TG with
<code>MsgSelectTG</code>. Audio is never sent or received on
TG <code>0</code>.</td></tr>
<tr><td><code>001</code>, other <code>0xx</code></td>
<td>ITU test networks. Not assigned to any country.</td></tr>
<tr><td><code>1xx</code></td>
<td>Reserved by ITU. Not assigned to any country.</td></tr>
<tr><td><code>2xx</code></td>
<td><strong>Europe.</strong> Lowest country MCC:
<code>202</code> Greece. (<code>200</code>, <code>201</code> are
unassigned.)</td></tr>
<tr><td><code>3xx</code></td><td>North America (incl. Greenland, Caribbean)</td></tr>
<tr><td><code>4xx</code></td><td>Asia, Middle East</td></tr>
<tr><td><code>5xx</code></td><td>Oceania</td></tr>
<tr><td><code>6xx</code></td><td>Africa</td></tr>
<tr><td><code>7xx</code></td><td>South &amp; Central America</td></tr>
<tr><td><code>8xx</code>, <code>9xx</code></td>
<td>Reserved / non-country use (rare assignments)</td></tr>
</table>
<p><strong>Safe cluster-TG ranges: <code>100–199</code> and
<code>800–999</code>.</strong> Pick cluster TGs (the kind that bypass
prefix ownership — see §2) from these ranges:</p>
<ul>
<li>The <code>1xx</code> block is reserved by ITU and contains no
country MCC.</li>
<li>The <code>8xx</code> and <code>9xx</code> blocks are reserved /
non-country (rare assignments only).</li>
</ul>
<p>A cluster TG drawn from either range cannot collide with any current
or future country prefix (countries live entirely in
<code>200</code>–<code>799</code>). Combined that's roughly 300 available
numbers — more than enough for worldwide, nationwide, and any thematic
broadcast TGs you want to define.</p>
<p>Avoid <code>200</code>–<code>799</code> (country prefix collisions)
and the <code>0xx</code>/<code>1</code>–<code>99</code> ranges (the
latter are technically safe but unconventional for DMR/SvxLink TG
numbering — short numbers are rare in practice). The well-known TG
<code>91</code> (worldwide chat) is a pre-existing convention that
predates this recommendation; new cluster-TG assignments should follow
the <code>100–199</code> / <code>800–999</code> rule.</p>
<h3 style="page-break-after: avoid;">Properties that hold across all variants</h3>
<ul style="page-break-inside: avoid;">
<li>Longest-prefix-match decides the owner of any given TG.</li>
<li>Trunk relay is single-hop. Satellite mirror is independent of that
rule.</li>
<li>Owner fanout is gated by <strong>peer interest</strong> with a
10-minute idle window. Interest is registered the first time a peer
transmits on a TG.</li>
<li>Source-side exclusion in the owner's fanout prevents echo loops.</li>
<li><code>SATELLITE_FILTER</code> is bidirectional and advertised to the
parent.</li>
<li>Talker arbitration uses the random 32-bit nonce exchanged in
<code>MsgPeerHello</code> — lower wins. The loser defers and blocks
local clients from interrupting.</li>
</ul>
</section>
</body>
</html>
+23
View File
@@ -2968,6 +2968,29 @@ bool Reflector::isLocalTG(uint32_t tg) const
} /* Reflector::isLocalTG */ } /* Reflector::isLocalTG */
bool Reflector::hasPrefixRoute(uint32_t tg) const
{
const std::string s = std::to_string(tg);
for (const auto& prefix : m_all_prefixes)
{
if (s.size() >= prefix.size() &&
s.compare(0, prefix.size(), prefix) == 0)
{
return true;
}
}
return false;
} /* Reflector::hasPrefixRoute */
bool Reflector::shouldRelayInbound(uint32_t tg) const
{
if (isLocalTG(tg)) return true;
if (isClusterTG(tg)) return false;
return hasPrefixRoute(tg);
} /* Reflector::shouldRelayInbound */
void Reflector::forwardTrunkAudioToOtherTrunks(const TrunkLink* src, void Reflector::forwardTrunkAudioToOtherTrunks(const TrunkLink* src,
uint32_t tg, uint32_t tg,
const std::vector<uint8_t>& audio) const std::vector<uint8_t>& audio)
+18
View File
@@ -253,6 +253,24 @@ class Reflector : public sigc::trackable
// Used to gate owner-relay fanout of trunk-received audio. // Used to gate owner-relay fanout of trunk-received audio.
bool isLocalTG(uint32_t tg) const; bool isLocalTG(uint32_t tg) const;
// True iff any prefix in m_all_prefixes (local + every configured
// [TRUNK_x] REMOTE_PREFIX) prefix-matches this TG. Used to gate
// trunk-to-trunk fanout: a non-owner gateway forwards onward only if
// it knows a route via prefix table. A bare cluster TG with no prefix
// anywhere in the mesh has no route and stays single-hop.
bool hasPrefixRoute(uint32_t tg) const;
// True iff inbound trunk traffic for this TG should be re-forwarded
// to other trunk peers. Composes ownership, prefix routing, and the
// anti-loop rule for cluster TGs:
// - we own it -> yes (existing owner-fanout)
// - it is a cluster TG -> no (deliberately single-hop; cluster TGs
// are broadcast outbound from local clients, never relayed
// between trunk peers, since they would loop in cyclic meshes)
// - we have a prefix route (gateway between meshes) -> yes
// - otherwise -> no
bool shouldRelayInbound(uint32_t tg) const;
// Owner-relay fanout: when we receive trunk traffic for a TG we own, // Owner-relay fanout: when we receive trunk traffic for a TG we own,
// forward to every other trunk peer except `src`. Each peer's TrunkLink // forward to every other trunk peer except `src`. Each peer's TrunkLink
// applies its own shared/cluster/interest filter, so links with no // applies its own shared/cluster/interest filter, so links with no
+16 -12
View File
@@ -1027,10 +1027,13 @@ void TrunkLink::handleMsgPeerTalkerStart(std::istream& is)
peerId()); peerId());
m_reflector->notifyExternalTrunkTalkerStart(local_tg, m_section, msg.callsign()); m_reflector->notifyExternalTrunkTalkerStart(local_tg, m_section, msg.callsign());
// Owner-relay: if we own this TG, propagate the talker-start to every // Prefix-routed fanout: forward to every other trunk peer if we have a
// other interested trunk peer so their local clients and our mesh-wide // route for this TG in our prefix table. isSharedTG inside the per-trunk
// audience learn about the remote talker. // filter (TrunkLink::onLocalTalkerStart) selects the longest-match owner;
if (m_reflector->isLocalTG(local_tg)) // isPeerInterestedTG covers the return leg. Cluster TGs with no prefix
// match anywhere stay single-hop — gating on hasPrefixRoute prevents
// them from looping in cyclic trunk topologies.
if (m_reflector->shouldRelayInbound(local_tg))
{ {
m_reflector->forwardTrunkTalkerStartToOtherTrunks(this, local_tg, m_reflector->forwardTrunkTalkerStartToOtherTrunks(this, local_tg,
msg.callsign()); msg.callsign());
@@ -1064,8 +1067,9 @@ void TrunkLink::handleMsgPeerTalkerStop(std::istream& is)
TGHandler::instance()->clearTrunkTalkerForTG(local_tg); TGHandler::instance()->clearTrunkTalkerForTG(local_tg);
m_reflector->notifyExternalTrunkTalkerStop(local_tg, m_section); m_reflector->notifyExternalTrunkTalkerStop(local_tg, m_section);
// Owner-relay: propagate the talker-stop to every other interested peer. // Prefix-routed fanout (mirrors talker-start): only fan out if we have
if (m_reflector->isLocalTG(local_tg)) // a route. Cluster TGs without a prefix match stay single-hop.
if (m_reflector->shouldRelayInbound(local_tg))
{ {
m_reflector->forwardTrunkTalkerStopToOtherTrunks(this, local_tg); m_reflector->forwardTrunkTalkerStopToOtherTrunks(this, local_tg);
} }
@@ -1117,9 +1121,9 @@ void TrunkLink::handleMsgPeerAudio(std::istream& is)
// Forward trunk audio to connected satellites // Forward trunk audio to connected satellites
m_reflector->forwardAudioToSatellitesExcept(nullptr, local_tg, msg.audio()); m_reflector->forwardAudioToSatellitesExcept(nullptr, local_tg, msg.audio());
// Owner-relay: when the TG is ours, fan the audio out to every other // Prefix-routed fanout (mirrors talker-start): only fan out if we have
// trunk peer that has interest (so mesh-wide audience hears the talker). // a route. Cluster TGs without a prefix match stay single-hop.
if (m_reflector->isLocalTG(local_tg)) if (m_reflector->shouldRelayInbound(local_tg))
{ {
m_reflector->forwardTrunkAudioToOtherTrunks(this, local_tg, msg.audio()); m_reflector->forwardTrunkAudioToOtherTrunks(this, local_tg, msg.audio());
} }
@@ -1153,9 +1157,9 @@ void TrunkLink::handleMsgPeerFlush(std::istream& is)
// Forward trunk flush to connected satellites // Forward trunk flush to connected satellites
m_reflector->forwardFlushToSatellitesExcept(nullptr, local_tg); m_reflector->forwardFlushToSatellitesExcept(nullptr, local_tg);
// Owner-relay: when the TG is ours, fan the flush out to every other // Prefix-routed fanout (mirrors talker-start): only fan out if we have
// trunk peer so their clients see end-of-stream as well. // a route. Cluster TGs without a prefix match stay single-hop.
if (m_reflector->isLocalTG(local_tg)) if (m_reflector->shouldRelayInbound(local_tg))
{ {
m_reflector->forwardTrunkFlushToOtherTrunks(this, local_tg); m_reflector->forwardTrunkFlushToOtherTrunks(this, local_tg);
} }
+4 -1
View File
@@ -48,8 +48,11 @@ def generate_reflector_conf(name: str) -> str:
lines.append(f"{client['group']}={client['password']}") lines.append(f"{client['group']}={client['password']}")
groups_seen.discard(client['group']) groups_seen.discard(client['group'])
# Trunk sections for each peer reflector # Trunk sections for each peer reflector. Honour the `peers` filter
# so tests can build sparse trunk topologies (e.g. gateway routing).
for peer_name in sorted(peers): for peer_name in sorted(peers):
if not T.should_trunk(name, peer_name):
continue
peer = peers[peer_name] peer = peers[peer_name]
section = T.trunk_section_name(name, peer_name) section = T.trunk_section_name(name, peer_name)
secret = T.trunk_secret(name, peer_name) secret = T.trunk_secret(name, peer_name)
+156 -3
View File
@@ -701,7 +701,7 @@ class TestTrunkIntegration(unittest.TestCase):
sys.stderr.flush() sys.stderr.flush()
for name in REFLECTOR_NAMES: for name in REFLECTOR_NAMES:
for peer in REFLECTOR_NAMES: for peer in REFLECTOR_NAMES:
if peer != name: if peer != name and T.should_trunk(name, peer):
wait_for_trunk_connected( wait_for_trunk_connected(
*_http(name), T.trunk_section_name(name, peer), timeout=30.0) *_http(name), T.trunk_section_name(name, peer), timeout=30.0)
labels = "\u2194".join(n.upper() for n in REFLECTOR_NAMES) labels = "\u2194".join(n.upper() for n in REFLECTOR_NAMES)
@@ -729,11 +729,12 @@ class TestTrunkIntegration(unittest.TestCase):
# Test 1: Mesh connectivity (no harness needed) # Test 1: Mesh connectivity (no harness needed)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
def test_01_mesh_connectivity(self): def test_01_mesh_connectivity(self):
"""All trunk links in the mesh are connected.""" """All trunk links in the mesh are connected (only the trunks the
topology declares — sparse layouts skip non-existent pairs)."""
for name in REFLECTOR_NAMES: for name in REFLECTOR_NAMES:
status = get_status(*_http(name)) status = get_status(*_http(name))
for peer in REFLECTOR_NAMES: for peer in REFLECTOR_NAMES:
if peer == name: if peer == name or not T.should_trunk(name, peer):
continue continue
section = T.trunk_section_name(name, peer) section = T.trunk_section_name(name, peer)
self.assertTrue( self.assertTrue(
@@ -2471,6 +2472,158 @@ class TestTrunkIntegration(unittest.TestCase):
sat_a.close() sat_a.close()
sat_b.close() sat_b.close()
# ------------------------------------------------------------------
# Test 37: Gateway prefix-routing through a non-owner reflector
# ------------------------------------------------------------------
def test_37_gateway_prefix_routing(self):
"""Audio crosses two trunk legs via a non-owner gateway, no
CLUSTER_TGS involved — pure longest-prefix-match.
Topology (from topology.py):
a prefix 122 trunks: b, c (no direct trunk to d)
b prefix 121 trunks: a, c, d (gateway)
c prefix 1 trunks: a, b
d prefix 1219 trunks: b only
TG `121950` is owned by d (longest match `1219`), but a has no
[TRUNK_*_D] section. a's longest match is `121` → routes to b.
b is a non-owner of `121950` (longer prefix `1219` wins in its
m_all_prefixes), so under the old `isLocalTG` gate b would have
delivered locally and stopped — d would never hear it. With the
gate dropped, b's per-trunk filter (isSharedTG selects TRUNK_B_D
as the longest-match owner) routes the audio onward to d.
This test is the cross-mesh case described in
docs/TOPOLOGY_EXAMPLES.md §2 — it must work without the operator
listing every regional TG in CLUSTER_TGS.
"""
# Skip gracefully if the topology doesn't have d (e.g. a partial
# regeneration in someone's working tree).
if "d" not in REFLECTOR_NAMES:
self.skipTest("test_37 requires reflector 'd' in topology")
tg = 121950 # longest-match owner: d (1219); next-longest: b (121)
a_client = ClientPeer()
d_client = ClientPeer()
try:
for client, name, cs, pw in [
(a_client, "a", CLIENT_CALLSIGN, CLIENT_PASSWORD),
(d_client, "d", CLIENT2_CALLSIGN, CLIENT2_PASSWORD),
]:
port = T.mapped_client_port(name)
client.connect(HOST, port)
client.authenticate(callsign=cs, password=pw)
client.setup_udp(udp_port=port)
client.select_tg(tg)
time.sleep(0.8)
hb_frame = struct.pack("!H", 1) # MsgHeartbeat
def keepalive():
for c in (a_client, d_client):
try:
send_frame(c.tcp, hb_frame)
except OSError:
pass
def send_burst(sender, frames=6):
for _ in range(frames):
sender.send_udp_audio(b"\xAB\xCD" * 80)
time.sleep(0.02)
sender.send_udp_flush()
# Pass 1: prime peer-interest on the return leg.
# a -> b (longest-match 121) -> d (b's longest-match 1219)
# registers a-interested at b's TRUNK_A_B and b-interested at
# d's TRUNK_B_D, so the return path d -> b -> a will work.
a_client.recv_udp_all(timeout=0.05)
d_client.recv_udp_all(timeout=0.05)
send_burst(a_client)
time.sleep(1.2)
keepalive()
d_client.recv_udp_all(timeout=0.3)
# Forward leg measurement: a -> ... -> d
a_client.recv_udp_all(timeout=0.05)
d_client.recv_udp_all(timeout=0.05)
send_burst(a_client)
time.sleep(1.2)
keepalive()
d_msgs = d_client.recv_udp_all(timeout=0.8)
d_audio = sum(1 for t, _ in d_msgs if t == UDP_AUDIO)
d_flush = sum(1 for t, _ in d_msgs if t == UDP_FLUSH)
self.assertGreater(d_audio + d_flush, 0,
f"forward leg failed: a->b->d on TG {tg} delivered no "
f"audio/flush to d (gateway forwarding broken)")
# Return leg measurement: d -> ... -> a
a_client.recv_udp_all(timeout=0.05)
d_client.recv_udp_all(timeout=0.05)
send_burst(d_client)
time.sleep(1.2)
keepalive()
a_msgs = a_client.recv_udp_all(timeout=0.8)
a_audio = sum(1 for t, _ in a_msgs if t == UDP_AUDIO)
a_flush = sum(1 for t, _ in a_msgs if t == UDP_FLUSH)
self.assertGreater(a_audio + a_flush, 0,
f"return leg failed: d->b->a on TG {tg} delivered no "
f"audio/flush to a (interest-based return path broken)")
finally:
a_client.close()
d_client.close()
# ------------------------------------------------------------------
# Test 38: Cluster TG broadcast from a local V2 client
# ------------------------------------------------------------------
def test_38_cluster_tg_local_client_broadcast(self):
"""Local V2 client keys a cluster TG; another reflector's V2 client
on the same TG hears it.
Cluster TGs are broadcast by `onLocalAudio` regardless of prefix
ownership (the outbound path passes `isClusterTG`). This test
guards that property — the inbound trunk-to-trunk gate
(`shouldRelayInbound`) deliberately *blocks* cluster relay to
prevent loops, so the only way for a cluster TG to reach another
reflector is the local-client-originated broadcast.
"""
if not T.CLUSTER_TGS:
self.skipTest("test_38 requires at least one CLUSTER_TG")
tg = T.CLUSTER_TGS[0]
other = next(n for n in REFLECTOR_NAMES if n != self.PRIMARY)
sender = ClientPeer()
receiver = ClientPeer()
try:
tx_port = T.mapped_client_port(self.PRIMARY)
sender.connect(HOST, tx_port)
sender.authenticate(callsign=CLIENT_CALLSIGN, password=CLIENT_PASSWORD)
sender.setup_udp(udp_port=tx_port)
sender.select_tg(tg)
rx_port = T.mapped_client_port(other)
receiver.connect(HOST, rx_port)
receiver.authenticate(callsign=CLIENT2_CALLSIGN, password=CLIENT2_PASSWORD)
receiver.setup_udp(udp_port=rx_port)
receiver.select_tg(tg)
time.sleep(0.4)
receiver.recv_udp_all(timeout=0.05)
for _ in range(6):
sender.send_udp_audio(b"\xBE\xEF" * 80)
time.sleep(0.02)
time.sleep(1.0)
msgs = receiver.recv_udp_all(timeout=1.5)
audio_count = sum(1 for t, _ in msgs if t == UDP_AUDIO)
flush_count = sum(1 for t, _ in msgs if t == UDP_FLUSH)
self.assertGreater(audio_count + flush_count, 0,
f"cluster TG {tg} broadcast from reflector-{self.PRIMARY} "
f"did not reach V2 client on reflector-{other}")
finally:
sender.close()
receiver.close()
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Custom test runner with clean, readable output # Custom test runner with clean, readable output
+21
View File
@@ -14,6 +14,11 @@ REFLECTORS = {
"a": {"prefix": ["122"], "trunk_port_base": 15000}, "a": {"prefix": ["122"], "trunk_port_base": 15000},
"b": {"prefix": ["121"], "trunk_port_base": 25000}, "b": {"prefix": ["121"], "trunk_port_base": 25000},
"c": {"prefix": ["1"], "trunk_port_base": 35000}, "c": {"prefix": ["1"], "trunk_port_base": 35000},
# `d` is sparse-trunked: only connects to `b`. With prefix `1219`
# (sub-prefix of b's `121`), it lets test_37 verify gateway forwarding
# — a's audio for TG `121950` must reach d via the b gateway, even
# though a has no direct trunk to d.
"d": {"prefix": ["1219"], "trunk_port_base": 45000, "peers": ["b"]},
} }
# Fake trunk peers used by the test harness. # Fake trunk peers used by the test harness.
@@ -102,6 +107,22 @@ def trunk_secret(name_a: str, name_b: str) -> str:
pair = tuple(sorted([name_a, name_b])) pair = tuple(sorted([name_a, name_b]))
return f"secret_{pair[0]}{pair[1]}" return f"secret_{pair[0]}{pair[1]}"
def _allowed_peers(name: str) -> set:
"""Other reflector names that `name` is willing to trunk to.
Default is full mesh (all other reflectors). A reflector can opt into
a sparse layout by setting `peers: ["x", "y"]` in REFLECTORS — useful
for testing gateway-style prefix routing.
"""
me = REFLECTORS[name]
if "peers" in me:
return set(me["peers"])
return {n for n in REFLECTORS if n != name}
def should_trunk(a: str, b: str) -> bool:
"""A trunk between a and b exists iff both sides allow it."""
return b in _allowed_peers(a) and a in _allowed_peers(b)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Helpers for prefix handling # Helpers for prefix handling
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------