diff --git a/docs/TOPOLOGY_EXAMPLES.md b/docs/TOPOLOGY_EXAMPLES.md index 7679a86..958fd41 100644 --- a/docs/TOPOLOGY_EXAMPLES.md +++ b/docs/TOPOLOGY_EXAMPLES.md @@ -12,7 +12,7 @@ > > Project home: . -A visual cookbook of the five topology shapes GeuReflector supports, using a +A visual cookbook of the four 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). @@ -100,7 +100,7 @@ This layer is the foundation. Everything else stacks on top of it. --- -## 2. National trunk mesh joined at the country gateway +## 2. National trunk topology 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 @@ -213,99 +213,95 @@ and [`CONCEPTS.md`](CONCEPTS.md) for the full mechanism. > country (national domain). Configure those on every reflector that > should join the broadcast. -**Trade-offs.** +### Variant: sub-trunk star -- **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.** Satellites were originally introduced as a small, -> single-operator pattern: a NAT'd instance hanging off a parent, -> authenticated by one shared `[SATELLITE] SECRET=`. Since the -> per-satellite-secrets feature, the parent can also pin each satellite -> to its own value via `SECRET_=` entries in the same section -> (id charset `[A-Za-z0-9-]+`, matched against the satellite's -> `SATELLITE_ID`). Per-id wins — an HMAC mismatch on a pinned id rejects -> the connection with no fallback. Keeping `SECRET=` alongside the -> per-id entries is backward-compatible. Use the per-id form when more -> than one operator administers satellites under the same parent — e.g. -> per-Zone satellites in §3 each get `SECRET_=` so a leaked Zone-1 -> secret cannot impersonate Zone-2. For a single-operator deployment, -> the shared `SECRET=` is still fine; for multi-operator national meshes -> consider also §2 (national trunk mesh) where each `[TRUNK_x]` has its -> own `SECRET`. See [README §Satellite reflectors](../README.md#satellite-reflectors) -> for the config form. +The national side does not have to be a full mesh. IT 222 can delegate +sub-prefixes of its own `222` over ordinary trunks to Zones that each trunk +*only* to IT 222. The Zones still **own** their prefixes — that is the whole +difference from a satellite, which owns nothing and inherits its parent's +identity (§3). A Zone may own more than one prefix: `REMOTE_PREFIX` is a +comma-separated list, so one reflector can serve Lombardia and Emilia-Romagna +together. ``` - INTERNATIONAL MESH (trunk full mesh, port :5302) - same as section 1 — only IT 222 represents Italy upstream + SUB-TRUNK STAR under IT 222 (port :5302, not a full mesh) - [IT 222] - ╱ ╲ - [SE 240]──────[DE 262] + [IT 222] ◄── owns 222, also intl peer + ╱ ╲ + REMOTE_PREFIX=2221 REMOTE_PREFIX=2222,2224 + ╱ ╲ + [IT-Z1 2221] [IT-Z2/Z4 2222,2224] - - 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) + each Zone's uplink section, pointing back at IT 222: + REMOTE_PREFIX=222 + ROUTABLE_PREFIXES=* ← single-uplink default route ``` -**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. +Each Zone has exactly one trunk, so its uplink takes the single-uplink-leaf +`ROUTABLE_PREFIXES=*` described above rather than an explicit prefix list. -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. +**Delegation, not collision.** IT 222 owns `222`; Z1 owns `2221`. TG `22213` +matches both, and longest-prefix-match hands it to Z1. That overlap is the +mechanism, not a hazard — see [`CONCEPTS.md`](CONCEPTS.md). -**Trade-offs vs. the national trunk mesh.** +| TG | Longest match | Owner | +|---|---|---| +| `22213` | `2221` | IT-Z1 | +| `22241` | `2224` | IT-Z2/Z4 | +| `22299` | `222` | IT 222 | +| `2629` | none locally → `*` route | up to IT 222, then DE | -| | National trunk mesh (§2) | Satellite tree (§3) | +A **Z1 client keying `2629`** (DE) reaches Germany because `2629` matches +nothing Z1 owns and the uplink's `*` makes IT 222 the default route: +Z1 → IT 222 → DE. Inbound, an SE client keying `22241` lands on IT 222, whose +gateway prefix routing bridges it down to IT-Z2/Z4 exactly as in the full-mesh +case. + +**A Zone mixes local-only and mesh-reachable TGs.** Owning `2222,2224` does +not mean every TG on that reflector is routable. Three kinds coexist: + +| TG on IT-Z2/Z4 | Config | Reach | +|---|---|---| +| `22241` | owned outright (under `2224`) | routed across the mesh by prefix | +| `40` | nothing — matches no prefix | **effectively local**: no reflector owns it | +| `8` | `LOCAL_ALIASES=8:2222008` | dialed as `8` locally, `2222008` on the mesh | + +`40` stays a private Zone talk group and `8` is the club TG operators keep +dialing by its short number while the mesh routes it as `2222008` under the +Zone's own `2222` prefix. Mind the cost of the `*` route, though: it matches +everything no longer prefix claims, so `40` is still forwarded up the uplink, +and IT 222 discards it only on arrival — it matches neither IT's `LOCAL_PREFIX` +nor the Zone's `REMOTE_PREFIX`. Nobody hears it, but it crosses the wire. With +an explicit `ROUTABLE_PREFIXES=262,240` it would never egress at all. + +**Full mesh or star?** + +| | Full mesh | Sub-trunk star | |---|---|---| | 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) | +| NAT story | Zones need inbound reachability from other Zones + IT 222 | Zone dials out; only IT 222 needs an inbound port | +| IT 222 outage | Zones keep talking to each other; international reach is lost | Zones are isolated from each other and from abroad | +| Zone-to-Zone audio | direct, one hop | two hops, relayed by IT 222 | +| Foreign → regional TG reach | gateway prefix routing on IT 222 (`shouldRelayInbound`) | same | +| Reaching international TGs from a Zone | list foreign prefixes in `ROUTABLE_PREFIXES` per leg | `ROUTABLE_PREFIXES=*` on the one uplink | +| Prefix advertised upstream | only `222` (Zones not visible to SE/DE) | only `222` | + +Either way, foreign reflectors carry no Italian internal prefix table — the +country presents one face upstream (`222`) — and IT 222 is a single point of +failure for international reach into or out of Italy, unless it is run as a +twin pair (§4). --- -## 4. Satellite under a regional reflector +## 3. 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: +national mesh, parent to its own satellite. A satellite is a **leaf**: it +owns no prefix, accepts no children of its own, and inherits the parent's +identity. That is why a Zone (which owns `2222`) is sub-trunked in §2 rather +than made a 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 @@ -320,6 +316,16 @@ together: against it. Audio federates over the satellite link while authentication state stays separated on each side. +> **Trust model.** Pin each satellite to its own credential with a +> `SECRET_` entry in `[SATELLITE]`, matched against the satellite's +> `SATELLITE_ID` (id charset `[A-Za-z0-9-]+`). Per-id wins, and an HMAC +> mismatch on a pinned id is rejected with no fallback to the shared +> `SECRET` — so a leaked secret from one club cannot impersonate another. +> Use it whenever more than one operator runs satellites under the same +> parent. A single shared `SECRET` is fine for a one-operator deployment. +> See [README §Satellite reflectors](../README.md#satellite-reflectors) +> for the config form. + ``` INTL DOMAIN NATIONAL DOMAIN SATELLITE under Z2 (port :5302) (port :5302) (port :5303) @@ -328,7 +334,7 @@ together: │ ╱ │ │ [IT 222] ──┤ [IT-Z2 2222] ─ ─ ─ ─ ─ [MI club] │ (gateway) │ │ SATELLITE_OF=z2.host - │ ╲ [IT-Z3 2223] SATELLITE_FILTER=2222 + │ ╲ [IT-Z3 2223] SATELLITE_FILTER=2222* [DE 262] ╲ │ (optional, see below) [IT-Z4 2224] (full mesh @@ -364,17 +370,22 @@ through the IT 222 hinge via gateway prefix routing (see §2). 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` +**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 +`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). +Mind the syntax: entries are **exact** unless they end in `*`. `2222` matches +only literal TG `2222`; `2222*` matches everything under Lombardia. The shared +TG-filter syntax is exact `26200`, prefix `24*`, range `2427-2438`, +comma-separated. + --- -## 5. HA twin pair +## 4. 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 @@ -457,25 +468,116 @@ 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 — +member of a national trunk topology (§2), or the parent of a club +satellite (§3). Don't reach for twins just to share traffic across two boxes — that's what plain trunks are for. --- +## Overlay: local aliases — giving a short local TG a mesh-reachable number + +Not a topology shape but an overlay that composes with all five: a way to make +an existing **short local TG** reachable from the mesh without renumbering it +on the clients. + +Recall from *Properties* below that routing follows the number: a TG matching +no configured prefix has no owner and stays **local-only**. A club or legacy +talk group like `8` therefore never leaves its reflector — but it is also +exactly the kind of number operators have in their muscle memory and in their +node configs. `LOCAL_ALIASES` (in `[GLOBAL]`) resolves the tension by +**re-homing** the short TG under one of the reflector's own prefixes, giving it +a globally-unique number, while local users keep dialing the short one. + +```ini +# On IT 222: +[GLOBAL] +LOCAL_PREFIX=222 +LOCAL_ALIASES=8:2220008,90:2220090/out,91:2220091/in +``` + +**Syntax.** Comma-separated entries of the form `localTG:aliasTG[/dir]`, where +`dir` is `in` or `out`; omitted means two-way. + +- **two-way** (`8:2220008`): local talk on `8` is exported to the mesh as + `2220008`, and mesh traffic on `2220008` is delivered to local clients as `8`. +- **`/out`** (`90:2220090/out`): publish-only — local talk is exported, inbound + mesh traffic is not folded back onto the short number. +- **`/in`** (`91:2220091/in`): listen-only — mesh traffic is delivered locally, + the short number is never exported. + +**Ownership rule.** `aliasTG` must fall under one of *this* reflector's +`LOCAL_PREFIX` values, checked with the same longest-prefix match used for TG +ownership everywhere else. An entry whose `aliasTG` is not owned is rejected at +config load — logged as an error and skipped, while the reflector still starts +and the remaining valid entries take effect. A reflector can therefore never +alias its way onto a number another peer owns. This is the same discipline as +prefix ownership itself: you may only re-home a TG into space you already own. + +**Routing on the long number, delivery on the short one.** The alias is a +translation applied at the **trunk boundary**, not a rename. Prefix routing, +owner-relay fanout and peer-interest bookkeeping all run on the long number, +because that is the identity the rest of the mesh matches prefixes against. +Local delivery and talker arbitration run on the short number, because that is +what local clients selected. Everything on the local side of the boundary — +clients and satellites alike — sees `8`; everything across a trunk sees +`2220008`. + +**Rewrite-on-select.** A client that dials the long number `2220008` directly +is folded onto `8` the moment it selects or monitors the TG, so the two are +always one conversation locally; you cannot end up with a split room. + +**Flow.** + +- An **SE client keys `2220008`**: SE's prefix table matches `222 → IT`, so the + audio crosses the trunk to IT exactly like any other owned TG. IT translates + at the boundary and delivers it to its local nodes on TG `8`. +- An **IT client keys `8`**: IT exports it to the mesh as `2220008`, reaching + peers that have registered interest in that TG. Locally it is an ordinary + TG `8` transmission. + +``` + SE 240 ──── trunk: TG 2220008 ────► IT 222 + │ alias boundary + │ route on 2220008 + │ deliver on 8 + ▼ + local nodes select TG 8 +``` + +**Composing with the topologies above.** Because `aliasTG` must be owned +locally, each reflector aliases into its *own* prefix space: in §2 an Italian +Zone re-homes its club TGs under its Zone prefix (`2222…` for Z2) while IT 222 +re-homes under `222…`. In a twin pair (§4), give **both** twins identical +`LOCAL_ALIASES` — each twin independently applies the translation on its own +trunk sections. + +> **Aliases are not cluster TGs.** `CLUSTER_TGS` broadcasts an *unowned* TG to +> every peer regardless of prefix. `LOCAL_ALIASES` does the opposite: it pulls +> an unowned short number *into* your owned prefix space so that ordinary +> longest-prefix-match routing takes over. Reach for an alias when the TG +> belongs to you; reach for a cluster TG when it belongs to everyone. + +See [`PEER_PROTOCOL.md`](PEER_PROTOCOL.md) ("Local aliases") for the wire-level +consequences, including why `/status.active_talkers` reports the long mesh +number while local clients simultaneously experience the short one. + +--- + ## 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 | +| Each Zone has a public IP; want regional autonomy and resilience to gateway outage | National trunk topology, full mesh (§2) | +| Zones own their prefixes but sit behind NAT, or you want one simple uplink per Zone instead of a full mesh | National trunk topology, sub-trunk star (§2) | +| §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) | Satellite under a regional reflector (§3) | +| HA failover for SvxLink clients on a single site (two boxes, same LAN) | Twin pair (§4) — composes with §1–§3 | +| An existing short local TG (e.g. `8`) must stay dialable locally but become reachable across the mesh | `LOCAL_ALIASES` overlay — 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. +The shapes compose: the international layer (§1) is always present, and §2 +and §3 are ways to fan out *inside* a country. §4 is orthogonal — any single +reflector role above can be played by a twin pair instead, and the +`LOCAL_ALIASES` overlay applies to any of them. ## Appendix: MCC ranges and cluster-TG numbering @@ -525,13 +627,20 @@ recommendation; new cluster-TG assignments should follow the `100–199` / its longest matching prefix *that exists in the mesh* (e.g. `22210`→`222`, `26201`→`262`, when those country prefixes are owned), while a TG that matches **no** configured prefix has no owner and stays **local-only** — - it works among the originating reflector's own nodes but is never trunked. + it works among the originating reflector's own nodes but is never trunked — + unless a link carries `ROUTABLE_PREFIXES=*`, whose default route forwards it + to the uplink, where the peer drops it as unowned. Local TG numbering is thus the operator's choice; only numbers under the agreed prefix scheme are reachable across the mesh (and a "local" number - that happens to match a prefix *will* be routed to that owner). + that happens to match a prefix *will* be routed to that owner). A + local-only number can be given mesh reach without renumbering the clients, + via the `LOCAL_ALIASES` overlay. +- Aliases translate at the trunk boundary only: the mesh routes the long + owned number, local clients and satellites see the short one. - 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. + Interest is registered when a peer first transmits on a TG, or proactively + when it advertises a selected / monitored TG via `MsgPeerTgInterest`. - 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 diff --git a/docs/TOPOLOGY_EXAMPLES.pdf b/docs/TOPOLOGY_EXAMPLES.pdf index 14133c3..b8004aa 100644 Binary files a/docs/TOPOLOGY_EXAMPLES.pdf and b/docs/TOPOLOGY_EXAMPLES.pdf differ diff --git a/docs/build_topology_pdf.sh b/docs/build_topology_pdf.sh index fab8752..191da84 100755 --- a/docs/build_topology_pdf.sh +++ b/docs/build_topology_pdf.sh @@ -16,9 +16,10 @@ 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 +dot -Tsvg 03_subtrunk_star.dot -o 03_subtrunk_star.svg neato -Tsvg 04_hybrid.dot -o 04_hybrid.svg neato -Tsvg 05_twin_pair.dot -o 05_twin_pair.svg +neato -Tsvg 06_local_alias.dot -o 06_local_alias.svg echo "[2/3] Building PDF with WeasyPrint" BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M UTC") diff --git a/docs/topology_pdf/03_satellite_tree.dot b/docs/topology_pdf/03_satellite_tree.dot deleted file mode 100644 index 38f7ef2..0000000 --- a/docs/topology_pdf/03_satellite_tree.dot +++ /dev/null @@ -1,49 +0,0 @@ -// 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; -} diff --git a/docs/topology_pdf/03_satellite_tree.svg b/docs/topology_pdf/03_satellite_tree.svg deleted file mode 100644 index aecad55..0000000 --- a/docs/topology_pdf/03_satellite_tree.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - -SatTree - -cluster_intl - -International trunk mesh (port :5302) - - -cluster_sat - -Italian satellite tree (port :5303) - - - -SE - -SE -240 - - - -DE - -DE -262 - - - -SE->DE - - - - -IT - -IT -222 - - - -SE->IT - - - - -DE->IT - - - - -Z1 - -IT-Z1 -2221 -filter=2221 - - - -IT->Z1 - - - - - - -Z2 - -IT-Z2 -2222 -filter=2222 - - - -IT->Z2 - - - - - - -Z3 - -IT-Z3 -2223 -filter=2223 - - - -IT->Z3 - - - - - - -Z4 - -IT-Z4 -2224 -filter=2224 - - - -IT->Z4 - - - - - - -Z5 - -IT-Z5 -2225 -filter=2225 - - - -IT->Z5 - - - - - - diff --git a/docs/topology_pdf/03_subtrunk_star.dot b/docs/topology_pdf/03_subtrunk_star.dot new file mode 100644 index 0000000..bd10be0 --- /dev/null +++ b/docs/topology_pdf/03_subtrunk_star.dot @@ -0,0 +1,64 @@ +// Sub-trunk star — IT 222 delegates Zone sub-prefixes over ordinary trunks. +// The Zones own their prefixes (unlike satellites) but hold a single uplink. +digraph SubTrunkStar { + layout = dot; + rankdir = TB; + bgcolor = "transparent"; + margin = 0.3; + splines = true; + ranksep = 1.35; + nodesep = 0.7; + + 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"]; + } + + // Zone reflectors, sub-trunked to IT 222. They own delegated sub-prefixes. + subgraph cluster_zones { + label = "Italian sub-trunks (port :5302)"; + fontname = "Helvetica-Bold"; fontsize = 12; color = "#1e7d34"; + style = "rounded,dashed"; bgcolor = "#f5fbf6"; margin = 14; + Z1 [label="IT-Z1\n2221", fillcolor="#dff3e0", color="#1e7d34", + fixedsize=false, width=1.3]; + Z24 [label="IT-Z2/Z4\n2222, 2224", fillcolor="#dff3e0", color="#1e7d34", + fixedsize=false, width=1.6]; + } + + // Annotation: the Zone side of every uplink + UP [label="each Zone's uplink to IT 222:\lREMOTE_PREFIX=222\lROUTABLE_PREFIXES=*\l", + shape=note, fillcolor="#fff9e6", color="#a37300", + style="filled,dashed", fontname="Helvetica", fontsize=10, + fixedsize=false]; + + // Annotation: a Zone mixes local-only TGs with aliased ones + MIX [label="IT-Z2/Z4 talk groups:\lTG 40 no owner → effectively local\lTG 8 LOCAL_ALIASES=8:2222008 → mesh-reachable\lTG 22241 owned outright (under 2224)\l", + shape=note, fillcolor="#eceff1", color="#5f6368", + style="filled,dashed", fontname="Helvetica", fontsize=10, + fixedsize=false]; + + // Trunk edges — international full mesh + edge [color="#5f6368", penwidth=1.5, dir=none, constraint=false]; + SE -> DE; SE -> IT; DE -> IT; + + // Sub-trunk edges — IT 222 down to each Zone (bidirectional trunks) + edge [color="#5f6368", penwidth=1.6, style=solid, dir=none, + constraint=true, fontname="Helvetica", fontsize=10, + fontcolor="#3c4043"]; + IT -> Z1 [label=" REMOTE_PREFIX=2221 "]; + IT -> Z24 [label=" REMOTE_PREFIX=2222,2224 "]; + + // Attach annotations + edge [color="#a37300", penwidth=1.2, style=dotted, dir=none, label=""]; + Z1 -> UP; + edge [color="#5f6368"]; + Z24 -> MIX; +} diff --git a/docs/topology_pdf/03_subtrunk_star.svg b/docs/topology_pdf/03_subtrunk_star.svg new file mode 100644 index 0000000..a92a272 --- /dev/null +++ b/docs/topology_pdf/03_subtrunk_star.svg @@ -0,0 +1,115 @@ + + + + + + +SubTrunkStar + +cluster_intl + +International trunk mesh (port :5302) + + +cluster_zones + +Italian sub-trunks (port :5302) + + + +SE + +SE +240 + + + +DE + +DE +262 + + + +SE->DE + + + + +IT + +IT +222 + + + +SE->IT + + + + +DE->IT + + + + +Z1 + +IT-Z1 +2221 + + + +IT->Z1 + +  REMOTE_PREFIX=2221   + + + +Z24 + +IT-Z2/Z4 +2222, 2224 + + + +IT->Z24 + +  REMOTE_PREFIX=2222,2224   + + + +UP + + + +each Zone's uplink to IT 222: +REMOTE_PREFIX=222 +ROUTABLE_PREFIXES=* + + + +Z1->UP + + + + +MIX + + + +IT-Z2/Z4 talk groups: +TG 40      no owner → effectively local +TG 8       LOCAL_ALIASES=8:2222008 → mesh-reachable +TG 22241   owned outright (under 2224) + + + +Z24->MIX + + + + diff --git a/docs/topology_pdf/04_hybrid.dot b/docs/topology_pdf/04_hybrid.dot index 28d2428..fd9b847 100644 --- a/docs/topology_pdf/04_hybrid.dot +++ b/docs/topology_pdf/04_hybrid.dot @@ -24,7 +24,7 @@ graph Hybrid { 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", + 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!"]; diff --git a/docs/topology_pdf/04_hybrid.svg b/docs/topology_pdf/04_hybrid.svg index 2fdfe1b..2b815cf 100644 --- a/docs/topology_pdf/04_hybrid.svg +++ b/docs/topology_pdf/04_hybrid.svg @@ -123,7 +123,7 @@ MI club (satellite) -filter=2222 +filter=2222* diff --git a/docs/topology_pdf/06_local_alias.dot b/docs/topology_pdf/06_local_alias.dot new file mode 100644 index 0000000..45026a4 --- /dev/null +++ b/docs/topology_pdf/06_local_alias.dot @@ -0,0 +1,51 @@ +// Local aliases — a short local TG (8) re-homed under IT's owned prefix 222 +// as the globally-unique number 2220008. The mesh routes the long number; +// local clients (and satellites) keep dialing the short one. +graph LocalAlias { + 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="-4.6, 1.0!"]; + DE [label="DE\n262", fillcolor="#dde8fb", color="#1a4fa3", pos="-4.6,-1.0!"]; + + // The aliasing reflector — owns 222, re-homes local TG 8 as 2220008 + IT [label="IT\n222", fillcolor="#fde2d4", color="#c0531c", pos="0,0!"]; + + // Local SvxLink nodes hanging off IT — they only ever see TG 8 + NODES [label="local SvxLink nodes\nselect TG 8", + fillcolor="#eceff1", color="#5f6368", style="filled,rounded,dashed", + height=0.8, width=2.0, pos="0,-2.1!"]; + + // Annotation: the number the mesh routes on (sits between the two trunk legs) + MESH [label="trunk: the mesh\nroutes TG 2220008", shape=plaintext, + style="", fillcolor="none", fontname="Helvetica", fontsize=11, + fontcolor="#3c4043", width=1.6, height=0.5, pos="-2.35,0!"]; + + // Annotation: what the alias boundary does inside IT + ALIAS [label="alias boundary\nroute on 2220008\ndeliver on 8", + shape=note, fillcolor="#fff9e6", color="#a37300", + style="filled,dashed", fontname="Helvetica", + fontsize=11, height=0.95, width=1.75, pos="3.0, 0!"]; + + edge [color="#5f6368", penwidth=1.2, fontname="Helvetica", fontsize=11, + fontcolor="#3c4043"]; + + // International full mesh — the long number is what these peers route on + SE -- DE; + SE -- IT; + DE -- IT; + + // Local delivery leg — the short number is what these clients see + IT -- NODES [label=" local: TG 8 "]; + + // Tie the annotation to the reflector that performs the translation + edge [color="#a37300", penwidth=1.6, style=dotted, len=0.8]; + IT -- ALIAS; +} diff --git a/docs/topology_pdf/06_local_alias.svg b/docs/topology_pdf/06_local_alias.svg new file mode 100644 index 0000000..8527dbc --- /dev/null +++ b/docs/topology_pdf/06_local_alias.svg @@ -0,0 +1,82 @@ + + + + + + +LocalAlias + + +SE + +SE +240 + + + +DE + +DE +262 + + + +SE--DE + + + + +IT + +IT +222 + + + +SE--IT + + + + +DE--IT + + + + +NODES + +local SvxLink nodes +select TG 8 + + + +IT--NODES + +  local: TG 8   + + + +ALIAS + + + +alias boundary +route on 2220008 +deliver on 8 + + + +IT--ALIAS + + + + +MESH +trunk: the mesh +routes TG 2220008 + + + diff --git a/docs/topology_pdf/topology.html b/docs/topology_pdf/topology.html index 13963f9..5002ed5 100644 --- a/docs/topology_pdf/topology.html +++ b/docs/topology_pdf/topology.html @@ -30,7 +30,7 @@ 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; + h1, h2, h3, h4 { 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; @@ -38,13 +38,18 @@ page-break-after: avoid; } h3 { font-size: 12pt; margin: 14pt 0 4pt 0; color: #1a4fa3; page-break-after: avoid; } + h4 { font-size: 10.5pt; margin: 12pt 0 4pt 0; color: #1e7d34; + 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; } + padding: 0.5pt 3pt; border-radius: 3pt; font-size: 9pt; + /* JetBrains Mono ligates ">=" into a single glyph, which would + silently swallow the ">" in tokens like SECRET_=. */ + font-variant-ligatures: none; } table { border-collapse: collapse; margin: 8pt 0 12pt 0; width: 100%; font-size: 9.5pt; page-break-inside: avoid; } @@ -132,6 +137,8 @@ .legend .sat { background: #fff4d6; border-color: #a37300; border-style: dashed; } .legend .twin { background: #e6dcff; border-color: #5430a8; } + .legend .nodes { background: #eceff1; border-color: #5f6368; + border-style: dashed; } .legend .trunk-line { display: inline-block; width: 18pt; height: 2pt; background: #5f6368; vertical-align: middle; margin-right: 4pt; @@ -155,7 +162,7 @@
GeuReflector documentation

