How to setup DCUTR properly? #5291
shamil-gadelshin
started this conversation in
General
Replies: 2 comments 1 reply
-
@DougAnderson444 do you have any experience with the DCUTR implementation in rust-libp2p? |
Beta Was this translation helpful? Give feedback.
1 reply
-
DCUtR is handled automatically when two peers who support it connects to a common relay. However I haven't yet observed a case where the direct connection upgrade succeeded. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We're researching an option to add
DCUTR
to our network and have a couple of questions about the protocol.Do we need
port_reuse
withDCUTR
? We found this discussion:Consider only reusing TCP port when hole punching specs#389And it seems that
port_reuse
setting is not mandatory. If it is not then how src and dest peers will initiate two connections with the same ports and ip addresses (port will be random on both sides)?If
port_reuse
is necessary then how autonat will work?One of the common ways to use autonat is to request for a probe from the currently connected peers. But the new connection will fail because of the duplicate tuple of (source IP, source port, destination IP, destination port) when
port_reuse
enabled. Am I missing something here?This comment from the discussion looks like a workaround: Consider only reusing TCP port when hole punching specs#389 (comment)
However, is there a way to toggle the port reuse flag in the configured swarm?
Are there any projects that use rust version of
DCUTR
?We found this project: https://github.com/n0-computer/beetle/blob/main/iroh-p2p/src/behaviour.rs
But it is archived now and it's unknown whether its DCUTR worked in the first place (no port reuse though).
How to setup DCUTR properly?
My current understanding of the DCUTR contradicts itself:
according to the specification - peers need to simultaneously connect to each other having the identical tuple (source IP, source port, destination IP, destination port) to hole punch which is achieved using port reuse but autonat won't work in this setup because it won't create a second connection with already connected peer for a probe because of the existing tuple (src IP, src port, dest IP, dest port). I skip the relayer part in this description for simplicity. Please, point to an error in my reasoning.
Beta Was this translation helpful? Give feedback.
All reactions