Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownTrack scoring when RR is not received. #1664

Merged
merged 3 commits into from
Apr 28, 2023
Merged

DownTrack scoring when RR is not received. #1664

merged 3 commits into from
Apr 28, 2023

Conversation

boks1971
Copy link
Contributor

@boks1971 boks1971 commented Apr 28, 2023

Got more complicated than I would like, but the main challenge is distinguishing between publisher traffic stopping vs subscriber not sending RTCP Receiver Report.

Split out the send and receiver report snapshot on down track. This is directionally okay. As we want to report what we are sending to analytics. Till now, what is reported to analytics also depended on what was reported in receiver report.

Once that is split out, can check for streaming.
If publisher has run dry, we will not be sending anything.

If we are sending data, then look for long interval without receiver report and treat it like no report and score it poor. Scoring runs on receiver report based snap shot purely.

Also, increase the no receiver report interval to 30 seconds to give enough headroom.

Got more complicated than I would like, but the main challenge
is distinguishing between publisher traffic stopping vs
subscriber not sendint RTCP Receiver Report.

Split out the send and receiver report snapshot on down track.
This is directionally okay. As we want to report what we are
sending to analytics. Till now, what is reported to analytics
also depended on what was reported in receiver report.

Once that is split out, can check for streaming.
If publisher has run dry, we will not be sending anything.

If we are sending data, then look for long interval without
receiver report and treat it like no report and score it poor.
Scoring runs on receiver report based snap shot purely.

Also, increase the no receiver report interval to 30 seconds to give
enough headroom.
packetsLost = intervalStats.packetsLost
}
intervalStats := r.getIntervalStats(uint16(then.extStartSN), uint16(now.extStartSN))
packetsLost := intervalStats.packetsLost
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaning these up. If receiver report based delta is needed, DeltaInfoOverridden should be used. So, cleaning these up.

}
r.snapshots[snapshotId] = then
}

var startTime time.Time
if override && r.params.IsReceiverReportDriven {
startTime = r.lastRRTime
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lock snap shots to receiver report time. Without that, maxPPS calculation was off as the window durations were offset between receiver report and snap shots.

@boks1971 boks1971 merged commit 50ab72a into master Apr 28, 2023
1 check passed
@boks1971 boks1971 deleted the raja_rr_score branch April 28, 2023 09:20
boks1971 added a commit that referenced this pull request Jun 9, 2023
Reversing a bit of #1664.
That PR did two snapshots (one based on what SFU is sending
and one based on combination of what SFU is sending reconciled with
stats reported from client via RTCP Receiver Report). That PR
reported SFU only view to analytics. But, that view does not have
information about loss seen by client in the downstream.
Also, that does not have RTT/jitter information. The rationale behind
using SFU only view is that SFU should report what it sends irrespective
of client is receiving or not. But, that view did not have proper
loss/RTT/jitter.

So, switch back to reporting SFU + receiver report reconciled view.
The down side is that when receiver reports are not receiver,
packets sent/bytes sent will not be reported to analytics.

An option is to report SFU only view if there are no receiver reports.
But, it becomes complex because of the offset. Receiver report would
acknowledge certain range whereas SFU only view could be different
because of propagation delay. To simplify, just using the reconciled
view to report to analytics. Using the available view will require
a bunch more work to produce accurate data.
(NOTE: all this started due to a bug where RTCP was not restarted on
a track resume which killed receiver reports and we went on this path
to distinguish between publisher stopping vs RTCP receiver report not
happening)

One optimisation to here here concerns the check to see if publisher is sending data.
Using a full DeltaInfo for that is an overkill. Can do a lighter weight
for that later.
boks1971 added a commit that referenced this pull request Jun 9, 2023
* Use receiver report stats for loss/rtt/jitter.

Reversing a bit of #1664.
That PR did two snapshots (one based on what SFU is sending
and one based on combination of what SFU is sending reconciled with
stats reported from client via RTCP Receiver Report). That PR
reported SFU only view to analytics. But, that view does not have
information about loss seen by client in the downstream.
Also, that does not have RTT/jitter information. The rationale behind
using SFU only view is that SFU should report what it sends irrespective
of client is receiving or not. But, that view did not have proper
loss/RTT/jitter.

So, switch back to reporting SFU + receiver report reconciled view.
The down side is that when receiver reports are not receiver,
packets sent/bytes sent will not be reported to analytics.

An option is to report SFU only view if there are no receiver reports.
But, it becomes complex because of the offset. Receiver report would
acknowledge certain range whereas SFU only view could be different
because of propagation delay. To simplify, just using the reconciled
view to report to analytics. Using the available view will require
a bunch more work to produce accurate data.
(NOTE: all this started due to a bug where RTCP was not restarted on
a track resume which killed receiver reports and we went on this path
to distinguish between publisher stopping vs RTCP receiver report not
happening)

One optimisation to here here concerns the check to see if publisher is sending data.
Using a full DeltaInfo for that is an overkill. Can do a lighter weight
for that later.

* return available streams

* fix test
hautvfami pushed a commit to Stark-Industries-Ltd/livekit that referenced this pull request Jul 21, 2023
hautvfami pushed a commit to Stark-Industries-Ltd/livekit that referenced this pull request Jul 21, 2023
* Use receiver report stats for loss/rtt/jitter.

Reversing a bit of livekit#1664.
That PR did two snapshots (one based on what SFU is sending
and one based on combination of what SFU is sending reconciled with
stats reported from client via RTCP Receiver Report). That PR
reported SFU only view to analytics. But, that view does not have
information about loss seen by client in the downstream.
Also, that does not have RTT/jitter information. The rationale behind
using SFU only view is that SFU should report what it sends irrespective
of client is receiving or not. But, that view did not have proper
loss/RTT/jitter.

So, switch back to reporting SFU + receiver report reconciled view.
The down side is that when receiver reports are not receiver,
packets sent/bytes sent will not be reported to analytics.

An option is to report SFU only view if there are no receiver reports.
But, it becomes complex because of the offset. Receiver report would
acknowledge certain range whereas SFU only view could be different
because of propagation delay. To simplify, just using the reconciled
view to report to analytics. Using the available view will require
a bunch more work to produce accurate data.
(NOTE: all this started due to a bug where RTCP was not restarted on
a track resume which killed receiver reports and we went on this path
to distinguish between publisher stopping vs RTCP receiver report not
happening)

One optimisation to here here concerns the check to see if publisher is sending data.
Using a full DeltaInfo for that is an overkill. Can do a lighter weight
for that later.

* return available streams

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants