dcutr: Improve VPN hole punching by subtracting default gateway RTTs from protocol RTT measurement
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1.8k
- Forks
- 320
- Avg merge
- 11d 15h
- Merged PRs (30d)
- 1
Description
As we were discussing protocol improvements in #487 I'm just leaving this here as a not fleshed-out food for thought:
Currently, the protocol has the hidden assumption that the RTT measurement from one node to the other is equivalent to the RTT between both NAT's. This assumption holds true for most home networks where the router is a millisecond away. However, for VPN'd peers it's likely not true.
Let's say A wants to hole-punch B. A opens a dcutr stream via a relaying peer R and sends the first CONNECT message. B replies with a CONNECT message - but now, this message also contains the observed RTT of B to its default gateway (which could be a VPN exit node - not sure if default gateways == VPN exit nodes). In the meantime A has also measured the RTT to its default gateway. Upon receipt of the second CONNECT message at A, A knows
- the RTT between
AandB, Band its default gateway- the RTT to its own default gateway.
A sends out the SYNC message and in the current specification A would wait 1/2 the RTT between A and B (1.). The change here would be to wait for:
1/2 RTT A to B + 1/2 RTT B to its default gateway - 1/2 RTT A to its default gateway.
I hope, I got the different RTT's right.
cc @physikerwelt
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the protocol discussion in issue #488 and the related issue #487; no file, test, or entry point is named. Clarify the RTT assumptions and scope with maintainers, then document an agreed protocol change and its completion criteria before implementation begins.
Written by the indexing model from the issue text.
Assessment
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100