Add TURN architecture documentation
This commit is contained in:
parent
59d24d2c28
commit
235064cbf2
22
docs/architecture/data_flow.md
Normal file
22
docs/architecture/data_flow.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Packet Flow & Allocation Handling
|
||||
|
||||
## Komponenten
|
||||
- **UDP Listener** (`udp_reader_loop`): Empfängt STUN/TURN Nachrichten auf `bind` Adresse.
|
||||
- **AllocationManager**: Verwaltet Relay-Sockets je Client (`allocate_for`).
|
||||
- **TLS Listener** (`tls::serve_tls`): Optional, Wrappt dieselbe Logik über TCP/TLS.
|
||||
|
||||
## Ablauf (UDP)
|
||||
1. `UdpSocket::recv_from` liest Paket, `parse_message` prüft STUN-Header.
|
||||
2. Enthält `MESSAGE-INTEGRITY` → Username wird aus CredentialStore geladen und verifiziert.
|
||||
3. Bei `ALLOCATE` → `AllocationManager` erstellt Relay-Port, sendet `XOR-RELAYED-ADDRESS` zurück.
|
||||
4. Ohne gültige Credentials → Antwort `401 Unauthorized` mit `NONCE`.
|
||||
|
||||
## Ablauf (Relay)
|
||||
- Für jedes Allocation wird ein Task gespawnt, der Pakete vom Relay-Socket liest und sie zurück zum Client sendet.
|
||||
- TODO: Channel-Bindings und PeerData-Handling implementieren.
|
||||
|
||||
## TODOs
|
||||
- Allocation Timeout & Refresh Requests.
|
||||
- Permission Handling (CreatePermission).
|
||||
- Bandbreitenlimits, Statistik (Prometheus).
|
||||
- Shared Secret Mechanismus für Long-Term Credentials (RFC 5389/5766).
|
||||
29
docs/config/runtime.md
Normal file
29
docs/config/runtime.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Runtime Configuration
|
||||
|
||||
## Dateien
|
||||
- `appsettings.example.json`: Beispiel mit Server-Bind und Test-Credentials.
|
||||
- `appsettings.json`: Produktiverstellung (bind, TLS, Credentials).
|
||||
|
||||
## Struktur
|
||||
```
|
||||
Config {
|
||||
server: ServerOptions {
|
||||
bind: String,
|
||||
tls_cert: Option<String>,
|
||||
tls_key: Option<String>,
|
||||
},
|
||||
credentials: Vec<CredentialEntry> {
|
||||
username: String,
|
||||
password: String,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Default-Fallbacks (siehe `main.rs`)
|
||||
- Bind: `0.0.0.0:3478`
|
||||
- Single Test Credential: `testuser` / `secretpassword`
|
||||
|
||||
## TODOs
|
||||
- Shared Secret / REST API zur Credential-Verwaltung.
|
||||
- Konfigurierbare TLS-Bind-Adresse (`turns` Standard 5349).
|
||||
- Health-Port (HTTP) für Monitoring.
|
||||
11
docs/index.md
Normal file
11
docs/index.md
Normal file
@ -0,0 +1,11 @@
|
||||
# niom-turn Docs
|
||||
|
||||
Dokumentationsübersicht für den TURN/STUN-Server.
|
||||
|
||||
- [`architecture/data_flow.md`](architecture/data_flow.md) – UDP/TLS-Loop, Allocation Manager.
|
||||
- [`config/runtime.md`](config/runtime.md) – Appsettings & Credentials.
|
||||
- Bereits vorhanden: `deploy_tls_lxc.md`, RFC-Referenzen (STUN/TURN Specs).
|
||||
|
||||
## Zielsetzung
|
||||
- Production-ready TURN mit Authentifizierung, Lebenszeitverwaltung und Monitoring.
|
||||
- Optionales TLS (TURN over TLS) für restriktive Netzwerke.
|
||||
Loading…
x
Reference in New Issue
Block a user