Strategy for preventing unprotect/ROC issues when using an SFU?

45 views
Skip to first unread message

Brian Baldino

unread,
May 11, 2016, 8:28:31 PM5/11/16
to discuss...@googlegroups.com
We've got an SFU that only forwards the current active speakers' video to other participants and we're running into the following issue:

T0: Speaker A is forwarded to receiver B
T1: Speaker C is forwarded to receiver B (B is no longer receiving A's video stream)
T2: Speaker A is forwarded to receiver B

The problem is when the difference in time between T0 and T2 is long enough for A's sequence numbers to roll over enough to throw off the srtp index calculation, so at time T2, B complains with a bunch of srtp_unprotect errors.

I know this must be a common scenario, what are people doing to work around it?  We've added logic to forward, say, 10 out of every 2500 packets from A to B (always, regardless if it is the active speaker or not) so that B can always calculate the srtp index properly, but that makes the peerconnection stats on B look a bit wonky (it's viewed as huge chunks of packet loss).  Is there a better way?

-brian

Peter Boström

unread,
May 11, 2016, 8:34:59 PM5/11/16
to discuss...@googlegroups.com
I would assume that it's quite common to rewrite sequence numbers in the SFU for every outgoing packet.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAAEyqM4JMaxo8AQioO45yZDrzY75iu%2BR9%2BBzUc0ohyucbEpV0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Brian Baldino

unread,
Jun 22, 2016, 1:35:52 PM6/22/16
to discuss...@googlegroups.com
We implemented sequence number rewriting on the SFU to fix the ROC problems, but ran into an issue with slow switching due to some logic in the jitter buffer which causes switches between streams to sometimes be very slow (5-10 seconds).  details in the bug here: https://bugs.chromium.org/p/webrtc/issues/detail?id=6026

emanuele bizzarri

unread,
Jun 25, 2016, 5:07:27 AM6/25/16
to discuss...@googlegroups.com

You could try this.
Don't manage sequence. Leave the original values.
When you stop sending A to B, send a new sdp B, removing A SSRC.
When you want to restart sending A to B, send a new sdp to B, containing a NEW DIFFERENT SSRC for A. B should start decrypting A srtp immediately.
Using this solution you have to rewrite ssrcs for rtp tracks, but not sequences.
I think that rewrite sequences could have difficulties in case of packet loss and retransmission

Reply all
Reply to author
Forward
0 new messages