Mesh Topology Examples

- A visual cookbook of trunk and satellite layouts — + A visual cookbook of trunk, satellite and twin layouts — European running example with Italian BrandMeister Zone prefixes
@@ -200,9 +207,15 @@ 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. +
  • Peer interest is populated either when a peer emits + PeerTalkerStart / PeerAudio on a TG, or + proactively when a peer advertises its local clients' selected / + monitored TGs via MsgPeerTgInterest (type 129). The + proactive path means a passive listener — a SvxLink node that has + selected a foreign TG or added it to monitoredTGs without + keying — registers as interested at the owner without first + transmitting; the receiver re-advertises one hop further toward the + owner so multi-hop national-mesh layouts (§2) propagate correctly. 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 @@ -217,6 +230,7 @@ down.

    Italian Zone reflector Satellite reflector Twin (HA pair) + Local SvxLink nodes (clients) Trunk link (port :5302) Satellite mirror (port :5303) Twin link @@ -249,7 +263,7 @@ SE is excluded as the source.

    -

    2. National trunk mesh joined at the country gateway

    +

    2. National trunk topology joined at the country gateway

    Italy adds per-Zone reflectors that form a national trunk mesh together with IT 222. Foreign countries see only @@ -310,7 +324,9 @@ 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.

    +the SE side — either by a previous PTT from SE, or proactively as soon as +the Swedish operator selected (or monitored) 22221 on their +SvxLink node, via MsgPeerTgInterest (type 129).

    Reaching international TGs from a Zone — ROUTABLE_PREFIXES. The gateway routing above carries a @@ -348,102 +364,118 @@ logs a startup warning and is ambiguous about which leg to use).

    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.
  • -
