RTP Payload Format Restrictions
updates
- rfc-4855 — Media Type Registration of RTP Payload Formats
Extracted elements (26)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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'.
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.
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.
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.
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.
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.
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).
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.
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.
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.
RID identifiers are expected to be opaque and are not expected to contain sensitive information that would be harmful if observed by third parties.
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.
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'.