vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
249 stars 54 forks source link

WebRTC transport support #698

Open Menduist opened 2 years ago

Menduist commented 2 years ago

Issue to track what's needed to support the WebRTC transport (aka libp2p-webrtc-direct)

Transport protocols

The WebRTC stack:

RTCPeerConnection DataChannel
SRTP SCTP
DTLS DTLS
UDP UDP

My understanding is that we only need DataChannel for the transport to work properly. UDP: already implemented in chronos DTLS: BearSSL doesn't implement it yet. Track progress here. After it's done (or maybe we can hack it together), chronos implementation should be relatively trivial (~300 LoC) SCTP over DTLS: need a user-space library (linux has a native implem of SCTP over IP or UDP, not over DTLS). Complexity: probably similar to Quic DataChannel: Should be pretty straightforward (~200 LoC)

Overall, probably >3 months of work.

Repo: https://github.com/status-im/nim-webrtc

mxinden commented 2 years ago

(aka libp2p-webrtc-direct)

Note that webrtc direct will likely not be promoted to the general libp2p WebRTC protocol, given that it requires a previous WebSocket connection to exchange the SDP.

The goal of the upcoming design (https://github.com/libp2p/specs/issues/220) is to not require a previous exchange.

Happy to expand on this in case you are planning on working on this any time soon.

lchenut commented 2 years ago

We dig a bit on the SCTP part with @Menduist lately, here what we found:

As for the full webrtc stack, only two were satisfying, the google one in C++ and the pion one in Go. I'm not sure if we can use those directly though.

lchenut commented 1 year ago

A quick overview of what was done since last update.

Some DataChannel relevant links: