-
Notifications
You must be signed in to change notification settings - Fork 280
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
webrtc(private-to-private): clarify interaction with DCUtR #583
Comments
Until this Chromium bug is resolved it's better for browsers to maximise use of WebRTC because the WebTransport transport can very quickly become unusable when WT sessions start to time out or otherwise error. This Firefox bug also needs to be resolved before WebTransport is usable in Firefox for our purposes at all.
There's no QUIC in node yet ref: nodejs/node#48244 so no WebTransport either - the browser would have to reverse the connection using WebSockets. The TLS part of setting up a WebSocket listener seems to be too onerous for most so for node.js at least, until QUIC arrives WebRTC might be the best option. |
Thanks @achingbrain, looks like we should trigger /webrtc dial if the peer doesn't support DCUtR.
Implemented here: libp2p/go-libp2p@6325e4e |
I guess the implication here is:
Otherwise it might end up with both peers doing nothing if they both support DCUtR but only listen on WebRTC addresses? |
Should we just ensure that the |
Do you think we might be trying to be too clever with this? If the node is instructed to dial WebRTC perhaps it should dial WebRTC, then if/when DCUtR happens, if there's a better transport to be used it could be used and then any open streams could be migrated? |
I agree. This is getting rather complicated and the better solution is to keep upgrading connections to better transports rather than dialing the best transport after looking at all possible addresses. Looking at all possible addresses is getting too involved as this issues shows. There is a proposal in go-libp2p along similar lines: libp2p/go-libp2p#2412 My present problem is probably too go-libp2p specific. If we implement webrtc as it is, it'll almost always connect on the /webrtc address rather than a /quic-v1 holepunched address. This is because, the /webrtc address is the one that's publicly advertised. The /quic-v1 address for a firewalled node needs to be obtained from DCUtR. So the dialer will proceed with establishing the webrtc connection. After the webrtc connection has been established, the dialer will not establish any new connections since it has no concept of upgrading the connection. |
On go-libp2p I've decided to holepunch using webrtc private to private when DCUtR fails. |
There's some subtle interaction involved between DCUtR and webrtc hole punching especially considering that the dialer initiates the holepunch in webrtc and the receiver initiates the hole punch on DCUtR. I'm documenting some cases here. Sorry this is not too clear right now but I'd like to get other people's inputs.
It seems to me that situation will be simplified if we let the receiver of a relayed connection dial /webrtc addresses.
@achingbrain, does the present js-libp2p implementation support this?
The text was updated successfully, but these errors were encountered: