Based on an analysis of NADA [
RFC 8698], SCReAM [
RFC 8298], Google Congestion Control [
Google-GCC], and Shared Bottleneck Detection [
RFC 8382], the following per-RTP packet congestion control feedback information has been determined to be necessary:
-
RTP Sequence Number:
-
The receiver of an RTP flow needs to feed the sequence numbers of the received RTP packets back to the sender, so the sender can determine which packets were received and which were lost. Packet loss is used as an indication of congestion by many congestion control algorithms.
-
Packet Arrival Time:
-
The receiver of an RTP flow needs to feed the arrival time of each RTP packet back to the sender. Packet delay and/or delay variation (jitter) is used as a congestion signal by some congestion control algorithms.
-
Packet Explicit Congestion Notification (ECN) Marking:
-
If ECN [RFC 3168] [RFC 6679] is used, it is necessary to feed back the 2-bit ECN mark in received RTP packets, indicating for each RTP packet whether it is marked not-ECT, ECT(0), ECT(1), or ECN Congestion Experienced (ECN-CE). ("ECT" stands for "ECN-Capable Transport".) If the path used by the RTP traffic is ECN capable, the sender can use ECN-CE marking information as a congestion control signal.
Every RTP flow is identified by its Synchronization Source (SSRC) identifier. Accordingly, the RTCP feedback format needs to group its reports by SSRC, sending one report block per received SSRC.
As a practical matter, we note that host operating system (OS) process interruptions can occur at inopportune times. Accordingly, recording RTP packet send times at the sender, and the corresponding RTP packet arrival times at the receiver, needs to be done with deliberate care. This is because the time duration of host OS interruptions can be significant relative to the precision desired in the one-way delay estimates. Specifically, the send time needs to be recorded at the last opportunity prior to transmitting the RTP packet at the sender, and the arrival time at the receiver needs to be recorded at the earliest available opportunity.
Congestion control feedback can be sent as part of a regular scheduled RTCP report or in an RTP/AVPF early feedback packet. If sent as early feedback, congestion control feedback
MAY be sent in a non-compound RTCP packet [
RFC 5506] if the RTP/AVPF profile [
RFC 4585] or the RTP/SAVPF profile [
RFC 5124] is used.
Irrespective of how it is transported, the congestion control feedback is sent as a Transport-Layer Feedback Message (RTCP packet type 205). The format of this RTCP packet is shown in
Figure 1:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|V=2|P| FMT=11 | PT = 205 | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of RTCP packet sender |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of 1st RTP Stream |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| begin_seq | num_reports |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|ECN| Arrival time offset | ... .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| SSRC of nth RTP Stream |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| begin_seq | num_reports |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|ECN| Arrival time offset | ... |
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Report Timestamp (32 bits) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The first 8 octets comprise a standard RTCP header, with PT=205 and FMT=11 indicating that this is a congestion control feedback packet, and with the SSRC set to that of the sender of the RTCP packet.
Section 6.1 of
RFC 4585 requires the RTCP header to be followed by the SSRC of the RTP flow being reported upon. Accordingly, the RTCP header is followed by a report block for each SSRC from which RTP packets have been received, followed by a Report Timestamp.
Each report block begins with the SSRC of the received RTP stream on which it is reporting. Following this, the report block contains a 16-bit packet metric block for each RTP packet that has a sequence number in the range begin_seq to begin_seq+num_reports inclusive (calculated using arithmetic modulo 65536 to account for possible sequence number wrap-around). If the number of 16-bit packet metric blocks included in the report block is not a multiple of two, then 16 bits of zero padding
MUST be added after the last packet metric block, to align the end of the packet metric blocks with the next 32-bit boundary. The value of num_reports
MAY be 0, indicating that there are no packet metric blocks included for that SSRC. Each report block
MUST NOT include more than 16384 packet metric blocks (i.e., it
MUST NOT report on more than one quarter of the sequence number space in a single report).
The contents of each 16-bit packet metric block comprise the R, ECN, and ATO fields as follows:
-
Received (R, 1 bit):
-
A boolean that indicates whether the packet was received. 0 indicates that the packet was not yet received and the subsequent 15 bits (ECN and ATO) in this 16-bit packet metric block are also set to 0 and MUST be ignored. 1 indicates that the packet was received and the subsequent bits in the block need to be parsed.
-
ECN (2 bits):
-
The echoed ECN mark of the packet. These bits are set to 00 if not received or if ECN is not used.
-
Arrival time offset (ATO, 13 bits):
-
The arrival time of the RTP packet at the receiver, as an offset before the time represented by the Report Timestamp (RTS) field of this RTCP congestion control feedback report. The ATO field is in units of 1/1024 seconds (this unit is chosen to give exact offsets from the RTS field) so, for example, an ATO value of 512 indicates that the corresponding RTP packet arrived exactly half a second before the time instant represented by the RTS field. If the measured value is greater than 8189/1024 seconds (the value that would be coded as 0x1FFD), the value 0x1FFE MUST be reported to indicate an over-range measurement. If the measurement is unavailable or if the arrival time of the RTP packet is after the time represented by the RTS field, then an ATO value of 0x1FFF MUST be reported for the packet.
The RTCP congestion control feedback report packet concludes with the Report Timestamp field (RTS, 32 bits). This denotes the time instant on which this packet is reporting and is the instant from which the arrival time offset values are calculated. The value of the RTS field is derived from the same clock used to generate the NTP timestamp field in RTCP Sender Report (SR) packets. It is formatted as the middle 32 bits of an NTP format timestamp, as described in
Section 4 of
RFC 3550.
RTCP Congestion Control Feedback Packets
SHOULD include a report block for every active SSRC. The sequence number ranges reported on in consecutive reports for a given SSRC will generally be contiguous, but overlapping reports
MAY be sent (and need to be sent in cases where RTP packet reordering occurs across the boundary between consecutive reports). If an RTP packet was reported as received in one report, that packet
MUST also be reported as received in any overlapping reports sent later that cover its sequence number range. If feedback reports covering overlapping sequence number ranges are sent, information in later feedback reports may update any data sent in previous reports for RTP packets included in both feedback reports.
RTCP Congestion Control Feedback Packets can be large if they are sent infrequently relative to the number of RTP data packets. If an RTCP Congestion Control Feedback Packet is too large to fit within the path MTU, its sender
SHOULD split it into multiple feedback packets. The RTCP reporting interval
SHOULD be chosen such that feedback packets are sent often enough that they are small enough to fit within the path MTU. ([
RTCP-Multimedia-Feedback] discusses how to choose the reporting interval; specifications for RTP congestion control algorithms can also provide guidance.)
If duplicate copies of a particular RTP packet are received, then the arrival time of the first copy to arrive
MUST be reported. If any of the copies of the duplicated packet are ECN-CE marked, then an ECN-CE mark
MUST be reported for that packet; otherwise, the ECN mark of the first copy to arrive is reported.
If no packets are received from an SSRC in a reporting interval, a report block
MAY be sent with begin_seq set to the highest sequence number previously received from that SSRC and num_reports set to 0 (or the report can simply be omitted). The corresponding Sender Report / Receiver Report (SR/RR) packet will have a non-increased extended highest sequence number received field that will inform the sender that no packets have been received, but it can ease processing to have that information available in the congestion control feedback reports too.
A report block indicating that certain RTP packets were lost is not to be interpreted as a request to retransmit the lost packets. The receiver of such a report might choose to retransmit such packets, provided a retransmission payload format has been negotiated, but there is no requirement that it do so.