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