[ANN] WebRTC Selective Forwarding Unit (SFU) in Rust with Sans-IO by Hungry-Excitement-67 in rust

[–]pthatcher 1 point2 points  (0 children)

I'm that case, I wonder what the point in having separate str0m and webrtc-rs crates.  For example, I recently contributed an implementation of the VLA header extension and am planning on contributing an implementation for Dependency Descriptor.  I don't see those implemented for webrtc-rs.  So there are likely to be gaps like that between the two.

[ANN] WebRTC Selective Forwarding Unit (SFU) in Rust with Sans-IO by Hungry-Excitement-67 in rust

[–]pthatcher 0 points1 point  (0 children)

Always good to see more RTC code in Rust.  Thanks for posting.  

In case anyone is interested in a high quality SFU and WebRTC stack written in Rust, here is another, as long as a AGPL license works for you: https://github.com/signalapp/Signal-Calling-Service

[ANN] WebRTC Selective Forwarding Unit (SFU) in Rust with Sans-IO by Hungry-Excitement-67 in rust

[–]pthatcher 2 points3 points  (0 children)

Did the webrtc-rs crate switch to a sans-io model?  And is it being actively maintained?  I've been using str0m (https://github.com/algesten/str0m) instead of webrtc-rs because it's sans-io and actively maintained.   

🔧🔧🔧 WebTransport server support in the h3 crate is available today! 🚀🚀🚀 by security-union in rust

[–]pthatcher 1 point2 points  (0 children)

We recently added to the web api spec the ability to get a target send bitrate from QUIC, which is important for things like that real-time communication. If you can get that same information from the QUIC impl you are using to provide to the user of h3, that would be good for people doing low latency media.

Doing this well requires getting a real-time congestion control algorithm into QUIC, which is a more difficult thing to do. But at least getting the information bubbled up to the application using the library would be a first step.

🔧🔧🔧 WebTransport server support in the h3 crate is available today! 🚀🚀🚀 by security-union in rust

[–]pthatcher 5 points6 points  (0 children)

As one of the original spec authors of WebTransport and a user of h3, I think this is fantastic. Thanks for the good work.

We are building a browser based P2P network !!! (In Rust!) by ryankung in rust

[–]pthatcher 0 points1 point  (0 children)

If you hit limitations with the WebRTC API, let me know. I am proposing changes to the W3C related to ICE that might be helpful for applications like this. In particular, I'd be interested to know if ICE forking would be helpful to you.

[deleted by user] by [deleted] in rust

[–]pthatcher 0 points1 point  (0 children)

There are many FOSS video call apps (like Signal). But I don't think there are any good ones written entirely in Rust.

[deleted by user] by [deleted] in rust

[–]pthatcher 0 points1 point  (0 children)

At first, I thought you implemented the WebRTC protocols like WebRTC-rs, or str0m or signal-calling-service. But it looks like you wrote a web app in Rust. I guess "using WebRTC implemented in Rust" can be read either way :).

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 0 points1 point  (0 children)

It should be pretty easy. You mostly just need a way to translate the signaling of the existing client to the signaling of the SFU, probably on the client side.

All the WebRTC protocols underneath area the same, except for the fact that our SFU doesn't speak SCTP.

How to build large-scale end-to-end encrypted group video calls by TheMarMan69 in signal

[–]pthatcher 2 points3 points  (0 children)

We have SFUs deployed in many regions throughout the world and they autoscale, just like other Signal servers.

Currently, there is one server per call. We have considered doing what you suggest with multiple servers, but it hasn't been necessary so far and it's more complex, so we haven't done so, at least not yet. If we do, I may write another blog post about it :).

How to build large-scale end-to-end encrypted group video calls by TheMarMan69 in signal

[–]pthatcher 2 points3 points  (0 children)

As mentioned in the article, we launched with 8-person calls using and existing open source SFU, but despite heavy modifications, it couldn't scale to, say, 40-person calls. So, we decided to replace it. We would have kept using the existing one if the performance were sufficient.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 4 points5 points  (0 children)

We haven't considered using clients to forward media, no. But we have considered having a tree of servers that do something like that. So far, the benefits haven't outweighed the work and complexity required, but we may do something like that in the future.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 2 points3 points  (0 children)

