rfc-8851

RTP Payload Format Restrictions

A.B. Roach (Editor)
date2021-01 streamIETF areaart wgmmusic statusPROPOSED STANDARD pages26 canonicalhttps://www.rfc-editor.org/rfc/rfc8851 doi10.17487/RFC8851 errataview
In this specification, we define a framework for specifying restrictions on RTP streams in the Session Description Protocol (SDP). This framework defines a new "rid" ("restriction identifier") SDP attribute to unambiguously identify the RTP streams within an RTP session and restrict the streams' payload format parameters in a codec-agnostic way beyond what is provided with the regular payload types. This specification updates RFC 4855 to give additional guidance on choice of Format Parameter (fmtp) names and their relation to the restrictions defined by this document.

updates

Extracted elements (26)

design-rationale §2

Backwards compatibility is achieved by relying on the standard SDP rule that unknown 'a=' lines are ignored, meaning 'a=rid'-unaware implementations will produce valid sessions. Extensibility is achieved by having offerers include all supported restrictions and having answerers ignore unknown ones.

rtp, webrtc, realtime

design-rationale §9

Future RTP payload format registrations whose parameters match RID restrictions SHOULD name those parameters to match the RID restriction names and SHOULD explicitly state how fmtp parameters relate to RID restrictions, to enable consistent codec-agnostic negotiation.

rtp, webrtc, realtime, registry

design-rationale §2

The 'a=rid' framework was created because the 7-bit RTP PT field is too small to enumerate all payload configurations needed by simulcast and layered codecs, and because existing mechanisms (fmtp, imageattr) are codec-specific. RID provides a codec-agnostic, complementary extension that further restricts—but never replaces—existing format parameter mechanisms.

rtp, webrtc, realtime

interoperability-note §4

After an SSRC change associated with an RtpStreamId or RepairedRtpStreamId, all source packets referenced by the first several repair packets SHOULD include their stream identifier to maximize correct reassociation of source and redundancy data.

rtp, webrtc, realtime

interoperability-note §6.2.1

An 'a=rid'-unaware answerer will ignore the entire 'a=rid' line per standard offer/answer rules. Because RFC 8851 requires a valid 'a=fmtp' line to be present whenever one would otherwise be needed, ignoring 'a=rid' lines always results in a valid session description.

rtp, webrtc, realtime

interoperability-note §8.1.2

When 'a=rid' max-fs interacts with VP8's 'max-fs' fmtp parameter, the sent stream conforms to min(rid_max_fs, fmtp_max_fs * macroblock_size); similarly max-width and max-height are bounded by both the rid values and those derived from sqrt(fmtp_max_fs * 8) per RFC 7741 Section 6.1.

rtp, webrtc, realtime

interoperability-note §8

When 'a=rid' restrictions are combined with other restricting mechanisms such as 'a=fmtp' or 'a=imageattr', the combined result must produce a non-empty intersection. The 'a=rid' restrictions only further restrict parameters established by other mechanisms and can never relax them.

rtp, webrtc, realtime

interoperability-note §6

When used with BUNDLE (RFC 8843), RTP streams are associated with both MID and RID SDES items. The rid-id values are only required to be unique within a media section ('m=' line), not within the entire RTP session.

rtp, webrtc, realtime

normative-requirement §4 MUST NOT

A given 'rid-id' MUST NOT be repeated in a given media description ('m=' section). All 'rid' restrictions MUST be registered with IANA using the registry defined in Section 12.

rtp, webrtc, realtime, registry

normative-requirement §6.2.2 MUST

An 'a=rid'-aware answerer must process each received 'a=rid' line through six ordered verification steps: syntax check, rid-id uniqueness check, pt= validation against the m= line, support check for recv restrictions, depend rid-id ambiguity check, and codec compatibility check. Lines failing any step are discarded.

rtp, webrtc, realtime

normative-requirement §5 SHOULD NOT

For max-fps, the time between any two consecutive frames SHOULD NOT be less than 1/max-fps seconds. For max-br, the total bits in the payload portion of RTP SHOULD NOT exceed the specified value for any given one-second sliding window.

rtp, webrtc, realtime

normative-requirement §4 MUST

Implementations that use the 'a=rid' parameter in SDP MUST support the RtpStreamId SDES item described in RFC 8852, and MUST send that SDES item for all streams in an SDP media description that have 'a=rid' lines remaining after applying the offer/answer rules.

rtp, webrtc, realtime

