Live data from Hacker News

Ask HN: Why is there no P2P streaming protocol like BitTorrent?

news.ycombinator.com

81–90 of 231 posts

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#81
You need good latency for streaming, torrents can get to a decent speed but the latency will always be bad.

Modern streaming protocols sometimes go to absurd lengths to avoid too many hops so you get the data as soon as possible... torrent has so many jumps and negotiations to get to the actual file. It's good for decentralization but decentralization and efficiency go against each other.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#82
post #62

Part of the reason bit torrent works really well is that the file is downloaded in random order. It lets everyone cooperate, while still being robust to bad peers, bad network connections, churn etc. If you want live high quality streaming, a lot of reasons bit torrent works so well goes away. Latency matters. In bit torrent if the peer goes away, no big deal, just try again in 5 minutes with another peer, you are do…

I am not convinced about the random order stuff. If most people will stream from the start then the start will be more seeded? So it's all good. And the order is requested by the client, and there are clients that go in the sequential order, like Deluge

The benefit of a random order is that it forces you to actually keep all the packets, which makes upload more likely. Streaming lets you get away with not storing the whole file, which makes bad actors more likely.

And, sure, some BT clients can stream the data, but what the default is makes a huge difference.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#83
post #64
post #61

There is peertube and webtorrent, but they does not seem to catch the mainstream users. In my opinion, NAT and the extensive tracking that has led users to distrust sharing their IP addresses are the reasons why it hasn't caught on. Imagine YouTube using P2P technology, it would save lot of money spent on caching servers.

Peertube and web torrent aren't doing live streams as far as i know, just stream of pre-recorded video, which is still a lot harder for p2p than random order download, but not in the same ballpark as a livestream. > Imagine YouTube using P2P technology, it would save lot of money spent on caching servers. I think its money well spent.

Peertube supports live streams https://framablog.org/2021/01/07/peertube-v3-its-a-live-a-li...

There is a lag between the source and the audience, maybe it's been improved in the last 4 years though, not sure.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#84
post #2

People have tried to build BitTorrent clients to do this. As far as I know they never took off. The primary problem is you oftentimes don't get people who want to share back or who have firewalls or other connections that don't allow them to share back. So you end up with a few people who end up seeding everything out. The second problem is in order to watch a streaming protocol things need to arrive in order. It is…

Popcorn Time did this and it worked great. Starting a torrent wasn't instant, but once a buffer was built up, it streamed just fine.

Popcorn Time got taken down pretty hard because they became too popular too fast.

