Update docs to reflect decoupled trunk connections and implemented features

Connection handling docs still described the old priority-based tie-breaking
model removed in 3b7831c. Updated TRUNK_PROTOCOL.md, README.md to describe
the current dual-connection model (outbound preferred, inbound fallback).
Marked satellite and cluster TG features as implemented in design doc.
Added satellite files to TRUNK_PROTOCOL.md files-changed table.
This commit is contained in:
Audric committed 2026-03-28 16:01:34 +01:00
1 parent eca3c71122
commit 8cf96f9ba5
3 files changed
+25 -19

No files matched your search

+4 -3
View File
@@ -168,9 +168,10 @@ Repeat for each peer (`[TRUNK_3]`, `[TRUNK_4]`, …).
**Trunk links** require **mutual reachability**: each reflector both listens for
inbound trunk connections and connects outbound to every peer. Both sides
attempt to connect simultaneously; the first connection that authenticates
becomes the active link (duplicate connections are resolved automatically via
priority-based tie-breaking). All reflectors in the mesh need a static IP (or
attempt to connect simultaneously; outbound and inbound connections operate
independently and can both be active at the same time. When sending, the
outbound connection is preferred with inbound as fallback. All reflectors in
the mesh need a static IP (or
stable DNS name) and the trunk port (default 5302, configurable via
`TRUNK_LISTEN_PORT`) open for inbound TCP connections.
+2 -2
View File
@@ -1,7 +1,7 @@
# Design: Regional Satellites & Nationwide Cluster TGs
Two proposed extensions to GeuReflector's trunk architecture. Each can be
implemented independently.
Two extensions to GeuReflector's trunk architecture, both now fully
implemented.
---
+19 -14
View File
@@ -140,7 +140,9 @@ directions:
Each reflector both listens for inbound trunk connections on its trunk server
port (default 5302) and actively connects outbound to each configured peer.
Whichever direction succeeds first becomes the active connection for that peer.
Outbound and inbound connections operate independently and can both be active
at the same time. When sending, the outbound connection is preferred; if it is
not ready, the inbound connection is used as fallback.
### Outbound connection
@@ -167,8 +169,8 @@ The trunk server (`Reflector::m_trunk_srv`) listens on the configured
2. The server waits for a `MsgTrunkHello` frame
3. The shared secret is verified via HMAC against each configured `TrunkLink`
4. On match, the connection is handed off to the corresponding `TrunkLink`
5. The `TrunkLink` pauses its own outbound connection attempts and uses the
inbound connection
5. The `TrunkLink` stores the inbound connection alongside any existing
outbound connection
**Security hardening:**
- Pre-authentication frame size is limited to 4 KB (vs 32 KB post-auth)
@@ -178,25 +180,24 @@ The trunk server (`Reflector::m_trunk_srv`) listens on the configured
- Peer identifiers are sanitized before logging (control characters stripped,
length capped at 64)
### Connection Conflict Resolution
### Dual Connection Model
Because both sides connect outbound simultaneously, it is possible for both an
inbound and outbound connection to be active at the same time for the same peer.
When this is detected, a deterministic tie-break resolves the conflict:
Each `TrunkLink` maintains two independent connections to the peer: an outbound
connection (via `TcpPrioClient`) and an inbound connection (accepted by the
trunk server). Both can be active simultaneously. When sending messages, the
outbound connection is preferred; if it is not ready, the inbound connection is
used as fallback. Each connection has independent heartbeat timers.
- The side with the **lower** priority nonce keeps its **outbound** connection
- The side with the higher priority nonce keeps the **inbound** connection
- Both sides independently reach the same conclusion, so exactly one TCP
connection survives
This ensures convergence regardless of timing.
If a second inbound connection arrives while one is already active, the new one
is rejected. Outbound reconnection is handled automatically by
`TcpPrioClient`.
### `MsgTrunkHello` fields
- `id` — the config section name (e.g. `TRUNK_2`), used for logging
- `local_prefix` — the sender's authoritative TG prefix (e.g. `"1"`)
- `priority` — random 32-bit nonce, regenerated per connection, used for
tie-breaking (both talker arbitration and connection conflict resolution)
talker arbitration tie-breaking
- `nonce` + `digest` — HMAC authentication of the shared secret
---
@@ -438,6 +439,10 @@ REMOTE_PREFIX=2
| `src/svxlink/reflector/Reflector.cpp` | Wired trunk init, trunk server (listen + accept + auth), signals, audio relay, arbitration guard, HTTP status |
| `src/svxlink/reflector/TrunkLink.h` | **New** — `TrunkLink` class declaration |
| `src/svxlink/reflector/TrunkLink.cpp` | **New** — full trunk link implementation |
| `src/svxlink/reflector/SatelliteLink.h` | **New** — `SatelliteLink` class declaration |
| `src/svxlink/reflector/SatelliteLink.cpp` | **New** — satellite link implementation (parent side) |
| `src/svxlink/reflector/SatelliteClient.h` | **New** — `SatelliteClient` class declaration |
| `src/svxlink/reflector/SatelliteClient.cpp` | **New** — satellite client implementation (satellite side) |
| `src/svxlink/reflector/CMakeLists.txt` | Added `TrunkLink.cpp` to sources |
| `src/svxlink/reflector/svxreflector.conf.in` | Added prefix-based trunk example config |
| `src/versions` | Version bumped to `1.3.99.12+trunk1` |