normative-requirement §4 MUST

Implementations using 'a=rid' with redundancy RTP streams MUST support the RepairedRtpStreamId SDES item for those redundancy streams, and RepairedRtpStreamId MUST be used for all redundancy RTP streams to which it can be applied.

rtp, webrtc, realtime

normative-requirement §6.1 MUST

In generating the initial SDP offer, the offerer MUST generate a rid-id unique within a media description, MUST set the direction to 'send' or 'recv', and if a codec would require an 'a=fmtp' line when used without 'a=rid', the offer MUST include a valid corresponding 'a=fmtp' line even when using 'a=rid'.

rtp, webrtc, realtime

normative-requirement §6.3 MUST

In generating the SDP answer, the answerer MUST reverse the direction field ('send'↔'recv'), MUST NOT modify the rid-id, MUST NOT include restrictions absent from the offer, and any modified restriction values MUST be more restrictive than those in the offer.

rtp, webrtc, realtime

normative-requirement §12.2 MUST

Parameters registered in the 'RID Attribute Parameters' registry MUST be of the form where applying the modification results in a stream that still complies with other parameters — restrictions always produce a subset of what is otherwise allowable and never expand it.

registry, rtp, webrtc, realtime

normative-requirement §6.4 MUST

The offerer MUST be prepared to receive a media stream to which no restrictions have been applied, since the answerer may not support 'a=rid' at all or may not support the indicated restrictions.

rtp, webrtc, realtime

normative-requirement §6.5 SHOULD

When modifying a session, any RIDs with proposed changes SHOULD use a new ID rather than reusing one from the previous offer/answer exchange to avoid race conditions with media; RIDs without proposed changes SHOULD reuse the ID from the previous exchange.

rtp, webrtc, realtime

normative-requirement §6.4 SHALL

When processing the SDP answer, the offerer SHALL discard any 'a=rid' line if the answer contains new restrictions not in the offer, if modifications are not more restrictive, if pt= appears in the answer but not the offer, or if pt= payload type validation fails using semantic (not byte-wise) comparison of rtpmap/fmtp parameters.

rtp, webrtc, realtime

protocol-element §5

The 'a=rid' framework defines eight codec-agnostic video restrictions: max-width, max-height, max-fps (frames/sec), max-fs (pixels/frame), max-br (bits/sec, payload only), max-pps (pixels/sec), max-bpp (bits/pixel, range 0.0001-48.0, float with up to four decimal digits), and depend (comma-separated list of rid-ids for stream dependencies).

rtp, webrtc, realtime

protocol-element §4

The 'a=rid' SDP media-level attribute takes the form: 'a=rid:<rid-id> <direction> [pt=<fmt-list>;]<restriction>=<value>...'. The 'direction' field is either 'send' or 'recv' and is expressed independently of the media section's sendrecv/sendonly/recvonly/inactive attributes.

rtp, webrtc, realtime

registry §12.2

RFC 8851 creates the 'RID Attribute Parameters' IANA registry within the SDP parameters registry. New entries are accepted under 'Specification Required' policy (RFC 8126). Initial registrations include: pt, max-width, max-height, max-fps, max-fs, max-br, max-pps, max-bpp, and depend.

registry, rtp, webrtc, realtime

registry §12.1

RFC 8851 registers the 'rid' SDP media-level attribute under 'Session Description Protocol (SDP) Parameters' → 'att-field (media level only)', with Mux Category SPECIAL. The attribute is not charset-dependent.

registry, rtp, webrtc, realtime

security-consideration §13

RID identifiers are expected to be opaque and are not expected to contain sensitive information that would be harmful if observed by third parties.

security, privacy, rtp, webrtc

security-consideration §13

Without integrity protection over 'a=rid' attributes, attackers can modify session restrictions, potentially causing an implementation to send more data than the recipient desires. However, since 'a=rid' can only restrict streams to a subset of what is otherwise allowable, a modified value cannot result in higher bandwidth than would be sent to an implementation that does not support this mechanism.

security, rtp, webrtc, realtime

wire-format §10

The ABNF for 'a=rid' is: 'rid-syntax = %s"a=rid:" rid-id SP rid-dir [ rid-pt-param-list / rid-param-list ]'. The rid-id consists of one or more alphanumeric characters, hyphens, or underscores. The float-param-val for max-bpp is encoded as '1*DIGIT "." 1*DIGIT'.

rtp, webrtc, realtime