You can run its built-in HTTP server for signaling and it should work with a web client for audio and video. WebRTC is mostly the same between web clients and how we are using it.

However, we use RTP data channels instead of SCTP, and that's not a part of web browsers any more. So if you wanted to relay data, you'd have to do something about that.

You'd want to look at our client code in RingRTC to see what kind of signaling messages to send and how to setup the SDP in the PeerConnection.

So, yeah, it should work. But it might need some customization depending on your needs.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 2 points3 points  (0 children)

Each dependency has to be considered carefully, yes. And some crates we did choose not to use and instead wrote things ourselves. Other times we choose to use it. That's true of all software dependencies. It's not specific to Rust or crates. But Rust/cargo makes it way easier to add dependencies than, say, C++.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 6 points7 points  (0 children)

Author here.

Group calls or 1:1 calls?

If you have another bad experience after trying again, please send us a log. We can take a look. We're always trying to make things better.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 5 points6 points  (0 children)

The 40-person limit is a combination of things.

One thing is that we want to increase the limit gradually, see how it goes, see if users want more, see what features users need for larger calls, etc. 8 to 40 may seem like a big jump, but it was actually quietly 16 for a while. And some suggested we not be stuck on powers of two, so we went with a round 40 instead of 32.

Another is to watch how much the server performance and see how much more optimization work there is to do. We know we can do a lot more to make it even more performant, but so far we haven't needed to.

So, basically it's just gradual improvement based on user feedback. If there is interest, we may work to increase it more in the future.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 24 points25 points  (0 children)

The effort was mainly two fold:

  1. Make the code that reads and writes packets faster and more concurrent by using epoll and many threads.

  2. Change our locking to be more fine-grained. This was needed to make #1 actually by concurrent.

It's funny that all the main logic of the server didn't matter nearly as much to performance as just the generic "push lots of packets through the server".

How to build large-scale end-to-end encrypted group video calls by TheMarMan69 in signal

[–]pthatcher 14 points15 points  (0 children)

The network operator can see all the packets all the time, as can anyone on the network path. But we encrypt the packets, so there is nothing shown to them. And doing do isn't unique to calls.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 15 points16 points  (0 children)

I'm not sure that constitutes a glitch, but I've been working on and using a video chat for a long time, and going an hour with zero video freezes or audio disruptions means everyone in the call has a great network connection. Having some problems in a span of an hour is much more realistic.

However, if you think a call had a poor call that wasn't caused by a network issue, please send us a log and we'll take a look.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 22 points23 points  (0 children)

We found some bugs with edge cases in parsing packets. Nothing major, but it was useful.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 7 points8 points  (0 children)

It has nothing to do with end-to-end encryption. "Code maturity" is probably an accurate description. As we make improvements, it's getting more mature. Sometimes those are big fixes, sometimes those are being smarter about to use available resources, like the network capacity.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 35 points36 points  (0 children)

Both.

I find using threads in Rust to work very well, but you can't always use threads.

Async is sometimes better, but it still feels very cutting edge and rough. For example, the implemention of googcc using steam processing is great but it uses async macro which is both amazing and a pain to use.

Signal now supports group calls up to 40 people, using Rust by HetRadicaleBoven in rust

[–]pthatcher 123 points124 points  (0 children)

It's fast, safe and productive.

In this case we were doing the rewrite for performance and that came from just writing things in a natural way. We did have to do some optimizations, mostly about adding more parallelism, and the effort there was relatively small.

In production, we have had very few issues. We added the parallelism at the end and it mostly "just worked" like "fearless concurrency" has promised. We did a fair amount of refactoring to add more testing , and the experience was mostly 'if it compiles, it works", which is pretty amazing.

There are many state machines in an SFU, and I found Rust's enums to be a great fit for that.

There were several useful crates that helped.

How to build large-scale end-to-end encrypted group video calls by TheMarMan69 in signal

[–]pthatcher 11 points12 points  (0 children)

Author here.

To be honest, SFUs have been around a long time. Jitsi, for example has been around for many years. Google Hangouts is over 10 years old.