libchan icon indicating copy to clipboard operation
libchan copied to clipboard

Add a transport that uses UDP or DTLS when multiplexing streams

Open Lennie opened this issue 11 years ago • 10 comments

As I wasn't at the DockerCon I haven't heard how libchan is going to be used, but if multiple streams on top of these transports is a goal I suggest adding a datagram-based transport as well.

The reason is because of head-of-line blocking.

Obviously, HTTP/2 or SPDY is already better than HTTP/1.x or something like WebSocket at dealing with multiple streams.

But at the TCP level you can still get head-of-line blocking because if packets are lost they can not be reordered.

It's similar to the TCP tunneling in TCP problem: http://sites.inka.de/~W1011/devel/tcp-tcp.html

It is also (one of ?) the reasons https://en.wikipedia.org/wiki/QUIC is being developed.

An other example WebRTC which uses DTLS ('SSL'/TLS over UDP) at the lowerlevel and SCTP as the datachannel protocol for the multiplexing.

Obviously I wouldn't suggest implementing all of WebRTC, it's a pretty big specification.

But they are just examples of current protocols that already do this.

Lennie avatar Jun 15 '14 19:06 Lennie

Totally agreed somebody should get started on a UDP based transport like QUIC.

progrium avatar Jun 23 '14 16:06 progrium

If I'm not mistake, there is only one implementation of QUIC that isn't enabled by default and no specification yet. Or at least no standardization process yet. So probably a bit early for that. :-)

But on the WebRTC datachannel front there are people (developers are CoreOS) that have already started on some code: https://github.com/coreos/go-webrtc-datachannel https://github.com/ccding/go-stun

So there was an interrest in doing that, but they stopped.

What is interresting about WebRTC is that is can do NAT traversal.

Lennie avatar Jun 23 '14 18:06 Lennie

Yes, super early. Excited about CoreOS's datachannel work. Basically, I'm looking for a mid-level transport layer for Duplex: https://github.com/progrium/duplex/

I had considered also doing an HTTP2 transport layer for it... but for simplicity, since it needs to be implemented in C very soon, I think we'll just do our simple transport protocol. In the hopes that we can use libchan or something similar when available in C. I would try to help port libchan to C but it's probably too early and there are already many dependencies that would make it difficult.

progrium avatar Jun 23 '14 18:06 progrium

I'm also happy to contribute my generic net/rpc server reflection code so that libchan can have net/rpc style interface on top of the low level req/rep API. There is a lot of overlap in all our work, so I hope we can figure out a way to collaborate and/or design them to work together. (For example, CoreOS's datachannel could be a libchan transport)

progrium avatar Jun 23 '14 18:06 progrium

There are existing SPDY/HTTP2 implementations in C like https://github.com/tatsuhiro-t/nghttp2

Lennie avatar Jun 23 '14 18:06 Lennie

Yeah, that's one of the big ones and luckily it's there. Anyway, can't wait for a port to C...

progrium avatar Jun 23 '14 18:06 progrium

+1 for QUIC. This would make libchan usable in all high-bandwidth realtime apps, and p2p. (Note that TCP has issues in exposed networks, where anybody can forge RSTs).

jbenet avatar Jul 07 '14 07:07 jbenet

If someone wants to participate in building a QUIC golang implementation then I think progress can be made on this issue. Otherwise I will close it for now and we can re-address when there is a finalized QUIC spec or golang implementation.

dmcgowan avatar Nov 01 '14 02:11 dmcgowan

What's the status of it?

sheerun avatar Jun 14 '16 20:06 sheerun

@sheerun if you know of any Go libraries implementing QUIC I would love to give it a try. Also feel free to advocate for an alternative. As it stands now most this specifications are still fluid and Go implementations are not there.

dmcgowan avatar Jun 14 '16 21:06 dmcgowan