A commercial solution could have a seed server optimized for streaming the initial segments of video files to kickstart the stream, and let basic torrents deal with the rest of the stream.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#85
I am a contributor to Iroh ( https://github.com/n0-computer/iroh ), an open source library for direct QUIC connections between devices that can be behind a NAT.

Our library is general purpose and can be used whenever you need direct connections, but on top of Iroh we also provide iroh-blobs, which provides BLAKE3 verified streaming over our QUIC connections.

Blobs currently is a library that provides low level primitives and point to point streaming (see e.g. https://www.iroh.computer/sendme as an example/demo )

We are currently working on extending blobs to also allow easy concurrent downloading from multiple providers. We will also provide pluggable content discovery mechanisms as well as a lightweight content tracker implementation.

There is an experimental tracker here: https://github.com/n0-computer/iroh-experiments/tree/main/co...

Due to the properties of the BLAKE3 tree hash you can start sharing content even before you have completely downloaded it, so blobs is very well suited to the use case described above.

We already did a few explorations regarding media streaming over iroh connections, see for example https://www.youtube.com/watch?v=K3qqyu1mmGQ .

The big advantage of iroh over bittorrent is that content can be shared efficiently from even behind routers that don't allow manual or automatic port mapping, such as many carrier grade NAT setups.

Another advantage that BLAKE3 has over the bittorrent protocol is that content is verified incrementally. If somebody sends you wrong data you will notice after at most ~16 KiB. Bittorrent has something similar in the form of piece hashes, but those are more coarse grained. Also, BLAKE3 is extremely fast due to a very SIMD friendly design.

We are big fans of bittorrent and actually use parts of bittorrent, the mainline DHT, for our node discovery.

Here is a talk from last year explaining how iroh works in detail: https://www.youtube.com/watch?v=uj-7Y_7p4Dg , also briefly covering the blobs protocol.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#86
post #76

Earlier quoted context omitted.

This is still just streaming a static file though. Adjusting which segment to get will work, buffering will work, and people don't mind their movie starting a few seconds after they press play. If I'm streaming live, I need the frame immediately, and it doesn't help much to get later frames after the frame I'm missing.

what if everyone agrees on a 10s delay?

The issue is everyone is watching the same part of the file at the same time. Offsetting by 10 seconds does not change that.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#87
post #62

Part of the reason bit torrent works really well is that the file is downloaded in random order. It lets everyone cooperate, while still being robust to bad peers, bad network connections, churn etc. If you want live high quality streaming, a lot of reasons bit torrent works so well goes away. Latency matters. In bit torrent if the peer goes away, no big deal, just try again in 5 minutes with another peer, you are do…

I am not convinced about the random order stuff. If most people will stream from the start then the start will be more seeded? So it's all good. And the order is requested by the client, and there are clients that go in the sequential order, like Deluge

If we are talking about a live stream (and not a stream of a static file), having the start be more seeded is useless.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#88
post #76

Earlier quoted context omitted.

This is still just streaming a static file though. Adjusting which segment to get will work, buffering will work, and people don't mind their movie starting a few seconds after they press play. If I'm streaming live, I need the frame immediately, and it doesn't help much to get later frames after the frame I'm missing.

what if everyone agrees on a 10s delay?

For pseudo-live streams such as sports events, that would be totally fine. People can have slightly out of sync streams, delayed by various amounts.

But you can't live stream a conversation with someone if you have a 10s delay.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#89

The only way this will be possible is if there is widespread adoption of an Internet overlay network similar to Tailscale in its design. Fortunately or unfortunately depending on how you look at it Tailscale is limited to Layer 3 so Multicast doesn't work (it depends on IGMP to function correctly).

Why Tailscale? Are you aware of IPv6?

AFAIK IPv6 multicast across the internet is pretty much dead. ISPs seem to block it because of its DDoS potential. They use it themselves of course (very useful for streaming live TV across their private VLANs) but as an outsider you'll have to convince every ISP and backbone provider to trust your multicast stream, which they probably won't.

Tailscale (or any other P2P overlay network) could solve this problem by re-enabling the multicast support that most ISPs block. It's not a terrible idea.

Edit: a comment elsewhere linked https://www.librecast.net/librecast.html which seems to be doing exactly this.

Re: Ask HN: Why is there no P2P streaming protocol like BitTorrent?

#90
post #83
post #64

Earlier quoted context omitted.

Peertube and web torrent aren't doing live streams as far as i know, just stream of pre-recorded video, which is still a lot harder for p2p than random order download, but not in the same ballpark as a livestream. > Imagine YouTube using P2P technology, it would save lot of money spent on caching servers. I think its money well spent.

Peertube supports live streams https://framablog.org/2021/01/07/peertube-v3-its-a-live-a-li... There is a lag between the source and the audience, maybe it's been improved in the last 4 years though, not sure.

Hmm interesting i didn't know that.

I couldn't find much docs on how it works, just https://docs.joinpeertube.org/contribute/architecture#live

Sounds like they break the stream into very small segments and publish each of those with bit torrent (?), they seem to claim about 30 second delay and scale in the hundreds but not thousands. Certainly impressive if true, i wouldnt of thought such an approach would scale so well. Of course its still a far cry from twitch, but nonetheless impressive.

Post reply on HN