| Yes, you are right that there is also a simple loss-based congestion control mechanism (https://github.com/jech/galene/blob/e8fbfcb9ba532f733405b1c5...) and a min() between it and the REMB. I missed that part. However, that appears to still be immature, only in a different way than I thought. If I'm right that only one server->client video stream (called "down track" in the Galene code) is receiving the REMB message, then only one will use the REMB value and the rest will fallback to loss-based congestion control. If I'm wrong and all the server->client video streams are receiving the REMB message, then all of them will use that same value which will be higher than a calculated by the loss-based congestion control for each stream independently, so in effect they will all be falling back to loss-based congestion control (when there is more than 1 video stream; for 1 video stream it probably works fine). Either way, it appears that each server->client video stream is independently running a loss-based congestion controller, all of which will be battling each other (like N TCP streams do). That can work, I guess, but it's better to run one congestion controller and then divide that bitrate among the various video streams, which is what I meant by "bitrate allocation". In other words, selecting video layers to send is exactly what I mean by bitrate allocation. Sorry for being unclear about that. The code you linked to is estimating the client->server bitrate for a given video stream. What I was looking for is code that will take a bitrate (from one congestion control mechanism, whatever it may be) and then divides that between the various video streams that flow server->client by selecting which layers to forward. I couldn't find that, and now I see why: because each video stream has its own congestion controller, and they apparently compete with each other where they are likely all loss-based in practice. Loss-based congestion control for video conferencing isn't as good as latency-based congestion control because it will cause more latency. Thanks for pointing out what I was missing. Now that I understand it better, I can see that it would work fine for 1 video stream (when there are only 2 clients in the call), but then likely falls back to loss-based congestion control for more than 2 clients, which will work, but not as well. If this is accurate, then I'd make a few suggestions for Galene:
1. Use one "maxBitrate" calculation per-"rtpConn" instead of per-"downTrack" and then divide that bitrate between those downTracks rather than doing N such independent calculations. This will avoid the problems from having congestion controllers competing with each other.
2. Feed the REMB value from the receiving client into the unified calculation. Then you'll get the benefit of latency-based congestion control (assuming the client is doing latency-based congestion control).
3. Switch the loss-based mechanism in the server to a latency-based system using something like transport-cc (which I think Pion supports). |
Galène doesn't bundle multiple streams in a single PeerConnection: it puts each stream (audio+video) in its own PeerConnection. Thus, if we can assume that the audio traffic does not significantly contribute to congestion, then performing congestion control per-track or per-connection is exactly equivalent.
(It's a tradeoff. Bundling reduces the amount of ICE traffic and makes for faster connection establishment, but it ends up putting multiple unrelated streas into a single transport-layer flow, which confuses traffic shapers and AQMs. I'm betting that things like fq-codel are being deployed as we speak; if my bet is wrong, then bundling will turn out to be the better choice.)