Proposal: SDR (Steam Datagram Relay) as optional transport backend for CGNAT traversal #762
Replies: 2 comments 2 replies
-
|
LGTM, I think that accurately surmises the conversation that was had on discord |
Beta Was this translation helpful? Give feedback.
-
I am fairly certain on my Mirror Branch that I did test SDR and that it established fine without any changes needed on the partner dashboard, but definitely worth doing a PoC again anyway to confirm 100%. I believe the only thing we'd need partner access for is doing stuff with Rich Presence as it requires the status strings be set on the Steam backend Also I'd say there's a chance we can get the devs to make changes on the backend if we needed them to, not guaranteed but backend changes being needed doesn't necessarily mean it's a dead end either |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Players behind CGNAT (Carrier-Grade NAT) cannot port forward and have no direct path to host or join games without third-party tunneling (Ngrok, VPN, playit.gg). This affects:
STUN (hole-punching) does not solve this. Behind CGNAT with symmetric NAT, every outbound connection gets a different external port mapping, making the mapping STUN discovers useless for a different peer. The only solutions are relay-based: TURN, tunneling, or SDR.
Currently, users must set up Ngrok, a VPN (Hamachi, ZeroTier, Radmin), or playit.gg. This works but adds friction — people just want to play DSP with their friends, not debug networking infrastructure.
Proposal: Add SDR as an Optional Transport Backend
Add Steam Datagram Relay (SDR) support alongside the existing WebSocket transport using a backend selection system. This was discussed among contributors and the following principles were agreed on:
Terminology
ISteamNetworkingSockets) — the Steamworks proprietary build of GNSGNS is the transport. SDR is the relay. You can use GNS without SDR, and SDR requires Steam.
Architecture
SDR Tunnel Approach
Rather than replacing WebSocket with SNS directly as a transport (which had fragmentation issues with large game state packets in past testing), SDR acts as a raw byte tunnel underneath WebSocket:
WebSocket handles fragmentation and reliability as it does today. SDR only sees small TCP stream chunks (~1KB). The previous fragmentation problems with large factory/Dyson sphere/game state transfers are avoided because TCP segments them before they reach SDR.
Zero changes to packet processors, serialization, or game sync code. The tunnel is a self-contained component.
Connection Scenarios
Backend Detection
User-facing settings:
Prior Art & Context
Previous Transport Investigations
Relevant earlier discussion: How do we handle transferring large amounts of data? — the core tension between TCP reliability for large transfers and UDP performance for gameplay has been a known issue since early development.
Why Not Just STUN/TURN?
SDR Authentication
From the Steamworks SDR docs: the game coordinator / auth server requirements apply to dedicated servers and non-Steam players. For Steam-to-Steam P2P:
No auth server or game coordinator is needed for the P2P path between two Steam users.
Open Questions
1. Does SDR relay activate for DSP's AppID?
SDR relay may require the game's AppID (1366540) to be configured in the Steamworks partner backend. We don't have partner access. This needs to be validated with a PoC before committing to the full implementation.
Proposed PoC: Minimal BepInEx plugin that creates a
SteamNetworkingSocketsP2P connection between two machines behind NAT, tunnels a TCP echo server through it. If relay activates, the approach works.2.
InitRelayNetworkAccess()in BepInEx contextNeeds testing to confirm it works from a mod where
SteamAPI_Init()was already called by the game.3. Future: GNS/LNL as direct transport replacement
Both GNS and LNL have evolved since they were last evaluated. A direct UDP transport (not tunneled) would improve performance but requires:
This is a separate investigation from the SDR tunnel work and can happen in parallel.
4. Non-Steam relay options
For Game Pass/WeGame users who need relay:
Proposed Implementation Phases
Phase 1: PoC — Validate SDR relay works for DSP's AppID with a minimal TCP ↔ SNS bridge between two CGNAT'd machines
Phase 2: Backend selection — Transport abstraction, platform detection, settings UI, status in
/infoPhase 3: Integration — Wire SDR tunnel into host/join flow, Steam ID based joining, fallback handling, logging
Phase 4: Future transport investigation (separate track) — Re-evaluate LNL/GNS as direct transports, application-level chunking for bulk transfers, non-Steam relay options
References
Beta Was this translation helpful? Give feedback.
All reactions