- +

Variant: sub-trunk star

-
-

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. -
+

The national side does not have to be a full mesh. IT 222 can delegate +sub-prefixes of its own 222 over ordinary trunks to Zones that +each trunk only to IT 222. The Zones still own their +prefixes — that is the whole difference from a satellite, which owns nothing +and inherits its parent's identity (§3). A Zone may own more than one prefix: +REMOTE_PREFIX is a comma-separated list, so one reflector can +serve Lombardia and Emilia-Romagna together.

- Satellite tree under IT 222 -
Diagram 3 — IT 222 is the only Italian reflector on the - international trunk mesh. Zones hang off as satellites over port :5303, - each with SATELLITE_FILTER set to its own prefix.
+ Sub-trunk star under IT 222 +
Diagram 3 — IT 222 owns 222 and delegates + 2221 and 2222,2224 to Zone reflectors over ordinary + trunks. A star, not a full mesh: each Zone holds exactly one uplink, so its + uplink section carries ROUTABLE_PREFIXES=*.
-

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.

+

Each Zone has exactly one trunk, so its uplink takes the +single-uplink-leaf ROUTABLE_PREFIXES=* described above rather than +an explicit prefix list.

-

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.

+

Delegation, not collision

+

IT 222 owns 222; Z1 owns 2221. TG 22213 +matches both, and longest-prefix-match hands it to Z1. That overlap is the +mechanism, not a hazard.

