What's the state of dcutr? #5910
-
Hi everybody! I was wondering if you know the state of dcutr in rust-libp2p? The reason is that it doesn't work very well for me, but I'm not sure if that's because I'm using it wrong, have bad luck with my network environments, or it really just doesn't work well. I'm aware that a few years back, there has been some effort to evaluate the performance of dcutr, for example by means of punchr. Talks I found on the Internet spoke of hole punching success rates between 90 and 60 %, depending on the network, VPN, etc. My own success rates, tested by now on three different (semi)private networks, are more in between 1 and 10 % success rates. Is that just me, or do you get similar metrics? I'm not actually doing much right now. More or less just walking the DHT, connecting to some random (10) relays, and having dcutr active, which does its thing pretty independently. Any time I do get a dcutr
(these are particularly bad) What I read from that is that the perfomance is, most interestingly, very consistent per peer. If it failed once, it'll fail again. If it's successful once, it'll be successful again (not seen in above stats but in others I got). Never have I ever had a peer fail and then succeed, or the other way around. This makes me wonder: Is there room for improvement on that protocol? Are there any plans to tackle that again? At the moment, assuming this is typical performance, it wouldn't be useful for any real world scenario at all. There also the very wide open gaping hole between the dcutr spec and this popular article on NAT traversal that seems to explain in great detail why dcutr isn't, in fact, adequate. Should I perhaps move away from dcutr and explore other options, I wonder. I haven't looked at the state of WebRTC in libp2p. Is that going to fix things, or is it a separate topic. Is direct connection between NATed peers high up on the prio list for future development at all? Really looking forward to hearing your perspectives :) |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 8 replies
-
Personally I don't really expect dcutr to work very well. I'm hoping for 10% success rate at best but I don't really have the data. I don't think WebRTC will be of any help because it still depends on the physical network, and we can't really do anything about that. Maybe with IPv6? |
Beta Was this translation helpful? Give feedback.
-
When the punchr project was first developed I ran a rust-client and had a good success rate, roughly matching what was reported in the campaign. |
Beta Was this translation helpful? Give feedback.
-
In my experience, it has been a bit of a hit or miss at times depending on the environment. In a good environment though, it was worked pretty well and had more of a success, although this was using TCP. With QUIC, I would say this can be the same but noticed some flakiness in the earlier days of quic and not sure about the success rate right now at this moment. |
Beta Was this translation helpful? Give feedback.
-
Actually, I hadn't had quic enabled, only TCP. Enabling quic raised the successrate significantly (this is from running multiple days): Total successful: 6687 So, at the moment, that's a 40% success rate per attempt and a 44% success rate per peer. Again, a little sad that this "magic" improvement happens without any prior indication that missing quic may be part of the problem. In the meantime, at least for my home network, I have figured out that it uses a "easy NAT", so no exceptional difficulties expected purely from the networking situation. I'll probably focus on local network for now to get my application logic working and then see if I find the time to get further into the dcutr debugging |
Beta Was this translation helpful? Give feedback.
-
Hi Matthias! As Elena I also run the So as to make this discussion helpful for future reference
can you elaborate on this? DCUtR was thought with the decentralized nature of libp2p in mind, as you can read more about here. But the fundamental concepts are similar to what tailscale presents on their article. @drHuangMHT can you elaborate on
why do you not expect it to work very well? And @dariusc93 can you elaborate also on
what in your usage experience is a good environment? Thank you all! |
Beta Was this translation helpful? Give feedback.
-
again, I don't think this is true. Can you elaborate on what is specifically missing?
It's the same with libp2p, it provides all the tools to do that.
you can configure that value with
can you elaborate on what were you expecting? |
Beta Was this translation helpful? Give feedback.
-
Sure, I'll cite a few things from the article which I find relevant to this discussion
And let's end with this, which is what I hope one day libp2p will provide not just for networking specialists but your general run-off-the-mill application programmer
and of course, just reading the TL;DR at the end of the article quite concisely enumerates what an "ideal" p2p application should do. I think a lot of these boxes current libp2p can't check. I do of course understand that implementing all that will be significant effort. I do understand nobody may have time or resources to tackle it. But I don't think a project like libp2p can just say "I'm happy the way I am and ignore that I could be better". People will be looking for the better and a libp2p that doesn't try being it is always going to be a candidate for replacement |
Beta Was this translation helpful? Give feedback.
Thanks for elaborating folks. As you both referred, hole punching success may be influence by the type of NAT's prevalent on a certain geographic area.
Symmetric NAT's which are a subset of endpoind dependant NAT's are described both in the libp2p blogpost:
and the hole punching paper: