idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-07.txt: -(4528): Line appears to be too long, but this could be caused by non-ascii characters in UTF-8 encoding Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.5 on line 7807. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 7780. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 7787. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 7793. ** The document seems to lack an RFC 3978 Section 5.1 IPR Disclosure Acknowledgement -- however, there's a paragraph with a matching beginning. Boilerplate error? ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to 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. == There is 1 instance of lines with non-ascii characters in the document. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 37) being 59 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Authors' Addresses Section. ** There are 819 instances of too long lines in the document, the longest one being 3 characters in excess of 72. ** There are 6 instances of lines with control characters in the document. == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. == There are 5 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 2 instances of lines with multicast IPv4 addresses in the document. If these are generic example addresses, they should be changed to use the 233.252.0.x range defined in RFC 5771 == There are 2 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 1636 has weird spacing: '...equired all...' == Line 1637 has weird spacing: '...ccepted all...' == Line 1933 has weird spacing: '...mmended rec...' == Line 1936 has weird spacing: '...mmended rec...' == Line 1937 has weird spacing: '...mmended opt...' == (21 more instances...) == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: Unless requested otherwise by the Speed parameter, the data rate SHOULD not be changed. Implementation of scale changes depends on the server and media type. For video, a server may, for example, deliver only key frames or selected key frames. For audio, it may time-scale the audio while preserving pitch or, less desirably, deliver fragments of audio. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The name of the feature MUST follow these rules: The name may be of any length, but SHOULD be no more than twenty characters long. The name MUST not contain any spaces, or control characters. The registration SHALL indicate if the feature tag applies to servers only, proxies only or both server and proxies. Any proprietary feature SHALL have as the first part of the name a vendor tag, which identifies the organization. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHALL not' in this paragraph: The response to valid request meeting the requisites is normally a 2xx (SUCCESS) unless other noted in the response column. The exceptions shall be given a response according to the response column. If the request does not meet the requisite, is erroneous or some other type of error occur the appropriate response code MUST be sent. If the response code is a 4xx the session state is unchanged. A response code of 3rr will result in that the session is ended and its state is changed to Init. A response code of 304 results in no state change. However there exist restrictions to when a 3xx response may be used. A 5xx response SHALL not result in any change of the session state, except if the error is not possible to recover from. A unrecoverable error SHALL result the ending of the session. As it in the general case can't be determined if it was a unrecoverable error or not the client will be required to test. In the case that the next request after a 5xx is responded with 454 (Session Not Found) the client shall assume that the session has been ended. -- 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.) -- Couldn't find a document date in the document -- date freshness check skipped. 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 7611 looks like a reference -- Missing reference section? '24' on line 7695 looks like a reference -- Missing reference section? '25' on line 7700 looks like a reference -- Missing reference section? '26' on line 7703 looks like a reference -- Missing reference section? '27' on line 7706 looks like a reference -- Missing reference section? '2' on line 7615 looks like a reference -- Missing reference section? '3' on line 7618 looks like a reference -- Missing reference section? '4' on line 7622 looks like a reference -- Missing reference section? '28' on line 7709 looks like a reference -- Missing reference section? '5' on line 7626 looks like a reference -- Missing reference section? '6' on line 7629 looks like a reference -- Missing reference section? '29' on line 7713 looks like a reference -- Missing reference section? '13' on line 7653 looks like a reference -- Missing reference section? '7' on line 7632 looks like a reference -- Missing reference section? '8' on line 7635 looks like a reference -- Missing reference section? '9' on line 7640 looks like a reference -- Missing reference section? '30' on line 7719 looks like a reference -- Missing reference section? '10' on line 7643 looks like a reference -- Missing reference section? '31' on line 7723 looks like a reference -- Missing reference section? '32' on line 7728 looks like a reference -- Missing reference section? '33' on line 7733 looks like a reference -- Missing reference section? '34' on line 7736 looks like a reference -- Missing reference section? '35' on line 7741 looks like a reference -- Missing reference section? '18' on line 7670 looks like a reference -- Missing reference section? '11' on line 7646 looks like a reference -- Missing reference section? '12' on line 7649 looks like a reference -- Missing reference section? '14' on line 7657 looks like a reference -- Missing reference section? 'H6' on line 1433 looks like a reference -- Missing reference section? '15' on line 7660 looks like a reference -- Missing reference section? '36' on line 7746 looks like a reference -- Missing reference section? '37' on line 7749 looks like a reference -- Missing reference section? 'H10' on line 2913 looks like a reference -- Missing reference section? '16' on line 7663 looks like a reference -- Missing reference section? '17' on line 7666 looks like a reference -- Missing reference section? '38' on line 7752 looks like a reference -- Missing reference section? 'H15' on line 5684 looks like a reference -- Missing reference section? '19' on line 7674 looks like a reference -- Missing reference section? '20' on line 7677 looks like a reference -- Missing reference section? '21' on line 7681 looks like a reference -- Missing reference section? '39' on line 7755 looks like a reference -- Missing reference section? '40' on line 7760 looks like a reference -- Missing reference section? '41' on line 7763 looks like a reference -- Missing reference section? '42' on line 7767 looks like a reference -- Missing reference section? '22' on line 7685 looks like a reference -- Missing reference section? '23' on line 7689 looks like a reference Summary: 8 errors (**), 0 flaws (~~), 18 warnings (==), 51 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force MMUSIC WG 3 Internet Draft H. Schulzrinne 4 draft-ietf-mmusic-rfc2326bis-07.txt Columbia U. 5 July 19, 2004 A. Rao 6 Expires: January, 2005 Cisco 7 R. Lanphier 8 RealNetworks 9 M. Westerlund 10 Ericsson 11 A. Narasimhan 12 Princeton 14 Real Time Streaming Protocol (RTSP) 16 STATUS OF THIS MEMO 18 By submitting this Internet-Draft, I (we) certify that any applicable 19 patent or other IPR claims of which I am (we are) aware have been 20 disclosed, and any of which I (we) become aware will be disclosed, in 21 accordance with RFC 3668 (BCP 79). 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF), its areas, and its working groups. Note that 25 other groups may also distribute working documents as Internet- 26 Drafts. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress". 33 The list of current Internet-Drafts can be accessed at 34 http://www.ietf.org/ietf/1id-abstracts.txt 36 To view the list Internet-Draft Shadow Directories, see 37 http://www.ietf.org/shadow.html. 39 Abstract 41 This memorandum is a revision of RFC 2326, which is currently a 42 Proposed Standard. 44 The Real Time Streaming Protocol, or RTSP, is an application-level 45 protocol for control over the delivery of data with real-time 46 properties. RTSP provides an extensible framework to enable 47 controlled, on-demand delivery of real-time data, such as audio and 48 video. Sources of data can include both live data feeds and stored 49 clips. This protocol is intended to control multiple data delivery 50 sessions, provide a means for choosing delivery channels such as UDP, 51 multicast UDP and TCP, and provide a means for choosing delivery 52 mechanisms based upon RTP (RFC 3550). 54 Table of Contents 56 1 Introduction ........................................ 9 57 1.1 RTSP Specification Update ........................... 9 58 1.2 Purpose ............................................. 10 59 1.3 Notational Conventions .............................. 11 60 1.4 Terminology ......................................... 12 61 1.5 Protocol Properties ................................. 15 62 1.6 Extending RTSP ...................................... 17 63 1.7 Overall Operation ................................... 18 64 1.8 RTSP States ......................................... 19 65 1.9 Relationship with Other Protocols ................... 20 66 2 RTSP Use Cases ...................................... 20 67 2.1 On-demand Playback of Stored Content ................ 20 68 2.2 Unicast distribution of Live Content ................ 22 69 2.3 On-demand Playback using Multicast .................. 22 70 2.4 Inviting a RTSP server into a conference ............ 23 71 2.5 Live Content using Multicast ........................ 24 72 3 Protocol Parameters ................................. 25 73 3.1 RTSP Version ........................................ 25 74 3.2 RTSP URL ............................................ 25 75 3.3 Session Identifiers ................................. 26 76 3.4 SMPTE Relative Timestamps ........................... 27 77 3.5 Normal Play Time .................................... 27 78 3.6 Absolute Time ....................................... 28 79 3.7 Feature-tags ........................................ 28 80 3.8 Entity Tags ......................................... 29 81 4 RTSP Message ........................................ 29 82 4.1 Message Types ....................................... 29 83 4.2 Message Headers ..................................... 30 84 4.3 Message Body ........................................ 30 85 4.4 Message Length ...................................... 30 86 5 General Header Fields ............................... 30 87 6 Request ............................................. 30 88 6.1 Request Line ........................................ 31 89 6.2 Request Header Fields ............................... 32 90 7 Response ............................................ 32 91 7.1 Status-Line ......................................... 33 92 7.1.1 Status Code and Reason Phrase ....................... 33 93 7.1.2 Response Header Fields .............................. 35 94 8 Entity .............................................. 35 95 8.1 Entity Header Fields ................................ 35 96 8.2 Entity Body ......................................... 35 97 9 Connections ......................................... 36 98 9.1 Pipelining .......................................... 36 99 9.2 Reliability and Acknowledgements .................... 36 100 9.3 Unreliable Transport ................................ 39 101 9.4 The usage of connections ............................ 39 102 9.5 Timing Out RTSP messages ............................ 41 103 9.6 Use of IPv6 ......................................... 41 104 10 Capability Handling ................................. 42 105 11 Method Definitions .................................. 43 106 11.1 OPTIONS ............................................. 44 107 11.2 DESCRIBE ............................................ 45 108 11.3 SETUP ............................................... 47 109 11.4 PLAY ................................................ 50 110 11.5 PAUSE ............................................... 54 111 11.6 TEARDOWN ............................................ 58 112 11.7 GET_PARAMETER ....................................... 58 113 11.8 SET_PARAMETER ....................................... 59 114 11.9 REDIRECT ............................................ 61 115 11.10 PING ................................................ 63 116 12 Embedded (Interleaved) Binary Data .................. 64 117 13 Status Code Definitions ............................. 65 118 13.1 Success 1xx ......................................... 66 119 13.1.1 100 Continue ........................................ 66 120 13.2 Success 2xx ......................................... 66 121 13.3 Redirection 3xx ..................................... 66 122 13.3.1 TBW ................................................. 66 123 13.3.2 301 Moved Permanently ............................... 66 124 13.3.3 302 Found ........................................... 66 125 13.3.4 303 See Other ....................................... 67 126 13.3.5 304 Not Modified .................................... 67 127 13.3.6 305 Use Proxy ....................................... 67 128 13.4 Client Error 4xx .................................... 67 129 13.4.1 400 Bad Request ..................................... 67 130 13.4.2 405 Method Not Allowed .............................. 68 131 13.4.3 451 Parameter Not Understood ........................ 68 132 13.4.4 452 reserved ........................................ 68 133 13.4.5 453 Not Enough Bandwidth ............................ 68 134 13.4.6 454 Session Not Found ............................... 68 135 13.4.7 455 Method Not Valid in This State .................. 68 136 13.4.8 456 Header Field Not Valid for Resource ............. 68 137 13.4.9 457 Invalid Range ................................... 69 138 13.4.10 458 Parameter Is Read-Only .......................... 69 139 13.4.11 459 Aggregate Operation Not Allowed ................. 69 140 13.4.12 460 Only Aggregate Operation Allowed ................ 69 141 13.4.13 461 Unsupported Transport ........................... 69 142 13.4.14 462 Destination Unreachable ......................... 69 143 13.4.15 470 Connection Authorization Required ............... 69 144 13.4.16 471 Connection Credentials not accepted ............. 69 145 13.5 Server Error 5xx .................................... 69 146 13.5.1 551 Option not supported ............................ 70 147 14 Header Field Definitions ............................ 70 148 14.1 Accept .............................................. 72 149 14.2 Accept-Credentials .................................. 72 150 14.3 Accept-Encoding ..................................... 77 151 14.4 Accept-Language ..................................... 77 152 14.5 Accept-Ranges ....................................... 77 153 14.6 Allow ............................................... 77 154 14.7 Authorization ....................................... 77 155 14.8 Bandwidth ........................................... 78 156 14.9 Blocksize ........................................... 78 157 14.10 Cache-Control ....................................... 78 158 14.11 Connection .......................................... 81 159 14.12 Content-Base ........................................ 81 160 14.13 Content-Encoding .................................... 81 161 14.14 Content-Language .................................... 81 162 14.15 Content-Length ...................................... 81 163 14.16 Content-Location .................................... 81 164 14.17 Content-Type ........................................ 81 165 14.18 CSeq ................................................ 82 166 14.19 Date ................................................ 82 167 14.20 ETag ................................................ 82 168 14.21 Expires ............................................. 83 169 14.22 From ................................................ 83 170 14.23 Host ................................................ 84 171 14.24 If-Match ............................................ 84 172 14.25 If-Modified-Since ................................... 84 173 14.26 If-None-Match ....................................... 84 174 14.27 Last-Modified ....................................... 85 175 14.28 Location ............................................ 85 176 14.29 Proxy-Authenticate .................................. 85 177 14.30 Proxy-Require ....................................... 85 178 14.31 Public .............................................. 85 179 14.32 Range ............................................... 86 180 14.33 Referer ............................................. 88 181 14.34 Retry-After ......................................... 88 182 14.35 Require ............................................. 88 183 14.36 RTP-Info ............................................ 89 184 14.37 Scale ............................................... 91 185 14.38 Speed ............................................... 92 186 14.39 Server .............................................. 92 187 14.40 Session ............................................. 92 188 14.41 Supported ........................................... 94 189 14.42 Timestamp ........................................... 95 190 14.43 Transport ........................................... 95 191 14.44 Unsupported ......................................... 101 192 14.45 User-Agent .......................................... 102 193 14.46 Vary ................................................ 102 194 14.47 Via ................................................. 102 195 14.48 WWW-Authenticate .................................... 102 196 15 Caching ............................................. 102 197 16 Examples ............................................ 103 198 16.1 Media on Demand (Unicast) ........................... 103 199 16.2 Streaming of a Container file ....................... 106 200 16.3 Single Stream Container Files ....................... 109 201 16.4 Live Media Presentation Using Multicast ............. 111 202 16.5 Capability Negotiation .............................. 112 203 17 Security Framework .................................. 113 204 17.1 RTSP and HTTP Authentication ........................ 113 205 17.2 RTSP over TLS ....................................... 114 206 17.3 Security and Proxies ................................ 114 207 17.3.1 Accept-Credentials .................................. 115 208 17.3.2 User approved TLS procedure ......................... 116 209 18 Syntax .............................................. 118 210 18.1 Base Syntax ......................................... 118 211 18.2 RTSP Protocol Definition ............................ 119 212 18.2.1 Generic Protocol elements ........................... 119 213 18.2.2 Message Syntax ...................................... 120 214 18.2.3 Header Syntax ....................................... 124 215 19 Security Considerations ............................. 126 216 20 IANA Considerations ................................. 128 217 20.1 Feature-tags ........................................ 129 218 20.1.1 Description ......................................... 129 219 20.1.2 Registering New Feature-tags with IANA .............. 129 220 20.1.3 Registered entries .................................. 130 221 20.2 RTSP Methods ........................................ 130 222 20.2.1 Description ......................................... 130 223 20.2.2 Registering New Methods with IANA ................... 130 224 20.2.3 Registered Entries .................................. 131 225 20.3 RTSP Status Codes ................................... 131 226 20.3.1 Description ......................................... 131 227 20.3.2 Registering New Status Codes with IANA .............. 131 228 20.3.3 Registered Entries .................................. 131 229 20.4 RTSP Headers ........................................ 131 230 20.4.1 Description ......................................... 131 231 20.4.2 Registering New Headers with IANA ................... 131 232 20.4.3 Registered entries .................................. 132 233 20.5 Transport Header registries ......................... 132 234 20.5.1 Transport Protocols ................................. 132 235 20.5.2 Profile ............................................. 133 236 20.5.3 Lower Transport ..................................... 133 237 20.5.4 Transport modes ..................................... 134 238 20.6 Cache Directive Extensions .......................... 134 239 20.7 Accept-Credentials policies ......................... 135 240 20.8 SDP attributes ...................................... 135 241 A RTSP Protocol State Machine ......................... 136 242 A.1 States .............................................. 137 243 A.2 State variables ..................................... 137 244 A.3 Abbreviations ....................................... 137 245 A.4 State Tables ........................................ 137 246 B Media Transport Alternatives ........................ 141 247 B.1 RTP ................................................. 141 248 B.1.1 AVP ................................................. 141 249 B.1.2 AVP/UDP ............................................. 141 250 B.1.3 AVP/TCP ............................................. 143 251 B.1.4 Handling NPT Jumps in the RTP Media Layer ........... 143 252 B.1.5 Handling RTP Timestamps after PAUSE ................. 145 253 B.1.6 RTSP / RTP Integration .............................. 148 254 B.1.7 Scaling with RTP .................................... 148 255 B.1.8 Maintaining NPT synchronization with RTP 256 timestamps .......................................... 148 257 B.1.9 Continuous Audio .................................... 148 258 B.1.10 Multiple Sources in an RTP Session .................. 148 259 B.1.11 Usage of SSRCs and the RTCP BYE Message During a 260 RTSP Session ........................................ 148 261 B.2 Future Additions .................................... 149 262 C Use of SDP for RTSP Session Descriptions ............ 150 263 C.1 Definitions ......................................... 150 264 C.1.1 Control URL ......................................... 150 265 C.1.2 Media Streams ....................................... 151 266 C.1.3 Payload Type(s) ..................................... 152 267 C.1.4 Format-Specific Parameters .......................... 152 268 C.1.5 Range of Presentation ............................... 152 269 C.1.6 Time of Availability ................................ 153 270 C.1.7 Connection Information .............................. 153 271 C.1.8 Entity Tag .......................................... 153 272 C.2 Aggregate Control Not Available ..................... 154 273 C.3 Aggregate Control Available ......................... 155 274 C.4 RTSP external SDP delivery .......................... 156 275 D Minimal RTSP implementation ......................... 156 276 D.1 Client .............................................. 156 277 D.1.1 Basic Playback ...................................... 157 278 D.1.2 Authentication-enabled .............................. 157 279 D.2 Server .............................................. 157 280 D.2.1 Basic Playback ...................................... 158 281 D.2.2 Authentication-enabled .............................. 159 282 E Open Issues ......................................... 159 283 F Changes ............................................. 160 284 G Author Addresses .................................... 166 285 H Contributors ........................................ 167 286 I Acknowledgements .................................... 167 287 J Normative References ................................ 168 288 K Informative References .............................. 169 290 1 Introduction 292 1.1 RTSP Specification Update 294 This document is a draft to an update of RTSP, a proposed standard | 295 defined in RFC 2326 [1]. The goal the update is to progress RTSP to | 296 draft standard status. Many flaws have been identified in RTSP since | 297 its publication. While this draft tries to address these flaws, not | 298 all known issues have been resolved. Appendix F catalogs the issues | 299 that have already been addressed. Known open issues are listed in | 300 appendix E. | 302 The possibility of progressing RTSP to draft standard without | 303 republishing RTSP as a proposed standard depends on the changes | 304 necessary to make the protocol work. | 306 A list of bugs against the specification is available at | 307 "http://rtspspec.sourceforge.net". These bugs should be taken into | 308 account when reading this specification. Input on the unresolved bugs | 309 and other issues can be sent via e-mail to the MMUSIC WG's mailing | 310 list mmusic@ietf.org and the authors. 312 Not all of the contents of RFC 2326 are part of this draft. In an | 313 attempt to prevent bloat, the specification has been reduced and | 314 split. The content of this draft is the core specification of the 315 protocol. It contains the general idea behind RTSP and the basic 316 functionality necessary to establish an on-demand play-back session. 317 It also contains the mechanisms for extending the protocol. Any other 318 functionality will be published as extension documents. The Working | 319 group is currently working on: 321 o NAT and FW traversal mechanisms for RTSP are described in a 322 document called "How to make Real-Time Streaming Protocol 323 (RTSP) traverse Network Address Translators (NAT) and interact 324 with Firewalls." [24]. 326 There have also been discussion or proposals about the following 327 extensions to RTSP: 329 o Mute and Unmute Extension [25]. 331 o RTSP Stream Switching [26]. 333 o Live Streaming Relays [27]. 335 o Unreliable transport of RTSP messages (rtspu). 337 o The Record functionality. 339 o A text body type with suitable syntax for basic parameters to 340 be used in SET_PARAMETER, and GET_PARAMETER. Including IANA 341 registry within the defined name space. 343 o A RTSP MIB. 345 1.2 Purpose 347 The Real-Time Streaming Protocol (RTSP) establishes and controls 348 single or several time-synchronized streams of continuous media such 349 as audio and video. Put simply, RTSP acts as a "network remote 350 control" for multimedia servers. 352 There is no notion of a RTSP connection in the protocol. Instead, a 353 RTSP server maintains a session labelled by an identifier to 354 associate groups of media streams and their states. A RTSP session is 355 not tied to a transport-level connection such as a TCP connection. 356 During a session, a client may open and close many reliable transport 357 connections to the server to issue RTSP requests for that session. 359 This memorandum describes the use of RTSP over a reliable connection 360 based transport level protocol such as TCP. RTSP may be implemented 361 over an unreliable connectionless transport protocol such as UDP. 362 While nothing in RTSP precludes this, additional definition of this 363 problem area must be handled as an extension to the core 364 specification. 366 The mechanisms of RTSP's operation over UDP were left out 367 of this spec. because they were poorly defined in RFC 2326 368 [1] and the tradeoff in size and complexity of this spec. 369 for a small gain in a targeted problem space was not deemed 370 justifiable. 372 The set of streams to be controlled in a RTSP session is defined by a | 373 presentation description. This memorandum does not define a format 374 for the presentation description. However appendix C defines how SDP 375 [2] is used for this purpose. The streams controlled by RTSP may use 376 RTP [3] for their data transport, but the operation of RTSP does not 377 depend on the transport mechanism used to carry continuous media. | 378 RTSP is intentionally similar in syntax and operation to HTTP/1.1 [4] 379 so that extension mechanisms to HTTP can in most cases also be added 380 to RTSP. However, RTSP differs in a number of important aspects from 381 HTTP: 383 o RTSP introduces a number of new methods and has a different 384 protocol identifier. 386 o RTSP has the notion of a session built into the protocol. 388 o A RTSP server needs to maintain state by default in almost all 389 cases, as opposed to the stateless nature of HTTP. 391 o Both a RTSP server and client can issue requests. 393 o Data is usually carried out-of-band by a different protocol. 394 Session descriptions returned in a DESCRIBE response (see 395 Section 11.2) and interleaving of RTP with RTSP over TCP are 396 exceptions to this rule (see Section 12). 398 o RTSP is defined to use ISO 10646 (UTF-8) rather than ISO 399 8859-1, consistent with HTML internationalization efforts 400 [28]. 402 o The Request-URL always contains the absolute URL. Because of 403 backward compatibility with a historical blunder, HTTP/1.1 [4] 404 carries only the absolute path in the request and puts the 405 host name in a separate header field. 407 This makes "virtual hosting" easier, where a single 408 host with one IP address hosts several document trees. 410 The protocol supports the following operations: 412 Retrieval of media from media server: The client can either 413 request a presentation description via RTSP DESCRIBE, HTTP 414 or some other method. If the presentation is being 415 multicast, the presentation description contains the 416 multicast addresses and ports to be used for the continuous 417 media. If the presentation is to be sent only to the client 418 via unicast, the client provides the destination for 419 security reasons. 421 Invitation of a media server to a conference: A media server can 422 be "invited" to join an existing conference to play back 423 media into the presentation. This mode is useful for 424 distributed teaching applications. Several parties in the 425 conference may take turns "pushing the remote control 426 buttons". 428 RTSP requests may be handled by proxies, tunnels and caches as in 429 HTTP/1.1 [4]. 431 1.3 Notational Conventions 432 Since many of the definitions and syntax are identical to HTTP/1.1, 433 this specification only points to the section where they are defined 434 rather than copying it. For brevity, [HX.Y] is to be taken to refer 435 to Section X.Y of the current HTTP/1.1 specification (RFC 2616 [4]). 437 All the mechanisms specified in this document are described in both 438 prose and the augmented Backus-Naur form (BNF) described in detail in 439 RFC 2234 [5]. 441 Indented and smaller-type paragraphs are used to provide background | 442 and motivation. This is intended to give readers who were not | 443 involved with the formulation of the specification an understanding | 444 of why things are the way they are in RTSP. 446 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 447 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 448 document are to be interpreted as described in RFC 2119 [6]. 450 The word, unspecified, is used to indicate functionality or features | 451 that are not defined in this specification. Such functionality cannot | 452 be used in a standardized manner without further definition and | 453 review in an extension specification to RTSP. 455 1.4 Terminology 457 Some of the terminology has been adopted from HTTP/1.1 [4]. Terms not 458 listed here are defined as in HTTP/1.1. 460 Aggregate control: The concept of controlling multiple streams 461 using a single timeline, generally maintained by the 462 server. A client, for example, uses aggregate control when 463 it issues a single play or pause message to simultaneously 464 control both the audio and video in a movie. 466 Aggregate control URL: The URL used in a RTSP request to refer 467 to and control an aggregated session. It normally, but not 468 always, corresponds to the presentation URL specified in 469 the session description. See Section 11.3 for more 470 information. 472 Conference: a multiparty, multimedia presentation, where "multi" 473 implies greater than or equal to one. 475 Client: The client requests media service from the media server. 477 Connection: A transport layer virtual circuit established 478 between two programs for the purpose of communication. 480 Container file: A file which may contain multiple media streams | 481 which often constitutes a presentation when played | 482 together. The concept of a container file is not embedded | 483 in the protocol. However, RTSP servers may offer aggregate | 484 control on the media streams within these files. 486 Continuous media: Data where there is a timing relationship 487 between source and sink; that is, the sink must reproduce 488 the timing relationship that existed at the source. The 489 most common examples of continuous media are audio and 490 motion video. Continuous media can be real-time 491 (interactive), where there is a "tight" timing relationship 492 between source and sink, or streaming (playback), where the 493 relationship is less strict. 495 Entity: The information transferred as the payload of a request 496 or response. An entity consists of meta-information in the 497 form of entity-header fields and content in the form of an 498 entity-body, as described in Section 8. 500 Feature-tag: A tag representing a certain set of functionality, 501 i.e. a feature. 503 Live: Normally used to describe a presentation or session with 504 media coming from ongoing event. This generally results in 505 that the session has a unbound or only loosely defined 506 duration, and that no seek operations are possible. 508 Media initialization: Datatype/codec specific initialization. 509 This includes such things as clock rates, color tables, 510 etc. Any transport-independent information which is 511 required by a client for playback of a media stream occurs 512 in the media initialization phase of stream setup. 514 Media parameter: Parameter specific to a media type that may be 515 changed before or during stream playback. 517 Media server: The server providing playback services for one or 518 more media streams. Different media streams within a 519 presentation may originate from different media servers. A | 520 media server may reside on the same host or on a different | 521 host from which the presentation is invoked. 523 Media server indirection: Redirection of a media client to a 524 different media server. 526 (Media) stream: A single media instance, e.g., an audio stream 527 or a video stream as well as a single whiteboard or shared 528 application group. When using RTP, a stream consists of all 529 RTP and RTCP packets created by a source within an RTP 530 session. This is equivalent to the definition of a DSM-CC 531 stream([29]). 533 Message: The basic unit of RTSP communication, consisting of a 534 structured sequence of octets matching the syntax defined 535 in Section 18 and transmitted over a connection or a | 536 connectionless transport. 538 Non-Aggregated Control: Control of a single media stream. Only 539 possible in RTSP sessions with a single media. 541 Participant: Member of a conference. A participant may be a 542 machine, e.g., a playback server. 544 Presentation: A set of one or more streams presented to the 545 client as a complete media feed and described by a | 546 presentation description as defined below. In the RTSP | 547 context, this generally implies aggregate control over the | 548 streams, but does not necessarily have to. 550 Presentation description: A presentation description contains 551 information about one or more media streams within a 552 presentation, such as the set of encodings, network 553 addresses and information about the content. Other IETF 554 protocols such as SDP (RFC 2327 [2]) use the term "session" 555 for a presentation. The presentation description may take 556 several different formats, including but not limited to the 557 session description protocol format, SDP. | 559 Response: A RTSP response. If an HTTP response is meant, that is 560 indicated explicitly. 562 Request: A RTSP request. If an HTTP request is meant, that is 563 indicated explicitly. 565 Request URL: The URL used in a request to indicate the resource | 566 on which the request shall be performed. 568 RTSP agent: Refers to either a RTSP client, a RTSP server, or a | 569 RTSP Proxy. In this specification, there are many | 570 capabilities that are common to these three entities such | 571 as the capability to send requests or receive responses. | 572 This term will be used when describing functionality that | 573 is applicable to all three of these entities. 575 RTSP session: A stateful abstraction upon which the main control 576 methods of RTSP operate. A RTSP session is a server entity; 577 it is created, maintained and destroyed by the server. It 578 is established by a RTSP server upon the completion of a 579 successful SETUP request (when 200 OK response is sent) and 580 is labelled by a session identifier at that time. The 581 session exists until timed out by the server or explicitly 582 removed by a TEARDOWN request. A RTSP session is a stateful | 583 entity; a RTSP server maintains an explicit session state 584 machine (see Appendix A) where most state transitions are 585 triggered by client requests. The existence of a session 586 implies the existence of state about the session's media 587 streams and their respective transport mechanisms. A given 588 session can have zero or more media streams associated with 589 it. A RTSP server uses the session to aggregate control 590 over multiple media streams. 592 Transport initialization: The negotiation of transport 593 information (e.g., port numbers, transport protocols) 594 between the client and the server. 596 URI: Universal Resource Identifier, see RFC 2396 [13]. In RTSP 597 the used URIs are as general rule in fact URL's as they 598 gives an location for the resource. Therefore although RTSP 599 URLs are a subset of URIs, they will be refered as URLs. 601 URL: Universal Resource Locator, is an URI which identifies the 602 resource through its primary access mechanism, rather than 603 identifying the resource by name or by some other 604 attribute(s) of that resource. 606 1.5 Protocol Properties 608 RTSP has the following properties: 610 Extendable: New methods and parameters can be easily added to 611 RTSP. 613 Easy to parse: RTSP can be parsed by standard HTTP or MIME 614 parsers. 616 Secure: RTSP re-uses web security mechanisms, either at the 617 transport level (TLS, RFC 2246 [7]) or within the protocol 618 itself. All HTTP authentication mechanisms such as basic 619 (RFC 2616 [4]) and digest authentication (RFC 2617 [8]) are 620 directly applicable. 622 Transport-independent: RTSP does not preclude the use of an 623 unreliable datagram protocol (UDP) (RFC 768 [9]), a 624 reliable datagram protocol (RDP, RFC 1151, not widely used 625 [30]) as it would be possible to implement application- 626 level reliability. The use of a connectionless datagram 627 protocol such as UDP or RDP requires additional definition 628 that may be provided as extensions to the core RTSP 629 specification. The usage of the reliable stream protocol 630 TCP (RFC 793 [10]) is what is currently defined as 631 transport protocol of RTSP messages. 633 Multi-server capable: Each media stream within a presentation 634 can reside on a different server. The client automatically 635 establishes several concurrent control sessions with the 636 different media servers. Media synchronization is 637 performed at the transport level. 639 Separation of stream control and conference initiation: Stream 640 control is divorced from inviting a media server to a 641 conference. In particular, SIP [31] or H.323 [32] may be 642 used to invite a server to a conference. 644 Suitable for professional applications: RTSP supports frame- 645 level accuracy through SMPTE time stamps to allow remote 646 digital editing. 648 Presentation description neutral: The protocol does not impose a 649 particular presentation description or metafile format and 650 can convey the type of format to be used. However, the 651 presentation description must contain at least one RTSP 652 URL. 654 Proxy and firewall friendly: The protocol should be readily 655 handled by both application and transport-layer (SOCKS 656 [33]) firewalls. A firewall may need to understand the 657 SETUP method to open a "hole" for the media stream. 659 HTTP-friendly: Where sensible, RTSP reuses HTTP concepts, so 660 that the existing infrastructure can be reused. This 661 infrastructure includes PICS (Platform for Internet Content 662 Selection [34,35]) for associating labels with content. 663 However, RTSP does not just add methods to HTTP since the 664 controlling continuous media requires server state in most 665 cases. 667 Appropriate server control: If a client can start a stream, it 668 must be able to stop a stream. Servers should not start 669 streaming to clients in such a way that clients cannot stop 670 the stream. 672 Transport negotiation: The client can negotiate the transport 673 method prior to actually needing to process a continuous 674 media stream. 676 An earlier requirement in RTSP was multi-client capability. 677 However, it was determined that a better approach was to 678 make sure that the protocol is easily extensible to the 679 multi-client scenario. Stream identifiers can be used by 680 several control streams, so that "passing the remote" would 681 be possible. The protocol would not address how several 682 clients negotiate access; this is left to either a "social 683 protocol" or some other floor control mechanism. 685 1.6 Extending RTSP 687 Since not all media servers have the same functionality, media 688 servers by necessity will support different sets of requests. For 689 example: 691 o A server may not be capable of seeking (absolute positioning) 692 if it is to support live events only. 694 o Some servers may not support setting stream parameters and 695 thus not support GET_PARAMETER and SET_PARAMETER. 697 A server SHOULD implement all header fields described in Section 14. 699 It is up to the creators of presentation descriptions not to ask the 700 impossible of a server. This situation is similar in HTTP/1.1 [4], 701 where the methods described in [H19.5] are not likely to be supported 702 across all servers. 704 RTSP can be extended in three ways, listed here in order of the 705 magnitude of changes supported: 707 o Existing methods can be extended with new parameters, e.g. 708 headers, as long as these parameters can be safely ignored by 709 the recipient. If the client needs negative acknowledgement | 710 when a method extension is not supported, a tag corresponding 711 to the extension may be added in the Require: field (see 712 Section 14.35). 714 o New methods can be added. If the recipient of the message does 715 not understand the request, it responds with error code 501 716 (Not Implemented) and the sender should not attempt to use 717 this method again. A client may also use the OPTIONS method to 718 inquire about methods supported by the server. The server MUST 719 list the methods it supports using the Public response header. 721 o A new version of the protocol can be defined, allowing almost 722 all aspects (except the position of the protocol version 723 number) to change. 725 The basic capability discovery mechanism can be used to both discover 726 support for a certain feature and to ensure that a feature is 727 available when performing a request. For detailed explanation of this 728 see chapter 10. 730 1.7 Overall Operation 732 Each presentation and media stream is identified by an RTSP URL. The 733 overall presentation and the properties of the media the presentation 734 is made up of are defined by a presentation description file, the 735 format of which is outside the scope of this specification. The 736 presentation description file may be obtained by the client using 737 HTTP or other means such as email and may not necessarily be stored 738 on the media server. 740 For the purposes of this specification, a presentation description is 741 assumed to describe one or more presentations, each of which 742 maintains a common time axis. For simplicity of exposition and 743 without loss of generality, it is assumed that the presentation 744 description contains exactly one such presentation. A presentation 745 may contain several media streams. 747 The presentation description file contains a description of the media 748 streams making up the presentation, including their encodings, 749 language, and other parameters that enable the client to choose the 750 most appropriate combination of media. In this presentation 751 description, each media stream that is individually controllable by 752 RTSP is identified by a RTSP URL, which points to the media server 753 handling that particular media stream and names the stream stored on 754 that server. Several media streams can be located on different 755 servers; for example, audio and video streams can be split across 756 servers for load sharing. The description also enumerates which 757 transport methods the server is capable of. 759 Besides the media parameters, the network destination address and 760 port need to be determined. Several modes of operation can be 761 distinguished: 763 Unicast: The media is transmitted to the source of the RTSP 764 request, with the port number chosen by the client. 765 Alternatively, the media is transmitted on the same 766 reliable stream as RTSP. 768 Multicast, server chooses address: The media server picks the 769 multicast address and port. This is the typical case for a 770 live or near-media-on-demand transmission. 772 Multicast, client chooses address: If the server is to 773 participate in an existing multicast conference, the 774 multicast address, port and encryption key are given by the 775 conference description, established by means outside the 776 scope of this specification. 778 1.8 RTSP States 780 RTSP controls a stream which may be sent via a separate protocol, 781 independent of the control channel. For example, RTSP control may 782 occur on a TCP connection while the data flows via UDP. Thus, data 783 delivery continues even if no RTSP requests are received by the media 784 server. Also, during its lifetime, a single media stream may be 785 controlled by RTSP requests issued sequentially on different TCP 786 connections. Therefore, the server needs to maintain "session state" 787 to be able to correlate RTSP requests with a stream. The state 788 transitions are described in Appendix A. 790 Many methods in RTSP do not contribute to state. However, the 791 following play a central role in defining the allocation and usage of 792 stream resources on the server: SETUP, PLAY, PAUSE, REDIRECT, PING 793 and TEARDOWN. 795 SETUP: Causes the server to allocate resources for a stream and 796 create a RTSP session. 798 PLAY: Starts data transmission on a stream allocated via SETUP. 800 PAUSE: Temporarily halts a stream without freeing server 801 resources. 803 REDIRECT: Indicates that the session should be moved to new 804 server / location 806 PING: Prevents the identified session from being timed out. 808 TEARDOWN: Frees resources associated with the stream. The RTSP 809 session ceases to exist on the server. 811 RTSP methods that contribute to state use the Session header field 812 (Section 14.40) to identify the RTSP session whose state is being 813 manipulated. The server generates session identifiers in response to 814 SETUP requests (Section 11.3). 816 1.9 Relationship with Other Protocols 818 RTSP has some overlap in functionality with HTTP. It also may 819 interact with HTTP in that the initial contact with streaming content 820 is often to be made through a web page. The current protocol 821 specification aims to allow different hand-off points between a web 822 server and the media server implementing RTSP. For example, the 823 presentation description can be retrieved using HTTP or RTSP, which 824 reduces round trips in web-browser-based scenarios, yet also allows 825 for stand alone RTSP servers and clients which do not rely on HTTP at 826 all. However, RTSP differs fundamentally from HTTP in that most data 827 delivery takes place out-of-band in a different protocol. HTTP is an 828 asymmetric protocol where the client issues requests and the server 829 responds. In RTSP, both the media client and media server can issue 830 requests. RTSP requests are also stateful; they may set parameters 831 and continue to control a media stream long after the request has 832 been acknowledged. 834 Re-using HTTP functionality has advantages in at least two 835 areas, namely security and proxies. The requirements are 836 very similar, so having the ability to adopt HTTP work on 837 caches, proxies and authentication is valuable. 839 RTSP assumes the existence of a presentation description format that 840 can express both static and temporal properties of a presentation 841 containing several media streams. Session Description Protocol (SDP) 842 [2] is generally the format of choice; however, RTSP is not bound to 843 it. For data delivery, most real-time media will use RTP as a 844 transport protocol. While RTSP works well with RTP, it is not tied to 845 RTP. 847 2 RTSP Use Cases 849 This section describes some of the use cases for RTSP. They are | 850 listed in descending order of importance in regards to ensuring that | 851 all necessary functionality is present. This specification does only | 852 fully support usage of the two first. Also in these first two cases | 853 are there special cases that will not be supported without | 854 extensions, e.g. the redirection of media to another address than the | 855 controlling entity. | 857 2.1 On-demand Playback of Stored Content | 859 An RTSP capable server stores content suitable for being streamed to | 860 a client. A client desiring playback of any of the stored content | 861 uses RTSP to set up the media transport required for the desired | 862 content. Then RTSP is used to initiate, halt and manipulate the | 863 transmission of the content. There are also requirement on being able | 864 to use RTSP to carry necessary description and synchronization | 865 information for the content. | 867 The above high level description can be broken down into a number of | 868 functionalities that RTSP needs to be capable of. | 870 Presentation Description: The possibility to carry | 871 initialization information about the presentation | 872 (content), for example, which media codec(s) that are | 873 needed for the content. Other information that are | 874 important; how many media stream that the presentation | 875 contains; what transport protocols to use for the media | 876 streams; and identifiers for these media streams. This | 877 information is required before setup of the content is | 878 possible. The information is also needed by the client to | 879 determine if it is capable at all to support the content. | 881 This information is not required to be sent using RTSP, | 882 instead other external protocols can be utilized to | 883 transport presentation descriptions. Two good examples are | 884 the use of HTTP [4] or email to fetch or receive | 885 presentation descriptions like SDP [2]. | 887 Setup: Performing setup of some or all of the media streams in a | 888 presentation. The setup itself consist of determining which | 889 protocols for media transport to use; the necessary | 890 parameters for the protocol, like addresses and ports. | 892 Control of Transmission: After the necessary media streams has | 893 been established the client can request the server to start | 894 transmitting the content. There is need to allow the client | 895 to arbitrary times start or stop the transmission of the | 896 content. There are also exist need to be able to start the | 897 transmission at an any point in the timeline of the | 898 presentation. | 900 Synchronization: For media transport protocols like RTP [18] it | 901 might be beneficial to carry synchronization information | 902 within RTSP. Either due to the lack of inter media | 903 synchronization within the protocol itself, or the | 904 potential delay before the synchronization is established | 905 (which is the case for RTP when using RTCP). | 907 Termination There is also need to be able to terminate the | 908 established contexts. | 910 For this use cases there is a number of assumption about how it | 911 works. These are listed below: | 913 On-Demand content: The content available is stored at the server | 914 and can be accessed at any time during a time period when | 915 it is intended to be available. | 917 Independent sessions: A server is capable of serving a number of | 918 clients simultaneously, including from the same piece of | 919 content at different points in that presentations time- | 920 line. | 922 Unicast Transport: Content for each individual client is | 923 transmitted to them using unicast traffic. | 925 It is also possible to redirect the media traffic to another | 926 destination than where the entity controlling traffic uses. However | 927 allowing this without appropriate mechanisms for checking that the | 928 destination approves of this is a denial of service threat. | 930 2.2 Unicast distribution of Live Content | 932 This use cases is not that different from the above on-demand content | 933 case (see section 2.1. The difference is really the restriction the | 934 content itself establish. Live content is continuously distributed | 935 as it becomes available from a source, i.e. the main difference to | 936 on-demand is that one starts distributing content before the end of | 937 it has become available to the server. | 939 In many cases the consumer of live content is only interested in | 940 consuming what is actually happens "now", i.e. very similar to | 941 broadcast TV. However in this case it is assumed that there exist no | 942 broadcast or multicast channel to the users, and instead the server | 943 functions as a distribution node, sending the same content to | 944 multiple receivers, using unicast traffic between server and client. | 945 This unicast traffic and the transport parameters are individually | 946 negotiated for each receiving client. | 948 Another aspect of live content is that it has often very limited time | 949 of availability, as it is only is available for the duration of the | 950 event the content covers. A example of such a live content could for | 951 example be a music concert, which lasts 2 hour and starts at a | 952 predetermined time. Thus there is need to announce when and for how | 953 long the live content is available. | 955 2.3 On-demand Playback using Multicast | 957 It is possible to use RTSP to request that media is delivered to a | 958 multicast group. The entity setting up the session (the controller) | 959 will then control when and what media that is delivered to the group. | 960 Also this use case has some potential for denial of service attacks, | 961 in this case flooding any multicast group. Therefore there is need | 962 for a mechanism indicating that the group actually accepts the | 963 traffic from the RTSP server. | 965 An open issue in this use case is how one ensures that all receivers | 966 listening to the multicast or broadcast receives the session | 967 presentation configuring the receivers. | 969 2.4 Inviting a RTSP server into a conference | 971 If one has an established conference or group session, it is possible | 972 to have a RTSP server distribute media to the whole group. The | 973 transmission to the group is simplest controlled by a single | 974 participant or leader of the conference. Shared control might be | 975 possible, but would require further investigation and possibly | 976 extensions. There are some protocol mechanisms missing for this | 977 scenario. | 979 For reasonable complexity in the media transmission stage, this use | 980 case assumes that there exist either multicast or a conference focus | 981 that redistribute media to all participants. | 983 In some more detail, this use case is intended to be able to handle | 984 the following scenario: A conference leader or participant (from here | 985 called the controller) has some pre-stored content on a RTSP server | 986 that he likes to share with the group. The controller sets up a RTSP | 987 session at the streaming server for the content the controller likes | 988 to share. The session description for the content is retrieved to the | 989 controller. The media destination for the media content is set to the | 990 shared multicast group or conference focus. When desired by the | 991 controller, he/she can start and stop the transmission of the media | 992 to the conference group. | 994 There are several issues with this use case that is not solved by | 995 this core specification for RTSP: | 997 o Denial of service threat, to avoid a RTSP server from being a | 998 unknowing participant of a denial of service attack the server | 999 must be able to verify the destinations acceptance for the | 1000 media. Such a mechanism does not yet exist that can be used to | 1001 verify the approval to received media, instead only policies | 1002 can be used, which can be made to work in controlled | 1003 environments. | 1005 o The problem of distributing the presentation description to | 1006 all participants in the group. To enable a media receiver to | 1007 decode the content correctly the media configuration | 1008 information will need to be distributed reliable to all | 1009 participants. This will most likely require support from an | 1010 external protocol. | 1012 o Passing the control. If it is desired to be able to pass the | 1013 control of the RTSP session between the participants some | 1014 support will be required by an external protocol for the | 1015 necessary exchange of state information and possibly floor | 1016 control of who is controlling the RTSP session. | 1018 So if there interest in this use case further work on the necessary | 1019 extensions has to be performed. | 1021 2.5 Live Content using Multicast | 1023 This use case does in its simplest form not require any use of RTSP | 1024 at all. This is what multicast conferences being announce with SAP | 1025 and SDP are intended to handle. However in use cases where more | 1026 advance features like access control to the multicast session is | 1027 desired, RTSP could be used for session establishment. | 1029 A client desiring to join a live multicasted media session with | 1030 cryptographic (encryption) access control could use RTSP in the | 1031 following way. The source of the session, announces the session and | 1032 gives all interested to join, a RTSP URI. The client connects to the | 1033 server and requests the presentation description allowing for | 1034 configuration the reception. In this step it is possible to use | 1035 secured transport for the client, and also desired levels of | 1036 authentication, for example for charging purposes or simply access | 1037 control. An RTSP link also allows for load balancing between multiple | 1038 servers. However if this the only thing that occurs it can probably | 1039 be solved as simple using HTTP. | 1041 However for session where the sender likes to keep track of each | 1042 individual receiver during the session, and possibly use this side | 1043 channel for pushing out key-updates or other side information that is | 1044 desirable to be done on a per receiver basis, and the receivers are | 1045 not know prior to the session start, the state establishment that | 1046 RTSP provides can be beneficial. In this case a client would | 1047 establish a RTSP session to the multicast group. The RTSP server will | 1048 not transmit any media, instead it will simply point to the multicast | 1049 group. However the client and server will be able to keep the session | 1050 alive for as long as the receiver participates in the session. Thus | 1051 enabling for example server to client pushes of updates. | 1053 This use cases will most likely not be able to actually implement | 1054 some extensions in relation to the server to client push mechanism. | 1055 Here a method like ANNOUNCE might be suitable, however it will | 1056 require a RTSP extension to revive the method. 1058 3 Protocol Parameters 1060 3.1 RTSP Version 1062 HTTP Specification Section [H3.1] applies, with HTTP replaced by 1063 RTSP. This specification defines version 1.0 of RTSP. 1065 3.2 RTSP URL 1067 The "rtsp", "rtsps" and "rtspu" schemes are used to refer to network 1068 resources via the RTSP protocol. This section defines the scheme- 1069 specific syntax and semantics for RTSP URLs. The RTSP URL is case 1070 sensitive. 1072 Informative RTSP URL syntax: 1074 rtsp[u|s]://host[:port]/abspath[?query]#fragment 1076 See section 18.2.1 for the formal definition of the RTSP URL syntax. 1078 Note that fragment and query identifiers do not have a 1079 well-defined meaning at this time, i.e. their usage is 1080 unspecified, with the interpretation left to the RTSP 1081 server. 1083 The URL scheme rtsp requires that commands are issued via a reliable | 1084 protocol (within the Internet, TCP), while the scheme rtspu is | 1085 intended to identify RTSP over an unreliable protocol (within the | 1086 Internet, UDP). The scheme rtsps identifies a reliable transport | 1087 using secure transport (TLS [7]). The rtspu is not defined in this | 1088 specification, and are for future extensions of the protocol to | 1089 define how to use. 1091 If the port is empty or not given, port 554 SHALL be assumed. The 1092 semantics are that the identified resource can be controlled by RTSP 1093 at the server listening for TCP (scheme "rtsp") connections or UDP 1094 (scheme "rtspu") packets on that port of host, and the Request-URL 1095 for the resource is rtsp_URL. For the scheme rtsps the TCP and UDP 1096 port 322 is registered and SHALL be assumed. 1098 The use of IP addresses in URLs SHOULD be avoided whenever possible 1099 (see RFC 1924 [11]). Note: Using qualified domain names in any URL is 1100 one requirement for making it possible for RFC 2326 implementations 1101 of RTSP to use IPv6. This specification is updated to allow for 1102 literal IPv6 addresses in RTSP URLs using the host specification in 1103 RFC 2732 [12]. 1105 A presentation or a stream is identified by a textual media 1106 identifier, using the character set and escape conventions [H3.2] of 1107 URLs (RFC 2396 [13]). URLs may refer to a stream or an aggregate of 1108 streams, i.e., a presentation. Accordingly, requests described in 1109 Section 11 can apply to either the whole presentation or an 1110 individual stream within the presentation. Note that some request 1111 methods can only be applied to streams, not presentations and vice 1112 versa. 1114 For example, the RTSP URL: 1116 rtsp://media.example.com:554/twister/audiotrack 1118 identifies the audio stream within the presentation "twister", which 1119 can be controlled via RTSP requests issued over a TCP connection to 1120 port 554 of host media.example.com 1122 Also, the RTSP URL: 1124 rtsp://media.example.com:554/twister 1126 identifies the presentation "twister", which may be composed of audio 1127 and video streams. 1129 This does not imply a standard way to reference streams in 1130 URLs. The presentation description defines the hierarchical 1131 relationships in the presentation and the URLs for the 1132 individual streams. A presentation description may name a 1133 stream "a.mov" and the whole presentation "b.mov". 1135 The path components of the RTSP URL are opaque to the client and do 1136 not imply any particular file system structure for the server. 1138 This decoupling also allows presentation descriptions to be 1139 used with non-RTSP media control protocols simply by 1140 replacing the scheme in the URL. 1142 3.3 Session Identifiers 1143 Session identifiers are strings of any arbitrary length. A session 1144 identifier MUST be chosen randomly and MUST be at least eight 1145 characters long to make guessing it more difficult. (See Section 19.) 1147 3.4 SMPTE Relative Timestamps 1149 A SMPTE relative timestamp expresses time relative to the start of 1150 the clip. Relative timestamps are expressed as SMPTE time codes for 1151 frame-level access accuracy. The time code has the format 1152 hours:minutes:seconds:frames.subframes, 1153 with the origin at the start of the clip. The default smpte format 1154 is"SMPTE 30 drop" format, with frame rate is 29.97 frames per second. 1155 Other SMPTE codes MAY be supported (such as "SMPTE 25") through the 1156 use of alternative use of "smpte time". For the "frames" field in the 1157 time value can assume the values 0 through 29. The difference between 1158 30 and 29.97 frames per second is handled by dropping the first two 1159 frame indices (values 00 and 01) of every minute, except every tenth 1160 minute. If the frame value is zero, it may be omitted. Subframes are 1161 measured in one-hundredth of a frame. 1163 Examples: 1165 smpte=10:12:33:20- 1166 smpte=10:07:33- 1167 smpte=10:07:00-10:07:33:05.01 1168 smpte-25=10:07:00-10:07:33:05.01 1170 3.5 Normal Play Time 1172 Normal play time (NPT) indicates the stream absolute position 1173 relative to the beginning of the presentation, not to be confused 1174 with the Network Time Protocol (NTP). The timestamp consists of a 1175 decimal fraction. The part left of the decimal may be expressed in 1176 either seconds or hours, minutes, and seconds. The part right of the 1177 decimal point measures fractions of a second. 1179 The beginning of a presentation corresponds to 0.0 seconds. Negative 1180 values are not defined. The special constant now is defined as the 1181 current instant of a live type event. It MAY only be used for live 1182 type events, and SHALL NOT be used for on-demand content. 1184 NPT is defined as in DSM-CC: "Intuitively, NPT is the clock the 1185 viewer associates with a program. It is often digitally displayed on 1186 a VCR. NPT advances normally when in normal play mode (scale = 1), 1187 advances at a faster rate when in fast scan forward (high positive 1188 scale ratio), decrements when in scan reverse (high negative scale 1189 ratio) and is fixed in pause mode. NPT is (logically) equivalent to 1190 SMPTE time codes." [29] 1192 Examples: 1194 npt=123.45-125 1195 npt=12:05:35.3- 1196 npt=now- 1198 The syntax conforms to ISO 8601. The npt-sec notation is 1199 optimized for automatic generation, the ntp-hhmmss notation 1200 for consumption by human readers. The "now" constant allows 1201 clients to request to receive the live feed rather than the 1202 stored or time-delayed version. This is needed since 1203 neither absolute time nor zero time are appropriate for 1204 this case. 1206 3.6 Absolute Time 1208 Absolute time is expressed as ISO 8601 timestamps, using UTC (GMT). 1209 Fractions of a second may be indicated. 1211 Example for November 8, 1996 at 14h37 and 20 and a quarter seconds 1212 UTC: 1214 19961108T143720.25Z 1216 3.7 Feature-tags 1218 Feature-tags are unique identifiers used to designate features in 1219 RTSP. These tags are used in Require (Section 14.35), Proxy-Require 1220 (Section 14.30), Unsupported (Section 14.44), and Supported (Section 1221 14.41) header fields. 1223 Feature tag needs to indicate if they apply to servers only, proxies 1224 only, or both server and proxies. 1226 The creator of a new RTSP feature-tag should either prefix the 1227 feature-tag with a reverse domain name (e.g., 1228 "com.example.mynewfeature" is an apt name for a feature whose 1229 inventor can be reached at "example.com"), or register the new 1230 feature-tag with the Internet Assigned Numbers Authority (IANA), see 1231 IANA Section 20. 1233 The usage of feature tags are further described in section 10 that | 1234 deals with capability handling. | 1236 3.8 Entity Tags | 1238 Entity tags opaque strings that are used to compare two entities from | 1239 the same resource, for example in caches or to optimize setup after a | 1240 redirect. Further explanation is present in [H3.11]. For explanation | 1241 on how to compare Entity tags see [H13.3]. Entity tags can be carried | 1242 in the ETag header (see section 14.20) or in SDP (see section C.1.8). | 1244 Entity tags are used in RTSP to make some methods conditional. The | 1245 methods are made conditional through the inclusion of headers, see | 1246 14.24 and 14.26. 1248 4 RTSP Message 1250 RTSP is a text-based protocol and uses the ISO 10646 character set in 1251 UTF-8 encoding (RFC 2279 [14]). Lines are terminated by CRLF, but 1252 receivers should be prepared to also interpret CR and LF by 1253 themselves as line terminators. 1255 Text-based protocols make it easier to add optional 1256 parameters in a self-describing manner. Since the number of 1257 parameters and the frequency of commands is low, processing 1258 efficiency is not a concern. Text-based protocols, if done 1259 carefully, also allow easy implementation of research 1260 prototypes in scripting languages such as Tcl, Visual Basic 1261 and Perl. 1263 The 10646 character set avoids tricky character set switching, but is 1264 invisible to the application as long as US-ASCII is being used. This 1265 is also the encoding used for RTCP. ISO 8859-1 translates directly 1266 into Unicode with a high-order octet of zero. ISO 8859-1 characters 1267 with the most-significant bit set are represented as 1100001x 1268 10xxxxxx. (See RFC 2279 [14]) 1270 RTSP messages can be carried over any lower-layer transport protocol 1271 that is 8-bit clean. RTSP messages are vulnerable to bit errors and 1272 SHOULD NOT be subjected to them. 1274 Requests contain methods, the object the method is operating upon and 1275 parameters to further describe the method. Methods are idempotent, 1276 unless otherwise noted. Methods are also designed to require little 1277 or no state maintenance at the media server. 1279 4.1 Message Types 1280 See [H4.1]. 1282 4.2 Message Headers 1284 See [H4.2]. 1286 4.3 Message Body 1288 See [H4.3] 1290 4.4 Message Length 1292 When a message body is included with a message, the length of that 1293 body is determined by one of the following (in order of precedence): 1295 1. Any response message which MUST NOT include a message body 1296 (such as the 1xx, 204, and 304 responses) is always 1297 terminated by the first empty line after the header fields, 1298 regardless of the entity-header fields present in the 1299 message. (Note: An empty line consists of only CRLF.) 1301 2. If a Content-Length header field (section 14.15) is 1302 present, its value in bytes represents the length of the 1303 message-body. If this header field is not present, a value 1304 of zero is assumed. 1306 Note that RTSP does not (at present) support the HTTP/1.1 "chunked" 1307 transfer coding(see [H3.6.1]) and requires the presence of the 1308 Content-Length header field. 1310 Given the moderate length of presentation descriptions 1311 returned, the server should always be able to determine its 1312 length, even if it is generated dynamically, making the 1313 chunked transfer encoding unnecessary. 1315 5 General Header Fields 1317 See [H4.5], except that Pragma, Trailer, Transfer-Encoding, Upgrade, 1318 and Warning headers are not defined. RTSP further defines the CSeq, 1319 and Timestamp. The general headers are listed in table 1: 1321 6 Request 1323 A request message from a client to a server or vice versa includes, | 1324 within the first line (Request Line) of that message, the method to | 1325 be applied to the resource, the identifier of the resource, and the | 1326 Header Name Comment 1327 _________________________________ 1328 Cache-Control See section 14.10 1329 Connection See section 14.11 1330 CSeq See section 14.18 1331 Date See section 14.19 1332 Supported See section 14.41 1333 Timestamp See section 14.42 1334 Via See section 14.47 1336 Table 1: The General headers used in RTSP. 1338 protocol version in use. Then follows zero or more headers that can | 1339 be of general (Section 5), request (Section 6.2), or entity (Section | 1340 8.1) type. Then an empty line, i.e. a line with only the two | 1341 characters Carriage Return (CR) and Line Feed (LF), indicates the end | 1342 of the header part. Optionally a message body (entity) follows to the | 1343 end of the message. The length of the message body is indicated | 1344 through the Content-Length entity header. 1346 6.1 Request Line 1348 The request line, provides the most important things about the 1349 request: What method, on what resources and using which RTSP version. 1350 The methods that is defined by this specification can be seen in 1351 Table 6.1. The resource is identified through an absolute RTSP URL 1352 (see section 3.2. 1354 SP SP CRLF 1356 Please note: The request line's syntax can't be freely changed in | 1357 future versions of RTSP, as this line indicates the version of the | 1358 messages and need to be parsable also by older versions. 1360 Note that in contrast to HTTP/1.1 [4], RTSP requests always contain 1361 the absolute URL (that is, including the scheme, host and port) 1362 rather than just the absolute path. 1364 HTTP/1.1 requires servers to understand the absolute URL, 1365 but clients are supposed to use the Host request header. 1366 This is purely needed for backward-compatibility with 1367 HTTP/1.0 servers, a consideration that does not apply to 1368 RTSP. 1370 Method Defined In Section 1371 _________________________________ 1372 DESCRIBE Section 11.2 1373 GET_PARAMETER Section 11.7 1374 OPTIONS Section 11.1 1375 PAUSE Section 11.5 1376 PLAY Section 11.4 1377 PING Section 11.10 1378 REDIRECT Section 11.9 1379 SETUP Section 11.3 1380 SET_PARAMETER Section 11.8 1381 TEARDOWN Section 11.6 1383 Table 2: The RTSP Methods 1385 The asterisk "*" in the Request-URL means that the request does not 1386 apply to a particular resource, but to the server or proxy itself, 1387 and is only allowed when the method used does not necessarily apply 1388 to a resource. 1390 One example would be as follows: 1392 OPTIONS * RTSP/1.0 1394 An OPTIONS in this form will determine the capabilities of the server 1395 or the proxy that first receives the request. If one needs to address 1396 the server explicitly, then one should use an absolute URL with the 1397 server's address. 1399 OPTIONS rtsp://example.com RTSP/1.0 1401 6.2 Request Header Fields 1403 The RTSP headers in Table 3 can be included in a request with the 1404 purpose to give further define how the request should be fulfilled. A 1405 request header MAY also be response header, see section 7.1.2. 1407 7 Response 1408 Header Defined in Section 1409 _____________________________________ 1410 Accept Section 14.1 1411 Accept-Encoding Section 14.3 1412 Accept-Language Section 14.4 1413 Authorization Section 14.7 1414 Bandwidth Section 14.8 1415 Blocksize Section 14.9 1416 From Section 14.22 1417 If-Match Section 14.24 1418 If-Modified-Since Section 14.25 1419 If-None-Match Section 14.26 1420 Proxy-Require Section 14.30 1421 Range Section 14.32 1422 Referer Section 14.33 1423 Require Section 14.35 1424 Scale Section 14.37 1425 Session Section 14.40 1426 Speed Section 14.38 1427 Supported Section 14.41 1428 Transport Section 14.43 1429 User-Agent Section 14.45 1431 Table 3: The RTSP request headers 1433 [H6] applies except that HTTP-Version is replaced by RTSP-Version. 1434 Also, RTSP defines additional status codes and does not define some 1435 HTTP codes. The valid response codes and the methods they can be used 1436 with are defined in Table 4. 1438 After receiving and interpreting a request message, the recipient 1439 responds with an RTSP response message. 1441 7.1 Status-Line 1443 The first line of a Response message is the Status-Line, consisting 1444 of the protocol version followed by a numeric status code, and the 1445 textual phrase associated with the status code, with each element 1446 separated by SP characters. No CR or LF is allowed except in the 1447 final CRLF sequence. 1449 SP SP CRLF 1451 7.1.1 Status Code and Reason Phrase 1452 The Status-Code element is a 3-digit integer result code of the 1453 attempt to understand and satisfy the request. These codes are fully 1454 defined in Section 13. The Reason-Phrase is intended to give a short 1455 textual description of the Status-Code. The Status-Code is intended 1456 for use by automata and the Reason-Phrase is intended for the human 1457 user. The client is not required to examine or display the Reason- 1458 Phrase. 1460 The first digit of the Status-Code defines the class of response. The 1461 last two digits do not have any categorization role. There are 5 1462 values for the first digit: 1464 o 1xx: Informational - Request received, continuing process 1466 o 2xx: Success - The action was successfully received, 1467 understood, and accepted 1469 o 3rr: Redirection - Further action must be taken in order to 1470 complete the request 1472 o 4xx: Client Error - The request contains bad syntax or cannot 1473 be fulfilled 1475 o 5xx: Server Error - The server failed to fulfill an apparently 1476 valid request 1478 The individual values of the numeric status codes defined for 1479 RTSP/1.0, and an example set of corresponding Reason-Phrase's, are 1480 presented in table 4. The reason phrases listed here are only 1481 recommended they may be replaced by local equivalents without 1482 affecting the protocol. Note that RTSP adopts most HTTP/1.1 [4] 1483 status codes and adds RTSP-specific status codes starting at x50 to 1484 avoid conflicts with newly defined HTTP status codes. 1486 RTSP status codes are extensible. RTSP applications are not required 1487 to understand the meaning of all registered status codes, though such 1488 understanding is obviously desirable. However, applications MUST 1489 understand the class of any status code, as indicated by the first 1490 digit, and treat any unrecognized response as being equivalent to the 1491 x00 status code of that class, with the exception that an 1492 unrecognized response MUST NOT be cached. For example, if an 1493 unrecognized status code of 431 is received by the client, it can 1494 safely assume that there was something wrong with its request and 1495 treat the response as if it had received a 400 status code. In such 1496 cases, user agents SHOULD present to the user the entity returned 1497 with the response, since that entity is likely to include human- 1498 readable information which will explain the unusual status. 1500 7.1.2 Response Header Fields 1502 The response-header fields allow the request recipient to pass 1503 additional information about the response which cannot be placed in 1504 the Status-Line. These header fields give information about the 1505 server and about further access to the resource identified by the 1506 Request-URL. All headers currently being classified as response 1507 headers are listed in table 5. 1509 Response-header field names can be extended reliably only in 1510 combination with a change in the protocol version. However, new or 1511 experimental header fields MAY be given the semantics of response- 1512 header fields if all parties in the communication recognize them to 1513 be response-header fields. Unrecognized header fields are treated as 1514 entity-header fields. 1516 8 Entity 1518 Request and Response messages MAY transfer an entity if not otherwise 1519 restricted by the request method or response status code. An entity 1520 consists of entity-header fields and an entity-body, although some 1521 responses will only include the entity-headers. 1523 The SET_PARAMETER, and GET_PARAMETER request and response, and 1524 DESCRIBE response MAY have an entity. All 4xx and 5xx responses MAY 1525 also have an entity. 1527 In this section, both sender and recipient refer to either the client 1528 or the server, depending on who sends and who receives the entity. 1530 8.1 Entity Header Fields 1532 Entity-header fields define optional meta-information about the 1533 entity-body or, if no body is present, about the resource identified 1534 by the request. The entity header fields are listed in table 8.1. 1536 The extension-header mechanism allows additional entity-header fields 1537 to be defined without changing the protocol, but these fields cannot 1538 be assumed to be recognizable by the recipient. Unrecognized header 1539 fields SHOULD be ignored by the recipient and forwarded by proxies. 1541 8.2 Entity Body 1543 See [H7.2] with the addition that a RTSP message with an entity body 1544 MUST include the Content-Type and Content-Length headers. 1546 9 Connections 1548 RTSP requests can be transmitted in several different ways: 1550 o persistent transport connections used for several request- 1551 response transactions; 1553 o one connection per request/response transaction; 1555 o connectionless mode. 1557 The type of transport is defined by the RTSP URL (Section 3.2). For 1558 the scheme "rtsp", a connection is assumed, while the scheme "rtspu" 1559 calls for RTSP requests to be sent without setting up a connection. 1561 Unlike HTTP, RTSP allows the media server to send requests to the 1562 media client. However, this is only supported for persistent 1563 connections, as the media server otherwise has no reliable way of 1564 reaching the client. Also, this is the only way that requests from 1565 media server to client are likely to traverse firewalls. 1567 9.1 Pipelining 1569 A client that supports persistent connections or connectionless mode 1570 MAY "pipeline" its requests (i.e., send multiple requests without 1571 waiting for each response). A server MUST send its responses to those 1572 requests in the same order that the requests were received. 1574 9.2 Reliability and Acknowledgements 1576 The transmission of RTSP over UDP was optionally to implement and 1577 specified in RFC 2326. However that definition was not satisfactory 1578 for interoperable implementations. Due to lack of interest, this 1579 specification does not specify how RTSP over UDP shall be 1580 implemented. However to maintain backwards compatibility in the 1581 message format certain RTSP headers must be maintained. These 1582 mechanism are described below. The next section Unreliable Transport 1583 (section 9.3) provides documentation of certain features that are 1584 necessary for transport protocols like UDP. 1586 Any RTSP request according to this specification SHALL NOT be sent to 1587 a multicast address. Any RTSP request SHALL be acknowledged. If a 1588 reliable transport protocol is used to carry RTSP, requests MUST NOT 1589 be retransmitted; the RTSP application MUST instead rely on the 1590 underlying transport to provide reliability. 1592 If both the underlying reliable transport such as TCP and 1593 Code Reason Method 1594 __________________________________________________________ 1595 100 Continue all 1597 __________________________________________________________ 1598 200 OK all 1599 201 Created RECORD 1600 250 Low on Storage Space RECORD 1601 __________________________________________________________ 1602 300 Multiple Choices all 1603 301 Moved Permanently all 1604 302 Found all 1605 303 See Other all 1606 305 Use Proxy all 1608 __________________________________________________________ 1609 400 Bad Request all 1610 401 Unauthorized all 1611 402 Payment Required all 1612 403 Forbidden all 1613 404 Not Found all 1614 405 Method Not Allowed all 1615 406 Not Acceptable all 1616 407 Proxy Authentication Required all 1617 408 Request Timeout all 1618 410 Gone all 1619 411 Length Required all 1620 412 Precondition Failed DESCRIBE, SETUP 1621 413 Request Entity Too Large all 1622 414 Request-URL Too Long all 1623 415 Unsupported Media Type all 1624 451 Parameter Not Understood SET_PARAMETER 1625 452 reserved n/a 1626 453 Not Enough Bandwidth SETUP 1627 454 Session Not Found all 1628 455 Method Not Valid In This State all 1629 456 Header Field Not Valid all 1630 457 Invalid Range PLAY, PAUSE 1631 458 Parameter Is Read-Only SET_PARAMETER 1632 459 Aggregate Operation Not Allowed all 1633 460 Only Aggregate Operation Allowed all 1634 461 Unsupported Transport all 1635 462 Destination Unreachable all 1636 470 Connection Authorization Required all 1637 471 Connection Credentials not accepted all 1638 __________________________________________________________ 1639 500 Internal Server Error all 1640 501 Not Implemented all 1641 502 Bad Gateway all 1642 503 Service Unavailable all 1643 504 Gateway Timeout all 1644 505 RTSP Version Not Supported all 1646 Table 4: Status codes and their usage with RTSP methods 1648 Header Defined in Section 1649 ______________________________________ 1650 Accept-Ranges Section 14.5 1651 ETag Section 14.20 1652 Location Section 14.28 1653 Proxy-Authenticate Section 14.29 1654 Public Section 14.31 1655 Range Section 14.32 1656 Retry-After Section 14.34 1657 RTP-Info Section 14.36 1658 Scale Section 14.37 1659 Session Section 14.40 1660 Server Section 14.39 1661 Speed Section 14.38 1662 Transport Section 14.43 1663 Unsupported Section 14.44 1664 Vary Section 14.46 1665 WWW-Authenticate Section 14.48 1667 Table 5: The RTSP response headers 1669 Header Defined in Section 1671 ____________________________________ 1672 Allow Section 14.6 1673 Content-Base Section 14.12 1674 Content-Encoding Section 14.13 1675 Content-Language Section 14.14 1676 Content-Length Section 14.15 1677 Content-Location Section 14.16 1678 Content-Type Section 14.17 1679 Expires Section 14.21 1680 Last-Modified Section 14.27 1682 Table 6: The RTSP entity headers 1684 the RTSP application retransmit requests, it is possible 1685 that each packet loss results in two retransmissions. The 1686 receiver cannot typically take advantage of the 1687 application-layer retransmission since the transport stack 1688 will not deliver the application-layer retransmission 1689 before the first attempt has reached the receiver. If the 1690 packet loss is caused by congestion, multiple 1691 retransmissions at different layers will exacerbate the 1692 congestion. 1694 Each request carries a sequence number in the CSeq header (Section 1695 14.18), which MUST be incremented by one for each distinct request 1696 transmitted to the destination end-point. The initial sequence 1697 number MAY be chosen arbitrary, but is RECOMMENDED to begin with 0. 1698 If a request is repeated because of lack of acknowledgement, the 1699 request MUST carry the original sequence number (i.e., the sequence 1700 number is not incremented). 1702 9.3 Unreliable Transport 1704 This section provides some information to future specification of 1705 RTSP over unreliable transport. 1707 Requests shall be acknowledged by the receiver. If there is no 1708 acknowledgement, the sender may resend the same message after a 1709 timeout of one round-trip time (RTT). The round-trip time is 1710 estimated as in TCP (RFC 1123) [15], with an initial round-trip value 1711 of 500 ms. An implementation MAY cache the last RTT measurement as 1712 the initial value for future connections. 1714 If RTSP is used over a small-RTT LAN, standard procedures for 1715 optimizing initial TCP round trip estimates, such as those used in 1716 T/TCP (RFC 1644) [36], can be beneficial. 1718 The Timestamp header (Section 14.42) is used to avoid the 1719 retransmission ambiguity problem [37] and obviates the need for 1720 Karn's algorithm. 1722 If a request is repeated because of lack of acknowledgement, the 1723 request must carry the original sequence number (i.e., the sequence 1724 number is not incremented). 1726 A number of RTSP messages destined for the same control end point may 1727 be packed into a single lower-layer PDU. 1729 The default port for the RTSP server is 554 for UDP. 1731 9.4 The usage of connections 1733 Systems implementing RTSP MUST support carrying RTSP over TCP. The 1734 default port for the RTSP server is 554 for TCP. A number of RTSP 1735 packets destined for the same control end point may be encapsulated 1736 into a TCP stream. RTSP data MAY be interleaved with RTP and RTCP 1737 packets, see section 12. Unlike HTTP, an RTSP message MUST contain a 1738 Content-Length header field whenever that message contains a payload 1739 (entity). Otherwise, an RTSP packet is terminated with an empty line 1740 immediately following the last message header. 1742 TCP can be used for both persistent connections and for one message 1743 exchange per connection, as presented above. This section gives 1744 further rules and recommendations on how to handle these connections 1745 so maximum interoperability and flexibility can be achieved. 1747 A server SHALL handle both persistent connections and one 1748 request/response transaction per connection. A persistent connection 1749 MAY be used for all transactions between the server and client, 1750 including messages to multiple RTSP sessions. However the persistent 1751 connection MAY also be closed after a few message exchanges, e.g. the 1752 initial setup and play command in a session. Later when the client 1753 wishes to send a new request, e.g. pause, to the session a new 1754 connection is opened. This connection may either be for a single 1755 message exchange or can be kept open for several messages, i.e. 1756 persistent. 1758 A major motivation for allowing non-persistent connections are that 1759 they ensure fault tolerance. A second one is to allow for application 1760 layer mobility. A server and client supporting non-persistent 1761 connection can survive a loss of a TCP connection, e.g. due to a NAT 1762 timeout. When the client has discovered that the TCP connection has 1763 been lost, it can set up a new one when there is need to communicate. 1765 The client MAY close the connection at any time when no outstanding 1766 request/response transactions exist. The server SHOULD NOT close the 1767 connection unless at least one RTSP session timeout period has passed 1768 without data traffic. A server SHOULD NOT initiate a close of a 1769 connection directly after responding to a TEARDOWN request for the 1770 whole session. A server SHOULD NOT close the connection as a result 1771 of responding to a request with an error code. Doing this would 1772 prevent or result in extra overhead for the client when testing 1773 advanced or special types of requests. 1775 The client SHOULD NOT have more than one connection to the server at 1776 any given point. If a client or proxy handles multiple RTSP sessions 1777 on the same server, it is RECOMMENDED to use only a single 1778 connection. 1780 Older services which was implemented according to RFC 2326 sometimes 1781 requires the client to use persistent connection. The client closing 1782 the connection may result in that the server removes the session. To 1783 achieve interoperability with old servers any client is strongly 1784 RECOMMENDED to use persistent connections. 1786 A Client is also strongly RECOMMENDED to use persistent connections 1787 as it allows the server to send request to the client. In cases 1788 where no connection exist between the server and the client, this may 1789 cause the server to be forced to drop the RTSP session without 1790 notifying the client why, due to the lack of signalling channel. An 1791 example of such a case is when the server desires to send a REDIRECT 1792 request for a RTSP session to the client. 1794 A server implemented according to this specification MUST respond 1795 that it supports the "play.basic" feature-tag above. A client MAY 1796 send a request including the Supported header in a request to 1797 determine support of non-persistent connections. A server supporting 1798 non-persistent connections will return the "play.basic" feature-tag 1799 in its response. If the client receives the feature-tag in the 1800 response, it can be certain that the server handles non-persistent 1801 connections. 1803 9.5 Timing Out RTSP messages 1805 Receivers of a request (responder) SHOULD respond to requests in a 1806 timely manner even when a reliable transport such as TCP is used. 1807 Similarly, the sender of a request (requestor) SHOULD wait for a 1808 sufficient time for a response before concluding that the responder 1809 will not be acting upon its request. 1811 A responder SHOULD respond to all requests within 5 seconds. If the 1812 responder recognizes that processing of a request will take longer 1813 than 5 seconds, it SHOULD send a 100 response as soon as possible. It 1814 SHOULD continue sending a 100 response every 5 seconds thereafter 1815 until it is ready to send the final response to the requestor. After 1816 sending a 100 response, the receiver MUST send a final response 1817 indicating the success or failure of the request. 1819 A requestor SHOULD wait at least 10 seconds for a response before 1820 concluding that the responder will not be responding to its request. 1821 After receiving a 100 response, the requestor SHOULD continue waiting 1822 for further responses. If more than 10 seconds elapses without 1823 receiving any response, the requestor MAY assume the responder is 1824 unresponsive and abort the connection. 1826 A requestor SHOULD wait longer than 10 seconds for a response if it 1827 is experiencing significant transport delays on its connection to the 1828 responder. The requestor is capable of determining the RTT using the 1829 Timestamp header (section 14.42) in any RTSP request. 1831 9.6 Use of IPv6 1833 This specification has been updated so that it supports IPv6. 1834 However this support was not present in RFC 2326 therefore some 1835 interoperability issues exist. A RFC 2326 implementation can support 1836 IPv6 as long as no explicit IPv6 addresses are used within RTSP 1837 messages. This require that any RTSP URL pointing at a IPv6 host must 1838 use fully qualified domain name and not a IPv6 address. Further the 1839 Transport header must not use the parameters source and destination. 1841 Implementations according to this specification MUST understand IPv6 1842 addresses in URLs, and headers. By this requirement the feature-tag 1843 "play.basic" can be used to determine that a server or client is 1844 capable of handling IPv6 within RTSP. 1846 10 Capability Handling 1848 This chapter describes the capability handling mechanism available in 1849 RTSP which allows RTSP to be extended. Extensions to this version of 1850 the protocol are basically done in two ways. First, new headers can 1851 be added. Secondly, new methods can be added. The capability handling 1852 mechanism is designed to handle these two cases. 1854 When a method is added the involved parties can use the OPTIONS 1855 method to discover if it is supported. This is done by issuing a 1856 OPTIONS request to the other party. Depending on the URL it will 1857 either apply in regards to a certain media resource, the whole server 1858 in general, or simply the next hop. The OPTIONS response will contain 1859 a Public header which declares all methods supported for the 1860 indicated resource. 1862 It is not necessary to use OPTIONS to discover support of a method, 1863 the client could simply try the method. If the receiver of the 1864 request does not support the method it will respond with an error 1865 code indicating the the method is either not implemented (501) or 1866 does not apply for the resource (405). The choice between the two 1867 discovery methods depends on the requirements of the service. 1869 To handle functionality additions that are not new methods feature- 1870 tags are defined. Each feature-tag represents a certain block of 1871 functionality. The amount of functionality that a feature-tag 1872 represents can vary significantly. A simple feature-tag can simple 1873 represent the functionality a single header gives. Another feature- 1874 tag is "play.basic" which represents the minimal playback 1875 implementation according to the updated specification. 1877 The feature-tags are then used to determine if the client, server or 1878 proxy supports the functionality that is necessary to achieve the 1879 desired service. To determine support of a feature-tag several 1880 different headers can be used, each explained below: 1882 Supported: The supported header is used to determine the 1883 complete set of functionality that both client and server 1884 has. The intended usage is to determine before one needs to 1885 use a functionality that it is supported. It can be used in 1886 any method however OPTIONS is the most suitable as one at 1887 the same time determines all methods that are implemented. 1888 When sending a request the requestor declares all its 1889 capabilities by including all supported feature-tags. This 1890 results in that the receiver learns the requestors feature 1891 support. The receiver then includes its set of features in 1892 the response. 1894 Require: The Require header can be included in any request where 1895 the end point, i.e. the client or server, is required to 1896 understand the feature to correctly perform the request. 1897 This can for example be a SETUP request where the server 1898 must understand a certain parameter to be able to set up 1899 the media delivery correctly. Ignoring this parameter would 1900 not have the desired effect and is not acceptable. 1901 Therefore the end-point receiving a request containing a 1902 Require must negatively acknowledge any feature that it 1903 does not understand and not perform the request. The 1904 response in cases where features are not understood are 551 1905 (Option Not Supported). Also the features that are not 1906 understood are given in the Unsupported header in the 1907 response. 1909 Proxy-Require: This method has the same purpose and workings as 1910 Require except that it only applies to proxies and not the 1911 end point. Features that needs to be supported by both 1912 proxies and end-point needs to be included in both the 1913 Require and Proxy-Require header. 1915 Unsupported: This header is used in 551 error response to tell 1916 which feature(s) that was not supported. Such a response is 1917 only the result of the usage of the Require and/or Proxy- 1918 Require header where one or more feature where not 1919 supported. This information allows the requestor to make 1920 the best of situations as it knows which features that was 1921 not supported. 1923 11 Method Definitions 1925 The method indicates what is to be performed on the resource 1926 identified by the Request-URL. The method name is case-sensitive. 1927 New methods may be defined in the future. Method names may not start 1928 with a $ character (decimal 24) and must be a token as defined by the 1929 ABNF. Methods are summarized in Table 11. 1931 method direction object Server req. Client req. 1932 ___________________________________________________________________ 1933 DESCRIBE C -> S P,S recommended recommended 1934 GET_PARAMETER C -> S, S -> C P,S optional optional 1935 OPTIONS C -> S, S -> C P,S R=Req, Sd=Opt Sd=Req, R=Opt 1936 PAUSE C -> S P,S recommended recommended 1937 PING C -> S, S -> C P,S recommended optional 1938 PLAY C -> S P,S required required 1939 REDIRECT S -> C P,S optional optional 1940 SETUP C -> S S required required 1941 SET_PARAMETER C -> S, S -> C P,S optional optional 1942 TEARDOWN C -> S P,S required required 1944 Table 7: Overview of RTSP methods, their direction, and what objects | 1945 (P: presentation, S: stream) they operate on. Legend: R=Respond, | 1946 Sd=Send, Opt: Optional, Req: Required, Rec: Recommended 1948 Notes on Table 11: PAUSE is recommended, but not required. For | 1949 example, a fully functional server can be built to deliver live feeds | 1950 that does not support this method. If a RTSP agent does not support a | 1951 particular method, it MUST return 501 (Not Implemented) and the | 1952 requesting RTSP agent, in turn, SHOULD NOT try this method again for | 1953 the given agent / resource combination. 1955 11.1 OPTIONS 1957 The semantics of the RTSP OPTIONS method is equivalent to that of the | 1958 HTTP OPTIONS method described in [H9.2]. In, RTSP, however, OPTIONS | 1959 is bi-directional, where a client can request it to a server and vice | 1960 versa. A client MUST implement the capability to send an OPTIONS | 1961 request and a server or a proxy MUST implement the capability to | 1962 respond to an OPTIONS request. The client, server or proxy MAY also | 1963 implement the converse of their required capability. | 1965 An OPTIONS request may be issued at any time. Such a request does not | 1966 modify the session state. However, it may prolong the session | 1967 lifespan (see below). The URL in an OPTIONS request determines the | 1968 scope of the request and the corresponding response. If the request | 1969 URL refers to a specific media resource on a given host, the scope is | 1970 limited to the set of methods supported for that media resource by | 1971 the indicated RTSP agent. A request URL with only the host address | 1972 limits the scope to the specified RTSP agent's general capabilities | 1973 without regard to any specific media. If the request URL is an | 1974 asterisk ("*"), the scope is limited to the general capabilities of | 1975 the next hop (i.e. the RTSP agent in direct communication with the | 1976 request sender). | 1977 Regardless of scope of the request, the Public header MUST always be | 1978 included in the OPTIONS response listing the methods that are | 1979 supported by the responding RTSP agent. In addition, if the scope of | 1980 the request is limited to a media resource, the Allow header MAY be | 1981 included in the response to enumerate the set of methods that are | 1982 allowed for that resource. If the given resource is not available, | 1983 the RTSP agent SHOULD return an appropriate response code such as 3rr | 1984 or 4xx. The Supported header can be included in the request to query | 1985 the set of features that are supported by the responding RTSP agent. | 1987 The OPTIONS method can be used to keep an RTSP session alive. | 1988 However, it is not the preferred means of session keep-alive | 1989 signalling, see section 14.40. An OPTIONS request intended for | 1990 keeping alive a RTSP session MUST include the Session header with the | 1991 associated session ID. Such a request SHOULD also use the media or | 1992 the aggregated control URL as the request URL. 1994 Example: 1996 C->S: OPTIONS * RTSP/1.0 1997 CSeq: 1 1998 User-Agent: PhonyClient/1.2 1999 Require: 2000 Proxy-Require: gzipped-messages 2001 Supported: play.basic 2003 S->C: RTSP/1.0 200 OK 2004 CSeq: 1 2005 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE 2006 Supported: play.basic, implicit-play, gzipped-messages 2007 Server: PhonyServer/1.0 2009 Note that some of the feature-tags in Require and Proxy-Require are 2010 necessarily fictional features (one would hope that we would not 2011 purposefully overlook a truly useful feature just so that we could 2012 have a strong example in this section). 2014 11.2 DESCRIBE 2016 The DESCRIBE method is used to retrieve the description of a | 2017 presentation or media object from a server. The request URL of the | 2018 DESCRIBE request identifies the media resource of interest. The | 2019 client MAY include the Accept header in the request to list the | 2020 description formats that it understands. The server SHALL respond | 2021 with a description of the requested resource and return the | 2022 description in the entity of the response. The DESCRIBE reply- 2023 response pair constitutes the media initialization phase of RTSP. 2025 Example: 2027 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/1.0 2028 CSeq: 312 2029 User-Agent: PhonyClient 1.2 2030 Accept: application/sdp, application/rtsl, application/mheg 2032 S->C: RTSP/1.0 200 OK 2033 CSeq: 312 2034 Date: 23 Jan 1997 15:35:06 GMT 2035 Server: PhonyServer 1.0 2036 Content-Type: application/sdp 2037 Content-Length: 376 2039 v=0 2040 o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4 2041 s=SDP Seminar 2042 i=A Seminar on the session description protocol 2043 u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps 2044 e=mjh@isi.edu (Mark Handley) 2045 c=IN IP4 224.2.17.12/127 2046 t=2873397496 2873404696 2047 a=recvonly 2048 m=audio 3456 RTP/AVP 0 2049 m=video 2232 RTP/AVP 31 2050 m=application 32416 UDP WB 2051 a=orient:portrait 2053 The DESCRIBE response MUST contain all media initialization 2054 information for the resource(s) that it describes. Servers SHOULD NOT | 2055 use the DESCRIBE response as a means of media indirection. | 2057 By forcing a DESCRIBE response to contain all media | 2058 initialization for the set of streams that it describes, | 2059 and discouraging use of DESCRIBE for media indirection, we | 2060 avoid looping problems that might result from other | 2061 approaches. | 2063 Media initialization is a requirement for any RTSP-based system, but | 2064 the RTSP specification does not dictate that this must be done via | 2065 the DESCRIBE method. There are four ways that an RTSP client may | 2066 receive initialization information: | 2068 o via a RTSP DESCRIBE method | 2070 o via some other protocol (HTTP, email attachment, etc.) | 2072 o via the command line or standard input | 2074 If a client obtains a valid description from an alternate source, the 2075 client MAY use this description for initialization purposes without 2076 issuing a DESCRIBE request for the same media. 2078 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2079 and highly recommended that minimal clients support the ability to | 2080 act as "helper applications" that accept a media initialization file | 2081 from standard input, command line, and/or other means that are | 2082 appropriate to the operating environment of the clients. 2084 11.3 SETUP 2086 The SETUP request for a URL specifies the transport mechanism to be | 2087 used for the streamed media. The SETUP method may be used in three | 2088 different cases; Create a RTSP session, add a media to a session, and | 2089 change the transport parameters of already set up media stream. Using | 2090 SETUP to create or add media to a session when in PLAY state is | 2091 unspecified. Otherwise SETUP can be used in all three states; INIT, | 2092 and READY, for both purposes and in PLAY to change the transport | 2093 parameters. 2095 The Transport header, see section 14.43, specifies the transport 2096 parameters acceptable to the client for data transmission; the 2097 response will contain the transport parameters selected by the 2098 server. This allows the client to enumerate in priority order the 2099 transport mechanisms and parameters acceptable to it, while the 2100 server can select the most appropriate. It is expected that the 2101 session description format used will enable the client to select a 2102 limited number possible configurations that are offered to the server 2103 to choose from. All transport parameters SHOULD be included in the 2104 Transport header, the use of other headers for this purpose is 2105 discouraged due to middle boxes. 2107 For the benefit of any intervening firewalls, a client SHOULD 2108 indicate the transport parameters even if it has no influence over 2109 these parameters, for example, where the server advertises a fixed 2110 multicast address. 2112 Since SETUP includes all transport initialization 2113 information, firewalls and other intermediate network 2114 devices (which need this information) are spared the more 2115 arduous task of parsing the DESCRIBE response, which has 2116 been reserved for media initialization. 2118 In a SETUP response the server SHOULD include the Accept-Ranges 2119 header (see section 14.5 to indicate which time formats that are 2120 acceptable to use for this media resource. 2122 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/1.0 2123 CSeq: 302 2124 Transport: RTP/AVP;unicast;client_port=4588-4589, 2125 RTP/AVP/TCP;unicast;interleaved=0-1 2127 S->C: RTSP/1.0 200 OK 2128 CSeq: 302 2129 Date: 23 Jan 1997 15:35:06 GMT 2130 Server: PhonyServer 1.0 2131 Session: 47112344;timeout=60 2132 Transport: RTP/AVP;unicast;client_port=4588-4589; 2133 server_port=6256-6257;ssrc=2A3F93ED 2134 Accept-Ranges: NPT 2136 In the above example the client want to create a RTSP session 2137 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2138 The transport parameters acceptable to the client is either 2139 RTP/AVP/UDP (UDP per default) to be received on client port 4588 and 2140 4589 or RTP/AVP interleaved on the RTSP control channel. The server 2141 selects the RTP/AVP/UDP transport and adds the ports it will send and 2142 received RTP and RTCP from, and the RTP SSRC that will be used by the 2143 server. 2145 The server MUST generate a session identifier in response to a 2146 successful SETUP request, unless a SETUP request to a server includes 2147 a session identifier, in which case the server MUST bundle this setup 2148 request into the existing session (aggregated session) or return 2149 error 459 (Aggregate Operation Not Allowed) (see Section 13.4.11). 2150 An Aggregate control URL MUST be used to control an aggregated 2151 session. This URL MUST be different from the stream control URLs of 2152 the individual media streams included in the aggregate. The Aggregate 2153 control URL is to be specified by the session description if the 2154 server supports aggregated control and aggregated control is desired 2155 for the session. However even if aggregated control is offered the 2156 client MAY chose to not set up the session in aggregated control. If 2157 an Aggregate control URL is not specified in the session description, 2158 it is normally an indication that non-aggregated control should be 2159 used. The SETUP of media streams in an aggregate which has not been 2160 given an aggregated control URL is unspecified. 2162 While the session ID sometimes has enough information for 2163 aggregate control of a session, the Aggregate control URL 2164 is still important for some methods such as SET_PARAMETER 2165 where the control URL enables the resource in question to 2166 be easily identified. The Aggregate control URL is also 2167 useful for proxies, enabling them to route the request to 2168 the appropriate server, and for logging, where it is useful 2169 to note the actual resource that a request was operating 2170 on. Finally, presence of the Aggregate control URL allows 2171 for backwards compatibility with RFC 2326 [1]. 2173 A session will exist until it is either removed by a TEARDOWN request 2174 or is timed-out by the server. The server MAY remove a session that 2175 has not demonstrated liveness signs from the client within a certain 2176 timeout period. The default timeout value is 60 seconds; the server 2177 MAY set this to a different value and indicate so in the timeout 2178 field of the Session header in the SETUP response. For further 2179 discussion see chapter 14.40. Signs of liveness for a RTSP session 2180 are: 2182 o Any RTSP request from a client which includes a Session header 2183 with that session's ID. 2185 o If RTP is used as a transport for the underlying media 2186 streams, an RTCP sender or receiver report from the client for 2187 any of the media streams in that RTSP session. 2189 If a SETUP request on a session fails for any reason, the session 2190 state, as well as transport and other parameters for associated 2191 streams SHALL remain unchanged from their values as if the SETUP 2192 request had never been received by the server. 2194 A client MAY issue a SETUP request for a stream that is already set 2195 up or playing in the session to change transport parameters, which a 2196 server MAY allow. If it does not allow this, it MUST respond with 2197 error 455 (Method Not Valid In This State). Reasons to support 2198 changing transport parameters, is to allow for application layer 2199 mobility and flexibility to utilize the best available transport as 2200 it becomes available. 2202 In a SETUP response for a request to change the transport parameters 2203 while in Play state, the server SHOULD include the Range to indicate 2204 from what point the new transport parameters are used. Further if RTP 2205 is used for delivery the server SHOULD also include the RTP-Info 2206 header to indicate from what timestamp and RTP sequence number the 2207 change has taken place. If both RTP-Info and Range is included in the 2208 response the "rtp_time" parameter and range MUST be for the 2209 corresponding time, i.e. be used in the same way as for PLAY to 2210 ensure the correct synchronization information is present. 2212 If the transport parameter change while in PLAY state results in a 2213 change of synchronization related information, for example changing 2214 RTP SSRC, the server MUST provide in the SETUP response the necessary 2215 synchronization information. However the server is RECOMMENDED to 2216 avoid changing the synchronization information if possible. 2218 11.4 PLAY 2220 The PLAY method tells the server to start sending data via the 2221 mechanism specified in SETUP. A client MUST NOT issue a PLAY request 2222 until any outstanding SETUP requests have been acknowledged as 2223 successful. PLAY requests are valid when the session is in READY 2224 state; the use of PLAY requests when the session is in PLAY state is 2225 deprecated. A PLAY request MUST include a Session header to indicate 2226 which session the request applies to. 2228 In an aggregated session the PLAY request MUST contain an aggregated 2229 control URL. A server SHALL responde with error 460 (Only Aggregate 2230 Operation Allowed) if the client PLAY request URL is for one of the 2231 media. The media in an aggregate SHALL be played in sync. If a client 2232 want individual control of the media it must use separate RTSP 2233 sessions for each media. 2235 The PLAY request SHALL position the normal play time to the beginning 2236 of the range specified by the Range header and delivers stream data 2237 until the end of the range if given, else to the end of the media is 2238 reached. To allow for precise composition multiple ranges MAY be 2239 specified in one PLAY Request. The range values are valid if all 2240 given ranges are part of any media within the aggregate. If a given 2241 range value points outside of the media, the response SHALL be the 2242 457 (Invalid Range) error code. 2244 The below example will first play seconds 10 through 15, then, 2245 immediately following, seconds 20 to 25, and finally seconds 30 2246 through the end. 2248 C->S: PLAY rtsp://audio.example.com/audio RTSP/1.0 2249 CSeq: 835 2250 Session: 12345678 2251 Range: npt=10-15, npt=20-25, npt=30- 2253 See the description of the PAUSE request for further examples. 2255 A PLAY request without a Range header is legal. It SHALL start 2256 playing a stream from the beginning (npt=0-) unless the stream has 2257 been paused. If a stream has been paused via PAUSE, stream delivery 2258 resumes at the pause point. The stream SHALL play until the end of 2259 the media. 2261 The Range header MUST NOT contain a time parameter. The usage of time 2262 in PLAY method has been deprecated. If a request with time parameter 2263 is received the server SHOULD respond with a 457 (Invalid Range) to 2264 indicate that the time parameter is not supported. 2266 Server MUST include a "Range" header in any PLAY response. The 2267 response MUST use the same format as the request's range header 2268 contained. If no Range header was in the request, the NPT time format 2269 SHOULD be used unless the client showed support for an other format 2270 more appropriate. Also for a session with live media streams the 2271 Range header MUST indicate a valid time. It is RECOMMENDED that 2272 normal play time is used, either the "now" indicator, for example 2273 "npt=now-", or the time since session start as an open interval, e.g. 2274 "npt=96.23-". An absolute time value (clock) for the corresponding 2275 time MAY be given, i.e. "clock=20030213T143205Z-". The UTC clock 2276 format SHOULD only be used if client has shown support for it. 2278 A media server only supporting playback MUST support the npt format 2279 and MAY support the clock and smpte formats. 2281 For a on-demand stream, the server MUST reply with the actual range | 2282 that will be played back, i.e. for which duration all media having | 2283 content at this time is delivered. This may differ from the requested | 2284 range if alignment of the requested range to valid frame boundaries | 2285 is required for the media source. Note that some media streams in an | 2286 aggregate may need to be delivered from even earlier points. Also | 2287 some media format has very long duration per individual data unit, | 2288 therefore it might be necessary for the client to parse the data | 2289 unit, and select where to start. | 2291 Example: Single audio stream (MIDI) | 2293 C->S: PLAY rtsp://example.com/audio RTSP/1.0 | 2294 CSeq: 836 | 2295 Session: 12345678 | 2296 Range: npt=7.05- | 2298 S->C: RTSP/1.0 200 OK | 2299 CSeq: 836 | 2300 Date: 23 Jan 1997 15:35:06 GMT | 2301 Server: PhonyServer 1.0 | 2302 Range: npt=3.52- | 2303 RTP-Info:url=rtsp://example.com/audio; | 2304 seq=14783;rtptime=2345962545 | 2306 S->C: RTP Packet TS=2345962545 => NPT=3.52 | 2307 Duration: 4.15 seconds | 2309 In this example the client receives the first media packet that | 2310 stretches all the way up and past the requested playtime. Thus it is | 2311 a client decision if it desires to render to the user the time | 2312 between 3.52 and 7.05 that the user requested. In most cases it is | 2313 probably suitable to not render that time period. | 2315 For live media sources it might be impossible to specify from which | 2316 point in time all media streams that has active content can actually | 2317 be delivered. Therefore a server MAY specify a start time (or now-) | 2318 in the range header, for which not all media will be available from. 2320 If no range is specified in the request, the start position SHALL 2321 still be returned in the reply. If the medias that are part of an 2322 aggregate has different lengths, the PLAY request SHALL be performed 2323 as long as the given range is valid for any media, for example the 2324 longest media. Media will be sent whenever it is available for the 2325 given play-out point. 2327 A PLAY response MAY include a header(s) carrying synchronization | 2328 information. As the information necessary is dependent on the media | 2329 transport format, further rules specifying the header and its usage | 2330 is needed. For RTP the RTP-Info header is specified, see section | 2331 14.36. 2333 After playing the desired range, the presentation is NOT 2334 automatically paused, media delivery simply stops. A PAUSE request 2335 MUST be issued before another PLAY request can be issued. Note: This 2336 is one change resulting in a non-operability with RFC 2326 2337 implementations. A client not issuing a PAUSE request before a new 2338 PLAY will be stuck in PLAY state. To mitigate this backwards 2339 compatibility issue the following behavior is recommended. If a 2340 server receives a PLAY request when in play state and all media has 2341 finished the requested play out, the server MAY interpret this as a 2342 PLAY request received in ready state. However the server SHALL NOT do 2343 this if the client has shown any support for this specification, for 2344 example by sending a Supported header with the play.basic feature 2345 tag. 2347 A client desiring to play the media from the beginning MUST send a 2348 PLAY request with a Range header pointing at the beginning, e.g. 2349 npt=0-. If a PLAY request is received without a Range header when 2350 media delivery has stopped at the end, the server SHOULD respond with 2351 a 457 "Invalid Range" error response. In that response the current 2352 pause point in a Range header SHALL be included. 2354 The following example plays the whole presentation starting at SMPTE 2355 time code 0:10:20 until the end of the clip. Note: The RTP-Info 2356 headers has been broken into several lines to fit the page. 2358 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/1.0 2359 CSeq: 833 2360 Session: 12345678 2361 Range: smpte=0:10:20- 2363 S->C: RTSP/1.0 200 OK 2364 CSeq: 833 2365 Date: 23 Jan 1997 15:35:06 GMT 2366 Server: PhonyServer 1.0 2367 Range: smpte=0:10:22-0:15:45 2368 RTP-Info:url=rtsp://example.com/twister.en; 2369 seq=14783;rtptime=2345962545 2371 For playing back a recording of a live presentation, it may be 2372 desirable to use clock units: 2374 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/1.0 2375 CSeq: 835 2376 Session: 12345678 2377 Range: clock=19961108T142300Z-19961108T143520Z 2379 S->C: RTSP/1.0 200 OK 2380 CSeq: 835 2381 Date: 23 Jan 1997 15:35:06 GMT 2382 Server:PhonyServer 1.0 2383 Range: clock=19961108T142300Z-19961108T143520Z 2384 RTP-Info:url=rtsp://example.com/meeting.en; 2385 seq=53745;rtptime=484589019 2387 All range specifiers in this specification allow for ranges with 2388 unspecified begin times (e.g. "npt=-30"). When used in a PLAY 2389 request, the server treats this as a request to start/resume playback 2390 from the current pause point, ending at the end time specified in the 2391 Range header. If the pause point is located later than the given end 2392 value, a 457 (Invalid Range) response SHALL be given. 2394 The queued play functionality described in RFC 2326 [1] is removed 2395 and multiple ranges can be used to achieve a similar functionality. 2396 If a server receives a PLAY request while in the PLAY state, the 2397 server SHALL responde using the error code 455 (Method Not Valid In 2398 This State). This will signal the client that queued play are not 2399 supported. 2401 The use of PLAY for keep-alive signaling, i.e. PLAY request without a 2402 range header in PLAY state, has also been depreciated. Instead a 2403 client can use, PING, SET_PARAMETER or OPTIONS for keep alive. A 2404 server receiving a PLAY keep alive SHALL respond with the 455 error 2405 code. 2407 11.5 PAUSE 2409 The PAUSE request causes the stream delivery to be interrupted 2410 (halted) temporarily. A PAUSE request MUST be done with the 2411 aggregated control URL for aggregated sessions, resulting in all 2412 media being halted, or the media URL for non-aggregated sessions. 2413 Any attempt to do muting of a single media with an PAUSE request in 2414 an aggregated session SHALL be responded with error 460 (Only 2415 Aggregate Operation Allowed). After resuming playback, 2416 synchronization of the tracks MUST be maintained. Any server 2417 resources are kept, though servers MAY close the session and free 2418 resources after being paused for the duration specified with the 2419 timeout parameter of the Session header in the SETUP message. 2421 Example: 2423 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 2424 CSeq: 834 2425 Session: 12345678 2427 S->C: RTSP/1.0 200 OK 2428 CSeq: 834 2429 Date: 23 Jan 1997 15:35:06 GMT 2430 Range: npt=45.76- 2432 The PAUSE request MAY contain a Range header specifying when the 2433 stream or presentation is to be halted. We refer to this point as the 2434 "pause point". The time parameter in the Range MUST NOT be used. The 2435 Range header MUST contain a single value, expressed as the beginning 2436 value an open range. For example, the following clip will be played 2437 from 10 seconds through 21 seconds of the clip's normal play time, 2438 under the assumption that the PAUSE request reaches the server within 2439 11 seconds of the PLAY request. Note that some lines has been broken 2440 in an non-correct way to fit the page: 2442 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/1.0 2443 CSeq: 834 2444 Session: 12345678 2445 Range: npt=10-30 2447 S->C: RTSP/1.0 200 OK 2448 CSeq: 834 2449 Date: 23 Jan 1997 15:35:06 GMT 2450 Server: PhonyServer 1.0 2451 Range: npt=10-30 2452 RTP-Info:url=rtsp://example.com/fizzle/audiotrack; 2453 seq=5712;rtptime=934207921, 2454 url=rtsp://example.com/fizzle/videotrack; 2455 seq=57654;rtptime=2792482193 2456 Session: 12345678 2458 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 2459 CSeq: 835 2460 Session: 12345678 2461 Range: npt=21- 2463 S->C: RTSP/1.0 200 OK 2464 CSeq: 835 2465 Date: 23 Jan 1997 15:35:09 GMT 2466 Server: PhonyServer 1.0 2467 Range: npt=21- 2468 Session: 12345678 2470 The pause request becomes effective the first time the server is 2471 encountering the time point specified in any of the multiple ranges. 2472 If the Range header specifies a time outside any range from the PLAY 2473 request, the error 457 (Invalid Range) SHALL be returned. If a media 2474 unit (such as an audio or video frame) starts presentation at exactly 2475 the pause point, it is not played. If the Range header is missing, 2476 stream delivery is interrupted immediately on receipt of the message 2477 and the pause point is set to the current normal play time. However, 2478 the pause point in the media stream MUST be maintained. A subsequent 2479 PLAY request without Range header SHALL resume from the pause point 2480 and play until media end. 2482 If the server has already sent data beyond the time specified in the 2483 PAUSE request's Range header, a PLAY without range SHALL resume at 2484 the point in time specified by the PAUSE request's Range header, as 2485 it is assumed that the client has discarded data after that point. 2486 This ensures continuous pause/play cycling without gaps. 2488 The pause point after any PAUSE request SHALL be returned to the 2489 client by adding a Range header with what remains unplayed of the 2490 PLAY request's ranges, i.e. including all the remaining ranges part 2491 of multiple range specification. If one desires to resume playing a 2492 ranged request, one simply includes the Range header from the PAUSE 2493 response. Note that this server behavior was not mandated previously 2494 and servers implementing according to RFC 2326 will probably not 2495 return the range header. 2497 For example, if the server have a play request for ranges 10 to 15 2498 and 20 to 29 pending and then receives a pause request for NPT 21, it 2499 would start playing the second range and stop at NPT 21. If the pause 2500 request is for NPT 12 and the server is playing at NPT 13 serving the 2501 first play request, the server stops immediately. If the pause 2502 request is for NPT 16, the server returns a 457 error message. To 2503 prevent that the second range is played and the server stops after 2504 completing the first range, a PAUSE request for 20 must be issued. 2506 As another example, if a server has received requests to play ranges 2507 10 to 15 and then 13 to 20 (that is, overlapping ranges), the PAUSE 2508 request for NPT=14 would take effect while the server plays the first 2509 range, with the second range effectively being ignored, assuming the 2510 PAUSE request arrives before the server has started playing the 2511 second, overlapping range. Regardless of when the PAUSE request 2512 arrives, it sets the pause point to 14. The below example messages is 2513 for the above case when the PAUSE request arrives before the first 2514 occurrence of NPT=14. 2516 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/1.0 2517 CSeq: 834 2518 Session: 12345678 2519 Range: npt=10-15, npt=13-20 2521 S->C: RTSP/1.0 200 OK 2522 CSeq: 834 2523 Date: 23 Jan 1997 15:35:06 GMT 2524 Server: PhonyServer 1.0 2525 Range: npt=10-15, npt=13-20 2526 RTP-Info:url=rtsp://example.com/fizzle/audiotrack; 2527 seq=5712;rtptime=934207921, 2528 url=rtsp://example.com/fizzle/videotrack; 2529 seq=57654;rtptime=2792482193 2530 Session: 12345678 2532 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 2533 CSeq: 835 2534 Session: 12345678 2535 Range: npt=14- 2537 S->C: RTSP/1.0 200 OK 2538 CSeq: 835 2539 Date: 23 Jan 1997 15:35:09 GMT 2540 Server: PhonyServer 1.0 2541 Range: npt=14-15, npt=13-20 2542 Session: 12345678 2544 If a client issues a PAUSE request and the server acknowledges and 2545 enters the READY state, the proper server response, if the player 2546 issues another PAUSE, is still 200 OK. The 200 OK response MUST 2547 include the Range header with the current pause point, even if the 2548 PAUSE request is asking for some other pause point. See examples 2549 below: 2551 Examples: 2553 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 2554 CSeq: 834 2555 Session: 12345678 2557 S->C: RTSP/1.0 200 OK 2558 CSeq: 834 2559 Session: 12345678 2560 Date: 23 Jan 1997 15:35:06 GMT 2561 Range: npt=45.76-98.36 2563 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 2564 CSeq: 835 2565 Session: 12345678 2566 Range: 86- 2568 S->C: RTSP/1.0 200 OK 2569 CSeq: 835 2570 Session: 12345678 2571 Date: 23 Jan 1997 15:35:07 GMT 2572 Range: npt=45.76-98.36 2574 11.6 TEARDOWN 2576 The TEARDOWN client to server request stops the stream delivery for 2577 the given URL, freeing the resources associated with it. TEARDOWN 2578 MAY be done using either an aggregated or a media control URL. 2579 However some restrictions apply depending on the current state. The 2580 TEARDOWN request SHALL contain a Session header indicating what 2581 session the request applies to. 2583 A TEARDOWN using the aggregated control URL or the media URL in a 2584 session under non-aggregated control MAY be done in any state (Ready, 2585 and Play). A successful request SHALL result in that media delivery 2586 is immediately halted and the session state is destroyed. This SHALL 2587 be indicated through the lack of a Session header in the response. 2589 A TEARDOWN using a media URL in an aggregated session MAY only be | 2590 done in Ready state. Such a request only removes the indicated media | 2591 stream and associated resources from the session. This may result in | 2592 that a session returns to non-aggregated control, due to that it only | 2593 contains a single media after the requests completion. In the | 2594 response to TEARDOWN request resulting in that the session still | 2595 exist SHALL contain a Session header to indicate this. 2597 Note, the indication with the session header if sessions state remain 2598 may not be done correctly by a RFC 2326 client, but will be for any 2599 server signalling the "play.basic" tag. 2601 Example: 2603 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/1.0 2604 CSeq: 892 2605 Session: 12345678 2607 S->C: RTSP/1.0 200 OK 2608 CSeq: 892 2609 Server: PhonyServer 1.0 2611 11.7 GET_PARAMETER 2612 The GET_PARAMETER request retrieves the value of a parameter or 2613 parameters for a presentation or stream specified in the URL. If the 2614 Session header is present in a request, the value of a parameter MUST 2615 be retrieved in the specified session context. The content of the 2616 reply and response is left to the implementation. 2618 The method MAY also be used without a body (entity). If the this 2619 request is successful, i.e. a 200 OK response is received, then the 2620 keep-alive time has been updated. Any non-required header present in 2621 such a request, may or may not been processed. The allow a client to 2622 determine if any such header has been processed, it is necessary to 2623 use a feature tag and the Require header. Due to this reason it is 2624 RECOMMENDED that any parameters to be retrieved are sent in the body, 2625 rather than using any header. 2627 Example: 2629 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0 2630 CSeq: 431 2631 Content-Type: text/parameters 2632 Session: 12345678 2633 Content-Length: 15 2635 packets_received 2636 jitter 2638 C->S: RTSP/1.0 200 OK 2639 CSeq: 431 2640 Content-Length: 46 2641 Content-Type: text/parameters 2643 packets_received: 10 2644 jitter: 0.3838 2646 The "text/parameters" section is only an example type for 2647 parameter. This method is intentionally loosely defined 2648 with the intention that the reply content and response 2649 content will be defined after further experimentation. 2651 11.8 SET_PARAMETER 2653 This method requests to set the value of a parameter or a set of 2654 parameters for a presentation or stream specified by the URL. The 2655 method MAY also be used without a body (entity). If the this request 2656 is successful, i.e. a 200 OK response is received, then the keep- 2657 alive time has been updated. Any non-required header present in such 2658 a request, may or may not been processed. The allow a client to 2659 determine if any such header has been processed, it is necessary to 2660 use a feature tag and the Require header. Due to this reason it is 2661 RECOMMENDED that any parameters are sent in the body, rather than 2662 using any header. 2664 A request is RECOMMENDED to only contain a single parameter to allow 2665 the client to determine why a particular request failed. If the 2666 request contains several parameters, the server MUST only act on the 2667 request if all of the parameters can be set successfully. A server 2668 MUST allow a parameter to be set repeatedly to the same value, but it 2669 MAY disallow changing parameter values. If the receiver of the 2670 request does not understand or can locate a parameter error 451 2671 (Parameter Not Understood) SHALL be used. In the case a parameter is 2672 not allowed to change the error code 458 (Parameter Is Read-Only). 2673 The response body SHOULD contain only the parameters that has errors. 2674 Otherwise no body SHALL be returned. 2676 Note: transport parameters for the media stream MUST only be set with 2677 the SETUP command. 2679 Restricting setting transport parameters to SETUP is for 2680 the benefit of firewalls. 2682 The parameters are split in a fine-grained fashion so that 2683 there can be more meaningful error indications. However, it 2684 may make sense to allow the setting of several parameters 2685 if an atomic setting is desirable. Imagine device control 2686 where the client does not want the camera to pan unless it 2687 can also tilt to the right angle at the same time. 2689 Example: 2691 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0 2692 CSeq: 421 2693 Content-length: 20 2694 Content-type: text/parameters 2696 barparam: barstuff 2698 S->C: RTSP/1.0 451 Parameter Not Understood 2699 CSeq: 421 2700 Content-length: 10 2701 Content-type: text/parameters 2702 barparam 2704 The "text/parameters" section is only an example type for 2705 parameter. This method is intentionally loosely defined 2706 with the intention that the reply content and response 2707 content will be defined after further experimentation. 2709 11.9 REDIRECT 2711 The REDIRECT method is issued by a server to inform a client that it | 2712 MUST connect to another server location to access the resource | 2713 indicated by the Request URL. The presence of the Session header in a | 2714 REDIRECT request indicates the scope of the request, and determines | 2715 the specific semantics of the request. | 2717 A REDIRECT request with a Session header has end-to-end (i.e. server | 2718 to client) scope and applies only to the given session. Any | 2719 intervening proxies SHOULD NOT disconnect the control channel while | 2720 there are other remaining end-to-end sessions. The OPTIONAL Location | 2721 header, if included in such a request, SHALL contain a complete | 2722 absolute URL pointing to the resource to which the client SHOULD | 2723 reconnect. Specifically, the Location SHALL NOT contain just the host | 2724 and port. A client may receive a REDIRECT request with a Session | 2725 header, if and only if, an end-to-end session has been established. | 2727 A client may receive a REDIRECT request without a Session header at | 2728 any time when it has communication or a connection established with a | 2729 server. The scope of such a request is limited to the next-hop (i.e. | 2730 the RTSP agent in direct communication with the server) and applies, | 2731 as well, to the control connection between the next-hop RTSP agent | 2732 and the server. A REDIRECT request without a Session header indicates | 2733 that all sessions and pending requests being managed via the control | 2734 connection MUST be redirected. The OPTIONAL Location header, if | 2735 included in such a request, SHOULD contain an absolute URL with only | 2736 the host address and the OPTIONAL port number of the server to which | 2737 the RTSP agent SHOULD reconnect. Any intervening proxies SHOULD do | 2738 all of the following in the order listed: | 2740 1. respond to the REDIRECT request | 2742 2. disconnect the control channel from the requesting server | 2744 3. connect to the server at the given host address | 2745 4. pass the REDIRECT request to each applicable client | 2746 (typically those clients with an active session or an | 2747 unanswered request) | 2749 Note: The proxy is responsible for accepting REDIRECT responses from | 2750 its clients; these responses MUST NOT be passed on to either the | 2751 original server or the redirected server. | 2753 The lack of a Location header in any REDIRECT request is indicative | 2754 of the server no longer being able to fulfill the current request and | 2755 having no alternatives for the client to continue with its normal | 2756 operation. It is akin to a server initiated TEARDOWN that applies | 2757 both to sessions as well as the general connection associated with | 2758 that client. | 2760 When the Range header is not included in a REDIRECT request, the | 2761 client SHOULD perform the redirection immediately and return a | 2762 response to the server. The server can consider the session as | 2763 terminated and can free any associated state after it receives the | 2764 successful (2xx) response. The server MAY close the signalling | 2765 connection upon receiving the response and the client SHOULD close | 2766 the signalling connection after sending the 2xx response. The | 2767 exception to this is when the client has several sessions on the | 2768 server being managed by the given signalling connection. In this | 2769 case, the client SHOULD close the connection when it has received and | 2770 responded to REDIRECT requests for all the sessions managed by the | 2771 signalling connection. | 2773 If the OPTIONAL Range header is included in a REDIRECT request, it | 2774 indicates when the redirection shall take effect. The range value | 2775 MUST be an open ended single value, e.g. npt=59-, indicating the | 2776 play out time when redirection SHALL occur. Alternatively, a range | 2777 with a time= parameter indicates the wall clock time by when the | 2778 redirection MUST take place. When the time= parameter is present in | 2779 the range, any range value MUST be ignored even though it MUST be | 2780 syntactically correct. When the indicated redirect point is reached, | 2781 a client MUST issue a TEARDOWN request and SHOULD close the | 2782 signalling connection after receiving a 2xx response. The normal | 2783 connection considerations apply for the server. | 2785 The differentiation of REDIRECT requests with and without | 2786 range headers is to allow for clear and explicit state | 2787 handling. As the state in the server needs to be kept until | 2788 the point of redirection, the handling becomes more clear | 2789 if the client is required to TEARDOWN the session at the | 2790 redirect point. | 2792 After a REDIRECT request has been processed, a client that wants to | 2793 continue to send or receive media for the resource identified by the | 2794 request URL will have to establish a new session with the designated | 2795 host. If the URL given in the Location header is a valid resource | 2796 URL, a client SHOULD issue a DESCRIBE request for the URL. | 2798 Note: The media resource indicated by the Location header | 2799 can be either identical, slightly different or totally | 2800 different. This is the reason why a new DESCRIBE request | 2801 SHOULD be issued. If the Location header contains only a | 2802 host address, the client MAY assume that the media on the | 2803 new server is identical to the media on the old server, | 2804 i.e. all media configuration information from the old | 2805 session is still valid except for the host address. 2807 This example request redirects traffic for this session to the new 2808 server at the given absolute time: 2810 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/1.0 2811 CSeq: 732 2812 Location: rtsp://s2.example.com:8001 2813 Range: npt=0- ;time=19960213T143205Z 2814 Session: uZ3ci0K+Ld-M 2816 11.10 PING 2818 This method is a bi-directional mechanism for server or client 2819 liveness checking. It has no side effects. The issuer of the request 2820 MUST include a session header with the session ID of the session that 2821 is being checked for liveness. 2823 Prior to using this method, an OPTIONS method is RECOMMENDED to be 2824 issued in the direction which the PING method would be used. This 2825 method MUST NOT be used if support is not indicated by the Public 2826 header. Note: That an 501 (Not Implemented) response means that the 2827 keep-alive timer has not been updated. 2829 When a proxy is in use, PING with a * indicates a single-hop liveness 2830 check, whereas PING with a URL including an host address indicates an 2831 end-to-end liveness check. 2833 Example: 2835 C->S: PING * RTSP/1.0 2836 CSeq: 123 2837 Session:12345678 2839 S->C: RTSP/1.0 200 OK 2840 CSeq: 123 2841 Session:12345678 2843 12 Embedded (Interleaved) Binary Data 2845 Certain firewall designs and other circumstances may force a server 2846 to interleave RTSP messages and media stream data. This interleaving 2847 should generally be avoided unless necessary since it complicates 2848 client and server operation and imposes additional overhead. Also 2849 head of line blocking may cause problems. Interleaved binary data 2850 SHOULD only be used if RTSP is carried over TCP. 2852 Stream data such as RTP packets is encapsulated by an ASCII dollar 2853 sign (24 decimal), followed by a one-byte channel identifier, 2854 followed by the length of the encapsulated binary data as a binary, 2855 two-byte integer in network byte order. The stream data follows 2856 immediately afterwards, without a CRLF, but including the upper-layer 2857 protocol headers. Each $ block SHALL contain exactly one upper-layer 2858 protocol data unit, e.g., one RTP packet. 2860 0 1 2 3 2861 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 2862 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2863 | "$" = 24 | Channel ID | Length in bytes | 2864 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2865 : Length number of bytes of binary data : 2866 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2868 The channel identifier is defined in the Transport header with the 2869 interleaved parameter(Section 14.43). 2871 When the transport choice is RTP, RTCP messages are also interleaved 2872 by the server over the TCP connection. The usage of RTCP messages is 2873 indicated by including a range containing a second channel in the 2874 interleaved parameter of the Transport header, see section 14.43. If 2875 RTCP is used, packets SHALL be sent on the first available channel 2876 higher than the RTP channel. The channels are bi-directional and 2877 therefore RTCP traffic are sent on the second channel in both 2878 directions. 2880 RTCP is needed for synchronization when two or more streams 2881 are interleaved in such a fashion. Also, this provides a 2882 convenient way to tunnel RTP/RTCP packets through the TCP 2883 control connection when required by the network 2884 configuration and transfer them onto UDP when possible. 2886 C->S: SETUP rtsp://example.com/bar.file RTSP/1.0 2887 CSeq: 2 2888 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 2890 S->C: RTSP/1.0 200 OK 2891 CSeq: 2 2892 Date: 05 Jun 1997 18:57:18 GMT 2893 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 2894 Session: 12345678 2896 C->S: PLAY rtsp://example.com/bar.file RTSP/1.0 2897 CSeq: 3 2898 Session: 12345678 2900 S->C: RTSP/1.0 200 OK 2901 CSeq: 3 2902 Session: 12345678 2903 Date: 05 Jun 1997 18:59:15 GMT 2904 RTP-Info: url=rtsp://example.com/bar.file; 2905 seq=232433;rtptime=972948234 2907 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 2908 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 2909 S->C: $006{2 byte length}{"length" bytes RTCP packet} 2911 13 Status Code Definitions 2913 Where applicable, HTTP status [H10] codes are reused. Status codes 2914 that have the same meaning are not repeated here. See Table 4 for a 2915 listing of which status codes may be returned by which requests. All 2916 error messages, 4xx and 5xx MAY return a body containing further 2917 information about the error. 2919 13.1 Success 1xx 2921 13.1.1 100 Continue 2923 See, [H10.1.1]. 2925 13.2 Success 2xx 2927 13.3 Redirection 3xx 2929 The notation "3rr" indicates response codes from 300 to 399 inclusive 2930 which are meant for redirection. The response code 304 is excluded 2931 from this set, as it is not used for redirection. 2933 See [H10.3] for definition of status code 300 to 305. However 2934 comments are given for some to how they apply to RTSP. 2936 Within RTSP, redirection may be used for load balancing or 2937 redirecting stream requests to a server topologically closer to the 2938 client. Mechanisms to determine topological proximity are beyond the 2939 scope of this specification. 2941 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 2942 that they are used if necessary before a session is established, i.e. 2943 in response to DESCRIBE or SETUP. However in cases where a server is 2944 not able to send a REDIRECT request to the client, the server MAY 2945 need to resort to using 3rr responses to inform a client with a 2946 established session about the need for redirecting the session. If an 2947 3rr response is received for an request in relation to a established 2948 session, the client SHOULD send a TEARDOWN request for the session, 2949 and MAY reestablish the session using the resource indicated by the 2950 Location. 2952 If the the Location header is used in a response it SHALL contain an 2953 absolute URL pointing out the media resource the client is redirected 2954 to, the URL SHALL NOT only contain the host name. 2956 13.3.1 300 Multiple Choices 2958 13.3.2 301 Moved Permanently 2960 The request resource are moved permanently and resides now at the URL 2961 given by the location header. The user client SHOULD redirect 2962 automatically to the given URL. This response MUST NOT contain a 2963 message-body. 2965 13.3.3 302 Found 2966 The requested resource reside temporarily at the URL given by the 2967 Location header. The Location header MUST be included in the 2968 response. Is intended to be used for many types of temporary 2969 redirects, e.g. load balancing. It is RECOMMENDED that one set the 2970 reason phrase to something more meaningful than "Found" in these 2971 cases. The user client SHOULD redirect automatically to the given 2972 URL. This response MUST NOT contain a message-body. 2974 13.3.4 303 See Other 2976 This status code SHALL NOT be used in RTSP. However as it was allowed 2977 to use in RFC 2326 it is possible that such response may be received, 2978 in which case the behavior is undefined. 2980 13.3.5 304 Not Modified 2982 If the client has performed a conditional DESCRIBE or SETUP (see 2983 12.23) and the requested resource has not been modified, the server 2984 SHOULD send a 304 response. This response MUST NOT contain a 2985 message-body. 2987 The response MUST include the following header fields: 2989 o Date 2991 o ETag and/or Content-Location, if the header would have been 2992 sent in a 200 response to the same request. 2994 o Expires, Cache-Control, and/or Vary, if the field-value might 2995 differ from that sent in any previous response for the same 2996 variant. 2998 This response is independent for the DESCRIBE and SETUP requests. 2999 That is, a 304 response to DESCRIBE does NOT imply that the resource 3000 content is unchanged and a 304 response to SETUP does NOT imply that 3001 the resource description is unchanged. The ETag and If-Match headers 3002 may be used to link the DESCRIBE and SETUP in this manner. 3004 13.3.6 305 Use Proxy 3006 See [H10.3.6]. 3008 13.4 Client Error 4xx 3010 13.4.1 400 Bad Request 3012 The request could not be understood by the server due to malformed 3013 syntax. The client SHOULD NOT repeat the request without 3014 modifications [H10.4.1]. If the request does not have a CSeq header, 3015 the server MUST NOT include a CSeq in the response. 3017 13.4.2 405 Method Not Allowed 3019 The method specified in the request is not allowed for the resource 3020 identified by the request URL. The response MUST include an Allow 3021 header containing a list of valid methods for the requested resource. 3022 This status code is also to be used if a request attempts to use a 3023 method not indicated during SETUP, e.g., if a RECORD request is 3024 issued even though the mode parameter in the Transport header only 3025 specified PLAY. 3027 13.4.3 451 Parameter Not Understood 3029 The recipient of the request does not support one or more parameters 3030 contained in the request.When returning this error message the sender 3031 SHOULD return a entity body containing the offending parameter(s). 3033 13.4.4 452 reserved 3035 This error code was removed from RFC 2326 [1] and is obsolete. 3037 13.4.5 453 Not Enough Bandwidth 3039 The request was refused because there was insufficient bandwidth. 3040 This may, for example, be the result of a resource reservation 3041 failure. 3043 13.4.6 454 Session Not Found 3045 The RTSP session identifier in the Session header is missing, 3046 invalid, or has timed out. 3048 13.4.7 455 Method Not Valid in This State 3050 The client or server cannot process this request in its current 3051 state. The response SHOULD contain an Allow header to make error 3052 recovery easier. 3054 13.4.8 456 Header Field Not Valid for Resource 3056 The server could not act on a required request header. For example, 3057 if PLAY contains the Range header field but the stream does not allow 3058 seeking. This error message may also be used for specifying when the 3059 time format in Range is impossible for the resource. In that case the 3060 Accept-Ranges header SHOULD be returned to inform the client of which 3061 format(s) that are allowed. 3063 13.4.9 457 Invalid Range 3065 The Range value given is out of bounds, e.g., beyond the end of the 3066 presentation. 3068 13.4.10 458 Parameter Is Read-Only 3070 The parameter to be set by SET_PARAMETER can be read but not 3071 modified. When returning this error message the sender SHOULD return 3072 a entity body containing the offending parameter(s). 3074 13.4.11 459 Aggregate Operation Not Allowed 3076 The requested method may not be applied on the URL in question since 3077 it is an aggregate (presentation) URL. The method may be applied on a 3078 media URL. 3080 13.4.12 460 Only Aggregate Operation Allowed 3082 The requested method may not be applied on the URL in question since 3083 it is not an aggregate control (presentation) URL. The method may be 3084 applied on the aggregate control URL. 3086 13.4.13 461 Unsupported Transport 3088 The Transport field did not contain a supported transport 3089 specification. 3091 13.4.14 462 Destination Unreachable 3093 The data transmission channel could not be established because the 3094 client address could not be reached. This error will most likely be 3095 the result of a client attempt to place an invalid Destination 3096 parameter in the Transport field. 3098 13.4.15 470 Connection Authorization Required 3100 The secured connection attempt need user or client authorization 3101 before proceeding. The next hops certificate is included in this 3102 response in the Accept-Credentials header. 3104 13.4.16 471 Connection Credentials not accepted 3106 When performing a secure connection over multiple connections, a 3107 intermediary has refused to connect to the next hop and carry out the 3108 request due to unacceptable credentials for the used policy. 3110 13.5 Server Error 5xx 3111 13.5.1 551 Option not supported 3113 An feature-tag given in the Require or the Proxy-Require fields was 3114 not supported. The Unsupported header SHOULD be returned stating the 3115 feature for which there is no support. 3117 14 Header Field Definitions 3119 method direction object acronym Body 3120 _________________________________________________ 3121 DESCRIBE C -> S P,S DES r 3122 GET_PARAMETER C -> S, S -> C P,S GPR R,r 3123 OPTIONS C -> S P,S OPT 3124 S -> C 3125 PAUSE C -> S P,S PSE 3126 PING C -> S, S -> C P,S PNG 3127 PLAY C -> S P,S PLY 3128 REDIRECT S -> C P,S RDR 3129 SETUP C -> S S STP 3130 SET_PARAMETER C -> S, S -> C P,S SPR R,r 3131 TEARDOWN C -> S P,S TRD 3133 Table 8: Overview of RTSP methods, their direction, and what objects 3134 (P: presentation, S: stream) they operate on. Body notes if a method 3135 is allowed to carry body and in which direction, R = Request, 3136 r=response. Note: It is allowed for all error messages 4xx and 5xx to 3137 have a body 3139 The general syntax for header fields is covered in Section 4.2 This 3140 section lists the full set of header fields along with notes on 3141 meaning, and usage. The syntax definition for headers are present in 3142 section 18.2.3. Throughout this section, we use [HX.Y] to refer to 3143 Section X.Y of the current HTTP/1.1 specification RFC 2616 [4]. 3144 Examples of each header field are given. 3146 Information about header fields in relation to methods and proxy 3147 processing is summarized in Tables 9, 10, 11, and 12. 3149 The "where" column describes the request and response types in which 3150 the header field can be used. Values in this column are: 3152 R: header field may only appear in requests; 3154 r: header field may only appear in responses; 3155 2xx, 4xx, etc.: A numerical value or range indicates response 3156 codes with which the header field can be used; 3158 c: header field is copied from the request to the response. 3160 An empty entry in the "where" column indicates that the header field 3161 may be present in all requests and responses. 3163 The "proxy" column describes the operations a proxy may perform on a 3164 header field: 3166 a: A proxy can add or concatenate the header field if not 3167 present. 3169 m: A proxy can modify an existing header field value. 3171 d: A proxy can delete a header field value. 3173 r: A proxy must be able to read the header field, and thus this 3174 header field cannot be encrypted. 3176 The rest of the columns relate to the presence of a header field in a 3177 method. The method names when abbreviated, are according to table 8: 3179 c: Conditional; requirements on the header field depend on the 3180 context of the message. 3182 m: The header field is mandatory. 3184 m*: The header field SHOULD be sent, but clients/servers need to 3185 be prepared to receive messages without that header field. 3187 o: The header field is optional. 3189 *: The header field is required if the message body is not 3190 empty. See sections 14.15, 14.17 and 4.3 for details. 3192 -: The header field is not applicable. 3194 "Optional" means that a Client/Server MAY include the header field in 3195 a request or response. The Client/Server behavior when receiving such 3196 headers varies, for some it may ignore the header field, in other 3197 case it is request to process the header. This is regulated by the 3198 method and header descriptions. Example of such headers that require 3199 processing are the Require and Proxy-Require header fields discussed 3200 in 14.35 and 14.30. A "mandatory" header field MUST be present in a 3201 request, and MUST be understood by the Client/Server receiving the 3202 request. A mandatory response header field MUST be present in the 3203 response, and the header field MUST be understood by the 3204 Client/Server processing the response. "Not applicable" means that 3205 the header field MUST NOT be present in a request. If one is placed 3206 in a request by mistake, it MUST be ignored by the Client/Server 3207 receiving the request. Similarly, a header field labeled "not 3208 applicable" for a response means that the Client/Server MUST NOT 3209 place the header field in the response, and the Client/Server MUST 3210 ignore the header field in the response. 3212 A Client/Server SHOULD ignore extension header parameters that are 3213 not understood. 3215 The From, Location, and RTP-Info header fields contain a URL. If the 3216 URL contains a comma, or semicolon, the URL MUST be enclosed in 3217 double quotas ("). Any URL parameters are contained within these 3218 quotas. If the URL is not enclosed in double quotas, any semicolon- 3219 delimited parameters are header-parameters, not URL parameters. 3221 14.1 Accept 3223 The Accept request-header field can be used to specify certain 3224 presentation description content types which are acceptable for the 3225 response. 3227 The "level" parameter for presentation descriptions is 3228 properly defined as part of the MIME type registration, not 3229 here. 3231 See [H14.1] for syntax. 3233 Example of use: 3235 Accept: application/rtsl q=1.0, application/sdp 3237 14.2 Accept-Credentials 3239 The Accept-Credentials header has different usage in RTSP requests | 3240 and responses. In a request it is used to indicate to any trusted | 3241 intermediary how to handle further secured connections to proxies or | 3242 servers. In responses the header is used to carry the credentials of | 3243 Header Where Proxy DES OPT SETUP PLAY PAUSE TRD 3244 _____________________________________________________________ 3245 Accept R o - - - - - 3246 Accept-Credentials R r o o o o o o 3247 Accept-Credentials 470,407 ar o o o o o o 3248 Accept-Encoding R r o - - - - - 3249 Accept-Language R r o - - - - - 3250 Accept-Ranges r r - - o - - - 3251 Accept-Ranges 456 r - - - o o - 3252 Allow r - o - - - - 3253 Allow 405 m m m m m m 3254 Authorization R o o o o o o 3255 Bandwidth R o o o o - - 3256 Blocksize R o - o o - - 3257 Cache-Control r - - o - - - 3258 Connection o o o o o o 3259 Content-Base r o - - - - - 3260 Content-Base 4xx o o o o o o 3261 Content-Encoding R r - - - - - - 3262 Content-Encoding r r o - - - - - 3263 Content-Encoding 4xx r o o o o o o 3264 Content-Language R r - - - - - - 3265 Content-Language r r o - - - - - 3266 Content-Language 4xx r o o o o o o 3267 Content-Length r r * - - - - - 3268 Content-Length 4xx r * * * * * * 3269 Content-Location r o - - - - - 3270 Content-Location 4xx o o o o o o 3271 Content-Type r * - - - - - 3272 Content-Type 4xx * * * * * * 3273 CSeq Rc m m m m m m 3274 Date am o o o o o o 3275 ETag r r o - o - - - 3276 Expires r r o - - - - - 3277 From R r o o o o o o 3278 Host - - - - - - 3279 If-Match R r - - o - - - 3280 If-Modified-Since R r o - o - - - 3281 If-None-Match R r o - - - - - 3282 Last-Modified r r o - - - - - 3283 Location 3rr o o o o o o 3285 Table 9: Overview of RTSP header fields (A-L) related to methods 3286 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 3288 Header Where Proxy DES OPT SETUP PLAY PAUSE TRD 3289 _____________________________________________________________ 3290 Proxy-Authenticate 407 amr m m m m m m 3291 Proxy-Require R ar o o o o o o 3292 Public r admr - m* - - - - 3293 Public 501 admr m* m* m* m* m* m* 3294 Range R - - - o o - 3295 Range r - - c m* m* - 3296 Referer R o o o o o o 3297 Require R o o o o o o 3298 Retry-After 3rr,503 o o o - - - 3299 RTP-Info r - - o c - - 3300 Scale - - - o - - 3301 Session R - o o m m m 3302 Session r - c m m m o 3303 Server R - o - - - - 3304 Server r o o o o o o 3305 Speed - - - o - - 3306 Supported R o o o o o o 3307 Supported r c c c c c c 3308 Timestamp R o o o o o o 3309 Timestamp c m m m m m m 3310 Transport - - m - - - 3311 Unsupported r c c c c c c 3312 User-Agent R m* m* m* m* m* m* 3313 Vary r c c c c c c 3314 Via R amr o o o o o o 3315 Via c dr m m m m m m 3316 WWW-Authenticate 401 m m m m m m 3318 _____________________________________________________________ 3319 Header Where Proxy DES OPT SETUP PLAY PAUSE TRD 3321 Table 10: Overview of RTSP header fields (P-W) related to methods 3322 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 3324 any next hop that need to be approved by the requestor. See section | 3325 17 for the usage of this header. It SHALL only be included in client | 3326 to server requests, and server to client responses. | 3328 In a request the header SHALL contain the method (User, Proxy, or | 3329 Any) for approving credentials selected by the requestor. The method | 3330 SHALL NOT be changed by any proxy. If the method is "User" the header | 3331 contains zero or more of credentials that the client accept. Each | 3332 credential SHALL consist of one URI identifying the proxy or server, | 3333 Header Where Proxy GPR SPR RDR PNG 3334 __________________________________________________ 3335 Accept-Credentials R r o o o o 3336 Accept-Credentials 470,407 ar o o o o 3337 Allow 405 m m m m 3338 Authorization R o o o o 3339 Bandwidth R - o - - 3340 Blocksize R - o - - 3341 Connection o o o - 3342 Content-Base R o o - - 3343 Content-Base r o o - - 3344 Content-Base 4xx o o o - 3345 Content-Encoding R r o o - - 3346 Content-Encoding r r o o - - 3347 Content-Encoding 4xx r o o o - 3348 Content-Language R r o o - - 3349 Content-Language r r o o - - 3350 Content-Language 4xx r o o o - 3351 Content-Length R r * * - - 3352 Content-Length r r * * - - 3353 Content-Length 4xx r * * * - 3354 Content-Location R o o - - 3355 Content-Location r o o - - 3356 Content-Location 4xx o o o - 3357 Content-Type R * * - - 3358 Content-Type r * * - - 3359 Content-Type 4xx * * * - 3360 CSeq Rc m m m m 3361 Date am o o o o 3362 From R r o o o o 3363 Host - - - - 3364 Last-Modified R r - - - - 3365 Last-Modified r r o - - - 3366 Location 3rr o o o o 3367 Location R - - m - 3368 Proxy-Authenticate 407 amr m m m m 3369 Proxy-Require R ar o o o o 3370 Public 501 admr m* m* m* m* 3372 __________________________________________________ 3373 Header Where Proxy GPR SPR RDR PNG 3375 Table 11: Overview of RTSP header fields (A-P) related to methods 3376 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PING. 3378 Header Where Proxy GPR SPR RDR PNG 3379 ________________________________________________ 3380 Range R - - o - 3381 Referer R o o o - 3382 Require R o o o o 3383 Retry-After 3rr,503 o o - - 3384 Scale - - - - 3385 Session R o o o m 3386 Session r c c o m 3387 Server R o o o o 3388 Server r o o - o 3389 Supported R o o o o 3390 Supported r c c c c 3391 Timestamp R o o o o 3392 Timestamp c m m m m 3393 Unsupported r c c c c 3394 User-Agent R m* m* - m* 3395 User-Agent r - - m* - 3396 Vary r c c - - 3397 Via R amr o o o o 3398 Via c dr m m m m 3399 WWW-Authenticate 401 m m m m 3401 ________________________________________________ 3402 Header Where Proxy GPR SPR RDR PNG 3404 Table 12: Overview of RTSP header fields (R-W) related to methods 3405 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PING. 3407 and the SHA-1 [16] hash computed over that entity's DER encoded | 3408 certificate [17] in Base64 [38]. | 3410 The Accept-Credentials header in a RTSP response SHALL, if included, | 3411 contain the credentials information of the next hop that an | 3412 intermediary needs to securely connect to. The credential MUST | 3413 include the URI of the next proxy or server and the DER encoded | 3414 X.509v3 [17] certificate in base64 [38]. | 3416 Request Example: | 3417 Accept-Credentials:User, | 3418 "rtsps://proxy2.example.com/";exaIl9VMbQMOFGClx5rXnPJKVNI=, | 3419 "rtsps://server.example.com/";lurbjj5khhB0NhIuOXtt4bBRH1M= | 3421 Response Example: | 3422 Accept-Credentials:"rtsps://proxy2.example.com/";XmW+39x4XdTLp... | 3424 14.3 Accept-Encoding 3426 See [H14.3] 3428 14.4 Accept-Language 3430 See [H14.4]. Note that the language specified applies to the 3431 presentation description and any reason phrases, not the media 3432 content. 3434 14.5 Accept-Ranges 3436 The Accept-Ranges response-header field allows the server to indicate 3437 its acceptance of range requests and possible formats for a resource: 3439 Accept-Ranges: NPT, SMPTE 3441 This header has the same syntax as [H14.5] and the syntax is defined 3442 in 18.2.3. However new range-units are defined. Inclusion of any of 3443 the time formats indicates acceptance by the server for PLAY and 3444 PAUSE requests with this format. The headers value is valid for the 3445 resource specified by the URL in the request, this response 3446 corresponds to. A server SHOULD use this header in SETUP responses to 3447 indicate to the client which range time formats the media supports. 3448 The header SHOULD also be included in "456" responses which is a 3449 result of use of unsupported range formats. 3451 14.6 Allow 3453 The Allow entity-header field lists the methods supported by the 3454 resource identified by the request-URL. The purpose of this field is 3455 to strictly inform the recipient of valid methods associated with the 3456 resource. An Allow header field MUST be present in a 405 (Method Not 3457 Allowed) response. See [H14.7] for syntax definition. 3459 Example of use: 3461 Allow: SETUP, PLAY, SET_PARAMETER 3463 14.7 Authorization 3465 See [H14.8] 3467 14.8 Bandwidth 3469 The Bandwidth request-header field describes the estimated bandwidth 3470 available to the client, expressed as a positive integer and measured 3471 in bits per second. The bandwidth available to the client may change 3472 during an RTSP session, e.g., due to modem retraining. 3474 Example: 3476 Bandwidth: 4000 3478 14.9 Blocksize 3480 The Blocksize request-header field is sent from the client to the 3481 media server asking the server for a particular media packet size. 3482 This packet size does not include lower-layer headers such as IP, 3483 UDP, or RTP. The server is free to use a blocksize which is lower 3484 than the one requested. The server MAY truncate this packet size to 3485 the closest multiple of the minimum, media-specific block size, or 3486 override it with the media-specific size if necessary. The block size 3487 MUST be a positive decimal number, measured in octets. The server 3488 only returns an error (4xx) if the value is syntactically invalid. 3490 14.10 Cache-Control 3492 The Cache-Control general-header field is used to specify directives 3493 that MUST be obeyed by all caching mechanisms along the 3494 request/response chain. 3496 Cache directives must be passed through by a proxy or gateway 3497 application, regardless of their significance to that application, 3498 since the directives may be applicable to all recipients along the 3499 request/response chain. It is not possible to specify a cache- 3500 directive for a specific cache. 3502 Cache-Control should only be specified in a SETUP request and its 3503 response. Note: Cache-Control does not govern the caching of 3504 responses as for HTTP, instead it applies to the media stream 3505 identified by the SETUP request. The caching of RTSP requests are 3506 generally not cacheable, for further information see 15. Below is the 3507 description of the cache directives that can be included in the 3508 Cache-Control header. 3510 no-cache: Indicates that the media stream MUST NOT be cached 3511 anywhere. This allows an origin server to prevent caching 3512 even by caches that have been configured to return stale 3513 responses to client requests. 3515 public: Indicates that the media stream is cacheable by any 3516 cache. 3518 private: Indicates that the media stream is intended for a 3519 single user and MUST NOT be cached by a shared cache. A 3520 private (non-shared) cache may cache the media stream. 3522 no-transform: An intermediate cache (proxy) may find it useful 3523 to convert the media type of a certain stream. A proxy 3524 might, for example, convert between video formats to save 3525 cache space or to reduce the amount of traffic on a slow 3526 link. Serious operational problems may occur, however, 3527 when these transformations have been applied to streams 3528 intended for certain kinds of applications. For example, 3529 applications for medical imaging, scientific data analysis 3530 and those using end-to-end authentication all depend on 3531 receiving a stream that is bit-for-bit identical to the 3532 original media stream. Therefore, if a response includes 3533 the no-transform directive, an intermediate cache or proxy 3534 MUST NOT change the encoding of the stream. Unlike HTTP, 3535 RTSP does not provide for partial transformation at this 3536 point, e.g., allowing translation into a different 3537 language. 3539 only-if-cached: In some cases, such as times of extremely poor 3540 network connectivity, a client may want a cache to return 3541 only those media streams that it currently has stored, and 3542 not to receive these from the origin server. To do this, 3543 the client may include the only-if-cached directive in a 3544 request. If it receives this directive, a cache SHOULD 3545 either respond using a cached media stream that is 3546 consistent with the other constraints of the request, or 3547 respond with a 504 (Gateway Timeout) status. However, if a 3548 group of caches is being operated as a unified system with 3549 good internal connectivity, such a request MAY be forwarded 3550 within that group of caches. 3552 max-stale: Indicates that the client is willing to accept a 3553 media stream that has exceeded its expiration time. If 3554 max-stale is assigned a value, then the client is willing 3555 to accept a response that has exceeded its expiration time 3556 by no more than the specified number of seconds. If no 3557 value is assigned to max-stale, then the client is willing 3558 to accept a stale response of any age. 3560 min-fresh: Indicates that the client is willing to accept a 3561 media stream whose freshness lifetime is no less than its 3562 current age plus the specified time in seconds. That is, 3563 the client wants a response that will still be fresh for at 3564 least the specified number of seconds. 3566 must-revalidate: When the must-revalidate directive is present 3567 in a SETUP response received by a cache, that cache MUST 3568 NOT use the entry after it becomes stale to respond to a 3569 subsequent request without first revalidating it with the 3570 origin server. That is, the cache must do an end-to-end 3571 revalidation every time, if, based solely on the origin 3572 server's Expires, the cached response is stale.) 3574 proxy-revalidate: The proxy-revalidate directive has the same 3575 meaning as the must-revalidate directive, except that it 3576 does not apply to non-shared user agent caches. It can be 3577 used on a response to an authenticated request to permit 3578 the user's cache to store and later return the response 3579 without needing to revalidate it (since it has already been 3580 authenticated once by that user), while still requiring 3581 proxies that service many users to revalidate each time (in 3582 order to make sure that each user has been authenticated). 3583 Note that such authenticated responses also need the public 3584 cache control directive in order to allow them to be cached 3585 at all. 3587 max-age: When an intermediate cache is forced, by means of a 3588 max-age=0 directive, to revalidate its own cache entry, and 3589 the client has supplied its own validator in the request, 3590 the supplied validator might differ from the validator 3591 currently stored with the cache entry. In this case, the 3592 cache MAY use either validator in making its own request 3593 without affecting semantic transparency. 3595 However, the choice of validator might affect performance. 3596 The best approach is for the intermediate cache to use its 3597 own validator when making its request. If the server 3598 replies with 304 (Not Modified), then the cache can return 3599 its now validated copy to the client with a 200 (OK) 3600 response. If the server replies with a new entity and cache 3601 validator, however, the intermediate cache can compare the 3602 returned validator with the one provided in the client's 3603 request, using the strong comparison function. If the 3604 client's validator is equal to the origin server's, then 3605 the intermediate cache simply returns 304 (Not Modified). 3606 Otherwise, it returns the new entity with a 200 (OK) 3607 response. 3609 14.11 Connection 3611 See [H14.10]. The use of the connection option "close" in RTSP 3612 messages SHOULD be limited to error messages when the server is 3613 unable to recover and therefore see it necessary to close the 3614 connection. The reason is that the client shall have the choice of 3615 continue using a connection indefinitely as long as it sends valid 3616 messages. 3618 14.12 Content-Base 3620 The Content-Base entity-header field may be used to specify the base 3621 URL for resolving relative URLs within the entity. 3623 Content-Base: rtsp://media.example.com/movie/twister 3625 If no Content-Base field is present, the base URL of an entity is 3626 defined either by its Content-Location (if that Content-Location URL 3627 is an absolute URL) or the URL used to initiate the request, in that 3628 order of precedence. Note, however, that the base URL of the contents 3629 within the entity-body may be redefined within that entity-body. 3631 14.13 Content-Encoding 3633 See [H14.11] 3635 14.14 Content-Language 3637 See [H14.12] 3639 14.15 Content-Length 3641 The Content-Length general-header field contains the length of the 3642 content of the method (i.e. after the double CRLF following the last 3643 header). Unlike HTTP, it MUST be included in all messages that carry 3644 content beyond the header portion of the message. If it is missing, a 3645 default value of zero is assumed. It is interpreted according to 3646 [H14.13]. 3648 14.16 Content-Location 3650 See [H14.14] 3652 14.17 Content-Type 3654 See [H14.17]. Note that the content types suitable for RTSP are 3655 likely to be restricted in practice to presentation descriptions and 3656 parameter-value types. 3658 14.18 CSeq 3660 The CSeq general-header field specifies the sequence number for an 3661 RTSP request-response pair. This field MUST be present in all 3662 requests and responses. For every RTSP request containing the given 3663 sequence number, the corresponding response will have the same 3664 number. Any retransmitted request must contain the same sequence 3665 number as the original (i.e. the sequence number is not incremented 3666 for retransmissions of the same request). For each new RTSP request 3667 the CSeq value SHALL be incremented by one. The initial sequence 3668 number MAY be any number, however it is RECOMMENDED to start at 1. 3669 Each sequence number series is unique between each requester and 3670 responder, i.e. the client has one series for its request to a server 3671 and the server has another when sending request to the client. Each 3672 requester and responder is identified with its network address. 3674 Example: 3676 CSeq: 239 3678 14.19 Date 3680 See [H14.18]. An RTSP message containing a body MUST include a Date 3681 header if the sending host has a clock. Servers SHOULD include a Date 3682 header in all other RTSP messages. 3684 14.20 ETag | 3686 The ETag response header MAY be included in DESCRIBE or SETUP | 3687 responses. The entity tag returned in a DESCRIBE response is for the | 3688 included entity, while for SETUP it refers to the media resource just | 3689 set up. This differentiation allows for cache validation of both | 3690 session description and the media resource associated with the | 3691 description. If the ETag is provided both inside the entity, e.g. | 3692 within the "a=etag" attribute in SDP, and in the response message, | 3693 then both tags SHALL be identical. It is RECOMMENDED that the ETag is | 3694 primarily given in the RTSP response message, to ensure that caches | 3695 can use the ETag without requiring content inspection. | 3697 SETUP and DESCRIBE requests can be made conditional upon the ETag | 3698 using the headers If-Match (Section 14.24) and If-None-Match (Section | 3699 14.26). | 3701 14.21 Expires 3703 The Expires entity-header field gives a date and time after which the 3704 description or media-stream should be considered stale. The 3705 interpretation depends on the method: 3707 DESCRIBE response: The Expires header indicates a date and time 3708 after which the description SHOULD be considered stale. 3710 SETUP response: The Expires header indicate a date and time 3711 after which the media stream SHOULD be considered stale. 3713 A stale cache entry may not normally be returned by a cache (either a 3714 proxy cache or an user agent cache) unless it is first validated with 3715 the origin server (or with an intermediate cache that has a fresh 3716 copy of the entity). See section 15 for further discussion of the 3717 expiration model. 3719 The presence of an Expires field does not imply that the original 3720 resource will change or cease to exist at, before, or after that 3721 time. 3723 The format is an absolute date and time as defined by HTTP-date in 3724 [H3.3]; it MUST be in RFC1123-date format: 3726 An example of its use is 3728 Expires: Thu, 01 Dec 1994 16:00:00 GMT 3730 RTSP/1.0 clients and caches MUST treat other invalid date formats, 3731 especially including the value "0", as having occurred in the past 3732 (i.e., already expired). 3734 To mark a response as "already expired," an origin server should use 3735 an Expires date that is equal to the Date header value. To mark a 3736 response as "never expires," an origin server SHOULD use an Expires 3737 date approximately one year from the time the response is sent. 3738 RTSP/1.0 servers SHOULD NOT send Expires dates more than one year in 3739 the future. 3741 The presence of an Expires header field with a date value of some 3742 time in the future on a media stream that otherwise would by default 3743 be non-cacheable indicates that the media stream is cacheable, unless 3744 indicated otherwise by a Cache-Control header field (Section 14.10). 3746 14.22 From 3747 See [H14.22]. 3749 14.23 Host 3751 The Host HTTP request header field [H14.23] is not needed for RTSP, 3752 and SHALL NOT be sent. It SHALL be silently ignored if received. 3754 14.24 If-Match 3756 See [H14.24]. The If-Match request-header field is especially useful | 3757 for ensuring the integrity of the presentation description, in both | 3758 the case where it is fetched via means external to RTSP (such as | 3759 HTTP), or in the case where the server implementation is guaranteeing | 3760 the integrity of the description between the time of the DESCRIBE | 3761 message and the SETUP message. By including the ETag given in or with | 3762 the session description in a SETUP request, the client ensures that | 3763 resources set up are matching the description. A SETUP request for | 3764 which the ETag validation check fails, SHALL responde using 412 | 3765 (Precondition Failed). | 3767 This validation check is also very useful if a session has been | 3768 redirected from one server to another. | 3770 14.25 If-Modified-Since 3772 The If-Modified-Since request-header field is used with the DESCRIBE 3773 and SETUP methods to make them conditional. If the requested variant 3774 has not been modified since the time specified in this field, a 3775 description will not be returned from the server (DESCRIBE) or a 3776 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 3777 response SHALL be returned without any message-body. 3779 An example of the field is: 3781 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 3783 14.26 If-None-Match 3785 See [H14.26]. 3787 This request header can be used with entity tags to make DESCRIBE 3788 requests conditional. A new session description is retrieved only if 3789 another entity than the already available would be included. If the 3790 entity available for delivery is matching the one the client already 3791 has, then a 304 (Not Modified) response is given. 3793 14.27 Last-Modified 3795 The Last-Modified entity-header field indicates the date and time at 3796 which the origin server believes the presentation description or 3797 media stream was last modified. See [H14.29]. For the methods 3798 DESCRIBE, the header field indicates the last modification date and 3799 time of the description, for SETUP that of the media stream. 3801 14.28 Location 3803 See [H14.30]. 3805 14.29 Proxy-Authenticate 3807 See [H14.33]. 3809 14.30 Proxy-Require 3811 The Proxy-Require request-header field is used to indicate proxy- 3812 sensitive features that MUST be supported by the proxy. Any Proxy- 3813 Require header features that are not supported by the proxy MUST be 3814 negatively acknowledged by the proxy to the client using the 3815 Unsupported header. The proxy SHALL use the 551 (Option Not 3816 Supported) status code in the response. Any feature tag included in 3817 the Proxy-Require does not apply to the server. To ensure that a 3818 feature is supported by both proxies and servers the tag must be 3819 included in also a Require header. 3821 See Section 14.35 for more details on the mechanics of this message 3822 and a usage example. 3824 Example of use: 3826 Proxy-Require: play.basic 3828 14.31 Public 3830 The Public response header field lists the set of methods supported | 3831 by the response sender. This header applies to the general | 3832 capabilities of the sender and its only purpose is to indicate the | 3833 sender's capabilities to the recipient. The methods listed may or may 3834 not be applicable to the Request-URL; the Allow header field (section 3835 14.7) MAY be used to indicate methods allowed for a particular URL. 3837 Example of use: 3839 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 3841 In the event that there are proxies between the sender and the | 3842 recipient of a response, each intervening proxy MUST modify the | 3843 Public header field to remove any methods that are not supported via | 3844 that proxy. The resulting Public header field will contain an | 3845 intersection of the sender's methods and the methods allowed through | 3846 by the intervening proxies. | 3848 In general proxies should allow all methods to | 3849 transparently pass through from the sending RTSP agent to | 3850 the receiving RTSP agent, but there may be cases where this | 3851 is not desirable for a given proxy. Modification of the | 3852 Public response header field by the intervening proxies | 3853 ensures that the request sender gets an accurate response | 3854 indicating the methods that can be used on the target agent | 3855 via the proxy chain. 3857 14.32 Range 3859 The Range request and response header field specifies a range of 3860 time. The header is used in PLAY request to indicate the range of 3861 time the client desires the server to play back. The Range header in 3862 a PLAY indicates what range of time that is actually being played. In 3863 a SETUP response the header MAY be used, to ensure correct 3864 synchronization information after changes of transport parameters. 3866 The range can be specified in a number of units. This specification 3867 defines the smpte (Section 3.4), npt (Section 3.5), and clock 3868 (Section 3.6) range units. Within RTSP, byte ranges [H14.35.1] are 3869 normally not meaningful, and the behavior is unspecified, but they 3870 and other extended units MAY be used. Servers supporting the Range 3871 header MUST understand the NPT range format and SHOULD understand the 3872 SMPTE range format. If the Range header is given in a time format 3873 that is not understood, the recipient should return 456 (Header Field 3874 Not Valid for Resource) and include a Accept-Ranges header indicating 3875 which time format that is supported for this resource. 3877 The header MAY contain a time parameter in UTC, specifying the time 3878 at which the operation is to be made effective. This functionality 3879 SHALL only be used with the REDIRECT method. 3881 Ranges are half-open intervals, including the first point, but 3882 excluding the second point. In other words, a range of A-B starts 3883 exactly at time A, but stops just before B. Only the start time of a 3884 media unit such as a video or audio frame is relevant. As an example, 3885 assume that video frames are generated every 40 ms. A range of 3886 10.0-10.1 would include a video frame starting at 10.0 or later time 3887 and would include a video frame starting at 10.08, even though it 3888 lasted beyond the interval. A range of 10.0-10.08, on the other hand, 3889 would exclude the frame at 10.08. 3891 Example: 3893 Range: clock=19960213T143205Z-;time=19970123T143720Z 3895 The notation is similar to that used for the HTTP/1.1 [4] 3896 byte-range header. It allows clients to select an excerpt 3897 from the media object, and to play from a given point to 3898 the end as well as from the current location to a given 3899 point. The start of playback can be scheduled for any time 3900 in the future, although a server may refuse to keep server 3901 resources for extended idle periods. 3903 By default, range intervals increase, where the second point is 3904 larger than the first point. 3906 Example: 3908 Range: npt=10-15 3910 However, range intervals can also decrease if the Scale header (see 3911 section 14.37) indicates a negative scale value. For example, this 3912 would be the case when a playback in reverse is desired. 3914 Example: 3916 Scale: -1 3917 Range: npt=15-10 3919 Decreasing ranges are still half open intervals as described above. 3920 Thus, For range A-B, A is closed and B is open. In the above example, 3921 15 is closed and 10 is open. An exception to this rule is the case 3922 when B=0 in a decreasing range. In this case, the range is closed on 3923 both ends, as otherwise there would be no way to reach 0 on a reverse 3924 playback. 3926 Example: 3928 Scale: -1 3929 Range: npt=15-0 3931 In this range both 15 and 0 are closed. 3933 A decreasing range interval without a corresponding negative Scale 3934 header is not valid. 3936 14.33 Referer 3938 See [H14.36]. The URL refers to that of the presentation description, 3939 typically retrieved via HTTP. 3941 14.34 Retry-After 3943 See [H14.37]. 3945 14.35 Require 3947 The Require request-header field is used by clients or servers to 3948 ensure that the other end-point supports features that are required 3949 in respect to this request. It can also be used to query if the other 3950 end-point supports certain features, however the use of the Supported 3951 (Section 14.41) is much more effective in this purpose. The server 3952 MUST respond to this header by using the Unsupported header to 3953 negatively acknowledge those feature-tags which are NOT supported. 3954 The response SHALL use the error code 551 (Option Not Supported). 3955 This header does not apply to proxies, for the same functionality in 3956 respect to proxies see, header Proxy-Require (Section 14.30). 3958 This is to make sure that the client-server interaction 3959 will proceed without delay when all features are understood 3960 by both sides, and only slow down if features are not 3961 understood (as in the example below). For a well-matched 3962 client-server pair, the interaction proceeds quickly, 3963 saving a round-trip often required by negotiation 3964 mechanisms. In addition, it also removes state ambiguity 3965 when the client requires features that the server does not 3966 understand. 3968 Example: 3970 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/1.0 3971 CSeq: 302 3972 Require: funky-feature 3973 Funky-Parameter: funkystuff 3975 S->C: RTSP/1.0 551 Option not supported 3976 CSeq: 302 3977 Unsupported: funky-feature 3979 In this example, "funky-feature" is the feature-tag which indicates 3980 to the client that the fictional Funky-Parameter field is required. 3981 The relationship between "funky-feature" and Funky-Parameter is not 3982 communicated via the RTSP exchange, since that relationship is an 3983 immutable property of "funky-feature" and thus should not be 3984 transmitted with every exchange. 3986 Proxies and other intermediary devices SHOULD ignore features that 3987 are not understood in this field. If a particular extension requires 3988 that intermediate devices support it, the extension should be tagged 3989 in the Proxy-Require field instead (see Section 14.30). 3991 14.36 RTP-Info 3993 The RTP-Info response-header field is used to set RTP-specific | 3994 parameters in the PLAY response. These parameters correspond to the | 3995 synchronization source identified by the first value of the ssrc | 3996 parameter of the Transport response header in the SETUP response. For | 3997 streams using RTP as transport protocol the RTP-Info header SHOULD be | 3998 part of a 200 response to PLAY. 4000 The exclusion of the RTP-Info in a PLAY response for RTP 4001 transported media will result in that a client needs to 4002 synchronize the media streams using RTCP. This may have 4003 negative impact as the RTCP can be lost, and does not need 4004 to be particulary timely in their arrival. Also 4005 functionality as informing the client from which packet a 4006 seek has occurred is affected. 4008 The RTP-Info MAY also be included in SETUP responses to provide 4009 synchronization information when changing transport parameters, see 4010 11.3. 4012 The header can carry the following parameters: 4014 url: Indicates the stream URL which for which the following RTP 4015 parameters correspond, this URL MUST be the same used in 4016 the SETUP request for this media stream. Any relative URL 4017 SHALL use the request URL as base URL. 4019 seq: Indicates the sequence number of the first packet of the | 4020 stream that is direct result of the request. This allows | 4021 clients to gracefully deal with packets when seeking. The | 4022 client uses this value to differentiate packets that | 4023 originated before the seek from packets that originated | 4024 after the seek. Note that a client may not receive the | 4025 packet with the expressed sequence number, and instead | 4026 packets with a higher sequence number, due to packet loss | 4027 or reordering. 4029 rtptime: Indicates the RTP timestamp corresponding to the time 4030 value in the Range response header. (Note: For aggregate 4031 control, a particular stream may not actually generate a 4032 packet for the Range time value returned or implied. Thus, 4033 there is no guarantee that the packet with the sequence 4034 number indicated by seq actually has the timestamp 4035 indicated by rtptime.) The client uses this value to 4036 calculate the mapping of RTP time to NPT. 4038 A mapping from RTP timestamps to NTP timestamps (wall 4039 clock) is available via RTCP. However, this 4040 information is not sufficient to generate a mapping 4041 from RTP timestamps to NPT. Furthermore, in order to 4042 ensure that this information is available at the 4043 necessary time (immediately at startup or after a 4044 seek), and that it is delivered reliably, this mapping 4045 is placed in the RTSP control channel. 4047 In order to compensate for drift for long, uninterrupted 4048 presentations, RTSP clients should additionally map NPT to 4049 NTP, using initial RTCP sender reports to do the mapping, 4050 and later reports to check drift against the mapping. 4052 Additionally, the RTP-Info header parameter fields only apply to a | 4053 single SSRC within a stream (the first SSRC reported in the transport | 4054 response header; see section 14.43). If there are multiple | 4055 synchronization sources (SSRCs) present within a RTP session | 4056 transmitting media, RTCP must be used to map RTP and NTP timestamps | 4057 for those sources, for both synchronization and drift-checking. Due | 4058 to backwards compatibility reasons these shortcomings can't be fixed | 4059 without defining a new header, which is for future work if needed. 4061 Additional constraint: The syntax element "safe-url" (see section 4062 18.2.3) MUST NOT contain the semicolon (";") or comma (",") 4063 characters. The quoted-url form SHOULD only be used when a URL does 4064 not meet the safe-url constraint, in order to ensure compatibility 4065 with implementations conformant to RFC 2326 [1]. 4067 Example: 4069 RTP-Info: url=rtsp://example.com/bar.avi/streamid=0;seq=45102, 4070 url=rtsp://example.com/bar.avi/streamid=1;seq=30211 4072 14.37 Scale 4074 A scale value of 1 indicates normal play at the normal forward 4075 viewing rate. If not 1, the value corresponds to the rate with 4076 respect to normal viewing rate. For example, a ratio of 2 indicates 4077 twice the normal viewing rate ("fast forward") and a ratio of 0.5 4078 indicates half the normal viewing rate. In other words, a ratio of 2 4079 has normal play time increase at twice the wallclock rate. For every 4080 second of elapsed (wallclock) time, 2 seconds of content will be 4081 delivered. A negative value indicates reverse direction. For certain 4082 media transports this may require certain considerations to work 4083 consistent, see section B.1 for description on how RTP handles this. 4085 Unless requested otherwise by the Speed parameter, the data rate 4086 SHOULD not be changed. Implementation of scale changes depends on the 4087 server and media type. For video, a server may, for example, deliver 4088 only key frames or selected key frames. For audio, it may time-scale 4089 the audio while preserving pitch or, less desirably, deliver 4090 fragments of audio. 4092 The server should try to approximate the viewing rate, but may 4093 restrict the range of scale values that it supports. The response 4094 MUST contain the actual scale value chosen by the server. 4096 If the server does not implement the possibility to scale, it will 4097 not return a Scale header. A server supporting Scale operations for 4098 PLAY SHALL indicate this with the use of the "play.scale" feature- 4099 tags. 4101 When indicating a negative scale for a reverse playback, the Range 4102 header must indicate a decreasing range as described in section 4103 14.32. 4105 Example of playing in reverse at 3.5 times normal rate: 4107 Scale: -3.5 4108 Range: npt=15-10 4110 14.38 Speed 4112 The Speed request-header field requests the server to deliver data to 4113 the client at a particular speed, contingent on the server's ability 4114 and desire to serve the media stream at the given speed. 4115 Implementation by the server is OPTIONAL. The default is the bit rate 4116 of the stream. 4118 The parameter value is expressed as a decimal ratio, e.g., a value of 4119 2.0 indicates that data is to be delivered twice as fast as normal. A 4120 speed of zero is invalid. All speeds may not be possible to support. 4121 Therefore the actual used speed MUST be included in the response. The 4122 lack of a response header is indication of lack of support from the 4123 server of this functionality. Support of the speed functionality are 4124 indicated by the "play.speed" featuretag. 4126 Example: 4128 Speed: 2.5 4130 Use of this field changes the bandwidth used for data delivery. It is 4131 meant for use in specific circumstances where preview of the 4132 presentation at a higher or lower rate is necessary. Implementors 4133 should keep in mind that bandwidth for the session may be negotiated 4134 beforehand (by means other than RTSP), and therefore re-negotiation 4135 may be necessary. When data is delivered over UDP, it is highly 4136 recommended that means such as RTCP be used to track packet loss 4137 rates. If the data transport is performed over public best-effort 4138 networks the sender SHOULD perform congestion control of the 4139 stream(s). This can result in that the communicated speed is 4140 impossible to maintain. 4142 14.39 Server 4144 See [H14.38], however the header syntax is corrected in section 4145 18.2.3. 4147 14.40 Session 4149 The Session request-header and response-header field identifies an 4150 RTSP session. An RTSP session is created by the server as a result of 4151 a successful SETUP request and in the response the session identifier 4152 is given to the client. The RTSP session exist until destroyed by a 4153 TEARDOWN or timed out by the server. 4155 The session identifier is chosen by the server (see Section 3.3) and 4156 MUST be returned in the SETUP response. Once a client receives a 4157 session identifier, it SHALL be included in any request related to 4158 that session. This means that the Session header MUST be included in 4159 a request using the following methods: PLAY, PAUSE, PING, and 4160 TEARDOWN, and MAY be included in SETUP, OPTIONS, SET_PARAMETER, 4161 GET_PARAMETER, and REDIRECT, and SHALL NOT be included in DESCRIBE. 4162 In a RTSP response the session header SHALL be included in methods, 4163 SETUP, PING, PLAY, and PAUSE, and MAY be included in methods, 4164 TEARDOWN, and REDIRECT, and if included in the request of the 4165 following methods it SHALL also be included in the response, OPTIONS, 4166 GET_PARAMETER, and SET_PARAMETER, and SHALL NOT be included in 4167 DESCRIBE. 4169 Note that RFC 2326 servers and client may in some cases not include 4170 or return a Session header when expected according to the above text. 4171 Any client or server is RECOMMENDED to be forgiving of this error if 4172 possible (which it is in many cases). 4174 The timeout parameter MAY be included in a SETUP response, and SHALL 4175 NOT be included in requests. The server uses it to indicate to the 4176 client how long the server is prepared to wait between RTSP commands 4177 or other signs of life before closing the session due to lack of 4178 activity (see below and Section A). The timeout is measured in 4179 seconds, with a default of 60 seconds (1 minute). The length of the 4180 session timeout SHALL NOT be changed in a established session. 4182 The mechanisms for showing liveness of the client is, any RTSP 4183 request with a Session header, if RTP & RTCP is used an RTCP message, 4184 or through any other used media protocol capable of indicating 4185 liveness of the RTSP client. It is RECOMMENDED that a client does not 4186 wait to the last second of the timeout before trying to send a 4187 liveness message. The RTSP message may be lost or when using reliable 4188 protocols, such as TCP, the message may take some time to arrive 4189 safely at the receiver. To show liveness between RTSP request issued 4190 to accomplish other things, the following mechanisms can be used, in 4191 descending order of preference: 4193 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 4194 RTCP is used to report transport statistics, it SHALL also 4195 work as keep alive. The server can determine the client by 4196 used network address and port together with the fact that 4197 the client is reporting on the servers SSRC(s). A downside 4198 of using RTCP is that it only gives statistical guarantees 4199 to reach the server. However that probability is so low 4200 that it can be ignored in most cases. For example, a 4201 session with 60 seconds timeout and enough bitrate assigned 4202 to RTCP messages to send a message from client to server on 4203 average every 5 seconds. That client have for a network 4204 with 5 % packet loss, the probability to fail showing 4205 liveness sign in that session within the timeout interval 4206 of 2.4*E-16. In sessions with shorter timeout times, or 4207 much higher packet loss, or small RTCP bandwidths SHOULD 4208 also use any of the mechanisms below. 4210 PING: The use of the PING method is the best of the RTSP based 4211 methods. It has no other effects than updating the timeout 4212 timer. In that way it will be a minimal message, that also 4213 does not cause any extra processing for the server. The 4214 downside is that it may not be implemented. A client SHOULD 4215 use a OPTIONS request to verify support of the PING at the 4216 server. It is also possible to detect support by sending a 4217 PING to the server. If a 200 (OK) message is received the 4218 server supports it. In case a 501 (Not Implemented) is 4219 received it does not support PING and there is no meaning 4220 in continue trying. Also the reception of a error message 4221 will also mean that the liveness timer has not been 4222 updated. 4224 SET_PARAMETER: When using SET_PARAMETER for keep alive, no body 4225 SHOULD be included. This method is basically as good as 4226 PING, however the implementation support of the method is 4227 today limited. The same considerations as for PING apply 4228 regarding checking of support in server and proxies. 4230 OPTIONS: This method does also work. However it causes the 4231 server to perform unnecessary processing and result in 4232 bigger responses than necessary for the task. The reason 4233 for this is that the Public is always included creating 4234 overhead. 4236 Note that a session identifier identifies an RTSP session across 4237 transport sessions or connections. RTSP requests for a given session 4238 can use different URLs (Presentation and media URLs). Note, that 4239 there are restrictions depending on the session which URLs that are 4240 acceptable for a given method. However, multiple "user" sessions for 4241 the same URL from the same client will require use of different 4242 session identifiers. 4244 The session identifier is needed to distinguish several 4245 delivery requests for the same URL coming from the same 4246 client. 4248 The response 454 (Session Not Found) SHALL be returned if the session 4249 identifier is invalid. 4251 14.41 Supported 4252 The Supported header field enumerates all the extensions supported by | 4253 the client or server using feature tags. The header carries the | 4254 extensions supported by the message sending entity. The Supported | 4255 header MAY be included in any request. When present in a request, | 4256 the receiver MUST respond with its corresponding Supported header. | 4257 Note, also in 4xx and 5xx responses shall the supported header be | 4258 included. 4260 The Supported header field contains a list of feature-tags, described 4261 in Section 3.7, that are understood by the client or server. 4263 Example: 4265 C->S: OPTIONS rtsp://example.com/ RTSP/1.0 4266 Supported: foo, bar, blech 4268 S->C: RTSP/1.0 200 OK 4269 Supported: bar, blech, baz 4271 14.42 Timestamp 4273 The Timestamp general-header field describes when the client sent the 4274 request to the server. The value of the timestamp is of significance 4275 only to the client and may use any timescale. The server MUST echo 4276 the exact same value and MAY, if it has accurate information about 4277 this, add a floating point number indicating the number of seconds 4278 that has elapsed since it has received the request. The timestamp is 4279 used by the client to compute the round-trip time to the server so 4280 that it can adjust the timeout value for retransmissions. It also 4281 resolves retransmission ambiguities for unreliable transport of RTSP. 4283 14.43 Transport 4285 The Transport request and response header field indicates which 4286 transport protocol is to be used and configures its parameters such 4287 as destination address, compression, multicast time-to-live and 4288 destination port for a single stream. It sets those values not 4289 already determined by a presentation description. 4291 Transports are comma separated, listed in order of preference. 4292 Parameters may be added to each transport, separated by a semicolon. 4293 The server SHOULD return a Transport response-header field in the 4294 response to indicate the values actually chosen. The Transport header 4295 field MAY also be used to change certain transport parameters. A 4296 server MAY refuse to change parameters of an existing stream. 4298 A Transport request header field MAY contain a list of transport 4299 options acceptable to the client, in the form of multiple 4300 transportspec entries. In that case, the server MUST return the 4301 single option (transport-spec) which was actually chosen. The number 4302 of transportspec entries is expected to be limited as the client will 4303 get guidance on what configurations that are possible from the 4304 presentation description. 4306 A transport-spec transport option may only contain one of any given 4307 parameter within it. Parameters may be given in any order. 4308 Additionally, it may only contain the unicast or multicast transport 4309 parameter. Unknown transport parameters SHALL be ignored. The 4310 requester need to ensure that the responder understands the 4311 parameters through the use of feature tags and the Require header. 4313 The usage of any parameter that was not defined in RFC 2326 or in an 4314 extended way requires that request or response contains a Require 4315 header with the "play.basic" feature tag. 4317 The Transport header field is restricted to describing a 4318 single media stream. (RTSP can also control multiple 4319 streams as a single entity.) Making it part of RTSP rather 4320 than relying on a multitude of session description formats 4321 greatly simplifies designs of firewalls. 4323 The syntax for the transport specifier is 4325 transport/profile/lower-transport. 4327 The default value for the "lower-transport" parameters is specific to 4328 the profile. For RTP/AVP, the default is UDP. 4330 There is three different methods for how to specify where the media 4331 should be delivered: 4333 o The presence of this parameter and its values indicates 4334 address and port pairs for one or more IP flow necessary for 4335 the media transport. This is an improved version of the 4336 Destination parameter. 4338 o The presence of this parameter and its value indicates what IP 4339 address the media shall be delivered to. This method is kept 4340 for backwards compatibility reasons, dest_addr is a better 4341 choice. 4343 o The lack of of both of the above parameters indicates that the 4344 server SHALL send media to same address for which the RTSP 4345 messages originates. 4347 The choice of method for indicating where the media shall be 4348 delivered depends on the use case. In many case the only allowed 4349 method will be to use no explicit indication and have the server 4350 deliver media to the source of the RTSP messages. 4352 An RTSP proxy will also need to take care. If the media is not 4353 desired to be routed through the proxy, the proxy will need to 4354 introduce the destination indication. 4356 Below are the configuration parameters associated with transport: 4358 General parameters: 4360 unicast / multicast: This parameter is a mutually exclusive 4361 indication of whether unicast or multicast delivery will be 4362 attempted. One of the two values MUST be specified. Clients 4363 that are capable of handling both unicast and multicast 4364 transmission MUST indicate such capability by including two 4365 full transport-specs with separate parameters for each. 4367 destination: The address of the stream recipient to which a 4368 stream will be sent. The client originating the RTSP 4369 request may specify the destination address of the stream 4370 recipient with the destination parameter. When the 4371 destination field is specified, the recipient may be a 4372 different party than the originator of the request. To 4373 avoid becoming the unwitting perpetrator of a remote- 4374 controlled denial-of-service attack, a server SHOULD 4375 authenticate the client originating the request and SHOULD 4376 log such attempts before allowing the client to direct a 4377 media stream to a recipient address not chosen by the 4378 server. While, this is particularly important if RTSP 4379 commands are issued via UDP, implementations cannot rely on 4380 TCP as reliable means of client identification by itself 4381 either. 4383 The server SHOULD NOT allow the destination field to be set 4384 unless a mechanism exists in the system to authorize the 4385 request originator to direct streams to the recipient. It 4386 is preferred that this authorization be performed by the 4387 recipient itself and the credentials passed along to the 4388 server. However, in certain cases, such as when recipient 4389 address is a multicast group, or when the recipient is 4390 unable to communicate with the server in an out-of-band 4391 manner, this may not be possible. In these cases server may 4392 chose another method such as a server-resident 4393 authorization list to ensure that the request originator 4394 has the proper credentials to request stream delivery to 4395 the recipient. 4397 This parameter SHALL NOT be used when src_addr and 4398 dest_addr is used in a transport declaration. For IPv6 4399 addresses it is RECOMMENDED that they be given as fully 4400 qualified domain to make it backwards compatible with RFC 4401 2326 implementations. 4403 source: If the source address for the stream is different than 4404 can be derived from the RTSP endpoint address (the server 4405 in playback), the source address SHOULD be specified. To 4406 maintain backwards compatibility with RFC 2326, any IPv6 4407 host's address must be given as a fully qualified domain 4408 name. This parameter SHALL NOT be used when src_addr and 4409 dest_addr is used in a transport declaration. 4411 This information may also be available through SDP. 4412 However, since this is more a feature of transport 4413 than media initialization, the authoritative source 4414 for this information should be in the SETUP response. 4416 layers: The number of multicast layers to be used for this media 4417 stream. The layers are sent to consecutive addresses 4418 starting at the destination address. 4420 dest_addr: A general destination address parameter that can 4421 contain one or more address and port pair. For each 4422 combination of Protocol/Profile/Lower Transport the 4423 interpretation of the address or addresses needs to be 4424 defined. The host address part of the tuple MAY be empty, 4425 for example ":8000", in cases when only destination port is 4426 desired to be specified. 4428 The client or server SHALL NOT use this parameter unless 4429 both client and server has shown support. This parameter 4430 MUST be supported by client and servers that implements 4431 this specification. Support is indicated by the use of the 4432 feature-tag "play.basic". This parameter SHALL NOT be used 4433 in the same transport specification as any of the 4434 parameters "destination", "source", "port", "client_port", 4435 and "server_port". 4437 The same security consideration that are given for the 4438 "Destination" parameter does also applies to this 4439 parameter. This parameter can be used for redirecting 4440 traffic to recipient not desiring the media traffic. 4442 src_addr: A General source address parameter that can contain 4443 one or more address and port pair. For each combination of 4444 Protocol/Profile/Lower Transport the interpretation of the 4445 address or addresses needs to be defined. The client or 4446 server SHALL NOT use this parameter unless both client and 4447 server has shown support. This parameter MUST be supported 4448 by client and servers that implements this specification. 4449 Support is indicated by the use the feature-tag 4450 "play.basic". This parameter SHALL NOT be used in the same 4451 transport specification as any of the parameters 4452 "destination", "source", "port", "client_port", and 4453 "server_port". 4455 This parameter MUST be specified by the server if it 4456 transmits media packets from another address than the one 4457 RTSP messages are sent to. This will allow the client to 4458 verify source address and give it a destination address for 4459 its RTCP feedback packets if RTP is used. The address or 4460 addresses indicated in the src_addr parameter SHOULD be 4461 used both for sending and receiving of the media streams 4462 data packets. The main reasons are three: First by sending 4463 from the indicated ports the source address will be known 4464 by the receiver of the packet. Secondly, in the presence of 4465 NATs some traversal mechanism requires either knowledge 4466 from which address and port a packet flow is coming, or 4467 having the possibility to send data to the sender port. 4469 mode: The mode parameter indicates the methods to be supported 4470 for this session. Valid values are PLAY and RECORD. If not 4471 provided, the default is PLAY. The RECORD value was 4472 defined in RFC 2326 and is deprecated in this 4473 specification. 4475 append: The append parameter was used together with RECORD and 4476 is now deprecated. 4478 interleaved: The interleaved parameter implies mixing the media 4479 stream with the control stream in whatever protocol is 4480 being used by the control stream, using the mechanism 4481 defined in Section 12. The argument provides the channel 4482 number to be used in the $ statement and MUST be present. 4483 This parameter MAY be specified as a range, e.g., 4484 interleaved=4-5 in cases where the transport choice for the 4485 media stream requires it, e.g. for RTP with RTCP. The 4486 channel number given in the request are only a guidance 4487 from the client to the server on what channel number(s) to 4488 use. The server MAY set any valid channel number in the 4489 response. The declared channel(s) are bi-directional, so 4490 both end-parties MAY send data on the given channel. One 4491 example of such usage is the second channel used for RTCP, 4492 where both server and client sends RTCP packets on the same 4493 channel. 4495 This allows RTP/RTCP to be handled similarly to the 4496 way that it is done with UDP, i.e., one channel for 4497 RTP and the other for RTCP. 4499 Multicast-specific: 4501 ttl: multicast time-to-live. 4503 RTP-specific: 4505 These parameters are MAY only be used if the media transport protocol 4506 is RTP. 4508 port: This parameter provides the RTP/RTCP port pair for a 4509 multicast session. It is should be specified as a range, 4510 e.g., port=3456-3457 4512 client_port: This parameter provides the unicast RTP/RTCP port 4513 pair on the client where media data and control information 4514 is to be sent. It is specified as a range, e.g., 4515 port=3456-3457. This parameter SHALL NOT be used when 4516 src_addr and dest_addr is used in a transport declaration. 4518 server_port: This parameter provides the unicast RTP/RTCP port 4519 pair on the server where media data and control information 4520 is to be sent. It is specified as a range, e.g., 4521 port=3456-3457. This parameter SHALL NOT be used when 4522 src_addr and dest_addr is used in a transport declaration. 4524 ssrc: The ssrc parameter, if included in a SETUP response, | 4525 indicates the RTP SSRC [18] value(s) that will be used by | 4526 the media server for RTP packets within the stream. It is | 4527 expressed as an eight digit hexadecimal value. Multiple | 4528 values MAY only be specified if the cl�ent has indicated | 4529 support for this specification, i.e. if including multiple | 4530 SSRC values, the request must have include "Require: | 4531 play.basic" or "Supported: play.basic". If no such support | 4532 is present only a single value SHALL be included. | 4533 If the server does not act as a synchronization source for | 4534 stream data (for instance, server is a translator, | 4535 reflector, etc.), and only a single value can be specified, | 4536 the value will be the "packet sender's SSRC" that would | 4537 have been used in the RTCP Receiver Reports generated by | 4538 the server, regardless of whether the server actually | 4539 generates RTCP RRs. | 4541 The first SSRC value is the one that RTP-Info | 4542 synchronization information relates to, see section 14.36. 4544 The functionality of specifying the ssrc parameter in a 4545 SETUP request is deprecated as it is incompatible with the 4546 specification of RTP in RFC 3550 [18]. If the parameter is 4547 included in the transport header of a SETUP request, the 4548 server MAY ignore it, and choose an appropriate SSRC for 4549 the stream. The server MAY set the ssrc parameter in the 4550 transport header of the response. 4552 The combination of transport protocol, profile and lower transport 4553 needs to be defined. A number of combinations are defined in the 4554 appendix B. 4556 Below is a usage example, showing a client advertising the capability 4557 to handle multicast or unicast, preferring multicast. Since this is 4558 a unicast-only stream, the server responds with the proper transport 4559 parameters for unicast. 4561 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/1.0 4562 CSeq: 302 4563 Transport: RTP/AVP;multicast;mode="PLAY", 4564 RTP/AVP;unicast;client_port=3456-3457;mode="PLAY" 4566 S->C: RTSP/1.0 200 OK 4567 CSeq: 302 4568 Date: 23 Jan 1997 15:35:06 GMT 4569 Session: 47112344 4570 Transport: RTP/AVP;unicast;client_port=3456-3457; 4571 server_port=6256-6257;mode="PLAY" 4573 14.44 Unsupported 4575 The Unsupported response-header field lists the features not 4576 supported by the server. In the case where the feature was specified 4577 via the Proxy-Require field (Section 14.30), if there is a proxy on 4578 the path between the client and the server, the proxy MUST send a 4579 response message with a status code of 551 (Option Not Supported). 4580 The request SHALL NOT be forwarded. 4582 See Section 14.35 for a usage example. 4584 14.45 User-Agent 4586 See [H14.43] for explanation, however the syntax is clarified due to 4587 an error in RFC 2616. A Client SHOULD include this header in all RTSP 4588 messages it sends. 4590 14.46 Vary 4592 See [H14.44] 4594 14.47 Via 4596 See [H14.45]. 4598 14.48 WWW-Authenticate 4600 See [H14.47]. 4602 15 Caching 4604 In HTTP, response-request pairs are cached. RTSP differs 4605 significantly in that respect. Responses are not cacheable, with the 4606 exception of the presentation description returned by DESCRIBE. 4607 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 4608 not return any data, caching is not really an issue for these 4609 requests.) However, it is desirable for the continuous media data, 4610 typically delivered out-of-band with respect to RTSP, to be cached, 4611 as well as the session description. 4613 On receiving a SETUP or PLAY request, a proxy ascertains whether it 4614 has an up-to-date copy of the continuous media content and its 4615 description. It can determine whether the copy is up-to-date by 4616 issuing a SETUP or DESCRIBE request, respectively, and comparing the 4617 Last-Modified header with that of the cached copy. If the copy is not 4618 up-to-date, it modifies the SETUP transport parameters as appropriate 4619 and forwards the request to the origin server. Subsequent control 4620 commands such as PLAY or PAUSE then pass the proxy unmodified. The 4621 proxy delivers the continuous media data to the client, while 4622 possibly making a local copy for later reuse. The exact behavior 4623 allowed to the cache is given by the cache-response directives 4624 described in Section 14.10. A cache MUST answer any DESCRIBE requests 4625 if it is currently serving the stream to the requestor, as it is 4626 possible that low-level details of the stream description may have 4627 changed on the origin-server. 4629 Note that an RTSP cache, unlike the HTTP cache, is of the "cut- 4630 through" variety. Rather than retrieving the whole resource from the 4631 origin server, the cache simply copies the streaming data as it 4632 passes by on its way to the client. Thus, it does not introduce 4633 additional latency. 4635 To the client, an RTSP proxy cache appears like a regular media 4636 server, to the media origin server like a client. Just as an HTTP 4637 cache has to store the content type, content language, and so on for 4638 the objects it caches, a media cache has to store the presentation 4639 description. Typically, a cache eliminates all transport-references 4640 (that is, multicast information) from the presentation description, 4641 since these are independent of the data delivery from the cache to 4642 the client. Information on the encodings remains the same. If the 4643 cache is able to translate the cached media data, it would create a 4644 new presentation description with all the encoding possibilities it 4645 can offer. 4647 16 Examples 4649 This section contains several different examples trying to illustrate 4650 possible ways of using RTSP. The examples can also help with the 4651 understanding of how functions of RTSP work. However remember that 4652 this is examples and the normative and syntax description in the 4653 other chapters takes precedence. Please also note that many of the 4654 example MAY contain syntax illegal line breaks to accommodate the 4655 formatting restriction that the RFC series impose. 4657 16.1 Media on Demand (Unicast) 4659 Client C requests a movie distributed from two different media 4660 servers A (audio.example.com ) and V (video.example.com ). The media 4661 description is stored on a web server W. The media description 4662 contains descriptions of the presentation and all its streams, 4663 including the codecs that are available, dynamic RTP payload types, 4664 the protocol stack, and content information such as language or 4665 copyright restrictions. It may also give an indication about the 4666 timeline of the movie. 4668 In this example, the client is only interested in the last part of 4669 the movie. 4671 C->W: GET /twister.sdp HTTP/1.1 4672 Host: www.example.com 4673 Accept: application/sdp 4675 W->C: HTTP/1.0 200 OK 4676 Date: 23 Jan 1997 15:35:06 GMT 4677 Content-Type: application/sdp 4678 Content-Length: 255 4679 Expires: 23 Jan 1998 15:35:06 GMT 4681 v=0 4682 o=- 2890844526 2890842807 IN IP4 192.16.24.202 4683 s=RTSP Session 4684 e=adm@example.com 4685 a=range:npt=0-1:49:34 4686 t=0 0 4687 m=audio 0 RTP/AVP 0 4688 a=control:rtsp://audio.example.com/twister/audio.en 4689 m=video 0 RTP/AVP 31 4690 a=control:rtsp://video.example.com/twister/video 4692 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/1.0 4693 CSeq: 1 4694 User-Agent: PhonyClient/1.2 4695 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057, 4696 RTP/AVP/TCP;unicast;interleaved=0-1 4698 A->C: RTSP/1.0 200 OK 4699 CSeq: 1 4700 Session: 12345678 4701 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057; 4702 server_port=5000-5001 4703 Date: 23 Jan 1997 15:35:12 GMT 4704 Server: PhonyServer/1.0 4705 Expires: 24 Jan 1997 15:35:12 GMT 4706 Cache-Control: public 4707 Accept-Ranges: NPT, SMPTE 4709 C->V: SETUP rtsp://video.example.com/twister/video RTSP/1.0 4710 CSeq: 1 4711 User-Agent: PhonyClient/1.2 4712 Transport: RTP/AVP/UDP;unicast;client_port=3058-3059, 4713 RTP/AVP/TCP;unicast;interleaved=0-1 4715 V->C: RTSP/1.0 200 OK 4716 CSeq: 1 4717 Session: 23456789 4718 Transport: RTP/AVP/UDP;unicast;client_port=3058-3059; 4719 server_port=5002-5003 4720 Date: 23 Jan 1997 15:35:12 GMT 4721 Server: PhonyServer/1.0 4722 Cache-Control: public 4723 Expires: 24 Jan 1997 15:35:12 GMT 4724 Accept-Ranges: NPT, SMPTE 4726 C->V: PLAY rtsp://video.example.com/twister/video RTSP/1.0 4727 CSeq: 2 4728 User-Agent: PhonyClient/1.2 4729 Session: 23456789 4730 Range: smpte=0:10:00- 4732 V->C: RTSP/1.0 200 OK 4733 CSeq: 2 4734 Session: 23456789 4735 Range: smpte=0:10:00-1:49:23 4736 RTP-Info: url=rtsp://video.example.com/twister/video; 4737 seq=12312232;rtptime=78712811 4738 Server: PhonyServer/2.0 4739 Date: 23 Jan 1997 15:35:13 GMT 4741 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/1.0 4742 CSeq: 2 4743 User-Agent: PhonyClient/1.2 4744 Session: 12345678 4745 Range: smpte=0:10:00- 4747 A->C: RTSP/1.0 200 OK 4748 CSeq: 2 4749 Session: 12345678 4750 Range: smpte=0:10:00-1:49:23 4751 RTP-Info: url=rtsp://audio.example.com/twister/audio.en; 4752 seq=876655;rtptime=1032181 4753 Server: PhonyServer/1.0 4754 Date: 23 Jan 1997 15:35:13 GMT 4756 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/1.0 4757 CSeq: 3 4758 User-Agent: PhonyClient/1.2 4759 Session: 12345678 4761 A->C: RTSP/1.0 200 OK 4762 CSeq: 3 4763 Server: PhonyServer/1.0 4764 Date: 23 Jan 1997 15:36:52 GMT 4766 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/1.0 4767 CSeq: 3 4768 User-Agent: PhonyClient/1.2 4769 Session: 23456789 4771 V->C: RTSP/1.0 200 OK 4772 CSeq: 3 4773 Server: PhonyServer/2.0 4774 Date: 23 Jan 1997 15:36:52 GMT 4776 Even though the audio and video track are on two different servers, 4777 and may start at slightly different times and may drift with respect 4778 to each other, the client can synchronize the two using standard RTP 4779 methods, in particular the time scale contained in the RTCP sender 4780 reports. Initial synchronization is achieved through the RTP-Info and 4781 Range headers information in the PLAY response. 4783 16.2 Streaming of a Container file 4785 For purposes of this example, a container file is a storage entity in 4786 which multiple continuous media types pertaining to the same end-user 4787 presentation are present. In effect, the container file represents an 4788 RTSP presentation, with each of its components being RTSP streams. 4789 Container files are a widely used means to store such presentations. 4790 While the components are transported as independent streams, it is 4791 desirable to maintain a common context for those streams at the 4792 server end. 4794 This enables the server to keep a single storage handle 4795 open easily. It also allows treating all the streams 4796 equally in case of any prioritization of streams by the 4797 server. 4799 It is also possible that the presentation author may wish to prevent 4800 selective retrieval of the streams by the client in order to preserve 4801 the artistic effect of the combined media presentation. Similarly, in 4802 such a tightly bound presentation, it is desirable to be able to 4803 control all the streams via a single control message using an 4804 aggregate URL. 4806 The following is an example of using a single RTSP session to control 4807 multiple streams. It also illustrates the use of aggregate URLs. In a 4808 container file it is also desirable to not write any URL parts which 4809 is not kept, when the container is distributed, like the host and 4810 most of the path element. Therefore this example also uses the "*" 4811 and relative URL in the delivered SDP. 4813 Client C requests a presentation from media server M. The movie is 4814 stored in a container file. The client has obtained an RTSP URL to 4815 the container file. 4817 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/1.0 4818 CSeq: 1 4819 User-Agent: PhonyClient/1.2 4821 M->C: RTSP/1.0 200 OK 4822 CSeq: 1 4823 Server: PhonyServer/1.0 4824 Date: 23 Jan 1997 15:35:06 GMT 4825 Content-Type: application/sdp 4826 Content-Length: 257 4827 Content-Base: rtsp://example.com/twister.3gp/ 4828 Expires: 24 Jan 1997 15:35:06 GMT 4830 v=0 4831 o=- 2890844256 2890842807 IN IP4 172.16.2.93 4832 s=RTSP Session 4833 i=An Example of RTSP Session Usage 4834 e=adm@example.com 4835 a=control: * 4836 a=range: npt=0-0:10:34.10 4837 t=0 0 4838 m=audio 0 RTP/AVP 0 4839 a=control: trackID=1 4840 m=video 0 RTP/AVP 26 4841 a=control: trackID=4 4843 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/1.0 4844 CSeq: 2 4845 User-Agent: PhonyClient/1.2 4846 Require: play.basic 4847 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 4849 M->C: RTSP/1.0 200 OK 4850 CSeq: 2 4851 Server: PhonyServer/1.0 4852 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001; 4853 src_addr="172.16.2.93:9000"/"172.16.2.93:9001" 4854 ssrc=93CB001E 4855 Session: 12345678 4856 Expires: 24 Jan 1997 15:35:12 GMT 4857 Date: 23 Jan 1997 15:35:12 GMT 4858 Accept-Ranges: NPT 4860 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/1.0 4861 CSeq: 3 4862 User-Agent: PhonyClient/1.2 4863 Require: play.basic 4864 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 4865 Session: 12345678 4867 M->C: RTSP/1.0 200 OK 4868 CSeq: 3 4869 Server: PhonyServer/1.0 4870 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003; 4871 src_addr="172.16.2.93:9002"/"172.16.2.93:9003"; 4872 ssrc=A813FC13 4873 Session: 12345678 4874 Expires: 24 Jan 1997 15:35:13 GMT 4875 Date: 23 Jan 1997 15:35:13 GMT 4876 Accept-Range: NPT 4878 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/1.0 4879 CSeq: 4 4880 User-Agent: PhonyClient/1.2 4881 Range: npt=0-10, npt=30- 4882 Session: 12345678 4884 M->C: RTSP/1.0 200 OK 4885 CSeq: 4 4886 Server: PhonyServer/1.0 4887 Date: 23 Jan 1997 15:35:14 GMT 4888 Session: 12345678 4889 Range: npt=0-10, npt=30-623.10 4890 RTP-Info: url=rtsp://example.com/twister.3gp/trackID=4; 4891 seq=12345;rtptime=3450012, 4892 url=rtsp://example.com/twister.3gp/trackID=1; 4893 seq=54321;rtptime=2876889 4895 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/1.0 4896 CSeq: 5 4897 User-Agent: PhonyClient/1.2 4898 Session: 12345678 4900 M->C: RTSP/1.0 200 OK 4901 CSeq: 5 4902 Server: PhonyServer/1.0 4903 Date: 23 Jan 1997 15:36:01 GMT 4904 Session: 12345678 4905 Range: npt=34.57-623.10 4907 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/1.0 4908 CSeq: 6 4909 User-Agent: PhonyClient/1.2 4910 Range: npt=34.57-623.10 4911 Session: 12345678 4913 M->C: RTSP/1.0 200 OK 4914 CSeq: 6 4915 Server: PhonyServer/1.0 4916 Date: 23 Jan 1997 15:36:01 GMT 4917 Session: 12345678 4918 Range: npt=34.57-623.10 4919 RTP-Info: url=rtsp://example.com/twister.3gp/trackID=4; 4920 seq=12555;rtptime=6330012, 4921 url=rtsp://example.com/twister.3gp/trackID=1; 4922 seq=55021;rtptime=3132889 4924 16.3 Single Stream Container Files 4926 Some RTSP servers may treat all files as though they are "container 4927 files", yet other servers may not support such a concept. Because of 4928 this, clients SHOULD use the rules set forth in the session 4929 description for request URLs, rather than assuming that a consistent 4930 URL may always be used throughout. Here's an example of how a multi- 4931 stream server might expect a single-stream file to be served: 4933 C->S: DESCRIBE rtsp://foo.com/test.wav RTSP/1.0 | 4934 Accept: application/x-rtsp-mh, application/sdp | 4935 CSeq: 1 | 4936 User-Agent: PhonyClient/1.2 | 4938 S->C: RTSP/1.0 200 OK | 4939 CSeq: 1 | 4940 Content-base: rtsp://foo.com/test.wav/ | 4941 Content-type: application/sdp | 4942 Content-length: 48 | 4943 Server: PhonyServer/1.0 | 4944 Date: 23 Jan 1997 15:35:06 GMT | 4945 Expires: 23 Jan 1997 17:00:00 GMT | 4947 v=0 | 4948 o=- 872653257 872653257 IN IP4 172.16.2.187 | 4949 s=mu-law wave file | 4950 i=audio test | 4951 t=0 0 | 4952 a=control: * | 4953 m=audio 0 RTP/AVP 0 | 4954 a=control:streamid=0 | 4956 C->S: SETUP rtsp://foo.com/test.wav/streamid=0 RTSP/1.0 | 4957 Transport: RTP/AVP/UDP;unicast; | 4958 client_port=6970-6971;mode="PLAY" | 4959 CSeq: 2 | 4960 User-Agent: PhonyClient/1.2 | 4962 S->C: RTSP/1.0 200 OK | 4963 Transport: RTP/AVP/UDP;unicast;client_port=6970-6971; | 4964 server_port=6970-6971;mode="PLAY";ssrc=EAB98712 | 4965 CSeq: 2 | 4966 Session: 2034820394 | 4967 Expires: 23 Jan 1997 16:00:00 GMT | 4968 Server: PhonyServer/1.0 | 4969 Date: 23 Jan 1997 15:35:07 GMT | 4971 C->S: PLAY rtsp://foo.com/test.wav/ RTSP/1.0 | 4972 CSeq: 3 | 4973 User-Agent: PhonyClient/1.2 | 4974 Session: 2034820394 | 4976 S->C: RTSP/1.0 200 OK | 4977 CSeq: 3 | 4978 Server: PhonyServer/1.0 | 4979 Date: 23 Jan 1997 15:35:08 GMT | 4980 Session: 2034820394 | 4981 Range: npt=0-600 | 4982 RTP-Info: url=rtsp://foo.com/test.wav/streamid=0; | 4983 seq=981888;rtptime=3781123 | 4985 Note the different URL in the SETUP command, and then the switch back 4986 to the aggregate URL in the PLAY command. This makes complete sense 4987 when there are multiple streams with aggregate control, but is less 4988 than intuitive in the special case where the number of streams is 4989 one. However the server has declared that the aggregated control URL 4990 in the SDP and therefore this is fine. 4992 If however the server had not declared an aggregated control URL it 4993 would be another question, in which the client should consider it 4994 lucky if it works. 4996 In this case, it is also required that servers accept implementations 4997 that uses the non-aggregated interpretation and uses the individual 4998 media URL, like this: 5000 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/1.0 5001 CSeq: 3 5002 User-Agent: PhonyClient/1.2 5004 16.4 Live Media Presentation Using Multicast 5006 The media server M chooses the multicast address and port. Here, we 5007 assume that the web server only contains a pointer to the full 5008 description, while the media server M maintains the full description. 5010 Editors note: Is this example really valid? In what situations does 5011 it make sense to do a setup to a multicast distribution channel, and 5012 also issue PLAY requests? 5014 C->W: GET /sessions.html HTTP/1.1 5015 Host: www.example.com 5017 W->C: HTTP/1.1 200 OK 5018 Content-Type: text/html 5020 5021 ... 5022 5024 ... 5025 5027 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/1.0 5028 CSeq: 1 5029 Supported: play.basic, play.scale 5031 M->C: RTSP/1.0 200 OK 5032 CSeq: 1 5033 Content-Type: application/sdp 5034 Content-Length: 181 5035 Server: PhonyServer/1.0 5036 Date: 23 Jan 1997 15:35:06 GMT 5037 Supported: play.basic 5039 v=0 5040 o=- 2890844526 2890842807 IN IP4 192.16.24.202 5041 s=RTSP Session 5042 m=audio 3456 RTP/AVP 0 5043 c=IN IP4 224.2.0.1/16 5044 a=control: rtsp://live.example.com/concert/audio 5045 a=range:npt=0- 5047 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/1.0 5048 CSeq: 2 5049 Transport: RTP/AVP;multicast 5051 M->C: RTSP/1.0 200 OK 5052 CSeq: 2 5053 Server: PhonyServer/1.0 5054 Date: 23 Jan 1997 15:35:06 GMT 5055 Transport: RTP/AVP;multicast;destination=224.2.0.1; 5056 port=3456-3457;ttl=16 5057 Session: 0456804596 5058 Accept-Ranges: NPT, UTC 5060 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/1.0 5061 CSeq: 3 5062 Session: 0456804596 5064 M->C: RTSP/1.0 200 OK 5065 CSeq: 3 5066 Server: PhonyServer/1.0 5067 Date: 23 Jan 1997 15:35:07 GMT 5068 Session: 0456804596 5069 Range:npt=1256- 5070 RTP-Info: url=rtsp://live.example.com/concert/audio; 5071 seq=1473; rtptime=80000 5073 16.5 Capability Negotiation 5075 This examples illustrate how the client and server determines there 5076 capability to support a special feature, in this case "play.scale". 5077 The server through the clients request, and included Supported header 5078 learns that the client is supporting this updated specification, and 5079 also support the playback time scaling feature of RTSP. The server's 5080 response declares that it is also an updated specification minimal 5081 implementation and supports the extra features, of client requested 5082 time scaling and faster than normal transmission rates, plus one 5083 "example.com" proprietary feature "flight". The client also learns 5084 what methods that are possible to use in regards to the indicated 5085 resource. 5087 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/1.0 5088 CSeq: 1 5089 Supported: play.basic, play.scale 5090 User-Agent: PhonyClient/1.2 5092 S->C: RTSP/1.0 200 OK 5093 CSeq: 1 5094 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 5095 Server: PhonyServer/2.0 5096 Supported: play.basic, play.scale, example.com.flight 5098 When the client sends its SETUP request it tells the server that it 5099 is must support the play.scale feature for this session by including 5100 the Require header. 5102 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/1.0 5103 CSeq: 3 5104 User-Agent: PhonyClient/1.2 5105 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057, 5106 RTP/AVP/TCP;unicast;interleaved=0-1 5107 Require: play.scale 5109 S->C: RTSP/1.0 200 OK 5110 CSeq: 3 5111 Session: 12345678 5112 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057; 5113 server_port=5000-5001 5114 Server: PhonyServer/2.0 5115 Accept-Ranges: NPT, SMPTE 5117 17 Security Framework 5119 The RTSP security framework consists of two high level components: 5120 the pure authentication mechanisms based on HTTP authentication, and 5121 the transport protection based on TLS, which is independent of RTSP. 5122 Because of the similarity in syntax and usage between RTSP servers 5123 and HTTP servers, the security for HTTP is re-used to a large extent. 5125 17.1 RTSP and HTTP Authentication 5127 RTSP and HTTP share common authentication schemes, and thus follow | 5128 the same usage guidelines as specified in [8] and also in [H15]. | 5129 Servers SHOULD implement both basic and digest [8] authentication. | 5131 It should be stressed that using the HTTP authentication alone does | 5132 not provide full control message security. Therefore, in environments | 5133 requiring tighter security for the control messages, TLS SHOULD be | 5134 used, see Section 17.2. | 5136 17.2 RTSP over TLS | 5138 RTSP SHALL follow the same guidelines with regards to TLS [7] usage | 5139 as specified for HTTP, see [19]. RTSP over TLS is separated from | 5140 unsecured RTSP both on URI level and port level. Instead of using the | 5141 "rtsp" scheme identifier in the URI, the "rtsps" scheme identifier | 5142 MUST be used to signal RTSP over TLS. If no port is given in a URI | 5143 with the "rtsps" scheme, port 322 SHALL be used for TLS over TCP/IP. | 5145 When a client tries to setup an insecure channel to the server (using | 5146 the "rtsp" URI), and the policy for the resource requires a secure | 5147 channel, the server SHALL redirect the client to the secure service | 5148 by sending a 301 redirect response code together with the correct | 5149 Location URI (using the "rtsps" scheme). | 5151 It should be noted that TLS allows for mutual authentication (when | 5152 using both server and client certificates). Still, one of the more | 5153 common way TLS is used is to only provide server side authentication | 5154 (often to avoid client certificates). TLS is then used in addition to | 5155 HTTP authentication, providing transport security and server | 5156 authentication, while HTTP Authentication is used to authenticate the | 5157 client. | 5159 RTSP includes the possibility to keep a TCP session up between the | 5160 client and server, throughout the RTSP session lifetime. It may be | 5161 convenient to keep the TCP session, not only to save the extra setup | 5162 time for TCP, but also the extra setup time for TLS (even if TLS uses | 5163 the resume function, there will be almost two extra roundtrips). | 5164 Still, when TLS is used, such behavior introduces extra active state | 5165 in the server, not only for TCP and RTSP, but also for TLS. This may | 5166 increase the vulnerability to DoS attacks. | 5168 In addition to these recommendations, Section 17.3 gives further | 5169 recommendations of TLS usage with proxies. | 5171 17.3 Security and Proxies | 5173 The nature of a proxy is often to act as a "man-in-the-middle", while | 5174 security is often about preventing the existence of a "man-in-the- | 5175 middle". | 5176 There are basically two categories of inspecting proxies, the | 5177 transparent proxies (which the client is not aware of) and the non- | 5178 transparent proxies (which the client is aware of). An infrastructure | 5179 based on proxies must assume that the trust model is such that both | 5180 client and servers can trust the proxies to handle the RTSP messages | 5181 correctly. To be able to trust a proxy, the client and server must | 5182 also be aware of the proxy. Hence, transparent proxies cannot | 5183 generally be seen as trusted and will not work well with security | 5184 (unless they work only at transport layer and not above that in the | 5185 stack). In the rest of this section we will by proxy refer to a non- | 5186 transparent proxy, which requires to inspect/manipulate the RTSP | 5187 messages. | 5189 The HTTP Authentication is built on the assumption of proxies and can | 5190 provide user-proxy authentication and proxy-proxy/server | 5191 authentication in addition to the client-server authentication. | 5193 When TLS is applied and a proxy is used, the client will use the | 5194 proxy's destination URI address when sending messages. This implies | 5195 that for TLS, the client will authenticate the proxy server and not | 5196 the end server. Note that, when the client checks the server | 5197 certificate in TLS, it MUST check the proxy's identity (URI or | 5198 possibly other known identity) against the proxy's identity as | 5199 presented in the proxy's Certificate message. | 5201 A problem here is that, even though the client accepts the proxy, the | 5202 proxy has no information on what grounds it shall accept the | 5203 server/next proxy certificate (it may of course have own decision | 5204 rules for this, but very likely the user may have different as well). | 5205 To handle this case, the Accept-Credentials header (See Section 14.2) | 5206 is used, where the client can force the proxy/proxies to relay back | 5207 the certificates used by any intermediate proxies as well as the | 5208 server. Given the assumption that the proxies are view as trusted, it | 5209 gives the user a possibility to enforce policies to each trusted | 5210 proxy of whether it should accept the next entity in the chain. | 5212 A proxy MUST use TLS for the next hop if the RTSP request includes a | 5213 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between | 5214 client and proxy, or between proxy and proxy), even if the resource | 5215 and the end server does not require to use it. | 5217 17.3.1 Accept-Credentials | 5219 The Accept-Credentials header can be used by the client to distribute | 5220 simple authorization policies to intermediate proxies. The client | 5221 includes the Accept-Credentials header to dictate how the proxy shall | 5222 treat the server/next proxy certificate. There are currently three | 5223 methods defined: | 5224 Any, which means that the proxy (or proxies) SHALL accept | 5225 whatever certificate presented. This is of course not a | 5226 recommended option to use, but may be useful in certain | 5227 circumstances (such as testing). | 5229 Proxy, which means that the proxy (or proxies) MUST use its own | 5230 policies to validate the certificate and decided whether to | 5231 accept it or not. This may be convenient in cases where it | 5232 is a personal proxy or the client in some other way have a | 5233 very strong trust relation with the proxy (e.g. the proxy | 5234 includes other out-of-band possibilities for the client to | 5235 configure policies in the proxy). | 5237 User, which means that the proxy (or proxies) MUST send | 5238 credential information about the next hop to the client for | 5239 authorization. The client can then decide whether the proxy | 5240 should accept the certificate or not. See section 17.3.2 | 5241 for further details. | 5243 If the Accept-Credentials header is not included in the RTSP request | 5244 from the client, the default method used SHALL be "Proxy". If | 5245 something else than the "Proxy" method is used, the Accept- | 5246 Credentials header SHALL always be included in the RTSP request from | 5247 the client. This is because it cannot be assumed that the proxy | 5248 always keeps the TLS state or the users previously preference between | 5249 different RTSP messages (in particular if the time interval between | 5250 the messages is long). | 5252 The "Any" and "Proxy" methods does not require the proxy to provide | 5253 any specific response, but only apply the policy as defined for | 5254 respectively method. If the policy does not accept the credentials of | 5255 the next hop, the entity SHALL respond with a message using status | 5256 code 471 (Connection Credentials not accepted). | 5258 An RTSP request in the direction server to client MUST NOT include | 5259 the Accept-Credential header. As for the non-secured communication, | 5260 the possibility for these request depend on the presence of a client | 5261 established connection. However if the server to client request is in | 5262 relation to a session established over a TLS secured channel, if MUST | 5263 be sent in a TLS secured connection. That secured connection MUST | 5264 also be the one used by the last client to server request. If no such | 5265 transport connection exist at the time when the server desire to send | 5266 the request, it silently fails. | 5268 Further policies MAY be defined and registered, but should be done so | 5269 with caution. | 5271 17.3.2 User approved TLS procedure | 5272 For the "User" method each proxy MUST perform the the following | 5273 procedure for each RTSP request: | 5275 o Setup the TLS session to the next hop if not already present | 5276 (i.e. run the TLS handshake, but do not send the RTSP | 5277 request). | 5279 o Extract the peer certificate for the TLS session. | 5281 o Check if a matching identity and hash of the peer certificate | 5282 is present in the Accept-Credentials header. If present, send | 5283 the message to the next hop, and conclude these procedures. If | 5284 not, go to the next step. | 5286 o The proxy responds to the RTSP request with a 470 or 407 | 5287 response code. The 407 response code MAY be used when the | 5288 proxy requires both user and connection authorization from | 5289 user or client. In this message the proxy SHALL include a | 5290 Accept-Credentials header with the next hop's identity and | 5291 certificate. | 5293 The client MUST upon receiving a 470 or 407 response with Accept- | 5294 Credentials take the decision on whether to accept the certificate or | 5295 not (if it cannot do so, the user SHOULD be consulted). If the | 5296 certificate is accepted, the client have to again send the RTSP | 5297 request. In that request the client have to include the Accept- | 5298 Credentials header including the hash over the DER encoded | 5299 certificate for all trusted proxies in the chain. | 5301 Example: | 5302 Accept-Credentials:User, | 5303 "rtsps://proxy2.example.com/";exaIl9VMbQMOFGClx5rXnPJKVNI=, | 5304 "rtsps://server.example.com/";lurbjj5khhB0NhIuOXtt4bBRH1M= | 5306 The implication is that the connection for secured RTSP messages may | 5307 take significantly more round-trip times for the first message. As | 5308 each proxy that has to be accepted will result in a complete extra | 5309 message exchange between the proxy connecting to the next hop and the | 5310 client. However after the first message exchange the remaining | 5311 message should not be delayed, as each message shall contain the | 5312 chain of proxies that the requestor accepts. The procedure of | 5313 including the credentials in each request rather than building state | 5314 in each proxy, avoids the need for revocation procedures. | 5316 18 Syntax 5318 The RTSP syntax is described in an augmented Backus-Naur Form (BNF) 5319 as defined in RFC 2234 [5]. 5321 18.1 Base Syntax 5323 OCTET = %x00-FF 5324 CHAR = %x01-7F 5325 UPALPHA = %x41-5A 5326 LOALPHA = %x61-7A 5327 ALPHA = UPALPHA / LOALPHA 5328 DIGIT = %x30-39 5329 CTL = %x00-1F / %x7F 5331 CR = %x0D 5332 LF = %x0A 5333 SP = %x20 5334 HT = %x09 5335 DQUOTE = %x22 5336 BACKSLASH = %x5C 5337 CRLF = CR LF 5339 LWS = [CRLF] 1*( SP / HT ) 5340 TEXT = %x20-7D / %x80-FF 5341 tspecials = "(" / ")" / "<" / ">" / "@" 5342 / "," / ";" / ":" / BACKSLASH / DQUOTE 5343 / "/" / "[" / "]" / "?" / "=" 5344 / "{" / "}" / SP / HT 5345 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 5346 / %x41-5A / %x5E-7A / %x7C / %x7E) 5347 1* 5348 quoted-string = ( DQUOTE *(qdtext) DQUOTE ) 5349 qdtext = %x20-21 / %x23-7D / %x80-FF > 5350 quoted-pair = BACKSLASH CHAR 5352 safe = "$" / "-" / "_" / "." / "+" 5353 extra = "!" / "*" / "'" / "(" / ")" / "," 5354 hex = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" / 5355 "a" / "b" / "c" / "d" / "e" / "f" 5356 escape = "%" hex hex 5357 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 5358 unreserved = alpha / digit / safe / extra 5359 xchar = unreserved / reserved / escape 5360 base64 = 0*base64-unit [base64-pad] 5361 base64-unit = 4base64-char 5362 base64-pad = (2base64-char "==") / (3base64-char "=") 5363 base64-char = ALPHA / DIGIT / "+" / "/" 5365 18.2 RTSP Protocol Definition 5367 18.2.1 Generic Protocol elements 5369 absoluteURL = as defined in RFC 2396 [13] and RFC2732 [12] 5370 relativeURL = as defined in RFC 2396 [13] and RFC2732 [12] 5371 rtsp_URL = rtsp-scheme "//" host [":" port] 5372 [abs_path ["?" query]] ["#" fragment] 5373 rtsp-scheme = ( "rtsp:" / "rtspu:" / "rtsps:" ) 5374 host = As defined by RFC 2732 [12] 5375 abs_path = As defined by RFC 2396 [13] 5376 port = *DIGIT ; Is expected to be 1*5DIGIT 5377 query = As defined by RFC 2396 [13] 5378 fragment = As defined by RFC 2396 [13] 5380 smpte-range = smpte-type "=" smpte-range-spec 5381 ;Section 3.4 5382 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 5383 / ( "-" smpte-time ) 5384 smpte-type = "smpte" / "smpte-30-drop" 5385 / "smpte-25" / smpte-type-extension 5386 ; other timecodes may be added 5387 smpte-type-extension = token 5388 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 5389 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 5391 npt-range = ["npt" "="] npt-range-spec ; Section 3.5 5392 ; implementations SHOULD use npt= prefix, 5393 ;but SHOULD be prepared to interoperate with 5394 ; RFC 2326 implementations which don't use it. 5395 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 5396 npt-time = "now" / npt-sec / npt-hhmmss 5397 npt-sec = 1*DIGIT [ "." *DIGIT ] 5398 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." *DIGIT ] 5399 npt-hh = 1*DIGIT ; any positive number 5400 npt-mm = 1*2DIGIT ; 0-59 5401 npt-ss = 1*2DIGIT ; 0-59 5403 utc-range = "clock" "=" utc-range-spec ; Section 3.6 5404 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 5405 utc-time = utc-date "T" utc-clock "Z" 5406 utc-date = 8DIGIT ; < YYYYMMDD > 5407 utc-clock = 6DIGIT [ "." fraction ]; < HHMMSS.fraction > 5408 fraction = 1*DIGIT 5410 feature-tag = token 5411 session-id = 8*( ALPHA / DIGIT / safe ) 5412 message-header = field-name ":" [ field-value ] CRLF 5413 field-name = token 5414 field-value = *( field-content / LWS ) 5415 field-content = 5419 18.2.2 Message Syntax 5421 RTSP-message = Request / Response ; RTSP/1.0 messages 5422 Request = Request-Line ; Section 6.1 5423 *( general-header ; Section 5 5424 / request-header ; Section 6.2 5425 / entity-header ) ; Section 8.1 5426 CRLF 5427 [ message-body ] ; Section 4.3 5428 Response = Status-Line ; Section 7.1 5429 *( general-header ; Section 5 5430 / response-header ; Section 7.1.2 5431 / entity-header ) ; Section 8.1 5432 CRLF 5433 [ message-body ] ; Section 4.3 5435 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 5436 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 5437 Method = "DESCRIBE" ; Section 11.2 5438 / "GET_PARAMETER" ; Section 11.7 5439 / "OPTIONS" ; Section 11.1 5440 / "PAUSE" ; Section 11.5 5441 / "PLAY" ; Section 11.4 5442 / "PING" ; Section 11.10 5443 / "REDIRECT" ; Section 11.9 5444 / "SETUP" ; Section 11.3 5445 / "SET_PARAMETER" ; Section 11.8 5446 / "TEARDOWN" ; Section 11.6 5447 / extension-method 5448 extension-method = token 5450 Request-URI = "*" / absolute_URL 5451 RTSP-Version = "RTSP" "/" 1*DIGIT "." 1*DIGIT 5453 Status-Code = "100" ; Continue 5454 / "200" ; OK 5455 / "201" ; Created 5456 / "250" ; Low on Storage Space 5457 / "300" ; Multiple Choices 5458 / "301" ; Moved Permanently 5459 / "302" ; Moved Temporarily 5460 / "303" ; See Other 5461 / "304" ; Not Modified 5462 / "305" ; Use Proxy 5463 / "400" ; Bad Request 5464 / "401" ; Unauthorized 5465 / "402" ; Payment Required 5466 / "403" ; Forbidden 5467 / "404" ; Not Found 5468 / "405" ; Method Not Allowed 5469 / "406" ; Not Acceptable 5470 / "407" ; Proxy Authentication Required 5471 / "408" ; Request Time-out 5472 / "410" ; Gone 5473 / "411" ; Length Required 5474 / "412" ; Precondition Failed 5475 / "413" ; Request Entity Too Large 5476 / "414" ; Request-URI Too Large 5477 / "415" ; Unsupported Media Type 5478 / "451" ; Parameter Not Understood 5479 / "452" ; reserved 5480 / "453" ; Not Enough Bandwidth 5481 / "454" ; Session Not Found 5482 / "455" ; Method Not Valid in This State 5483 / "456" ; Header Field Not Valid for Resource 5484 / "457" ; Invalid Range 5485 / "458" ; Parameter Is Read-Only 5486 / "459" ; Aggregate operation not allowed 5487 / "460" ; Only aggregate operation allowed 5488 / "461" ; Unsupported transport 5489 / "462" ; Destination unreachable 5490 / "470" ; Connection Authorization Required 5491 / "471" ; Connection Credentials not accepted 5492 / "500" ; Internal Server Error 5493 / "501" ; Not Implemented 5494 / "502" ; Bad Gateway 5495 / "503" ; Service Unavailable 5496 / "504" ; Gateway Time-out 5497 / "505" ; RTSP Version not supported 5498 / "551" ; Option not supported 5499 / extension-code 5501 extension-code = 3DIGIT 5502 Reason-Phrase = * 5504 general-header = Cache-Control ; Section 14.10 5505 / Connection ; Section 14.11 5506 / CSeq ; Section 14.18 5507 / Date ; Section 14.19 5508 / Supported ; Section 14.41 5509 / Timestamp ; Section 14.42 5510 / Via ; Section 14.47 5511 / extension-header 5513 request-header = Accept ; Section 14.1 and [H14.1] | 5514 / Accept-Credentials ; Section 14.2 | 5515 / Accept-Encoding ; Section 14.3 and [H14.3] | 5516 / Accept-Language ; Section 14.4 and [H14.4] | 5517 / Authorization ; Section 14.7 and [H14.8] | 5518 / Bandwidth ; Section 14.8 | 5519 / Blocksize ; Section 14.9 | 5520 / From ; Section 14.22 | 5521 / If-Match ; Section 14.24 | 5522 / If-Modified-Since ; Section 14.25 and [H14.25] | 5523 / If-None-Match ; Section 14.26 | 5524 / Proxy-Require ; Section 14.30 | 5525 / Range ; Section 14.32 | 5526 / Referer ; Section 14.33 | 5527 / Require ; Section 14.35 | 5528 / Scale ; Section 14.37 | 5529 / Session ; Section 14.40 | 5530 / Speed ; Section 14.38 | 5531 / Supported ; Section 14.41 | 5532 / Transport ; Section 14.43 | 5533 / User-Agent ; Section 14.45 | 5534 / extension-header | 5536 response-header = Accept-Credentials ; Section 14.2 | 5537 / Accept-Ranges ; Section 14.5 | 5538 / ETag ; Section 14.20 | 5539 / Location ; Section 14.28 | 5540 / Proxy-Authenticate ; Section 14.29 | 5541 / Public ; Section 14.31 | 5542 / Range ; Section 14.32 | 5543 / Retry-After ; Section 14.34 | 5544 / RTP-Info ; Section 14.36 | 5545 / Scale ; Section 14.37 | 5546 / Session ; Section 14.40 | 5547 / Server ; Section 14.39 | 5548 / Speed ; Section 14.38 | 5549 / Transport ; Section 14.43 | 5550 / Unsupported ; Section 14.44 | 5551 / Vary ; Section 14.46 | 5552 / WWW-Authenticate ; Section 14.48 | 5553 / extension-header | 5555 entity-header = Allow ; Section 14.6 5556 / Content-Base ; Section 14.12 5557 / Content-Encoding ; Section 14.13 5558 / Content-Language ; Section 14.14 5559 / Content-Length ; Section 14.15 5560 / Content-Location ; Section 14.16 5561 / Content-Type ; Section 14.17 5562 / Expires ; Section 14.21 and [H14.21] 5563 / Last-Modified ; Section 14.27 5564 / extension-header 5566 extension-header = message-header 5568 18.2.3 Header Syntax 5570 All header syntaxes not defined in this section are defined in 5571 chapter 14 of the HTTP 1.1 specification [4]. | 5573 accept-credentials = "Accept-Credentials" ":" accept-cred-data | 5574 accept-cred-data = credential-decision / credential-info | 5575 credential-decision = ("User" "," [credential-info]) | 5576 / "Proxy" | 5577 / "Any" | 5578 / token ; For future extensions | 5579 credential-info = cred-info-data 0*("," cred-info-data) | 5580 cred-info-data = DQUOTE rtsp_URL DQUOTE ";" base64 | 5581 Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges | 5582 acceptable-ranges = (range-unit *("," LWS range-unit)) | 5583 / "none" | 5584 range-unit = NPT / SMPTE / UTC / extension-format | 5585 extension-format = token | 5586 Bandwidth = "Bandwidth" ":" 1*DIGIT | 5587 Blocksize = "Blocksize" ":" 1*DIGIT | 5589 Cache-Control = "Cache-Control" ":" cache-directive 5590 *("," LWS cache-directive) 5591 cache-directive = cache-request-directive 5592 / cache-response-directive 5593 cache-request-directive = "no-cache" 5594 / "max-stale" ["=" delta-seconds] 5595 / "min-fresh" "=" delta-seconds 5596 / "only-if-cached" 5597 / cache-extension 5598 cache-response-directive = "public" 5599 / "private" 5600 / "no-cache" 5601 / "no-transform" 5602 / "must-revalidate" 5603 / "proxy-revalidate" 5604 / "max-age" "=" delta-seconds 5605 / cache-extension 5606 cache-extension = token ["=" (token / quoted-string)] 5607 delta-seconds = 1*DIGIT 5608 Content-Base = "Content-Base" ":" absoluteURL 5609 CSeq = "Cseq" ":" 1*DIGIT 5610 Proxy-Require = "Proxy-Require" ":" feature-tag 5611 *("," LWS feature-tag) 5612 Public = "Public" ":" method *("," LWS method) 5613 Range = "Range" ":" ranges-spec *("," LWS ranges-spec) 5614 [ ";" "time" "=" utc-time ] 5615 ranges-spec = npt-range / utc-range / smpte-range 5616 Require = "Require" ":" feature-tag *("," LWS feature-tag) 5618 RTP-Info = "RTP-Info" ":" rtsp-info-spec 5619 *("," LWS rtsp-info-spec) 5620 rtsp-info-spec = stream-url 1*parameter 5621 stream-url = quoted-url / unquoted-url 5622 unquoted-url = "url" "=" safe-url 5623 quoted-url = "url" "=" DQUOTE needquote-url DQUOTE 5624 safe-url = url 5625 needquote-url = url //That contains ; or , 5626 url = ( absoluteURL / relativeURL ) 5627 parameter = ";" "seq" "=" 1*DIGIT 5628 / ";" "rtptime" "=" 1*DIGIT 5630 Scale = "Scale" ":" [ "-" ] 1*DIGIT [ "." *DIGIT ] 5631 Speed = "Speed" ":" 1*DIGIT [ "." *DIGIT ] 5632 Server = "Server" ":" ( product / comment ) 5633 *(SP (product / comment)) 5634 Session = "Session" ":" session-id 5635 [ ";" "timeout" "=" delta-seconds ] 5636 Supported = "Supported" ":" [feature-tag *("," LWS feature-tag)] 5638 Timestamp = "Timestamp" ":" *(DIGIT) ["." *(DIGIT)] [delay] 5639 delay = *(DIGIT) [ "." *(DIGIT) ] 5640 Transport = "Transport" ":" transport-spec 5641 *("," LWS transport-spec) 5642 transport-spec = transport-id *parameter 5643 transport-id = transport-prot "/" profile ["/" lower-transport] 5644 ; no LWS is allowed inside transport-id 5646 transport-prot = "RTP" / token 5647 profile = "AVP" / token 5648 lower-transport = "TCP" / "UDP" / token 5649 parameter = ";" ( "unicast" / "multicast" ) 5650 / ";" "source" "=" host 5651 / ";" "destination" [ "=" host ] 5652 / ";" "interleaved" "=" channel [ "-" channel ] 5653 / ";" "append" 5654 / ";" "ttl" "=" ttl 5655 / ";" "layers" "=" 1*DIGIT 5656 / ";" "port" "=" port-spec 5657 / ";" "client_port" "=" port-spec 5658 / ";" "server_port" "=" port-spec 5659 / ";" "ssrc" "=" ssrc *("/" ssrc) 5660 / ";" "client_ssrc" "=" ssrc 5661 / ";" "mode" "=" mode-spec 5662 / ";" "dest_addr" "=" addr-list 5663 / ";" "src_addr" "=" addr-list 5664 / ";" trn-param-ext 5665 port-spec = port [ "-" port ] 5666 trn-param-ext = par-name "=" trn-par-value 5667 par-name = token 5668 trn-par-value = *(unreserved / DQUOTE *TEXT DQUOTE) 5669 ttl = 1*3(DIGIT) 5670 ssrc = 8*8(HEX) 5671 channel = 1*3(DIGIT) 5672 mode-spec = ( DQUOTE mode *("," *SP mode) DQUOTE ) / mode 5673 mode = "PLAY" / "RECORD" / token 5674 addr-list = quoted-host-port *("/" quoted-host-port) 5675 quoted-host-port = DQUOTE host [":" port] DQUOTE 5677 Unsupported = "Unsupported" ":" feature-tag *("," feature-tag) 5678 User-Agent = "User-Agent" ":" ( product / comment ) 5679 0*(SP (product / comment) 5681 19 Security Considerations 5683 Because of the similarity in syntax and usage between RTSP servers 5684 and HTTP servers, the security considerations outlined in [H15] 5685 apply. Specifically, please note the following: 5687 Abuse of Server Log Information: RTSP and HTTP servers will | 5688 presumably have similar logging mechanisms, and thus should 5689 be equally guarded in protecting the contents of those 5690 logs, thus protecting the privacy of the users of the 5691 servers. See [H15.1.1] for HTTP server recommendations 5692 regarding server logs. 5694 Transfer of Sensitive Information: There is no reason to believe 5695 that information transferred via RTSP may be any less 5696 sensitive than that normally transmitted via HTTP. 5697 Therefore, all of the precautions regarding the protection 5698 of data privacy and user privacy apply to implementors of 5699 RTSP clients, servers, and proxies. See [H15.1.2] for 5700 further details. 5702 Attacks Based On File and Path Names: Though RTSP URLs are 5703 opaque handles that do not necessarily have file system 5704 semantics, it is anticipated that many implementations will 5705 translate portions of the request URLs directly to file 5706 system calls. In such cases, file systems SHOULD follow the 5707 precautions outlined in [H15.5], such as checking for ".." 5708 in path components. 5710 Personal Information: RTSP clients are often privy to the same 5711 information that HTTP clients are (user name, location, 5712 etc.) and thus should be equally. See [H15.1] for further 5713 recommendations. 5715 Privacy Issues Connected to Accept Headers: Since may of the 5716 same "Accept" headers exist in RTSP as in HTTP, the same 5717 caveats outlined in [H15.1.4] with regards to their use 5718 should be followed. 5720 DNS Spoofing: Presumably, given the longer connection times 5721 typically associated to RTSP sessions relative to HTTP 5722 sessions, RTSP client DNS optimizations should be less 5723 prevalent. Nonetheless, the recommendations provided in 5724 [H15.3] are still relevant to any implementation which 5725 attempts to rely on a DNS-to-IP mapping to hold beyond a 5726 single use of the mapping. 5728 Location Headers and Spoofing: If a single server supports 5729 multiple organizations that do not trust one another, then 5730 it must check the values of Location and Content-Location 5731 header fields in responses that are generated under control 5732 of said organizations to make sure that they do not attempt 5733 to invalidate resources over which they have no authority. 5734 ([H15.4]) 5736 In addition to the recommendations in the current HTTP specification 5737 (RFC 2616 [4], as of this writing) and also of the previous RFC2068 5738 [20], future HTTP specifications may provide additional guidance on 5739 security issues. 5741 The following are added considerations for RTSP implementations. 5743 Concentrated denial-of-service attack: The protocol offers the 5744 opportunity for a remote-controlled denial-of-service 5745 attack. 5747 The attacker may initiate traffic flows to one or more IP 5748 addresses by specifying them as the destination in SETUP 5749 requests. While the attacker's IP address may be known in 5750 this case, this is not always useful in prevention of more 5751 attacks or ascertaining the attackers identity. Thus, an 5752 RTSP server SHOULD only allow client-specified destinations 5753 for RTSP-initiated traffic flows if the server has verified 5754 the client's identity, either against a database of known 5755 users using RTSP authentication mechanisms (preferably 5756 digest authentication or stronger), or other secure means. 5758 Session hijacking: Since there is no or little relation between 5759 a transport layer connection and an RTSP session, it is 5760 possible for a malicious client to issue requests with 5761 random session identifiers which would affect unsuspecting 5762 clients. The server SHOULD use a large, random and non- 5763 sequential session identifier to minimize the possibility 5764 of this kind of attack. 5766 Authentication: Servers SHOULD implement both basic and digest | 5767 [8] authentication. In environments requiring tighter | 5768 security for the control messages, the transport layer | 5769 mechanism TLS (RFC 2246 [7]) SHOULD be used. 5771 Stream issues: RTSP only provides for stream control. Stream 5772 delivery issues are not covered in this section, nor in the 5773 rest of this draft. RTSP implementations will most likely 5774 rely on other protocols such as RTP, IP multicast, RSVP and 5775 IGMP, and should address security considerations brought up 5776 in those and other applicable specifications. 5778 Persistently suspicious behavior: RTSP servers SHOULD return 5779 error code 403 (Forbidden) upon receiving a single instance 5780 of behavior which is deemed a security risk. RTSP servers 5781 SHOULD also be aware of attempts to probe the server for 5782 weaknesses and entry points and MAY arbitrarily disconnect 5783 and ignore further requests clients which are deemed to be 5784 in violation of local security policy. 5786 20 IANA Considerations 5788 This section set up a number of registers for RTSP that should be 5789 maintained by IANA. For each registry there is a description on what 5790 it shall contain, what specification is needed when adding a entry 5791 with IANA, and finally the entries that this document needs to 5792 register. See also the section 1.6 "Extending RTSP". There is also an 5793 IANA registration of two SDP attributes. 5795 The sections describing how to register an item uses some of the 5796 requirements level described in RFC 2434 [21], namely " First Come, 5797 First Served", "Specification Required", and "Standards Action". 5799 A registration request to IANA MUST contain the following 5800 information: 5802 o A name of the item to register according to the rules 5803 specified by the intended registry. 5805 o Indication of who has change control over the feature (for 5806 example, IETF, ISO, ITU-T, other international standardization 5807 bodies, a consortium, a particular company or group of 5808 companies, or an individual); 5810 o A reference to a further description, if available, for 5811 example (in order of preference) an RFC, a published standard, 5812 a published paper, a patent filing, a technical report, 5813 documented source code or a computer manual; 5815 o For proprietary features, contact information (postal and 5816 email address); 5818 20.1 Feature-tags 5820 20.1.1 Description 5822 When a client and server try to determine what part and functionality 5823 of the RTSP specification and any future extensions that its counter 5824 part implements there is need for a namespace. This registry 5825 contains named entries representing certain functionality. 5827 The usage of feature-tags is explained in section 10 and 11.1. 5829 20.1.2 Registering New Feature-tags with IANA 5831 The registering of feature-tags is done on a first come, first served 5832 basis. 5834 The name of the feature MUST follow these rules: The name may be of 5835 any length, but SHOULD be no more than twenty characters long. The 5836 name MUST not contain any spaces, or control characters. The 5837 registration SHALL indicate if the feature tag applies to servers 5838 only, proxies only or both server and proxies. Any proprietary 5839 feature SHALL have as the first part of the name a vendor tag, which 5840 identifies the organization. 5842 20.1.3 Registered entries 5844 The following feature-tags are in this specification defined and 5845 hereby registered. The change control belongs to the Authors and the 5846 IETF MMUSIC WG. 5848 play.basic: The minimal implementation for playback operations 5849 according to section D. Applies for both servers and 5850 proxies. 5852 play.scale: Support of scale operations for media playback. 5853 Applies only for servers. 5855 play.speed: Support of the speed functionality for playback. 5856 Applies only for servers 5858 20.2 RTSP Methods 5860 20.2.1 Description 5862 What a method is, is described in section 11. Extending the protocol 5863 with new methods allow for totally new functionality. 5865 20.2.2 Registering New Methods with IANA 5867 A new method MUST be registered through an IETF standard track 5868 document. The reason is that new methods may radically change the 5869 protocols behavior and purpose. 5871 A specification for a new RTSP method MUST consist of the following 5872 items: 5874 o A method name which follows the BNF rules for methods. 5876 o A clear specification on what action and response a request 5877 with the method will result in. Which directions the method is 5878 used, C -> S or S -> C or both. How the use of headers, if 5879 any, modifies the behavior and effect of the method. 5881 o A list or table specifying which of the registered headers 5882 that are allowed to use with the method in request or/and 5883 response. 5885 o Describe how the method relates to network proxies. 5887 20.2.3 Registered Entries 5889 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 5890 GET_PARAMETER, OPTIONS, PAUSE, PING, PLAY, REDIRECT, SETUP, 5891 SET_PARAMETER, and TEARDOWN. 5893 20.3 RTSP Status Codes 5895 20.3.1 Description 5897 A status code is the three digit numbers used to convey information 5898 in RTSP response messages, see 7. The number space is limited and 5899 care should be taken not to fill the space. 5901 20.3.2 Registering New Status Codes with IANA 5903 A new status code can only be registered by an IETF standards track 5904 document. A specification for a new status code MUST specify the 5905 following: 5907 o The requested number. 5909 o A description what the status code means and the expected 5910 behavior of the sender and receiver of the code. 5912 20.3.3 Registered Entries 5914 RFCXXX, registers the numbered status code defined in the BNF entry 5915 "Status-Code" except "extension-code" in section 18.2.2. 5917 20.4 RTSP Headers 5919 20.4.1 Description 5921 By specifying new headers a method(s) can be enhanced in many 5922 different ways. An unknown header will be ignored by the receiving 5923 entity. If the new header is vital for a certain functionality, a 5924 feature-tag for the functionality can be created and demanded to be 5925 used by the counter-part with the inclusion of a Require header 5926 carrying the feature-tag. 5928 20.4.2 Registering New Headers with IANA 5930 A public available specification is required to register a header. 5931 The specification SHOULD be a standards document, preferable an IETF 5932 RFC. 5934 The specification MUST contain the following information: 5936 o The name of the header. 5938 o A BNF specification of the header syntax. 5940 o A list or table specifying when the header may be used, 5941 encompassing all methods, their request or response, the 5942 direction (C -> S or S -> C). 5944 o How the header shall be handled by proxies. 5946 o A description of the purpose of the header. 5948 20.4.3 Registered entries 5950 All headers specified in section 14 in RFCXXXX are to be registered. 5952 Furthermore the following RTSP headers defined in other 5953 specifications are registered: 5955 o x-wap-profile defined in [39]. 5957 o x-wap-profile-diff defined in [39]. 5959 o x-wap-profile-warning defined in [39]. 5961 o x-predecbufsize defined in [39]. 5963 o x-initpredecbufperiod defined in [39]. 5965 o x-initpostdecbufperiod defined in [39]. 5967 Note: The use of "X-" is NOT RECOMMENDED but the above headers 5968 in the register list was defined prior to the clarification. 5970 20.5 Transport Header registries 5972 The transport header contains a number of parameters which have 5973 possibilities for future extensions. Therefore registries for these 5974 must be defined. 5976 20.5.1 Transport Protocols 5978 A registry for the parameter transport-protocol shall be defined with 5979 the following rules: 5981 o Registering requires public available standards specification. 5983 o A contact person or organization with address and email. 5985 o A value definition that are following the BNF token 5986 definition. 5988 o A describing text that explains how the registered value are 5989 used in RTSP. 5991 This specification registers 1 value: 5993 o Use of the RTP [18] protocol for media transport. The usage 5994 is explained in RFC XXXX, appendix B.1. 5996 20.5.2 Profile 5998 A registry for the parameter profile shall be defined with the 5999 following rules: 6001 o Registering requires public available standards specification. 6003 o A contact person or organization with address and email. 6005 o A value definition that are following the BNF token 6006 definition. 6008 o A definition of which Transport protocol(s) that this profile 6009 is valid for. 6011 o A describing text that explains how the registered value are 6012 used in RTSP. 6014 This specification registers 1 value: 6016 o The "RTP profile for audio and video conferences with minimal 6017 control" [3] MUST only be used when the transport 6018 specification's transport-protocol is "RTP". 6020 20.5.3 Lower Transport 6022 A registry for the parameter lower-transport shall be defined with 6023 the following rules: 6025 o Registering requires public available standards specification. 6027 o A contact person or organization with address and email. 6029 o A value definition that are following the BNF token 6030 definition. 6032 o A text describing how the registered value are used in RTSP. 6034 This specification registers 2 values: 6036 o Indicates the use of the "User datagram protocol" [9] for 6037 media transport. 6039 o Indicates the use Transmission control protocol [10] for 6040 media transport. 6042 20.5.4 Transport modes 6044 A registry for the transport parameter mode shall be defined with the 6045 following rules: 6047 o Registering requires a IETF standard tracks document. 6049 o A contact person or organization with address and email. 6051 o A value definition that are following the BNF token 6052 definition. 6054 o A describing text that explains how the registered value are 6055 used in RTSP. 6057 This specification registers 2 values: 6059 o See RFC XXXX. 6061 o See RFC XXXX. 6063 20.6 Cache Directive Extensions 6065 There exist a number of cache directives which can be sent in the 6066 Cache-Control header. A registry for this cache directives shall be 6067 defined with the following rules: 6069 o Registering requires a IETF standard tracks document. 6071 o A registration shall name a contact person. 6073 o Name of the directive and a definition of the value, if any. 6075 o Specification if it is an request or response directive. 6077 o A describing text that explains how the cache directive is 6078 used for RTSP controlled media streams. 6080 This specification registers the following values: 6082 no-cache: 6084 public: 6086 private: 6088 no-transform: 6090 only-if-cached: 6092 max-stale: 6094 min-fresh: 6096 must-revalidate: 6098 proxy-revalidate: 6100 max-age: 6102 20.7 Accept-Credentials policies 6104 In section 17.3.1 three policies for how to handle certificates. 6105 Further policies may be defined and be registered with IANA using the 6106 following rules: 6108 o Registering requires an IETF standard tracks document. 6110 o A registration shall name a contact person. 6112 o Name of the policy. 6114 o A describing text that explains how the policy works for 6115 handling the certificates. 6117 This specification registers the following values: 6119 Any 6121 Proxy 6123 User 6125 20.8 SDP attributes 6127 This specification defines two SDP [2] attributes that it is 6128 requested that IANA register. 6130 SDP Attribute ("att-field"): 6132 Attribute name: range 6133 Long form: Media Range Attribute 6134 Type of name: att-field 6135 Type of attribute: Media and session level 6136 Subject to charset: No 6137 Purpose: RFC XXXX 6138 Reference: RFC XXXX 6139 Values: See ABNF definition. 6141 Attribute name: control 6142 Long form: RTSP control URL 6143 Type of name: att-field 6144 Type of attribute: Media and session level 6145 Subject to charset: No 6146 Purpose: RFC XXXX 6147 Reference: RFC XXXX 6148 Values: Absolute or Relative URLs. 6150 Attribute name: etag 6151 Long form: Entity Tag 6152 Type of name: att-field 6153 Type of attribute: Media and session level 6154 Subject to charset: No 6155 Purpose: RFC XXXX 6156 Reference: RFC XXXX 6157 Values: See ABNF definition 6159 A RTSP Protocol State Machine 6161 The RTSP session state machine describe the behavior of the protocol 6162 from RTSP session initialization through RTSP session termination. 6164 State machine is defined on a per session basis which is uniquely 6165 identified by the RTSP session identifier. The session may contain 6166 one or more media streams depending on state. If a single media 6167 stream is part of the session it is in non-aggregated control. If two 6168 or more is part of the session it is in aggregated control. 6170 This state machine is one possible representation that helps explain 6171 how the protocol works and when different requests are allowed. We 6172 find it a reasonable representation but does not mandate it, and 6173 other representations can be created. 6175 A.1 States 6177 The state machine contains three states, described below. For each 6178 state there exist a table which shows which requests and events that 6179 is allowed and if they will result in a state change. 6181 Init: Initial state no session exist. 6183 Ready: Session is ready to start playing. 6185 Play: Session is playing, i.e. sending media stream data in the 6186 direction S -> C. 6188 A.2 State variables 6190 This representation of the state machine needs more than its state to 6191 work. A small number of variables are also needed and is explained 6192 below. 6194 NRM: The number of media streams part of this session. 6196 RP: Resume point, the point in the presentation time line at 6197 which a request to continue will resume from. A time format 6198 for the variable is not mandated. 6200 A.3 Abbreviations 6202 To make the state tables more compact a number of abbreviations are 6203 used, which are explained below. 6205 IFI: IF Implemented. 6207 md: Media 6209 PP: Pause Point, the point in the presentation time line at 6210 which the presentation was paused. 6212 Prs: Presentation, the complete multimedia presentation. 6214 RedP: Redirect Point, the point in the presentation time line at 6215 which a REDIRECT was specified to occur. 6217 SES: Session. 6219 A.4 State Tables 6221 This section contains a table for each state. The table contains all 6222 the requests and events that this state is allowed to act on. The 6223 events which is method names are, unless noted, requests with the 6224 given method in the direction client to server (C -> S). In some 6225 cases there exist one or more requisite. The response column tells 6226 what type of response actions should be performed. Possible actions 6227 that is requested for an event includes: response codes, e.g. 200, 6228 headers that MUST be included in the response, setting of state 6229 variables, or setting of other session related parameters. The new 6230 state column tells which state the state machine shall change to. 6232 The response to valid request meeting the requisites is normally a 6233 2xx (SUCCESS) unless other noted in the response column. The 6234 exceptions shall be given a response according to the response 6235 column. If the request does not meet the requisite, is erroneous or 6236 some other type of error occur the appropriate response code MUST be 6237 sent. If the response code is a 4xx the session state is unchanged. A 6238 response code of 3rr will result in that the session is ended and its 6239 state is changed to Init. A response code of 304 results in no state 6240 change. However there exist restrictions to when a 3xx response may 6241 be used. A 5xx response SHALL not result in any change of the session 6242 state, except if the error is not possible to recover from. A 6243 unrecoverable error SHALL result the ending of the session. As it in 6244 the general case can't be determined if it was a unrecoverable error 6245 or not the client will be required to test. In the case that the next 6246 request after a 5xx is responded with 454 (Session Not Found) the 6247 client shall assume that the session has been ended. 6249 The server will timeout the session after the period of time 6250 specified in the SETUP response, if no activity from the client is 6251 detected. Therefore there exist a timeout event for all states 6252 except Init. 6254 In the case that NRM=1 the presentation URL is equal to the media 6255 URL. For NRM>1 the presentation URL MUST be other than any of the 6256 medias that are part of the session. This applies to all states. 6258 The methods in Table 13 do not have any effect on the state machine 6259 or the state variables. However some methods do change other session 6260 related parameters, for example SET_PARAMETER which will set the 6261 parameter(s) specified in its body. 6263 The initial state of the state machine, see Table 14 can only be left 6264 by processing a correct SETUP request. As seen in the table the two 6265 state variables are also set by a correct request. This table also 6266 shows that a correct SETUP can in some cases be redirected to another 6267 URL and/or server by a 3rr response. 6269 Event Prerequisite Response 6270 ______________________________________________________________ 6271 DESCRIBE Needs REDIRECT 3rr Redirect 6272 DESCRIBE 200, Session description 6273 OPTIONS Session ID 200, Reset session timeout timer 6274 OPTIONS 200 6275 SET_PARAMETER Valid parameter 200, change value of parameter 6276 GET_PARAMETER Valid parameter 200, return value of parameter 6278 Table 13: None state-machine changing events 6280 Action Requisite New State Response 6282 _____________________________________________________________ 6283 SETUP Ready NRM=1, RP=0.0 6284 SETUP Needs Redirect Init 3rr Redirect 6285 S -> C:REDIRECT No Session hdr Init Terminate all SES 6287 Table 14: State: Init 6289 Action Requisite New State Response 6290 _____________________________________________________________________ 6291 SETUP New URL Ready NRM+=1 6292 SETUP Setten up URL Ready Change transport param 6293 TEARDOWN Prs URL,NRM>1 Init No session hdr 6294 TEARDOWN md URL,NRM=1 Init No Session hdr, NRM=0 6295 TEARDOWN md URL,NRM>1 Ready Session hdr, NRM-=1 6296 PLAY Prs URL, No range Play Play from RP 6297 PLAY Prs URL, Range Play according to range 6298 PAUSE Prs URL Ready Return PP 6299 S -> C:REDIRECT Range hdr Ready Set RedP 6300 S -> C:REDIRECT no range hdr Init Session is removed 6301 Timeout Init 6302 RedP reached Ready TEARDOWN of session 6304 Table 15: State: Ready 6306 In the Ready state, see Table 15, some of the actions are depending 6307 on the number of media streams (NRM) in the session, i.e. aggregated 6308 or non-aggregated control. A setup request in the ready state can 6309 either add one more media stream to the session or if the media 6310 stream (same URL) already is part of the session change the transport 6311 parameters. TEARDOWN is depending on both the request URL and the 6312 number of media stream within the session. If the request URL is the 6313 presentations URL the whole session is torn down. If a media URL is 6314 used in the TEARDOWN request and more than one media exist in the 6315 session, the session will remain and a session header MUST be 6316 returned in the response. If only a single media stream remains in 6317 the session when performing a TEARDOWN with a media URL the session 6318 is removed. The number of media streams remaining after tearing down 6319 a media stream determines the new state. 6321 Action Requisite New State Response 6322 ______________________________________________________________________ 6323 PAUSE PrsURL,No range Ready Set RP to present point 6324 PAUSE PrsURL,Range>now Play Set RP & PP to given p. 6325 PAUSE PrsURL,Range1 Media plays Play No action 6329 End of range Play Set RP = End of range 6330 SETUP New URL Play 455 6331 SETUP Setuped URL Play 455 6332 SETUP Setuped URL, IFI Play Change transport param. 6333 TEARDOWN Prs URL,NRM>1 Init No session hdr 6334 TEARDOWN md URL,NRM=1 Init No Session hdr, NRM=0 6335 TEARDOWN md URL Play 455 6336 S -> C:REDIRECT Range hdr Play Set RedP 6337 S -> C:REDIRECT no range hdr Init Session is removed 6338 RedP reached Play TEARDOWN of session 6339 Timeout Init Stop Media playout 6341 Table 16: State: Play 6343 The Play state table, see Table 16, is the largest. The table 6344 contains an number of request that has presentation URL as a 6345 prerequisite on the request URL, this is due to the exclusion of 6346 non-aggregated stream control in sessions with more than one media 6347 stream. 6349 To avoid inconsistencies between the client and server, automatic 6350 state transitions are avoided. This can be seen at for example "End 6351 of media" event when all media has finished playing, the session 6352 still remain in Play state. An explicit PAUSE request must be sent to 6353 change the state to Ready. It may appear that there exist two 6354 automatic transitions in "RedP reached" and "PP reached", however 6355 they are requested and acknowledge before they take place. The time 6356 at which the transition will happen is known by looking at the range 6357 header. If the client sends request close in time to these 6358 transitions it must be prepared for getting error message as the 6359 state may or may not have changed. 6361 B Media Transport Alternatives 6363 This chapter defines how certain combinations of protocols, profiles 6364 and lower transports are used. This includes the usage of the 6365 Transport header's general source and destination parameters 6366 "src_addr" and "dest_addr". 6368 B.1 RTP 6370 This section defines the interaction of RTSP with respect to the RTP 6371 protocol [18]. It also defines any necessary media transport 6372 signalling with regards to RTP. 6374 The available RTP profiles and lower layer transports are described 6375 below along with rules on signalling the available combinations. 6377 B.1.1 AVP 6379 The usage of the "RTP Profile for Audio and Video Conferences with 6380 Minimal Control" [3] when using RTP for media transport over 6381 different lower layer transport protocols are defined below in 6382 regards to RTSP. 6384 On such case is defined within this document, the use of embedded 6385 (interleaved) binary data as defined in section 12. The usage of 6386 this method is indicated by include the "interleaved" parameter. 6388 When using embedded binary data the "src_addr" and "dest_addr" SHALL 6389 NOT be used. This addressing and multiplexing is used as defined with 6390 use of channel numbers and the interleaved parameter. 6392 B.1.2 AVP/UDP 6394 This part describes sending of RTP [18] over lower transport layer 6395 UDP [9] according to the profile "RTP Profile for Audio and Video 6396 Conferences with Minimal Control" defined in RFC 3551 [3]. This 6397 profiles requires that one or two uni- or bi-directional UDP flows 6398 per media stream. The first UDP flow is for RTP and the second is 6399 for RTCP. Embedded (interleaved) data when RTSP messages is 6400 transported over UDP SHOULD NOT be performed. 6402 The RTP/UDP and RTCP/UDP flows can be established in two ways using 6403 the Transport header's parameters. The way provided in RFC 2326 was 6404 to use the necessary parameters from the set of "source", 6405 "destination", "client_port", and "server_port". This has the 6406 advantage of being compatible with all RTP capable RTSP servers and 6407 clients. However this method does not provide a possibility to 6408 specify non-continues port ranges for RTP and RTCP. The other way is 6409 to use the parameters "src_addr", and "dest_addr". This method 6410 provides total flexibility in specifying address and port number for 6411 each transport flow. However the disadvantage is that it is not 6412 supported by non-updated clients, i.e. clients not supporting the 6413 "play.basic" feature-tag. 6415 When using the "source", "destination", "client_port", and 6416 "server_port" the packets are be addressed in the following way for 6417 media playback: 6419 o RTP/UDP packet from the server to the client SHALL be sent to | 6420 the address specified in the "destination" parameter and first | 6421 even port number given in client_port range. If only a RTP | 6422 port is to be specified, then only that even port number SHALL | 6423 be given, i.e. no range including a odd number SHALL be used. 6425 o The server SHOULD send its RTP/UDP packets from the address 6426 specified in "source" parameter and from the first even port 6427 number specified in "server_port" parameter. 6429 o If there is specified a range in "client_port" parameter that 6430 contains at least two port numbers, the RTCP/UDP packets from 6431 server to client SHALL be sent to the address specified in the 6432 "destination" parameter and first odd port number part of the 6433 range specified in the client_port parameter. 6435 o The Server SHOULD send its RTCP/UDP packets from the address 6436 specified in "source" parameter and from the first odd port 6437 number greater than the RTP port number specified in 6438 "server_port" parameter. 6440 o RTCP/UDP packets from the client to the server SHALL be sent | 6441 to the address specified in the "source" parameter and first | 6442 odd port number greater than the RTP port number given in | 6443 server_port range. | 6445 o The client SHOULD send its RTCP/UDP packets from the address | 6446 specified in "destination" parameter and from the first odd | 6447 port number specified in client_port" parameter. 6449 The usage of "src_addr" and "dest_addr" parameters to specify the 6450 address and port numbers are done in the following way for media 6451 playback, i.e. Mode=PLAY: 6453 o The "src_addr" and "dest_addr" parameters MUST contain either 6454 1 or 2 address and port pairs. 6456 o Each address and port pair MUST contain both and address and a 6457 port number. 6459 o The first address and port pair given in either of the 6460 parameters applies to the RTP stream. The second address and 6461 port pair if present applies to the RTCP stream. 6463 o The RTP/UDP packets from the server to the client SHALL be 6464 sent to the address and port given by first address and port 6465 pair of the "dest_addr" parameter. 6467 o The RTCP/UDP packets from the server to the client SHALL be 6468 sent to the address and port given by the second address and 6469 port pair of the "dest_addr" parameter. If no second pair is 6470 given RTCP SHALL NOT be sent. 6472 o The RTCP/UDP packets from the client to the server SHALL be | 6473 sent to the address and port given by the second address and | 6474 port pair of the "src_addr" parameter. If no second pair is | 6475 given RTCP SHALL NOT be sent. 6477 o RTP and RTCP Packets SHOULD be sent from the corresponding 6478 receiver port, i.e. RTCP packets from server should be sent 6479 from the "src_addr" parameters second address port pair. 6481 B.1.3 AVP/TCP 6483 Note that this combination is not yet defined using sperate TCP 6484 connections. However the use of embedded (interleaved) binary data 6485 transported on the RTSP connection is possible as specified in 6486 section 12. When using this declared combination of interleaved 6487 binary data the RTSP messages MUST be transported over TCP. 6489 A possible future for this profile would be to define the use of a 6490 combination of the two drafts "Connection-Oriented Media Transport in 6491 SDP" [40] and "Framing RTP and RTCP Packets over Connection-Oriented 6492 Transport" [41]. However as this work is not finished, this 6493 functionality is unspecified. 6495 B.1.4 Handling NPT Jumps in the RTP Media Layer 6496 RTSP allows media clients to control selected, non-contiguous 6497 sections of media presentations, rendering those streams with an RTP 6498 media layer[18]. Such control allows jumps to be created in NPT 6499 timeline of the RTSP session. For example, jumps in NPT can be caused 6500 by multiple ranges in the range specifier of a PLAY request or 6501 through a "seek" opertaion on an RTSP session which involves a PLAY, 6502 PAUSE, PLAY scenario where a new NPT is set for the session. The 6503 media layer rendering the RTP stream should not be affected by jumps 6504 in NPT. Thus, both RTP sequence numbers and RTP timestamps MUST be 6505 continuous and monotonic across jumps of NPT. 6507 We cannot assume that the RTSP client can communicate with 6508 the RTP media agent, as the two may be independent 6509 processes. If the RTP timestamp shows the same gap as the 6510 NPT, the media agent will assume that there is a pause in 6511 the presentation. If the jump in NPT is large enough, the 6512 RTP timestamp may roll over and the media agent may believe 6513 later packets to be duplicates of packets just played out. 6515 As an example, assume a clock frequency of 8000 Hz, a packetization 6516 interval of 100 ms and an initial sequence number and timestamp of 6517 zero. 6519 C->S: PLAY rtsp://xyz/fizzle RTSP/1.0 6520 CSeq: 4 6521 Session: abcdefg 6522 Range: npt=10-15; 6524 S->C: RTSP/1.0 200 OK 6525 CSeq: 4 6526 Session: abcdefg 6527 Range: npt=10-15 6528 RTP-Info: url= rtsp://xyz/fizzle/audiotrack;seq=0; 6529 rtptime=0 6531 The ensuing RTP data stream is depicted below: 6533 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 6534 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 6535 . . . 6536 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 6538 Immediately after the end of the play range, the client follows up 6539 with a request to PLAY from a new NPT. 6541 C->S: PAUSE rtsp://xyz/fizzle RTSP/1.0 6542 CSeq: 5 6543 Session: abcdefg 6545 S->C: RTSP/1.0 200 OK 6546 CSeq: 5 6547 Session: abcdefg 6548 Range: npt=15-15 6550 C->S: PLAY rtsp://xyz/fizzle RTSP/1.0 6551 CSeq: 6 6552 Session: abcdefg 6553 Range: npt=18-20; 6555 S->C: RTSP/1.0 200 OK 6556 CSeq: 6 6557 Session: abcdefg 6558 Range: npt=18-20 6559 RTP-Info: url= rtsp://xyz/fizzle/audiotrack;seq=50; 6560 rtptime=40000 6562 The ensuing RTP data stream is depicted below: 6564 S->C: RTP packet - seq = 50, rtptime = 40000, NPT time = 18s 6565 S->C: RTP packet - seq = 51, rtptime = 40800, NPT time = 18.1s 6566 . . . 6567 S->C: RTP packet - seq = 69, rtptime = 55200, NPT time = 19.9s 6569 First we play NPT 10 through 15, then skip ahead and play NPT 18 6570 through 20. The first segment is presented as RTP packets with 6571 sequence numbers 0 through 49 and timestamp 0 through 39,200. The 6572 second segment consists of RTP packets with sequence number 50 6573 through 69, with timestamps 40,000 through 55,200. While there is a 6574 gap in the NPT, there is no gap in the sequence number or timestamp 6575 space of the RTP data stream. 6577 B.1.5 Handling RTP Timestamps after PAUSE 6579 During a PAUSE / PLAY interaction in a RTSP session, the duration of 6580 time for which the RTP transmission was halted MUST be reflected in 6581 the RTP timestamp of each RTP stream. The duration can be calculated 6582 for each RTP stream as the time elapsed from when the last RTP packet 6583 was sent before the PAUSE request was received and when the first RTP 6584 packet was sent after thesubsequent PLAY request was received. The 6585 duration includes all latency incurred and processing time required 6586 to complete the request. 6588 The RTP RFC [18] states that: The RTP timestamp for each 6589 unit[packet] would be related to the wallclock time at 6590 which the unit becomes current on the virtual presentation 6591 timeline. 6593 In order to satisfy the requirements of [18], the RTP timestamp space 6594 must increase continously with real time. While this is not optimal 6595 for stored media, it is required for RTP and RTCP to function as 6596 intended. Using a continous RTP timestamp space allows the same 6597 timestamp model for both stored and live media and allows better 6598 opportunity to integrate both types of media under a single control. 6600 As an example, assume a clock frequency of 8000 Hz, a packetization 6601 interval of 100 ms and an initial sequence number and timestamp of 6602 zero. 6604 C->S: PLAY rtsp://xyz/fizzle RTSP/1.0 6605 CSeq: 4 6606 Session: abcdefg 6607 Range: npt=10-15; 6609 S->C: RTSP/1.0 200 OK 6610 CSeq: 4 6611 Session: abcdefg 6612 Range: npt=10-15 6613 RTP-Info: url= rtsp://xyz/fizzle/audiotrack;seq=0; 6614 rtptime=0 6616 The ensuing RTP data stream is depicted below: 6618 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 6619 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 6620 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 6621 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 6623 The client then sends a PAUSE request: 6625 C->S: PAUSE rtsp://xyz/fizzle RTSP/1.0 6626 CSeq: 5 6627 Session: abdcdefg 6629 S->C: RTSP/1.0 200 OK 6630 CSeq: 5 6631 Session: abcdefg 6632 Range: npt=10.4-15 6634 20 seconds elapse and then the client sends a PLAY request. In 6635 addtion the server requires 15 ms to process the request: 6637 C->S: PLAY rtsp://xyz/fizzle RTSP/1.0 6638 CSeq: 6 6639 Session: abcdefg 6641 S->C: RTSP/1.0 200 OK 6642 CSeq: 6 6643 Session: abcdefg 6644 Range: npt=10.4-15 6645 RTP-Info: url= rtsp://xyz/fizzle/audiotrack;seq=4; 6646 rtptime=164400 6648 The ensuing RTP data stream is depicted below: 6650 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 6651 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 6652 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 6654 First, we play NPT 10 through 10.3, when a PAUSE is received by the 6655 server. After 20 seconds a PLAY is recieved by the server which take 6656 15ms to process. The duration of time for which the session was 6657 paused is reflected in the RTP timestamp of the RTP packets sent 6658 after this PLAY request. 6660 A client can use the RTSP range header and RTP-Info header to map NPT 6661 time of a presentation with the RTP timestamp. 6663 Note: In RFC 2326 [1], this matter was not clearly defined and was 6664 misunderstood commonly. Therefore, clients SHOULD expect servers to 6665 break the continuity of the RTP timestamp space in various arbitrary 6666 manners after a PAUSE request. In these cases, it is RECOMMENDED that 6667 clients accept the RTP stream after the pause with appropriate 6668 mappings provided by the RTP-Info and Range headers. 6670 B.1.6 RTSP / RTP Integration 6672 For certain datatypes, tight integration between the RTSP layer and 6673 the RTP layer will be necessary. This by no means precludes the above 6674 restrictions. Combined RTSP/RTP media clients should use the RTP-Info 6675 field to determine whether incoming RTP packets were sent before or 6676 after a seek or before or after a PAUSE. 6678 B.1.7 Scaling with RTP 6680 For scaling (see Section 14.37), RTP timestamps should correspond to 6681 the playback timing. For example, when playing video recorded at 30 6682 frames/second at a scale of two and speed (Section 14.38) of one, the 6683 server would drop every second frame to maintain and deliver video 6684 packets with the normal timestamp spacing of 3,000 per frame, but NPT 6685 would increase by 1/15 second for each video frame. 6687 B.1.8 Maintaining NPT synchronization with RTP timestamps 6689 The client can maintain a correct display of NPT by noting the RTP 6690 timestamp value of the first packet arriving after repositioning. 6691 The sequence parameter of the RTP-Info (Section 14.36) header 6692 provides the first sequence number of the next segment. 6694 B.1.9 Continuous Audio 6696 For continuous audio, the server SHOULD set the RTP marker bit at the 6697 beginning of serving a new PLAY request. This allows the client to 6698 perform playout delay adaptation. 6700 B.1.10 Multiple Sources in an RTP Session 6702 Note that more than one SSRC MAY be sent in the media stream. 6703 However, without further extensions RTSP can't synchronize more than 6704 the single one indicated in the Transport header. In these cases RTCP 6705 needs to be used for synchronization. 6707 B.1.11 Usage of SSRCs and the RTCP BYE Message During a RTSP Session 6709 The RTCP BYE message indicates the end of use of a given SSRC. If all | 6710 sources leave an RTP session, it can in most cases be considered to | 6711 have ended. Therefore, a client or server SHALL NOT send a RTCP BYE | 6712 message until it has finished using a SSRC. A server SHOULD keep | 6713 using a SSRC until the RTP session is terminated. Prologing the use | 6714 of a SSRC allows the established synchronization context associated | 6715 with that SSRC to be used to sychronize subsequent PLAY requests even | 6716 if the PLAY response is late. Additionally, changing the server side | 6717 SSRC will prevent the server from synchronizing the new SSRC within | 6718 RTSP as it is connected to the one declared in the ssrc parameter in | 6719 the Transport header. | 6721 An SSRC collision with the SSRC that transmits media does also has | 6722 consequences, as it will force it to change its SSRC in accordance | 6723 with the RTP specification [18]. This will result in a loss of | 6724 synchronization context, and require any receiver to wait for RTCP | 6725 sender reports for all media requiring synchronization before being | 6726 able to play out synchronized. Due to these reasons a client joining | 6727 a session should take care to not select the same SSRC as the server. | 6728 Any SSRC signalled in the Transport header SHOULD be avoided. Also a | 6729 client detecting a collision prior to sending any RTP or RTCP | 6730 messages can also select a new SSRC. | 6732 B.2 Future Additions 6734 It is the intention that any future protocol or profile regarding 6735 both for media delivery and lower transport should be easy to add to 6736 RTSP. This chapter provides the necessary steps that needs to be 6737 meet. 6739 The following things needs to be considered when adding a new 6740 protocol of profile for use with RTSP: 6742 o The protocol or profile needs to define a name tag 6743 representing it. This tag is required to be a ABNF "token" to 6744 be possible to use in the Transport header specification. 6746 o The useful combinations of protocol/profile/lower-layer needs 6747 to be defined and for each combination declare the necessary 6748 parameters to use in the Transport header. 6750 o For new media protocols the interaction with RTSP needs to be 6751 addressed. One important factor will be the media 6752 synchronization. 6754 See the IANA section ( 20) on how to register the necessary 6755 attributes. 6757 C Use of SDP for RTSP Session Descriptions 6759 The Session Description Protocol (SDP, RFC 2327 [2]) may be used to 6760 describe streams or presentations in RTSP. This description is 6761 typically returned in reply to a DESCRIBE request on a URL from a 6762 server to a client, or received via HTTP from a server to a client. 6764 This appendix describes how an SDP file determines the operation of 6765 an RTSP session. SDP as is provides no mechanism by which a client 6766 can distinguish, without human guidance, between several media 6767 streams to be rendered simultaneously and a set of alternatives 6768 (e.g., two audio streams spoken in different languages). However the 6769 SDP extension "Grouping of Media Lines in the Session Description 6770 Protocol (SDP)" [42] may provide such functionality depending on 6771 need. Also future grouping semantics may in the future be developed. 6773 C.1 Definitions 6775 The terms "session-level", "media-level" and other key/attribute 6776 names and values used in this appendix are to be used as defined in 6777 SDP (RFC 2327 [2]): 6779 C.1.1 Control URL 6781 The "a=control:" attribute is used to convey the control URL. This 6782 attribute is used both for the session and media descriptions. If 6783 used for individual media, it indicates the URL to be used for 6784 controlling that particular media stream. If found at the session 6785 level, the attribute indicates the URL for aggregate control 6786 (presentation URL). The session level URL SHALL be different from any 6787 media level URL. The presence of a session level control attribute 6788 SHALL be interpreted as support for aggregated control. The control 6789 attribute SHALL be present on media level unless the presentation 6790 only contains a single media stream, in which case the attribute MAY 6791 only be present on the session level. 6793 control-attribute = "a=" "control" ":" url 6795 Example: 6797 a=control:rtsp://example.com/foo 6799 This attribute MAY contain either relative and absolute URLs, 6800 following the rules and conventions set out in RFC 2396 [13]. 6802 Implementations SHALL look for a base URL in the following order: 6804 1. the RTSP Content-Base field; 6806 2. the RTSP Content-Location field; 6808 3. the RTSP request URL. 6810 If this attribute contains only an asterisk (*), then the URL SHALL 6811 be treated as if it were an empty embedded URL, and thus inherit the 6812 entire base URL. 6814 For SDP retrieved from a container file, there are certain things to 6815 consider. Lets say that the container file has the following URL: 6816 "rtsp://example.com/container.mp4". A media level relative URL needs 6817 to contain the file name container.mp4 in the beginning to be 6818 resolved correctly relative to the before given URL. An alternative 6819 if one does not desire to enter the container files name is to ensure 6820 that the base URL for the SDP document becomes: 6821 "rtsp://example.com/container.mp4/", i.e. an extra trailing slash. 6822 When using the URL resolution rules in RFC 2396 that will resolve 6823 correctly. However, please note that if the session level control URL 6824 is a *, that control URL will be equal to 6825 "rtsp://example.com/container.mp4/" and include the slash. 6827 C.1.2 Media Streams 6829 The "m=" field is used to enumerate the streams. It is expected that 6830 all the specified streams will be rendered with appropriate 6831 synchronization. If the session is a multicast, the port number 6832 indicated SHOULD be used for reception. The client MAY try to 6833 override the destination port, through the Transport header. The 6834 servers MAY allow this, the response will indicate if allowed or not. 6835 If the session is unicast, the port number is the ones RECOMMENDED by 6836 the server to the client, about which receiver ports to use; the 6837 client MUST still include its receiver ports in its SETUP request. 6838 The client MAY ignore this recommendation. If the server has no 6839 preference, it SHOULD set the port number value to zero. 6841 The "m=" lines contain information about what transport protocol, 6842 profile, and possibly lower-layer shall be used for the media stream. 6843 The combination of transport, profile and lower layer, like 6844 RTP/AVP/UDP needs to be defined for how to be used with RTSP. The 6845 currently defined combinations are defined in section B, further 6846 combinations MAY be specified. 6848 TODO: Write something about the usage of Grouping of media line, RFC 6849 3388 [42]. 6851 Example: 6853 m=audio 0 RTP/AVP 31 6855 C.1.3 Payload Type(s) 6857 The payload type(s) are specified in the "m=" field. In case the 6858 payload type is a static payload type from RFC 3551 [3], no other 6859 information is required. In case it is a dynamic payload type, the 6860 media attribute "rtpmap" is used to specify what the media is. The 6861 "encoding name" within the "rtpmap" attribute may be one of those 6862 specified in RFC 3551 (Sections 5 and 6), or an MIME type registered 6863 with IANA, or an experimental encoding as specified in SDP (RFC 2327 6864 [2]). Codec-specific parameters are not specified in this field, but 6865 rather in the "fmtp" attribute described below. 6867 C.1.4 Format-Specific Parameters 6869 Format-specific parameters are conveyed using the "fmtp" media 6870 attribute. The syntax of the "fmtp" attribute is specific to the 6871 encoding(s) that the attribute refers to. Note that some of the 6872 format specific parameters may be specified outside of the fmtp 6873 parameters, like for example the "ptime" attribute for most audio 6874 encodings. 6876 C.1.5 Range of Presentation 6878 The "a=range" attribute defines the total time range of the stored 6879 session or an individual media. Non-seekable live sessions can be 6880 indicated, while the length of live sessions can be deduced from the 6881 "t" and "r" SDP parameters. 6883 The attribute is both a session and a media level attribute. For 6884 presentations that contains media streams of the same durations, the 6885 range attribute SHOULD only be used at session-level. In case of 6886 different length the range attribute MUST be given at media level for 6887 all media, and SHOULD NOT be given at session level. If the attribute 6888 is present at both media level and session level the media level 6889 values SHALL be used. 6891 The unit is specified first, followed by the value range. The units 6892 and their values are as defined in Section 3.4, 3.5 and 3.6 and MAY 6893 be extended with further formats. Any open ended range (start-), i.e. 6894 without stop range, is of unspecified duration and SHALL be 6895 considered as non-seekable content unless this property is 6896 overridden. 6898 This attribute is defined in ABNF [5] as: 6900 a-range-def = "a" "=" "range" ":" ranges-specifier CRLF 6902 Examples: 6904 a=range:npt=0-34.4368 6905 a=range:clock=19971113T2115-19971113T2203 6906 Non seekable stream of unknown duration: 6907 a=range:npt=0- 6909 C.1.6 Time of Availability 6911 The "t=" field MUST contain suitable values for the start and stop 6912 times for both aggregate and non-aggregate stream control. The 6913 server SHOULD indicate a stop time value for which it guarantees the 6914 description to be valid, and a start time that is equal to or before 6915 the time at which the DESCRIBE request was received. It MAY also 6916 indicate start and stop times of 0, meaning that the session is 6917 always available. 6919 For sessions that are of live type, i.e. specific start time, unknown 6920 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 6921 to indicate the start time of the event. The stop time SHOULD be 6922 given so that the live event will with high probability have ended at 6923 that time, while still not be unnecessary long into the future. 6925 C.1.7 Connection Information 6927 In SDP, the "c=" field contains the destination address for the media 6928 stream. For a media destination address that is a IPv6 one, the SDP 6929 extension defined in [22] needs to be used. For on-demand unicast 6930 streams and some multicast streams, the destination address MAY be 6931 specified by the client via the SETUP request, thus overriding any 6932 specified address. To identify streams without a fixed destination 6933 address, where the client must specify a destination address, the 6934 "c=" field SHOULD be set to a null value. For addresses of type 6935 "IP4", this value SHALL be "0.0.0.0", and for type "IP6", this value 6936 SHALL be "0:0:0:0:0:0:0:0", i.e. the unspecified address according to 6937 RFC 3513 [23]. 6939 C.1.8 Entity Tag 6941 The optional "a=etag" attribute identifies a version of the session 6942 description. It is opaque to the client. SETUP requests may include 6943 this identifier in the If-Match field (see section 14.24) to only 6944 allow session establishment if this attribute value still corresponds 6945 to that of the current description. The attribute value is opaque 6946 and may contain any character allowed within SDP attribute values. 6948 a-etag-def = "a" "=" "etag" ":" etag-string CRLF 6949 etag-string = 1*(%x01-09/%x0B-0C/%x0E-FF) 6951 Example: 6953 a=etag:158bb3e7c7fd62ce67f12b533f06b83a 6955 One could argue that the "o=" field provides identical 6956 functionality. However, it does so in a manner that would 6957 put constraints on servers that need to support multiple 6958 session description types other than SDP for the same piece 6959 of media content. 6961 C.2 Aggregate Control Not Available 6963 If a presentation does not support aggregate control no session level 6964 "a=control:" attribute is specified. For a SDP with multiple media 6965 sections specified, each section will have its own control URL 6966 specified via the "a=control:" attribute. 6968 Example: 6970 v=0 6971 o=- 2890844256 2890842807 IN IP4 204.34.34.32 6972 s=I came from a web page 6973 e=adm@example.com 6974 c=IN IP4 0.0.0.0 6975 t=0 0 6976 m=video 8002 RTP/AVP 31 6977 a=control:rtsp://audio.com/movie.aud 6978 m=audio 8004 RTP/AVP 3 6979 a=control:rtsp://video.com/movie.vid 6981 Note that the position of the control URL in the description implies 6982 that the client establishes separate RTSP control sessions to the 6983 servers audio.com and video.com 6984 It is recommended that an SDP file contains the complete media 6985 initialization information even if it is delivered to the media 6986 client through non-RTSP means. This is necessary as there is no 6987 mechanism to indicate that the client should request more detailed 6988 media stream information via DESCRIBE. 6990 C.3 Aggregate Control Available 6992 In this scenario, the server has multiple streams that can be 6993 controlled as a whole. In this case, there are both a media-level 6994 "a=control:" attributes, which are used to specify the stream URLs, 6995 and a session-level "a=control:" attribute which is used as the 6996 request URL for aggregate control. If the media-level URL is 6997 relative, it is resolved to absolute URLs according to Section C.1.1 6998 above. 7000 Example: 7002 C->M: DESCRIBE rtsp://example.com/movie RTSP/1.0 7003 CSeq: 1 7005 M->C: RTSP/1.0 200 OK 7006 CSeq: 1 7007 Date: 23 Jan 1997 15:35:06 GMT 7008 Content-Type: application/sdp 7009 Content-Base: rtsp://example.com/movie/ 7010 Content-Length: 164 7012 v=0 7013 o=- 2890844256 2890842807 IN IP4 204.34.34.32 7014 s=I contain 7015 i= 7016 e=adm@example.com 7017 c=IN IP4 0.0.0.0 7018 t=0 0 7019 a=control:* 7020 m=video 8002 RTP/AVP 31 7021 a=control:trackID=1 7022 m=audio 8004 RTP/AVP 3 7023 a=control:trackID=2 7025 In this example, the client is required to establish a single RTSP 7026 session to the server, and uses the URLs 7027 rtsp://example.com/movie/trackID=1 and 7028 rtsp://example.com/movie/trackID=2 to set up the video and audio 7029 streams, respectively. The URL rtsp://example.com/movie/ , which is 7030 resolved from the "*", controls the whole presentation (movie). 7032 A client is not required to issues SETUP requests for all streams 7033 within an aggregate object. Servers should allow the client to ask 7034 for only a subset of the streams. 7036 C.4 RTSP external SDP delivery 7038 There are some considerations that needs to be made when the session 7039 description is delivered to client outside of RTSP, for example in 7040 HTTP or email. 7042 First of all the SDP needs to contain absolute URLs, relative will in 7043 most cases not work as the delivery will not correctly forward the 7044 base URL. And as SDP might be temporarily stored on file system 7045 before being loaded into a RTSP capable client, thus if possible to 7046 transport the base URL it still would need to be merged into the 7047 file. 7049 The writing of the SDP session availability information, i.e. "t=" 7050 and "r=", needs to be carefully considered. When the SDP is fetched 7051 by the DESCRIBE method it is with very high probability that the it 7052 is valid. However the same are much less certain for SDPs distributed 7053 using other methods. Therefore the publisher of the SDP should take 7054 care to follow the recommendations about availability in the SDP 7055 specification [2]. 7057 D Minimal RTSP implementation 7059 D.1 Client 7061 A client implementation MUST be able to do the following : 7063 o Generate the following requests: SETUP, TEARDOWN, PLAY. 7065 o Include the following headers in requests: CSeq, Connection, 7066 Session, Transport. 7068 o Parse and understand the following headers in responses: 7069 CSeq, Connection, Session, Transport, Content-Language, 7070 Content-Encoding, Content-Length, Content-Type. 7072 o Understand the class of each error code received and notify 7073 the end-user, if one is present, of error codes in classes 4xx 7074 and 5xx. The notification requirement may be relaxed if the 7075 end-user explicitly does not want it for one or all status 7076 codes. 7078 o Expect and respond to asynchronous requests from the server, 7079 such as REDIRECT. This does not necessarily mean that it 7080 should implement the REDIRECT method, merely that it MUST 7081 respond positively or negatively to any request received from 7082 the server. 7084 Though not required, the following are RECOMMENDED. 7086 o Implement RTP/AVP/UDP as a valid transport. 7088 o Inclusion of the User-Agent header. 7090 o Understand SDP session descriptions as defined in Appendix C 7092 o Accept media initialization formats (such as SDP) from 7093 standard input, command line, or other means appropriate to 7094 the operating environment to act as a "helper application" for 7095 other applications (such as web browsers). 7097 There may be RTSP applications different from those 7098 initially envisioned by the contributors to the RTSP 7099 specification for which the requirements above do not make 7100 sense. Therefore, the recommendations above serve only as 7101 guidelines instead of strict requirements. 7103 D.1.1 Basic Playback 7105 To support on-demand playback of media streams, the client MUST 7106 additionally be able to do the following: 7108 o generate the PAUSE request; 7110 o implement the REDIRECT method, and the Location header. 7112 D.1.2 Authentication-enabled 7114 In order to access media presentations from RTSP servers that require 7115 authentication, the client MUST additionally be able to do the 7116 following: 7118 o recognize the 401 (Unauthorized) status code; 7120 o parse and include the WWW-Authenticate header; 7122 o implement Basic Authentication and Digest Authentication. 7124 D.2 Server 7125 A minimal server implementation MUST be able to do the following: 7127 o Implement the following methods: SETUP, TEARDOWN, OPTIONS and 7128 PLAY. 7130 o Include the following headers in responses: Connection, 7131 Content-Length, Content-Type, Content-Language, Content- 7132 Encoding, Timestamp, Transport, Public, and Via, and 7133 Unsupported. RTP-compliant implementations MUST also 7134 implement the RTP-Info field. 7136 o Parse and respond appropriately to the following headers in 7137 requests: Connection, Proxy-Require, Session, Transport, and 7138 Require. 7140 Though not required, the following are highly recommended at the time 7141 of publication for practical interoperability with initial 7142 implementations and/or to be a "good citizen". 7144 o Implement RTP/AVP/UDP as a valid transport. 7146 o Inclusion of the Server, Cache-Control Date, and Expires 7147 headers. 7149 o Implement the DESCRIBE method. 7151 o Generate SDP session descriptions as defined in Appendix C 7153 There may be RTSP applications different from those 7154 initially envisioned by the contributors to the RTSP 7155 specification for which the requirements above do not make 7156 sense. Therefore, the recommendations above serve only as 7157 guidelines instead of strict requirements. 7159 D.2.1 Basic Playback 7161 To support on-demand playback of media streams, the server MUST 7162 additionally be able to do the following: 7164 o Recognize the Range header, and return an error if seeking is 7165 not supported. 7167 o Implement the PAUSE method. 7169 In addition, in order to support commonly-accepted user interface 7170 features, the following are highly recommended for on-demand media 7171 servers: 7173 o Include and parse the Range header, with NPT units. 7174 Implementation of SMPTE units is recommended. 7176 o Include the length of the media presentation in the media 7177 initialization information. 7179 o Include mappings from data-specific timestamps to NPT. When 7180 RTP is used, the rtptime portion of the RTP-Info field may be 7181 used to map RTP timestamps to NPT. 7183 Client implementations may use the presence of length 7184 information to determine if the clip is seekable, and 7185 visably disable seeking features for clips for which the 7186 length information is unavailable. A common use of the 7187 presentation length is to implement a "slider bar" which 7188 serves as both a progress indicator and a timeline 7189 positioning tool. 7191 Mappings from RTP timestamps to NPT are necessary to ensure correct 7192 positioning of the slider bar. 7194 D.2.2 Authentication-enabled 7196 In order to correctly handle client authentication, the server MUST 7197 additionally be able to do the following: 7199 o Generate the 401 (Unauthorized) status code when 7200 authentication is required for the resource. 7202 o Parse and include the WWW-Authenticate header 7204 o Implement Basic Authentication and Digest Authentication 7206 E Open Issues 7208 This section contains a list of open issues that still needs to be 7209 resolved. However also any open issues in the bug tracker at 7210 http://rtspspec.sourceforge.net should also be considered. 7212 1. The proxy indications in the two header tables in chapter 7213 14 needs review. 7215 2. Should the Allow header be possible to use optional in 7216 request or responses besides the now specified 405 error 7217 code? 7219 3. The minimal implementation must be checked to see if it 7220 complies with the specification. All must and should shall 7221 be included in the minimal. Feature-tags for these needs to 7222 be defined. Further feature-tags needs to be discussed. 7224 4. The list specifying which status codes are allowed on which 7225 request methods seem to be in error and need review. 7227 5. Can fragment be included in a request URL? Or should it as 7228 for HTTP only be handled on the User-Agent side? 7230 6. ABNF Syntax needs to be run through verifier. 7232 7. There is need for clearer rule in regards to Transport 7233 parameters changes in mid session. It needs to be 7234 determined if there should be any clarification on how and 7235 which Transport header parameters that may be changed. 7237 8. Normative suggestion is needed for doing RTSP session keep 7238 alives. Currently there are too many options being 7239 suggested by RTSP such as OPTIONS with Session ID, PING, 7240 SET_PARAMETER. This leads to interoperability problems, 7241 maintenance issues and additional development for 7242 implementers for little gain. 7244 F Changes 7246 Compared to RFC 2326, the following issues has been addressed: 7248 o The Transport header has been changed in the following way: 7250 - The ABNF has been changed to define that extensions are 7251 possible, and that unknown extension parameters shall be 7252 ignored. 7254 - To prevent backwards compatibility issues, any extension or 7255 new parameter requires the usage of a feature tag combined 7256 with the Require header. 7258 - Syntax unclarities with the Mode parameter has been 7259 resolved. 7261 - Syntax error with ";" for multicast and unicast has been 7262 resolved. 7264 - Two new addressing parameters has been defined, src_addr and 7265 dest_addr. These allow one to specify more than one complete 7266 address and port tuple if needed. 7268 - Support for IPv6 explicit addresses in all address fields 7269 has been included. 7271 - To handle URI definitions that contain ";" or "," a quoted 7272 URL format has been introduced. 7274 - Defined IANA registries for the transport headers 7275 parameters, transport-protocol, profile, lower-transport, 7276 and mode. 7278 - The transport headers interleaved parameter's text was made 7279 more strict and use formal requirements levels. However no 7280 change on how it is used was made. 7282 - It has been clarified that the client can't request of the 7283 server to use a certain RTP SSRC, using a request with the 7284 transport parameter SSRC. 7286 - Syntax defintion for SSRC has been clarified to require 8*8 7287 HEX. It has also been extend to allow multiple values for 7288 clients supporting this version. 7290 - Updated the text on the transport headers "destination" and 7291 "dest_addr" parameters regarding what security precautions 7292 the server shall perform. 7294 - The embedded (interleaved) binary data and its transport 7295 parameter was clarified to being symmetric and that it is 7296 the server that sets the channel numbers. 7298 o The Range formats has been changed in the following way: 7300 - The NPT format has been given a initial NPT identifier that 7301 should be used, if missing NPT is assumed. 7303 - All formats now support initial open ended formats of type 7304 "npt=-10". 7306 o RTSP message handling has been changed in the following way: 7308 - It has been clarified that a 4xx message due to missing CSeq 7309 header shall be returned without a CSeq header. 7311 - Rules for how to handle timing out RTSP messages has been 7312 added. 7314 o The HTTP references has been updated to RFC 2616 and RFC 2617. 7315 This has required that public, and content-base header are now 7316 defined in the RTSP specification. Known effects on RTSP due 7317 to HTTP clarifications: 7319 - Content-Encoding header can include encoding of type 7320 "identity". 7322 o The state machine chapter has completely been rewritten. It 7323 includes now more details and are also more clear about the 7324 model used. 7326 o A IANA section has been included with contains a number of 7327 registries and their rules. This will allow us to use IANA to 7328 keep track of all RTSP extensions. 7330 o Than transport of RTSP messages has seen the following 7331 changes: 7333 - The use of UDP has been deprecated due to missing interest 7334 and to broken specification. 7336 - The rules for how TCP connections shall be handled has been 7337 clarified. Now it is made clear that servers should not 7338 close the TCP connection unless they have been unused for 7339 significant time. 7341 - Strong recommendations why server and clients should use 7342 persistent connections has also been added. 7344 - There is now a requirement to handle non-persistent 7345 connections as this provides great fault tolerance. 7347 - Added wording on the usage of Connection:Close for RTSP. 7349 - specified usage of TLS for RTSP messages, including a scheme 7350 to approve a proxies TLS connection to the next hop. 7352 o The following header related changes have been made: 7354 - Accept-Ranges response header is added. This header 7355 clarifies which range formats that can be used for a 7356 resource. 7358 - Clarified that Range header allows multiple ranges to allow 7359 for creating editing list. 7361 - Fixed the missing definitions for the Cache-Control header. 7362 Also added to the syntax definition the missing delta- 7363 seconds for max-stale and min-fresh parameters. 7365 - Put requirement on CSeq header that the value is increased 7366 by one for each new RTSP request. A Recommendation to start 7367 at 1 has also been added. 7369 - Added requirement that the Date header must be used for all 7370 messages with entity. Also the Server should always include 7371 it. 7373 - Removed possibility of using Range header with Scale header 7374 to indicate when it shall be activated, since it can't work 7375 as defined. Also added rule that lack of Scale header in 7376 response indicates lack of support for the header. Feature- 7377 tags for scaled playback has been defined. 7379 - The Speed header must now be responded to indicate support 7380 and the actual speed going to be used. A feature-tag is 7381 defined. Notes on congestion control was also added. 7383 - The Supported header was borrowed from SIP to help with the 7384 feature negotiation in RTSP. 7386 - Clarified that the Timestamp header can be used to resolve 7387 retransmission ambiguities. 7389 - The Session header text has been expanded with a explanation 7390 on keep alive and which methods to use. 7392 - It has been clarified how the Range header formats shall be 7393 used to indicate pause points. 7395 - Clarified that RTP-Info URLs that are relative, uses the 7396 request URL as base URL. Also clarified that the URL that 7397 must be used is the SETUP. 7399 - Added text that requires the Range to always be present in 7400 PLAY responses. Clarified what should be sent in case of 7401 live streams. 7403 - The quoted URL format may also be used with the RTP-Info 7404 header. Backwards compatibility issues exist with such 7405 usage, thus it can only be used for implementations 7406 following this specification. 7408 - The headers table has been updated using a structured 7409 borrowed from SIP. This table carries much more information 7410 and should provide a good overview of the available headers. 7412 - It has been is clarified that any message with a message 7413 body is required to have a Content-Length header. This was 7414 the case in RFC 2326 but could be misinterpreted. 7416 - To resolve functionality around ETag. The ETag and If-None- 7417 Match header has been added from HTTP with necessary 7418 clarification in regards to RTSP operation. 7420 - Imported the Public header from HTTP RFC 2068 [20] since it 7421 has been removed from HTTP due to lack of use. Public is 7422 used quite frequently in RTSP. 7424 - Clarified rules for populating the Public header so that it 7425 is an intersection of the capabilities of all the RTSP 7426 agents in a chain. 7428 o The minimal implementation specification has been changed: 7430 - Required Timestamp, Via, and Unsupported headers for a 7431 minimal server implementation. 7433 - Recommended that Cache-Control, Expires and Date headers be 7434 supported by server implementations. 7436 o The Protocol Syntax has been changed in the following way: 7438 - All BNF definitions are updated according to the rules 7439 defined in RFC 2234 [5] and has been gathered in a separate 7440 chapter 18. 7442 - The BNF for the User-Agent and Server headers has been 7443 corrected so now only the description is in the HTTP 7444 specification. 7446 - The definition in the introduction of the RTSP session has 7447 been changed. 7449 - The protocol has been made fully IPv6 capable. Certain of 7450 the functionality, like using explicit IPv6 addresses in 7451 fields requires that the protocol support this updated 7452 specification. 7454 - Added a fragment part to the RTSP URL. This seem to be 7455 indicated by the note below the definition however it was 7456 not part of the BNF. 7458 o The Status codes has been changed in the following way: 7460 - The use of status code 303 "See Other" has been deprecated 7461 as it does not make sense to use in RTSP. 7463 - When sending response 451 and 458 the response body should 7464 contain the offending parameters. 7466 - Clarification on when a 3rr redirect status code can be 7467 received has been added. This includes receiving 3rr as a 7468 result of request within a established session. This 7469 provides clarification to a previous unspecified behavior. 7471 - Removed the 250 (Low On Storage Space) status code as it 7472 only is relevant to recording which is deprecated. 7474 o The following functionality has been deprecated from the 7475 protocol: 7477 - The use of Queued Play. 7479 - The use of PLAY method for keep-alive in play state. 7481 - The RECORD and ANNOUNCE methods and all related 7482 functionality. Some of the syntax has been removed. 7484 - The possibility to use timed execution of methods with the 7485 time parameter in the Range header. 7487 - The description on how rtspu works is not part of the core 7488 specification and will require external description. Only 7489 that it exist is defined here. 7491 o Text specifying the special behavior of PLAY for live content. 7493 o The following changes has been made in relation to methods: 7495 - The OPTIONS method has been clarified with regards to the 7496 use of the Public and Allow headers. 7498 - The RECORD and ANNOUNCE methods are removed as they are 7499 lacking implementation and not considered necessary in the 7500 core specification. Any work on these methods should be done 7501 as a extension document to RTSP. 7503 - Added text clarifying the usage of SET_PARAMETER for keep- 7504 alive and usage without any body. 7506 - Added a backwards compatibility resolution for how to handle 7507 the new state machine without automatic state transition, 7508 for example for returning to ready when finished playing. 7510 o Wrote a new chapter about how to setup different media 7511 transport alternatives and their profiles, and lower layer 7512 protocols. This resulted that the appendix on RTP interaction 7513 was moved there instead in the part describing RTP. The 7514 chapter also includes guidelines what to think of when writing 7515 usage guidelines for new protocols and profiles. 7517 o Added a new chapter describing the available mechanisms to 7518 determine if functionality is supported, called "Capability 7519 Handling". Renamed option-tags to feature-tags. 7521 o Added a contributors chapter with people who has contribute 7522 actual text to the specification. 7524 o Added a chapter Use Cases that describes the major use cases 7525 for RTSP. 7527 o Clarified the usage of a=range and how to indicate live 7528 content that are not seekable with this header. 7530 Note that this list does not reflect minor changes in wording or 7531 correction of typographical errors. 7533 A word-by-word diff from RFC 2326 can be found at http://rtsp.org/ 7535 G Author Addresses 7537 Henning Schulzrinne 7538 Dept. of Computer Science 7539 Columbia University 7540 1214 Amsterdam Avenue 7541 New York, NY 10027 7542 USA 7543 electronic mail: schulzrinne@cs.columbia.edu 7545 Anup Rao 7546 Cisco 7547 USA 7548 electronic mail: anrao@cisco.com 7550 Robert Lanphier 7551 RealNetworks 7552 P.O. Box 91123 7553 Seattle, WA 98111-9223 7554 USA 7555 electronic mail: robla@real.com 7557 Magnus Westerlund 7558 Ericsson AB, EAB/TVA/A 7559 Torshamsgatan 23 7560 SE-164 80 STOCKHOLM 7561 SWEDEN 7562 electronic mail: magnus.westerlund@ericsson.com 7564 Aravind Narasimhan 7565 Princeton, NJ 7566 USA 7567 electronic mail: aravind.narasimhan@gmail.com 7569 H Contributors 7571 The following people has made written contribution included in the 7572 specification: 7574 o Tom Marshall has contributed with text about the usage of 3rr 7575 status codes. 7577 o Thomas Zheng has contributed with text regarding the usage of 7578 the Range in PLAY responses. 7580 o Sean Sheedy has contributed the text regarding the timing out 7581 of RTSP messages. 7583 o Fredrik Lindholm has contributed with text for the RTSP 7584 security framework. 7586 I Acknowledgements 7588 This draft is based on the functionality of the original RTSP draft 7589 submitted in October 1996. It also borrows format and descriptions 7590 from HTTP/1.1. 7592 This document has benefited greatly from the comments of all those 7593 participating in the MMUSIC-WG. In addition to those already 7594 mentioned, the following individuals have contributed to this 7595 specification: 7597 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 7598 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 7599 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 7600 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 7601 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Anders Klemets, 7602 Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo F. Llach, Thomas 7603 Marshall, Rob McCool, David Oran, Joerg Ott, Maria Papadopouli, Sujal 7604 Patel, Ema Patki, Alagu Periyannan, Colin Perkins, Igor Plotnikov, 7605 Jonathan Sergent, Pinaki Shah, David Singer, Lior Sion, Jeff Smith, 7606 Alexander Sokolsky, Dale Stammen, John Francis Stracke, Maureen 7607 Chesire, David Walker, and Geetha Srikantan. 7609 J Normative References 7611 [1] H. Schulzrinne, A. Rao, and R. Lanphier, "Real time streaming 7612 protocol (RTSP)," RFC 2326, Internet Engineering Task Force, Apr. 7613 1998. 7615 [2] M. Handley and V. Jacobson, "SDP: session description protocol," 7616 RFC 2327, Internet Engineering Task Force, Apr. 1998. 7618 [3] H. Schulzrinne and S. Casner, "RTP profile for audio and video 7619 conferences with minimal control," RFC 3551, Internet Engineering 7620 Task Force, July 2003. 7622 [4] R. Fielding, J. Gettys, J. C. Mogul, H. Frystyk, L. Masinter, P. 7623 J. Leach, and T. Berners-Lee, "Hypertext transfer protocol -- 7624 HTTP/1.1," RFC 2616, Internet Engineering Task Force, June 1999. 7626 [5] "Augmented BNF for syntax specifications: ABNF," RFC 2234, 7627 Internet Engineering Task Force, Nov. 1997. 7629 [6] S. Bradner, "Key words for use in RFCs to indicate requirement 7630 levels," RFC 2119, Internet Engineering Task Force, Mar. 1997. 7632 [7] T. Dierks and C. Allen, "The TLS protocol version 1.0," RFC 2246, 7633 Internet Engineering Task Force, Jan. 1999. 7635 [8] J. Franks, P. Hallam-Baker, J. Hostetler, S. Lawrence, P. J. 7636 Leach, A. Luotonen, and L. Stewart, "HTTP authentication: Basic and 7637 digest access authentication," RFC 2617, Internet Engineering Task 7638 Force, June 1999. 7640 [9] J. B. Postel, "User datagram protocol," RFC 768, Internet 7641 Engineering Task Force, Aug. 1980. 7643 [10] J. B. Postel, "Transmission control protocol," RFC 793, Internet 7644 Engineering Task Force, Sept. 1981. 7646 [11] R. Elz, "A compact representation of IPv6 addresses," RFC 1924, 7647 Internet Engineering Task Force, Apr. 1996. 7649 [12] R. Hinden, B. E. Carpenter, and L. Masinter, "Format for literal 7650 IPv6 addresses in URL's," RFC 2732, Internet Engineering Task Force, 7651 Dec. 1999. 7653 [13] T. Berners-Lee, R. Fielding, and L. Masinter, "Uniform resource 7654 identifiers (URI): generic syntax," RFC 2396, Internet Engineering 7655 Task Force, Aug. 1998. 7657 [14] F. Yergeau, "UTF-8, a transformation format of ISO 10646," RFC 7658 2279, Internet Engineering Task Force, Jan. 1998. 7660 [15] "Requirements for Internet hosts - application and support," RFC 7661 1123, Internet Engineering Task Force, Oct. 1989. 7663 [16] NIST, "Fips pub 180-1:secure hash standard," tech. rep., 7664 National Institute of Standards and Technology, Apr. 1995. 7666 [17] R. Housley, W. Polk, W. Ford, and D. Solo, "Internet X.509 7667 public key infrastructure certificate and certificate revocation list 7668 (CRL) profile," RFC 3280, Internet Engineering Task Force, Apr. 2002. 7670 [18] H. Schulzrinne, S. Casner, R. Frederick, and V. Jacobson, "RTP: 7671 a transport protocol for real-time applications," RFC 3550, Internet 7672 Engineering Task Force, July 2003. 7674 [19] E. Rescorla, "HTTP over TLS," RFC 2818, Internet Engineering 7675 Task Force, May 2000. 7677 [20] R. Fielding, J. Gettys, J. C. Mogul, H. Frystyk, and T. 7678 Berners-Lee, "Hypertext transfer protocol -- HTTP/1.1," RFC 2068, 7679 Internet Engineering Task Force, Jan. 1997. 7681 [21] T. Narten and H. Alvestrand, "Guidelines for writing an IANA 7682 considerations section in RFCs," RFC 2434, Internet Engineering Task 7683 Force, Oct. 1998. 7685 [22] S. Olson, G. Camarillo, and A. B. Roach, "Support for IPv6 in 7686 session description protocol (SDP)," RFC 3266, Internet Engineering 7687 Task Force, June 2002. 7689 [23] R. Hinden and S. E. Deering, "Internet protocol version 6 (ipv6) 7690 addressing architecture," RFC 3513, Internet Engineering Task Force, 7691 Apr. 2003. 7693 K Informative References 7695 [24] T. Z. M. Westerlund, "How to make real-time streaming protocol 7696 (rtsp) traverse network address translators (nat) and interact with 7697 firewalls.," internet draft, Internet Engineering Task Force, Feb. 7698 2004. Work in progress. 7700 [25] A. Narasimhan, "Mute and unmute extension to rtsp," internet 7701 draft, Internet Engineering Task Force, Feb. 2002. Work in progress. 7703 [26] P. Gentric, "Rtsp stream switching," internet draft, Internet 7704 Engineering Task Force, Jan. 2004. Work in progress. 7706 [27] A. L. G. Srikantan, J. Murata, "Streaming relays," internet 7707 draft, Internet Engineering Task Force, Dec. 2003. Work in progress. 7709 [28] F. Yergeau, G. Nicol, G. C. Adams, and M. Duerst, 7710 "Internationalization of the hypertext markup language," RFC 2070, 7711 Internet Engineering Task Force, Jan. 1997. 7713 [29] ISO/IEC, "Information technology -- generic coding of moving 7714 pictures and associated audio informaiton -- part 6: extension for 7715 digital storage media and control," Draft International Standard ISO 7716 13818-6, International Organization for Standardization ISO/IEC 7717 JTC1/SC29/WG11, Geneva, Switzerland, Nov. 1995. 7719 [30] C. Partridge and R. Hinden, "Version 2 of the reliable data 7720 protocol (RDP)," RFC 1151, Internet Engineering Task Force, Apr. 7721 1990. 7723 [31] H. Schulzrinne, "A comprehensive multimedia control architecture 7724 for the Internet," in Proc. International Workshop on Network and 7725 Operating System Support for Digital Audio and Video (NOSSDAV), (St. 7726 Louis, Missouri), May 1997. 7728 [32] International Telecommunication Union, "Visual telephone systems 7729 and equipment for local area networks which provide a non-guaranteed 7730 quality of service," Recommendation H.323, Telecommunication 7731 Standardization Sector of ITU, Geneva, Switzerland, May 1996. 7733 [33] P. McMahon, "GSS-API authentication method for SOCKS version 5," 7734 RFC 1961, Internet Engineering Task Force, June 1996. 7736 [34] J. Miller, P. Resnick, and D. Singer, "Rating services and 7737 rating systems (and their machine readable descriptions)," 7738 Recommendation REC-PICS-services-961031, W3C (World Wide Web 7739 Consortium), Boston, Massachusetts, Oct. 1996. 7741 [35] J. Miller, T. Krauskopf, P. Resnick, and W. Treese, "PICS label 7742 distribution label syntax and communication protocols," 7743 Recommendation REC-PICS-labels-961031, W3C (World Wide Web 7744 Consortium), Boston, Massachusetts, Oct. 1996. 7746 [36] R. Braden, "T/TCP -- TCP extensions for transactions functional 7747 specification," RFC 1644, Internet Engineering Task Force, July 1994. 7749 [37] W. R. Stevens, TCP/IP illustrated: the implementation, vol. 2. 7750 Reading, Massachusetts: Addison-Wesley, 1994. 7752 [38] S. Josefsson and I. W. Ed., "The base16, base32, and base64 data 7753 encodings," RFC 3548, Internet Engineering Task Force, July 2003. 7755 [39] Third Generation Partnership Project (3GPP), "Transparent end- 7756 to-end packet-switched streaming service (pss); protocols and 7757 codecs," Technical Specification 26.234, Third Generation Partnership 7758 Project (3GPP), Dec. 2002. 7760 [40] D. Yon, "Connection-oriented media transport in sdp," internet 7761 draft, Internet Engineering Task Force, Mar. 2003. Work in progress. 7763 [41] J. Lazzaro, "Framing rtp and rtcp packets over connection- 7764 oriented transport," internet draft, Internet Engineering Task Force, 7765 Oct. 2003. Work in progress. 7767 [42] G. Camarillo, G. Eriksson, J. Holler, and H. Schulzrinne, 7768 "Grouping of media lines in the session description protocol (SDP)," 7769 RFC 3388, Internet Engineering Task Force, Dec. 2002. 7771 IPR Notice 7773 The IETF takes no position regarding the validity or scope of any 7774 Intellectual Property Rights or other rights that might be claimed to 7775 pertain to the implementation or use of the technology described in 7776 this document or the extent to which any license under such rights 7777 might or might not be available; nor does it represent that it has 7778 made any independent effort to identify any such rights. Information 7779 on the procedures with respect to rights in RFC documents can be 7780 found in BCP 78 and BCP 79. 7782 Copies of IPR disclosures made to the IETF Secretariat and any 7783 assurances of licenses to be made available, or the result of an 7784 attempt made to obtain a general license or permission for the use of 7785 such proprietary rights by implementers or users of this 7786 specification can be obtained from the IETF on-line IPR repository at 7787 http://www.ietf.org/ipr. 7789 The IETF invites any interested party to bring to its attention any 7790 copyrights, patents or patent applications, or other proprietary 7791 rights that may cover technology that may be required to implement 7792 this standard. Please address the information to the IETF at ietf- 7793 ipr@ietf.org. 7795 Full Copyright Statement 7797 Copyright (C) The Internet Society (2004). This document is subject 7798 to the rights, licenses and restrictions contained in BCP 78, and 7799 except as set forth therein, the authors retain all their rights. 7801 This document and the information contained herein are provided on an 7802 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 7803 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 7804 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 7805 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 7806 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 7807 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.