-

Trade-offs vs. the national trunk mesh

- + + + + + + +
PropertyNational trunk mesh (§2)Satellite tree (§3)
TGLongest matchOwner
222132221IT-Z1
222412224IT-Z2/Z4
22299222IT 222
2629none locally → * routeup to IT 222, then DE
+ +

A Z1 client keying 2629 (DE) reaches Germany +because 2629 matches nothing Z1 owns and the uplink's +* makes IT 222 the default route: Z1 → IT 222 → DE. Inbound, an SE +client keying 22241 lands on IT 222, whose gateway prefix routing +bridges it down to IT-Z2/Z4 exactly as in the full-mesh case.

+ +

A Zone mixes local-only and mesh-reachable TGs

+

Owning 2222,2224 does not mean every TG on that reflector is +routable. Three kinds coexist.

+ + + + + + + + + + + + +
TG on IT-Z2/Z4ConfigReach
22241owned outright (under 2224)routed across the mesh by prefix
40nothing — matches no prefixeffectively local: no reflector owns it
8LOCAL_ALIASES=8:2222008dialed as 8 locally, 2222008 on the mesh
+ +

40 stays a private Zone talk group and 8 is the +club TG operators keep dialing by its short number while the mesh routes it as +2222008 under the Zone's own 2222 prefix. Mind the +cost of the * route, though: it matches everything no longer +prefix claims, so 40 is still forwarded up the uplink, and IT 222 +discards it only on arrival — it matches neither IT's LOCAL_PREFIX +nor the Zone's REMOTE_PREFIX. Nobody hears it, but it crosses the +wire. With an explicit ROUTABLE_PREFIXES=262,240 it would never +egress at all.

