idnits 2.17.1 draft-ietf-avt-rtp-new-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Authors' Addresses Section. ** There are 26 instances of too long lines in the document, the longest one being 8 characters in excess of 72. ** There are 19 instances of lines with control characters in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 969 has weird spacing: '... item item ...' == Line 3279 has weird spacing: '...ed char u_int...' == Line 3281 has weird spacing: '...ned int u_in...' == Line 3809 has weird spacing: '... char c[16...' == Line 3833 has weird spacing: '... struct timev...' == (6 more instances...) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 2, 2001) is 8450 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? '1' on line 4415 looks like a reference -- Missing reference section? '2' on line 4421 looks like a reference -- Missing reference section? '3' on line 4425 looks like a reference -- Missing reference section? '4' on line 4429 looks like a reference -- Missing reference section? '5' on line 4433 looks like a reference -- Missing reference section? '6' on line 4436 looks like a reference -- Missing reference section? '7' on line 4440 looks like a reference -- Missing reference section? '8' on line 4445 looks like a reference -- Missing reference section? '9' on line 4449 looks like a reference -- Missing reference section? '10' on line 4453 looks like a reference -- Missing reference section? '11' on line 4456 looks like a reference -- Missing reference section? '12' on line 4460 looks like a reference -- Missing reference section? '13' on line 4464 looks like a reference -- Missing reference section? '14' on line 4469 looks like a reference -- Missing reference section? '-packet-' on line 966 looks like a reference -- Missing reference section? '15' on line 4473 looks like a reference -- Missing reference section? '16' on line 4478 looks like a reference -- Missing reference section? '17' on line 4482 looks like a reference -- Missing reference section? '18' on line 4485 looks like a reference -- Missing reference section? '19' on line 4489 looks like a reference -- Missing reference section? '20' on line 4493 looks like a reference -- Missing reference section? '21' on line 4497 looks like a reference -- Missing reference section? '22' on line 4501 looks like a reference -- Missing reference section? '23' on line 4505 looks like a reference -- Missing reference section? '24' on line 4510 looks like a reference -- Missing reference section? 'E1' on line 2412 looks like a reference -- Missing reference section? 'E6' on line 2412 looks like a reference -- Missing reference section? 'E2' on line 2421 looks like a reference -- Missing reference section? 'E4' on line 2421 looks like a reference -- Missing reference section? 'E3' on line 2423 looks like a reference -- Missing reference section? 'E5' on line 2427 looks like a reference -- Missing reference section? '25' on line 4514 looks like a reference -- Missing reference section? '26' on line 4518 looks like a reference -- Missing reference section? 'RR' on line 2927 looks like a reference -- Missing reference section? '27' on line 4522 looks like a reference -- Missing reference section? '28' on line 4526 looks like a reference -- Missing reference section? '29' on line 4530 looks like a reference -- Missing reference section? '0' on line 3740 looks like a reference -- Missing reference section? '30' on line 4534 looks like a reference -- Missing reference section? '31' on line 4538 looks like a reference -- Missing reference section? '32' on line 4542 looks like a reference Summary: 6 errors (**), 0 flaws (~~), 8 warnings (==), 44 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force Audio/Video Transport Working Group 3 Internet Draft Schulzrinne/Casner/Frederick/Jacobson 4 draft-ietf-avt-rtp-new-09.txt Columbia U./Packet Design/Entera/Packet Design 5 March 2, 2001 6 Expires: August 2, 2001 8 RTP: A Transport Protocol for Real-Time Applications 10 STATUS OF THIS MEMO 12 This document is an Internet-Draft and is in full conformance with 13 all provisions of Section 10 of RFC2026. 15 Internet-Drafts are working documents of the Internet Engineering 16 Task Force (IETF), its areas, and its working groups. Note that 17 other groups may also distribute working documents as Internet- 18 Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six months 21 and may be updated, replaced, or obsoleted by other documents at any 22 time. It is inappropriate to use Internet-Drafts as reference 23 material or to cite them other than as "work in progress". 25 The list of current Internet-Drafts can be accessed at 26 http://www.ietf.org/ietf/1id-abstracts.txt 28 To view the list Internet-Draft Shadow Directories, see 29 http://www.ietf.org/shadow.html. 31 Abstract 33 This memorandum is a revision of RFC 1889 in preparation for 34 advancement from Proposed Standard to Draft Standard status. Readers 35 are encouraged to use the PostScript form of this draft to see where 36 changes from RFC 1889 are marked by change bars. 38 This memorandum describes RTP, the real-time transport protocol. RTP 39 provides end-to-end network transport functions suitable for 40 applications transmitting real-time data, such as audio, video or 41 simulation data, over multicast or unicast network services. RTP does 42 not address resource reservation and does not guarantee quality-of- 43 service for real-time services. The data transport is augmented by a 44 control protocol (RTCP) to allow monitoring of the data delivery in a 45 manner scalable to large multicast networks, and to provide minimal 46 control and identification functionality. RTP and RTCP are designed 47 to be independent of the underlying transport and network layers. The 48 protocol supports the use of RTP-level translators and mixers. 50 This specification is a product of the Audio/Video Transport working 51 group within the Internet Engineering Task Force. Comments are 52 solicited and should be addressed to the working group's mailing list 53 at rem-conf@es.net and/or the authors. 55 Resolution of Open Issues 57 [Note to the RFC Editor: This section is to be deleted when this 58 draft is published as an RFC but is shown here for reference during 59 the Last Call. The first paragraph of the Abstract is also to be 60 deleted.] 62 Readers are directed to Appendix B, Changes from RFC 1889, for a 63 listing of the changes that have been made in this draft. The changes 64 are marked with change bars in the PostScript form of this draft. 66 The only changes in this revision of the draft from the previous 67 one were the addition of a reference to RFC 2914 in Section 10 and 68 a clarification of splitting RTCP between encrypted and unencrypted 69 packets in Section 9. 71 This version of the draft is intended to be complete for Working 72 Group last call; the open issues from previous drafts have been 73 addressed: 75 o A fudge factor has been added to the RTCP unconditional 76 reconsideration algorithm to compensate for the fact that it 77 settles to a steady state bandwidth that is below the desired 78 level. 80 o As agreed at the Chicago IETF, the conditional and hybrid 81 reconsideration schemes have been removed in favor of 82 unconditional reconsideration. 84 o The SSRC sampling algorithm has been extracted to a separate 85 draft as agreed at the Chicago IETF. That draft describes the 86 "bin" mechanism that avoids a temporary underestimate in group 87 size when the group size is decreasing. 89 o The "reverse reconsideration" algorithm does not prevent the 90 group size estimate from incorrectly dropping to zero for a 91 short time when most participants of a large session leave at 92 once but some remain. This has just been noted as only a 93 secondary concern. 95 o Scaling of the minimum RTCP interval inversely proportional to 96 the session bandwidth parameter has been added, but only in 97 the direction of smaller intervals for higher bandwidth. 98 Scaling to longer intervals for low bandwidths would cause a 99 problem because this is an optional step. Some participants 100 might be timed out prematurely if they scaled to a longer 101 interval while others kept the nominal 5 seconds. The benefit 102 of scaling longer was not considered great in any case. 104 o No change was specified for the jitter computation for media 105 with several packets with the same timestamp. There is not a 106 clear answer as to what should be done, or that any change 107 would make a significant improvement. 109 o As proposed without objection at the Los Angeles IETF, 110 definition of additional SDES items such as PHOTO URL and 111 NICKNAME will be deferred to subsequent registration through 112 IANA since that method has been established. This is in the 113 spirit of minimizing changes to the protocol in the transition 114 from Proposed to Draft. 116 o Nothing was added about allowing a translator to add its own 117 random offsets to the sequence number and timestamp fields 118 because it would likely cause more trouble than good. 120 o It was decided that it is not necessary for the length of a 121 compound RTCP packet containing information about N sources 122 (usually from a mixer that aggregates RTCP) to be divided by N 123 before adding it into the average length since the smoothing 124 of the estimator is sufficient. 126 1 Introduction 128 This memorandum specifies the real-time transport protocol (RTP), 129 which provides end-to-end delivery services for data with real-time 130 characteristics, such as interactive audio and video. Those services 131 include payload type identification, sequence numbering, timestamping 132 and delivery monitoring. Applications typically run RTP on top of UDP 133 to make use of its multiplexing and checksum services; both protocols 134 contribute parts of the transport protocol functionality. However, 135 RTP may be used with other suitable underlying network or transport 136 protocols (see Section 11). RTP supports data transfer to multiple 137 destinations using multicast distribution if provided by the 138 underlying network. 140 Note that RTP itself does not provide any mechanism to ensure timely 141 delivery or provide other quality-of-service guarantees, but relies 142 on lower-layer services to do so. It does not guarantee delivery or 143 prevent out-of-order delivery, nor does it assume that the underlying 144 network is reliable and delivers packets in sequence. The sequence 145 numbers included in RTP allow the receiver to reconstruct the 146 sender's packet sequence, but sequence numbers might also be used to 147 determine the proper location of a packet, for example in video 148 decoding, without necessarily decoding packets in sequence. 150 While RTP is primarily designed to satisfy the needs of multi- 151 participant multimedia conferences, it is not limited to that 152 particular application. Storage of continuous data, interactive 153 distributed simulation, active badge, and control and measurement 154 applications may also find RTP applicable. 156 This document defines RTP, consisting of two closely-linked parts: 158 o the real-time transport protocol (RTP), to carry data that has 159 real-time properties. 161 o the RTP control protocol (RTCP), to monitor the quality of 162 service and to convey information about the participants in an 163 on-going session. The latter aspect of RTCP may be sufficient 164 for "loosely controlled" sessions, i.e., where there is no 165 explicit membership control and set-up, but it is not 166 necessarily intended to support all of an application's 167 control communication requirements. This functionality may be 168 fully or partially subsumed by a separate session control 169 protocol, which is beyond the scope of this document. 171 RTP represents a new style of protocol following the principles of 172 application level framing and integrated layer processing proposed by 173 Clark and Tennenhouse [1]. That is, RTP is intended to be malleable 174 to provide the information required by a particular application and 175 will often be integrated into the application processing rather than 176 being implemented as a separate layer. RTP is a protocol framework 177 that is deliberately not complete. This document specifies those 178 functions expected to be common across all the applications for which 179 RTP would be appropriate. Unlike conventional protocols in which 180 additional functions might be accommodated by making the protocol 181 more general or by adding an option mechanism that would require 182 parsing, RTP is intended to be tailored through modifications and/or 183 additions to the headers as needed. Examples are given in Sections 184 5.3 and 6.4.3. 186 Therefore, in addition to this document, a complete specification of 187 RTP for a particular application will require one or more companion 188 documents (see Section 13): 190 o a profile specification document, which defines a set of 191 payload type codes and their mapping to payload formats (e.g., 192 media encodings). A profile may also define extensions or 193 modifications to RTP that are specific to a particular class 194 of applications. Typically an application will operate under 195 only one profile. A profile for audio and video data may be 196 found in the companion RFC 1890 (updated by Internet-Draft 197 draft-ietf-avt-profile-new [2]). 199 o payload format specification documents, which define how a 200 particular payload, such as an audio or video encoding, is to 201 be carried in RTP. 203 A discussion of real-time services and algorithms for their 204 implementation as well as background discussion on some of the RTP 205 design decisions can be found in [3]. 207 1.1 Terminology 209 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 210 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 211 document are to be interpreted as described in RFC 2119 [4] and 212 indicate requirement levels for compliant RTP implementations. 214 2 RTP Use Scenarios 216 The following sections describe some aspects of the use of RTP. The 217 examples were chosen to illustrate the basic operation of 218 applications using RTP, not to limit what RTP may be used for. In 219 these examples, RTP is carried on top of IP and UDP, and follows the 220 conventions established by the profile for audio and video specified 221 in the companion RFC 1890 (updated by Internet-Draft draft-ietf-avt- 222 profile-new ). 224 2.1 Simple Multicast Audio Conference 226 A working group of the IETF meets to discuss the latest protocol 227 draft, using the IP multicast services of the Internet for voice 228 communications. Through some allocation mechanism the working group 229 chair obtains a multicast group address and pair of ports. One port 230 is used for audio data, and the other is used for control (RTCP) 231 packets. This address and port information is distributed to the 232 intended participants. If privacy is desired, the data and control 233 packets may be encrypted as specified in Section 9.1, in which case 234 an encryption key must also be generated and distributed. The exact 235 details of these allocation and distribution mechanisms are beyond 236 the scope of RTP. 238 The audio conferencing application used by each conference 239 participant sends audio data in small chunks of, say, 20 ms duration. 240 Each chunk of audio data is preceded by an RTP header; RTP header and 241 data are in turn contained in a UDP packet. The RTP header indicates 242 what type of audio encoding (such as PCM, ADPCM or LPC) is contained 243 in each packet so that senders can change the encoding during a 244 conference, for example, to accommodate a new participant that is 245 connected through a low-bandwidth link or react to indications of 246 network congestion. 248 The Internet, like other packet networks, occasionally loses and 249 reorders packets and delays them by variable amounts of time. To cope 250 with these impairments, the RTP header contains timing information 251 and a sequence number that allow the receivers to reconstruct the 252 timing produced by the source, so that in this example, chunks of 253 audio are contiguously played out the speaker every 20 ms. This 254 timing reconstruction is performed separately for each source of RTP 255 packets in the conference. The sequence number can also be used by 256 the receiver to estimate how many packets are being lost. 258 Since members of the working group join and leave during the 259 conference, it is useful to know who is participating at any moment 260 and how well they are receiving the audio data. For that purpose, 261 each instance of the audio application in the conference periodically 262 multicasts a reception report plus the name of its user on the RTCP 263 (control) port. The reception report indicates how well the current 264 speaker is being received and may be used to control adaptive 265 encodings. In addition to the user name, other identifying 266 information may also be included subject to control bandwidth limits. 267 A site sends the RTCP BYE packet (Section 6.6) when it leaves the 268 conference. 270 2.2 Audio and Video Conference 272 If both audio and video media are used in a conference, they are 273 transmitted as separate RTP sessions RTCP packets are transmitted for 274 each medium using two different UDP port pairs and/or multicast 275 addresses. There is no direct coupling at the RTP level between the 276 audio and video sessions, except that a user participating in both 277 sessions should use the same distinguished (canonical) name in the 278 RTCP packets for both so that the sessions can be associated. 280 One motivation for this separation is to allow some participants in 281 the conference to receive only one medium if they choose. Further 282 explanation is given in Section 5.2. Despite the separation, 283 synchronized playback of a source's audio and video can be achieved 284 using timing information carried in the RTCP packets for both 285 sessions. 287 2.3 Mixers and Translators 288 So far, we have assumed that all sites want to receive media data in 289 the same format. However, this may not always be appropriate. 290 Consider the case where participants in one area are connected 291 through a low-speed link to the majority of the conference 292 participants who enjoy high-speed network access. Instead of forcing 293 everyone to use a lower-bandwidth, reduced-quality audio encoding, an 294 RTP-level relay called a mixer may be placed near the low-bandwidth 295 area. This mixer resynchronizes incoming audio packets to reconstruct 296 the constant 20 ms spacing generated by the sender, mixes these 297 reconstructed audio streams into a single stream, translates the 298 audio encoding to a lower-bandwidth one and forwards the lower- 299 bandwidth packet stream across the low-speed link. These packets 300 might be unicast to a single recipient or multicast on a different 301 address to multiple recipients. The RTP header includes a means for 302 mixers to identify the sources that contributed to a mixed packet so 303 that correct talker indication can be provided at the receivers. 305 Some of the intended participants in the audio conference may be 306 connected with high bandwidth links but might not be directly 307 reachable via IP multicast. For example, they might be behind an 308 application-level firewall that will not let any IP packets pass. For 309 these sites, mixing may not be necessary, in which case another type 310 of RTP-level relay called a translator may be used. Two translators 311 are installed, one on either side of the firewall, with the outside 312 one funneling all multicast packets received through a secure 313 connection to the translator inside the firewall. The translator 314 inside the firewall sends them again as multicast packets to a 315 multicast group restricted to the site's internal network. 317 Mixers and translators may be designed for a variety of purposes. An 318 example is a video mixer that scales the images of individual people 319 in separate video streams and composites them into one video stream 320 to simulate a group scene. Other examples of translation include the 321 connection of a group of hosts speaking only IP/UDP to a group of 322 hosts that understand only ST-II, or the packet-by-packet encoding 323 translation of video streams from individual sources without 324 resynchronization or mixing. Details of the operation of mixers and 325 translators are given in Section 7. 327 2.4 Layered Encodings 329 Multimedia applications should be able to adjust the transmission 330 rate to match the capacity of the receiver or to adapt to network 331 congestion. Many implementations place the responsibility of rate- 332 adaptivity at the source. This does not work well with multicast 333 transmission because of the conflicting bandwidth requirements of 334 heterogeneous receivers. The result is often a least-common 335 denominator scenario, where the smallest pipe in the network mesh 336 dictates the quality and fidelity of the overall live multimedia 337 "broadcast". 339 Instead, responsibility for rate-adaptation can be placed at the 340 receivers by combining a layered encoding with a layered transmission 341 system. In the context of RTP over IP multicast, the source can 342 stripe the progressive layers of a hierarchically represented signal 343 across multiple RTP sessions each carried on its own multicast group. 344 Receivers can then adapt to network heterogeneity and control their 345 reception bandwidth by joining only the appropriate subset of the 346 multicast groups. 348 Details of the use of RTP with layered encodings are given in 349 Sections 6.3.9, 8.3 and 11. 351 3 Definitions 353 RTP payload: The data transported by RTP in a packet, for 354 example audio samples or compressed video data. The payload 355 format and interpretation are beyond the scope of this 356 document. 358 RTP packet: A data packet consisting of the fixed RTP header, a 359 possibly empty list of contributing sources (see below), 360 and the payload data. Some underlying protocols may require 361 an encapsulation of the RTP packet to be defined. Typically 362 one packet of the underlying protocol contains a single RTP 363 packet, but several RTP packets MAY be contained if 364 permitted by the encapsulation method (see Section 11). 366 RTCP packet: A control packet consisting of a fixed header part 367 similar to that of RTP data packets, followed by structured 368 elements that vary depending upon the RTCP packet type. The 369 formats are defined in Section 6. Typically, multiple RTCP 370 packets are sent together as a compound RTCP packet in a 371 single packet of the underlying protocol; this is enabled 372 by the length field in the fixed header of each RTCP 373 packet. 375 Port: The "abstraction that transport protocols use to 376 distinguish among multiple destinations within a given host 377 computer. TCP/IP protocols identify ports using small 378 positive integers." [5] The transport selectors (TSEL) used 379 by the OSI transport layer are equivalent to ports. RTP 380 depends upon the lower-layer protocol to provide some 381 mechanism such as ports to multiplex the RTP and RTCP 382 packets of a session. 384 Transport address: The combination of a network address and port 385 that identifies a transport-level endpoint, for example an 386 IP address and a UDP port. Packets are transmitted from a 387 source transport address to a destination transport 388 address. 390 RTP media type: An RTP media type is the collection of payload 391 types which can be carried within a single RTP session. The 392 RTP Profile assigns RTP media types to RTP payload types. 394 RTP session: The association among a set of participants 395 communicating with RTP. For each participant, the session 396 is defined by a particular pair of destination transport 397 addresses (one network address plus a port pair for RTP and 398 RTCP). The destination transport address pair may be common 399 for all participants, as in the case of IP multicast, or 400 may be different for each, as in the case of individual 401 unicast network addresses and port pairs. In a multimedia 402 session, each medium is carried in a separate RTP session 403 with its own RTCP packets. The multiple RTP sessions are 404 distinguished by different port number pairs and/or 405 different multicast addresses. 407 Synchronization source (SSRC): The source of a stream of RTP 408 packets, identified by a 32-bit numeric SSRC identifier 409 carried in the RTP header so as not to be dependent upon 410 the network address. All packets from a synchronization 411 source form part of the same timing and sequence number 412 space, so a receiver groups packets by synchronization 413 source for playback. Examples of synchronization sources 414 include the sender of a stream of packets derived from a 415 signal source such as a microphone or a camera, or an RTP 416 mixer (see below). A synchronization source may change its 417 data format, e.g., audio encoding, over time. The SSRC 418 identifier is a randomly chosen value meant to be globally 419 unique within a particular RTP session (see Section 8). A 420 participant need not use the same SSRC identifier for all 421 the RTP sessions in a multimedia session; the binding of 422 the SSRC identifiers is provided through RTCP (see Section 423 6.5.1). If a participant generates multiple streams in one 424 RTP session, for example from separate video cameras, each 425 MUST be identified as a different SSRC. 427 Contributing source (CSRC): A source of a stream of RTP packets 428 that has contributed to the combined stream produced by an 429 RTP mixer (see below). The mixer inserts a list of the SSRC 430 identifiers of the sources that contributed to the 431 generation of a particular packet into the RTP header of 432 that packet. This list is called the CSRC list. An example 433 application is audio conferencing where a mixer indicates 434 all the talkers whose speech was combined to produce the 435 outgoing packet, allowing the receiver to indicate the 436 current talker, even though all the audio packets contain 437 the same SSRC identifier (that of the mixer). 439 End system: An application that generates the content to be sent 440 in RTP packets and/or consumes the content of received RTP 441 packets. An end system can act as one or more 442 synchronization sources in a particular RTP session, but 443 typically only one. 445 Mixer: An intermediate system that receives RTP packets from one 446 or more sources, possibly changes the data format, combines 447 the packets in some manner and then forwards a new RTP 448 packet. Since the timing among multiple input sources will 449 not generally be synchronized, the mixer will make timing 450 adjustments among the streams and generate its own timing 451 for the combined stream. Thus, all data packets originating 452 from a mixer will be identified as having the mixer as 453 their synchronization source. 455 Translator: An intermediate system that forwards RTP packets 456 with their synchronization source identifier intact. 457 Examples of translators include devices that convert 458 encodings without mixing, replicators from multicast to 459 unicast, and application-level filters in firewalls. 461 Monitor: An application that receives RTCP packets sent by 462 participants in an RTP session, in particular the reception 463 reports, and estimates the current quality of service for 464 distribution monitoring, fault diagnosis and long-term 465 statistics. The monitor function is likely to be built into 466 the application(s) participating in the session, but may 467 also be a separate application that does not otherwise 468 participate and does not send or receive the RTP data 469 packets (since they are on a separate port). These are 470 called third-party monitors. It is also acceptable for a 471 third-party monitor to receive the RTP data packets but not 472 send RTCP packets or otherwise be counted in the session. 474 Non-RTP means: Protocols and mechanisms that may be needed in 475 addition to RTP to provide a usable service. In particular, 476 for multimedia conferences, a control protocol may 477 distribute multicast addresses and keys for encryption, 478 negotiate the encryption algorithm to be used, and define 479 dynamic mappings between RTP payload type values and the 480 payload formats they represent for formats that do not have 481 a predefined payload type value. Examples of such protocols 482 include the Session Initiation Protocol (SIP) (RFC 2543 483 [6]), H.323 [7] and applications using SDP (RFC 2327 [8]), 484 such as RTSP (RFC 2326 [9]). For simple applications, 485 electronic mail or a conference database may also be used. 486 The specification of such protocols and mechanisms is 487 outside the scope of this document. 489 4 Byte Order, Alignment, and Time Format 491 All integer fields are carried in network byte order, that is, most 492 significant byte (octet) first. This byte order is commonly known as 493 big-endian. The transmission order is described in detail in [10]. 494 Unless otherwise noted, numeric constants are in decimal (base 10). 496 All header data is aligned to its natural length, i.e., 16-bit fields 497 are aligned on even offsets, 32-bit fields are aligned at offsets 498 divisible by four, etc. Octets designated as padding have the value 499 zero. 501 Wallclock time (absolute date and time) is represented using the 502 timestamp format of the Network Time Protocol (NTP), which is in 503 seconds relative to 0h UTC on 1 January 1900 [11]. The full 504 resolution NTP timestamp is a 64-bit unsigned fixed-point number with 505 the integer part in the first 32 bits and the fractional part in the 506 last 32 bits. In some fields where a more compact representation is 507 appropriate, only the middle 32 bits are used; that is, the low 16 508 bits of the integer part and the high 16 bits of the fractional part. 509 The high 16 bits of the integer part must be determined 510 independently. 512 An implementation is not required to run the Network Time Protocol in 513 order to use RTP. Other time sources, or none at all, may be used 514 (see the description of the NTP timestamp field in Section 6.4.1). 515 However, running NTP may be useful for synchronizing streams 516 transmitted from separate hosts. 518 The NTP timestamp will wrap around to zero some time in the year 519 2036, but for RTP purposes, only differences between pairs of NTP 520 timestamps are used. So long as the pairs of timestamps can be 521 assumed to be within 68 years of each other, using modulo arithmetic 522 for subtractions and comparisons makes the wraparound irrelevant. 524 5 RTP Data Transfer Protocol 526 5.1 RTP Fixed Header Fields 527 The RTP header has the following format: 529 0 1 2 3 530 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 531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 532 |V=2|P|X| CC |M| PT | sequence number | 533 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 534 | timestamp | 535 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 536 | synchronization source (SSRC) identifier | 537 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 538 | contributing source (CSRC) identifiers | 539 | .... | 540 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 542 The first twelve octets are present in every RTP packet, while the 543 list of CSRC identifiers is present only when inserted by a mixer. 544 The fields have the following meaning: 546 version (V): 2 bits 547 This field identifies the version of RTP. The version 548 defined by this specification is two (2). (The value 1 is 549 used by the first draft version of RTP and the value 0 is 550 used by the protocol initially implemented in the "vat" 551 audio tool.) 553 padding (P): 1 bit 554 If the padding bit is set, the packet contains one or more 555 additional padding octets at the end which are not part of 556 the payload. The last octet of the padding contains a count 557 of how many padding octets should be ignored, including 558 itself. Padding may be needed by some encryption 559 algorithms with fixed block sizes or for carrying several 560 RTP packets in a lower-layer protocol data unit. 562 extension (X): 1 bit 563 If the extension bit is set, the fixed header MUST be 564 followed by exactly one header extension, with a format 565 defined in Section 5.3.1. 567 CSRC count (CC): 4 bits 568 The CSRC count contains the number of CSRC identifiers that 569 follow the fixed header. 571 marker (M): 1 bit 572 The interpretation of the marker is defined by a profile. 573 It is intended to allow significant events such as frame 574 boundaries to be marked in the packet stream. A profile MAY 575 define additional marker bits or specify that there is no 576 marker bit by changing the number of bits in the payload 577 type field (see Section 5.3). 579 payload type (PT): 7 bits 580 This field identifies the format of the RTP payload and 581 determines its interpretation by the application. A profile 582 MAY specify a default static mapping of payload type codes 583 to payload formats. Additional payload type codes MAY be 584 defined dynamically through non-RTP means (see Section 3). 585 A set of default mappings for audio and video is specified 586 in the companion RFC 1890 (updated by Internet-Draft 587 draft-ietf-avt-profile-new [2]). An RTP source MAY change 588 the payload type during a session, but this field SHOULD 589 NOT be used for multiplexing separate media streams (see 590 Section 5.2). 592 A receiver MUST ignore packets with payload types that it 593 does not understand. 595 sequence number: 16 bits 596 The sequence number increments by one for each RTP data 597 packet sent, and may be used by the receiver to detect 598 packet loss and to restore packet sequence. The initial 599 value of the sequence number SHOULD be random 600 (unpredictable) to make known-plaintext attacks on 601 encryption more difficult, even if the source itself does 602 not encrypt according to the method in Section 9.1, because 603 the packets may flow through a translator that does. 604 Techniques for choosing unpredictable numbers are discussed 605 in [12]. 607 timestamp: 32 bits 608 The timestamp reflects the sampling instant of the first 609 octet in the RTP data packet. The sampling instant MUST be 610 derived from a clock that increments monotonically and 611 linearly in time to allow synchronization and jitter 612 calculations (see Section 6.4.1). The resolution of the 613 clock MUST be sufficient for the desired synchronization 614 accuracy and for measuring packet arrival jitter (one tick 615 per video frame is typically not sufficient). The clock 616 frequency is dependent on the format of data carried as 617 payload and is specified statically in the profile or 618 payload format specification that defines the format, or 619 MAY be specified dynamically for payload formats defined 620 through non-RTP means. If RTP packets are generated 621 periodically, the nominal sampling instant as determined 622 from the sampling clock is to be used, not a reading of the 623 system clock. As an example, for fixed-rate audio the 624 timestamp clock would likely increment by one for each 625 sampling period. If an audio application reads blocks 626 covering 160 sampling periods from the input device, the 627 timestamp would be increased by 160 for each such block, 628 regardless of whether the block is transmitted in a packet 629 or dropped as silent. 631 The initial value of the timestamp SHOULD be random, as for 632 the sequence number. Several consecutive RTP packets will 633 have equal timestamps if they are (logically) generated at 634 once, e.g., belong to the same video frame. Consecutive RTP 635 packets MAY contain timestamps that are not monotonic if 636 the data is not transmitted in the order it was sampled, as 637 in the case of MPEG interpolated video frames. (The 638 sequence numbers of the packets as transmitted will still 639 be monotonic.) 641 SSRC: 32 bits 642 The SSRC field identifies the synchronization source. This 643 identifier SHOULD be chosen randomly, with the intent that 644 no two synchronization sources within the same RTP session 645 will have the same SSRC identifier. An example algorithm 646 for generating a random identifier is presented in Appendix 647 A.6. Although the probability of multiple sources choosing 648 the same identifier is low, all RTP implementations must be 649 prepared to detect and resolve collisions. Section 8 650 describes the probability of collision along with a 651 mechanism for resolving collisions and detecting RTP-level 652 forwarding loops based on the uniqueness of the SSRC 653 identifier. If a source changes its source transport 654 address, it must also choose a new SSRC identifier to avoid 655 being interpreted as a looped source (see Section 8.2). 657 CSRC list: 0 to 15 items, 32 bits each 658 The CSRC list identifies the contributing sources for the 659 payload contained in this packet. The number of identifiers 660 is given by the CC field. If there are more than 15 661 contributing sources, only 15 can be identified. CSRC 662 identifiers are inserted by mixers (see Section 7.1), using 663 the SSRC identifiers of contributing sources. For example, 664 for audio packets the SSRC identifiers of all sources that 665 were mixed together to create a packet are listed, allowing 666 correct talker indication at the receiver. 668 5.2 Multiplexing RTP Sessions 670 For efficient protocol processing, the number of multiplexing points 671 should be minimized, as described in the integrated layer processing 672 design principle [1]. In RTP, multiplexing is provided by the 673 destination transport address (network address and port number) which 674 define an RTP session. For example, in a teleconference composed of 675 audio and video media encoded separately, each medium SHOULD be 676 carried in a separate RTP session with its own destination transport 677 address. 679 Separate audio and video streams SHOULD NOT be carried in a single 680 RTP session and demultiplexed based on the payload type or SSRC 681 fields. Interleaving packets with different RTP media types but using 682 the same SSRC would introduce several problems: 684 1. If, say, two audio streams shared the same RTP session and 685 the same SSRC value, and one were to change encodings and 686 thus acquire a different RTP payload type, there would be 687 no general way of identifying which stream had changed 688 encodings. 690 2. An SSRC is defined to identify a single timing and sequence 691 number space. Interleaving multiple payload types would 692 require different timing spaces if the media clock rates 693 differ and would require different sequence number spaces 694 to tell which payload type suffered packet loss. 696 3. The RTCP sender and receiver reports (see Section 6.4) can 697 only describe one timing and sequence number space per SSRC 698 and do not carry a payload type field. 700 4. An RTP mixer would not be able to combine interleaved 701 streams of incompatible media into one stream. 703 5. Carrying multiple media in one RTP session precludes: the 704 use of different network paths or network resource 705 allocations if appropriate; reception of a subset of the 706 media if desired, for example just audio if video would 707 exceed the available bandwidth; and receiver 708 implementations that use separate processes for the 709 different media, whereas using separate RTP sessions 710 permits either single- or multiple-process implementations. 712 Using a different SSRC for each medium but sending them in the same 713 RTP session would avoid the first three problems but not the last 714 two. 716 5.3 Profile-Specific Modifications to the RTP Header 718 The existing RTP data packet header is believed to be complete for 719 the set of functions required in common across all the application 720 classes that RTP might support. However, in keeping with the ALF 721 design principle, the header MAY be tailored through modifications or 722 additions defined in a profile specification while still allowing 723 profile-independent monitoring and recording tools to function. 725 o The marker bit and payload type field carry profile-specific 726 information, but they are allocated in the fixed header since 727 many applications are expected to need them and might 728 otherwise have to add another 32-bit word just to hold them. 729 The octet containing these fields MAY be redefined by a 730 profile to suit different requirements, for example with a 731 more or fewer marker bits. If there are any marker bits, one 732 SHOULD be located in the most significant bit of the octet 733 since profile-independent monitors may be able to observe a 734 correlation between packet loss patterns and the marker bit. 736 o Additional information that is required for a particular 737 payload format, such as a video encoding, SHOULD be carried in 738 the payload section of the packet. This might be in a header 739 that is always present at the start of the payload section, or 740 might be indicated by a reserved value in the data pattern. 742 o If a particular class of applications needs additional 743 functionality independent of payload format, the profile under 744 which those applications operate SHOULD define additional 745 fixed fields to follow immediately after the SSRC field of the 746 existing fixed header. Those applications will be able to 747 quickly and directly access the additional fields while 748 profile-independent monitors or recorders can still process 749 the RTP packets by interpreting only the first twelve octets. 751 If it turns out that additional functionality is needed in common 752 across all profiles, then a new version of RTP should be defined to 753 make a permanent change to the fixed header. 755 5.3.1 RTP Header Extension 757 An extension mechanism is provided to allow individual 758 implementations to experiment with new payload-format-independent 759 functions that require additional information to be carried in the 760 RTP data packet header. This mechanism is designed so that the header 761 extension may be ignored by other interoperating implementations that 762 have not been extended. 764 Note that this header extension is intended only for limited use. 765 Most potential uses of this mechanism would be better done another 766 way, using the methods described in the previous section. For 767 example, a profile-specific extension to the fixed header is less 768 expensive to process because it is not conditional nor in a variable 769 location. Additional information required for a particular payload 770 format SHOULD NOT use this header extension, but SHOULD be carried in 771 the payload section of the packet. 773 0 1 2 3 774 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 775 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 776 | defined by profile | length | 777 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 778 | header extension | 779 | .... | 781 If the X bit in the RTP header is one, a variable-length header 782 extension MUST be appended to the RTP header, following the CSRC list 783 if present. The header extension contains a 16-bit length field that 784 counts the number of 32-bit words in the extension, excluding the 785 four-octet extension header (therefore zero is a valid length). Only 786 a single extension can be appended to the RTP data header. To allow 787 multiple interoperating implementations to each experiment 788 independently with different header extensions, or to allow a 789 particular implementation to experiment with more than one type of 790 header extension, the first 16 bits of the header extension are left 791 open for distinguishing identifiers or parameters. The format of 792 these 16 bits is to be defined by the profile specification under 793 which the implementations are operating. This RTP specification does 794 not define any header extensions itself. 796 6 RTP Control Protocol -- RTCP 798 The RTP control protocol (RTCP) is based on the periodic transmission 799 of control packets to all participants in the session, using the same 800 distribution mechanism as the data packets. The underlying protocol 801 MUST provide multiplexing of the data and control packets, for 802 example using separate port numbers with UDP. RTCP performs four 803 functions: 805 1. The primary function is to provide feedback on the quality 806 of the data distribution. This is an integral part of the 807 RTP's role as a transport protocol and is related to the 808 flow and congestion control functions of other transport 809 protocols (see Section 10 on the requirement for congestion 810 control). The feedback may be directly useful for control 811 of adaptive encodings [13,14], but experiments with IP 812 multicasting have shown that it is also critical to get 813 feedback from the receivers to diagnose faults in the 814 distribution. Sending reception feedback reports to all 815 participants allows one who is observing problems to 816 evaluate whether those problems are local or global. With a 817 distribution mechanism like IP multicast, it is also 818 possible for an entity such as a network service provider 819 who is not otherwise involved in the session to receive the 820 feedback information and act as a third-party monitor to 821 diagnose network problems. This feedback function is 822 performed by the RTCP sender and receiver reports, 823 described below in Section 6.4. 825 2. RTCP carries a persistent transport-level identifier for an 826 RTP source called the canonical name or CNAME, Section 827 6.5.1. Since the SSRC identifier may change if a conflict 828 is discovered or a program is restarted, receivers require 829 the CNAME to keep track of each participant. Receivers may 830 also require the CNAME to associate multiple data streams 831 from a given participant in a set of related RTP sessions, 832 for example to synchronize audio and video. Inter-media 833 synchronization also requires the NTP and RTP timestamps 834 included in RTCP packets by data senders. 836 3. The first two functions require that all participants send 837 RTCP packets, therefore the rate must be controlled in 838 order for RTP to scale up to a large number of 839 participants. By having each participant send its control 840 packets to all the others, each can independently observe 841 the number of participants. This number is used to 842 calculate the rate at which the packets are sent, as 843 explained in Section 6.2. 845 4. A fourth, OPTIONAL function is to convey minimal session 846 control information, for example participant identification 847 to be displayed in the user interface. This is most likely 848 to be useful in "loosely controlled" sessions where 849 participants enter and leave without membership control or 850 parameter negotiation. RTCP serves as a convenient channel 851 to reach all the participants, but it is not necessarily 852 expected to support all the control communication 853 requirements of an application. A higher-level session 854 control protocol, which is beyond the scope of this 855 document, may be needed. 857 Functions 1-3 SHOULD be used in all environments, but particularly in 858 the IP multicast environment. RTP application designers SHOULD avoid 859 mechanisms that can only work in unicast mode and will not scale to 860 larger numbers. Transmission of RTCP MAY be controlled separately for 861 senders and receivers, as described in Section 6.2, for cases such as 862 unidirectional links where feedback from receivers is not possible. 864 6.1 RTCP Packet Format 866 This specification defines several RTCP packet types to carry a 867 variety of control information: 869 SR: Sender report, for transmission and reception statistics 870 from participants that are active senders 872 RR: Receiver report, for reception statistics from participants 873 that are not active senders and in combination with SR for 874 active senders reporting on more than 31 sources 876 SDES: Source description items, including CNAME 878 BYE: Indicates end of participation 880 APP: Application specific functions 882 Each RTCP packet begins with a fixed part similar to that of RTP data 883 packets, followed by structured elements that MAY be of variable 884 length according to the packet type but MUST end on a 32-bit 885 boundary. The alignment requirement and a length field in the fixed 886 part of each packet are included to make RTCP packets "stackable". 887 Multiple RTCP packets can be concatenated without any intervening 888 separators to form a compound RTCP packet that is sent in a single 889 packet of the lower layer protocol, for example UDP. There is no 890 explicit count of individual RTCP packets in the compound packet 891 since the lower layer protocols are expected to provide an overall 892 length to determine the end of the compound packet. 894 Each individual RTCP packet in the compound packet may be processed 895 independently with no requirements upon the order or combination of 896 packets. However, in order to perform the functions of the protocol, 897 the following constraints are imposed: 899 o Reception statistics (in SR or RR) should be sent as often as 900 bandwidth constraints will allow to maximize the resolution of 901 the statistics, therefore each periodically transmitted 902 compound RTCP packet MUST include a report packet. 904 o New receivers need to receive the CNAME for a source as soon 905 as possible to identify the source and to begin associating 906 media for purposes such as lip-sync, so each compound RTCP 907 packet MUST also include the SDES CNAME. 909 o The number of packet types that may appear first in the 910 compound packet needs to be limited to increase the number of 911 constant bits in the first word and the probability of 912 successfully validating RTCP packets against misaddressed RTP 913 data packets or other unrelated packets. 915 Thus, all RTCP packets MUST be sent in a compound packet of at least 916 two individual packets, with the following format: 918 Encryption prefix: If and only if the compound packet is to be 919 encrypted according to the method in Section 9.1, it MUST 920 be prefixed by a random 32-bit quantity redrawn for every 921 compound packet transmitted. If padding is required for 922 the encryption, it MUST be added to the last packet of the 923 compound packet. 925 SR or RR: The first RTCP packet in the compound packet MUST 926 always be a report packet to facilitate header validation 927 as described in Appendix A.2. This is true even if no data 928 has been sent or received, in which case an empty RR MUST 929 be sent, and even if the only other RTCP packet in the 930 compound packet is a BYE. 932 Additional RRs: If the number of sources for which reception 933 statistics are being reported exceeds 31, the number that 934 will fit into one SR or RR packet, then additional RR 935 packets SHOULD follow the initial report packet. 937 SDES: An SDES packet containing a CNAME item MUST be included 938 in each compound RTCP packet. Other source description 939 items MAY optionally be included if required by a 940 particular application, subject to bandwidth constraints 941 (see Section 6.3.9). 943 BYE or APP: Other RTCP packet types, including those yet to be 944 defined, MAY follow in any order, except that BYE SHOULD be 945 the last packet sent with a given SSRC/CSRC. Packet types 946 MAY appear more than once. 948 It is RECOMMENDED that translators and mixers combine individual RTCP 949 packets from the multiple sources they are forwarding into one 950 compound packet whenever feasible in order to amortize the packet 951 overhead (see Section 7). An example RTCP compound packet as might be 952 produced by a mixer is shown in Fig. 1. If the overall length of a 953 compound packet would exceed the maximum transmission unit (MTU) of 954 the network path, it SHOULD be segmented into multiple shorter 955 compound packets to be transmitted in separate packets of the 956 underlying protocol. Note that each of the compound packets MUST 957 begin with an SR or RR packet. 959 An implementation SHOULD ignore incoming RTCP packets with types 960 unknown to it. Additional RTCP packet types may be registered with 961 the Internet Assigned Numbers Authority (IANA) as described in 962 Section 14. 964 if encrypted: random 32-bit integer 965 | 966 |[--------- packet --------][---------- packet ----------][-packet-] 967 | 968 | receiver chunk chunk 969 V reports item item item item 970 -------------------------------------------------------------------- 971 R[SR #sendinfo #site1#site2][SDES #CNAME PHONE #CNAME LOC][BYE##why] 972 -------------------------------------------------------------------- 973 | | 974 |<----------------------- compound packet ----------------------->| 975 |<-------------------------- UDP packet ------------------------->| 977 #: SSRC/CSRC identifier 979 Figure 1: Example of an RTCP compound packet 981 6.2 RTCP Transmission Interval 983 RTP is designed to allow an application to scale automatically over 984 session sizes ranging from a few participants to thousands. For 985 example, in an audio conference the data traffic is inherently self- 986 limiting because only one or two people will speak at a time, so with 987 multicast distribution the data rate on any given link remains 988 relatively constant independent of the number of participants. 989 However, the control traffic is not self-limiting. If the reception 990 reports from each participant were sent at a constant rate, the 991 control traffic would grow linearly with the number of participants. 992 Therefore, the rate must be scaled down by dynamically calculating 993 the interval between RTCP packet transmissions. 995 For each session, it is assumed that the data traffic is subject to 996 an aggregate limit called the "session bandwidth" to be divided among 997 the participants. This bandwidth might be reserved and the limit 998 enforced by the network. If there is no reservation, there may be 999 other constraints, depending on the environment, that establish the 1000 "reasonable" maximum for the session to use, and that would be the 1001 session bandwidth. The session bandwidth may be chosen based or some 1002 cost or a priori knowledge of the available network bandwidth for the 1003 session. It is somewhat independent of the media encoding, but the 1004 encoding choice may be limited by the session bandwidth. Often, the 1005 session bandwidth is the sum of the nominal bandwidths of the senders 1006 expected to be concurrently active. For teleconference audio, this 1007 number would typically be one sender's bandwidth. For layered 1008 encodings, each layer is a separate RTP session with its own session 1009 bandwidth parameter. 1011 The session bandwidth parameter is expected to be supplied by a 1012 session management application when it invokes a media application, 1013 but media applications MAY set a default based on the single-sender 1014 data bandwidth for the encoding selected for the session. The 1015 application MAY also enforce bandwidth limits based on multicast 1016 scope rules or other criteria. All participants MUST use the same 1017 value for the session bandwidth so that the same RTCP interval will 1018 be calculated. 1020 Bandwidth calculations for control and data traffic include lower- 1021 layer transport and network protocols (e.g., UDP and IP) since that 1022 is what the resource reservation system would need to know. The 1023 application can also be expected to know which of these protocols are 1024 in use. Link level headers are not included in the calculation since 1025 the packet will be encapsulated with different link level headers as 1026 it travels. 1028 The control traffic should be limited to a small and known fraction 1029 of the session bandwidth: small so that the primary function of the 1030 transport protocol to carry data is not impaired; known so that the 1031 control traffic can be included in the bandwidth specification given 1032 to a resource reservation protocol, and so that each participant can 1033 independently calculate its share. It is RECOMMENDED that the 1034 fraction of the session bandwidth allocated to RTCP be fixed at 5%. 1035 It is also RECOMMENDED that 1/4 of the RTCP bandwidth be dedicated to 1036 participants that are sending data so that in sessions with a large 1037 number of receivers but a small number of senders, newly joining 1038 participants will more quickly receive the CNAME for the sending 1039 sites. When the proportion of senders is greater than 1/4 of the 1040 participants, the senders get their proportion of the full RTCP 1041 bandwidth. While the values of these and other constants in the 1042 interval calculation are not critical, all participants in the 1043 session MUST use the same values so the same interval will be 1044 calculated. Therefore, these constants SHOULD be fixed for a 1045 particular profile. 1047 A profile MAY specify that the control traffic bandwidth may be a 1048 separate parameter of the session rather than a strict percentage of 1049 the session bandwidth. Using a separate parameter allows rate- 1050 adaptive applications to set an RTCP bandwidth consistent with a 1051 "typical" data bandwidth that is lower than the maximum bandwidth 1052 specified by the session bandwidth parameter. 1054 The profile MAY further specify that the control traffic bandwidth 1055 may be divided into two separate session parameters for those 1056 participants which are active data senders and those which are not. 1057 Following the recommendation that 1/4 of the RTCP bandwidth be 1058 dedicated to data senders, the RECOMMENDED default values for these 1059 two parameters would be 1.25% and 3.75%, respectively. When the 1060 proportion of senders is greater than 1/4 of the participants, the 1061 senders get their proportion of the sum of these parameters. Using 1062 two parameters allows RTCP reception reports to be turned off 1063 entirely for a particular session by setting the RTCP bandwidth for 1064 non-data-senders to zero while keeping the RTCP bandwidth for data 1065 senders non-zero so that sender reports can still be sent for inter- 1066 media synchronization. This may be appropriate for systems operating 1067 on unidirectional links or for sessions that don't require feedback 1068 on the quality of reception. 1070 The calculated interval between transmissions of compound RTCP 1071 packets SHOULD also have a lower bound to avoid having bursts of 1072 packets exceed the allowed bandwidth when the number of participants 1073 is small and the traffic isn't smoothed according to the law of large 1074 numbers. It also keeps the report interval from becoming too small 1075 during transient outages like a network partition such that 1076 adaptation is delayed when the partition heals. At application 1077 startup, a delay SHOULD be imposed before the first compound RTCP 1078 packet is sent to allow time for RTCP packets to be received from 1079 other participants so the report interval will converge to the 1080 correct value more quickly. This delay MAY be set to half the 1081 minimum interval to allow quicker notification that the new 1082 participant is present. The RECOMMENDED value for a fixed minimum 1083 interval is 5 seconds. 1085 An implementation MAY scale the minimum RTCP interval to a smaller 1086 value inversely proportional to the session bandwidth parameter with 1087 the following limitations: 1089 o For multicast sessions, only active data senders MAY use the 1090 reduced minimum value to calculate the interval for 1091 transmission of compound RTCP packets. 1093 o For unicast sessions, the reduced value MAY be used by 1094 participants that are not active data senders as well, and the 1095 delay before sending the initial compound RTCP packet MAY be 1096 zero. 1098 o For all sessions, the fixed minimum SHOULD be used when 1099 calculating the participant timeout interval (see Section 1100 6.3.5) so that implementations which do not use the reduced 1101 value for transmitting RTCP packets are not timed out by other 1102 participants prematurely. 1104 o The RECOMMENDED value for the reduced minimum in seconds is 1105 360 divided by the session bandwidth in kilobits/second. This 1106 minimum is smaller than 5 seconds for bandwidths greater than 1107 72 kb/s. 1109 The algorithm described in Section 6.3 and Appendix A.7 was designed 1110 to meet the goals outlined in this section. It calculates the 1111 interval between sending compound RTCP packets to divide the allowed 1112 control traffic bandwidth among the participants. This allows an 1113 application to provide fast response for small sessions where, for 1114 example, identification of all participants is important, yet 1115 automatically adapt to large sessions. The algorithm incorporates the 1116 following characteristics: 1118 o The calculated interval between RTCP packets scales linearly 1119 with the number of members in the group. It is this linear 1120 factor which allows for a constant amount of control traffic 1121 when summed across all members. 1123 o The interval between RTCP packets is varied randomly over the 1124 range [0.5,1.5] times the calculated interval to avoid 1125 unintended synchronization of all participants [15]. The 1126 first RTCP packet sent after joining a session is also delayed 1127 by a random variation of half the minimum RTCP interval. 1129 o A dynamic estimate of the average compound RTCP packet size is 1130 calculated, including all those received and sent, to 1131 automatically adapt to changes in the amount of control 1132 information carried. 1134 o Since the calculated interval is dependent on the number of 1135 observed group members, there may be undesirable startup 1136 effects when a new user joins an existing session, or many 1137 users simultaneously join a new session. These new users will 1138 initially have incorrect estimates of the group membership, 1139 and thus their RTCP transmission interval will be too short. 1140 This problem can be significant if many users join the session 1141 simultaneously. To deal with this, an algorithm called "timer 1142 reconsideration" is employed. This algorithm implements a 1143 simple back-off mechanism which causes users to hold back RTCP 1144 packet transmission if the group sizes are increasing. 1146 o When users leave a session, either with a BYE or by timeout, 1147 the group membership decreases, and thus the calculated 1148 interval should decrease. A "reverse reconsideration" 1149 algorithm is used to allow members to more quickly reduce 1150 their intervals in response to group membership decreases. 1152 o BYE packets are given different treatment than other RTCP 1153 packets. When a user leaves a group, and wishes to send a BYE 1154 packet, it may do so before its next scheduled RTCP packet. 1155 However, transmission of BYE's follows a back-off algorithm 1156 which avoids floods of BYE packets should a large number of 1157 members simultaneously leave the session. 1159 This algorithm may be used for sessions in which all participants are 1160 allowed to send. In that case, the session bandwidth parameter is the 1161 product of the individual sender's bandwidth times the number of 1162 participants, and the RTCP bandwidth is 5% of that. 1164 Details of the algorithm's operation are given in the sections that 1165 follow. Appendix A.7 gives an example implementation. 1167 6.2.1 Maintaining the number of session members 1169 Calculation of the RTCP packet interval depends upon an estimate of 1170 the number of sites participating in the session. New sites are added 1171 to the count when they are heard, and an entry for each SHOULD be 1172 created in a table indexed by the SSRC or CSRC identifier (see 1173 Section 8.2) to keep track of them. New entries MAY be considered not 1174 valid until multiple packets carrying the new SSRC have been received 1175 (see Appendix A.1), or until an SDES RTCP packet containing a CNAME 1176 for that SSRC has been received. Entries MAY be deleted from the 1177 table when an RTCP BYE packet with the corresponding SSRC identifier 1178 is received, except that some straggler data packets might arrive 1179 after the BYE and cause the entry to be recreated. Instead, the entry 1180 SHOULD be marked as having received a BYE and then deleted after an 1181 appropriate delay. 1183 A participant MAY mark another site inactive, or delete it if not yet 1184 valid, if no RTP or RTCP packet has been received for a small number 1185 of RTCP report intervals (5 is RECOMMENDED). This provides some 1186 robustness against packet loss. All sites must have the same value 1187 for this multiplier and must calculate roughly the same value for the 1188 RTCP report interval in order for this timeout to work properly. 1189 Therefore, this multiplier SHOULD be fixed for a particular profile. 1191 For sessions with a very large number of participants, it may be 1192 impractical to maintain a table to store the SSRC identifier and 1193 state information for all of them. An implementation MAY use SSRC 1194 sampling, as described in [16], to reduce the storage requirements. 1195 An implementation MAY use any other algorithm with similar 1196 performance. A key requirement is that any algorithm considered 1197 SHOULD NOT substantially underestimate the group size, although it 1198 MAY overestimate. 1200 6.3 RTCP Packet Send and Receive Rules 1202 The rules for how to send, and what to do when receiving an RTCP 1203 packet are outlined here. An implementation that allows operation in 1204 a multicast environment or a multipoint unicast environment MUST meet 1205 the requirements in Section 6.2. Such an implementation MAY use the 1206 algorithm defined in this section to meet those requirements, or MAY 1207 use some other algorithm so long as it provides equivalent or better 1208 performance. An implementation which is constrained to two-party 1209 unicast operation SHOULD still use randomization of the RTCP 1210 transmission interval to avoid unintended synchronization of multiple 1211 instances operating in the same environment, but MAY omit the "timer 1212 reconsideration" and "reverse reconsideration" algorithms in Sections 1213 6.3.3, 6.3.6 and 6.3.7. 1215 To execute these rules, a session participant must maintain several 1216 pieces of state: 1218 tp: the last time an RTCP packet was transmitted; 1220 tc: the current time; 1222 tn: the next scheduled transmission time of an RTCP packet; 1224 pmembers: the estimated number of session members at the time tn 1225 was last recomputed; 1227 members: the most current estimate for the number of session 1228 members; 1230 senders: the most current estimate for the number of senders in 1231 the session; 1233 rtcp_bw: The target RTCP bandwidth, i.e., the total bandwidth 1234 that will be used for RTCP packets by all members of this 1235 session, in octets per second. This will be a specified 1236 fraction of the "session bandwidth" parameter supplied to 1237 the application at startup. 1239 we_sent: Flag that is true if the application has sent data 1240 since the 2nd previous RTCP report was transmitted. 1242 avg_rtcp_size: The average compound RTCP packet size, in octets, 1243 over all RTCP packets sent and received by this 1244 participant. 1246 initial: Flag that is true if the application has not yet sent 1247 an RTCP packet. 1249 Many of these rules make use of the "calculated interval" between 1250 packet transmissions. This interval is described in the following 1251 section. 1253 6.3.1 Computing the RTCP transmission interval 1255 To maintain scalability, the average interval between packets from a 1256 session participant should scale with the group size. This interval 1257 is called the calculated interval. It is obtained by combining a 1258 number of the pieces of state described above. The calculated 1259 interval T is then determined as follows: 1261 1. If there are any senders (senders > 0) in the session, but 1262 the number of senders is less than 25% of the membership 1263 (members), the interval depends on whether the participant 1264 is a sender or not (based on the value of we_sent). If the 1265 participant is a sender (we_sent true), the constant C is 1266 set to the average RTCP packet size (avg_rtcp_size) divided 1267 by 25% of the RTCP bandwidth (rtcp_bw), and the constant n 1268 is set to the number of senders. If we_sent is not true, 1269 the constant C is set to the average RTCP packet size 1270 divided by 75% of the RTCP bandwidth. The constant n is set 1271 to the number of receivers (members - senders). If the 1272 number of senders is greater than 25%, senders and 1273 receivers are treated together. The constant C is set to 1274 the total RTCP bandwidth and n is set to the total number 1275 of members. 1277 2. If the participant has not yet sent an RTCP packet (the 1278 variable initial is true), the constant Tmin is set to 2.5 1279 seconds, else it is set to 5 seconds. 1281 3. The deterministic calculated interval Td is set to 1282 max(Tmin, n*C). 1284 4. The calculated interval T is set to a number uniformly 1285 distributed between 0.5 and 1.5 times the deterministic 1286 calculated interval. 1288 5. The resulting value of T is divided by e-3/2=1.21828 to 1289 compensate for the fact that the timer reconsideration 1290 algorithm converges to a value of the RTCP bandwidth below 1291 the intended average. 1293 This procedure results in an interval which is random, but which, on 1294 average, gives at least 25% of the RTCP bandwidth to senders and the 1295 rest to receivers. If the senders constitute more than one quarter of 1296 the membership, this procedure splits the bandwidth equally among all 1297 participants, on average. 1299 6.3.2 Initialization 1301 Upon joining the session, the participant initializes tp to 0, tc to 1302 0, senders to 0, pmembers to 1, members to 1, we_sent to false, 1303 rtcp_bw to the specified fraction of the session bandwidth, initial 1304 to true, and avg_rtcp_size to the probable size of the first RTCP 1305 packet that the application will later construct. The calculated 1306 interval T is then computed, and the first packet is scheduled for 1307 time tn = T. This means that a transmission timer is set which 1308 expires at time T. Note that an application MAY use any desired 1309 approach for implementing this timer. 1311 The participant adds its own SSRC to the member table. 1313 6.3.3 Receiving an RTP or non-BYE RTCP packet 1315 When an RTP or RTCP packet is received from a participant whose SSRC 1316 is not in the member table, the SSRC is added to the table, and the 1317 value for members is updated once the participant has been validated 1318 as described in Section 6.2.1. The same processing occurs for each 1319 CSRC in a validated RTP packet. 1321 When an RTP packet is received from a participant whose SSRC is not 1322 in the sender table, the SSRC is added to the table, and the value 1323 for senders is updated. 1325 For each compound RTCP packet received, the value of avg_rtcp_size is 1326 updated: avg_rtcp_size = (1/16)*packet_size + (15/16)* avg_rtcp_size, 1327 where packet_size is the size of the RTCP packet just received. 1329 6.3.4 Receiving an RTCP BYE packet 1331 Except as described in Section 6.3.7 for the case when an RTCP BYE is 1332 to be transmitted, if the received packet is an RTCP BYE packet, the 1333 SSRC is checked against the member table. If present, the entry is 1334 removed from the table, and the value for members is updated. The 1335 SSRC is then checked against the sender table. If present, the entry 1336 is removed from the table, and the value for senders is updated. 1338 Furthermore, to make the transmission rate of RTCP packets more 1339 adaptive to changes in group membership, the following "reverse 1340 reconsideration" algorithm SHOULD be executed when a BYE packet is 1341 received that reduces members to a value less than pmembers: 1343 o The value for tn is updated according to the following 1344 formula: tn = tc + (members/pmembers)(tn - tc). 1346 o The value for tp is updated according the following formula: 1347 tp = tc - (members/pmembers)(tc - tp). 1349 o The next RTCP packet is rescheduled for transmission at time 1350 tn, which is now earlier. 1352 o The value of pmembers is set equal to members. 1354 This algorithm does not prevent the group size estimate from 1355 incorrectly dropping to zero for a short time due to premature 1356 timeouts when most participants of a large session leave at once but 1357 some remain. The algorithm does make the estimate return to the 1358 correct value more rapidly. This situation is unusual enough and the 1359 consequences are sufficiently harmless that this problem is deemed 1360 only a secondary concern. 1362 6.3.5 Timing Out an SSRC 1364 At occassional intervals, the participant MUST check to see if any of 1365 the other participants time out. To do this, the participant computes 1366 the deterministic (without the randomization factor) calculated 1367 interval Td for a receiver, that is, with we_sent false. Any other 1368 session member who has not sent an RTP or RTCP packet since time tc - 1369 MTd (M is the timeout multiplier, and defaults to 5) is timed out. 1370 This means that its SSRC is removed from the member list, and members 1371 is updated. A similar check is performed on the sender list. Any 1372 member on the sender list who has not sent an RTP packet since time 1373 tc - 2T (within the last two RTCP report intervals) is removed from 1374 the sender list, and senders is updated. 1376 If any members time out, the reverse reconsideration algorithm 1377 described in Section 6.3.4 SHOULD be performed. 1379 The participant MUST perform this check at least once per RTCP 1380 transmission interval. 1382 6.3.6 Expiration of transmission timer 1383 When the packet transmission timer expires, the participant performs 1384 the following operations: 1386 o The transmission interval T is computed as described in 1387 Section 6.3.1, including the randomization factor. 1389 o If tp + T is less than or equal to tc, an RTCP packet is 1390 transmitted. tp is set to tc, then another value for T is 1391 calculated as in the previous step and tn is set to tc + T. 1392 The transmission timer is set to expire again at time tn. If 1393 tp + T is greater than tc, tn is set to tp + T. No RTCP packet 1394 is transmitted. The transmission timer is set to expire at 1395 time tn. 1397 o pmembers is set to members. 1399 If an RTCP packet is transmitted, the value of initial is set to 1400 FALSE. Furthermore, the value of avg_rtcp_size is updated: 1401 avg_rtcp_size = (1/16)*packet_size + (15/16)* avg_rtcp_size, where 1402 packet_size is the size of the RTCP packet just transmitted. 1404 6.3.7 Transmitting a BYE packet 1406 When a participant wishes to leave a session, a BYE packet is 1407 transmitted to inform the other participants of the event. In order 1408 to avoid a flood of BYE packets when many participants leave the 1409 system, a participant MUST execute the following algorithm if the 1410 number of members is more than 50 when the participant chooses to 1411 leave. This algorithm usurps the normal role of the members variable 1412 to count BYE packets instead: 1414 o When the participant decides to leave the system, tp is reset 1415 to tc, the current time, members and pmembers are initialized 1416 to 1, initial is set to 1, we_sent is set to false, senders is 1417 set to 0, and avg_rtcp_size is set to the size of the BYE 1418 packet. The calculated interval T is computed. The BYE packet 1419 is then scheduled for time tn = tc + T. 1421 o Every time a BYE packet from another participant is received, 1422 members is incremented by 1 regardless of whether that 1423 participant exists in the member table or not, and when SSRC 1424 sampling is in use, regardless of whether or not the BYE SSRC 1425 would be included in the sample. members is NOT incremented 1426 when other RTCP packets or RTP packets are received, but only 1427 for BYE packets. 1429 o Transmission of the BYE packet then follows the rules for 1430 transmitting a regular RTCP packet, as above. 1432 This allows BYE packets to be sent right away, yet controls their 1433 total bandwidth usage. In the worst case, this could cause RTCP 1434 control packets to use twice the bandwidth as normal (10%) -- 5% for 1435 non BYE RTCP packets and 5% for BYE. 1437 A participant that does not want to wait for the above mechanism to 1438 allow transmission of a BYE packet MAY leave the group without 1439 sending a BYE at all. That participant will eventually be timed out 1440 by the other group members. 1442 If the group size estimate members is less than 50 when the 1443 participant decides to leave, the participant MAY send a BYE packet 1444 immediately. Alternatively, the participant MAY choose to execute 1445 the above BYE backoff algorithm. 1447 In either case, a participant which never sent an RTP or RTCP packet 1448 MUST NOT send a BYE packet when they leave the group. 1450 6.3.8 Updating we_sent 1452 The variable we_sent contains true if the participant has sent an RTP 1453 packet recently, false otherwise. This determination is made by using 1454 the same mechanisms as for managing the set of other participants 1455 listed in the senders table. If the participant sends an RTP packet 1456 when we_sent is false, it adds itself to the sender table and sets 1457 we_sent to true. The reverse reconsideration algorithm described in 1458 Section 6.3.4 SHOULD be performed to possibly reduce the delay before 1459 sending an SR packet. Every time another RTP packet is sent, the 1460 time of transmission of that packet is maintained in the table. The 1461 normal sender timeout algorithm is then applied to the participant -- 1462 if an RTP packet has not been transmitted since time tc - 2T, the 1463 participant removes itself from the sender table, decrements the 1464 sender count, and sets we_sent to false. 1466 6.3.9 Allocation of source description bandwidth 1468 This specification defines several source description (SDES) items in 1469 addition to the mandatory CNAME item, such as NAME (personal name) 1470 and EMAIL (email address). It also provides a means to define new 1471 application-specific RTCP packet types. Applications should exercise 1472 caution in allocating control bandwidth to this additional 1473 information because it will slow down the rate at which reception 1474 reports and CNAME are sent, thus impairing the performance of the 1475 protocol. It is RECOMMENDED that no more than 20% of the RTCP 1476 bandwidth allocated to a single participant be used to carry the 1477 additional information. Furthermore, it is not intended that all 1478 SDES items will be included in every application. Those that are 1479 included SHOULD be assigned a fraction of the bandwidth according to 1480 their utility. Rather than estimate these fractions dynamically, it 1481 is recommended that the percentages be translated statically into 1482 report interval counts based on the typical length of an item. 1484 For example, an application may be designed to send only CNAME, NAME 1485 and EMAIL and not any others. NAME might be given much higher 1486 priority than EMAIL because the NAME would be displayed continuously 1487 in the application's user interface, whereas EMAIL would be displayed 1488 only when requested. At every RTCP interval, an RR packet and an SDES 1489 packet with the CNAME item would be sent. For a small session 1490 operating at the minimum interval, that would be every 5 seconds on 1491 the average. Every third interval (15 seconds), one extra item would 1492 be included in the SDES packet. Seven out of eight times this would 1493 be the NAME item, and every eighth time (2 minutes) it would be the 1494 EMAIL item. 1496 When multiple applications operate in concert using cross-application 1497 binding through a common CNAME for each participant, for example in a 1498 multimedia conference composed of an RTP session for each medium, the 1499 additional SDES information MAY be sent in only one RTP session. The 1500 other sessions would carry only the CNAME item. In particular, this 1501 approach should be applied to the multiple sessions of a layered 1502 encoding scheme (see Section 2.4). 1504 6.4 Sender and Receiver Reports 1506 RTP receivers provide reception quality feedback using RTCP report 1507 packets which may take one of two forms depending upon whether or not 1508 the receiver is also a sender. The only difference between the sender 1509 report (SR) and receiver report (RR) forms, besides the packet type 1510 code, is that the sender report includes a 20-byte sender information 1511 section for use by active senders. The SR is issued if a site has 1512 sent any data packets during the interval since issuing the last 1513 report or the previous one, otherwise the RR is issued. 1515 Both the SR and RR forms include zero or more reception report 1516 blocks, one for each of the synchronization sources from which this 1517 receiver has received RTP data packets since the last report. Reports 1518 are not issued for contributing sources listed in the CSRC list. Each 1519 reception report block provides statistics about the data received 1520 from the particular source indicated in that block. Since a maximum 1521 of 31 reception report blocks will fit in an SR or RR packet, 1522 additional RR packets MAY be stacked after the initial SR or RR 1523 packet as needed to contain the reception reports for all sources 1524 heard during the interval since the last report. 1526 The next sections define the formats of the two reports, how they may 1527 be extended in a profile-specific manner if an application requires 1528 additional feedback information, and how the reports may be used. 1529 Details of reception reporting by translators and mixers is given in 1530 Section 7. 1532 6.4.1 SR: Sender report RTCP packet 1534 0 1 2 3 1535 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 1536 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1537 |V=2|P| RC | PT=SR=200 | length | header 1538 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1539 | SSRC of sender | 1540 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1541 | NTP timestamp, most significant word | sender 1542 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ info 1543 | NTP timestamp, least significant word | 1544 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1545 | RTP timestamp | 1546 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1547 | sender's packet count | 1548 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1549 | sender's octet count | 1550 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1551 | SSRC_1 (SSRC of first source) | report 1552 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block 1553 | fraction lost | cumulative number of packets lost | 1 1554 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1555 | extended highest sequence number received | 1556 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1557 | interarrival jitter | 1558 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1559 | last SR (LSR) | 1560 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1561 | delay since last SR (DLSR) | 1562 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1563 | SSRC_2 (SSRC of second source) | report 1564 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block 1565 : ... : 2 1566 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1567 | profile-specific extensions | 1568 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1570 The sender report packet consists of three sections, possibly 1571 followed by a fourth profile-specific extension section if defined. 1572 The first section, the header, is 8 octets long. The fields have the 1573 following meaning: 1575 version (V): 2 bits 1576 Identifies the version of RTP, which is the same in RTCP 1577 packets as in RTP data packets. The version defined by this 1578 specification is two (2). 1580 padding (P): 1 bit 1581 If the padding bit is set, this individual RTCP packet 1582 contains some additional padding octets at the end which 1583 are not part of the control information but are included in 1584 the length field. The last octet of the padding is a count 1585 of how many padding octets should be ignored, including 1586 itself (it will be a multiple of four). Padding may be 1587 needed by some encryption algorithms with fixed block 1588 sizes. In a compound RTCP packet, padding is only required 1589 on one individual packet because the compound packet is 1590 encrypted as a whole for the method in Section 9.1. Thus, 1591 padding MUST only be added to the last individual packet, 1592 and if padding is added to that packet, the padding bit 1593 MUST be set only on that packet. This convention aids the 1594 header validity checks described in Appendix A.2 and allows 1595 detection of packets from some early implementations that 1596 incorrectly set the padding bit on the first individual 1597 packet and add padding to the last individual packet. 1599 reception report count (RC): 5 bits 1600 The number of reception report blocks contained in this 1601 packet. A value of zero is valid. 1603 packet type (PT): 8 bits 1604 Contains the constant 200 to identify this as an RTCP SR 1605 packet. 1607 length: 16 bits 1608 The length of this RTCP packet in 32-bit words minus one, 1609 including the header and any padding. (The offset of one 1610 makes zero a valid length and avoids a possible infinite 1611 loop in scanning a compound RTCP packet, while counting 1612 32-bit words avoids a validity check for a multiple of 4.) 1614 SSRC: 32 bits 1615 The synchronization source identifier for the originator of 1616 this SR packet. 1618 The second section, the sender information, is 20 octets long and is 1619 present in every sender report packet. It summarizes the data 1620 transmissions from this sender. The fields have the following 1621 meaning: 1623 NTP timestamp: 64 bits 1624 Indicates the wallclock time (see Section 4) when this 1625 report was sent so that it may be used in combination with 1626 timestamps returned in reception reports from other 1627 receivers to measure round-trip propagation to those 1628 receivers. Receivers should expect that the measurement 1629 accuracy of the timestamp may be limited to far less than 1630 the resolution of the NTP timestamp. The measurement 1631 uncertainty of the timestamp is not indicated as it may not 1632 be known. On a system that has no notion of wallclock time 1633 but does have some system-specific clock such as "system 1634 uptime", a sender MAY use that clock as a reference to 1635 calculate relative NTP timestamps. It is important to 1636 choose a commonly used clock so that if separate 1637 implementations are used to produce the individual streams 1638 of a multimedia session, all implementations will use the 1639 same clock. Until the year 2036, relative and absolute 1640 timestamps will differ in the high bit so (invalid) 1641 comparisons will show a large difference; by then one hopes 1642 relative timestamps will no longer be needed. A sender 1643 that has no notion of wallclock or elapsed time MAY set the 1644 NTP timestamp to zero. 1646 RTP timestamp: 32 bits 1647 Corresponds to the same time as the NTP timestamp (above), 1648 but in the same units and with the same random offset as 1649 the RTP timestamps in data packets. This correspondence may 1650 be used for intra- and inter-media synchronization for 1651 sources whose NTP timestamps are synchronized, and may be 1652 used by media-independent receivers to estimate the nominal 1653 RTP clock frequency. Note that in most cases this timestamp 1654 will not be equal to the RTP timestamp in any adjacent data 1655 packet. Rather, it MUST be calculated from the 1656 corresponding NTP timestamp using the relationship between 1657 the RTP timestamp counter and real time as maintained by 1658 periodically checking the wallclock time at a sampling 1659 instant. 1661 sender's packet count: 32 bits 1662 The total number of RTP data packets transmitted by the 1663 sender since starting transmission up until the time this 1664 SR packet was generated. The count SHOULD be reset if the 1665 sender changes its SSRC identifier. 1667 sender's octet count: 32 bits 1668 The total number of payload octets (i.e., not including 1669 header or padding) transmitted in RTP data packets by the 1670 sender since starting transmission up until the time this 1671 SR packet was generated. The count SHOULD be reset if the 1672 sender changes its SSRC identifier. This field can be used 1673 to estimate the average payload data rate. 1675 The third section contains zero or more reception report blocks 1676 depending on the number of other sources heard by this sender since 1677 the last report. Each reception report block conveys statistics on 1678 the reception of RTP packets from a single synchronization source. 1679 Receivers SHOULD NOT carry over statistics when a source changes its 1680 SSRC identifier due to a collision. These statistics are: 1682 SSRC_n (source identifier): 32 bits 1683 The SSRC identifier of the source to which the information 1684 in this reception report block pertains. 1686 fraction lost: 8 bits 1687 The fraction of RTP data packets from source SSRC_n lost 1688 since the previous SR or RR packet was sent, expressed as a 1689 fixed point number with the binary point at the left edge 1690 of the field. (That is equivalent to taking the integer 1691 part after multiplying the loss fraction by 256.) This 1692 fraction is defined to be the number of packets lost 1693 divided by the number of packets expected, as defined in 1694 the next paragraph. An implementation is shown in Appendix 1695 A.3. If the loss is negative due to duplicates, the 1696 fraction lost is set to zero. Note that a receiver cannot 1697 tell whether any packets were lost after the last one 1698 received, and that there will be no reception report block 1699 issued for a source if all packets from that source sent 1700 during the last reporting interval have been lost. 1702 cumulative number of packets lost: 24 bits 1703 The total number of RTP data packets from source SSRC_n 1704 that have been lost since the beginning of reception. This 1705 number is defined to be the number of packets expected less 1706 the number of packets actually received, where the number 1707 of packets received includes any which are late or 1708 duplicates. Thus packets that arrive late are not counted 1709 as lost, and the loss may be negative if there are 1710 duplicates. The number of packets expected is defined to 1711 be the extended last sequence number received, as defined 1712 next, less the initial sequence number received. This may 1713 be calculated as shown in Appendix A.3. 1715 extended highest sequence number received: 32 bits 1716 The low 16 bits contain the highest sequence number 1717 received in an RTP data packet from source SSRC_n, and the 1718 most significant 16 bits extend that sequence number with 1719 the corresponding count of sequence number cycles, which 1720 may be maintained according to the algorithm in Appendix 1721 A.1. Note that different receivers within the same session 1722 will generate different extensions to the sequence number 1723 if their start times differ significantly. 1725 interarrival jitter: 32 bits 1726 An estimate of the statistical variance of the RTP data 1727 packet interarrival time, measured in timestamp units and 1728 expressed as an unsigned integer. The interarrival jitter J 1729 is defined to be the mean deviation (smoothed absolute 1730 value) of the difference D in packet spacing at the 1731 receiver compared to the sender for a pair of packets. As 1732 shown in the equation below, this is equivalent to the 1733 difference in the "relative transit time" for the two 1734 packets; the relative transit time is the difference 1735 between a packet's RTP timestamp and the receiver's clock 1736 at the time of arrival, measured in the same units. 1738 If Si is the RTP timestamp from packet i, and Ri is the 1739 time of arrival in RTP timestamp units for packet i, then 1740 for two packets i and j, D may be expressed as D(i,j) = 1741 (R_j - R_i) - (S_j - S_i) = (R_j - S_j) - (R_i - S_i) 1743 The interarrival jitter SHOULD be calculated continuously 1744 as each data packet i is received from source SSRC_n, using 1745 this difference D for that packet and the previous packet 1746 i-1 in order of arrival (not necessarily in sequence), 1747 according to the formula J_i = J_i-1 + (|D(i-1,i)| - J_i- 1748 1)/16 1749 Whenever a reception report is issued, the current value of 1750 J is sampled. 1752 The jitter calculation MUST conform to the formula 1753 specified here in order to allow profile-independent 1754 monitors to make valid interpretations of reports coming 1755 from different implementations. This algorithm is the 1756 optimal first-order estimator and the gain parameter 1/16 1757 gives a good noise reduction ratio while maintaining a 1758 reasonable rate of convergence [17]. A sample 1759 implementation is shown in Appendix A.8. 1761 last SR timestamp (LSR): 32 bits 1762 The middle 32 bits out of 64 in the NTP timestamp (as 1763 explained in Section 4) received as part of the most recent 1764 RTCP sender report (SR) packet from source SSRC_n. If no SR 1765 has been received yet, the field is set to zero. 1767 delay since last SR (DLSR): 32 bits 1768 The delay, expressed in units of 1/65536 seconds, between 1769 receiving the last SR packet from source SSRC_n and sending 1770 this reception report block. If no SR packet has been 1771 received yet from SSRC_n, the DLSR field is set to zero. 1773 Let SSRC_r denote the receiver issuing this receiver 1774 report. Source SSRC_n can compute the round-trip 1775 propagation delay to SSRC_r by recording the time A when 1776 this reception report block is received. It calculates the 1777 total round-trip time A-LSR using the last SR timestamp 1778 (LSR) field, and then subtracting this field to leave the 1779 round-trip propagation delay as (A- LSR - DLSR). This is 1780 illustrated in Fig. 2. 1782 This may be used as an approximate measure of distance to 1783 cluster receivers, although some links have very asymmetric 1784 delays. 1786 [10 Nov 1995 11:33:25.125] [10 Nov 1995 11:33:36.5] 1787 n SR(n) A=b710:8000 (46864.500 s) 1788 ----------------------------------------------------------------> 1789 v ^ 1790 ntp_sec =0xb44db705 v ^ dlsr=0x0005.4000 ( 5.250s) 1791 ntp_frac=0x20000000 v ^ lsr =0xb705:2000 (46853.125s) 1792 (3024992016.125 s) v ^ 1793 r v ^ RR(n) 1794 ----------------------------------------------------------------> 1795 |<-DLSR->| 1796 (5.250 s) 1798 A 0xb710:8000 (46864.500 s) 1799 DLSR -0x0005:4000 ( 5.250 s) 1800 LSR -0xb705:2000 (46853.125 s) 1801 ------------------------------- 1802 delay 0x 6:2000 ( 6.125 s) 1804 Figure 2: Example for round-trip time computation 1806 6.4.2 RR: Receiver report RTCP packet 1807 0 1 2 3 1808 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 1809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1810 |V=2|P| RC | PT=RR=201 | length | header 1811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1812 | SSRC of packet sender | 1813 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1814 | SSRC_1 (SSRC of first source) | report 1815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block 1816 | fraction lost | cumulative number of packets lost | 1 1817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1818 | extended highest sequence number received | 1819 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1820 | interarrival jitter | 1821 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1822 | last SR (LSR) | 1823 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1824 | delay since last SR (DLSR) | 1825 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1826 | SSRC_2 (SSRC of second source) | report 1827 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ block 1828 : ... : 2 1829 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1830 | profile-specific extensions | 1831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1833 The format of the receiver report (RR) packet is the same as that of 1834 the SR packet except that the packet type field contains the constant 1835 201 and the five words of sender information are omitted (these are 1836 the NTP and RTP timestamps and sender's packet and octet counts). The 1837 remaining fields have the same meaning as for the SR packet. 1839 An empty RR packet (RC = 0) MUST be put at the head of a compound 1840 RTCP packet when there is no data transmission or reception to 1841 report. 1843 6.4.3 Extending the sender and receiver reports 1845 A profile SHOULD define profile-specific extensions to the sender 1846 report and receiver report if there is additional information that 1847 needs to be reported regularly about the sender or receivers. This 1848 method SHOULD be used in preference to defining another RTCP packet 1849 type because it requires less overhead: 1851 o fewer octets in the packet (no RTCP header or SSRC field); 1853 o simpler and faster parsing because applications running under 1854 that profile would be programmed to always expect the 1855 extension fields in the directly accessible location after the 1856 reception reports. 1858 The extension is a fourth section in the sender- or receiver-report 1859 packet which comes at the end after the reception report blocks, if 1860 any. If additional sender information is required, then for sender 1861 reports it would be included first in the extension section, but for 1862 receiver reports it would not be present. If information about 1863 receivers is to be included, that data SHOULD be structured as an 1864 array of blocks parallel to the existing array of reception report 1865 blocks; that is, the number of blocks would be indicated by the RC 1866 field. 1868 6.4.4 Analyzing sender and receiver reports 1870 It is expected that reception quality feedback will be useful not 1871 only for the sender but also for other receivers and third-party 1872 monitors. The sender may modify its transmissions based on the 1873 feedback; receivers can determine whether problems are local, 1874 regional or global; network managers may use profile-independent 1875 monitors that receive only the RTCP packets and not the corresponding 1876 RTP data packets to evaluate the performance of their networks for 1877 multicast distribution. 1879 Cumulative counts are used in both the sender information and 1880 receiver report blocks so that differences may be calculated between 1881 any two reports to make measurements over both short and long time 1882 periods, and to provide resilience against the loss of a report. The 1883 difference between the last two reports received can be used to 1884 estimate the recent quality of the distribution. The NTP timestamp is 1885 included so that rates may be calculated from these differences over 1886 the interval between two reports. Since that timestamp is independent 1887 of the clock rate for the data encoding, it is possible to implement 1888 encoding- and profile-independent quality monitors. 1890 An example calculation is the packet loss rate over the interval 1891 between two reception reports. The difference in the cumulative 1892 number of packets lost gives the number lost during that interval. 1893 The difference in the extended last sequence numbers received gives 1894 the number of packets expected during the interval. The ratio of 1895 these two is the packet loss fraction over the interval. This ratio 1896 should equal the fraction lost field if the two reports are 1897 consecutive, but otherwise it may not. The loss rate per second can 1898 be obtained by dividing the loss fraction by the difference in NTP 1899 timestamps, expressed in seconds. The number of packets received is 1900 the number of packets expected minus the number lost. The number of 1901 packets expected may also be used to judge the statistical validity 1902 of any loss estimates. For example, 1 out of 5 packets lost has a 1903 lower significance than 200 out of 1000. 1905 From the sender information, a third-party monitor can calculate the 1906 average payload data rate and the average packet rate over an 1907 interval without receiving the data. Taking the ratio of the two 1908 gives the average payload size. If it can be assumed that packet loss 1909 is independent of packet size, then the number of packets received by 1910 a particular receiver times the average payload size (or the 1911 corresponding packet size) gives the apparent throughput available to 1912 that receiver. 1914 In addition to the cumulative counts which allow long-term packet 1915 loss measurements using differences between reports, the fraction 1916 lost field provides a short-term measurement from a single report. 1917 This becomes more important as the size of a session scales up enough 1918 that reception state information might not be kept for all receivers 1919 or the interval between reports becomes long enough that only one 1920 report might have been received from a particular receiver. 1922 The interarrival jitter field provides a second short-term measure of 1923 network congestion. Packet loss tracks persistent congestion while 1924 the jitter measure tracks transient congestion. The jitter measure 1925 may indicate congestion before it leads to packet loss. Since the 1926 interarrival jitter field is only a snapshot of the jitter at the 1927 time of a report, it may be necessary to analyze a number of reports 1928 from one receiver over time or from multiple receivers, e.g., within 1929 a single network. 1931 6.5 SDES: Source description RTCP packet 1933 0 1 2 3 1934 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 1935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1936 |V=2|P| SC | PT=SDES=202 | length | header 1937 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1938 | SSRC/CSRC_1 | chunk 1939 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 1940 | SDES items | 1941 | ... | 1942 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1943 | SSRC/CSRC_2 | chunk 1944 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2 1945 | SDES items | 1946 | ... | 1947 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 1948 The SDES packet is a three-level structure composed of a header and 1949 zero or more chunks, each of of which is composed of items describing 1950 the source identified in that chunk. The items are described 1951 individually in subsequent sections. 1953 version (V), padding (P), length: 1954 As described for the SR packet (see Section 6.4.1). 1956 packet type (PT): 8 bits 1957 Contains the constant 202 to identify this as an RTCP SDES 1958 packet. 1960 source count (SC): 5 bits 1961 The number of SSRC/CSRC chunks contained in this SDES 1962 packet. A value of zero is valid but useless. 1964 Each chunk consists of an SSRC/CSRC identifier followed by a list of 1965 zero or more items, which carry information about the SSRC/CSRC. Each 1966 chunk starts on a 32-bit boundary. Each item consists of an 8-bit 1967 type field, an 8-bit octet count describing the length of the text 1968 (thus, not including this two-octet header), and the text itself. 1969 Note that the text can be no longer than 255 octets, but this is 1970 consistent with the need to limit RTCP bandwidth consumption. 1972 The text is encoded according to the UTF-8 encoding specified in RFC 1973 2279 [18]. US-ASCII is a subset of this encoding and requires no 1974 additional encoding. The presence of multi-octet encodings is 1975 indicated by setting the most significant bit of a character to a 1976 value of one. 1978 Items are contiguous, i.e., items are not individually padded to a 1979 32-bit boundary. Text is not null terminated because some multi-octet 1980 encodings include null octets. The list of items in each chunk MUST 1981 be terminated by one or more null octets, the first of which is 1982 interpreted as an item type of zero to denote the end of the list. 1983 No length octet follows the null item type octet, but additional null 1984 octets MUST be included if needed to pad until the next 32-bit 1985 boundary. Note that this padding is separate from that indicated by 1986 the P bit in the RTCP header. A chunk with zero items (four null 1987 octets) is valid but useless. 1989 End systems send one SDES packet containing their own source 1990 identifier (the same as the SSRC in the fixed RTP header). A mixer 1991 sends one SDES packet containing a chunk for each contributing source 1992 from which it is receiving SDES information, or multiple complete 1993 SDES packets in the format above if there are more than 31 such 1994 sources (see Section 7). 1996 The SDES items currently defined are described in the next sections. 1997 Only the CNAME item is mandatory. Some items shown here may be useful 1998 only for particular profiles, but the item types are all assigned 1999 from one common space to promote shared use and to simplify profile- 2000 independent applications. Additional items may be defined in a 2001 profile by registering the type numbers with IANA as described in 2002 Section 14. 2004 6.5.1 CNAME: Canonical end-point identifier SDES item 2006 0 1 2 3 2007 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 2008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2009 | CNAME=1 | length | user and domain name ... 2010 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2012 The CNAME identifier has the following properties: 2014 o Because the randomly allocated SSRC identifier may change if a 2015 conflict is discovered or if a program is restarted, the CNAME 2016 item MUST be included to provide the binding from the SSRC 2017 identifier to an identifier for the source that remains 2018 constant. 2020 o Like the SSRC identifier, the CNAME identifier SHOULD also be 2021 unique among all participants within one RTP session. 2023 o To provide a binding across multiple media tools used by one 2024 participant in a set of related RTP sessions, the CNAME SHOULD 2025 be fixed for that participant. 2027 o To facilitate third-party monitoring, the CNAME SHOULD be 2028 suitable for either a program or a person to locate the 2029 source. 2031 Therefore, the CNAME SHOULD be derived algorithmically and not 2032 entered manually, when possible. To meet these requirements, the 2033 following format SHOULD be used unless a profile specifies an 2034 alternate syntax or semantics. The CNAME item SHOULD have the format 2035 "user@host", or "host" if a user name is not available as on single- 2036 user systems. For both formats, "host" is either the fully qualified 2037 domain name of the host from which the real-time data originates, 2038 formatted according to the rules specified in RFC 1034 [19], RFC 1035 2039 [20] and Section 2.1 of RFC 1123 [21]; or the standard ASCII 2040 representation of the host's numeric address on the interface used 2041 for the RTP communication. For example, the standard ASCII 2042 representation of an IP Version 4 address is "dotted decimal", also 2043 known as dotted quad. Other address types are expected to have ASCII 2044 representations that are mutually unique. The fully qualified domain 2045 name is more convenient for a human observer and may avoid the need 2046 to send a NAME item in addition, but it may be difficult or 2047 impossible to obtain reliably in some operating environments. 2048 Applications that may be run in such environments SHOULD use the 2049 ASCII representation of the address instead. 2051 Examples are "doe@sleepy.megacorp.com" or "doe@192.0.2.89" for a 2052 multi-user system. On a system with no user name, examples would be 2053 "sleepy.megacorp.com" or "192.0.2.89". 2055 The user name SHOULD be in a form that a program such as "finger" or 2056 "talk" could use, i.e., it typically is the login name rather than 2057 the personal name. The host name is not necessarily identical to the 2058 one in the participant's electronic mail address. 2060 This syntax will not provide unique identifiers for each source if an 2061 application permits a user to generate multiple sources from one 2062 host. Such an application would have to rely on the SSRC to further 2063 identify the source, or the profile for that application would have 2064 to specify additional syntax for the CNAME identifier. 2066 If each application creates its CNAME independently, the resulting 2067 CNAMEs may not be identical as would be required to provide a binding 2068 across multiple media tools belonging to one participant in a set of 2069 related RTP sessions. If cross-media binding is required, it may be 2070 necessary for the CNAME of each tool to be externally configured with 2071 the same value by a coordination tool. 2073 Application writers should be aware that private network address 2074 assignments such as the Net-10 assignment proposed in RFC 1597 [22] 2075 may create network addresses that are not globally unique. This would 2076 lead to non-unique CNAMEs if hosts with private addresses and no 2077 direct IP connectivity to the public Internet have their RTP packets 2078 forwarded to the public Internet through an RTP-level translator. 2079 (See also RFC 1627 [23].) To handle this case, applications MAY 2080 provide a means to configure a unique CNAME, but the burden is on the 2081 translator to translate CNAMEs from private addresses to public 2082 addresses if necessary to keep private addresses from being exposed. 2084 6.5.2 NAME: User name SDES item 2085 0 1 2 3 2086 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 2087 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2088 | NAME=2 | length | common name of source ... 2089 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2091 This is the real name used to describe the source, e.g., "John Doe, 2092 Bit Recycler, Megacorp". It may be in any form desired by the user. 2093 For applications such as conferencing, this form of name may be the 2094 most desirable for display in participant lists, and therefore might 2095 be sent most frequently of those items other than CNAME. Profiles MAY 2096 establish such priorities. The NAME value is expected to remain 2097 constant at least for the duration of a session. It SHOULD NOT be 2098 relied upon to be unique among all participants in the session. 2100 6.5.3 EMAIL: Electronic mail address SDES item 2102 0 1 2 3 2103 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 2104 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2105 | EMAIL=3 | length | email address of source ... 2106 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2108 The email address is formatted according to RFC 822 [24], for 2109 example, "John.Doe@megacorp.com". The EMAIL value is expected to 2110 remain constant for the duration of a session. 2112 6.5.4 PHONE: Phone number SDES item 2114 0 1 2 3 2115 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 2116 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2117 | PHONE=4 | length | phone number of source ... 2118 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2120 The phone number SHOULD be formatted with the plus sign replacing the 2121 international access code. For example, "+1 908 555 1212" for a 2122 number in the United States. 2124 6.5.5 LOC: Geographic user location SDES item 2125 0 1 2 3 2126 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 2127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2128 | LOC=5 | length | geographic location of site ... 2129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2131 Depending on the application, different degrees of detail are 2132 appropriate for this item. For conference applications, a string 2133 like "Murray Hill, New Jersey" may be sufficient, while, for an 2134 active badge system, strings like "Room 2A244, AT&T BL MH" might be 2135 appropriate. The degree of detail is left to the implementation 2136 and/or user, but format and content MAY be prescribed by a profile. 2137 The LOC value is expected to remain constant for the duration of a 2138 session, except for mobile hosts. 2140 6.5.6 TOOL: Application or tool name SDES item 2142 0 1 2 3 2143 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 2144 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2145 | TOOL=6 | length | name/version of source appl. ... 2146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2148 A string giving the name and possibly version of the application 2149 generating the stream, e.g., "videotool 1.2". This information may be 2150 useful for debugging purposes and is similar to the Mailer or Mail- 2151 System-Version SMTP headers. The TOOL value is expected to remain 2152 constant for the duration of the session. 2154 6.5.7 NOTE: Notice/status SDES item 2156 0 1 2 3 2157 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 2158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2159 | NOTE=7 | length | note about the source ... 2160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2162 The following semantics are suggested for this item, but these or 2163 other semantics MAY be explicitly defined by a profile. The NOTE item 2164 is intended for transient messages describing the current state of 2165 the source, e.g., "on the phone, can't talk". Or, during a seminar, 2166 this item might be used to convey the title of the talk. It should be 2167 used only to carry exceptional information and SHOULD NOT be included 2168 routinely by all participants because this would slow down the rate 2169 at which reception reports and CNAME are sent, thus impairing the 2170 performance of the protocol. In particular, it SHOULD NOT be included 2171 as an item in a user's configuration file nor automatically generated 2172 as in a quote-of-the-day. 2174 Since the NOTE item may be important to display while it is active, 2175 the rate at which other non-CNAME items such as NAME are transmitted 2176 might be reduced so that the NOTE item can take that part of the RTCP 2177 bandwidth. When the transient message becomes inactive, the NOTE item 2178 SHOULD continue to be transmitted a few times at the same repetition 2179 rate but with a string of length zero to signal the receivers. 2180 However, receivers SHOULD also consider the NOTE item inactive if it 2181 is not received for a small multiple of the repetition rate, or 2182 perhaps 20-30 RTCP intervals. 2184 6.5.8 PRIV: Private extensions SDES item 2186 0 1 2 3 2187 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 2188 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2189 | PRIV=8 | length | prefix length | prefix string... 2190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2191 ... | value string ... 2192 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2194 This item is used to define experimental or application-specific SDES 2195 extensions. The item contains a prefix consisting of a length-string 2196 pair, followed by the value string filling the remainder of the item 2197 and carrying the desired information. The prefix length field is 8 2198 bits long. The prefix string is a name chosen by the person defining 2199 the PRIV item to be unique with respect to other PRIV items this 2200 application might receive. The application creator might choose to 2201 use the application name plus an additional subtype identification if 2202 needed. Alternatively, it is RECOMMENDED that others choose a name 2203 based on the entity they represent, then coordinate the use of the 2204 name within that entity. 2206 Note that the prefix consumes some space within the item's total 2207 length of 255 octets, so the prefix should be kept as short as 2208 possible. This facility and the constrained RTCP bandwidth SHOULD NOT 2209 be overloaded; it is not intended to satisfy all the control 2210 communication requirements of all applications. 2212 SDES PRIV prefixes will not be registered by IANA. If some form of 2213 the PRIV item proves to be of general utility, it SHOULD instead be 2214 assigned a regular SDES item type registered with IANA so that no 2215 prefix is required. This simplifies use and increases transmission 2216 efficiency. 2218 6.6 BYE: Goodbye RTCP packet 2220 0 1 2 3 2221 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 2222 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2223 |V=2|P| SC | PT=BYE=203 | length | 2224 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2225 | SSRC/CSRC | 2226 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2227 : ... : 2228 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 2229 | length | reason for leaving ... (opt) 2230 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2232 The BYE packet indicates that one or more sources are no longer 2233 active. 2235 version (V), padding (P), length: 2236 As described for the SR packet (see Section 6.4.1). 2238 packet type (PT): 8 bits 2239 Contains the constant 203 to identify this as an RTCP BYE 2240 packet. 2242 source count (SC): 5 bits 2243 The number of SSRC/CSRC identifiers included in this BYE 2244 packet. A count value of zero is valid, but useless. 2246 The rules for when a BYE packet should be sent are specified in 2247 Sections 6.3.7 and 8.2. 2249 If a BYE packet is received by a mixer, the mixer SHOULD forward the 2250 BYE packet with the SSRC/CSRC identifier(s) unchanged. If a mixer 2251 shuts down, it SHOULD send a BYE packet listing all contributing 2252 sources it handles, as well as its own SSRC identifier. Optionally, 2253 the BYE packet MAY include an 8-bit octet count followed by that many 2254 octets of text indicating the reason for leaving, e.g., "camera 2255 malfunction" or "RTP loop detected". The string has the same encoding 2256 as that described for SDES. If the string fills the packet to the 2257 next 32-bit boundary, the string is not null terminated. If not, the 2258 BYE packet MUST be padded with null octets to the next 32-bit 2259 boundary. This padding is separate from that indicated by the P bit 2260 in the RTCP header. 2262 6.7 APP: Application-defined RTCP packet 2263 0 1 2 3 2264 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 2265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2266 |V=2|P| subtype | PT=APP=204 | length | 2267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2268 | SSRC/CSRC | 2269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2270 | name (ASCII) | 2271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2272 | application-dependent data ... 2273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2275 The APP packet is intended for experimental use as new applications 2276 and new features are developed, without requiring packet type value 2277 registration. APP packets with unrecognized names SHOULD be ignored. 2278 After testing and if wider use is justified, it is RECOMMENDED that 2279 each APP packet be redefined without the subtype and name fields and 2280 registered with IANA using an RTCP packet type. 2282 version (V), padding (P), length: 2283 As described for the SR packet (see Section 6.4.1). 2285 subtype: 5 bits 2286 May be used as a subtype to allow a set of APP packets to 2287 be defined under one unique name, or for any application- 2288 dependent data. 2290 packet type (PT): 8 bits 2291 Contains the constant 204 to identify this as an RTCP APP 2292 packet. 2294 name: 4 octets 2295 A name chosen by the person defining the set of APP packets 2296 to be unique with respect to other APP packets this 2297 application might receive. The application creator might 2298 choose to use the application name, and then coordinate the 2299 allocation of subtype values to others who want to define 2300 new packet types for the application. Alternatively, it is 2301 RECOMMENDED that others choose a name based on the entity 2302 they represent, then coordinate the use of the name within 2303 that entity. The name is interpreted as a sequence of four 2304 ASCII characters, with uppercase and lowercase characters 2305 treated as distinct. 2307 application-dependent data: variable length 2308 Application-dependent data may or may not appear in an APP 2309 packet. It is interpreted by the application and not RTP 2310 itself. It MUST be a multiple of 32 bits long. 2312 7 RTP Translators and Mixers 2314 In addition to end systems, RTP supports the notion of "translators" 2315 and "mixers", which could be considered as "intermediate systems" at 2316 the RTP level. Although this support adds some complexity to the 2317 protocol, the need for these functions has been clearly established 2318 by experiments with multicast audio and video applications in the 2319 Internet. Example uses of translators and mixers given in Section 2.3 2320 stem from the presence of firewalls and low bandwidth connections, 2321 both of which are likely to remain. 2323 7.1 General Description 2325 An RTP translator/mixer connects two or more transport-level 2326 "clouds". Typically, each cloud is defined by a common network and 2327 transport protocol (e.g., IP/UDP) plus a multicast address and 2328 transport level destination port or a pair of unicast addresses and 2329 ports. (Network-level protocol translators, such as IP version 4 to 2330 IP version 6, may be present within a cloud invisibly to RTP.) One 2331 system may serve as a translator or mixer for a number of RTP 2332 sessions, but each is considered a logically separate entity. 2334 In order to avoid creating a loop when a translator or mixer is 2335 installed, the following rules MUST be observed: 2337 o Each of the clouds connected by translators and mixers 2338 participating in one RTP session either MUST be distinct from 2339 all the others in at least one of these parameters (protocol, 2340 address, port), or MUST be isolated at the network level from 2341 the others. 2343 o A derivative of the first rule is that there MUST NOT be 2344 multiple translators or mixers connected in parallel unless by 2345 some arrangement they partition the set of sources to be 2346 forwarded. 2348 Similarly, all RTP end systems that can communicate through one or 2349 more RTP translators or mixers share the same SSRC space, that is, 2350 the SSRC identifiers MUST be unique among all these end systems. 2351 Section 8.2 describes the collision resolution algorithm by which 2352 SSRC identifiers are kept unique and loops are detected. 2354 There may be many varieties of translators and mixers designed for 2355 different purposes and applications. Some examples are to add or 2356 remove encryption, change the encoding of the data or the underlying 2357 protocols, or replicate between a multicast address and one or more 2358 unicast addresses. The distinction between translators and mixers is 2359 that a translator passes through the data streams from different 2360 sources separately, whereas a mixer combines them to form one new 2361 stream: 2363 Translator: Forwards RTP packets with their SSRC identifier 2364 intact; this makes it possible for receivers to identify 2365 individual sources even though packets from all the sources 2366 pass through the same translator and carry the translator's 2367 network source address. Some kinds of translators will pass 2368 through the data untouched, but others MAY change the 2369 encoding of the data and thus the RTP data payload type and 2370 timestamp. If multiple data packets are re-encoded into 2371 one, or vice versa, a translator MUST assign new sequence 2372 numbers to the outgoing packets. Losses in the incoming 2373 packet stream may induce corresponding gaps in the outgoing 2374 sequence numbers. Receivers cannot detect the presence of a 2375 translator unless they know by some other means what 2376 payload type or transport address was used by the original 2377 source. 2379 Mixer: Receives streams of RTP data packets from one or more 2380 sources, possibly changes the data format, combines the 2381 streams in some manner and then forwards the combined 2382 stream. Since the timing among multiple input sources will 2383 not generally be synchronized, the mixer will make timing 2384 adjustments among the streams and generate its own timing 2385 for the combined stream, so it is the synchronization 2386 source. Thus, all data packets forwarded by a mixer MUST be 2387 marked with the mixer's own SSRC identifier. In order to 2388 preserve the identity of the original sources contributing 2389 to the mixed packet, the mixer SHOULD insert their SSRC 2390 identifiers into the CSRC identifier list following the 2391 fixed RTP header of the packet. A mixer that is also itself 2392 a contributing source for some packet SHOULD explicitly 2393 include its own SSRC identifier in the CSRC list for that 2394 packet. 2396 For some applications, it MAY be acceptable for a mixer not 2397 to identify sources in the CSRC list. However, this 2398 introduces the danger that loops involving those sources 2399 could not be detected. 2401 The advantage of a mixer over a translator for applications like 2402 audio is that the output bandwidth is limited to that of one source 2403 even when multiple sources are active on the input side. This may be 2404 important for low-bandwidth links. The disadvantage is that receivers 2405 on the output side don't have any control over which sources are 2406 passed through or muted, unless some mechanism is implemented for 2407 remote control of the mixer. The regeneration of synchronization 2408 information by mixers also means that receivers can't do inter-media 2409 synchronization of the original streams. A multi-media mixer could do 2410 it. 2412 [E1] [E6] 2413 | | 2414 E1:17 | E6:15 | 2415 | | E6:15 2416 V M1:48 (1,17) M1:48 (1,17) V M1:48 (1,17) 2417 (M1)------------->----------------->-------------->[E7] 2418 ^ ^ E4:47 ^ E4:47 2419 E2:1 | E4:47 | | M3:89 (64,45) 2420 | | | 2421 [E2] [E4] M3:89 (64,45) | 2422 | legend: 2423 [E3] --------->(M2)----------->(M3)------------| [End system] 2424 E3:64 M2:12 (64) ^ (Mixer) 2425 | E5:45 2426 | 2427 [E5] source: SSRC (CSRCs) 2428 -------------------> 2430 Figure 3: Sample RTP network with end systems, mixers and translators 2432 A collection of mixers and translators is shown in Figure 3 to 2433 illustrate their effect on SSRC and CSRC identifiers. In the figure, 2434 end systems are shown as rectangles (named E), translators as 2435 triangles (named T) and mixers as ovals (named M). The notation "M1: 2436 48(1,17)" designates a packet originating a mixer M1, identified with 2437 M1's (random) SSRC value of 48 and two CSRC identifiers, 1 and 17, 2438 copied from the SSRC identifiers of packets from E1 and E2. 2440 7.2 RTCP Processing in Translators 2442 In addition to forwarding data packets, perhaps modified, translators 2443 and mixers MUST also process RTCP packets. In many cases, they will 2444 take apart the compound RTCP packets received from end systems to 2445 aggregate SDES information and to modify the SR or RR packets. 2446 Retransmission of this information may be triggered by the packet 2447 arrival or by the RTCP interval timer of the translator or mixer 2448 itself. 2450 A translator that does not modify the data packets, for example one 2451 that just replicates between a multicast address and a unicast 2452 address, MAY simply forward RTCP packets unmodified as well. A 2453 translator that transforms the payload in some way MUST make 2454 corresponding transformations in the SR and RR information so that it 2455 still reflects the characteristics of the data and the reception 2456 quality. These translators MUST NOT simply forward RTCP packets. In 2457 general, a translator SHOULD NOT aggregate SR and RR packets from 2458 different sources into one packet since that would reduce the 2459 accuracy of the propagation delay measurements based on the LSR and 2460 DLSR fields. 2462 SR sender information: A translator does not generate its own 2463 sender information, but forwards the SR packets received 2464 from one cloud to the others. The SSRC is left intact but 2465 the sender information MUST be modified if required by the 2466 translation. If a translator changes the data encoding, it 2467 MUST change the "sender's byte count" field. If it also 2468 combines several data packets into one output packet, it 2469 MUST change the "sender's packet count" field. If it 2470 changes the timestamp frequency, it MUST change the "RTP 2471 timestamp" field in the SR packet. 2473 SR/RR reception report blocks: A translator forwards reception 2474 reports received from one cloud to the others. Note that 2475 these flow in the direction opposite to the data. The SSRC 2476 is left intact. If a translator combines several data 2477 packets into one output packet, and therefore changes the 2478 sequence numbers, it MUST make the inverse manipulation for 2479 the packet loss fields and the "extended last sequence 2480 number" field. This may be complex. In the extreme case, 2481 there may be no meaningful way to translate the reception 2482 reports, so the translator MAY pass on no reception report 2483 at all or a synthetic report based on its own reception. 2484 The general rule is to do what makes sense for a particular 2485 translation. 2487 A translator does not require an SSRC identifier of its 2488 own, but MAY choose to allocate one for the purpose of 2489 sending reports about what it has received. These would be 2490 sent to all the connected clouds, each corresponding to the 2491 translation of the data stream as sent to that cloud, since 2492 reception reports are normally multicast to all 2493 participants. 2495 SDES: Translators typically forward without change the SDES 2496 information they receive from one cloud to the others, but 2497 MAY, for example, decide to filter non-CNAME SDES 2498 information if bandwidth is limited. The CNAMEs MUST be 2499 forwarded to allow SSRC identifier collision detection to 2500 work. A translator that generates its own RR packets MUST 2501 send SDES CNAME information about itself to the same clouds 2502 that it sends those RR packets. 2504 BYE: Translators forward BYE packets unchanged. A translator 2505 that is about to cease forwarding packets SHOULD send a BYE 2506 packet to each connected cloud containing all the SSRC 2507 identifiers that were previously being forwarded to that 2508 cloud, including the translator's own SSRC identifier if it 2509 sent reports of its own. 2511 APP: Translators forward APP packets unchanged. 2513 7.3 RTCP Processing in Mixers 2515 Since a mixer generates a new data stream of its own, it does not 2516 pass through SR or RR packets at all and instead generates new 2517 information for both sides. 2519 SR sender information: A mixer does not pass through sender 2520 information from the sources it mixes because the 2521 characteristics of the source streams are lost in the mix. 2522 As a synchronization source, the mixer SHOULD generate its 2523 own SR packets with sender information about the mixed data 2524 stream and send them in the same direction as the mixed 2525 stream. 2527 SR/RR reception report blocks: A mixer generates its own 2528 reception reports for sources in each cloud and sends them 2529 out only to the same cloud. It MUST NOT send these 2530 reception reports to the other clouds and MUST NOT forward 2531 reception reports from one cloud to the others because the 2532 sources would not be SSRCs there (only CSRCs). 2534 SDES: Mixers typically forward without change the SDES 2535 information they receive from one cloud to the others, but 2536 MAY, for example, decide to filter non-CNAME SDES 2537 information if bandwidth is limited. The CNAMEs MUST be 2538 forwarded to allow SSRC identifier collision detection to 2539 work. (An identifier in a CSRC list generated by a mixer 2540 might collide with an SSRC identifier generated by an end 2541 system.) A mixer MUST send SDES CNAME information about 2542 itself to the same clouds that it sends SR or RR packets. 2544 Since mixers do not forward SR or RR packets, they will 2545 typically be extracting SDES packets from a compound RTCP 2546 packet. To minimize overhead, chunks from the SDES packets 2547 MAY be aggregated into a single SDES packet which is then 2548 stacked on an SR or RR packet originating from the mixer. 2549 A mixer which aggregates SDES packets will use more RTCP 2550 bandwidth than an individual source because the compound 2551 packets will be longer, but that is appropriate since the 2552 mixer represents multiple sources. Similarly, a mixer 2553 which passes through SDES packets as they are received will 2554 be transmitting RTCP packets at higher than the single 2555 source rate, but again that is correct since the packets 2556 come from multiple sources. The RTCP packet rate may be 2557 different on each side of the mixer. 2559 A mixer that does not insert CSRC identifiers MAY also 2560 refrain from forwarding SDES CNAMEs. In this case, the SSRC 2561 identifier spaces in the two clouds are independent. As 2562 mentioned earlier, this mode of operation creates a danger 2563 that loops can't be detected. 2565 BYE: Mixers MUST forward BYE packets. A mixer that is about to 2566 cease forwarding packets SHOULD send a BYE packet to each 2567 connected cloud containing all the SSRC identifiers that 2568 were previously being forwarded to that cloud, including 2569 the mixer's own SSRC identifier if it sent reports of its 2570 own. 2572 APP: The treatment of APP packets by mixers is application- 2573 specific. 2575 7.4 Cascaded Mixers 2577 An RTP session may involve a collection of mixers and translators as 2578 shown in Figure 3. If two mixers are cascaded, such as M2 and M3 in 2579 the figure, packets received by a mixer may already have been mixed 2580 and may include a CSRC list with multiple identifiers. The second 2581 mixer SHOULD build the CSRC list for the outgoing packet using the 2582 CSRC identifiers from already-mixed input packets and the SSRC 2583 identifiers from unmixed input packets. This is shown in the output 2584 arc from mixer M3 labeled M3:89(64,45) in the figure. As in the case 2585 of mixers that are not cascaded, if the resulting CSRC list has more 2586 than 15 identifiers, the remainder cannot be included. 2588 8 SSRC Identifier Allocation and Use 2590 The SSRC identifier carried in the RTP header and in various fields 2591 of RTCP packets is a random 32-bit number that is required to be 2592 globally unique within an RTP session. It is crucial that the number 2593 be chosen with care in order that participants on the same network or 2594 starting at the same time are not likely to choose the same number. 2596 It is not sufficient to use the local network address (such as an 2597 IPv4 address) for the identifier because the address may not be 2598 unique. Since RTP translators and mixers enable interoperation among 2599 multiple networks with different address spaces, the allocation 2600 patterns for addresses within two spaces might result in a much 2601 higher rate of collision than would occur with random allocation. 2603 Multiple sources running on one host would also conflict. 2605 It is also not sufficient to obtain an SSRC identifier simply by 2606 calling random() without carefully initializing the state. An example 2607 of how to generate a random identifier is presented in Appendix A.6. 2609 8.1 Probability of Collision 2611 Since the identifiers are chosen randomly, it is possible that two or 2612 more sources will choose the same number. Collision occurs with the 2613 highest probability when all sources are started simultaneously, for 2614 example when triggered automatically by some session management 2615 event. If N is the number of sources and L the length of the 2616 identifier (here, 32 bits), the probability that two sources 2617 independently pick the same value can be approximated for large N 2618 [25] as 1 - exp(-N**2 / 2**(L+1)). For N=1000, the probability is 2619 roughly 10**-4. 2621 The typical collision probability is much lower than the worst-case 2622 above. When one new source joins an RTP session in which all the 2623 other sources already have unique identifiers, the probability of 2624 collision is just the fraction of numbers used out of the space. 2625 Again, if N is the number of sources and L the length of the 2626 identifier, the probability of collision is N / 2**L. For N=1000, the 2627 probability is roughly 2*10**-7. 2629 The probability of collision is further reduced by the opportunity 2630 for a new source to receive packets from other participants before 2631 sending its first packet (either data or control). If the new source 2632 keeps track of the other participants (by SSRC identifier), then 2633 before transmitting its first packet the new source can verify that 2634 its identifier does not conflict with any that have been received, or 2635 else choose again. 2637 8.2 Collision Resolution and Loop Detection 2639 Although the probability of SSRC identifier collision is low, all RTP 2640 implementations MUST be prepared to detect collisions and take the 2641 appropriate actions to resolve them. If a source discovers at any 2642 time that another source is using the same SSRC identifier as its 2643 own, it MUST send an RTCP BYE packet for the old identifier and 2644 choose another random one. (As explained below, this step is taken 2645 only once in case of a loop.) If a receiver discovers that two other 2646 sources are colliding, it MAY keep the packets from one and discard 2647 the packets from the other when this can be detected by different 2648 source transport addresses or CNAMEs. The two sources are expected 2649 to resolve the collision so that the situation doesn't last. 2651 Because the random SSRC identifiers are kept globally unique for each 2652 RTP session, they can also be used to detect loops that may be 2653 introduced by mixers or translators. A loop causes duplication of 2654 data and control information, either unmodified or possibly mixed, as 2655 in the following examples: 2657 o A translator may incorrectly forward a packet to the same 2658 multicast group from which it has received the packet, either 2659 directly or through a chain of translators. In that case, the 2660 same packet appears several times, originating from different 2661 network sources. 2663 o Two translators incorrectly set up in parallel, i.e., with the 2664 same multicast groups on both sides, would both forward 2665 packets from one multicast group to the other. Unidirectional 2666 translators would produce two copies; bidirectional 2667 translators would form a loop. 2669 o A mixer can close a loop by sending to the same transport 2670 destination upon which it receives packets, either directly or 2671 through another mixer or translator. In this case a source 2672 might show up both as an SSRC on a data packet and a CSRC in a 2673 mixed data packet. 2675 A source may discover that its own packets are being looped, or that 2676 packets from another source are being looped (a third-party loop). 2678 Both loops and collisions in the random selection of a source 2679 identifier result in packets arriving with the same SSRC identifier 2680 but a different source transport address, which may be that of the 2681 end system originating the packet or an intermediate system. 2682 Therefore, if a source changes its source transport address, it MAY 2683 also choose a new SSRC identifier to avoid being interpreted as a 2684 looped source. (This is not MUST because in some applications of RTP 2685 sources may be expected to change addresses during a session.) Note 2686 that if a translator restarts and consequently changes the source 2687 transport address (e.g., changes the UDP source port number) on which 2688 it forwards packets, then all those packets will appear to receivers 2689 to be looped because the SSRC identifiers are applied by the original 2690 source and will not change. This problem can be avoided by keeping 2691 the source transport addressed fixed across restarts, but in any case 2692 will be resolved after a timeout at the receivers. 2694 Loops or collisions occurring on the far side of a translator or 2695 mixer cannot be detected using the source transport address if all 2696 copies of the packets go through the translator or mixer, however 2697 collisions may still be detected when chunks from two RTCP SDES 2698 packets contain the same SSRC identifier but different CNAMEs. 2700 To detect and resolve these conflicts, an RTP implementation MUST 2701 include an algorithm similar to the one described below, though the 2702 implementation MAY choose a different policy for which packets from 2703 colliding third-party sources are kept. The algorithm described below 2704 ignores packets from a new source or loop that collide with an 2705 established source. It resolves collisions with the participant's own 2706 SSRC identifier by sending an RTCP BYE for the old identifier and 2707 choosing a new one. However, when the collision was induced by a loop 2708 of the participant's own packets, the algorithm will choose a new 2709 identifier only once and thereafter ignore packets from the looping 2710 source transport address. This is required to avoid a flood of BYE 2711 packets. 2713 This algorithm requires keeping a table indexed by the source 2714 identifier and containing the source transport addresses from the 2715 first RTP packet and first RTCP packet received with that identifier, 2716 along with other state for that source. Two source transport 2717 addresses are required since, for example, the UDP source port 2718 numbers may be different on RTP and RTCP packets. However, it may be 2719 assumed that the network address is the same in both source transport 2720 addresses. 2722 Each SSRC or CSRC identifier received in an RTP or RTCP packet is 2723 looked up in the source identifier table in order to process that 2724 data or control information. The source transport address from the 2725 packet is compared to the corresponding source transport address in 2726 the table to detect a loop or collision if they don't match. For 2727 control packets, each element with its own SSRC id, for example an 2728 SDES chunk, requires a separate lookup. (The SSRC id in a reception 2729 report block is an exception because it identifies a source heard by 2730 the reporter, and that SSRC id is unrelated to the source transport 2731 adddress of the RTCP packet sent by the reporter.) If the SSRC or 2732 CSRC is not found, a new entry is created. These table entries are 2733 removed when an RTCP BYE packet is received with the corresponding 2734 SSRC id and validated by a matching source transport address, or 2735 after no packets have arrived for a relatively long time (see Section 2736 6.2.1). 2738 Note that if two sources on the same host are transmitting with the 2739 same source identifier at the time a receiver begins operation, it 2740 would be possible that the first RTP packet received came from one of 2741 the sources while the first RTCP packet received came from the other. 2742 This would cause the wrong RTCP information to be associated with the 2743 RTP data, but this situation should be sufficiently rare and harmless 2744 that it may be disregarded. 2746 In order to track loops of the participant's own data packets, the 2747 implementation MUST also keep a separate list of source transport 2748 addresses (not identifiers) that have been found to be conflicting. 2749 As in the source identifier table, two source transport addresses 2750 MUST be kept to separately track conflicting RTP and RTCP packets. 2751 Note that the conflicting address list should be short, usually 2752 empty. Each element in this list stores the source addresses plus 2753 the time when the most recent conflicting packet was received. An 2754 element MAY be removed from the list when no conflicting packet has 2755 arrived from that source for a time on the order of 10 RTCP report 2756 intervals (see Section 6.2). 2758 For the algorithm as shown, it is assumed that the participant's own 2759 source identifier and state are included in the source identifier 2760 table. The algorithm could be restructured to first make a separate 2761 comparison against the participant's own source identifier. 2763 if (SSRC or CSRC identifier is not found in the source 2764 identifier table) { 2765 create a new entry storing the data or control source 2766 transport address, the SSRC or CSRC id and other state; 2767 } 2769 /* Identifier is found in the table */ 2771 else if (table entry was created on receipt of a control packet 2772 and this is the first data packet or vice versa) { 2773 store the source transport address from this packet; 2774 } 2775 else if (source transport address from the packet does not match 2776 the one saved in the table entry for this identifier) { 2778 /* An identifier collision or a loop is indicated */ 2780 if (source identifier is not the participant's own) { 2781 /* OPTIONAL error counter step */ 2782 if (source identifier is from an RTCP SDES chunk 2783 containing a CNAME item that differs from the CNAME 2784 in the table entry) { 2785 count a third-party collision; 2786 } else { 2787 count a third-party loop; 2788 } 2789 abort processing of data packet or control element; 2790 /* MAY choose a different policy to keep new source */ 2791 } 2793 /* A collision or loop of the participant's own packets */ 2795 else if (source transport address is found in the list of 2796 conflicting data or control source transport 2797 addresses) { 2798 /* OPTIONAL error counter step */ 2799 if (source identifier is not from an RTCP SDES chunk 2800 containing a CNAME item or CNAME is the 2801 participant's own) { 2802 count occurrence of own traffic looped; 2803 } 2804 mark current time in conflicting address list entry; 2805 abort processing of data packet or control element; 2806 } 2808 /* New collision, change SSRC identifier */ 2810 else { 2811 log occurrence of a collision; 2812 create a new entry in the conflicting data or control 2813 source transport address list and mark current time; 2814 send an RTCP BYE packet with the old SSRC identifier; 2815 choose a new SSRC identifier; 2816 create a new entry in the source identifier table with 2817 the old SSRC plus the source transport address from 2818 the data or control packet being processed; 2819 } 2820 } 2822 In this algorithm, packets from a newly conflicting source address 2823 will be ignored and packets from the original source address will be 2824 kept. If no packets arrive from the original source for an extended 2825 period, the table entry will be timed out and the new source will be 2826 able to take over. This might occur if the original source detects 2827 the collision and moves to a new source identifier, but in the usual 2828 case an RTCP BYE packet will be received from the original source to 2829 delete the state without having to wait for a timeout. 2831 If the original source address was through a mixer (i.e., learned as 2832 a CSRC) and later the same source is received directly, the receiver 2833 may be well advised to switch to the new source address unless other 2834 sources in the mix would be lost. Furthermore, for applications such 2835 as telephony in which some sources such as mobile entities may change 2836 addresses during the course of an RTP session, the RTP implementation 2837 SHOULD modify the collision detection algorithm to accept packets 2838 from the new source transport address. To guard against flip-flopping 2839 between addresses if a genuine collision does occur, the algorithm 2840 SHOULD include some means to detect this case and avoid switching. 2842 When a new SSRC identifier is chosen due to a collision, the 2843 candidate identifier SHOULD first be looked up in the source 2844 identifier table to see if it was already in use by some other 2845 source. If so, another candidate MUST be generated and the process 2846 repeated. 2848 A loop of data packets to a multicast destination can cause severe 2849 network flooding. All mixers and translators MUST implement a loop 2850 detection algorithm like the one here so that they can break loops. 2851 This should limit the excess traffic to no more than one duplicate 2852 copy of the original traffic, which may allow the session to continue 2853 so that the cause of the loop can be found and fixed. However, in 2854 extreme cases where a mixer or translator does not properly break the 2855 loop and high traffic levels result, it may be necessary for end 2856 systems to cease transmitting data or control packets entirely. This 2857 decision may depend upon the application. An error condition SHOULD 2858 be indicated as appropriate. Transmission MAY be attempted again 2859 periodically after a long, random time (on the order of minutes). 2861 8.3 Use with Layered Encodings 2863 For layered encodings transmitted on separate RTP sessions (see 2864 Section 2.4), a single SSRC identifier space SHOULD be used across 2865 the sessions of all layers and the core (base) layer SHOULD be used 2866 for SSRC identifier allocation and collision resolution. When a 2867 source discovers that it has collided, it transmits an RTCP BYE 2868 packet on only the base layer but changes the SSRC identifier to the 2869 new value in all layers. 2871 9 Security 2873 Lower layer protocols may eventually provide all the security 2874 services that may be desired for applications of RTP, including 2875 authentication, integrity, and confidentiality. These services have 2876 been specified for IP in [26]. Since the initial audio and video 2877 applications using RTP needed a confidentiality service before such 2878 services were available for the IP layer, the confidentiality service 2879 described in the next section was defined for use with RTP and RTCP. 2880 That description is included here to codify existing practice. New 2881 applications of RTP MAY implement this RTP-specific confidentiality 2882 service for backward compatibility, and/or they MAY implement IP 2883 layer security services. The overhead on the RTP protocol for this 2884 confidentiality service is low, so the penalty will be minimal if 2885 this service is obsoleted by lower layer services in the future. 2887 Alternatively, other services, other implementations of services and 2888 other algorithms may be defined for RTP in the future if warranted. 2889 The selection presented here is meant to simplify implementation of 2890 interoperable, secure applications and provide guidance to 2891 implementors. No claim is made that the methods presented here are 2892 appropriate for a particular security need. A profile may specify 2893 which services and algorithms should be offered by applications, and 2894 may provide guidance as to their appropriate use. 2896 Key distribution and certificates are outside the scope of this 2897 document. 2899 9.1 Confidentiality 2901 Confidentiality means that only the intended receiver(s) can decode 2902 the received packets; for others, the packet contains no useful 2903 information. Confidentiality of the content is achieved by 2904 encryption. 2906 When encryption of RTP or RTCP is desired, all the octets that will 2907 be encapsulated for transmission in a single lower-layer packet are 2908 encrypted as a unit. For RTCP, a 32-bit random number MUST be 2909 prepended to the unit before encryption to deter known plaintext 2910 attacks. For RTP, no prefix is required because the sequence number 2911 and timestamp fields are initialized with random offsets. 2913 For RTCP, an implementation MAY segregate the individual RTCP 2914 packets in a compound RTCP packet into two separate compound RTCP 2915 packets, one to be encrypted and one to be sent in the clear. For 2916 example, SDES information might be encrypted while reception 2917 reports were sent in the clear to accommodate third-party monitors 2918 that are not privy to the encryption key. In this example, depicted 2919 in Fig. 4, the SDES information MUST be appended to an RR packet 2920 with no reports (and the random number) to satisfy the requirement 2921 that all compound RTCP packets begin with an SR or RR packet. 2923 The presence of encryption and the use of the correct key are 2925 UDP packet UDP packet 2926 ----------------------------- ------------------------------ 2927 [random][RR][SDES #CNAME ...] [SR #senderinfo #site1 #site2] 2928 ----------------------------- ------------------------------ 2929 encrypted not encrypted 2931 #: SSRC identifier 2933 Figure 4: Encrypted and non-encrypted RTCP packets 2935 confirmed by the receiver through header or payload validity checks. 2936 Examples of such validity checks for RTP and RTCP headers are given 2937 in Appendices A.1 and A.2. 2939 To be consistent with existing practice, the default encryption 2940 algorithm is the Data Encryption Standard (DES) algorithm in cipher 2941 block chaining (CBC) mode, as described in Section 1.1 of RFC 1423 2942 [27], except that padding to a multiple of 8 octets is indicated as 2943 described for the P bit in Section 5.1. The initialization vector is 2944 zero because random values are supplied in the RTP header or by the 2945 random prefix for compound RTCP packets. For details on the use of 2946 CBC initialization vectors, see [28]. Implementations that support 2947 encryption SHOULD always support the DES algorithm in CBC mode as the 2948 default to maximize interoperability. This method was chosen because 2949 it has been demonstrated to be easy and practical to use in 2950 experimental audio and video tools in operation on the Internet. 2951 Other encryption algorithms MAY be specified dynamically for a 2952 session by non-RTP means. It is RECOMMENDED that stronger encryption 2953 algorithms such as Triple-DES be used in place of the default 2954 algorithm. 2956 As an alternative to encryption at the IP level or at the RTP level 2957 as described above, profiles MAY define additional payload types for 2958 encrypted encodings. Those encodings MUST specify how padding and 2959 other aspects of the encryption are to be handled. This method allows 2960 encrypting only the data while leaving the headers in the clear for 2961 applications where that is desired. It may be particularly useful for 2962 hardware devices that will handle both decryption and decoding. It 2963 is also valuable for applications where link-level compression of RTP 2964 and lower-layer headers is desired and confidentiality of the payload 2965 (but not addresses) is sufficient since encryption of the headers 2966 precludes compression. 2968 9.2 Authentication and Message Integrity 2970 Authentication and message integrity services are not defined at the 2971 RTP level since these services would not be directly feasible without 2972 a key management infrastructure. It is expected that authentication 2973 and integrity services will be provided by lower layer protocols. 2975 10 Congestion Control 2977 All transport protocols used on the Internet need to address 2978 congestion control in some way [29]. RTP is not an exception, but 2979 because the data transported over RTP is often inelastic (generated 2980 at a fixed or controlled rate), the means to control congestion in 2981 RTP may be quite different from those for other transport protocols 2982 such as TCP. In one sense, inelasticity reduces the risk of 2983 congestion because the RTP stream will not expand to consume all 2984 available bandwidth as a TCP stream can. However, inelasticity also 2985 means that the RTP stream cannot arbitrarily reduce its load on the 2986 network to eliminate congestion when it occurs. 2988 Since RTP may be used for a wide variety of applications in many 2989 different contexts, there is no single congestion control mechanism 2990 that will work for all. Therefore, congestion control SHOULD be 2991 defined in each RTP profile as appropriate. For some profiles, it may 2992 be sufficient to include an applicability statement restricting the 2993 use of that profile to environments where congestion is avoided by 2994 engineering. For other profiles, specific methods such as data rate 2995 adaptation based on RTCP feedback may be required. 2997 11 RTP over Network and Transport Protocols 2999 This section describes issues specific to carrying RTP packets within 3000 particular network and transport protocols. The following rules apply 3001 unless superseded by protocol-specific definitions outside this 3002 specification. 3004 RTP relies on the underlying protocol(s) to provide demultiplexing of 3005 RTP data and RTCP control streams. For UDP and similar protocols, RTP 3006 SHOULD use an even destination port number and the corresponding RTCP 3007 stream SHOULD use the next higher (odd) destination port number. If 3008 an application is supplied with an odd number for use as the 3009 destination RTP port, it SHOULD replace this number with the next 3010 lower (even) number. 3012 In a unicast session, both participants need to identify a port pair 3013 for receiving RTP and RTCP packets. Both participants MAY use the 3014 same port pair. A participant MUST NOT assume that the source port of 3015 the incoming RTP or RTCP packet can be used as the destination port 3016 for outgoing RTP or RTCP packets. When RTP data packets are being 3017 sent in both directions, each participant MUST send RTCP SR packets 3018 to the port that the other participant has specified for reception of 3019 RTCP. The RTCP SR packets combine sender information for the outgoing 3020 data plus reception report information for the incoming data. If a 3021 side is not actively sending data (see Section 6.4), an RTCP RR 3022 packet is sent instead. 3024 It is RECOMMENDED that layered encoding applications (see Section 3025 2.4) use a set of contiguous port numbers. The port numbers MUST be 3026 distinct because of a widespread deficiency in existing operating 3027 systems that prevents use of the same port with multiple multicast 3028 addresses, and for unicast, there is only one permissible address. 3029 Thus for layer n, the data port is P + 2n, and the control port is P 3030 + 2n + 1. When IP multicast is used, the addresses MUST also be 3031 distinct because multicast routing and group membership are managed 3032 on an address granularity. However, allocation of contiguous IP 3033 multicast addresses cannot be assumed because some groups may require 3034 different scopes and may therefore be allocated from different 3035 address ranges. 3037 The previous paragraph conflicts with the SDP specification, RFC 2327 3038 [8], which says that it is illegal for both multiple addresses and 3039 multiple ports to be specified in the same session description 3040 because the association of addresses with ports could be ambiguous. 3041 It is intended that this restriction will be relaxed in a revision of 3042 RFC 2327 to allow an equal number of addresses and ports to be 3043 specified with a one-to-one mapping implied. 3045 RTP data packets contain no length field or other delineation, 3046 therefore RTP relies on the underlying protocol(s) to provide a 3047 length indication. The maximum length of RTP packets is limited only 3048 by the underlying protocols. 3050 If RTP packets are to be carried in an underlying protocol that 3051 provides the abstraction of a continuous octet stream rather than 3052 messages (packets), an encapsulation of the RTP packets MUST be 3053 defined to provide a framing mechanism. Framing is also needed if the 3054 underlying protocol may contain padding so that the extent of the RTP 3055 payload cannot be determined. The framing mechanism is not defined 3056 here. 3058 A profile MAY specify a framing method to be used even when RTP is 3059 carried in protocols that do provide framing in order to allow 3060 carrying several RTP packets in one lower-layer protocol data unit, 3061 such as a UDP packet. Carrying several RTP packets in one network or 3062 transport packet reduces header overhead and may simplify 3063 synchronization between different streams. 3065 12 Summary of Protocol Constants 3067 This section contains a summary listing of the constants defined in 3068 this specification. 3070 The RTP payload type (PT) constants are defined in profiles rather 3071 than this document. However, the octet of the RTP header which 3072 contains the marker bit(s) and payload type MUST avoid the reserved 3073 values 200 and 201 (decimal) to distinguish RTP packets from the RTCP 3074 SR and RR packet types for the header validation procedure described 3075 in Appendix A.1. For the standard definition of one marker bit and a 3076 7-bit payload type field as shown in this specification, this 3077 restriction means that payload types 72 and 73 are reserved. 3079 12.1 RTCP packet types 3081 abbrev. name value 3082 SR sender report 200 3083 RR receiver report 201 3084 SDES source description 202 3085 BYE goodbye 203 3086 APP application-defined 204 3088 These type values were chosen in the range 200-204 for improved 3089 header validity checking of RTCP packets compared to RTP packets or 3090 other unrelated packets. When the RTCP packet type field is compared 3091 to the corresponding octet of the RTP header, this range corresponds 3092 to the marker bit being 1 (which it usually is not in data packets) 3093 and to the high bit of the standard payload type field being 1 (since 3094 the static payload types are typically defined in the low half). This 3095 range was also chosen to be some distance numerically from 0 and 255 3096 since all-zeros and all-ones are common data patterns. 3098 Since all compound RTCP packets MUST begin with SR or RR, these codes 3099 were chosen as an even/odd pair to allow the RTCP validity check to 3100 test the maximum number of bits with mask and value. 3102 Additional RTCP packet types may be registered through IANA (see 3103 Section 14). 3105 12.2 SDES types 3107 abbrev. name value 3108 END end of SDES list 0 3109 CNAME canonical name 1 3110 NAME user name 2 3111 EMAIL user's electronic mail address 3 3112 PHONE user's phone number 4 3113 LOC geographic user location 5 3114 TOOL name of application or tool 6 3115 NOTE notice about the source 7 3116 PRIV private extensions 8 3118 Additional SDES types may be registered through IANA (see Section 3119 14). 3121 13 RTP Profiles and Payload Format Specifications 3123 A complete specification of RTP for a particular application will 3124 require one or more companion documents of two types described here: 3125 profiles, and payload format specifications. 3127 RTP may be used for a variety of applications with somewhat differing 3128 requirements. The flexibility to adapt to those requirements is 3129 provided by allowing multiple choices in the main protocol 3130 specification, then selecting the appropriate choices or defining 3131 extensions for a particular environment and class of applications in 3132 a separate profile document. Typically an application will operate 3133 under only one profile in a particular RTP session, so there is no 3134 explicit indication within the RTP protocol itself as to which 3135 profile is in use. A profile for audio and video applications may be 3136 found in the companion RFC 1890 (updated by Internet-Draft draft- 3137 ietf-avt-profile-new ). Profiles are typically titled "RTP Profile 3138 for ...". 3140 The second type of companion document is a payload format 3141 specification, which defines how a particular kind of payload data, 3142 such as H.261 encoded video, should be carried in RTP. These 3143 documents are typically titled "RTP Payload Format for XYZ 3144 Audio/Video Encoding". Payload formats may be useful under multiple 3145 profiles and may therefore be defined independently of any particular 3146 profile. The profile documents are then responsible for assigning a 3147 default mapping of that format to a payload type value if needed. 3149 Within this specification, the following items have been identified 3150 for possible definition within a profile, but this list is not meant 3151 to be exhaustive: 3153 RTP data header: The octet in the RTP data header that contains 3154 the marker bit and payload type field MAY be redefined by a 3155 profile to suit different requirements, for example with 3156 more or fewer marker bits (Section 5.3, p. 13). 3158 Payload types: Assuming that a payload type field is included, 3159 the profile will usually define a set of payload formats 3160 (e.g., media encodings) and a default static mapping of 3161 those formats to payload type values. Some of the payload 3162 formats may be defined by reference to separate payload 3163 format specifications. For each payload type defined, the 3164 profile MUST specify the RTP timestamp clock rate to be 3165 used (Section 5.1, p. 12). 3167 RTP data header additions: Additional fields MAY be appended to 3168 the fixed RTP data header if some additional functionality 3169 is required across the profile's class of applications 3170 independent of payload type (Section 5.3, p. 13). 3172 RTP data header extensions: The contents of the first 16 bits of 3173 the RTP data header extension structure MUST be defined if 3174 use of that mechanism is to be allowed under the profile 3175 for implementation-specific extensions (Section 5.3.1, p. 3176 14). 3178 RTCP packet types: New application-class-specific RTCP packet 3179 types MAY be defined and registered with IANA. 3181 RTCP report interval: A profile SHOULD specify that the values 3182 suggested in Section 6.2 for the constants employed in the 3183 calculation of the RTCP report interval will be used. Those 3184 are the RTCP fraction of session bandwidth, the minimum 3185 report interval, and the bandwidth split between senders 3186 and receivers. A profile MAY specify alternate values if 3187 they have been demonstrated to work in a scalable manner. 3189 SR/RR extension: An extension section MAY be defined for the 3190 RTCP SR and RR packets if there is additional information 3191 that should be reported regularly about the sender or 3192 receivers (Section 6.4.3, p. 31). 3194 SDES use: The profile MAY specify the relative priorities for 3195 RTCP SDES items to be transmitted or excluded entirely 3196 (Section 6.3.9); an alternate syntax or semantics for the 3197 CNAME item (Section 6.5.1); the format of the LOC item 3198 (Section 6.5.5); the semantics and use of the NOTE item 3199 (Section 6.5.7); or new SDES item types to be registered 3200 with IANA. 3202 Security: A profile MAY specify which security services and 3203 algorithms should be offered by applications, and MAY 3204 provide guidance as to their appropriate use (Section 9, p. 3205 47). 3207 String-to-key mapping: A profile MAY specify how a user-provided 3208 password or pass phrase is mapped into an encryption key. 3210 Congestion: A profile SHOULD specify the congestion control 3211 behavior appropriate for that profile. 3213 Underlying protocol: Use of a particular underlying network or 3214 transport layer protocol to carry RTP packets MAY be 3215 required. 3217 Transport mapping: A mapping of RTP and RTCP to transport-level 3218 addresses, e.g., UDP ports, other than the standard mapping 3219 defined in Section 11, p. 49 may be specified. 3221 Encapsulation: An encapsulation of RTP packets may be defined to 3222 allow multiple RTP data packets to be carried in one 3223 lower-layer packet or to provide framing over underlying 3224 protocols that do not already do so (Section 11, p. 49). 3226 It is not expected that a new profile will be required for every 3227 application. Within one application class, it would be better to 3228 extend an existing profile rather than make a new one in order to 3229 facilitate interoperation among the applications since each will 3230 typically run under only one profile. Simple extensions such as the 3231 definition of additional payload type values or RTCP packet types may 3232 be accomplished by registering them through IANA and publishing their 3233 descriptions in an addendum to the profile or in a payload format 3234 specification. 3236 14 IANA Considerations 3238 Additional RTCP packet types and SDES item types may be registered 3239 through the Internet Assigned Numbers Authority (IANA). Since these 3240 number spaces are small, allowing unconstrained registration of new 3241 values would not be prudent. To facilitate review of requests and to 3242 promote shared use of new types among multiple applications, requests 3243 for registration of new values must be documented in an RFC or other 3244 permanent and readily available reference such as the product of 3245 another cooperative standards body (e.g., ITU-T). Other requests may 3246 also be accepted, under the advice of a "designated expert." (Contact 3247 the IANA for the contact information of the current expert.) 3249 RTP profile specifications SHOULD register with IANA a name for the 3250 profile in the form "RTP/xxx", where xxx is a short abbreviation of 3251 the profile title. These names are for use by higher-level control 3252 protocols, such as the Session Description Protocol (SDP), RFC 2327 3253 [8], to refer to transport methods. 3255 A Algorithms 3257 We provide examples of C code for aspects of RTP sender and receiver 3258 algorithms. There may be other implementation methods that are faster 3259 in particular operating environments or have other advantages. These 3260 implementation notes are for informational purposes only and are 3261 meant to clarify the RTP specification. 3263 The following definitions are used for all examples; for clarity and 3264 brevity, the structure definitions are only valid for 32-bit big- 3265 endian (most significant octet first) architectures. Bit fields are 3266 assumed to be packed tightly in big-endian bit order, with no 3267 additional padding. Modifications would be required to construct a 3268 portable implementation. 3270 /* 3271 * rtp.h -- RTP header file 3272 */ 3273 #include 3275 /* 3276 * The type definitions below are valid for 32-bit architectures and 3277 * may have to be adjusted for 16- or 64-bit architectures. 3278 */ 3279 typedef unsigned char u_int8; 3280 typedef unsigned short u_int16; 3281 typedef unsigned int u_int32; 3282 typedef short int16; 3284 /* 3285 * Current protocol version. 3286 */ 3287 #define RTP_VERSION 2 3289 #define RTP_SEQ_MOD (1<<16) 3290 #define RTP_MAX_SDES 255 /* maximum text length for SDES */ 3292 typedef enum { 3293 RTCP_SR = 200, 3294 RTCP_RR = 201, 3295 RTCP_SDES = 202, 3296 RTCP_BYE = 203, 3297 RTCP_APP = 204 3298 } rtcp_type_t; 3300 typedef enum { 3301 RTCP_SDES_END = 0, 3302 RTCP_SDES_CNAME = 1, 3303 RTCP_SDES_NAME = 2, 3304 RTCP_SDES_EMAIL = 3, 3305 RTCP_SDES_PHONE = 4, 3306 RTCP_SDES_LOC = 5, 3307 RTCP_SDES_TOOL = 6, 3308 RTCP_SDES_NOTE = 7, 3309 RTCP_SDES_PRIV = 8 3310 } rtcp_sdes_type_t; 3312 /* 3313 * RTP data header 3314 */ 3315 typedef struct { 3316 unsigned int version:2; /* protocol version */ 3317 unsigned int p:1; /* padding flag */ 3318 unsigned int x:1; /* header extension flag */ 3319 unsigned int cc:4; /* CSRC count */ 3320 unsigned int m:1; /* marker bit */ 3321 unsigned int pt:7; /* payload type */ 3322 unsigned int seq:16; /* sequence number */ 3323 u_int32 ts; /* timestamp */ 3324 u_int32 ssrc; /* synchronization source */ 3325 u_int32 csrc[1]; /* optional CSRC list */ 3326 } rtp_hdr_t; 3328 /* 3329 * RTCP common header word 3330 */ 3331 typedef struct { 3332 unsigned int version:2; /* protocol version */ 3333 unsigned int p:1; /* padding flag */ 3334 unsigned int count:5; /* varies by packet type */ 3335 unsigned int pt:8; /* RTCP packet type */ 3336 u_int16 length; /* pkt len in words, w/o this word */ 3337 } rtcp_common_t; 3339 /* 3340 * Big-endian mask for version, padding bit and packet type pair 3341 */ 3342 #define RTCP_VALID_MASK (0xc000 | 0x2000 | 0xfe) 3343 #define RTCP_VALID_VALUE ((RTP_VERSION << 14) | RTCP_SR) 3345 /* 3346 * Reception report block 3347 */ 3348 typedef struct { 3349 u_int32 ssrc; /* data source being reported */ 3350 unsigned int fraction:8; /* fraction lost since last SR/RR */ 3351 int lost:24; /* cumul. no. pkts lost (signed!) */ 3352 u_int32 last_seq; /* extended last seq. no. received */ 3353 u_int32 jitter; /* interarrival jitter */ 3354 u_int32 lsr; /* last SR packet from this source */ 3355 u_int32 dlsr; /* delay since last SR packet */ 3356 } rtcp_rr_t; 3358 /* 3359 * SDES item 3360 */ 3361 typedef struct { 3362 u_int8 type; /* type of item (rtcp_sdes_type_t) */ 3363 u_int8 length; /* length of item (in octets) */ 3364 char data[1]; /* text, not null-terminated */ 3366 } rtcp_sdes_item_t; 3368 /* 3369 * One RTCP packet 3370 */ 3371 typedef struct { 3372 rtcp_common_t common; /* common header */ 3373 union { 3374 /* sender report (SR) */ 3375 struct { 3376 u_int32 ssrc; /* sender generating this report */ 3377 u_int32 ntp_sec; /* NTP timestamp */ 3378 u_int32 ntp_frac; 3379 u_int32 rtp_ts; /* RTP timestamp */ 3380 u_int32 psent; /* packets sent */ 3381 u_int32 osent; /* octets sent */ 3382 rtcp_rr_t rr[1]; /* variable-length list */ 3383 } sr; 3385 /* reception report (RR) */ 3386 struct { 3387 u_int32 ssrc; /* receiver generating this report */ 3388 rtcp_rr_t rr[1]; /* variable-length list */ 3389 } rr; 3391 /* source description (SDES) */ 3392 struct rtcp_sdes { 3393 u_int32 src; /* first SSRC/CSRC */ 3394 rtcp_sdes_item_t item[1]; /* list of SDES items */ 3395 } sdes; 3397 /* BYE */ 3398 struct { 3399 u_int32 src[1]; /* list of sources */ 3400 /* can't express trailing text for reason */ 3401 } bye; 3402 } r; 3403 } rtcp_t; 3405 typedef struct rtcp_sdes rtcp_sdes_t; 3406 /* 3407 * Per-source state information 3408 */ 3409 typedef struct { 3410 u_int16 max_seq; /* highest seq. number seen */ 3411 u_int32 cycles; /* shifted count of seq. number cycles */ 3412 u_int32 base_seq; /* base seq number */ 3413 u_int32 bad_seq; /* last 'bad' seq number + 1 */ 3414 u_int32 probation; /* sequ. packets till source is valid */ 3415 u_int32 received; /* packets received */ 3416 u_int32 expected_prior; /* packet expected at last interval */ 3417 u_int32 received_prior; /* packet received at last interval */ 3418 u_int32 transit; /* relative trans time for prev pkt */ 3419 u_int32 jitter; /* estimated jitter */ 3420 /* ... */ 3421 } source; 3423 A.1 RTP Data Header Validity Checks 3425 An RTP receiver SHOULD check the validity of the RTP header on 3426 incoming packets since they might be encrypted or might be from a 3427 different application that happens to be misaddressed. Similarly, if 3428 encryption according to the method described in Section 9 is enabled, 3429 the header validity check is needed to verify that incoming packets 3430 have been correctly decrypted, although a failure of the header 3431 validity check (e.g., unknown payload type) may not necessarily 3432 indicate decryption failure. 3434 Only weak validity checks are possible on an RTP data packet from a 3435 source that has not been heard before: 3437 o RTP version field must equal 2. 3439 o The payload type must be known, in particular it must not be 3440 equal to SR or RR. 3442 o If the P bit is set, then the last octet of the packet must 3443 contain a valid octet count, in particular, less than the 3444 total packet length minus the header size. 3446 o The X bit must be zero if the profile does not specify that 3447 the header extension mechanism may be used. Otherwise, the 3448 extension length field must be less than the total packet size 3449 minus the fixed header length and padding. 3451 o The length of the packet must be consistent with CC and 3452 payload type (if payloads have a known length). 3454 The last three checks are somewhat complex and not always possible, 3455 leaving only the first two which total just a few bits. If the SSRC 3456 identifier in the packet is one that has been received before, then 3457 the packet is probably valid and checking if the sequence number is 3458 in the expected range provides further validation. If the SSRC 3459 identifier has not been seen before, then data packets carrying that 3460 identifier may be considered invalid until a small number of them 3461 arrive with consecutive sequence numbers. Those invalid packets MAY 3462 be discarded or they MAY be stored and delivered once validation has 3463 been achieved if the resulting delay is acceptable. 3465 The routine update_seq shown below ensures that a source is declared 3466 valid only after MIN_SEQUENTIAL packets have been received in 3467 sequence. It also validates the sequence number seq of a newly 3468 received packet and updates the sequence state for the packet's 3469 source in the structure to which s points. 3471 When a new source is heard for the first time, that is, its SSRC 3472 identifier is not in the table (see Section 8.2), and the per-source 3473 state is allocated for it, s->probation should be set to the number 3474 of sequential packets required before declaring a source valid 3475 (parameter MIN_SEQUENTIAL ) and s->max_seq initialized to seq-1 s- 3476 >probation marks the source as not yet valid so the state may be 3477 discarded after a short timeout rather than a long one, as discussed 3478 in Section 6.2.1. 3480 After a source is considered valid, the sequence number is considered 3481 valid if it is no more than MAX_DROPOUT ahead of s->max_seq nor more 3482 than MAX_MISORDER behind. If the new sequence number is ahead of 3483 max_seq modulo the RTP sequence number range (16 bits), but is 3484 smaller than max_seq , it has wrapped around and the (shifted) count 3485 of sequence number cycles is incremented. A value of one is returned 3486 to indicate a valid sequence number. 3488 Otherwise, the value zero is returned to indicate that the validation 3489 failed, and the bad sequence number is stored. If the next packet 3490 received carries the next higher sequence number, it is considered 3491 the valid start of a new packet sequence presumably caused by an 3492 extended dropout or a source restart. Since multiple complete 3493 sequence number cycles may have been missed, the packet loss 3494 statistics are reset. 3496 Typical values for the parameters are shown, based on a maximum 3497 misordering time of 2 seconds at 50 packets/second and a maximum 3498 dropout of 1 minute. The dropout parameter MAX_DROPOUT SHOULD be a 3499 small fraction of the 16-bit sequence number space to give a 3500 reasonable probability that new sequence numbers after a restart will 3501 not fall in the acceptable range for sequence numbers from before the 3502 restart. 3504 void init_seq(source *s, u_int16 seq) 3505 { 3506 s->base_seq = seq - 1; 3507 s->max_seq = seq; 3508 s->bad_seq = RTP_SEQ_MOD + 1; 3509 s->cycles = 0; 3510 s->received = 0; 3511 s->received_prior = 0; 3512 s->expected_prior = 0; 3513 /* other initialization */ 3514 } 3516 int update_seq(source *s, u_int16 seq) 3517 { 3518 u_int16 udelta = seq - s->max_seq; 3519 const int MAX_DROPOUT = 3000; 3520 const int MAX_MISORDER = 100; 3521 const int MIN_SEQUENTIAL = 2; 3523 /* 3524 * Source is not valid until MIN_SEQUENTIAL packets with 3525 * sequential sequence numbers have been received. 3526 */ 3527 if (s->probation) { 3528 /* packet is in sequence */ 3529 if (seq == s->max_seq + 1) { 3530 s->probation--; 3531 s->max_seq = seq; 3532 if (s->probation == 0) { 3533 init_seq(s, seq); 3534 s->received++; 3535 return 1; 3536 } 3537 } else { 3538 s->probation = MIN_SEQUENTIAL - 1; 3539 s->max_seq = seq; 3540 } 3541 return 0; 3542 } else if (udelta < MAX_DROPOUT) { 3543 /* in order, with permissible gap */ 3544 if (seq < s->max_seq) { 3545 /* 3546 * Sequence number wrapped - count another 64K cycle. 3547 */ 3548 s->cycles += RTP_SEQ_MOD; 3549 } 3550 s->max_seq = seq; 3552 } else if (udelta <= RTP_SEQ_MOD - MAX_MISORDER) { 3553 /* the sequence number made a very large jump */ 3554 if (seq == s->bad_seq) { 3555 /* 3556 * Two sequential packets -- assume that the other side 3557 * restarted without telling us so just re-sync 3558 * (i.e., pretend this was the first packet). 3559 */ 3560 init_seq(s, seq); 3561 } 3562 else { 3563 s->bad_seq = (seq + 1) & (RTP_SEQ_MOD-1); 3564 return 0; 3565 } 3566 } else { 3567 /* duplicate or reordered packet */ 3568 } 3569 s->received++; 3570 return 1; 3571 } 3573 The validity check can be made stronger requiring more than two 3574 packets in sequence. The disadvantages are that a larger number of 3575 initial packets will be discarded (or delayed in a queue) and that 3576 high packet loss rates could prevent validation. However, because the 3577 RTCP header validation is relatively strong, if an RTCP packet is 3578 received from a source before the data packets, the count could be 3579 adjusted so that only two packets are required in sequence. If 3580 initial data loss for a few seconds can be tolerated, an application 3581 MAY choose to discard all data packets from a source until a valid 3582 RTCP packet has been received from that source. 3584 Depending on the application and encoding, algorithms may exploit 3585 additional knowledge about the payload format for further validation. 3586 For payload types where the timestamp increment is the same for all 3587 packets, the timestamp values can be predicted from the previous 3588 packet received from the same source using the sequence number 3589 difference (assuming no change in payload type). 3591 A strong "fast-path" check is possible since with high probability 3592 the first four octets in the header of a newly received RTP data 3593 packet will be just the same as that of the previous packet from the 3594 same SSRC except that the sequence number will have increased by one. 3595 Similarly, a single-entry cache may be used for faster SSRC lookups 3596 in applications where data is typically received from one source at a 3597 time. 3599 A.2 RTCP Header Validity Checks 3601 The following checks SHOULD be applied to RTCP packets. 3603 o RTP version field must equal 2. 3605 o The payload type field of the first RTCP packet in a compound 3606 packet must be equal to SR or RR. 3608 o The padding bit (P) should be zero for the first packet of a 3609 compound RTCP packet because padding should only be applied, 3610 if it is needed, to the last packet. 3612 o The length fields of the individual RTCP packets must total to 3613 the overall length of the compound RTCP packet as received. 3614 This is a fairly strong check. 3616 The code fragment below performs all of these checks. The packet type 3617 is not checked for subsequent packets since unknown packet types may 3618 be present and should be ignored. 3620 u_int32 len; /* length of compound RTCP packet in words */ 3621 rtcp_t *r; /* RTCP header */ 3622 rtcp_t *end; /* end of compound RTCP packet */ 3624 if ((*(u_int16 *)r & RTCP_VALID_MASK) != RTCP_VALID_VALUE) { 3625 /* something wrong with packet format */ 3626 } 3627 end = (rtcp_t *)((u_int32 *)r + len); 3629 do r = (rtcp_t *)((u_int32 *)r + r->common.length + 1); 3630 while (r < end && r->common.version == 2); 3632 if (r != end) { 3633 /* something wrong with packet format */ 3634 } 3636 A.3 Determining the Number of RTP Packets Expected and Lost 3638 In order to compute packet loss rates, the number of packets expected 3639 and actually received from each source needs to be known, using per- 3640 source state information defined in struct source referenced via 3641 pointer s in the code below. The number of packets received is simply 3642 the count of packets as they arrive, including any late or duplicate 3643 packets. The number of packets expected can be computed by the 3644 receiver as the difference between the highest sequence number 3645 received ( s->max_seq ) and the first sequence number received ( s- 3646 >base_seq ). Since the sequence number is only 16 bits and will wrap 3647 around, it is necessary to extend the highest sequence number with 3648 the (shifted) count of sequence number wraparounds ( s->cycles ). 3649 Both the received packet count and the count of cycles are maintained 3650 the RTP header validity check routine in Appendix A.1. 3652 extended_max = s->cycles + s->max_seq; 3653 expected = extended_max - s->base_seq + 1; 3655 The number of packets lost is defined to be the number of packets 3656 expected less the number of packets actually received: 3658 lost = expected - s->received; 3660 Since this signed number is carried in 24 bits, it SHOULD be clamped 3661 at 0x7fffff for positive loss or 0x800000 for negative loss rather 3662 than wrapping around. 3664 The fraction of packets lost during the last reporting interval 3665 (since the previous SR or RR packet was sent) is calculated from 3666 differences in the expected and received packet counts across the 3667 interval, where expected_prior and received_prior are the values 3668 saved when the previous reception report was generated: 3670 expected_interval = expected - s->expected_prior; 3671 s->expected_prior = expected; 3672 received_interval = s->received - s->received_prior; 3673 s->received_prior = s->received; 3674 lost_interval = expected_interval - received_interval; 3675 if (expected_interval == 0 || lost_interval <= 0) fraction = 0; 3676 else fraction = (lost_interval << 8) / expected_interval; 3678 The resulting fraction is an 8-bit fixed point number with the binary 3679 point at the left edge. 3681 A.4 Generating SDES RTCP Packets 3683 This function builds one SDES chunk into buffer b composed of argc 3684 items supplied in arrays type , value and length b 3686 char *rtp_write_sdes(char *b, u_int32 src, int argc, 3687 rtcp_sdes_type_t type[], char *value[], 3688 int length[]) 3689 { 3690 rtcp_sdes_t *s = (rtcp_sdes_t *)b; 3691 rtcp_sdes_item_t *rsp; 3692 int i; 3693 int len; 3694 int pad; 3696 /* SSRC header */ 3697 s->src = src; 3698 rsp = &s->item[0]; 3700 /* SDES items */ 3701 for (i = 0; i < argc; i++) { 3702 rsp->type = type[i]; 3703 len = length[i]; 3704 if (len > RTP_MAX_SDES) { 3705 /* invalid length, may want to take other action */ 3706 len = RTP_MAX_SDES; 3707 } 3708 rsp->length = len; 3709 memcpy(rsp->data, value[i], len); 3710 rsp = (rtcp_sdes_item_t *)&rsp->data[len]; 3711 } 3713 /* terminate with end marker and pad to next 4-octet boundary */ 3714 len = ((char *) rsp) - b; 3715 pad = 4 - (len & 0x3); 3716 b = (char *) rsp; 3717 while (pad--) *b++ = RTCP_SDES_END; 3719 return b; 3720 } 3722 A.5 Parsing RTCP SDES Packets 3724 This function parses an SDES packet, calling functions find_member() 3725 to find a pointer to the information for a session member given the 3726 SSRC identifier and member_sdes() to store the new SDES information 3727 for that member. This function expects a pointer to the header of the 3728 RTCP packet. 3730 void rtp_read_sdes(rtcp_t *r) 3731 { 3732 int count = r->common.count; 3733 rtcp_sdes_t *sd = &r->r.sdes; 3734 rtcp_sdes_item_t *rsp, *rspn; 3735 rtcp_sdes_item_t *end = (rtcp_sdes_item_t *) 3736 ((u_int32 *)r + r->common.length + 1); 3737 source *s; 3739 while (--count >= 0) { 3740 rsp = &sd->item[0]; 3741 if (rsp >= end) break; 3742 s = find_member(sd->src); 3744 for (; rsp->type; rsp = rspn ) { 3745 rspn = (rtcp_sdes_item_t *)((char*)rsp+rsp->length+2); 3746 if (rspn >= end) { 3747 rsp = rspn; 3748 break; 3749 } 3750 member_sdes(s, rsp->type, rsp->data, rsp->length); 3751 } 3752 sd = (rtcp_sdes_t *) 3753 ((u_int32 *)sd + (((char *)rsp - (char *)sd) >> 2)+1); 3754 } 3755 if (count >= 0) { 3756 /* invalid packet format */ 3757 } 3758 } 3760 A.6 Generating a Random 32-bit Identifier 3762 The following subroutine generates a random 32-bit identifier using 3763 the MD5 routines published in RFC 1321 [30]. The system routines may 3764 not be present on all operating systems, but they should serve as 3765 hints as to what kinds of information may be used. Other system calls 3766 that may be appropriate include 3768 o getdomainname() , 3770 o getwd() , or 3772 o getrusage() 3774 "Live" video or audio samples are also a good source of random 3775 numbers, but care must be taken to avoid using a turned-off 3776 microphone or blinded camera as a source [12]. 3778 Use of this or similar routine is RECOMMENDED to generate the initial 3779 seed for the random number generator producing the RTCP period (as 3780 shown in Appendix A.7), to generate the initial values for the 3781 sequence number and timestamp, and to generate SSRC values. Since 3782 this routine is likely to be CPU-intensive, its direct use to 3783 generate RTCP periods is inappropriate because predictability is not 3784 an issue. Note that this routine produces the same result on repeated 3785 calls until the value of the system clock changes unless different 3786 values are supplied for the type argument. 3788 /* 3789 * Generate a random 32-bit quantity. 3790 */ 3791 #include /* u_long */ 3792 #include /* gettimeofday() */ 3793 #include /* get..() */ 3794 #include /* printf() */ 3795 #include /* clock() */ 3796 #include /* uname() */ 3797 #include "global.h" /* from RFC 1321 */ 3798 #include "md5.h" /* from RFC 1321 */ 3800 #define MD_CTX MD5_CTX 3801 #define MDInit MD5Init 3802 #define MDUpdate MD5Update 3803 #define MDFinal MD5Final 3805 static u_long md_32(char *string, int length) 3806 { 3807 MD_CTX context; 3808 union { 3809 char c[16]; 3810 u_long x[4]; 3811 } digest; 3812 u_long r; 3813 int i; 3815 MDInit (&context); 3816 MDUpdate (&context, string, length); 3817 MDFinal ((unsigned char *)&digest, &context); 3818 r = 0; 3819 for (i = 0; i < 3; i++) { 3820 r ^= digest.x[i]; 3821 } 3822 return r; 3823 } /* md_32 */ 3825 /* 3826 * Return random unsigned 32-bit quantity. Use 'type' argument if you 3827 * need to generate several different values in close succession. 3828 */ 3829 u_int32 random32(int type) 3830 { 3831 struct { 3832 int type; 3833 struct timeval tv; 3834 clock_t cpu; 3835 pid_t pid; 3836 u_long hid; 3837 uid_t uid; 3838 gid_t gid; 3839 struct utsname name; 3840 } s; 3842 gettimeofday(&s.tv, 0); 3843 uname(&s.name); 3844 s.type = type; 3845 s.cpu = clock(); 3846 s.pid = getpid(); 3847 s.hid = gethostid(); 3848 s.uid = getuid(); 3849 s.gid = getgid(); 3850 /* also: system uptime */ 3852 return md_32((char *)&s, sizeof(s)); 3853 } /* random32 */ 3855 A.7 Computing the RTCP Transmission Interval 3857 The following functions implement the RTCP transmission and reception 3858 rules described in Section 6.2. These rules are coded in several 3859 functions: 3861 o rtcp_interval() computes the deterministic calculated 3862 interval, measured in seconds. The parameters are defined in 3863 Section 6.3. 3865 o OnExpire() is called when the RTCP transmission timer expires. 3867 o OnReceive() is called whenever an RTCP packet is received. 3869 Both OnExpire() and OnReceive() have event e as an argument. This is 3870 the next scheduled event for that participant, either an RTCP report 3871 or a BYE packet. It is assumed that the following functions are 3872 available: 3874 o Schedule(time t, event e) schedules an event e to occur at 3875 time t. When time t arrives, the funcion OnExpire is called 3876 with e as an argument. 3878 o Reschedule(time t, event e) reschedules a previously scheduled 3879 event e for time t. 3881 o SendRTCPReport(event e) sends an RTCP report. 3883 o SendBYEPacket(event e) sends a BYE packet. 3885 o TypeOfEvent(event e) returns EVENT_BYE if the event being 3886 processed is for a BYE packet to be sent, else it returns 3887 EVENT_REPORT. 3889 o PacketType(p) returns PACKET_RTCP_REPORT if packet p is an 3890 RTCP report (not BYE), PACKET_BYE if its a BYE RTCP packet, 3891 and PACKET_RTP if its a regular RTP data packet. 3893 o ReceivedPacketSize() and SentPacketSize() return the size of 3894 the referenced packet in octets. 3896 o NewMember(p) returns a 1 if the participant who sent packet p 3897 is not currently in the member list, 0 otherwise. Note this 3898 function is not sufficient for a complete implementation 3899 because each CSRC identifier in an RTP packet and each SSRC in 3900 a BYE packet should be processed. 3902 o NewSender(p) returns a 1 if the participant who sent packet p 3903 is not currently in the sender sublist of the member list, 0 3904 otherwise. 3906 o AddMember() and RemoveMember() to add and remove participants 3907 from the member list. 3909 o AddSender() and RemoveSender() to add and remove participants 3910 from the sender sublist of the member list. 3912 double rtcp_interval(int members, 3913 int senders, 3914 double rtcp_bw, 3915 int we_sent, 3916 double avg_rtcp_size, 3917 int initial) 3918 { 3919 /* 3920 * Minimum average time between RTCP packets from this site (in 3921 * seconds). This time prevents the reports from `clumping' when 3922 * sessions are small and the law of large numbers isn't helping 3923 * to smooth out the traffic. It also keeps the report interval 3924 * from becoming ridiculously small during transient outages like 3925 * a network partition. 3926 */ 3927 double const RTCP_MIN_TIME = 5.; 3928 /* 3929 * Fraction of the RTCP bandwidth to be shared among active 3930 * senders. (This fraction was chosen so that in a typical 3931 * session with one or two active senders, the computed report 3932 * time would be roughly equal to the minimum report time so that 3933 * we don't unnecessarily slow down receiver reports.) The 3934 * receiver fraction must be 1 - the sender fraction. 3935 */ 3936 double const RTCP_SENDER_BW_FRACTION = 0.25; 3937 double const RTCP_RCVR_BW_FRACTION = (1-RTCP_SENDER_BW_FRACTION); 3938 /* 3939 /* To compensate for "unconditional reconsideration" converging to a 3940 * value below the intended average. 3941 */ 3942 double const COMPENSATION = 2.71828 - 1.5; 3944 double t; /* interval */ 3945 double rtcp_min_time = RTCP_MIN_TIME; 3946 int n; /* no. of members for computation */ 3948 /* 3949 * Very first call at application start-up uses half the min 3950 * delay for quicker notification while still allowing some time 3951 * before reporting for randomization and to learn about other 3952 * sources so the report interval will converge to the correct 3953 * interval more quickly. 3954 */ 3955 if (initial) { 3956 rtcp_min_time /= 2; 3957 } 3958 /* 3959 * If there were active senders, give them at least a minimum 3960 * share of the RTCP bandwidth. Otherwise all participants share 3961 * the RTCP bandwidth equally. 3962 */ 3963 n = members; 3964 if (senders > 0 && senders < members * RTCP_SENDER_BW_FRACTION) { 3965 if (we_sent) { 3966 rtcp_bw *= RTCP_SENDER_BW_FRACTION; 3967 n = senders; 3968 } else { 3969 rtcp_bw *= RTCP_RCVR_BW_FRACTION; 3970 n -= senders; 3971 } 3972 } 3974 /* 3975 * The effective number of sites times the average packet size is 3976 * the total number of octets sent when each site sends a report. 3977 * Dividing this by the effective bandwidth gives the time 3978 * interval over which those packets must be sent in order to 3979 * meet the bandwidth target, with a minimum enforced. In that 3980 * time interval we send one report so this time is also our 3981 * average time between reports. 3982 */ 3983 t = avg_rtcp_size * n / rtcp_bw; 3984 if (t < rtcp_min_time) t = rtcp_min_time; 3986 /* 3987 * To avoid traffic bursts from unintended synchronization with 3988 * other sites, we then pick our actual next report interval as a 3989 * random number uniformly distributed between 0.5*t and 1.5*t. 3990 */ 3991 t = t * (drand48() + 0.5); 3992 t = t / COMPENSATION; 3993 return t; 3994 } 3995 void OnExpire(event e, 3996 int members, 3997 int senders, 3998 double rtcp_bw, 3999 int we_sent, 4000 double *avg_rtcp_size, 4001 int *initial, 4002 time_tp tc, 4003 time_tp *tp, 4004 int *pmembers) 4005 { 4006 /* This function is responsible for deciding whether to send 4007 * an RTCP report or BYE packet now, or to reschedule transmission. 4008 * It is also responsible for updating the pmembers, initial, tp, 4009 * and avg_rtcp_size state variables. This function should be called 4010 * upon expiration of the event timer used by Schedule(). */ 4012 double t; /* Interval */ 4013 double tn; /* Next transmit time */ 4015 /* In the case of a BYE, we use "unconditional reconsideration" to 4016 * reschedule the transmission of the BYE if necessary */ 4018 if (TypeOfEvent(e) == EVENT_BYE) { 4019 t = rtcp_interval(members, 4020 senders, 4021 rtcp_bw, 4022 we_sent, 4023 *avg_rtcp_size, 4024 *initial); 4025 tn = *tp + t; 4026 if (tn <= tc) { 4027 SendBYEPacket(e); 4028 exit(1); 4029 } else { 4030 Schedule(tn, e); 4031 } 4033 } else if (TypeOfEvent(e) == EVENT_REPORT) { 4034 t = rtcp_interval(members, 4035 senders, 4036 rtcp_bw, 4037 we_sent, 4038 *avg_rtcp_size, 4039 *initial); 4040 tn = *tp + t; 4041 if (tn <= tc) { 4042 SendRTCPReport(e); 4043 *avg_rtcp_size = (1./16.)*SentPacketSize(e) + 4044 (15./16.)*(*avg_rtcp_size); 4045 *tp = tc; 4047 /* We must redraw the interval. Don't reuse the 4048 one computed above, since its not actually 4049 distributed the same, as we are conditioned 4050 on it being small enough to cause a packet to 4051 be sent */ 4053 t = rtcp_interval(members, 4054 senders, 4055 rtcp_bw, 4056 we_sent, 4057 *avg_rtcp_size, 4058 *initial); 4060 Schedule(t+tc,e); 4061 *initial = 0; 4062 } else { 4063 Schedule(tn, e); 4064 } 4065 *pmembers = members; 4066 } 4067 } 4068 void OnReceive(packet p, 4069 event e, 4070 int *members, 4071 int *pmembers, 4072 int *senders, 4073 double *avg_rtcp_size, 4074 double *tp, 4075 double tc, 4076 double tn) 4077 { 4078 /* What we do depends on whether we have left the group, and 4079 * are waiting to send a BYE (TypeOfEvent(e) == EVENT_BYE) or 4080 * an RTCP report. p represents the packet that was just received. */ 4082 if (PacketType(p) == PACKET_RTCP_REPORT) { 4083 if (NewMember(p) && (TypeOfEvent(e) == EVENT_REPORT)) { 4084 AddMember(p); 4085 *members += 1; 4086 } 4087 *avg_rtcp_size = (1./16.)*ReceivedPacketSize(p) + 4088 (15./16.)*(*avg_rtcp_size); 4089 } else if (PacketType(p) == PACKET_RTP) { 4090 if (NewMember(p) && (TypeOfEvent(e) == EVENT_REPORT)) { 4091 AddMember(p); 4092 *members += 1; 4093 } 4094 if (NewSender(p) && (TypeOfEvent(e) == EVENT_REPORT)) { 4095 AddSender(p); 4096 *senders += 1; 4097 } 4098 } else if (PacketType(p) == PACKET_BYE) { 4099 *avg_rtcp_size = (1./16.)*ReceivedPacketSize(p) + 4100 (15./16.)*(*avg_rtcp_size); 4102 if (TypeOfEvent(e) == EVENT_REPORT) { 4103 if (NewSender(p) == FALSE) { 4104 RemoveSender(p); 4105 *senders -= 1; 4106 } 4108 if (NewMember(p) == FALSE) { 4109 RemoveMember(p); 4110 *members -= 1; 4111 } 4113 if(*members < *pmembers) { 4114 tn = tc + (((double) *members)/(*pmembers))*(tn - tc); 4115 *tp = tc - (((double) *members)/(*pmembers))*(tc - *tp); 4117 /* Reschedule the next report for time tn */ 4119 Reschedule(tn, e); 4120 *pmembers = *members; 4121 } 4123 } else if (TypeOfEvent(e) == EVENT_BYE) { 4124 *members += 1; 4125 } 4126 } 4127 } 4129 A.8 Estimating the Interarrival Jitter 4131 The code fragments below implement the algorithm given in Section 4132 6.4.1 for calculating an estimate of the statistical variance of the 4133 RTP data interarrival time to be inserted in the interarrival jitter 4134 field of reception reports. The inputs are r->ts , the timestamp from 4135 the incoming packet, and arrival , the current time in the same 4136 units. Here s points to state for the source; s->transit holds the 4137 relative transit time for the previous packet, and s->jitter holds 4138 the estimated jitter. The jitter field of the reception report is 4139 measured in timestamp units and expressed as an unsigned integer, but 4140 the jitter estimate is kept in a floating point. As each data packet 4141 arrives, the jitter estimate is updated: 4143 int transit = arrival - r->ts; 4144 int d = transit - s->transit; 4145 s->transit = transit; 4146 if (d < 0) d = -d; 4147 s->jitter += (1./16.) * ((double)d - s->jitter); 4149 When a reception report block (to which rr points) is generated for 4150 this member, the current jitter estimate is returned: 4152 rr->jitter = (u_int32) s->jitter; 4154 Alternatively, the jitter estimate can be kept as an integer, but 4155 scaled to reduce round-off error. The calculation is the same except 4156 for the last line: 4158 s->jitter += d - ((s->jitter + 8) >> 4); 4160 In this case, the estimate is sampled for the reception report as: 4162 rr->jitter = s->jitter >> 4; 4164 B Changes from RFC 1889 4166 Most of this RFC is identical to RFC 1889. The changes are listed 4167 below. 4169 o The algorithm for calculating the RTCP transmission interval 4170 specified in Sections 6.2 and 6.3 and illustrated in Appendix 4171 A.7 is augmented to include "reconsideration" to minimize 4172 transmission over the intended rate when many participants 4173 join a session simultaneously, and "reverse reconsideration" 4174 to reduce the incidence and duration of false participant 4175 timeouts when the number of participants drops rapidly. 4176 Reverse reconsideration is also used to possibly shorten the 4177 delay before sending RTCP SR when transitioning from passive 4178 receiver to active sender mode. 4180 o Section 6.3.7 specifies new rules controlling when an RTCP BYE 4181 packet should be sent in order to avoid a flood of packets 4182 when many participants leave a session simultaneously. 4183 Sections 7.2 and 7.3 specify that translators and mixers 4184 should send BYE packets for the sources they are no longer 4185 forwarding. 4187 o Section 6.2.1 specifies that implementations may store only a 4188 sampling of the participants' SSRC identifiers to allow 4189 scaling to very large sessions. Algorithms are specified in 4190 RFC 2762 [16]. 4192 o In Section 6.2 it is specified that RTCP sender and receiver 4193 bandwidths to be set as separate parameters of the session 4194 rather than a strict percentage of the session bandwidth, and 4195 may be set to zero. The requirement that RTCP was mandatory 4196 for RTP sessions using IP multicast was relaxed. 4198 o Also in Section 6.2 it is specified that the minimum RTCP 4199 interval may be scaled to smaller values for high bandwidth 4200 sessions, and that the initial RTCP delay may be set to zero 4201 for unicast sessions. 4203 o The requirement to retain state for inactive participants for 4204 a period long enough to span typical network partitions was 4205 removed from Section 6.2.1. In a session where many 4206 participants join for a brief time and fail to send BYE, this 4207 requirement would cause a significant overestimate of the 4208 number of participants. The reconsideration algorithm added in 4209 this revision compensates for the large number of new 4210 participants joining simultaneously when a partition heals. 4212 o Timing out a participant is to be based on inactivity for a 4213 number of RTCP report intervals calculated using the receiver 4214 RTCP bandwidth fraction even for active senders. 4216 o Rule changes for layered encodings are defined in Sections 4217 2.4, 6.3.9, 8.3 and 11. In the last of these, it is noted that 4218 the address and port assignment rule conflicts with the SDP 4219 specification, RFC 2327 [8], but it is intended that this 4220 restriction will be relaxed in a revision of RFC 2327. 4222 o A new Section 10 on congestion control was added. 4224 o In Section 8.2, the requirement that a new SSRC identifier 4225 MUST be chosen whenever the source transport address is 4226 changed has been relaxed to say that a new SSRC identifier MAY 4227 be chosen. Correspondingly, it was clarified that an 4228 implementation MAY choose to keep packets from the new source 4229 address rather than the existing source address when a 4230 collision occurs, and SHOULD do so for applications such as 4231 telephony in which some sources such as mobile entities may 4232 change addresses during the course of an RTP session. 4234 o An indentation bug in the RFC 1889 printing of the pseudo-code 4235 for the collision detection and resolution algorithm in 4236 Section 8.2 has been corrected by translating the syntax to 4237 pseudo C language, and the algorithm has been modified to 4238 remove the restriction that both RTP and RTCP must be sent 4239 from the same source port number. 4241 o For unicast RTP sessions, distinct port pairs may be used for 4242 the two ends (Sections 3 and 7.1). 4244 o The description of the padding mechanism for RTCP packets was 4245 clarified and it is specified that padding MUST be applied to 4246 the last packet of a compound RTCP packet. 4248 o Clamping of number of packets lost in Section A.3 was 4249 corrected to use both positive and negative limits. 4251 o It is specified that a receiver MUST ignore packets with 4252 payload types it does not understand. 4254 o The specification of "relative" NTP timestamp in the RTCP SR 4255 section now defines these timestamps to be based on the most 4256 common system-specific clock, such as system uptime, rather 4257 than on session elapsed time which would not be the same for 4258 multiple applications started on the same machine at different 4259 times. 4261 o The inconsequence of NTP timestamps wrapping around in the 4262 year 2036 is explained. 4264 o The policy for registration of RTCP packet types and SDES 4265 types was clarified in a new Section 14, IANA Considerations. 4266 The suggestion that experimenters register the numbers they 4267 need and then unregister those which prove to be unneeded has 4268 been removed in in favor of using APP and PRIV. Registration 4269 of profile names was also specified. 4271 o The reference for the UTF-8 character set was changed from an 4272 X/Open Preliminary Specification to be RFC 2279. 4274 o The last paragraph of the introduction in RFC 1889, which 4275 cautioned implementers to limit deployment in the Internet, 4276 was removed because it was deemed no longer relevant. 4278 o Small clarifications of the text have been made in several 4279 places, some in response to questions from readers. In 4280 particular: 4282 - A definition for "RTP media type" is given in Section 3 to 4283 allow the explanation of multiplexing RTP sessions in 4284 Section 5.2 to be more clear regarding the multiplexing of 4285 multiple media. 4287 - The definition for "non-RTP means" was expanded to include 4288 examples of other protocols constituting non-RTP means. 4290 - The description of the session bandwidth parameter is 4291 expanded in Section 6.2. 4293 - The method for terminating and padding a sequence of SDES 4294 items was clarified in Section 6.5. 4296 - The Security section adds a formal reference to IPSEC now 4297 that it is available, and says that the confidentiality 4298 method defined in this specification is primarily to codify 4299 existing practice. It is RECOMMENDED that stronger 4300 encryption algorithms such as Triple-DES be used in place of 4301 the default algorithm. It is also noted that payload-only 4302 encryption is necessary to allow for header compression. 4304 - The convention for using even/odd port pairs in Section 11 4305 was clarified to refer to destination ports. 4307 - A note was added in Appendix A.1 that packets may be saved 4308 during RTP header validation and delivered upon success. 4310 - Section 7.3 now explains that a mixer aggregating SDES 4311 packets uses more RTCP bandwidth due to longer packets, and 4312 a mixer passing through RTCP naturally sends packets at 4313 higher than the single source rate, but both behaviors are 4314 valid. 4316 - Section 13 clarifies that an RTP application may use 4317 multiple profiles but typically only one in a given session. 4319 - The terms MUST, SHOULD, MAY, etc. are used as defined in RFC 4320 2119. 4322 C Security Considerations 4324 RTP suffers from the same security liabilities as the underlying 4325 protocols. For example, an impostor can fake source or destination 4326 network addresses, or change the header or payload. Within RTCP, the 4327 CNAME and NAME information may be used to impersonate another 4328 participant. In addition, RTP may be sent via IP multicast, which 4329 provides no direct means for a sender to know all the receivers of 4330 the data sent and therefore no measure of privacy. Rightly or not, 4331 users may be more sensitive to privacy concerns with audio and video 4332 communication than they have been with more traditional forms of 4333 network communication [31]. Therefore, the use of security mechanisms 4334 with RTP is important. These mechanisms are discussed in Section 9. 4336 RTP-level translators or mixers may be used to allow RTP traffic to 4337 reach hosts behind firewalls. Appropriate firewall security 4338 principles and practices, which are beyond the scope of this 4339 document, should be followed in the design and installation of these 4340 devices and in the admission of RTP applications for use behind the 4341 firewall. 4343 D Full Copyright Statement 4345 Copyright (C) The Internet Society (2000). All Rights Reserved. 4347 This document and translations of it may be copied and furnished to 4348 others, and derivative works that comment on or otherwise explain it 4349 or assist in its implmentation may be prepared, copied, published and 4350 distributed, in whole or in part, without restriction of any kind, 4351 provided that the above copyright notice and this paragraph are 4352 included on all such copies and derivative works. However, this 4353 document itself may not be modified in any way, such as by removing 4354 the copyright notice or references to the Internet Society or other 4355 Internet organizations, except as needed for the purpose of 4356 developing Internet standards in which case the procedures for 4357 copyrights defined in the Internet Standards process must be 4358 followed, or as required to translate it into languages other than 4359 English. 4361 The limited permissions granted above are perpetual and will not be 4362 revoked by the Internet Society or its successors or assigns. 4364 This document and the information contained herein is provided on an 4365 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 4366 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 4367 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 4368 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 4369 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4371 E Addresses of Authors 4373 Henning Schulzrinne 4374 Dept. of Computer Science 4375 Columbia University 4376 1214 Amsterdam Avenue 4377 New York, NY 10027 4378 USA 4379 electronic mail: schulzrinne@cs.columbia.edu 4381 Stephen L. Casner 4382 Packet Design 4383 2465 Latham Street 4384 Mountain View, CA 94040 4385 United States 4386 electronic mail: casner@acm.org 4388 Ron Frederick 4389 Entera, Inc. 4390 40971 Encyclopedia Circle 4391 Fremont, CA 94538 4392 United States 4393 electronic mail: ronf@entera.com 4395 Van Jacobson 4396 Packet Design 4397 2465 Latham Street 4398 Mountain View, CA 94040 4399 United States 4400 electronic mail: van@packetdesign.com 4402 Acknowledgments 4404 This memorandum is based on discussions within the IETF Audio/Video 4405 Transport working group chaired by Stephen Casner and Colin Perkins. 4406 The current protocol has its origins in the Network Voice Protocol 4407 and the Packet Video Protocol (Danny Cohen and Randy Cole) and the 4408 protocol implemented by the vat application (Van Jacobson and Steve 4409 McCanne). Christian Huitema provided ideas for the random identifier 4410 generator. Extensive analysis and simulation of the timer 4411 reconsideration algorithm was done by Jonathan Rosenberg. 4413 F Bibliography 4415 [1] D. D. Clark and D. L. Tennenhouse, "Architectural considerations 4416 for a new generation of protocols," in SIGCOMM Symposium on 4417 Communications Architectures and Protocols , (Philadelphia, 4418 Pennsylvania), pp. 200--208, IEEE, Sept. 1990. Computer 4419 Communications Review, Vol. 20(4), Sept. 1990. 4421 [2] H. Schulzrinne and S. Casner, "RTP profile for audio and video 4422 conferences with minimal control," Internet Draft, Internet 4423 Engineering Task Force, June 1999. Work in progress. 4425 [3] H. Schulzrinne, "Issues in designing a transport protocol for 4426 audio and video conferences and other multiparticipant real-time 4427 applications." expired Internet draft, Oct. 1993. 4429 [4] S. Bradner, "Key words for use in RFCs to indicate requirement 4430 levels," Request for Comments (Best Current Practice) 2119, Internet 4431 Engineering Task Force, Mar. 1997. 4433 [5] D. E. Comer, Internetworking with TCP/IP , vol. 1. Englewood 4434 Cliffs, New Jersey: Prentice Hall, 1991. 4436 [6] M. Handley, H. Schulzrinne, E. Schooler, and J. Rosenberg, "SIP: 4437 session initiation protocol," Request for Comments (Proposed 4438 Standard) 2543, Internet Engineering Task Force, Mar. 1999. 4440 [7] International Telecommunication Union, "Visual telephone systems 4441 and equipment for local area networks which provide a non-guaranteed 4442 quality of service," Recommendation H.323, Telecommunication 4443 Standardization Sector of ITU, Geneva, Switzerland, May 1996. 4445 [8] M. Handley and V. Jacobson, "SDP: session description protocol," 4446 Request for Comments (Proposed Standard) 2327, Internet Engineering 4447 Task Force, Apr. 1998. 4449 [9] H. Schulzrinne, A. Rao, and R. Lanphier, "Real time streaming 4450 protocol (RTSP)," Request for Comments (Proposed Standard) 2326, 4451 Internet Engineering Task Force, Apr. 1998. 4453 [10] J. Postel, "Internet protocol," Request for Comments (Standard) 4454 791, Internet Engineering Task Force, Sept. 1981. 4456 [11] D. L. Mills, "Network time protocol (version 3) specification, 4457 implementation," Request for Comments (Draft Standard) 1305, Internet 4458 Engineering Task Force, Mar. 1992. 4460 [12] D. Eastlake, 3rd, S. Crocker, and J. Schiller, "Randomness 4461 recommendations for security," Request for Comments (Informational) 4462 1750, Internet Engineering Task Force, Dec. 1994. 4464 [13] J.-C. Bolot, T. Turletti, and I. Wakeman, "Scalable feedback 4465 control for multicast video distribution in the internet," in SIGCOMM 4466 Symposium on Communications Architectures and Protocols , (London, 4467 England), pp. 58--67, ACM, Aug. 1994. 4469 [14] I. Busse, B. Deffner, and H. Schulzrinne, "Dynamic QoS control 4470 of multimedia applications based on RTP," Computer Communications , 4471 vol. 19, pp. 49--58, Jan. 1996. 4473 [15] S. Floyd and V. Jacobson, "The synchronization of periodic 4474 routing messages," in SIGCOMM Symposium on Communications 4475 Architectures and Protocols (D. P. Sidhu, ed.), (San Francisco, 4476 California), pp. 33--44, ACM, Sept. 1993. also in [32]. 4478 [16] J. Rosenberg and H. Schulzrinne, "Sampling of the group 4479 membership in RTP," Request for Comments (Experimental) 2762, 4480 Internet Engineering Task Force, May 1999. 4482 [17] J. A. Cadzow, Foundations of digital signal processing and data 4483 analysis New York, New York: Macmillan, 1987. 4485 [18] F. Yergeau, "UTF-8, a transformation format of ISO 10646," 4486 Request for Comments (Proposed Standard) 2279, Internet Engineering 4487 Task Force, Jan. 1998. 4489 [19] P. V. Mockapetris, "Domain names - concepts and facilities," 4490 Request for Comments (Standard) 1034, Internet Engineering Task 4491 Force, Nov. 1987. 4493 [20] P. V. Mockapetris, "Domain names - implementation and 4494 specification," Request for Comments (Standard) 1035, Internet 4495 Engineering Task Force, Nov. 1987. 4497 [21] R. T. Braden, "Requirements for internet hosts - application and 4498 support," Request for Comments (Standard) 1123, Internet Engineering 4499 Task Force, Oct. 1989. 4501 [22] Y. Rekhter, B. Moskowitz, D. Karrenberg, and G. de Groot, 4502 "Address allocation for private internets," Request for Comments 4503 (Informational) 1597, Internet Engineering Task Force, Mar. 1994. 4505 [23] E. Lear, E. Fair, D. Crocker, and T. Kessler, "Network 10 4506 considered harmful (some practices shouldn't be codified)," Request 4507 for Comments (Informational) 1627, Internet Engineering Task Force, 4508 June 1994. 4510 [24] D. Crocker, "Standard for the format of ARPA internet text 4511 messages," Request for Comments (Standard) 822, Internet Engineering 4512 Task Force, Aug. 1982. 4514 [25] W. Feller, An Introduction to Probability Theory and its 4515 Applications, Volume 1 , vol. 1. New York, New York: John Wiley and 4516 Sons, third ed., 1968. 4518 [26] S. Kent and R. Atkinson, "Security architecture for the internet 4519 protocol," Request for Comments (Proposed Standard) 2401, Internet 4520 Engineering Task Force, Nov. 1998. 4522 [27] D. Balenson, "Privacy enhancement for internet electronic mail: 4523 Part III: algorithms, modes, and identifiers," Request for Comments 4524 (Proposed Standard) 1423, Internet Engineering Task Force, Feb. 1993. 4526 [28] V. L. Voydock and S. T. Kent, "Security mechanisms in high-level 4527 network protocols," ACM Computing Surveys , vol. 15, pp. 135--171, 4528 June 1983. 4530 [29] S. Floyd, "Congestion Control Principles," Request for 4531 Comments (Best Current Practice) 2914, Internet Engineering Task 4532 Force, Sep. 2000. 4534 [30] R. Rivest, "The MD5 message-digest algorithm," Request for 4535 Comments (Informational) 1321, Internet Engineering Task Force, Apr. 4536 1992. 4538 [31] S. Stubblebine, "Security services for multimedia conferencing," 4539 in 16th National Computer Security Conference , (Baltimore, 4540 Maryland), pp. 391--395, Sept. 1993. 4542 [32] S. Floyd and V. Jacobson, "The synchronization of periodic 4543 routing messages," IEEE/ACM Transactions on Networking , vol. 2, pp. 4544 122--136, Apr. 1994. 4546 Table of Contents 4548 1 Introduction ........................................ 3 4549 1.1 Terminology ......................................... 5 4550 2 RTP Use Scenarios ................................... 5 4551 2.1 Simple Multicast Audio Conference ................... 5 4552 2.2 Audio and Video Conference .......................... 6 4553 2.3 Mixers and Translators .............................. 6 4554 2.4 Layered Encodings ................................... 7 4555 3 Definitions ......................................... 8 4556 4 Byte Order, Alignment, and Time Format .............. 11 4557 5 RTP Data Transfer Protocol .......................... 11 4558 5.1 RTP Fixed Header Fields ............................. 11 4559 5.2 Multiplexing RTP Sessions ........................... 14 4560 5.3 Profile-Specific Modifications to the RTP Header 4561 ................................................................ 15 4562 5.3.1 RTP Header Extension ................................ 16 4563 6 RTP Control Protocol -- RTCP ........................ 17 4564 6.1 RTCP Packet Format .................................. 19 4565 6.2 RTCP Transmission Interval .......................... 21 4566 6.2.1 Maintaining the number of session members ........... 25 4567 6.3 RTCP Packet Send and Receive Rules .................. 26 4568 6.3.1 Computing the RTCP transmission interval ............ 27 4569 6.3.2 Initialization ...................................... 28 4570 6.3.3 Receiving an RTP or non-BYE RTCP packet ............. 28 4571 6.3.4 Receiving an RTCP BYE packet ........................ 28 4572 6.3.5 Timing Out an SSRC .................................. 29 4573 6.3.6 Expiration of transmission timer .................... 29 4574 6.3.7 Transmitting a BYE packet ........................... 30 4575 6.3.8 Updating we_sent .................................... 31 4576 6.3.9 Allocation of source description bandwidth .......... 31 4577 6.4 Sender and Receiver Reports ......................... 32 4578 6.4.1 SR: Sender report RTCP packet ....................... 33 4579 6.4.2 RR: Receiver report RTCP packet ..................... 38 4580 6.4.3 Extending the sender and receiver reports ........... 39 4581 6.4.4 Analyzing sender and receiver reports ............... 40 4582 6.5 SDES: Source description RTCP packet ................ 41 4583 6.5.1 CNAME: Canonical end-point identifier SDES item ..... 43 4584 6.5.2 NAME: User name SDES item ........................... 44 4585 6.5.3 EMAIL: Electronic mail address SDES item ............ 45 4586 6.5.4 PHONE: Phone number SDES item ....................... 45 4587 6.5.5 LOC: Geographic user location SDES item ............. 45 4588 6.5.6 TOOL: Application or tool name SDES item ............ 46 4589 6.5.7 NOTE: Notice/status SDES item ....................... 46 4590 6.5.8 PRIV: Private extensions SDES item .................. 47 4591 6.6 BYE: Goodbye RTCP packet ............................ 48 4592 6.7 APP: Application-defined RTCP packet ................ 48 4593 7 RTP Translators and Mixers .......................... 50 4594 7.1 General Description ................................. 50 4595 7.2 RTCP Processing in Translators ...................... 52 4596 7.3 RTCP Processing in Mixers ........................... 54 4597 7.4 Cascaded Mixers ..................................... 55 4598 8 SSRC Identifier Allocation and Use .................. 55 4599 8.1 Probability of Collision ............................ 56 4600 8.2 Collision Resolution and Loop Detection ............. 56 4601 8.3 Use with Layered Encodings .......................... 61 4602 9 Security ............................................ 61 4603 9.1 Confidentiality ..................................... 62 4604 9.2 Authentication and Message Integrity ................ 64 4605 10 Congestion Control .................................. 64 4606 11 RTP over Network and Transport Protocols ............ 64 4607 12 Summary of Protocol Constants ....................... 66 4608 12.1 RTCP packet types ................................... 66 4609 12.2 SDES types .......................................... 66 4610 13 RTP Profiles and Payload Format Specifications ...... 67 4611 14 IANA Considerations ................................. 69 4612 A Algorithms .......................................... 70 4613 A.1 RTP Data Header Validity Checks ..................... 74 4614 A.2 RTCP Header Validity Checks ......................... 79 4615 A.3 Determining the Number of RTP Packets Expected and 4616 Lost ........................................................... 79 4617 A.4 Generating SDES RTCP Packets ........................ 80 4618 A.5 Parsing RTCP SDES Packets ........................... 81 4619 A.6 Generating a Random 32-bit Identifier ............... 82 4620 A.7 Computing the RTCP Transmission Interval ............ 85 4621 A.8 Estimating the Interarrival Jitter .................. 92 4622 B Changes from RFC 1889 ............................... 93 4623 C Security Considerations ............................. 96 4624 D Full Copyright Statement ............................ 97 4625 E Addresses of Authors ................................ 97 4626 F Bibliography ........................................ 98