Skip to content

Commit 9bbc5a8

Browse files
Add counters that support deployment of L4S (#792)
* Add counters that support deployment of L4S These counters also depend on RFC8888 being deployed. * Create l4s-explainer.md This is the explainer for the counters proposed in the PR. * Remove internal note * Minor edits * Fix missing dt Co-authored-by: Dominique Hazael-Massieux <[email protected]> * Add feedback counts to explainer * Add ccfb counters to webrtc-stats.html as per discussion on the PR. --------- Co-authored-by: Dominique Hazael-Massieux <[email protected]>
1 parent d3baab4 commit 9bbc5a8

File tree

2 files changed

+159
-2
lines changed

2 files changed

+159
-2
lines changed

l4s-explainer.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<!-- Output copied to clipboard! -->
2+
3+
4+
5+
# Explainer - RFC8888 and L4S stats support in webrtc-stats
6+
7+
This explainer gives the background for the proposal to add stats to webrtc-stats to support the deployment of L4S and its prerequisite reporting format, RFC8888.
8+
9+
## What is L4S
10+
11+
L4S is a strategy for packet scheduling and marking in the Internet that is intended to make the Internet better for latency-sensitive applications that are capable of and willing to rapidly respond to signals that indicate queue buildup.
12+
13+
The elements constituting L4S, seen from an application, are:
14+
15+
16+
17+
* The data sender marks outgoing packets with the bit pattern ECT(1) (01) (rather than the default, “no signal” (00)
18+
* Network elements, when observing queue buildup, change the ECT(1) bit pattern to the CE (Congestion Experienced) bit pattern (11).
19+
* The data recipient reflects the bits observed on each packet back to the sender, using the RFC8888 reporting format
20+
* The data sender adjusts its send rate according to the observations in the report
21+
22+
23+
## What we need to diagnose
24+
25+
There are a number of scenarios we want to diagnose:
26+
27+
28+
29+
* CE-aware chokepoints: ECT(1) gets sent and received, the occasional CE gets received, and reflected back to the sender, which adjusts bitrate accordingly
30+
* Bleaching: ECT(1) gets sent, but the recipient sees “No signal”
31+
* Network drops: Packets marked with ECT(1) get dropped, packets without it get through
32+
* CE-less chokepoints: We observe packet loss, but no CE markings.
33+
34+
We may also want to look at packet loss vs packet reordering - when packets are lost, the reports will contain loss markings; when packets are reordered, later reports will overlap the previous reports and add info on packets previously reported as missing.
35+
36+
37+
## Suggested counters and where to attach them
38+
39+
The following counters are proposed:
40+
41+
Attached to RTCSentRtpStreamStats:
42+
43+
44+
45+
* Number of packets sent with normal markings (this can be calculated from PacketsSent - Ect1PacketsSent, so no explicit counter is needed)
46+
* Number of packets sent with ECT(1) markings
47+
48+
Attached to RTCReceivedRtpStreamStats:
49+
50+
51+
52+
* Number of packets received with normal markings
53+
* Number of packets received with ECT(1) marking
54+
* Number of packets received with CE marking
55+
* Number of packets reported as lost in RFC8888 reports
56+
* Number of packets reported as lost in one RFC8888 report but later reported as arrived
57+
58+
Attached to RTCRemoteInboundRtpStreamStats (which is a subclass of RTCReceivedRtpStreamStats):
59+
60+
61+
62+
* Number of packets sent with ECT(1) but reported as “no marking” (Bleached)
63+
64+
Data in RTCRemoteInboundRtpStreamStats are computed based on a sender’s knowledge of the outgoing packets + data from remote reports (RR or RFC8888 reports). Computing “bleached” packets requires having both info on the sent packet and info on the RFC8888 report available.
65+
66+
Attached to RTCTransportStats:
67+
68+
* Number of RFC 8888 format feedback messages sent
69+
* Number of RFC 8888 format feedback messages received
70+
71+
These numbers will allow monitoring of the frequency of RFC 8888 reporting.
72+
73+
74+
## How to diagnose scenarios from these numbers
75+
76+
Diagnosing is performed at the sending endpoint.
77+
78+
79+
80+
* CE-aware chokepoints: ECT(1) is sent, ECT(1) and CE are in reports, reported ECT(1) + CE + lost add up to the number of sent packets (modulo in-flight). Bleaching stays at zero.
81+
* Bleaching: ECT(1) is sent, but “no marking” is reported. Number of sent packets and number of received packets + lost are roughly equal.
82+
* Network drops: Packets sent with normal and ECT(1) are both above zero, but packets received are only normal, not ECT(1), and correspond to the number of normal packets. (NOTE: This is a failure scenario for deploying L4S)
83+
* CE-less chokepoints: ECT(1) is sent and received, but CE counter remains at zero. Number of packets reported as lost in RFC8888 reports is above zero.
84+
85+
If excessive reordering occurs, the “reported later” counters will go up; the precise interpretation of that number depends on the strategy used for scheduling RFC8888 reports (longer intervals will allow more reordered packets to be recovered without this being visible in the reports).

webrtc-stats.html

+74-2
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,10 @@ <h3>
893893
<div>
894894
<pre class="idl">dictionary RTCReceivedRtpStreamStats : RTCRtpStreamStats {
895895
unsigned long long packetsReceived;
896+
unsigned long long packetsReceivedWithEct1;
897+
unsigned long long packetsReceivedWithCe;
898+
unsigned long long packetsReportedAsLost;
899+
unsigned long long packetsReportedAsLostButRecovered;
896900
long long packetsLost;
897901
double jitter;
898902
};</pre>
@@ -917,6 +921,41 @@ <h2>
917921
sender side. If no <a>RTCP Receiver Report</a> has been received yet, then return 0.
918922
</p>
919923
</dd>
924+
<dt>
925+
<dfn>packetsReceivedWithEct1</dfn> of type <span class="idlMemberType">unsigned long long</span>
926+
</dt>
927+
<dd>
928+
<p>
929+
Total number of RTP packets received for this <a>SSRC</a> marked with the "ECT(1)" marking.
930+
</p>
931+
</dd>
932+
<dt>
933+
<dfn>packetsReceivedWithCe</dfn> of type <span class="idlMemberType">unsigned long long</span>
934+
</dt>
935+
<dd>
936+
<p>
937+
Total number of RTP packets received for this <a>SSRC</a> marked with the "CE" marking.
938+
</p>
939+
</dd>
940+
<dt>
941+
<dt>
942+
<dfn>packetsReportedAsLost</dfn> of type <span class="idlMemberType">unsigned long long</span>
943+
</dt>
944+
<dd>
945+
<p>
946+
Total number of RTP packets for which an [[RFC8888]] section 3.1 report has been sent with a zero R bit.
947+
Only reported if support for the "ccfb" feedback mechanism has been negotiated.
948+
</p>
949+
</dd>
950+
<dt><dfn>packetsReportedAsLostButRecovered</dfn> of type <span class="idlMemberType">unsigned long long</span></dt>
951+
</dt>
952+
<dd>
953+
<p>
954+
Total number of RTP packets for which an [[RFC8888]] section 3.1 report has been sent with a zero R bit,
955+
but a later report for the same packet has the R bit set to 1.
956+
Only reported if support for the "ccfb" feedback mechanism has been negotiated.
957+
</p>
958+
</dd>
920959
<dt>
921960
<dfn>packetsLost</dfn> of type <span class="idlMemberType">long long</span>
922961
</dt>
@@ -1830,6 +1869,7 @@ <h3>
18301869
double totalRoundTripTime;
18311870
double fractionLost;
18321871
unsigned long long roundTripTimeMeasurements;
1872+
unsigned long long packetsWithBleachedEct1Marking;
18331873
};</pre>
18341874
<section>
18351875
<h2>
@@ -1894,6 +1934,14 @@ <h2>
18941934
be calculated because no <a>RTCP Receiver Report</a> with a DLSR value other than 0 has been received.
18951935
</p>
18961936
</dd>
1937+
<dt>
1938+
<dfn>packetsWithBleachedEct1Marking</dfn> of type <span class="idlMemberType">unsigned long long</span>
1939+
</dt>
1940+
<dd>
1941+
<p>
1942+
Number of packets that were sent with ECT(1) markings per [[RFC3168]] section 3, but where an
1943+
[[RFC8888]] report gave information that the packet was received with a marking of "not-ECT".
1944+
</p>
18971945
</dl>
18981946
</section>
18991947
</div>
@@ -1904,8 +1952,9 @@ <h3>
19041952
</h3>
19051953
<div>
19061954
<pre class="idl">dictionary RTCSentRtpStreamStats : RTCRtpStreamStats {
1907-
unsigned long long packetsSent;
1908-
unsigned long long bytesSent;
1955+
unsigned long long packetsSent;
1956+
unsigned long long bytesSent;
1957+
unsigned long long packetsSentWithEct1;
19091958
};</pre>
19101959
<section>
19111960
<h2>
@@ -1933,6 +1982,13 @@ <h2>
19331982
Calculated as defined in [[!RFC3550]] section 6.4.1.
19341983
</p>
19351984
</dd>
1985+
<dt>
1986+
<dfn>packetsSentWithEct1</dfn> of type <span class="idlMemberType">unsigned long long</span>
1987+
</dt>
1988+
<dd>
1989+
Total number of RTP packets sent for this <a>SSRC</a> with the ECT(1) marking defined in [[RFC3168]]
1990+
section 5 and used by the L4S protocol described in [[RFC9331]].
1991+
</dd>
19361992
</dl>
19371993
</section>
19381994
</div>
@@ -3114,6 +3170,8 @@ <h3>
31143170
RTCDtlsRole dtlsRole;
31153171
DOMString srtpCipher;
31163172
unsigned long selectedCandidatePairChanges;
3173+
unsigned long ccfbMessagesSent;
3174+
unsigned long ccfbMessagesReceived;
31173175
};</pre>
31183176
<section>
31193177
<h2>
@@ -3290,6 +3348,20 @@ <h2>
32903348
pair is selected.
32913349
</p>
32923350
</dd>
3351+
<dt>
3352+
<dfn>ccfbMessagesSent</dfn> of type <span class="idlMemberType">unsigned long</span>span>
3353+
</dt>
3354+
<dd>
3355+
<p>The number of Transport-Layer Feedback Messages of type CongestionControl Feedback Packet, as described
3356+
in [[!RFC8888]] section 3.1, sent on this transport.</p>
3357+
</dd>
3358+
<dt>
3359+
<dfn>ccfbMessagesReceived</dfn> of type <span class="idlMemberType">unsigned long</span>span>
3360+
</dt>
3361+
<dd>
3362+
<p>The number of Transport-Layer Feedback Messages of type CongestionControl Feedback Packet, as described
3363+
in [[!RFC8888]] section 3.1, received on this transport.</p>
3364+
</dd>
32933365
</dl>
32943366
</section>
32953367
<section>

0 commit comments

Comments
 (0)