+ +

Full mesh or star?

+ + - + - + + + + - - - - - + + + + + - +
PropertyFull meshSub-trunk star
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 222only IT 222 needs an inbound port
Zone dials out; only IT 222 needs an inbound port
IT 222 outage Zones keep talking to each other; international reach is lostwhole country offline
Zones are isolated from each other and from abroad
Zone-to-Zone audiodirect, one hoptwo hops, relayed by IT 222
Foreign → regional TG reachworks automatically via gateway prefix routing on IT 222 (shouldRelayInbound)works automatically via parent mirror + filter
Fanout cost on a busy ZoneO(other national peers)O(0) — parent does it
gateway prefix routing on IT 222 (shouldRelayInbound)same
Reaching international TGs from a Zonelist foreign prefixes in ROUTABLE_PREFIXES per legROUTABLE_PREFIXES=* on the one uplink
Prefix advertised upstream only 222 (Zones not visible to SE/DE)only 222 (Zones hidden behind parent)
only 222
+ +

Either way, foreign reflectors carry no Italian internal prefix table — the +country presents one face upstream (222) — and IT 222 is a single +point of failure for international reach into or out of Italy, unless it is run +as a twin pair (§4).

-

4. Satellite under a regional reflector

+

3. 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:

+the national mesh, parent to its own satellite. A satellite is a +leaf: it owns no prefix, accepts no children of its own, and +inherits the parent's identity. That is why a Zone (which owns +2222) is sub-trunked in §2 rather than made a satellite. Two +motivations apply, often together:

  • NAT traversal. The downstream site (e.g. a Milano @@ -463,6 +495,18 @@ often together:

    authentication state stays separated on each side.
+
+ Trust model + Pin each satellite to its own credential with a + SECRET_<id> entry in [SATELLITE], matched + against the satellite's SATELLITE_ID. Per-id wins, and an HMAC + mismatch on a pinned id is rejected with no fallback to the shared + SECRET — so a leaked secret from one club cannot impersonate + another. Use it whenever more than one operator runs satellites under the + same parent. A single shared SECRET is fine for a one-operator + deployment. +
+
Hybrid layout — two-domain trunk + a satellite under Z2
Diagram 4 — International + national trunk mesh joined at IT 222, @@ -483,7 +527,7 @@ often together:

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 + mirrors down to MI through the satellite link (filter 2222* matches). The return leg works symmetrically through isPeerInterestedTG.
  • MI client keys 22241 (Emilia-Romagna, @@ -499,18 +543,23 @@ often together:

    Filter caveat - A restrictive SATELLITE_FILTER like 2222 prevents + A restrictive SATELLITE_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 + 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). + that should never hear other Zones' traffic). Mind the syntax: entries are + exact unless they end in * — + 2222 matches only literal TG 2222, while + 2222* matches everything under Lombardia. The shared TG-filter + syntax is exact 26200, prefix 24*, range + 2427-2438, comma-separated.
  • -

    5. HA twin pair

    +

    4. HA twin pair

    A twin is a purpose-built link type for running two reflector instances as a redundant pair. Both nodes declare the @@ -594,11 +643,101 @@ 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 +member of a national trunk topology (§2), or the parent of a club +satellite (§3). Don't reach for twins just to share traffic across two boxes — that's what plain trunks are for.

    +
    +

    Overlay: local aliases

    + +

    Not a topology shape but an overlay that composes with all five: a way to +make an existing short local TG reachable from the mesh +without renumbering it on the clients. Routing follows the number, so a TG +matching no configured prefix has no owner and stays local-only +— yet a club or legacy talk group like 8 is exactly the kind +of number operators have in their muscle memory and their node configs. +LOCAL_ALIASES (in [GLOBAL]) resolves the tension by +re-homing the short TG under one of the reflector's own +prefixes, giving it a globally-unique number while local users keep dialing the +short one — e.g. LOCAL_ALIASES=8:2220008 alongside +LOCAL_PREFIX=222 on IT 222.

    + +
    + Local alias — short TG 8 re-homed as 2220008 +
    Diagram 6 — IT 222 re-homes its local TG 8 as + 2220008. Foreign peers route the long number by ordinary + longest-prefix-match; IT translates at the trunk boundary and its own nodes + keep selecting 8.
    +
    + +

    Syntax and direction

    +

    Comma-separated entries of the form localTG:aliasTG[/dir], +where dir is in or out; omitted means +two-way.

    +
      +
    • two-way (8:2220008): local talk on + 8 is exported to the mesh as 2220008, and mesh + traffic on 2220008 is delivered to local clients as + 8.
    • +
    • /out (90:2220090/out): + publish-only — local talk is exported, inbound mesh traffic is not + folded back onto the short number.
    • +
    • /in (91:2220091/in): + listen-only — mesh traffic is delivered locally, the short number + is never exported.
    • +
    + +

    Ownership rule

    +

    aliasTG must fall under one of this reflector's +LOCAL_PREFIX values, checked with the same longest-prefix match +used for TG ownership everywhere else. An entry whose aliasTG is +not owned is rejected at config load — logged as an error and skipped, +while the reflector still starts and the remaining valid entries take effect. +A reflector can therefore never alias its way onto a number another peer owns: +you may only re-home a TG into space you already own.

    + +

    Routing on the long number, delivery on the short one

    +

    The alias is a translation applied at the trunk boundary, +not a rename. Prefix routing, owner-relay fanout and peer-interest bookkeeping +all run on the long number, because that is the identity the rest of the mesh +matches prefixes against. Local delivery and talker arbitration run on the +short number, because that is what local clients selected. Everything on the +local side of the boundary — clients and satellites alike — sees +8; everything across a trunk sees 2220008. A client +that dials the long number directly is folded onto the short one the moment it +selects or monitors the TG (rewrite-on-select), so the two are always +one conversation locally.

    + +

    Flow

    +
      +
    • An SE client keys 2220008: SE's prefix + table matches 222 → IT, so the audio crosses the trunk + to IT exactly like any other owned TG. IT translates at the boundary and + delivers it to its local nodes on TG 8.
    • +
    • An IT client keys 8: IT exports it to the + mesh as 2220008, reaching peers that have registered + interest in that TG. Locally it is an ordinary TG 8 + transmission.
    • +
    + +

    Because aliasTG must be owned locally, each reflector aliases +into its own prefix space: in §2 an Italian Zone re-homes its club TGs +under its Zone prefix (2222… for Z2) while IT 222 re-homes under +222…. In a twin pair (§4), give both twins +identical LOCAL_ALIASES — each twin independently applies the +translation on its own trunk sections.

    + +
    + Aliases are not cluster TGs + CLUSTER_TGS broadcasts an unowned TG to every peer + regardless of prefix. LOCAL_ALIASES does the opposite: it pulls + an unowned short number into your owned prefix space so that ordinary + longest-prefix-match routing takes over. Reach for an alias when the TG + belongs to you; reach for a cluster TG when it belongs to everyone. +
    +
    +

    Picking a topology

    @@ -607,18 +746,21 @@ what plain trunks are for.

    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) + National trunk topology, full mesh (§2) + Zones own their prefixes but sit behind NAT, or you want one simple uplink per Zone instead of a full mesh + National trunk topology, sub-trunk star (§2) §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) + Satellite under a regional reflector (§3) HA failover for SvxLink clients on a single site (two boxes, same LAN) - Twin pair (§5) — composes with §1–§4 + Twin pair (§4) — composes with §1–§3 + An existing short local TG (e.g. 8) must stay dialable locally but become reachable across the mesh + LOCAL_ALIASES overlay — 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.

    +

    The shapes compose: the international layer (§1) is always present, and §2 +and §3 are ways to fan out inside a country. §4 is orthogonal — any +single reflector role above can be played by a twin pair instead, and the +LOCAL_ALIASES overlay applies to any of them.

    Appendix: MCC ranges and cluster-TG numbering

    @@ -684,14 +826,21 @@ the 100–199 / 800–999 rule.

    22210→222, 26201→262, when those country prefixes are owned). A TG matching no configured prefix has no owner and stays local-only — - it relays among the originating reflector's own nodes but is never trunked. + it relays among the originating reflector's own nodes but is never trunked + — unless a link carries ROUTABLE_PREFIXES=*, whose default + route forwards it to the uplink, where the peer drops it as unowned. Local TG numbering is the operator's choice; only numbers under the agreed - prefix scheme are reachable across the mesh. + prefix scheme are reachable across the mesh. A local-only number can be + given mesh reach without renumbering the clients, via the + LOCAL_ALIASES overlay. +
  • Aliases translate at the trunk boundary only: the mesh routes the long + owned number, local clients and satellites see the short one.
  • 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.
  • + 10-minute idle window. Interest is registered when a peer first + transmits on a TG, or proactively when it advertises a selected / + monitored TG via MsgPeerTgInterest.
  • Source-side exclusion in the owner's fanout prevents echo loops.
  • SATELLITE_FILTER is bidirectional and advertised to the parent.