-
Notifications
You must be signed in to change notification settings - Fork 384
Description
Summary
Currently, the Swarm overlay places disproportionate structural load on inbound-reachable (publicly connectable) nodes to maintain topology health and indirectly connect NATed peers.
Introducing libp2p DCUtR (Direct Connection Upgrade through Relay) would allow two initially non-reachable Bee nodes to upgrade from relayed to direct connections when possible, reducing long-term reliance on public nodes and improving stability, performance, and fairness of the network.
Motivation
Swarm functions with outbound-only nodes, but this leads to:
- reduced connectivity entropy, lower peer diversity,
- traffic concentration on reachable nodes, causing higher impact from churn.
- pull syncing practically requires at least one reachable anchor node in a neighborhood; DCUtR can release this requirement by enabling unreachable peers at the same depth to connect directly.
DCUtR does not eliminate the need for reachable nodes, but reduces the network's structural burden by shortening relay lifetimes and creating more direct peer edges.
For users:
- More effective peer connectivity → more routing paths → higher chance of finding a fast, available responder
- Less jitter and improved latency → More predictable UX under load (e.g. less fluctuation in stream consumption.)
For node operators:
- Better discoverability despite NAT → more opportunities to serve bandwidth
- Improved pull-sync robustness → lower hardware and bandwidth requirements
- More stable peer sets even without a public IP
- Relayers economically compensated via SWAP for negotiation traffic
For the network:
- More evenly distributed connectivity graph
- Reduced dependency on a small subset of public nodes → improved resilience to churn and localized failures
- Better long-term scalability of topology maintenance
Implementation
Use existing peer connections as temporary relays for DCUtR signaling. Attempt direct connection upgrade after direct connection failure.
-
SWAP accounting
- Relay-forwarded DCUtR signaling traffic must be accounted
- Relayers should be compensated for bandwidth used during negotiation
-
Fallback behavior
- Attempt DCUtR after direct connection failure.
- Use existing inbound-reachable peer connections as temporary relays for DCUtR signaling. If the target node is not connected to any of the reachable peers then log this out.
-
Topology changes
- Re-evaluate restrictions that discourage storage or forwarding on non-reachable nodes, e.g.: in kademlia or push syncing
-
Testing requirements
- test environment under partial DCUtR success with no reachable node in one neighborhood
- topology stability tests (with measuring tail latency under high concurrency)
- pull-syncing, retrieval and upload correctness
- relay accounting correctness
Drawbacks
-
Not a universal solution
- DCUtR does not work reliably with:
- symmetric NATs
- multi-layer NAT / CGNAT
- relayer located behind the same NAT as one peer
- DCUtR does not work reliably with:
-
Added complexity
- Increased complexity in p2p, accounting, and topology subsystems
- Harder to reason about emergent connectivity behavior
-
No benefit for browser clients
- Browsers cannot open raw TCP/QUIC sockets
- DCUtR does not improve browser connectivity
-
Reachable nodes still necessary
- Bootstrapping
- Browser access
- Even DCUtR requires that for initiating connections
- However, it reduces pressure on them and require less from them.