-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use udp instead of tcp in multiaddress #353
Comments
We do not currently have any UDP based transports. We are working on adding QUIC support but QUIC multiaddrs will have the form FYI, we do have several NAT traversal mechanisms and are working on more.
|
Any plans to start supporting UDP? |
I'm lacking the history context here, but adding raw UDP support (no QUIC) would involve creating a "glue" @Stebalien – would love your 2 cents here. |
So, there are two parts to this:
However, we still have to think carefully about the abstractions involved. |
@Stebalien thanks for the clarification! 👍 Regarding (1), I found the multigram proposal which is intended as the multistream counterpart for datagram sockets. About (2), I'm not sure I follow. Wouldn't multistream negotiations and SecIO behave well on top of a message-oriented transport? After all they use varint-delimited writes. If the application guarantees that all its messages are below ~64kb in length (after encapsulating in multiplexer, etc... length for UDP datagrams), wouldn't we be able to use datagrams straightaway? (leaving aside the fact that the stream nomenclature might be a misnomer) ^^ that is assuming that |
Actually, I’m thinking that application would need a way to declare to libp2p that it can live without a reliable transport, which would unlock the usage of UDP if we had no other transports for the peer. Not sure how worthwhile an investment this would be in the advent of QUIC, though. @bkolad – would you guys like to serve as an early adopter of QUIC? It’s in experimental stages. |
@raulk - yes we can check out QUIC, thx for the suggestion. |
Sort of. The minimum MTU is actually quite a bit smaller than 64Kib (really, you can only expect ~1KiB`). However, SECIO itself expects a stream transport. That is, it won't work properly unless the underlying transport delivers packets in-order. Basically, (2) is:
Also note: Multistream won't work by itself as we'll get out-of-order and duplicate messages.
IMO, this is quite useful. For example, many DHT operations don't really care about trying again. However, yes, we'd need to expose this to the application. My thinking is that the user would call
However, the second is mitigated by QUIC's session resumption. The current plan is to (eventually) store these session tickets in the peerstore. As long as we don't get too much DHT churn, DHT requests should usually take one RTT. |
Google performed some measurements for this, and they concluded that 1370 bytes is safe for IPv4 UDP packets (which is the value Chrome now uses for QUIC packets).
There's currently a QUIC extension being defined that allows unreliable messages. We'd still have to do the handshake (we need that if we want to encrypt stuff anyway, unless we want to do some asymmetric crypto). |
@raulk & @Stebalien we are using "go get", any plans to fix go-libp2p-quic-transport with go-get? |
This is unfortunately due to the fact that the QUIC protocol is not stable yet, and quic-go therefore doesn’t expose any stable QUIC version numbers. Please see https://github.com/lucas-clemente/quic-go for more details. Once the QUIC protocol (and the implementation) become stable, it will be possible to install and use via go get. |
This would be so awesome...
What if we used a fork of quic-go for now, or something like that. It would be really nice to be able to use the QUIC transport without gx. |
We can use plain old dependency vendoring here. I opened libp2p/go-libp2p-quic-transport#41. |
(closing because this is more of a discussion and isn't worth tracking) |
I'm studying this example and try to make it fit my own project.
In my project, there are several NAT devices between the proxy server and the proxy client. So I need to do a NAT traverse to make them connected.
I choose to use the UDP punching hole to do the NAT traverse. Thus I need to set udp instead tcp in the multiaddress like this:
Changed:
To:
However, After I run the program, I get error like this:
So I just want to if I did something wrong here or udp is just not supported by the library right now for transport protocol?
Thank you. Hope I make myself clear on this.
The text was updated successfully, but these errors were encountered: