idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-23.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? -- The draft header indicates that this document obsoletes RFC2326, but the abstract doesn't seem to directly say this. It does mention RFC2326 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 8, 2010) is 5161 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'H10' is mentioned on line 4051, but not defined == Missing Reference: 'H15' is mentioned on line 8588, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 9025, but not defined == Missing Reference: 'CSeq' is mentioned on line 12098, but not defined == Missing Reference: 'Timestamp' is mentioned on line 12100, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. '3gpp-26234' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-pub-180-2' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3851 (Obsoleted by RFC 5751) ** Obsolete normative reference: RFC 4288 (Obsoleted by RFC 6838) ** Obsolete normative reference: RFC 4395 (Obsoleted by RFC 7595) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-22) exists of draft-ietf-mmusic-rtsp-nat-09 -- Obsolete informational reference (is this intentional?): RFC 822 (Obsoleted by RFC 2822) -- Obsolete informational reference (is this intentional?): RFC 1305 (Obsoleted by RFC 5905) -- Obsolete informational reference (is this intentional?): RFC 1644 (Obsoleted by RFC 6247) -- Obsolete informational reference (is this intentional?): RFC 2068 (Obsoleted by RFC 2616) -- Obsolete informational reference (is this intentional?): RFC 2326 (Obsoleted by RFC 7826) -- Obsolete informational reference (is this intentional?): RFC 3388 (Obsoleted by RFC 5888) Summary: 11 errors (**), 0 flaws (~~), 9 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MMUSIC Working Group H. Schulzrinne 3 Internet-Draft Columbia University 4 Obsoletes: 2326 (if approved) A. Rao 5 Intended status: Standards Track Cisco 6 Expires: September 9, 2010 R. Lanphier 7 M. Westerlund 8 Ericsson AB 9 M. Stiemerling (Ed.) 10 NEC 11 March 8, 2010 13 Real Time Streaming Protocol 2.0 (RTSP) 14 draft-ietf-mmusic-rfc2326bis-23 16 Abstract 18 This memorandum defines RTSP version 2.0 which obsoletes RTSP version 19 1.0 which is defined in RFC 2326. 21 The Real Time Streaming Protocol, or RTSP, is an application-level 22 protocol for setup and control of the delivery of data with real-time 23 properties. RTSP provides an extensible framework to enable 24 controlled, on-demand delivery of real-time data, such as audio and 25 video. Sources of data can include both live data feeds and stored 26 clips. This protocol is intended to control multiple data delivery 27 sessions, provide a means for choosing delivery channels such as UDP, 28 multicast UDP and TCP, and provide a means for choosing delivery 29 mechanisms based upon RTP (RFC 3550). 31 Status of this Memo 33 This Internet-Draft is submitted to IETF in full conformance with the 34 provisions of BCP 78 and BCP 79. 36 Internet-Drafts are working documents of the Internet Engineering 37 Task Force (IETF), its areas, and its working groups. Note that 38 other groups may also distribute working documents as Internet- 39 Drafts. 41 Internet-Drafts are draft documents valid for a maximum of six months 42 and may be updated, replaced, or obsoleted by other documents at any 43 time. It is inappropriate to use Internet-Drafts as reference 44 material or to cite them other than as "work in progress." 46 The list of current Internet-Drafts can be accessed at 47 http://www.ietf.org/ietf/1id-abstracts.txt. 49 The list of Internet-Draft Shadow Directories can be accessed at 50 http://www.ietf.org/shadow.html. 52 This Internet-Draft will expire on September 9, 2010. 54 Copyright Notice 56 Copyright (c) 2010 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (http://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the BSD License. 69 This document may contain material from IETF Documents or IETF 70 Contributions published or made publicly available before November 71 10, 2008. The person(s) controlling the copyright in some of this 72 material may not have granted the IETF Trust the right to allow 73 modifications of such material outside the IETF Standards Process. 74 Without obtaining an adequate license from the person(s) controlling 75 the copyright in such materials, this document may not be modified 76 outside the IETF Standards Process, and derivative works of it may 77 not be created outside the IETF Standards Process, except to format 78 it for publication as an RFC or to translate it into languages other 79 than English. 81 Table of Contents 83 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 10 84 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 11 85 2.1. Presentation Description . . . . . . . . . . . . . . . . 11 86 2.2. Session Establishment . . . . . . . . . . . . . . . . . 12 87 2.3. Media Delivery Control . . . . . . . . . . . . . . . . . 13 88 2.4. Session Parameter Manipulations . . . . . . . . . . . . 15 89 2.5. Media Delivery . . . . . . . . . . . . . . . . . . . . . 15 90 2.5.1. Media Delivery Manipulations . . . . . . . . . . . . 16 91 2.6. Session Maintenance and Termination . . . . . . . . . . 18 92 2.7. Extending RTSP . . . . . . . . . . . . . . . . . . . . . 19 93 3. Document Conventions . . . . . . . . . . . . . . . . . . . . 21 94 3.1. Notational Conventions . . . . . . . . . . . . . . . . . 21 95 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . 21 96 4. Protocol Parameters . . . . . . . . . . . . . . . . . . . . . 25 97 4.1. RTSP Version . . . . . . . . . . . . . . . . . . . . . . 25 98 4.2. RTSP IRI and URI . . . . . . . . . . . . . . . . . . . . 25 99 4.3. Session Identifiers . . . . . . . . . . . . . . . . . . 27 100 4.4. SMPTE Relative Timestamps . . . . . . . . . . . . . . . 27 101 4.5. Normal Play Time . . . . . . . . . . . . . . . . . . . . 28 102 4.6. Absolute Time . . . . . . . . . . . . . . . . . . . . . 29 103 4.7. Feature-Tags . . . . . . . . . . . . . . . . . . . . . . 29 104 4.8. Message Body Tags . . . . . . . . . . . . . . . . . . . 29 105 4.9. Media Properties . . . . . . . . . . . . . . . . . . . . 30 106 4.9.1. Random Access and Seeking . . . . . . . . . . . . . 31 107 4.9.2. Retention . . . . . . . . . . . . . . . . . . . . . 31 108 4.9.3. Content Modifications . . . . . . . . . . . . . . . 32 109 4.9.4. Supported Scale Factors . . . . . . . . . . . . . . 32 110 4.9.5. Mapping to the Attributes . . . . . . . . . . . . . 32 111 5. RTSP Message . . . . . . . . . . . . . . . . . . . . . . . . 34 112 5.1. Message Types . . . . . . . . . . . . . . . . . . . . . 34 113 5.2. Message Headers . . . . . . . . . . . . . . . . . . . . 35 114 5.3. Message Body . . . . . . . . . . . . . . . . . . . . . . 35 115 5.4. Message Length . . . . . . . . . . . . . . . . . . . . . 36 116 6. General Header Fields . . . . . . . . . . . . . . . . . . . . 37 117 7. Request . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 118 7.1. Request Line . . . . . . . . . . . . . . . . . . . . . . 38 119 7.2. Request Header Fields . . . . . . . . . . . . . . . . . 40 120 8. Response . . . . . . . . . . . . . . . . . . . . . . . . . . 42 121 8.1. Status-Line . . . . . . . . . . . . . . . . . . . . . . 42 122 8.1.1. Status Code and Reason Phrase . . . . . . . . . . . 42 123 8.2. Response Headers . . . . . . . . . . . . . . . . . . . . 45 124 9. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 47 125 9.1. Message-Body Header Fields . . . . . . . . . . . . . . . 47 126 9.2. Message Body . . . . . . . . . . . . . . . . . . . . . . 48 127 10. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 49 128 10.1. Reliability and Acknowledgements . . . . . . . . . . . . 49 129 10.2. Using Connections . . . . . . . . . . . . . . . . . . . 50 130 10.3. Closing Connections . . . . . . . . . . . . . . . . . . 52 131 10.4. Timing Out Connections and RTSP Messages . . . . . . . . 53 132 10.5. Showing Liveness . . . . . . . . . . . . . . . . . . . . 53 133 10.6. Use of IPv6 . . . . . . . . . . . . . . . . . . . . . . 54 134 11. Capability Handling . . . . . . . . . . . . . . . . . . . . . 55 135 12. Pipelining Support . . . . . . . . . . . . . . . . . . . . . 57 136 13. Method Definitions . . . . . . . . . . . . . . . . . . . . . 58 137 13.1. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . 59 138 13.2. DESCRIBE . . . . . . . . . . . . . . . . . . . . . . . . 60 139 13.3. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . 62 140 13.3.1. Changing Transport Parameters . . . . . . . . . . . 65 141 13.4. PLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 66 142 13.4.1. General Usage . . . . . . . . . . . . . . . . . . . 66 143 13.4.2. Aggregated Sessions . . . . . . . . . . . . . . . . 71 144 13.4.3. Updating current PLAY Requests . . . . . . . . . . . 72 145 13.4.4. Playing On-Demand Media . . . . . . . . . . . . . . 73 146 13.4.5. Playing Dynamic On-Demand Media . . . . . . . . . . 74 147 13.4.6. Playing Live Media . . . . . . . . . . . . . . . . . 74 148 13.4.7. Playing Live with Recording . . . . . . . . . . . . 75 149 13.4.8. Playing Live with Time-Shift . . . . . . . . . . . . 75 150 13.5. PLAY_NOTIFY . . . . . . . . . . . . . . . . . . . . . . 76 151 13.5.1. End-of-Stream . . . . . . . . . . . . . . . . . . . 77 152 13.5.2. Media-Properties-Update . . . . . . . . . . . . . . 78 153 13.5.3. Scale-Change . . . . . . . . . . . . . . . . . . . . 79 154 13.6. PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 80 155 13.7. TEARDOWN . . . . . . . . . . . . . . . . . . . . . . . . 83 156 13.7.1. Client to Server . . . . . . . . . . . . . . . . . . 83 157 13.7.2. Server to Client . . . . . . . . . . . . . . . . . . 84 158 13.8. GET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 85 159 13.9. SET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 86 160 13.10. REDIRECT . . . . . . . . . . . . . . . . . . . . . . . . 88 161 14. Embedded (Interleaved) Binary Data . . . . . . . . . . . . . 91 162 15. Status Code Definitions . . . . . . . . . . . . . . . . . . . 93 163 15.1. Success 1xx . . . . . . . . . . . . . . . . . . . . . . 93 164 15.1.1. 100 Continue . . . . . . . . . . . . . . . . . . . . 93 165 15.2. Success 2xx . . . . . . . . . . . . . . . . . . . . . . 93 166 15.2.1. 200 OK . . . . . . . . . . . . . . . . . . . . . . . 93 167 15.3. Redirection 3xx . . . . . . . . . . . . . . . . . . . . 93 168 15.3.1. 301 Moved Permanently . . . . . . . . . . . . . . . 94 169 15.3.2. 302 Found . . . . . . . . . . . . . . . . . . . . . 94 170 15.3.3. 303 See Other . . . . . . . . . . . . . . . . . . . 94 171 15.3.4. 304 Not Modified . . . . . . . . . . . . . . . . . . 94 172 15.3.5. 305 Use Proxy . . . . . . . . . . . . . . . . . . . 95 173 15.4. Client Error 4xx . . . . . . . . . . . . . . . . . . . . 95 174 15.4.1. 400 Bad Request . . . . . . . . . . . . . . . . . . 95 175 15.4.2. 401 Unauthorized . . . . . . . . . . . . . . . . . . 95 176 15.4.3. 402 Payment Required . . . . . . . . . . . . . . . . 96 177 15.4.4. 403 Forbidden . . . . . . . . . . . . . . . . . . . 96 178 15.4.5. 404 Not Found . . . . . . . . . . . . . . . . . . . 96 179 15.4.6. 405 Method Not Allowed . . . . . . . . . . . . . . . 96 180 15.4.7. 406 Not Acceptable . . . . . . . . . . . . . . . . . 96 181 15.4.8. 407 Proxy Authentication Required . . . . . . . . . 97 182 15.4.9. 408 Request Timeout . . . . . . . . . . . . . . . . 97 183 15.4.10. 410 Gone . . . . . . . . . . . . . . . . . . . . . . 97 184 15.4.11. 411 Length Required . . . . . . . . . . . . . . . . 97 185 15.4.12. 412 Precondition Failed . . . . . . . . . . . . . . 98 186 15.4.13. 413 Request Message Body Too Large . . . . . . . . . 98 187 15.4.14. 414 Request-URI Too Long . . . . . . . . . . . . . . 98 188 15.4.15. 415 Unsupported Media Type . . . . . . . . . . . . . 98 189 15.4.16. 451 Parameter Not Understood . . . . . . . . . . . . 98 190 15.4.17. 452 reserved . . . . . . . . . . . . . . . . . . . . 98 191 15.4.18. 453 Not Enough Bandwidth . . . . . . . . . . . . . . 99 192 15.4.19. 454 Session Not Found . . . . . . . . . . . . . . . 99 193 15.4.20. 455 Method Not Valid in This State . . . . . . . . . 99 194 15.4.21. 456 Header Field Not Valid for Resource . . . . . . 99 195 15.4.22. 457 Invalid Range . . . . . . . . . . . . . . . . . 99 196 15.4.23. 458 Parameter Is Read-Only . . . . . . . . . . . . . 99 197 15.4.24. 459 Aggregate Operation Not Allowed . . . . . . . . 99 198 15.4.25. 460 Only Aggregate Operation Allowed . . . . . . . . 99 199 15.4.26. 461 Unsupported Transport . . . . . . . . . . . . . 100 200 15.4.27. 462 Destination Unreachable . . . . . . . . . . . . 100 201 15.4.28. 463 Destination Prohibited . . . . . . . . . . . . . 100 202 15.4.29. 464 Data Transport Not Ready Yet . . . . . . . . . . 100 203 15.4.30. 465 Notification Reason Unknown . . . . . . . . . . 100 204 15.4.31. 470 Connection Authorization Required . . . . . . . 100 205 15.4.32. 471 Connection Credentials not accepted . . . . . . 101 206 15.4.33. 472 Failure to establish secure connection . . . . . 101 207 15.5. Server Error 5xx . . . . . . . . . . . . . . . . . . . . 101 208 15.5.1. 500 Internal Server Error . . . . . . . . . . . . . 101 209 15.5.2. 501 Not Implemented . . . . . . . . . . . . . . . . 101 210 15.5.3. 502 Bad Gateway . . . . . . . . . . . . . . . . . . 101 211 15.5.4. 503 Service Unavailable . . . . . . . . . . . . . . 101 212 15.5.5. 504 Gateway Timeout . . . . . . . . . . . . . . . . 102 213 15.5.6. 505 RTSP Version Not Supported . . . . . . . . . . . 102 214 15.5.7. 551 Option not supported . . . . . . . . . . . . . . 102 215 16. Header Field Definitions . . . . . . . . . . . . . . . . . . 103 216 16.1. Accept . . . . . . . . . . . . . . . . . . . . . . . . . 113 217 16.2. Accept-Credentials . . . . . . . . . . . . . . . . . . . 113 218 16.3. Accept-Encoding . . . . . . . . . . . . . . . . . . . . 114 219 16.4. Accept-Language . . . . . . . . . . . . . . . . . . . . 115 220 16.5. Accept-Ranges . . . . . . . . . . . . . . . . . . . . . 116 221 16.6. Allow . . . . . . . . . . . . . . . . . . . . . . . . . 116 222 16.7. Authorization . . . . . . . . . . . . . . . . . . . . . 116 223 16.8. Bandwidth . . . . . . . . . . . . . . . . . . . . . . . 117 224 16.9. Blocksize . . . . . . . . . . . . . . . . . . . . . . . 117 225 16.10. Cache-Control . . . . . . . . . . . . . . . . . . . . . 118 226 16.11. Connection . . . . . . . . . . . . . . . . . . . . . . . 120 227 16.12. Connection-Credentials . . . . . . . . . . . . . . . . . 121 228 16.13. Content-Base . . . . . . . . . . . . . . . . . . . . . . 122 229 16.14. Content-Encoding . . . . . . . . . . . . . . . . . . . . 122 230 16.15. Content-Language . . . . . . . . . . . . . . . . . . . . 123 231 16.16. Content-Length . . . . . . . . . . . . . . . . . . . . . 123 232 16.17. Content-Location . . . . . . . . . . . . . . . . . . . . 124 233 16.18. Content-Type . . . . . . . . . . . . . . . . . . . . . . 124 234 16.19. CSeq . . . . . . . . . . . . . . . . . . . . . . . . . . 124 235 16.20. Date . . . . . . . . . . . . . . . . . . . . . . . . . . 125 236 16.21. Expires . . . . . . . . . . . . . . . . . . . . . . . . 126 237 16.22. From . . . . . . . . . . . . . . . . . . . . . . . . . . 127 238 16.23. If-Match . . . . . . . . . . . . . . . . . . . . . . . . 127 239 16.24. If-Modified-Since . . . . . . . . . . . . . . . . . . . 127 240 16.25. If-None-Match . . . . . . . . . . . . . . . . . . . . . 128 241 16.26. Last-Modified . . . . . . . . . . . . . . . . . . . . . 129 242 16.27. Location . . . . . . . . . . . . . . . . . . . . . . . . 129 243 16.28. Media-Properties . . . . . . . . . . . . . . . . . . . . 129 244 16.29. Media-Range . . . . . . . . . . . . . . . . . . . . . . 131 245 16.30. MTag . . . . . . . . . . . . . . . . . . . . . . . . . . 132 246 16.31. Notify-Reason . . . . . . . . . . . . . . . . . . . . . 132 247 16.32. Pipelined-Requests . . . . . . . . . . . . . . . . . . . 133 248 16.33. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . 134 249 16.34. Proxy-Authorization . . . . . . . . . . . . . . . . . . 134 250 16.35. Proxy-Require . . . . . . . . . . . . . . . . . . . . . 134 251 16.36. Proxy-Supported . . . . . . . . . . . . . . . . . . . . 135 252 16.37. Public . . . . . . . . . . . . . . . . . . . . . . . . . 136 253 16.38. Range . . . . . . . . . . . . . . . . . . . . . . . . . 136 254 16.39. Referrer . . . . . . . . . . . . . . . . . . . . . . . . 138 255 16.40. Request-Status . . . . . . . . . . . . . . . . . . . . . 139 256 16.41. Require . . . . . . . . . . . . . . . . . . . . . . . . 139 257 16.42. Retry-After . . . . . . . . . . . . . . . . . . . . . . 140 258 16.43. RTP-Info . . . . . . . . . . . . . . . . . . . . . . . . 140 259 16.44. Scale . . . . . . . . . . . . . . . . . . . . . . . . . 143 260 16.45. Seek-Style . . . . . . . . . . . . . . . . . . . . . . . 144 261 16.46. Server . . . . . . . . . . . . . . . . . . . . . . . . . 145 262 16.47. Session . . . . . . . . . . . . . . . . . . . . . . . . 146 263 16.48. Speed . . . . . . . . . . . . . . . . . . . . . . . . . 147 264 16.49. Supported . . . . . . . . . . . . . . . . . . . . . . . 148 265 16.50. Terminate-Reason . . . . . . . . . . . . . . . . . . . . 148 266 16.51. Timestamp . . . . . . . . . . . . . . . . . . . . . . . 149 267 16.52. Transport . . . . . . . . . . . . . . . . . . . . . . . 149 268 16.53. Unsupported . . . . . . . . . . . . . . . . . . . . . . 156 269 16.54. User-Agent . . . . . . . . . . . . . . . . . . . . . . . 156 270 16.55. Vary . . . . . . . . . . . . . . . . . . . . . . . . . . 157 271 16.56. Via . . . . . . . . . . . . . . . . . . . . . . . . . . 157 272 16.57. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . 158 274 17. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 275 17.1. Proxies and Protocol Extensions . . . . . . . . . . . . 160 276 17.2. Multiplexing and Demultiplexing of Messages . . . . . . 161 277 18. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 278 18.1. Validation Model . . . . . . . . . . . . . . . . . . . . 162 279 18.1.1. Last-Modified Dates . . . . . . . . . . . . . . . . 164 280 18.1.2. Message Body Tag Cache Validators . . . . . . . . . 164 281 18.1.3. Weak and Strong Validators . . . . . . . . . . . . . 164 282 18.1.4. Rules for When to Use Message Body Tags and 283 Last-Modified Dates . . . . . . . . . . . . . . . . 166 284 18.1.5. Non-validating Conditionals . . . . . . . . . . . . 168 285 18.2. Invalidation After Updates or Deletions . . . . . . . . 168 286 19. Security Framework . . . . . . . . . . . . . . . . . . . . . 170 287 19.1. RTSP and HTTP Authentication . . . . . . . . . . . . . . 170 288 19.2. RTSP over TLS . . . . . . . . . . . . . . . . . . . . . 170 289 19.3. Security and Proxies . . . . . . . . . . . . . . . . . . 171 290 19.3.1. Accept-Credentials . . . . . . . . . . . . . . . . . 172 291 19.3.2. User approved TLS procedure . . . . . . . . . . . . 173 292 20. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 293 20.1. Base Syntax . . . . . . . . . . . . . . . . . . . . . . 176 294 20.2. RTSP Protocol Definition . . . . . . . . . . . . . . . . 178 295 20.2.1. Generic Protocol elements . . . . . . . . . . . . . 178 296 20.2.2. Message Syntax . . . . . . . . . . . . . . . . . . . 181 297 20.2.3. Header Syntax . . . . . . . . . . . . . . . . . . . 185 298 20.3. SDP extension Syntax . . . . . . . . . . . . . . . . . . 194 299 21. Security Considerations . . . . . . . . . . . . . . . . . . . 195 300 21.1. Remote denial of Service Attack . . . . . . . . . . . . 197 301 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 199 302 22.1. Feature-tags . . . . . . . . . . . . . . . . . . . . . . 199 303 22.1.1. Description . . . . . . . . . . . . . . . . . . . . 199 304 22.1.2. Registering New Feature-tags with IANA . . . . . . . 200 305 22.1.3. Registered entries . . . . . . . . . . . . . . . . . 200 306 22.2. RTSP Methods . . . . . . . . . . . . . . . . . . . . . . 200 307 22.2.1. Description . . . . . . . . . . . . . . . . . . . . 200 308 22.2.2. Registering New Methods with IANA . . . . . . . . . 201 309 22.2.3. Registered Entries . . . . . . . . . . . . . . . . . 201 310 22.3. RTSP Status Codes . . . . . . . . . . . . . . . . . . . 201 311 22.3.1. Description . . . . . . . . . . . . . . . . . . . . 201 312 22.3.2. Registering New Status Codes with IANA . . . . . . . 202 313 22.3.3. Registered Entries . . . . . . . . . . . . . . . . . 202 314 22.4. RTSP Headers . . . . . . . . . . . . . . . . . . . . . . 202 315 22.4.1. Description . . . . . . . . . . . . . . . . . . . . 202 316 22.4.2. Registering New Headers with IANA . . . . . . . . . 202 317 22.4.3. Registered entries . . . . . . . . . . . . . . . . . 203 318 22.5. Accept-Credentials . . . . . . . . . . . . . . . . . . . 203 319 22.5.1. Accept-Credentials policies . . . . . . . . . . . . 203 320 22.5.2. Accept-Credentials hash algorithms . . . . . . . . . 204 321 22.6. Cache-Control Cache Directive Extensions . . . . . . . . 204 322 22.7. Media Properties . . . . . . . . . . . . . . . . . . . . 205 323 22.7.1. Description . . . . . . . . . . . . . . . . . . . . 205 324 22.7.2. Registration Rules . . . . . . . . . . . . . . . . . 205 325 22.7.3. Registered Values . . . . . . . . . . . . . . . . . 206 326 22.8. Notify-Reason header . . . . . . . . . . . . . . . . . . 206 327 22.8.1. Description . . . . . . . . . . . . . . . . . . . . 206 328 22.8.2. Registration Rules . . . . . . . . . . . . . . . . . 206 329 22.8.3. Registered Values . . . . . . . . . . . . . . . . . 207 330 22.9. Range header formats . . . . . . . . . . . . . . . . . . 207 331 22.9.1. Description . . . . . . . . . . . . . . . . . . . . 207 332 22.9.2. Registration Rules . . . . . . . . . . . . . . . . . 207 333 22.9.3. Registered Values . . . . . . . . . . . . . . . . . 207 334 22.10. Terminate-Reason Header . . . . . . . . . . . . . . . . 208 335 22.10.1. Redirect Reasons . . . . . . . . . . . . . . . . . . 208 336 22.10.2. Terminate-Reason Header Parameters . . . . . . . . . 208 337 22.11. RTP-Info header parameters . . . . . . . . . . . . . . . 208 338 22.11.1. Description . . . . . . . . . . . . . . . . . . . . 208 339 22.11.2. Registration Rules . . . . . . . . . . . . . . . . . 209 340 22.11.3. Registered Values . . . . . . . . . . . . . . . . . 209 341 22.12. Seek-Style Policies . . . . . . . . . . . . . . . . . . 209 342 22.12.1. Description . . . . . . . . . . . . . . . . . . . . 209 343 22.12.2. Registration Rules . . . . . . . . . . . . . . . . . 209 344 22.12.3. Registered Values . . . . . . . . . . . . . . . . . 210 345 22.13. Transport Header Registries . . . . . . . . . . . . . . 210 346 22.13.1. Transport Protocol Specification . . . . . . . . . . 210 347 22.13.2. Transport modes . . . . . . . . . . . . . . . . . . 211 348 22.13.3. Transport Parameters . . . . . . . . . . . . . . . . 212 349 22.14. URI Schemes . . . . . . . . . . . . . . . . . . . . . . 212 350 22.14.1. The rtsp URI Scheme . . . . . . . . . . . . . . . . 212 351 22.14.2. The rtsps URI Scheme . . . . . . . . . . . . . . . . 213 352 22.14.3. The rtspu URI Scheme . . . . . . . . . . . . . . . . 214 353 22.15. SDP attributes . . . . . . . . . . . . . . . . . . . . . 215 354 22.16. Media Type Registration for text/parameters . . . . . . 216 355 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 218 356 23.1. Normative References . . . . . . . . . . . . . . . . . . 218 357 23.2. Informative References . . . . . . . . . . . . . . . . . 220 358 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 223 359 A.1. Media on Demand (Unicast) . . . . . . . . . . . . . . . 223 360 A.2. Media on Demand using Pipelining . . . . . . . . . . . . 227 361 A.3. Media on Demand (Unicast) . . . . . . . . . . . . . . . 229 362 A.4. Single Stream Container Files . . . . . . . . . . . . . 233 363 A.5. Live Media Presentation Using Multicast . . . . . . . . 235 364 A.6. Capability Negotiation . . . . . . . . . . . . . . . . . 236 365 Appendix B. RTSP Protocol State Machine . . . . . . . . . . . . 238 366 B.1. States . . . . . . . . . . . . . . . . . . . . . . . . . 238 367 B.2. State variables . . . . . . . . . . . . . . . . . . . . 238 368 B.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . 238 369 B.4. State Tables . . . . . . . . . . . . . . . . . . . . . . 239 371 Appendix C. Media Transport Alternatives . . . . . . . . . . . . 245 372 C.1. RTP . . . . . . . . . . . . . . . . . . . . . . . . . . 245 373 C.1.1. AVP . . . . . . . . . . . . . . . . . . . . . . . . 245 374 C.1.2. AVP/UDP . . . . . . . . . . . . . . . . . . . . . . 245 375 C.1.3. AVPF/UDP . . . . . . . . . . . . . . . . . . . . . . 246 376 C.1.4. SAVP/UDP . . . . . . . . . . . . . . . . . . . . . . 247 377 C.1.5. SAVPF/UDP . . . . . . . . . . . . . . . . . . . . . 247 378 C.1.6. RTCP usage with RTSP . . . . . . . . . . . . . . . . 247 379 C.2. RTP over TCP . . . . . . . . . . . . . . . . . . . . . . 248 380 C.2.1. Interleaved RTP over TCP . . . . . . . . . . . . . . 249 381 C.2.2. RTP over independent TCP . . . . . . . . . . . . . . 249 382 C.3. Handling Media Clock Time Jumps in the RTP Media Layer . 253 383 C.4. Handling RTP Timestamps after PAUSE . . . . . . . . . . 257 384 C.5. RTSP / RTP Integration . . . . . . . . . . . . . . . . . 259 385 C.6. Scaling with RTP . . . . . . . . . . . . . . . . . . . . 259 386 C.7. Maintaining NPT synchronization with RTP timestamps . . 259 387 C.8. Continuous Audio . . . . . . . . . . . . . . . . . . . . 259 388 C.9. Multiple Sources in an RTP Session . . . . . . . . . . . 259 389 C.10. Usage of SSRCs and the RTCP BYE Message During an 390 RTSP Session . . . . . . . . . . . . . . . . . . . . . . 259 391 C.11. Future Additions . . . . . . . . . . . . . . . . . . . . 260 392 Appendix D. Use of SDP for RTSP Session Descriptions . . . . . . 261 393 D.1. Definitions . . . . . . . . . . . . . . . . . . . . . . 261 394 D.1.1. Control URI . . . . . . . . . . . . . . . . . . . . 261 395 D.1.2. Media Streams . . . . . . . . . . . . . . . . . . . 262 396 D.1.3. Payload Type(s) . . . . . . . . . . . . . . . . . . 263 397 D.1.4. Format-Specific Parameters . . . . . . . . . . . . . 263 398 D.1.5. Directionality of media stream . . . . . . . . . . . 263 399 D.1.6. Range of Presentation . . . . . . . . . . . . . . . 264 400 D.1.7. Time of Availability . . . . . . . . . . . . . . . . 265 401 D.1.8. Connection Information . . . . . . . . . . . . . . . 265 402 D.1.9. Message Body Tag . . . . . . . . . . . . . . . . . . 265 403 D.2. Aggregate Control Not Available . . . . . . . . . . . . 266 404 D.3. Aggregate Control Available . . . . . . . . . . . . . . 266 405 D.4. Grouping of Media Lines in SDP . . . . . . . . . . . . . 267 406 D.5. RTSP external SDP delivery . . . . . . . . . . . . . . . 268 407 Appendix E. RTSP Use Cases . . . . . . . . . . . . . . . . . . . 269 408 E.1. On-demand Playback of Stored Content . . . . . . . . . . 269 409 E.2. Unicast Distribution of Live Content . . . . . . . . . . 270 410 E.3. On-demand Playback using Multicast . . . . . . . . . . . 271 411 E.4. Inviting an RTSP server into a conference . . . . . . . 271 412 E.5. Live Content using Multicast . . . . . . . . . . . . . . 272 413 Appendix F. Text format for Parameters . . . . . . . . . . . . . 274 414 Appendix G. Requirements for Unreliable Transport of RTSP . . . 275 415 Appendix H. Backwards Compatibility Considerations . . . . . . . 277 416 H.1. Play Request in Play mode . . . . . . . . . . . . . . . 277 417 H.2. Using Persistent Connections . . . . . . . . . . . . . . 277 418 Appendix I. Open Issues . . . . . . . . . . . . . . . . . . . . 278 419 Appendix J. Changes . . . . . . . . . . . . . . . . . . . . . . 279 420 J.1. Brief Overview . . . . . . . . . . . . . . . . . . . . . 279 421 J.2. Detailed List of Changes . . . . . . . . . . . . . . . . 280 422 Appendix K. Acknowledgements . . . . . . . . . . . . . . . . . . 287 423 K.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 287 424 Appendix L. RFC Editor Consideration . . . . . . . . . . . . . . 289 425 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 290 427 1. Introduction 429 This memo defines version 2.0 of the Real Time Streaming Protocol 430 (RTSP 2.0). RTSP 2.0 is an application-level protocol for setup and 431 control over the delivery of data with real-time properties, 432 typically streaming media. Streaming media is, for instance, video 433 on demand or audio live streaming. Put simply, RTSP acts as a 434 "network remote control" for multimedia servers, as you know it from 435 your TV set. 437 The protocol operates between RTSP 2.0 clients and servers, but also 438 supports the usage of proxies placed between clients and servers. 439 Clients can request information about streaming media from servers, 440 by asking for a description of the media or use media description 441 provided externally. Then the media delivery protocol is used to 442 establish the media streams described by the media description. 443 Clients can then request to play out the media, pause it, or stop it 444 completely, as known from a regular DVD player remote control. The 445 requested media can consist of multiple audio and video streams that 446 are delivered as a time-synchronized streams from servers to clients. 448 RTSP 2.0 is an replacement of RTSP 1.0 [RFC2326] that obsoletes that 449 specification. This protocol is based on RTSP 1.0 but not backwards 450 compatible other than in the basic version negotiation mechanism. 451 The changes are documented in Appendix J. There are many reasons why 452 RTSP 2.0 can't be backwards compatible with RTSP 1.0 but some of the 453 main ones are; that most header that needed to be extensible did not 454 define the allowed syntax preventing safe deployment of extensions; 455 the changed behavior of the PLAY method when received in playing 456 state; changed behavior of the extensibility model and its mechanism; 457 the change of syntax for some headers. The summary is that there are 458 so many small details that changing version become necessary to 459 enable clarification and consistent behavior. 461 This document is structured in the way that it begins with an 462 overview of the protocol operations and its functions in an informal 463 way. Then a set of definitions of used terms and document 464 conventions is introduced. Then comes the actual protocol 465 specification. In the appendix some functionality that isn't core 466 RTSP defined, but still important to enable some usage, like RTP 467 Appendix C and SDP usage with RTSP Appendix D, making these two 468 appendixes mandatory. This is followed by a number of informational 469 parts discussing the changes, use cases, different considerations or 470 motivations. 472 2. Protocol Overview 474 This section provides a informative overview of the different 475 mechanisms in the RTSP 2.0 protocol, to give the reader a high level 476 understanding before getting into all the different details. In case 477 of conflict with this description and the later sections, the later 478 sections take precedence. For more information about considered use 479 cases for RTSP see Appendix E. 481 RTSP 2.0 is a bi-directional request and response protocol that first 482 establish a context including content resources (the media) and then 483 controls the delivery of these content resources from the server to 484 the client. RTSP has three fundamental parts of interest: Session 485 Establishment, Media Delivery Control, and an extensibility model 486 described below. The protocol is based on some assumptions on 487 existing functionality to provide a complete solution for client 488 controlled real-time media delivery. 490 RTSP uses text-based messages, requests and responses, that may 491 contain a binary message body. An RTSP request starts with a method 492 line that identifies the method, the protocol and version and the 493 resource to act on. Following the method line follows a number of 494 RTSP headers. This part is ended by two consecutive carriage return 495 line feed (CRLF) character pairs. The message body if present 496 follows the two CRLF and the bodies length are described by a message 497 header. RTSP responses are similar, but start with a response line 498 with protocol and version, followed by a status code and a reason 499 phrase. RTSP messages are sent over a reliable transport protocol 500 between the client and server. RTSP 2.0 requires clients and servers 501 to implement TCP, and TLS over TCP, as mandatory transports for RTSP 502 messages. 504 2.1. Presentation Description 506 RTSP exists to provide access to multi-media presentations and 507 content, but tries to be agnostic to the media type or the actual 508 media delivery protocol that is used. To enable a client to 509 implement a complete system, an RTSP-external mechanism for 510 describing the presentation and the delivery protocol(s) is used. 511 RTSP assumes that this description is either delivered completely out 512 of bands or as a data object in the response to a client's request 513 using the DESCRIBE method (Section 13.2). 515 Parameters that commonly have to be included in the Content 516 Description are the following: 518 o Number of media streams 519 o The resource identifier for each media stream/resource that is to 520 be controlled by RTSP 522 o The protocol that each media stream is to be delivered over 524 o Transport protocol parameters that are not negotiated or varies 525 with each client 527 o Media encoding information enabling client to correctly decode it 528 upon reception 530 o An aggregate control resource identifier 532 RTSP uses its own URI schemes ("rtsp" and "rtsps") to reference media 533 resources and aggregates under common control. 535 This specification describes in Appendix D how one uses SDP [RFC4566] 536 for Content Description 538 2.2. Session Establishment 540 The RTSP client can request the establishment of an RTSP session 541 after having used the presentation description to determine which 542 media streams are available, and also which media delivery protocol 543 is used and their particular resource identifiers. The RTSP session 544 is a common context between the client and the server that consist of 545 one or more media resource that is to be under common media delivery 546 control. 548 The client creates an RTSP session by sending an request using the 549 SETUP method (Section 13.3) to the server. In the SETUP request the 550 client also includes all the transport parameter necessary to enable 551 the media delivery protocol to function in the "Transport" header 552 (Section 16.52). This includes parameters that are pre-established 553 by the presentation description but necessary for any middlebox to 554 correctly handle the media delivery protocols. The Transport header 555 in a request may contain multiple alternatives for media delivery in 556 a prioritized list, which the server can select from. These 557 alternatives are typically based on information in the content 558 description. 560 The server determines if the media resource is available upon 561 receiving a SETUP request and if any of the transport parameter 562 specifications are acceptable. If that is successful, an RTSP 563 session context is created and the relevant parameters and state is 564 stored. An identifier is created for the RTSP session and included 565 in the response in the Session header (Section 16.47). The SETUP 566 response includes a Transport header that specifies which of the 567 alternatives that have been selected and relevant parameters. 569 A SETUP request that references an existing RTSP session but 570 identifies a new media resource is a request to add that media 571 resource under common control with the already present media 572 resources in an aggregated session. A client can expect this to work 573 for all media resources under RTSP control within a multi-media 574 content. However, aggregating resources from different content are 575 likely to be refused by the server. The RTSP session as aggregate is 576 referenced by the aggregate control URI, even if the RTSP session 577 only contains a single media. 579 To avoid an extra round trip in the session establishment of 580 aggregated RTSP sessions, RTSP 2.0 supports pipelined requests, i.e., 581 the client can send multiple requests back to back without waiting 582 first for the completion of any of them. The client uses client 583 selected identifier in the Pipelined-Requests header to instruct the 584 server to bind multiple requests together as if they included the 585 session identifier. 587 The SETUP response also provides additional information about the 588 established sessions in a couple of different headers. The Media- 589 Properties header include a number of properties that apply for the 590 aggregate that is valuable when doing media delivery control and 591 configuring user interface. The Accept-Ranges header inform the 592 client about which range formats that the server supports with these 593 media resources. The Media-Range header inform the client about the 594 time range of the media currently available. 596 2.3. Media Delivery Control 598 After having established an RTSP session, the client can start 599 controlling the media delivery. The basic operations are Start by 600 using the PLAY method (Section 13.4) and Halt by using the PAUSE 601 method (Section 13.6). PLAY also allows for choosing the starting 602 media position from which the server should deliver the media. The 603 positioning is done using the Range header (Section 16.38) that 604 supports several different time formats: Normal Play Time 605 (Section 4.5), SMPTE Timestamps (Section 4.4) and absolute time 606 (Section 4.6). The Range header does further allow the client to 607 specify a position where delivery should end, thus allowing a 608 specific interval to be delivered. 610 The support for positioning/searching within a content depends on the 611 content's media properties. Content exists in a number of different 612 types, such as: on-demand, live, and live with simultaneous 613 recording. Even within these categories there are differences in how 614 the content is generated and distributed, which affect how it can be 615 accessed for playback. The properties applicable for the RTSP 616 session are provided by the server in the SETUP response using the 617 Media-Properties header (Section 16.28). These are expressed using 618 one or several independent attributes. A first attribute is Random 619 Access, which expresses if positioning can be done, and with what 620 granularity. Another aspect is whether the content will change 621 during the lifetime of the session. While on-demand content will 622 provided in its completeness from the beginning, a live stream being 623 recorded results in that the length of the accessible content grows 624 as the session goes on. There also exist content that is dynamically 625 built by another protocol than RTSP and thus also changes in steps 626 during the session, but maybe not continuously. Furthermore, when 627 content is recorded, there are cases where not the complete content 628 is maintained, but, for example, only the last hour. All these 629 properties result in the need for mechanisms that will be discussed 630 below. 632 When the client accesses on-demand content, that is possible to 633 perform random access in, the client can issue the PLAY request for 634 any point in the content between the start and the end. The server 635 will deliver media from the closest random access point prior to the 636 requested point and indicate that in its PLAY response. If the 637 client issues a pause the delivery will be halted and the point at 638 which the server stopped will be reported back in the response. The 639 client can later resume by a PLAY request without a range header. 640 When the server is about to completed the PLAY request by delivering 641 the end of the content or the requested range the server will send a 642 PLAY_NOTIFY request indicating this. 644 When playing live content with no extra functions, such as recording, 645 the client will receive the live media from the server after having 646 sent a PLAY request. Seeking in such content is not possible as the 647 server does not store it, but only forwards it from the source of the 648 session. Thus delivery continues until the client sends a PAUSE 649 request, tears down the session, or the content ends. 651 For live sessions that are being recorded the client will need to 652 keep track of how the recording progresses. Upon session 653 establishment the client will learn the current duration of the 654 recording from the Media-Range header. As the recording is ongoing 655 the content grows in direct relation to the passed time. Therefore, 656 each server's response to a PLAY request will contain the current 657 Media-Range header. The server should also send regularly every 5 658 minutes the current media range in a PLAY_NOTIFY request. If the 659 live transmission ends, the server must send a PLAY_NOTIFY request 660 with the updated Media-Properties indicating that the content stopped 661 being a recorded live session and instead become a on-demand content. 662 The request also contains the final media range. While the live 663 delivery continues the client can request to play what is delivered 664 just now by using the NPT timescale symbol "now", or it can request a 665 specific point in the available content by an explicit range request 666 for that point. If the requested point is outside of the available 667 interval the server will adjust the position to the closest available 668 point, i.e., either at the beginning or the end. 670 A special case of recording is, where the recording is not retained 671 longer than a specific time period, thus as the live delivery 672 continues the client can access any media within a moving window that 673 covers for example "now" to "now" minus 1 hour. A client that pauses 674 on a specific point within the content may not be able to retrieve 675 the content anymore. If the client waits too long before resuming 676 the pause point, the content may no longer be available. In this 677 case the pause point will be adjusted to the end of the available 678 media. 680 2.4. Session Parameter Manipulations 682 A session may have additional state or functionality that effects how 683 the server or client treats the session, content, how it functions, 684 or feedback on how well the session works. Such extensions are not 685 defined in this specification, but may be done in various extensions. 686 RTSP has two methods for retrieving and setting parameter values on 687 either the client or the server: GET_PARAMETER (Section 13.8) and 688 SET_PARAMETER (Section 13.9). These methods carry the parameters in 689 a message body of the appropriate format. One can also headers to 690 query state with the GET_PARAMETER method. As an example, clients 691 needing to know the current Media-Range for a time-progressing 692 session can use the GET_PARAMETER method and include the media-range. 693 Furthermore, synchronization information can be requested by using a 694 combination of RTP-Info and Range. 696 RTSP 2.0 does not have a strong mechanism for providing negotiation 697 of which headers, or parameters and their formats, that can be used. 698 However, responses will indicate request headers or parameters that 699 are not supported. A priori determination of what features are 700 available needs to be done through out-of-band mechanisms, like the 701 session description, or through the usage of feature tags 702 (Section 4.7). 704 2.5. Media Delivery 706 The delivery of media to the RTSP client is done with a protocol 707 outside of RTSP and this protocol is determined during the session 708 establishment. This document specifies how media is delivered with 709 RTP over UDP, TCP or the RTSP control connection. Additional 710 protocols may be specified in the future based on demand. 712 The usage of RTP as media delivery protocol requires some additional 713 information to function well. The PLAY responses contains 714 synchronization information to enable reliable and timely deliver of 715 how a client should synchronize different sources in the different 716 RTP sessions. It also provides a mapping between RTP timestamps and 717 the content time scale. When the server want to notify the client 718 about the completion of the media delivery, it sends a PLAY_NOTIFY 719 request to the client. The PLAY_NOTIFY request includes information 720 about the stream end, including the last RTP sequence number for each 721 stream, thus enabling the client to empty the buffer smoothly. 723 2.5.1. Media Delivery Manipulations 725 The basic playback functionality of RTSP is to request content for a 726 particular range to be delivered to the client in a pace that enables 727 playback as intended by the creator. However, RTSP can also 728 manipulate how this delivery is done to the client in two ways. 730 Scale: The ratio of media content time delivered per unit playback 731 time. 733 Speed: The ratio of playback time delivered per unit of wallclock 734 time. 736 Both affect the media delivery per time unit. However, they 737 manipulate two independent time scales and the effects are possible 738 to combine. 740 Scale is used for fast forward or slow motion control as it changes 741 the amount of content timescale that should be played back per time 742 unit. Scale > 1.0, means fast forward, e.g. Scale=2.0 results in 743 that 2 seconds of content is played back every second of playback. 744 Scale = 1.0 is the default value that is used if no Scale is 745 specified, i.e. playback at the contents original rate. Scale values 746 between 0 and 1.0 is providing for slow motion. Scale can be 747 negative to allow for reverse playback in either regular pace (Scale 748 = -1.0) or fast backwards (Scale < -1.0) or slow motion backwards 749 (-1.0 < Scale < 0). Scale = 0 is equal to pause and is not allowed. 751 In most cases the realization of scale means server side manipulation 752 of the media to ensure that the client can actually play it back. 753 These media manipulation and when they are needed are highly media 754 type dependent. Lets exemplify with two common media types audio and 755 video. 757 It is very difficult to modify the playback rate of audio. A maximum 758 of 10-30% is possible by changing the pitch-rate of speech. Music 759 goes out of tune if one tries to manipulate the playback rate by 760 resampling it. This is a well known problem and audio is commonly 761 muted or played back in short segments with skips to keep up with the 762 current playback point. 764 For video is possible to manipulate the frame rate, although the 765 rendering capabilities are often limited to certain frame rates. 766 Also the allowed bit-rates in decoding, the structured used in the 767 encoding and its dependency between frames and other capabilities of 768 the rendering device limits the possible manipulations. Therefore 769 basic fast forward capabilities often is implemented by selecting 770 certain sub-sets of frames. 772 Due to the media restrictions, the possible scale values are commonly 773 restricted to a limited set of possible scale ratios. To enable the 774 clients to select from the possible scale values, RTSP can signal the 775 supported Scale ratios for the content. To support aggregated or 776 dynamic content, where this may change during the ongoing session and 777 dependent on the location within the content, a mechanism for 778 updating the media properties and the current used scale factor 779 exist. 781 Speed affects how much of the playback timeline that is delivered in 782 a given wallclock period. The default is Speed = 1 which is to 783 deliver at the same rate the media is consumed. Speed > 1 means that 784 the receiver will get content faster than it regularly would consume 785 it. Speed < 1 means that delivery is slower than the regular media 786 rate. Speed values of 0 or lower has no meaning and are not allowed. 787 This mechanism enables two general functionalities. Client side 788 scale operations, i.e. the client receives all the frames and makes 789 the adjustment to the playback locally. The second usage is to 790 control delivery for buffering of media. By specifying a speed over 791 1.0 the client can build up the amount of playback time it has 792 present in its buffers to a level that is sufficient for its needs. 794 A naive implementation of Speed would only affect the transmission 795 schedule of the media and has a clear impact on the needed bandwidth. 796 This would result in the data rate being proportional to the speed 797 factor. Speed = 1.5, i.e. 50% faster than normal delivery, will then 798 result in a 50% increase in the data transport rate. If that can be 799 supported or not depends solely on the underlying network path. 800 Scale may also have some impact on the required bandwidth due to the 801 manipulation of the content in the new playback schedule. An example 802 is fast forward where only the independently decodable intra frames 803 are included in the media stream. This usage of solely intra frames 804 increase the data rate significantly compared to a normal sequence 805 with the same number of frames where most frames are encoded using 806 prediction. 808 This potential increase of the data rate needs to be handled by the 809 media sender. The client has requested that the media is delivered 810 in a specific way, which should be honored. However, the media 811 sender can not ignore if the network path between the sender and the 812 receiver can't handle the resulting media stream. In that case the 813 media stream needs to be adapted to fit the available resources of 814 the path. This can result in that media quality has be reduced due 815 to the delivery modifications that the client has requested. 817 The need for bitrate adaptation becomes especially problematic in 818 connection to Speed. If the goal is to fill up the buffer, the 819 client may not want to do that at the cost of reduced quality. If 820 you like to do local playout changes then you may actually require 821 that the requested speed is honored. To resolve this issue, the 822 usage of speed specifies a range so that both usages can be 823 supported. The server is requested to use the highest possible speed 824 value within the range which is compatible with the available 825 bandwidth. As long as the server can maintain a speed value within 826 the range it shall not change the media quality, but instead modify 827 the speed value in response to available bandwidth. However, if this 828 is not possible, the server should instead modify the media quality 829 to respect the lowest speed value and the available bandwidth. 831 This functionality enables the local scaling implementation to use a 832 tight range, or even a range where the lower bound equals the upper 833 bound, to identify that it requires the server to deliver the 834 requested amount of media time per delivery time independent of how 835 much it needs to adapt the media quality to fit within the available 836 path bandwidth. For buffer fill up, it is suitable to use a range 837 with a reasonable span and with a lower bound at the nominal media 838 rate 1.0, such as 1.0 - 2.5. If the client wants to reduce the 839 buffer, it can specify an upper bound that is below 1.0 to force the 840 server to deliver slower than the nominal media rate. 842 2.6. Session Maintenance and Termination 844 The session context that has been established is kept alive by having 845 the client show liveness. This is done in two main ways: 847 o Media transport protocol keep-alive. RTCP is possible to use when 848 using RTP. 850 o Any RTSP request referencing the session context. 852 Section 10.5 discusses the methods for showing liveness in more 853 depth. If the client fails to show liveness for more than the 854 established session timeout value (normally 60 seconds), the server 855 may terminate the context. Other values may be selected by the 856 server through the inclusion of the timeout parameter in the session 857 header. 859 The session context is normally terminated by the client by sending a 860 TEARDOWN request to the server referencing the aggregated control 861 URI. An individual media resource can be removed from a session 862 context by a TEARDOWN request referencing that particular media 863 resource. If all media resources are removed from a session context, 864 the session context is terminated. 866 A client may keep the session alive indefinitely if allowed by the 867 server, however it is recommend to release the session context when 868 an extended period of time without media delivery activity has 869 passed. It can re-establish the session context if required later. 870 One issue is that what is an extended period of time is dependent on 871 the server and its usage. It is recommended that the client 872 terminates the session before 10*times the session timeout value has 873 passed. A server may terminate the session after one session timeout 874 period without any client activity beyond keep-alive. When a server 875 terminates the session context, it does that by sending a TEARDOWN 876 request indicating the reason. 878 A server can also request that the client tear down the session and 879 re-establish it at an alternative server, as may be needed for 880 maintenance. This is done by using the REDIRECT method. The 881 Terminate-Reason header is used to indicate when and why. The 882 Location header indicates where it should connect if there is an 883 alternative server available. When the deadline expires, the server 884 simply stops providing the service. To achieve a clean closure, the 885 client needs to initiate session termination prior to the deadline. 886 In case the server has no other server to redirect to, and likes to 887 close the session for maintenance, it shall use the TEARDOWN method 888 with a Terminate-Reason header. 890 2.7. Extending RTSP 892 RTSP is quite a versatile protocol which supports extensions in many 893 different directions. Even this core specification contains several 894 blocks of functionality that are optional to implement. The use case 895 and need for the protocol deployment is what should determine what is 896 implemented. Allowing for extensions makes it possible for RTSP to 897 reach out to additional use cases. However, extensions will affect 898 the interoperability of the protocol and therefore it is important 899 that it can be done in a structured way. 901 The client can learn the servers capability through the usage of the 902 OPTIONS method (Section 13.1) and the Supported header 903 (Section 16.49). It can also try and possibly fail by using new 904 methods or require that particular features are supported using the 905 Require or Proxy-Require header. 907 The RTSP protocol in itself can be extended in three ways, listed 908 here in order of the magnitude of changes supported: 910 o Existing methods can be extended with new parameters, for example, 911 headers, as long as these parameters can be safely ignored by the 912 recipient. If the client needs negative acknowledgement when a 913 method extension is not supported, a tag corresponding to the 914 extension may be added in the field of the Require or Proxy- 915 Require headers (see Section 16.35). 917 o New methods can be added. If the recipient of the message does 918 not understand the request, it must respond with error code 501 919 (Not Implemented) so that the sender can avoid using this method 920 again. A client may also use the OPTIONS method to inquire about 921 methods supported by the server. The server must list the methods 922 it supports using the Public response header. 924 o A new version of the protocol can be defined, allowing almost all 925 aspects (except the position of the protocol version number) to 926 change. A new version of the protocol must be registered through 927 an IETF standard track document. 929 The basic capability discovery mechanism can be used to both discover 930 support for a certain feature and to ensure that a feature is 931 available when performing a request. For a detailed explanation of 932 this see Section 11. 934 New media delivery protocols may be added and negotiated at session 935 establishment, in addition to extension to the core protocol. 936 Certain types of protocol manipulations can be done through parameter 937 formats using SET_PARAMETER and GET_PARAMETER. 939 3. Document Conventions 941 3.1. Notational Conventions 943 Since a few of the definitions are identical to HTTP/1.1, this 944 specification only points to the section where they are defined 945 rather than copying it. For brevity, [HX.Y] is to be taken to refer 946 to Section X.Y of the current HTTP/1.1 specification ([RFC2616]). 948 All the mechanisms specified in this document are described in both 949 prose and the Augmented Backus-Naur form (ABNF) described in detail 950 in [RFC5234]. 952 Indented and smaller-type paragraphs are used to provide informative 953 background and motivation. This is intended to give readers who were 954 not involved with the formulation of the specification an 955 understanding of why things are the way they are in RTSP. 957 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 958 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 959 document are to be interpreted as described in [RFC2119]. 961 The word, "unspecified" is used to indicate functionality or features 962 that are not defined in this specification. Such functionality 963 cannot be used in a standardized manner without further definition in 964 an extension specification to RTSP. 966 3.2. Terminology 968 Aggregate control: The concept of controlling multiple streams using 969 a single timeline, generally maintained by the server. A client, 970 for example, uses aggregate control when it issues a single play 971 or pause message to simultaneously control both the audio and 972 video in a movie. A session which is under aggregate control is 973 referred to as an aggregated session. 975 Aggregate control URI: The URI used in an RTSP request to refer to 976 and control an aggregated session. It normally, but not always, 977 corresponds to the presentation URI specified in the session 978 description. See Section 13.3 for more information. 980 Client: The client requests media service from the media server. 982 Connection: A transport layer virtual circuit established between 983 two programs for the purpose of communication. 985 Container file: A file which may contain multiple media streams 986 which often constitutes a presentation when played together. The 987 concept of a container file is not embedded in the protocol. 988 However, RTSP servers may offer aggregate control on the media 989 streams within these files. 991 Continuous media: Data where there is a timing relationship between 992 source and sink; that is, the sink needs to reproduce the timing 993 relationship that existed at the source. The most common examples 994 of continuous media are audio and motion video. Continuous media 995 can be real-time (interactive or conversational), where there is a 996 "tight" timing relationship between source and sink, or streaming 997 where the relationship is less strict. 999 Feature-tag: A tag representing a certain set of functionality, i.e. 1000 a feature. 1002 IRI: Internationalized Resource Identifier, is the same as an URI, 1003 with the exception that it allows characters from the whole 1004 Universal Character Set (Unicode/ISO 10646), rather than the US- 1005 ASCII only. See [RFC3987] for more information. 1007 Live: Normally used to describe a presentation or session with media 1008 coming from an ongoing event. This generally results in the 1009 session having an unbound or only loosely defined duration, and 1010 sometimes no seek operations are possible. 1012 Media initialization: Datatype/codec specific initialization. This 1013 includes such things as clock rates, color tables, etc. Any 1014 transport-independent information which is required by a client 1015 for playback of a media stream occurs in the media initialization 1016 phase of stream setup. 1018 Media parameter: Parameter specific to a media type that may be 1019 changed before or during stream delivery. 1021 Media server: The server providing media delivery services for one 1022 or more media streams. Different media streams within a 1023 presentation may originate from different media servers. A media 1024 server may reside on the same host or on a different host from 1025 which the presentation is invoked. 1027 (Media) stream: A single media instance, e.g., an audio stream or a 1028 video stream as well as a single whiteboard or shared application 1029 group. When using RTP, a stream consists of all RTP and RTCP 1030 packets created by a source within an RTP session. 1032 Message: The basic unit of RTSP communication, consisting of a 1033 structured sequence of octets matching the syntax defined in 1034 Section 20 and transmitted over a connection or a connectionless 1035 transport. A message is either a Request or a Response. 1037 Message Body: The information transferred as the payload of a 1038 message (Request and response). A message body consists of meta- 1039 information in the form of message-headers and content in the form 1040 of an message-body, as described in Section 9. 1042 Non-Aggregated Control: Control of a single media stream. 1044 Presentation: A set of one or more streams presented to the client 1045 as a complete media feed and described by a presentation 1046 description as defined below. Presentations with more than one 1047 media stream are often handled in RTSP under aggregate control. 1049 Presentation description: A presentation description contains 1050 information about one or more media streams within a presentation, 1051 such as the set of encodings, network addresses and information 1052 about the content. Other IETF protocols such as SDP ([RFC4566]) 1053 use the term "session" for a presentation. The presentation 1054 description may take several different formats, including but not 1055 limited to the session description protocol format, SDP. 1057 Response: An RTSP response to a Request. One type of RTSP message. 1058 If an HTTP response is meant, it is indicated explicitly. 1060 Request: An RTSP request. One type of RTSP message. If an HTTP 1061 request is meant, it is indicated explicitly. 1063 Request-URI: The URI used in a request to indicate the resource on 1064 which the request is to be performed. 1066 RTSP agent: Refers to either an RTSP client, an RTSP server, or an 1067 RTSP proxy. In this specification, there are many capabilities 1068 that are common to these three entities such as the capability to 1069 send requests or receive responses. This term will be used when 1070 describing functionality that is applicable to all three of these 1071 entities. 1073 RTSP session: A stateful abstraction upon which the main control 1074 methods of RTSP operate. An RTSP session is a common context; it 1075 is created, maintained and destroyed on client's request. It is 1076 established by an RTSP server upon the completion of a successful 1077 SETUP request (when a 200 OK response is sent) and is labeled with 1078 a session identifier at that time. The session exists until timed 1079 out by the server or explicitly removed by a TEARDOWN request. An 1080 RTSP session is a stateful entity; an RTSP server maintains an 1081 explicit session state machine (see Appendix A) where most state 1082 transitions are triggered by client requests. The existence of a 1083 session implies the existence of state about the session's media 1084 streams and their respective transport mechanisms. A given 1085 session can have one or more media streams associated with it. An 1086 RTSP server uses the session to aggregate control over multiple 1087 media streams. 1089 Origin Server: The server on which a given resource resides. 1091 Transport initialization: The negotiation of transport information 1092 (e.g., port numbers, transport protocols) between the client and 1093 the server. 1095 URI: Universal Resource Identifier, see [RFC3986]. The URIs used in 1096 RTSP are generally URLs as they give a location for the resource. 1097 As URLs are a subset of URIs, they will be referred to as URIs to 1098 cover also the cases when an RTSP URI would not be an URL. 1100 URL: Universal Resource Locator, is an URI which identifies the 1101 resource through its primary access mechanism, rather than 1102 identifying the resource by name or by some other attribute(s) of 1103 that resource. 1105 4. Protocol Parameters 1107 4.1. RTSP Version 1109 This specification defines version 2.0 of RTSP. 1111 RTSP uses a "." numbering scheme to indicate versions 1112 of the protocol. The protocol versioning policy is intended to allow 1113 the sender to indicate the format of a message and its capacity for 1114 understanding further RTSP communication, rather than the features 1115 obtained via that communication. No change is made to the version 1116 number for the addition of message components which do not affect 1117 communication behavior or which only add to extensible field values. 1119 The number is incremented when the changes made to the 1120 protocol add features which do not change the general message parsing 1121 algorithm, but which may add to the message semantics and imply 1122 additional capabilities of the sender. The number is 1123 incremented when the format of a message within the protocol is 1124 changed. The version of an RTSP message is indicated by an RTSP- 1125 Version field in the first line of the message. Note that the major 1126 and minor numbers MUST be treated as separate integers and that each 1127 MAY be incremented higher than a single digit. Thus, RTSP/2.4 is a 1128 lower version than RTSP/2.13, which in turn is lower than RTSP/12.3. 1129 Leading zeros MUST be ignored by recipients and MUST NOT be sent. 1131 4.2. RTSP IRI and URI 1133 RTSP 2.0 defines and registers three URI schemes "rtsp", "rtsps" and 1134 "rtspu". The usage of the last, "rtspu", is unspecified in RTSP 2.0, 1135 and is defined here to register and reserve the URI scheme that is 1136 defined in RTSP 1.0. The "rtspu" scheme indicates unspecified 1137 transport of the RTSP messages over unreliable transport (UDP in RTSP 1138 1.0). The details of the syntax of "rtsp" and "rtsps" URIs has been 1139 changed from RTSP 1.0. 1141 This specification also defines the format of the RTSP IRI [RFC3987] 1142 that can be used as RTSP resource identifiers and locators, in web 1143 pages, user interfaces, on paper, etc. However, the RTSP request 1144 message format only allows usage of the absolute URI format. The 1145 RTSP IRI format MUST use the rules and transformation for IRIs 1146 defined in [RFC3987]. This way RTSP 2.0 URIs for request can be 1147 produced from an RTSP IRI. 1149 The RTSP IRI and URI are both syntax restricted compared to the 1150 generic syntax defined in [RFC3986] and RFC [RFC3987]: 1152 o An absolute URI requires the authority part; i.e., a host identity 1153 must be provided. 1155 o Parameters in the path element are prefixed with the reserved 1156 separator ";". 1158 The RTSP URI and IRI is case sensitive, with the exception of those 1159 parts that [RFC3986] and [RFC3987] defines as case-insensitive; for 1160 example, the scheme and host part. 1162 The fragment identifier is used as defined in sections 3.5 and 4.3 of 1163 [RFC3986], i.e. the fragment is to be stripped from the IRI by the 1164 requester and not included in the request URI. The user agent needs 1165 to interpret the value of the fragment based on the media type the 1166 request relates to; i.e., the media type indicated in Content-Type 1167 header in the response to DESCRIBE. 1169 The syntax of any URI query string is unspecified and responder 1170 (usually the server) specific. The query is, from the requester's 1171 perspective, an opaque string and needs to be handled as such. 1172 Please note that relative URI with queries are difficult to handle 1173 due to the RFC 3986 relative URI handling rules. Any change of the 1174 path element using a relative URI results in the stripping of the 1175 query. Which means the relative part needs to contain the query. 1177 The URI scheme "rtsp" requires that commands are issued via a 1178 reliable protocol (within the Internet, TCP), while the scheme 1179 "rtsps" identifies a reliable transport using secure transport (TLS 1180 [RFC5246], see (Section 19). 1182 For the scheme "rtsp", if no port number is provided in the authority 1183 part of the URI port number 554 MUST be used. For the scheme 1184 "rtsps", the TCP port 322 is registered and MUST be assumed. 1186 A presentation or a stream is identified by a textual media 1187 identifier, using the character set and escape conventions of URIs 1188 [RFC3986]. URIs may refer to a stream or an aggregate of streams; 1189 i.e., a presentation. Accordingly, requests described in 1190 (Section 13) can apply to either the whole presentation or an 1191 individual stream within the presentation. Note that some request 1192 methods can only be applied to streams, not presentations, and vice 1193 versa. 1195 For example, the RTSP URI: 1197 rtsp://media.example.com:554/twister/audiotrack 1199 may identify the audio stream within the presentation "twister", 1200 which can be controlled via RTSP requests issued over a TCP 1201 connection to port 554 of host media.example.com. 1203 Also, the RTSP URI: 1205 rtsp://media.example.com:554/twister 1207 identifies the presentation "twister", which may be composed of audio 1208 and video streams, but could also be something else like a random 1209 media redirector. 1211 This does not imply a standard way to reference streams in URIs. 1212 The presentation description defines the hierarchical 1213 relationships in the presentation and the URIs for the individual 1214 streams. A presentation description may name a stream "a.mov" and 1215 the whole presentation "b.mov". 1217 The path components of the RTSP URI are opaque to the client and do 1218 not imply any particular file system structure for the server. 1220 This decoupling also allows presentation descriptions to be used 1221 with non-RTSP media control protocols simply by replacing the 1222 scheme in the URI. 1224 4.3. Session Identifiers 1226 Session identifiers are strings of length 8-128 characters. A 1227 session identifier MUST be chosen cryptographically random (see 1228 [RFC4086]) . It is RECOMMENDED that it contains 128 bits of entropy, 1229 i.e. approximately 22 characters from a high quality generator. (see 1230 Section 21.) However, note that the session identifier does not 1231 provide any security against session hijacking unless it is kept 1232 confidential by the client, server and trusted proxies. 1234 4.4. SMPTE Relative Timestamps 1236 A SMPTE relative timestamp expresses time relative to the start of 1237 the clip. Relative timestamps are expressed as SMPTE time codes for 1238 frame-level access accuracy. The time code has the format 1240 hours:minutes:seconds:frames.subframes, 1242 with the origin at the start of the clip. The default SMPTE format 1243 is "SMPTE 30 drop" format, with frame rate is 29.97 frames per 1244 second. Other SMPTE codes MAY be supported (such as "SMPTE 25") 1245 through the use of alternative use of "smpte-type". For SMPTE 30, 1246 the "frames" field in the time value can assume the values 0 through 1247 29. The difference between 30 and 29.97 frames per second is handled 1248 by dropping the first two frame indices (values 00 and 01) of every 1249 minute, except every tenth minute. If the frame and the subframe 1250 values are zero, they may be omitted. Subframes are measured in one- 1251 hundredth of a frame. 1253 Examples: 1255 smpte=10:12:33:20- 1256 smpte=10:07:33- 1257 smpte=10:07:00-10:07:33:05.01 1258 smpte-25=10:07:00-10:07:33:05.01 1260 4.5. Normal Play Time 1262 Normal play time (NPT) indicates the stream absolute position 1263 relative to the beginning of the presentation, not to be confused 1264 with the Network Time Protocol (NTP) [RFC1305]. The timestamp 1265 consists of two parts: the mandatory first part may be expressed in 1266 either seconds or hours, minutes, and seconds. The optional second 1267 part consists of a decimal point and decimal figures and indicates 1268 fractions of a second. 1270 The beginning of a presentation corresponds to 0.0 seconds. Negative 1271 values are not defined. 1273 The special constant "now" is defined as the current instant of a 1274 live event. It MAY only be used for live events, and MUST NOT be 1275 used for on-demand (i.e., non-live) content. 1277 NPT is defined as in DSM-CC [ISO.13818-6.1995]: "Intuitively, NPT is 1278 the clock the viewer associates with a program. It is often 1279 digitally displayed on a VCR. NPT advances normally when in normal 1280 play mode (scale = 1), advances at a faster rate when in fast scan 1281 forward (high positive scale ratio), decrements when in scan reverse 1282 (negative scale ratio) and is fixed in pause mode. NPT is 1283 (logically) equivalent to SMPTE time codes." 1285 Examples: 1287 npt=123.45-125 1288 npt=12:05:35.3- 1289 npt=now- 1290 The syntax conforms to ISO 8601 [ISO.8601.2000]. The npt-sec 1291 notation is optimized for automatic generation, the npt-hhmmss 1292 notation for consumption by human readers. The "now" constant 1293 allows clients to request to receive the live feed rather than the 1294 stored or time-delayed version. This is needed since neither 1295 absolute time nor zero time are appropriate for this case. 1297 4.6. Absolute Time 1299 Absolute time is expressed as ISO 8601 [ISO.8601.2000] timestamps, 1300 using UTC (GMT). Fractions of a second may be indicated. 1302 Example for November 8, 1996 at 14h 37 min and 20 and a quarter 1303 seconds UTC: 1305 19961108T143720.25Z 1307 4.7. Feature-Tags 1309 Feature-tags are unique identifiers used to designate features in 1310 RTSP. These tags are used in Require (Section 16.41), Proxy-Require 1311 (Section 16.35), Proxy-Supported (Section 16.36), and Unsupported 1312 (Section 16.53) header fields. 1314 A feature-tag definition MUST indicate which combination of clients, 1315 servers or proxies they applies to. 1317 The creator of a new RTSP feature-tag should either prefix the 1318 feature-tag with a reverse domain name (e.g., 1319 "com.example.mynewfeature" is an apt name for a feature whose 1320 inventor can be reached at "example.com"), or register the new 1321 feature-tag with the Internet Assigned Numbers Authority (IANA) (see 1322 IANA Section 22). 1324 The usage of feature-tags is further described in Section 11 that 1325 deals with capability handling. 1327 4.8. Message Body Tags 1329 Message body tags are opaque strings that are used to compare two 1330 message bodies from the same resource, for example in caches or to 1331 optimize setup after a redirect. Message body tags can be carried in 1332 the MTag header (see Section 16.30) or in SDP (see Appendix D.1.9). 1333 MTag is similar to ETag in HTTP/1.1. 1335 A message body tag MUST be unique across all versions of all message 1336 bodies associated with a particular resource. A given message body 1337 tag value MAY be used for message body obtained by requests on 1338 different URIs. The use of the same message body tag value in 1339 conjunction with message bodies obtained by requests on different 1340 URIs does not imply the equivalence of those message bodies 1342 Message body tags are used in RTSP to make some methods conditional. 1343 The methods are made conditional through the inclusion of headers, 1344 see "If-Match" (Section 16.23) and "If-None-Match" (Section 16.25). 1345 Note that RTSP message body tags apply to the complete presentation; 1346 i.e., both the presentation description and the individual media 1347 streams. Thus message body tags can be used to verify at setup time 1348 after a redirect that the same session description applies to the 1349 media at the new location using the If-Match header. 1351 4.9. Media Properties 1353 When an RTSP server handles media, it is important to consider the 1354 different properties a media instance for delivery and playback can 1355 have. This specification considers the below listed media properties 1356 in its protocol operations. They are derived from the differences 1357 between a number of supported usages. 1359 On-demand: Media that has a fixed (given) duration that doesn't 1360 change during the life time of the RTSP session and is known at 1361 the time of the creation of the session. It is expected that the 1362 content of the media will not change, even if the representation, 1363 i.e encoding, quality, etc, may change. Generally one can seek, 1364 i.e. request any range, within the media. 1366 Dynamic On-demand: This is a variation of the on-demand case where 1367 external methods are used to manipulate the actual content of the 1368 media setup for the RTSP session. The main example is a content 1369 defined by a playlist. 1371 Live: Live media represents a progressing content stream (such as 1372 broadcast TV) where the duration may or may not be known. It is 1373 not seekable, only the content presently being delivered can be 1374 accessed. 1376 Live with Recording: A Live stream that is combined with a server 1377 side capability to store and retain the content of the live 1378 session for random access delivery within the part of the already 1379 recorded content. The actual behavior of the media stream is very 1380 much depending on the retention policy for the media stream. 1381 Either the server will be able to capture the complete media 1382 stream, or it will have a limitation in how much will be retained. 1383 The media range will dynamically change as the session progress. 1384 For servers with a limited amount of storage available for 1385 recording, there will typically be a sliding window that goes 1386 forwards while data is made available and content that is older 1387 than a limit will be discarded. 1389 To cover the above usages, the following media properties with 1390 appropriate values are specified: 1392 4.9.1. Random Access and Seeking 1394 Random Access is about the possibility to specify and get media 1395 delivered from any point inside the content, an operation called 1396 seeking. This possibility is signaled using Seek-Style which can 1397 take the following different values: 1399 Random Access: The media are seekable to any out of a large number 1400 of points within the media. Due to media encoding limitations, a 1401 particular point may not be reachable, but seeking to a point 1402 close by is enabled. A floating point number of seconds may be 1403 provided to express the worst case distance between random access 1404 points. 1406 Conditional Random Access: Based on the above Random Access but 1407 intended to handle a case where the distance in the media between 1408 random access points are large and where small seek forward using 1409 Random Access would move the client further away then the current 1410 point. 1412 Return To Start: Seeking is only possible to beginning of the 1413 content. 1415 No seeking: Seeking is not possible at all. 1417 4.9.2. Retention 1419 Media may have different retention policy in place that affect the 1420 operation on the media. The following different media retention 1421 policies are envisioned and taken into consideration where 1422 applicable. 1424 Unlimited: The media will not be removed as long as the RTSP session 1425 is in existence. 1427 Time Limited: The media will at least not be removed before given 1428 wallclock time. After that time it may or may not be available 1429 any more. 1431 Duration limited: Each individual unit of the media will be retained 1432 for the specified duration. 1434 4.9.3. Content Modifications 1436 There is also the question of how the content may change during time 1437 for a give media resource: 1439 Immutable: The content of the media will not change, even if the 1440 representation, i.e encoding, quality, etc, may change. 1442 Dynamic: Between explicit updates the media content will not change, 1443 but the content may change due to external methods or triggers, 1444 such as playlists. 1446 Time Progressing: As times progress new content will become 1447 available. If the content also is retained it will become longer 1448 and longer as everything between the start point and the point in 1449 currently being made available can be accessed. 1451 4.9.4. Supported Scale Factors 1453 The content is often limiting the possible rates of scale that can be 1454 supported when delivering the media. To enable the client to know 1455 what values or ranges of scale operations that the whole content or 1456 the current position supports a media properties attribute for this 1457 is defined. It contains a list with the values and/or ranges that 1458 are supported. The attribute is named "Scales". It may be updated 1459 at any point in the content due to content consisting of spliced 1460 pieces or content being dynamically updated by out of bands 1461 mechanisms. 1463 4.9.5. Mapping to the Attributes 1465 This section exemplifies how one would map the above listed usages to 1466 the properties and their values. 1468 On-demand: Random Access: Random Access=5s, Content Modifications: 1469 Immutable, Retention: unlimited or time limited. 1471 Dynamic On-demand: Random Access: Random Access=3s, Content 1472 Modifications: Dynamic, Retention: unlimited or time limited. 1474 Live: Random Access: No seeking, Content Modifications: Time 1475 Progressing, Retention: Duration limited=0.0s 1477 Live with Recording: Random Access: Random Access=3s, Content 1478 Modifications: Time Progressing, Retention: Duration limited=2H 1480 5. RTSP Message 1482 RTSP is a text-based protocol and uses the ISO 10646 character set in 1483 UTF-8 encoding RFC 3629 [RFC3629]. Lines MUST be terminated by CRLF. 1485 Text-based protocols make it easier to add optional parameters in 1486 a self-describing manner. Since the number of parameters and the 1487 frequency of commands is low, processing efficiency is not a 1488 concern. Text-based protocols, if done carefully, also allow easy 1489 implementation of research prototypes in scripting languages such 1490 as TCL, Visual Basic and Perl. 1492 The ISO 10646 character set avoids tricky character set switching, 1493 but is invisible to the application as long as US-ASCII is being 1494 used. This is also the encoding used for RTCP [RFC3550]. ISO 8859-1 1495 translates directly into Unicode with a high-order octet of zero. 1496 ISO 8859-1 characters with the most-significant bit set are 1497 represented as 1100001x 10xxxxxx. (See RFC 3629 [RFC3629]) 1499 Requests contain methods, the object the method is operating upon and 1500 parameters to further describe the method. Methods are idempotent 1501 unless otherwise noted. Methods are also designed to require little 1502 or no state maintenance at the media server. 1504 5.1. Message Types 1506 RTSP messages consist of requests from client to server, or server to 1507 client, and responses in the reverse direction. Request Section 7 1508 and Response Section 8 messages uses a format based on the generic 1509 message format of RFC 0822 [RFC0822] for transferring bodies (the 1510 payload of the message). Both types of message consist of a start- 1511 line, zero or more header fields (also known as "headers"), an empty 1512 line (i.e., a line with nothing preceding the CRLF) indicating the 1513 end of the header, and possibly the data of the message-body. 1515 generic-message = start-line 1516 *(message-header CRLF) 1517 CRLF 1518 [ message-body-data ] 1519 start-line = Request-Line | Status-Line 1521 In the interest of robustness, servers MUST ignore any empty line(s) 1522 received where a Request-Line is expected. In other words, if the 1523 server is reading the protocol stream at the beginning of a message 1524 and receives a CRLF first, it should ignore the CRLF. 1526 5.2. Message Headers 1528 RTSP header fields (see Section 16) include general-header, request- 1529 header, response-header, and Message-body header fields. 1531 The order in which header fields with differing field names are 1532 received is not significant. However, it is "good practice" to send 1533 general-header fields first, followed by request-header or response- 1534 header fields, and ending with the Message-body header fields. 1536 Multiple message-header fields with the same field-name MAY be 1537 present in a message if and only if the entire field-value for that 1538 header field is defined as a comma-separated list. It MUST be 1539 possible to combine the multiple header fields into one "field-name: 1540 field-value" pair, without changing the semantics of the message, by 1541 appending each subsequent field-value to the first, each separated by 1542 a comma. The order in which header fields with the same field-name 1543 are received is therefore significant to the interpretation of the 1544 combined field value, and thus a proxy MUST NOT change the order of 1545 these field values when a message is forwarded. 1547 Unknown message headers MUST be ignored (skipping over the header to 1548 the next protocol element, and not causing an error) by a RTSP server 1549 or client. An RTSP Proxy MUST forward unknown message headers. 1550 Message headers defined outside of this specification that are 1551 required to be interpret by the RTSP agent will need to use feature 1552 tags (Section 4.7) and include it in the appropriate Require 1553 (Section 16.41) or Proxy-Require (Section 16.35) header. 1555 5.3. Message Body 1557 The message-body (if any) of an RTSP message is used to carry further 1558 information for a particular resource associated with the request or 1559 response. An example for a message body is the Session Description 1560 Protocol (SDP). 1562 The presence of a message-body in either a request or a response MUST 1563 be signaled by the inclusion of a Content-Length header (see 1564 Section 16.16). 1566 The presence of a message-body in a request is signaled by the 1567 inclusion of a Content-Length header field in the RTSP message. A 1568 message-body MUST NOT be included in a request or response if the 1569 specification of the particular method (see Method Definitions 1570 (Section 13)) does not allow sending a message body. 1572 5.4. Message Length 1574 When a message body is included with a message, the length of that 1575 body is determined by one of the following (in order of precedence): 1577 1. Any response message which MUST NOT include a message body (such 1578 as the 1xx, 204, and 304 responses) is always terminated by the 1579 first empty line after the header fields, regardless of the 1580 message-header fields present in the message. (Note: An empty 1581 line is a line with nothing preceding the CRLF.) 1583 2. If a Content-Length header(Section 16.16) is present, its value 1584 in bytes represents the length of the message-body. If this 1585 header field is not present, a value of zero is assumed. 1587 Unlike an HTTP message, an RTSP message MUST contain a Content-Length 1588 header whenever it contains a message body. Note that RTSP does not 1589 support the HTTP/1.1 "chunked" transfer coding (see [H3.6.1]). 1591 Given the moderate length of presentation descriptions returned, 1592 the server should always be able to determine its length, even if 1593 it is generated dynamically, making the chunked transfer encoding 1594 unnecessary. 1596 6. General Header Fields 1598 General headers are headers that may be used in both request and 1599 responses. The general headers are listed in Table 1: 1601 +--------------------+--------------------+ 1602 | Header Name | Defined in Section | 1603 +--------------------+--------------------+ 1604 | Accept-Ranges | Section 16.5 | 1605 | | | 1606 | Cache-Control | Section 16.10 | 1607 | | | 1608 | Connection | Section 16.11 | 1609 | | | 1610 | CSeq | Section 16.19 | 1611 | | | 1612 | Date | Section 16.20 | 1613 | | | 1614 | Media-Properties | Section 16.28 | 1615 | | | 1616 | Media-Range | Section 16.29 | 1617 | | | 1618 | Pipelined-Requests | Section 16.32 | 1619 | | | 1620 | Proxy-Supported | Section 16.36 | 1621 | | | 1622 | RTP-Info | Section 16.43 | 1623 | | | 1624 | Seek-Style | Section 16.45 | 1625 | | | 1626 | Supported | Section 16.49 | 1627 | | | 1628 | Timestamp | Section 16.51 | 1629 | | | 1630 | Via | Section 16.56 | 1631 +--------------------+--------------------+ 1633 Table 1: The general headers used in RTSP 1635 7. Request 1637 A request message uses the format outlined below regardless of the 1638 direction of a request, client to server or server to client: 1640 o Request line, containing the method to be applied to the resource, 1641 the identifier of the resource, and the protocol version in use; 1643 o Zero or more Header lines, that can be of the following types: 1644 general (Section 6), request (Section 7.2), or message 1645 body(Section 9.1); 1647 o One empty line (CRLF) to indicate the end of the header section; 1649 o Optionally a message-body, consisting of one or more lines. The 1650 length of the message body in bytes is indicated by the Content- 1651 Length message header. 1653 7.1. Request Line 1655 The request line provides the key information about the request: what 1656 method, on what resources and using which RTSP version. The methods 1657 that are defined by this specification are listed in Table 2. 1659 +---------------+--------------------+ 1660 | Method | Defined in Section | 1661 +---------------+--------------------+ 1662 | DESCRIBE | Section 13.2 | 1663 | | | 1664 | GET_PARAMETER | Section 13.8 | 1665 | | | 1666 | OPTIONS | Section 13.1 | 1667 | | | 1668 | PAUSE | Section 13.6 | 1669 | | | 1670 | PLAY | Section 13.4 | 1671 | | | 1672 | PLAY_NOTIFY | Section 13.5 | 1673 | | | 1674 | REDIRECT | Section 13.10 | 1675 | | | 1676 | SETUP | Section 13.3 | 1677 | | | 1678 | SET_PARAMETER | Section 13.9 | 1679 | | | 1680 | TEARDOWN | Section 13.7 | 1681 +---------------+--------------------+ 1683 Table 2: The RTSP Methods 1685 The syntax of the RTSP request line is the following: 1687 CRLF 1689 Note: This syntax cannot be freely changed in future versions of 1690 RTSP. This line needs to remain parsable by older RTSP 1691 implementations since it indicates the RTSP version of the message. 1693 In contrast to HTTP/1.1 [RFC2616], RTSP requests identify the 1694 resource through an absolute RTSP URI (including scheme, host, and 1695 port) (see Section 4.2) rather than just the absolute path. 1697 HTTP/1.1 requires servers to understand the absolute URI, but 1698 clients are supposed to use the Host request header. This is 1699 purely needed for backward-compatibility with HTTP/1.0 servers, a 1700 consideration that does not apply to RTSP. 1702 An asterisk "*" can be used instead of an absolute URI in the 1703 Request-URI part to indicate that the request does not apply to a 1704 particular resource, but to the server or proxy itself, and is only 1705 allowed when the request method does not necessarily apply to a 1706 resource. 1708 For example: 1710 OPTIONS * RTSP/2.0 1712 An OPTIONS in this form will determine the capabilities of the server 1713 or the proxy that first receives the request. If the capability of 1714 the specific server needs to be determined, without regard to the 1715 capability of an intervening proxy, the server should be addressed 1716 explicitly with an absolute URI that contains the server's address. 1718 For example: 1720 OPTIONS rtsp://example.com RTSP/2.0 1722 7.2. Request Header Fields 1724 The RTSP headers in Table 3 can be included in a request, as request 1725 headers, to modify the specifics of the request. Some of these 1726 headers may also be used in the response to a request, as response 1727 headers, to modify the specifics of a response (Section 8.2). 1729 +--------------------+--------------------+ 1730 | Header | Defined in Section | 1731 +--------------------+--------------------+ 1732 | Accept | Section 16.1 | 1733 | | | 1734 | Accept-Credentials | Section 16.2 | 1735 | | | 1736 | Accept-Encoding | Section 16.3 | 1737 | | | 1738 | Accept-Language | Section 16.4 | 1739 | | | 1740 | Authorization | Section 16.7 | 1741 | | | 1742 | Bandwidth | Section 16.8 | 1743 | | | 1744 | Blocksize | Section 16.9 | 1745 | | | 1746 | From | Section 16.22 | 1747 | | | 1748 | If-Match | Section 16.23 | 1749 | | | 1750 | If-Modified-Since | Section 16.24 | 1751 | | | 1752 | If-None-Match | Section 16.25 | 1753 | | | 1754 | Notify-Reason | Section 16.31 | 1755 | | | 1756 | Proxy-Require | Section 16.35 | 1757 | | | 1758 | Range | Section 16.38 | 1759 | | | 1760 | Terminate-Reason | Section 16.50 | 1761 | | | 1762 | Referrer | Section 16.39 | 1763 | | | 1764 | Request-Status | Section 16.40 | 1765 | | | 1766 | Require | Section 16.41 | 1767 | | | 1768 | Scale | Section 16.44 | 1769 | | | 1770 | Session | Section 16.47 | 1771 | | | 1772 | Speed | Section 16.48 | 1773 | | | 1774 | Supported | Section 16.49 | 1775 | | | 1776 | Transport | Section 16.52 | 1777 | | | 1778 | User-Agent | Section 16.54 | 1779 +--------------------+--------------------+ 1781 Table 3: The RTSP request headers 1783 Detailed headers definition are provided in Section 16. 1785 New request headers may be defined. If the receiver of the request 1786 is required to understand the request header, the request MUST 1787 include a corresponding feature tag in a Require or Proxy-Require 1788 header to ensure the processing of the header. 1790 8. Response 1792 After receiving and interpreting a request message, the recipient 1793 responds with an RTSP response message. Normally, there is only one, 1794 final, response. It is only for responses using the response code 1795 class 1xx, that it is allowed to send one or more 1xx response 1796 messages prior to the final response message. 1798 The valid response codes and the methods they can be used with are 1799 listed in Table 4. 1801 8.1. Status-Line 1803 The first line of a Response message is the Status-Line, consisting 1804 of the protocol version followed by a numeric status code and the 1805 textual phrase associated with the status code, with each element 1806 separated by SP characters. No CR or LF is allowed except in the 1807 final CRLF sequence. 1809 SP SP CRLF 1811 8.1.1. Status Code and Reason Phrase 1813 The Status-Code element is a 3-digit integer result code of the 1814 attempt to understand and satisfy the request. These codes are fully 1815 defined in Section 15. The Reason-Phrase is intended to give a short 1816 textual description of the Status-Code. The Status-Code is intended 1817 for use by automata and the Reason-Phrase is intended for the human 1818 user. The client is not required to examine or display the Reason- 1819 Phrase. 1821 The first digit of the Status-Code defines the class of response. 1822 The last two digits do not have any categorization role. There are 5 1823 values for the first digit: 1825 1xx: Informational - Request received, continuing process 1827 2xx: Success - The action was successfully received, understood, and 1828 accepted 1830 3rr: Redirection - Further action needs to be taken in order to 1831 complete the request 1833 4xx: Client Error - The request contains bad syntax or cannot be 1834 fulfilled 1836 5xx: Server Error - The server failed to fulfill an apparently valid 1837 request 1839 The individual values of the numeric status codes defined for 1840 RTSP/2.0, and an example set of corresponding Reason-Phrases, are 1841 presented in Table 4. The reason phrases listed here are only 1842 recommended; they may be replaced by local equivalents without 1843 affecting the protocol. Note that RTSP adopts most HTTP/1.1 1844 [RFC2616] status codes and adds RTSP-specific status codes starting 1845 at x50 to avoid conflicts with future HTTP status codes that are 1846 desirable to import into RTSP. 1848 RTSP status codes are extensible. RTSP applications are not required 1849 to understand the meaning of all registered status codes, though such 1850 understanding is obviously desirable. However, applications MUST 1851 understand the class of any status code, as indicated by the first 1852 digit, and treat any unrecognized response as being equivalent to the 1853 x00 status code of that class, with the exception that an 1854 unrecognized response MUST NOT be cached. For example, if an 1855 unrecognized status code of 431 is received by the client, it can 1856 safely assume that there was something wrong with its request and 1857 treat the response as if it had received a 400 status code. In such 1858 cases, user agents SHOULD present to the user the message body 1859 returned with the response, since that message body is likely to 1860 include human-readable information which will explain the unusual 1861 status. 1863 +------+----------------------------------------+-----------------+ 1864 | Code | Reason | Method | 1865 +------+----------------------------------------+-----------------+ 1866 | 100 | Continue | all | 1867 | | | | 1868 | | | | 1869 | 200 | OK | all | 1870 | | | | 1871 | | | | 1872 | 301 | Moved Permanently | all | 1873 | | | | 1874 | 302 | Found | all | 1875 | | | | 1876 | 304 | Not Modified | all | 1877 | | | | 1878 | 305 | Use Proxy | all | 1879 | | | | 1880 | | | | 1881 | 400 | Bad Request | all | 1882 | | | | 1883 | 401 | Unauthorized | all | 1884 | 402 | Payment Required | all | 1885 | | | | 1886 | 403 | Forbidden | all | 1887 | | | | 1888 | 404 | Not Found | all | 1889 | | | | 1890 | 405 | Method Not Allowed | all | 1891 | | | | 1892 | 406 | Not Acceptable | all | 1893 | | | | 1894 | 407 | Proxy Authentication Required | all | 1895 | | | | 1896 | 408 | Request Timeout | all | 1897 | | | | 1898 | 410 | Gone | all | 1899 | | | | 1900 | 411 | Length Required | all | 1901 | | | | 1902 | 412 | Precondition Failed | DESCRIBE, SETUP | 1903 | | | | 1904 | 413 | Request Message Body Too Large | all | 1905 | | | | 1906 | 414 | Request-URI Too Long | all | 1907 | | | | 1908 | 415 | Unsupported Media Type | all | 1909 | | | | 1910 | 451 | Parameter Not Understood | SET_PARAMETER | 1911 | | | | 1912 | 452 | reserved | n/a | 1913 | | | | 1914 | 453 | Not Enough Bandwidth | SETUP | 1915 | | | | 1916 | 454 | Session Not Found | all | 1917 | | | | 1918 | 455 | Method Not Valid In This State | all | 1919 | | | | 1920 | 456 | Header Field Not Valid | all | 1921 | | | | 1922 | 457 | Invalid Range | PLAY, PAUSE | 1923 | | | | 1924 | 458 | Parameter Is Read-Only | SET_PARAMETER | 1925 | | | | 1926 | 459 | Aggregate Operation Not Allowed | all | 1927 | | | | 1928 | 460 | Only Aggregate Operation Allowed | all | 1929 | | | | 1930 | 461 | Unsupported Transport | all | 1931 | | | | 1932 | 462 | Destination Unreachable | all | 1933 | | | | 1934 | 463 | Destination Prohibited | SETUP | 1935 | | | | 1936 | 464 | Data Transport Not Ready Yet | PLAY | 1937 | | | | 1938 | 465 | Notification Reason Unknown | PLAY_NOTIFY | 1939 | | | | 1940 | 470 | Connection Authorization Required | all | 1941 | | | | 1942 | 471 | Connection Credentials not accepted | all | 1943 | | | | 1944 | 472 | Failure to establish secure connection | all | 1945 | | | | 1946 | | | | 1947 | 500 | Internal Server Error | all | 1948 | | | | 1949 | 501 | Not Implemented | all | 1950 | | | | 1951 | 502 | Bad Gateway | all | 1952 | | | | 1953 | 503 | Service Unavailable | all | 1954 | | | | 1955 | 504 | Gateway Timeout | all | 1956 | | | | 1957 | 505 | RTSP Version Not Supported | all | 1958 | | | | 1959 | 551 | Option not support | all | 1960 +------+----------------------------------------+-----------------+ 1962 Table 4: Status codes and their usage with RTSP methods 1964 8.2. Response Headers 1966 The response-header allow the request recipient to pass additional 1967 information about the response which cannot be placed in the Status- 1968 Line. This header give information about the server and about 1969 further access to the resource identified by the Request-URI. All 1970 headers currently classified as response headers are listed in 1971 Table 5. 1973 +------------------------+--------------------+ 1974 | Header | Defined in Section | 1975 +------------------------+--------------------+ 1976 | Connection-Credentials | Section 16.12 | 1977 | | | 1978 | MTag | Section 16.30 | 1979 | | | 1980 | Location | Section 16.27 | 1981 | | | 1982 | Proxy-Authenticate | Section 16.33 | 1983 | | | 1984 | Public | Section 16.37 | 1985 | | | 1986 | Range | Section 16.38 | 1987 | | | 1988 | Retry-After | Section 16.42 | 1989 | | | 1990 | Scale | Section 16.44 | 1991 | | | 1992 | Session | Section 16.47 | 1993 | | | 1994 | Server | Section 16.46 | 1995 | | | 1996 | Speed | Section 16.48 | 1997 | | | 1998 | Transport | Section 16.52 | 1999 | | | 2000 | Unsupported | Section 16.53 | 2001 | | | 2002 | Vary | Section 16.55 | 2003 | | | 2004 | WWW-Authenticate | Section 16.57 | 2005 +------------------------+--------------------+ 2007 Table 5: The RTSP response headers 2009 Response-headers names can be extended reliably only in combination 2010 with a change in the protocol version. However, the usage of 2011 feature-tags in the request allows the responding party to learn the 2012 capability of the receiver of the response. New or experimental 2013 header MAY be given the semantics of response-header if all parties 2014 in the communication recognize them to be response-header. 2015 Unrecognized headers in responses are treated as message-headers. 2017 9. Message Body 2019 Request and Response messages MAY transfer a message body, if not 2020 otherwise restricted by the request method or response status code. 2021 The message body consists of message-body header fields and an the 2022 content data itself. 2024 The SET_PARAMETER and GET_PARAMETER request and response, and 2025 DESCRIBE response MAY have an message body. All 4xx and 5xx 2026 responses MAY also have an message body. 2028 In this section, both sender and recipient refer to either the client 2029 or the server, depending on who sends and who receives the message 2030 body. 2032 9.1. Message-Body Header Fields 2034 Message-body header fields define meta-information about the content 2035 data in the message body. The message-body header fields are listed 2036 in Table 6. 2038 +------------------+--------------------+ 2039 | Header | Defined in Section | 2040 +------------------+--------------------+ 2041 | Allow | Section 16.6 | 2042 | | | 2043 | Content-Base | Section 16.13 | 2044 | | | 2045 | Content-Encoding | Section 16.14 | 2046 | | | 2047 | Content-Language | Section 16.15 | 2048 | | | 2049 | Content-Length | Section 16.16 | 2050 | | | 2051 | Content-Location | Section 16.17 | 2052 | | | 2053 | Content-Type | Section 16.18 | 2054 | | | 2055 | Expires | Section 16.21 | 2056 | | | 2057 | Last-Modified | Section 16.26 | 2058 +------------------+--------------------+ 2060 Table 6: The RTSP message-body headers 2062 The extension-header mechanism allows additional message-header 2063 fields to be defined without changing the protocol, but these fields 2064 cannot be assumed to be recognizable by the recipient. Unrecognized 2065 header fields MUST be ignored by the recipient and forwarded by 2066 proxies. 2068 9.2. Message Body 2070 RTSP message with an message body MUST include the Content-Type and 2071 Content-Length headers. When a message body is included with a 2072 message, the data type of that content data is determined via the 2073 header fields Content-Type and Content-Encoding. 2075 Content-Type specifies the media type of the underlying data. 2076 Content-Encoding may be used to indicate any additional content 2077 codings applied to the data, usually for the purpose of data 2078 compression, that are a property of the requested resource. There is 2079 no default encoding. 2081 The Content-Length of a message is the length of the content, 2082 measured in bytes. 2084 10. Connections 2086 RTSP requests can be transmitted using the two different connection 2087 scenarios listed below: 2089 o persistent - a transport connection is used for several request/ 2090 response transactions; 2092 o transient - a transport connection is used for a single request/ 2093 response transaction. 2095 RFC 2326 attempted to specify an optional mechanism for transmitting 2096 RTSP messages in connectionless mode over a transport protocol such 2097 as UDP. However, it was not specified in sufficient detail to allow 2098 for interoperable implementations. In an attempt to reduce 2099 complexity and scope, and due to lack of interest, RTSP 2.0 does not 2100 attempt to define a mechanism for supporting RTSP over UDP or other 2101 connectionless transport protocols. A side-effect of this is that 2102 RTSP requests MUST NOT be sent to multicast groups since no 2103 connection can be established with a specific receiver in multicast 2104 environments. 2106 Certain RTSP headers, such as the CSeq header (Section 16.19), which 2107 may appear to be relevant only to connectionless transport scenarios 2108 are still retained and must be implemented according to the 2109 specification. In the case of CSeq, it is quite useful for matching 2110 responses to requests if the requests are pipelined (see Section 12). 2111 It is also useful in proxies for keeping track of the different 2112 requests when aggregating several client requests on a single TCP 2113 connection. 2115 10.1. Reliability and Acknowledgements 2117 When RTSP messages are transmitted using reliable transport 2118 protocols, they MUST NOT be retransmitted at the RTSP protocol level. 2119 Instead, the implementation must rely on the underlying transport to 2120 provide reliability. The RTSP implementation may use any indication 2121 of reception acknowledgement of the message from the underlying 2122 transport protocols to optimize the RTSP behavior. 2124 If both the underlying reliable transport such as TCP and the RTSP 2125 application retransmit requests, each packet loss or message loss 2126 may result in two retransmissions. The receiver typically cannot 2127 take advantage of the application-layer retransmission since the 2128 transport stack will not deliver the application-layer 2129 retransmission before the first attempt has reached the receiver. 2130 If the packet loss is caused by congestion, multiple 2131 retransmissions at different layers will exacerbate the 2132 congestion. 2134 Lack of acknowledgement of an RTSP request should be handled within 2135 the constraints of the connection timeout considerations described 2136 below (Section 10.4). 2138 10.2. Using Connections 2140 A TCP transport can be used for both persistent connections (for 2141 several message exchanges) and transient connections (for a single 2142 message exchange). Implementations of this specification MUST 2143 support RTSP over TCP. The scheme of the RTSP URI (Section 4.2) 2144 indicates the default port that the server will listen on if the port 2145 is not explicitly given. 2147 A server MUST handle both persistent and transient connections. 2149 Transient connections facilitate mechanisms for fault tolerance. 2150 They also allow for application layer mobility. A server and 2151 client pair that support transient connections can survive the 2152 loss of a TCP connection; e.g., due to a NAT timeout. When the 2153 client has discovered that the TCP connection has been lost, it 2154 can set up a new one when there is need to communicate again. 2156 A persistent connection is RECOMMENDED to be used for all 2157 transactions between the server and client, including messages for 2158 multiple RTSP sessions. However, a persistent connection MAY be 2159 closed after a few message exchanges. For example, a client may use 2160 a persistent connection for the initial SETUP and PLAY message 2161 exchanges in a session and then close the connection. Later, when 2162 the client wishes to send a new request, such as a PAUSE for the 2163 session, a new connection would be opened. This connection may 2164 either be transient or persistent. 2166 An RTSP agent SHOULD NOT have more than one connection to the server 2167 at any given point. If a client or proxy handles multiple RTSP 2168 sessions on the same server, it SHOULD use only one connection for 2169 managing those sessions. 2171 This saves connection resources on the server. It also reduces 2172 complexity by and enabling the server to maintain less state about 2173 its sessions and connections. 2175 RTSP allows a server to send requests to a client. However, this can 2176 be supported only if a client establishes a persistent connection 2177 with the server. In cases where a persistent connection does not 2178 exist between a server and its client, due to the lack of a signaling 2179 channel the server may be forced to silently discard RTSP messages, 2180 and may even drop an RTSP session without notifying the client. An 2181 example of such a case is when the server desires to send a REDIRECT 2182 request for an RTSP session to the client but is not able to do so 2183 because it cannot reach the client. A server that attempt to send a 2184 request to a client that has no connection currently to the server 2185 SHOULD discard the request directly, it MAY queue it for later 2186 delivery. However, if the server queue the request it should when 2187 adding additional requests to the queue ensure to remove older 2188 requests that are now redundant. 2190 Without a persistent connection between the client and the server, 2191 the media server has no reliable way of reaching the client. 2192 Because the likely failure of server to client established 2193 connections the server will not even attempt establishing any 2194 connection. 2196 The sending of client and server requests can be asynchronous events. 2197 To avoid deadlock situations both client and server MUST be able to 2198 send and receive requests simultaneously. As an RTSP response may be 2199 queued up for transmission, reception or processing behind the peer 2200 RTSP agent's own requests, all RTSP agents are required to have a 2201 certain capability of handling outstanding messages. The issue is 2202 that outstanding requests may timeout despite them being processed by 2203 the peer due to the response is caught in the queue behind a number 2204 of request that the RTSP agent is processing but that take some time 2205 to complete. To avoid this problem an RTSP agent is recommended to 2206 buffer incoming messages locally so that any response messages can be 2207 processed immediately upon reception. If responses are separated 2208 from requests and directly forwarded for processing can not only the 2209 result be used immediately, the state associated with that 2210 outstanding request can also be released. However, buffering a 2211 number of requests on the receiving RTSP agent consumes resources and 2212 enables a resource exhaustion attack on the agent. Therefore this 2213 buffer should be limited so that an unreasonable number of requests 2214 or total message size is not allowed to consume the receiving agents 2215 resources. In most APIs having the receiving agent stop reading from 2216 the TCP socket will result in TCP's window being clamped. Thus 2217 forcing the buffering on the sending agent when the load is larger 2218 than expected. However, as both RTSP message sizes and frequency may 2219 be changed in the future by protocol extension an agent should be 2220 careful against taking harsher measurements against a potential 2221 attack. When under attack an RTSP agent can close TCP connections 2222 and release state associated with that TCP connection. 2224 To provide some guidance on what is reasonable the following 2225 guidelines are given. An RTSP agent should not have more than 10 2226 outstanding requests per RTSP session. An RTSP agent should not have 2227 more than 10 outstanding requests that aren't related to an RTSP 2228 session or that are requesting to create an RTSP session. 2230 In light of the above, it is RECOMMENDED that clients use persistent 2231 connections whenever possible. A client that supports persistent 2232 connections MAY "pipeline" its requests (see Section 12). 2234 10.3. Closing Connections 2236 The client MAY close a connection at any point when no outstanding 2237 request/response transactions exist for any RTSP session being 2238 managed through the connection. The server, however, SHOULD NOT 2239 close a connection until all RTSP sessions being managed through the 2240 connection have been timed out (Section 16.47). A server SHOULD NOT 2241 close a connection immediately after responding to a session-level 2242 TEARDOWN request for the last RTSP session being controlled through 2243 the connection. Instead, it should wait for a reasonable amount of 2244 time for the client to receive the TEARDOWN response, take 2245 appropriate action, and initiate the connection closing. The server 2246 SHOULD wait at least 10 seconds after sending the TEARDOWN response 2247 before closing the connection. 2249 This is to ensure that the client has time to issue a SETUP for a 2250 new session on the existing connection after having torn the last 2251 one down. 10 seconds should give the client ample opportunity to 2252 get its message to the server. 2254 A server SHOULD NOT close the connection directly as a result of 2255 responding to a request with an error code. 2257 Certain error responses such as "460 Only Aggregate Operation 2258 Allowed" (Section 15.4.25) are used for negotiating capabilities 2259 of a server with respect to content or other factors. In such 2260 cases, it is inefficient for the server to close a connection on 2261 an error response. Also, such behavior would prevent 2262 implementation of advanced/special types of requests or result in 2263 extra overhead for the client when testing for new features. On 2264 the flip side, keeping connections open after sending an error 2265 response poses a Denial of Service security risk (Section 21). 2267 If a server closes a connection while the client is attempting to 2268 send a new request, the client will have to close its current 2269 connection, establish a new connection and send its request over the 2270 new connection. 2272 An RTSP message should not be terminated by closing the connection. 2273 Such a message MAY be considered to be incomplete by the receiver and 2274 discarded. An RTSP message is properly terminated as defined in 2275 Section 5. 2277 10.4. Timing Out Connections and RTSP Messages 2279 Receivers of a request (responder) SHOULD respond to requests in a 2280 timely manner even when a reliable transport such as TCP is used. 2281 Similarly, the sender of a request (requester) SHOULD wait for a 2282 sufficient time for a response before concluding that the responder 2283 will not be acting upon its request. 2285 A responder SHOULD respond to all requests within 5 seconds. If the 2286 responder recognizes that processing of a request will take longer 2287 than 5 seconds, it SHOULD send a 100 (Continue) response as soon as 2288 possible. It SHOULD continue sending a 100 response every 5 seconds 2289 thereafter until it is ready to send the final response to the 2290 requester. After sending a 100 response, the receiver MUST send a 2291 final response indicating the success or failure of the request. 2293 A requester SHOULD wait at least 10 seconds for a response before 2294 concluding that the responder will not be responding to its request. 2295 After receiving a 100 response, the requester SHOULD continue waiting 2296 for further responses. If more than 10 seconds elapses without 2297 receiving any response, the requester MAY assume that the responder 2298 is unresponsive and abort the connection. 2300 A requester SHOULD wait longer than 10 seconds for a response if it 2301 is experiencing significant transport delays on its connection to the 2302 responder. The requester is capable of determining the RTT of the 2303 request/response cycle using the Timestamp header (Section 16.51) in 2304 any RTSP request. 2306 10 seconds was chosen for the following reasons. It gives TCP 2307 time to perform a couple of retransmissions, even if operating on 2308 default values. It is short enough that users may not abandon the 2309 process themselves. However, it should be noted that 10 seconds 2310 can be aggressive on certain type of networks. The 5 seconds 2311 value for 1xx messages is half the timeout giving a reasonable 2312 change of successful delivery before timeout happens on the 2313 requester side. 2315 10.5. Showing Liveness 2317 The mechanisms for showing liveness of the client is, any RTSP 2318 request with a Session header, if RTP & RTCP is used an RTCP message, 2319 or through any other used media protocol capable of indicating 2320 liveness of the RTSP client. It is RECOMMENDED that a client does 2321 not wait to the last second of the timeout before trying to send a 2322 liveness message. The RTSP message may be lost or when using 2323 reliable protocols, such as TCP, the message may take some time to 2324 arrive safely at the receiver. To show liveness between RTSP request 2325 issued to accomplish other things, the following mechanisms can be 2326 used, in descending order of preference: 2328 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 2329 RTCP is used to report transport statistics, it MUST also work 2330 as keep alive. The server can determine the client by used 2331 network address and port together with the fact that the client 2332 is reporting on the servers SSRC(s). A downside of using RTCP 2333 is that it only gives statistical guarantees to reach the 2334 server. However, that probability is so low that it can be 2335 ignored in most cases. For example, a session with 60 seconds 2336 timeout and enough bitrate assigned to RTCP messages to send a 2337 message from client to server on average every 5 seconds. That 2338 client have for a network with 5 % packet loss, the probability 2339 to fail showing liveness sign in that session within the 2340 timeout interval of 2.4*E-16. In sessions with shorter timeout 2341 times, or much higher packet loss, or small RTCP bandwidths 2342 SHOULD also use any of the mechanisms below. 2344 SET_PARAMETER: When using SET_PARAMETER for keep alive, no body 2345 SHOULD be included. This method is the RECOMMENDED RTSP method 2346 to use in request only intended to perform keep-alive. 2348 GET_PARAMETER: When using GET_PARAMETER for keep alive, no body 2349 SHOULD be included. 2351 OPTIONS: This method is also usable, but it causes the server to 2352 perform more unnecessary processing and result in bigger 2353 responses than necessary for the task. The reason is that the 2354 server needs to determine the capabilities associated with the 2355 media resource to correctly populate the Public and Allow 2356 headers. 2358 The timeout parameter MAY be included in a SETUP response, and MUST 2359 NOT be included in requests. The server uses it to indicate to the 2360 client how long the server is prepared to wait between RTSP commands 2361 or other signs of life before closing the session due to lack of 2362 activity (see below and Appendix B). The timeout is measured in 2363 seconds, with a default of 60 seconds. The length of the session 2364 timeout MUST NOT be changed in an established session. 2366 10.6. Use of IPv6 2368 Explicit IPv6 support was not present in RTSP 1.0 (RFC 2326). RTSP 2369 2.0 has been updated for explicit IPv6 support. Implementations of 2370 RTSP 2.0 MUST understand literal IPv6 addresses in URIs and headers. 2372 11. Capability Handling 2374 This section describes the available capability handling mechanism 2375 which allows RTSP to be extended. Extensions to this version of the 2376 protocol are basically done in two ways. First, new headers can be 2377 added. Secondly, new methods can be added. The capability handling 2378 mechanism is designed to handle both cases. 2380 When a method is added, the involved parties can use the OPTIONS 2381 method to discover whether it is supported. This is done by issuing 2382 a OPTIONS request to the other party. Depending on the URI it will 2383 either apply in regards to a certain media resource, the whole server 2384 in general, or simply the next hop. The OPTIONS response MUST 2385 contain a Public header which declares all methods supported for the 2386 indicated resource. 2388 It is not necessary to use OPTIONS to discover support of a method, 2389 the client could simply try the method. If the receiver of the 2390 request does not support the method it will respond with an error 2391 code indicating the method is either not implemented (501) or does 2392 not apply for the resource (405). The choice between the two 2393 discovery methods depends on the requirements of the service. 2395 Feature-Tags are defined to handle functionality additions that are 2396 not new methods. Each feature-tag represents a certain block of 2397 functionality. The amount of functionality that a feature-tag 2398 represents can vary significantly. A feature-tag can for example 2399 represent the functionality a single RTSP header provides. Another 2400 feature-tag can represent much more functionality, such as the 2401 "play.basic" feature-tag which represents the minimal media delivery 2402 for playback implementation. 2404 Feature-tags are used to determine whether the client, server or 2405 proxy supports the functionality that is necessary to achieve the 2406 desired service. To determine support of a feature-tag, several 2407 different headers can be used, each explained below: 2409 Supported: This header is used to determine the complete set of 2410 functionality that both client and server have. The intended 2411 usage is to determine before one needs to use a functionality 2412 that it is supported. It can be used in any method, however, 2413 OPTIONS is the most suitable one as it at the same time 2414 determines all methods that are implemented. When sending a 2415 request the requester declares all its capabilities by 2416 including all supported feature-tags. This results in that the 2417 receiver learns the requesters feature support. The receiver 2418 then includes its set of features in the response. 2420 Proxy-Supported: This header is used similar to the Supported 2421 header, but instead of giving the supported functionality of 2422 the client or server it provides both the requester and the 2423 responder a view of what functionality the proxy chain between 2424 the two supports. Proxies are required to add this header 2425 whenever the Supported header is present, but proxies may 2426 independently of the requester add it. 2428 Require: The header can be included in any request where the end- 2429 point, i.e. the client or server, is required to understand the 2430 feature to correctly perform the request. This can, for 2431 example, be a SETUP request where the server is required to 2432 understand a certain parameter to be able to set up the media 2433 delivery correctly. Ignoring this parameter would not have the 2434 desired effect and is not acceptable. Therefore the end-point 2435 receiving a request containing a Require MUST negatively 2436 acknowledge any feature that it does not understand and not 2437 perform the request. The response in cases where features are 2438 not supported are 551 (Option Not Supported). Also the 2439 features that are not supported are given in the Unsupported 2440 header in the response. 2442 Proxy-Require: This header has the same purpose and workings as 2443 Require except that it only applies to proxies and not the end- 2444 point. Features that needs to be supported by both proxies and 2445 end-point needs to be included in both the Require and Proxy- 2446 Require header. 2448 Unsupported: This header is used in a 551 error response, to 2449 indicate which features were not supported. Such a response is 2450 only the result of the usage of the Require and/or Proxy- 2451 Require header where one or more feature where not supported. 2452 This information allows the requester to make the best of 2453 situations as it knows which features are not supported. 2455 12. Pipelining Support 2457 Pipelining is a general method to improve performance of request 2458 response protocols by allowing the requesting agent to have more than 2459 one request outstanding and send them over the same persistent 2460 connection. For RTSP, where the relative order of requests will 2461 matter, it is important to maintain the order of the requests. 2462 Because of this, the responding agent MUST process the incoming 2463 requests in their sending order. The sending order can be determined 2464 by the CSeq header and its sequence number. For TCP the delivery 2465 order will be the same as the sending order. The processing of the 2466 request MUST also have been finished before processing the next 2467 request from the same agent. The responses MUST be sent in the order 2468 the requests was processed. 2470 RTSP 2.0 has extended support for pipelining compared to RTSP 1.0. 2471 The major improvement is to allow all requests to setup and initiate 2472 media delivery to be pipelined after each other. This is 2473 accomplished by the utilization of the Pipelined-Requests header (see 2474 Section 16.32). This header allows a client to request that two or 2475 more requests are processed in the same RTSP session context which 2476 the first request creates. In other words, a client can request that 2477 two or more media streams are set-up and then played without needing 2478 to wait for a single response. This speeds up the initial startup 2479 time for an RTSP session with at least one RTT. 2481 If a pipelined request builds on the successful completion of one or 2482 more prior requests the requester must verify that all requests were 2483 executed as expected. A common example will be two SETUP requests 2484 and a PLAY request. In case one of the SETUP fails unexpectedly, the 2485 PLAY request can still be successfully executed. However, not as 2486 expected by the requesting client as only a single media instead of 2487 two will be played. In this case the client can send a PAUSE 2488 request, correct the failing SETUP request and then request it to be 2489 played. 2491 13. Method Definitions 2493 The method indicates what is to be performed on the resource 2494 identified by the Request-URI. The method name is case-sensitive. 2495 New methods may be defined in the future. Method names MUST NOT 2496 start with a $ character (decimal 24) and MUST be a token as defined 2497 by the ABNF [RFC5234] in the syntax chapter Section 20. The methods 2498 are summarized in Table 7. 2500 +---------------+-----------+--------+-------------+-------------+ 2501 | method | direction | object | Server req. | Client req. | 2502 +---------------+-----------+--------+-------------+-------------+ 2503 | DESCRIBE | C -> S | P,S | recommended | recommended | 2504 | | | | | | 2505 | GET_PARAMETER | C -> S | P,S | optional | optional | 2506 | | | | | | 2507 | | S -> C | P,S | optional | optional | 2508 | | | | | | 2509 | OPTIONS | C -> S | P,S | required | required | 2510 | | | | | | 2511 | | S -> C | P,S | optional | optional | 2512 | | | | | | 2513 | PAUSE | C -> S | P,S | required | required | 2514 | | | | | | 2515 | PLAY | C -> S | P,S | required | required | 2516 | | | | | | 2517 | PLAY_NOTIFY | S -> C | P,S | required | required | 2518 | | | | | | 2519 | REDIRECT | S -> C | P,S | optional | required | 2520 | | | | | | 2521 | SETUP | C -> S | S | required | required | 2522 | | | | | | 2523 | SET_PARAMETER | C -> S | P,S | required | optional | 2524 | | | | | | 2525 | | S -> C | P,S | optional | optional | 2526 | | | | | | 2527 | TEARDOWN | C -> S | P,S | required | required | 2528 | | | | | | 2529 | | S -> C | | required | required | 2530 +---------------+-----------+--------+-------------+-------------+ 2532 Table 7: Overview of RTSP methods, their direction, and what objects 2533 (P: presentation, S: stream) they operate on. Legend: R=Respond, 2534 Sd=Send, Opt: Optional, Req: Required 2536 Note on Table 7: GET_PARAMETER is recommended, but not required. 2537 For example, a fully functional server can be built to deliver 2538 media without any parameters. SET_PARAMETER is required, however, 2539 due to its usage for keep-alive. PAUSE is now required due to 2540 that it is the only way of getting out of the state machines play 2541 state without terminating the whole session. 2543 If an RTSP agent does not support a particular method, it MUST return 2544 501 (Not Implemented) and the requesting RTSP agent, in turn, SHOULD 2545 NOT try this method again for the given agent / resource combination. 2546 An RTSP proxy who's main function is to log or audit and not modify 2547 transport or media handling in any way MAY forward RTSP messages with 2548 unknown methods. Note, the proxy still needs to perform the minimal 2549 required processing, like adding the Via header. 2551 13.1. OPTIONS 2553 The semantics of the RTSP OPTIONS method is similar to that of the 2554 HTTP OPTIONS method described in [H9.2]. In RTSP however, OPTIONS is 2555 bi-directional, in that a client can request it to a server and vice 2556 versa. A client MUST implement the capability to send an OPTIONS 2557 request and a server or a proxy MUST implement the capability to 2558 respond to an OPTIONS request. The client, server or proxy MAY also 2559 implement the converse of their required capability. 2561 An OPTIONS request may be issued at any time. Such a request does 2562 not modify the session state. However, it may prolong the session 2563 lifespan (see below). The URI in an OPTIONS request determines the 2564 scope of the request and the corresponding response. If the Request- 2565 URI refers to a specific media resource on a given host, the scope is 2566 limited to the set of methods supported for that media resource by 2567 the indicated RTSP agent. A Request-URI with only the host address 2568 limits the scope to the specified RTSP agent's general capabilities 2569 without regard to any specific media. If the Request-URI is an 2570 asterisk ("*"), the scope is limited to the general capabilities of 2571 the next hop (i.e. the RTSP agent in direct communication with the 2572 request sender). 2574 Regardless of scope of the request, the Public header MUST always be 2575 included in the OPTIONS response listing the methods that are 2576 supported by the responding RTSP agent. In addition, if the scope of 2577 the request is limited to a media resource, the Allow header MUST be 2578 included in the response to enumerate the set of methods that are 2579 allowed for that resource unless the set of methods completely 2580 matches the set in the Public header. If the given resource is not 2581 available, the RTSP agent SHOULD return an appropriate response code 2582 such as 3rr or 4xx. The Supported header MAY be included in the 2583 request to query the set of features that are supported by the 2584 responding RTSP agent. 2586 The OPTIONS method can be used to keep an RTSP session alive. 2587 However, it is not the preferred means of session keep-alive 2588 signaling, see Section 16.47. An OPTIONS request intended for 2589 keeping alive an RTSP session MUST include the Session header with 2590 the associated session ID. Such a request SHOULD also use the media 2591 or the aggregated control URI as the Request-URI. 2593 Example: 2595 C->S: OPTIONS rtsp://server.example.com RTSP/2.0 2596 CSeq: 1 2597 User-Agent: PhonyClient/1.2 2598 Proxy-Require: gzipped-messages 2599 Supported: play.basic 2601 S->C: RTSP/2.0 200 OK 2602 CSeq: 1 2603 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS 2604 Supported: play.basic, setup.rtp.rtcp.mux, play.scale 2605 Server: PhonyServer/1.1 2607 Note that some of the feature-tags in Supported and Proxy-Require are 2608 fictional features. 2610 13.2. DESCRIBE 2612 The DESCRIBE method is used to retrieve the description of a 2613 presentation or media object from a server. The Request-URI of the 2614 DESCRIBE request identifies the media resource of interest. The 2615 client MAY include the Accept header in the request to list the 2616 description formats that it understands. The server MUST respond 2617 with a description of the requested resource and return the 2618 description in the message body of the response. The DESCRIBE reply- 2619 response pair constitutes the media initialization phase of RTSP. 2621 Example: 2623 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/2.0 2624 CSeq: 312 2625 User-Agent: PhonyClient 1.2 2626 Accept: application/sdp, application/example 2628 S->C: RTSP/2.0 200 OK 2629 CSeq: 312 2630 Date: Thu, 23 Jan 1997 15:35:06 GMT 2631 Server: PhonyServer 1.1 2632 Content-Base: rtsp://server.example.com/fizzle/foo/ 2633 Content-Type: application/sdp 2634 Content-Length: 358 2636 v=0 2637 o=mhandley 2890844526 2890842807 IN IP4 192.0.2.46 2638 s=SDP Seminar 2639 i=A Seminar on the session description protocol 2640 u=http://www.example.com/lectures/sdp.ps 2641 e=seminar@example.com (Seminar Management) 2642 c=IN IP4 0.0.0.0 2643 a=control:* 2644 t=2873397496 2873404696 2645 m=audio 3456 RTP/AVP 0 2646 a=control:audio 2647 m=video 2232 RTP/AVP 31 2648 a=control:video 2650 The DESCRIBE response SHOULD contain all media initialization 2651 information for the resource(s) that it describes. Servers SHOULD 2652 NOT use the DESCRIBE response as a means of media indirection by 2653 having the description point at another server, instead usage of 3rr 2654 responses are recommended. 2656 By forcing a DESCRIBE response to contain all media initialization 2657 for the set of streams that it describes, and discouraging the use 2658 of DESCRIBE for media indirection, any looping problems can be 2659 avoided that might have resulted from other approaches. 2661 Media initialization is a requirement for any RTSP-based system, but 2662 the RTSP specification does not dictate that this is required to be 2663 done via the DESCRIBE method. There are three ways that an RTSP 2664 client may receive initialization information: 2666 o via an RTSP DESCRIBE request 2668 o via some other protocol (HTTP, email attachment, etc.) 2669 o via some form of user interface 2671 If a client obtains a valid description from an alternate source, the 2672 client MAY use this description for initialization purposes without 2673 issuing a DESCRIBE request for the same media. The client should use 2674 any MTag to either validate the presentation description or make the 2675 session establishment conditional on being valid. 2677 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2678 and highly recommended that minimal clients support the ability to 2679 act as "helper applications" that accept a media initialization file 2680 from a user interface, and/or other means that are appropriate to the 2681 operating environment of the clients. 2683 13.3. SETUP 2685 The SETUP request for an URI specifies the transport mechanism to be 2686 used for the streamed media. The SETUP method may be used in two 2687 different cases; Create an RTSP session and change the transport 2688 parameters of already set up media stream. SETUP can be used in all 2689 three states; INIT, and READY, for both purposes and in PLAY to 2690 change the transport parameters. There is also a third possible 2691 usage for the SETUP method which is not specified in this memo: 2692 adding a media to a session. Using SETUP to add media to an existing 2693 session, when the session is in PLAY state, is unspecified. 2695 The Transport header, see Section 16.52, specifies the media 2696 transport parameters acceptable to the client for data transmission; 2697 the response will contain the transport parameters selected by the 2698 server. This allows the client to enumerate in descending order of 2699 preference the transport mechanisms and parameters acceptable to it, 2700 while the server can select the most appropriate. It is expected 2701 that the session description format used will enable the client to 2702 select a limited number possible configurations that are offered to 2703 the server to choose from. All transport related parameters shall be 2704 included in the Transport header, the use of other headers for this 2705 purpose is discouraged due to middleboxes, such as firewalls or NATs. 2707 For the benefit of any intervening firewalls, a client MUST indicate 2708 the known transport parameters, even if it has no influence over 2709 these parameters, for example, where the server advertises a fixed 2710 multicast address as destination. 2712 Since SETUP includes all transport initialization information, 2713 firewalls and other intermediate network devices (which need this 2714 information) are spared the more arduous task of parsing the 2715 DESCRIBE response, which has been reserved for media 2716 initialization. 2718 The client MUST include the Accept-Ranges header in the request 2719 indicating all supported unit formats in the Range header. This 2720 allows the server to know which format it may use in future session 2721 related responses, such as PLAY response without any range in the 2722 request. If the client does not support a time format necessary for 2723 the presentation the server MUST respond using 456 (Header Field Not 2724 Valid for Resource) and include the Accept-Ranges header with the 2725 range unit formats supported for the resource. 2727 In a SETUP response the server MUST include the Accept-Ranges header 2728 (see Section 16.5) to indicate which time formats that are acceptable 2729 to use for this media resource. 2731 The SETUP response 200 OK MUST include the Media-Properties header 2732 (see Section 16.28 ). The combination of the parameters of the 2733 Media-Properties header indicate the nature of the content present in 2734 the session (see also Section 4.9). For example, a live stream with 2735 time shifting is indicated by 2737 o Random Access set to Random-Access, 2739 o Content Modifications set to Time Progressing, 2741 o Retention set to Time-Duration (with specific recording window 2742 time value). 2744 The SETUP response 200 OK MUST include the Media-Range header (see 2745 Section 16.29) if the media is Time-Progressing. 2747 A basic example for SETUP: 2749 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 2750 CSeq: 302 2751 Transport: RTP/AVP;unicast;dest_addr=":4588"/":4589", 2752 RTP/AVP/TCP;unicast;interleaved=0-1 2753 Accept-Ranges: NPT, UTC 2754 User-Agent: PhonyClient/1.2 2756 S->C: RTSP/2.0 200 OK 2757 CSeq: 302 2758 Date: Thu, 23 Jan 1997 15:35:06 GMT 2759 Server: PhonyServer 1.1 2760 Session: 47112344;timeout=60 2761 Transport: RTP/AVP;unicast;dest_addr="192.0.2.53:4588"/ 2762 "192.0.2.53:4589"; src_addr="198.51.100.241:6256"/ 2763 "198.51.100.241:6257"; ssrc=2A3F93ED 2764 Accept-Ranges: NPT 2765 Media-Properties: Random-Access=3.2, Time-Progressing, 2766 Time-Duration=3600.0 2767 Media-Range: npt=0-2893.23 2769 In the above example the client wants to create an RTSP session 2770 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2771 The transport parameters acceptable to the client is either RTP/AVP/ 2772 UDP (UDP per default) to be received on client port 4588 and 4589 at 2773 the address the RTSP setup connection comes from or RTP/AVP 2774 interleaved on the RTSP control channel. The server selects the RTP/ 2775 AVP/UDP transport and adds the address and ports it will send and 2776 received RTP and RTCP from, and the RTP SSRC that will be used by the 2777 server. 2779 The server MUST generate a session identifier in response to a 2780 successful SETUP request, unless a SETUP request to a server includes 2781 a session identifier or an Pipelined-Requests header referencing an 2782 existing session context, in which case the server MUST bundle this 2783 setup request into the existing session (aggregated session) or 2784 return error 459 (Aggregate Operation Not Allowed) (see 2785 Section 15.4.24). An Aggregate control URI MUST be used to control 2786 an aggregated session. This URI MUST be different from the stream 2787 control URIs of the individual media streams included in the 2788 aggregate. The Aggregate control URI is to be specified by the 2789 session description if the server supports aggregated control and 2790 aggregated control is desired for the session. However, even if 2791 aggregated control is offered the client MAY chose to not set up the 2792 session in aggregated control. If an Aggregate control URI is not 2793 specified in the session description, it is normally an indication 2794 that non-aggregated control should be used. The SETUP of media 2795 streams in an aggregate which has not been given an aggregated 2796 control URI is unspecified. 2798 While the session ID sometimes carries enough information for 2799 aggregate control of a session, the Aggregate control URI is still 2800 important for some methods such as SET_PARAMETER where the control 2801 URI enables the resource in question to be easily identified. The 2802 Aggregate control URI is also useful for proxies, enabling them to 2803 route the request to the appropriate server, and for logging, 2804 where it is useful to note the actual resource that a request was 2805 operating on. 2807 A session will exist until it is either removed by a TEARDOWN request 2808 or is timed-out by the server. The server MAY remove a session that 2809 has not demonstrated liveness signs from the client(s) within a 2810 certain timeout period. The default timeout value is 60 seconds; the 2811 server MAY set this to a different value and indicate so in the 2812 timeout field of the Session header in the SETUP response. For 2813 further discussion see Section 16.47. Signs of liveness for an RTSP 2814 session are: 2816 o Any RTSP request from a client which includes a Session header 2817 with that session's ID. 2819 o If RTP is used as a transport for the underlying media streams, an 2820 RTCP sender or receiver report from the client(s) for any of the 2821 media streams in that RTSP session. RTCP Sender Reports may for 2822 example be received in sessions where the server is invited into a 2823 conference session and is as valid for keep-alive. 2825 If a SETUP request on a session fails for any reason, the session 2826 state, as well as transport and other parameters for associated 2827 streams MUST remain unchanged from their values as if the SETUP 2828 request had never been received by the server. 2830 13.3.1. Changing Transport Parameters 2832 A client MAY issue a SETUP request for a stream that is already set 2833 up or playing in the session to change transport parameters, which a 2834 server MAY allow. If it does not allow changing of parameters, it 2835 MUST respond with error 455 (Method Not Valid In This State). 2836 Reasons to support changing transport parameters, is to allow for 2837 application layer mobility and flexibility to utilize the best 2838 available transport as it becomes available. If a client receives a 2839 455 when trying to change transport parameters while the server is in 2840 play state, it MAY try to put the server in ready state using PAUSE, 2841 before issuing the SETUP request again. If also that fails the 2842 changing of transport parameters will require that the client 2843 performs a TEARDOWN of the affected media and then setting it up 2844 again. In aggregated session avoiding tearing down all the media at 2845 the same time will avoid the creation of a new session. 2847 All transport parameters MAY be changed. However, the primary usage 2848 expected is to either change transport protocol completely, like 2849 switching from Interleaved TCP mode to UDP or vice versa or change 2850 delivery address. 2852 In a SETUP response for a request to change the transport parameters 2853 while in Play state, the server MUST include the Range to indicate 2854 from what point the new transport parameters are used. Further, if 2855 RTP is used for delivery, the server MUST also include the RTP-Info 2856 header to indicate from what timestamp and RTP sequence number the 2857 change has taken place. If both RTP-Info and Range is included in 2858 the response the "rtp_time" parameter and start point in the Range 2859 header MUST be for the corresponding time, i.e. be used in the same 2860 way as for PLAY to ensure the correct synchronization information is 2861 available. 2863 If the transport parameters change while in PLAY state results in a 2864 change of synchronization related information, for example changing 2865 RTP SSRC, the server MUST provide in the SETUP response the necessary 2866 synchronization information. However, the server is RECOMMENDED to 2867 avoid changing the synchronization information if possible. 2869 13.4. PLAY 2871 This section describes the usage of the PLAY method in general, for 2872 aggregated sessions, and in different usage scenarios. 2874 13.4.1. General Usage 2876 The PLAY method tells the server to start sending data via the 2877 mechanism specified in SETUP and which part of the media should be 2878 played out. PLAY requests are valid when the session is in READY or 2879 PLAY states. A PLAY request MUST include a Session header to 2880 indicate which session the request applies to. 2882 Upon receipt of the PLAY request, the server MUST position the normal 2883 play time to the beginning of the range specified in the received 2884 Range header and deliver stream data until the end of the range if 2885 given, or until a new PLAY request is received, else to the end of 2886 the media is reached. If no Range header is present in the PLAY 2887 request the server shall play from current pause point until the end 2888 of media. The pause point defaults at session start to the beginning 2889 of the media. For media that is time-progressing and has no 2890 retention, the pause point will always be set equal to NPT "now", 2891 i.e. current delivery point. The pause point may also be set to a 2892 particular point in the media by the PAUSE method, see Section 13.6. 2893 The pause point for media that is currently playing is equal to the 2894 current media position. For time-progressing media with time-limited 2895 retention, if the pause point represents a position that is older 2896 than what is retained by the server, the pause point will be moved to 2897 the oldest retained. 2899 What range values are valid depends on the type of content. For 2900 content that isn't time progressing the range value is valid if the 2901 given range is part of any media within the aggregate. In other 2902 words the valid media range for the aggregate is the union of all of 2903 the media components in the aggregate. If a given range value points 2904 outside of the media, the response MUST be the 457 (Invalid Range) 2905 error code and include the Media-Range header (Section 16.29) with 2906 the valid range for the media. Except for time progressing content 2907 where the client request a start point prior to what is retained, the 2908 start point is adjusted to the oldest retained content. For a start 2909 point that is beyond the media front edge, i.e. beyond the current 2910 value for "now", the server shall adjust the start value to the 2911 current front edge. The Range headers end point value may point 2912 beyond the current media edge. In that case, the server shall 2913 deliver media from the requested (and possibly adjusted) start point 2914 until the provided end-point, or the end of the media is reached 2915 prior to the specified stop point. Please note that if one simply 2916 want to play from a particular start point until the end of media 2917 using an Range header with an implicit stop point is recommended. 2919 If a client request starting playing media at the end-point either 2920 explicitly with a Range header or implicit by having a pause point 2921 that is at the end of the media, a 457 (Invalid Range) error MUST be 2922 sent and include the Media-Range header (Section 16.29). Below is 2923 specified that the Range header also must be included, and will in 2924 the case of Ready-State carry the pause point. Note that this also 2925 applies if the pause point or requested start point is at the 2926 beginning of the media and a Scale header (Section 16.44) is included 2927 with a negative value (playing backwards). 2929 For media with random access properties a client may express its 2930 preference on which policy for start point selection the server shall 2931 use. This is done by including the Seek-Style header (Section 16.45) 2932 in the PLAY request. The Seek-Style applied will effect the content 2933 of the Range header as it will be adjusted to indicate from what 2934 point the media actually is delivered. 2936 A client desiring to play the media from the beginning MUST send a 2937 PLAY request with a Range header pointing at the beginning, e.g. 2938 npt=0-. If a PLAY request is received without a Range header and 2939 media delivery has stopped at the end, the server SHOULD respond with 2940 a 457 "Invalid Range" error response. In that response, the current 2941 pause point MUST be included in a Range header. 2943 All range specifiers in this specification allow for ranges with 2944 implicit start point (e.g. "npt=-30"). When used in a PLAY request, 2945 the server treats this as a request to start/resume delivery from the 2946 current pause point, ending at the end time specified in the Range 2947 header. If the pause point is located later than the given end 2948 value, a 457 (Invalid Range) response MUST be given. 2950 The example below will play seconds 10 through 25. It also request 2951 the server to deliver media from the first Random Access Point prior 2952 to the indicated start point. 2954 C->S: PLAY rtsp://audio.example.com/audio RTSP/2.0 2955 CSeq: 835 2956 Session: 12345678 2957 Range: npt=10-25 2958 Seek-Style: RAP 2959 User-Agent: PhonyClient/1.2 2961 Servers MUST include a "Range" header in any PLAY response, even if 2962 no Range header was present in the request. The response MUST use 2963 the same format as the request's range header contained. If no Range 2964 header was in the request, the format used in any previous PLAY 2965 request within the session SHOULD be used. If no format has been 2966 indicated in a previous request the server MAY use any time format 2967 supported by the media and indicated in the Accept-Ranges header in 2968 the SETUP request. It is RECOMMENDED that NPT is used if supported 2969 by the media. 2971 For any error response to a PLAY request, the server's response 2972 depends on the current session state. If the session is in ready 2973 state, the current pause-point is returned using Range header with 2974 the pause point as the explicit start-point and an implicit end- 2975 point. For time-progressing content where the pause-point moves with 2976 real-time due to limited retention, the current pause point is 2977 returned. For sessions in playing state, the current playout point 2978 and the remaining parts of the range request is returned. For any 2979 media with retention longer than 0 seconds the currently valid Media- 2980 Range header shall also be included in the response. 2982 A PLAY response MAY include a header carrying synchronization 2983 information. As the information necessary is dependent on the media 2984 transport format, further rules specifying the header and its usage 2985 are needed. For RTP the RTP-Info header is specified, see 2986 Section 16.43, and used in the following example. 2988 Here is a simple example for a single audio stream where the client 2989 requests the media starting from 3.52 seconds and to the end. The 2990 server sends a 200 OK response with the actual play time which is 10 2991 ms prior (3.51) and the RTP-Info header that contains the necessary 2992 parameters for the RTP stack. 2994 C->S: PLAY rtsp://example.com/audio RTSP/2.0 2995 CSeq: 836 2996 Session: 12345678 2997 Range: npt=3.52- 2998 User-Agent: PhonyClient/1.2 3000 S->C: RTSP/2.0 200 OK 3001 CSeq: 836 3002 Date: Thu, 23 Jan 1997 15:35:06 GMT 3003 Server: PhonyServer 1.0 3004 Range: npt=3.51-324.39 3005 Seek-Style: First-Prior 3006 RTP-Info:url="rtsp://example.com/audio" 3007 ssrc=0D12F123:seq=14783;rtptime=2345962545 3009 S->C: RTP Packet TS=2345962545 => NPT=3.51 3010 Media duration=0.16 seconds 3012 The server reply with the actual start point that will be delivered. 3013 This may differ from the requested range if alignment of the 3014 requested range to valid frame boundaries is required for the media 3015 source. Note that some media streams in an aggregate may need to be 3016 delivered from even earlier points. Also, some media format have a 3017 very long duration per individual data unit, therefore it might be 3018 necessary for the client to parse the data unit, and select where to 3019 start. The server shall also indicate which policy it uses for 3020 selecting the actual start point by including a Seek-Style header. 3022 In the following example the client receives the first media packet 3023 that stretches all the way up and past the requested playtime. Thus, 3024 it is the client's decision if to render to the user the time between 3025 3.52 and 7.05, or to skip it. In most cases it is probably most 3026 suitable not to render that time period. 3028 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3029 CSeq: 836 3030 Session: 12345678 3031 Range: npt=7.05- User-Agent: PhonyClient/1.2 3033 S->C: RTSP/2.0 200 OK 3034 CSeq: 836 3035 Date: Thu, 23 Jan 1997 15:35:06 GMT 3036 Server: PhonyServer 1.0 3037 Range: npt=3.52- 3038 Seek-Style: First-Prior 3039 RTP-Info:url="rtsp://example.com/audio" 3040 ssrc=0D12F123:seq=14783;rtptime=2345962545 3042 S->C: RTP Packet TS=2345962545 => NPT=3.52 3043 Duration=4.15 seconds 3045 After playing the desired range, the presentation does NOT transition 3046 to the READY state, media delivery simply stops. A PAUSE request 3047 MUST be issued before the stream enters the READY state. A PLAY 3048 request while the stream is still in the PLAYING state is legal, and 3049 can be issued without an intervening PAUSE request. Such a request 3050 MUST replace the current PLAY action with the new one requested, i.e. 3051 being handle the same as the request was received in ready state. In 3052 the case the range in Range header has a implicit start time 3053 (-endtime), the server MUST continue to play from where it currently 3054 was until the specified end point. This is useful to change end at 3055 another point than in the previous request. 3057 The following example plays the whole presentation starting at SMPTE 3058 time code 0:10:20 until the end of the clip. Note: The RTP-Info 3059 headers has been broken into several lines, where following lines 3060 start with whitespace as allowed by the syntax. 3062 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/2.0 3063 CSeq: 833 3064 Session: 12345678 3065 Range: smpte=0:10:20- 3066 User-Agent: PhonyClient/1.2 3068 S->C: RTSP/2.0 200 OK 3069 CSeq: 833 3070 Date: Thu, 23 Jan 1997 15:35:06 GMT 3071 Session: 12345678 3072 Server: PhonyServer 1.0 3073 Range: smpte=0:10:22-0:15:45 3074 Seek-Style: Next 3075 RTP-Info:url="rtsp://example.com/twister.en" 3076 ssrc=0D12F123:seq=14783;rtptime=2345962545 3078 For playing back a recording of a live presentation, it may be 3079 desirable to use clock units: 3081 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/2.0 3082 CSeq: 835 3083 Session: 12345678 3084 Range: clock=19961108T142300Z-19961108T143520Z 3085 User-Agent: PhonyClient/1.2 3087 S->C: RTSP/2.0 200 OK 3088 CSeq: 835 3089 Date: Thu, 23 Jan 1997 15:35:06 GMT 3090 Session: 12345678 3091 Server: PhonyServer 1.0 3092 Range: clock=19961108T142300Z-19961108T143520Z 3093 Seek-Style: Next 3094 RTP-Info:url="rtsp://example.com/meeting.en" 3095 ssrc=0D12F123:seq=53745;rtptime=484589019 3097 13.4.2. Aggregated Sessions 3099 PLAY requests can operate on sessions controlling a single media and 3100 on aggregated sessions controlling multiple media. 3102 In an aggregated session the PLAY request MUST contain an aggregated 3103 control URI. A server MUST response with error 460 (Only Aggregate 3104 Operation Allowed) if the client PLAY Request-URI is for one of the 3105 media. The media in an aggregate MUST be played in sync. If a 3106 client wants individual control of the media, it needs to use 3107 separate RTSP sessions for each media. 3109 For aggregated sessions where the initial SETUP request (creating a 3110 session) is followed by one or more additional SETUP request, a PLAY 3111 request MAY be pipelined after those additional SETUP requests 3112 without awaiting their responses. This procedure can reduce the 3113 delay from start of session establishment until media play-out has 3114 started with one round trip time. However, a client needs to be 3115 aware that using this procedure will result in the playout of the 3116 server state established at the time of processing the PLAY, i.e., 3117 after the processing of all the requests prior to the PLAY request in 3118 the pipeline. This may not be the intended one due to failure of any 3119 of the prior requests. However, a client can easily determine this 3120 based on the responses from those requests. In case of failure, the 3121 client can halt the media playout using PAUSE and try to establish 3122 the intended state again before issuing another PLAY request. 3124 13.4.3. Updating current PLAY Requests 3126 Clients can issue PLAY requests while the stream is in PLAYING state 3127 and thus updating their request. 3129 The important difference compared to a PLAY request in ready state is 3130 the handling of the current play point and how the range header in 3131 request is constructed. The session is actively playing media and 3132 the play point will be moving making the exact time a request will 3133 take action is hard to predict. Depending on how the PLAY header 3134 appears two different cases exist: total replacement or continuation. 3135 A total replacement is signaled by having the first range 3136 specification have an explicit start value, e.g. npt=45- or 3137 npt=45-60, in which case the server stops playout at the current 3138 playout point and then starts delivering media according to the Range 3139 header. This is equivalent to having the client first send a PAUSE 3140 and then a new play request that isn't based on the pause point. In 3141 the case of continuation the first range specifier has an implicit 3142 start point and a explicit stop value (Z), e.g. npt=-60, which 3143 indicate that it MUST convert the range specifier being played prior 3144 to this PLAY request (X to Y) into (X to Z) and continue as this was 3145 the request originally played. If the stop point is beyond the 3146 current delivery point, the server SHALL immediately pause delivery. 3147 As the request has been completed successfully it shall be responded 3148 with 200 OK. A PLAY-Notify with end-of-stream is also sent to 3149 indicate the actual stop point. The pause point is set to requested 3150 stop point. 3152 An example of this behavior. The server has received requests to 3153 play ranges 10 to 15. If the new PLAY request arrives at the server 3154 4 seconds after the previous one, it will take effect while the 3155 server still plays the first range (10-15). Thus changing the 3156 behavior of this range to continue to play to 25 seconds, i.e. the 3157 equivalent single request would be PLAY with range: npt=10-25. 3159 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3160 CSeq: 834 3161 Session: 12345678 3162 Range: npt=10-15 3163 User-Agent: PhonyClient/1.2 3165 S->C: RTSP/2.0 200 OK 3166 CSeq: 834 3167 Date: Thu, 23 Jan 1997 15:35:06 GMT 3168 Session: 12345678 3169 Server: PhonyServer 1.0 3170 Range: npt=10-15 3171 Seek-Style: Next 3172 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3173 ssrc=0D12F123:seq=5712;rtptime=934207921, 3174 url="rtsp://example.com/fizzle/videotrack" 3175 ssrc=789DAF12:seq=57654;rtptime=2792482193 3176 Session: 12345678 3178 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3179 CSeq: 835 3180 Session: 12345678 3181 Range: npt=-25 3182 User-Agent: PhonyClient/1.2 3184 S->C: RTSP/2.0 200 OK 3185 CSeq: 835 3186 Date: Thu, 23 Jan 1997 15:35:09 GMT 3187 Session: 12345678 3188 Server: PhonyServer 1.0 3189 Range: npt=14-25 3190 Seek-Style: Next 3191 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3192 ssrc=0D12F123:seq=5712;rtptime=934239921, 3193 url="rtsp://example.com/fizzle/videotrack" 3194 ssrc=789DAF12:seq=57654;rtptime=2792842193 3195 Session: 12345678 3197 13.4.4. Playing On-Demand Media 3199 On-demand media is indicated by the content of the Media-Properties 3200 header in the SETUP response by (see also Section 16.28): 3202 o Random-Access property is set to Random Access; 3204 o Content Modifications set to Immutable; 3205 o Retention set Unlimited or Time-Limited. 3207 Playing on-demand media follows the general usage as described in 3208 Section 13.4.1. 3210 13.4.5. Playing Dynamic On-Demand Media 3212 Dynamic on-demand media is indicated by the content of the Media- 3213 Properties header in the SETUP response by (see also Section 16.28): 3215 o Random-Access set to Random Access; 3217 o Content Modifications set to dynamic; 3219 o Retention set Unlimited or Time-Limited. 3221 Playing on-demand media follows the general usage as described in 3222 Section 13.4.1 as long as the media has not been changed. 3224 There are two ways for the client to get informed about changes of 3225 media resources in play state. The client will receive a PLAY_NOTIFY 3226 request with Notify-Reason header set to media-properties-update (see 3227 Section 13.5.2. The client can use the value of the Media-Range to 3228 decide further actions, if the Media-Range header is present in the 3229 PLAY_NOTIFY request. The second way is that the client issues a 3230 GET_PARAMETER request without a body but including a Media-Range 3231 header. The 200 OK response MUST include the current Media-Range 3232 header (see Section 16.29). 3234 13.4.6. Playing Live Media 3236 Live media is indicated by the content of the Media-Properties header 3237 in the SETUP response by (see also Section 16.28): 3239 o Random-Access set to no-seeking; 3241 o Content Modifications set to Time-Progressing; 3243 o Retention with Time-Duration set to 0.0. 3245 For live media, the SETUP response 200 OK MUST include the Media- 3246 Range header (see Section 16.29). 3248 A client MAY send PLAY requests without the Range header, if the 3249 request include the Range header it MUST use a symbolic value 3250 representing "now". For NPT that range specification is "npt=now-". 3251 The server MUST include the Range header in the response and it MUST 3252 indicate an explicit time value and not a symbolic value. In other 3253 words npt=now- is not a valid to use in the response. Instead the 3254 time since session start is recommended expressed as an open 3255 interval, e.g. "npt=96.23-". An absolute time value (clock) for the 3256 corresponding time MAY be given, i.e. "clock=20030213T143205Z-". The 3257 UTC clock format can only be used if client has shown support for it 3258 using the Accept-Ranges header. 3260 13.4.7. Playing Live with Recording 3262 Certain media server may offer recording services of live sessions to 3263 their clients. This recording would normally be from the beginning 3264 of the media session. Clients can randomly access the media between 3265 now and the beginning of the media session. This live media with 3266 recording is indicated by the content of the Media-Properties header 3267 in the SETUP response by (see also Section 16.28): 3269 o Random-Access set to random-access; 3271 o Content Modifications set to Time-Progressing; 3273 o Retention set to Time-limited or Unlimited 3275 The SETUP response 200 OK MUST include the Media-Range header (see 3276 Section 16.29) for this type of media. For live media with 3277 recording, the Range header indicates the current delivery point in 3278 the media and the Media-Range header indicates the currently 3279 available media window around the current time. This window can 3280 cover recorded content in the past (seen from current time in the 3281 media) or recorded content in the future (seen from current time in 3282 the media). The server adjusts the delivery point to the requested 3283 border of the window, if the client requests a delivery point that is 3284 located outside the recording windows, e.g., if requested to far in 3285 the past, the server selects the oldest range in the recording. The 3286 considerations in Section 13.5.3 apply, if a client requests delivery 3287 with Scale (Section 16.44) values other than 1.0 (Normal playback 3288 rate) while delivering live media with recording. 3290 13.4.8. Playing Live with Time-Shift 3292 Certain media server may offer time-shift services to their clients. 3293 This time shift records a fixed interval in the past, i.e., a sliding 3294 window recording mechanism, but not past this interval. Clients can 3295 randomly access the media between now and the interval. This live 3296 media with recording is indicated by the content of the Media- 3297 Properties header in the SETUP response by (see also Section 16.28): 3299 o Random-Access set to random-access; 3300 o Content Modifications set to Time-Progressing; 3302 o Retention set to Time-Duration and a value indicating the 3303 recording interval (>0). 3305 The SETUP response 200 OK MUST include the Media-Range header (see 3306 Section 16.29) for this type of media. For live media with recording 3307 the Range header indicates the current time in the media and the 3308 Media Range indicates a window around the current time. This window 3309 can cover recorded content in the past (seen from current time in the 3310 media) or recorded content in the future (seen from current time in 3311 the media). The server adjusts the play point to the requested 3312 border of the window, if the client requests a play point that is 3313 located outside the recording windows, e.g., if requested too far in 3314 the past, the server selects the oldest range in the recording. The 3315 considerations in Section 13.5.3 apply, if a client requests delivery 3316 using a Scale (Section 16.44) value other than 1.0 (Normal playback 3317 rate) while delivering live media with time-shift. 3319 13.5. PLAY_NOTIFY 3321 The PLAY_NOTIFY method is issued by a server to inform a client about 3322 an asynchronously event for a session in play state. The Session 3323 header MUST be presented in a PLAY_NOTIFY request and indicates the 3324 scope of the request. Sending of PLAY_NOTIFY requests requires a 3325 persistent connection between server and client, otherwise there is 3326 no way for the server to send this request method to the client. 3328 PLAY_NOTIFY requests have an end-to-end (i.e. server to client) 3329 scope, as they carry the Session header, and apply only to the given 3330 session. The client SHOULD immediately return a response to the 3331 server. 3333 PLAY_NOTIFY requests MAY be used with a message body, depending on 3334 the value of the Notify-Reason header. It is described in the 3335 particular section for each Notify-Reason if a message body is used. 3336 However, currently there is no Notify-Reason that allows using a 3337 message body. There is in this case a need to obey some limitations 3338 when adding new Notify-Reasons that intend to use a message body: The 3339 server can send any type of message body, but it is not ensured that 3340 the client can understand the received message body. This is related 3341 to DESCRIBE (see Section 13.2 ), but in this particular case the 3342 client can state its acceptable message bodies by using the Accept 3343 header. In the case of PLAY_NOTIFY, the server does not know which 3344 message bodies are understood by the client. 3346 The Notify-Reason header (see Section 16.31) specifies the reason why 3347 the server sends the PLAY_NOTIFY request. This is extensible and new 3348 reasons MAY be added in the future. In case the client does not 3349 understand the reason for the notification it MUST respond with an 3350 465 (Notification Reason Unknown) (Section 15.4.30) error code. 3351 Servers can send PLAY_NOTIFY with these types: 3353 o end-of-stream (see Section 13.5.1); 3355 o media-properties-update (see Section 13.5.2); 3357 o scale-change (see Section 13.5.3). 3359 13.5.1. End-of-Stream 3361 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3362 indicates the completion or near completion of the PLAY request and 3363 the ending delivery of the media stream(s). The request MUST NOT be 3364 issued unless the server is in the playing state. The end of the 3365 media stream delivery notification may be used to indicate either a 3366 successful completion of the PLAY request currently being served, or 3367 to indicate some error resulting in failure to complete the request. 3368 The Request-Status header (Section 16.40) MUST be included to 3369 indicate which request the notification is for and its completion 3370 status. The message response status codes (Section 8.1.1) are used 3371 to indicate how the PLAY request concluded. The sender of a 3372 PLAY_NOTIFY can issue an updated PLAY_NOTIFY, in the case of a 3373 PLAY_NOTIFY sent with wrong information. For instance, a PLAY_NOTIFY 3374 was issued before reaching the end-of-stream, but some error occurred 3375 resulting in that the previously sent PLAY_NOTIFY contained a wrong 3376 time when the stream will end. In this case a new PLAY_NOTIFY MUST 3377 be sent including the correct status for the completion and all 3378 additional information. 3380 PLAY_NOTIFY requests with Notify-Reason header set to end-of-stream 3381 MUST include a Range header and the Scale header if the scale value 3382 is not 1. The Range header indicates the point in the stream or 3383 streams where delivery is ending with the timescale that was used by 3384 the server in the PLAY response for the request being fulfilled. The 3385 server MUST NOT use the "now" constant in the Range header; it MUST 3386 use the actual numeric end position in the proper timescale. When 3387 end-of-stream notifications are issued prior to having sent the last 3388 media packets, this is evident as the end time in the Range header is 3389 beyond the current time in the media being received by the client, 3390 e.g., npt=-15, if npt is currently at 14.2 seconds. The Scale header 3391 is to be included so that it is evident if the media time scale is 3392 moving backwards and/or have a non-default pace. 3394 If RTP is used as media transport, a RTP-Info header MUST be 3395 included, and the RTP-Info header MUST indicate the last sequence 3396 number in the seq parameter. 3398 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3399 MUST NOT carry a message body. 3401 This example request notifies the client about a future end-of-stream 3402 event: 3404 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3405 CSeq: 854 3406 Notify-Reason: end-of-stream 3407 Request-Status: cseq=853 status=200 reason="OK" 3408 Range: npt=-145 3409 RTP-Info:url="rtsp://example.com/audio" 3410 ssrc=0D12F123:seq=14783;rtptime=2345962545 3411 Session: uZ3ci0K+Ld-M 3412 Date: Mon, 08 Mar 2010 13:37:16 GMT 3414 C->S: RTSP/2.0 200 OK 3415 CSeq: 854 3416 User-Agent: PhonyClient/1.2 3417 Session: uZ3ci0K+Ld-M 3419 13.5.2. Media-Properties-Update 3421 A PLAY_NOTIFY request with Notify-Reason header set to media- 3422 properties-update indicates an update of the media properties for the 3423 given session (see Section 16.28) and/or the available media range 3424 that can be played as indicated by Media-Range (Section 16.29). 3425 PLAY_NOTIFY requests with Notify-Reason header set to media- 3426 properties-update MUST include a Media-Properties and Date header and 3427 SHOULD include a Media-Range header. 3429 This notification MUST be sent for media that are time-progressing 3430 every time an event happens that changes the basis for making 3431 estimations on how the media range progress. In addition it is 3432 RECOMMENDED that the server sends these notifications every 5 minutes 3433 for time-progressing content to ensure the long term stability of the 3434 client estimation and allowing for clock skew detection by the 3435 client. Requests for the just mentioned reasons MUST include Media- 3436 Range header to provide current Media duration and the Range header 3437 to indicate the current playing point and any remaining parts of the 3438 requested range. 3440 The recommendation for sending updates every 5 minutes is due to 3441 any clock skew issues. In 5 minutes the clock skew should not 3442 become too significant as this is not used for media playback and 3443 synchronization, only for determining which content is available 3444 to the user. 3446 A PLAY_NOTIFY request with Notify-Reason header set to media- 3447 properties-update MUST NOT carry a message body. 3449 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3450 Date: Tue, 14 Apr 2008 15:48:06 GMT 3451 CSeq: 854 3452 Notify-Reason: media-properties-update 3453 Session: uZ3ci0K+Ld-M 3454 Media-Properties: Time-Progressing, 3455 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3456 Media-Range: npt=0-1:37:21.394 3457 Range: npt=1:15:49.873- 3459 C->S: RTSP/2.0 200 OK 3460 CSeq: 854 3461 User-Agent: PhonyClient/1.2 3462 Session: uZ3ci0K+Ld-M 3464 13.5.3. Scale-Change 3466 The server may be forced to change the rate, when a client request 3467 delivery using a Scale (Section 16.44) value other than 1.0 (normal 3468 playback rate). For time progressing media with some retention, i.e. 3469 the server stores already sent content, a client requesting to play 3470 with Scale values larger than 1 may catch up with the front end of 3471 the media. The server will then be unable to continue to provide 3472 with content at Scale larger than 1 as content is only made available 3473 by the server at Scale=1. Another case is when Scale < 1 and the 3474 media retention is time-duration limited. In this case the delivery 3475 point can reach the oldest media unit available, and further playback 3476 at this scale becomes impossible as there will be no media available. 3477 To avoid having the client loose any media, the scale will need to be 3478 adjusted to the same rate which the media is removed from the storage 3479 buffer, commonly scale = 1.0. 3481 Another case is when the content itself consist of spliced pieces or 3482 is dynamically updated. In these cases the server may be required to 3483 change from one supported scale value (different than Scale=1.0) to 3484 another. In this case the server will pick the closest value and 3485 inform the client of what it has picked. In these case the media 3486 properties will also be sent updating the supported Scale values. 3487 This enables a client to adjust the used Scale value. 3489 To minimize impact on playback in any of the above cases the server 3490 MUST modify the playback properties and set Scale to a supportable 3491 value and continue delivery the media. When doing this modification 3492 it MUST send a PLAY_NOTIFY message with the Notify-Reason header set 3493 to "scale-change". The request MUST contain a Range header with the 3494 media time where the change took effect, a Scale header with the new 3495 value in use, Session header with the ID for the session it applies 3496 to and a Date header with the server wallclock time of the change. 3497 For time progressing content also the Media-Range and the Media- 3498 Properties at this point in time MUST be included. The Media- 3499 Properties header MUST be included if the scale change was due to the 3500 content changing what scale values that is supported. 3502 For media streams being delivered using RTP also a RTP-Info header 3503 MUST be included. It MUST contain the rtptime parameter with a value 3504 corresponding to the point of change in that media and optionally 3505 also the sequence number. 3507 A PLAY_NOTIFY request with Notify-Reason header set to "Scale-Change" 3508 MUST NOT carry a message body. 3510 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3511 Date: Tue, 14 Apr 2008 15:48:06 GMT 3512 CSeq: 854 3513 Notify-Reason: scale-change 3514 Session: uZ3ci0K+Ld-M 3515 Media-Properties: Time-Progressing, 3516 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3517 Media-Range: npt=0-1:37:21.394 3518 Range: npt=1:37:21.394- 3519 Scale: 1 3520 RTP-Info: url="rtsp://example.com/fizzle/foo/audio" 3521 ssrc=0D12F123:rtptime=2345962545 3523 C->S: RTSP/2.0 200 OK 3524 CSeq: 854 3525 User-Agent: PhonyClient/1.2 3526 Session: uZ3ci0K+Ld-M 3528 13.6. PAUSE 3530 The PAUSE request causes the stream delivery to immediately be 3531 interrupted (halted). A PAUSE request MUST be done either with the 3532 aggregated control URI for aggregated sessions, resulting in all 3533 media being halted, or the media URI for non-aggregated sessions. 3534 Any attempt to do muting of a single media with an PAUSE request in 3535 an aggregated session MUST be responded with error 460 (Only 3536 Aggregate Operation Allowed). After resuming playback, 3537 synchronization of the tracks MUST be maintained. Any server 3538 resources are kept, though servers MAY close the session and free 3539 resources after being paused for the duration specified with the 3540 timeout parameter of the Session header in the SETUP message. 3542 Example: 3544 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3545 CSeq: 834 3546 Session: 12345678 3547 User-Agent: PhonyClient/1.2 3549 S->C: RTSP/2.0 200 OK 3550 CSeq: 834 3551 Date: Thu, 23 Jan 1997 15:35:06 GMT 3552 Range: npt=45.76-75.00 3554 The PAUSE request causes stream delivery to be interrupted 3555 immediately on receipt of the message and the pause point is set to 3556 the current point in the presentation. That pause point in the media 3557 stream needs to be maintained. A subsequent PLAY request without 3558 Range header resume from the pause point and play until media end. 3560 The pause point after any PAUSE request MUST be returned to the 3561 client by adding a Range header with what remains unplayed of the 3562 PLAY request's range. For media with random access properties, if 3563 one desires to resume playing a ranged request, one simply includes 3564 the Range header from the PAUSE response and include the Seek-Style 3565 header with the Next policy in the PLAY request. For media that is 3566 time-progressing and has retention duration=0 the follow-up PLAY 3567 request to start media delivery again, will need to use "npt=now-" 3568 and not the answer given in the response to PAUSE. 3570 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3571 CSeq: 834 3572 Session: 12345678 3573 Range: npt=10-30 3574 User-Agent: PhonyClient/1.2 3576 S->C: RTSP/2.0 200 OK 3577 CSeq: 834 3578 Date: Thu, 23 Jan 1997 15:35:06 GMT 3579 Server: PhonyServer 1.0 3580 Range: npt=10-30 3581 Seek-Style: First-Prior 3582 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3583 ssrc=0D12F123:seq=5712;rtptime=934207921, 3584 url="rtsp://example.com/fizzle/videotrack" 3585 ssrc=4FAD8726:seq=57654;rtptime=2792482193 3586 Session: 12345678 3588 After 11 seconds, i.e. at 21 seconds into the presentation: 3589 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3590 CSeq: 835 3591 Session: 12345678 3592 User-Agent: PhonyClient/1.2 3594 S->C: RTSP/2.0 200 OK 3595 CSeq: 835 3596 Date: 23 Jan 1997 15:35:09 GMT 3597 Server: PhonyServer 1.0 3598 Range: npt=21-30 3599 Session: 12345678 3601 If a client issues a PAUSE request and the server acknowledges and 3602 enters the READY state, the proper server response, if the player 3603 issues another PAUSE, is still 200 OK. The 200 OK response MUST 3604 include the Range header with the current pause point. See examples 3605 below: 3607 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3608 CSeq: 834 3609 Session: 12345678 3610 User-Agent: PhonyClient/1.2 3612 S->C: RTSP/2.0 200 OK 3613 CSeq: 834 3614 Session: 12345678 3615 Date: Thu, 23 Jan 1997 15:35:06 GMT 3616 Range: npt=45.76-98.36 3618 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3619 CSeq: 835 3620 Session: 12345678 3621 User-Agent: PhonyClient/1.2 3623 S->C: RTSP/2.0 200 OK 3624 CSeq: 835 3625 Session: 12345678 3626 Date: 23 Jan 1997 15:35:07 GMT 3627 Range: npt=45.76-98.36 3629 13.7. TEARDOWN 3631 13.7.1. Client to Server 3633 The TEARDOWN client to server request stops the stream delivery for 3634 the given URI, freeing the resources associated with it. A TEARDOWN 3635 request MAY be performed on either an aggregated or a media control 3636 URI. However, some restrictions apply depending on the current 3637 state. The TEARDOWN request MUST contain a Session header indicating 3638 what session the request applies to. 3640 A TEARDOWN using the aggregated control URI or the media URI in a 3641 session under non-aggregated control (single media session) MAY be 3642 done in any state (Ready, and Play). A successful request MUST 3643 result in that media delivery is immediately halted and the session 3644 state is destroyed. This MUST be indicated through the lack of a 3645 Session header in the response. 3647 A TEARDOWN using a media URI in an aggregated session MAY only be 3648 done in Ready state. Such a request only removes the indicated media 3649 stream and associated resources from the session. This may result in 3650 that a session returns to non-aggregated control, due to that it only 3651 contains a single media after the requests completion. A session 3652 that will exist after the processing of the TEARDOWN request MUST in 3653 the response to that TEARDOWN request contain a Session header. Thus 3654 the presence of the Session header indicates to the receiver of the 3655 response if the session is still existing or has been removed. 3657 Example: 3659 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/2.0 3660 CSeq: 892 3661 Session: 12345678 3662 User-Agent: PhonyClient/1.2 3664 S->C: RTSP/2.0 200 OK 3665 CSeq: 892 3666 Server: PhonyServer 1.0 3668 13.7.2. Server to Client 3670 The server can send TEARDOWN requests in the server to client 3671 direction to indicate that the server has been forced to terminate 3672 the ongoing session. This may happen for several reasons, such as 3673 server maintenance without available backup, or that the session has 3674 been inactive for extended periods of time. The reason is provided 3675 in the Terminate-Reason header (Section 16.50). 3677 When a RTSP client has maintained a RTSP session that otherwise is 3678 inactive for an extended period of time the server may reclaim the 3679 resources. That is done by issuing a TEARDOWN request with the 3680 Terminate-Reason set to "Session-Timeout". This MAY be done when the 3681 client has been inactive in the RTSP session for more than one 3682 Session Timeout period (Section 16.47). However, the server is 3683 RECOMMENDED to not perform this operation until an extended period of 3684 inactivity has passed. The time period is considered extended when 3685 it is 10 times the Session Timeout period. Consideration of the 3686 application of the server and its content should be performed when 3687 configuring what is considered as extended periods of time. 3689 In case the server needs to stop providing service to the established 3690 sessions and their is no server to point at in a REDIRECT request 3691 TEARDOWN shall be used to terminate the session. This method can 3692 also be used when non-recoverable internal errors have happened and 3693 the server has no other option then to terminate the sessions. 3695 The TEARDOWN request is normally done on the session aggregate 3696 control URI and MUST include the following headers; Session and 3697 Terminate-Reason headers. The request only applies to the session 3698 identified in the Session header. The server may include a message 3699 to the client's user with the "user-msg" parameter. 3701 The TEARDOWN request may alternatively be done on the wild card URI * 3702 and without any session header. The scope of such a request is 3703 limited to the next-hop (i.e. the RTSP agent in direct communication 3704 with the server) and applies, as well, to the control connection 3705 between the next-hop RTSP agent and the server. This request 3706 indicates that all sessions and pending requests being managed via 3707 the control connection are terminated. Any intervening proxies 3708 SHOULD do all of the following in the order listed: 3710 1. respond to the TEARDOWN request 3712 2. disconnect the control channel from the requesting server 3714 3. pass the TEARDOWN request to each applicable client (typically 3715 those clients with an active session or an unanswered request) 3717 Note: The proxy is responsible for accepting TEARDOWN responses 3718 from its clients; these responses MUST NOT be passed on to either 3719 the original server or the target server in the redirect. 3721 13.8. GET_PARAMETER 3723 The GET_PARAMETER request retrieves the value of any specified 3724 parameter or parameters for a presentation or stream specified in the 3725 URI. If the Session header is present in a request, the value of a 3726 parameter MUST be retrieved in the specified session context. There 3727 are two ways of specifying the parameters to be retrieved. The first 3728 is by including headers which have been defined such that you can use 3729 them for this purpose. Headers for this purpose should allow empty, 3730 or stripped value parts to avoid having to specify bogus data when 3731 indicating the desire to retrieve a value. The successful completion 3732 of the request should also be evident from any filled out values in 3733 the response. The Media-Range header (Section 16.29) is one such 3734 header. The other way is to specify a message body that lists the 3735 parameter(s) that are desired to be retrieved. The Content-Type 3736 header (Section 16.18) is used to specify which format the message 3737 body has. 3739 The headers that MAY be used for retrieving their current value using 3740 GET_PARAMETER are: 3742 o Accept-Ranges 3744 o Media-Range 3746 o Media-Properties 3748 o Range 3749 o RTP-Info 3751 The method MAY also be used without a message body or any header that 3752 request parameters for keep-alive purpose. Any request that is 3753 successful, i.e., a 200 OK response is received, then the keep-alive 3754 timer has been updated. Any non-required header present in such a 3755 request may or may not been processed. Normally the presence of 3756 filled out values in the header will be indication that the header 3757 has been processed. However, for cases when this is difficult to 3758 determine, it is recommended to use a feature-tag and the Require 3759 header. Due to this reason it is usually easier if any parameters to 3760 be retrieved are sent in the body, rather than using any header. 3762 Parameters specified within the body of the message must all be 3763 understood by the request receiving agent. If one or more parameters 3764 are not understood a 451 (Parameter Not Understood) MUST be sent 3765 including a body listing these parameters that wasn't understood. If 3766 all parameters are understood their value is filled in and returned 3767 in the response message body. 3769 Example: 3771 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3772 CSeq: 431 3773 User-Agent: PhonyClient/1.2 3774 Session: 12345678 3775 Content-Length: 26 3776 Content-Type: text/parameters 3778 packets_received 3779 jitter 3781 C->S: RTSP/2.0 200 OK 3782 CSeq: 431 3783 Session: 12345678 3784 Server: PhonyServer/1.1 3785 Date: Mon, 08 Mar 2010 13:43:23 GMT 3786 Content-Length: 38 3787 Content-Type: text/parameters 3789 packets_received: 10 3790 jitter: 0.3838 3792 13.9. SET_PARAMETER 3794 This method requests to set the value of a parameter or a set of 3795 parameters for a presentation or stream specified by the URI. The 3796 method MAY also be used without a message body. It is the 3797 RECOMMENDED method to use in request sent for the sole purpose of 3798 updating the keep-alive timer. If this request is successful, i.e. a 3799 200 OK response is received, then the keep-alive timer has been 3800 updated. Any non-required header present in such a request may or 3801 may not been processed. To allow a client to determine if any such 3802 header has been processed, it is necessary to use a feature tag and 3803 the Require header. Due to this reason it is RECOMMENDED that any 3804 parameters are sent in the body, rather than using any header. 3806 A request is RECOMMENDED to only contain a single parameter to allow 3807 the client to determine why a particular request failed. If the 3808 request contains several parameters, the server MUST only act on the 3809 request if all of the parameters can be set successfully. A server 3810 MUST allow a parameter to be set repeatedly to the same value, but it 3811 MAY disallow changing parameter values. If the receiver of the 3812 request does not understand or cannot locate a parameter, error 451 3813 (Parameter Not Understood) MUST be used. In the case a parameter is 3814 not allowed to change, the error code is 458 (Parameter Is Read- 3815 Only). The response body MUST contain only the parameters that have 3816 errors. Otherwise no body MUST be returned. 3818 Note: transport parameters for the media stream MUST only be set with 3819 the SETUP command. 3821 Restricting setting transport parameters to SETUP is for the 3822 benefit of firewalls. 3824 The parameters are split in a fine-grained fashion so that there 3825 can be more meaningful error indications. However, it may make 3826 sense to allow the setting of several parameters if an atomic 3827 setting is desirable. Imagine device control where the client 3828 does not want the camera to pan unless it can also tilt to the 3829 right angle at the same time. 3831 Example: 3833 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3834 CSeq: 421 3835 User-Agent: PhonyClient/1.2 3836 Session: iixT43KLc 3837 Date: Mon, 08 Mar 2010 14:45:04 GMT 3838 Content-length: 20 3839 Content-type: text/parameters 3841 barparam: barstuff 3843 S->C: RTSP/2.0 451 Parameter Not Understood 3844 CSeq: 421 3845 Session: iixT43KLc 3846 Server: PhonyServer 1.0 3847 Date: Mon, 08 Mar 2010 14:44:56 GMT 3848 Content-length: 10 3849 Content-type: text/parameters 3851 barparam: barstuff 3853 13.10. REDIRECT 3855 The REDIRECT method is issued by a server to inform a client that the 3856 service provided will be terminated and where a corresponding service 3857 can be provided instead. This happens for different reasons. One is 3858 that the server is being administrated such that it must stop 3859 providing service. Thus the client is required to connect to another 3860 server location to access the resource indicated by the Request-URI. 3862 The REDIRECT request SHALL contain a Terminate-Reason header 3863 (Section 16.50) to inform the client of the reason for the request. 3864 Additional parameters related to the reason may also be included. 3865 The intention here is to allow a server administrator to do a 3866 controlled shutdown of the RTSP server. That requires sufficient 3867 time to inform all entities having associated state with the server 3868 and for them to perform a controlled migration from this server to a 3869 fall back server. 3871 A REDIRECT request with a Session header has end-to-end (i.e. server 3872 to client) scope and applies only to the given session. Any 3873 intervening proxies SHOULD NOT disconnect the control channel while 3874 there are other remaining end-to-end sessions. The REQUIRED Location 3875 header MUST contain a complete absolute URI pointing to the resource 3876 to which the client SHOULD reconnect. Specifically, the Location 3877 MUST NOT contain just the host and port. A client may receive a 3878 REDIRECT request with a Session header, if and only if, an end-to-end 3879 session has been established. 3881 A client may receive a REDIRECT request without a Session header at 3882 any time when it has communication or a connection established with a 3883 server. The scope of such a request is limited to the next-hop (i.e. 3884 the RTSP agent in direct communication with the server) and applies 3885 to all sessions controlled, as well as the control connection between 3886 the next-hop RTSP agent and the server. A REDIRECT request without a 3887 Session header indicates that all sessions and pending requests being 3888 managed via the control connection MUST be redirected. The REQUIRED 3889 Location header, if included in such a request, SHOULD contain an 3890 absolute URI with only the host address and the OPTIONAL port number 3891 of the server to which the RTSP agent SHOULD reconnect. Any 3892 intervening proxies SHOULD do all of the following in the order 3893 listed: 3895 1. respond to the REDIRECT request 3897 2. disconnect the control channel from the requesting server 3899 3. connect to the server at the given host address 3901 4. pass the REDIRECT request to each applicable client (typically 3902 those clients with an active session or an unanswered request) 3904 Note: The proxy is responsible for accepting REDIRECT responses 3905 from its clients; these responses MUST NOT be passed on to either 3906 the original server or the redirected server. 3908 When the server lacks any alternative server and needs to terminate a 3909 session or all sessions the TEARDOWN request SHALL be used instead. 3911 When no Terminate-Reason "time" parameter are included in a REDIRECT 3912 request, the client SHALL perform the redirection immediately and 3913 return a response to the server. The server shall consider the 3914 session as terminated and can free any associated state after it 3915 receives the successful (2xx) response. The server MAY close the 3916 signaling connection upon receiving the response and the client 3917 SHOULD close the signaling connection after sending the 2xx response. 3918 The exception to this is when the client has several sessions on the 3919 server being managed by the given signaling connection. In this 3920 case, the client SHOULD close the connection when it has received and 3921 responded to REDIRECT requests for all the sessions managed by the 3922 signaling connection. 3924 The Terminate-Reason header "time" parameter MAY be used to indicate 3925 the wallclock time by when the redirection MUST have take place. To 3926 allow a client to determine that redirect time without being time 3927 synchronized with the server, the server MUST include a Date header 3928 in the request. The client should have before the redirection time- 3929 line terminated the session and close the control connection. The 3930 server MAY simple cease to provide service when the deadline time has 3931 been reached, or it may issue TEARDOWN requests to the remaining 3932 sessions. 3934 If the REDIRECT request times out following the rules in Section 10.4 3935 the server MAY terminate the session or transport connection that 3936 would be redirected by the request. This is a safeguard against 3937 misbehaving clients that refuses to respond to a REDIRECT request. 3938 That should not provide any benefit. 3940 After a REDIRECT request has been processed, a client that wants to 3941 continue to send or receive media for the resource identified by the 3942 Request-URI will have to establish a new session with the designated 3943 host. If the URI given in the Location header is a valid resource 3944 URI, a client SHOULD issue a DESCRIBE request for the URI. 3946 Note: The media resource indicated by the Location header can be 3947 identical, slightly different or totally different. This is the 3948 reason why a new DESCRIBE request SHOULD be issued. 3950 If the Location header contains only a host address, the client MAY 3951 assume that the media on the new server is identical to the media on 3952 the old server, i.e. all media configuration information from the old 3953 session is still valid except for the host address. However, the 3954 usage of conditional SETUP using MTag identifiers are RECOMMENDED to 3955 verify the assumption. 3957 This example request redirects traffic for this session to the new 3958 server at the given absolute time: 3960 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/2.0 3961 CSeq: 732 3962 Location: rtsp://s2.example.com:8001 3963 Terminate-Reason: Server-Admin ;time=19960213T143205Z 3964 Session: uZ3ci0K+Ld-M 3965 Date: Thu, 13 Feb 1996 14:30:43 GMT 3967 C->S: RTSP/2.0 200 OK 3968 CSeq: 732 3969 User-Agent: PhonyClient/1.2 3970 Session: uZ3ci0K+Ld-M 3972 14. Embedded (Interleaved) Binary Data 3974 In order to fulfill certain requirements on the network side, e.g. in 3975 conjunction with network address translators that block RTP traffic 3976 over UDP, it may be necessary to interleave RTSP messages and media 3977 stream data. This interleaving should generally be avoided unless 3978 necessary since it complicates client and server operation and 3979 imposes additional overhead. Also, head of line blocking may cause 3980 problems. Interleaved binary data SHOULD only be used if RTSP is 3981 carried over TCP. Interleaved data is not allowed inside RTSP 3982 messages. 3984 Stream data such as RTP packets is encapsulated by an ASCII dollar 3985 sign (24 decimal), followed by a one-byte channel identifier, 3986 followed by the length of the encapsulated binary data as a binary, 3987 two-byte integer in network byte order. The stream data follows 3988 immediately afterwards, without a CRLF, but including the upper-layer 3989 protocol headers. Each $ block MUST contain exactly one upper-layer 3990 protocol data unit, e.g., one RTP packet. 3991 0 1 2 3 3992 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 3993 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3994 | "$" = 24 | Channel ID | Length in bytes | 3995 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3996 : Length number of bytes of binary data : 3997 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3999 The channel identifier is defined in the Transport header with the 4000 interleaved parameter (Section 16.52). 4002 When the transport choice is RTP, RTCP messages are also interleaved 4003 by the server over the TCP connection. The usage of RTCP messages is 4004 indicated by including a interval containing a second channel in the 4005 interleaved parameter of the Transport header, see Section 16.52. If 4006 RTCP is used, packets MUST be sent on the first available channel 4007 higher than the RTP channel. The channels are bi-directional, using 4008 the same ChannelD in both directions, and therefore RTCP traffic are 4009 sent on the second channel in both directions. 4011 RTCP is sometime needed for synchronization when two or more 4012 streams are interleaved in such a fashion. Also, this provides a 4013 convenient way to tunnel RTP/RTCP packets through the TCP control 4014 connection when required by the network configuration and transfer 4015 them onto UDP when possible. 4017 C->S: SETUP rtsp://example.com/bar.file RTSP/2.0 4018 CSeq: 2 4019 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4020 Accept-Ranges: NPT, SMPTE, UTC 4021 User-Agent: PhonyClient/1.2 4023 S->C: RTSP/2.0 200 OK 4024 CSeq: 2 4025 Date: Thu, 05 Jun 1997 18:57:18 GMT 4026 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 4027 Session: 12345678 4028 Accept-Ranges: NPT 4029 Media-Properties: Random-Access=0.2, Unmutable, Unlimited 4031 C->S: PLAY rtsp://example.com/bar.file RTSP/2.0 4032 CSeq: 3 4033 Session: 12345678 4034 User-Agent: PhonyClient/1.2 4036 S->C: RTSP/2.0 200 OK 4037 CSeq: 3 4038 Session: 12345678 4039 Date: Thu, 05 Jun 1997 18:57:19 GMT 4040 RTP-Info: url="rtsp://example.com/bar.file" 4041 ssrc=0D12F123:seq=232433;rtptime=972948234 4042 Range: npt=0-56.8 4043 Seek-Style: RAP 4045 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4046 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4047 S->C: $006{2 byte length}{"length" bytes RTCP packet} 4049 15. Status Code Definitions 4051 Where applicable, HTTP status [H10] codes are reused. Status codes 4052 that have the same meaning are not repeated here. See Table 4 for a 4053 listing of which status codes may be returned by which requests. All 4054 error messages, 4xx and 5xx MAY return a body containing further 4055 information about the error. 4057 15.1. Success 1xx 4059 15.1.1. 100 Continue 4061 The client SHOULD continue with its request. This interim response 4062 is used to inform the client that the initial part of the request has 4063 been received and has not yet been rejected by the server. The 4064 client SHOULD continue by sending the remainder of the request or, if 4065 the request has already been completed, ignore this response. The 4066 server MUST send a final response after the request has been 4067 completed. 4069 15.2. Success 2xx 4071 This class of status code indicates that the client's request was 4072 successfully received, understood, and accepted. 4074 15.2.1. 200 OK 4076 The request has succeeded. The information returned with the 4077 response is dependent on the method used in the request. 4079 15.3. Redirection 3xx 4081 The notation "3rr" indicates response codes from 300 to 399 inclusive 4082 which are meant for redirection. The response code 304 is excluded 4083 from this set, as it is not used for redirection. 4085 Within RTSP, redirection may be used for load balancing or 4086 redirecting stream requests to a server topologically closer to the 4087 client. Mechanisms to determine topological proximity are beyond the 4088 scope of this specification. 4090 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 4091 that they are used if necessary before a session is established, 4092 i.e., in response to DESCRIBE or SETUP. However, in cases where a 4093 server is not able to send a REDIRECT request to the client, the 4094 server MAY need to resort to using 3rr responses to inform a client 4095 with an established session about the need for redirecting the 4096 session. If a 3rr response is received for a request in relation to 4097 an established session, the client SHOULD send a TEARDOWN request for 4098 the session, and MAY reestablish the session using the resource 4099 indicated by the Location. 4101 If the Location header is used in a response it MUST contain an 4102 absolute URI pointing out the media resource the client is redirected 4103 to, the URI MUST NOT only contain the host name. 4105 15.3.1. 301 Moved Permanently 4107 The request resource are moved permanently and resides now at the URI 4108 given by the location header. The user client SHOULD redirect 4109 automatically to the given URI. This response MUST NOT contain a 4110 message-body. The Location header MUST be included in the response. 4112 15.3.2. 302 Found 4114 The requested resource resides temporarily at the URI given by the 4115 Location header. The Location header MUST be included in the 4116 response. This response is intended to be used for many types of 4117 temporary redirects; e.g., load balancing. It is RECOMMENDED that 4118 the server set the reason phrase to something more meaningful than 4119 "Found" in these cases. The user client SHOULD redirect 4120 automatically to the given URI. This response MUST NOT contain a 4121 message-body. 4123 This example shows a client being redirected to a different server: 4125 C->S: SETUP rtsp://example.com/fizzle/foo RTSP/2.0 4126 CSeq: 2 4127 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4128 Accept-Ranges: NPT, SMPTE, UTC 4129 User-Agent: PhonyClient/1.2 4131 S->C: RTSP/2.0 302 Try Other Server 4132 CSeq: 2 4133 Location: rtsp://s2.example.com:8001/fizzle/foo 4135 15.3.3. 303 See Other 4137 This status code MUST NOT be used in RTSP 2.0. However, it was 4138 allowed to use in RTSP 1.0 (RFC 2326). 4140 15.3.4. 304 Not Modified 4142 If the client has performed a conditional DESCRIBE or SETUP (see 4143 Section 16.24) and the requested resource has not been modified, the 4144 server SHOULD send a 304 response. This response MUST NOT contain a 4145 message-body. 4147 The response MUST include the following header fields: 4149 o Date 4151 o MTag and/or Content-Location, if the header(s) would have been 4152 sent in a 200 response to the same request. 4154 o Expires, Cache-Control, and/or Vary, if the field-value might 4155 differ from that sent in any previous response for the same 4156 variant. 4158 This response is independent for the DESCRIBE and SETUP requests. 4159 That is, a 304 response to DESCRIBE does NOT imply that the resource 4160 content is unchanged (only the session description) and a 304 4161 response to SETUP does NOT imply that the resource description is 4162 unchanged. The MTag and If-Match headers may be used to link the 4163 DESCRIBE and SETUP in this manner. 4165 15.3.5. 305 Use Proxy 4167 The requested resource MUST be accessed through the proxy given by 4168 the Location field. The Location field gives the URI of the proxy. 4169 The recipient is expected to repeat this single request via the 4170 proxy. 305 responses MUST only be generated by origin servers. 4172 15.4. Client Error 4xx 4174 15.4.1. 400 Bad Request 4176 The request could not be understood by the server due to malformed 4177 syntax. The client SHOULD NOT repeat the request without 4178 modifications. If the request does not have a CSeq header, the 4179 server MUST NOT include a CSeq in the response. 4181 15.4.2. 401 Unauthorized 4183 The request requires user authentication. The response MUST include 4184 a WWW-Authenticate header (Section 16.57) field containing a 4185 challenge applicable to the requested resource. The client MAY 4186 repeat the request with a suitable Authorization header field. If 4187 the request already included Authorization credentials, then the 401 4188 response indicates that authorization has been refused for those 4189 credentials. If the 401 response contains the same challenge as the 4190 prior response, and the user agent has already attempted 4191 authentication at least once, then the user SHOULD be presented the 4192 message body that was given in the response, since that message body 4193 might include relevant diagnostic information. HTTP access 4194 authentication is explained in [RFC2617]. 4196 15.4.3. 402 Payment Required 4198 This code is reserved for future use. 4200 15.4.4. 403 Forbidden 4202 The server understood the request, but is refusing to fulfill it. 4203 Authorization will not help and the request SHOULD NOT be repeated. 4204 If the server wishes to make public why the request has not been 4205 fulfilled, it SHOULD describe the reason for the refusal in the 4206 message body. If the server does not wish to make this information 4207 available to the client, the status code 404 (Not Found) can be used 4208 instead. 4210 15.4.5. 404 Not Found 4212 The server has not found anything matching the Request-URI. No 4213 indication is given of whether the condition is temporary or 4214 permanent. The 410 (Gone) status code SHOULD be used if the server 4215 knows, through some internally configurable mechanism, that an old 4216 resource is permanently unavailable and has no forwarding address. 4217 This status code is commonly used when the server does not wish to 4218 reveal exactly why the request has been refused, or when no other 4219 response is applicable. 4221 15.4.6. 405 Method Not Allowed 4223 The method specified in the request is not allowed for the resource 4224 identified by the Request-URI. The response MUST include an Allow 4225 header containing a list of valid methods for the requested resource. 4226 This status code is also to be used if a request attempts to use a 4227 method not indicated during SETUP. 4229 15.4.7. 406 Not Acceptable 4231 The resource identified by the request is only capable of generating 4232 response message bodies which have content characteristics not 4233 acceptable according to the accept headers sent in the request. 4235 The response SHOULD include an message body containing a list of 4236 available message body characteristics and location(s) from which the 4237 user or user agent can choose the one most appropriate. The message 4238 body format is specified by the media type given in the Content-Type 4239 header field. Depending upon the format and the capabilities of the 4240 user agent, selection of the most appropriate choice MAY be performed 4241 automatically. However, this specification does not define any 4242 standard for such automatic selection. 4244 If the response could be unacceptable, a user agent SHOULD 4245 temporarily stop receipt of more data and query the user for a 4246 decision on further actions. 4248 15.4.8. 407 Proxy Authentication Required 4250 This code is similar to 401 (Unauthorized) (Section 15.4.2), but 4251 indicates that the client must first authenticate itself with the 4252 proxy. The proxy MUST return a Proxy-Authenticate header field 4253 (Section 16.33) containing a challenge applicable to the proxy for 4254 the requested resource. 4256 15.4.9. 408 Request Timeout 4258 The client did not produce a request within the time that the server 4259 was prepared to wait. The client MAY repeat the request without 4260 modifications at any later time. 4262 15.4.10. 410 Gone 4264 The requested resource is no longer available at the server and the 4265 forwarding address is not known. This condition is expected to be 4266 considered permanent. If the server does not know, or has no 4267 facility to determine, whether or not the condition is permanent, the 4268 status code 404 (Not Found) SHOULD be used instead. This response is 4269 cacheable unless indicated otherwise. 4271 The 410 response is primarily intended to assist the task of 4272 repository maintenance by notifying the recipient that the resource 4273 is intentionally unavailable and that the server owners desire that 4274 remote links to that resource be removed. Such an event is common 4275 for limited-time, promotional services and for resources belonging to 4276 individuals no longer working at the server's site. It is not 4277 necessary to mark all permanently unavailable resources as "gone" or 4278 to keep the mark for any length of time -- that is left to the 4279 discretion of the owner of the server. 4281 15.4.11. 411 Length Required 4283 The server refuses to accept the request without a defined Content- 4284 Length. The client MAY repeat the request if it adds a valid 4285 Content-Length header field containing the length of the message-body 4286 in the request message. 4288 15.4.12. 412 Precondition Failed 4290 The precondition given in one or more of the request-header fields 4291 evaluated to false when it was tested on the server. This response 4292 code allows the client to place preconditions on the current resource 4293 meta information (header field data) and thus prevent the requested 4294 method from being applied to a resource other than the one intended. 4296 15.4.13. 413 Request Message Body Too Large 4298 The server is refusing to process a request because the request 4299 message body is larger than the server is willing or able to process. 4300 The server MAY close the connection to prevent the client from 4301 continuing the request. 4303 If the condition is temporary, the server SHOULD include a Retry- 4304 After header field to indicate that it is temporary and after what 4305 time the client MAY try again. 4307 15.4.14. 414 Request-URI Too Long 4309 The server is refusing to service the request because the Request-URI 4310 is longer than the server is willing to interpret. This rare 4311 condition is only likely to occur when a client has used a request 4312 with long query information, when the client has descended into a URI 4313 "black hole" of redirection (e.g., a redirected URI prefix that 4314 points to a suffix of itself), or when the server is under attack by 4315 a client attempting to exploit security holes present in some servers 4316 using fixed-length buffers for reading or manipulating the Request- 4317 URI. 4319 15.4.15. 415 Unsupported Media Type 4321 The server is refusing to service the request because the message 4322 body of the request is in a format not supported by the requested 4323 resource for the requested method. 4325 15.4.16. 451 Parameter Not Understood 4327 The recipient of the request does not support one or more parameters 4328 contained in the request. When returning this error message the 4329 sender SHOULD return a message body containing the offending 4330 parameter(s). 4332 15.4.17. 452 reserved 4334 This error code was removed from RFC 2326 [RFC2326] as it is 4335 obsolete. This error code MUST NOT be used anymore. 4337 15.4.18. 453 Not Enough Bandwidth 4339 The request was refused because there was insufficient bandwidth. 4340 This may, for example, be the result of a resource reservation 4341 failure. 4343 15.4.19. 454 Session Not Found 4345 The RTSP session identifier in the Session header is missing, 4346 invalid, or has timed out. 4348 15.4.20. 455 Method Not Valid in This State 4350 The client or server cannot process this request in its current 4351 state. The response MUST contain an Allow header to make error 4352 recovery possible. 4354 15.4.21. 456 Header Field Not Valid for Resource 4356 The server could not act on a required request header. For example, 4357 if PLAY contains the Range header field but the stream does not allow 4358 seeking. This error message may also be used for specifying when the 4359 time format in Range is impossible for the resource. In that case 4360 the Accept-Ranges header MUST be returned to inform the client of 4361 which format(s) that are allowed. 4363 15.4.22. 457 Invalid Range 4365 The Range value given is out of bounds, e.g., beyond the end of the 4366 presentation. 4368 15.4.23. 458 Parameter Is Read-Only 4370 The parameter to be set by SET_PARAMETER can be read but not 4371 modified. When returning this error message the sender SHOULD return 4372 a message body containing the offending parameter(s). 4374 15.4.24. 459 Aggregate Operation Not Allowed 4376 The requested method may not be applied on the URI in question since 4377 it is an aggregate (presentation) URI. The method may be applied on 4378 a media URI. 4380 15.4.25. 460 Only Aggregate Operation Allowed 4382 The requested method may not be applied on the URI in question since 4383 it is not an aggregate control (presentation) URI. The method may be 4384 applied on the aggregate control URI. 4386 15.4.26. 461 Unsupported Transport 4388 The Transport field did not contain a supported transport 4389 specification. 4391 15.4.27. 462 Destination Unreachable 4393 The data transmission channel could not be established because the 4394 client address could not be reached. This error will most likely be 4395 the result of a client attempt to place an invalid dest_addr 4396 parameter in the Transport field. 4398 15.4.28. 463 Destination Prohibited 4400 The data transmission channel was not established because the server 4401 prohibited access to the client address. This error is most likely 4402 the result of a client attempt to redirect media traffic to another 4403 destination with a dest_addr parameter in the Transport header. 4405 15.4.29. 464 Data Transport Not Ready Yet 4407 The data transmission channel to the media destination is not yet 4408 ready for carrying data. However, the responding agent still expects 4409 that the data transmission channel will be established at some point 4410 in time. Note, however, that this may result in a permanent failure 4411 like 462 "Destination Unreachable". 4413 An example when this error may occur is in the case a client sends a 4414 PLAY request to a server prior to ensuring that the TCP connections 4415 negotiated for carrying media data was successful established (In 4416 violation of this specification). The server would use this error 4417 code to indicate that the requested action could not be performed due 4418 to the failure of completing the connection establishment. 4420 15.4.30. 465 Notification Reason Unknown 4422 This indicates that the client has received a PLAY_NOTIFY 4423 (Section 13.5) with a Notify-Reason header (Section 16.31) unknown to 4424 the client. 4426 15.4.31. 470 Connection Authorization Required 4428 The secured connection attempt needs user or client authorization 4429 before proceeding. The next hops certificate is included in this 4430 response in the Accept-Credentials header. 4432 15.4.32. 471 Connection Credentials not accepted 4434 When performing a secure connection over multiple connections, a 4435 intermediary has refused to connect to the next hop and carry out the 4436 request due to unacceptable credentials for the used policy. 4438 15.4.33. 472 Failure to establish secure connection 4440 A proxy fails to establish a secure connection to the next hop RTSP 4441 agent. This is primarily caused by a fatal failure at the TLS 4442 handshake, for example due to server not accepting any cipher suits. 4444 15.5. Server Error 5xx 4446 Response status codes beginning with the digit "5" indicate cases in 4447 which the server is aware that it has erred or is incapable of 4448 performing the request The server SHOULD include an message body 4449 containing an explanation of the error situation, and whether it is a 4450 temporary or permanent condition. User agents SHOULD display any 4451 included message body to the user. These response codes are 4452 applicable to any request method. 4454 15.5.1. 500 Internal Server Error 4456 The server encountered an unexpected condition which prevented it 4457 from fulfilling the request. 4459 15.5.2. 501 Not Implemented 4461 The server does not support the functionality required to fulfill the 4462 request. This is the appropriate response when the server does not 4463 recognize the request method and is not capable of supporting it for 4464 any resource. 4466 15.5.3. 502 Bad Gateway 4468 The server, while acting as a gateway or proxy, received an invalid 4469 response from the upstream server it accessed in attempting to 4470 fulfill the request. 4472 15.5.4. 503 Service Unavailable 4474 The server is currently unable to handle the request due to a 4475 temporary overloading or maintenance of the server. The implication 4476 is that this is a temporary condition which will be alleviated after 4477 some delay. If known, the length of the delay MAY be indicated in a 4478 Retry-After header. If no Retry-After is given, the client SHOULD 4479 handle the response as it would for a 500 response. 4481 Note: The existence of the 503 status code does not imply that 4482 a server must use it when becoming overloaded. Some servers 4483 may wish to simply refuse the connection. 4485 15.5.5. 504 Gateway Timeout 4487 The server, while acting as a proxy, did not receive a timely 4488 response from the upstream server specified by the URI or some other 4489 auxiliary server (e.g. DNS) it needed to access in attempting to 4490 complete the request. 4492 15.5.6. 505 RTSP Version Not Supported 4494 The server does not support, or refuses to support, the RTSP protocol 4495 version that was used in the request message. The server is 4496 indicating that it is unable or unwilling to complete the request 4497 using the same major version as the client other than with this error 4498 message. The response SHOULD contain an message body describing why 4499 that version is not supported and what other protocols are supported 4500 by that server. 4502 15.5.7. 551 Option not supported 4504 A feature-tag given in the Require or the Proxy-Require fields was 4505 not supported. The Unsupported header MUST be returned stating the 4506 feature for which there is no support. 4508 16. Header Field Definitions 4510 +---------------+----------------+--------+---------+------+ 4511 | method | direction | object | acronym | Body | 4512 +---------------+----------------+--------+---------+------+ 4513 | DESCRIBE | C -> S | P,S | DES | r | 4514 | | | | | | 4515 | GET_PARAMETER | C -> S, S -> C | P,S | GPR | R,r | 4516 | | | | | | 4517 | OPTIONS | C -> S, S -> C | P,S | OPT | | 4518 | | | | | | 4519 | PAUSE | C -> S | P,S | PSE | | 4520 | | | | | | 4521 | PLAY | C -> S | P,S | PLY | | 4522 | | | | | | 4523 | PLAY_NOTIFY | S -> C | P,S | PNY | R | 4524 | | | | | | 4525 | REDIRECT | S -> C | P,S | RDR | | 4526 | | | | | | 4527 | SETUP | C -> S | S | STP | | 4528 | | | | | | 4529 | SET_PARAMETER | C -> S, S -> C | P,S | SPR | R,r | 4530 | | | | | | 4531 | TEARDOWN | C -> S | P,S | TRD | | 4532 +---------------+----------------+--------+---------+------+ 4534 Table 8: Overview of RTSP methods, their direction, and what objects 4535 (P: presentation, S: stream) they operate on. Body notes if a method 4536 is allowed to carry body and in which direction, R = Request, 4537 r=response. Note: It is allowed for all error messages 4xx and 5xx to 4538 have a body 4540 The general syntax for header fields is covered in Section 5.2. This 4541 section lists the full set of header fields along with notes on 4542 meaning, and usage. The syntax definition for header fields are 4543 present in Section 20.2.3. Throughout this section, we use [HX.Y] to 4544 informational refer to Section X.Y of the current HTTP/1.1 4545 specification RFC 2616 [RFC2616]. Examples of each header field are 4546 given. 4548 Information about header fields in relation to methods and proxy 4549 processing is summarized in Table 9, Table 10, Table 11, and 4550 Table 12. 4552 The "where" column describes the request and response types in which 4553 the header field can be used. Values in this column are: 4555 R: header field may only appear in requests; 4557 r: header field may only appear in responses; 4559 2xx, 4xx, etc.: A numerical value or range indicates response codes 4560 with which the header field can be used; 4562 c: header field is copied from the request to the response. 4564 An empty entry in the "where" column indicates that the header field 4565 may be present in both requests and responses. 4567 The "proxy" column describes the operations a proxy may perform on a 4568 header field. An empty proxy column indicates that the proxy MUST 4569 NOT do any changes to that header, all allowed operations are 4570 explicitly stated: 4572 a: A proxy can add or concatenate the header field if not present. 4574 m: A proxy can modify an existing header field value. 4576 d: A proxy can delete a header field value. 4578 r: A proxy needs to be able to read the header field, and thus 4579 this header field cannot be encrypted. 4581 The rest of the columns relate to the presence of a header field in a 4582 method. The method names when abbreviated, are according to Table 8: 4584 c: Conditional; requirements on the header field depend on the 4585 context of the message. 4587 m: The header field is mandatory. 4589 m*: The header field SHOULD be sent, but clients/servers need to be 4590 prepared to receive messages without that header field. 4592 o: The header field is optional. 4594 *: The header field MUST be present if the message body is not 4595 empty. See Section 16.16, Section 16.18 and Section 5.3 for 4596 details. 4598 -: The header field is not applicable. 4600 "Optional" means that a Client/Server MAY include the header field in 4601 a request or response. The Client/Server behavior when receiving 4602 such headers varies, for some it may ignore the header field, in 4603 other case it is request to process the header. This is regulated by 4604 the method and header descriptions. Example of headers that require 4605 processing are the Require and Proxy-Require header fields discussed 4606 in Section 16.41 and Section 16.35. A "mandatory" header field MUST 4607 be present in a request, and MUST be understood by the Client/Server 4608 receiving the request. A mandatory response header field MUST be 4609 present in the response, and the header field MUST be understood by 4610 the Client/Server processing the response. "Not applicable" means 4611 that the header field MUST NOT be present in a request. If one is 4612 placed in a request by mistake, it MUST be ignored by the Client/ 4613 Server receiving the request. Similarly, a header field labeled "not 4614 applicable" for a response means that the Client/Server MUST NOT 4615 place the header field in the response, and the Client/Server MUST 4616 ignore the header field in the response. 4618 An RTSP agent MUST ignore extension headers that are not understood. 4620 The From and Location header fields contain an URI. If the URI 4621 contains a comma, or semicolon, the URI MUST be enclosed in double 4622 quotes ("). Any URI parameters are contained within these quotes. 4623 If the URI is not enclosed in double quotas, any semicolon- delimited 4624 parameters are header-parameters, not URI parameters. 4626 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4627 | Header | Where | Pro | DE | OPT | STP | PLY | PSE | TRD | 4628 | | | xy | S | | | | | | 4629 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4630 | Accept | R | | o | - | - | - | - | - | 4631 | | | | | | | | | | 4632 | Accept-Credentia | R | rm | o | o | o | o | o | o | 4633 | ls | | | | | | | | | 4634 | | | | | | | | | | 4635 | Accept-Encoding | R | r | o | - | - | - | - | - | 4636 | | | | | | | | | | 4637 | Accept-Language | R | r | o | - | - | - | - | - | 4638 | | | | | | | | | | 4639 | Accept-Ranges | R | r | - | - | m | - | - | - | 4640 | | | | | | | | | | 4641 | Accept-Ranges | r | r | - | - | m | - | - | - | 4642 | | | | | | | | | | 4643 | Accept-Ranges | 456 | r | - | - | - | m | - | - | 4644 | | | | | | | | | | 4645 | Allow | r | am | c | c | c | - | - | - | 4646 | | | | | | | | | | 4647 | Allow | 405 | am | m | m | m | m | m | m | 4648 | | | | | | | | | | 4649 | Authorization | R | | o | o | o | o | o | o | 4650 | | | | | | | | | | 4651 | Bandwidth | R | | o | o | o | o | - | - | 4652 | | | | | | | | | | 4653 | Blocksize | R | | o | - | o | o | - | - | 4654 | | | | | | | | | | 4655 | Cache-Control | | r | o | - | o | - | - | - | 4656 | | | | | | | | | | 4657 | Connection | | ad | o | o | o | o | o | o | 4658 | | | | | | | | | | 4659 | Connection-Crede | 470,4 | ar | o | o | o | o | o | o | 4660 | ntials | 07 | | | | | | | | 4661 | | | | | | | | | | 4662 | Content-Base | r | | o | - | - | - | - | - | 4663 | | | | | | | | | | 4664 | Content-Base | 4xx,5 | | o | o | o | o | o | o | 4665 | | xx | | | | | | | | 4666 | | | | | | | | | | 4667 | Content-Encoding | R | r | - | - | - | - | - | - | 4668 | | | | | | | | | | 4669 | Content-Encoding | r | r | o | - | - | - | - | - | 4670 | | | | | | | | | | 4671 | Content-Encoding | 4xx,5 | r | o | o | o | o | o | o | 4672 | | xx | | | | | | | | 4673 | | | | | | | | | | 4674 | Content-Language | R | r | - | - | - | - | - | - | 4675 | | | | | | | | | | 4676 | Content-Language | r | r | o | - | - | - | - | - | 4677 | | | | | | | | | | 4678 | Content-Language | 4xx,5 | r | o | o | o | o | o | o | 4679 | | xx | | | | | | | | 4680 | | | | | | | | | | 4681 | Content-Length | r | r | * | - | - | - | - | - | 4682 | | | | | | | | | | 4683 | Content-Length | 4xx,5 | r | * | * | * | * | * | * | 4684 | | xx | | | | | | | | 4685 | | | | | | | | | | 4686 | Content-Location | r | r | o | - | - | - | - | - | 4687 | | | | | | | | | | 4688 | Content-Location | 4xx,5 | r | o | o | o | o | o | o | 4689 | | xx | | | | | | | | 4690 | | | | | | | | | | 4691 | Content-Type | r | r | * | - | - | - | - | - | 4692 | | | | | | | | | | 4693 | Content-Type | 4xx,5 | ar | * | * | * | * | * | * | 4694 | | xx | | | | | | | | 4695 | | | | | | | | | | 4696 | CSeq | Rc | rm | m | m | m | m | m | m | 4697 | | | | | | | | | | 4698 | Date | | am | o/ | o/* | o/* | o/* | o/* | o/* | 4699 | | | | * | | | | | | 4700 | | | | | | | | | | 4701 | Expires | r | r | o | - | - | - | - | - | 4702 | | | | | | | | | | 4703 | From | R | r | o | o | o | o | o | o | 4704 | | | | | | | | | | 4705 | If-Match | R | r | - | - | o | - | - | - | 4706 | | | | | | | | | | 4707 | If-Modified-Sinc | R | r | o | - | o | - | - | - | 4708 | e | | | | | | | | | 4709 | | | | | | | | | | 4710 | If-None-Match | R | r | o | - | o | - | - | - | 4711 | | | | | | | | | | 4712 | Last-Modified | r | r | o | - | o | - | - | - | 4713 | | | | | | | | | | 4714 | Location | 3rr | | o | o | o | o | o | o | 4715 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4717 Table 9: Overview of RTSP header fields (A-L) related to methods 4718 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4720 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4721 | Header | Where | Prox | DES | OPT | STP | PLY | PSE | TRD | 4722 | | | y | | | | | | | 4723 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4724 | Media- | | | - | - | m | m | m | - | 4725 | Properties | | | | | | | | | 4726 | | | | | | | | | | 4727 | Media-Range | | | - | - | m | m | m | - | 4728 | | | | | | | | | | 4729 | MTag | r | r | o | - | o | - | - | - | 4730 | | | | | | | | | | 4731 | Pipelined- | | amdr | - | o | o | o | o | o | 4732 | Requests | | | | | | | | | 4733 | | | | | | | | | | 4734 | Proxy- | 407 | amr | m | m | m | m | m | m | 4735 | Authenticate | | | | | | | | | 4736 | | | | | | | | | | 4737 | Proxy- | R | rd | o | o | o | o | o | o | 4738 | Authorization | | | | | | | | | 4739 | | | | | | | | | | 4740 | Proxy- | R | ar | o | o | o | o | o | o | 4741 | Require | | | | | | | | | 4742 | | | | | | | | | | 4743 | Proxy- | r | r | c | c | c | c | c | c | 4744 | Require | | | | | | | | | 4745 | | | | | | | | | | 4746 | Proxy- | R | amr | c | c | c | c | c | c | 4747 | Supported | | | | | | | | | 4748 | | | | | | | | | | 4749 | Proxy- | r | | c | c | c | c | c | c | 4750 | Supported | | | | | | | | | 4751 | | | | | | | | | | 4752 | Public | r | amr | - | m | - | - | - | - | 4753 | | | | | | | | | | 4754 | Public | 501 | amr | m | m | m | m | m | m | 4755 | | | | | | | | | | 4756 | Range | R | | - | - | - | o | - | - | 4757 | | | | | | | | | | 4758 | Range | r | | - | - | c | m | m | - | 4759 | | | | | | | | | | 4760 | Terminate-Rea | R | r | - | - | - | - | - | - | 4761 | son | | | | | | | | | 4762 | | | | | | | | | | 4763 | Referrer | R | | o | o | o | o | o | o | 4764 | | | | | | | | | | 4765 | Request- | R | | - | - | - | - | - | - | 4766 | Status | | | | | | | | | 4767 | | | | | | | | | | 4768 | Require | R | | o | o | o | o | o | o | 4769 | | | | | | | | | | 4770 | Retry-After | 3rr,50 | | o | o | o | o | o | - | 4771 | | 3 | | | | | | | | 4772 | | | | | | | | | | 4773 | Retry-After | 413 | | o | - | - | - | - | - | 4774 | | | | | | | | | | 4775 | RTP-Info | r | | - | - | c | c | - | - | 4776 | | | | | | | | | | 4777 | Scale | R | r | - | - | - | o | - | - | 4778 | | | | | | | | | | 4779 | Scale | r | amr | - | - | - | c | - | - | 4780 | | | | | | | | | | 4781 | Seek-Style | R | | - | - | - | o | - | - | 4782 | | | | | | | | | | 4783 | Seek-Style | r | | - | - | - | m | - | - | 4784 | | | | | | | | | | 4785 | Server | R | r | - | o | - | - | - | o | 4786 | | | | | | | | | | 4787 | Server | r | r | o | o | o | o | o | o | 4788 | | | | | | | | | | 4789 | Session | R | r | - | o | o | m | m | m | 4790 | | | | | | | | | | 4791 | Session | r | r | - | c | m | m | m | o | 4792 | | | | | | | | | | 4793 | Speed | R | admr | - | - | - | o | - | - | 4794 | Speed | r | admr | - | - | - | c | - | - | 4795 | | | | | | | | | | 4796 | Supported | R | amr | o | o | o | o | o | o | 4797 | | | | | | | | | | 4798 | Supported | r | amr | c | c | c | c | c | c | 4799 | | | | | | | | | | 4800 | Timestamp | R | admr | o | o | o | o | o | o | 4801 | | | | | | | | | | 4802 | Timestamp | c | admr | m | m | m | m | m | m | 4803 | | | | | | | | | | 4804 | Transport | | mr | - | - | m | - | - | - | 4805 | | | | | | | | | | 4806 | Unsupported | r | | c | c | c | c | c | c | 4807 | | | | | | | | | | 4808 | User-Agent | R | | m* | m* | m* | m* | m* | m* | 4809 | | | | | | | | | | 4810 | Vary | r | | c | c | c | c | c | c | 4811 | | | | | | | | | | 4812 | Via | R | amr | o | o | o | o | o | o | 4813 | | | | | | | | | | 4814 | Via | c | dr | m | m | m | m | m | m | 4815 | | | | | | | | | | 4816 | WWW- | 401 | | m | m | m | m | m | m | 4817 | Authenticate | | | | | | | | | 4818 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4820 Table 10: Overview of RTSP header fields (P-W) related to methods 4821 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4823 +------------------------+---------+-------+-----+-----+-----+-----+ 4824 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4825 +------------------------+---------+-------+-----+-----+-----+-----+ 4826 | Accept | R | arm | o | o | - | - | 4827 | | | | | | | | 4828 | Accept-Credentials | R | rm | o | o | o | - | 4829 | | | | | | | | 4830 | Accept-Ranges | | rm | o | - | - | - | 4831 | | | | | | | | 4832 | Allow | 405 | amr | m | m | m | - | 4833 | | | | | | | | 4834 | Authorization | R | | o | o | o | - | 4835 | | | | | | | | 4836 | Bandwidth | R | | - | o | - | - | 4837 | | | | | | | | 4838 | Blocksize | R | | - | o | - | - | 4839 | | | | | | | | 4840 | Connection | | | o | o | o | o | 4841 | | | | | | | | 4842 | Cache-Control | | r | o | o | - | - | 4843 | | | | | | | | 4844 | Connection-Credentials | 470,407 | ar | o | o | o | - | 4845 | | | | | | | | 4846 | Content-Base | R | | o | o | - | - | 4847 | | | | | | | | 4848 | Content-Base | r | | o | o | - | - | 4849 | | | | | | | | 4850 | Content-Base | 4xx,5xx | | o | o | o | o | 4851 | | | | | | | | 4852 | Content-Encoding | R | r | o | o | - | - | 4853 | | | | | | | | 4854 | Content-Encoding | r | r | o | o | - | - | 4855 | | | | | | | | 4856 | Content-Encoding | 4xx,5xx | r | o | o | o | o | 4857 | | | | | | | | 4858 | Content-Language | R | r | o | o | - | - | 4859 | | | | | | | | 4860 | Content-Language | r | r | o | o | - | - | 4861 | | | | | | | | 4862 | Content-Language | 4xx,5xx | r | o | o | o | o | 4863 | | | | | | | | 4864 | Content-Length | R | r | * | * | - | - | 4865 | | | | | | | | 4866 | Content-Length | r | r | * | * | - | - | 4867 | | | | | | | | 4868 | Content-Length | 4xx,5xx | r | * | * | * | * | 4869 | | | | | | | | 4870 | Content-Location | R | | o | o | - | - | 4871 | | | | | | | | 4872 | Content-Location | r | | o | o | - | - | 4873 | | | | | | | | 4874 | Content-Location | 4xx,5xx | | o | o | o | o | 4875 | | | | | | | | 4876 | Content-Type | R | | * | * | - | - | 4877 | | | | | | | | 4878 | Content-Type | r | | * | * | - | - | 4879 | | | | | | | | 4880 | Content-Type | 4xx,5xx | | * | * | * | * | 4881 | | | | | | | | 4882 | CSeq | R,c | mr | m | m | m | m | 4883 | | | | | | | | 4884 | Date | R | a | o | o | m | o | 4885 | | | | | | | | 4886 | Date | r | am | o | o | o | o | 4887 | | | | | | | | 4888 | If-Modified-Since | R | am | o | - | - | - | 4889 | | | | | | | | 4890 | If-None-Match | R | am | o | - | - | - | 4891 | | | | | | | | 4892 | From | R | r | o | o | o | - | 4893 | | | | | | | | 4894 | Last-Modified | R | r | - | - | - | - | 4895 | | | | | | | | 4896 | Last-Modified | r | r | o | - | - | - | 4897 | | | | | | | | 4898 | Location | 3rr | | o | o | o | - | 4899 | | | | | | | | 4900 | Location | R | | - | - | m | - | 4901 | | | | | | | | 4902 | Media-Properties | R | amr | o | - | - | c | 4903 | | | | | | | | 4904 | Media-Properties | r | mr | c | - | - | - | 4905 | | | | | | | | 4906 | Media-Range | R | | o | - | - | c | 4907 | | | | | | | | 4908 | Media-Range | r | | c | - | - | - | 4909 | | | | | | | | 4910 | Notify-Reason | R | | - | - | - | m | 4911 | | | | | | | | 4912 | Pipelined-Requests | R | amdr | o | o | - | - | 4913 | | | | | | | | 4914 | Proxy-Authenticate | 407 | amr | m | m | m | - | 4915 | | | | | | | | 4916 | Proxy-Authorization | R | rd | o | o | o | - | 4917 | | | | | | | | 4918 | Proxy-Require | R | ar | o | o | o | - | 4919 | | | | | | | | 4920 | Proxy-Require | r | r | c | c | c | - | 4921 | | | | | | | | 4922 | Proxy-Supported | R | amr | c | c | c | - | 4923 | | | | | | | | 4924 | Proxy-Supported | r | | c | c | c | - | 4925 | | | | | | | | 4926 | Public | 501 | admr | m | m | m | - | 4927 +------------------------+---------+-------+-----+-----+-----+-----+ 4929 Table 11: Overview of RTSP header fields (A-P) related to methods 4930 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 4932 +------------------+---------+-------+-----+-----+-----+-----+ 4933 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4934 +------------------+---------+-------+-----+-----+-----+-----+ 4935 | Range | R | | o | - | o | m | 4936 | | | | | | | | 4937 | Referrer | R | | o | o | o | - | 4938 | Request-Status | R | | - | - | - | c | 4939 | | | | | | | | 4940 | Require | R | r | o | o | o | - | 4941 | | | | | | | | 4942 | Retry-After | 3rr,503 | | o | o | - | - | 4943 | | | | | | | | 4944 | Retry-After | 413 | | o | o | - | - | 4945 | | | | | | | | 4946 | RTP-Info | R | r | o | - | - | C | 4947 | | | | | | | | 4948 | RTP-Info | r | r | c | - | - | - | 4949 | | | | | | | | 4950 | Scale | | | - | - | - | c | 4951 | | | | | | | | 4952 | Seek-Style | | | - | - | - | - | 4953 | | | | | | | | 4954 | Session | R | r | o | o | o | m | 4955 | | | | | | | | 4956 | Session | r | r | c | c | o | m | 4957 | | | | | | | | 4958 | Server | R | r | o | o | o | o | 4959 | | | | | | | | 4960 | Server | r | r | o | o | - | - | 4961 | | | | | | | | 4962 | Speed | | | - | - | - | - | 4963 | | | | | | | | 4964 | Supported | R | adrm | o | o | o | - | 4965 | | | | | | | | 4966 | Supported | r | adrm | c | c | c | - | 4967 | | | | | | | | 4968 | Terminate-Reason | R | r | - | - | m | - | 4969 | | | | | | | | 4970 | Timestamp | R | adrm | o | o | o | - | 4971 | | | | | | | | 4972 | Timestamp | c | adrm | m | m | m | - | 4973 | | | | | | | | 4974 | Unsupported | r | arm | c | c | c | - | 4975 | | | | | | | | 4976 | User-Agent | R | r | m* | m* | - | - | 4977 | | | | | | | | 4978 | User-Agent | r | r | m* | m* | m* | m* | 4979 | | | | | | | | 4980 | Vary | r | | c | c | - | - | 4981 | | | | | | | | 4982 | Via | R | amr | o | o | o | - | 4983 | | | | | | | | 4984 | Via | c | dr | m | m | m | - | 4985 | | | | | | | | 4986 | WWW-Authenticate | 401 | | m | m | m | - | 4987 +------------------+---------+-------+-----+-----+-----+-----+ 4989 Table 12: Overview of RTSP header fields (R-W) related to methods 4990 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 4992 16.1. Accept 4994 The Accept request-header field can be used to specify certain 4995 presentation description and parameter media types [RFC4288] which 4996 are acceptable for the response to DESCRIBE and GET_PARAMETER 4997 requests. 4999 See Section 20.2.3 for the syntax. 5001 Example of use: 5002 Accept: application/example ;q=1.0, application/sdp 5004 16.2. Accept-Credentials 5006 The Accept-Credentials header is a request header used to indicate to 5007 any trusted intermediary how to handle further secured connections to 5008 proxies or servers. See Section 19 for the usage of this header. It 5009 MUST NOT be included in server to client requests. 5011 In a request the header MUST contain the method (User, Proxy, or Any) 5012 for approving credentials selected by the requester. The method MUST 5013 NOT be changed by any proxy, unless it is "proxy" when a proxy MAY 5014 change it to "user" to take the role of user approving each further 5015 hop. If the method is "User" the header contains zero or more of 5016 credentials that the client accepts. The header may contain zero 5017 credentials in the first RTSP request to a RTSP server when using the 5018 "User" method. This as the client has not yet received any 5019 credentials to accept. Each credential MUST consist of one URI 5020 identifying the proxy or server, the hash algorithm identifier, and 5021 the hash over that agent's DER encoded certificate [RFC5280] in 5022 Base64 [RFC4648]. All RTSP clients and proxies MUST implement the 5023 SHA-256[FIPS-pub-180-2] algorithm for computation of the hash of the 5024 DER encoded certificate. The SHA-256 algorithm is identified by the 5025 token "sha-256". 5027 The intention with allowing for other hash algorithms is to enable 5028 the future retirement of algorithms that are not implemented 5029 somewhere else than here. Thus the definition of future algorithms 5030 for this purpose is intended to be extremely limited. A feature tag 5031 can be used to ensure that support for the replacement algorithm 5032 exist. 5034 Example: 5035 Accept-Credentials:User 5036 "rtsps://proxy2.example.com/";sha-256;exaIl9VMbQMOFGClx5rXnPJKVNI=, 5037 "rtsps://server.example.com/";sha-256;lurbjj5khhB0NhIuOXtt4bBRH1M= 5039 16.3. Accept-Encoding 5041 The Accept-Encoding request-header field is similar to Accept, but 5042 restricts the content-codings, i.e. transformation codings of the 5043 message body like gzip compression, that are acceptable in the 5044 response. 5046 A server tests whether a content-coding is acceptable, according to 5047 an Accept-Encoding field, using these rules: 5049 1. If the content-coding is one of the content-codings listed in the 5050 Accept-Encoding field, then it is acceptable, unless it is 5051 accompanied by a qvalue of 0. (As defined in section 3.9, a 5052 qvalue of 0 means "not acceptable.") 5054 2. The special "*" symbol in an Accept-Encoding field matches any 5055 available content-coding not explicitly listed in the header 5056 field. 5058 3. If multiple content-codings are acceptable, then the acceptable 5059 content-coding with the highest non-zero qvalue is preferred. 5061 4. The "identity" content-coding is always acceptable, i.e. no 5062 transformation at all, unless specifically refused because the 5063 Accept-Encoding field includes "identity;q=0", or because the 5064 field includes "*;q=0" and does not explicitly include the 5065 "identity" content-coding. If the Accept-Encoding field-value is 5066 empty, then only the "identity" encoding is acceptable. 5068 If an Accept-Encoding field is present in a request, and if the 5069 server cannot send a response which is acceptable according to the 5070 Accept-Encoding header, then the server SHOULD send an error response 5071 with the 406 (Not Acceptable) status code. 5073 If no Accept-Encoding field is present in a request, the server MAY 5074 assume that the client will accept any content coding. In this case, 5075 if "identity" is one of the available content-codings, then the 5076 server SHOULD use the "identity" content-coding, unless it has 5077 additional information that a different content-coding is meaningful 5078 to the client. 5080 16.4. Accept-Language 5082 The Accept-Language request-header field is similar to Accept, but 5083 restricts the set of natural languages that are preferred as a 5084 response to the request. Note that the language specified applies to 5085 the presentation description and any reason phrases, but not the 5086 media content. 5088 A language tag identifies a natural language spoken, written, or 5089 otherwise conveyed by human beings for communication of information 5090 to other human beings. Computer languages are explicitly excluded. 5091 The syntax and registry of RTSP 2.0 language tags is the same as that 5092 defined by [RFC5646]. 5094 Each language-range MAY be given an associated quality value which 5095 represents an estimate of the user's preference for the languages 5096 specified by that range. The quality value defaults to "q=1". For 5097 example: 5099 Accept-Language: da, en-gb;q=0.8, en;q=0.7 5101 would mean: "I prefer Danish, but will accept British English and 5102 other types of English." A language-range matches a language-tag if 5103 it exactly equals the tag, or if it exactly equals a prefix of the 5104 tag such that the first tag character following the prefix is "-". 5105 The special range "*", if present in the Accept-Language field, 5106 matches every tag not matched by any other range present in the 5107 Accept-Language field. 5109 Note: This use of a prefix matching rule does not imply that 5110 language tags are assigned to languages in such a way that it is 5111 always true that if a user understands a language with a certain 5112 tag, then this user will also understand all languages with tags 5113 for which this tag is a prefix. The prefix rule simply allows the 5114 use of prefix tags if this is the case. 5116 The language quality factor assigned to a language-tag by the Accept- 5117 Language field is the quality value of the longest language-range in 5118 the field that matches the language-tag. If no language-range in the 5119 field matches the tag, the language quality factor assigned is 0. If 5120 no Accept-Language header is present in the request, the server 5121 SHOULD assume that all languages are equally acceptable. If an 5122 Accept-Language header is present, then all languages which are 5123 assigned a quality factor greater than 0 are acceptable. 5125 16.5. Accept-Ranges 5127 The Accept-Ranges general-header field allows indication of the 5128 format supported in the Range header. The client MUST include the 5129 header in SETUP requests to indicate which formats it support to 5130 receive in PLAY and PAUSE responses, and REDIRECT requests. The 5131 server MUST include the header in SETUP and 456 error responses to 5132 indicate the formats supported for the resource indicated by the 5133 request URI. The header MAY be included in GET_PARAMETER request and 5134 response pairs. The GET_PARAMETER request MUST contain a Session 5135 header to identify the session context the request are related to. 5136 The requester and responder will indicate their capabilities 5137 regarding Range formats respectively. 5139 Accept-Ranges: NPT, SMPTE 5141 The syntax is defined in Section 20.2.3. 5143 16.6. Allow 5145 The Allow message-header field lists the methods supported by the 5146 resource identified by the Request-URI. The purpose of this field is 5147 to strictly inform the recipient of valid methods associated with the 5148 resource. An Allow header field MUST be present in a 405 (Method Not 5149 Allowed) response. The Allow header MUST also be present in all 5150 OPTIONS responses where the content of the header will not include 5151 exactly the same methods as listed in the Public header. 5153 The Allow MUST also be included in SETUP and DESCRIBE responses, if 5154 the methods allowed for the resource is different than the minimal 5155 implementation set. 5157 Example of use: 5158 Allow: SETUP, PLAY, SET_PARAMETER, DESCRIBE 5160 16.7. Authorization 5162 An RTSP client that wishes to authenticate itself with a server using 5163 authentication mechanism from HTTP [RFC2617] , usually, but not 5164 necessarily, after receiving a 401 response, does so by including an 5165 Authorization request-header field with the request. The 5166 Authorization field value consists of credentials containing the 5167 authentication information of the user agent for the realm of the 5168 resource being requested. 5170 If a request is authenticated and a realm specified, the same 5171 credentials SHOULD be valid for all other requests within this realm 5172 (assuming that the authentication scheme itself does not require 5173 otherwise, such as credentials that vary according to a challenge 5174 value or using synchronized clocks). 5176 When a shared cache (see Section 18) receives a request containing an 5177 Authorization field, it MUST NOT return the corresponding response as 5178 a reply to any other request, unless one of the following specific 5179 exceptions holds: 5181 1. If the response includes the "maxage" cache-control directive, 5182 the cache MAY use that response in replying to a subsequent 5183 request. But (if the specified maximum age has passed) a proxy 5184 cache MUST first revalidate it with the origin server, using the 5185 request-headers from the new request to allow the origin server 5186 to authenticate the new request. (This is the defined behavior 5187 for maxage.) If the response includes "maxage=0", the proxy MUST 5188 always revalidate it before re-using it. 5190 2. If the response includes the "must-revalidate" cache-control 5191 directive, the cache MAY use that response in replying to a 5192 subsequent request. But if the response is stale, all caches 5193 MUST first revalidate it with the origin server, using the 5194 request-headers from the new request to allow the origin server 5195 to authenticate the new request. 5197 3. If the response includes the "public" cache-control directive, it 5198 MAY be returned in reply to any subsequent request. 5200 16.8. Bandwidth 5202 The Bandwidth request-header field describes the estimated bandwidth 5203 available to the client, expressed as a positive integer and measured 5204 in bits per second. The bandwidth available to the client may change 5205 during an RTSP session, e.g., due to mobility, congestion, etc. 5207 Example: 5208 Bandwidth: 62360 5210 16.9. Blocksize 5212 The Blocksize request-header field is sent from the client to the 5213 media server asking the server for a particular media packet size. 5214 This packet size does not include lower-layer headers such as IP, 5215 UDP, or RTP. The server is free to use a blocksize which is lower 5216 than the one requested. The server MAY truncate this packet size to 5217 the closest multiple of the minimum, media-specific block size, or 5218 override it with the media-specific size if necessary. The block 5219 size MUST be a positive decimal number, measured in octets. The 5220 server only returns an error (4xx) if the value is syntactically 5221 invalid. 5223 16.10. Cache-Control 5225 The Cache-Control general-header field is used to specify directives 5226 that MUST be obeyed by all caching mechanisms along the request/ 5227 response chain. 5229 Cache directives MUST be passed through by a proxy or gateway 5230 application, regardless of their significance to that application, 5231 since the directives may be applicable to all recipients along the 5232 request/response chain. It is not possible to specify a cache- 5233 directive for a specific cache. 5235 Cache-Control should only be specified in a DESCRIBE, GET_PARAMETER, 5236 SET_PARAMETER and SETUP request and its response. Note: Cache- 5237 Control does not govern only the caching of responses as for HTTP, 5238 instead it also applies to the media stream identified by the SETUP 5239 request. The RTSP requests are generally not cacheable, for further 5240 information see Section 18. Below is the description of the cache 5241 directives that can be included in the Cache-Control header. 5243 no-cache: Indicates that the media stream MUST NOT be cached 5244 anywhere. This allows an origin server to prevent caching even 5245 by caches that have been configured to return stale responses 5246 to client requests. Note, there is no security function 5247 enforcing that the content can't be cached. 5249 public: Indicates that the media stream is cacheable by any cache. 5251 private: Indicates that the media stream is intended for a single 5252 user and MUST NOT be cached by a shared cache. A private (non- 5253 shared) cache may cache the media streams. 5255 no-transform: An intermediate cache (proxy) may find it useful to 5256 convert the media type of a certain stream. A proxy might, for 5257 example, convert between video formats to save cache space or 5258 to reduce the amount of traffic on a slow link. Serious 5259 operational problems may occur, however, when these 5260 transformations have been applied to streams intended for 5261 certain kinds of applications. For example, applications for 5262 medical imaging, scientific data analysis and those using end- 5263 to-end authentication all depend on receiving a stream that is 5264 bit-for-bit identical to the original media stream. Therefore, 5265 if a response includes the no-transform directive, an 5266 intermediate cache or proxy MUST NOT change the encoding of the 5267 stream. Unlike HTTP, RTSP does not provide for partial 5268 transformation at this point, e.g., allowing translation into a 5269 different language. 5271 only-if-cached: In some cases, such as times of extremely poor 5272 network connectivity, a client may want a cache to return only 5273 those media streams that it currently has stored, and not to 5274 receive these from the origin server. To do this, the client 5275 may include the only-if-cached directive in a request. If it 5276 receives this directive, a cache SHOULD either respond using a 5277 cached media stream that is consistent with the other 5278 constraints of the request, or respond with a 504 (Gateway 5279 Timeout) status. However, if a group of caches is being 5280 operated as a unified system with good internal connectivity, 5281 such a request MAY be forwarded within that group of caches. 5283 max-stale: Indicates that the client is willing to accept a media 5284 stream that has exceeded its expiration time. If max-stale is 5285 assigned a value, then the client is willing to accept a 5286 response that has exceeded its expiration time by no more than 5287 the specified number of seconds. If no value is assigned to 5288 max-stale, then the client is willing to accept a stale 5289 response of any age. 5291 min-fresh: Indicates that the client is willing to accept a media 5292 stream whose freshness lifetime is no less than its current age 5293 plus the specified time in seconds. That is, the client wants 5294 a response that will still be fresh for at least the specified 5295 number of seconds. 5297 must-revalidate: When the must-revalidate directive is present in a 5298 SETUP response received by a cache, that cache MUST NOT use the 5299 entry after it becomes stale to respond to a subsequent request 5300 without first revalidating it with the origin server. That is, 5301 the cache is required to do an end-to-end revalidation every 5302 time, if, based solely on the origin server's Expires, the 5303 cached response is stale.) 5305 proxy-revalidate: The proxy-revalidate directive has the same 5306 meaning as the must-revalidate directive, except that it does 5307 not apply to non-shared user agent caches. It can be used on a 5308 response to an authenticated request to permit the user's cache 5309 to store and later return the response without needing to 5310 revalidate it (since it has already been authenticated once by 5311 that user), while still requiring proxies that service many 5312 users to revalidate each time (in order to make sure that each 5313 user has been authenticated). Note that such authenticated 5314 responses also need the public cache control directive in order 5315 to allow them to be cached at all. 5317 max-age: When an intermediate cache is forced, by means of a max- 5318 age=0 directive, to revalidate its own cache entry, and the 5319 client has supplied its own validator in the request, the 5320 supplied validator might differ from the validator currently 5321 stored with the cache entry. In this case, the cache MAY use 5322 either validator in making its own request without affecting 5323 semantic transparency. 5325 However, the choice of validator might affect performance. The best 5326 approach is for the intermediate cache to use its own validator when 5327 making its request. If the server replies with 304 (Not Modified), 5328 then the cache can return its now validated copy to the client with a 5329 200 (OK) response. If the server replies with a new message body and 5330 cache validator, however, the intermediate cache can compare the 5331 returned validator with the one provided in the client's request, 5332 using the strong comparison function. If the client's validator is 5333 equal to the origin server's, then the intermediate cache simply 5334 returns 304 (Not Modified). Otherwise, it returns the new message 5335 body with a 200 (OK) response. 5337 16.11. Connection 5339 The Connection general-header field allows the sender to specify 5340 options that are desired for that particular connection and MUST NOT 5341 be communicated by proxies over further connections. 5343 RTSP 2.0 proxies MUST parse the Connection header field before a 5344 message is forwarded and, for each connection-token in this field, 5345 remove any header field(s) from the message with the same name as the 5346 connection-token. Connection options are signaled by the presence of 5347 a connection-token in the Connection header field, not by any 5348 corresponding additional header field(s), since the additional header 5349 field may not be sent if there are no parameters associated with that 5350 connection option. 5352 Message headers listed in the Connection header MUST NOT include end- 5353 to-end headers, such as Cache-Control. 5355 RTSP 2.0 defines the "close" connection option for the sender to 5356 signal that the connection will be closed after completion of the 5357 response. For example, Connection: close in either the request or 5358 the response header fields indicates that the connection SHOULD NOT 5359 be considered `persistent' (Section 10.2) after the current request/ 5360 response is complete. 5362 The use of the connection option "close" in RTSP messages SHOULD be 5363 limited to error messages when the server is unable to recover and 5364 therefore see it necessary to close the connection. The reason is 5365 that the client has the choice of continuing using a connection 5366 indefinitely, as long as it sends valid messages. 5368 16.12. Connection-Credentials 5370 The Connection-Credentials response header is used to carry the chain 5371 of credentials of any next hop that need to be approved by the 5372 requester. It MUST only be used in server to client responses. 5374 The Connection-Credentials header in an RTSP response MUST, if 5375 included, contain the credential information (in form of a list of 5376 certificates providing the chain of certification) of the next hop 5377 that an intermediary needs to securely connect to. The header MUST 5378 include the URI of the next hop (proxy or server) and a base64 5379 [RFC4648] encoded binary structure containing a sequence of DER 5380 encoded X.509v3 certificates[RFC5280] . 5382 The binary structure starts with the number of certificates 5383 (NR_CERTS) included as a 16 bit unsigned integer. This is followed 5384 by NR_CERTS number of 16 bit unsigned integers providing the size in 5385 octets of each DER encoded certificate. This is followed by NR_CERTS 5386 number of DER encoded X.509v3 certificates in a sequence (chain). 5387 The proxy or server's certificate must come first in the structure. 5388 Each following certificate must directly certify the one preceding 5389 it. Because certificate validation requires that root keys be 5390 distributed independently, the self-signed certificate which 5391 specifies the root certificate authority may optionally be omitted 5392 from the chain, under the assumption that the remote end must already 5393 possess it in order to validate it in any case. 5395 Example: 5397 Connection-Credentials:"rtsps://proxy2.example.com/";MIIDNTCC... 5399 Where MIIDNTCC... is a BASE64 encoding of the following structure: 5401 0 1 2 3 5402 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 5403 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5404 | Number of certificates | Size of certificate #1 | 5405 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5406 | Size of certificate #2 | Size of certificate #3 | 5407 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5408 : DER Encoding of Certificate #1 : 5409 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5410 : DER Encoding of Certificate #2 : 5411 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5412 : DER Encoding of Certificate #3 : 5414 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5416 16.13. Content-Base 5418 The Content-Base message-header field may be used to specify the base 5419 URI for resolving relative URIs within the message body. 5421 Content-Base: rtsp://media.example.com/movie/twister/ 5423 If no Content-Base field is present, the base URI of an message body 5424 is defined either by its Content-Location (if that Content-Location 5425 URI is an absolute URI) or the URI used to initiate the request, in 5426 that order of precedence. Note, however, that the base URI of the 5427 contents within the message-body may be redefined within that 5428 message-body. 5430 16.14. Content-Encoding 5432 The Content-Encoding header field is used as a modifier to the media- 5433 type. When present, its value indicates what additional content 5434 codings have been applied to the message body, and thus what decoding 5435 mechanisms must be applied in order to obtain the media-type 5436 referenced by the Content-Type header field. Content-Encoding is 5437 primarily used to allow a document to be compressed without losing 5438 the identity of its underlying media type. 5440 The content-coding is a characteristic of the message body identified 5441 by the Request-URI. Typically, the message body is stored with this 5442 encoding and is only decoded before rendering or analogous usage. 5443 However, a non-transparent proxy MAY modify the content-coding if the 5444 new coding is known to be acceptable to the recipient, unless the 5445 "no-transform" cache-control directive is present in the message. 5447 If the content-coding of an message body is not "identity", then the 5448 response MUST include a Content-Encoding Message-body header that 5449 lists the non-identity content-coding(s) used. 5451 If the content-coding of an message body in a request message is not 5452 acceptable to the origin server, the server SHOULD respond with a 5453 status code of 415 (Unsupported Media Type). 5455 If multiple encodings have been applied to a message body, the 5456 content codings MUST be listed in the order in which they were 5457 applied, first to last from left to right. Additional information 5458 about the encoding parameters MAY be provided by other header fields 5459 not defined by this specification. 5461 16.15. Content-Language 5463 The Content-Language header field describes the natural language(s) 5464 of the intended audience for the enclosed message body. Note that 5465 this might not be equivalent to all the languages used within the 5466 message body. 5468 Language tags are mentioned in Section 16.4. The primary purpose of 5469 Content-Language is to allow a user to identify and differentiate 5470 entities according to the user's own preferred language. Thus, if 5471 the body content is intended only for a Danish-literate audience, the 5472 appropriate field is 5474 Content-Language: da 5476 If no Content-Language is specified, the default is that the content 5477 is intended for all language audiences. This might mean that the 5478 sender does not consider it to be specific to any natural language, 5479 or that the sender does not know for which language it is intended. 5481 Multiple languages MAY be listed for content that is intended for 5482 multiple audiences. For example, a rendition of the "Treaty of 5483 Waitangi," presented simultaneously in the original Maori and English 5484 versions, would call for 5486 Content-Language: mi, en 5488 However, just because multiple languages are present within an 5489 message body does not mean that it is intended for multiple 5490 linguistic audiences. An example would be a beginner's language 5491 primer, such as "A First Lesson in Latin," which is clearly intended 5492 to be used by an English-literate audience. In this case, the 5493 Content-Language would properly only include "en". 5495 Content-Language MAY be applied to any media type -- it is not 5496 limited to textual documents. 5498 16.16. Content-Length 5500 The Content-Length general-header field contains the length of the 5501 message body of the RTSP message (i.e. after the double CRLF 5502 following the last header). Unlike HTTP, it MUST be included in all 5503 messages that carry a message body beyond the header portion of the 5504 RTSP message. If it is missing, a default value of zero is assumed. 5505 Any Content-Length greater than or equal to zero is a valid value. 5507 16.17. Content-Location 5509 The Content-Location header field MAY be used to supply the resource 5510 location for the message body enclosed in the message when that body 5511 is accessible from a location separate from the requested resource's 5512 URI. A server SHOULD provide a Content-Location for the variant 5513 corresponding to the response message body; especially in the case 5514 where a resource has multiple variants associated with it, and those 5515 entities actually have separate locations by which they might be 5516 individually accessed, the server SHOULD provide a Content-Location 5517 for the particular variant which is returned. 5519 The Content-Location value is not a replacement for the original 5520 requested URI; it is only a statement of the location of the resource 5521 corresponding to this particular variant at the time of the request. 5522 Future requests MAY specify the Content-Location URI as the request 5523 URI if the desire is to identify the source of that particular 5524 variant. 5526 A cache cannot assume that an message body with a Content-Location 5527 different from the URI used to retrieve it can be used to respond to 5528 later requests on that Content-Location URI. However, the Content- 5529 Location can be used to differentiate between multiple variants 5530 retrieved from a single requested resource. 5532 If the Content-Location is a relative URI, the relative URI is 5533 interpreted relative to the Request-URI. 5535 16.18. Content-Type 5537 The Content-Type header indicates the media type of the message body 5538 sent to the recipient. Note that the content types suitable for RTSP 5539 are likely to be restricted in practice to presentation descriptions 5540 and parameter-value types. 5542 16.19. CSeq 5544 The CSeq general-header field specifies the sequence number for an 5545 RTSP request-response pair. This field MUST be present in all 5546 requests and responses. For every RTSP request containing the given 5547 sequence number, the corresponding response will have the same 5548 number. Any retransmitted request MUST contain the same sequence 5549 number as the original (i.e. the sequence number is not incremented 5550 for retransmissions of the same request). For each new RTSP request 5551 the CSeq value MUST be incremented by one. The initial sequence 5552 number MAY be any number, however, it is RECOMMENDED to start at 0. 5553 Each sequence number series is unique between each requester and 5554 responder, i.e. the client has one series for its request to a server 5555 and the server has another when sending request to the client. Each 5556 requester and responder is identified with its network address. 5558 Proxies that aggregate several sessions on the same transport will 5559 have to ensure that the requests sent towards a particular server 5560 have a joint sequence number space, i.e., they will regularly need to 5561 renumber the CSeq header field in requests (from proxy to server) and 5562 responses (from server to proxy) to fulfill the rules for the header. 5563 The proxy MUST increase the CSeq by one for each request it 5564 transmits, without regard of different sessions. 5566 Example: 5567 CSeq: 239 5569 16.20. Date 5571 The Date header field represents the date and time at which the 5572 message was originated. The inclusion of the Date header in RTSP 5573 message follows these rules: 5575 o An RTSP message, sent either by the client or the server, 5576 containing a body MUST include a Date header, if the sending host 5577 has a clock; 5579 o Clients and servers are RECOMMENDED to include a Date header in 5580 all other RTSP messages, if the sending host has a clock; 5582 o If the server does not have a clock that can provide a reasonable 5583 approximation of the current time, its responses MUST NOT include 5584 a Date header field. In this case, this rule MUST be followed: 5585 Some origin server implementations might not have a clock 5586 available. An origin server without a clock MUST NOT assign 5587 Expires or Last- Modified values to a response, unless these 5588 values were associated with the resource by a system or user with 5589 a reliable clock. It MAY assign an Expires value that is known, 5590 at or before server configuration time, to be in the past (this 5591 allows "pre-expiration" of responses without storing separate 5592 Expires values for each resource). 5594 A received message that does not have a Date header field MUST be 5595 assigned one by the recipient if the message will be cached by that 5596 recipient . An RTSP implementation without a clock MUST NOT cache 5597 responses without revalidating them on every use. An RTSP cache, 5598 especially a shared cache, SHOULD use a mechanism, such as NTP, to 5599 synchronize its clock with a reliable external standard. 5601 The RTSP-date sent in a Date header SHOULD NOT represent a date and 5602 time subsequent to the generation of the message. It SHOULD 5603 represent the best available approximation of the date and time of 5604 message generation, unless the implementation has no means of 5605 generating a reasonably accurate date and time. In theory, the date 5606 ought to represent the moment just before the message body is 5607 generated. In practice, the date can be generated at any time during 5608 the message origination without affecting its semantic value. 5610 16.21. Expires 5612 The Expires message-header field gives a date and time after which 5613 the description or media-stream should be considered stale. The 5614 interpretation depends on the method: 5616 DESCRIBE response: The Expires header indicates a date and time 5617 after which the presentation description (body) SHOULD be 5618 considered stale. 5620 SETUP response: The Expires header indicate a date and time after 5621 which the media stream SHOULD be considered stale. 5623 A stale cache entry may not normally be returned by a cache (either a 5624 proxy cache or an user agent cache) unless it is first validated with 5625 the origin server (or with an intermediate cache that has a fresh 5626 copy of the message body). See Section 18 for further discussion of 5627 the expiration model. 5629 The presence of an Expires field does not imply that the original 5630 resource will change or cease to exist at, before, or after that 5631 time. 5633 The format is an absolute date and time as defined by RTSP-date. An 5634 example of its use is 5635 Expires: Thu, 01 Dec 1994 16:00:00 GMT 5637 RTSP/2.0 clients and caches MUST treat other invalid date formats, 5638 especially including the value "0", as having occurred in the past 5639 (i.e., already expired). 5641 To mark a response as "already expired," an origin server should use 5642 an Expires date that is equal to the Date header value. To mark a 5643 response as "never expires," an origin server SHOULD use an Expires 5644 date approximately one year from the time the response is sent. 5645 RTSP/2.0 servers SHOULD NOT send Expires dates more than one year in 5646 the future. 5648 16.22. From 5650 The From request-header field, if given, SHOULD contain an Internet 5651 e-mail address for the human user who controls the requesting user 5652 agent. The address SHOULD be machine-usable, as defined by "mailbox" 5653 in [RFC1123]. 5655 This header field MAY be used for logging purposes and as a means for 5656 identifying the source of invalid or unwanted requests. It SHOULD 5657 NOT be used as an insecure form of access protection. The 5658 interpretation of this field is that the request is being performed 5659 on behalf of the person given, who accepts responsibility for the 5660 method performed. In particular, robot agents SHOULD include this 5661 header so that the person responsible for running the robot can be 5662 contacted if problems occur on the receiving end. 5664 The Internet e-mail address in this field MAY be separate from the 5665 Internet host which issued the request. For example, when a request 5666 is passed through a proxy the original issuer's address SHOULD be 5667 used. 5669 The client SHOULD NOT send the From header field without the user's 5670 approval, as it might conflict with the user's privacy interests or 5671 their site's security policy. It is strongly recommended that the 5672 user be able to disable, enable, and modify the value of this field 5673 at any time prior to a request. 5675 16.23. If-Match 5677 The If-Match request-header field is especially useful for ensuring 5678 the integrity of the presentation description, in both the case where 5679 it is fetched via means external to RTSP (such as HTTP), or in the 5680 case where the server implementation is guaranteeing the integrity of 5681 the description between the time of the DESCRIBE message and the 5682 SETUP message. By including the MTag given in or with the session 5683 description in a in a If-Match header part of the SETUP request, the 5684 client ensures that resources set up are matching the description. A 5685 SETUP request with the If-Match header for which the MTag validation 5686 check fails, MUST response using 412 (Precondition Failed). 5688 This validation check is also very useful if a session has been 5689 redirected from one server to another. 5691 16.24. If-Modified-Since 5693 The If-Modified-Since request-header field is used with the DESCRIBE 5694 and SETUP methods to make them conditional. If the requested variant 5695 has not been modified since the time specified in this field, a 5696 description will not be returned from the server (DESCRIBE) or a 5697 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 5698 response MUST be returned without any message-body. 5700 An example of the field is: 5701 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 5703 16.25. If-None-Match 5705 This request header can be used with one or several message body tags 5706 to make DESCRIBE requests conditional. A client that has one or more 5707 message bodies previously obtained from the resource, can verify that 5708 none of those entities is current by including a list of their 5709 associated message body tags in the If-None-Match header field. The 5710 purpose of this feature is to allow efficient updates of cached 5711 information with a minimum amount of transaction overhead. As a 5712 special case, the value "*" matches any current entity of the 5713 resource. 5715 if any of the message body tags match the message body tag of the 5716 message body that would have been returned in the response to a 5717 similar DESCRIBE request (without the If-None-Match header) on that 5718 resource, or if "*" is given and any current entity exists for that 5719 resource, then the server MUST NOT perform the requested method, 5720 unless required to do so because the resource's modification date 5721 fails to match that supplied in an If-Modified-Since header field in 5722 the request. Instead, if the request method was DESCRIBE, the server 5723 SHOULD respond with a 304 (Not Modified) response, including the 5724 cache-related header fields (particularly MTag) of one of the message 5725 bodies that matched. For all other request methods, the server MUST 5726 respond with a status of 412 (Precondition Failed). 5728 See Section 18.1.3 for rules on how to determine if two message body 5729 tags match. 5731 If none of the message body tags match, then the server MAY perform 5732 the requested method as if the If-None-Match header field did not 5733 exist, but MUST also ignore any If-Modified-Since header field(s) in 5734 the request. That is, if no message body tags match, then the server 5735 MUST NOT return a 304 (Not Modified) response. 5737 If the request would, without the If-None-Match header field, result 5738 in anything other than a 2xx or 304 status, then the If-None-Match 5739 header MUST be ignored. (See Section 18.1.4 for a discussion of 5740 server behavior when both If-Modified-Since and If-None-Match appear 5741 in the same request.) 5743 The result of a request having both an If-None-Match header field and 5744 an If-Match header field is unspecified and MUST be considered an 5745 illegal request. 5747 16.26. Last-Modified 5749 The Last-Modified message-header field indicates the date and time at 5750 which the origin server believes the presentation description or 5751 media stream was last modified. For the method DESCRIBE, the header 5752 field indicates the last modification date and time of the 5753 description, for SETUP that of the media stream. 5755 An origin server MUST NOT send a Last-Modified date which is later 5756 than the server's time of message origination. In such cases, where 5757 the resource's last modification would indicate some time in the 5758 future, the server MUST replace that date with the message 5759 origination date. 5761 An origin server SHOULD obtain the Last-Modified value of the message 5762 body as close as possible to the time that it generates the Date 5763 value of its response. This allows a recipient to make an accurate 5764 assessment of the message body's modification time, especially if the 5765 message body changes near the time that the response is generated. 5767 RTSP servers SHOULD send Last-Modified whenever feasible. 5769 16.27. Location 5771 The Location response-header field is used to redirect the recipient 5772 to a location other than the Request-URI for completion of the 5773 request or identification of a new resource. For 3xx responses, the 5774 location SHOULD indicate the server's preferred URI for automatic 5775 redirection to the resource. The field value consists of a single 5776 absolute URI. 5778 Note: The Content-Location header field (Section 16.17) differs from 5779 Location in that the Content-Location identifies the original 5780 location of the message body enclosed in the request. It is 5781 therefore possible for a response to contain header fields for both 5782 Location and Content-Location. Also, see Section 18.2 for cache 5783 requirements of some methods. 5785 16.28. Media-Properties 5787 This general header is used in SETUP response or PLAY_NOTIFY requests 5788 to indicate the media's properties that currently are applicable to 5789 the RTSP session. PLAY_NOTIFY MAY be used to modify these properties 5790 at any point. However, the client SHOULD have received the update 5791 prior to that any action related to the new media properties take 5792 effect. For aggregated sessions, the Media-Properties header will be 5793 returned in each SETUP response. The header received in the latest 5794 response is the one that applies on the whole session from this point 5795 until any future update. The header MAY be included without value in 5796 GET_PARAMETER requests to the server with a Session header included 5797 to query the current Media-Properties for the session. The responder 5798 MUST include the current session's media properties. 5800 The media properties expressed by this header is the one applicable 5801 to all media in the RTSP session. For aggregated sessions, the 5802 header expressed the combined media-properties. As a result 5803 aggregation of media MAY result in a change of the media properties, 5804 and thus the content of the Media-Properties header contained in 5805 subsequent SETUP responses. 5807 The header contains a list of property values that are applicable to 5808 the currently setup media or aggregate of media as indicated by the 5809 RTSP URI in the request. No ordering are enforced within the header. 5810 Property values should be grouped into a single group that handles a 5811 particular orthogonal property. Values or groups that express 5812 multiple properties SHOULD NOT be used. The list of properties that 5813 can be expressed MAY be extended at any time. Unknown property 5814 values MUST be ignored. 5816 This specification defines the following 4 groups and their property 5817 values: 5819 Random Access: 5821 Random-Access: Indicates that random access is possible. May 5822 optionally include a floating point value in seconds indicating 5823 the longest duration between any two random access points in 5824 the media. 5826 Begining-Only: Seeking is limited to the beginning only. 5828 No-Seeking: No seeking is possible. 5830 Content Modifications: 5832 Immutable: The content will not be changed during the life-time 5833 of the RTSP session. 5835 Dynamic: The content may be changed based on external methods or 5836 triggers 5838 Time-Progressing The media accessible progress as wallclock time 5839 progresses. 5841 Retention: 5843 Unlimited: Content will be retained for the duration of the life- 5844 time of the RTSP session. 5846 Time-Limited: Content will be retained at least until the 5847 specified wallclock time. The time must be provided in the 5848 absolute time format specified in Section 4.6. 5850 Time-Duration Each individual media unit is retained for at least 5851 the specified time duration. This definition allows for 5852 retaining data with a time based sliding window. The time 5853 duration is expressed as floating point number in seconds. 0.0 5854 is a valid value as this indicates that no data is retained in 5855 a time-progressing session. 5857 Supported Scale: 5859 Scales: A quoted comma separated list of one or more decimal 5860 values or ranges of scale values supported by the content in 5861 arbitrary order. A range has a start and stop value separated 5862 by a colon. A range indicates that the content supports fine 5863 grained selection of scale values. Fine grained allows for 5864 steps at least as small as one tenth of a scale value. 5865 Negative values are supported. The value 0 have no meaning and 5866 must not be used. 5868 Examples of this header for on-demand content and a live stream 5869 without recording are: 5871 On-demand: 5872 Media-Properties: Random-Access=2.5s, Unlimited, Immutable, 5873 Scales="-20, -10, -4, 0.5:1.5, 4, 8, 10, 15, 20" 5875 Live stream without recording/timeshifting: 5876 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0.0 5878 16.29. Media-Range 5880 The Media-Range general header is used to give the range of the media 5881 at the time of sending the RTSP message. This header MUST be 5882 included in SETUP response, and PLAY and PAUSE response for media 5883 that are Time-Progressing, and PLAY and PAUSE response after any 5884 change for media that are Dynamic, and in PLAY_NOTIFY request that 5885 are sent due to Media-Property-Update. Media-Range header without 5886 any range specifications MAY be included in GET_PARAMETER requests to 5887 the server to request the current range. The server MUST in this 5888 case include the current range at the time of sending the response. 5890 The header MUST include range specifications for all time formats 5891 supported for the media, as indicated in Accept-Ranges header 5892 (Section 16.5) when setting up the media. The server MAY include 5893 more than one range specification of any given time format to 5894 indicate media that has non-continuous range. 5896 For media that has the Time-Progressing property, the Media-Range 5897 values will only be valid for the particular point in time when it 5898 was issued. As wallclock progresses so will also the media range. 5899 However, it shall be assumed that media time progress in direct 5900 relationship to wallclock time (with the exception of clock skew) so 5901 that a reasonably accurate estimation of the media range can be 5902 calculated. 5904 16.30. MTag 5906 The MTag response header MAY be included in DESCRIBE, GET_PARAMETER 5907 or SETUP responses. The message body tags (Section 4.8) returned in 5908 a DESCRIBE response, and the one in SETUP refers to the presentation, 5909 i.e. both the returned session description and the media stream. 5910 This allows for verification that one has the right session 5911 description to a media resource at the time of the SETUP request. 5912 However, it has the disadvantage that a change in any of the parts 5913 results in invalidation of all the parts. 5915 If the MTag is provided both inside the message body, e.g. within the 5916 "a=mtag" attribute in SDP, and in the response message, then both 5917 tags MUST be identical. It is RECOMMENDED that the MTag is primarily 5918 given in the RTSP response message, to ensure that caches can use the 5919 MTag without requiring content inspection. However, for session 5920 descriptions that are distributed outside of RTSP, for example using 5921 HTTP, etc. it will be necessary to include the message body tag in 5922 the session description as specified in Appendix D.1.9. 5924 SETUP and DESCRIBE requests can be made conditional upon the MTag 5925 using the headers If-Match (Section 16.23) and If-None-Match ( 5926 Section 16.25). 5928 16.31. Notify-Reason 5930 The Notify Reason header is solely used in the PLAY_NOTIFY method. 5931 It indicates the reason why the server has sent the asynchronous 5932 PLAY_NOTIFY request (see Section 13.5). 5934 16.32. Pipelined-Requests 5936 The Pipelined-Requests general header is used to indicate that a 5937 request is to be executed in the context created by a previous 5938 request(s). The primary usage of this header is to allow pipelining 5939 of SETUP requests so that any additional SETUP request after the 5940 first one does not need to wait for the session ID to be sent back to 5941 the requesting agent. The header contains a unique identifier that 5942 is scoped by the persistent connection used to send the requests. 5944 Upon receiving a request with the Pipelined-Requests the responding 5945 agent MUST look up if there exist a binding between this Pipelined- 5946 Requests identifier for the current persistent connection and an RTSP 5947 session ID. If that exists then the received request is processed 5948 the same way as if it did contain the Session header with the looked 5949 up session ID. If there doesn't exist a mapping and no Session 5950 header is included in the request, the responding agent MUST create a 5951 binding upon the successful completion of a session creating request, 5952 i.e. SETUP. If the request failed to create an RTSP session no 5953 binding MUST be created. In case the request contains both a Session 5954 header and the Pipelined-Requests header the Pipelined-Requests MUST 5955 be ignored. 5957 Note: Based on the above definition at least the first request 5958 containing a new unique Pipelined-Requests will be required to be a 5959 SETUP request (unless the protocol is extended with new methods of 5960 creating a session). After that first one, additional SETUP requests 5961 or request of any type using the RTSP session context may include the 5962 Pipelined-Requests header. 5964 When responding to any request that contained the Pipelined-Requests 5965 header the server MUST include also the Session header when a binding 5966 to a session context exist. A RTSP agent that knows the session ID 5967 SHOULD NOT use the Pipelined-Requests header in any request and only 5968 use the Session header. This as the Session identifier is persistent 5969 across transport contexts, like TCP connections, which the Pipelined- 5970 Requests identifier is not. 5972 It is the RTSP agent sending the request with a Pipelined-Requests 5973 header that has the responsibility for using a unique and previously 5974 unused identifier within the transport context. Currently only TCP 5975 connection is defined as such transport context. A server MUST 5976 delete the Pipelined-Requests identifier and its binding to a session 5977 upon the termination of that session. RTSP agents are RECOMMENDED to 5978 despite the previous mandate to not reuse identifiers to allow for 5979 better error handling and logging. 5981 RTSP Proxies may need to translate Pipelined-Requests identifier 5982 values from incoming request to outgoing to allow for aggregation of 5983 requests onto a persistent connection. 5985 16.33. Proxy-Authenticate 5987 The Proxy-Authenticate response-header field MUST be included as part 5988 of a 407 (Proxy Authentication Required) response. The field value 5989 consists of a challenge that indicates the authentication scheme and 5990 parameters applicable to the proxy for this Request-URI. 5992 The HTTP access authentication process is described in [RFC2617]. 5993 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 5994 only to the current connection and SHOULD NOT be passed on to 5995 downstream agents. However, an intermediate proxy might need to 5996 obtain its own credentials by requesting them from the downstream 5997 agent, which in some circumstances will appear as if the proxy is 5998 forwarding the Proxy-Authenticate header field. 6000 16.34. Proxy-Authorization 6002 The Proxy-Authorization request-header field allows the client to 6003 identify itself (or its user) to a proxy which requires 6004 authentication. The Proxy-Authorization field value consists of 6005 credentials containing the authentication information of the user 6006 agent for the proxy and/or realm of the resource being requested. 6008 The HTTP access authentication process is described in [RFC2617]. 6009 Unlike Authorization, the Proxy-Authorization header field applies 6010 only to the next outbound proxy that demanded authentication using 6011 the Proxy- Authenticate field. When multiple proxies are used in a 6012 chain, the Proxy-Authorization header field is consumed by the first 6013 outbound proxy that was expecting to receive credentials. A proxy 6014 MAY relay the credentials from the client request to the next proxy 6015 if that is the mechanism by which the proxies cooperatively 6016 authenticate a given request. 6018 16.35. Proxy-Require 6020 The Proxy-Require request-header field is used to indicate proxy- 6021 sensitive features that MUST be supported by the proxy. Any Proxy- 6022 Require header features that are not supported by the proxy MUST be 6023 negatively acknowledged by the proxy to the client using the 6024 Unsupported header. The proxy MUST use the 551 (Option Not 6025 Supported) status code in the response. Any feature-tag included in 6026 the Proxy-Require does not apply to the end-point (server or client). 6027 To ensure that a feature is supported by both proxies and servers the 6028 tag needs to be included in also a Require header. 6030 See Section 16.41 for more details on the mechanics of this message 6031 and a usage example. See discussion in the proxies section 6032 (Section 17.1) about when to consider that a feature requires proxy 6033 support. 6035 Example of use: 6036 Proxy-Require: play.basic 6038 16.36. Proxy-Supported 6040 The Proxy-Supported header field enumerates all the extensions 6041 supported by the proxy using feature-tags. The header carries the 6042 intersection of extensions supported by the forwarding proxies. The 6043 Proxy-Supported header MAY be included in any request by a proxy. It 6044 MUST be added by any proxy if the Supported header is present in a 6045 request. When present in a request, the receiver MUST in the 6046 response copy the received Proxy-Supported header. 6048 The Proxy-Supported header field contains a list of feature-tags 6049 applicable to proxies, as described in Section 4.7. The list are the 6050 intersection of all feature-tags understood by the proxies. To 6051 achieve an intersection, the proxy adding the Proxy-Supported header 6052 includes all proxy feature-tags it understands. Any proxy receiving 6053 a request with the header, checks the list and removes any feature- 6054 tag it do not support. A Proxy-Supported header present in the 6055 response MUST NOT be touched by the proxies. 6057 Example: 6058 C->P1: OPTIONS rtsp://example.com/ RTSP/2.0 6059 Supported: foo, bar, blech 6060 User-Agent: PhonyClient/1.2 6062 P1->P2: OPTIONS rtsp://example.com/ RTSP/2.0 6063 Supported: foo, bar, blech 6064 Proxy-Supported: proxy-foo, proxy-bar, proxy-blech 6065 Via: 2.0 pro.example.com 6067 P2->S: OPTIONS rtsp://example.com/ RTSP/2.0 6068 Supported: foo, bar, blech 6069 Proxy-Supported: proxy-foo, proxy-blech 6070 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6072 S->C: RTSP/2.0 200 OK 6073 Supported: foo, bar, baz 6074 Proxy-Supported: proxy-foo, proxy-blech 6075 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6076 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6078 16.37. Public 6080 The Public response header field lists the set of methods supported 6081 by the response sender. This header applies to the general 6082 capabilities of the sender and its only purpose is to indicate the 6083 sender's capabilities to the recipient. The methods listed may or 6084 may not be applicable to the Request-URI; the Allow header field 6085 (Section 16.6) MAY be used to indicate methods allowed for a 6086 particular URI. 6088 Example of use: 6089 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6091 In the event that there are proxies between the sender and the 6092 recipient of a response, each intervening proxy MUST modify the 6093 Public header field to remove any methods that are not supported via 6094 that proxy. The resulting Public header field will contain an 6095 intersection of the sender's methods and the methods allowed through 6096 by the intervening proxies. 6098 In general, proxies should allow all methods to transparently pass 6099 through from the sending RTSP agent to the receiving RTSP agent, 6100 but there may be cases where this is not desirable for a given 6101 proxy. Modification of the Public response header field by the 6102 intervening proxies ensures that the request sender gets an 6103 accurate response indicating the methods that can be used on the 6104 target agent via the proxy chain. 6106 16.38. Range 6108 The Range header specifies a time range in PLAY (Section 13.4), PAUSE 6109 (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and 6110 PLAY_NOTIFY (Section 13.5) requests and responses. It MAY be 6111 included in GET_PARAMETER requests from the client to the server with 6112 only a Range format and no value to request the current media 6113 position, whether the session is in playing or ready state in the 6114 included format. The server SHALL, if supporting the range format, 6115 respond with the current playing point or pause point as the start of 6116 the range. If an explicit stop point was used in the previous PLAY 6117 request, then that value shall be included as stop point. Note that 6118 if the server is currently under any type of media playback 6119 manipulation affecting the interpretation of Range, like Scale, that 6120 is also required to be included in any GET_PARAMETER response to 6121 provide complete information. 6123 The range can be specified in a number of units. This specification 6124 defines smpte (Section 4.4), npt (Section 4.5), and clock 6125 (Section 4.6) range units. While byte ranges [H14.35.1] and other 6126 extended units MAY be used, their behavior is unspecified since they 6127 are not normally meaningful in RTSP. Servers supporting the Range 6128 header MUST understand the NPT range format and SHOULD understand the 6129 SMPTE range format. If the Range header is sent in a time format 6130 that is not understood, the recipient SHOULD return 456 (Header Field 6131 Not Valid for Resource) and include an Accept-Ranges header 6132 indicating the supported time formats for the given resource. 6134 Example: 6135 Range: clock=19960213T143205Z- 6137 The Range header contains a range of one single range format. A 6138 range is a half-open interval with a start and an end point, 6139 including the start point, but excluding the end point. A range may 6140 either be fully specified with explicit values for start point and 6141 end point, or have either start or end point be implicit. An 6142 implicit start point indicates the session's pause point, and if no 6143 pause point is set the start of the content. An implicit end point 6144 indicates the end of the content. The usage of both implicit start 6145 and end point is not allowed in the same range header, however, the 6146 exclusion of the range header has that meaning, i.e. from pause point 6147 (or start) until end of content. 6149 Regarding the half-open intervals; a range of A-B starts exactly 6150 at time A, but ends just before B. Only the start time of a media 6151 unit such as a video or audio frame is relevant. For example, 6152 assume that video frames are generated every 40 ms. A range of 6153 10.0-10.1 would include a video frame starting at 10.0 or later 6154 time and would include a video frame starting at 10.08, even 6155 though it lasted beyond the interval. A range of 10.0-10.08, on 6156 the other hand, would exclude the frame at 10.08. 6158 Please note the difference between NPT time scales' "now" and an 6159 implicit start value. Implicit value reference the current pause- 6160 point. While "now" is the currently ongoing time. In a time- 6161 progressing session with recording (retention for some or full 6162 time) the pause point may be 2 min into the session while now 6163 could be 1 hour into the session. 6165 By default, range intervals increase, where the second point is 6166 larger than the first point. 6168 Example: 6169 Range: npt=10-15 6171 However, range intervals can also decrease if the Scale header (see 6172 Section 16.44) indicates a negative scale value. For example, this 6173 would be the case when a playback in reverse is desired. 6175 Example: 6176 Scale: -1 6177 Range: npt=15-10 6179 Decreasing ranges are still half open intervals as described above. 6180 Thus, for range A-B, A is closed and B is open. In the above 6181 example, 15 is closed and 10 is open. An exception to this rule is 6182 the case when B=0 in a decreasing range. In this case, the range is 6183 closed on both ends, as otherwise there would be no way to reach 0 on 6184 a reverse playback for formats that have such a notion, like NPT and 6185 SMPTE. 6187 Example: 6188 Scale: -1 6189 Range: npt=15-0 6191 In this range both 15 and 0 are closed. 6193 A decreasing range interval without a corresponding negative Scale 6194 header is not valid. 6196 16.39. Referrer 6198 The Referrer request-header field allows the client to specify, for 6199 the server's benefit, the address (URI) of the resource from which 6200 the Request-URI was obtained. The URI refers to that of the 6201 presentation description, typically retrieved via HTTP. The Referrer 6202 request-header allows a server to generate lists of back-links to 6203 resources for interest, logging, optimized caching, etc. It also 6204 allows obsolete or mistyped links to be traced for maintenance. The 6205 Referrer field MUST NOT be sent if the Request-URI was obtained from 6206 a source that does not have its own URI, such as input from the user 6207 keyboard. 6209 If the field value is a relative URI, it SHOULD be interpreted 6210 relative to the Request-URI. The URI MUST NOT include a fragment. 6212 Because the source of a link might be private information or might 6213 reveal an otherwise private information source, it is strongly 6214 recommended that the user be able to select whether or not the 6215 Referrer field is sent. For example, a streaming client could have a 6216 toggle switch for openly/anonymously, which would respectively 6217 enable/disable the sending of Referee and From information. 6219 Clients SHOULD NOT include a Referee header field in a (non-secure) 6220 RTSP request if the referring page was transferred with a secure 6221 protocol. 6223 16.40. Request-Status 6225 This request header is used to indicate the end result for requests 6226 that takes time to complete, such a PLAY (Section 13.4). It is sent 6227 in PLAY_NOTIFY (Section 13.5) with the end-of-stream reason to report 6228 how the PLAY request concluded, either in success or in failure. The 6229 header carries a reference to the request it reports on using the 6230 CSeq number for the session indicated by the Session header in the 6231 request. It provides both a numerical status code (according to 6232 Section 8.1.1) and a human readable reason phrase. 6234 Example: 6235 Request-Status: cseq=63 status=500 reason="Media data unavailable" 6237 16.41. Require 6239 The Require request-header field is used by clients or servers to 6240 ensure that the other end-point supports features that are required 6241 in respect to this request. It can also be used to query if the 6242 other end-point supports certain features, however, the use of the 6243 Supported (Section 16.49) is much more effective in this purpose. 6244 The server MUST respond to this header by using the Unsupported 6245 header to negatively acknowledge those feature-tags which are NOT 6246 supported. The response MUST use the error code 551 (Option Not 6247 Supported). This header does not apply to proxies, for the same 6248 functionality in respect to proxies see Proxy-Require header 6249 (Section 16.35) with the exception of media modifying proxies. Media 6250 modifying proxies due to their nature of handling media in a way that 6251 is very similar to what a server, do need to understand also the 6252 server features to correctly serve the client. 6254 This is to make sure that the client-server interaction will 6255 proceed without delay when all features are understood by both 6256 sides, and only slow down if features are not understood (as in 6257 the example below). For a well-matched client-server pair, the 6258 interaction proceeds quickly, saving a round-trip often required 6259 by negotiation mechanisms. In addition, it also removes state 6260 ambiguity when the client requires features that the server does 6261 not understand. 6263 Example (Not complete): 6265 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/2.0 6266 CSeq: 302 6267 Require: funky-feature 6268 Funky-Parameter: funkystuff 6270 S->C: RTSP/2.0 551 Option not supported 6271 CSeq: 302 6272 Unsupported: funky-feature 6274 In this example, "funky-feature" is the feature-tag which indicates 6275 to the client that the fictional Funky-Parameter field is required. 6276 The relationship between "funky-feature" and Funky-Parameter is not 6277 communicated via the RTSP exchange, since that relationship is an 6278 immutable property of "funky-feature" and thus should not be 6279 transmitted with every exchange. 6281 Proxies and other intermediary devices MUST ignore this header. If a 6282 particular extension requires that intermediate devices support it, 6283 the extension should be tagged in the Proxy-Require field instead 6284 (see Section 16.35). See discussion in the proxies section 6285 (Section 17.1) about when to consider that a feature requires proxy 6286 support. 6288 16.42. Retry-After 6290 The Retry-After response-header field can be used with a 503 (Service 6291 Unavailable) response to indicate how long the service is expected to 6292 be unavailable to the requesting client. This field MAY also be used 6293 with any 3xx (Redirection) response to indicate the minimum time the 6294 user-agent is asked wait before issuing the redirected request. The 6295 value of this field can be either an RTSP-date or an integer number 6296 of seconds (in decimal) after the time of the response. 6298 Example: 6299 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT 6300 Retry-After: 120 6302 In the latter example, the delay is 2 minutes. 6304 16.43. RTP-Info 6306 The RTP-Info general field is used to set RTP-specific parameters in 6307 the PLAY and GET_PARAMETER responses or a PLAY_NOTIFY and 6308 GET_PARAMETER requests. For streams using RTP as transport protocol 6309 the RTP-Info header SHOULD be part of a 200 response to PLAY. 6311 The exclusion of the RTP-Info in a PLAY response for RTP 6312 transported media will result in that a client needs to 6313 synchronize the media streams using RTCP. This may have negative 6314 impact as the RTCP can be lost, and does not need to be 6315 particularly timely in their arrival. Also functionality as 6316 informing the client from which packet a seek has occurred is 6317 affected. 6319 The RTP-Info MAY be included in SETUP responses to provide 6320 synchronization information when changing transport parameters, see 6321 Section 13.3. The RTP-Info header and the Range header MAY be 6322 included in a GET_PARAMETER request from client to server without any 6323 values to request the current playback point and corresponding. RTP 6324 synchronization information. When the RTP-Info header is included in 6325 a Request also the Range header MUST be included (Note, Range header 6326 only MAY be used). The server response SHALL include both the Range 6327 header and the RTP-Info header. If the session is in playing state, 6328 then the value of the Range header SHALL be filled in with the 6329 current playback point and with the corresponding RTP-Info values. 6330 If the server is another state, no values are included in the RTP- 6331 Info header. The header is included in PLAY_NOTIFY requests with the 6332 Notify-Reason of end-of-stream to provide RTP information about the 6333 end of the stream. 6335 The header can carry the following parameters: 6337 url: Indicates the stream URI which for which the following RTP 6338 parameters correspond, this URI MUST be the same used in the 6339 SETUP request for this media stream. Any relative URI MUST use 6340 the Request-URI as base URI. This parameter MUST be present. 6342 ssrc: The Synchronization source (SSRC) that the RTP timestamp and 6343 sequence number provide applies to. This parameter MUST be 6344 present. 6346 seq: Indicates the sequence number of the first packet of the stream 6347 that is direct result of the request. This allows clients to 6348 gracefully deal with packets when seeking. The client uses 6349 this value to differentiate packets that originated before the 6350 seek from packets that originated after the seek. Note that a 6351 client may not receive the packet with the expressed sequence 6352 number, and instead packets with a higher sequence number, due 6353 to packet loss or reordering. This parameter is RECOMMENDED to 6354 be present. 6356 rtptime: MUST indicate the RTP timestamp value corresponding to the 6357 start time value in the Range response header, or if not 6358 explicitly given the implied start point. The client uses this 6359 value to calculate the mapping of RTP time to NPT or other 6360 media timescale. This parameter SHOULD be present to ensure 6361 inter-media synchronization is achieved. There exist no 6362 requirement that any received RTP packet will have the same RTP 6363 timestamp value as the one in the parameter used to establish 6364 synchronization. 6366 A mapping from RTP timestamps to NTP timestamps (wallclock) is 6367 available via RTCP. However, this information is not sufficient 6368 to generate a mapping from RTP timestamps to media clock time 6369 (NPT, etc.). Furthermore, in order to ensure that this 6370 information is available at the necessary time (immediately at 6371 startup or after a seek), and that it is delivered reliably, this 6372 mapping is placed in the RTSP control channel. 6374 In order to compensate for drift for long, uninterrupted 6375 presentations, RTSP clients should additionally map NPT to NTP, 6376 using initial RTCP sender reports to do the mapping, and later 6377 reports to check drift against the mapping. 6379 Example: 6380 Range:npt=3.25-15 6381 RTP-Info:url="rtsp://example.com/foo/audio" ssrc=0A13C760:seq=45102; 6382 rtptime=12345678,url="rtsp://example.com/foo/video" 6383 ssrc=9A9DE123:seq=30211;rtptime=29567112 6385 Lets assume that Audio uses a 16kHz RTP timestamp clock and Video 6386 a 90kHz RTP timestamp clock. Then the media synchronization is 6387 depicted in the following way. 6389 NPT 3.0---3.1---3.2-X-3.3---3.4---3.5---3.6 6390 Audio PA A 6391 Video V PV 6393 X: NPT time value = 3.25, from Range header. 6394 A: RTP timestamp value for Audio from RTP-Info header (12345678). 6395 V: RTP timestamp value for Video from RTP-Info header (29567112). 6396 PA: RTP audio packet carrying an RTP timestamp of 12344878. Which 6397 corresponds to NPT = (12344878 - A) / 16000 + 3.25 = 3.2 6398 PV: RTP video packet carrying an RTP timestamp of 29573412. Which 6399 corresponds to NPT = (29573412 - V) / 90000 + 3.25 = 3.32 6401 16.44. Scale 6403 A scale value of 1 indicates normal play at the normal forward 6404 viewing rate. If not 1, the value corresponds to the rate with 6405 respect to normal viewing rate. For example, a ratio of 2 indicates 6406 twice the normal viewing rate ("fast forward") and a ratio of 0.5 6407 indicates half the normal viewing rate. In other words, a ratio of 2 6408 has content time increase at twice the playback time. For every 6409 second of elapsed (wallclock) time, 2 seconds of content time will be 6410 delivered. A negative value indicates reverse direction. For 6411 certain media transports this may require certain considerations to 6412 work consistent, see Appendix C.1 for description on how RTP handles 6413 this. 6415 The transmitted data rate SHOULD NOT be changed by selection of a 6416 different scale value. The resulting bit-rate should be reasonably 6417 close to the nominal bit-rate of the content for Scale = 1. The 6418 server has to actively manipulate the data when needed to meet the 6419 bitrate constraints. Implementation of scale changes depends on the 6420 server and media type. For video, a server may, for example, deliver 6421 only key frames or selected frames. For audio, it may time-scale the 6422 audio while preserving pitch or, less desirably, deliver fragments of 6423 audio, or completely mute the audio. 6425 The server and content may restrict the range of scale values that it 6426 supports. The supported values are indicated by the Media-Properties 6427 header (Section 16.28). The client SHOULD only indicate values 6428 indicated to be supported. However, as the values may change as the 6429 content progresses a requested value may no longer be valid when the 6430 request arrives. Thus, a non-supported value in a request does not 6431 generate an error, only forces the server to choose the closest 6432 value. The response MUST always contain the actual scale value 6433 chosen by the server. 6435 If the server does not implement the possibility to scale, it will 6436 not return a Scale header. A server supporting Scale operations for 6437 PLAY MUST indicate this with the use of the "play.scale" feature-tag. 6439 When indicating a negative scale for a reverse playback, the Range 6440 header MUST indicate a decreasing range as described in 6441 Section 16.38. 6443 Example of playing in reverse at 3.5 times normal rate: 6444 Scale: -3.5 6445 Range: npt=15-10 6447 16.45. Seek-Style 6449 When a client sends a PLAY request with a Range header to perform a 6450 random access to the media, the client does not know if the server 6451 will pick the first media samples or the first random access point 6452 prior to the request range. Depending on use case, the client may 6453 have a strong preference. To express this preference and provide the 6454 client with information on how the server actually acted on that 6455 preference the Seek-Style header is defined. 6457 Seek-Style is a general header that MAY be included in any PLAY 6458 request to indicate the client's preference for any media stream that 6459 has random access properties. The server MUST always include the 6460 header in any PLAY response for media with random access properties 6461 to indicate what policy was applied. A Server that receives a 6462 unknown Seek-Style policy MUST ignore it and select the server 6463 default policy. A Client receiving an unknown policy MUST ignore it 6464 and use the Range header and any media synchronization information as 6465 basis to figure out what the server did. 6467 This specification defines the following seek policies that may be 6468 requested: 6470 RAP: Random Access Point (RAP) is the behavior of requesting the 6471 server to locate the closest previous random access point that 6472 exist in the media aggregate and deliver from that. By requesting 6473 a RAP media quality will be the best possible as all media will be 6474 delivered from a point where full media state can be established 6475 in the media decoder. 6477 CoRAP: Conditional Random Access Point (CoRAP) is a variant of the 6478 above RAP behavior. It is conditioned on that there exist a 6479 Random Access Point closer to the requested start point than the 6480 current pause point. This policy assumes that the media state 6481 existing prior to the pause is usable if delivery is continued. 6482 If the client or server knows that this is not the fact the RAP 6483 policy should be used. In other words in most cases when the 6484 client requests a start point prior to the current pause point a 6485 valid decoding dependency chain from the media delivered prior to 6486 the pause and to the requested media unit will not exist. This 6487 policy is primarily intended for cases where there are larger 6488 distance between the random access points in the media. If the 6489 server searched to a random access point the server MUST return 6490 the CoRAP policy in the Seek-Style header and adjust the Range 6491 header to reflect the position of the picked RAP. In case the 6492 random access point is further away and the server selects to 6493 continue from the current pause point it MUST include the "Next" 6494 policy in the Seek-Style header and adjust the Range header start 6495 point to the current pause point. 6497 First-Prior: The first-prior policy will start delivery with the 6498 media unit that has a playout time first prior to the requested 6499 time. For discrete media that would only include media units that 6500 would still be rendered at the request time. For continuous media 6501 that is media that will be render during the requested start time 6502 of the range. 6504 Next: The next media units after the provided start time of the 6505 range. For continuous framed media that would mean the first next 6506 frame after the provided time. For discrete media the first unit 6507 that is to be rendered after the provided time. The main usage is 6508 for this case is when the client knows it has all media up to a 6509 certain point and would like to continue delivery so that a 6510 complete non-interrupted media playback can be achieved. Example 6511 of such scenarios include switching from a broadcast/multicast 6512 delivery to a unicast based delivery. This policy MUST only be 6513 used on the client's explicit request. 6515 Please note that these expressed preferences exist for optimizing the 6516 startup time or the media quality. The "Next" policy breaks the 6517 normal definition of the Range header to enable a client to request 6518 media with minimal overlap, although some may still occur for 6519 aggregated sessions. RAP and First-Prior both fulfill the 6520 requirement of providing media from the requested range and forward. 6521 However, unless RAP is used, the media quality for many media codecs 6522 using predictive methods can be severely degraded unless additional 6523 data is available as, for example, already buffered, or through other 6524 side channels. 6526 16.46. Server 6528 The Server response-header field contains information about the 6529 software used by the origin server to handle the request. The field 6530 can contain multiple product tokens and comments identifying the 6531 server and any significant subproducts. The product tokens are 6532 listed in order of their significance for identifying the 6533 application. 6535 Example: 6536 Server: PhonyServer/1.0 6538 If the response is being forwarded through a proxy, the proxy 6539 application MUST NOT modify the Server response-header. Instead, it 6540 SHOULD include a Via field (Section 16.56). 6542 16.47. Session 6544 The Session request-header and response-header field identifies an 6545 RTSP session. An RTSP session is created by the server as a result 6546 of a successful SETUP request and in the response the session 6547 identifier is given to the client. The RTSP session exist until 6548 destroyed by a TEARDOWN, REDIRECT or timed out by the server. 6550 The session identifier is chosen by the server (see Section 4.3) and 6551 MUST be returned in the SETUP response. Once a client receives a 6552 session identifier, it MUST be included in any request related to 6553 that session. This means that the Session header MUST be included in 6554 a request using the following methods: PLAY, PAUSE, and TEARDOWN, and 6555 MAY be included in SETUP, OPTIONS, SET_PARAMETER, GET_PARAMETER, and 6556 REDIRECT, and MUST NOT be included in DESCRIBE. In an RTSP response 6557 the session header MUST be included in methods, SETUP, PLAY, and 6558 PAUSE, and MAY be included in methods, TEARDOWN, and REDIRECT, and if 6559 included in the request of the following methods it MUST also be 6560 included in the response, OPTIONS, GET_PARAMETER, and SET_PARAMETER, 6561 and MUST NOT be included in DESCRIBE. 6563 Note that a session identifier identifies an RTSP session across 6564 transport sessions or connections. RTSP requests for a given session 6565 can use different URIs (Presentation and media URIs). Note, that 6566 there are restrictions depending on the session which URIs that are 6567 acceptable for a given method. However, multiple "user" sessions for 6568 the same URI from the same client will require use of different 6569 session identifiers. 6571 The session identifier is needed to distinguish several delivery 6572 requests for the same URI coming from the same client. 6574 The response 454 (Session Not Found) MUST be returned if the session 6575 identifier is invalid. 6577 The header MAY include the session timeout period. If not explicitly 6578 provided this value is set to 60 seconds. As this affects how often 6579 session keep-alives are needed values smaller than 30 seconds are not 6580 recommended. However, larger than default values can be useful in 6581 applications of RTSP that have inactive but established sessions for 6582 longer time periods. 6584 60 seconds was chosen as session timeout value due to: Resulting 6585 in not to frequent keep-alive messages and having low sensitivity 6586 to variations in request response timing. If one reduces the 6587 timeout value to below 30 seconds the corresponding request 6588 response timeout becomes a significant part of the session 6589 timeout. 60 seconds also allows for reasonably rapid recovery of 6590 committed server resources in case of client failure. 6592 16.48. Speed 6594 The Speed request-header field requests the server to deliver 6595 specific amounts of nominal media time per unit of delivery time, 6596 contingent on the server's ability and desire to serve the media 6597 stream at the given speed. The client requests the delivery speed to 6598 be within a given range with an lower and upper bound. The server 6599 SHALL deliver at the highest possible speed within the range, but not 6600 faster than the upper-bound, for which the underlying network path 6601 can support the resulting transport data rates. As long as any speed 6602 value within the given range can be provided the server SHALL NOT 6603 modify the media quality. Only if the server is unable to delivery 6604 media at the speed value provided by the lower bound shall it reduce 6605 the media quality. 6607 Implementation of the Speed functionality by the server is OPTIONAL. 6608 The server can indicate its support through a feature-tag, 6609 play.speed. The lack of a Speed header in the response is an 6610 indication of lack of support of this functionality. 6612 The speed parameter values are expressed as a positive decimal value, 6613 e.g., a value of 2.0 indicates that data is to be delivered twice as 6614 fast as normal. A speed value of zero is invalid. The range is 6615 specified in the form "lower bound - upper bound". The lower bound 6616 value may be smaller or equal to the upper bound. All speeds may not 6617 be possible to support. Therefore the server MAY modify the 6618 requested values to the closest supported. The actual supported 6619 speed MUST be included in the response. Note, however, that the use 6620 cases may vary and that Speed value ranges such as 0.7 - 0.8, 6621 0.3-2.0, 1.0-2.5, 2.5-2.5 all have their usage. 6623 Example: 6625 Speed: 1.0 - 2.5 6627 Use of this header changes the bandwidth used for data delivery. It 6628 is meant for use in specific circumstances where delivery of the 6629 presentation at a higher or lower rate is desired. The main use 6630 cases are buffer operations or local scale operations. Implementors 6631 should keep in mind that bandwidth for the session may be negotiated 6632 beforehand (by means other than RTSP), and therefore re-negotiation 6633 may be necessary. To perform Speed operations the server needs to 6634 ensure that the network path can support the resulting bit-rate. 6635 Thus the media transport needs to support feedback so that the server 6636 can react and adapt to the available bitrate. 6638 16.49. Supported 6640 The Supported header enumerates all the extensions supported by the 6641 client or server using feature tags. The header carries the 6642 extensions supported by the message sending client or server. The 6643 Supported header MAY be included in any request. When present in a 6644 request, the receiver MUST respond with its corresponding Supported 6645 header. Note that the supported headers is also included in 4xx and 6646 5xx responses. 6648 The Supported header contains a list of feature-tags, described in 6649 Section 4.7, that are understood by the client or server. 6651 Example: 6653 C->S: OPTIONS rtsp://example.com/ RTSP/2.0 6654 Supported: foo, bar, blech 6655 User-Agent: PhonyClient/1.2 6657 S->C: RTSP/2.0 200 OK 6658 Supported: bar, blech, baz 6660 16.50. Terminate-Reason 6662 The Terminate-Reason request header allows the server when sending a 6663 REDIRECT or TERMINATE request to provide a reason for the session 6664 termination and any additional information. This specification 6665 identifies three reasons for Redirections and may be extended in the 6666 future: 6668 Server-Admin: The server needs to be shutdown for some 6669 administrative reason. 6671 Session-Timeout: A client's session is kept alive for extended 6672 periods of time and the server has determined that it needs to 6673 reclaim the resources associated with this session. 6675 Internal-Error An internal error that is impossible to recover from 6676 has occurred forcing the server to terminate the session. 6678 The Server may provide additional parameters containing information 6679 around the redirect. This specification defines the following ones. 6681 time: Provides a wallclock time when the server will stop provide 6682 any service. 6684 user-msg: An UTF-8 text string with a message from the server to the 6685 user. This message SHOULD be displayed to the user. 6687 16.51. Timestamp 6689 The Timestamp general-header describes when the agent sent the 6690 request. The value of the timestamp is of significance only to the 6691 agent and may use any timescale. The responding agent MUST echo the 6692 exact same value and MAY, if it has accurate information about this, 6693 add a floating point number indicating the number of seconds that has 6694 elapsed since it has received the request. The timestamp can be used 6695 by the agent to compute the round-trip time to the responding agent 6696 so that it can adjust the timeout value for retransmissions when 6697 running over a unreliable protocol. It also resolves retransmission 6698 ambiguities for unreliable transport of RTSP. 6700 16.52. Transport 6702 The Transport request and response header indicates which transport 6703 protocol is to be used and configures its parameters such as 6704 destination address, compression, multicast time-to-live and 6705 destination port for a single stream. It sets those values not 6706 already determined by a presentation description. 6708 A Transport request header MAY contain a list of transport options 6709 acceptable to the client, in the form of multiple transport 6710 specification entries. Transport specifications are comma separated, 6711 listed in decreasing order of preference. Parameters may be added to 6712 each transport specification, separated by a semicolon. The server 6713 MUST return a Transport response-header in the response to indicate 6714 the values actually chosen if any. If the transport specification is 6715 not supported, no transport header is returned and the request MUST 6716 be responded using the status code 461 (Unsupported Transport) 6717 (Section 15.4.26). In case more than one transport specification was 6718 present in the request, the server MUST return the single (transport- 6719 spec) which was actually chosen, if any. The number of transport- 6720 spec entries is expected to be limited as the client will get 6721 guidance on what configurations that are possible from the 6722 presentation description. 6724 The Transport header MAY also be used in subsequent SETUP requests to 6725 change transport parameters. A server MAY refuse to change 6726 parameters of an existing stream. 6728 A transport specification may only contain one of any given parameter 6729 within it. Parameters MAY be given in any order. Additionally, it 6730 may only contain either of the unicast or the multicast transport 6731 type parameter. All parameters need to be understood in a transport 6732 specification, if not, the transport specification MUST be ignored. 6733 RTSP proxies of any type that uses or modifies the transport 6734 specification, e.g. access proxy or security proxy, MUST remove 6735 specifications with unknown parameters before forwarding the RTSP 6736 message. If that result in no remaining transport specification the 6737 proxy shall send a 461 (Unsupported Transport) (Section 15.4.26) 6738 response without any Transport header. 6740 The Transport header is restricted to describing a single media 6741 stream. (RTSP can also control multiple streams as a single 6742 entity.) Making it part of RTSP rather than relying on a 6743 multitude of session description formats greatly simplifies 6744 designs of firewalls. 6746 The general syntax for the transport specifier is a list of slash 6747 separated tokens: 6748 Value1/Value2/Value3... 6749 Which for RTP transports take the form: 6750 RTP/profile/lower-transport. 6752 The default value for the "lower-transport" parameters is specific to 6753 the profile. For RTP/AVP, the default is UDP. 6755 There are two different methods for how to specify where the media 6756 should be delivered for unicast transport: 6758 dest_addr: The presence of this parameter and its values indicates 6759 the destination address or addresses (host address and port 6760 pairs for IP flows) necessary for the media transport. 6762 No dest_addr: The lack of the dest_addr parameter indicates that the 6763 server MUST send media to same address for which the RTSP 6764 messages originates. 6766 The choice of method for indicating where the media is to be 6767 delivered depends on the use case. In some case the only allowed 6768 method will be to use no explicit address indication and have the 6769 server deliver media to the source of the RTSP messages. 6771 For Multicast there is several methods for specifying addresses but 6772 they are different in how they work compared with unicast: 6774 dest_addr with client picked address: The address and relevant 6775 parameters like TTL (scope) for the actual multicast group to 6776 deliver the media to. There are security implications 6777 (Section 21) with this method that needs to be addressed if 6778 using this method because a RTSP server can be used as a DoS 6779 attacker on a existing multicast group. 6781 dest_addr using Session Description Information: The information 6782 included in the transport header can all be coming from the 6783 session description, e.g. the SDP c= and m= line. This 6784 mitigates some of the security issues of the previous methods 6785 as it is the session provider that picks the multicast group 6786 and scope. The client MUST include the information if it is 6787 available in the session description. 6789 No dest_addr: The behavior when no explicit multicast group is 6790 present in a request is not defined. 6792 An RTSP proxy will need to take care. If the media is not desired to 6793 be routed through the proxy, the proxy will need to introduce the 6794 destination indication. 6796 Below are the configuration parameters associated with transport: 6798 General parameters: 6800 unicast / multicast: This parameter is a mutually exclusive 6801 indication of whether unicast or multicast delivery will be 6802 attempted. One of the two values MUST be specified. Clients 6803 that are capable of handling both unicast and multicast 6804 transmission needs to indicate such capability by including two 6805 full transport-specs with separate parameters for each. 6807 layers: The number of multicast layers to be used for this media 6808 stream. The layers are sent to consecutive addresses starting 6809 at the dest_addr address. If the parameter is not included, it 6810 defaults to a single layer. 6812 dest_addr: A general destination address parameter that can contain 6813 one or more address specifications. Each combination of 6814 Protocol/Profile/Lower Transport needs to have the format and 6815 interpretation of its address specification defined. For RTP/ 6816 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 6817 containing a host address and port. Note, only a single 6818 destination parameter per transport spec is intended. The 6819 usage of multiple destination to distribute a single media to 6820 multiple entities is unspecified. 6822 The client originating the RTSP request MAY specify the 6823 destination address of the stream recipient with the host 6824 address part of the tuple. When the destination address is 6825 specified, the recipient may be a different party than the 6826 originator of the request. To avoid becoming the unwitting 6827 perpetrator of a remote-controlled denial-of-service attack, a 6828 server MUST perform security checks (see Section 21.1) and 6829 SHOULD log such attempts before allowing the client to direct a 6830 media stream to a recipient address not chosen by the server. 6831 Implementations cannot rely on TCP as reliable means of client 6832 identification. If the server does not allow the host address 6833 part of the tuple to be set, it MUST return 463 (Destination 6834 Prohibited). 6836 The host address part of the tuple MAY be empty, for example 6837 ":58044", in cases when only destination port is desired to be 6838 specified. Responses to request including the Transport header 6839 with a dest_addr parameter SHOULD include the full destination 6840 address that is actually used by the server. The server MUST 6841 NOT remove address information present already in the request 6842 when responding unless the protocol requires it. 6844 src_addr: A general source address parameter that can contain one or 6845 more address specifications. Each combination of Protocol/ 6846 Profile/Lower Transport needs to have the format and 6847 interpretation of its address specification defined. For RTP/ 6848 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 6849 containing a host address and port. 6851 This parameter MUST be specified by the server if it transmits 6852 media packets from another address than the one RTSP messages 6853 are sent to. This will allow the client to verify source 6854 address and give it a destination address for its RTCP feedback 6855 packets if RTP is used. The address or addresses indicated in 6856 the src_addr parameter SHOULD be used both for sending and 6857 receiving of the media streams data packets. The main reasons 6858 are threefold: First, indicating the port and source address(s) 6859 lets the receiver know where from the packets is expected to 6860 originate. Secondly, traversal of NATs are greatly simplified 6861 when traffic is flowing symmetrically over a NAT binding. 6862 Thirdly, certain NAT traversal mechanisms, needs to know to 6863 which address and port to send so called "binding packets" from 6864 the receiver to the sender, thus creating a address binding in 6865 the NAT that the sender to receiver packet flow can use. 6867 This information may also be available through SDP. 6868 However, since this is more a feature of transport than 6869 media initialization, the authoritative source for this 6870 information should be in the SETUP response. 6872 mode: The mode parameter indicates the methods to be supported for 6873 this session. Currently defined valid values are "PLAY". If 6874 not provided, the default is "PLAY". The "RECORD" value was 6875 defined in RFC 2326 and is in this specification unspecified 6876 but reserved. RECORD and other values may be specified in the 6877 future. 6879 interleaved: The interleaved parameter implies mixing the media 6880 stream with the control stream in whatever protocol is being 6881 used by the control stream, using the mechanism defined in 6882 Section 14. The argument provides the channel number to be 6883 used in the $ statement and MUST be present. This parameter 6884 MAY be specified as a interval, e.g., interleaved=4-5 in cases 6885 where the transport choice for the media stream requires it, 6886 e.g. for RTP with RTCP. The channel number given in the 6887 request are only a guidance from the client to the server on 6888 what channel number(s) to use. The server MAY set any valid 6889 channel number in the response. The declared channel(s) are 6890 bi-directional, so both end-parties MAY send data on the given 6891 channel. One example of such usage is the second channel used 6892 for RTCP, where both server and client sends RTCP packets on 6893 the same channel. 6895 This allows RTP/RTCP to be handled similarly to the way 6896 that it is done with UDP, i.e., one channel for RTP and 6897 the other for RTCP. 6899 Multicast-specific: 6901 ttl: multicast time-to-live for IPv4. When included in requests the 6902 value indicate the TTL value that the client request the server 6903 to use. In a response, the value actually being used by the 6904 server is returned. A server will need to consider what values 6905 that are reasonable and also the authority of the user to set 6906 this value. Corresponding functions are not needed for IPv6 as 6907 the scoping is part of the address. 6909 RTP-specific: 6911 These parameters are MAY only be used if the media transport protocol 6912 is RTP. 6914 ssrc: The ssrc parameter, if included in a SETUP response, indicates 6915 the RTP SSRC [RFC3550] value(s) that will be used by the media 6916 server for RTP packets within the stream. It is expressed as 6917 an eight digit hexadecimal value. 6919 The ssrc parameter MUST NOT be specified in requests. The 6920 functionality of specifying the ssrc parameter in a SETUP 6921 request is deprecated as it is incompatible with the 6922 specification of RTP in RFC 3550[RFC3550]. If the parameter is 6923 included in the Transport header of a SETUP request, the server 6924 MAY ignore it, and choose appropriate SSRCs for the stream. 6925 The server MAY set the ssrc parameter in the Transport header 6926 of the response. 6928 The parameters setup and connection defined below MAY only be used if 6929 the media transport protocol of the lower-level transport is 6930 connection-oriented (such as TCP). However, these parameters MUST 6931 NOT be used when interleaving data over the RTSP control connection. 6932 The third parameter, RTCP-mux, can be used also in the interleaved 6933 mode. 6935 setup: Clients use the setup parameter on the Transport line in a 6936 SETUP request, to indicate the roles it wishes to play in a TCP 6937 connection. This parameter is adapted from [RFC4145]. We 6938 discuss the use of this parameter in RTP/AVP/TCP non- 6939 interleaved transport in Appendix C.2.2; the discussion below 6940 is limited to syntactic issues. Clients may specify the 6941 following values for the setup parameter: ["active":] The 6942 client will initiate an outgoing connection. ["passive":] The 6943 client will accept an incoming connection. ["actpass":] The 6944 client is willing to accept an incoming connection or to 6945 initiate an outgoing connection. 6947 If a client does not specify a setup value, the "active" value 6948 is assumed. 6950 In response to a client SETUP request where the setup parameter 6951 is set to "active", a server's 2xx reply MUST assign the setup 6952 parameter to "passive" on the Transport header line. 6954 In response to a client SETUP request where the setup parameter 6955 is set to "passive", a server's 2xx reply MUST assign the setup 6956 parameter to "active" on the Transport header line. 6958 In response to a client SETUP request where the setup parameter 6959 is set to "actpass", a server's 2xx reply MUST assign the setup 6960 parameter to "active" or "passive" on the Transport header 6961 line. 6963 Note that the "holdconn" value for setup is not defined for 6964 RTSP use, and MUST NOT appear on a Transport line. 6966 connection: Clients use the setup parameter on the Transport line in 6967 a SETUP request, to indicate the SETUP request prefers the 6968 reuse of an existing connection between client and server (in 6969 which case the client sets the "connection" parameter to 6970 "existing"), or that the client requires the creation of a new 6971 connection between client and server (in which cast the client 6972 sets the "connection" parameter to "new"). Typically, clients 6973 use the "new" value for the first SETUP request for a URL, and 6974 "existing" for subsequent SETUP requests for a URL. 6976 If a client SETUP request assigns the "new" value to 6977 "connection", the server response MUST also assign the "new" 6978 value to "connection" on the Transport line. 6980 If a client SETUP request assigns the "existing" value to 6981 "connection", the server response MUST assign a value of 6982 "existing" or "new" to "connection" on the Transport line, at 6983 its discretion. 6985 The default value of "connection" is "existing", for all SETUP 6986 requests (initial and subsequent). 6988 RTCP-mux: Use to negotiate the usage of RTP and RTCP multiplexing 6989 [I-D.ietf-avt-rtp-and-rtcp-mux] on a single underlying 6990 transport stream. The presence of this parameter in a SETUP 6991 request indicates the clients support and requires the server 6992 to use RTP and RTCP multiplexing. The client SHALL only 6993 include one transport stream in the Transport header 6994 specification. To provide the server with a choice between 6995 using RTP/RTCP multiplexing or not, two different transport 6996 header specifications must be included. 6998 The combination of transport protocol, profile and lower transport 6999 needs to be defined. A number of combinations are defined in the 7000 Appendix C. 7002 Below is a usage example, showing a client advertising the capability 7003 to handle multicast or unicast, preferring multicast. Since this is 7004 a unicast-only stream, the server responds with the proper transport 7005 parameters for unicast. 7007 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 7008 CSeq: 302 7009 Transport: RTP/AVP;multicast;mode="PLAY", 7010 RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7011 "192.0.2.5:3457";mode="PLAY" 7012 Accept-Ranges: NPT, SMPTE, UTC 7013 User-Agent: PhonyClient/1.2 7015 S->C: RTSP/2.0 200 OK 7016 CSeq: 302 7017 Date: Thu, 23 Jan 1997 15:35:06 GMT 7018 Session: 47112344 7019 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7020 "192.0.2.5:3457";src_addr="192.0.2.224:6256"/ 7021 "192.0.2.224:6257";mode="PLAY" 7022 Accept-Ranges: NPT 7023 Media-Properties: Random-Access=0.6, Dynamic, 7024 Time-Limited=20081128T165900 7026 16.53. Unsupported 7028 The Unsupported response-header lists the features not supported by 7029 the responding RTSP agent. In the case where the feature was 7030 specified via the Proxy-Require field (Section 16.35), if there is a 7031 proxy on the path between the client and the server, the proxy MUST 7032 send a response message with a status code of 551 (Option Not 7033 Supported). The request MUST NOT be forwarded. 7035 See Section 16.41 for a usage example. 7037 16.54. User-Agent 7039 The User-Agent request-header field contains information about the 7040 user agent originating the request. This is for statistical 7041 purposes, the tracing of protocol violations, and automated 7042 recognition of user agents for the sake of tailoring responses to 7043 avoid particular user agent limitations. User agents SHOULD include 7044 this field with requests. The field can contain multiple product 7045 tokens and comments identifying the agent and any subproducts which 7046 form a significant part of the user agent. By convention, the 7047 product tokens are listed in order of their significance for 7048 identifying the application. 7050 Example: 7051 User-Agent: PhonyClient/1.2 7053 16.55. Vary 7055 The Vary field value indicates the set of request-header fields that 7056 fully determines, while the response is fresh, whether a cache is 7057 permitted to use the response to reply to a subsequent request 7058 without revalidation. For uncacheable or stale responses, the Vary 7059 field value advises the user agent about the criteria that were used 7060 to select the representation. A Vary field value of "*" implies that 7061 a cache cannot determine from the request headers of a subsequent 7062 request whether this response is the appropriate representation. 7064 An RTSP server SHOULD include a Vary header field with any cacheable 7065 response that is subject to server-driven negotiation. Doing so 7066 allows a cache to properly interpret future requests on that resource 7067 and informs the user agent about the presence of negotiation on that 7068 resource. A server MAY include a Vary header field with a non- 7069 cacheable response that is subject to server-driven negotiation, 7070 since this might provide the user agent with useful information about 7071 the dimensions over which the response varies at the time of the 7072 response. 7074 A Vary field value consisting of a list of field-names signals that 7075 the representation selected for the response is based on a selection 7076 algorithm which considers ONLY the listed request-header field values 7077 in selecting the most appropriate representation. A cache MAY assume 7078 that the same selection will be made for future requests with the 7079 same values for the listed field names, for the duration of time for 7080 which the response is fresh. 7082 The field-names given are not limited to the set of standard request- 7083 header fields defined by this specification. Field names are case- 7084 insensitive. 7086 A Vary field value of "*" signals that unspecified parameters not 7087 limited to the request-headers (e.g., the network address of the 7088 client), play a role in the selection of the response representation. 7089 The "*" value MUST NOT be generated by a proxy server; it may only be 7090 generated by an origin server. 7092 16.56. Via 7094 The Via general-header field MUST be used by proxies to indicate the 7095 intermediate protocols and recipients between the user agent and the 7096 server on requests, and between the origin server and the client on 7097 responses. The field is intended to be used for tracking message 7098 forwards, avoiding request loops, and identifying the protocol 7099 capabilities of all senders along the request/response chain. 7101 Multiple Via field values represents each proxy that has forwarded 7102 the message. Each recipient MUST append its information such that 7103 the end result is ordered according to the sequence of forwarding 7104 applications. 7106 Proxies (e.g., Access Proxy or Translator Proxy) SHOULD NOT, by 7107 default, forward the names and ports of hosts within the private/ 7108 protected region. This information SHOULD only be propagated if 7109 explicitly enabled. If not enabled, the via-received of any host 7110 behind the firewall/NAT SHOULD be replaced by an appropriate 7111 pseudonym for that host. 7113 For organizations that have strong privacy requirements for hiding 7114 internal structures, a proxy MAY combine an ordered subsequence of 7115 Via header field entries with identical sent-protocol values into a 7116 single such entry. Applications MUST NOT combine entries which have 7117 different received-protocol values. 7119 16.57. WWW-Authenticate 7121 The WWW-Authenticate response-header field MUST be included in 401 7122 (Unauthorized) response messages. The field value consists of at 7123 least one challenge that indicates the authentication scheme(s) and 7124 parameters applicable to the Request-URI. 7126 The HTTP access authentication process is described in [RFC2617]. 7127 User agents are advised to take special care in parsing the WWW- 7128 Authenticate field value as it might contain more than one challenge, 7129 or if more than one WWW-Authenticate header field is provided, the 7130 contents of a challenge itself can contain a comma-separated list of 7131 authentication parameters. 7133 17. Proxies 7135 RTSP Proxies are RTSP agents that sit in between a client and a 7136 server. A proxy can take on both the role as a client and as server 7137 depending on what it tries to accomplish. Proxies are also 7138 introduced for several different reasons and the below are often 7139 combined. 7141 Caching Proxy: This type of proxy is used to reduce the workload on 7142 servers and connections. By caching the description and media 7143 streams, i.e., the presentation, the proxy can serve a client 7144 with content, but without requesting it from the server once it 7145 has been cached and has not become stale. See the caching 7146 Section 18. This type of proxy is also expected to understand 7147 RTSP end-point functionality, i.e., functionality identified in 7148 the Require header in addition to what Proxy-Require demands. 7150 Translator Proxy: This type of proxy is used to ensure that an RTSP 7151 client get access to servers and content on an external network 7152 or using content encodings not supported by the client. The 7153 proxy performs the necessary translation of addresses, 7154 protocols or encodings. This type of proxy is expected to also 7155 understand RTSP end-point functionality, i.e. functionality 7156 identified in the Require header in addition to what Proxy- 7157 Require demands. 7159 Access Proxy: This type of proxy is used to ensure that a RTSP 7160 client get access to servers on an external network. Thus this 7161 proxy is placed on the border between two domains, e.g. a 7162 private address space and the public Internet. The proxy 7163 performs the necessary translation, usually addresses. This 7164 type of proxies are required to redirect the media to 7165 themselves or a controlled gateway that perform the translation 7166 before the media can reach the client. 7168 Security Proxy: This type of proxy is used to help facilitate 7169 security functions around RTSP. For example when having a 7170 firewalled network, the security proxy request that the 7171 necessary pinholes in the firewall is opened when a client in 7172 the protected network want to access media streams on the 7173 external side. This proxy can also limit the clients access to 7174 certain type of content. This proxy can perform its function 7175 without redirecting the media between the server and client. 7176 However, in deployments with private address spaces this proxy 7177 is likely to be combined with the access proxy. Anyway, the 7178 functionality of this proxy is usually closely tied into 7179 understand all aspects of the media transport. 7181 Auditing Proxy: RTSP proxies can also provide network owners with a 7182 logging and audit point for RTSP sessions, e.g. for 7183 corporations that tracks their employees usage of the network. 7184 This type of proxy can perform its function without inserting 7185 itself or any other node in the media transport. This proxy 7186 type can also accept unknown methods as it doesn't interfere 7187 with the clients requests. 7189 All type of proxies can be used also when using secured communication 7190 with TLS as RTSP 2.0 allows the client to approve certificate chains 7191 used for connection establishment from a proxy, see Section 19.3.2. 7192 However, that trust model may not be suitable for all type of 7193 deployment, and instead secured sessions do by-pass of the proxies. 7195 Access proxies SHOULD NOT be used in equipment like NATs and 7196 firewalls that aren't expected to be regularly maintained, like home 7197 or small office equipment. In these cases it is better to use the 7198 NAT traversal procedures defined for RTSP 2.0 7199 [I-D.ietf-mmusic-rtsp-nat]. The reason for these recommendations is 7200 that any extensions of RTSP resulting in new media transport 7201 protocols or profiles, new parameters etc may fail in a proxy that 7202 isn't maintained. Thus resulting in blocking further development of 7203 RTSP and its usage. 7205 17.1. Proxies and Protocol Extensions 7207 The existence of proxies must always be considered when developing 7208 new RTSP extensions. Most type of proxies will need to implement any 7209 new method to operate correct in the presence of that extension. New 7210 headers will be possible to introduce without being blocked by 7211 proxies not yet updated. However, it is important to consider if 7212 this header and its function is required to be understood by the 7213 proxy or can be forwarded. If the header needs to be understood a 7214 feature-tag representing the functionality needs to be included in 7215 the Proxy-Require header. Below are guidelines for analysis if the 7216 header needs to be understood. The transport header and its 7217 parameters also shows that headers that are extensible and requires 7218 correct interpretation in the proxy also requires handling rules. 7220 When defining a new RTSP header it needs to be considered if RTSP 7221 proxies are required to understand them to achieve correct 7222 functionality. Determining this is not easy as the functionality for 7223 proxies are widely varied as can be understood from the above list of 7224 functionality. When evaluating this, one can divide the 7225 functionality into three main categories: 7227 Media modifying: The caching and translator proxies are modifying 7228 the actual media and therefore needs to understand also request 7229 directed to the server that affects how the media is rendered. 7230 Thus, this type of proxies needs to also understand the server 7231 side functionality. 7233 Transport modifying: The access and the security proxy both need to 7234 understand how the transport is performed, either for opening 7235 pinholes or to translate the outer headers, e.g. IP and UDP. 7237 Non-modifying: The audit proxy is special in that it do not modify 7238 the messages in other ways than to insert the Via header. That 7239 makes it possible for this type to forward RTSP message that 7240 contains different type of unknown methods, headers or header 7241 parameters. 7243 Based on the above classification, one should evaluate if the new 7244 functionality requires the Transport modifying type of proxies to 7245 understand it or not. 7247 17.2. Multiplexing and Demultiplexing of Messages 7249 RTSP proxies may have to multiplex multiple RTSP sessions from their 7250 clients towards RTSP servers. This requires that RTSP requests from 7251 multiple clients are multiplexed onto a common connection for 7252 requests outgoing to a RTSP server and on the way back the responses 7253 are demultiplexed from the server to per client responses. On the 7254 protocol level this requires that request and response messages are 7255 handled in both ways, requiring that there is a mechanism to 7256 correlated what request/response pair exchanged between proxy and 7257 server is mapped to what client (or client request). 7259 This multiplexing of requests and demultiplexing of responses is done 7260 by using the CSeq header field (see Section 16.19). The proxy has to 7261 rewrite the CSeq in requests to the server and responses from the 7262 server and remember what CSeq is mapped to what client. 7264 18. Caching 7266 In HTTP, response-request pairs are cached. RTSP differs 7267 significantly in that respect. Responses are not cacheable, with the 7268 exception of the presentation description returned by DESCRIBE. 7269 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 7270 not return any data, caching is not really an issue for these 7271 requests.) However, it is desirable for the continuous media data, 7272 typically delivered out-of-band with respect to RTSP, to be cached, 7273 as well as the session description. 7275 On receiving a SETUP or PLAY request, a proxy ascertains whether it 7276 has an up-to-date copy of the continuous media content and its 7277 description. It can determine whether the copy is up-to-date by 7278 issuing a SETUP or DESCRIBE request, respectively, and comparing the 7279 Last-Modified header with that of the cached copy. If the copy is 7280 not up-to-date, it modifies the SETUP transport parameters as 7281 appropriate and forwards the request to the origin server. 7282 Subsequent control commands such as PLAY or PAUSE then pass the proxy 7283 unmodified. The proxy delivers the continuous media data to the 7284 client, while possibly making a local copy for later reuse. The 7285 exact allowed behavior of the cache is given by the cache-response 7286 directives described in Section 16.10. A cache MUST answer any 7287 DESCRIBE requests if it is currently serving the stream to the 7288 requester, as it is possible that low-level details of the stream 7289 description may have changed on the origin-server. 7291 Note that an RTSP cache, is of the "cut-through" variety. Rather 7292 than retrieving the whole resource from the origin server, the cache 7293 simply copies the streaming data as it passes by on its way to the 7294 client. Thus, it does not introduce additional latency. 7296 To the client, an RTSP proxy cache appears like a regular media 7297 server, to the media origin server like a client. Just as an HTTP 7298 cache has to store the content type, content language, and so on for 7299 the objects it caches, a media cache has to store the presentation 7300 description. Typically, a cache eliminates all transport-references 7301 (that is, e.g. multicast information) from the presentation 7302 description, since these are independent of the data delivery from 7303 the cache to the client. Information on the encodings remains the 7304 same. If the cache is able to translate the cached media data, it 7305 would create a new presentation description with all the encoding 7306 possibilities it can offer. 7308 18.1. Validation Model 7310 When a cache has a stale entry that it would like to use as a 7311 response to a client's request, it first has to check with the origin 7312 server (or possibly an intermediate cache with a fresh response) to 7313 see if its cached entry is still usable. We call this "validating" 7314 the cache entry. Since we do not want to have to pay the overhead of 7315 retransmitting the full response if the cached entry is good, and we 7316 do not want to pay the overhead of an extra round trip if the cached 7317 entry is invalid, the RTSP protocol supports the use of conditional 7318 methods. 7320 The key protocol features for supporting conditional methods are 7321 those concerned with "cache validators." When an origin server 7322 generates a full response, it attaches some sort of validator to it, 7323 which is kept with the cache entry. When a client (user agent or 7324 proxy cache) makes a conditional request for a resource for which it 7325 has a cache entry, it includes the associated validator in the 7326 request. 7328 The server then checks that validator against the current validator 7329 for the requested resource, and, if they match (see Section 18.1.3), 7330 it responds with a special status code (usually, 304 (Not Modified)) 7331 and no message body. Otherwise, it returns a full response 7332 (including message body). Thus, we avoid transmitting the full 7333 response if the validator matches, and we avoid an extra round trip 7334 if it does not match. 7336 In RTSP, a conditional request looks exactly the same as a normal 7337 request for the same resource, except that it carries a special 7338 header (which includes the validator) that implicitly turns the 7339 method (usually DESCRIBE or SETUP) into a conditional. 7341 The protocol includes both positive and negative senses of cache- 7342 validating conditions. That is, it is possible to request either 7343 that a method be performed if and only if a validator matches or if 7344 and only if no validators match. 7346 Note: a response that lacks a validator may still be cached, and 7347 served from cache until it expires, unless this is explicitly 7348 prohibited by a cache-control directive (see Section 16.10). 7349 However, a cache cannot do a conditional retrieval if it does not 7350 have a validator for the resource, which means it will not be 7351 refreshable after it expires. 7353 Media streams that are being adapted based on the transport capacity 7354 between the server and the cache makes caching more difficult. A 7355 server needs to consider how it views caching of media streams that 7356 it adapts and potentially instruct any caches to not cache such 7357 streams. 7359 18.1.1. Last-Modified Dates 7361 The Last-Modified header (Section 16.26) value is often used as a 7362 cache validator. In simple terms, a cache entry is considered to be 7363 valid if the content has not been modified since the Last-Modified 7364 value. 7366 18.1.2. Message Body Tag Cache Validators 7368 The MTag response-header field value, an message body tag, provides 7369 for an "opaque" cache validator. This might allow more reliable 7370 validation in situations where it is inconvenient to store 7371 modification dates, where the one-second resolution of RTSP-date 7372 values is not sufficient, or where the origin server wishes to avoid 7373 certain paradoxes that might arise from the use of modification 7374 dates. 7376 Message body tags are described in Section 5.3 7378 18.1.3. Weak and Strong Validators 7380 Since both origin servers and caches will compare two validators to 7381 decide if they represent the same or different entities, one normally 7382 would expect that if the message body (i.e., the presentation 7383 description) or any associated message body headers changes in any 7384 way, then the associated validator would change as well. If this is 7385 true, then we call this validator a "strong validator." We call 7386 message body (i.e., the presentation description) or any associated 7387 message body headers an entity for a better understanding. 7389 However, there might be cases when a server prefers to change the 7390 validator only on semantically significant changes, and not when 7391 insignificant aspects of the entity change. A validator that does 7392 not always change when the resource changes is a "weak validator." 7394 Message body tags are normally "strong validators," but the protocol 7395 provides a mechanism to tag an message body tag as "weak." One can 7396 think of a strong validator as one that changes whenever the bits of 7397 an entity changes, while a weak value changes whenever the meaning of 7398 an entity changes. Alternatively, one can think of a strong 7399 validator as part of an identifier for a specific entity, while a 7400 weak validator is part of an identifier for a set of semantically 7401 equivalent entities. 7403 Note: One example of a strong validator is an integer that is 7404 incremented in stable storage every time an entity is changed. 7406 An entity's modification time, if represented with one-second 7407 resolution, could be a weak validator, since it is possible that 7408 the resource might be modified twice during a single second. 7410 Support for weak validators is optional. However, weak validators 7411 allow for more efficient caching of equivalent objects. 7413 A "use" of a validator is either when a client generates a request 7414 and includes the validator in a validating header field, or when a 7415 server compares two validators. 7417 Strong validators are usable in any context. Weak validators are 7418 only usable in contexts that do not depend on exact equality of an 7419 entity. For example, either kind is usable for a conditional 7420 DESCRIBE of a full entity. However, only a strong validator is 7421 usable for a sub-range retrieval, since otherwise the client might 7422 end up with an internally inconsistent entity. 7424 Clients MAY issue DESCRIBE requests with either weak validators or 7425 strong validators. Clients MUST NOT use weak validators in other 7426 forms of request. 7428 The only function that the RTSP protocol defines on validators is 7429 comparison. There are two validator comparison functions, depending 7430 on whether the comparison context allows the use of weak validators 7431 or not: 7433 o The strong comparison function: in order to be considered equal, 7434 both validators MUST be identical in every way, and both MUST NOT 7435 be weak. 7437 o The weak comparison function: in order to be considered equal, 7438 both validators MUST be identical in every way, but either or both 7439 of them MAY be tagged as "weak" without affecting the result. 7441 An message body tag is strong unless it is explicitly tagged as weak. 7443 A Last-Modified time, when used as a validator in a request, is 7444 implicitly weak unless it is possible to deduce that it is strong, 7445 using the following rules: 7447 o The validator is being compared by an origin server to the actual 7448 current validator for the entity and, 7450 o That origin server reliably knows that the associated entity did 7451 not change twice during the second covered by the presented 7452 validator. 7454 OR 7456 o The validator is about to be used by a client in an If-Modified- 7457 Since, because the client has a cache entry for the associated 7458 entity, and 7460 o That cache entry includes a Date value, which gives the time when 7461 the origin server sent the original response, and 7463 o The presented Last-Modified time is at least 60 seconds before the 7464 Date value. 7466 OR 7468 o The validator is being compared by an intermediate cache to the 7469 validator stored in its cache entry for the entity, and 7471 o That cache entry includes a Date value, which gives the time when 7472 the origin server sent the original response, and 7474 o The presented Last-Modified time is at least 60 seconds before the 7475 Date value. 7477 This method relies on the fact that if two different responses were 7478 sent by the origin server during the same second, but both had the 7479 same Last-Modified time, then at least one of those responses would 7480 have a Date value equal to its Last-Modified time. The arbitrary 60- 7481 second limit guards against the possibility that the Date and Last- 7482 Modified values are generated from different clocks, or at somewhat 7483 different times during the preparation of the response. An 7484 implementation MAY use a value larger than 60 seconds, if it is 7485 believed that 60 seconds is too short. 7487 If a client wishes to perform a sub-range retrieval on a value for 7488 which it has only a Last-Modified time and no opaque validator, it 7489 MAY do this only if the Last-Modified time is strong in the sense 7490 described here. 7492 18.1.4. Rules for When to Use Message Body Tags and Last-Modified Dates 7494 We adopt a set of rules and recommendations for origin servers, 7495 clients, and caches regarding when various validator types ought to 7496 be used, and for what purposes. 7498 RTSP origin servers: 7500 o SHOULD send an message body tag validator unless it is not 7501 feasible to generate one. 7503 o MAY send a weak message body tag instead of a strong message body 7504 tag, if performance considerations support the use of weak message 7505 body tags, or if it is unfeasible to send a strong message body 7506 tag. 7508 o SHOULD send a Last-Modified value if it is feasible to send one, 7509 unless the risk of a breakdown in semantic transparency that could 7510 result from using this date in an If-Modified-Since header would 7511 lead to serious problems. 7513 In other words, the preferred behavior for an RTSP origin server is 7514 to send both a strong message body tag and a Last-Modified value. 7516 In order to be legal, a strong message body tag MUST change whenever 7517 the associated entity value changes in any way. A weak message body 7518 tag SHOULD change whenever the associated entity changes in a 7519 semantically significant way. 7521 Note: in order to provide semantically transparent caching, an 7522 origin server must avoid reusing a specific strong message body 7523 tag value for two different entities, or reusing a specific weak 7524 message body tag value for two semantically different entities. 7525 Cache entries might persist for arbitrarily long periods, 7526 regardless of expiration times, so it might be inappropriate to 7527 expect that a cache will never again attempt to validate an entry 7528 using a validator that it obtained at some point in the past. 7530 RTSP clients: 7532 o If an message body tag has been provided by the origin server, 7533 MUST use that message body tag in any cache-conditional request 7534 (using If- Match or If-None-Match). 7536 o If only a Last-Modified value has been provided by the origin 7537 server, SHOULD use that value in non-subrange cache-conditional 7538 requests (using If-Modified-Since). 7540 o If both an message body tag and a Last-Modified value have been 7541 provided by the origin server, SHOULD use both validators in 7542 cache-conditional requests. 7544 An RTSP origin server, upon receiving a conditional request that 7545 includes both a Last-Modified date (e.g., in an If-Modified-Since 7546 header) and one or more message body tags (e.g., in an If-Match, If- 7547 None-Match, or If-Range header field) as cache validators, MUST NOT 7548 return a response status of 304 (Not Modified) unless doing so is 7549 consistent with all of the conditional header fields in the request. 7551 Note: The general principle behind these rules is that RTSP 7552 servers and clients should transmit as much non-redundant 7553 information as is available in their responses and requests. RTSP 7554 systems receiving this information will make the most conservative 7555 assumptions about the validators they receive. 7557 18.1.5. Non-validating Conditionals 7559 The principle behind message body tags is that only the service 7560 author knows the semantics of a resource well enough to select an 7561 appropriate cache validation mechanism, and the specification of any 7562 validator comparison function more complex than byte-equality would 7563 open up a can of worms. Thus, comparisons of any other headers are 7564 never used for purposes of validating a cache entry. 7566 18.2. Invalidation After Updates or Deletions 7568 The effect of certain methods performed on a resource at the origin 7569 server might cause one or more existing cache entries to become non- 7570 transparently invalid. That is, although they might continue to be 7571 "fresh," they do not accurately reflect what the origin server would 7572 return for a new request on that resource. 7574 There is no way for the RTSP protocol to guarantee that all such 7575 cache entries are marked invalid. For example, the request that 7576 caused the change at the origin server might not have gone through 7577 the proxy where a cache entry is stored. However, several rules help 7578 reduce the likelihood of erroneous behavior. 7580 In this section, the phrase "invalidate an entity" means that the 7581 cache will either remove all instances of that entity from its 7582 storage, or will mark these as "invalid" and in need of a mandatory 7583 revalidation before they can be returned in response to a subsequent 7584 request. 7586 Some RTSP methods MUST cause a cache to invalidate an entity. This 7587 is either the entity referred to by the Request-URI, or by the 7588 Location or Content-Location headers (if present). These methods 7589 are: 7591 o DESCRIBE 7592 o SETUP 7594 In order to prevent denial of service attacks, an invalidation based 7595 on the URI in a Location or Content-Location header MUST only be 7596 performed if the host part is the same as in the Request-URI. 7598 A cache that passes through requests for methods it does not 7599 understand SHOULD invalidate any entities referred to by the Request- 7600 URI. 7602 19. Security Framework 7604 The RTSP security framework consists of two high level components: 7605 the pure authentication mechanisms based on HTTP authentication, and 7606 the message transport protection based on TLS, which is independent 7607 of RTSP. Because of the similarity in syntax and usage between RTSP 7608 servers and HTTP servers, the security for HTTP is re-used to a large 7609 extent. 7611 19.1. RTSP and HTTP Authentication 7613 RTSP and HTTP share common authentication schemes, and thus follow 7614 the same usage guidelines as specified in[RFC2617] and also in [H15]. 7615 Servers SHOULD implement both basic and digest [RFC2617] 7616 authentication. Client MUST implement both basic and digest 7617 authentication [RFC2617] so that Server who requires the client to 7618 authenticate can trust that the capability is present. 7620 It should be stressed that using the HTTP authentication alone does 7621 not provide full control message security. Therefore, in 7622 environments requiring tighter security for the control messages, TLS 7623 SHOULD be used, see Section 19.2. 7625 19.2. RTSP over TLS 7627 RTSP MUST follow the same guidelines with regards to TLS [RFC5246] 7628 usage as specified for HTTP, see [RFC2818]. RTSP over TLS is 7629 separated from unsecured RTSP both on URI level and port level. 7630 Instead of using the "rtsp" scheme identifier in the URI, the "rtsps" 7631 scheme identifier MUST be used to signal RTSP over TLS. If no port 7632 is given in a URI with the "rtsps" scheme, port 322 MUST be used for 7633 TLS over TCP/IP. 7635 When a client tries to setup an insecure channel to the server (using 7636 the "rtsp" URI), and the policy for the resource requires a secure 7637 channel, the server MUST redirect the client to the secure service by 7638 sending a 301 redirect response code together with the correct 7639 Location URI (using the "rtsps" scheme). A user or client MAY 7640 upgrade a non secured URI to a secured by changing the scheme from 7641 "rtsp" to "rtsps". A server implementing support for "rtsps" MUST 7642 allow this. 7644 It should be noted that TLS allows for mutual authentication (when 7645 using both server and client certificates). Still, one of the more 7646 common ways TLS is used is to only provide server side authentication 7647 (often to avoid client certificates). TLS is then used in addition 7648 to HTTP authentication, providing transport security and server 7649 authentication, while HTTP Authentication is used to authenticate the 7650 client. 7652 RTSP includes the possibility to keep a TCP session up between the 7653 client and server, throughout the RTSP session lifetime. It may be 7654 convenient to keep the TCP session, not only to save the extra setup 7655 time for TCP, but also the extra setup time for TLS (even if TLS uses 7656 the resume function, there will be almost two extra round trips). 7657 Still, when TLS is used, such behavior introduces extra active state 7658 in the server, not only for TCP and RTSP, but also for TLS. This may 7659 increase the vulnerability to DoS attacks. 7661 In addition to these recommendations, Section 19.3 gives further 7662 recommendations of TLS usage with proxies. 7664 19.3. Security and Proxies 7666 The nature of a proxy is often to act as a "man-in-the-middle", while 7667 security is often about preventing the existence of a "man-in-the- 7668 middle". This section provides clients with the possibility to use 7669 proxies even when applying secure transports (TLS) between the RTSP 7670 agents. The TLS proxy mechanism allows for server and proxy 7671 identification using certificates. However, the client can not be 7672 identified based on certificates. The client needs to select between 7673 using the procedure specified below or using a TLS connection 7674 directly (by-passing any proxies) to the server. The choice may be 7675 dependent on policies. 7677 There are basically two categories of proxies, the transparent 7678 proxies (of which the client is not aware) and the non-transparent 7679 proxies (of which the client is aware). An infrastructure based on 7680 proxies requires that the trust model is such that both client and 7681 servers can trust the proxies to handle the RTSP messages correctly. 7682 To be able to trust a proxy, the client and server also needs to be 7683 aware of the proxy. Hence, transparent proxies cannot generally be 7684 seen as trusted and will not work well with security (unless they 7685 work only at transport layer). In the rest of this section any 7686 reference to proxy will be to a non-transparent proxy, which inspects 7687 or manipulate the RTSP messages. 7689 HTTP Authentication is built on the assumption of proxies and can 7690 provide user-proxy authentication and proxy-proxy/server 7691 authentication in addition to the client-server authentication. 7693 When TLS is applied and a proxy is used, the client will connect to 7694 the proxy's address when connecting to any RTSP server. This implies 7695 that for TLS, the client will authenticate the proxy server and not 7696 the end server. Note that when the client checks the server 7697 certificate in TLS, it MUST check the proxy's identity (URI or 7698 possibly other known identity) against the proxy's identity as 7699 presented in the proxy's Certificate message. 7701 The problem is that for a proxy accepted by the client, the proxy 7702 needs to be provided information on which grounds it should accept 7703 the next-hop certificate. Both the proxy and the user may have rules 7704 for this, and the user have the possibility to select the desired 7705 behavior. To handle this case, the Accept-Credentials header (See 7706 Section 16.2) is used, where the client can force the proxy/proxies 7707 to relay back the chain of certificates used to authenticate any 7708 intermediate proxies as well as the server. Given the assumption 7709 that the proxies are viewed as trusted, it gives the user a 7710 possibility to enforce policies to each trusted proxy of whether it 7711 should accept the next agent in the chain. 7713 A proxy MUST use TLS for the next hop if the RTSP request includes a 7714 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between 7715 client and proxy, or between proxy and proxy), even if the resource 7716 and the end server are not require to use it. The proxy MUST, when 7717 initiating the next hop TLS connection, use the incoming TLS 7718 connections cipher suite list, only modified by removing any cipher 7719 suits that the proxy does not support. In case a proxy fails to 7720 establish a TLS connection due to cipher suite mismatch between proxy 7721 and next hop proxy or server, this is indicated using error code 472 7722 (Failure to establish secure connection). 7724 19.3.1. Accept-Credentials 7726 The Accept-Credentials header can be used by the client to distribute 7727 simple authorization policies to intermediate proxies. The client 7728 includes the Accept-Credentials header to dictate how the proxy 7729 treats the server/next proxy certificate. There are currently three 7730 methods defined: 7732 Any, which means that the proxy (or proxies) MUST accept whatever 7733 certificate presented. This is of course not a recommended 7734 option to use, but may be useful in certain circumstances (such 7735 as testing). 7737 Proxy, which means that the proxy (or proxies) MUST use its own 7738 policies to validate the certificate and decide whether to 7739 accept it or not. This is convenient in cases where the user 7740 has a strong trust relation with the proxy. Reason why a 7741 strong trust relation may exist are; personal/company proxy, 7742 proxy has a out-of-band policy configuration mechanism. 7744 User, which means that the proxy (or proxies) MUST send credential 7745 information about the next hop to the client for authorization. 7746 The client can then decide whether the proxy should accept the 7747 certificate or not. See Section 19.3.2 for further details. 7749 If the Accept-Credentials header is not included in the RTSP request 7750 from the client, then the "Proxy" method MUST be used as default. If 7751 another method than the "Proxy" is to be used, then the Accept- 7752 Credentials header MUST be included in all of the RTSP request from 7753 the client. This is because it cannot be assumed that the proxy 7754 always keeps the TLS state or the users previous preference between 7755 different RTSP messages (in particular if the time interval between 7756 the messages is long). 7758 With the "Any" and "Proxy" methods the proxy will apply the policy as 7759 defined for respectively method. If the policy does not accept the 7760 credentials of the next hop, the proxy MUST respond with a message 7761 using status code 471 (Connection Credentials not accepted). 7763 An RTSP request in the direction server to client MUST NOT include 7764 the Accept-Credential header. As for the non-secured communication, 7765 the possibility for these requests depends on the presence of a 7766 client established connection. However, if the server to client 7767 request is in relation to a session established over a TLS secured 7768 channel, it MUST be sent in a TLS secured connection. That secured 7769 connection MUST also be the one used by the last client to server 7770 request. If no such transport connection exist at the time when the 7771 server desires to send the request, the server discard the message. 7773 Further policies MAY be defined and registered, but should be done so 7774 with caution. 7776 19.3.2. User approved TLS procedure 7778 For the "User" method, each proxy MUST perform the following 7779 procedure for each RTSP request: 7781 o Setup the TLS session to the next hop if not already present (i.e. 7782 run the TLS handshake, but do not send the RTSP request). 7784 o Extract the peer certificate chain for the TLS session. 7786 o Check if a matching identity and hash of the peer certificate is 7787 present in the Accept-Credentials header. If present, send the 7788 message to the next hop, and conclude these procedures. If not, 7789 go to the next step. 7791 o The proxy responds to the RTSP request with a 470 or 407 response 7792 code. The 407 response code MAY be used when the proxy requires 7793 both user and connection authorization from user or client. In 7794 this message the proxy MUST include a Connection-Credentials 7795 header, see Section 16.12 with the next hop's identity and 7796 certificate. 7798 The client MUST upon receiving a 470 or 407 response with Connection- 7799 Credentials header take the decision on whether to accept the 7800 certificate or not (if it cannot do so, the user SHOULD be 7801 consulted). If the certificate is accepted, the client has to again 7802 send the RTSP request. In that request the client has to include the 7803 Accept-Credentials header including the hash over the DER encoded 7804 certificate for all trusted proxies in the chain. 7806 Example: 7808 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7809 CSeq: 2 7810 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7811 "192.0.2.5:4589" 7812 Accept-Ranges: NPT, SMPTE, UTC 7813 Accept-Credentials: User 7815 P->C: RTSP/2.0 470 Connection Authorization Required 7816 CSeq: 2 7817 Connection-Credentials: "rtsps://test.example.org"; 7818 MIIDNTCCAp... 7820 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7821 CSeq: 2 7822 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7823 "192.0.2.5:4589" 7824 Accept-Credentials: User "rtsps://test.example.org";sha-256; 7825 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 7826 Accept-Ranges: NPT, SMPTE, UTC 7828 P->S: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7829 CSeq: 2 7830 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7831 "192.0.2.5:4589" 7832 Via: RTSP/2.0 proxy.example.org 7833 Accept-Credentials: User "rtsps://test.example.org";sha-256; 7834 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 7835 Accept-Ranges: NPT, SMPTE, UTC 7837 One implication of this process is that the connection for secured 7838 RTSP messages may take significantly more round-trip times for the 7839 first message. An complete extra message exchange between the proxy 7840 connecting to the next hop and the client results because of the 7841 process for approval for each hop. However, after the first message 7842 exchange the remaining message should not be delayed, if each message 7843 contains the chain of proxies that the requester accepts. The 7844 procedure of including the credentials in each request rather than 7845 building state in each proxy, avoids the need for revocation 7846 procedures. 7848 20. Syntax 7850 The RTSP syntax is described in an Augmented Backus-Naur Form (ABNF) 7851 as defined in RFC 5234 [RFC5234]. It uses the basic definitions 7852 present in RFC 5234. 7854 Please note that ABNF strings, e.g. "Accept", are case insensitive 7855 as specified in section 2.3 of RFC 5234. 7857 20.1. Base Syntax 7859 RTSP header values can be folded onto multiple lines if the 7860 continuation line begins with a space or horizontal tab. All linear 7861 white space, including folding, has the same semantics as SP. A 7862 recipient MAY replace any linear white space with a single SP before 7863 interpreting the field value or forwarding the message downstream. 7864 This is intended to behave exactly as HTTP/1.1 as described in RFC 7865 2616 [RFC2616]. The SWS construct is used when linear white space is 7866 optional, generally between tokens and separators. 7868 To separate the header name from the rest of value, a colon is used, 7869 which, by the above rule, allows whitespace before, but no line 7870 break, and whitespace after, including a line break. The HCOLON 7871 defines this construct. 7873 OCTET = %x00-FF ; any 8-bit sequence of data 7874 CHAR = %x01-7F ; any US-ASCII character (octets 1 - 127) 7875 UPALPHA = %x41-5A ; any US-ASCII uppercase letter "A".."Z" 7876 LOALPHA = %x61-7A ;any US-ASCII lowercase letter "a".."z" 7877 ALPHA = UPALPHA / LOALPHA 7878 DIGIT = %x30-39 ; any US-ASCII digit "0".."9" 7879 CTL = %x00-1F / %x7F ; any US-ASCII control character 7880 ; (octets 0 - 31) and DEL (127) 7881 CR = %x0D ; US-ASCII CR, carriage return (13) 7882 LF = %x0A ; US-ASCII LF, linefeed (10) 7883 SP = %x20 ; US-ASCII SP, space (32) 7884 HT = %x09 ; US-ASCII HT, horizontal-tab (9) 7885 DQ = %x22 ; US-ASCII double-quote mark (34) 7886 BACKSLASH = %x5C ; US-ASCII backslash (92) 7887 CRLF = CR LF 7888 LWS = [CRLF] 1*( SP / HT ) ; Line-breaking White Space 7889 SWS = [LWS] ; Separating White Space 7890 HCOLON = *( SP / HT ) ":" SWS 7891 TEXT = %x20-7E / %x80-FF ; any OCTET except CTLs 7892 tspecials = "(" / ")" / "<" / ">" / "@" 7893 / "," / ";" / ":" / BACKSLASH / DQ 7894 / "/" / "[" / "]" / "?" / "=" 7895 / "{" / "}" / SP / HT 7896 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 7897 / %x41-5A / %x5E-7A / %x7C / %x7E) 7898 ; 1* 7899 quoted-string = ( DQ *qdtext DQ ) 7900 qdtext = %x20-21 / %x23-7E / %x80-FF / UTF8-NONASCII 7901 ; any UTF-8 TEXT except <"> 7902 quoted-pair = BACKSLASH CHAR 7903 ctext = %x20-27 / %x2A-7E 7904 / %x80-FF ; any OCTET except CTLs, "(" and ")" 7905 generic-param = token [ EQUAL gen-value ] 7906 gen-value = token / host / quoted-string 7908 safe = "$" / "-" / "_" / "." / "+" 7909 extra = "!" / "*" / "'" / "(" / ")" / "," 7910 rtsp-extra = "!" / "*" / "'" / "(" / ")" 7912 HEX = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" 7913 / "a" / "b" / "c" / "d" / "e" / "f" 7914 LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" 7915 ; lowercase "a-f" Hex 7916 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 7918 unreserved = ALPHA / DIGIT / safe / extra 7919 rtsp-unreserved = ALPHA / DIGIT / safe / rtsp-extra 7921 base64 = *base64-unit [base64-pad] 7922 base64-unit = 4base64-char 7923 base64-pad = (2base64-char "==") / (3base64-char "=") 7924 base64-char = ALPHA / DIGIT / "+" / "/" 7925 SLASH = SWS "/" SWS ; slash 7926 EQUAL = SWS "=" SWS ; equal 7927 LPAREN = SWS "(" SWS ; left parenthesis 7928 RPAREN = SWS ")" SWS ; right parenthesis 7929 COMMA = SWS "," SWS ; comma 7930 SEMI = SWS ";" SWS ; semicolon 7931 COLON = SWS ":" SWS ; colon 7932 MINUS = SWS "-" SWS ; minus/dash 7933 LDQUOT = SWS DQ ; open double quotation mark 7934 RDQUOT = DQ SWS ; close double quotation mark 7935 RAQUOT = ">" SWS ; right angle quote 7936 LAQUOT = SWS "<" ; left angle quote 7938 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 7939 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 7940 / %xE0-EF 2UTF8-CONT 7941 / %xF0-F7 3UTF8-CONT 7942 / %xF8-FB 4UTF8-CONT 7943 / %xFC-FD 5UTF8-CONT 7944 UTF8-CONT = %x80-BF 7946 FLOAT = ["-"] 1*12DIGIT ["." 1*9DIGIT] 7947 POS-FLOAT = 1*12DIGIT ["." 1*9DIGIT] 7949 20.2. RTSP Protocol Definition 7951 20.2.1. Generic Protocol elements 7952 RTSP-IRI = schemes ":" IRI-rest 7953 IRI-rest = ihier-part [ "?" iquery ] [ "#" ifragment ] 7954 ihier-part = "//" iauthority ipath-abempty 7955 RTSP-IRI-ref = RTSP-IRI / irelative-ref 7956 irelative-ref = irelative-part [ "?" iquery ] [ "#" ifragment ] 7957 irelative-part = "//" iauthority ipath-abempty 7958 / ipath-absolute 7959 / ipath-noscheme 7960 / ipath-empty 7962 iauthority = < As defined in RFC 3987> 7963 ipath = ipath-abempty ; begins with "/" or is empty 7964 / ipath-absolute ; begins with "/" but not "//" 7965 / ipath-noscheme ; begins with a non-colon segment 7966 / ipath-rootless ; begins with a segment 7967 / ipath-empty ; zero characters 7969 ipath-abempty = *( "/" isegment ) 7970 ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] 7971 ipath-noscheme = isegment-nz-nc *( "/" isegment ) 7972 ipath-rootless = isegment-nz *( "/" isegment ) 7973 ipath-empty = 0 7975 isegment = *ipchar [";" *ipchar] 7976 isegment-nz = 1*ipchar [";" *ipchar] 7977 / ";" *ipchar 7978 isegment-nz-nc = (1*ipchar-nc [";" *ipchar-nc]) 7979 / ";" *ipchar-nc 7980 ; non-zero-length segment without any colon ":" 7982 ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" 7983 ipchar-nc = iunreserved / pct-encoded / sub-delims / "@" 7985 iquery = < As defined in RFC 3987> 7986 ifragment = < As defined in RFC 3987> 7987 iunreserved = < As defined in RFC 3987> 7988 pct-encoded = < As defined in RFC 3987> 7989 RTSP-URI = schemes ":" URI-rest 7990 RTSP-REQ-URI = schemes ":" URI-req-rest 7991 RTSP-URI-Ref = RTSP-URI / RTSP-Relative 7992 RTSP-REQ-Ref = RTSP-REQ-URI / RTSP-REQ-Rel 7993 schemes = "rtsp" / "rtsps" / scheme 7994 scheme = < As defined in RFC 3986> 7995 URI-rest = hier-part [ "?" query ] [ "#" fragment ] 7996 URI-req-rest = hier-part [ "?" query ] 7997 ; Note fragment part not allowed in requests 7998 hier-part = "//" authority path-abempty 8000 RTSP-Relative = relative-part [ "?" query ] [ "#" fragment ] 8001 RTSP-REQ-Rel = relative-part [ "?" query ] 8002 relative-part = "//" authority path-abempty 8003 / path-absolute 8004 / path-noscheme 8005 / path-empty 8007 authority = < As defined in RFC 3986> 8008 query = < As defined in RFC 3986> 8009 fragment = < As defined in RFC 3986> 8011 path = path-abempty ; begins with "/" or is empty 8012 / path-absolute ; begins with "/" but not "//" 8013 / path-noscheme ; begins with a non-colon segment 8014 / path-rootless ; begins with a segment 8015 / path-empty ; zero characters 8017 path-abempty = *( "/" segment ) 8018 path-absolute = "/" [ segment-nz *( "/" segment ) ] 8019 path-noscheme = segment-nz-nc *( "/" segment ) 8020 path-rootless = segment-nz *( "/" segment ) 8021 path-empty = 0 8023 segment = *pchar [";" *pchar] 8024 segment-nz = ( 1*pchar [";" *pchar]) / (";" *pchar) 8025 segment-nz-nc = ( 1*pchar-nc [";" *pchar-nc]) / (";" *pchar-nc) 8026 ; non-zero-length segment without any colon ":" 8028 pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 8029 pchar-nc = unreserved / pct-encoded / sub-delims / "@" 8031 sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 8032 / "*" / "+" / "," / "=" 8034 smpte-range = smpte-type ["=" smpte-range-spec] 8035 ; See section 3.4 8036 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 8037 / ( "-" smpte-time ) 8038 smpte-type = "smpte" / "smpte-30-drop" 8039 / "smpte-25" / smpte-type-extension 8040 ; other timecodes may be added 8041 smpte-type-extension = "smpte" token 8042 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 8043 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 8045 npt-range = "npt" ["=" npt-range-spec] 8046 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 8047 npt-time = "now" / npt-sec / npt-hhmmss 8048 npt-sec = 1*19DIGIT [ "." 1*9DIGIT ] 8049 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ] 8050 npt-hh = 1*19DIGIT ; any positive number 8051 npt-mm = 1*2DIGIT ; 0-59 8052 npt-ss = 1*2DIGIT ; 0-59 8054 utc-range = "clock" ["=" utc-range-spec] 8055 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 8056 utc-time = utc-date "T" utc-clock "Z" 8057 utc-date = 8DIGIT 8058 utc-clock = 6DIGIT [ "." fraction ] 8059 fraction = 1*9DIGIT 8061 feature-tag = token 8063 session-id = 1*256( ALPHA / DIGIT / safe ) 8065 extension-header = header-name HCOLON header-value 8066 header-name = token 8067 header-value = *(TEXT-UTF8char / UTF8-CONT / LWS) 8069 20.2.2. Message Syntax 8070 RTSP-message = Request / Response ; RTSP/2.0 messages 8072 Request = Request-Line 8073 *((general-header 8074 / request-header 8075 / message-header) CRLF) 8076 CRLF 8077 [ message-body-data ] 8079 Response = Status-Line 8080 *((general-header 8081 / response-header 8082 / message-header) CRLF) 8083 CRLF 8084 [ message-body-data ] 8086 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 8088 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 8089 Method = "DESCRIBE" 8090 / "GET_PARAMETER" 8091 / "OPTIONS" 8092 / "PAUSE" 8093 / "PLAY" 8094 / "PLAY_NOTIFY" 8095 / "REDIRECT" 8096 / "SETUP" 8097 / "SET_PARAMETER" 8098 / "TEARDOWN" 8099 / extension-method 8101 extension-method = token 8103 Request-URI = "*" / RTSP-REQ-URI 8104 RTSP-Version = "RTSP/" 1*DIGIT "." 1*DIGIT 8106 message-body-data = 1*OCTET 8108 Status-Code = "100" ; Continue 8109 / "200" ; OK 8110 / "301" ; Moved Permanently 8111 / "302" ; Found 8112 / "303" ; See Other 8113 / "304" ; Not Modified 8114 / "305" ; Use Proxy 8115 / "400" ; Bad Request 8116 / "401" ; Unauthorized 8117 / "402" ; Payment Required 8118 / "403" ; Forbidden 8119 / "404" ; Not Found 8120 / "405" ; Method Not Allowed 8121 / "406" ; Not Acceptable 8122 / "407" ; Proxy Authentication Required 8123 / "408" ; Request Time-out 8124 / "410" ; Gone 8125 / "411" ; Length Required 8126 / "412" ; Precondition Failed 8127 / "413" ; Request Message Body Too Large 8128 / "414" ; Request-URI Too Large 8129 / "415" ; Unsupported Media Type 8130 / "451" ; Parameter Not Understood 8131 / "452" ; reserved 8132 / "453" ; Not Enough Bandwidth 8133 / "454" ; Session Not Found 8134 / "455" ; Method Not Valid in This State 8135 / "456" ; Header Field Not Valid for Resource 8136 / "457" ; Invalid Range 8137 / "458" ; Parameter Is Read-Only 8138 / "459" ; Aggregate operation not allowed 8139 / "460" ; Only aggregate operation allowed 8140 / "461" ; Unsupported Transport 8141 / "462" ; Destination Unreachable 8142 / "463" ; Destination Prohibited 8143 / "464" ; Data Transport Not Ready Yet 8144 / "470" ; Connection Authorization Required 8145 / "471" ; Connection Credentials not accepted 8146 / "472" ; Failure to establish secure connection 8147 / "500" ; Internal Server Error 8148 / "501" ; Not Implemented 8149 / "502" ; Bad Gateway 8150 / "503" ; Service Unavailable 8151 / "504" ; Gateway Time-out 8152 / "505" ; RTSP Version not supported 8153 / "551" ; Option not supported 8154 / extension-code 8156 extension-code = 3DIGIT 8158 Reason-Phrase = 1*(TEXT-UTF8char / HT / SP) 8159 general-header = Cache-Control 8160 / Connection 8161 / CSeq 8162 / Date 8163 / Media-Properties 8164 / Media-Range 8165 / Pipelined-Requests 8166 / Proxy-Supported 8167 / Seek-Style 8168 / Supported 8169 / Timestamp 8170 / Via 8171 / extension-header 8173 request-header = Accept 8174 / Accept-Credentials 8175 / Accept-Encoding 8176 / Accept-Language 8177 / Authorization 8178 / Bandwidth 8179 / Blocksize 8180 / From 8181 / If-Match 8182 / If-Modified-Since 8183 / If-None-Match 8184 / Notify-Reason 8185 / Proxy-Require 8186 / Range 8187 / Referrer 8188 / Request-Status 8189 / Require 8190 / Scale 8191 / Session 8192 / Speed 8193 / Supported 8194 / Terminate-Reason 8195 / Transport 8196 / User-Agent 8197 / extension-header 8199 response-header = Accept-Credentials 8200 / Accept-Ranges 8201 / Connection-Credentials 8202 / MTag 8203 / Location 8204 / Proxy-Authenticate 8205 / Public 8206 / Range 8207 / Retry-After 8208 / RTP-Info 8209 / Scale 8210 / Session 8211 / Server 8212 / Speed 8213 / Transport 8214 / Unsupported 8215 / Vary 8216 / WWW-Authenticate 8217 / extension-header 8219 message-header = Allow 8220 / Content-Base 8221 / Content-Encoding 8222 / Content-Language 8223 / Content-Length 8224 / Content-Location 8225 / Content-Type 8226 / Expires 8227 / Last-Modified 8228 / extension-header 8230 20.2.3. Header Syntax 8232 Accept = "Accept" HCOLON 8233 [ accept-range *(COMMA accept-range) ] 8234 accept-range = media-type-range [SEMI accept-params] 8235 media-type-range = ( "*/*" 8236 / ( m-type SLASH "*" ) 8237 / ( m-type SLASH m-subtype ) 8238 ) *( SEMI m-parameter ) 8239 accept-params = "q" EQUAL qvalue *(SEMI generic-param ) 8240 qvalue = ( "0" [ "." *3DIGIT ] ) 8241 / ( "1" [ "." *3("0") ] ) 8242 Accept-Credentials = "Accept-Credentials" HCOLON cred-decision 8243 cred-decision = ("User" [LWS cred-info]) 8244 / "Proxy" 8245 / "Any" 8246 / (token [LWS 1*header-value]) 8247 ; For future extensions 8248 cred-info = cred-info-data *(COMMA cred-info-data) 8250 cred-info-data = DQ RTSP-REQ-URI DQ SEMI hash-alg SEMI base64 8251 hash-alg = "sha-256" / extension-alg 8252 extension-alg = token 8253 Accept-Encoding = "Accept-Encoding" HCOLON 8254 [ encoding *(COMMA encoding) ] 8255 encoding = codings [SEMI accept-params] 8256 codings = content-coding / "*" 8257 content-coding = token 8258 Accept-Language = "Accept-Language" HCOLON 8259 [ language *(COMMA language) ] 8260 language = language-range [SEMI accept-params] 8261 language-range = language-tag / "*" 8262 language-tag = primary-tag *( "-" subtag ) 8263 primary-tag = 1*8ALPHA 8264 subtag = 1*8ALPHA 8265 Accept-Ranges = "Accept-Ranges" HCOLON acceptable-ranges 8266 acceptable-ranges = (range-unit *(COMMA range-unit)) 8267 range-unit = "NPT" / "SMPTE" / "UTC" / extension-format 8268 extension-format = token 8269 Allow = "Allow" HCOLON Method *(COMMA Method) 8270 Authorization = "Authorization" HCOLON credentials 8271 credentials = ("Digest" LWS digest-response) 8272 / other-response 8273 digest-response = dig-resp *(COMMA dig-resp) 8274 dig-resp = username / realm / nonce / digest-uri 8275 / dresponse / algorithm / cnonce 8276 / opaque / message-qop 8277 / nonce-count / auth-param 8278 username = "username" EQUAL username-value 8279 username-value = quoted-string 8280 digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT 8281 digest-uri-value = RTSP-REQ-URI 8282 message-qop = "qop" EQUAL qop-value 8283 cnonce = "cnonce" EQUAL cnonce-value 8284 cnonce-value = nonce-value 8285 nonce-count = "nc" EQUAL nc-value 8286 nc-value = 8LHEX 8287 dresponse = "response" EQUAL request-digest 8288 request-digest = LDQUOT 32LHEX RDQUOT 8289 auth-param = auth-param-name EQUAL 8290 ( token / quoted-string ) 8291 auth-param-name = token 8292 other-response = auth-scheme LWS auth-param 8293 *(COMMA auth-param) 8295 auth-scheme = token 8297 Bandwidth = "Bandwidth" HCOLON 1*19DIGIT 8299 Blocksize = "Blocksize" HCOLON 1*9DIGIT 8301 Cache-Control = "Cache-Control" HCOLON cache-directive 8302 *(COMMA cache-directive) 8303 cache-directive = cache-rqst-directive 8304 / cache-rspns-directive 8306 cache-rqst-directive = "no-cache" 8307 / "max-stale" [EQUAL delta-seconds] 8308 / "min-fresh" EQUAL delta-seconds 8309 / "only-if-cached" 8310 / cache-extension 8312 cache-rspns-directive = "public" 8313 / "private" 8314 / "no-cache" 8315 / "no-transform" 8316 / "must-revalidate" 8317 / "proxy-revalidate" 8318 / "max-age" EQUAL delta-seconds 8319 / cache-extension 8321 cache-extension = token [EQUAL (token / quoted-string)] 8322 delta-seconds = 1*19DIGIT 8324 Connection = "Connection" HCOLON connection-token 8325 *(COMMA connection-token) 8326 connection-token = token 8328 Connection-Credentials = "Connection-Credentials" HCOLON cred-chain 8329 cred-chain = DQ RTSP-REQ-URI DQ SEMI base64 8331 Content-Base = "Content-Base" HCOLON RTSP-URI 8332 Content-Encoding = "Content-Encoding" HCOLON 8333 content-coding *(COMMA content-coding) 8334 Content-Language = "Content-Language" HCOLON 8335 language-tag *(COMMA language-tag) 8336 Content-Length = "Content-Length" HCOLON 1*19DIGIT 8337 Content-Location = "Content-Location" HCOLON RTSP-REQ-Ref 8338 Content-Type = "Content-Type" HCOLON media-type 8339 media-type = m-type SLASH m-subtype *(SEMI m-parameter) 8340 m-type = discrete-type / composite-type 8341 discrete-type = "text" / "image" / "audio" / "video" 8342 / "application" / extension-token 8344 composite-type = "message" / "multipart" / extension-token 8345 extension-token = ietf-token / x-token 8346 ietf-token = token 8347 x-token = "x-" token 8348 m-subtype = extension-token / iana-token 8349 iana-token = token 8350 m-parameter = m-attribute EQUAL m-value 8351 m-attribute = token 8352 m-value = token / quoted-string 8354 CSeq = "CSeq" HCOLON cseq-nr 8355 cseq-nr = 1*9DIGIT 8356 Date = "Date" HCOLON RTSP-date 8357 RTSP-date = rfc1123-date ; HTTP-date 8358 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 8359 date1 = 2DIGIT SP month SP 4DIGIT 8360 ; day month year (e.g., 02 Jun 1982) 8361 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 8362 ; 00:00:00 - 23:59:59 8363 wkday = "Mon" / "Tue" / "Wed" 8364 / "Thu" / "Fri" / "Sat" / "Sun" 8365 month = "Jan" / "Feb" / "Mar" / "Apr" 8366 / "May" / "Jun" / "Jul" / "Aug" 8367 / "Sep" / "Oct" / "Nov" / "Dec" 8369 Expires = "Expires" HCOLON RTSP-date 8370 From = "From" HCOLON from-spec 8371 from-spec = ( name-addr / addr-spec ) *( SEMI from-param ) 8372 name-addr = [ display-name ] LAQUOT addr-spec RAQUOT 8373 addr-spec = RTSP-REQ-URI / absolute-URI 8374 absolute-URI = < As defined in RFC 3986> 8375 display-name = *(token LWS) / quoted-string 8376 from-param = tag-param / generic-param 8377 tag-param = "tag" EQUAL token 8378 If-Match = "If-Match" HCOLON ("*" / message-tag-list) 8379 message-tag-list = message-tag *(COMMA message-tag) 8380 message-tag = [ weak ] opaque-tag 8381 weak = "W/" 8382 opaque-tag = quoted-string 8383 If-Modified-Since = "If-Modified-Since" HCOLON RTSP-date 8384 If-None-Match = "If-None-Match" HCOLON ("*" / message-tag-list) 8385 Last-Modified = "Last-Modified" HCOLON RTSP-date 8386 Location = "Location" HCOLON RTSP-REQ-URI 8387 Media-Properties = "Media-Properties" HCOLON [media-prop-list] 8388 media-prop-list = media-prop-value *(COMMA media-prop-value) 8389 media-prop-value = ("Random-Access" [EQUAL POS-FLOAT]) 8390 / "Begining-Only" 8391 / "No-Seeking" 8392 / "Immutable" 8393 / "Dynamic" 8394 / "Time-Progressing" 8395 / "Unlimited" 8396 / ("Time-Limited" EQUAL utc-time) 8397 / ("Time-Duration" EQUAL POS-FLOAT) 8398 / ("Scales" EQUAL scale-value-list) 8399 / media-prop-ext 8400 media-prop-ext = token [EQUAL (1*rtsp-unreserved / quoted-string)] 8401 scale-value-list = DQ scale-entry *(COMMA scale-entry) DQ 8402 scale-entry = scale-value / (scale-value COLON scale-value) 8403 scale-value = FLOAT 8404 Media-Range = "Media-Range" HCOLON [ranges-list] 8405 ranges-list = ranges-spec *(COMMA ranges-spec) 8406 MTag = "MTag" HCOLON message-tag 8407 Notify-Reason = "Notify-Reason" HCOLON Notify-Reas-val 8408 Notify-Reas-val = "end-of-stream" 8409 / "media-properties-update" 8410 / "scale-change" 8411 / Notify-Reason-extension 8412 Notify-Reason-extension = token 8413 Pipelined-Requests = "Pipelined-Requests" HCOLON startup-id 8414 startup-id = 1*8DIGIT 8416 Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge-list 8417 challenge-list = challenge *(COMMA challenge) 8418 challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) 8419 / other-challenge 8420 other-challenge = auth-scheme LWS auth-param 8421 *(COMMA auth-param) 8422 digest-cln = realm / domain / nonce 8423 / opaque / stale / algorithm 8424 / qop-options / auth-param 8425 realm = "realm" EQUAL realm-value 8426 realm-value = quoted-string 8427 domain = "domain" EQUAL LDQUOT RTSP-REQ-Ref 8428 *(1*SP RTSP-REQ-Ref ) RDQUOT 8429 nonce = "nonce" EQUAL nonce-value 8430 nonce-value = quoted-string 8431 opaque = "opaque" EQUAL quoted-string 8432 stale = "stale" EQUAL ( "true" / "false" ) 8433 algorithm = "algorithm" EQUAL ("MD5" / "MD5-sess" / token) 8434 qop-options = "qop" EQUAL LDQUOT qop-value 8435 *("," qop-value) RDQUOT 8436 qop-value = "auth" / "auth-int" / token 8437 Proxy-Require = "Proxy-Require" HCOLON feature-tag-list 8438 feature-tag-list = feature-tag *(COMMA feature-tag) 8439 Proxy-Supported = "Proxy-Supported" HCOLON [feature-tag-list] 8441 Public = "Public" HCOLON Method *(COMMA Method) 8443 Range = "Range" HCOLON ranges-spec 8445 ranges-spec = npt-range / utc-range / smpte-range 8446 / range-ext 8447 range-ext = extension-format ["=" range-value] 8448 range-value = 1*(rtsp-unreserved / quoted-string / ":" ) 8450 Referrer = "Referrer" HCOLON (absolute-URI / RTSP-URI-Ref) 8451 Request-Status = "Request-Status" HCOLON req-status-info 8452 req-status-info = cseq-info LWS status-info LWS reason-info 8453 cseq-info = "cseq" EQUAL cseq-nr 8454 status-info = "status" EQUAL Status-Code 8455 reason-info = "reason" EQUAL DQ Reason-Phrase DQ 8456 Require = "Require" HCOLON feature-tag-list 8457 RTP-Info = "RTP-Info" HCOLON [rtsp-info-spec 8458 *(COMMA rtsp-info-spec)] 8459 rtsp-info-spec = stream-url 1*ssrc-parameter 8460 stream-url = "url" EQUAL DQ RTSP-REQ-Ref DQ 8461 ssrc-parameter = LWS "ssrc" EQUAL ssrc HCOLON 8462 ri-parameter *(SEMI ri-parameter) 8463 ri-parameter = ("seq" EQUAL 1*5DIGIT) 8464 / ("rtptime" EQUAL 1*10DIGIT) 8465 / generic-param 8467 Retry-After = "Retry-After" HCOLON ( RTSP-date / delta-seconds ) 8468 Scale = "Scale" HCOLON scale-value 8469 Seek-Style = "Seek-Style" HCOLON Seek-S-values 8470 Seek-S-values = "RAP" 8471 / "CoRAP" 8472 / "First-Prior" 8473 / "Next" 8474 / Seek-S-value-ext 8475 Seek-S-value-ext = token 8477 Server = "Server" HCOLON ( product / comment ) 8478 *(LWS (product / comment)) 8479 product = token [SLASH product-version] 8480 product-version = token 8481 comment = LPAREN *( ctext / quoted-pair) RPAREN 8483 Session = "Session" HCOLON session-id 8484 [ SEMI "timeout" EQUAL delta-seconds ] 8486 Speed = "Speed" HCOLON lower-bound MINUS upper-bound 8487 lower-bound = POS-FLOAT 8488 upper-bound = POS-FLOAT 8490 Supported = "Supported" HCOLON [feature-tag-list] 8491 Terminate-Reason = "Terminate-Reason" HCOLON TR-Info 8492 TR-Info = TR-Reason *(SEMI TR-Parameter) 8493 TR-Reason = "Session-Timeout" 8494 / "Server-Admin" 8495 / "Internal-Error" 8496 / token 8497 TR-Parameter = TR-time / TR-user-msg / generic-param 8498 TR-time = "time" EQUAL utc-time 8499 TR-user-msg = "user-msg" EQUAL quoted-string 8501 Timestamp = "Timestamp" HCOLON timestamp-value LWS [delay] 8502 timestamp-value = *19DIGIT [ "." *9DIGIT ] 8503 delay = *9DIGIT [ "." *9DIGIT ] 8505 Transport = "Transport" HCOLON transport-spec 8506 *(COMMA transport-spec) 8507 transport-spec = transport-id *trns-parameter 8508 transport-id = trans-id-rtp / other-trans 8509 trans-id-rtp = "RTP/" profile ["/" lower-transport] 8510 ; no LWS is allowed inside transport-id 8511 other-trans = token *("/" token) 8513 profile = "AVP" / "SAVP" / "AVPF" / token 8514 lower-transport = "TCP" / "UDP" / token 8515 trns-parameter = (SEMI ( "unicast" / "multicast" )) 8516 / (SEMI "interleaved" EQUAL channel [ "-" channel ]) 8517 / (SEMI "ttl" EQUAL ttl) 8518 / (SEMI "layers" EQUAL 1*DIGIT) 8519 / (SEMI "ssrc" EQUAL ssrc *(SLASH ssrc)) 8520 / (SEMI "mode" EQUAL mode-spec) 8521 / (SEMI "dest_addr" EQUAL addr-list) 8522 / (SEMI "src_addr" EQUAL addr-list) 8523 / (SEMI "setup" EQUAL contrans-setup) 8524 / (SEMI "connection" EQUAL contrans-con) 8525 / (SEMI "RTCP-mux") 8526 / (SEMI trn-param-ext) 8527 contrans-setup = "active" / "passive" / "actpass" 8528 contrans-con = "new" / "existing" 8529 trn-param-ext = par-name [EQUAL trn-par-value] 8530 par-name = token 8531 trn-par-value = *(rtsp-unreserved / quoted-string) 8532 ttl = 1*3DIGIT ; 0 to 255 8533 ssrc = 8HEX 8534 channel = 1*3DIGIT ; 0 to 255 8535 mode-spec = ( DQ mode *(COMMA mode) DQ ) 8536 mode = "PLAY" / token 8537 addr-list = quoted-addr *(SLASH quoted-addr) 8538 quoted-addr = DQ (host-port / extension-addr) DQ 8539 host-port = ( host [":" port] ) 8540 / ( ":" port ) 8541 extension-addr = 1*qdtext 8542 host = < As defined in RFC 3986> 8543 port = < As defined in RFC 3986> 8544 Unsupported = "Unsupported" HCOLON feature-tag-list 8546 User-Agent = "User-Agent" HCOLON ( product / comment ) 8547 *(LWS (product / comment)) 8549 Vary = "Vary" HCOLON ( "*" / field-name-list) 8550 field-name-list = field-name *(COMMA field-name) 8551 field-name = token 8552 Via = "Via" HCOLON via-parm *(COMMA via-parm) 8553 via-parm = sent-protocol LWS sent-by *( SEMI via-params ) 8554 via-params = via-ttl / via-maddr 8555 / via-received / via-branch 8556 / via-extension 8557 via-ttl = "ttl" EQUAL ttl 8558 via-maddr = "maddr" EQUAL host 8559 via-received = "received" EQUAL (IPv4address / IPv6address) 8560 IPv4address = < As defined in RFC 3986> 8561 IPv6address = < As defined in RFC 3986> 8562 via-branch = "branch" EQUAL token 8563 via-extension = generic-param 8564 sent-protocol = protocol-name SLASH protocol-version 8565 SLASH transport-prot 8566 protocol-name = "RTSP" / token 8567 protocol-version = token 8568 transport-prot = "UDP" / "TCP" / "TLS" / other-transport 8569 other-transport = token 8570 sent-by = host [ COLON port ] 8572 WWW-Authenticate = "WWW-Authenticate" HCOLON challenge-list 8574 20.3. SDP extension Syntax 8576 This section defines in ABNF the SDP extensions defined for RTSP. 8577 See Appendix D for the definition of the extensions in text. 8579 control-attribute = "a=control:" *SP RTSP-REQ-Ref 8581 a-range-def = "a=range:" ranges-spec CRLF 8583 a-mtag-def = "a=mtag:" message-tag CRLF 8585 21. Security Considerations 8587 Because of the similarity in syntax and usage between RTSP servers 8588 and HTTP servers, the security considerations outlined in [H15] apply 8589 also. 8591 Specifically, please note the following: 8593 Abuse of Server Log Information: RTSP and HTTP servers will 8594 presumably have similar logging mechanisms, and thus should be 8595 equally guarded in protecting the contents of those logs, thus 8596 protecting the privacy of the users of the servers. See 8597 [H15.1.1] for HTTP server recommendations regarding server 8598 logs. 8600 Transfer of Sensitive Information: There is no reason to believe 8601 that information transferred or controlled via RTSP may be any 8602 less sensitive than that normally transmitted via HTTP. 8603 Therefore, all of the precautions regarding the protection of 8604 data privacy and user privacy apply to implementors of RTSP 8605 clients, servers, and proxies. See [H15.1.2] for further 8606 details. 8608 Attacks Based On File and Path Names: Though RTSP URIs are opaque 8609 handles that do not necessarily have file system semantics, it 8610 is anticipated that many implementations will translate 8611 portions of the Request-URIs directly to file system calls. In 8612 such cases, file systems SHOULD follow the precautions outlined 8613 in [H15.5], such as checking for ".." in path components. 8615 Personal Information: RTSP clients are often privy to the same 8616 information that HTTP clients are (user name, location, etc.) 8617 and thus should be equally sensitive. See [H15.1] for further 8618 recommendations. 8620 Privacy Issues Connected to Accept Headers: Since may of the same 8621 "Accept" headers exist in RTSP as in HTTP, the same caveats 8622 outlined in [H15.1.4] with regards to their use should be 8623 followed. 8625 DNS Spoofing: Presumably, given the longer connection times 8626 typically associated to RTSP sessions relative to HTTP 8627 sessions, RTSP client DNS optimizations should be less 8628 prevalent. Nonetheless, the recommendations provided in 8629 [H15.3] are still relevant to any implementation which attempts 8630 to rely on a DNS-to-IP mapping to hold beyond a single use of 8631 the mapping. 8633 Location Headers and Spoofing: If a single server supports multiple 8634 organizations that do not trust each another, then it needs to 8635 check the values of Location and Content-Location header fields 8636 in responses that are generated under control of said 8637 organizations to make sure that they do not attempt to 8638 invalidate resources over which they have no authority. 8639 ([H15.4]) 8641 In addition to the recommendations in the current HTTP specification 8642 (RFC 2616 [RFC2616], as of this writing) and also of the previous 8643 RFC2068 [RFC2068], future HTTP specifications may provide additional 8644 guidance on security issues. 8646 The following are added considerations for RTSP implementations. 8648 Concentrated denial-of-service attack: The protocol offers the 8649 opportunity for a remote-controlled denial-of-service attack. 8650 See Section 21.1. 8652 Session hijacking: Since there is no or little relation between a 8653 transport layer connection and an RTSP session, it is possible 8654 for a malicious client to issue requests with random session 8655 identifiers which would affect unsuspecting clients. The 8656 server SHOULD use a large, random and non-sequential session 8657 identifier to minimize the possibility of this kind of attack. 8658 However, unless the RTSP signaling always are confidentiality 8659 protected, e.g. using TLS, an on-path attacker will be able to 8660 hijack a session. For real session security, client 8661 authentication needs to be performed. 8663 Authentication: Servers SHOULD implement both basic and digest 8664 [RFC2617] authentication. In environments requiring tighter 8665 security for the control messages, the transport layer 8666 mechanism TLS [RFC5246] SHOULD be used. 8668 Stream issues: RTSP only provides for stream control. Stream 8669 delivery issues are not covered in this section, nor in the 8670 rest of this draft. RTSP implementations will most likely rely 8671 on other protocols such as RTP, IP multicast, RSVP and IGMP, 8672 and should address security considerations brought up in those 8673 and other applicable specifications. 8675 Persistently suspicious behavior: RTSP servers SHOULD return error 8676 code 403 (Forbidden) upon receiving a single instance of 8677 behavior which is deemed a security risk. RTSP servers SHOULD 8678 also be aware of attempts to probe the server for weaknesses 8679 and entry points and MAY arbitrarily disconnect and ignore 8680 further requests clients which are deemed to be in violation of 8681 local security policy. 8683 Scope of Multicast: If RTSP is used to control the transmission of 8684 media onto a multicast network it is need to consider the scope 8685 that delivery has. RTSP supports the TTL Transport header 8686 parameter to indicate this scope. However, such scope control 8687 is risk as it may be set to large and distribute media beyond 8688 the intended scope. 8690 TLS through proxies: If one uses the possibility to connect TLS in 8691 multiple legs (Section 19.3 one really needs to be aware of the 8692 trust model. That procedure requires full faith and trust in 8693 all proxies that one allows to connect through. They are man 8694 in the middle and has access to all that goes on over the TLS 8695 connection. Thus it is important to consider if that trust 8696 model is acceptable in the actual application. 8698 Resource Exhaustion: As RTSP is a stateful protocol and establish 8699 resource usages on the server there is a clear possibility to 8700 attack the server by trying to overbook these resources to 8701 perform an denial of service attack. This attack can be both 8702 against ongoing sessions and to prevent others from 8703 establishing sessions. RTSP agents will need to have mechanism 8704 to prevent single peers from consuming extensive amounts of 8705 resources. 8707 21.1. Remote denial of Service Attack 8709 The attacker may initiate traffic flows to one or more IP addresses 8710 by specifying them as the destination in SETUP requests. While the 8711 attacker's IP address may be known in this case, this is not always 8712 useful in prevention of more attacks or ascertaining the attackers 8713 identity. Thus, an RTSP server MUST only allow client-specified 8714 destinations for RTSP-initiated traffic flows if the server has 8715 ensured that the specified destination address accepts receiving 8716 media through different security mechanisms. Security mechanisms 8717 that are acceptable in an increased generality are: 8719 o Verification of the client's identity, either against a database 8720 of known users using RTSP authentication mechanisms (preferably 8721 digest authentication or stronger) 8723 o A list of addresses that accept to be media destinations, 8724 especially considering user identity 8726 o Media path based verification 8728 The server SHOULD NOT allow the destination field to be set unless a 8729 mechanism exists in the system to authorize the request originator to 8730 direct streams to the recipient. It is preferred that this 8731 authorization be performed by the media recipient (destination) 8732 itself and the credentials passed along to the server. However, in 8733 certain cases, such as when recipient address is a multicast group, 8734 or when the recipient is unable to communicate with the server in an 8735 out-of-band manner, this may not be possible. In these cases the 8736 server may chose another method such as a server-resident 8737 authorization list to ensure that the request originator has the 8738 proper credentials to request stream delivery to the recipient. 8740 One solution that performs the necessary verification of acceptance 8741 of media suitable for unicast based delivery is the ICE based NAT 8742 traversal method described in [I-D.ietf-mmusic-rtsp-nat]. By using 8743 random passwords and username the probability of unintended 8744 indication as a valid media destination is very low. If the server 8745 include in its STUN requests a cookie (consisting of random material) 8746 that is the destination echo back the solution is also safe against 8747 having a off-path attacker being able to spoof the STUN checks. 8748 Leaving this solution vulnerable only to on-path attackers that can 8749 see the STUN requests go to the target of attack. 8751 For delivery to multicast addresses there is need for another 8752 solution which is not specified here. 8754 22. IANA Considerations 8756 This section sets up a number of registries for RTSP 2.0 that should 8757 be maintained by IANA. These registries are separate from any 8758 registries existing for RTSP 1.0. For each registry there is a 8759 description on what it is required to contain, what specification is 8760 needed when adding a entry with IANA, and finally the entries that 8761 this document needs to register. See also the Section 2.7 "Extending 8762 RTSP". There is also an IANA registration of two SDP attributes. 8764 The sections describing how to register an item uses some of the 8765 requirements level described in RFC 5226 [RFC5226], namely "First 8766 Come, First Served", "Expert Review, "Specification Required", and 8767 "Standards Action". 8769 In case a registry requires a contact person, the authors are the 8770 contact person for any entries created by this document. 8772 A registration request to IANA MUST contain the following 8773 information: 8775 o A name of the item to register according to the rules specified by 8776 the intended registry. 8778 o Indication of who has change control over the feature (for 8779 example, IETF, ISO, ITU-T, other international standardization 8780 bodies, a consortium, a particular company or group of companies, 8781 or an individual); 8783 o A reference to a further description, if available, for example 8784 (in decreasing order of preference) an RFC, a published standard, 8785 a published paper, a patent filing, a technical report, documented 8786 source code or a computer manual; 8788 o For proprietary features, contact information (postal and email 8789 address); 8791 22.1. Feature-tags 8793 22.1.1. Description 8795 When a client and server try to determine what part and functionality 8796 of the RTSP specification and any future extensions that its counter 8797 part implements there is need for a namespace. This registry 8798 contains named entries representing certain functionality. 8800 The usage of feature-tags is explained in Section 11 and 8801 Section 13.1. 8803 22.1.2. Registering New Feature-tags with IANA 8805 The registering of feature-tags is done on a first come, first served 8806 basis. 8808 The name of the feature MUST follow these rules: The name may be of 8809 any length, but SHOULD be no more than twenty characters long. The 8810 name MUST NOT contain any spaces, or control characters. The 8811 registration MUST indicate if the feature-tag applies to clients, 8812 servers, or proxies only or any combinations of these. Any 8813 proprietary feature MUST have as the first part of the name a vendor 8814 tag, which identifies the organization. The registry entries 8815 consists of the tag, a one paragraph description of what it 8816 represents, its applicability (server, client, proxy, any 8817 combination) and a reference to its specification where applicable. 8819 22.1.3. Registered entries 8821 The following feature-tags are in this specification defined and 8822 hereby registered. The change control belongs to the IETF. 8824 play.basic: The minimal implementation for delivery and playback 8825 operations according to this specification. Applies for both 8826 clients, servers and proxies. 8828 play.scale: Support of scale operations for media playback. Applies 8829 only for servers. 8831 play.speed: Support of the speed functionality for media delivery. 8832 Applies only for servers. 8834 setup.rtp.rtcp.mux Support of the RTP and RTCP multiplexing as 8835 discussed in Appendix C.1.6.4. Applies for both client and 8836 servers and any media caching proxy. 8838 This should be represented by IANA as table with the feature tags, 8839 contact person and their references. 8841 22.2. RTSP Methods 8843 22.2.1. Description 8845 What a method is, is described in section Section 13. Extending the 8846 protocol with new methods allow for totally new functionality. 8848 22.2.2. Registering New Methods with IANA 8850 A new method MUST be registered through an IETF Standards Action. 8851 The reason is that new methods may radically change the protocols 8852 behavior and purpose. 8854 A specification for a new RTSP method MUST consist of the following 8855 items: 8857 o A method name which follows the ABNF rules for methods. 8859 o A clear specification on what action and response a request with 8860 the method will result in. Which directions the method is used, 8861 C->S or S->C or both. How the use of headers, if any, modifies 8862 the behavior and effect of the method. 8864 o A list or table specifying which of the registered headers that 8865 are allowed to use with the method in request or/and response. 8867 o Describe how the method relates to network proxies. 8869 22.2.3. Registered Entries 8871 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 8872 GET_PARAMETER, OPTIONS, PAUSE, PLAY, PLAY_NOTIFY REDIRECT, SETUP, 8873 SET_PARAMETER, and TEARDOWN. The initial table of the registry is 8874 below provided. 8876 Method Directionality Reference 8877 ----------------------------------------------------- 8878 DESCRIBE C->S [RFCXXXX] 8879 GET_PARAMETER C->S, S->C [RFCXXXX] 8880 OPTIONS C->S, S->C [RFCXXXX] 8881 PAUSE C->S [RFCXXXX] 8882 PLAY C->S [RFCXXXX] 8883 PLAY_NOTIFY S->C [RFCXXXX] 8884 REDIRECT S->C [RFCXXXX] 8885 SETUP C->S [RFCXXXX] 8886 SET_PARAMETER C->S, S->C [RFCXXXX] 8887 TEARDOWN C->S, S->C [RFCXXXX] 8889 22.3. RTSP Status Codes 8891 22.3.1. Description 8893 A status code is the three digit numbers used to convey information 8894 in RTSP response messages, seeSection 8. The number space is limited 8895 and care should be taken not to fill the space. 8897 22.3.2. Registering New Status Codes with IANA 8899 A new status code registrations follows the policy of IETF Review. A 8900 specification for a new status code MUST specify the following: 8902 o The requested number. 8904 o A description what the status code means and the expected behavior 8905 of the sender and receiver of the code. 8907 22.3.3. Registered Entries 8909 RFCXXXX, registers the numbered status code defined in the ABNF entry 8910 "Status-Code" except "extension-code" (that defines the syntax 8911 allowed for future extensions) in Section 20.2.2. 8913 22.4. RTSP Headers 8915 22.4.1. Description 8917 By specifying new headers a method(s) can be enhanced in many 8918 different ways. An unknown header will be ignored by the receiving 8919 agent. If the new header is vital for a certain functionality, a 8920 feature-tag for the functionality can be created and demanded to be 8921 used by the counter-part with the inclusion of a Require header 8922 carrying the feature-tag. 8924 22.4.2. Registering New Headers with IANA 8926 Registrations in the registry can be done following the Expert Review 8927 policy. A specification SHOULD be provided, preferable an IETF RFC 8928 or other Standards Developing Organization specification. The 8929 minimal information in a registration request is the header name and 8930 the contact information. 8932 The specification SHOULD contain the following information: 8934 o The name of the header. 8936 o An ABNF specification of the header syntax. 8938 o A list or table specifying when the header may be used, 8939 encompassing all methods, their request or response, the direction 8940 (C->S or S->C). 8942 o How the header is to be handled by proxies. 8944 o A description of the purpose of the header. 8946 22.4.3. Registered entries 8948 All headers specified in Section 16 in RFCXXXX are to be registered. 8949 The Registry is to include header name, description, and reference. 8951 Furthermore the following RTSP headers defined in other 8952 specifications are registered: 8954 o x-wap-profile defined in [3gpp-26234]. 8956 o x-wap-profile-diff defined in [3gpp-26234]. 8958 o x-wap-profile-warning defined in [3gpp-26234]. 8960 o x-predecbufsize defined in [3gpp-26234]. 8962 o x-initpredecbufperiod defined in [3gpp-26234]. 8964 o x-initpostdecbufperiod defined in [3gpp-26234]. 8966 o 3gpp-videopostdecbufsize defined in [3gpp-26234]. 8968 o 3GPP-Link-Char defined in [3gpp-26234]. 8970 o 3GPP-Adaptation defined in [3gpp-26234]. 8972 o 3GPP-QoE-Metrics defined in [3gpp-26234]. 8974 o 3GPP-QoE-Feedback defined in [3gpp-26234]. 8976 The use of "x-" is NOT RECOMMENDED but the above headers in the 8977 register list was defined prior to the clarification. 8979 22.5. Accept-Credentials 8981 The security framework's TLS connection mechanism has two registrable 8982 entities. 8984 22.5.1. Accept-Credentials policies 8986 In Section 19.3.1 three policies for how to handle certificates are 8987 specified. Further policies may be defined and MUST be registered 8988 with IANA using the following rules: 8990 o Registering requires an IETF Standards Action 8991 o A registration is required to name a contact person. 8993 o Name of the policy. 8995 o A describing text that explains how the policy works for handling 8996 the certificates. 8998 This specification registers the following values: 9000 Any 9002 Proxy 9004 User 9006 22.5.2. Accept-Credentials hash algorithms 9008 The Accept-Credentials header (See Section 16.2) allows for the usage 9009 of other algorithms for hashing the DER records of accepted entities. 9010 The registration of any future algorithm is expected to be extremely 9011 rare and could also cause interoperability problems. Therefore the 9012 bar for registering new algorithms is intentionally placed high. 9014 Any registration of a new hash algorithm MUST fulfill the following 9015 requirement: 9017 o Follow the IETF Standards Action policy. 9019 o A definition of the algorithm and its identifier meeting the 9020 "token" ABNF requirement. 9022 The registered value is: 9023 Hash Alg. Id Reference 9024 ------------------------ 9025 sha-256 [RFCXXXX] 9027 22.6. Cache-Control Cache Directive Extensions 9029 There exist a number of cache directives which can be sent in the 9030 Cache-Control header. A registry for these cache directives MUST be 9031 defined with the following rules: 9033 o Registering requires an IETF Standards Action or IESG Approval. 9035 o A registration is required to contain a contact person. 9037 o Name of the directive and a definition of the value, if any. 9039 o Specification if it is an request or response directive. 9041 o A describing text that explains how the cache directive is used 9042 for RTSP controlled media streams. 9044 This specification registers the following values: 9046 no-cache: 9048 public: 9050 private: 9052 no-transform: 9054 only-if-cached: 9056 max-stale: 9058 min-fresh: 9060 must-revalidate: 9062 proxy-revalidate: 9064 max-age: 9066 The registry should be represented as: Name of the directive, contact 9067 person and reference. 9069 22.7. Media Properties 9071 22.7.1. Description 9073 The media streams being controlled by RTSP can have many different 9074 properties. The media properties required to cover the use cases 9075 that was in mind when writing the specification are defined. 9076 However, it can be expected that further innovation will result in 9077 new use cases or media streams with properties not covered by the 9078 ones specified here. Thus new media properties can be specified. As 9079 new media properties may need a substantial amount of new definitions 9080 to correctly specify behavior for this property the bar is intended 9081 to be high. 9083 22.7.2. Registration Rules 9085 Registering new media property MUST fulfill the following 9086 requirements 9087 o Follow the Specification Required policy and get the approval of 9088 the designated Expert. 9090 o Have an ABNF definition of the media property value name that 9091 meets "media-prop-ext" definition 9093 o A Contact Person for the Registration 9095 o Description of all changes to the behavior of the RTSP protocol as 9096 result of these changes. 9098 22.7.3. Registered Values 9100 This specification registers the 9 values listed in Section 16.28. 9101 The registry should be represented as: Name of the media property, 9102 contact person and reference. 9104 22.8. Notify-Reason header 9106 22.8.1. Description 9108 Notify-Reason values are used for indicating the reason the 9109 notification was sent. Each reason has its associated rules on what 9110 headers and information that may or must be included in the 9111 notification. New notification behaviors need to be specified to 9112 enable interoperable usage, thus a specification of each new value is 9113 required. 9115 22.8.2. Registration Rules 9117 Registrations for new Notify-Reason value MUST fulfill the following 9118 requirements 9120 o Follow the Specification Required policy and get the approval of 9121 the designated Expert. 9123 o Have a ABNF definition of the Notify reason value name that meets 9124 "Notify-Reason-extension" definition 9126 o A Contact Person for the Registration 9128 o Description of which headers shall be included in the request and 9129 response, when it should be sent, and any effect it has on the 9130 server client state. 9132 22.8.3. Registered Values 9134 This specification registers 3 values defined in the Notify-Reas-val 9135 ABNFSection 20.2.3: 9137 o end-of-stream 9139 o media-properties-update 9141 o scale-change 9143 The registry entries should be represented in the registry as: Name, 9144 short description, contact and reference. 9146 22.9. Range header formats 9148 22.9.1. Description 9150 The Range header (Section 16.38) allows for different range formats. 9151 New ones may be registered, but moderation should be applied as it 9152 makes interoperability more difficult. 9154 22.9.2. Registration Rules 9156 A registration MUST fulfill the following requirements: 9158 o Follow the Specification Required policy. 9160 o An ABNF definition of the range format that fulfills the "range- 9161 ext" definition. 9163 o A Contact person for the registration. 9165 o Rules for how one handles the range when using a negative Scale. 9167 22.9.3. Registered Values 9169 The registry should be represented as: Name of the range format, 9170 contact person and reference. This specification registers the 9171 following values. 9173 npt: Normal Play Time 9175 clock: UTC Clock format 9176 smpte: SMPTE Timestamps 9178 22.10. Terminate-Reason Header 9180 The Terminate-Reason header (Section 16.50) has two registries for 9181 extensions. 9183 22.10.1. Redirect Reasons 9185 Registrations are done under the policy of Expert Review. The 9186 registered value needs to follow syntax, i.e. be a token. The 9187 specification needs to provide definition of what the procedures that 9188 is to be followed when a client receives this redirect reason. This 9189 specification registers two values: 9191 o Session-Timeout 9193 o Server-Admin 9195 The registry should be represented as: Name of the Redirect Reason, 9196 contact person and reference. 9198 22.10.2. Terminate-Reason Header Parameters 9200 Registrations are done under the policy of Specification Required. 9201 The registrations must define a syntax for the parameter that also 9202 follows the allowed by the RTSP 2.0 specification. A contact person 9203 is also required. This specification registers: 9205 o time 9207 o user-msg 9209 The registry should be represented as: Name of the Terminate Reason, 9210 contact person and reference. 9212 22.11. RTP-Info header parameters 9214 22.11.1. Description 9216 The RTP-Info header (Section 16.43) carries one or more parameter 9217 value pairs with information about a particular point in the RTP 9218 stream. RTP extensions or new usages may need new types of 9219 information. As RTP information that could be needed is likely to be 9220 generic enough and to maximize the interoperability registration 9221 requires specification required. 9223 22.11.2. Registration Rules 9225 Registrations for new Notify-Reason value MUST fulfill the following 9226 requirements 9228 o Follow the Specification Required policy and get the approval of 9229 the designated Expert. 9231 o Have a ABNF definition that meets the "generic-param" definition 9233 o A Contact Person for the Registration 9235 22.11.3. Registered Values 9237 This specification registers 2 parameter value pairs: 9239 o seq 9241 o rtptime 9243 The registry should be represented as: Name of the parameter, contact 9244 person and reference. 9246 22.12. Seek-Style Policies 9248 22.12.1. Description 9250 New seek policies may be registered, however, a large number of these 9251 will complicate implementation substantially. The impact of unknown 9252 policies is that the server will not honor the unknown and use the 9253 server default policy instead. 9255 22.12.2. Registration Rules 9257 Registrations of new Seek-Style polices MUST fulfill the following 9258 requirements 9260 o Follow the Specification Required policy. 9262 o Have a ABNF definition of the Seek-Style policy name that meets 9263 "Seek-S-value-ext" definition 9265 o A Contact Person for the Registration 9267 o Description of which headers shall be included in the request and 9268 response, when it should be sent, and any affect it has on the 9269 server client state. 9271 22.12.3. Registered Values 9273 This specification registers 4 values: 9275 o RAP 9277 o CoRAP 9279 o First-Prior 9281 o Next 9283 The registry should be represented as: Name of the Seek-Style Policy, 9284 short description, contact person and reference. 9286 22.13. Transport Header Registries 9288 The transport header contains a number of parameters which have 9289 possibilities for future extensions. Therefore registries for these 9290 needs to be defined. 9292 22.13.1. Transport Protocol Specification 9294 A registry for the parameter transport-protocol specification MUST be 9295 defined with the following rules: 9297 o Registering uses the policy of Specification Required. 9299 o A contact person or organization with address and email. 9301 o A value definition that are following the ABNF syntax definition 9302 of "transport-id" Section 20.2.3. 9304 o A describing text that explains how the registered value are used 9305 in RTSP. 9307 The registry should be represented as: The protocol ID string, 9308 contact person and reference. 9310 This specification registers the following values: 9312 RTP/AVP: Use of the RTP[RFC3550] protocol for media transport in 9313 combination with the "RTP profile for audio and video 9314 conferences with minimal control"[RFC3551] over UDP. The usage 9315 is explained in RFC XXXX, Appendix C.1. 9317 RTP/AVP/UDP: the same as RTP/AVP. 9319 RTP/AVPF: Use of the RTP[RFC3550] protocol for media transport in 9320 combination with the "Extended RTP Profile for RTCP-based 9321 Feedback (RTP/AVPF)" [RFC4585] over UDP. The usage is 9322 explained in RFC XXXX, Appendix C.1. 9324 RTP/AVPF/UDP: the same as RTP/AVPF. 9326 RTP/SAVP: Use of the RTP[RFC3550] protocol for media transport in 9327 combination with the "The Secure Real-time Transport Protocol 9328 (SRTP)" [RFC3711] over UDP. The usage is explained in RFC 9329 XXXX, Appendix C.1. 9331 RTP/SAVP/UDP: the same as RTP/SAVP. 9333 RTP/SAVPF: Use of the RTP[RFC3550] protocol for media transport in 9334 combination with the "[RFC5124] over UDP. The usage is 9335 explained in RFC XXXX, Appendix C.1. 9337 RTP/SAVPF/UDP: the same as RTP/SAVPF. 9339 RTP/AVP/TCP: Use of the RTP[RFC3550] protocol for media transport in 9340 combination with the "RTP profile for audio and video 9341 conferences with minimal control"[RFC3551] over TCP. The usage 9342 is explained in RFC XXXX, Appendix C.2.2. 9344 RTP/AVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9345 in combination with the "Extended RTP Profile for RTCP-based 9346 Feedback (RTP/AVPF)"[RFC4585] over TCP. The usage is explained 9347 in RFC XXXX, Appendix C.2.2. 9349 RTP/SAVP/TCP: Use of the RTP[RFC3550] protocol for media transport 9350 in combination with the "The Secure Real-time Transport 9351 Protocol (SRTP)" [RFC3711] over TCP. The usage is explained in 9352 RFC XXXX, Appendix C.2.2. 9354 RTP/SAVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9355 in combination with the "[RFC5124] over TCP. The usage is 9356 explained in RFC XXXX, Appendix C.2.2. 9358 22.13.2. Transport modes 9360 A registry for the transport parameter mode MUST be defined with the 9361 following rules: 9363 o Registering requires an IETF Standards Action. 9365 o A contact person or organization with address and email. 9367 o A value definition that are following the ABNF "token" definition 9368 Section 20.2.3. 9370 o A describing text that explains how the registered value are used 9371 in RTSP. 9373 This specification registers 1 value: 9375 PLAY: See RFC XXXX. 9377 22.13.3. Transport Parameters 9379 A registry for parameters that may be included in the Transport 9380 header MUST be defined with the following rules: 9382 o Registering uses the Specification Required policy. 9384 o A value definition that are following the ABNF "token" definition 9385 Section 20.2.3. 9387 o A describing text that explains how the registered value are used 9388 in RTSP. 9390 This specification registers all the transport parameters defined in 9391 Section 16.52. 9393 22.14. URI Schemes 9395 This specification defines two URI schemes ("rtsp" and "rtsps") and 9396 reserves a third one ("rtspu"). Registrations are following RFC 9397 4395[RFC4395]. 9399 22.14.1. The rtsp URI Scheme 9401 URI scheme name: rtsp 9403 Status: Permanent 9405 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9407 URI scheme semantics: The rtsp scheme is used to indicate resources 9408 accessible through the usage of the Real-time Streaming 9409 Protocol (RTSP). RTSP allows different operations on the 9410 resource identified by the URI, but the primary purpose is the 9411 streaming delivery of the resource to a client. However, the 9412 operations that are currently defined are: Describing the 9413 resource for the purpose of configuring the receiving agent 9414 (DESCRIBE), configuring the delivery method and its addressing 9415 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9416 setting of resource related parameters (SET_PARAMETER and 9417 GET_PARAMETER, and termination of the session context created 9418 (TEARDOWN). 9420 Encoding considerations: IRIs in this scheme are defined and needs 9421 to be encoded as RTSP URIs when used within the RTSP protocol. 9422 That encoding is done according to RFC 3987. 9424 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9425 2326), RTSP 2.0 (RFC XXXX) 9427 Interoperability considerations: The change in URI syntax performed 9428 between RTSP 1.0 and 2.0 can create interoperability issues. 9430 Security considerations: All the security threats identified in 9431 Section 7 of RFC 3986 applies also to this scheme. They need 9432 to be reviewed and considered in any implementation utilizing 9433 this scheme. 9435 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9437 Author/Change controller: IETF 9439 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9441 22.14.2. The rtsps URI Scheme 9443 URI scheme name: rtsps 9445 Status: Permanent 9447 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9449 URI scheme semantics: The rtsps scheme is used to indicate resources 9450 accessible through the usage of the Real-time Streaming 9451 Protocol (RTSP) over TLS. RTSP allows different operations on 9452 the resource identified by the URI, but the primary purpose is 9453 the streaming delivery of the resource to a client. However, 9454 the operations that are currently defined are: Describing the 9455 resource for the purpose of configuring the receiving agent 9456 (DESCRIBE), configuring the delivery method and its addressing 9457 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9458 setting of resource related parameters (SET_PARAMETER and 9459 GET_PARAMETER, and termination of the session context created 9460 (TEARDOWN). 9462 Encoding considerations: IRIs in this scheme are defined and needs 9463 to be encoded as RTSP URIs when used within the RTSP protocol. 9464 That encoding is done according to RFC 3987. 9466 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9467 2326), RTSP 2.0 (RFC XXXX) 9469 Interoperability considerations: The change in URI syntax performed 9470 between RTSP 1.0 and 2.0 can create interoperability issues. 9472 Security considerations: All the security threats identified in 9473 Section 7 of RFC 3986 applies also to this scheme. They need 9474 to be reviewed and considered in any implementation utilizing 9475 this scheme. 9477 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9479 Author/Change controller: IETF 9481 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9483 22.14.3. The rtspu URI Scheme 9485 URI scheme name: rtspu 9487 Status: Permanent 9489 URI scheme syntax: See Section 3.2 of RFC 2326. 9491 URI scheme semantics: The rtspu scheme is used to indicate resources 9492 accessible through the usage of the Real-time Streaming 9493 Protocol (RTSP) over unreliable datagram transport. RTSP 9494 allows different operations on the resource identified by the 9495 URI, but the primary purpose is the streaming delivery of the 9496 resource to a client. However, the operations that are 9497 currently defined are: Describing the resource for the purpose 9498 of configuring the receiving agent (DESCRIBE), configuring the 9499 delivery method and its addressing (SETUP), controlling the 9500 delivery (PLAY and PAUSE), reading or setting of resource 9501 related parameters (SET_PARAMETER and GET_PARAMETER, and 9502 termination of the session context created (TEARDOWN). 9504 Encoding considerations: IRIs in this scheme are not defined. 9506 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9507 2326) 9509 Interoperability considerations: The definition of the transport 9510 mechanism of RTSP over UDP has interoperability issues. That 9511 makes the usage of this scheme problematic. 9513 Security considerations: All the security threats identified in 9514 Section 7 of RFC 3986 applies also to this scheme. They needs 9515 to be reviewed and considered in any implementation utilizing 9516 this scheme. 9518 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9520 Author/Change controller: IETF 9522 References: RFC 2326 9524 22.15. SDP attributes 9526 This specification defines three SDP [RFC4566] attributes that it is 9527 requested that IANA register. 9529 SDP Attribute ("att-field"): 9531 Attribute name: range 9532 Long form: Media Range Attribute 9533 Type of name: att-field 9534 Type of attribute: Media and session level 9535 Subject to charset: No 9536 Purpose: RFC XXXX 9537 Reference: RFC XXXX, RFC 2326 9538 Values: See ABNF definition. 9540 Attribute name: control 9541 Long form: RTSP control URI 9542 Type of name: att-field 9543 Type of attribute: Media and session level 9544 Subject to charset: No 9545 Purpose: RFC XXXX 9546 Reference: RFC XXXX, RFC 2326 9547 Values: Absolute or Relative URIs. 9549 Attribute name: mtag 9550 Long form: Message Tag 9551 Type of name: att-field 9552 Type of attribute: Media and session level 9553 Subject to charset: No 9554 Purpose: RFC XXXX 9555 Reference: RFC XXXX 9556 Values: See ABNF definition 9558 22.16. Media Type Registration for text/parameters 9560 Type name: text 9562 Subtype name: parameters 9564 Required parameters: 9566 Optional parameters: 9568 Encoding considerations: 9570 Security considerations: This format may carry any type of 9571 parameters. Some can clear have security requirements, like 9572 privacy, confidentiality or integrity requirements. The format 9573 has no built in security protection. For the usage it was defined 9574 the transport can be protected between server and client using 9575 TLS. However, care must be take to consider if also the proxies 9576 are trusted with the parameters in case hop-by-hop security is 9577 used. If stored as file in file system the necessary precautions 9578 needs to be taken in relation to the parameters requirements 9579 including object security such as S/MIME [RFC3851]. 9581 Interoperability considerations: This media type was mentioned as a 9582 fictional example in RFC 2326 but was not formally specified. 9583 This have resulted in usage of this media type which may not match 9584 its formal definition. 9586 Published specification: RFC XXXX, Appendix F. 9588 Applications that use this media type: Applications that use RTSP 9589 and have additional parameters they like to read and set using the 9590 RTSP GET_PARAMETER and SET_PARAMETER methods. 9592 Additional information: 9594 Magic number(s): 9596 File extension(s): 9598 Macintosh file type code(s): 9600 Person & email address to contact for further information: Magnus 9601 Westerlund (magnus.westerlund@ericsson.com) 9603 Intended usage: Common 9605 Restrictions on usage: None 9607 Author: Magnus Westerlund (magnus.westerlund@ericsson.com) 9609 Change controller: IETF 9611 Addition Notes: 9613 23. References 9615 23.1. Normative References 9617 [3gpp-26234] 9618 Third Generation Partnership Project (3GPP), "Transparent 9619 end-to-end Packet-switched Streaming Service (PSS); 9620 Protocols and codecs; Technical Specification 26.234", 9621 December 2002. 9623 [FIPS-pub-180-2] 9624 National Institute of Standards and Technology (NIST), 9625 "Federal Information Processing Standards Publications 9626 (FIPS PUBS) 180-2: Secure Hash Standard", August 2002. 9628 [I-D.ietf-avt-rtp-and-rtcp-mux] 9629 Perkins, C. and M. Westerlund, "Multiplexing RTP Data and 9630 Control Packets on a Single Port", 9631 draft-ietf-avt-rtp-and-rtcp-mux-07 (work in progress), 9632 August 2007. 9634 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 9635 August 1980. 9637 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 9638 RFC 793, September 1981. 9640 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 9641 Requirement Levels", BCP 14, RFC 2119, March 1997. 9643 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 9644 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 9645 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 9647 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 9648 Leach, P., Luotonen, A., and L. Stewart, "HTTP 9649 Authentication: Basic and Digest Access Authentication", 9650 RFC 2617, June 1999. 9652 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 9654 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 9655 Jacobson, "RTP: A Transport Protocol for Real-Time 9656 Applications", STD 64, RFC 3550, July 2003. 9658 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 9659 Video Conferences with Minimal Control", STD 65, RFC 3551, 9660 July 2003. 9662 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 9663 10646", STD 63, RFC 3629, November 2003. 9665 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 9666 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 9667 RFC 3711, March 2004. 9669 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 9670 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 9671 August 2004. 9673 [RFC3851] Ramsdell, B., "Secure/Multipurpose Internet Mail 9674 Extensions (S/MIME) Version 3.1 Message Specification", 9675 RFC 3851, July 2004. 9677 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 9678 Resource Identifier (URI): Generic Syntax", STD 66, 9679 RFC 3986, January 2005. 9681 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 9682 Identifiers (IRIs)", RFC 3987, January 2005. 9684 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 9685 Requirements for Security", BCP 106, RFC 4086, June 2005. 9687 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 9688 Registration Procedures", BCP 13, RFC 4288, December 2005. 9690 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 9691 Architecture", RFC 4291, February 2006. 9693 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 9694 Registration Procedures for New URI Schemes", BCP 35, 9695 RFC 4395, February 2006. 9697 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 9698 Description Protocol", RFC 4566, July 2006. 9700 [RFC4567] Arkko, J., Lindholm, F., Naslund, M., Norrman, K., and E. 9701 Carrara, "Key Management Extensions for Session 9702 Description Protocol (SDP) and Real Time Streaming 9703 Protocol (RTSP)", RFC 4567, July 2006. 9705 [RFC4571] Lazzaro, J., "Framing Real-time Transport Protocol (RTP) 9706 and RTP Control Protocol (RTCP) Packets over Connection- 9707 Oriented Transport", RFC 4571, July 2006. 9709 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 9710 "Extended RTP Profile for Real-time Transport Control 9711 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 9712 July 2006. 9714 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 9715 Encodings", RFC 4648, October 2006. 9717 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 9718 Real-time Transport Control Protocol (RTCP)-Based Feedback 9719 (RTP/SAVPF)", RFC 5124, February 2008. 9721 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 9722 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 9723 May 2008. 9725 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 9726 Specifications: ABNF", STD 68, RFC 5234, January 2008. 9728 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 9729 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 9731 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 9732 Housley, R., and W. Polk, "Internet X.509 Public Key 9733 Infrastructure Certificate and Certificate Revocation List 9734 (CRL) Profile", RFC 5280, May 2008. 9736 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 9737 Languages", BCP 47, RFC 5646, September 2009. 9739 23.2. Informative References 9741 [I-D.ietf-mmusic-rtsp-nat] 9742 Goldberg, J., Westerlund, M., and T. Zeng, "A Network 9743 Address Translator (NAT) Traversal mechanism for media 9744 controlled by Real-Time Streaming Protocol (RTSP)", 9745 draft-ietf-mmusic-rtsp-nat-09 (work in progress), 9746 January 2010. 9748 [ISO.13818-6.1995] 9749 International Organization for Standardization, 9750 "Information technology - Generic coding of moving 9751 pictures and associated audio information - part 6: 9752 Extension for digital storage media and control", 9753 ISO Draft Standard 13818-6, November 1995. 9755 [ISO.8601.2000] 9756 International Organization for Standardization, "Data 9757 elements and interchange formats - Information interchange 9758 - Representation of dates and times", ISO/IEC Standard 9759 8601, December 2000. 9761 [RFC0822] Crocker, D., "Standard for the format of ARPA Internet 9762 text messages", STD 11, RFC 822, August 1982. 9764 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 9765 and Support", STD 3, RFC 1123, October 1989. 9767 [RFC1305] Mills, D., "Network Time Protocol (Version 3) 9768 Specification, Implementation", RFC 1305, March 1992. 9770 [RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions 9771 Functional Specification", RFC 1644, July 1994. 9773 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 9774 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 9775 RFC 2068, January 1997. 9777 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 9778 Streaming Protocol (RTSP)", RFC 2326, April 1998. 9780 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 9781 Translator (NAT) Terminology and Considerations", 9782 RFC 2663, August 1999. 9784 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 9785 Announcement Protocol", RFC 2974, October 2000. 9787 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 9788 A., Peterson, J., Sparks, R., Handley, M., and E. 9789 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 9790 June 2002. 9792 [RFC3388] Camarillo, G., Eriksson, G., Holler, J., and H. 9793 Schulzrinne, "Grouping of Media Lines in the Session 9794 Description Protocol (SDP)", RFC 3388, December 2002. 9796 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 9797 the Session Description Protocol (SDP)", RFC 4145, 9798 September 2005. 9800 [RFC5583] Schierl, T. and S. Wenger, "Signaling Media Decoding 9801 Dependency in the Session Description Protocol (SDP)", 9802 RFC 5583, July 2009. 9804 [Stevens98] 9805 Stevens, W., "Unix Networking Programming - Volume 1, 9806 second edition", 1998. 9808 Appendix A. Examples 9810 This section contains several different examples trying to illustrate 9811 possible ways of using RTSP. The examples can also help with the 9812 understanding of how functions of RTSP work. However, remember that 9813 these are examples and the normative and syntax description in the 9814 other sections takes precedence. Please also note that many of the 9815 example contain syntax illegal line breaks to accommodate the 9816 formatting restriction that the RFC series impose. 9818 A.1. Media on Demand (Unicast) 9820 This is an example of media on demand streaming of a media stored in 9821 a container file. For purposes of this example, a container file is 9822 a storage entity in which multiple continuous media types pertaining 9823 to the same end-user presentation are present. In effect, the 9824 container file represents an RTSP presentation, with each of its 9825 components being RTSP controlled media streams. Container files are 9826 a widely used means to store such presentations. While the 9827 components are transported as independent streams, it is desirable to 9828 maintain a common context for those streams at the server end. 9830 This enables the server to keep a single storage handle open 9831 easily. It also allows treating all the streams equally in case 9832 of any priorization of streams by the server. 9834 It is also possible that the presentation author may wish to prevent 9835 selective retrieval of the streams by the client in order to preserve 9836 the artistic effect of the combined media presentation. Similarly, 9837 in such a tightly bound presentation, it is desirable to be able to 9838 control all the streams via a single control message using an 9839 aggregate URI. 9841 The following is an example of using a single RTSP session to control 9842 multiple streams. It also illustrates the use of aggregate URIs. In 9843 a container file it is also desirable to not write any URI parts 9844 which is not kept, when the container is distributed, like the host 9845 and most of the path element. Therefore this example also uses the 9846 "*" and relative URI in the delivered SDP. 9848 Also this presentation description (SDP) is not cachable, as the 9849 Expires header is set to an equal value with date indicating 9850 immediate expiration of its valididty. 9852 Client C requests a presentation from media server M. The movie is 9853 stored in a container file. The client has obtained an RTSP URI to 9854 the container file. 9856 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 9857 CSeq: 1 9858 User-Agent: PhonyClient/1.2 9860 M->C: RTSP/2.0 200 OK 9861 CSeq: 1 9862 Server: PhonyServer/1.0 9863 Date: Thu, 23 Jan 1997 15:35:06 GMT 9864 Content-Type: application/sdp 9865 Content-Length: 271 9866 Content-Base: rtsp://example.com/twister.3gp/ 9867 Expires: 24 Jan 1997 15:35:06 GMT 9869 v=0 9870 o=- 2890844256 2890842807 IN IP4 198.51.100.5 9871 s=RTSP Session 9872 i=An Example of RTSP Session Usage 9873 e=adm@example.com 9874 c=IN IP4 0.0.0.0 9875 a=control: * 9876 a=range: npt=0-0:10:34.10 9877 t=0 0 9878 m=audio 0 RTP/AVP 0 9879 a=control: trackID=1 9880 m=video 0 RTP/AVP 26 9881 a=control: trackID=4 9883 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 9884 CSeq: 2 9885 User-Agent: PhonyClient/1.2 9886 Require: play.basic 9887 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 9888 Accept-Ranges: NPT, SMPTE, UTC 9890 M->C: RTSP/2.0 200 OK 9891 CSeq: 2 9892 Server: PhonyServer/1.0 9893 Transport: RTP/AVP;unicast; ssrc=93CB001E; 9894 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 9895 src_addr="198.51.100.5:9000"/"198.51.100.5:9001" 9896 Session: 12345678 9897 Expires: 24 Jan 1997 15:35:12 GMT 9898 Date: 23 Jan 1997 15:35:12 GMT 9899 Accept-Ranges: NPT 9900 Media-Properties: Random-Access=0.02, Unmutable, Unlimited 9902 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 9903 CSeq: 3 9904 User-Agent: PhonyClient/1.2 9905 Require: play.basic 9906 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 9907 Session: 12345678 9908 Accept-Ranges: NPT, SMPTE, UTC 9910 M->C: RTSP/2.0 200 OK 9911 CSeq: 3 9912 Server: PhonyServer/1.0 9913 Transport: RTP/AVP;unicast; ssrc=A813FC13; 9914 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003"; 9915 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 9917 Session: 12345678 9918 Expires: 24 Jan 1997 15:35:13 GMT 9919 Date: 23 Jan 1997 15:35:13 GMT 9920 Accept-Range: NPT 9921 Media-Properties: Random-Access=0.8, Unmutable, Unlimited 9923 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 9924 CSeq: 4 9925 User-Agent: PhonyClient/1.2 9926 Range: npt=30- 9927 Seek-Style: RAP 9928 Session: 12345678 9930 M->C: RTSP/2.0 200 OK 9931 CSeq: 4 9932 Server: PhonyServer/1.0 9933 Date: 23 Jan 1997 15:35:14 GMT 9934 Session: 12345678 9935 Range: npt=30-623.10 9936 Seek-Style: RAP 9937 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 9938 ssrc=0D12F123:seq=12345;rtptime=3450012, 9939 url="rtsp://example.com/twister.3gp/trackID=1" 9940 ssrc=4F312DD8:seq=54321;rtptime=2876889 9942 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/2.0 9943 CSeq: 5 9944 User-Agent: PhonyClient/1.2 9945 Session: 12345678 9947 M->C: RTSP/2.0 200 OK 9948 CSeq: 5 9949 Server: PhonyServer/1.0 9950 Date: 23 Jan 1997 15:36:01 GMT 9951 Session: 12345678 9952 Range: npt=34.57-623.10 9954 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 9955 CSeq: 6 9956 User-Agent: PhonyClient/1.2 9957 Range: npt=34.57-623.10 9958 Seek-Style: Next 9959 Session: 12345678 9961 M->C: RTSP/2.0 200 OK 9962 CSeq: 6 9963 Server: PhonyServer/1.0 9964 Date: 23 Jan 1997 15:36:01 GMT 9965 Session: 12345678 9966 Range: npt=34.57-623.10 9967 Seek-Style: Next 9968 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 9969 ssrc=0D12F123:seq=12555;rtptime=6330012, 9970 url="rtsp://example.com/twister.3gp/trackID=1" 9971 ssrc=4F312DD8:seq=55021;rtptime=3132889 9973 C->M: TEARDOWN rtsp://example.com/twister.3gp/ RTSP/2.0 9974 CSeq: 7 9975 User-Agent: PhonyClient/1.2 9976 Session: 12345678 9978 M->C: RTSP/2.0 200 OK 9979 CSeq: 7 9980 Server: PhonyServer/1.0 9981 Date: 23 Jan 1997 15:49:34 GMT 9983 A.2. Media on Demand using Pipelining 9985 This example is basically the example above (Appendix A.1), but now 9986 utilizing pipelining to speed up the setup. It requires only two 9987 round trip times until the media starts flowing. First of all, the 9988 session description is retrieved to determine what media resources 9989 need to be setup. In the second step, one sends the necessary SETUP 9990 requests and the PLAY request to initiate media delivery. 9992 Client C requests a presentation from media server M. The movie is 9993 stored in a container file. The client has obtained an RTSP URI to 9994 the container file. 9996 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 9997 CSeq: 1 9998 User-Agent: PhonyClient/1.2 10000 M->C: RTSP/2.0 200 OK 10001 CSeq: 1 10002 Server: PhonyServer/1.0 10003 Date: Thu, 23 Jan 1997 15:35:06 GMT 10004 Content-Type: application/sdp 10005 Content-Length: 271 10006 Content-Base: rtsp://example.com/twister.3gp/ 10007 Expires: 24 Jan 1997 15:35:06 GMT 10009 v=0 10010 o=- 2890844256 2890842807 IN IP4 192.0.2.5 10011 s=RTSP Session 10012 i=An Example of RTSP Session Usage 10013 e=adm@example.com 10014 c=IN IP4 0.0.0.0 10015 a=control: * 10016 a=range: npt=0-0:10:34.10 10017 t=0 0 10018 m=audio 0 RTP/AVP 0 10019 a=control: trackID=1 10020 m=video 0 RTP/AVP 26 10021 a=control: trackID=4 10023 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10024 CSeq: 2 10025 User-Agent: PhonyClient/1.2 10026 Require: play.basic 10027 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10028 Accept-Ranges: NPT, SMPTE, UTC 10029 Pipelined-Requests: 7654 10031 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10032 CSeq: 3 10033 User-Agent: PhonyClient/1.2 10034 Require: play.basic 10035 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10036 Accept-Ranges: NPT, SMPTE, UTC 10037 Pipelined-Requests: 7654 10039 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10040 CSeq: 4 10041 User-Agent: PhonyClient/1.2 10042 Range: npt=0- 10043 Seek-Style: RAP 10044 Session: 12345678 10045 Pipelined-Requests: 7654 10047 M->C: RTSP/2.0 200 OK 10048 CSeq: 2 10049 Server: PhonyServer/1.0 10050 Transport: RTP/AVP;unicast; 10051 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10052 src_addr="198.51.100.5:9000"/"198.51.100.5:9001"; 10053 ssrc=93CB001E 10054 Session: 12345678 10055 Expires: 24 Jan 1997 15:35:12 GMT 10056 Date: 23 Jan 1997 15:35:12 GMT 10057 Accept-Ranges: NPT 10058 Pipelined-Requests: 7654 10059 Media-Properties: Random-Access=0.2, Unmutable, Unlimited 10061 M->C: RTSP/2.0 200 OK 10062 CSeq: 3 10063 Server: PhonyServer/1.0 10064 Transport: RTP/AVP;unicast; 10065 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003; 10066 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10067 ssrc=A813FC13 10068 Session: 12345678 10069 Expires: 24 Jan 1997 15:35:13 GMT 10070 Date: 23 Jan 1997 15:35:13 GMT 10071 Accept-Range: NPT 10072 Pipelined-Requests: 7654 10073 Media-Properties: Random-Access=0.8, Unmutable, Unlimited 10075 M->C: RTSP/2.0 200 OK 10076 CSeq: 4 10077 Server: PhonyServer/1.0 10078 Date: 23 Jan 1997 15:35:14 GMT 10079 Session: 12345678 10080 Range: npt=0-623.10 10081 Seek-Style: RAP 10082 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10083 ssrc=0D12F123:seq=12345;rtptime=3450012, 10084 url="rtsp://example.com/twister.3gp/trackID=1" 10085 ssrc=4F312DD8:seq=54321;rtptime=2876889 10086 Pipelined-Requests: 7654 10088 A.3. Media on Demand (Unicast) 10090 An alternative example of media on demand with a bit more tweaks is 10091 the following. Client C requests a movie distributed from two 10092 different media servers A (audio.example.com) and V ( 10093 video.example.com). The media description is stored on a web server 10094 W. The media description contains descriptions of the presentation 10095 and all its streams, including the codecs that are available, dynamic 10096 RTP payload types, the protocol stack, and content information such 10097 as language or copyright restrictions. It may also give an 10098 indication about the timeline of the movie. 10100 In this example, the client is only interested in the last part of 10101 the movie. 10103 C->W: GET /twister.sdp HTTP/1.1 10104 Host: www.example.com 10105 Accept: application/sdp 10107 W->C: HTTP/1.0 200 OK 10108 Date: Thu, 23 Jan 1997 15:35:06 GMT 10109 Content-Type: application/sdp 10110 Content-Length: 278 10111 Expires: 23 Jan 1998 15:35:06 GMT 10113 v=0 10114 o=- 2890844526 2890842807 IN IP4 198.51.100.5 10115 s=RTSP Session 10116 e=adm@example.com 10117 c=IN IP4 0.0.0.0 10118 a=range:npt=0-1:49:34 10119 t=0 0 10120 m=audio 0 RTP/AVP 0 10121 a=control:rtsp://audio.example.com/twister/audio.en 10122 m=video 0 RTP/AVP 31 10123 a=control:rtsp://video.example.com/twister/video 10125 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/2.0 10126 CSeq: 1 10127 User-Agent: PhonyClient/1.2 10128 Transport: RTP/AVP/UDP;unicast;dest_addr=":3056"/":3057", 10129 RTP/AVP/TCP;unicast;interleaved=0-1 10130 Accept-Ranges: NPT, SMPTE, UTC 10132 A->C: RTSP/2.0 200 OK 10133 CSeq: 1 10134 Session: 12345678 10135 Transport: RTP/AVP/UDP;unicast; 10136 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10137 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10138 Date: 23 Jan 1997 15:35:12 GMT 10139 Server: PhonyServer/1.0 10140 Expires: 24 Jan 1997 15:35:12 GMT 10141 Cache-Control: public 10142 Accept-Ranges: NPT, SMPTE 10143 Media-Properties: Random-Access=0.02, Unmutable, Unlimited 10145 C->V: SETUP rtsp://video.example.com/twister/video RTSP/2.0 10146 CSeq: 1 10147 User-Agent: PhonyClient/1.2 10148 Transport: RTP/AVP/UDP;unicast; 10149 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059", 10150 RTP/AVP/TCP;unicast;interleaved=0-1 10151 Accept-Ranges: NPT, SMPTE, UTC 10153 V->C: RTSP/2.0 200 OK 10154 CSeq: 1 10155 Session: 23456789 10156 Transport: RTP/AVP/UDP;unicast; 10157 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059"; 10158 src_addr="198.51.100.5:5002"/"198.51.100.5:5003" 10159 Date: 23 Jan 1997 15:35:12 GMT 10160 Server: PhonyServer/1.0 10161 Cache-Control: public 10162 Expires: 24 Jan 1997 15:35:12 GMT 10163 Accept-Ranges: NPT, SMPTE 10164 Media-Properties: Random-Access=1.2, Unmutable, Unlimited 10166 C->V: PLAY rtsp://video.example.com/twister/video RTSP/2.0 10167 CSeq: 2 10168 User-Agent: PhonyClient/1.2 10169 Session: 23456789 10170 Range: smpte=0:10:00- 10172 V->C: RTSP/2.0 200 OK 10173 CSeq: 2 10174 Session: 23456789 10175 Range: smpte=0:10:00-1:49:23 10176 Seek-Style: First-Prior 10177 RTP-Info: url="rtsp://video.example.com/twister/video" 10178 ssrc=A17E189D:seq=12312232;rtptime=78712811 10179 Server: PhonyServer/2.0 10180 Date: 23 Jan 1997 15:35:13 GMT 10182 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/2.0 10183 CSeq: 2 10184 User-Agent: PhonyClient/1.2 10185 Session: 12345678 10186 Range: smpte=0:10:00- 10188 A->C: RTSP/2.0 200 OK 10189 CSeq: 2 10190 Session: 12345678 10191 Range: smpte=0:10:00-1:49:23 10192 Seek-Style: First-Prior 10193 RTP-Info: url="rtsp://audio.example.com/twister/audio.en" 10194 ssrc=3D124F01:seq=876655;rtptime=1032181 10195 Server: PhonyServer/1.0 10196 Date: 23 Jan 1997 15:35:13 GMT 10198 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/2.0 10199 CSeq: 3 10200 User-Agent: PhonyClient/1.2 10201 Session: 12345678 10203 A->C: RTSP/2.0 200 OK 10204 CSeq: 3 10205 Server: PhonyServer/1.0 10206 Date: 23 Jan 1997 15:36:52 GMT 10208 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/2.0 10209 CSeq: 3 10210 User-Agent: PhonyClient/1.2 10211 Session: 23456789 10213 V->C: RTSP/2.0 200 OK 10214 CSeq: 3 10215 Server: PhonyServer/2.0 10216 Date: 23 Jan 1997 15:36:52 GMT 10218 Even though the audio and video track are on two different servers 10219 that may start at slightly different times and may drift with respect 10220 to each other over time, the client can perform initial 10221 synchronization of the two media using RTP-Info and Range received in 10222 the PLAY responses. If the two servers are time synchronized the 10223 RTCP packets can also be used to maintain synchronization. 10225 A.4. Single Stream Container Files 10227 Some RTSP servers may treat all files as though they are "container 10228 files", yet other servers may not support such a concept. Because of 10229 this, clients needs to use the rules set forth in the session 10230 description for Request-URIs, rather than assuming that a consistent 10231 URI may always be used throughout. Below are an example of how a 10232 multi-stream server might expect a single-stream file to be served: 10234 C->S: DESCRIBE rtsp://foo.example.com/test.wav RTSP/2.0 10235 Accept: application/x-rtsp-mh, application/sdp 10236 CSeq: 1 10237 User-Agent: PhonyClient/1.2 10239 S->C: RTSP/2.0 200 OK 10240 CSeq: 1 10241 Content-base: rtsp://foo.example.com/test.wav/ 10242 Content-type: application/sdp 10243 Content-length: 163 10244 Server: PhonyServer/1.0 10245 Date: Thu, 23 Jan 1997 15:35:06 GMT 10246 Expires: 23 Jan 1997 17:00:00 GMT 10248 v=0 10249 o=- 872653257 872653257 IN IP4 192.0.2.5 10250 s=mu-law wave file 10251 i=audio test 10252 c=IN IP4 0.0.0.0 10253 t=0 0 10254 a=control: * 10255 m=audio 0 RTP/AVP 0 10256 a=control:streamid=0 10258 C->S: SETUP rtsp://foo.example.com/test.wav/streamid=0 RTSP/2.0 10259 Transport: RTP/AVP/UDP;unicast; 10260 dest_addr=":6970"/":6971";mode="PLAY" 10261 CSeq: 2 10262 User-Agent: PhonyClient/1.2 10263 Accept-Ranges: NPT, SMPTE, UTC 10265 S->C: RTSP/2.0 200 OK 10266 Transport: RTP/AVP/UDP;unicast; 10267 dest_addr="192.0.2.53:6970"/"192.0.2.53:6971"; 10268 src_addr="198.51.100.5:6970"/"198.51.100.5:6971"; 10269 mode="PLAY";ssrc=EAB98712 10270 CSeq: 2 10271 Session: 2034820394 10272 Expires: 23 Jan 1997 16:00:00 GMT 10273 Server: PhonyServer/1.0 10274 Date: 23 Jan 1997 15:35:07 GMT 10275 Accept-Ranges: NPT 10276 Media-Properties: Random-Acces=0.5, Unmutable, Unlimited 10278 C->S: PLAY rtsp://foo.example.com/test.wav/ RTSP/2.0 10279 CSeq: 3 10280 User-Agent: PhonyClient/1.2 10281 Session: 2034820394 10283 S->C: RTSP/2.0 200 OK 10284 CSeq: 3 10285 Server: PhonyServer/1.0 10286 Date: 23 Jan 1997 15:35:08 GMT 10287 Session: 2034820394 10288 Range: npt=0-600 10289 Seek-Style: RAP 10290 RTP-Info: url="rtsp://foo.example.com/test.wav/streamid=0" 10291 ssrc=0D12F123:seq=981888;rtptime=3781123 10293 Note the different URI in the SETUP command, and then the switch back 10294 to the aggregate URI in the PLAY command. This makes complete sense 10295 when there are multiple streams with aggregate control, but is less 10296 than intuitive in the special case where the number of streams is 10297 one. However, the server has declared that the aggregated control 10298 URI in the SDP and therefore this is legal. 10300 In this case, it is also required that servers accept implementations 10301 that use the non-aggregated interpretation and use the individual 10302 media URI, like this: 10304 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/2.0 10305 CSeq: 3 10306 User-Agent: PhonyClient/1.2 10307 Session: 2034820394 10309 A.5. Live Media Presentation Using Multicast 10311 The media server M chooses the multicast address and port. Here, it 10312 is assumed that the web server only contains a pointer to the full 10313 description, while the media server M maintains the full description. 10315 C->W: GET /sessions.html HTTP/1.1 10316 Host: www.example.com 10318 W->C: HTTP/1.1 200 OK 10319 Content-Type: text/html 10321 10322 ... 10323 10325 ... 10326 10328 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/2.0 10329 CSeq: 1 10330 Supported: play.basic, play.scale 10331 User-Agent: PhonyClient/1.2 10333 M->C: RTSP/2.0 200 OK 10334 CSeq: 1 10335 Content-Type: application/sdp 10336 Content-Length: 183 10337 Server: PhonyServer/1.0 10338 Date: Thu, 23 Jan 1997 15:35:06 GMT 10339 Supported: play.basic 10341 v=0 10342 o=- 2890844526 2890842807 IN IP4 192.0.2.5 10343 s=RTSP Session 10344 t=0 0 10345 m=audio 3456 RTP/AVP 0 10346 c=IN IP4 233.252.0.54/16 10347 a=control: rtsp://live.example.com/concert/audio 10348 a=range:npt=0- 10350 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/2.0 10351 CSeq: 2 10352 Transport: RTP/AVP;multicast; 10353 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10354 Accept-Ranges: NPT, SMPTE, UTC 10355 User-Agent: PhonyClient/1.2 10357 M->C: RTSP/2.0 200 OK 10358 CSeq: 2 10359 Server: PhonyServer/1.0 10360 Date: Thu, 23 Jan 1997 15:35:06 GMT 10361 Transport: RTP/AVP;multicast; 10362 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10363 ;ssrc=4D12AB92/0DF876A3 10364 Session: 0456804596 10365 Accept-Ranges: NPT, UTC 10366 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0 10368 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/2.0 10369 CSeq: 3 10370 Session: 0456804596 10371 User-Agent: PhonyClient/1.2 10373 M->C: RTSP/2.0 200 OK 10374 CSeq: 3 10375 Server: PhonyServer/1.0 10376 Date: 23 Jan 1997 15:35:07 GMT 10377 Session: 0456804596 10378 Seek-Style: Next 10379 Range:npt=1256- 10380 RTP-Info: url="rtsp://live.example.com/concert/audio" 10381 ssrc=0D12F123:seq=1473; rtptime=80000 10383 A.6. Capability Negotiation 10385 This examples illustrate how the client and server determines their 10386 capability to support a special feature, in this case "play.scale". 10387 The server, through the clients request and the included Supported 10388 header, learns the client supports RTSP 2.0, and also supports the 10389 playback time scaling feature of RTSP. The server's response 10390 contains the following feature related information to the client; it 10391 supports the basic media delivery functions (play.basic), the 10392 extended functionality of time scaling of content (play.scale), and 10393 one "example.com" proprietary feature (com.example.flight). The 10394 client also learns the methods supported (Public header) by the 10395 server for the indicated resource. 10397 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/2.0 10398 CSeq: 1 10399 Supported: play.basic, play.scale 10400 User-Agent: PhonyClient/1.2 10402 S->C: RTSP/2.0 200 OK 10403 CSeq: 1 10404 Public: OPTIONS,SETUP,PLAY,PAUSE,TEARDOWN,DESCRIBE,GET_PARAMETER 10405 Allow: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, DESCRIBE 10406 Server: PhonyServer/2.0 10407 Supported: play.basic, play.scale, com.example.flight 10409 When the client sends its SETUP request it tells the server that it 10410 requires support of the play.scale feature for this session by 10411 including the Require header. 10413 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/2.0 10414 CSeq: 3 10415 User-Agent: PhonyClient/1.2 10416 Transport: RTP/AVP/UDP;unicast; 10417 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057", 10418 RTP/AVP/TCP;unicast;interleaved=0-1 10419 Require: play.scale 10420 Accept-Ranges: NPT, SMPTE, UTC 10421 User-Agent: PhonyClient/1.2 10423 S->C: RTSP/2.0 200 OK 10424 CSeq: 3 10425 Session: 12345678 10426 Transport: RTP/AVP/UDP;unicast; 10427 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10428 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10429 Server: PhonyServer/2.0 10430 Accept-Ranges: NPT, SMPTE 10431 Media-Properties: Random-Access=0.8, Unmutable, Unlimited 10433 Appendix B. RTSP Protocol State Machine 10435 The RTSP session state machine describes the behavior of the protocol 10436 from RTSP session initialization through RTSP session termination. 10438 The State machine is defined on a per session basis which is uniquely 10439 identified by the RTSP session identifier. The session may contain 10440 one or more media streams depending on state. If a single media 10441 stream is part of the session it is in non-aggregated control. If 10442 two or more is part of the session it is in aggregated control. 10444 The below state machine is a informative description of the protocols 10445 behavior. In case of ambiguity with the earlier parts of this 10446 specification, the description in the earlier parts take precedence. 10448 B.1. States 10450 The state machine contains three states, described below. For each 10451 state there exist a table which shows which requests and events that 10452 are allowed and if they will result in a state change. 10454 Init: Initial state no session exist. 10456 Ready: Session is ready to start playing. 10458 Play: Session is playing, i.e. sending media stream data in the 10459 direction S->C. 10461 B.2. State variables 10463 This representation of the state machine needs more than its state to 10464 work. A small number of variables are also needed and is explained 10465 below. 10467 NRM: The number of media streams part of this session. 10469 RP: Resume point, the point in the presentation time line at which 10470 a request to continue playing will resume from. A time format 10471 for the variable is not mandated. 10473 B.3. Abbreviations 10475 To make the state tables more compact a number of abbreviations are 10476 used, which are explained below. 10478 IFI: IF Implemented. 10480 md: Media 10482 PP: Pause Point, the point in the presentation time line at which 10483 the presentation was paused. 10485 Prs: Presentation, the complete multimedia presentation. 10487 RedP: Redirect Point, the point in the presentation time line at 10488 which a REDIRECT was specified to occur. 10490 SES: Session. 10492 B.4. State Tables 10494 This section contains a table for each state. The table contains all 10495 the requests and events that this state is allowed to act on. The 10496 events which is method names are, unless noted, requests with the 10497 given method in the direction client to server (C->S). In some cases 10498 there exist one or more requisite. The response column tells what 10499 type of response actions should be performed. Possible actions that 10500 is requested for an event includes: response codes, e.g. 200, headers 10501 that needs to be included in the response, setting of state 10502 variables, or setting of other session related parameters. The new 10503 state column tells which state the state machine changes to. 10505 The response to a valid request meeting the requisites is normally a 10506 2xx (SUCCESS) unless other noted in the response column. The 10507 exceptions need to be given a response according to the response 10508 column. If the request does not meet the requisite, is erroneous or 10509 some other type of error occur, the appropriate response code is to 10510 be sent. If the response code is a 4xx the session state is 10511 unchanged. A response code of 3rr will result in that the session is 10512 ended and its state is changed to Init. A response code of 304 10513 results in no state change. However, there exist restrictions to 10514 when a 3rr response may be used. A 5xx response does not result in 10515 any change of the session state, except if the error is not possible 10516 to recover from. A unrecoverable error results in the ending of the 10517 session. As it in the general case can't be determined if it was a 10518 unrecoverable error or not the client will be required to test. In 10519 the case that the next request after a 5xx is responded with 454 10520 (Session Not Found) the client knows that the session has ended. 10522 The server will timeout the session after the period of time 10523 specified in the SETUP response, if no activity from the client is 10524 detected. Therefore there exist a timeout event for all states 10525 except Init. 10527 In the case that NRM = 1 the presentation URI is equal to the media 10528 URI or a specified presentation URI. For NRM > 1 the presentation 10529 URI needs to be other than any of the medias that are part of the 10530 session. This applies to all states. 10532 +---------------+-----------------+---------------------------------+ 10533 | Event | Prerequisite | Response | 10534 +---------------+-----------------+---------------------------------+ 10535 | DESCRIBE | Needs REDIRECT | 3rr, Redirect | 10536 | | | | 10537 | DESCRIBE | | 200, Session description | 10538 | | | | 10539 | OPTIONS | Session ID | 200, Reset session timeout | 10540 | | | timer | 10541 | | | | 10542 | OPTIONS | | 200 | 10543 | | | | 10544 | SET_PARAMETER | Valid parameter | 200, change value of parameter | 10545 | | | | 10546 | GET_PARAMETER | Valid parameter | 200, return value of parameter | 10547 +---------------+-----------------+---------------------------------+ 10549 Table 13: None state-machine changing events 10551 The methods in Table 13 do not have any effect on the state machine 10552 or the state variables. However, some methods do change other 10553 session related parameters, for example SET_PARAMETER which will set 10554 the parameter(s) specified in its body. Also all of these methods 10555 that allows Session header will also update the keep-alive timer for 10556 the session. 10558 +------------------+----------------+-----------+-------------------+ 10559 | Action | Requisite | New State | Response | 10560 +------------------+----------------+-----------+-------------------+ 10561 | SETUP | | Ready | NRM=1, RP=0.0 | 10562 | | | | | 10563 | SETUP | Needs Redirect | Init | 3rr Redirect | 10564 | | | | | 10565 | S -> C: REDIRECT | No Session hdr | Init | Terminate all SES | 10566 +------------------+----------------+-----------+-------------------+ 10568 Table 14: State: Init 10570 The initial state of the state machine, see Table 14 can only be left 10571 by processing a correct SETUP request. As seen in the table the two 10572 state variables are also set by a correct request. This table also 10573 shows that a correct SETUP can in some cases be redirected to another 10574 URI and/or server by a 3rr response. 10576 +-------------+------------------------+---------+------------------+ 10577 | Action | Requisite | New | Response | 10578 | | | State | | 10579 +-------------+------------------------+---------+------------------+ 10580 | SETUP | New URI | Ready | NRM +=1 | 10581 | | | | | 10582 | SETUP | URI Setup prior | Ready | Change transport | 10583 | | | | param | 10584 | | | | | 10585 | TEARDOWN | Prs URI, | Init | No session hdr, | 10586 | | | | NRM = 0 | 10587 | | | | | 10588 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10589 | | | | NRM = 0 | 10590 | | | | | 10591 | TEARDOWN | md URI,NRM>1 | Ready | Session hdr, NRM | 10592 | | | | -= 1 | 10593 | | | | | 10594 | PLAY | Prs URI, No range | Play | Play from RP | 10595 | | | | | 10596 | PLAY | Prs URI, Range | Play | According to | 10597 | | | | range | 10598 | | | | | 10599 | PLAY | md URI, NRM=1, Range | Play | According to | 10600 | | | | range | 10601 | | | | | 10602 | PLAY | md URI, NRM=1 | Play | Play from RP | 10603 | | | | | 10604 | PAUSE | Prs URI | Ready | Return PP | 10605 | | | | | 10606 | SC:REDIRECT | Terminate-Reason | Ready | Set RedP | 10607 | | | | | 10608 | SC:REDIRECT | No Terminate-Reason | Init | Session is | 10609 | | time parameter | | removed | 10610 | | | | | 10611 | Timeout | | Init | | 10612 | | | | | 10613 | RedP | | Init | TEARDOWN of | 10614 | reached | | | session | 10615 +-------------+------------------------+---------+------------------+ 10617 Table 15: State: Ready 10619 In the Ready state, see Table 15, some of the actions are depending 10620 on the number of media streams (NRM) in the session, i.e. aggregated 10621 or non-aggregated control. A setup request in the ready state can 10622 either add one more media stream to the session or, if the media 10623 stream (same URI) already is part of the session, change the 10624 transport parameters. TEARDOWN is depending on both the Request-URI 10625 and the number of media stream within the session. If the Request- 10626 URI is the presentations URI the whole session is torn down. If a 10627 media URI is used in the TEARDOWN request and more than one media 10628 exist in the session, the session will remain and a session header is 10629 returned in the response. If only a single media stream remains in 10630 the session when performing a TEARDOWN with a media URI the session 10631 is removed. The number of media streams remaining after tearing down 10632 a media stream determines the new state. 10634 +----------------+-----------------------+--------+-----------------+ 10635 | Action | Requisite | New | Response | 10636 | | | State | | 10637 +----------------+-----------------------+--------+-----------------+ 10638 | PAUSE | Prs URI | Ready | Set RP to | 10639 | | | | present point | 10640 | | | | | 10641 | End of media | All media | Play | Set RP = End of | 10642 | | | | media | 10643 | | | | | 10644 | End of range | | Play | Set RP = End of | 10645 | | | | range | 10646 | | | | | 10647 | PLAY | Prs URI, No range | Play | Play from | 10648 | | | | present point | 10649 | | | | | 10650 | PLAY | Prs URI, Range | Play | According to | 10651 | | | | range | 10652 | | | | | 10653 | SC:PLAY_NOTIFY | | Play | 200 | 10654 | | | | | 10655 | SETUP | New URI | Play | 455 | 10656 | | | | | 10657 | SETUP | Setuped URI | Play | 455 | 10658 | | | | | 10659 | SETUP | Setuped URI, IFI | Play | Change | 10660 | | | | transport | 10661 | | | | param. | 10662 | | | | | 10663 | TEARDOWN | Prs URI | Init | No session hdr | 10664 | | | | | 10665 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10666 | | | | NRM=0 | 10667 | | | | | 10668 | TEARDOWN | md URI | Play | 455 | 10669 | | | | | 10670 | SC:REDIRECT | Terminate Reason with | Play | Set RedP | 10671 | | Time parameter | | | 10672 | | | | | 10673 | SC:REDIRECT | | Init | Session is | 10674 | | | | removed | 10675 | | | | | 10676 | RedP reached | | Init | TEARDOWN of | 10677 | | | | session | 10678 | | | | | 10679 | Timeout | | Init | Stop Media | 10680 | | | | playout | 10681 +----------------+-----------------------+--------+-----------------+ 10682 Table 16: State: Play 10684 The Play state table, see Table 16, is the largest. The table 10685 contains an number of requests that has presentation URI as a 10686 prerequisite on the Request-URI, this is due to the exclusion of non- 10687 aggregated stream control in sessions with more than one media 10688 stream. 10690 To avoid inconsistencies between the client and server, automatic 10691 state transitions are avoided. This can be seen at for example "End 10692 of media" event when all media has finished playing, the session 10693 still remain in Play state. An explicit PAUSE request needs to be 10694 sent to change the state to Ready. It may appear that there exist an 10695 automatic transitions in "RedP reached" and "PP reached", however, 10696 they are requested and acknowledge before they take place. The time 10697 at which the transition will happen is known by looking at the range 10698 header. If the client sends request close in time to these 10699 transitions it needs to be prepared for getting error message as the 10700 state may or may not have changed. 10702 Appendix C. Media Transport Alternatives 10704 This section defines how certain combinations of protocols, profiles 10705 and lower transports are used. This includes the usage of the 10706 Transport header's source and destination address parameters 10707 "src_addr" and "dest_addr". 10709 C.1. RTP 10711 This section defines the interaction of RTSP with respect to the RTP 10712 protocol [RFC3550]. It also defines any necessary media transport 10713 signalling with regards to RTP. 10715 The available RTP profiles and lower layer transports are described 10716 below along with rules on signalling the available combinations. 10718 C.1.1. AVP 10720 The usage of the "RTP Profile for Audio and Video Conferences with 10721 Minimal Control" [RFC3551] when using RTP for media transport over 10722 different lower layer transport protocols is defined below in regards 10723 to RTSP. 10725 One such case is defined within this document, the use of embedded 10726 (interleaved) binary data as defined in Section 14. The usage of 10727 this method is indicated by include the "interleaved" parameter. 10729 When using embedded binary data the "src_addr" and "dest_addr" MUST 10730 NOT be used. This addressing and multiplexing is used as defined 10731 with use of channel numbers and the interleaved parameter. 10733 C.1.2. AVP/UDP 10735 This part describes sending of RTP [RFC3550] over lower transport 10736 layer UDP [RFC0768] according to the profile "RTP Profile for Audio 10737 and Video Conferences with Minimal Control" defined in RFC 3551 10738 [RFC3551]. This profile requires one or two uni- or bi-directional 10739 UDP flows per media stream. The first UDP flow is for RTP and the 10740 second is for RTCP. Embedding of RTP data with the RTSP messages, in 10741 accordance with Section 14, SHOULD NOT be performed when RTSP 10742 messages are transported over unreliable transport protocols, like 10743 UDP [RFC0768]. 10745 The RTP/UDP and RTCP/UDP flows can be established using the Transport 10746 header's "src_addr", and "dest_addr" parameters. 10748 In RTSP PLAY mode, the transmission of RTP packets from client to 10749 server is unspecified. The behavior in regards to such RTP packets 10750 MAY be defined in future. 10752 The "src_addr" and "dest_addr" parameters are used in the following 10753 way for media delivery and playback mode, i.e. Mode=PLAY: 10755 o The "src_addr" and "dest_addr" parameters MUST contain either 1 or 10756 2 address specifications. 10758 o Each address specification for RTP/AVP/UDP or RTP/AVP/TCP MUST 10759 contain either: 10761 * both an address and a port number, or 10763 * a port number without an address. 10765 o The first address and port pair given in either of the parameters 10766 applies to the RTP stream. The second address and port pair if 10767 present applies to the RTCP stream. 10769 o The RTP/UDP packets from the server to the client MUST be sent to 10770 the address and port given by first address and port pair of the 10771 "dest_addr" parameter. 10773 o The RTCP/UDP packets from the server to the client MUST be sent to 10774 the address and port given by the second address and port pair of 10775 the "dest_addr" parameter. If no second pair is specified RTCP 10776 MUST NOT be sent. 10778 o The RTCP/UDP packets from the client to the server MUST be sent to 10779 the address and port given by the second address and port pair of 10780 the "src_addr" parameter. If no second pair is given RTCP MUST 10781 NOT be sent. 10783 o The RTP/UDP packets from the client to the server MUST be sent to 10784 the address and port given by the first address and port pair of 10785 the "src_addr" parameter. 10787 o RTP and RTCP Packets SHOULD be sent from the corresponding 10788 receiver port, i.e. RTCP packets from server should be sent from 10789 the "src_addr" parameters second address port pair. 10791 C.1.3. AVPF/UDP 10793 The RTP profile "Extended RTP Profile for RTCP-based Feedback (RTP/ 10794 AVPF)"[RFC4585] MAY be used as RTP profiles in session using RTP. 10795 All that is defined for AVP MUST also apply for AVPF. 10797 The usage of AVPF is indicated by the media initialization protocol 10798 used. In the case of SDP it is indicated by media lines (m=) 10799 containing the profile RTP/AVPF. That SDP MAY also contain further 10800 AVPF related SDP attributes configuring the AVPF session regarding 10801 reporting interval and feedback messages to be used. This 10802 configuration MUST be followed. 10804 C.1.4. SAVP/UDP 10806 The RTP profile "The Secure Real-time Transport Protocol (SRTP)" 10807 [RFC3711] is an RTP profile (SAVP) that MAY be used in RTSP sessions 10808 using RTP. All that is defined for AVP MUST also apply for SAVP. 10810 The usage of SRTP requires that a security association is 10811 established. The RECOMMENDED mechanism for establishing that 10812 security association is to use MIKEY with RTSP as defined in RFC 4567 10813 [RFC4567]. 10815 C.1.5. SAVPF/UDP 10817 The RTP profile "Extended Secure RTP Profile for RTCP-based Feedback 10818 (RTP/SAVPF)" [RFC5124] is an RTP profile (SAVPF) that MAY be used in 10819 RTSP sessions using RTP. All that is defined for AVP MUST also apply 10820 for SAVPF. 10822 The usage of SRTP requires that a security association is 10823 established. The RECOMMENDED mechanism for establishing that 10824 security association is to use MIKEY[RFC3830] with RTSP as defined in 10825 RFC 4567 [RFC4567]. 10827 C.1.6. RTCP usage with RTSP 10829 RTCP has several usages when RTP is used for media transport as 10830 explained below. Due to that RTCP MUST be supported if an RTSP agent 10831 handles RTP. 10833 C.1.6.1. Media synchronization 10835 RTCP provides media synchronization and clock drift compensation. 10836 The initial media synchronization is available from RTP-Info header. 10837 However, to be able to handle any clock drift between the media 10838 streams, RTCP is needed. 10840 C.1.6.2. RTSP Session keep-alive 10842 RTCP traffic from the RTSP client to the RTSP server MUST function as 10843 keep-alive. Which requires an RTSP server supporting RTP to use the 10844 received RTCP packets as indications that the client desires the 10845 related RTSP session to be kept alive. 10847 C.1.6.3. Bit-rate adaption 10849 RTCP Receiver reports and any additional feedback from the client 10850 MUST be used adapt the bit-rate used over the transport for all cases 10851 when RTP is sent over UDP. An RTP sender without reserved resources 10852 MUST NOT use more than its fair share of the available resources. 10853 This can be determined by comparing on short to medium term (some 10854 seconds) the used bit-rate and adapt it so that the RTP sender sends 10855 at a bit-rate comparable to what a TCP sender would achieve on 10856 average over the same path. 10858 C.1.6.4. RTP and RTCP Multiplexing 10860 RTSP can be used to negotiate the usage of RTP and RTCP multiplexing 10861 as described in [I-D.ietf-avt-rtp-and-rtcp-mux]. This allows servers 10862 and client to reduce the amount of resources required for the session 10863 by only requiring one underlying transport stream per media stream 10864 instead of two when using RTP and RTCP. This lessens the server port 10865 consumption and also the necessary state and keep-alive work when 10866 operating across Network and Address Translators [RFC2663]. 10868 Content must be prepared with some consideration for RTP and RTCP 10869 multiplexing, mainly ensuring that the RTP payload types used does 10870 not collide with the ones used for RTCP packet types this option 10871 likely needs explicit support from the content unless the RTP payload 10872 types can be remapped by the server and that is correctly reflected 10873 in the session description. Beyond that support of this feature 10874 should come at little cost and much gain. 10876 It is recommended that if the content and server supports RTP and 10877 RTCP multiplexing that this is indicated in the session description, 10878 for example using the SDP attribute "a=rtcp-mux". If the SDP message 10879 contains the a=rtcp-mux attribute for a media stream, the server MUST 10880 support RTP and RTCP multiplexing. If indicated or otherwise desired 10881 by the client it can include the Transport parameter "RTCP-mux" in 10882 any transport specification where it desires to use RTCP-mux. The 10883 server will indicate if it supports RTCP-mux. Server and Client 10884 SHOULD support RTP and RTCP multiplexing. 10886 For capability exchange, an RTSP feature tag for RTP and RTCP 10887 multiplexing is defined: "setup.rtp.rtcp.mux". 10889 C.2. RTP over TCP 10891 Transport of RTP over TCP can be done in two ways, over independent 10892 TCP connections using RFC 4571 [RFC4571] or interleaved in the RTSP 10893 control connection. In both cases the protocol MUST be "rtp" and the 10894 lower layer MUST be TCP. The profile may be any of the above 10895 specified ones; AVP, AVPF, SAVP or SAVPF. 10897 C.2.1. Interleaved RTP over TCP 10899 The use of embedded (interleaved) binary data transported on the RTSP 10900 connection is possible as specified in Section 14. When using this 10901 declared combination of interleaved binary data the RTSP messages 10902 MUST be transported over TCP. TLS may or may not be used. 10904 One should, however, consider that this will result that all media 10905 streams go through any proxy. Using independent TCP connections can 10906 avoid that issue. 10908 C.2.2. RTP over independent TCP 10910 In this Appendix, we describe the sending of RTP [RFC3550] over lower 10911 transport layer TCP [RFC0793] according to "Framing Real-time 10912 Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over 10913 Connection-Oriented Transport" [RFC4571]. This Appendix adapts the 10914 guidelines for using RTP over TCP within SIP/SDP [RFC4145] to work 10915 with RTSP. 10917 A client codes the support of RTP over independent TCP by specifying 10918 an RTP/AVP/TCP transport option without an interleaved parameter in 10919 the Transport line of a SETUP request. This transport option MUST 10920 include the "unicast" parameter. 10922 If the client wishes to use RTP with RTCP, two ports (or two address/ 10923 port pairs) are specified by the dest_addr parameter. If the client 10924 wishes to use RTP without RTCP, one port (or one address/port pair) 10925 is specified by the dest_addr parameter. Ordering rules of dest_addr 10926 ports follow the rules for RTP/AVP/UDP. 10928 If the client wishes to play the active role in initiating the TCP 10929 connection, it MAY set the "setup" parameter (See Section 16.52) on 10930 the Transport line to be "active", or it MAY omit the setup 10931 parameter, as active is the default. If the client signals the 10932 active role, the ports for all dest_addr values MUST be set to 9 (the 10933 discard port). 10935 If the client wishes to play the passive role in TCP connection 10936 initiation, it MUST set the "setup" parameter on the Transport line 10937 to be "passive". If the client is able to assume the active or the 10938 passive role, it MUST set the "setup" parameter on the Transport line 10939 to be "actpass". In either case, the dest_addr port value for RTP 10940 MUST be set to the TCP port number on which the client is expecting 10941 to receive the RTP stream connection, and the dest_addr port value 10942 for RTCP MUST be set to the TCP port number on which the client is 10943 expecting to receive the RTCP stream connection. 10945 If upon receipt of a non-interleaved RTP/AVP/TCP SETUP request, a 10946 server decides to accept this requested option, the 2xx reply MUST 10947 contain a Transport option that specifies RTP/AVP/TCP (without using 10948 the interleaved parameter, and with using the unicast parameter). 10949 The dest_addr parameter value MUST be echoed from the parameter value 10950 in the client request unless the destination address (only port) was 10951 not provided in which can the server MAY include the source address 10952 of the RTSP TCP connection with the port number unchanged. 10954 In addition, the server reply MUST set the setup parameter on the 10955 Transport line, to indicate the role the server will play in the 10956 connection setup. Permissible values are "active" (if a client set 10957 "setup" to "passive" or "actpass") and "passive" (if a client set 10958 "setup" to "active" or "actpass"). 10960 If a server sets "setup" to "passive", the "src_addr" in the reply 10961 MUST indicate the ports the server is willing to receive an RTP 10962 connection and (if the client requested an RTCP connection by 10963 specifying two dest_addr ports or address/port pairs) and RTCP 10964 connection. If a server sets "setup" to "active", the ports 10965 specified in "src_addr" MUST be set to 9. The server MAY use the 10966 "ssrc" parameter, following the guidance in Section 16.52. Port 10967 ordering for src_addr follows the rules for RTP/AVP/UDP. 10969 Servers MUST support taking the passive role and MAY support taking 10970 the active role. Servers with a public IP address takes the passive 10971 role, thus enabling clients behind NATs and Firewalls to better 10972 chance of succesful connect to the server by actively connecting 10973 outwards. Therefore the clients are RECOMMENDED to take the active 10974 role. 10976 After sending (receiving) a 2xx reply for a SETUP method for a non- 10977 interleaved RTP/AVP/TCP media stream, the active party SHOULD 10978 initiate the TCP connection as soon as possible. The client MUST NOT 10979 send a PLAY request prior to the establishment of all the TCP 10980 connections negotiated using SETUP for the session. In case the 10981 server receives a PLAY request in a session that has not yet 10982 established all the TCP connections, it MUST respond using the 464 10983 "Data Transport Not Ready Yet" (Section 15.4.29) error code. 10985 Once the PLAY request for a media resource transported over non- 10986 interleaved RTP/AVP/TCP occurs, media begins to flow from server to 10987 client over the RTP TCP connection, and RTCP packets flow 10988 bidirectionally over the RTCP TCP connection. As in the RTP/UDP 10989 case, client to server traffic on the TCP port is unspecified by this 10990 memo. The packets that travel on these connections MUST be framed 10991 using the protocol defined in [RFC4571], not by the framing defined 10992 for interleaving RTP over the RTSP control connection defined in 10993 Section 14. 10995 A successful PAUSE request for a media being transported over RTP/ 10996 AVP/TCP pauses the flow of packets over the connections, without 10997 closing the connections. A successful TEARDOWN request signals that 10998 the TCP connections for RTP and RTCP are to be closed as soon as 10999 possible. 11001 Subsequent SETUP requests on an already-SETUP RTP/AVP/TCP URI may be 11002 ambiguous in the following way: does the client wish to open up new 11003 TCP RTP and RTCP connections for the URI, or does the client wish to 11004 continue using the existing TCP RTP and RTCP connections? The client 11005 SHOULD use the "connection" parameter (defined in Section 16.52) on 11006 the Transport line to make its intention clear in the regard (by 11007 setting "connection" to "new" if new connections are needed, and by 11008 setting "connection" to "existing" if the existing connections are to 11009 be used). After a 2xx reply for a SETUP request for a new 11010 connection, parties should close the pre-existing connections, after 11011 waiting a suitable period for any stray RTP or RTCP packets to 11012 arrive. 11014 Below, we rewrite part of the example media on demand example shown 11015 in Appendix A.1 to use RTP/AVP/TCP non-interleaved: 11017 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 11018 CSeq: 1 11019 User-Agent: PhonyClient/1.2 11021 M->C: RTSP/2.0 200 OK 11022 CSeq: 1 11023 Server: PhonyServer/1.0 11024 Date: Thu, 23 Jan 1997 15:35:06 GMT 11025 Content-Type: application/sdp 11026 Content-Length: 227 11027 Content-Base: rtsp://example.com/twister.3gp/ 11028 Expires: 24 Jan 1997 15:35:06 GMT 11030 v=0 11031 o=- 2890844256 2890842807 IN IP4 198.51.100.34 11032 s=RTSP Session 11033 i=An Example of RTSP Session Usage 11034 e=adm@example.com 11035 c=IN IP4 0.0.0.0 11036 a=control: * 11037 a=range: npt=0-0:10:34.10 11038 t=0 0 11039 m=audio 0 RTP/AVP 0 11040 a=control: trackID=1 11042 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 11043 CSeq: 2 11044 User-Agent: PhonyClient/1.2 11045 Require: play.basic 11046 Transport: RTP/AVP/TCP;unicast;dest_addr=":9"/":9"; 11047 setup=active;connection=new 11048 Accept-Ranges: NPT, SMPTE, UTC 11050 M->C: RTSP/2.0 200 OK 11051 CSeq: 2 11052 Server: PhonyServer/1.0 11053 Transport: RTP/AVP/TCP;unicast; 11054 dest_addr=":9"/":9"; 11055 src_addr="198.51.100.5:53478"/"198.51.100.54091:"; 11056 setup=passive;connection=new;ssrc=93CB001E 11057 Session: 12345678 11058 Expires: 24 Jan 1997 15:35:12 GMT 11059 Date: 23 Jan 1997 15:35:12 GMT 11060 Accept-Ranges: NPT 11061 Media-Properties: Random-Access=0.8, Unmutable, Unlimited 11063 C->M: TCP Connection Establishment x2 11065 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 11066 CSeq: 4 11067 User-Agent: PhonyClient/1.2 11068 Range: npt=30- 11069 Session: 12345678 11071 M->C: RTSP/2.0 200 OK 11072 CSeq: 4 11073 Server: PhonyServer/1.0 11074 Date: 23 Jan 1997 15:35:14 GMT 11075 Session: 12345678 11076 Range: npt=30-623.10 11077 Seek-Style: First-Prior 11078 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=1" 11079 ssrc=4F312DD8:seq=54321;rtptime=2876889 11081 C.3. Handling Media Clock Time Jumps in the RTP Media Layer 11083 RTSP allows media clients to control selected, non-contiguous 11084 sections of media presentations, rendering those streams with an RTP 11085 media layer [RFC3550]. Two cases occur, the first is when a new PLAY 11086 request replaces an old ongoing request and the new request results 11087 in a jump in the media. This should produce in the RTP layer a 11088 continuous media stream. A client may also directly following a 11089 completed PLAY request perform a new PLAY request. This will result 11090 in some gap in the media layer. The below text will look into both 11091 cases. 11093 A PLAY request that replaces a ongoing request allows the media layer 11094 rendering the RTP stream without being affected by jumps in media 11095 clock time. The RTP timestamps for the new media range is set so 11096 that they become continuous with the previous media range in the 11097 previous request. The RTP sequence number for the first packet in 11098 the new range will be the next following the last packet in the 11099 previous range, i.e. monotonically increasing. The goal is to allow 11100 the media rendering layer to work without interruption or 11101 reconfiguration across the jumps in media clock. This should be 11102 possible in all cases of replaced PLAY requests for media that has 11103 random-access properties. In this case care is needed to align 11104 frames or similar media dependent structures. 11106 In cases where jumps in media clock time are a result of RTSP 11107 signalling operations arriving after a completed PLAY operation, the 11108 request timing will result in that media becomes non-continuous. The 11109 server becomes unable to send the media so that it arrive timely and 11110 still carry timestamps to make the media stream continuous. In these 11111 cases the server will produce RTP streams where there are gaps in the 11112 RTP timeline for the media. In such cases, if the media has frame 11113 structure, aligning the timestamp for the next frame with the 11114 previous structure reduces the burden to render this media. The gap 11115 should represent the time the server hasn't been serving media, e.g. 11116 the time between the end of the media stream or a PAUSE request and 11117 the new PLAY request. In these cases the RTP sequence number would 11118 normally be monotonically increasing across the gap. 11120 For RTSP sessions with media that lacks random access properties, 11121 like live streams, any media clock jump is commonly result of 11122 correspondingly long pause of delivery. The RTP timestamp will have 11123 increased in direct proportion to the duration of the paused 11124 delivery. Note also that in this case the RTP sequence number should 11125 be the next packet number. If not, the RTCP packet loss reporting 11126 will indicate as loss all packets not received between the point of 11127 pausing and later resuming. This may trigger congestion avoidance 11128 mechanisms. An allowed exception from the above recommendation on 11129 monotonically increasing RTP sequence number is live media streams, 11130 likely being relayed. In this case, when the client resumes 11131 delivery, it will get the media that is currently being delivered to 11132 the server itself. For this type of basic delivery of live streams 11133 to multiple users over unicast, individual rewriting of RTP sequence 11134 numbers becomes quite a burden. For solutions that anyway caches 11135 media, timeshifts, etc, the rewriting should be a minor issue. 11137 The goal when handling jumps in media clock time is that the provided 11138 stream is continuous without gaps in RTP timestamp or sequence 11139 number. However, when delivery has been halted for some reason the 11140 RTP timestamp when resuming MUST represent the duration the delivery 11141 was halted. RTP sequence number MUST generally be the next number, 11142 i.e. monotonically increasing modulo 65536. For media resources with 11143 the properties Time-Progressing and Time-Duration=0.0 the server MAY 11144 create RTP media streams with RTP sequence number jumps in them due 11145 to client first halting delivery and later resuming it (PAUSE and 11146 then later PLAY). However, servers utilizing this exception must 11147 take into consideration the resulting RTCP receiver reports that 11148 likely contains loss report for all the packets part of the 11149 discontinuity. A client can not rely on that a server will align 11150 when resuming playing even if it is RECOMMENDED. The RTP-Info header 11151 will provide information on how the server acts in each case. 11153 We cannot assume that the RTSP client can communicate with the RTP 11154 media agent, as the two may be independent processes. If the RTP 11155 timestamp shows the same gap as the NPT, the media agent will 11156 assume that there is a pause in the presentation. If the jump in 11157 NPT is large enough, the RTP timestamp may roll over and the media 11158 agent may believe later packets to be duplicates of packets just 11159 played out. Having the RTP timestamp jump will also affect the 11160 RTCP measurements based on this. 11162 As an example, assume a RTP timestamp frequency of 8000 Hz, a 11163 packetization interval of 100 ms and an initial sequence number and 11164 timestamp of zero. 11166 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11167 CSeq: 4 11168 Session: abcdefgh 11169 Range: npt=10-15 11170 User-Agent: PhonyClient/1.2 11172 S->C: RTSP/2.0 200 OK 11173 CSeq: 4 11174 Session: abcdefgh 11175 Range: npt=10-15 11176 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11177 ssrc=0D12F123:seq=0;rtptime=0 11179 The ensuing RTP data stream is depicted below: 11181 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11182 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11183 . . . 11184 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 11186 Upon the completion of the requested delivery the server sends a 11187 PLAY_NOTIFY 11188 S->C: PLAY_NOTIFY rtsp://example.com/fizzle RTSP/2.0 11189 CSeq: 5 11190 Notify-Reason: end-of-stream 11191 Request-Status: cseq=4 status=200 reason="OK" 11192 Range: npt=-15 11193 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 11194 ssrc=0D12F123:seq=49;rtptime=39200 11195 Session: abcdefgh 11197 C->S: RTSP/2.0 200 OK 11198 CSeq: 5 11199 User-Agent: PhonyClient/1.2 11201 Upon the completion of the play range, the client follows up with a 11202 request to PLAY from a new NPT. 11204 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11205 CSeq: 6 11206 Session: abcdefg 11207 Range: npt=18-20 11208 User-Agent: PhonyClient/1.2 11210 S->C: RTSP/2.0 200 OK 11211 CSeq: 6 11212 Session: abcdefg 11213 Range: npt=18-20 11214 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11215 ssrc=0D12F123:seq=50;rtptime=40100 11217 The ensuing RTP data stream is depicted below: 11219 S->C: RTP packet - seq = 50, rtptime = 40100, NPT time = 18s 11220 S->C: RTP packet - seq = 51, rtptime = 40900, NPT time = 18.1s 11221 . . . 11222 S->C: RTP packet - seq = 69, rtptime = 55300, NPT time = 19.9s 11224 In this example, first, NPT 10 through 15 is played, then the client 11225 request the server to skip ahead and play NPT 18 through 20. The 11226 first segment is presented as RTP packets with sequence numbers 0 11227 through 49 and timestamp 0 through 39,200. The second segment 11228 consists of RTP packets with sequence number 50 through 69, with 11229 timestamps 40,100 through 55,200. While there is a gap in the NPT, 11230 there is no gap in the sequence number space of the RTP data stream. 11232 The RTP timestamp gap is present in the above example due to the time 11233 it takes to perform the second play request, in this case 12.5 ms 11234 (100/8000). 11236 C.4. Handling RTP Timestamps after PAUSE 11238 During a PAUSE / PLAY interaction in an RTSP session, the duration of 11239 time for which the RTP transmission was halted MUST be reflected in 11240 the RTP timestamp of each RTP stream. The duration can be calculated 11241 for each RTP stream as the time elapsed from when the last RTP packet 11242 was sent before the PAUSE request was received and when the first RTP 11243 packet was sent after the subsequent PLAY request was received. The 11244 duration includes all latency incurred and processing time required 11245 to complete the request. 11247 The RTP RFC [RFC3550] states that: The RTP timestamp for each unit 11248 [packet] would be related to the wallclock time at which the unit 11249 becomes current on the virtual presentation timeline. 11251 In order to satisfy the requirements of [RFC3550], the RTP 11252 timestamp space needs to increase continuously with real time. 11253 While this is not optimal for stored media, it is required for RTP 11254 and RTCP to function as intended. Using a continuous RTP 11255 timestamp space allows the same timestamp model for both stored 11256 and live media and allows better opportunity to integrate both 11257 types of media under a single control. 11259 As an example, assume a clock frequency of 8000 Hz, a packetization 11260 interval of 100 ms and an initial sequence number and timestamp of 11261 zero. 11263 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11264 CSeq: 4 11265 Session: abcdefg 11266 Range: npt=10-15 11267 User-Agent: PhonyClient/1.2 11269 S->C: RTSP/2.0 200 OK 11270 CSeq: 4 11271 Session: abcdefg 11272 Range: npt=10-15 11273 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11274 ssrc=0D12F123:seq=0;rtptime=0 11276 The ensuing RTP data stream is depicted below: 11278 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11279 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11280 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 11281 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 11283 The client then sends a PAUSE request: 11285 C->S: PAUSE rtsp://example.com/fizzle RTSP/2.0 11286 CSeq: 5 11287 Session: abcdefg 11288 User-Agent: PhonyClient/1.2 11290 S->C: RTSP/2.0 200 OK 11291 CSeq: 5 11292 Session: abcdefg 11293 Range: npt=10.4-15 11295 20 seconds elapse and then the client sends a PLAY request. In 11296 addition the server requires 15 ms to process the request: 11298 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11299 CSeq: 6 11300 Session: abcdefg 11301 User-Agent: PhonyClient/1.2 11303 S->C: RTSP/2.0 200 OK 11304 CSeq: 6 11305 Session: abcdefg 11306 Range: npt=10.4-15 11307 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11308 ssrc=0D12F123:seq=4;rtptime=164400 11310 The ensuing RTP data stream is depicted below: 11312 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 11313 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 11314 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 11316 First, NPT 10 through 10.3 is played, then a PAUSE is received by the 11317 server. After 20 seconds a PLAY is received by the server which take 11318 15ms to process. The duration of time for which the session was 11319 paused is reflected in the RTP timestamp of the RTP packets sent 11320 after this PLAY request. 11322 A client can use the RTSP range header and RTP-Info header to map NPT 11323 time of a presentation with the RTP timestamp. 11325 Note: In RFC 2326 [RFC2326], this matter was not clearly defined and 11326 was misunderstood commonly. However, for RTSP 2.0 it is expected 11327 that this will be handled correctly and no exception handling will be 11328 required. 11330 Note Further: To ensure correct media decoding and usually jitter- 11331 buffer handling reseting some of the state when issuing a PLAY 11332 request is needed. 11334 C.5. RTSP / RTP Integration 11336 For certain datatypes, tight integration between the RTSP layer and 11337 the RTP layer will be necessary. This by no means precludes the 11338 above restrictions. Combined RTSP/RTP media clients should use the 11339 RTP-Info field to determine whether incoming RTP packets were sent 11340 before or after a seek or before or after a PAUSE. 11342 C.6. Scaling with RTP 11344 For scaling (see Section 16.44), RTP timestamps should correspond to 11345 the rendering timing. For example, when playing video recorded at 30 11346 frames/second at a scale of two and speed (Section 16.48) of one, the 11347 server would drop every second frame to maintain and deliver video 11348 packets with the normal timestamp spacing of 3,000 per frame, but NPT 11349 would increase by 1/15 second for each video frame. 11351 Note: The above scaling puts requirements on the media codec or a 11352 media stream to support it. For example motion JPEG or other non- 11353 predictive video coding can easier handle the above example. 11355 C.7. Maintaining NPT synchronization with RTP timestamps 11357 The client can maintain a correct display of NPT (Normal Play Time) 11358 by noting the RTP timestamp value of the first packet arriving after 11359 repositioning. The sequence parameter of the RTP-Info 11360 (Section 16.43) header provides the first sequence number of the next 11361 segment. 11363 C.8. Continuous Audio 11365 For continuous audio, the server SHOULD set the RTP marker bit at the 11366 beginning of serving a new PLAY request or at jumps in timeline. 11367 This allows the client to perform playout delay adaptation. 11369 C.9. Multiple Sources in an RTP Session 11371 Note that more than one SSRC MAY be sent in the media stream. If it 11372 happens all sources are expected to be rendered simultaneously. 11374 C.10. Usage of SSRCs and the RTCP BYE Message During an RTSP Session 11376 The RTCP BYE message indicates the end of use of a given SSRC. If 11377 all sources leave an RTP session, it can, in most cases, be assumed 11378 to have ended. Therefore, a client or server MUST NOT send a RTCP 11379 BYE message until it has finished using a SSRC. A server SHOULD keep 11380 using a SSRC until the RTP session is terminated. Prolonging the use 11381 of a SSRC allows the established synchronization context associated 11382 with that SSRC to be used to synchronize subsequent PLAY requests 11383 even if the PLAY response is late. 11385 An SSRC collision with the SSRC that transmits media does also have 11386 consequences, as it will normally force the media sender to change 11387 its SSRC in accordance with the RTP specification[RFC3550]. However, 11388 a RTSP server may wait and see if the client changes and thus resolve 11389 the conflict to minimize the impact. As media sender SSRC change 11390 will result in a loss of synchronization context, and require any 11391 receiver to wait for RTCP sender reports for all media requiring 11392 synchronization before being able to play out synchronized. Due to 11393 these reasons a client joining a session should take care to not 11394 select the same SSRC(s) as the server indicates in the ssrc Transport 11395 header parameter. Any SSRC signalled in the Transport header MUST be 11396 avoided. A client detecting a collision prior to sending any RTP or 11397 RTCP messages SHALL also select a new SSRC. 11399 C.11. Future Additions 11401 It is the intention that any future protocol or profile regarding 11402 both for media delivery and lower transport should be easy to add to 11403 RTSP. This section provides the necessary steps that needs to be 11404 meet. 11406 The following things needs to be considered when adding a new 11407 protocol or profile for use with RTSP: 11409 o The protocol or profile needs to define a name tag representing 11410 it. This tag is required to be a ABNF "token" to be possible to 11411 use in the Transport header specification. 11413 o The useful combinations of protocol, profiles and lower layer 11414 transport for this extension needs to be defined. For each 11415 combination declare the necessary parameters to use in the 11416 Transport header. 11418 o For new media protocols the interaction with RTSP needs to be 11419 addressed. One important factor will be the media 11420 synchronization. May need new headers similar to RTP info to 11421 carry information. 11423 o Discuss congestion control for media, especially if transport 11424 without built in congestion control is used. 11426 See the IANA section (Section 22) for information how to register new 11427 attributes. 11429 Appendix D. Use of SDP for RTSP Session Descriptions 11431 The Session Description Protocol (SDP, [RFC4566]) may be used to 11432 describe streams or presentations in RTSP. This description is 11433 typically returned in reply to a DESCRIBE request on an URI from a 11434 server to a client, or received via HTTP from a server to a client. 11436 This appendix describes how an SDP file determines the operation of 11437 an RTSP session. SDP as is provides no mechanism by which a client 11438 can distinguish, without human guidance, between several media 11439 streams to be rendered simultaneously and a set of alternatives 11440 (e.g., two audio streams spoken in different languages). The SDP 11441 extension "Grouping of Media Lines in the Session Description 11442 Protocol (SDP)" [RFC3388] provides such functionality to some degree. 11443 Appendix D.4 describes the usage of SDP media line grouping for RTSP. 11445 D.1. Definitions 11447 The terms "session-level", "media-level" and other key/attribute 11448 names and values used in this appendix are to be used as defined in 11449 SDP[RFC4566]: 11451 D.1.1. Control URI 11453 The "a=control:" attribute is used to convey the control URI. This 11454 attribute is used both for the session and media descriptions. If 11455 used for individual media, it indicates the URI to be used for 11456 controlling that particular media stream. If found at the session 11457 level, the attribute indicates the URI for aggregate control 11458 (presentation URI). The session level URI MUST be different from any 11459 media level URI. The presence of a session level control attribute 11460 MUST be interpreted as support for aggregated control. The control 11461 attribute MUST be present on media level unless the presentation only 11462 contains a single media stream, in which case the attribute MAY only 11463 be present on the session level and then also apply to that single 11464 media level. 11466 ABNF for the attribute is defined in Section 20.3. 11468 Example: 11469 a=control:rtsp://example.com/foo 11471 This attribute MAY contain either relative or absolute URIs, 11472 following the rules and conventions set out in RFC 3986 [RFC3986]. 11473 Implementations MUST look for a base URI in the following order: 11475 1. the RTSP Content-Base field; 11476 2. the RTSP Content-Location field; 11478 3. the RTSP Request-URI. 11480 If this attribute contains only an asterisk (*), then the URI MUST be 11481 treated as if it were an empty embedded URI, and thus inherit the 11482 entire base URI. 11484 Note, RFC 2326 was very unclear on the processing of relative URI 11485 and several RTSP 1.0 implementations at the point of publishing 11486 this document did not perform RFC 3986 processing to determine the 11487 resulting URI, instead simple concatenation is common. To avoid 11488 this issue completely it is recommended to use absolute URI in the 11489 SDP. 11491 The URI handling for SDPs from container files need special 11492 consideration. For example lets assume that a container file has the 11493 URI: "rtsp://example.com/container.mp4". Lets further assume this 11494 URI is the base URI, and that there is a absolute media level URI: 11495 "rtsp://example.com/container.mp4/trackID=2". A relative media level 11496 URI that resolves in accordance with RFC 3986 [RFC3986] to the above 11497 given media URI is: "container.mp4/trackID=2". It is usually not 11498 desirable to need to include in or modify the SDP stored within the 11499 container file with the server local name of the container file. To 11500 avoid this, one can modify the base URI used to include a trailing 11501 slash, e.g. "rtsp://example.com/container.mp4/". In this case the 11502 relative URI for the media will only need to be: "trackID=2". 11503 However, this will also mean that using "*" in the SDP will result in 11504 control URI including the trailing slash, i.e. 11505 "rtsp://example.com/container.mp4/". 11507 Note: The usage of TrackID in the above is not an standardized 11508 form, but one example out of several similar strings such as 11509 TrackID, Track_ID, StreamID that is used by different server 11510 vendors to indicate a particular piece of media inside a container 11511 file. 11513 D.1.2. Media Streams 11515 The "m=" field is used to enumerate the streams. It is expected that 11516 all the specified streams will be rendered with appropriate 11517 synchronization. If the session is over multicast, the port number 11518 indicated SHOULD be used for reception. The client MAY try to 11519 override the destination port, through the Transport header. The 11520 servers MAY allow this, the response will indicate if allowed or not. 11521 If the session is unicast, the port numbers are the ones RECOMMENDED 11522 by the server to the client, about which receiver ports to use; the 11523 client MUST still include its receiver ports in its SETUP request. 11525 The client MAY ignore this recommendation. If the server has no 11526 preference, it SHOULD set the port number value to zero. 11528 The "m=" lines contain information about which transport protocol, 11529 profile, and possibly lower-layer is to be used for the media stream. 11530 The combination of transport, profile and lower layer, like RTP/AVP/ 11531 UDP needs to be defined for how to be used with RTSP. The currently 11532 defined combinations are defined in Appendix C, further combinations 11533 MAY be specified. 11535 Example: 11536 m=audio 0 RTP/AVP 31 11538 D.1.3. Payload Type(s) 11540 The payload type(s) are specified in the "m=" line. In case the 11541 payload type is a static payload type from RFC 3551 [RFC3551], no 11542 other information may be required. In case it is a dynamic payload 11543 type, the media attribute "rtpmap" is used to specify what the media 11544 is. The "encoding name" within the "rtpmap" attribute may be one of 11545 those specified in RFC 3551 (Sections 5 and 6), or an MIME type 11546 registered with IANA, or an experimental encoding as specified in SDP 11547 (RFC 4566 [RFC4566]). Codec-specific parameters are not specified in 11548 this field, but rather in the "fmtp" attribute described below. 11550 The selection of the RTP payload type numbers used may be required to 11551 consider RTP and RTCP Multiplexing [I-D.ietf-avt-rtp-and-rtcp-mux] if 11552 that is to be supported by the server. 11554 D.1.4. Format-Specific Parameters 11556 Format-specific parameters are conveyed using the "fmtp" media 11557 attribute. The syntax of the "fmtp" attribute is specific to the 11558 encoding(s) that the attribute refers to. Note that some of the 11559 format specific parameters may be specified outside of the fmtp 11560 parameters, like for example the "ptime" attribute for most audio 11561 encodings. 11563 D.1.5. Directionality of media stream 11565 The SDP attributes "a=sendrecv", "a=recvonly" and "a=sendonly" 11566 provides instructions on which direction the media streams flow 11567 within a session. When using RTSP the SDP can be delivered to a 11568 client using either RTSP DESCRIBE or a number of RTSP external 11569 methods, like HTTP, FTP, and email. Based on this the SDP applies to 11570 how the RTSP client will see the complete session. Thus for media 11571 streams delivered from the RTSP server to the client would be given 11572 the "a=recvonly" attribute. 11574 The direction attributes are not commonly used in SDPs for RTSP, but 11575 may occur. "a=recvonly" in a SDP provided to the RTSP client MUST 11576 indicate that media delivery will only occur in the direction from 11577 the RTSP server to the client. In SDP provided to the RTSP client 11578 that lacks any of the directionality attributes (a=recvonly, 11579 a=sendonly, a=sendrecv) MUST behave as if the "a=recvonly" attribute 11580 was received. Note that this overrules the normal default rule 11581 defined in SDP[RFC4566]. The usage of "a=sendonly" or "a=sendrecv" 11582 is not defined, nor is the interpretation of SDP by other entities 11583 than the RTSP client. 11585 D.1.6. Range of Presentation 11587 The "a=range" attribute defines the total time range of the stored 11588 session or an individual media. Non-seekable live sessions can be 11589 indicated as specified below, while the length of live sessions can 11590 be deduced from the "t" and "r" SDP parameters. 11592 The attribute is both a session and a media level attribute. For 11593 presentations that contains media streams of the same durations, the 11594 range attribute SHOULD only be used at session-level. In case of 11595 different length the range attribute MUST be given at media level for 11596 all media, and SHOULD NOT be given at session level. If the 11597 attribute is present at both media level and session level the media 11598 level values MUST be used. 11600 Note: Usually one will specify the same length for all media, even if 11601 there isn't media available for the full duration on all media. 11602 However, that requires that the server accepts PLAY requests within 11603 that range. 11605 Servers MUST take care to provide RTSP Range (see Section 16.38) 11606 values that are consistent with what is presented in the SDP for the 11607 content. There is no reason for non dynamic content, like media 11608 clips provided on demand to have inconsistent values. Inconsistent 11609 values between the SDP and the actual values for the content handled 11610 by the server is likely to generate some failure, like 457 "Invalid 11611 Range", in case the client uses PLAY requests with a Range header. 11612 In case the content is dynamic in length and it is infeasible to 11613 provide a correct value in the SDP the server is recommended to 11614 describe this as non-seekable content (see below). The server MAY 11615 override that property in the response to a PLAY request using the 11616 correct values in the Range header. 11618 The unit is specified first, followed by the value range. The units 11619 and their values are as defined in Section 4.4, Section 4.5 and 11620 Section 4.6 and MAY be extended with further formats. Any open ended 11621 range (start-), i.e. without stop range, is of unspecified duration 11622 and MUST be considered as non-seekable content unless this property 11623 is overridden. Multiple instances carrying different clock formats 11624 MAY be included at either session or media level. 11626 ABNF for the attribute is defined in Section 20.3. 11628 Examples: 11629 a=range:npt=0-34.4368 11630 a=range:clock=19971113T211503Z-19971113T220300Z 11631 Non seekable stream of unknown duration: 11632 a=range:npt=0- 11634 D.1.7. Time of Availability 11636 The "t=" field defines when the SDP is valid. For on-demand content 11637 the server SHOULD indicate a stop time value for which it guarantees 11638 the description to be valid, and a start time that is equal to or 11639 before the time at which the DESCRIBE request was received. It MAY 11640 also indicate start and stop times of 0, meaning that the session is 11641 always available. 11643 For sessions that are of live type, i.e. specific start time, unknown 11644 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 11645 to indicate the start time of the event. The stop time SHOULD be 11646 given so that the live event will have ended at that time, while 11647 still not be unnecessary long into the future. 11649 D.1.8. Connection Information 11651 In SDP, the "c=" field contains the destination address for the media 11652 stream. If a multicast address is specified the client SHOULD use 11653 this address in any SETUP request as destination address, including 11654 any additional parameters, such as TTL. For on-demand unicast 11655 streams and some multicast streams, the destination address MAY be 11656 specified by the client via the SETUP request, thus overriding any 11657 specified address. To identify streams without a fixed destination 11658 address, where the client is required to specify a destination 11659 address, the "c=" field SHOULD be set to a null value. For addresses 11660 of type "IP4", this value MUST be "0.0.0.0", and for type "IP6", this 11661 value MUST be "0:0:0:0:0:0:0:0" (can also be written as "::"), i.e. 11662 the unspecified address according to RFC 4291 [RFC4291]. 11664 D.1.9. Message Body Tag 11666 The optional "a=mtag" attribute identifies a version of the session 11667 description. It is opaque to the client. SETUP requests may include 11668 this identifier in the If-Match field (see Section 16.23) to only 11669 allow session establishment if this attribute value still corresponds 11670 to that of the current description. The attribute value is opaque 11671 and may contain any character allowed within SDP attribute values. 11673 ABNF for the attribute is defined in Section 20.3. 11675 Example: 11676 a=mtag:"158bb3e7c7fd62ce67f12b533f06b83a" 11678 One could argue that the "o=" field provides identical 11679 functionality. However, it does so in a manner that would put 11680 constraints on servers that need to support multiple session 11681 description types other than SDP for the same piece of media 11682 content. 11684 D.2. Aggregate Control Not Available 11686 If a presentation does not support aggregate control no session level 11687 "a=control:" attribute is specified. For a SDP with multiple media 11688 sections specified, each section will have its own control URI 11689 specified via the "a=control:" attribute. 11691 Example: 11692 v=0 11693 o=- 2890844256 2890842807 IN IP4 192.0.2.56 11694 s=I came from a web page 11695 e=adm@example.com 11696 c=IN IP4 0.0.0.0 11697 t=0 0 11698 m=video 8002 RTP/AVP 31 11699 a=control:rtsp://audio.example.com/movie.aud 11700 m=audio 8004 RTP/AVP 3 11701 a=control:rtsp://video.example.com/movie.vid 11703 Note that the position of the control URI in the description implies 11704 that the client establishes separate RTSP control sessions to the 11705 servers audio.example.com and video.example.com. 11707 It is recommended that an SDP file contains the complete media 11708 initialization information even if it is delivered to the media 11709 client through non-RTSP means. This is necessary as there is no 11710 mechanism to indicate that the client should request more detailed 11711 media stream information via DESCRIBE. 11713 D.3. Aggregate Control Available 11715 In this scenario, the server has multiple streams that can be 11716 controlled as a whole. In this case, there are both a media-level 11717 "a=control:" attributes, which are used to specify the stream URIs, 11718 and a session-level "a=control:" attribute which is used as the 11719 Request-URI for aggregate control. If the media-level URI is 11720 relative, it is resolved to absolute URIs according to Appendix D.1.1 11721 above. 11723 Example: 11724 C->M: DESCRIBE rtsp://example.com/movie RTSP/2.0 11725 CSeq: 1 11726 User-Agent: PhonyClient/1.2 11728 M->C: RTSP/2.0 200 OK 11729 CSeq: 1 11730 Date: Thu, 23 Jan 1997 15:35:06 GMT 11731 Expires: Thu, 23 Jan 1997 16:35:06 GMT 11732 Content-Type: application/sdp 11733 Content-Base: rtsp://example.com/movie/ 11734 Content-Length: 227 11736 v=0 11737 o=- 2890844256 2890842807 IN IP4 192.0.2.211 11738 s=I contain 11739 i= 11740 e=adm@example.com 11741 c=IN IP4 0.0.0.0 11742 a=control:* 11743 t=0 0 11744 m=video 8002 RTP/AVP 31 11745 a=control:trackID=1 11746 m=audio 8004 RTP/AVP 3 11747 a=control:trackID=2 11749 In this example, the client is recommended to establish a single RTSP 11750 session to the server, and uses the URIs 11751 rtsp://example.com/movie/trackID=1 and 11752 rtsp://example.com/movie/trackID=2 to set up the video and audio 11753 streams, respectively. The URI rtsp://example.com/movie/, which is 11754 resolved from the "*", controls the whole presentation (movie). 11756 A client is not required to issues SETUP requests for all streams 11757 within an aggregate object. Servers should allow the client to ask 11758 for only a subset of the streams. 11760 D.4. Grouping of Media Lines in SDP 11762 For some types media it is desirable to express a relationship 11763 between various media components, for instance, for lip 11764 synchronization or Scalable Video Codec (SVC) [RFC5583]. This 11765 relationship is expressed on the SDP level by grouping of media 11766 lines, as described in [RFC3388] and can be exposed to RTSP. 11768 For RTSP it is mainly important to know how to handle grouped medias 11769 received by means of SDP, i.e., if the media are under aggregate 11770 control (see Appendix D.3) or if aggregate control is not available 11771 (see Appendix D.2). 11773 It is RECOMMENDED that grouped medias are handled by aggregate 11774 control, to give the client the ability to control either the whole 11775 presentation or single medias. 11777 Editor's note: how should the dependencies in [RFC5583] be handled 11778 in RTSP? 11780 D.5. RTSP external SDP delivery 11782 There are some considerations that need to be made when the session 11783 description is delivered to the client outside of RTSP, for example 11784 via HTTP or email. 11786 First of all, the SDP needs to contain absolute URIs, since relative 11787 will in most cases not work as the delivery will not correctly 11788 forward the base URI. 11790 The writing of the SDP session availability information, i.e. "t=" 11791 and "r=", needs to be carefully considered. When the SDP is fetched 11792 by the DESCRIBE method, the probability that it is valid is very 11793 high. However, the same are much less certain for SDPs distributed 11794 using other methods. Therefore the publisher of the SDP should take 11795 care to follow the recommendations about availability in the SDP 11796 specification [RFC4566]. 11798 Appendix E. RTSP Use Cases 11800 This Appendix describes the most important and considered use cases 11801 for RTSP. They are listed in descending order of importance in 11802 regards to ensuring that all necessary functionality is present. 11803 This specification only fully supports usage of the two first. Also 11804 in these first two cases, there are special cases or exceptions that 11805 are not supported without extensions, e.g. the redirection of media 11806 delivery to another address than the controlling agent's (client's). 11808 E.1. On-demand Playback of Stored Content 11810 An RTSP capable server stores content suitable for being streamed to 11811 a client. A client desiring playback of any of the stored content 11812 uses RTSP to set up the media transport required to deliver the 11813 desired content. RTSP is then used to initiate, halt and manipulate 11814 the actual transmission (playout) of the content. RTSP is also 11815 required to provide necessary description and synchronization 11816 information for the content. 11818 The above high level description can be broken down into a number of 11819 functions that RTSP needs to be capable of. 11821 Presentation Description: Provide initialization information about 11822 the presentation (content); for example, which media codecs are 11823 needed for the content. Other information that is important 11824 includes the number of media stream the presentation contains, 11825 the transport protocols used for the media streams, and 11826 identifiers for these media streams. This information is 11827 required before setup of the content is possible and to 11828 determine if the client is even capable of using the content. 11830 This information need not be sent using RTSP; other external 11831 protocols can be used to transmit the transport presentation 11832 descriptions. Two good examples are the use of HTTP [RFC2616] 11833 or email to fetch or receive presentation descriptions like SDP 11834 [RFC4566] 11836 Setup: Set up some or all of the media streams in a presentation. 11837 The setup itself consist of selecting the protocol for media 11838 transport and the necessary parameters for the protocol, like 11839 addresses and ports. 11841 Control of Transmission: After the necessary media streams have been 11842 established the client can request the server to start 11843 transmitting the content. The client must be allowed to start 11844 or stop the transmission of the content at arbitrary times. 11845 The client must also be able to start the transmission at any 11846 point in the timeline of the presentation. 11848 Synchronization: For media transport protocols like RTP [RFC3550] it 11849 might be beneficial to carry synchronization information within 11850 RTSP. This may be due to either the lack of inter-media 11851 synchronization within the protocol itself, or the potential 11852 delay before the synchronization is established (which is the 11853 case for RTP when using RTCP). 11855 Termination: Terminate the established contexts. 11857 For this use case there are a number of assumptions about how it 11858 works. These are: 11860 On-Demand content: The content is stored at the server and can be 11861 accessed at any time during a time period when it is intended 11862 to be available. 11864 Independent sessions: A server is capable of serving a number of 11865 clients simultaneously, including from the same piece of 11866 content at different points in that presentations time-line. 11868 Unicast Transport: Content for each individual client is transmitted 11869 to them using unicast traffic. 11871 It is also possible to redirect the media traffic to a different 11872 destination than that of the agent controlling the traffic. However, 11873 allowing this without appropriate mechanisms for checking that the 11874 destination approves of this allows for distributed denial of service 11875 attacks (DDoS). 11877 E.2. Unicast Distribution of Live Content 11879 This use case is similar to the above on-demand content case (see 11880 Appendix E.1) the difference is the nature of the content itself. 11881 Live content is continuously distributed as it becomes available from 11882 a source; i.e., the main difference from on-demand is that one starts 11883 distributing content before the end of it has become available to the 11884 server. 11886 In many cases the consumer of live content is only interested in 11887 consuming what is actually happens "now"; i.e., very similar to 11888 broadcast TV. However, in this case it is assumed that there exist 11889 no broadcast or multicast channel to the users, and instead the 11890 server functions as a distribution node, sending the same content to 11891 multiple receivers, using unicast traffic between server and client. 11892 This unicast traffic and the transport parameters are individually 11893 negotiated for each receiving client. 11895 Another aspect of live content is that it often has a very limited 11896 time of availability, as it is only is available for the duration of 11897 the event the content covers. An example of such a live content 11898 could be a music concert which lasts 2 hour and starts at a 11899 predetermined time. Thus there is need to announce when and for how 11900 long the live content is available. 11902 In some cases, the server providing live content may be saving some 11903 or all of the content to allow clients to pause the stream and resume 11904 it from the paused point, or to "rewind" and play continuously from a 11905 point earlier than the live point. Hence, this use case does not 11906 necessarily exclude playing from other than the live point of the 11907 stream, playing with scales other than 1.0, etc. 11909 E.3. On-demand Playback using Multicast 11911 It is possible to use RTSP to request that media be delivered to a 11912 multicast group. The entity setting up the session (the controller) 11913 will then control when and what media is delivered to the group. 11914 This use case has some potential for denial of service attacks by 11915 flooding a multicast group. Therefore, a mechanism is needed to 11916 indicate that the group actually accepts the traffic from the RTSP 11917 server. 11919 An open issue in this use case is how one ensures that all receivers 11920 listening to the multicast or broadcast receives the session 11921 presentation configuring the receivers. This specification has to 11922 rely on a external solution to solve this issue. 11924 E.4. Inviting an RTSP server into a conference 11926 If one has an established conference or group session, it is possible 11927 to have an RTSP server distribute media to the whole group. 11928 Transmission to the group is simplest when controlled by a single 11929 participant or leader of the conference. Shared control might be 11930 possible, but would require further investigation and possibly 11931 extensions. 11933 This use case assumes that there exists either multicast or a 11934 conference focus that redistribute media to all participants. 11936 This use case is intended to be able to handle the following 11937 scenario: A conference leader or participant (hereafter called the 11938 controller) has some pre-stored content on an RTSP server that he 11939 wants to share with the group. The controller sets up an RTSP 11940 session at the streaming server for this content and retrieves the 11941 session description for the content. The destination for the media 11942 content is set to the shared multicast group or conference focus. 11944 When desired by the controller, he/she can start and stop the 11945 transmission of the media to the conference group. 11947 There are several issues with this use case that are not solved by 11948 this core specification for RTSP: 11950 Denial of service: To avoid an RTSP server from being an unknowing 11951 participant in a denial of service attack the server needs to 11952 be able to verify the destination's acceptance of the media. 11953 Such a mechanism to verify the approval of received media does 11954 not yet exist; instead, only policies can be used, which can be 11955 made to work in controlled environments. 11957 Distributing the presentation description to all participants in the 11958 group: To enable a media receiver to correctly decode the content 11959 the media configuration information needs to be distributed 11960 reliably to all participants. This will most likely require 11961 support from an external protocol. 11963 Passing control of the session: If it is desired to pass control of 11964 the RTSP session between the participants, some support will be 11965 required by an external protocol to exchange state information 11966 and possibly floor control of who is controlling the RTSP 11967 session. 11969 If there interest in this use case, further work is required on the 11970 necessary extensions. 11972 E.5. Live Content using Multicast 11974 This use case in its simplest form does not require any use of RTSP 11975 at all; this is what multicast conferences being announced with SAP 11976 [RFC2974] and SDP are intended to handle. However, in use cases 11977 where more advanced features like access control to the multicast 11978 session are desired, RTSP could be used for session establishment. 11980 A client desiring to join a live multicasted media session with 11981 cryptographic (encryption) access control could use RTSP in the 11982 following way. The source of the session announces the session and 11983 gives all interested an RTSP URI. The client connects to the server 11984 and requests the presentation description, allowing configuration for 11985 reception of the media. In this step it is possible for the client 11986 to use secured transport and any desired level of authentication; for 11987 example, for billing or access control. An RTSP link also allows for 11988 load balancing between multiple servers. 11990 If these were the only goals, they could be achieved by simply using 11991 HTTP. However, for cases where the sender likes to keep track of 11992 each individual receiver of a session, and possibly use the session 11993 as a side channel for distributing key-updates or other information 11994 on a per-receiver basis, and the full set of receivers is not know 11995 prior to the session start, the state establishment that RTSP 11996 provides can be beneficial. In this case a client would establish an 11997 RTSP session for this multicast group with the RTSP server. The RTSP 11998 server will not transmit any media, but instead will point to the 11999 multicast group. The client and server will be able to keep the 12000 session alive for as long as the receiver participates in the session 12001 thus enabling, for example, the server to push updates to the client. 12003 This use case will most likely not be able to be implemented without 12004 some extensions to the server-to-client push mechanism. Here the 12005 PLAY_NOTIFY method (see Section 13.5) with a suitable extension could 12006 provide clear benefits. 12008 Appendix F. Text format for Parameters 12010 A resource of type "text/parameters" consists of either 1) a list of 12011 parameters (for a query) or 2) a list of parameters and associated 12012 values (for an response or setting of the parameter). Each entry of 12013 the list is a single line of text. Parameters are separated from 12014 values by a colon. The parameter name MUST only use US-ASCII visible 12015 characters while the values are UTF-8 text strings. The media type 12016 registration form is in Section 22.16. 12018 There exist a potential interoperability issue for this format. It 12019 was named in RFC 2326 but never defined, even if used in examples 12020 that hint at the syntax. This format matches the purpose and its 12021 syntax supports the examples provided. However, it goes further by 12022 allowing UTF-8 in the value part, thus usage of UTF-8 strings may not 12023 be supported. However, as individual parameters are not defined, the 12024 using application anyway needs to have out-of-band agreement or using 12025 feature-tag to determine if the end-point supports the parameters. 12027 The ABNF [RFC5234] grammar for "text/parameters" content is: 12029 file = *((parameter / parameter-value) CRLF) 12030 parameter = 1*visible-except-colon 12031 parameter-value = parameter *WSP ":" value 12032 visible-except-colon = %x21-39 / %x3B-7E ; VCHAR - ":" 12033 value = *(TEXT-UTF8char / WSP) 12034 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 12035 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 12036 / %xE0-EF 2UTF8-CONT 12037 / %xF0-F7 3UTF8-CONT 12038 / %xF8-FB 4UTF8-CONT 12039 / %xFC-FD 5UTF8-CONT 12040 UTF8-CONT = %x80-BF 12041 WSP = ; Space or HTAB 12042 VCHAR = 12043 CRLF = 12045 Appendix G. Requirements for Unreliable Transport of RTSP 12047 This section provides anyone intending to define how to transport of 12048 RTSP messages over a unreliable transport protocol with some 12049 information learned by the attempt in RFC 2326 [RFC2326]. RFC 2326 12050 define both an URI scheme and some basic functionality for transport 12051 of RTSP messages over UDP, however, it was not sufficient for 12052 reliable usage and successful interoperability. 12054 The RTSP scheme defined for unreliable transport of RTSP messages was 12055 "rtspu". It has been reserved by this specification as at least one 12056 commercial implementation exist, thus avoiding any collisions in the 12057 name space. 12059 The following considerations should exist for operation of RTSP over 12060 an unreliable transport protocol: 12062 o Request shall be acknowledged by the receiver. If there is no 12063 acknowledgement, the sender may resend the same message after a 12064 timeout of one round-trip time (RTT). Any retransmissions due to 12065 lack of acknowledgement must carry the same sequence number as the 12066 original request. 12068 o The round-trip time can be estimated as in TCP (RFC 1123) 12069 [RFC1123], with an initial round-trip value of 500 ms. An 12070 implementation may cache the last RTT measurement as the initial 12071 value for future connections. 12073 o If RTSP is used over a small-RTT LAN, standard procedures for 12074 optimizing initial TCP round trip estimates, such as those used in 12075 T/TCP (RFC 1644) [RFC1644], can be beneficial. 12077 o The Timestamp header (Section 16.51) is used to avoid the 12078 retransmission ambiguity problem [Stevens98]. 12080 o The registered default port for RTSP over UDP for the server is 12081 554. 12083 o RTSP messages can be carried over any lower-layer transport 12084 protocol that is 8-bit clean. 12086 o RTSP messages are vulnerable to bit errors and should not be 12087 subjected to them. 12089 o Source authentication, or at least validation that RTSP messages 12090 comes from the same entity becomes extremely important, as session 12091 hijacking may be substantially easier for RTSP message transport 12092 using an unreliable protocol like UDP than for TCP. 12094 There exist two RTSP headers thats primarily are intended for being 12095 used by the unreliable handling of RTSP messages and which will be 12096 maintained: 12098 o [CSeq] See Section 16.19 12100 o [Timestamp] See Section 16.51 12102 Appendix H. Backwards Compatibility Considerations 12104 This section contains notes on issues about backwards compatibility 12105 with clients or servers being implemented according to RFC 2326 12106 [RFC2326]. Note that there exist no requirement to implement RTSP 12107 1.0, in fact we recommend against it as it is difficult to do in an 12108 interoperable way. 12110 A server implementing RTSP/2.0 MUST include a RTSP-Version of 12111 RTSP/2.0 in all responses to requests containing RTSP-Version 12112 RTSP/2.0. If a server receives a RTSP/1.0 request, it MAY respond 12113 with a RTSP/1.0 response if it chooses to support RFC 2326. If the 12114 server chooses not to support RFC 2326, it MUST respond with a 505 12115 (RTSP Version not supported) status code. A server MUST NOT respond 12116 to a RTSP-Version RTSP/1.0 request with a RTSP-Version RTSP/2.0 12117 response. 12119 Clients implementing RTSP/2.0 MAY use an OPTIONS request with a RTSP- 12120 Version of 2.0 to determine whether a server supports RTSP/2.0. If 12121 the server responds with either a RTSP-Version of 1.0 or a status 12122 code of 505 (RTSP Version not supported), the client will have to use 12123 RTSP/1.0 requests if it chooses to support RFC 2326. 12125 H.1. Play Request in Play mode 12127 The behavior in the server when a Play is received in Play mode has 12128 changed (Section 13.4). In RFC 2326, the new PLAY request would be 12129 queued until the current Play completed. Any new PLAY request now 12130 take effect immediately replacing the previous request. 12132 H.2. Using Persistent Connections 12134 Some server implementations of RFC 2326 maintain a one-to-one 12135 relationship between a connection and an RTSP session. Such 12136 implementations require clients to use a persistent connection to 12137 communicate with the server and when a client closes its connection, 12138 the server may remove the RTSP session. This is worth noting if a 12139 RTSP 2.0 client also supporting 1.0 connects to a 1.0 server. 12141 Appendix I. Open Issues 12143 Open issues are filed and tracked in the bug and feature trackers at 12144 http://rtspspec.sourceforge.net. Open issues are discussed on MMUSIC 12145 list (mmusic@ietf.org). 12147 Note to RFC-editor: Please remove this section before publication of 12148 this document as an RFC. 12150 Appendix J. Changes 12152 This appendix briefly lists the differences between RTSP 1.0 12153 [RFC2326] and RTSP 2.0 for an informational purpose. For 12154 implementers of RTSP 2.0 it is recommended to read carefully through 12155 this memo and not to rely on the list of changes below to adapt from 12156 RTSP 1.0 to RTSP 2.0, as RTSP 2.0 is not intended to be backwards 12157 compatible with RTSP 1.0 [RFC2326] other than the version negotiation 12158 mechanism. 12160 J.1. Brief Overview 12162 The following protocol elements were removed in RTSP 2.0 compared to 12163 RTSP 1.0: 12165 o there is no section on minimal implementation anymore, but more 12166 the definition of RTSP 2.0 core; 12168 o the RECORD and ANNOUNCE methods and all related functionality 12169 (including 201 (Created) and 250 (Low On Storage Space) status 12170 codes); 12172 o the use of UDP for RTSP message transport was removed due to 12173 missing interest and to broken specification; 12175 o the use of PLAY method for keep-alive in play state. 12177 The following protocol elements were added or changed in RTSP 2.0 12178 compared to RTSP 1.0: 12180 o RTSP session TEARDOWN from the server to the client; 12182 o IPv6 support; 12184 o extended IANA registries (e.g., transport headers parameters, 12185 transport-protocol, profile, lower-transport, and mode); 12187 o request pipelinig for quick session start-up; 12189 o fully reworked state-machine; 12191 o RTSP messages now uses URIs rather then URLs; 12193 o incorporated much of related HTTP text ([RFC2616]) in this memo, 12194 compared to just referencing the sections in HTTP, to avoid 12195 ambiguities; 12197 o the REDIRECT method was expanded and diversified for different 12198 situations; 12200 o Includes a new section about how to setup different media 12201 transport alternatives and their profiles, and lower layer 12202 protocols. This resulted that the appendix on RTP interaction was 12203 moved there instead in the part describing RTP. The section also 12204 includes guidelines what to consider when writing usage guidelines 12205 for new protocols and profiles; 12207 o added an asynchronous notification method PLAY_NOTIFY. This 12208 method is used by the RTSP server to asynchronously notify clients 12209 about session changes while in play state. To a limited extend 12210 this is comparable with some implementations of ANNOUNCE in RTSP 12211 1.0 not intended for Recording. 12213 J.2. Detailed List of Changes 12215 Compared to RTSP 1.0 (RFC 2326), the below changes has been made when 12216 defining RTSP 2.0. Note that this list does not reflect minor 12217 changes in wording or correction of typographical errors. 12219 o The section on minimal implementation was deleted without 12220 substitution. 12222 o The Transport header has been changed in the following way: 12224 * The ABNF has been changed to define that extensions are 12225 possible, and that unknown extension parameters are to be 12226 ignored. 12228 * To prevent backwards compatibility issues, any extension or new 12229 parameter requires the usage of a feature-tag combined with the 12230 Require header. 12232 * Syntax unclarities with the Mode parameter has been resolved. 12234 * Syntax error with ";" for multicast and unicast has been 12235 resolved. 12237 * Two new addressing parameters has been defined, src_addr and 12238 dest_addr. These replaces the parameters "port", 12239 "client_port", "server_port", "destination", "source". 12241 * Support for IPv6 explicit addresses in all address fields has 12242 been included. 12244 * To handle URI definitions that contain ";" or "," a quoted URI 12245 format has been introduced and is required. 12247 * Defined IANA registries for the transport headers parameters, 12248 transport-protocol, profile, lower-transport, and mode. 12250 * The transport headers interleaved parameter's text was made 12251 more strict and use formal requirements levels. It was also 12252 clarified that the interleaved channels are symmetric and that 12253 it is the server that sets the channel numbers. 12255 * It has been clarified that the client can't request of the 12256 server to use a certain RTP SSRC, using a request with the 12257 transport parameter SSRC. 12259 * Syntax definition for SSRC has been clarified to require 8HEX. 12260 It has also been extended to allow multiple values for clients 12261 supporting this version. 12263 * Clarified the text on the transport headers "dest_addr" 12264 parameters regarding what security precautions the server is 12265 required to perform. 12267 o The Range formats has been changed in the following way: 12269 * The NPT format has been given a initial NPT identifier that 12270 must now be used. 12272 * All formats now support initial open ended formats of type 12273 "npt=-10" and also format only "Range: smpte" ranges for usage 12274 with GET_PARAMETER requests. 12276 o RTSP message handling has been changed in the following way: 12278 * RTSP messages now uses URIs rather then URLs. 12280 * It has been clarified that a 4xx message due to missing CSeq 12281 header shall be returned without a CSeq header. 12283 * The 300 (Multiple Choices) response code has been removed. 12285 * Rules for how to handle timing out RTSP messages has been 12286 added. 12288 * Extended Pipelining rules allowing for quick session startup. 12290 o The HTTP references has been updated to RFC 2616 and RFC 2617. 12291 Most of text has been copied and then altered to fit RTSP into 12292 this specification. Public, and the Content-Base header has also 12293 been imported from RFC 2068 so that they are defined in the RTSP 12294 specification. Known effects on RTSP due to HTTP clarifications: 12296 * Content-Encoding header can include encoding of type 12297 "identity". 12299 o The state machine section has completely been rewritten. It 12300 includes now more details and are also more clear about the model 12301 used. 12303 o A IANA section has been included with contains a number of 12304 registries and their rules. This will allow us to use IANA to 12305 keep track of RTSP extensions. 12307 o The transport of RTSP messages has seen the following changes: 12309 * The use of UDP for RTSP message transport has been deprecated 12310 due to missing interest and to broken specification. 12312 * The rules for how TCP connections is to be handled has been 12313 clarified. Now it is made clear that servers should not close 12314 the TCP connection unless they have been unused for significant 12315 time. 12317 * Strong recommendations why server and clients should use 12318 persistent connections has also been added. 12320 * There is now a requirement on the servers to handle non- 12321 persistent connections as this provides fault tolerance. 12323 * Added wording on the usage of Connection:Close for RTSP. 12325 * specified usage of TLS for RTSP messages, including a scheme to 12326 approve a proxies TLS connection to the next hop. 12328 o The following header related changes have been made: 12330 * Accept-Ranges response header is added. This header clarifies 12331 which range formats that can be used for a resource. 12333 * Fixed the missing definitions for the Cache-Control header. 12334 Also added to the syntax definition the missing delta-seconds 12335 for max-stale and min-fresh parameters. 12337 * Put requirement on CSeq header that the value is increased by 12338 one for each new RTSP request. A Recommendation to start at 1 12339 has also been added. 12341 * Added requirement that the Date header must be used for all 12342 messages with message body and the Server should always include 12343 it. 12345 * Removed possibility of using Range header with Scale header to 12346 indicate when it is to be activated, since it can't work as 12347 defined. Also added rule that lack of Scale header in response 12348 indicates lack of support for the header. Feature-tags for 12349 scaled playback has been defined. 12351 * The Speed header must now be responded to indicate support and 12352 the actual speed going to be used. A feature-tag is defined. 12353 Notes on congestion control was also added. 12355 * The Supported header was borrowed from SIP [RFC3261] to help 12356 with the feature negotiation in RTSP. 12358 * Clarified that the Timestamp header can be used to resolve 12359 retransmission ambiguities. 12361 * The Session header text has been expanded with a explanation on 12362 keep alive and which methods to use. SET_PARAMETER is now 12363 recommended to use if only keep-alive within RTSP is desired. 12365 * It has been clarified how the Range header formats is used to 12366 indicate pause points in the PAUSE response. 12368 * Clarified that RTP-Info URIs that are relative, use the 12369 Request-URI as base URI. Also clarified that the used URI must 12370 be the one that was used in the SETUP request. The URIs are 12371 now also required to be quoted. The header also expresses the 12372 SSRC for the provided RTP timestamp and sequence number values. 12374 * Added text that requires the Range to always be present in PLAY 12375 responses. Clarified what should be sent in case of live 12376 streams. 12378 * The headers table has been updated using a structured borrowed 12379 from SIP. Those tables carries much more information and 12380 should provide a good overview of the available headers. 12382 * It has been clarified that any message with a message body is 12383 required to have a Content-Length header. This was the case in 12384 RFC 2326, but could be misinterpreted. 12386 * ETag has changed name to MTag. 12388 * To resolve functionality around MTag. The MTag and If-None- 12389 Match header has been added from HTTP with necessary 12390 clarification in regards to RTSP operation. 12392 * Imported the Public header from HTTP RFC 2068 [RFC2068] since 12393 it has been removed from HTTP due to lack of use. Public is 12394 used quite frequently in RTSP. 12396 * Clarified rules for populating the Public header so that it is 12397 an intersection of the capabilities of all the RTSP agents in a 12398 chain. 12400 * Added the Media-Range header for listing the current 12401 availability of the media range. 12403 * Added the Notify-Reason header for giving the reason when 12404 sending PLAY_NOTIFY requests. 12406 * A new header Seek-Style has been defined to direct and inform 12407 how any seek operation should/have been performed. 12409 o The Protocol Syntax has been changed in the following way: 12411 * All ABNF definitions are updated according to the rules defined 12412 in RFC 5234 [RFC5234] and has been gathered in a separate 12413 Section 20. 12415 * The ABNF for the User-Agent and Server headers has been 12416 corrected. 12418 * Some definitions in the introduction regarding the RTSP session 12419 has been changed. 12421 * The protocol has been made fully IPv6 capable. 12423 * Added a fragment part to the RTSP URI. This seem to be 12424 indicated by the note below the definition, however, it was not 12425 part of the ABNF. 12427 * The CHAR rule has been changed to exclude NULL. 12429 o The Status codes have been changed in the following way: 12431 * The use of status code 303 "See Other" has been deprecated as 12432 it does not make sense to use in RTSP. 12434 * When sending response 451 and 458 the response body should 12435 contain the offending parameters. 12437 * Clarification on when a 3rr redirect status code can be 12438 received has been added. This includes receiving 3rr as a 12439 result of request within a established session. This provides 12440 clarification to a previous unspecified behavior. 12442 * Removed the 201 (Created) and 250 (Low On Storage Space) status 12443 codes as they are only relevant to recording, which is 12444 deprecated. 12446 * Several new Status codes has been defined: 464 "Data Transport 12447 Not Ready Yet", 465 "Notification Reason Unknown", 470 12448 "Connection Authorization Required", 471 "Connection 12449 Credentials not accepted", 472 "Failure to establish secure 12450 connection". 12452 o The following functionality has been deprecated from the protocol: 12454 * The use of Queued Play. 12456 * The use of PLAY method for keep-alive in play state. 12458 * The RECORD and ANNOUNCE methods and all related functionality. 12459 Some of the syntax has been removed. 12461 * The possibility to use timed execution of methods with the time 12462 parameter in the Range header. 12464 * The description on how rtspu works is not part of the core 12465 specification and will require external description. Only that 12466 it exist is defined here and some requirements for the 12467 transport is provided. 12469 o The following changes has been made in relation to methods: 12471 * The OPTIONS method has been clarified with regards to the use 12472 of the Public and Allow headers. 12474 * Added text clarifying the usage of SET_PARAMETER for keep-alive 12475 and usage without any body. 12477 * PLAY method is now allowed to be pipelined with the pipelining 12478 of one or more SETUP requests following the initial that 12479 generates the session for aggregated control. 12481 * REDIRECT has been expanded and diversified for different 12482 situations. 12484 * Added a new method PLAY_NOTIFY. This method is used by the 12485 RTSP server to asynchronously notify clients about session 12486 changes. 12488 o Wrote a new section about how to setup different media transport 12489 alternatives and their profiles, and lower layer protocols. This 12490 resulted that the appendix on RTP interaction was moved there 12491 instead in the part describing RTP. The section also includes 12492 guidelines what to consider when writing usage guidelines for new 12493 protocols and profiles. 12495 o Setup and usage of independent TCP connections for transport of 12496 RTP has been specified. 12498 o Added a new section describing the available mechanisms to 12499 determine if functionality is supported, called "Capability 12500 Handling". Renamed option-tags to feature-tags. 12502 o Added a contributors section with people who have contributed 12503 actual text to the specification. 12505 o Added a section Use Cases that describes the major use cases for 12506 RTSP. 12508 o Clarified the usage of a=range and how to indicate live content 12509 that are not seekable with this header. 12511 o Text specifying the special behavior of PLAY for live content. 12513 Appendix K. Acknowledgements 12515 This memorandum defines RTSP version 2.0 which is a revision of the 12516 Proposed Standard RTSP version 1.0 which is defined in [RFC2326]. 12517 The authors of RFC 2326 are Henning Schulzrinne, Anup Rao, and Robert 12518 Lanphier. 12520 Both RTSP version 1.0 and RTSP version 2.0 borrow format and 12521 descriptions from HTTP/1.1. 12523 This document has benefited greatly from the comments of all those 12524 participating in the MMUSIC-WG. In addition to those already 12525 mentioned, the following individuals have contributed to this 12526 specification: 12528 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 12529 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 12530 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 12531 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 12532 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Ingemar Johansson, 12533 Anders Klemets, Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo 12534 F. Llach, Thomas Marshall, Rob McCool, David Oran, Joerg Ott, Maria 12535 Papadopouli, Sujal Patel, Ema Patki, Alagu Periyannan, Colin Perkins, 12536 Igor Plotnikov, Jonathan Sergent, Pinaki Shah, David Singer, Lior 12537 Sion, Jeff Smith, Alexander Sokolsky, Dale Stammen, John Francis 12538 Stracke, Maureen Chesire, David Walker, Geetha Srikantan, Stephan 12539 Wenger, Pekka Pessi, Jae-Hwan Kim, Holger Schmidt, Stephen Farrell, 12540 Xavier Marjou, Joe Pallas, Martti Mela, and Patrick Hoffman. 12542 K.1. Contributors 12544 The following people have made written contributions that were 12545 included in the specification: 12547 o Tom Marshall contributed text on the usage of 3rr status codes. 12549 o Thomas Zheng contributed text on the usage of the Range in PLAY 12550 responses and proposed an earlier version of the PLAY_NOTIFY 12551 method. 12553 o Sean Sheedy contributed text on the timeout behavior of RTSP 12554 messages and connections, the 463 status code, and proposed an 12555 earlier version of the PLAY_NOTIFY method. 12557 o Greg Sherwood proposed an earlier version of the PLAY_NOTIFY 12558 method. 12560 o Fredrik Lindholm contributed text about the RTSP security 12561 framework. 12563 o John Lazzaro contributed the text for RTP over Independent TCP. 12565 o Aravind Narasimhan contributed by rewriting Media Transport 12566 Alternatives (Appendix C) and editorial improvements on a number 12567 of places in the specification. 12569 o Torbjorn Einarsson has done some editorial approvements of the 12570 text. 12572 Appendix L. RFC Editor Consideration 12574 Please replace RFC XXXX with the RFC number this specification 12575 receives. 12577 Authors' Addresses 12579 Henning Schulzrinne 12580 Columbia University 12581 1214 Amsterdam Avenue 12582 New York, NY 10027 12583 USA 12585 Email: schulzrinne@cs.columbia.edu 12587 Anup Rao 12588 Cisco 12589 USA 12591 Email: anrao@cisco.com 12593 Rob Lanphier 12594 Seattle, WA 12595 USA 12597 Email: robla@robla.net 12599 Magnus Westerlund 12600 Ericsson AB 12601 Faeroegatan 6 12602 STOCKHOLM, SE-164 80 12603 SWEDEN 12605 Email: magnus.westerlund@ericsson.com 12607 Martin Stiemerling 12608 NEC Laboratories Europe, NEC Europe Ltd. 12609 Kurfuersten-Anlage 36 12610 Heidelberg 69115 12611 Germany 12613 Phone: +49 (0) 6221 4342 113 12614 Email: stiemerling@nw.neclab.eu