dcutr/quic: prepare own router with low TTL packet first
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1.8k
- Forks
- 320
- Avg merge
- 11d 15h
- Merged PRs (30d)
- 1
Description
Thanks to a friendly exchange at FOSDEM '23, we were pointed to this p2p crate. This crate specifically implements NAT hole punching techniques and I believe we could draw some inspiration from them.
Especially the TTL approach sounds interesting. Their documentation describes a scenario where it would be beneficial here: https://docs.rs/p2p/0.5.2/p2p/#endpoint-address--port-dependent-filtering-port-restricted-cone
The idea is to prepare one's own router for the remote packets by sending low TTL packets to the remote. The problem we solve here is that if our UDP packets were to reach the NAT of the remote peer before the remote peer sent packets to us, an unfriendly NAT/router could denylist us for some time.
My proposal for a protocol optimization would be:
- When the first
CONNECTmessage reaches the remote peer, it starts sending UDP packets with a TTL of 3 to the addresses contained in theCONNECTmessage - When the second
CONNECTmessage reaches the local peer, it does the same until the sync timer has fired.
Why 3? The documentation of the p2p crate says: "In practice it's usually the 1st couple (or 3) routers that do NAT while others are non-NAT."
Something that would speak against this protocol optimization is the fact that hole punching is not really sensitive to timings, it seems. At least that's what our measurement campaign suggests. I'm opening this issue to also brainstorm if we could quantify the potential of this change from the data that we have gathered.
cc @mxinden
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 linked p2p crate documentation and the referenced NAT hole-punching measurement campaign. Then locate the CONNECT handling and sync timer in the implementation to assess the proposed TTL-3 packets. Done would require a decision, supported by measurements, on whether this protocol optimization is worthwhile.
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
- 25/100