From dda6ac553129bd1cf7d629b2ad1a172b8f9dd4e1 Mon Sep 17 00:00:00 2001 From: Audric Date: Tue, 24 Mar 2026 16:59:42 +0100 Subject: [PATCH] docs: clarify cluster TG subscription model and satellite TG filtering Cluster TGs are a per-reflector subscription choice, not a mesh-wide requirement. Document that satellites forward all TGs unconditionally with no prefix or cluster TG filtering. --- README.md | 25 +++++++++++++---- docs/DESIGN_SATELLITE_AND_CLUSTER.md | 17 +++++++++--- docs/TRUNK_PROTOCOL.md | 40 ++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c2c3e3d..5154a1d 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,17 @@ transmission on a cluster TG and all other reflectors in the mesh will hear it. CLUSTER_TGS=222,2221,91 # comma-separated list of cluster TG numbers ``` -All reflectors in the mesh should list the same cluster TGs. Cluster TG numbers -must not overlap with any `LOCAL_PREFIX` or `REMOTE_PREFIX`. +Each reflector owner chooses which cluster TGs to subscribe to. A reflector only +sends and accepts traffic for cluster TGs listed in its own `CLUSTER_TGS`. If +reflector A subscribes to TG 222 but reflector B does not, A will send TG 222 +traffic to B, but B will ignore it — this is normal operation, not a +misconfiguration. Only reflectors that both subscribe to a given cluster TG will +exchange audio for it. + +Cluster TG numbers must not overlap with any `LOCAL_PREFIX` or `REMOTE_PREFIX`. + +**Note:** Satellite links are unaffected by cluster TG configuration — they +forward all TGs unconditionally (see [Satellite reflectors](#satellite-reflectors)). ### 3. Add a trunk section per peer @@ -241,9 +250,15 @@ SATELLITE_SECRET=regional_satellite_secret SATELLITE_ID=my-satellite ``` -A satellite does not set `LOCAL_PREFIX`, `REMOTE_PREFIX`, or any `[TRUNK_x]` -sections. It inherits its parent's identity. Remote reflectors in the mesh see -satellite clients as if they were connected directly to the parent. +A satellite does not set `LOCAL_PREFIX`, `REMOTE_PREFIX`, `CLUSTER_TGS`, or any +`[TRUNK_x]` sections. It inherits its parent's identity. Remote reflectors in +the mesh see satellite clients as if they were connected directly to the parent. + +**No TG filtering:** Unlike trunk links (which filter by prefix and cluster TG), +satellite links forward **all** audio and talker signaling in both directions +without any TG filtering. The satellite is a transparent relay — every TG active +on the parent is heard on the satellite and vice versa, regardless of +`CLUSTER_TGS` or prefix configuration. Port `5303` is the default satellite port (separate from client port `5300` and trunk port `5302`). diff --git a/docs/DESIGN_SATELLITE_AND_CLUSTER.md b/docs/DESIGN_SATELLITE_AND_CLUSTER.md index f01bae3..b444b74 100644 --- a/docs/DESIGN_SATELLITE_AND_CLUSTER.md +++ b/docs/DESIGN_SATELLITE_AND_CLUSTER.md @@ -80,10 +80,11 @@ Similar to `TrunkLink` but with different semantics: | Aspect | TrunkLink (peer-to-peer) | SatelliteLink | |--------|-------------------------|---------------| | Topology | Symmetric mesh peers | Asymmetric — parent is authority | -| TG routing | Prefix-based (`isSharedTG`) | **All TGs** — satellite proxies everything | +| TG routing | Prefix-based (`isSharedTG`) + cluster (`isClusterTG`) | **No filtering** — all TGs forwarded unconditionally | | Talker arbitration | Nonce tie-break | Parent always wins | | Who initiates | Both sides connect to each other | Satellite connects to parent | -| Audio path | Only shared-prefix TGs | All TGs active on either side | +| Audio path | Only prefix-matched + cluster TGs | All TGs active on either side | +| `CLUSTER_TGS` config needed | Yes, must match on both sides | Not required | #### Parent-side changes (`Reflector.cpp`) @@ -203,8 +204,16 @@ LOCAL_PREFIX=01 CLUSTER_TGS=222,2221,2222,91 ``` -All reflectors in the mesh must list the same cluster TG set. A TG number -cannot be both a cluster TG and match a `LOCAL_PREFIX`/`REMOTE_PREFIX`. +Each reflector owner chooses which cluster TGs to subscribe to. The cluster TG +check is applied independently on both the sending and receiving side of each +trunk link. If a cluster TG is declared on one side but not the other, the +receiving side silently ignores the traffic — this is normal operation, not a +misconfiguration. Only reflectors that both subscribe to a given cluster TG will +exchange audio for it. A TG number cannot be both a cluster TG and match a +`LOCAL_PREFIX`/`REMOTE_PREFIX`. + +**Note:** Satellite links are not affected by `CLUSTER_TGS` — they forward all +TGs unconditionally regardless of configuration. ### Implementation diff --git a/docs/TRUNK_PROTOCOL.md b/docs/TRUNK_PROTOCOL.md index 97562fa..7d41ec5 100644 --- a/docs/TRUNK_PROTOCOL.md +++ b/docs/TRUNK_PROTOCOL.md @@ -65,6 +65,46 @@ at reflector B and carries only TGs whose decimal string starts with B's prefix (`REMOTE_PREFIX`). No multi-hop routing is needed because every pair has a direct trunk. +### Cluster TGs + +Cluster TGs bypass prefix routing entirely. A TG listed in `CLUSTER_TGS` is +forwarded to **all** trunk peers regardless of `LOCAL_PREFIX` or `REMOTE_PREFIX`. +The routing decision in `TrunkLink` is: + +``` +if isClusterTG(tg) → forward (regardless of prefix) +else if isSharedTG(tg) → forward (prefix match) +else → drop silently +``` + +This check is applied **independently on both sides** of each trunk link: + +- **Sending side:** `TrunkLink::onLocalTalkerStart`, `onLocalAudio`, and + `onLocalFlush` check `isSharedTG(tg) || isClusterTG(tg)` before sending. +- **Receiving side:** `TrunkLink::handleMsgTrunkTalkerStart`, + `handleMsgTrunkAudio`, and `handleMsgTrunkFlush` perform the same check + before accepting. + +Each reflector owner chooses which cluster TGs to subscribe to. A reflector +only sends and accepts traffic for cluster TGs listed in its own `CLUSTER_TGS`. +If a cluster TG is declared on the sending reflector but not the receiving one, +the receiving side silently ignores the traffic — this is normal operation, not +a misconfiguration. Only reflectors that both subscribe to a given cluster TG +will exchange audio for it. + +### Satellite Links — No TG Filtering + +Satellite links (`SatelliteClient` / `SatelliteLink`) do **not** apply any TG +filtering. All talker signaling and audio is forwarded unconditionally in both +directions: + +| Aspect | Trunk link | Satellite link | +|--------|-----------|----------------| +| Prefix filtering (`isSharedTG`) | Yes | No | +| Cluster filtering (`isClusterTG`) | Yes | No | +| What is forwarded | Only prefix-matched + cluster TGs | All TGs | +| `CLUSTER_TGS` config needed | Yes, on both sides | No | + --- ## Connection and Handshake