idnits 2.17.1 draft-ietf-mmusic-rtsp-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack an Authors' Addresses Section. ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 189 instances of too long lines in the document, the longest one being 3 characters in excess of 72. == There are 9 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 6 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. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 516: '... A server SHOULD implement all heade...' RFC 2119 keyword, line 536: '...the server. The server SHOULD list the...' RFC 2119 keyword, line 708: '...ddresses in URLs SHOULD be avoided whe...' RFC 2119 keyword, line 749: '...conference identifier MUST be globally...' RFC 2119 keyword, line 765: '...d. A session identifier MUST be chosen...' (112 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 1179 has weird spacing: '...equired all...' == Line 1191 has weird spacing: '...s State all...' == Line 1195 has weird spacing: '...Allowed all...' == Line 1992 has weird spacing: '... type supp...' == Line 3566 has weird spacing: '...eceived next ...' == 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: * Name and description of option. The name may be of any length, but SHOULD be no more than twenty characters long. The name MUST not contain any spaces, control characters or periods. * Indication of who has change control over the option (for example, IETF, ISO, ITU-T, other international standardization bodies, a consortium or a particular company or group of companies); * A reference to a further description, if available, for example (in order of preference) an RFC, a published paper, a patent filing, a technical report, documented source code or a computer manual; * For proprietary options, contact information (postal and email address); == 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: Notes on Table 2: PAUSE is recommended, but not required in that a fully functional server can be built that does not support this method, for example, for live feeds. If a server does not support a particular method, it MUST return "501 Not Implemented" and a client SHOULD not try this method again for this server. == 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 'SHOULD not' in this paragraph: destination: The address to which a stream will be sent. The client may specify the multicast address with the destination parameter. To avoid becoming the unwitting perpetrator of a remote-controlled denial-of-service attack, a server SHOULD authenticate the client and SHOULD log such attempts before allowing the client to direct a media stream to an address not chosen by the server. This is particularly important if RTSP commands are issued via UDP, but implementations cannot rely on TCP as reliable means of client identification by itself. A server SHOULD not allow a client to direct media streams to an address that differs from the address commands are coming from. -- 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 3699 looks like a reference -- Missing reference section? '2' on line 254 looks like a reference -- Missing reference section? '3' on line 295 looks like a reference -- Missing reference section? '4' on line 298 looks like a reference -- Missing reference section? '5' on line 817 looks like a reference -- Missing reference section? '6' on line 3425 looks like a reference -- Missing reference section? '7' on line 432 looks like a reference -- Missing reference section? '8' on line 433 looks like a reference -- Missing reference section? '9' on line 434 looks like a reference -- Missing reference section? '10' on line 758 looks like a reference -- Missing reference section? '11' on line 467 looks like a reference -- Missing reference section? '12' on line 474 looks like a reference -- Missing reference section? '13' on line 474 looks like a reference -- Missing reference section? '14' on line 662 looks like a reference -- Missing reference section? '15' on line 709 looks like a reference -- Missing reference section? '16' on line 713 looks like a reference -- Missing reference section? '17' on line 757 looks like a reference -- Missing reference section? 'H6' on line 1038 looks like a reference -- Missing reference section? 'H10' on line 1865 looks like a reference -- Missing reference section? 'CRLF' on line 3302 looks like a reference -- Missing reference section? 'H15' on line 3337 looks like a reference -- Missing reference section? '19' on line 3586 looks like a reference -- Missing reference section? '20' on line 3672 looks like a reference Summary: 12 errors (**), 0 flaws (~~), 14 warnings (==), 25 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet Engineering Task Force MMUSIC WG 2 Internet Draft H. Schulzrinne, A. Rao, R. Lanphier 3 draft-ietf-mmusic-rtsp-07.txt Columbia U./Netscape/RealNetworks 4 January 7, 1998 Expires: July 7, 1998 6 Real Time Streaming Protocol (RTSP) 8 STATUS OF THIS MEMO 10 This document is an Internet-Draft. Internet-Drafts are working 11 documents of the Internet Engineering Task Force (IETF), its areas, 12 and its working groups. Note that other groups may also distribute 13 working documents as Internet-Drafts. 15 Internet-Drafts are draft documents valid for a maximum of six months 16 and may be updated, replaced, or obsoleted by other documents at any 17 time. It is inappropriate to use Internet-Drafts as reference 18 material or to cite them other than as ``work in progress''. 20 To learn the current status of any Internet-Draft, please check the 21 ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow 22 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 23 munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or 24 ftp.isi.edu (US West Coast). 26 Distribution of this document is unlimited. 28 Abstract: 30 The Real Time Streaming Protocol, or RTSP, is an application-level 31 protocol for control over the delivery of data with real-time 32 properties. RTSP provides an extensible framework to enable 33 controlled, on-demand delivery of real-time data, such as audio and 34 video. Sources of data can include both live data feeds and stored 35 clips. This protocol is intended to control multiple data delivery 36 sessions, provide a means for choosing delivery channels such as UDP, 37 multicast UDP and TCP, and provide a means for choosing delivery 38 mechanisms based upon RTP (RFC 1889). 40 This is a snapshot of the current draft which will become the next 41 version of the ``official'' Internet Draft. 43 Copyright Notice: 45 Copyright (C) The Internet Society (1997). All Rights Reserved. 47 H. Schulzrinne, A. Rao, R. Lanphier Page 1 48 Table of Contents 50 * Contents 51 * 1 Introduction 52 + 1.1 Purpose 53 + 1.2 Requirements 54 + 1.3 Terminology 55 + 1.4 Protocol Properties 56 + 1.5 Extending RTSP 57 + 1.6 Overall Operation 58 + 1.7 RTSP States 59 + 1.8 Relationship with Other Protocols 60 * 2 Notational Conventions 61 * 3 Protocol Parameters 62 + 3.1 RTSP Version 63 + 3.2 RTSP URL 64 + 3.3 Conference Identifiers 65 + 3.4 Session Identifiers 66 + 3.5 SMPTE Relative Timestamps 67 + 3.6 Normal Play Time 68 + 3.7 Absolute Time 69 + 3.8 Option Tags 70 o 3.8.1 Registering New Option Tags with IANA 71 * 4 RTSP Message 72 + 4.1 Message Types 73 + 4.2 Message Headers 74 + 4.3 Message Body 75 + 4.4 Message Length 76 * 5 General Header Fields 77 * 6 Request 78 + 6.1 Request Line 79 + 6.2 Request Header Fields 80 * 7 Response 81 + 7.1 Status-Line 82 o 7.1.1 Status Code and Reason Phrase 83 o 7.1.2 Response Header Fields 84 * 8 Entity 85 + 8.1 Entity Header Fields 86 + 8.2 Entity Body 87 * 9 Connections 88 + 9.1 Pipelining 89 + 9.2 Reliability and Acknowledgements 90 * 10 Method Definitions 91 + 10.1 OPTIONS 92 + 10.2 DESCRIBE 93 + 10.3 ANNOUNCE 95 H. Schulzrinne, A. Rao, R. Lanphier Page 2 96 + 10.4 SETUP 97 + 10.5 PLAY 98 + 10.6 PAUSE 99 + 10.7 TEARDOWN 100 + 10.8 GET_PARAMETER 101 + 10.9 SET_PARAMETER 102 + 10.10 REDIRECT 103 + 10.11 RECORD 104 + 10.12 Embedded (Interleaved) Binary Data 105 * 11 Status Code Definitions 106 + 11.1 Success 2xx 107 o 11.1.1 250 Low on Storage Space 108 + 11.2 Redirection 3xx 109 + 11.3 Client Error 4xx 110 o 11.3.1 405 Method Not Allowed 111 o 11.3.2 451 Parameter Not Understood 112 o 11.3.3 452 Conference Not Found 113 o 11.3.4 453 Not Enough Bandwidth 114 o 11.3.5 454 Session Not Found 115 o 11.3.6 455 Method Not Valid in This State 116 o 11.3.7 456 Header Field Not Valid for Resource 117 o 11.3.8 457 Invalid Range 118 o 11.3.9 458 Parameter Is Read-Only 119 o 11.3.10 459 Aggregate Operation Not Allowed 120 o 11.3.11 460 Only Aggregate Operation Allowed 121 o 11.3.12 461 Unsupported Transport 122 o 11.3.13 462 Destination Unreachable 123 o 11.3.14 551 Option not supported 124 * 12 Header Field Definitions 125 + 12.1 Accept 126 + 12.2 Accept-Encoding 127 + 12.3 Accept-Language 128 + 12.4 Allow 129 + 12.5 Authorization 130 + 12.6 Bandwidth 131 + 12.7 Blocksize 132 + 12.8 Cache-Control 133 + 12.9 Conference 134 + 12.10 Connection 135 + 12.11 Content-Base 136 + 12.12 Content-Encoding 137 + 12.13 Content-Language 138 + 12.14 Content-Length 139 + 12.15 Content-Location 140 + 12.16 Content-Type 141 + 12.17 CSeq 143 H. Schulzrinne, A. Rao, R. Lanphier Page 3 144 + 12.18 Date 145 + 12.19 Expires 146 + 12.20 From 147 + 12.21 Host 148 + 12.22 If-Match 149 + 12.23 If-Modified-Since 150 + 12.24 Last-Modified 151 + 12.25 Location 152 + 12.26 Proxy-Authenticate 153 + 12.27 Proxy-Require 154 + 12.28 Public 155 + 12.29 Range 156 + 12.30 Referer 157 + 12.31 Retry-After 158 + 12.32 Require 159 + 12.33 RTP-Info 160 + 12.34 Scale 161 + 12.35 Speed 162 + 12.36 Server 163 + 12.37 Session 164 + 12.38 Timestamp 165 + 12.39 Transport 166 + 12.40 Unsupported 167 + 12.41 User-Agent 168 + 12.42 Vary 169 + 12.43 Via 170 + 12.44 WWW-Authenticate 171 * 13 Caching 172 * 14 Examples 173 + 14.1 Media on Demand (Unicast) 174 + 14.2 Streaming of a Container file 175 + 14.3 Single Stream Container Files 176 + 14.4 Live Media Presentation Using Multicast 177 + 14.5 Playing media into an existing session 178 + 14.6 Recording 179 * 15 Syntax 180 + 15.1 Base Syntax 181 * 16 Security Considerations 182 * A RTSP Protocol State Machines 183 + A.1 Client State Machine 184 + A.2 Server State Machine 185 * B Interaction with RTP 186 * C Use of SDP for RTSP Session Descriptions 187 + C.1 Definitions 188 o C.1.1 Control URL 189 o C.1.2 Media streams 191 H. Schulzrinne, A. Rao, R. Lanphier Page 4 192 o C.1.3 Payload type(s) 193 o C.1.4 Format-specific parameters 194 o C.1.5 Range of presentation 195 o C.1.6 Time of availability 196 o C.1.7 Connection Information 197 o C.1.8 Entity Tag 198 + C.2 Aggregate Control Not Available 199 + C.3 Aggregate Control Available 200 * D Minimal RTSP implementation 201 + D.1 Client 202 o D.1.1 Basic Playback 203 o D.1.2 Authentication-enabled 204 + D.2 Server 205 o D.2.1 Basic Playback 206 o D.2.2 Authentication-enabled 207 * E Changes 208 * F Author Addresses 209 * G Acknowledgements 210 * References 212 1 Introduction 214 1.1 Purpose 216 The Real-Time Streaming Protocol (RTSP) establishes and controls 217 either a single or several time-synchronized streams of continuous 218 media such as audio and video. It does not typically deliver the 219 continuous streams itself, although interleaving of the continuous 220 media stream with the control stream is possible (see Section 10.12). 221 In other words, RTSP acts as a ``network remote control'' for 222 multimedia servers. 224 The set of streams to be controlled is defined by a presentation 225 description. This memorandum does not define a format for a 226 presentation description. 228 There is no notion of an RTSP connection; instead, a server maintains 229 a session labeled by an identifier. An RTSP session is in no way tied 230 to a transport-level connection such as a TCP connection. During an 231 RTSP session, an RTSP client may open and close many reliable 232 transport connections to the server to issue RTSP requests. 233 Alternatively, it may use a connectionless transport protocol such as 234 UDP. 236 H. Schulzrinne, A. Rao, R. Lanphier Page 5 237 The streams controlled by RTSP may use RTP [1], but the operation of 238 RTSP does not depend on the transport mechanism used to carry 239 continuous media. 241 The protocol is intentionally similar in syntax and operation to 242 HTTP/1.1 so that extension mechanisms to HTTP can in most cases also 243 be added to RTSP. However, RTSP differs in a number of important 244 aspects from HTTP: 246 * RTSP introduces a number of new methods and has a different 247 protocol identifier. 248 * An RTSP server needs to maintain state by default in almost all 249 cases, as opposed to the stateless nature of HTTP. 250 * Both an RTSP server and client can issue requests. 251 * Data is carried out-of-band by a different protocol. (There is an 252 exception to this.) 253 * RTSP is defined to use ISO 10646 (UTF-8) rather than ISO 8859-1, 254 consistent with current HTML internationalization efforts [2]. 255 * The Request-URI always contains the absolute URI. Because of 256 backward compatibility with a historical blunder, HTTP/1.1 carries 257 only the absolute path in the request and puts the host name in a 258 separate header field. 260 This makes ``virtual hosting'' easier, where a single host with one 261 IP address hosts several document trees. 263 The protocol supports the following operations: 265 Retrieval of media from media server: 266 The client can request a presentation description via HTTP or 267 some other method. If the presentation is being multicast, the 268 presentation description contains the multicast addresses and 269 ports to be used for the continuous media. If the presentation 270 is to be sent only to the client via unicast, the client 271 provides the destination for security reasons. 273 Invitation of a media server to a conference: 274 A media server can be ``invited'' to join an existing 275 conference, either to play back media into the presentation or 276 to record all or a subset of the media in a presentation. This 277 mode is useful for distributed teaching applications. Several 278 parties in the conference may take turns ``pushing the remote 279 control buttons''. 281 H. Schulzrinne, A. Rao, R. Lanphier Page 6 282 Addition of media to an existing presentation: 283 Particularly for live presentations, it is useful if the server 284 can tell the client about additional media becoming available. 286 RTSP requests may be handled by proxies, tunnels and caches as in 287 HTTP/1.1. 289 1.2 Requirements 291 The key words ``MUST'', ``MUST NOT'', ``REQUIRED'', ``SHALL'', ``SHALL 292 NOT'', ``SHOULD'', ``SHOULD NOT'', ``RECOMMENDED'', ``MAY'', and 293 ``OPTIONAL'' in this document are to be interpreted as described in 294 RFC 2119 [3]. 296 1.3 Terminology 298 Some of the terminology has been adopted from HTTP/1.1 [4]. Terms not 299 listed here are defined as in HTTP/1.1. 301 Aggregate control: 302 The control of the multiple streams using a single timeline by 303 the server. For audio/video feeds, this means that the client 304 may issue a single play or pause message to control both the 305 audio and video feeds. 307 Conference: 308 a multiparty, multimedia presentation, where ``multi'' implies 309 greater than or equal to one. 311 Client: 312 The client requests continuous media data from the media 313 server. 315 Connection: 316 A transport layer virtual circuit established between two 317 programs for the purpose of communication. 319 Container file: 320 A file which may contain multiple media streams which often 321 comprise a presentation when played together. RTSP servers may 322 offer aggregate control on these files, though the concept of a 323 container file is not embedded in the protocol. 325 H. Schulzrinne, A. Rao, R. Lanphier Page 7 326 Continuous media: 327 Data where there is a timing relationship between source and 328 sink; that is, the sink must reproduce the timing relationship 329 that existed at the source. The most common examples of 330 continuous media are audio and motion video. Continuous media 331 can be real-time (interactive), where there is a ``tight'' 332 timing relationship between source and sink, or streaming 333 (playback), where the relationship is less strict. 335 Entity: 336 The information transferred as the payload of a request or 337 response. An entity consists of metainformation in the form of 338 entity-header fields and content in the form of an entity-body, 339 as described in Section 8. 341 Media initialization: 342 Datatype/codec specific initialization. This includes such 343 things as clockrates, color tables, etc. Any 344 transport-independent information which is required by a client 345 for playback of a media stream occurs in the media 346 initialization phase of stream setup. 348 Media parameter: 349 Parameter specific to a media type that may be changed before 350 or during stream playback. 352 Media server: 353 The server providing playback or recording services for one or 354 more media streams. Different media streams within a 355 presentation may originate from different media servers. A 356 media server may reside on the same or a different host as the 357 web server the presentation is invoked from. 359 Media server indirection: 360 Redirection of a media client to a different media server. 362 (Media) stream: 363 A single media instance, e.g., an audio stream or a video 364 stream as well as a single whiteboard or shared application 365 group. When using RTP, a stream consists of all RTP and RTCP 366 packets created by a source within an RTP session. This is 367 equivalent to the definition of a DSM-CC stream([5]). 369 H. Schulzrinne, A. Rao, R. Lanphier Page 8 370 Message: 371 The basic unit of RTSP communication, consisting of a 372 structured sequence of octets matching the syntax defined in 373 Section 15 and transmitted via a connection or a connectionless 374 protocol. 376 Participant: 377 Member of a conference. A participant may be a machine, e.g., a 378 media record or playback server. 380 Presentation: 381 A set of one or more streams presented to the client as a 382 complete media feed, using a presentation description as 383 defined below. In most cases in the RTSP context, this implies 384 aggregate control of those streams, but does not have to. 386 Presentation description: 387 A presentation description contains information about one or 388 more media streams within a presentation, such as the set of 389 encodings, network addresses and information about the content. 390 Other IETF protocols such as SDP (RFC XXXX) use the term 391 ``session'' for a live presentation. The presentation 392 description may take several different formats, including but 393 not limited to the session description format SDP. 395 Response: 396 An RTSP response. If an HTTP response is meant, that is 397 indicated explicitly. 399 Request: 400 An RTSP request. If an HTTP request is meant, that is indicated 401 explicitly. 403 RTSP session: 404 A complete RTSP ``transaction'', e.g., the viewing of a movie. 405 A session typically consists of a client setting up a transport 406 mechanism for the continuous media stream (SETUP), starting the 407 stream with PLAY or RECORD, and closing the stream with 408 TEARDOWN. 410 Transport initialization: 411 The negotiation of transport information (e.g., port numbers, 412 transport protocols) between the client and the server. 414 H. Schulzrinne, A. Rao, R. Lanphier Page 9 415 1.4 Protocol Properties 417 RTSP has the following properties: 419 Extendable: 420 New methods and parameters can be easily added to RTSP. 422 Easy to parse: 423 RTSP can be parsed by standard HTTP or MIME parsers. 425 Secure: 426 RTSP re-uses web security mechanisms, either at the transport 427 level (TLS, RFC XXXX) or within the protocol itself. All HTTP 428 authentication mechanisms such as basic [4, Section 11.1] and 429 digest authentication [6] are directly applicable. 431 Transport-independent: 432 RTSP may use either an unreliable datagram protocol (UDP) [7], 433 a reliable datagram protocol (RDP, not widely used [8]) or a 434 reliable stream protocol such as TCP [9] as it implements 435 application-level reliability. 437 Multi-server capable: 438 Each media stream within a presentation can reside on a 439 different server. The client automatically establishes several 440 concurrent control sessions with the different media servers. 441 Media synchronization is performed at the transport level. 443 Control of recording devices: 444 The protocol can control both recording and playback devices, 445 as well as devices that can alternate between the two modes 446 (``VCR''). 448 Separation of stream control and conference initiation: 449 Stream control is divorced from inviting a media server to a 450 conference. The only requirement is that the conference 451 initiation protocol either provides or can be used to create a 452 unique conference identifier. In particular, SIP [10] or H.323 453 may be used to invite a server to a conference. 455 Suitable for professional applications: 456 RTSP supports frame-level accuracy through SMPTE time stamps to 457 allow remote digital editing. 459 Presentation description neutral: 460 The protocol does not impose a particular presentation 461 description or metafile format and can convey the type of 462 format to be used. However, the presentation description must 463 contain at least one RTSP URI. 465 Proxy and firewall friendly: 466 The protocol should be readily handled by both application and 467 transport-layer (SOCKS [11]) firewalls. A firewall may need to 468 understand the SETUP method to open a ``hole'' for the UDP 469 media stream. 471 HTTP-friendly: 472 Where sensible, RTSP reuses HTTP concepts, so that the existing 473 infrastructure can be reused. This infrastructure includes PICS 474 (Platform for Internet Content Selection [12,13]) for 475 associating labels with content. However, RTSP does not just 476 add methods to HTTP since the controlling continuous media 477 requires server state in most cases. 479 Appropriate server control: 480 If a client can start a stream, it must be able to stop a 481 stream. Servers should not start streaming to clients in such a 482 way that clients cannot stop the stream. 484 Transport negotiation: 485 The client can negotiate the transport method prior to actually 486 needing to process a continuous media stream. 488 Capability negotiation: 489 If basic features are disabled, there must be some clean 490 mechanism for the client to determine which methods are not 491 going to be implemented. This allows clients to present the 492 appropriate user interface. For example, if seeking is not 493 allowed, the user interface must be able to disallow moving a 494 sliding position indicator. 496 An earlier requirement in RTSP was multi-client capability. 497 However, it was determined that a better approach was to make sure 498 that the protocol is easily extensible to the multi-client 499 scenario. Stream identifiers can be used by several control 500 streams, so that ``passing the remote'' would be possible. The 501 protocol would not address how several clients negotiate access; 502 this is left to either a ``social protocol'' or some other floor 503 control mechanism. 505 1.5 Extending RTSP 507 Since not all media servers have the same functionality, media servers 508 by necessity will support different sets of requests. For example: 509 * A server may only be capable of playback thus has no need to 510 support the RECORD request. 511 * A server may not be capable of seeking (absolute positioning) if 512 it is to support live events only. 513 * Some servers may not support setting stream parameters and thus 514 not support GET_PARAMETER and SET_PARAMETER. 516 A server SHOULD implement all header fields described in Section 12. 518 It is up to the creators of presentation descriptions not to ask the 519 impossible of a server. This situation is similar in HTTP/1.1, where 520 the methods described in [H19.6] are not likely to be supported across 521 all servers. 523 RTSP can be extended in three ways, listed here in order of the 524 magnitude of changes supported: 526 * Existing methods can be extended with new parameters, as long as 527 these parameters can be safely ignored by the recipient. (This is 528 equivalent to adding new parameters to an HTML tag.) If the client 529 needs negative acknowledgement when a method extension is not 530 supported, a tag corresponding to the extension may be added in 531 the Require: field (see Section 12.32). 532 * New methods can be added. If the recipient of the message does not 533 understand the request, it responds with error code 501 (Not 534 implemented) and the sender should not attempt to use this method 535 again. A client may also use the OPTIONS method to inquire about 536 methods supported by the server. The server SHOULD list the 537 methods it supports using the Public response header. 538 * A new version of the protocol can be defined, allowing almost all 539 aspects (except the position of the protocol version number) to 540 change. 542 1.6 Overall Operation 544 Each presentation and media stream may be identified by an RTSP URL. 545 The overall presentation and the properties of the media the 546 presentation is made up of are defined by a presentation description 547 file, the format of which is outside the scope of this specification. 548 The presentation description file may be obtained by the client using 549 HTTP or other means such as email and may not necessarily be stored on 550 the media server. 552 For the purposes of this specification, a presentation description is 553 assumed to describe one or more presentations, each of which maintains 554 a common time axis. For simplicity of exposition and without loss of 555 generality, it is assumed that the presentation description contains 556 exactly one such presentation. A presentation may contain several 557 media streams. 559 The presentation description file contains a description of the media 560 streams making up the presentation, including their encodings, 561 language, and other parameters that enable the client to choose the 562 most appropriate combination of media. In this presentation 563 description, each media stream that is individually controllable by 564 RTSP is identified by an RTSP URL, which points to the media server 565 handling that particular media stream and names the stream stored on 566 that server. Several media streams can be located on different 567 servers; for example, audio and video streams can be split across 568 servers for load sharing. The description also enumerates which 569 transport methods the server is capable of. 571 Besides the media parameters, the network destination address and port 572 need to be determined. Several modes of operation can be 573 distinguished: 575 Unicast: 576 The media is transmitted to the source of the RTSP request, 577 with the port number chosen by the client. Alternatively, the 578 media is transmitted on the same reliable stream as RTSP. 580 Multicast, server chooses address: 581 The media server picks the multicast address and port. This is 582 the typical case for a live or near-media-on-demand 583 transmission. 585 Multicast, client chooses address: 586 If the server is to participate in an existing multicast 587 conference, the multicast address, port and encryption key are 588 given by the conference description, established by means 589 outside the scope of this specification. 591 1.7 RTSP States 593 RTSP controls a stream which may be sent via a separate protocol, 594 independent of the control channel. For example, RTSP control may 595 occur on a TCP connection while the data flows via UDP. Thus, data 596 delivery continues even if no RTSP requests are received by the media 597 server. Also, during its lifetime, a single media stream may be 598 controlled by RTSP requests issued sequentially on different TCP 599 connections. Therefore, the server needs to maintain ``session state'' 600 to be able to correlate RTSP requests with a stream. The state 601 transitions are described in Section A. 603 Many methods in RTSP do not contribute to state. However, the 604 following play a central role in defining the allocation and usage of 605 stream resources on the server: SETUP, PLAY, RECORD, PAUSE, and 606 TEARDOWN. 608 SETUP: 609 Causes the server to allocate resources for a stream and start 610 an RTSP session. 612 PLAY and RECORD: 613 Starts data transmission on a stream allocated via SETUP. 615 PAUSE: 616 Temporarily halts a stream without freeing server resources. 618 TEARDOWN: 619 Frees resources associated with the stream. The RTSP session 620 ceases to exist on the server. 622 1.8 Relationship with Other Protocols 624 RTSP has some overlap in functionality with HTTP. It also may interact 625 with HTTP in that the initial contact with streaming content is often 626 to be made through a web page. The current protocol specification aims 627 to allow different hand-off points between a web server and the media 628 server implementing RTSP. For example, the presentation description 629 can be retrieved using HTTP or RTSP, which reduces roundtrips in 630 web-browser-based scenarios, yet also allows for standalone RTSP 631 servers and clients which do not rely on HTTP at all. 633 However, RTSP differs fundamentally from HTTP in that data delivery 634 takes place out-of-band in a different protocol. HTTP is an asymmetric 635 protocol where the client issues requests and the server responds. In 636 RTSP, both the media client and media server can issue requests. RTSP 637 requests are also not stateless; they may set parameters and continue 638 to control a media stream long after the request has been 639 acknowledged. 641 Re-using HTTP functionality has advantages in at least two areas, 642 namely security and proxies. The requirements are very similar, so 643 having the ability to adopt HTTP work on caches, proxies and 644 authentication is valuable. 646 While most real-time media will use RTP as a transport protocol, RTSP 647 is not tied to RTP. 649 RTSP assumes the existence of a presentation description format that 650 can express both static and temporal properties of a presentation 651 containing several media streams. 653 2 Notational Conventions 655 Since many of the definitions and syntax are identical to HTTP/1.1, 656 this specification only points to the section where they are defined 657 rather than copying it. For brevity, [HX.Y] is to be taken to refer to 658 Section X.Y of the current HTTP/1.1 specification (RFC 2068). 660 All the mechanisms specified in this document are described in both 661 prose and an augmented Backus-Naur form (BNF) similar to that used in 662 RFC 2068 [H2.1]. It is described in detail in [14], with the 663 difference that this RTSP specification maintains the ``1#'' notation 664 for comma-separated lists. 666 In this draft, we use indented and smaller-type paragraphs to provide 667 background and motivation. This is intended to give readers who were 668 not involved with the formulation of the specification an 669 understanding of why things are the way that they are in RTSP. 671 3 Protocol Parameters 673 3.1 RTSP Version 675 [H3.1] applies, with HTTP replaced by RTSP. 677 3.2 RTSP URL 679 The ``rtsp'', ``rtspu'' and ``rtsps'' schemes are used to refer to 680 network resources via the RTSP protocol. This section defines the 681 scheme-specific syntax and semantics for RTSP URLs. 683 rtsp_URL = ( "rtsp:" | "rtspu:" | "rtsps:" ) 684 "//" host [ ":" port ] [ abs_path ] 685 host = 688 port = *DIGIT 690 abs_path is defined in [H3.2.1]. 692 Note that fragment and query identifiers do not have a well-defined 693 meaning at this time, with the interpretation left to the RTSP 694 server. 696 The scheme rtsp requires that commands are issued via a reliable 697 protocol (within the Internet, TCP), while the scheme rtspu identifies 698 an unreliable protocol (within the Internet, UDP). The scheme rtsps 699 indicates that a TCP connection secured by TLS (RFC XXXX) must be 700 used. 702 If the port is empty or not given, port 554 is assumed. The semantics 703 are that the identified resource can be controlled by RTSP at the 704 server listening for TCP (scheme ``rtsp'') connections or UDP (scheme 705 ``rtspu'') packets on that port of host, and the Request-URI for the 706 resource is rtsp_URL. 708 The use of IP addresses in URLs SHOULD be avoided whenever possible 709 (see RFC 1924 [15]). 711 A presentation or a stream is identified by a textual media 712 identifier, using the character set and escape conventions [H3.2] of 713 URLs [16]. URLs may refer to a stream or an aggregate of streams, 714 i.e., a presentation. Accordingly, requests described in Section 10 715 can apply to either the whole presentation or an individual stream 716 within the presentation. Note that some request methods can only be 717 applied to streams, not presentations and vice versa. 719 For example, the RTSP URL: 720 rtsp://media.example.com:554/twister/audiotrack 722 identifies the audio stream within the presentation ``twister'', which 723 can be controlled via RTSP requests issued over a TCP connection to 724 port 554 of host media.example.com. 726 Also, the RTSP URL: 727 rtsp://media.example.com:554/twister 729 identifies the presentation ``twister'', which may be composed of 730 audio and video streams. 732 This does not imply a standard way to reference streams in URLs. 733 The presentation description defines the hierarchical relationships 734 in the presentation and the URLs for the individual streams. A 735 presentation description may name a stream ``a.mov'' and the whole 736 presentation ``b.mov''. 738 The path components of the RTSP URL are opaque to the client and do 739 not imply any particular file system structure for the server. 741 This decoupling also allows presentation descriptions to be used 742 with non-RTSP media control protocols simply by replacing the 743 scheme in the URL. 745 3.3 Conference Identifiers 747 Conference identifiers are opaque to RTSP and are encoded using 748 standard URI encoding methods (i.e., LWS is escaped with %). They can 749 contain any octet value. The conference identifier MUST be globally 750 unique. For H.323, the conferenceID value is to be used. 752 conference-id = 1*xchar 754 Conference identifiers are used to allow RTSP sessions to obtain 755 parameters from multimedia conferences the media server is 756 participating in. These conferences are created by protocols 757 outside the scope of this specification, e.g., H.323 [17] or SIP 758 [10]. Instead of the RTSP client explicitly providing transport 759 information, for example, it asks the media server to use the 760 values in the conference description instead. 762 3.4 Session Identifiers 764 Session identifiers are opaque strings of arbitrary length. Linear 765 white space must be URL-escaped. A session identifier MUST be chosen 766 randomly and MUST be at least eight octets long to make guessing it 767 more difficult. (See Section 16.) 769 session-id = 1*( ALPHA | DIGIT | safe ) 771 3.5 SMPTE Relative Timestamps 773 A SMPTE relative timestamp expresses time relative to the start of 774 the clip. Relative timestamps are expressed as SMPTE time codes for 775 frame-level access accuracy. The time code has the format 776 hours:minutes:seconds:frames.subframes, with the origin at the start 777 of the clip. The default smpte format is``SMPTE 30 drop'' format, with 778 frame rate is 29.97 frames per second. Other SMPTE codes MAY be 779 supported (such as "SMPTE 25") through the use of alternative use of 780 "smpte time". For the ``frames'' field in the time value can assume 781 the values 0 through 29. The difference between 30 and 29.97 frames 782 per second is handled by dropping the first two frame indices (values 783 00 and 01) of every minute, except every tenth minute. If the frame 784 value is zero, it may be omitted. Subframes are measured in 785 one-hundredth of a frame. 787 smpte-range = smpte-type "=" smpte-time "-" [ smpte-time ] 788 smpte-type = "smpte" | "smpte-30-drop" | "smpte-25" 789 ; other timecodes may be added 790 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT [ ":" 1*2DIGIT ] 791 [ "." 1*2DIGIT ] 793 Examples: 794 smpte=10:12:33:20- 795 smpte=10:07:33- 796 smpte=10:07:00-10:07:33:05.01 797 smpte-25=10:07:00-10:07:33:05.01 799 3.6 Normal Play Time 801 Normal play time (NPT) indicates the stream absolute position 802 relative to the beginning of the presentation. The timestamp consists 803 of a decimal fraction. The part left of the decimal may be expressed 804 in either seconds or hours, minutes, and seconds. The part right of 805 the decimal point measures fractions of a second. 807 The beginning of a presentation corresponds to 0.0 seconds. Negative 808 values are not defined. The special constant now is defined as the 809 current instant of a live event. It may be used only for live events. 811 NPT is defined as in DSM-CC: ``Intuitively, NPT is the clock the 812 viewer associates with a program. It is often digitally displayed on a 813 VCR. NPT advances normally when in normal play mode (scale = 1), 814 advances at a faster rate when in fast scan forward (high positive 815 scale ratio), decrements when in scan reverse (high negative scale 816 ratio) and is fixed in pause mode. NPT is (logically) equivalent to 817 SMPTE time codes.'' [5] 819 npt-range = ( npt-time "-" [ npt-time ] ) | ( "-" npt-time ) 820 npt-time = "now" | npt-sec | npt-hhmmss 821 npt-sec = 1*DIGIT [ "." *DIGIT ] 822 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." *DIGIT ] 823 npt-hh = 1*DIGIT ; any positive number 824 npt-mm = 1*2DIGIT ; 0-59 825 npt-ss = 1*2DIGIT ; 0-59 827 Examples: 828 npt=123.45-125 829 npt=12:05:35.3- 830 npt=now- 832 The syntax conforms to ISO 8601. The npt-sec notation is optimized 833 for automatic generation, the ntp-hhmmss notation for consumption 834 by human readers. The ``now'' constant allows clients to request to 835 receive the live feed rather than the stored or time-delayed 836 version. This is needed since neither absolute time nor zero time 837 are appropriate for this case. 839 3.7 Absolute Time 841 Absolute time is expressed as ISO 8601 timestamps, using UTC (GMT). 842 Fractions of a second may be indicated. 844 utc-range = "clock" "=" utc-time "-" [ utc-time ] 845 utc-time = utc-date "T" utc-time "Z" 846 utc-date = 8DIGIT ; < YYYYMMDD > 847 utc-time = 6DIGIT [ "." fraction ] ; < HHMMSS.fraction > 849 Example for November 8, 1996 at 14h37 and 20 and a quarter seconds 850 UTC: 852 19961108T143720.25Z 854 3.8 Option Tags 856 Option tags are unique identifiers used to designate new options in 857 RTSP. These tags are used in in Require (Section 12.32) and 858 Proxy-Require (Section 12.27) header fields. 860 Syntax: 862 option-tag = 1*xchar 864 The creator of a new RTSP option should either prefix the option with 865 a reverse domain name (e.g., ``com.foo.mynewfeature'' is an apt name 866 for a feature whose inventor can be reached at ``foo.com''), or 867 register the new option with the Internet Assigned Numbers Authority 868 (IANA). 870 3.8.1 Registering New Option Tags with IANA 872 When registering a new RTSP option, the following information should 873 be provided: 875 * Name and description of option. The name may be of any length, but 876 SHOULD be no more than twenty characters long. The name MUST not 877 contain any spaces, control characters or periods. 878 * Indication of who has change control over the option (for example, 879 IETF, ISO, ITU-T, other international standardization bodies, a 880 consortium or a particular company or group of companies); 881 * A reference to a further description, if available, for example 882 (in order of preference) an RFC, a published paper, a patent 883 filing, a technical report, documented source code or a computer 884 manual; 885 * For proprietary options, contact information (postal and email 886 address); 888 4 RTSP Message 890 RTSP is a text-based protocol and uses the ISO 10646 character set 891 in UTF-8 encoding (RFC 2044). Lines are terminated by CRLF, but 892 receivers should be prepared to also interpret CR and LF by themselves 893 as line terminators. 895 Text-based protocols make it easier to add optional parameters in a 896 self-describing manner. Since the number of parameters and the 897 frequency of commands is low, processing efficiency is not a 898 concern. Text-based protocols, if done carefully, also allow easy 899 implementation of research prototypes in scripting languages such 900 as Tcl, Visual Basic and Perl. 902 The 10646 character set avoids tricky character set switching, but 903 is invisible to the application as long as US-ASCII is being used. 904 This is also the encoding used for RTCP. ISO 8859-1 translates 905 directly into Unicode with a high-order octet of zero. ISO 8859-1 906 characters with the most-significant bit set are represented as 907 1100001x 10xxxxxx. 909 RTSP messages can be carried over any lower-layer transport protocol 910 that is 8-bit clean. 912 Requests contain methods, the object the method is operating upon and 913 parameters to further describe the method. Methods are idempotent, 914 unless otherwise noted. Methods are also designed to require little or 915 no state maintenance at the media server. 917 4.1 Message Types 919 See [H4.1] 921 4.2 Message Headers 923 See [H4.2] 925 4.3 Message Body 927 See [H4.3] 929 4.4 Message Length 931 When a message body is included with a message, the length of that 932 body is determined by one of the following (in order of precedence): 934 1. Any response message which MUST NOT include a message body 935 (such as the 1xx, 204, and 304 responses) is always terminated 936 by the first empty line after the header fields, regardless of 937 the entity-header fields present in the message. (Note: An 938 empty line consists of only CRLF.) 940 2. If a Content-Length header field (section 12.14) is present, 941 its value in bytes represents the length of the message-body. 942 If this header field is not present, a value of zero is 943 assumed. 945 3. By the server closing the connection. (Closing the connection 946 cannot be used to indicate the end of a request body, since 947 that would leave no possibility for the server to send back a 948 response.) 950 Note that RTSP does not (at present) support the HTTP/1.1 ``chunked'' 951 transfer coding(see [H3.6]) and requires the presence of the 952 Content-Length header field. 954 Given the moderate length of presentation descriptions returned, 955 the server should always be able to determine its length, even if 956 it is generated dynamically, making the chunked transfer encoding 957 unnecessary. Even though Content-Length must be present if there is 958 any entity body, the rules ensure reasonable behavior even if the 959 length is not given explicitly. 961 5 General Header Fields 963 See [H4.5], except that Pragma, Transfer-Encoding and Upgrade 964 headers are not defined: 966 general-header = Cache-Control ; Section 12.8 967 | Connection ; Section 12.10 968 | Date ; Section 12.18 969 | Via ; Section 12.43 971 6 Request 973 A request message from a client to a server or vice versa includes, 974 within the first line of that message, the method to be applied to the 975 resource, the identifier of the resource, and the protocol version in 976 use. 978 Request = Request-Line ; Section 6.1 979 *( general-header ; Section 5 980 | request-header ; Section 6.2 981 | entity-header ) ; Section 8.1 982 CRLF 983 [ message-body ] ; Section 4.3 985 6.1 Request Line 987 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 989 Method = "DESCRIBE" ; Section 10.2 990 | "ANNOUNCE" ; Section 10.3 991 | "GET_PARAMETER" ; Section 10.8 992 | "OPTIONS" ; Section 10.1 993 | "PAUSE" ; Section 10.6 994 | "PLAY" ; Section 10.5 995 | "RECORD" ; Section 10.11 996 | "REDIRECT" ; Section 10.10 997 | "SETUP" ; Section 10.4 998 | "SET_PARAMETER" ; Section 10.9 999 | "TEARDOWN" ; Section 10.7 1000 | extension-method 1002 extension-method = token 1004 Request-URI = "*" | absolute_URI 1006 RTSP-Version = "RTSP" "/" 1*DIGIT "." 1*DIGIT 1008 6.2 Request Header Fields 1010 request-header = Accept ; Section 12.1 1011 | Accept-Encoding ; Section 12.2 1012 | Accept-Language ; Section 12.3 1013 | Authorization ; Section 12.5 1014 | From ; Section 12.20 1015 | If-Modified-Since ; Section 12.23 1016 | Range ; Section 12.29 1017 | Referer ; Section 12.30 1018 | User-Agent ; Section 12.41 1020 Note that in contrast to HTTP/1.1, RTSP requests always contain the 1021 absolute URL (that is, including the scheme, host and port) rather 1022 than just the absolute path. 1024 HTTP/1.1 requires servers to understand the absolute URL, but 1025 clients are supposed to use the Host request header. This is purely 1026 needed for backward-compatibility with HTTP/1.0 servers, a 1027 consideration that does not apply to RTSP. 1029 The asterisk "*" in the Request-URI means that the request does not 1030 apply to a particular resource, but to the server itself, and is only 1031 allowed when the method used does not necessarily apply to a resource. 1032 One example would be: 1034 OPTIONS * RTSP/1.0 1036 7 Response 1038 [H6] applies except that HTTP-Version is replaced by RTSP-Version. 1039 Also, RTSP defines additional status codes and does not define some 1040 HTTP codes. The valid response codes and the methods they can be used 1041 with are defined in Table 1. 1043 After receiving and interpreting a request message, the recipient 1044 responds with an RTSP response message. 1046 Response = Status-Line ; Section 7.1 1047 *( general-header ; Section 5 1048 | response-header ; Section 7.1.2 1049 | entity-header ) ; Section 8.1 1050 CRLF 1051 [ message-body ] ; Section 4.3 1053 7.1 Status-Line 1055 The first line of a Response message is the Status-Line, consisting 1056 of the protocol version followed by a numeric status code, and the 1057 textual phrase associated with the status code, with each element 1058 separated by SP characters. No CR or LF is allowed except in the final 1059 CRLF sequence. 1061 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 1063 7.1.1 Status Code and Reason Phrase 1065 The Status-Code element is a 3-digit integer result code of the 1066 attempt to understand and satisfy the request. These codes are fully 1067 defined in Section 11. The Reason-Phrase is intended to give a short 1068 textual description of the Status-Code. The Status-Code is intended 1069 for use by automata and the Reason-Phrase is intended for the human 1070 user. The client is not required to examine or display the 1071 Reason-Phrase. 1073 The first digit of the Status-Code defines the class of response. The 1074 last two digits do not have any categorization role. There are 5 1075 values for the first digit: 1077 * 1xx: Informational - Request received, continuing process 1078 * 2xx: Success - The action was successfully received, understood, 1079 and accepted 1080 * 3xx: Redirection - Further action must be taken in order to 1081 complete the request 1082 * 4xx: Client Error - The request contains bad syntax or cannot be 1083 fulfilled 1084 * 5xx: Server Error - The server failed to fulfill an apparently 1085 valid request 1087 The individual values of the numeric status codes defined for 1088 RTSP/1.0, and an example set of corresponding Reason-Phrase's, are 1089 presented below. The reason phrases listed here are only recommended - 1090 they may be replaced by local equivalents without affecting the 1091 protocol. Note that RTSP adopts most HTTP/1.1 status codes and adds 1092 RTSP-specific status codes starting at x50 to avoid conflicts with 1093 newly defined HTTP status codes. 1095 Status-Code = "100" ; Continue 1096 | "200" ; OK 1097 | "201" ; Created 1098 | "250" ; Low on Storage Space 1099 | "300" ; Multiple Choices 1100 | "301" ; Moved Permanently 1101 | "302" ; Moved Temporarily 1102 | "303" ; See Other 1103 | "304" ; Not Modified 1104 | "305" ; Use Proxy 1105 | "400" ; Bad Request 1106 | "401" ; Unauthorized 1107 | "402" ; Payment Required 1108 | "403" ; Forbidden 1109 | "404" ; Not Found 1110 | "405" ; Method Not Allowed 1111 | "406" ; Not Acceptable 1112 | "407" ; Proxy Authentication Required 1113 | "408" ; Request Time-out 1114 | "410" ; Gone 1115 | "411" ; Length Required 1116 | "412" ; Precondition Failed 1117 | "413" ; Request Entity Too Large 1118 | "414" ; Request-URI Too Large 1119 | "415" ; Unsupported Media Type 1120 | "451" ; Parameter Not Understood 1121 | "452" ; Conference Not Found 1122 | "453" ; Not Enough Bandwidth 1123 | "454" ; Session Not Found 1124 | "455" ; Method Not Valid in This State 1125 | "456" ; Header Field Not Valid for Resource 1126 | "457" ; Invalid Range 1127 | "458" ; Parameter Is Read-Only 1128 | "459" ; Aggregate operation not allowed 1129 | "460" ; Only aggregate operation allowed 1130 | "461" ; Unsupported transport 1131 | "462" ; Destination unreachable 1132 | "500" ; Internal Server Error 1133 | "501" ; Not Implemented 1134 | "502" ; Bad Gateway 1135 | "503" ; Service Unavailable 1136 | "504" ; Gateway Time-out 1137 | "505" ; RTSP Version not supported 1138 | "551" ; Option not supported 1139 | extension-code 1141 extension-code = 3DIGIT 1143 Reason-Phrase = * 1145 RTSP status codes are extensible. RTSP applications are not required 1146 to understand the meaning of all registered status codes, though such 1147 understanding is obviously desirable. However, applications MUST 1148 understand the class of any status code, as indicated by the first 1149 digit, and treat any unrecognized response as being equivalent to the 1150 x00 status code of that class, with the exception that an unrecognized 1151 response MUST NOT be cached. For example, if an unrecognized status 1152 code of 431 is received by the client, it can safely assume that there 1153 was something wrong with its request and treat the response as if it 1154 had received a 400 status code. In such cases, user agents SHOULD 1155 present to the user the entity returned with the response, since that 1156 entity is likely to include human-readable information which will 1157 explain the unusual status. 1159 Code reason 1161 100 Continue all 1163 200 OK all 1164 201 Created RECORD 1165 250 Low on Storage Space RECORD 1167 300 Multiple Choices all 1168 301 Moved Permanently all 1169 302 Moved Temporarily all 1170 303 See Other all 1171 305 Use Proxy all 1172 400 Bad Request all 1173 401 Unauthorized all 1174 402 Payment Required all 1175 403 Forbidden all 1176 404 Not Found all 1177 405 Method Not Allowed all 1178 406 Not Acceptable all 1179 407 Proxy Authentication Required all 1180 408 Request Timeout all 1181 410 Gone all 1182 411 Length Required all 1183 412 Precondition Failed DESCRIBE, SETUP 1184 413 Request Entity Too Large all 1185 414 Request-URI Too Long all 1186 415 Unsupported Media Type all 1187 451 Invalid parameter SETUP 1188 452 Illegal Conference Identifier SETUP 1189 453 Not Enough Bandwidth SETUP 1190 454 Session Not Found all 1191 455 Method Not Valid In This State all 1192 456 Header Field Not Valid all 1193 457 Invalid Range PLAY 1194 458 Parameter Is Read-Only SET_PARAMETER 1195 459 Aggregate Operation Not Allowed all 1196 460 Only Aggregate Operation Allowed all 1197 461 Unsupported Transport all 1198 462 Destination Unreachable all 1200 500 Internal Server Error all 1201 501 Not Implemented all 1202 502 Bad Gateway all 1203 503 Service Unavailable all 1204 504 Gateway Timeout all 1205 505 RTSP Version Not Supported all 1206 551 Option not support all 1208 Table 1: Status codes and their usage with RTSP methods 1210 7.1.2 Response Header Fields 1212 The response-header fields allow the request recipient to pass 1213 additional information about the response which cannot be placed in 1214 the Status-Line. These header fields give information about the server 1215 and about further access to the resource identified by the 1216 Request-URI. 1218 response-header = Location ; Section 12.25 1219 | Proxy-Authenticate ; Section 12.26 1220 | Public ; Section 12.28 1221 | Retry-After ; Section 12.31 1222 | Server ; Section 12.36 1223 | Vary ; Section 12.42 1224 | WWW-Authenticate ; Section 12.44 1226 Response-header field names can be extended reliably only in 1227 combination with a change in the protocol version. However, new or 1228 experimental header fields MAY be given the semantics of 1229 response-header fields if all parties in the communication recognize 1230 them to be response-header fields. Unrecognized header fields are 1231 treated as entity-header fields. 1233 8 Entity 1235 Request and Response messages MAY transfer an entity if not 1236 otherwise restricted by the request method or response status code. An 1237 entity consists of entity-header fields and an entity-body, although 1238 some responses will only include the entity-headers. 1240 In this section, both sender and recipient refer to either the client 1241 or the server, depending on who sends and who receives the entity. 1243 8.1 Entity Header Fields 1245 Entity-header fields define optional metainformation about the 1246 entity-body or, if no body is present, about the resource identified 1247 by the request. 1249 entity-header = Allow ; Section 12.4 1250 | Content-Base ; Section 12.11 1251 | Content-Encoding ; Section 12.12 1252 | Content-Language ; Section 12.13 1253 | Content-Length ; Section 12.14 1254 | Content-Location ; Section 12.15 1255 | Content-Type ; Section 12.16 1256 | Expires ; Section 12.19 1257 | Last-Modified ; Section 12.24 1258 | extension-header 1259 extension-header = message-header 1261 The extension-header mechanism allows additional entity-header fields 1262 to be defined without changing the protocol, but these fields cannot 1263 be assumed to be recognizable by the recipient. Unrecognized header 1264 fields SHOULD be ignored by the recipient and forwarded by proxies. 1266 8.2 Entity Body 1268 See [H7.2] 1270 9 Connections 1272 RTSP requests can be transmitted in several different ways: 1274 * persistent transport connections used for several request-response 1275 transactions; 1276 * one connection per request/response transaction; 1277 * connectionless mode. 1279 The type of transport connection is defined by the RTSP URI 1280 (Section 3.2). For the scheme ``rtsp'', a persistent connection is 1281 assumed, while the scheme ``rtspu'' calls for RTSP requests to be sent 1282 without setting up a connection. 1284 Unlike HTTP, RTSP allows the media server to send requests to the 1285 media client. However, this is only supported for persistent 1286 connections, as the media server otherwise has no reliable way of 1287 reaching the client. Also, this is the only way that requests from 1288 media server to client are likely to traverse firewalls. 1290 9.1 Pipelining 1292 A client that supports persistent connections or connectionless mode 1293 MAY ``pipeline'' its requests (i.e., send multiple requests without 1294 waiting for each response). A server MUST send its responses to those 1295 requests in the same order that the requests were received. 1297 9.2 Reliability and Acknowledgements 1299 Requests are acknowledged by the receiver unless they are sent to a 1300 multicast group. If there is no acknowledgement, the sender may resend 1301 the same message after a timeout of one round-trip time (RTT). The 1302 round-trip time is estimated as in TCP (RFC 1123), with an initial 1303 round-trip value of 500 ms. An implementation MAY cache the last RTT 1304 measurement as the initial value for future connections. If a reliable 1305 transport protocol is used to carry RTSP, the timeout value MAY be set 1306 to an arbitrarily large value. 1308 This can greatly increase responsiveness for proxies operating in 1309 local-area networks with small RTTs. The mechanism is defined such 1310 that the client implementation does not have to be aware of whether 1311 a reliable or unreliable transport protocol is being used. It is 1312 probably a bad idea to have two reliability mechanisms on top of 1313 each other, although the RTSP RTT estimate is likely to be larger 1314 than the TCP estimate. 1316 The Timestamp header (Section 12.38) is used to avoid the 1317 retransmission ambiguity problem [18, p. 301] and obviates the need 1318 for Karn's algorithm. 1320 Each request carries a sequence number in the CSeq header 1321 (Section 12.17), which is incremented by one for each distinct request 1322 transmitted. If a request is repeated because of lack of 1323 acknowledgement, the request MUST carry the original sequence number 1324 (i.e. sequence number is not incremented). 1326 Systems implementing RTSP MUST support carrying RTSP over TCP and MAY 1327 support UDP. The default port for the RTSP server is 554 for both UDP 1328 and TCP. 1330 A number of RTSP packets destined for the same control end point may 1331 be packed into a single lower-layer PDU or encapsulated into a TCP 1332 stream. RTSP data MAY be interleaved with RTP and RTCP packets. Unlike 1333 HTTP, an RTSP message MUST contain a Content-Length header whenever 1334 that message contains a payload. Otherwise, an RTSP packet is 1335 terminated with an empty line immediately following the last message 1336 header. 1338 10 Method Definitions 1340 The method token indicates the method to be performed on the 1341 resource identified by the Request-URI. The method is case-sensitive. 1342 New methods may be defined in the future. Method names may not start 1343 with a $ character (decimal 24) and must be a token. Methods are 1344 summarized in Table 2. 1346 method direction object requirement 1347 DESCRIBE C->S P,S recommended 1348 ANNOUNCE C->S, S->C P,S optional 1349 GET_PARAMETER C->S, S->C P,S optional 1350 OPTIONS C->S, S->C P,S required 1351 (S->C: optional) 1352 PAUSE C->S P,S recommended 1353 PLAY C->S P,S required 1354 RECORD C->S P,S optional 1355 REDIRECT S->C P,S optional 1356 SETUP C->S S required 1357 SET_PARAMETER C->S, S->C P,S optional 1358 TEARDOWN C->S P,S required 1360 Table 2: Overview of RTSP methods, their direction, and what 1361 objects (P: presentation, S: stream) they operate on 1363 Notes on Table 2: PAUSE is recommended, but not required in that a 1364 fully functional server can be built that does not support this 1365 method, for example, for live feeds. If a server does not support a 1366 particular method, it MUST return "501 Not Implemented" and a client 1367 SHOULD not try this method again for this server. 1369 10.1 OPTIONS 1371 The behavior is equivalent to that described in [H9.2]. An OPTIONS 1372 request may be issued at any time, e.g., if the client is about to try 1373 a nonstandard request. It does not influence server state. 1375 Example: 1377 C->S: OPTIONS * RTSP/1.0 1378 CSeq: 1 1379 Require: implicit-play 1380 Proxy-Require: gzipped-messages 1382 S->C: RTSP/1.0 200 OK 1383 CSeq: 1 1384 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE 1386 Note that these are necessarily fictional features (one would hope 1387 that we would not purposefully overlook a truly useful feature just so 1388 that we could have a strong example in this section). 1390 10.2 DESCRIBE 1392 The DESCRIBE method retrieves the description of a presentation or 1393 media object identified by the request URL from a server. It may use 1394 the Accept header to specify the description formats that the client 1395 understands. The server responds with a description of the requested 1396 resource. The DESCRIBE reply-response pair constitutes the media 1397 initialization phase of RTSP. 1399 Example: 1401 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/1.0 1402 CSeq: 312 1403 Accept: application/sdp, application/rtsl, application/mheg 1405 S->C: RTSP/1.0 200 OK 1406 CSeq: 312 1407 Date: 23 Jan 1997 15:35:06 GMT 1408 Content-Type: application/sdp 1409 Content-Length: 376 1411 v=0 1412 o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4 1413 s=SDP Seminar 1414 i=A Seminar on the session description protocol 1415 u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps 1416 e=mjh@isi.edu (Mark Handley) 1417 c=IN IP4 224.2.17.12/127 1418 t=2873397496 2873404696 1419 a=recvonly 1420 m=audio 3456 RTP/AVP 0 1421 m=video 2232 RTP/AVP 31 1422 m=whiteboard 32416 UDP WB 1423 a=orient:portrait 1425 The DESCRIBE response MUST contain all media initialization 1426 information for the resource(s) that it describes. If a media client 1427 obtains a presentation description from a source other than DESCRIBE 1428 and that description contains a complete set of media initialization 1429 parameters, the client SHOULD use those parameters and not then 1430 request a description for the same media via RTSP. 1432 Additionally, servers SHOULD NOT use the DESCRIBE response as a means 1433 of media indirection. 1435 Clear ground rules need to be established so that clients have an 1436 unambiguous means of knowing when to request media initialization 1437 information via DESCRIBE, and when not to. By forcing a DESCRIBE 1438 response to contain all media initialization for the set of streams 1439 that it describes, and discouraging use of DESCRIBE for media 1440 indirection, we avoid looping problems that might result from other 1441 approaches. 1443 Media initialization is a requirement for any RTSP-based system, 1444 but the RTSP specification does not dictate that this must be done 1445 via the DESCRIBE method. There are three ways that an RTSP client 1446 may receive initialization information: 1448 * via RTSP's DESCRIBE method; 1449 * via some other protocol (HTTP, email attachment, etc.); 1450 * via the command line or standard input (thus working as a browser 1451 helper application launched with an SDP file or other media 1452 initialization format). 1454 In the interest of practical interoperability, it is highly 1455 recommended that minimal servers support the DESCRIBE method, and 1456 highly recommended that minimal clients support the ability to act 1457 as a ``helper application'' that accepts a media initialization 1458 file from standard input, command line, and/or other means that are 1459 appropriate to the operating environment of the client. 1461 10.3 ANNOUNCE 1463 The ANNOUNCE method serves two purposes: 1465 When sent from client to server, ANNOUNCE posts the description of a 1466 presentation or media object identified by the request URL to a 1467 server. When sent from server to client, ANNOUNCE updates the session 1468 description in real-time. 1470 If a new media stream is added to a presentation (e.g., during a live 1471 presentation), the whole presentation description should be sent 1472 again, rather than just the additional components, so that components 1473 can be deleted. 1475 Example: 1477 C->S: ANNOUNCE rtsp://server.example.com/fizzle/foo RTSP/1.0 1478 CSeq: 312 1479 Date: 23 Jan 1997 15:35:06 GMT 1480 Session: 4711 1481 Content-Type: application/sdp 1482 Content-Length: 332 1484 v=0 1485 o=mhandley 2890844526 2890845468 IN IP4 126.16.64.4 1486 s=SDP Seminar 1487 i=A Seminar on the session description protocol 1488 u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps 1489 e=mjh@isi.edu (Mark Handley) 1490 c=IN IP4 224.2.17.12/127 1491 t=2873397496 2873404696 1492 a=recvonly 1493 m=audio 3456 RTP/AVP 0 1494 m=video 2232 RTP/AVP 31 1496 S->C: RTSP/1.0 200 OK 1497 CSeq: 312 1499 10.4 SETUP 1501 The SETUP request for a URI specifies the transport mechanism to be 1502 used for the streamed media. A client can issue a SETUP request for a 1503 stream that is already playing to change transport parameters, which a 1504 server MAY allow. If it does not allow this, it MUST respond with 1505 error ``455 Method Not Valid In This State''. For the benefit of any 1506 intervening firewalls, a client must indicate the transport parameters 1507 even if it has no influence over these parameters, for example, where 1508 the server advertises a fixed multicast address. 1510 Since SETUP includes all transport initialization information, 1511 firewalls and other intermediate network devices (which need this 1512 information) are spared the more arduous task of parsing the 1513 DESCRIBE response, which has been reserved for media 1514 initialization. 1516 The Transport header specifies the transport parameters acceptable to 1517 the client for data transmission; the response will contain the 1518 transport parameters selected by the server. 1520 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/1.0 1521 CSeq: 302 1522 Transport: RTP/AVP;unicast;client_port=4588-4589 1524 S->C: RTSP/1.0 200 OK 1525 CSeq: 302 1526 Date: 23 Jan 1997 15:35:06 GMT 1527 Session: 4711 1528 Transport: RTP/AVP;unicast; 1529 client_port=4588-4589;server_port=6256-6257 1531 10.5 PLAY 1533 The PLAY method tells the server to start sending data via the 1534 mechanism specified in SETUP. A client MUST NOT issue a PLAY request 1535 until any outstanding SETUP requests have been acknowledged as 1536 successful. 1538 The PLAY request positions the normal play time to the beginning of 1539 the range specified and delivers stream data until the end of the 1540 range is reached. PLAY requests may be pipelined (queued); a server 1541 MUST queue PLAY requests to be executed in order. That is, a PLAY 1542 request arriving while a previous PLAY request is still active is 1543 delayed until the first has been completed. 1545 This allows precise editing. 1547 For example, regardless of how closely spaced the two PLAY requests in 1548 the example below arrive, the server will first play seconds 10 1549 through 15, then, immediately following, seconds 20 to 25, and finally 1550 seconds 30 through the end. 1552 C->S: PLAY rtsp://audio.example.com/audio RTSP/1.0 1553 CSeq: 835 1554 Range: npt=10-15 1556 C->S: PLAY rtsp://audio.example.com/audio RTSP/1.0 1557 CSeq: 836 1558 Range: npt=20-25 1560 C->S: PLAY rtsp://audio.example.com/audio RTSP/1.0 1561 CSeq: 837 1562 Range: npt=30- 1564 See the description of the PAUSE request for further examples. 1566 A PLAY request without a Range header is legal. It starts playing a 1567 stream from the beginning unless the stream has been paused. If a 1568 stream has been paused via PAUSE, stream delivery resumes at the pause 1569 point. If a stream is playing, such a PLAY request causes no further 1570 action and can be used by the client to test server liveness. 1572 The Range header may also contain a time parameter. This parameter 1573 specifies a time in UTC at which the playback should start. If the 1574 message is received after the specified time, playback is started 1575 immediately. The time parameter may be used to aid in synchronization 1576 of streams obtained from different sources. 1578 For a on-demand stream, the server replies with the actual range that 1579 will be played back. This may differ from the requested range if 1580 alignment of the requested range to valid frame boundaries is required 1581 for the media source. If no range is specified in the request, the 1582 current position is returned in the reply. The unit of the range in 1583 the reply is the same as that in the request. 1585 After playing the desired range, the presentation is automatically 1586 paused, as if a PAUSE request had been issued. 1588 The following example plays the whole presentation starting at SMPTE 1589 time code 0:10:20 until the end of the clip. The playback is to start 1590 at 15:36 on 23 Jan 1997. 1592 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/1.0 1593 CSeq: 833 1594 Range: smpte=0:10:20-;time=19970123T153600Z 1596 S->C: RTSP/1.0 200 OK 1597 CSeq: 833 1598 Date: 23 Jan 1997 15:35:06 GMT 1599 Range: smpte=0:10:22-;time=19970123T153600Z 1601 For playing back a recording of a live presentation, it may be 1602 desirable to use clock units: 1604 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/1.0 1605 CSeq: 835 1606 Range: clock=19961108T142300Z-19961108T143520Z 1608 S->C: RTSP/1.0 200 OK 1609 CSeq: 835 1610 Date: 23 Jan 1997 15:35:06 GMT 1612 A media server only supporting playback MUST support the npt format 1613 and MAY support the clock and smpte formats. 1615 10.6 PAUSE 1617 The PAUSE request causes the stream delivery to be interrupted 1618 (halted) temporarily. If the request URL names a stream, only playback 1619 and recording of that stream is halted. For example, for audio, this 1620 is equivalent to muting. If the request URL names a presentation or 1621 group of streams, delivery of all currently active streams within the 1622 presentation or group is halted. After resuming playback or recording, 1623 synchronization of the tracks MUST be maintained. Any server resources 1624 are kept, though servers MAY close the session and free resources 1625 after being paused for the duration specified with the timeout 1626 parameter of the Session header in the SETUP message. 1628 Example: 1630 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/1.0 1631 CSeq: 834 1632 Session: 1234 1634 S->C: RTSP/1.0 200 OK 1635 CSeq: 834 1636 Date: 23 Jan 1997 15:35:06 GMT 1638 The PAUSE request may contain a Range header specifying when the 1639 stream or presentation is to be halted. The header must contain 1640 exactly one value rather than a time range. The normal play time for 1641 the stream is set to that value. The pause request becomes effective 1642 the first time the server is encountering the time point specified in 1643 any of the currently pending PLAY requests. If the Range header 1644 specifies a time outside any currently pending PLAY requests, the 1645 error ``457 Invalid Range'' is returned. If this header is missing, 1646 stream delivery is interrupted immediately on receipt of the message. 1648 For example, if the server has play requests for ranges 10 to 15 and 1649 20 to 29 pending and then receives a pause request for NPT 21, it 1650 would start playing the second range and stop at NPT 21. If the pause 1651 request is for NPT 12 and the server is playing at NPT 13 serving the 1652 first play request, the server stops immediately. If the pause request 1653 is for NPT 16, the server stops after completing the first play 1654 request and discards the second play request. 1656 As another example, if a server has received requests to play ranges 1657 10 to 15 and then 13 to 20 (that is, overlapping ranges), the PAUSE 1658 request for NPT=14 would take effect while the server plays the first 1659 range, with the second PLAY request effectively being ignored, 1660 assuming the PAUSE request arrives before the server has started 1661 playing the second, overlapping range. Regardless of when the PAUSE 1662 request arrives, it sets the NPT to 14. 1664 If the server has already sent data beyond the time specified in the 1665 Range header, a PLAY would still resume at that point in time, as it 1666 is assumed that the client has discarded data after that point. This 1667 ensures continuous pause/play cycling without gaps. 1669 10.7 TEARDOWN 1671 The TEARDOWN request stops the stream delivery for the given URI, 1672 freeing the resources associated with it. If the URI is the 1673 presentation URI for this presentation, any RTSP session identifier 1674 associated with the session is no longer valid. Unless all transport 1675 parameters are defined by the session description, a SETUP request has 1676 to be issued before the session can be played again. 1678 Example: 1680 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/1.0 1681 CSeq: 892 1682 Session: 1234 1683 S->C: RTSP/1.0 200 OK 1684 CSeq: 892 1686 10.8 GET_PARAMETER 1688 The GET_PARAMETER request retrieves the value of a parameter of a 1689 presentation or stream specified in the URI. The content of the reply 1690 and response is left to the implementation. GET_PARAMETER with no 1691 entity body may be used to test client or server liveness (``ping''). 1693 Example: 1695 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0 1696 CSeq: 431 1697 Content-Type: text/parameters 1698 Session: 1234 1699 Content-Length: 15 1701 packets_received 1702 jitter 1704 C->S: RTSP/1.0 200 OK 1705 CSeq: 431 1706 Content-Length: 46 1707 Content-Type: text/parameters 1709 packets_received: 10 1710 jitter: 0.3838 1712 The ``text/parameters'' section is only an example type for 1713 parameter. This method is intentionally loosely defined with the 1714 intention that the reply content and response content will be 1715 defined after further experimentation. 1717 10.9 SET_PARAMETER 1719 This method requests to set the value of a parameter for a 1720 presentation or stream specified by the URI. 1722 A request SHOULD only contain a single parameter to allow the client 1723 to determine why a particular request failed. If the request contains 1724 several parameters, the server MUST only act on the request if all of 1725 the parameters can be set successfully. A server MUST allow a 1726 parameter to be set repeatedly to the same value, but it MAY disallow 1727 changing parameter values. 1729 Note: transport parameters for the media stream MUST only be set with 1730 the SETUP command. 1732 Restricting setting transport parameters to SETUP is for the 1733 benefit of firewalls. 1735 The parameters are split in a fine-grained fashion so that there 1736 can be more meaningful error indications. However, it may make 1737 sense to allow the setting of several parameters if an atomic 1738 setting is desirable. Imagine device control where the client does 1739 not want the camera to pan unless it can also tilt to the right 1740 angle at the same time. 1742 Example: 1744 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/1.0 1745 CSeq: 421 1746 Content-length: 20 1747 Content-type: text/parameters 1749 barparam: barstuff 1751 S->C: RTSP/1.0 451 Invalid Parameter 1752 CSeq: 421 1753 Content-length: 10 1754 Content-type: text/parameters 1756 barparam 1758 The ``text/parameters'' section is only an example type for 1759 parameter. This method is intentionally loosely defined with the 1760 intention that the reply content and response content will be 1761 defined after further experimentation. 1763 10.10 REDIRECT 1765 A redirect request informs the client that it must connect to 1766 another server location. It contains the mandatory header Location, 1767 which indicates that the client should issue requests for that URL. It 1768 may contain the parameter Range, which indicates when the redirection 1769 takes effect. If the client wants to continue to send or receive media 1770 for this URI, the client MUST issue a TEARDOWN request for the current 1771 session and a SETUP for the new session at the designated host. 1773 This example request redirects traffic for this URI to the new server 1774 at the given play time: 1776 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/1.0 1777 CSeq: 732 1778 Location: rtsp://bigserver.com:8001 1779 Range: clock=19960213T143205Z- 1781 10.11 RECORD 1783 This method initiates recording a range of media data according to 1784 the presentation description. The timestamp reflects start and end 1785 time (UTC). If no time range is given, use the start or end time 1786 provided in the presentation description. If the session has already 1787 started, commence recording immediately. 1789 The server decides whether to store the recorded data under the 1790 request-URI or another URI. If the server does not use the 1791 request-URI, the response SHOULD be 201 (Created) and contain an 1792 entity which describes the status of the request and refers to the new 1793 resource, and a Location header. 1795 A media server supporting recording of live presentations MUST support 1796 the clock range format; the smpte format does not make sense. 1798 In this example, the media server was previously invited to the 1799 conference indicated. 1801 C->S: RECORD rtsp://example.com/meeting/audio.en RTSP/1.0 1802 CSeq: 954 1803 Session: 1234 1804 Conference: 128.16.64.19/32492374 1806 10.12 Embedded (Interleaved) Binary Data 1808 Certain firewall designs and other circumstances may force a server 1809 to interleave RTSP methods and stream data. This interleaving should 1810 generally be avoided unless necessary since it complicates client and 1811 server operation and imposes additional overhead. Interleaved binary 1812 data SHOULD only be used if RTSP is carried over TCP. 1814 Stream data such as RTP packets is encapsulated by an ASCII dollar 1815 sign (24 decimal), followed by a one-byte channel identifier, followed 1816 by the length of the encapsulated binary data as a binary, two-byte 1817 integer in network byte order. The stream data follows immediately 1818 afterwards, without a CRLF, but including the upper-layer protocol 1819 headers. Each $ block contains exactly one upper-layer protocol data 1820 unit, e.g., one RTP packet. 1822 The channel identifier is defined in the Transport header with the 1823 interleaved parameter(Section 12.39). 1825 When the transport choice is RTP, RTCP messages are also interleaved 1826 by the server over the TCP connection. As a default, RTCP packets are 1827 sent on the first available channel higher than the RTP channel. The 1828 client MAY explicitly request RTCP packets on another channel. This is 1829 done by specifying two channels in the interleaved parameter of the 1830 Transport header(Section 12.39). 1832 RTCP is needed for synchronization when two or more streams are 1833 interleaved in such a fashion. Also, this provides a convenient way 1834 to tunnel RTP/RTCP packets through the TCP control connection when 1835 required by the network configuration and transfer them onto UDP 1836 when possible. 1838 C->S: SETUP rtsp://foo.com/bar.file RTSP/1.0 1839 CSeq: 2 1840 Transport: RTP/AVP/TCP;interleaved=0-1 1842 S->C: RTSP/1.0 200 OK 1843 CSeq: 2 1844 Date: 05 Jun 1997 18:57:18 GMT 1845 Transport: RTP/AVP/TCP;interleaved=0-1 1846 Session: 12345 1848 C->S: PLAY rtsp://foo.com/bar.file RTSP/1.0 1849 CSeq: 3 1850 Session: 12345 1852 S->C: RTSP/1.0 200 OK 1853 CSeq: 3 1854 Session: 12345 1855 Date: 05 Jun 1997 18:59:15 GMT 1856 RTP-Info: url=rtsp://foo.com/bar.file; 1857 seq=232433;rtptime=972948234 1859 S->C: $\000{2 byte length}{"length" bytes data, w/RTP header} 1860 S->C: $\000{2 byte length}{"length" bytes data, w/RTP header} 1861 S->C: $\001{2 byte length}{"length" bytes RTCP packet} 1863 11 Status Code Definitions 1865 Where applicable, HTTP status [H10] codes are reused. Status codes 1866 that have the same meaning are not repeated here. See Table 1 for a 1867 listing of which status codes may be returned by which requests. 1869 11.1 Success 2xx 1871 11.1.1 250 Low on Storage Space 1873 The server returns this warning after receiving a RECORD request that 1874 it may not be able to fulfill completely due to insufficient storage 1875 space. If possible, the server should use the Range header to indicate 1876 what time period it may still be able to record. Since other processes 1877 on the server may be consuming storage space simultaneously, a client 1878 should take this only as an estimate. 1880 11.2 Redirection 3xx 1882 See [H10.3]. 1884 Within RTSP, redirection may be used for load balancing or redirecting 1885 stream requests to a server topologically closer to the client. 1886 Mechanisms to determine topological proximity are beyond the scope of 1887 this specification. 1889 11.3 Client Error 4xx 1891 11.3.1 405 Method Not Allowed 1893 The method specified in the request is not allowed for the resource 1894 identified by the request URI. The response MUST include an Allow 1895 header containing a list of valid methods for the requested resource. 1896 This status code is also to be used if a request attempts to use a 1897 method not indicated during SETUP, e.g., if a RECORD request is issued 1898 even though the mode parameter in the Transport header only specified 1899 PLAY. 1901 11.3.2 451 Parameter Not Understood 1903 The recipient of the request does not support one or more parameters 1904 contained in the request. 1906 11.3.3 452 Conference Not Found 1908 The conference indicated by a Conference header field is unknown to 1909 the media server. 1911 11.3.4 453 Not Enough Bandwidth 1913 The request was refused because there was insufficient bandwidth. This 1914 may, for example, be the result of a resource reservation failure. 1916 11.3.5 454 Session Not Found 1918 The RTSP session identifier in the Session header is missing, invalid, 1919 or has timed out. 1921 11.3.6 455 Method Not Valid in This State 1923 The client or server cannot process this request in its current state. 1924 The response SHOULD contain an Allow header to make error recovery 1925 easier. 1927 11.3.7 456 Header Field Not Valid for Resource 1929 The server could not act on a required request header. For example, if 1930 PLAY contains the Range header field but the stream does not allow 1931 seeking. 1933 11.3.8 457 Invalid Range 1935 The Range value given is out of bounds, e.g., beyond the end of the 1936 presentation. 1938 11.3.9 458 Parameter Is Read-Only 1940 The parameter to be set by SET_PARAMETER can be read but not modified. 1942 11.3.10 459 Aggregate Operation Not Allowed 1944 The requested method may not be applied on the URL in question since 1945 it is an aggregate (presentation) URL. The method may be applied on a 1946 stream URL. 1948 11.3.11 460 Only Aggregate Operation Allowed 1950 The requested method may not be applied on the URL in question since 1951 it is not an aggregate (presentation) URL. The method may be applied 1952 on the presentation URL. 1954 11.3.12 461 Unsupported Transport 1956 The Transport field did not contain a supported transport 1957 specification. 1959 11.3.13 462 Destination Unreachable 1961 The data transmission channel could not be established because the 1962 client address could not be reached. This error will most likely be 1963 the result of a client attempt to place an invalid Destination 1964 parameter in the Transport field. 1966 11.3.14 551 Option not supported 1968 An option given in the Require or the Proxy-Require fields was not 1969 supported. The Unsupported header should be returned stating the 1970 option for which there is no support. 1972 12 Header Field Definitions 1974 HTTP/1.1 or other, non-standard header fields not listed here 1975 currently have no well-defined meaning and SHOULD be ignored by the 1976 recipient. 1978 Table 3 summarizes the header fields used by RTSP. Type ``g'' 1979 designates general request headers to be found in both requests and 1980 responses, type ``R'' designates request headers, type ``r'' 1981 designates response headers, and type ``e'' designates entity header 1982 fields. Fields marked with ``req.'' in the column labeled ``support'' 1983 MUST be implemented by the recipient for a particular method, while 1984 fields marked ``opt.'' are optional. Note that not all fields marked 1985 ``req.'' will be sent in every request of this type. The ``req.'' 1986 means only that client (for response headers) and server (for request 1987 headers) MUST implement the fields. The last column lists the method 1988 for which this header field is meaningful; the designation ``entity'' 1989 refers to all methods that return a message body. Within this 1990 specification, DESCRIBE and GET_PARAMETER fall into this class. 1992 Header type support methods 1993 Accept R opt. entity 1994 Accept-Encoding R opt. entity 1995 Accept-Language R opt. all 1996 Allow r opt. all 1997 Authorization R opt. all 1998 Bandwidth R opt. all 1999 Blocksize R opt. all but OPTIONS, TEARDOWN 2000 Cache-Control g opt. SETUP 2001 Conference R opt. SETUP 2002 Connection g req. all 2003 Content-Base e opt. entity 2004 Content-Encoding e req. SET_PARAMETER 2005 Content-Encoding e req. DESCRIBE, ANNOUNCE 2006 Content-Language e req. DESCRIBE, ANNOUNCE 2007 Content-Length e req. SET_PARAMETER, ANNOUNCE 2008 Content-Length e req. entity 2009 Content-Location e opt. entity 2010 Content-Type e req. SET_PARAMETER, ANNOUNCE 2011 Content-Type r req. entity 2012 CSeq g req. all 2013 Date g opt. all 2014 Expires e opt. DESCRIBE, ANNOUNCE 2015 From R opt. all 2016 If-Modified-Since R opt. DESCRIBE, SETUP 2017 Last-Modified e opt. entity 2018 Proxy-Authenticate 2019 Proxy-Require R req. all 2020 Public r opt. all 2021 Range R opt. PLAY, PAUSE, RECORD 2022 Range r opt. PLAY, PAUSE, RECORD 2023 Referer R opt. all 2024 Require R req. all 2025 Retry-After r opt. all 2026 RTP-Info r req. PLAY 2027 Scale Rr opt. PLAY, RECORD 2028 Session Rr req. all but SETUP, OPTIONS 2029 Server r opt. all 2030 Speed Rr opt. PLAY 2031 Transport Rr req. SETUP 2032 Unsupported r req. all 2033 User-Agent R opt. all 2034 Via g opt. all 2035 WWW-Authenticate r opt. all 2036 Overview of RTSP header fields 2038 12.1 Accept 2040 The Accept request-header field can be used to specify certain 2041 presentation description content types which are acceptable for the 2042 response. 2044 The ``level'' parameter for presentation descriptions is properly 2045 defined as part of the MIME type registration, not here. 2047 See [H14.1] for syntax. 2049 Example of use: 2050 Accept: application/rtsl, application/sdp;level=2 2052 12.2 Accept-Encoding 2054 See [H14.3] 2056 12.3 Accept-Language 2058 See [H14.4]. Note that the language specified applies to the 2059 presentation description and any reason phrases, not the media 2060 content. 2062 12.4 Allow 2064 The Allow response header field lists the methods supported by the 2065 resource identified by the request-URI. The purpose of this field is 2066 to strictly inform the recipient of valid methods associated with the 2067 resource. An Allow header field must be present in a 405 (Method not 2068 allowed) response. 2070 Example of use: 2071 Allow: SETUP, PLAY, RECORD, SET_PARAMETER 2073 12.5 Authorization 2075 See [H14.8] 2077 12.6 Bandwidth 2079 The Bandwidth request header field describes the estimated bandwidth 2080 available to the client, expressed as a positive integer and measured 2081 in bits per second. The bandwidth available to the client may change 2082 during an RTSP session, e.g., due to modem retraining. 2084 Bandwidth = "Bandwidth" ":" 1*DIGIT 2086 Example: 2087 Bandwidth: 4000 2089 12.7 Blocksize 2091 This request header field is sent from the client to the media 2092 server asking the server for a particular media packet size. This 2093 packet size does not include lower-layer headers such as IP, UDP, or 2094 RTP. The server is free to use a blocksize which is lower than the one 2095 requested. The server MAY truncate this packet size to the closest 2096 multiple of the minimum, media-specific block size, or override it 2097 with the media-specific size if necessary. The block size MUST be a 2098 positive decimal number, measured in octets. The server only returns 2099 an error (416) if the value is syntactically invalid. 2101 12.8 Cache-Control 2103 The Cache-Control general header field is used to specify directives 2104 that MUST be obeyed by all caching mechanisms along the 2105 request/response chain. 2107 Cache directives must be passed through by a proxy or gateway 2108 application, regardless of their significance to that application, 2109 since the directives may be applicable to all recipients along the 2110 request/response chain. It is not possible to specify a cache- 2111 directive for a specific cache. 2113 Cache-Control should only be specified in a SETUP request and its 2114 response. Note: Cache-Control does not govern the caching of responses 2115 as for HTTP, but rather of the stream identified by the SETUP request. 2116 Responses to RTSP requests are not cacheable, except for responses to 2117 DESCRIBE. 2119 Cache-Control = "Cache-Control" ":" 1#cache-directive 2120 cache-directive = cache-request-directive 2121 | cache-response-directive 2122 cache-request-directive = "no-cache" 2123 | "max-stale" 2124 | "min-fresh" 2125 | "only-if-cached" 2126 | cache-extension 2127 cache-response-directive = "public" 2128 | "private" 2129 | "no-cache" 2130 | "no-transform" 2131 | "must-revalidate" 2132 | "proxy-revalidate" 2133 | "max-age" "=" delta-seconds 2134 | cache-extension 2135 cache-extension = token [ "=" ( token | quoted-string ) ] 2137 no-cache: 2138 Indicates that the media stream MUST NOT be cached anywhere. 2139 This allows an origin server to prevent caching even by caches 2140 that have been configured to return stale responses to client 2141 requests. 2143 public: 2144 Indicates that the media stream is cacheable by any cache. 2146 private: 2147 Indicates that the media stream is intended for a single user 2148 and MUST NOT be cached by a shared cache. A private 2149 (non-shared) cache may cache the media stream. 2151 no-transform: 2152 An intermediate cache (proxy) may find it useful to convert the 2153 media type of a certain stream. A proxy might, for example, 2154 convert between video formats to save cache space or to reduce 2155 the amount of traffic on a slow link. Serious operational 2156 problems may occur, however, when these transformations have 2157 been applied to streams intended for certain kinds of 2158 applications. For example, applications for medical imaging, 2159 scientific data analysis and those using end-to-end 2160 authentication all depend on receiving a stream that is 2161 bit-for-bit identical to the original entity-body. Therefore, 2162 if a response includes the no-transform directive, an 2163 intermediate cache or proxy MUST NOT change the encoding of the 2164 stream. Unlike HTTP, RTSP does not provide for partial 2165 transformation at this point, e.g., allowing translation into a 2166 different language. 2168 only-if-cached: 2169 In some cases, such as times of extremely poor network 2170 connectivity, a client may want a cache to return only those 2171 media streams that it currently has stored, and not to receive 2172 these from the origin server. To do this, the client may 2173 include the only-if-cached directive in a request. If it 2174 receives this directive, a cache SHOULD either respond using a 2175 cached media stream that is consistent with the other 2176 constraints of the request, or respond with a 504 (Gateway 2177 Timeout) status. However, if a group of caches is being 2178 operated as a unified system with good internal connectivity, 2179 such a request MAY be forwarded within that group of caches. 2181 max-stale: 2182 Indicates that the client is willing to accept a media stream 2183 that has exceeded its expiration time. If max-stale is assigned 2184 a value, then the client is willing to accept a response that 2185 has exceeded its expiration time by no more than the specified 2186 number of seconds. If no value is assigned to max-stale, then 2187 the client is willing to accept a stale response of any age. 2189 min-fresh: 2190 Indicates that the client is willing to accept a media stream 2191 whose freshness lifetime is no less than its current age plus 2192 the specified time in seconds. That is, the client wants a 2193 response that will still be fresh for at least the specified 2194 number of seconds. 2196 must-revalidate: 2197 When the must-revalidate directive is present in a SETUP 2198 response received by a cache, that cache MUST NOT use the entry 2199 after it becomes stale to respond to a subsequent request 2200 without first revalidating it with the origin server. That is, 2201 the cache must do an end-to-end revalidation every time, if, 2202 based solely on the origin server's Expires, the cached 2203 response is stale.) 2205 12.9 Conference 2207 This request header field establishes a logical connection between a 2208 pre-established conference and an RTSP stream. The conference-id must 2209 not be changed for the same RTSP session. 2211 Conference = "Conference" ":" conference-id 2213 Example: 2214 Conference: 199702170042.SAA08642@obiwan.arl.wustl.edu%20Starr 2216 A response code of 452 (452 Conference Not Found) is returned if the 2217 conference-id is not valid. 2219 12.10 Connection 2221 See [H14.10] 2223 12.11 Content-Base 2225 See [H14.11] 2227 12.12 Content-Encoding 2229 See [H14.12] 2231 12.13 Content-Language 2233 See [H14.13] 2235 12.14 Content-Length 2237 This field contains the length of the content of the method (i.e. 2238 after the double CRLF following the last header). Unlike HTTP, it MUST 2239 be included in all messages that carry content beyond the header 2240 portion of the message. If it is missing, a default value of zero is 2241 assumed. It is interpreted according to [H14.14]. 2243 12.15 Content-Location 2245 See [H14.15] 2247 12.16 Content-Type 2249 See [H14.18]. Note that the content types suitable for RTSP are 2250 likely to be restricted in practice to presentation descriptions and 2251 parameter-value types. 2253 12.17 CSeq 2255 The CSeq field specifies the sequence number for an RTSP 2256 request-response pair. This field MUST be present in all requests and 2257 responses. For every RTSP request containing the given sequence 2258 number, there will be a corresponding response having the same number. 2259 Any retransmitted request must contain the same sequence number as the 2260 original (i.e. the sequence number is not incremented for 2261 retransmissions of the same request). 2263 12.18 Date 2265 See [H14.19]. 2267 12.19 Expires 2269 The Expires entity-header field gives a date and time after which 2270 the description or media-stream should be considered stale. The 2271 interpretation depends on the method: 2273 DESCRIBE response: 2274 The Expires header indicates a date and time after which the 2275 description should be considered stale. 2277 A stale cache entry may not normally be returned by a cache (either a 2278 proxy cache or an user agent cache) unless it is first validated with 2279 the origin server (or with an intermediate cache that has a fresh copy 2280 of the entity). See section 13 for further discussion of the 2281 expiration model. 2283 The presence of an Expires field does not imply that the original 2284 resource will change or cease to exist at, before, or after that time. 2286 The format is an absolute date and time as defined by HTTP-date in 2287 [H3.3]; it MUST be in RFC1123-date format: 2289 Expires = "Expires" ":" HTTP-date 2291 An example of its use is 2293 Expires: Thu, 01 Dec 1994 16:00:00 GMT 2295 RTSP/1.0 clients and caches MUST treat other invalid date formats, 2296 especially including the value "0", as having occured in the past 2297 (i.e., ``already expired''). 2299 To mark a response as ``already expired,'' an origin server should use 2300 an Expires date that is equal to the Date header value. To mark a 2301 response as ``never expires,'' an origin server should use an Expires 2302 date approximately one year from the time the response is sent. 2303 RTSP/1.0 servers should not send Expires dates more than one year in 2304 the future. 2306 The presence of an Expires header field with a date value of some time 2307 in the future on a media stream that otherwise would by default be 2308 non-cacheable indicates that the media stream is cacheable, unless 2309 indicated otherwise by a Cache-Control header field (Section 12.8). 2311 12.20 From 2313 See [H14.22]. 2315 12.21 Host 2317 This HTTP request header field is not needed for RTSP. It should be 2318 silently ignored if sent. 2320 12.22 If-Match 2322 See [H14.25]. 2324 This field is especially useful for ensuring the integrity of the 2325 presentation description, in both the case where it is fetched via 2326 means external to RTSP (such as HTTP), or in the case where the server 2327 implementation is guaranteeing the integrity of the description 2328 between the time of the DESCRIBE message and the SETUP message. 2330 The identifier is an opaque identifier, and thus is not specific to 2331 any particular session description language. 2333 12.23 If-Modified-Since 2335 The If-Modified-Since request-header field is used with the DESCRIBE 2336 and SETUP methods to make them conditional. If the requested variant 2337 has not been modified since the time specified in this field, a 2338 description will not be returned from the server (DESCRIBE) or a 2339 stream will not be set up (SETUP). Instead, a 304 (not modified) 2340 response will be returned without any message-body. 2342 If-Modified-Since = "If-Modified-Since" ":" HTTP-date 2344 An example of the field is: 2346 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 2348 12.24 Last-Modified 2350 The Last-Modified entity-header field indicates the date and time at 2351 which the origin server believes the presentation description or media 2352 stream was last modified. See [H14.29]. For the methods DESCRIBE or 2353 ANNOUNCE, the header field indicates the last modification date and 2354 time of the description, for SETUP that of the media stream. 2356 12.25 Location 2358 See [H14.30]. 2360 12.26 Proxy-Authenticate 2362 See [H14.33]. 2364 12.27 Proxy-Require 2366 The Proxy-Require header is used to indicate proxy-sensitive 2367 features that MUST be supported by the proxy. Any Proxy-Require header 2368 features that are not supported by the proxy MUST be negatively 2369 acknowledged by the proxy to the client if not supported. Servers 2370 should treat this field identically to the Require field. 2372 See Section 12.32 for more details on the mechanics of this message 2373 and a usage example. 2375 12.28 Public 2377 See [H14.35]. 2379 12.29 Range 2381 This request and response header field specifies a range of time. 2382 The range can be specified in a number of units. This specification 2383 defines the smpte (Section 3.5), npt (Section 3.6), and clock 2384 (Section 3.7) range units. Within RTSP, byte ranges [H14.36.1] are not 2385 meaningful and MUST NOT be used. The header may also contain a time 2386 parameter in UTC, specifying the time at which the operation is to be 2387 made effective. Servers supporting the Range header MUST understand 2388 the NPT range format and SHOULD understand the SMPTE range format. The 2389 Range response header indicates what range of time is actually being 2390 played or recorded. If the Range header is given in a time format that 2391 is not understood, the recipient should return ``501 Not 2392 Implemented''. 2394 Range = "Range" ":" 1#ranges-specifier 2395 [ ";" "time" "=" utc-time ] 2396 ranges-specifier = npt-range | utc-range | smpte-range 2398 Example: 2399 Range: clock=19960213T143205Z-;time=19970123T143720Z 2401 The notation is similar to that used for the HTTP/1.1 byterange 2402 header. It allows clients to select an excerpt from the media 2403 object, and to play from a given point to the end as well as from 2404 the current location to a given point. The start of playback can be 2405 scheduled for any time in the future, although a server may refuse 2406 to keep server resources for extended idle periods. 2408 12.30 Referer 2410 See [H14.37]. The URL refers to that of the presentation 2411 description, typically retrieved via HTTP. 2413 12.31 Retry-After 2415 See [H14.38]. 2417 12.32 Require 2419 The Require header is used by clients to query the server about 2420 options that it may or may not support. The server MUST respond to 2421 this header by using the Unsupported header to negatively acknowledge 2422 those options which are NOT supported. 2424 This is to make sure that the client-server interaction will 2425 proceed without delay when all options are understood by both 2426 sides, and only slow down if options are not understood (as in the 2427 case above). For a well-matched client-server pair, the interaction 2428 proceeds quickly, saving a round-trip often required by negotiation 2429 mechanisms. In addition, it also removes state ambiguity when the 2430 client requires features that the server does not understand. 2432 Require = "Require" ":" 1#option-tag 2434 Example: 2435 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/1.0 2436 CSeq: 302 2437 Require: funky-feature 2438 Funky-Parameter: funkystuff 2440 S->C: RTSP/1.0 551 Option not supported 2441 CSeq: 302 2442 Unsupported: funky-feature 2444 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/1.0 2445 CSeq: 303 2447 S->C: RTSP/1.0 200 OK 2448 CSeq: 303 2450 In this example, ``funky-feature'' is the feature tag which indicates 2451 to the client that the fictional Funky-Parameter field is required. 2452 The relationship between ``funky-feature'' and Funky-Parameter is not 2453 communicated via the RTSP exchange, since that relationship is an 2454 immutable property of ``funky-feature'' and thus should not be 2455 transmitted with every exchange. 2457 Proxies and other intermediary devices SHOULD ignore features that are 2458 not understood in this field. If a particular extension requires that 2459 intermediate devices support it, the extension should be tagged in the 2460 Proxy-Require field instead (see Section 3.4). 2462 12.33 RTP-Info 2464 This field is used to set RTP-specific parameters in the PLAY 2465 response. 2467 url: 2468 Indicates the stream URL which for which the following RTP 2469 parameters correspond. 2471 seq: 2472 Indicates the sequence number of the first packet of the 2473 stream. This allows clients to gracefully deal with packets 2474 when seeking. The client uses this value to differentiate 2475 packets that originated before the seek from packets that 2476 originated after the seek. 2478 rtptime: 2479 Indicates the RTP timestamp of the first packet of the stream. 2480 The client uses this value to calculate the mapping of RTP time 2481 to NPT. 2483 A mapping from RTP timestamps to NTP timestamps (wall clock) is 2484 available via RTCP. However, this information is not sufficient to 2485 generate a mapping from RTP timestamps to NPT. Furthermore, in 2486 order to ensure that this information is available at the necessary 2487 time (immediately at startup or after a seek), and that it is 2488 delivered reliably, this mapping is placed in the RTSP control 2489 channel. 2491 In order to compensate for drift for long, uninterrupted 2492 presentations, RTSP clients should additionally map NPT to NTP, 2493 using initial RTCP sender reports to do the mapping, and later 2494 reports to check drift against the mapping. 2496 Syntax: 2498 RTP-Info = "RTP-Info" ":" 1#stream-url 1*parameter 2499 stream-url = "url" "=" url 2500 parameter = ";" "seq" "=" 1*DIGIT 2501 | ";" "rtptime" "=" 1*DIGIT 2503 Example: 2505 RTP-Info: url=rtsp://foo.com/bar.avi/streamid=0;seq=45102, 2506 url=rtsp://foo.com/bar.avi/streamid=1;seq=30211 2508 12.34 Scale 2510 A scale value of 1 indicates normal play or record at the normal 2511 forward viewing rate. If not 1, the value corresponds to the rate with 2512 respect to normal viewing rate. For example, a ratio of 2 indicates 2513 twice the normal viewing rate (``fast forward'') and a ratio of 0.5 2514 indicates half the normal viewing rate. In other words, a ratio of 2 2515 has normal play time increase at twice the wallclock rate. For every 2516 second of elapsed (wallclock) time, 2 seconds of content will be 2517 delivered. A negative value indicates reverse direction. 2519 Unless requested otherwise by the Speed parameter, the data rate 2520 SHOULD not be changed. Implementation of scale changes depends on the 2521 server and media type. For video, a server may, for example, deliver 2522 only key frames or selected key frames. For audio, it may time-scale 2523 the audio while preserving pitch or, less desirably, deliver fragments 2524 of audio. 2526 The server should try to approximate the viewing rate, but may 2527 restrict the range of scale values that it supports. The response MUST 2528 contain the actual scale value chosen by the server. 2530 If the request contains a Range parameter, the new scale value will 2531 take effect at that time. 2533 Scale = "Scale" ":" [ "-" ] 1*DIGIT [ "." *DIGIT ] 2535 Example of playing in reverse at 3.5 times normal rate: 2537 Scale: -3.5 2539 12.35 Speed 2541 This request header fields parameter requests the server to deliver 2542 data to the client at a particular speed, contingent on the server's 2543 ability and desire to serve the media stream at the given speed. 2544 Implementation by the server is OPTIONAL. The default is the bit rate 2545 of the stream. 2547 The parameter value is expressed as a decimal ratio, e.g., a value of 2548 2.0 indicates that data is to be delivered twice as fast as normal. A 2549 speed of zero is invalid. If the request contains a Range parameter, 2550 the new speed value will take effect at that time. 2552 Speed = "Speed" ":" 1*DIGIT [ "." *DIGIT ] 2554 Example: 2555 Speed: 2.5 2557 Use of this field changes the bandwidth used for data delivery. It is 2558 meant for use in specific circumstances where preview of the 2559 presentation at a higher or lower rate is necessary. Implementors 2560 should keep in mind that bandwidth for the session may be negotiated 2561 beforehand (by means other than RTSP), and therefore re-negotiation 2562 may be necessary. When data is delivered over UDP, it is highly 2563 recommended that means such as RTCP be used to track packet loss 2564 rates. 2566 12.36 Server 2568 See [H14.39] 2570 12.37 Session 2572 This request and response header field identifies an RTSP session 2573 started by the media server in a SETUP response and concluded by 2574 TEARDOWN on the presentation URL. The session identifier is chosen by 2575 the media server (see Section 3.4). Once a client receives a Session 2576 identifier, it MUST return it for any request related to that session. 2577 A server does not have to set up a session identifier if it has other 2578 means of identifying a session, such as dynamically generated URLs. 2580 Session = "Session" ":" session-id [ ";" "timeout" "=" delta-seconds ] 2582 The timeout parameter is only allowed in a response header. The server 2583 uses it to indicate to the client how long the server is prepared to 2584 wait between RTSP commands before closing the session due to lack of 2585 activity (see Section A). The timeout is measured in seconds, with a 2586 default of 60 seconds (1 minute). 2588 Note that a session identifier identifies a RTSP session across 2589 transport sessions or connections. Control messages for more than one 2590 RTSP URL may be sent within a single RTSP session. Hence, it is 2591 possible that clients use the same session for controlling many 2592 streams constituting a presentation, as long as all the streams come 2593 from the same server. (See example in Section 14). However, multiple 2594 ``user'' sessions for the same URL from the same client MUST use 2595 different session identifiers. 2597 The session identifier is needed to distinguish several delivery 2598 requests for the same URL coming from the same client. 2600 The response 454 (Session Not Found) is returned if the session 2601 identifier is invalid. 2603 12.38 Timestamp 2605 The timestamp general header describes when the client sent the 2606 request to the server. The value of the timestamp is of significance 2607 only to the client and may use any timescale. The server MUST echo the 2608 exact same value and MAY, if it has accurate information about this, 2609 add a floating point number indicating the number of seconds that has 2610 elapsed since it has received the request. The timestamp is used by 2611 the client to compute the round-trip time to the server so that it can 2612 adjust the timeout value for retransmissions. 2614 Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ] 2615 delay = *(DIGIT) [ "." *(DIGIT) ] 2617 12.39 Transport 2619 This request header indicates which transport protocol is to be used 2620 and configures its parameters such as destination address, 2621 compression, multicast time-to-live and destination port for a single 2622 stream. It sets those values not already determined by a presentation 2623 description. 2625 Transports are comma separated, listed in order of preference. 2626 Parameters may be added to each transport, separated by a semicolon. 2628 The Transport header MAY also be used to change certain transport 2629 parameters. A server MAY refuse to change parameters of an existing 2630 stream. 2632 The server MAY return a Transport response header in the response to 2633 indicate the values actually chosen. 2635 A Transport request header field may contain a list of transport 2636 options acceptable to the client. In that case, the server MUST return 2637 a single option which was actually chosen. 2639 The syntax for the transport specifier is 2641 transport/profile/lower-transport. 2643 The default value for the ``lower-transport'' parameters is specific 2644 to the profile. For RTP/AVP, the default is UDP. 2646 Below are the configuration parameters associated with transport: 2648 General parameters: 2650 unicast | multicast 2651 : mutually exclusive indication of whether unicast or multicast 2652 delivery will be attempted. Default value is multicast. Clients 2653 that are capable of handling both unicast and multicast 2654 transmission MUST indicate such capability by including two 2655 full transport-specs with separate parameters for each. 2657 destination: 2658 The address to which a stream will be sent. The client may 2659 specify the multicast address with the destination parameter. 2660 To avoid becoming the unwitting perpetrator of a 2661 remote-controlled denial-of-service attack, a server SHOULD 2662 authenticate the client and SHOULD log such attempts before 2663 allowing the client to direct a media stream to an address not 2664 chosen by the server. This is particularly important if RTSP 2665 commands are issued via UDP, but implementations cannot rely on 2666 TCP as reliable means of client identification by itself. A 2667 server SHOULD not allow a client to direct media streams to an 2668 address that differs from the address commands are coming from. 2670 source: 2671 If the source address for the stream is different than can be 2672 derived from the RTSP endpoint address (the server in playback 2673 or the client in recording), the source MAY be specified. 2675 This information may also be available through SDP. However, since 2676 this is more a feature of transport than media initialization, the 2677 authoritative source for this information should be in the SETUP 2678 response. 2680 layers: 2681 The number of multicast layers to be used for this media 2682 stream. The layers are sent to consecutive addresses starting 2683 at the destination address. 2685 mode: 2686 The mode parameter indicates the methods to be supported for 2687 this session. Valid values are PLAY and RECORD. If not 2688 provided, the default is PLAY. 2690 append: 2691 If the mode parameter includes RECORD, the append parameter 2692 indicates that the media data should append to the existing 2693 resource rather than overwrite it. If appending is requested 2694 and the server does not support this, it MUST refuse the 2695 request rather than overwrite the resource identified by the 2696 URI. The append parameter is ignored if the mode parameter does 2697 not contain RECORD. 2699 interleaved: 2700 The interleaved parameter implies mixing the media stream with 2701 the control stream in whatever protocol is being used by the 2702 control stream, using the mechanism defined in Section 10.12. 2703 The argument provides the channel number to be used in the $ 2704 statement. This parameter may be specified as a range, e.g., 2705 interleaved=4-5 in cases where the transport choice for the 2706 media stream requires it. 2708 This allows RTP/RTCP to be handled similarly to the way that it is 2709 done with UDP, i.e., one channel for RTP and the other for RTCP. 2711 Multicast specific: 2713 ttl: 2714 multicast time-to-live 2716 RTP Specific: 2718 port: 2719 This parameter provides the RTP/RTCP port pair for a multicast 2720 session. It is specified as a range, e.g., port=3456-3457. 2722 client_port: 2723 This parameter provides the unicast RTP/RTCP port pair on the 2724 client where media data and control information is to be sent. 2725 It is specified as a range, e.g., port=3456-3457. 2727 server_port: 2728 This parameter provides the unicast RTP/RTCP port pair on the 2729 server where media data and control information is to be sent. 2730 It is specified as a range, e.g., port=3456-3457. 2732 ssrc: 2733 The ssrc parameter indicates the RTP SSRC [19, Sec. 3] value 2734 that should be (request) or will be (response) used by the 2735 media server. This parameter is only valid for unicast 2736 transmission. It identifies the synchronization source to be 2737 associated with the media stream. 2739 Transport = "Transport" ":" 2740 1\#transport-spec 2741 transport-spec = transport-protocol/profile[/lower-transport] 2742 *parameter 2743 transport-protocol = "RTP" 2744 profile = "AVP" 2745 lower-transport = "TCP" | "UDP" 2746 parameter = ( "unicast" | "multicast" ) 2747 | ";" "destination" [ "=" address ] 2748 | ";" "interleaved" "=" channel [ "-" channel ] 2749 | ";" "append" 2750 | ";" "ttl" "=" ttl 2751 | ";" "layers" "=" 1*DIGIT 2752 | ";" "port" "=" port [ "-" port ] 2753 | ";" "client_port" "=" port [ "-" port ] 2754 | ";" "server_port" "=" port [ "-" port ] 2755 | ";" "ssrc" "=" ssrc 2756 | ";" "mode" = <"> 1\#mode <"> 2757 ttl = 1*3(DIGIT) 2758 port = 1*5(DIGIT) 2759 ssrc = 8*8(HEX) 2760 channel = 1*3(DIGIT) 2761 address = host 2762 mode = <"> *Method <"> | Method 2764 Example: 2765 Transport: RTP/AVP;multicast;ttl=127;mode="PLAY", 2766 RTP/AVP;unicast;client_port=3456-3457;mode="PLAY" 2768 The Transport header is restricted to describing a single RTP 2769 stream. (RTSP can also control multiple streams as a single 2770 entity.) Making it part of RTSP rather than relying on a multitude 2771 of session description formats greatly simplifies designs of 2772 firewalls. 2774 12.40 Unsupported 2776 The Unsupported response header lists the features not supported by 2777 the server. In the case where the feature was specified via the 2778 Proxy-Require field (Section 12.32), if there is a proxy on the path 2779 between the client and the server, the proxy MUST insert a message 2780 reply with an error message ``551 Option Not Supported''. 2782 See Section 12.32 for a usage example. 2784 12.41 User-Agent 2786 See [H14.42] 2788 12.42 Vary 2790 See [H14.43] 2792 12.43 Via 2794 See [H14.44]. 2796 12.44 WWW-Authenticate 2798 See [H14.46]. 2800 13 Caching 2802 In HTTP, response-request pairs are cached. RTSP differs 2803 significantly in that respect. Responses are not cacheable, with the 2804 exception of the presentation description returned by DESCRIBE or 2805 included with ANNOUNCE. (Since the responses for anything but DESCRIBE 2806 and GET_PARAMETER do not return any data, caching is not really an 2807 issue for these requests.) However, it is desirable for the continuous 2808 media data, typically delivered out-of-band with respect to RTSP, to 2809 be cached, as well as the session description. 2811 On receiving a SETUP or PLAY request, a proxy ascertains whether it 2812 has an up-to-date copy of the continuous media content and its 2813 description. It can determine whether the copy is up-to-date by 2814 issuing a SETUP or DESCRIBE request, respectively, and comparing the 2815 Last-Modified header with that of the cached copy. If the copy is not 2816 up-to-date, it modifies the SETUP transport parameters as appropriate 2817 and forwards the request to the origin server. Subsequent control 2818 commands such as PLAY or PAUSE then pass the proxy unmodified. The 2819 proxy delivers the continuous media data to the client, while possibly 2820 making a local copy for later reuse. The exact behavior allowed to the 2821 cache is given by the cache-response directives described in 2822 Section 12.8. A cache MUST answer any DESCRIBE requests if it is 2823 currently serving the stream to the requestor, as it is possible that 2824 low-level details of the stream description may have changed on the 2825 origin-server. 2827 Note that an RTSP cache, unlike the HTTP cache, is of the 2828 ``cut-through'' variety. Rather than retrieving the whole resource 2829 from the origin server, the cache simply copies the streaming data as 2830 it passes by on its way to the client. Thus, it does not introduce 2831 additional latency. 2833 To the client, an RTSP proxy cache appears like a regular media 2834 server, to the media origin server like a client. Just as an HTTP 2835 cache has to store the content type, content language, and so on for 2836 the objects it caches, a media cache has to store the presentation 2837 description. Typically, a cache eliminates all transport-references 2838 (that is, multicast information) from the presentation description, 2839 since these are independent of the data delivery from the cache to the 2840 client. Information on the encodings remains the same. If the cache is 2841 able to translate the cached media data, it would create a new 2842 presentation description with all the encoding possibilities it can 2843 offer. 2845 14 Examples 2847 The following examples refer to stream description formats that are 2848 not standards, such as RTSL. The following examples are not to be used 2849 as a reference for those formats. 2851 14.1 Media on Demand (Unicast) 2853 Client C requests a movie from media servers A ( audio.example.com) 2854 and V (video.example.com). The media description is stored on a web 2855 server W . The media description contains descriptions of the 2856 presentation and all its streams, including the codecs that are 2857 available, dynamic RTP payload types, the protocol stack, and content 2858 information such as language or copyright restrictions. It may also 2859 give an indication about the timeline of the movie. 2861 In this example, the client is only interested in the last part of the 2862 movie. 2864 C->W: GET /twister.sdp HTTP/1.1 2865 Host: www.example.com 2866 Accept: application/sdp 2868 W->C: HTTP/1.0 200 OK 2869 Content-Type: application/sdp 2871 v=0 2872 o=- 2890844526 2890842807 IN IP4 192.16.24.202 2873 s=RTSP Session 2874 m=audio 0 RTP/AVP 0 2875 a=control:rtsp://audio.example.com/twister/audio.en 2876 m=video 0 RTP/AVP 31 2877 a=control:rtsp://video.example.com/twister/video 2879 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/1.0 2880 CSeq: 1 2881 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057 2883 A->C: RTSP/1.0 200 OK 2884 CSeq: 1 2885 Session: 1234 2886 Transport: RTP/AVP/UDP;unicast;client_port=3056-3057; 2887 server_port=5000-5001 2889 C->V: SETUP rtsp://video.example.com/twister/video RTSP/1.0 2890 CSeq: 1 2891 Transport: RTP/AVP/UDP;unicast;client_port=3058-3059 2893 V->C: RTSP/1.0 200 OK 2894 CSeq: 1 2895 Session: 1235 2896 Transport: RTP/AVP/UDP;unicast;client_port=3058-3059; 2897 server_port=5002-5003 2899 C->V: PLAY rtsp://video.example.com/twister/video RTSP/1.0 2900 CSeq: 2 2901 Session: 1235 2902 Range: smpte=0:10:00- 2904 V->C: RTSP/1.0 200 OK 2905 CSeq: 2 2906 Session: 1235 2907 Range: smpte=0:10:00-0:20:00 2908 RTP-Info: url=rtsp://video.example.com/twister/video; 2909 seq=12312232;rtptime=78712811 2911 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/1.0 2912 CSeq: 2 2913 Session: 1234 2914 Range: smpte=0:10:00- 2916 A->C: RTSP/1.0 200 OK 2917 CSeq: 2 2918 Session: 1234 2919 Range: smpte=0:10:00-0:20:00 2920 RTP-Info: url=rtsp://audio.example.com/twister/audio.en; 2921 seq=876655;rtptime=1032181 2923 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/1.0 2924 CSeq: 3 2925 Session: 1234 2927 A->C: RTSP/1.0 200 OK 2928 CSeq: 3 2930 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/1.0 2931 CSeq: 3 2932 Session: 1235 2934 V->C: RTSP/1.0 200 OK 2935 CSeq: 3 2937 Even though the audio and video track are on two different servers, 2938 and may start at slightly different times and may drift with respect 2939 to each other, the client can synchronize the two using standard RTP 2940 methods, in particular the time scale contained in the RTCP sender 2941 reports. 2943 14.2 Streaming of a Container file 2945 For purposes of this example, a container file is a storage entity in 2946 which multiple continuous media types pertaining to the same end-user 2947 presentation are present. In effect, the container file represents a 2948 RTSP presentation, with each of its components being RTSP streams. 2949 Container files are a widely used means to store such presentations. 2950 While the components are transported as independent streams, it is 2951 desirable to maintain a common context for those streams at the server 2952 end. 2954 This enables the server to keep a single storage handle open 2955 easily. It also allows treating all the streams equally in case of 2956 any prioritization of streams by the server. 2958 It is also possible that the presentation author may wish to prevent 2959 selective retrieval of the streams by the client in order to preserve 2960 the artistic effect of the combined media presentation. Similarly, in 2961 such a tightly bound presentation, it is desirable to be able to 2962 control all the streams via a single control message using an 2963 aggregate URL. 2965 The following is an example of using a single RTSP session to control 2966 multiple streams. It also illustrates the use of aggregate URLs. 2968 Client C requests a presentation from media server M . The movie is 2969 stored in a container file. The client has obtained a RTSP URL to the 2970 container file. 2972 C->M: DESCRIBE rtsp://foo/twister RTSP/1.0 2973 CSeq: 1 2975 M->C: RTSP/1.0 200 OK 2976 CSeq: 1 2977 Content-Type: application/sdp 2978 Content-Length: 164 2979 v=0 2980 o=- 2890844256 2890842807 IN IP4 172.16.2.93 2981 s=RTSP Session 2982 i=An Example of RTSP Session Usage 2983 a=control:rtsp://foo/twister 2984 t=0 0 2985 m=audio 0 RTP/AVP 0 2986 a=control:rtsp://foo/twister/audio 2987 m=video 0 RTP/AVP 26 2988 a=control:rtsp://foo/twister/video 2990 C->M: SETUP rtsp://foo/twister/audio RTSP/1.0 2991 CSeq: 2 2992 Transport: RTP/AVP;unicast;client_port=8000-8001 2994 M->C: RTSP/1.0 200 OK 2995 CSeq: 2 2996 Transport: RTP/AVP;unicast;client_port=8000-8001; 2997 server_port=9000-9001 2998 Session: 1234 3000 C->M: SETUP rtsp://foo/twister/video RTSP/1.0 3001 CSeq: 3 3002 Transport: RTP/AVP;unicast;client_port=8002-8003 3003 Session: 1234 3005 M->C: RTSP/1.0 200 OK 3006 CSeq: 3 3007 Transport: RTP/AVP;unicast;client_port=8002-8003; 3008 server_port=9004-9005 3009 Session: 1234 3011 C->M: PLAY rtsp://foo/twister RTSP/1.0 3012 CSeq: 4 3013 Range: npt=0- 3014 Session: 1234 3016 M->C: RTSP/1.0 200 OK 3017 CSeq: 4 3018 Session: 1234 3019 RTP-Info: url=rtsp://foo/twister/video; 3020 seq=9810092;rtptime=3450012 3022 C->M: PAUSE rtsp://foo/twister/video RTSP/1.0 3023 CSeq: 5 3024 Session: 1234 3026 M->C: RTSP/1.0 460 Only aggregate operation allowed 3027 CSeq: 5 3029 C->M: PAUSE rtsp://foo/twister RTSP/1.0 3030 CSeq: 6 3031 Session: 1234 3033 M->C: RTSP/1.0 200 OK 3034 CSeq: 6 3035 Session: 1234 3037 C->M: SETUP rtsp://foo/twister RTSP/1.0 3038 CSeq: 7 3039 Transport: RTP/AVP;unicast;client_port=10000 3041 M->C: RTSP/1.0 459 Aggregate operation not allowed 3042 CSeq: 7 3044 In the first instance of failure, the client tries to pause one stream 3045 (in this case video) of the presentation. This is disallowed for that 3046 presentation by the server. In the second instance, the aggregate URL 3047 may not be used for SETUP and one control message is required per 3048 stream to set up transport parameters. 3050 This keeps the syntax of the Transport header simple and allows 3051 easy parsing of transport information by firewalls. 3053 14.3 Single Stream Container Files 3055 Some RTSP servers may treat all files as though they are ``container 3056 files'', yet other servers may not support such a concept. Because of 3057 this, clients SHOULD use the rules set forth in the session 3058 description for request URLs, rather than assuming that a consistant 3059 URL may always be used throughout. Here's an example of how a 3060 multi-stream server might expect a single-stream file to be served: 3062 C->S DESCRIBE rtsp://foo.com/test.wav RTSP/1.0 3063 Accept: application/x-rtsp-mh, application/sdp 3064 CSeq: 1 3066 S->C RTSP/1.0 200 OK 3067 CSeq: 1 3068 Content-base: rtsp://foo.com/test.wav/ 3069 Content-type: application/sdp 3070 Content-length: 48 3071 v=0 3072 o=- 872653257 872653257 IN IP4 172.16.2.187 3073 s=mu-law wave file 3074 i=audio test 3075 t=0 0 3076 m=audio 0 RTP/AVP 0 3077 a=control:streamid=0 3079 C->S SETUP rtsp://foo.com/test.wav/streamid=0 RTSP/1.0 3080 Transport: RTP/AVP/UDP;unicast; 3081 client_port=6970-6971;mode=play 3082 CSeq: 2 3084 S->C RTSP/1.0 200 OK 3085 Transport: RTP/AVP/UDP;unicast;client_port=6970-6971; 3086 server_port=6970-6971;mode=play 3087 CSeq: 2 3088 Session: 2034820394 3090 C->S PLAY rtsp://foo.com/test.wav RTSP/1.0 3091 CSeq: 3 3092 Session: 2034820394 3094 S->C RTSP/1.0 200 OK 3095 CSeq: 3 3096 Session: 2034820394 3097 RTP-Info: url=rtsp://foo.com/test.wav/streamid=0; 3098 seq=981888;rtptime=3781123 3100 Note the different URL in the SETUP command, and then the switch back 3101 to the aggregate URL in the PLAY command. This makes complete sense 3102 when there are multiple streams with aggregate control, but is less 3103 than intuitive in the special case where the number of streams is one. 3105 In this special case, it is recommended that servers be forgiving of 3106 implementations that send: 3108 C->S PLAY rtsp://foo.com/test.wav/streamid=0 RTSP/1.0 3109 CSeq: 3 3111 In the worst case, servers should send back: 3113 S->C RTSP/1.0 460 Only aggregate operation allowed 3114 CSeq: 3 3116 One would also hope that server implementations are also forgiving of 3117 the following: 3119 C->S SETUP rtsp://foo.com/test.wav RTSP/1.0 3120 Transport: rtp/avp/udp;client_port=6970-6971;mode=play 3121 CSeq: 2 3123 Since there is only a single stream in this file, it's not ambiguous 3124 what this means. 3126 14.4 Live Media Presentation Using Multicast 3128 The media server M chooses the multicast address and port. Here, we 3129 assume that the web server only contains a pointer to the full 3130 description, while the media server M maintains the full description. 3132 C->W: GET /concert.sdp HTTP/1.1 3133 Host: www.example.com 3135 W->C: HTTP/1.1 200 OK 3136 Content-Type: application/x-rtsl 3138 3139 3140 3142 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/1.0 3143 CSeq: 1 3145 M->C: RTSP/1.0 200 OK 3146 CSeq: 1 3147 Content-Type: application/sdp 3148 Content-Length: 44 3150 v=0 3151 o=- 2890844526 2890842807 IN IP4 192.16.24.202 3152 s=RTSP Session 3153 m=audio 3456 RTP/AVP 0 3154 a=control:rtsp://live.example.com/concert/audio 3155 c=IN IP4 224.2.0.1/16 3157 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/1.0 3158 CSeq: 2 3159 Transport: RTP/AVP;multicast 3161 M->C: RTSP/1.0 200 OK 3162 CSeq: 2 3163 Transport: RTP/AVP;multicast;destination=224.2.0.1; 3164 port=3456-3457;ttl=16 3165 Session: 0456804596 3167 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/1.0 3168 CSeq: 3 3169 Session: 0456804596 3171 M->C: RTSP/1.0 200 OK 3172 CSeq: 3 3173 Session: 0456804596 3175 14.5 Playing media into an existing session 3177 A conference participant C wants to have the media server M play back 3178 a demo tape into an existing conference. C indicates to the media 3179 server that the network addresses and encryption keys are already 3180 given by the conference, so they should not be chosen by the server. 3181 The example omits the simple ACK responses. 3183 C->M: DESCRIBE rtsp://server.example.com/demo/548/sound RTSP/1.0 3184 CSeq: 1 3185 Accept: application/sdp 3187 M->C: RTSP/1.0 200 1 OK 3188 Content-type: application/sdp 3189 Content-Length: 44 3191 v=0 3192 o=- 2890844526 2890842807 IN IP4 192.16.24.202 3193 s=RTSP Session 3194 i=See above 3195 t=0 0 3196 m=audio 0 RTP/AVP 0 3198 C->M: SETUP rtsp://server.example.com/demo/548/sound RTSP/1.0 3199 CSeq: 2 3200 Transport: RTP/AVP;multicast;destination=225.219.201.15; 3201 port=7000-7001;ttl=127 3202 Conference: 199702170042.SAA08642@obiwan.arl.wustl.edu%20Starr 3204 M->C: RTSP/1.0 200 OK 3205 CSeq: 2 3206 Transport: RTP/AVP;multicast;destination=225.219.201.15; 3207 port=7000-7001;ttl=127 3208 Session: 91389234234 3209 Conference: 199702170042.SAA08642@obiwan.arl.wustl.edu%20Starr 3211 C->M: PLAY rtsp://server.example.com/demo/548/sound RTSP/1.0 3212 CSeq: 3 3213 Session: 91389234234 3215 M->C: RTSP/1.0 200 OK 3216 CSeq: 3 3218 14.6 Recording 3220 The conference participant client C asks the media server M to record 3221 the audio and video portions of a meeting. The client uses the 3222 ANNOUNCE method to provide meta-information about the recorded session 3223 to the server. 3225 C->M: ANNOUNCE rtsp://server.example.com/meeting RTSP/1.0 3226 CSeq: 90 3227 Content-Type: application/sdp 3228 Content-Length: 121 3230 v=0 3231 o=camera1 3080117314 3080118787 IN IP4 195.27.192.36 3232 s=IETF Meeting, Munich - 1 3233 i=The thirty-ninth IETF meeting will be held in Munich, Germany 3234 u=http://www.ietf.org/meetings/Munich.html 3235 e=IETF Channel 1 3236 p=IETF Channel 1 +49-172-2312 451 3237 c=IN IP4 224.0.1.11/127 3238 t=3080271600 3080703600 3239 a=tool:sdr v2.4a6 3240 a=type:test 3241 m=audio 21010 RTP/AVP 5 3242 c=IN IP4 224.0.1.11/127 3243 a=ptime:40 3244 m=video 61010 RTP/AVP 31 3245 c=IN IP4 224.0.1.12/127 3247 M->C: RTSP/1.0 200 OK 3248 CSeq: 90 3250 C->M: SETUP rtsp://server.example.com/meeting/audiotrack RTSP/1.0 3251 CSeq: 91 3252 Transport: RTP/AVP;multicast;destination=224.0.1.11; 3253 port=21010-21011;mode=record;ttl=127 3255 M->C: RTSP/1.0 200 OK 3256 CSeq: 91 3257 Session: 508876 3258 Transport: RTP/AVP;multicast;destination=224.0.1.11; 3259 port=21010-21011;mode=record;ttl=127 3261 C->M: SETUP rtsp://server.example.com/meeting/videotrack RTSP/1.0 3262 CSeq: 92 3263 Session: 508876 3264 Transport: RTP/AVP;multicast;destination=224.0.1.12; 3265 port=61010-61011;mode=record;ttl=127 3267 M->C: RTSP/1.0 200 OK 3268 CSeq: 92 3269 Transport: RTP/AVP;multicast;destination=224.0.1.12; 3270 port=61010-61011;mode=record;ttl=127 3272 C->M: RECORD rtsp://server.example.com/meeting RTSP/1.0 3273 CSeq: 93 3274 Session: 508876 3275 Range: clock=19961110T1925-19961110T2015 3277 M->C: RTSP/1.0 200 OK 3278 CSeq: 93 3280 15 Syntax 3282 The RTSP syntax is described in an augmented Backus-Naur form (BNF) 3283 as used in RFC 2068 (HTTP/1.1). 3285 15.1 Base Syntax 3287 OCTET = 3288 CHAR = 3289 UPALPHA = 3290 LOALPHA = 3291 ALPHA = UPALPHA | LOALPHA 3292 DIGIT = 3293 CTL = 3295 CR = 3296 LF = 3298 SP = 3299 HT = 3300 <"> = 3301 CRLF = CR LF 3302 LWS = [CRLF] 1*( SP | HT ) 3304 TEXT = 3305 tspecials = "(" | ")" | "<" | ">" | "@" 3306 | "," | ";" | ":" | "\" | <"> 3307 | "/" | "[" | "]" | "?" | "=" 3308 | "{" | "}" | SP | HT 3310 token = 1* 3311 quoted-string = ( <"> *(qdtext) <"> ) 3312 qdtext = > 3313 quoted-pair = "\" CHAR 3315 message-header = field-name ":" [ field-value ] CRLF 3316 field-name = token 3317 field-value = *( field-content | LWS ) 3318 field-content = 3323 safe = "\$" | "-" | "_" | "." | "+" 3324 extra = "!" | "*" | "$'$" | "(" | ")" | "," 3326 hex = DIGIT | "A" | "B" | "C" | "D" | "E" | "F" | 3327 "a" | "b" | "c" | "d" | "e" | "f" 3328 escape = "\%" hex hex 3329 reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" 3331 unreserved = alpha | digit | safe | extra 3332 xchar = unreserved | reserved | escape 3334 16 Security Considerations 3336 Because of the similarity in syntax and usage between RTSP servers 3337 and HTTP servers, the security considerations outlined in [H15] apply. 3338 Specifically, please note the following: 3340 Authentication Mechanisms: 3341 RTSP and HTTP share common authentication schemes, and thus 3342 should follow the same prescriptions with regards to 3343 authentication. See [H15.1] for client authentication issues, 3344 and [H15.2] for issues regarding support for multiple 3345 authentication mechanisms. 3347 Abuse of Server Log Information: 3348 RTSP and HTTP servers will presumably have similar logging 3349 mechanisms, and thus should be equally guarded in protecting 3350 the contents of those logs, thus protecting the privacy of the 3351 users of the servers. See [H15.3] for HTTP server 3352 recommendations regarding server logs. 3354 Transfer of Sensitive Information: 3355 There is no reason to believe that information transferred via 3356 RTSP may be any less sensitive than that normally transmitted 3357 via HTTP. Therefore, all of the precautions regarding the 3358 protection of data privacy and user privacy apply to 3359 implementors of RTSP clients, servers, and proxies. See [H15.4] 3360 for further details. 3362 Attacks Based On File and Path Names: 3363 Though RTSP URLs are opaque handles that do not necessarily 3364 have file system semantics, it is anticipated that many 3365 implementations will translate portions of the request URLs 3366 directly to file system calls. In such cases, file systems 3367 SHOULD follow the precautions outlined in [H15.5], such as 3368 checking for ``..'' in path components. 3370 Personal Information: 3371 RTSP clients are often privy to the same information that HTTP 3372 clients are (user name, location, etc.) and thus should be 3373 equally. See [H15.6] for further recommendations. 3375 Privacy Issues Connected to Accept Headers: 3376 Since may of the same ``Accept'' headers exist in RTSP as in 3377 HTTP, the same caveats outlined in [H15.7] with regards to 3378 their use should be followed. 3380 DNS Spoofing: 3381 Presumably, given the longer connection times typically 3382 associated to RTSP sessions relative to HTTP sessions, RTSP 3383 client DNS optimizations should be less prevalent. Nonetheless, 3384 the recommendations provided in [H15.8] are still relevant to 3385 any implementation which attempts to rely on a DNS-to-IP 3386 mapping to hold beyond a single use of the mapping. 3388 Location Headers and Spoofing: 3389 If a single server supports multiple organizations that do not 3390 trust one another, then it must check the values of Location 3391 and Content-Location headers in responses that are generated 3392 under control of said organizations to make sure that they do 3393 not attempt to invalidate resources over which they have no 3394 authority. ([H15.9]) 3396 In addition to the recommendations in the current HTTP specification 3397 (RFC 2068, as of this writing), future HTTP specifications may provide 3398 additional guidance on security issues. 3400 The following are added considerations for RTSP implementations. 3402 Concentrated Denial-Of-Service: 3403 The protocol offers the opportunity for a remote-controlled 3404 denial-of-service attack. The attacker may initiate traffic 3405 flows to one or more IP addresses by specifying them as the 3406 destination in SETUP requests. While the attacker's IP address 3407 may be known in this case, this is not always useful in 3408 prevention of more attacks or ascertaining the attackers 3409 identity. Thus, an RTSP server SHOULD only allow 3410 client-specified destinations for RTSP-initiated traffic flows 3411 if the server has verified the client's identity, either 3412 against a database of known users using RTSP authentication 3413 mechanisms (preferrably digest authentication or stronger), or 3414 other secure means. 3416 Session Hijacking: 3417 Since there is no relation between a transport layer connection 3418 and an RTSP session, it is possible for a malicious client to 3419 issue requests with random session identifiers which would 3420 affect unsuspecting clients. The server SHOULD use a large, 3421 random and non-sequential session identifier to minimize the 3422 possibility of this kind of attack. 3424 Authentication: 3425 Servers SHOULD implement both basic and digest [6] 3426 authentication. In environments requiring tighter security for 3427 the control messages, transport layer mechanisms such as TLS 3428 (RFC XXXX) SHOULD be used. 3430 Stream issues: 3431 RTSP only provides for stream control. Stream delivery issues 3432 are not covered in this section, nor in the rest of this draft. 3433 RTSP implementations will most likely rely on other protocols 3434 such as RTP, IP Multicast, RSVP, and IGMP, and should address 3435 considerations brought up in these specifications (even when 3436 non-standard equivalents are used in place of said protocols). 3438 Persistently suspicious behavior: 3439 RTSP servers SHOULD return error code 403 (Forbidden) upon 3440 receiving a single instance of behavior which is deemed a 3441 security risk. RTSP servers SHOULD also be aware of attempts to 3442 probe the server for weaknesses and entry points and MAY 3443 arbitrarily disconnect and ignore further requests clients 3444 which are deemed to be in violation of local security policy. 3446 Appendix A: RTSP Protocol State Machines 3448 The RTSP client and server state machines describe the behavior of 3449 the protocol from RTSP session initialization through RTSP session 3450 termination. 3452 State is defined on a per object basis. An object is uniquely 3453 identified by the stream URL and the RTSP session identifier. Any 3454 request/reply using aggregate URLs denoting RTSP presentations 3455 composed of multiple streams will have an effect on the individual 3456 states of all the streams. For example, if the presentation /movie 3457 contains two streams, /movie/audio and /movie/video, then the 3458 following command: 3460 PLAY rtsp://foo.com/movie RTSP/1.0 3461 CSeq: 559 3462 Session: 12345 3464 will have an effect on the states of movie/audio and movie/video. 3466 This example does not imply a standard way to represent streams in 3467 URLs or a relation to the filesystem. See Section 3.2. 3469 The requests OPTIONS, ANNOUNCE, DESCRIBE, GET_PARAMETER, SET_PARAMETER 3470 do not have any effect on client or server state and are therefore not 3471 listed in the state tables. 3473 A.1 Client State Machine 3475 The client can assume the following states: 3477 Init: 3478 SETUP has been sent, waiting for reply. 3480 Ready: 3481 SETUP reply received or PAUSE reply received while in Playing 3482 state. 3484 Playing: 3485 PLAY reply received 3487 Recording: 3488 RECORD reply received 3490 In general, the client changes state on receipt of replies to 3491 requests. Note that some requests are effective at a future time or 3492 position (such as a PAUSE), and state also changes accordingly. If no 3493 explicit SETUP is required for the object (for example, it is 3494 available via a multicast group), state begins at Ready. In this case, 3495 there are only two states, Ready and Playing. The client also changes 3496 state from Playing/Recording to Ready when the end of the requested 3497 range is reached. 3499 The ``next state'' column indicates the state assumed after receiving 3500 a success response (2xx). If a request yields a status code of 3xx, 3501 the state becomes Init, and a status code of 4xx yields no change in 3502 state. Messages not listed for each state MUST NOT be issued by the 3503 client in that state, with the exception of messages not affecting 3504 state, as listed above. Receiving a REDIRECT from the server is 3505 equivalent to receiving a 3xx redirect status from the server. 3507 state message sent next state after response 3508 Init SETUP Ready 3509 TEARDOWN Init 3510 Ready PLAY Playing 3511 RECORD Recording 3512 TEARDOWN Init 3513 SETUP Ready 3514 Playing PAUSE Ready 3515 TEARDOWN Init 3516 PLAY Playing 3517 SETUP Playing (changed transport) 3518 Recording PAUSE Ready 3519 TEARDOWN Init 3520 RECORD Recording 3521 SETUP Recording (changed transport) 3523 A.2 Server State Machine 3525 The server can assume the following states: 3527 Init: 3528 The initial state, no valid SETUP has been received yet. 3530 Ready: 3531 Last SETUP received was successful, reply sent or after 3532 playing, last PAUSE received was successful, reply sent. 3534 Playing: 3535 Last PLAY received was successful, reply sent. Data is being 3536 sent. 3538 Recording: 3539 The server is recording media data. 3541 In general, the server changes state on receiving requests. If the 3542 server is in state Playing or Recording and in unicast mode, it MAY 3543 revert to Init and tear down the RTSP session if it has not received 3544 ``wellness'' information, such as RTCP reports or RTSP commands, from 3545 the client for a defined interval, with a default of one minute. The 3546 server can declare another timeout value in the Session response 3547 header (Section 12.37). If the server is in state Ready, it MAY revert 3548 to Init if it does not receive an RTSP request for an interval of more 3549 than one minute. Note that some requests (such as PAUSE) may be 3550 effective at a future time or position, and server state changes at 3551 the appropriate time. The server reverts from state Playing or 3552 Recording to state Ready at the end of the range requested by the 3553 client. 3555 The REDIRECT message, when sent, is effective immediately unless it 3556 has a Range header specifying when the redirect is effective. In such 3557 a case, server state will also change at the appropriate time. 3559 If no explicit SETUP is required for the object, the state starts at 3560 Ready and there are only two states, Ready and Playing. 3562 The ``next state'' column indicates the state assumed after sending a 3563 success response (2xx). If a request results in a status code of 3xx, 3564 the state becomes Init. A status code of 4xx results in no change. 3566 state message received next state 3567 Init SETUP Ready 3568 TEARDOWN Init 3569 Ready PLAY Playing 3570 SETUP Ready 3571 TEARDOWN Init 3572 RECORD Recording 3573 Playing PLAY Playing 3574 PAUSE Ready 3575 TEARDOWN Init 3576 SETUP Playing 3577 Recording RECORD Recording 3578 PAUSE Ready 3579 TEARDOWN Init 3580 SETUP Recording 3582 Appendix B: Interaction with RTP 3584 RTSP allows media clients to control selected, non-contiguous 3585 sections of media presentations, rendering those streams with an RTP 3586 media layer[19]. The media layer rendering the RTP stream should not 3587 be affected by jumps in NPT. Thus, both RTP sequence numbers and RTP 3588 timestamps MUST be continuous and monotonic across jumps of NPT. 3590 As an example, assume a clock frequency of 8000 Hz, a packetization 3591 interval of 100 ms and an initial sequence number and timestamp of 3592 zero. First we play NPT 10 through 15, then skip ahead and play NPT 18 3593 through 20. The first segment is presented as RTP packets with 3594 sequence numbers 0 through 49 and timestamp 0 through 39,200. The 3595 second segment consists of RTP packets with sequence number 50 through 3596 69, with timestamps 40,000 through 55,200. 3598 We cannot assume that the RTSP client can communicate with the RTP 3599 media agent, as the two may be independent processes. If the RTP 3600 timestamp shows the same gap as the NPT, the media agent will 3601 assume that there is a pause in the presentation. If the jump in 3602 NPT is large enough, the RTP timestamp may roll over and the media 3603 agent may believe later packets to be duplicates of packets just 3604 played out. 3606 For certain datatypes, tight integration between the RTSP layer and 3607 the RTP layer will be necessary. This by no means precludes the 3608 above restriction. Combined RTSP/RTP media clients should use the 3609 RTP-Info field to determine whether incoming RTP packets were sent 3610 before or after a seek. 3612 For continuous audio, the server SHOULD set the RTP marker bit at the 3613 beginning of serving a new PLAY request. This allows the client to 3614 perform playout delay adaptation. 3616 For scaling (see Section 12.34), RTP timestamps should correspond to 3617 the playback timing. For example, when playing video recorded at 30 3618 frames/second at a scale of two and speed (Section 12.35) of one, the 3619 server would drop every second frame to maintain and deliver video 3620 packets with the normal timestamp spacing of 3,000 per frame, but NPT 3621 would increase by 1/15 second for each video frame. 3623 The client can maintain a correct display of NPT by noting the RTP 3624 timestamp value of the first packet arriving after repositioning. The 3625 sequence parameter of the RTP-Info (Section 12.33) header provides the 3626 first sequence number of the next segment. 3628 Appendix C: Use of SDP for RTSP Session Descriptions 3630 The Session Description Protocol (SDP, RFC XXXX) may be used to 3631 describe streams or presentations in RTSP. Such usage is limited to 3632 specifying means of access and encoding(s) for: 3634 aggregate control: 3635 A presentation composed of streams from one or more servers 3636 that are not available for aggregate control. Such a 3637 description is typically retrieved by HTTP or other non-RTSP 3638 means. However, they may be received with ANNOUNCE methods. 3640 non-aggregate control: 3641 A presentation composed of multiple streams from a single 3642 server that are available for aggregate control. Such a 3643 description is typically returned in reply to a DESCRIBE 3644 request on a URL, or received in an ANNOUNCE method. 3646 This appendix describes how an SDP file, retrieved, for example, 3647 through HTTP, determines the operation of an RTSP session. It also 3648 describes how a client should interpret SDP content returned in reply 3649 to a DESCRIBE request. SDP provides no mechanism by which a client can 3650 distinguish, without human guidance, between several media streams to 3651 be rendered simultaneously and a set of alternatives (e.g., two audio 3652 streams spoken in different languages). 3654 C.1 Definitions 3656 The terms ``session-level'', ``media-level'' and other key/attribute 3657 names and values used in this appendix are to be used as defined in 3658 RFC XXXX (SDP): 3660 C.1.1 Control URL 3662 The ``a=control:'' attribute is used to convey the control URL. This 3663 attribute is used both for the session and media descriptions. If used 3664 for individual media, it indicates the URL to be used for controlling 3665 that particular media stream. If found at the session level, the 3666 attribute indicates the URL for aggregate control. 3668 Example: 3669 a=control:rtsp://example.com/foo 3671 This attribute may contain either relative and absolute URLs, 3672 following the rules and conventions set out in RFC 1808 ([20]). 3673 Implementations should look for a base URL in the following order: 3675 1. The RTSP Content-Base field 3676 2. The RTSP Content-Location field 3677 3. The RTSP request URL 3679 If this attribute contains only an asterisk (*), then the URL is 3680 treated as if it were an empty embedded URL, and thus inherits the 3681 entire base URL. 3683 C.1.2 Media streams 3685 The ``m='' field is used to enumerate the streams. It is expected that 3686 all the specified streams will be rendered with appropriate 3687 synchronization. If the session is unicast, the port number serves as 3688 a recommendation from the server to the client; the client still has 3689 to include it in its SETUP request and may ignore this recommendation. 3690 If the server has no preference, it SHOULD set the port number value 3691 to zero. 3693 Example: 3694 m=audio 0 RTP/AVP 31 3696 C.1.3 Payload type(s) 3698 The payload type(s) are specified in the ``m='' field. In case the 3699 payload type is a static payload type from RFC 1890([1]), no other 3700 information is required. In case it is a dynamic payload type, the 3701 media attribute ``rtpmap'' is used to specify what the media is. The 3702 ``encoding name'' within the ``rtpmap'' attribute may be one of those 3703 specified in RFC 1890 (Sections 5 and 6), or an experimental encoding 3704 with a ``X-'' prefix as specified in RFC XXXX (SDP). Codec-specific 3705 parameters are not specified in this field, but rather in the ``fmtp'' 3706 attribute described below. Implementors seeking to register new 3707 encodings should follow the procedure in RFC 1890. If the media type 3708 is not suited to the RTP AV profile, then it is recommended that a new 3709 profile be created and the appropriate profile name be used in lieu of 3710 ``RTP/AVP'' in the ``m='' field. 3712 C.1.4 Format-specific parameters 3714 Format-specific parameters are conveyed using the ``fmtp'' media 3715 attribute. The syntax of the ``fmtp'' attribute is specific to the 3716 encoding(s) that the attribute refers to. Note that the packetization 3717 interval is conveyed using the ``ptime'' attribute. 3719 C.1.5 Range of presentation 3721 The ``a=range'' attribute defines the total time range of the stored 3722 session. (The length of live sessions can be deduced from the ``t'' 3723 and ``r'' parameters.) Unless the presentation contains media streams 3724 of different durations, the length attribute is a session-level 3725 attribute. The unit is specified first, followed by the value range. 3726 The units and their values are as defined in Section 3.5, 3.6 and 3.7. 3728 Examples: 3729 a=range:npt=0-34.4368 3730 a=range:clock=19971113T2115-19971113T2203 3732 C.1.6 Time of availability 3734 The ``t='' field MUST contain suitable values for the start and stop 3735 times for both aggregate and non-aggregate stream control. With 3736 aggregate control, the server SHOULD indicate a stop time value for 3737 which it guarantees the description to be valid, and a start time that 3738 is equal to or before the time at which the DESCRIBE request was 3739 received. It MAY also indicate start and stop times of 0, meaning that 3740 the session is always available. With non-aggregate control, the 3741 values should reflect the actual period for which the session is 3742 available in keeping with SDP semantics, and not depend on other means 3743 (such as the life of the web page containing the description) for this 3744 purpose. 3746 C.1.7 Connection Information 3748 In SDP, the ``c='' field contains the destination address for the 3749 media stream. However, for on-demand unicast streams and some 3750 multicast streams, the destination address is specified by the client 3751 via the SETUP request. Unless the media content has a fixed 3752 destination address, the ``c='' field is to be set to a suitable null 3753 value. For addresses of type ``IP4'', this value is ``0.0.0.0''. 3755 C.1.8 Entity Tag 3757 The optional ``a=etag'' attribute identifies a version of the session 3758 description. It is opaque to the client. SETUP requests may include 3759 this identifier in the If-Match field (see section 12.22) to only 3760 allow session establishment if this attribute value still corresponds 3761 to that of the current description. The attribute value is opaque and 3762 may contain any character allowed within SDP attribute values. 3764 Example: 3765 a=etag:158bb3e7c7fd62ce67f12b533f06b83a 3767 One could argue that the ``o='' field provides identical 3768 functionality. However, it does so in a manner that would put 3769 constraints on servers that need to support multiple session 3770 description types other than SDP for the same piece of media 3771 content. 3773 C.2 Aggregate Control Not Available 3775 If a presentation does not support aggregate control and multiple 3776 media sections are specified, each section MUST have the control URL 3777 specified via the ``a=control:'' attribute. 3779 Example: 3780 v=0 3781 o=- 2890844256 2890842807 IN IP4 204.34.34.32 3782 s=I came from a web page 3783 t=0 0 3784 c=IN IP4 0.0.0.0 3785 m=video 8002 RTP/AVP 31 3786 a=control:rtsp://audio.com/movie.aud 3787 m=audio 8004 RTP/AVP 3 3788 a=control:rtsp://video.com/movie.vid 3790 Note that the position of the control URL in the description implies 3791 that the client establishes separate RTSP control sessions to the 3792 servers audio.com and video.com. 3794 It is recommended that an SDP file contains the complete media 3795 initialization information even if it is delivered to the media client 3796 through non-RTSP means. This is necessary as there is no mechanism to 3797 indicate that the client should request more detailed media stream 3798 information via DESCRIBE. 3800 C.3 Aggregate Control Available 3802 In this scenario, the server has multiple streams that can be 3803 controlled as a whole. In this case, there are both a media-level 3804 ``a=control:'' attributes, which are used to specify the stream URLs, 3805 and a session-level ``a=control:'' attribute which is used as the 3806 request URL for aggregate control. If the media-level URL is relative, 3807 it is resolved to absolute URLs according to Section C.1.1 above. 3809 If the presentation comprises only a single stream, the media-level 3810 ``a=control:'' attribute may be omitted altogether. However, if the 3811 presentation contains more than one stream, each media stream section 3812 MUST contain its own ``a=control'' attribute. 3814 Example: 3815 v=0 3816 o=- 2890844256 2890842807 IN IP4 204.34.34.32 3817 s=I contain 3818 i= 3819 t=0 0 3820 c=IN IP4 0.0.0.0 3821 a=control:rtsp://example.com/movie/ 3822 m=video 8002 RTP/AVP 31 3823 a=control:trackID=1 3824 m=audio 8004 RTP/AVP 3 3825 a=control:trackID=2 3827 In this example, the client is required to establish a single RTSP 3828 session to the server, and uses the URLs 3829 rtsp://example.com/movie/trackID=1 and 3830 rtsp://example.com/movie/trackID=2 to set up the video and audio 3831 streams, respectively. The URL rtsp://example.com/movie/ controls the 3832 whole movie. 3834 Appendix D: Minimal RTSP implementation 3836 D.1 Client 3838 A client implementation MUST be able to do the following : 3840 * Generate the following requests : 3841 SETUP, TEARDOWN, and one of PLAY (i.e., a minimal playback client) 3842 or RECORD (i.e., a minimal recording client). If RECORD is 3843 implemented, ANNOUNCE must be implemented as well. 3844 * Include the following headers in requests: 3845 CSeq, Connection, Session, Transport. If ANNOUNCE is implemented, 3846 the capability to include headers Content-Language, 3847 Content-Encoding, Content-Length, and Content-Type should be as 3848 well. 3849 * Parse and understand the following headers in responses: CSeq, 3850 Connection, Session, Transport, Content-Language, 3851 Content-Encoding, Content-Length, Content-Type. If RECORD is 3852 implemented, the Location header must be understood as well. 3853 RTP-compliant implementations should also implement RTP-Info. 3854 * Understand the class of each error code received and notify the 3855 end-user, if one is present, of error codes in classes 4xx and 3856 5xx. The notification requirement may be relaxed if the end-user 3857 explicitly does not want it for one or all status codes. 3858 * Expect and respond to asynchronous requests from the server, such 3859 as ANNOUNCE. This does not necessarily mean that it should 3860 implement the ANNOUNCE method, merely that it MUST respond 3861 positively or negatively to any request received from the server. 3863 Though not required, the following are highly recommended at the time 3864 of publication for practical interoperability with initial 3865 implementations and/or to be a ``good citizen''. 3867 * Implement RTP/AVP/UDP as a valid transport. 3868 * Inclusion of the User-Agent header. 3869 * Understand SDP session descriptions as defined in Appendix C 3870 * Accept media initialization formats (such as SDP) from standard 3871 input, command line, or other means appropriate to the operating 3872 environment to act as a ``helper application'' for other 3873 applications (such as web browsers). 3875 There may be RTSP applications different from those initially 3876 envisioned by the contributors to the RTSP specification for which 3877 the requirements above do not make sense. Therefore, the 3878 recommendations above serve only as guidelines instead of strict 3879 requirements. 3881 D.1.1 Basic Playback 3883 To support on-demand playback of media streams, the client MUST 3884 additionally be able to do the following: 3885 * generate the PAUSE request; 3886 * implement the REDIRECT method, and the Location header. 3888 D.1.2 Authentication-enabled 3890 In order to access media presentations from RTSP servers that require 3891 authentication, the client MUST additionally be able to do the 3892 following: 3893 * recognize the 401 status code; 3894 * parse and include the WWW-Authenticate header; 3895 * implement Basic Authentication and Digest Authentication. 3897 D.2 Server 3899 A minimal server implementation MUST be able to do the following: 3901 * Implement the following methods: SETUP, TEARDOWN, OPTIONS and 3902 either PLAY (for a minimal playback server) or RECORD (for a 3903 minimal recording server). 3904 If RECORD is implemented, ANNOUNCE should be implemented as well. 3905 * Include the following headers in responses: Connection, 3906 Content-Length, Content-Type, Content-Language, Content-Encoding, 3907 Transport, Public. The capability to include the Location header 3908 should be implemented if the RECORD method is. RTP-compliant 3909 implementations should also implement the RTP-Info field. 3910 * Parse and respond appropriately to the following headers in 3911 requests: Connection, Session, Transport, Require. 3913 Though not required, the following are highly recommended at the time 3914 of publication for practical interoperability with initial 3915 implementations and/or to be a ``good citizen''. 3917 * Implement RTP/AVP/UDP as a valid transport. 3918 * Inclusion of the Server header. 3919 * Implement the DESCRIBE method. 3920 * Generate SDP session descriptions as defined in Appendix C 3922 There may be RTSP applications different from those initially 3923 envisioned by the contributors to the RTSP specification for which 3924 the requirements above do not make sense. Therefore, the 3925 recommendations above serve only as guidelines instead of strict 3926 requirements. 3928 D.2.1 Basic Playback 3930 To support on-demand playback of media streams, the server MUST 3931 additionally be able to do the following: 3933 * Recognize the Range header, and return an error if seeking is not 3934 supported. 3935 * Implement the PAUSE method. 3937 In addition, in order to support commonly-accepted user interface 3938 features, the following are highly recommended for on-demand media 3939 servers: 3941 * Include and parse the Range header, with NPT units. Implementation 3942 of SMPTE units is recommended. 3943 * Include the length of the media presentation in the media 3944 initialization information. 3945 * Include mappings from data-specific timestamps to NPT. When RTP is 3946 used, the rtptime portion of the RTP-Info field may be used to map 3947 RTP timestamps to NPT. 3949 Client implementations may use the presence of length information 3950 to determine if the clip is seekable, and visably disable seeking 3951 features for clips for which the length information is unavailable. 3952 A common use of the presentation length is to implement a ``slider 3953 bar'' which serves as both a progress indicator and a timeline 3954 positioning tool. 3956 Mappings from RTP timestamps to NPT are necessary to ensure correct 3957 positioning of the slider bar. 3959 D.2.2 Authentication-enabled 3961 In order to correctly handle client authentication, the server MUST 3962 additionally be able to do the following: 3964 * Generate the 401 status code when authentication is required for 3965 the resource. 3966 * Parse and include the WWW-Authenticate header 3967 * Implement Basic Authentication and Digest Authentication 3969 Appendix E: Changes 3971 Since draft 06 (November 21, 1997 version) of RTSP, the following 3972 changes were made: 3974 * Added "Persistently suspicious behavior" to Security 3975 Considerations (Section 16). 3976 * Fixed examples in the explanation of NPT (Section 3.6). 3977 * Session identifiers MUST be chosen at random and must be at least 3978 8 octets long (Section 3.4). (Formerly, this was only SHOULD). 3979 * Made XXXX reference to SDP more clearly belong to SDP in Appendix 3980 C (still needs to be fixed when SDP gets an RFC number). 3982 Since draft 05 (October 28, 1997 version) of RTSP, the following 3983 changes were made: 3985 * Added reference to Timestamp: header. 3986 * Added some RTP-Info headers to PLAY responses in example code. 3987 * Added atomicity wording to SET_PARAMETER. 3988 * Added support for smpte-25. 3989 * Added Allow header to header table. 3990 * Changed smpte and npt to allow 1*2DIGIT. 3991 * Changed RTP-Info from providing the last sequence number of the 3992 previous segment to first sequence number of the next segment. 3993 * Changed SDP a=length to a=range. 3994 * Described ``append'' Transport parameter further. 3995 * Fixed bugs in CSeq wording (was per packet, now per request). 3996 * Fleshed out security section reference to HTTP by explaining why 3997 each of the HTTP recommendations are applicable to RTSP. 3998 * Allow server initiated OPTIONS exchange 3999 * Fixed wording on the Range header support for minimal 4000 implementations. 4001 * Updated section and example to interleave RTCP packets on the TCP 4002 connection well. 4004 Since draft 04 (September 17, 1997 version) of RTSP, the following 4005 changes were made: 4007 * Further explanation of container files and how to deal with 4008 ``single-stream container files''. 4009 * IANA procedure for registering option tags. 4010 * New response codes (``461 Unsupported Transport'', ``462 4011 Destination Unreachable'', ``551 Option Not Supported''). 4012 * Practical minimum implementations established in Appendix D. 4013 * Removed quasi-specification of ``text/rtsp-parameters'' with the 4014 intent to define this separately. 4015 * Closed out open issues 4016 * Inserted ommisions in ``Since draft03...'' below (``etag'' 4017 change). 4018 * Addition of ``etag'' mechanism in SDP, and corresponding If-Match 4019 field. 4021 Since draft 03 (July 30, 1997 version) of RTSP, the following changes 4022 were made: 4024 * PEP was removed, Require header returns. Motivation: We explored 4025 using the W3C's PEP proposal for this functionality. However, 4026 Require, Proxy-Require, and Unsupported allow the addition of 4027 extensions with far less complexity. The Proxy-Require field 4028 roughly corresponds to the C-PEP field in the PEP draft. The 4029 Require field roughly corresponds to the PEP field in the PEP 4030 draft. The Unsupported field roughly corresponds to the PEP-Info 4031 and C-PEP-Info in the PEP draft. 4032 * Usage of SDP within RTSP is specified as an appendix. 4033 * Minimal RTSP implementation specified as an appendix. 4034 * The RTSP control sequence number was moved from the request and 4035 response lines into its own CSeq header. 4036 * Appendix detailing interaction with RTP added. 4037 * Several changes to Transport and RTP-Info fields. RTP-Info was 4038 formerly Transport-Info. 4039 * Addition of etag mechanism in SDP, and corresponding If-Match 4040 field. 4042 Between draft 02 (March, 1997) and draft 03 (July, 1997), the 4043 following changes were made: 4045 * Definition of RTP behavior. 4046 * Definition of behavior for container files. 4047 * Remove server-to-client DESCRIBE request. 4048 * Allowing the Transport header to direct media streams to unicast 4049 and multicast addresses, with an appropriate warning about 4050 denial-of-service attacks. 4051 * Add mode parameter to Transport header to allow RECORD or PLAY. 4052 * The Embedded binary data section was modified to clearly indicate 4053 the stream the data corresponds to, and a reference to the 4054 Transport header was added. 4055 * The Transport header format has been changed to use a more general 4056 means to specify data channel and application-level protocol. It 4057 also conveys the port to be used at the server for RTCP messages, 4058 and the start sequence number that will be used in the RTP 4059 packets. 4060 * The use of the Session: header has been enhanced. Requests for 4061 multiple URLs may be sent in a single session. 4062 * There is a distinction between aggregate (presentation) URLs and 4063 stream URLs. Error codes have been added to reflect the fact that 4064 some methods may be allowed only on a particular type of URL. 4065 * Example showing the use of aggregate/presentation control using a 4066 single RTSP session has been added. 4068 * Support for the PEP (Protocol Extension Protocol) headers has been 4069 added. 4070 * Server-Client DESCRIBE messages have been renamed to ANNOUNCE for 4071 better clarity and differentiation. 4073 Note that this list does not reflect minor changes in wording or 4074 correction of typographical errors. 4076 Appendix F: Author Addresses 4078 Henning Schulzrinne 4079 Dept. of Computer Science 4080 Columbia University 4081 1214 Amsterdam Avenue 4082 New York, NY 10027 4083 USA 4084 electronic mail: schulzrinne@cs.columbia.edu 4086 Anup Rao 4087 Netscape Communications Corp. 4088 501 E. Middlefield Road 4089 Mountain View, CA 94043 4090 USA 4091 electronic mail: anup@netscape.com 4093 Robert Lanphier 4094 RealNetworks 4095 1111 Third Avenue Suite 2900 4096 Seattle, WA 98101 4097 USA 4098 electronic mail: robla@prognet.com 4100 Appendix G: Acknowledgements 4102 This draft is based on the functionality of the original RTSP draft 4103 submitted in October 96. It also borrows format and descriptions from 4104 HTTP/1.1. 4106 This document has benefited greatly from the comments of all those 4107 participating in the MMUSIC-WG. In addition to those already 4108 mentioned, the following individuals have contributed to this 4109 specification: 4111 Rahul Agarwal, Torsten Braun, Brent Browning, Bruce Butterfield, Ema 4112 Patki, Steve Casner, Francisco Cortes, Kelly Djahandari, Martin 4113 Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. Guruprasad, 4114 Peter Haight, Mark Handley, Brad Hefta-Gaub, John K. Ho, Philipp 4115 Hoschka, Anne Jones, Anders Klemets, Ruth Lang, Stephanie Leif, 4116 Jonathan Lennox, Eduardo F. Llach, Rob McCool, David Oran, Maria 4117 Papadopouli, Sujal Patel, Alagu Periyannan, Igor Plotnikov, Pinaki 4118 Shah, David Singer, Jeff Smith, Alexander Sokolsky, Dale Stammen, and 4119 John Francis Stracke. 4121 References 4123 1 H. Schulzrinne, ``RTP profile for audio and video conferences 4124 with minimal control,'' RFC 1890, Internet Engineering Task 4125 Force, Jan. 1996. 4127 2 F. Yergeau, G. Nicol, G. Adams, and M. Duerst, 4128 ``Internationalization of the hypertext markup language,'' RFC 4129 2070, Internet Engineering Task Force, Jan. 1997. 4131 3 S. Bradner, ``Key words for use in RFCs to indicate requirement 4132 levels,'' RFC 2119, Internet Engineering Task Force, Mar. 1997. 4134 4 R. Fielding, J. Gettys, J. Mogul, H. Nielsen, and T. 4135 Berners-Lee, ``Hypertext transfer protocol - HTTP/1.1,'' RFC 4136 2068, Internet Engineering Task Force, Jan. 1997. 4138 5 ISO/IEC, ``Information technology - generic coding of moving 4139 pictures and associated audio informaiton - part 6: extension 4140 for digital storage media and control,'' Draft International 4141 Standard ISO 13818-6, International Organization for 4142 Standardization ISO/IEC JTC1/SC29/WG11, Geneva, Switzerland, 4143 Nov. 1995. 4145 6 J. Franks, P. Hallam-Baker, and J. Hostetler, ``An extension to 4146 HTTP: digest access authentication,'' RFC 2069, Internet 4147 Engineering Task Force, Jan. 1997. 4149 7 J. Postel, ``User datagram protocol,'' RFC STD 6, 768, Internet 4150 Engineering Task Force, Aug. 1980. 4152 8 B. Hinden and C. Partridge, ``Version 2 of the reliable data 4153 protocol (RDP),'' RFC 1151, Internet Engineering Task Force, 4154 Apr. 1990. 4156 9 J. Postel, ``Transmission control protocol,'' RFC STD 7, 793, 4157 Internet Engineering Task Force, Sept. 1981. 4159 10 H. Schulzrinne, ``A comprehensive multimedia control 4160 architecture for the Internet,'' in Proc. International 4161 Workshop on Network and Operating System Support for Digital 4162 Audio and Video (NOSSDAV), (St. Louis, Missouri), May 1997. 4164 11 P. McMahon, ``GSS-API authentication method for SOCKS version 4165 5,'' RFC 1961, Internet Engineering Task Force, June 1996. 4167 12 J. Miller, P. Resnick, and D. Singer, ``Rating services and 4168 rating systems (and their machine readable descriptions),'' 4169 Recommendation REC-PICS-services-961031, W3C (World Wide Web 4170 Consortium), Boston, Massachusetts, Oct. 1996. 4172 13 J. Miller, T. Krauskopf, P. Resnick, and W. Treese, ``PICS 4173 label distribution label syntax and communication protocols,'' 4174 Recommendation REC-PICS-labels-961031, W3C (World Wide Web 4175 Consortium), Boston, Massachusetts, Oct. 1996. 4177 14 D. Crocker and P. Overell, ``Augmented BNF for syntax 4178 specifications: ABNF,'' RFC 2234, Internet Engineering Task 4179 Force, Nov. 1997. 4181 15 R. Elz, ``A compact representation of IPv6 addresses,'' RFC 4182 1924, Internet Engineering Task Force, Apr. 1996. 4184 16 T. Berners-Lee, L. Masinter, and M. McCahill, ``Uniform 4185 resource locators (URL),'' RFC 1738, Internet Engineering Task 4186 Force, Dec. 1994. 4188 17 International Telecommunication Union, ``Visual telephone 4189 systems and equipment for local area networks which provide a 4190 non-guaranteed quality of service,'' Recommendation H.323, 4191 Telecommunication Standardization Sector of ITU, Geneva, 4192 Switzerland, May 1996. 4194 18 W. R. Stevens, TCP/IP illustrated: the implementation, vol. 2. 4195 Reading, Massachusetts: Addison-Wesley, 1994. 4197 19 H. Schulzrinne, S. Casner, R. Frederick, and V. Jacobson, 4198 ``RTP: a transport protocol for real-time applications,'' RFC 4199 1889, Internet Engineering Task Force, Jan. 1996. 4201 20 R. Fielding, ``Relative uniform resource locators,'' RFC 1808, 4202 Internet Engineering Task Force, June 1995. 4204 Full Copyright Statement 4206 Copyright (C) The Internet Society (1997). All Rights Reserved. 4208 This document and translations of it may be copied and furnished to 4209 others, and derivative works that comment on or otherwise explain it 4210 or assist in its implmentation may be prepared, copied, published and 4211 distributed, in whole or in part, without restriction of any kind, 4212 provided that the above copyright notice and this paragraph are 4213 included on all such copies and derivative works. However, this 4214 document itself may not be modified in any way, such as by removing 4215 the copyright notice or references to the Internet Society or other 4216 Internet organizations, except as needed for the purpose of developing 4217 Internet standards in which case the procedures for copyrights defined 4218 in the Internet Standards process must be followed, or as required to 4219 translate it into languages other than English. 4221 The limited permissions granted above are perpetual and will not be 4222 revoked by the Internet Society or its successors or assigns. 4224 This document and the information contained herein is provided on an 4225 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 4226 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT 4227 NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN 4228 WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 4229 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.