4. Choosing an RTCP CNAME
It is difficult, and in some cases impossible, for a host to determine if there is a NAT between itself and its RTP peer. Furthermore, even some public IPv4 addresses can be shared by multiple hosts in the Internet. Using the numeric representation of the IPv4 address as the "host" part of the RTCP CNAME is NOT RECOMMENDED.
4.1. Persistent RTCP CNAMEs versus Per-Session RTCP CNAMEs
The RTCP CNAME can be either persistent across different RTP sessions for an RTP endpoint or unique per session, meaning that an RTP endpoint chooses a different RTCP CNAME for each RTP session.
An RTP endpoint that is emitting multiple related RTP streams that require synchronization at the other endpoint(s) MUST use the same RTCP CNAME for all streams that are to be synchronized. This requires a short-term, persistent RTCP CNAME that is common across several RTP streams, and potentially across several related RTP sessions. A common example of such use occurs when syncing audio and video streams in a multimedia session, where a single participant has to use the same RTCP CNAME for its audio RTP session and for its video RTP session. Another example might be to synchronize the layers of a layered audio codec, where the same RTCP CNAME has to be used for each layer.
If the multiple RTP streams in an RTP session are not related, and thus do not require synchronization, an RTP endpoint can use different RTCP CNAMEs for these streams.
A longer-term persistent RTCP CNAME is sometimes useful to facilitate third-party monitoring, consistent with [RFC3550]. One such use might be to allow network management tools to correlate the ongoing quality of service for a participant across multiple RTP sessions for fault diagnosis and to understand long-term network performance statistics. An application developer that wishes to discourage this type of third-party monitoring can choose to generate a unique RTCP CNAME for each RTP session, or group of related RTP sessions, that the application will join. Such a per-session RTCP CNAME cannot be used for traffic analysis, and so provides some limited form of privacy. Note that there are non-RTP means that can be used by a third party to correlate RTP sessions, so the use of per-session RTCP CNAMEs will not prevent a determined traffic analyst from monitoring such sessions.
This memo defines several different ways by which an implementation can choose an RTCP CNAME. It is possible, and legitimate, for independent implementations to make different choices of RTCP CNAME when running on the same host. This can hinder third-party monitoring, unless some external means is provided to configure a persistent choice of RTCP CNAME for those implementations.
Note that there is no backwards compatibility issue (with implementations compatible with [RFC3550]) introduced in this memo, since the RTCP CNAMEs are opaque strings to remote peers.
4.2. Requirements
RTP endpoints will choose to generate RTCP CNAMEs that are persistent or per-session. An RTP endpoint that wishes to generate a persistent RTCP CNAME MUST use one of the following two methods:
-
To produce a long-term persistent RTCP CNAME, an RTP endpoint MUST generate and store a Universally Unique IDentifier (UUID) [RFC4122] for use as the "host" part of its RTCP CNAME. The UUID MUST be version 1, 2, or 4, as described in [RFC4122], with the "urn:uuid:" stripped, resulting in a 36-octet printable string representation.
-
To produce a short-term persistent RTCP CNAME, an RTP endpoint MUST generate and use an identifier by following the procedure described in Section 5. That procedure is performed at least once per initialization of the software. After obtaining an identifier, minimally the least significant 96 bits SHOULD be converted to ASCII using Base64 encoding [RFC4648] (to compromise between packet size and uniqueness -- refer to Section 6.1). If 96 bits are used, the resulting string will be 16 octets. Note the Base64 encoded value cannot exceed the maximum RTCP CNAME length of 255 octets [RFC3550].
In the two cases above, the "user@" part of the RTCP CNAME MAY be omitted on single-user systems and MAY be replaced by an opaque token on multiuser systems, to preserve privacy.
An RTP endpoint that wishes to generate a per-session RTCP CNAME MUST use the following method:
- For every new RTP session, a new RTCP CNAME is generated following the procedure described in Section 5. After performing that procedure, minimally the least significant 96 bits SHOULD be converted to ASCII using Base64 encoding [RFC4648]. The RTCP CNAME cannot change over the life of an RTP session [RFC3550]. The "user@" part of the RTCP CNAME is omitted when generating per-session RTCP CNAMEs.
It is believed that obtaining uniqueness (with a high probability) is an important property that requires careful evaluation of the method. This document provides a number of methods, at least one of which would be suitable for any given deployment scenarios. This document therefore does not provide for the implementor to define and select an alternative method.
A future specification might define an alternative method for generating RTCP CNAMEs, as long as the proposed method has appropriate uniqueness and there is consistency between the methods used for multiple RTP sessions that are to be correlated. However, such a specification needs to be reviewed and approved before deployment.
The mechanisms described in this document are to be used to generate RTCP CNAMEs, and they are not to be used for generating general-purpose unique identifiers.
5. Procedure to Generate a Unique Identifier
To locally produce a unique identifier, one simply generates a cryptographically pseudorandom value as described in [RFC4086]. This value MUST be at least 96 bits.
The biggest bottleneck to implementation of this algorithm is the availability of an appropriate cryptographically secure pseudorandom number generator (CSPRNG). In any setting that already has a secure PRNG, this algorithm described is far simpler than the algorithm described in Section 5 of [RFC6222]. SIP stacks [RFC3261] are required to use cryptographically random numbers to generate To and From tags (Section 19.3). Real-Time Communications on the Web (RTCWEB) implementations [ARCH] will need to have secure PRNGs to implement ICE [RFC5245] and DTLS-SRTP [RFC5764]. And, of course, essentially every Web browser already supports TLS, which requires a secure PRNG.