idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-31.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 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 (February 25, 2013) is 4078 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 4670, but not defined == Missing Reference: 'RFC 2326' is mentioned on line 4956, but not defined ** Obsolete undefined reference: RFC 2326 (Obsoleted by RFC 7826) == Missing Reference: 'H15' is mentioned on line 8821, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 9428, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-pub-180-2' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2460 (Obsoleted by RFC 8200) ** 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 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) ** Obsolete normative reference: RFC 5751 (Obsoleted by RFC 8551) -- Possible downref: Non-RFC (?) normative reference: ref. 'TS-26234' == Outdated reference: A later version (-22) exists of draft-ietf-mmusic-rtsp-nat-14 -- 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 2822 (Obsoleted by RFC 5322) Summary: 12 errors (**), 0 flaws (~~), 7 warnings (==), 10 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: August 29, 2013 R. Lanphier 7 M. Westerlund 8 Ericsson AB 9 M. Stiemerling (Ed.) 10 NEC 11 February 25, 2013 13 Real Time Streaming Protocol 2.0 (RTSP) 14 draft-ietf-mmusic-rfc2326bis-31 16 Abstract 18 This memorandum defines RTSP version 2.0 which obsoletes RTSP version 19 1.0 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 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). Note that other groups may also distribute 38 working documents as Internet-Drafts. The list of current Internet- 39 Drafts is at http://datatracker.ietf.org/drafts/current/. 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 This Internet-Draft will expire on August 29, 2013. 48 Copyright Notice 50 Copyright (c) 2013 IETF Trust and the persons identified as the 51 document authors. All rights reserved. 53 This document is subject to BCP 78 and the IETF Trust's Legal 54 Provisions Relating to IETF Documents 55 (http://trustee.ietf.org/license-info) in effect on the date of 56 publication of this document. Please review these documents 57 carefully, as they describe your rights and restrictions with respect 58 to this document. Code Components extracted from this document must 59 include Simplified BSD License text as described in Section 4.e of 60 the Trust Legal Provisions and are provided without warranty as 61 described in the Simplified BSD License. 63 This document may contain material from IETF Documents or IETF 64 Contributions published or made publicly available before November 65 10, 2008. The person(s) controlling the copyright in some of this 66 material may not have granted the IETF Trust the right to allow 67 modifications of such material outside the IETF Standards Process. 68 Without obtaining an adequate license from the person(s) controlling 69 the copyright in such materials, this document may not be modified 70 outside the IETF Standards Process, and derivative works of it may 71 not be created outside the IETF Standards Process, except to format 72 it for publication as an RFC or to translate it into languages other 73 than English. 75 Table of Contents 77 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 11 78 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 13 79 2.1. Presentation Description . . . . . . . . . . . . . . . . 13 80 2.2. Session Establishment . . . . . . . . . . . . . . . . . 14 81 2.3. Media Delivery Control . . . . . . . . . . . . . . . . . 15 82 2.4. Session Parameter Manipulations . . . . . . . . . . . . 17 83 2.5. Media Delivery . . . . . . . . . . . . . . . . . . . . . 17 84 2.5.1. Media Delivery Manipulations . . . . . . . . . . . . 18 85 2.6. Session Maintenance and Termination . . . . . . . . . . 20 86 2.7. Extending RTSP . . . . . . . . . . . . . . . . . . . . . 21 87 3. Document Conventions . . . . . . . . . . . . . . . . . . . . 23 88 3.1. Notational Conventions . . . . . . . . . . . . . . . . . 23 89 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . 23 90 4. Protocol Parameters . . . . . . . . . . . . . . . . . . . . . 27 91 4.1. RTSP Version . . . . . . . . . . . . . . . . . . . . . . 27 92 4.2. RTSP IRI and URI . . . . . . . . . . . . . . . . . . . . 27 93 4.3. Session Identifiers . . . . . . . . . . . . . . . . . . 29 94 4.4. SMPTE Relative Timestamps . . . . . . . . . . . . . . . 29 95 4.5. Normal Play Time . . . . . . . . . . . . . . . . . . . . 30 96 4.6. Absolute Time . . . . . . . . . . . . . . . . . . . . . 31 97 4.7. Feature-Tags . . . . . . . . . . . . . . . . . . . . . . 31 98 4.8. Message Body Tags . . . . . . . . . . . . . . . . . . . 31 99 4.9. Media Properties . . . . . . . . . . . . . . . . . . . . 32 100 4.9.1. Random Access and Seeking . . . . . . . . . . . . . 33 101 4.9.2. Retention . . . . . . . . . . . . . . . . . . . . . 33 102 4.9.3. Content Modifications . . . . . . . . . . . . . . . 34 103 4.9.4. Supported Scale Factors . . . . . . . . . . . . . . 34 104 4.9.5. Mapping to the Attributes . . . . . . . . . . . . . 34 105 5. RTSP Message . . . . . . . . . . . . . . . . . . . . . . . . 35 106 5.1. Message Types . . . . . . . . . . . . . . . . . . . . . 35 107 5.2. Message Headers . . . . . . . . . . . . . . . . . . . . 35 108 5.3. Message Body . . . . . . . . . . . . . . . . . . . . . . 36 109 5.4. Message Length . . . . . . . . . . . . . . . . . . . . . 36 110 6. General Header Fields . . . . . . . . . . . . . . . . . . . . 38 111 7. Request . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 112 7.1. Request Line . . . . . . . . . . . . . . . . . . . . . . 39 113 7.2. Request Header Fields . . . . . . . . . . . . . . . . . 41 114 8. Response . . . . . . . . . . . . . . . . . . . . . . . . . . 43 115 8.1. Status-Line . . . . . . . . . . . . . . . . . . . . . . 43 116 8.1.1. Status Code and Reason Phrase . . . . . . . . . . . 43 117 8.2. Response Headers . . . . . . . . . . . . . . . . . . . . 46 118 9. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 48 119 9.1. Message-Body Header Fields . . . . . . . . . . . . . . . 48 120 9.2. Message Body . . . . . . . . . . . . . . . . . . . . . . 49 121 10. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 50 122 10.1. Reliability and Acknowledgements . . . . . . . . . . . . 50 123 10.2. Using Connections . . . . . . . . . . . . . . . . . . . 51 124 10.3. Closing Connections . . . . . . . . . . . . . . . . . . 53 125 10.4. Timing Out Connections and RTSP Messages . . . . . . . . 54 126 10.5. Showing Liveness . . . . . . . . . . . . . . . . . . . . 55 127 10.6. Use of IPv6 . . . . . . . . . . . . . . . . . . . . . . 56 128 10.7. Overload Control . . . . . . . . . . . . . . . . . . . . 56 129 11. Capability Handling . . . . . . . . . . . . . . . . . . . . . 58 130 12. Pipelining Support . . . . . . . . . . . . . . . . . . . . . 60 131 13. Method Definitions . . . . . . . . . . . . . . . . . . . . . 61 132 13.1. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . 62 133 13.2. DESCRIBE . . . . . . . . . . . . . . . . . . . . . . . . 63 134 13.3. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . 65 135 13.3.1. Changing Transport Parameters . . . . . . . . . . . 68 136 13.4. PLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 69 137 13.4.1. General Usage . . . . . . . . . . . . . . . . . . . 69 138 13.4.2. Aggregated Sessions . . . . . . . . . . . . . . . . 74 139 13.4.3. Updating current PLAY Requests . . . . . . . . . . . 75 140 13.4.4. Playing On-Demand Media . . . . . . . . . . . . . . 77 141 13.4.5. Playing Dynamic On-Demand Media . . . . . . . . . . 78 142 13.4.6. Playing Live Media . . . . . . . . . . . . . . . . . 78 143 13.4.7. Playing Live with Recording . . . . . . . . . . . . 79 144 13.4.8. Playing Live with Time-Shift . . . . . . . . . . . . 79 145 13.5. PLAY_NOTIFY . . . . . . . . . . . . . . . . . . . . . . 80 146 13.5.1. End-of-Stream . . . . . . . . . . . . . . . . . . . 81 147 13.5.2. Media-Properties-Update . . . . . . . . . . . . . . 82 148 13.5.3. Scale-Change . . . . . . . . . . . . . . . . . . . . 83 149 13.6. PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 84 150 13.7. TEARDOWN . . . . . . . . . . . . . . . . . . . . . . . . 87 151 13.7.1. Client to Server . . . . . . . . . . . . . . . . . . 87 152 13.7.2. Server to Client . . . . . . . . . . . . . . . . . . 88 153 13.8. GET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 89 154 13.9. SET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 91 155 13.10. REDIRECT . . . . . . . . . . . . . . . . . . . . . . . . 92 156 14. Embedded (Interleaved) Binary Data . . . . . . . . . . . . . 95 157 15. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 158 15.1. Proxies and Protocol Extensions . . . . . . . . . . . . 98 159 15.2. Multiplexing and Demultiplexing of Messages . . . . . . 99 160 16. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 161 16.1. Validation Model . . . . . . . . . . . . . . . . . . . . 100 162 16.1.1. Last-Modified Dates . . . . . . . . . . . . . . . . 102 163 16.1.2. Message Body Tag Cache Validators . . . . . . . . . 102 164 16.1.3. Weak and Strong Validators . . . . . . . . . . . . . 102 165 16.1.4. Rules for When to Use Message Body Tags and 166 Last-Modified Dates . . . . . . . . . . . . . . . . 104 167 16.1.5. Non-validating Conditionals . . . . . . . . . . . . 106 168 16.2. Invalidation After Updates or Deletions . . . . . . . . 106 169 17. Status Code Definitions . . . . . . . . . . . . . . . . . . . 108 170 17.1. Success 1xx . . . . . . . . . . . . . . . . . . . . . . 108 171 17.1.1. 100 Continue . . . . . . . . . . . . . . . . . . . . 108 172 17.2. Success 2xx . . . . . . . . . . . . . . . . . . . . . . 108 173 17.2.1. 200 OK . . . . . . . . . . . . . . . . . . . . . . . 108 174 17.3. Redirection 3xx . . . . . . . . . . . . . . . . . . . . 108 175 17.3.1. 301 Moved Permanently . . . . . . . . . . . . . . . 109 176 17.3.2. 302 Found . . . . . . . . . . . . . . . . . . . . . 109 177 17.3.3. 303 See Other . . . . . . . . . . . . . . . . . . . 109 178 17.3.4. 304 Not Modified . . . . . . . . . . . . . . . . . . 109 179 17.3.5. 305 Use Proxy . . . . . . . . . . . . . . . . . . . 110 180 17.4. Client Error 4xx . . . . . . . . . . . . . . . . . . . . 110 181 17.4.1. 400 Bad Request . . . . . . . . . . . . . . . . . . 110 182 17.4.2. 401 Unauthorized . . . . . . . . . . . . . . . . . . 110 183 17.4.3. 402 Payment Required . . . . . . . . . . . . . . . . 111 184 17.4.4. 403 Forbidden . . . . . . . . . . . . . . . . . . . 111 185 17.4.5. 404 Not Found . . . . . . . . . . . . . . . . . . . 111 186 17.4.6. 405 Method Not Allowed . . . . . . . . . . . . . . . 111 187 17.4.7. 406 Not Acceptable . . . . . . . . . . . . . . . . . 111 188 17.4.8. 407 Proxy Authentication Required . . . . . . . . . 112 189 17.4.9. 408 Request Timeout . . . . . . . . . . . . . . . . 112 190 17.4.10. 410 Gone . . . . . . . . . . . . . . . . . . . . . . 112 191 17.4.11. 411 Length Required . . . . . . . . . . . . . . . . 112 192 17.4.12. 412 Precondition Failed . . . . . . . . . . . . . . 113 193 17.4.13. 413 Request Message Body Too Large . . . . . . . . . 113 194 17.4.14. 414 Request-URI Too Long . . . . . . . . . . . . . . 113 195 17.4.15. 415 Unsupported Media Type . . . . . . . . . . . . . 113 196 17.4.16. 451 Parameter Not Understood . . . . . . . . . . . . 113 197 17.4.17. 452 reserved . . . . . . . . . . . . . . . . . . . . 114 198 17.4.18. 453 Not Enough Bandwidth . . . . . . . . . . . . . . 114 199 17.4.19. 454 Session Not Found . . . . . . . . . . . . . . . 114 200 17.4.20. 455 Method Not Valid in This State . . . . . . . . . 114 201 17.4.21. 456 Header Field Not Valid for Resource . . . . . . 114 202 17.4.22. 457 Invalid Range . . . . . . . . . . . . . . . . . 114 203 17.4.23. 458 Parameter Is Read-Only . . . . . . . . . . . . . 114 204 17.4.24. 459 Aggregate Operation Not Allowed . . . . . . . . 114 205 17.4.25. 460 Only Aggregate Operation Allowed . . . . . . . . 115 206 17.4.26. 461 Unsupported Transport . . . . . . . . . . . . . 115 207 17.4.27. 462 Destination Unreachable . . . . . . . . . . . . 115 208 17.4.28. 463 Destination Prohibited . . . . . . . . . . . . . 115 209 17.4.29. 464 Data Transport Not Ready Yet . . . . . . . . . . 115 210 17.4.30. 465 Notification Reason Unknown . . . . . . . . . . 115 211 17.4.31. 466 Key Management Error . . . . . . . . . . . . . . 116 212 17.4.32. 470 Connection Authorization Required . . . . . . . 116 213 17.4.33. 471 Connection Credentials not accepted . . . . . . 116 214 17.4.34. 472 Failure to establish secure connection . . . . . 116 215 17.5. Server Error 5xx . . . . . . . . . . . . . . . . . . . . 116 216 17.5.1. 500 Internal Server Error . . . . . . . . . . . . . 116 217 17.5.2. 501 Not Implemented . . . . . . . . . . . . . . . . 116 218 17.5.3. 502 Bad Gateway . . . . . . . . . . . . . . . . . . 117 219 17.5.4. 503 Service Unavailable . . . . . . . . . . . . . . 117 220 17.5.5. 504 Gateway Timeout . . . . . . . . . . . . . . . . 117 221 17.5.6. 505 RTSP Version Not Supported . . . . . . . . . . . 117 222 17.5.7. 551 Option not supported . . . . . . . . . . . . . . 117 223 18. Header Field Definitions . . . . . . . . . . . . . . . . . . 118 224 18.1. Accept . . . . . . . . . . . . . . . . . . . . . . . . . 128 225 18.2. Accept-Credentials . . . . . . . . . . . . . . . . . . . 128 226 18.3. Accept-Encoding . . . . . . . . . . . . . . . . . . . . 129 227 18.4. Accept-Language . . . . . . . . . . . . . . . . . . . . 130 228 18.5. Accept-Ranges . . . . . . . . . . . . . . . . . . . . . 131 229 18.6. Allow . . . . . . . . . . . . . . . . . . . . . . . . . 131 230 18.7. Authorization . . . . . . . . . . . . . . . . . . . . . 131 231 18.8. Bandwidth . . . . . . . . . . . . . . . . . . . . . . . 132 232 18.9. Blocksize . . . . . . . . . . . . . . . . . . . . . . . 133 233 18.10. Cache-Control . . . . . . . . . . . . . . . . . . . . . 133 234 18.11. Connection . . . . . . . . . . . . . . . . . . . . . . . 136 235 18.12. Connection-Credentials . . . . . . . . . . . . . . . . . 136 236 18.13. Content-Base . . . . . . . . . . . . . . . . . . . . . . 137 237 18.14. Content-Encoding . . . . . . . . . . . . . . . . . . . . 137 238 18.15. Content-Language . . . . . . . . . . . . . . . . . . . . 138 239 18.16. Content-Length . . . . . . . . . . . . . . . . . . . . . 139 240 18.17. Content-Location . . . . . . . . . . . . . . . . . . . . 139 241 18.18. Content-Type . . . . . . . . . . . . . . . . . . . . . . 140 242 18.19. CSeq . . . . . . . . . . . . . . . . . . . . . . . . . . 140 243 18.20. Date . . . . . . . . . . . . . . . . . . . . . . . . . . 141 244 18.21. Expires . . . . . . . . . . . . . . . . . . . . . . . . 142 245 18.22. From . . . . . . . . . . . . . . . . . . . . . . . . . . 143 246 18.23. If-Match . . . . . . . . . . . . . . . . . . . . . . . . 143 247 18.24. If-Modified-Since . . . . . . . . . . . . . . . . . . . 144 248 18.25. If-None-Match . . . . . . . . . . . . . . . . . . . . . 144 249 18.26. Last-Modified . . . . . . . . . . . . . . . . . . . . . 145 250 18.27. Location . . . . . . . . . . . . . . . . . . . . . . . . 145 251 18.28. Media-Properties . . . . . . . . . . . . . . . . . . . . 146 252 18.29. Media-Range . . . . . . . . . . . . . . . . . . . . . . 148 253 18.30. MTag . . . . . . . . . . . . . . . . . . . . . . . . . . 148 254 18.31. Notify-Reason . . . . . . . . . . . . . . . . . . . . . 149 255 18.32. Pipelined-Requests . . . . . . . . . . . . . . . . . . . 149 256 18.33. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . 150 257 18.34. Proxy-Authorization . . . . . . . . . . . . . . . . . . 150 258 18.35. Proxy-Require . . . . . . . . . . . . . . . . . . . . . 151 259 18.36. Proxy-Supported . . . . . . . . . . . . . . . . . . . . 151 260 18.37. Public . . . . . . . . . . . . . . . . . . . . . . . . . 152 261 18.38. Range . . . . . . . . . . . . . . . . . . . . . . . . . 153 262 18.39. Referrer . . . . . . . . . . . . . . . . . . . . . . . . 154 263 18.40. Request-Status . . . . . . . . . . . . . . . . . . . . . 155 264 18.41. Require . . . . . . . . . . . . . . . . . . . . . . . . 155 265 18.42. Retry-After . . . . . . . . . . . . . . . . . . . . . . 156 266 18.43. RTP-Info . . . . . . . . . . . . . . . . . . . . . . . . 157 267 18.44. Scale . . . . . . . . . . . . . . . . . . . . . . . . . 159 268 18.45. Seek-Style . . . . . . . . . . . . . . . . . . . . . . . 160 269 18.46. Server . . . . . . . . . . . . . . . . . . . . . . . . . 162 270 18.47. Session . . . . . . . . . . . . . . . . . . . . . . . . 162 271 18.48. Speed . . . . . . . . . . . . . . . . . . . . . . . . . 163 272 18.49. Supported . . . . . . . . . . . . . . . . . . . . . . . 164 273 18.50. Terminate-Reason . . . . . . . . . . . . . . . . . . . . 165 274 18.51. Timestamp . . . . . . . . . . . . . . . . . . . . . . . 165 275 18.52. Transport . . . . . . . . . . . . . . . . . . . . . . . 166 276 18.53. Unsupported . . . . . . . . . . . . . . . . . . . . . . 173 277 18.54. User-Agent . . . . . . . . . . . . . . . . . . . . . . . 173 278 18.55. Via . . . . . . . . . . . . . . . . . . . . . . . . . . 174 279 18.56. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . 174 280 19. Security Framework . . . . . . . . . . . . . . . . . . . . . 175 281 19.1. RTSP and HTTP Authentication . . . . . . . . . . . . . . 175 282 19.2. RTSP over TLS . . . . . . . . . . . . . . . . . . . . . 175 283 19.3. Security and Proxies . . . . . . . . . . . . . . . . . . 176 284 19.3.1. Accept-Credentials . . . . . . . . . . . . . . . . . 177 285 19.3.2. User approved TLS procedure . . . . . . . . . . . . 178 286 20. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 287 20.1. Base Syntax . . . . . . . . . . . . . . . . . . . . . . 181 288 20.2. RTSP Protocol Definition . . . . . . . . . . . . . . . . 183 289 20.2.1. Generic Protocol elements . . . . . . . . . . . . . 183 290 20.2.2. Message Syntax . . . . . . . . . . . . . . . . . . . 186 291 20.2.3. Header Syntax . . . . . . . . . . . . . . . . . . . 190 292 20.3. SDP extension Syntax . . . . . . . . . . . . . . . . . . 199 293 21. Security Considerations . . . . . . . . . . . . . . . . . . . 200 294 21.1. Signaling Protocol Threats . . . . . . . . . . . . . . . 200 295 21.2. Media Stream Delivery Threats . . . . . . . . . . . . . 203 296 21.2.1. Remote Denial of Service Attack . . . . . . . . . . 204 297 21.2.2. RTP Security analysis . . . . . . . . . . . . . . . 205 298 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 207 299 22.1. Feature-tags . . . . . . . . . . . . . . . . . . . . . . 207 300 22.1.1. Description . . . . . . . . . . . . . . . . . . . . 208 301 22.1.2. Registering New Feature-tags with IANA . . . . . . . 208 302 22.1.3. Registered entries . . . . . . . . . . . . . . . . . 208 303 22.2. RTSP Methods . . . . . . . . . . . . . . . . . . . . . . 209 304 22.2.1. Description . . . . . . . . . . . . . . . . . . . . 209 305 22.2.2. Registering New Methods with IANA . . . . . . . . . 209 306 22.2.3. Registered Entries . . . . . . . . . . . . . . . . . 209 307 22.3. RTSP Status Codes . . . . . . . . . . . . . . . . . . . 210 308 22.3.1. Description . . . . . . . . . . . . . . . . . . . . 210 309 22.3.2. Registering New Status Codes with IANA . . . . . . . 210 310 22.3.3. Registered Entries . . . . . . . . . . . . . . . . . 210 311 22.4. RTSP Headers . . . . . . . . . . . . . . . . . . . . . . 210 312 22.4.1. Description . . . . . . . . . . . . . . . . . . . . 210 313 22.4.2. Registering New Headers with IANA . . . . . . . . . 211 314 22.4.3. Registered entries . . . . . . . . . . . . . . . . . 211 316 22.5. Accept-Credentials . . . . . . . . . . . . . . . . . . . 212 317 22.5.1. Accept-Credentials policies . . . . . . . . . . . . 212 318 22.5.2. Accept-Credentials hash algorithms . . . . . . . . . 213 319 22.6. Cache-Control Cache Directive Extensions . . . . . . . . 213 320 22.7. Media Properties . . . . . . . . . . . . . . . . . . . . 214 321 22.7.1. Description . . . . . . . . . . . . . . . . . . . . 214 322 22.7.2. Registration Rules . . . . . . . . . . . . . . . . . 215 323 22.7.3. Registered Values . . . . . . . . . . . . . . . . . 215 324 22.8. Notify-Reason header . . . . . . . . . . . . . . . . . . 215 325 22.8.1. Description . . . . . . . . . . . . . . . . . . . . 215 326 22.8.2. Registration Rules . . . . . . . . . . . . . . . . . 215 327 22.8.3. Registered Values . . . . . . . . . . . . . . . . . 216 328 22.9. Range header formats . . . . . . . . . . . . . . . . . . 216 329 22.9.1. Description . . . . . . . . . . . . . . . . . . . . 216 330 22.9.2. Registration Rules . . . . . . . . . . . . . . . . . 216 331 22.9.3. Registered Values . . . . . . . . . . . . . . . . . 216 332 22.10. Terminate-Reason Header . . . . . . . . . . . . . . . . 217 333 22.10.1. Redirect Reasons . . . . . . . . . . . . . . . . . . 217 334 22.10.2. Terminate-Reason Header Parameters . . . . . . . . . 217 335 22.11. RTP-Info header parameters . . . . . . . . . . . . . . . 218 336 22.11.1. Description . . . . . . . . . . . . . . . . . . . . 218 337 22.11.2. Registration Rules . . . . . . . . . . . . . . . . . 218 338 22.11.3. Registered Values . . . . . . . . . . . . . . . . . 218 339 22.12. Seek-Style Policies . . . . . . . . . . . . . . . . . . 218 340 22.12.1. Description . . . . . . . . . . . . . . . . . . . . 218 341 22.12.2. Registration Rules . . . . . . . . . . . . . . . . . 219 342 22.12.3. Registered Values . . . . . . . . . . . . . . . . . 219 343 22.13. Transport Header Registries . . . . . . . . . . . . . . 219 344 22.13.1. Transport Protocol Specification . . . . . . . . . . 219 345 22.13.2. Transport modes . . . . . . . . . . . . . . . . . . 221 346 22.13.3. Transport Parameters . . . . . . . . . . . . . . . . 221 347 22.14. URI Schemes . . . . . . . . . . . . . . . . . . . . . . 222 348 22.14.1. The rtsp URI Scheme . . . . . . . . . . . . . . . . 222 349 22.14.2. The rtsps URI Scheme . . . . . . . . . . . . . . . . 223 350 22.14.3. The rtspu URI Scheme . . . . . . . . . . . . . . . . 224 351 22.15. SDP attributes . . . . . . . . . . . . . . . . . . . . . 225 352 22.16. Media Type Registration for text/parameters . . . . . . 226 353 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 228 354 23.1. Normative References . . . . . . . . . . . . . . . . . . 228 355 23.2. Informative References . . . . . . . . . . . . . . . . . 230 356 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 233 357 A.1. Media on Demand (Unicast) . . . . . . . . . . . . . . . 233 358 A.2. Media on Demand using Pipelining . . . . . . . . . . . . 237 359 A.3. Media on Demand (Unicast) . . . . . . . . . . . . . . . 239 360 A.4. Single Stream Container Files . . . . . . . . . . . . . 243 361 A.5. Live Media Presentation Using Multicast . . . . . . . . 245 362 A.6. Capability Negotiation . . . . . . . . . . . . . . . . . 246 363 Appendix B. RTSP Protocol State Machine . . . . . . . . . . . . 248 364 B.1. States . . . . . . . . . . . . . . . . . . . . . . . . . 248 365 B.2. State variables . . . . . . . . . . . . . . . . . . . . 248 366 B.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . 248 367 B.4. State Tables . . . . . . . . . . . . . . . . . . . . . . 249 368 Appendix C. Media Transport Alternatives . . . . . . . . . . . . 255 369 C.1. RTP . . . . . . . . . . . . . . . . . . . . . . . . . . 255 370 C.1.1. AVP . . . . . . . . . . . . . . . . . . . . . . . . 255 371 C.1.2. AVP/UDP . . . . . . . . . . . . . . . . . . . . . . 255 372 C.1.3. AVPF/UDP . . . . . . . . . . . . . . . . . . . . . . 256 373 C.1.4. SAVP/UDP . . . . . . . . . . . . . . . . . . . . . . 257 374 C.1.5. SAVPF/UDP . . . . . . . . . . . . . . . . . . . . . 259 375 C.1.6. RTCP usage with RTSP . . . . . . . . . . . . . . . . 259 376 C.2. RTP over TCP . . . . . . . . . . . . . . . . . . . . . . 261 377 C.2.1. Interleaved RTP over TCP . . . . . . . . . . . . . . 261 378 C.2.2. RTP over independent TCP . . . . . . . . . . . . . . 261 379 C.3. Handling Media Clock Time Jumps in the RTP Media Layer . 265 380 C.4. Handling RTP Timestamps after PAUSE . . . . . . . . . . 269 381 C.5. RTSP / RTP Integration . . . . . . . . . . . . . . . . . 271 382 C.6. Scaling with RTP . . . . . . . . . . . . . . . . . . . . 271 383 C.7. Maintaining NPT synchronization with RTP timestamps . . 271 384 C.8. Continuous Audio . . . . . . . . . . . . . . . . . . . . 271 385 C.9. Multiple Sources in an RTP Session . . . . . . . . . . . 271 386 C.10. Usage of SSRCs and the RTCP BYE Message During an 387 RTSP Session . . . . . . . . . . . . . . . . . . . . . . 271 388 C.11. Future Additions . . . . . . . . . . . . . . . . . . . . 272 389 Appendix D. Use of SDP for RTSP Session Descriptions . . . . . . 273 390 D.1. Definitions . . . . . . . . . . . . . . . . . . . . . . 273 391 D.1.1. Control URI . . . . . . . . . . . . . . . . . . . . 273 392 D.1.2. Media Streams . . . . . . . . . . . . . . . . . . . 274 393 D.1.3. Payload Type(s) . . . . . . . . . . . . . . . . . . 275 394 D.1.4. Format-Specific Parameters . . . . . . . . . . . . . 275 395 D.1.5. Directionality of media stream . . . . . . . . . . . 275 396 D.1.6. Range of Presentation . . . . . . . . . . . . . . . 276 397 D.1.7. Time of Availability . . . . . . . . . . . . . . . . 277 398 D.1.8. Connection Information . . . . . . . . . . . . . . . 277 399 D.1.9. Message Body Tag . . . . . . . . . . . . . . . . . . 278 400 D.2. Aggregate Control Not Available . . . . . . . . . . . . 278 401 D.3. Aggregate Control Available . . . . . . . . . . . . . . 279 402 D.4. Grouping of Media Lines in SDP . . . . . . . . . . . . . 280 403 D.5. RTSP external SDP delivery . . . . . . . . . . . . . . . 280 404 Appendix E. RTSP Use Cases . . . . . . . . . . . . . . . . . . . 281 405 E.1. On-demand Playback of Stored Content . . . . . . . . . . 281 406 E.2. Unicast Distribution of Live Content . . . . . . . . . . 282 407 E.3. On-demand Playback using Multicast . . . . . . . . . . . 283 408 E.4. Inviting an RTSP server into a conference . . . . . . . 283 409 E.5. Live Content using Multicast . . . . . . . . . . . . . . 284 410 Appendix F. Text format for Parameters . . . . . . . . . . . . . 286 411 Appendix G. Requirements for Unreliable Transport of RTSP . . . 287 412 Appendix H. Backwards Compatibility Considerations . . . . . . . 289 413 H.1. Play Request in Play State . . . . . . . . . . . . . . . 289 414 H.2. Using Persistent Connections . . . . . . . . . . . . . . 289 415 Appendix I. Changes . . . . . . . . . . . . . . . . . . . . . . 290 416 I.1. Brief Overview . . . . . . . . . . . . . . . . . . . . . 290 417 I.2. Detailed List of Changes . . . . . . . . . . . . . . . . 291 418 Appendix J. Acknowledgements . . . . . . . . . . . . . . . . . . 298 419 J.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 298 420 Appendix K. RFC Editor Consideration . . . . . . . . . . . . . . 300 421 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 301 423 1. Introduction 425 This memo defines version 2.0 of the Real Time Streaming Protocol 426 (RTSP 2.0). RTSP 2.0 is an application-level protocol for setup and 427 control over the delivery of data with real-time properties, 428 typically streaming media. Streaming media is, for instance, video 429 on demand or audio live streaming. Put simply, RTSP acts as a 430 "network remote control" for multimedia servers, similar to the 431 remote control for a DVD player. 433 The protocol operates between RTSP 2.0 clients and servers, but also 434 supports the usage of proxies placed between clients and servers. 435 Clients can request information about streaming media from servers by 436 asking for a description of the media or use media description 437 provided externally. The media delivery protocol is used to 438 establish the media streams described by the media description. 439 Clients can then request to play out the media, pause it, or stop it 440 completely, as known from DVD players remote control or media 441 players. The requested media can consist of multiple audio and video 442 streams that are delivered as a time-synchronized streams from 443 servers to clients. 445 RTSP 2.0 is a replacement of RTSP 1.0 [RFC2326] and obsoletes that 446 specification. This protocol is based on RTSP 1.0 but is not 447 backwards compatible other than in the basic version negotiation 448 mechanism. The changes are documented in Appendix I. There are many 449 reasons why RTSP 2.0 can't be backwards compatible with RTSP 1.0 but 450 some of the main ones are: 452 o Most headers that needed to be extensible did not define the 453 allowed syntax, preventing safe deployment of extensions; 455 o The changed behavior of the PLAY method when received in Play 456 state; 458 o Changed behavior of the extensibility model and its mechanism; 460 o The change of syntax for some headers. 462 In summary, there are so many small details that changing version 463 became necessary to enable clarification and consistent behavior. 465 This document is structured as follows. It begins with an overview 466 of the protocol operations and its functions in an informal way. 467 Then a set of definitions of used terms and document conventions is 468 introduced. It is followed by the actual RTSP 2.0 core protocol 469 specification. The appendixes describe and define some 470 functionalities that are not part of the core RTSP specification, but 471 which are still important to enable some usages. Among them, the RTP 472 usage is defined in Appendix C and the SDP usage with RTSP is defined 473 in Appendix D, which are two mandatory appendixes. Others include a 474 number of informational parts discussing the changes, use cases, 475 different considerations or motivations. 477 2. Protocol Overview 479 This section provides an informative overview of the different 480 mechanisms in the RTSP 2.0 protocol, to give the reader a high level 481 understanding before getting into all the different details. In case 482 of conflict with this description and the later sections, the later 483 sections take precedence. For more information about considered use 484 cases for RTSP see Appendix E. 486 RTSP 2.0 is a bi-directional request and response protocol that first 487 establishes a context including content resources (the media) and 488 then controls the delivery of these content resources from the 489 provider to the consumer. RTSP has three fundamental parts: Session 490 Establishment, Media Delivery Control, and an extensibility model 491 described below. The protocol is based on some assumptions about 492 existing functionality to provide a complete solution for client 493 controlled real-time media delivery. 495 RTSP uses text-based messages, requests and responses, that may 496 contain a binary message body. An RTSP request starts with a method 497 line that identifies the method, the protocol and version and the 498 resource to act on. Following the method line are a number of RTSP 499 headers. This part is ended by two consecutive carriage return line 500 feed (CRLF) character pairs. The message body if present follows the 501 two CRLF and the body's length is described by a message header. 502 RTSP responses are similar, but start with a response line with the 503 protocol and version, followed by a status code and a reason phrase. 504 RTSP messages are sent over a reliable transport protocol between the 505 client and server. RTSP 2.0 requires clients and servers to 506 implement TCP, and TLS over TCP, as mandatory transports for RTSP 507 messages. 509 2.1. Presentation Description 511 RTSP exists to provide access to multi-media presentations and 512 content, but tries to be agnostic about the media type or the actual 513 media delivery protocol that is used. To enable a client to 514 implement a complete system, an RTSP-external mechanism for 515 describing the presentation and the delivery protocol(s) is used. 516 RTSP assumes that this description is either delivered completely out 517 of bands or as a data object in the response to a client's request 518 using the DESCRIBE method (Section 13.2). 520 Parameters that commonly have to be included in the Presentation 521 Description are the following: 523 o Number of media streams; 524 o The resource identifier for each media stream/resource that is to 525 be controlled by RTSP; 527 o The protocol that each media stream is to be delivered over; 529 o Transport protocol parameters that are not negotiated or vary with 530 each client; 532 o Media encoding information enabling a client to correctly decode 533 the media upon reception; 535 o An aggregate control resource identifier. 537 RTSP uses its own URI schemes ("rtsp" and "rtsps") to reference media 538 resources and aggregates under common control. 540 This specification describes in Appendix D how one uses SDP [RFC4566] 541 for Presentation Description 543 2.2. Session Establishment 545 The RTSP client can request the establishment of an RTSP session 546 after having used the presentation description to determine which 547 media streams are available, and also which media delivery protocol 548 is used and their particular resource identifiers. The RTSP session 549 is a common context between the client and the server that consists 550 of one or more media resources that are to be under common media 551 delivery control. 553 The client creates an RTSP session by sending a request using the 554 SETUP method (Section 13.3) to the server. In the SETUP request the 555 client also includes all the transport parameters necessary to enable 556 the media delivery protocol to function in the "Transport" header 557 (Section 18.52). This includes parameters that are pre-established 558 by the presentation description but necessary for any middlebox to 559 correctly handle the media delivery protocols. The Transport header 560 in a request may contain multiple alternatives for media delivery in 561 a prioritized list, which the server can select from. These 562 alternatives are typically based on information in the presentation 563 description. 565 The server determines if the media resource is available upon 566 receiving a SETUP request and if any of the transport parameter 567 specifications are acceptable. If that is successful, an RTSP 568 session context is created and the relevant parameters and state is 569 stored. An identifier is created for the RTSP session and included 570 in the response in the Session header (Section 18.47). The SETUP 571 response includes a Transport header that specifies which of the 572 alternatives has been selected and relevant parameters. 574 A SETUP request that references an existing RTSP session but 575 identifies a new media resource is a request to add that media 576 resource under common control with the already present media 577 resources in an aggregated session. A client can expect this to work 578 for all media resources under RTSP control within a multi-media 579 content. However, aggregating resources from different content are 580 likely to be refused by the server. The RTSP session as aggregate is 581 referenced by the aggregate control URI, even if the RTSP session 582 only contains a single media. 584 To avoid an extra round trip in the session establishment of 585 aggregated RTSP sessions, RTSP 2.0 supports pipelined requests; i.e., 586 the client can send multiple requests back-to-back without waiting 587 first for the completion of any of them. The client uses client- 588 selected identifier in the Pipelined-Requests header to instruct the 589 server to bind multiple requests together as if they included the 590 session identifier. 592 The SETUP response also provides additional information about the 593 established sessions in a couple of different headers. The Media- 594 Properties header includes a number of properties that apply for the 595 aggregate that is valuable when doing media delivery control and 596 configuring user interface. The Accept-Ranges header informs the 597 client about which range formats that the server supports with these 598 media resources. The Media-Range header informs the client about the 599 time range of the media currently available. 601 2.3. Media Delivery Control 603 After having established an RTSP session, the client can start 604 controlling the media delivery. The basic operations are Start by 605 using the PLAY method (Section 13.4) and Halt by using the PAUSE 606 method (Section 13.6). PLAY also allows for choosing the starting 607 media position from which the server should deliver the media. The 608 positioning is done by using the Range header (Section 18.38) that 609 supports several different time formats: Normal Play Time (NPT) 610 (Section 4.5), SMPTE Timestamps (Section 4.4) and absolute time 611 (Section 4.6). The Range header does further allow the client to 612 specify a position where delivery should end, thus allowing a 613 specific interval to be delivered. 615 The support for positioning/searching within a content depends on the 616 content's media properties. Content exists in a number of different 617 types, such as: on-demand, live, and live with simultaneous 618 recording. Even within these categories there are differences in how 619 the content is generated and distributed, which affect how it can be 620 accessed for playback. The properties applicable for the RTSP 621 session are provided by the server in the SETUP response using the 622 Media-Properties header (Section 18.28). These are expressed using 623 one or several independent attributes. A first attribute is Random 624 Access, which expresses if positioning can be done, and with what 625 granularity. Another aspect is whether the content will change 626 during the lifetime of the session. While on-demand content will be 627 provided in full from the beginning, a live stream being recorded 628 results in the length of the accessible content growing as the 629 session goes on. There also exists content that is dynamically built 630 by another protocol than RTSP and thus also changes in steps during 631 the session, but maybe not continuously. Furthermore, when content 632 is recorded, there are cases where not the complete content is 633 maintained, but, for example, only the last hour. All these 634 properties result in the need for mechanisms that will be discussed 635 below. 637 When the client accesses on-demand content that allows random access, 638 the client can issue the PLAY request for any point in the content 639 between the start and the end. The server will deliver media from 640 the closest random access point prior to the requested point and 641 indicate that in its PLAY response. If the client issues a PAUSE, 642 the delivery will be halted and the point at which the server stopped 643 will be reported back in the response. The client can later resume 644 by sending a PLAY request without a range header. When the server is 645 about to complete the PLAY request by delivering the end of the 646 content or the requested range, the server will send a PLAY_NOTIFY 647 request indicating this. 649 When playing live content with no extra functions, such as recording, 650 the client will receive the live media from the server after having 651 sent a PLAY request. Seeking in such content is not possible as the 652 server does not store it, but only forwards it from the source of the 653 session. Thus delivery continues until the client sends a PAUSE 654 request, tears down the session, or the content ends. 656 For live sessions that are being recorded the client will need to 657 keep track of how the recording progresses. Upon session 658 establishment the client will learn the current duration of the 659 recording from the Media-Range header. As the recording is ongoing 660 the content grows in direct relation to the passed time. Therefore, 661 each server's response to a PLAY request will contain the current 662 Media-Range header. The server should also regularly send every 5 663 minutes the current media range in a PLAY_NOTIFY request. If the 664 live transmission ends, the server must send a PLAY_NOTIFY request 665 with the updated Media-Properties indicating that the content stopped 666 being a recorded live session and instead became on-demand content; 667 the request also contains the final media range. While the live 668 delivery continues the client can request to play the current live 669 point by using the NPT timescale symbol "now", or it can request a 670 specific point in the available content by an explicit range request 671 for that point. If the requested point is outside of the available 672 interval the server will adjust the position to the closest available 673 point, i.e., either at the beginning or the end. 675 A special case of recording is that where the recording is not 676 retained longer than a specific time period, thus as the live 677 delivery continues the client can access any media within a moving 678 window that covers, for example, "now" to "now" minus 1 hour. A 679 client that pauses on a specific point within the content may not be 680 able to retrieve the content anymore. If the client waits too long 681 before resuming the pause point, the content may no longer be 682 available. In this case the pause point will be adjusted to the end 683 of the available media. 685 2.4. Session Parameter Manipulations 687 A session may have additional state or functionality that affects how 688 the server or client treats the session, content, how it functions, 689 or feedback on how well the session works. Such extensions are not 690 defined in this specification, but may be done in various extensions. 691 RTSP has two methods for retrieving and setting parameter values on 692 either the client or the server: GET_PARAMETER (Section 13.8) and 693 SET_PARAMETER (Section 13.9). These methods carry the parameters in 694 a message body of the appropriate format. One can also use headers 695 to query state with the GET_PARAMETER method. As an example, clients 696 needing to know the current media-range for a time-progressing 697 session can use the GET_PARAMETER method and include the media-range. 698 Furthermore, synchronization information can be requested by using a 699 combination of RTP-Info and Range. 701 RTSP 2.0 does not have a strong mechanism for providing negotiation 702 of which headers, or parameters and their formats, that can be used. 703 However, responses will indicate request headers or parameters that 704 are not supported. A priori determination of what features are 705 available needs to be done through out-of-band mechanisms, like the 706 session description, or through the usage of feature tags 707 (Section 4.7). 709 2.5. Media Delivery 711 The delivery of media to the RTSP client is done with a protocol 712 outside of RTSP and this protocol is determined during the session 713 establishment. This document specifies how media is delivered with 714 RTP [RFC3550] over UDP [RFC0768], TCP [RFC0793] or the RTSP control 715 connection. Additional protocols may be specified in the future 716 based on demand. 718 The usage of RTP as media delivery protocol requires some additional 719 information to function well. The PLAY response contains information 720 to enable reliable and timely delivery of how a client should 721 synchronize different sources in the different RTP sessions. It also 722 provides a mapping between RTP timestamps and the content time scale. 723 When the server wants to notify the client about the completion of 724 the media delivery, it sends a PLAY_NOTIFY request to the client. 725 The PLAY_NOTIFY request includes information about the stream end, 726 including the last RTP sequence number for each stream, thus enabling 727 the client to empty the buffer smoothly. 729 2.5.1. Media Delivery Manipulations 731 The basic playback functionality of RTSP enables delivery of a range 732 of requested content to the client at the pace intended by the 733 content's creator. However, RTSP can also manipulate the delivery to 734 the client in two ways. 736 Scale: The ratio of media content time delivered per unit playback 737 time. 739 Speed: The ratio of playback time delivered per unit of wallclock 740 time. 742 Both affect the media delivery per time unit. However, they 743 manipulate two independent time scales and the effects are possible 744 to combine. 746 Scale is used for fast forward or slow motion control as it changes 747 the amount of content timescale that should be played back per time 748 unit. Scale > 1.0, means fast forward, e.g. Scale=2.0 results in 749 that 2 seconds of content is played back every second of playback. 750 Scale = 1.0 is the default value that is used if no Scale is 751 specified, i.e., playback at the content's original rate. Scale 752 values between 0 and 1.0 is providing for slow motion. Scale can be 753 negative to allow for reverse playback in either regular pace (Scale 754 = -1.0) or fast backwards (Scale < -1.0) or slow motion backwards 755 (-1.0 < Scale < 0). Scale = 0 is equal to pause and is not allowed. 757 In most cases the realization of scale means server side manipulation 758 of the media to ensure that the client can actually play it back. 759 These media manipulation and when they are needed are highly media- 760 type dependent. Let's consider an example with two common media 761 types audio and video. 763 It is very difficult to modify the playback rate of audio. A maximum 764 of 10-30% is possible by changing the pitch-rate of speech. Music 765 goes out of tune if one tries to manipulate the playback rate by 766 resampling it. This is a well known problem and audio is commonly 767 muted or played back in short segments with skips to keep up with the 768 current playback point. 770 For video it is possible to manipulate the frame rate, although the 771 rendering capabilities are often limited to certain frame rates. 772 Also the allowed bitrates in decoding, the structure used in the 773 encoding and the dependency between frames and other capabilities of 774 the rendering device limits the possible manipulations. Therefore, 775 the basic fast forward capabilities often are implemented by 776 selecting certain subsets of frames. 778 Due to the media restrictions, the possible scale values are commonly 779 restricted to the set of realizable scale ratios. To enable the 780 clients to select from the possible scale values, RTSP can signal the 781 supported Scale ratios for the content. To support aggregated or 782 dynamic content, where this may change during the ongoing session and 783 dependent on the location within the content, a mechanism for 784 updating the media properties and the currently used scale factor 785 exist. 787 Speed affects how much of the playback timeline is delivered in a 788 given wallclock period. The default is Speed = 1 which means to 789 deliver at the same rate the media is consumed. Speed > 1 means that 790 the receiver will get content faster than it regularly would consume 791 it. Speed < 1 means that delivery is slower than the regular media 792 rate. Speed values of 0 or lower have no meaning and are not 793 allowed. This mechanism enables two general functionalities. One is 794 client side scale operations, i.e. the client receives all the frames 795 and makes the adjustment to the playback locally. The second is 796 delivery control for buffering of media. By specifying a speed over 797 1.0 the client can build up the amount of playback time it has 798 present in its buffers to a level that is sufficient for its needs. 800 A naive implementation of Speed would only affect the transmission 801 schedule of the media and has a clear impact on the needed bandwidth. 802 This would result in the data rate being proportional to the speed 803 factor. Speed = 1.5, i.e., 50% faster than normal delivery, would 804 result in a 50% increase in the data transport rate. If that can be 805 supported or not depends solely on the underlying network path. 806 Scale may also have some impact on the required bandwidth due to the 807 manipulation of the content in the new playback schedule. An example 808 is fast forward where only the independently decodable intra frames 809 are included in the media stream. This usage of solely intra frames 810 increases the data rate significantly compared to a normal sequence 811 with the same number of frames, where most frames are encoded using 812 prediction. 814 This potential increase of the data rate needs to be handled by the 815 media sender. The client has requested that the media will be 816 delivered in a specific way, which should be honored. However, the 817 media sender cannot ignore if the network path between the sender and 818 the receiver can't handle the resulting media stream. In that case 819 the media stream needs to be adapted to fit the available resources 820 of the path. This can result in a reduced media quality. 822 The need for bitrate adaptation becomes especially problematic in 823 connection with the Speed semantics. If the goal is to fill up the 824 buffer, the client may not want to do that at the cost of reduced 825 quality. If the client wants to make local playout changes then it 826 may actually require that the requested speed be honored. To resolve 827 this issue, Speed uses a range so that both cases can be supported. 828 The server is requested to use the highest possible speed value 829 within the range which is compatible with the available bandwidth. 830 As long as the server can maintain a speed value within the range it 831 shall not change the media quality, but instead modify the actual 832 delivery rate in response to available bandwidth and reflect this in 833 the Speed value in the response. However, if this is not possible, 834 the server should instead modify the media quality to respect the 835 lowest speed value and the available bandwidth. 837 This functionality enables the local scaling implementation to use a 838 tight range, or even a range where the lower bound equals the upper 839 bound, to identify that it requires the server to deliver the 840 requested amount of media time per delivery time independent of how 841 much it needs to adapt the media quality to fit within the available 842 path bandwidth. For buffer filling, it is suitable to use a range 843 with a reasonable span and with a lower bound at the nominal media 844 rate 1.0, such as 1.0 - 2.5. If the client wants to reduce the 845 buffer, it can specify an upper bound that is below 1.0 to force the 846 server to deliver slower than the nominal media rate. 848 2.6. Session Maintenance and Termination 850 The session context that has been established is kept alive by having 851 the client show liveness. This is done in two main ways: 853 o Media transport protocol keep-alive. RTCP may be used when using 854 RTP. 856 o Any RTSP request referencing the session context. 858 Section 10.5 discusses the methods for showing liveness in more 859 depth. If the client fails to show liveness for more than the 860 established session timeout value (normally 60 seconds), the server 861 may terminate the context. Other values may be selected by the 862 server through the inclusion of the timeout parameter in the session 863 header. 865 The session context is normally terminated by the client sending a 866 TEARDOWN request to the server referencing the aggregated control 867 URI. An individual media resource can be removed from a session 868 context by a TEARDOWN request referencing that particular media 869 resource. If all media resources are removed from a session context, 870 the session context is terminated. 872 A client may keep the session alive indefinitely if allowed by the 873 server; however, it is recommended to release the session context 874 when an extended period of time without media delivery activity has 875 passed. The client can re-establish the session context if required 876 later. What constitutes an extended period of time is dependent on 877 the server and its usage. It is recommended that the client 878 terminates the session before 10*times the session timeout value has 879 passed. A server may terminate the session after one session timeout 880 period without any client activity beyond keep-alive. When a server 881 terminates the session context, it does that by sending a TEARDOWN 882 request indicating the reason. 884 A server can also request that the client tear down the session and 885 re-establish it at an alternative server, as may be needed for 886 maintenance. This is done by using the REDIRECT method. The 887 Terminate-Reason header is used to indicate when and why. The 888 Location header indicates where it should connect if there is an 889 alternative server available. When the deadline expires, the server 890 simply stops providing the service. To achieve a clean closure, the 891 client needs to initiate session termination prior to the deadline. 892 In case the server has no other server to redirect to, and wants to 893 close the session for maintenance, it shall use the TEARDOWN method 894 with a Terminate-Reason header. 896 2.7. Extending RTSP 898 RTSP is quite a versatile protocol which supports extensions in many 899 different directions. Even this core specification contains several 900 blocks of functionality that are optional to implement. The use case 901 and need for the protocol deployment should determine what parts are 902 implemented. Allowing for extensions makes it possible for RTSP to 903 reach out to additional use cases. However, extensions will affect 904 the interoperability of the protocol and therefore it is important 905 that they can be added in a structured way. 907 The client can learn the capability of a server by using the OPTIONS 908 method (Section 13.1) and the Supported header (Section 18.49). It 909 can also try and possibly fail using new methods, or require that 910 particular features are supported using the Require or Proxy-Require 911 header. 913 The RTSP protocol in itself can be extended in three ways, listed 914 here in order of the magnitude of changes supported: 916 o Existing methods can be extended with new parameters, for example, 917 headers, as long as these parameters can be safely ignored by the 918 recipient. If the client needs negative acknowledgment when a 919 method extension is not supported, a tag corresponding to the 920 extension may be added in the field of the Require or Proxy- 921 Require headers (see Section 18.35). 923 o New methods can be added. If the recipient of the message does 924 not understand the request, it must respond with error code 501 925 (Not Implemented) so that the sender can avoid using this method 926 again. A client may also use the OPTIONS method to inquire about 927 methods supported by the server. The server must list the methods 928 it supports using the Public response header. 930 o A new version of the protocol can be defined, allowing almost all 931 aspects (except the position of the protocol version number) to 932 change. A new version of the protocol must be registered through 933 an IETF standard track document. 935 The basic capability discovery mechanism can be used to both discover 936 support for a certain feature and to ensure that a feature is 937 available when performing a request. For a detailed explanation of 938 this see Section 11. 940 New media delivery protocols may be added and negotiated at session 941 establishment, in addition to extensions to the core protocol. 942 Certain types of protocol manipulations can be done through parameter 943 formats using SET_PARAMETER and GET_PARAMETER. 945 3. Document Conventions 947 3.1. Notational Conventions 949 Since a few of the definitions are identical to HTTP/1.1, this 950 specification only points to the section where they are defined 951 rather than copying it. For brevity, [HX.Y] is to be taken to refer 952 to Section X.Y of the current HTTP/1.1 specification ([RFC2616]). 954 All the mechanisms specified in this document are described in both 955 prose and the Augmented Backus-Naur form (ABNF) described in detail 956 in [RFC5234]. 958 Indented and smaller-type paragraphs are used to provide informative 959 background and motivation. This is intended to give readers who were 960 not involved with the formulation of the specification an 961 understanding of why things are the way they are in RTSP. 963 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 964 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 965 "OPTIONAL" in this document are to be interpreted as described in 966 [RFC2119]. 968 The word, "unspecified" is used to indicate functionality or features 969 that are not defined in this specification. Such functionality 970 cannot be used in a standardized manner without further definition in 971 an extension specification to RTSP. 973 3.2. Terminology 975 Aggregate control: The concept of controlling multiple streams using 976 a single timeline, generally maintained by the server. A client, 977 for example, uses aggregate control when it issues a single play 978 or pause message to simultaneously control both the audio and 979 video in a movie. A session which is under aggregate control is 980 referred to as an aggregated session. 982 Aggregate control URI: The URI used in an RTSP request to refer to 983 and control an aggregated session. It normally, but not always, 984 corresponds to the presentation URI specified in the session 985 description. See Section 13.3 for more information. 987 Client: The client requests media service from the media server. 989 Connection: A transport layer virtual circuit established between 990 two programs for the purpose of communication. 992 Container file: A file which may contain multiple media streams 993 which often constitutes a presentation when played together. The 994 concept of a container file is not embedded in the protocol. 995 However, RTSP servers may offer aggregate control on the media 996 streams within these files. 998 Continuous media: Data where there is a timing relationship between 999 source and sink; that is, the sink needs to reproduce the timing 1000 relationship that existed at the source. The most common examples 1001 of continuous media are audio and motion video. Continuous media 1002 can be real-time (interactive or conversational), where there is a 1003 "tight" timing relationship between source and sink, or streaming 1004 where the relationship is less strict. 1006 Feature-tag: A tag representing a certain set of functionality, i.e. 1007 a feature. 1009 IRI: Internationalized Resource Identifier, is the same as an URI, 1010 with the exception that it allows characters from the whole 1011 Universal Character Set (Unicode/ISO 10646), rather than the US- 1012 ASCII only. See [RFC3987] for more information. 1014 Live: Normally used to describe a presentation or session with media 1015 coming from an ongoing event. This generally results in the 1016 session having an unbound or only loosely defined duration, and 1017 sometimes no seek operations are possible. 1019 Media initialization: Datatype/codec specific initialization. This 1020 includes such things as clock rates, color tables, etc. Any 1021 transport-independent information which is required by a client 1022 for playback of a media stream occurs in the media initialization 1023 phase of stream setup. 1025 Media parameter: Parameter specific to a media type that may be 1026 changed before or during stream delivery. 1028 Media server: The server providing media delivery services for one 1029 or more media streams. Different media streams within a 1030 presentation may originate from different media servers. A media 1031 server may reside on the same host or on a different host from 1032 which the presentation is invoked. 1034 (Media) stream: A single media instance, e.g., an audio stream or a 1035 video stream as well as a single whiteboard or shared application 1036 group. When using RTP, a stream consists of all RTP and RTCP 1037 packets created by a source within an RTP session. 1039 Message: The basic unit of RTSP communication, consisting of a 1040 structured sequence of octets matching the syntax defined in 1041 Section 20 and transmitted over a connection or a connectionless 1042 transport. A message is either a Request or a Response. 1044 Message Body: The information transferred as the payload of a 1045 message (Request or response). A message body consists of meta- 1046 information in the form of message-body headers and content in the 1047 form of a message-body, as described in Section 9. 1049 Non-Aggregated Control: Control of a single media stream. 1051 Presentation: A set of one or more streams presented to the client 1052 as a complete media feed and described by a presentation 1053 description as defined below. Presentations with more than one 1054 media stream are often handled in RTSP under aggregate control. 1056 Presentation description: A presentation description contains 1057 information about one or more media streams within a presentation, 1058 such as the set of encodings, network addresses and information 1059 about the content. Other IETF protocols such as SDP ([RFC4566]) 1060 use the term "session" for a presentation. The presentation 1061 description may take several different formats, including but not 1062 limited to the session description protocol format, SDP. 1064 Response: An RTSP response to a Request. One type of RTSP message. 1065 If an HTTP response is meant, it is indicated explicitly. 1067 Request: An RTSP request. One type of RTSP message. If an HTTP 1068 request is meant, it is indicated explicitly. 1070 Request-URI: The URI used in a request to indicate the resource on 1071 which the request is to be performed. 1073 RTSP agent: Refers to either an RTSP client, an RTSP server, or an 1074 RTSP proxy. In this specification, there are many capabilities 1075 that are common to these three entities such as the capability to 1076 send requests or receive responses. This term will be used when 1077 describing functionality that is applicable to all three of these 1078 entities. 1080 RTSP session: A stateful abstraction upon which the main control 1081 methods of RTSP operate. An RTSP session is a common context; it 1082 is created and maintained on client's request and can be destroyed 1083 by either the client or server. It is established by an RTSP 1084 server upon the completion of a successful SETUP request (when a 1085 200 OK response is sent) and is labeled with a session identifier 1086 at that time. The session exists until timed out by the server or 1087 explicitly removed by a TEARDOWN request. An RTSP session is a 1088 stateful entity; an RTSP server maintains an explicit session 1089 state machine (see Appendix B) where most state transitions are 1090 triggered by client requests. The existence of a session implies 1091 the existence of state about the session's media streams and their 1092 respective transport mechanisms. A given session can have one or 1093 more media streams associated with it. An RTSP server uses the 1094 session to aggregate control over multiple media streams. 1096 Origin Server: The server on which a given resource resides. 1098 Transport initialization: The negotiation of transport information 1099 (e.g., port numbers, transport protocols) between the client and 1100 the server. 1102 URI: Universal Resource Identifier, see [RFC3986]. The URIs used in 1103 RTSP are generally URLs as they give a location for the resource. 1104 As URLs are a subset of URIs, they will be referred to as URIs to 1105 cover also the cases when an RTSP URI would not be an URL. 1107 URL: Universal Resource Locator, is an URI which identifies the 1108 resource through its primary access mechanism, rather than 1109 identifying the resource by name or by some other attribute(s) of 1110 that resource. 1112 4. Protocol Parameters 1114 4.1. RTSP Version 1116 This specification defines version 2.0 of RTSP. 1118 RTSP uses a "." numbering scheme to indicate versions 1119 of the protocol. The protocol versioning policy is intended to allow 1120 the sender to indicate the format of a message and its capacity for 1121 understanding further RTSP communication, rather than the features 1122 obtained via that communication. No change is made to the version 1123 number for the addition of message components which do not affect 1124 communication behavior or which only add to extensible field values. 1126 The number is incremented when the changes made to the 1127 protocol add features which do not change the general message parsing 1128 algorithm, but which may add to the message semantics and imply 1129 additional capabilities of the sender. The number is 1130 incremented when the format of a message within the protocol is 1131 changed. The version of an RTSP message is indicated by an RTSP- 1132 Version field in the first line of the message. Note that the major 1133 and minor numbers MUST be treated as separate integers and that each 1134 MAY be incremented higher than a single digit. Thus, RTSP/2.4 is a 1135 lower version than RTSP/2.13, which in turn is lower than RTSP/12.3. 1136 Leading zeros MUST be ignored by recipients and MUST NOT be sent. 1138 4.2. RTSP IRI and URI 1140 RTSP 2.0 defines and registers three URI schemes "rtsp", "rtsps" and 1141 "rtspu". The usage of the last, "rtspu", is unspecified in RTSP 2.0, 1142 and is defined here to register and reserve the URI scheme that is 1143 defined in RTSP 1.0. The "rtspu" scheme indicates unspecified 1144 transport of the RTSP messages over unreliable transport (UDP in RTSP 1145 1.0). An RTSP server MUST respond with an error code indicating the 1146 "rtspu" scheme is not implemented (501) to a request that carries a 1147 "rtspu" URI scheme. The details of the syntax of "rtsp" and "rtsps" 1148 URIs has been changed from RTSP 1.0. 1150 This specification also defines the format of the RTSP IRI [RFC3987] 1151 that can be used as RTSP resource identifiers and locators, in web 1152 pages, user interfaces, on paper, etc. However, the RTSP request 1153 message format only allows usage of the absolute URI format. The 1154 RTSP IRI format MUST use the rules and transformation for IRIs to 1155 URIs, as defined in [RFC3987]. This way RTSP 2.0 URIs for request 1156 can be produced from an RTSP IRI. 1158 The RTSP IRI and URI are both syntax restricted compared to the 1159 generic syntax defined in [RFC3986] and [RFC3987]: 1161 o An absolute URI requires the authority part; i.e., a host identity 1162 MUST be provided. 1164 o Parameters in the path element are prefixed with the reserved 1165 separator ";". 1167 The RTSP URI and IRI are case sensitive, with the exception of those 1168 parts that [RFC3986] and [RFC3987] define as case-insensitive; for 1169 example, the scheme and host part. 1171 The fragment identifier is used as defined in sections 3.5 and 4.3 of 1172 [RFC3986], i.e., the fragment is to be stripped from the IRI by the 1173 requester and not included in the request URI. The user agent needs 1174 to interpret the value of the fragment based on the media type the 1175 request relates to; i.e., the media type indicated in Content-Type 1176 header in the response to DESCRIBE. 1178 The syntax of any URI query string is unspecified and responder 1179 (usually the server) specific. The query is, from the requester's 1180 perspective, an opaque string and needs to be handled as such. 1181 Please note that relative URI with queries are difficult to handle 1182 due to the RFC 3986 relative URI handling rules. Any change of the 1183 path element using a relative URI results in the stripping of the 1184 query, which means the relative part needs to contain the query. 1186 The URI scheme "rtsp" requires that commands are issued via a 1187 reliable protocol (within the Internet, TCP), while the scheme 1188 "rtsps" identifies a reliable transport using secure transport (TLS 1189 [RFC5246], see (Section 19). 1191 For the scheme "rtsp", if no port number is provided in the authority 1192 part of the URI port number 554 MUST be used. For the scheme 1193 "rtsps", the TCP port 322 is registered and MUST be assumed. 1195 A presentation or a stream is identified by a textual media 1196 identifier, using the character set and escape conventions of URIs 1197 [RFC3986]. URIs may refer to a stream or an aggregate of streams; 1198 i.e., a presentation. Accordingly, requests described in 1199 (Section 13) can apply to either the whole presentation or an 1200 individual stream within the presentation. Note that some request 1201 methods can only be applied to streams, not presentations, and vice 1202 versa. 1204 For example, the RTSP URI: 1206 rtsp://media.example.com:554/twister/audiotrack 1208 may identify the audio stream within the presentation "twister", 1209 which can be controlled via RTSP requests issued over a TCP 1210 connection to port 554 of host media.example.com. 1212 Also, the RTSP URI: 1214 rtsp://media.example.com:554/twister 1216 identifies the presentation "twister", which may be composed of audio 1217 and video streams, but could also be something else like a random 1218 media redirector. 1220 This does not imply a standard way to reference streams in URIs. 1221 The presentation description defines the hierarchical 1222 relationships in the presentation and the URIs for the individual 1223 streams. A presentation description may name a stream "a.mov" and 1224 the whole presentation "b.mov". 1226 The path components of the RTSP URI are opaque to the client and do 1227 not imply any particular file system structure for the server. 1229 This decoupling also allows presentation descriptions to be used 1230 with non-RTSP media control protocols simply by replacing the 1231 scheme in the URI. 1233 4.3. Session Identifiers 1235 Session identifiers are strings of length 8-128 characters. A 1236 session identifier MUST be chosen cryptographically random (see 1237 [RFC4086]). It is RECOMMENDED that it contains 128 bits of entropy, 1238 i.e. approximately 22 characters from a high quality generator (see 1239 Section 21). However, note that the session identifier does not 1240 provide any security against session hijacking unless it is kept 1241 confidential by the client, server and trusted proxies. 1243 4.4. SMPTE Relative Timestamps 1245 A SMPTE relative timestamp expresses time relative to the start of 1246 the clip. Relative timestamps are expressed as SMPTE time codes for 1247 frame-level access accuracy. The time code has the format 1249 hours:minutes:seconds:frames.subframes, 1251 with the origin at the start of the clip. The default SMPTE format 1252 is "SMPTE 30 drop" format, with frame rate is 29.97 frames per 1253 second. Other SMPTE codes MAY be supported (such as "SMPTE 25") 1254 through the use of "smpte-type". For SMPTE 30, the "frames" field in 1255 the time value can assume the values 0 through 29. The difference 1256 between 30 and 29.97 frames per second is handled by dropping the 1257 first two frame indices (values 00 and 01) of every minute, except 1258 every tenth minute. If the frame and the subframe values are zero, 1259 they may be omitted. Subframes are measured in one-hundredth of a 1260 frame. 1262 Examples: 1264 smpte=10:12:33:20- 1265 smpte=10:07:33- 1266 smpte=10:07:00-10:07:33:05.01 1267 smpte-25=10:07:00-10:07:33:05.01 1269 4.5. Normal Play Time 1271 Normal play time (NPT) indicates the stream absolute position 1272 relative to the beginning of the presentation, not to be confused 1273 with the Network Time Protocol (NTP) [RFC5905]. The timestamp 1274 consists of two parts: the mandatory first part may be expressed in 1275 either seconds or hours, minutes, and seconds. The optional second 1276 part consists of a decimal point and decimal figures and indicates 1277 fractions of a second. 1279 The beginning of a presentation corresponds to 0.0 seconds. Negative 1280 values are not defined. 1282 The special constant "now" is defined as the current instant of a 1283 live event. It MAY only be used for live events, and MUST NOT be 1284 used for on-demand (i.e., non-live) content. 1286 NPT is defined as in DSM-CC [ISO.13818-6.1995]: "Intuitively, NPT is 1287 the clock the viewer associates with a program. It is often 1288 digitally displayed on a VCR. NPT advances normally when in normal 1289 play mode (scale = 1), advances at a faster rate when in fast scan 1290 forward (high positive scale ratio), decrements when in scan reverse 1291 (negative scale ratio) and is fixed in pause mode. NPT is 1292 (logically) equivalent to SMPTE time codes." 1294 Examples: 1296 npt=123.45-125 1297 npt=12:05:35.3- 1298 npt=now- 1299 The syntax conforms to ISO 8601 [ISO.8601.2000]. The npt-sec 1300 notation is optimized for automatic generation, the npt-hhmmss 1301 notation for consumption by human readers. The "now" constant 1302 allows clients to request to receive the live feed rather than the 1303 stored or time-delayed version. This is needed since neither 1304 absolute time nor zero time are appropriate for this case. 1306 4.6. Absolute Time 1308 Absolute time is expressed as ISO 8601 [ISO.8601.2000] timestamps, 1309 using UTC (GMT). Fractions of a second may be indicated. 1311 Example for November 8, 1996 at 14h 37 min and 20 and a quarter 1312 seconds UTC: 1314 19961108T143720.25Z 1316 4.7. Feature-Tags 1318 Feature-tags are unique identifiers used to designate features in 1319 RTSP. These tags are used in Require (Section 18.41), Proxy-Require 1320 (Section 18.35), Proxy-Supported (Section 18.36), Supported 1321 (Section 18.49) and Unsupported (Section 18.53) header fields. 1323 A feature-tag definition MUST indicate which combination of clients, 1324 servers or proxies it applies to. 1326 The creator of a new RTSP feature-tag should either prefix the 1327 feature-tag with a reverse domain name (e.g., 1328 "com.example.mynewfeature" is an apt name for a feature whose 1329 inventor can be reached at "example.com"), or register the new 1330 feature-tag with the Internet Assigned Numbers Authority (IANA) (see 1331 IANA Section 22). 1333 The usage of feature-tags is further described in Section 11 that 1334 deals with capability handling. 1336 4.8. Message Body Tags 1338 Message body tags are opaque strings that are used to compare two 1339 message bodies from the same resource, for example in caches or to 1340 optimize setup after a redirect. Message body tags can be carried in 1341 the MTag header (see Section 18.30) or in SDP (see Appendix D.1.9). 1342 MTag is similar to ETag in HTTP/1.1. 1344 A message body tag MUST be unique across all versions of all message 1345 bodies associated with a particular resource. A given message body 1346 tag value MAY be used for message bodies obtained by requests on 1347 different URIs. The use of the same message body tag value in 1348 conjunction with message bodies obtained by requests on different 1349 URIs does not imply the equivalence of those message bodies 1351 Message body tags are used in RTSP to make some methods conditional. 1352 The methods are made conditional through the inclusion of headers; 1353 see "If-Match" (Section 18.23) and "If-None-Match" (Section 18.25). 1354 Note that RTSP message body tags apply to the complete presentation; 1355 i.e., both the presentation description and the individual media 1356 streams. Thus message body tags can be used to verify at setup time 1357 after a redirect that the same session description applies to the 1358 media at the new location using the If-Match header. 1360 4.9. Media Properties 1362 When an RTSP server handles media, it is important to consider the 1363 different properties a media instance for delivery and playback can 1364 have. This specification considers the below listed media properties 1365 in its protocol operations. They are derived from the differences 1366 between a number of supported usages. 1368 On-demand: Media that has a fixed (given) duration that doesn't 1369 change during the life time of the RTSP session and is known at 1370 the time of the creation of the session. It is expected that the 1371 content of the media will not change, even if the representation, 1372 i.e encoding, quality, etc, may change. Generally one can seek, 1373 i.e. request any range, within the media. 1375 Dynamic On-demand: This is a variation of the on-demand case where 1376 external methods are used to manipulate the actual content of the 1377 media setup for the RTSP session. The main example is a content 1378 defined by a playlist. 1380 Live: Live media represents a progressing content stream (such as 1381 broadcast TV) where the duration may or may not be known. It is 1382 not seekable, only the content presently being delivered can be 1383 accessed. 1385 Live with Recording: A Live stream that is combined with a server- 1386 side capability to store and retain the content of the live 1387 session, and allow for random access delivery within the part of 1388 the already recorded content. The actual behavior of the media 1389 stream is very much dependent on the retention policy for the 1390 media stream; either the server will be able to capture the 1391 complete media stream, or it will have a limitation in how much 1392 will be retained. The media range will dynamically change as the 1393 session progress. For servers with a limited amount of storage 1394 available for recording, there will typically be a sliding window 1395 that moves forward while new data is made available and older data 1396 is discarded. 1398 To cover the above usages, the following media properties with 1399 appropriate values are specified: 1401 4.9.1. Random Access and Seeking 1403 Random Access is the ability to specify and get media delivered from 1404 any point inside the content, an operation called seeking. This 1405 possibility is signaled using the Seek-Style header (see 1406 Section 18.45) which can take the following different values: 1408 Random Access: The media is seekable to any out of a large number of 1409 points within the media. Due to media encoding limitations, a 1410 particular point may not be reachable, but seeking to a point 1411 close by is enabled. A floating point number of seconds may be 1412 provided to express the worst case distance between random access 1413 points. 1415 Conditional Random Access: Based on the above Random Access but 1416 intended to handle a case where the distance in the media between 1417 random access points is large, and where small seek forward using 1418 Random Access would move the client further away than the current 1419 point. 1421 Return To Start: Seeking is only possible to the beginning of the 1422 content. 1424 No seeking: Seeking is not possible at all. 1426 4.9.2. Retention 1428 Media may have different retention policies in place that affect the 1429 operation on media. The following different media retention policies 1430 are envisioned and taken into consideration where applicable: 1432 Unlimited: The media will not be removed as long as the RTSP session 1433 is in existence. 1435 Time Limited: The media will not be removed before given wallclock 1436 time. After that time it may or may not be available any more. 1438 Duration limited: Each individual unit of the media will be retained 1439 for the specified duration. 1441 4.9.3. Content Modifications 1443 There is also the question of how the content may change during time 1444 for a given media resource: 1446 Immutable: The content of the media will not change, even if the 1447 representation, i.e., encoding, quality, etc., may change. 1449 Dynamic: Between explicit updates the media content will not change, 1450 but the content may change due to external methods or triggers, 1451 such as playlists. 1453 Time Progressing: As time progresses new content will become 1454 available. If the content also is retained it will become longer 1455 as everything between the start point and the point currently 1456 being made available can be accessed. If the media server uses a 1457 sliding window policy for retention, the start point will also 1458 change as time progresses. 1460 4.9.4. Supported Scale Factors 1462 Content often supports only a limited set or range of scales when 1463 delivering the media.. To enable the client to know what values or 1464 ranges of scale operations that the whole content or the current 1465 position supports, a media properties attribute for this is defined 1466 which contains a list with the values and/or ranges that are 1467 supported. The attribute is named "Scales". It may be updated at 1468 any point in the content due to content consisting of spliced pieces 1469 or content being dynamically updated by out-of-band mechanisms. 1471 4.9.5. Mapping to the Attributes 1473 This section shows examples of how one would map the above usages to 1474 the properties and their values. 1476 On-demand: Random Access: Random Access=5s, Content Modifications: 1477 Immutable, Retention: unlimited or time limited. 1479 Dynamic On-demand: Random Access: Random Access=3s, Content 1480 Modifications: Dynamic, Retention: unlimited or time limited. 1482 Live: Random Access: No seeking, Content Modifications: Time 1483 Progressing, Retention: Duration limited=0.0s 1485 Live with Recording: Random Access: Random Access=3s, Content 1486 Modifications: Time Progressing, Retention: Duration limited=2H 1488 5. RTSP Message 1490 RTSP is a text-based protocol and uses the ISO 10646 character set in 1491 UTF-8 encoding RFC 3629 [RFC3629]. Lines MUST be terminated by CRLF. 1493 Text-based protocols make it easier to add optional parameters in 1494 a self-describing manner. Since the number of parameters and the 1495 frequency of commands is low, processing efficiency is not a 1496 concern. Text-based protocols, if done carefully, also allow easy 1497 implementation of research prototypes in scripting languages such 1498 as TCL, Visual Basic and Perl. 1500 The ISO 10646 character set avoids tricky character set switching, 1501 but is invisible to the application as long as US-ASCII is being 1502 used. This is also the encoding used for RTCP [RFC3550]. 1504 Requests contain methods, the object the method is operating upon and 1505 parameters to further describe the method. Methods are idempotent 1506 unless otherwise noted. Methods are also designed to require little 1507 or no state maintenance at the media server. 1509 5.1. Message Types 1511 RTSP messages consist of requests from client to server, or server to 1512 client, and responses in the reverse direction. Request (Section 7) 1513 and Response (Section 8) messages use a format based on the generic 1514 message format of RFC 2822 [RFC2822] for transferring bodies (the 1515 payload of the message). Both types of messages consist of a start- 1516 line, zero or more header fields (also known as "headers"), an empty 1517 line (i.e., a line with nothing preceding the CRLF) indicating the 1518 end of the headers, and possibly the data of the message body. 1519 generic-message = start-line 1520 *(message-header CRLF) 1521 CRLF 1522 [ message-body-data ] 1523 start-line = Request-Line | Status-Line 1525 In the interest of robustness, agents MUST ignore any empty line(s) 1526 received where a Request-Line or Response-Line is expected. In other 1527 words, if the agent is reading the protocol stream at the beginning 1528 of a message and receives a CRLF first, it MUST ignore the CRLF. 1530 5.2. Message Headers 1532 RTSP header fields (see Section 18) include general-header, request- 1533 header, response-header, and message-body header fields. 1535 The order in which header fields with differing field names are 1536 received is not significant. However, it is "good practice" to send 1537 general-header fields first, followed by request-header or response- 1538 header fields, and ending with the Message-body header fields. 1540 Multiple message-header fields with the same field-name MAY be 1541 present in a message if and only if the entire field-value for that 1542 header field is defined as a comma-separated list. It MUST be 1543 possible to combine the multiple header fields into one "field-name: 1544 field-value" pair, without changing the semantics of the message, by 1545 appending each subsequent field-value to the first, each separated by 1546 a comma. The order in which header fields with the same field-name 1547 are received is therefore significant to the interpretation of the 1548 combined field value, and thus a proxy MUST NOT change the order of 1549 these field values when a message is forwarded. 1551 Unknown message headers MUST be ignored (skipping over the header to 1552 the next protocol element, and not causing an error) by a RTSP server 1553 or client. An RTSP Proxy MUST forward unknown message headers. 1554 Message headers defined outside of this specification that are 1555 required to be interpreted by the RTSP agent will need to use feature 1556 tags (Section 4.7) and include them in the appropriate Require 1557 (Section 18.41) or Proxy-Require (Section 18.35) header. 1559 5.3. Message Body 1561 The message body (if any) of an RTSP message is used to carry further 1562 information for a particular resource associated with the request or 1563 response. An example of a message body is the Session Description 1564 Protocol (SDP). 1566 The presence of a message body in either a request or a response MUST 1567 be signaled by the inclusion of a Content-Length header (see 1568 Section 18.16). A message body MUST NOT be included in a request or 1569 response if the specification of the particular method (see Method 1570 Definitions (Section 13)) does not allow sending a message body. 1572 5.4. Message Length 1574 When a message body is included in a message, the length of that body 1575 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 18.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 requests and 1599 responses. The general headers are listed in Table 1: 1601 +--------------------+--------------------+ 1602 | Header Name | Defined in Section | 1603 +--------------------+--------------------+ 1604 | Accept-Ranges | Section 18.5 | 1605 | | | 1606 | Cache-Control | Section 18.10 | 1607 | | | 1608 | Connection | Section 18.11 | 1609 | | | 1610 | CSeq | Section 18.19 | 1611 | | | 1612 | Date | Section 18.20 | 1613 | | | 1614 | Media-Properties | Section 18.28 | 1615 | | | 1616 | Media-Range | Section 18.29 | 1617 | | | 1618 | Pipelined-Requests | Section 18.32 | 1619 | | | 1620 | Proxy-Supported | Section 18.36 | 1621 | | | 1622 | RTP-Info | Section 18.43 | 1623 | | | 1624 | Seek-Style | Section 18.45 | 1625 | | | 1626 | Supported | Section 18.49 | 1627 | | | 1628 | Timestamp | Section 18.51 | 1629 | | | 1630 | Via | Section 18.55 | 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 headers (Section 6), request headers (Section 7.2), or 1645 message body headers (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 SP SP 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 18.1 | 1733 | | | 1734 | Accept-Credentials | Section 18.2 | 1735 | | | 1736 | Accept-Encoding | Section 18.3 | 1737 | | | 1738 | Accept-Language | Section 18.4 | 1739 | | | 1740 | Authorization | Section 18.7 | 1741 | | | 1742 | Bandwidth | Section 18.8 | 1743 | | | 1744 | Blocksize | Section 18.9 | 1745 | | | 1746 | From | Section 18.22 | 1747 | | | 1748 | If-Match | Section 18.23 | 1749 | | | 1750 | If-Modified-Since | Section 18.24 | 1751 | | | 1752 | If-None-Match | Section 18.25 | 1753 | | | 1754 | Notify-Reason | Section 18.31 | 1755 | | | 1756 | Proxy-Require | Section 18.35 | 1757 | | | 1758 | Range | Section 18.38 | 1759 | | | 1760 | Referrer | Section 18.39 | 1761 | | | 1762 | Request-Status | Section 18.40 | 1763 | | | 1764 | Require | Section 18.41 | 1765 | | | 1766 | Scale | Section 18.44 | 1767 | | | 1768 | Session | Section 18.47 | 1769 | | | 1770 | Speed | Section 18.48 | 1771 | | | 1772 | Supported | Section 18.49 | 1773 | | | 1774 | Terminate-Reason | Section 18.50 | 1775 | | | 1776 | Transport | Section 18.52 | 1777 | | | 1778 | User-Agent | Section 18.54 | 1779 +--------------------+--------------------+ 1781 Table 3: The RTSP request headers 1783 Detailed header definitions are provided in Section 18. 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. Only responses using the response code class 1xx, 1795 are allowed to send one or more 1xx response messages prior to the 1796 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 17. 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 | 303 | reserved | n/a | 1877 | | | | 1878 | 304 | Not Modified | all | 1879 | | | | 1880 | 305 | Use Proxy | all | 1881 | | | | 1882 | | | | 1883 | 400 | Bad Request | all | 1884 | 401 | Unauthorized | all | 1885 | | | | 1886 | 402 | Payment Required | all | 1887 | | | | 1888 | 403 | Forbidden | all | 1889 | | | | 1890 | 404 | Not Found | all | 1891 | | | | 1892 | 405 | Method Not Allowed | all | 1893 | | | | 1894 | 406 | Not Acceptable | all | 1895 | | | | 1896 | 407 | Proxy Authentication Required | all | 1897 | | | | 1898 | 408 | Request Timeout | all | 1899 | | | | 1900 | 410 | Gone | all | 1901 | | | | 1902 | 411 | Length Required | all | 1903 | | | | 1904 | 412 | Precondition Failed | DESCRIBE, SETUP | 1905 | | | | 1906 | 413 | Request Message Body Too Large | all | 1907 | | | | 1908 | 414 | Request-URI Too Long | all | 1909 | | | | 1910 | 415 | Unsupported Media Type | all | 1911 | | | | 1912 | 451 | Parameter Not Understood | SET_PARAMETER, | 1913 | | | GET_PARAMETER | 1914 | | | | 1915 | 452 | reserved | n/a | 1916 | | | | 1917 | 453 | Not Enough Bandwidth | SETUP | 1918 | | | | 1919 | 454 | Session Not Found | all | 1920 | | | | 1921 | 455 | Method Not Valid In This State | all | 1922 | | | | 1923 | 456 | Header Field Not Valid | all | 1924 | | | | 1925 | 457 | Invalid Range | PLAY, PAUSE | 1926 | | | | 1927 | 458 | Parameter Is Read-Only | SET_PARAMETER | 1928 | | | | 1929 | 459 | Aggregate Operation Not Allowed | all | 1930 | | | | 1931 | 460 | Only Aggregate Operation | all | 1932 | | Allowed | | 1933 | | | | 1934 | 461 | Unsupported Transport | all | 1935 | | | | 1936 | 462 | Destination Unreachable | all | 1937 | | | | 1938 | 463 | Destination Prohibited | SETUP | 1939 | | | | 1940 | 464 | Data Transport Not Ready Yet | PLAY | 1941 | | | | 1942 | 465 | Notification Reason Unknown | PLAY_NOTIFY | 1943 | | | | 1944 | 466 | Key Management Error | all | 1945 | | | | 1946 | 470 | Connection Authorization | all | 1947 | | Required | | 1948 | | | | 1949 | 471 | Connection Credentials not | all | 1950 | | accepted | | 1951 | | | | 1952 | 472 | Failure to establish secure | all | 1953 | | connection | | 1954 | | | | 1955 | | | | 1956 | 500 | Internal Server Error | all | 1957 | | | | 1958 | 501 | Not Implemented | all | 1959 | | | | 1960 | 502 | Bad Gateway | all | 1961 | | | | 1962 | 503 | Service Unavailable | all | 1963 | | | | 1964 | 504 | Gateway Timeout | all | 1965 | | | | 1966 | 505 | RTSP Version Not Supported | all | 1967 | | | | 1968 | 551 | Option Not Support | all | 1969 +------+---------------------------------+--------------------------+ 1971 Table 4: Status codes and their usage with RTSP methods 1973 8.2. Response Headers 1975 The response-headers allow the request recipient to pass additional 1976 information about the response which cannot be placed in the Status- 1977 Line. This header gives information about the server and about 1978 further access to the resource identified by the Request-URI. All 1979 headers currently classified as response headers are listed in 1980 Table 5. 1982 +------------------------+--------------------+ 1983 | Header | Defined in Section | 1984 +------------------------+--------------------+ 1985 | Connection-Credentials | Section 18.12 | 1986 | | | 1987 | Location | Section 18.27 | 1988 | | | 1989 | MTag | Section 18.30 | 1990 | | | 1991 | Proxy-Authenticate | Section 18.33 | 1992 | | | 1993 | Public | Section 18.37 | 1994 | | | 1995 | Range | Section 18.38 | 1996 | | | 1997 | Retry-After | Section 18.42 | 1998 | | | 1999 | Scale | Section 18.44 | 2000 | | | 2001 | Session | Section 18.47 | 2002 | | | 2003 | Server | Section 18.46 | 2004 | | | 2005 | Speed | Section 18.48 | 2006 | | | 2007 | Transport | Section 18.52 | 2008 | | | 2009 | Unsupported | Section 18.53 | 2010 | | | 2011 | WWW-Authenticate | Section 18.56 | 2012 +------------------------+--------------------+ 2014 Table 5: The RTSP response headers 2016 Response-header names can be extended reliably only in combination 2017 with a change in the protocol version. However, the usage of 2018 feature-tags in the request allows the responding party to learn the 2019 capability of the receiver of the response. A new or experimental 2020 header MAY be given the semantics of response-header if all parties 2021 in the communication recognize them to be response-header. 2022 Unrecognized headers in responses are treated as message-headers and 2023 hence MUST be ignored. 2025 9. Message Body 2027 Request and Response messages MAY transfer a message body, if not 2028 otherwise restricted by the request method or response status code. 2029 The message body consists of the content data itself (see also 2030 Section 5.2). 2032 The SET_PARAMETER and GET_PARAMETER request and response, and 2033 DESCRIBE response MAY have a message body. All 4xx and 5xx responses 2034 MAY also have a message body. 2036 In this section, both sender and recipient refer to either the client 2037 or the server, depending on who sends and who receives the message 2038 body. 2040 9.1. Message-Body Header Fields 2042 Message-body header fields define meta-information about the content 2043 data in the message body. The message-body header fields are listed 2044 in Table 6. 2046 +------------------+--------------------+ 2047 | Header | Defined in Section | 2048 +------------------+--------------------+ 2049 | Allow | Section 18.6 | 2050 | | | 2051 | Content-Base | Section 18.13 | 2052 | | | 2053 | Content-Encoding | Section 18.14 | 2054 | | | 2055 | Content-Language | Section 18.15 | 2056 | | | 2057 | Content-Length | Section 18.16 | 2058 | | | 2059 | Content-Location | Section 18.17 | 2060 | | | 2061 | Content-Type | Section 18.18 | 2062 | | | 2063 | Expires | Section 18.21 | 2064 | | | 2065 | Last-Modified | Section 18.26 | 2066 +------------------+--------------------+ 2068 Table 6: The RTSP message-body headers 2070 The extension-header mechanism allows additional message-body header 2071 fields to be defined without changing the protocol, but these fields 2072 cannot be assumed to be recognizable by the recipient. Unrecognized 2073 header fields MUST be ignored by the recipient and forwarded by 2074 proxies. 2076 9.2. Message Body 2078 An RTSP message with a message body MUST include the Content-Type and 2079 Content-Length headers. When a message body is included with a 2080 message, the data type of that content data is determined via the 2081 header fields Content-Type and Content-Encoding. 2083 Content-Type specifies the media type of the underlying data. 2084 Content-Encoding may be used to indicate any additional content 2085 codings applied to the data, usually for the purpose of data 2086 compression, that are a property of the requested resource. There is 2087 no default encoding. 2089 The Content-Length of a message is the length of the content, 2090 measured in bytes. 2092 10. Connections 2094 RTSP requests can be transmitted using the two different connection 2095 scenarios listed below: 2097 o persistent - a transport connection is used for several request/ 2098 response transactions; 2100 o transient - a transport connection is used for a single request/ 2101 response transaction. 2103 RFC 2326 attempted to specify an optional mechanism for transmitting 2104 RTSP messages in connectionless mode over a transport protocol such 2105 as UDP. However, it was not specified in sufficient detail to allow 2106 for interoperable implementations. In an attempt to reduce 2107 complexity and scope, and due to lack of interest, RTSP 2.0 does not 2108 attempt to define a mechanism for supporting RTSP over UDP or other 2109 connectionless transport protocols. A side-effect of this is that 2110 RTSP requests MUST NOT be sent to multicast groups since no 2111 connection can be established with a specific receiver in multicast 2112 environments. 2114 Certain RTSP headers, such as the CSeq header (Section 18.19), which 2115 may appear to be relevant only to connectionless transport scenarios 2116 are still retained and MUST be implemented according to the 2117 specification. In the case of CSeq, it is quite useful for matching 2118 responses to requests if the requests are pipelined (see Section 12). 2119 It is also useful in proxies for keeping track of the different 2120 requests when aggregating several client requests on a single TCP 2121 connection. 2123 10.1. Reliability and Acknowledgements 2125 Since RTSP messages are transmitted using reliable transport 2126 protocols, they MUST NOT be retransmitted at the RTSP protocol level. 2127 Instead, the implementation must rely on the underlying transport to 2128 provide reliability. The RTSP implementation may use any indication 2129 of reception acknowledgment of the message from the underlying 2130 transport protocols to optimize the RTSP behavior. 2132 If both the underlying reliable transport such as TCP and the RTSP 2133 application retransmit requests, each packet loss or message loss 2134 may result in two retransmissions. The receiver typically cannot 2135 take advantage of the application-layer retransmission since the 2136 transport stack will not deliver the application-layer 2137 retransmission before the first attempt has reached the receiver. 2138 If the packet loss is caused by congestion, multiple 2139 retransmissions at different layers will exacerbate the 2140 congestion. 2142 Lack of acknowledgment of an RTSP request should be handled within 2143 the constraints of the connection timeout considerations described 2144 below (Section 10.4). 2146 10.2. Using Connections 2148 A TCP transport can be used for both persistent connections (for 2149 several message exchanges) and transient connections (for a single 2150 message exchange). Implementations of this specification MUST 2151 support RTSP over TCP. The scheme of the RTSP URI (Section 4.2) 2152 indicates the default port that the server will listen on if the port 2153 is not explicitly given. 2155 A server MUST handle both persistent and transient connections. 2157 Transient connections facilitate mechanisms for fault tolerance. 2158 They also allow for application layer mobility. A server and 2159 client pair that support transient connections can survive the 2160 loss of a TCP connection; e.g., due to a NAT timeout. When the 2161 client has discovered that the TCP connection has been lost, it 2162 can set up a new one when there is need to communicate again. 2164 A persistent connection is RECOMMENDED to be used for all 2165 transactions between the server and client, including messages for 2166 multiple RTSP sessions. However, a persistent connection MAY be 2167 closed after a few message exchanges. For example, a client may use 2168 a persistent connection for the initial SETUP and PLAY message 2169 exchanges in a session and then close the connection. Later, when 2170 the client wishes to send a new request, such as a PAUSE for the 2171 session, a new connection would be opened. This connection may 2172 either be transient or persistent. 2174 An RTSP agent SHOULD NOT have more than one connection to the server 2175 at any given point. If a client or proxy handles multiple RTSP 2176 sessions on the same server, it SHOULD use only one connection for 2177 managing those sessions. 2179 This saves connection resources on the server. It also reduces 2180 complexity by enabling the server to maintain less state about its 2181 sessions and connections. 2183 RTSP allows a server to send requests to a client. However, this can 2184 be supported only if a client establishes a persistent connection 2185 with the server. In cases where a persistent connection does not 2186 exist between a server and its client, due to the lack of a signaling 2187 channel the server may be forced to silently discard RTSP messages, 2188 and may even drop an RTSP session without notifying the client. An 2189 example of such a case is when the server desires to send a REDIRECT 2190 request for an RTSP session to the client but is not able to do so 2191 because it cannot reach the client. A server that attempts to send a 2192 request to a client that has no connection currently to the server 2193 SHOULD discard the request directly, but it MAY queue it for later 2194 delivery. However, if the server queues the request it SHOULD when 2195 adding additional requests to the queue ensure to remove older 2196 requests that are now redundant. 2198 Without a persistent connection between the client and the server, 2199 the media server has no reliable way of reaching the client. 2200 Because the likely failure of server to client established 2201 connections the server will not even attempt establishing any 2202 connection. 2204 The sending of client and server requests can be asynchronous events. 2205 To avoid deadlock situations both client and server MUST be able to 2206 send and receive requests simultaneously. As an RTSP response may be 2207 queued up for transmission, reception or processing behind the peer 2208 RTSP agent's own requests, all RTSP agents are required to have a 2209 certain capability of handling outstanding messages. A potential 2210 issue is that outstanding requests may timeout despite them being 2211 processed by the peer due to the response is caught in the queue 2212 behind a number of request that the RTSP agent is processing but that 2213 take some time to complete. To avoid this problem an RTSP agent is 2214 recommended to buffer incoming messages locally so that any response 2215 messages can be processed immediately upon reception. If responses 2216 are separated from requests and directly forwarded for processing, 2217 not only can the result be used immediately, the state associated 2218 with that outstanding request can also be released. However, 2219 buffering a number of requests on the receiving RTSP agent consumes 2220 resources and enables a resource exhaustion attack on the agent. 2221 Therefore this buffer should be limited so that an unreasonable 2222 number of requests or total message size is not allowed to consume 2223 the receiving agent's resources. In most APIs, having the receiving 2224 agent stop reading from the TCP socket will result in TCP's window 2225 being clamped. Thus forcing the buffering onto the sending agent 2226 when the load is larger than expected. However, as both RTSP message 2227 sizes and frequency may be changed in the future by protocol 2228 extensions, an agent should be careful against taking harsher 2229 measurements against a potential attack. When under attack an RTSP 2230 agent can close TCP connections and release state associated with 2231 that TCP connection. 2233 To provide some guidance on what is reasonable the following 2234 guidelines are given. It is RECOMMENDED that: 2236 o an RTSP agent should not have more than 10 outstanding requests 2237 per RTSP session; 2239 o an RTSP agent should not have more than 10 outstanding requests 2240 that are not related to an RTSP session or that are requesting to 2241 create an RTSP session. 2243 In light of the above, it is RECOMMENDED that clients use persistent 2244 connections whenever possible. A client that supports persistent 2245 connections MAY "pipeline" its requests (see Section 12). 2247 10.3. Closing Connections 2249 The client MAY close a connection at any point when no outstanding 2250 request/response transactions exist for any RTSP session being 2251 managed through the connection. The server, however, SHOULD NOT 2252 close a connection until all RTSP sessions being managed through the 2253 connection have been timed out (Section 18.47). A server SHOULD NOT 2254 close a connection immediately after responding to a session-level 2255 TEARDOWN request for the last RTSP session being controlled through 2256 the connection. Instead, it should wait for a reasonable amount of 2257 time for the client to receive the TEARDOWN response, take 2258 appropriate action, and initiate the connection closing. The server 2259 SHOULD wait at least 10 seconds after sending the TEARDOWN response 2260 before closing the connection. 2262 This is to ensure that the client has time to issue a SETUP for a 2263 new session on the existing connection after having torn the last 2264 one down. 10 seconds should give the client ample opportunity to 2265 get its message to the server. 2267 A server SHOULD NOT close the connection directly as a result of 2268 responding to a request with an error code. 2270 Certain error responses such as "460 Only Aggregate Operation 2271 Allowed" (Section 17.4.25) are used for negotiating capabilities 2272 of a server with respect to content or other factors. In such 2273 cases, it is inefficient for the server to close a connection on 2274 an error response. Also, such behavior would prevent 2275 implementation of advanced/special types of requests or result in 2276 extra overhead for the client when testing for new features. On 2277 the flip side, keeping connections open after sending an error 2278 response poses a Denial of Service security risk (Section 21). 2280 The server MAY close a connection if it receives an incomplete 2281 message and if the message is not completed within a reasonable 2282 amount of time. It is RECOMMENDED that the server waits at least 10 2283 seconds for the completion of a message or for the next part of the 2284 message to arrive (which is an indication that the transport and the 2285 client are still alive). Servers believing they are under attack or 2286 otherwise starved for resources during that event MAY consider using 2287 a shorter timeout. 2289 If a server closes a connection while the client is attempting to 2290 send a new request, the client will have to close its current 2291 connection, establish a new connection and send its request over the 2292 new connection. 2294 An RTSP message SHOULD NOT be terminated by closing the connection. 2295 Such a message MAY be considered to be incomplete by the receiver and 2296 discarded. An RTSP message is properly terminated as defined in 2297 Section 5. 2299 10.4. Timing Out Connections and RTSP Messages 2301 Receivers of a request (responder) SHOULD respond to requests in a 2302 timely manner even when a reliable transport such as TCP is used. 2303 Similarly, the sender of a request (requester) SHOULD wait for a 2304 sufficient time for a response before concluding that the responder 2305 will not be acting upon its request. 2307 A responder SHOULD respond to all requests within 5 seconds. If the 2308 responder recognizes that processing of a request will take longer 2309 than 5 seconds, it SHOULD send a 100 (Continue) response as soon as 2310 possible. It SHOULD continue sending a 100 response every 5 seconds 2311 thereafter until it is ready to send the final response to the 2312 requester. After sending a 100 response, the receiver MUST send a 2313 final response indicating the success or failure of the request. 2315 A requester SHOULD wait at least 10 seconds for a response before 2316 concluding that the responder will not be responding to its request. 2317 After receiving a 100 response, the requester SHOULD continue waiting 2318 for further responses. If more than 10 seconds elapses without 2319 receiving any response, the requester MAY assume that the responder 2320 is unresponsive and abort the connection. 2322 A requester SHOULD wait longer than 10 seconds for a response if it 2323 is experiencing significant transport delays on its connection to the 2324 responder. The requester is capable of determining the RTT of the 2325 request/response cycle using the Timestamp header (Section 18.51) in 2326 any RTSP request. 2328 10 seconds was chosen for the following reasons. It gives TCP 2329 time to perform a couple of retransmissions, even if operating on 2330 default values. It is short enough that users may not abandon the 2331 process themselves. However, it should be noted that 10 seconds 2332 can be aggressive on certain type of networks. The 5 seconds 2333 value for 1xx messages is half the timeout giving a reasonable 2334 chance of successful delivery before timeout happens on the 2335 requester side. 2337 10.5. Showing Liveness 2339 The mechanisms for showing liveness of the client is, any RTSP 2340 request with a Session header, if RTP & RTCP is used an RTCP message, 2341 or through any other used media protocol capable of indicating 2342 liveness of the RTSP client. It is RECOMMENDED that a client does 2343 not wait to the last second of the timeout before trying to send a 2344 liveness message. The RTSP message may be lost or when using 2345 reliable protocols, such as TCP, the message may take some time to 2346 arrive safely at the receiver. To show liveness between RTSP request 2347 issued to accomplish other things, the following mechanisms can be 2348 used, in descending order of preference: 2350 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 2351 RTCP is used to report transport statistics, it MUST also work 2352 as keep alive. The server can determine the client by network 2353 address and port together with the fact that the client is 2354 reporting on the servers SSRC(s). A downside of using RTCP is 2355 that it only gives statistical guarantees to reach the server. 2356 However, the probability of a false client timeout is so low 2357 that it can be ignored in most cases. For example, assume a 2358 session with 60 seconds timeout and enough bitrate assigned to 2359 RTCP messages to send a message from client to server on 2360 average every 5 seconds. That client has, for a network with 5 2361 % packet loss, the probability to fail showing liveness sign in 2362 that session within the timeout interval of 2.4*E-16. Sessions 2363 with shorter timeouts, or much higher packet loss, or small 2364 RTCP bandwidths SHOULD also use any of the mechanisms below. 2366 SET_PARAMETER: When using SET_PARAMETER for keep alive, a body 2367 SHOULD NOT be included. This method is the RECOMMENDED RTSP 2368 method to use for a request intended only to perform keep- 2369 alive. 2371 GET_PARAMETER: When using GET_PARAMETER for keep alive, no body 2372 SHOULD be included. 2374 OPTIONS: This method is also usable, but it causes the server to 2375 perform more unnecessary processing and results in bigger 2376 responses than necessary for the task. The reason is that the 2377 server needs to determine the capabilities associated with the 2378 media resource to correctly populate the Public and Allow 2379 headers. 2381 The timeout parameter MAY be included in a SETUP response, and MUST 2382 NOT be included in requests. The server uses it to indicate to the 2383 client how long the server is prepared to wait between RTSP commands 2384 or other signs of life before closing the session due to lack of 2385 activity (see Appendix B). The timeout is measured in seconds, with 2386 a default of 60 seconds. The length of the session timeout MUST NOT 2387 be changed in an established session. 2389 10.6. Use of IPv6 2391 Explicit IPv6 [RFC2460] support was not present in RTSP 1.0 (RFC 2392 2326). RTSP 2.0 has been updated for explicit IPv6 support. 2393 Implementations of RTSP 2.0 MUST understand literal IPv6 addresses in 2394 URIs and headers. 2396 10.7. Overload Control 2398 Overload in RTSP can occur when servers and proxies have insufficient 2399 resources to complete the processing of a request. An improper 2400 handling of such an overload situation at proxies and servers can 2401 impact the operation of the RTSP deployment, and probably worsen the 2402 situation. RTSP defines the 503 (Service Unavailable) response 2403 (Section 17.5.4) to let servers and proxies notify requesting proxies 2404 and RTSP clients about an overload situation. In conjunction with 2405 the Retry-After header (Section 18.42) the server or proxy can 2406 indicate the time after the requesting entity can send another 2407 request to the proxy or server. 2409 Simply implementing and using the 503 (Service Unavailable) is not 2410 sufficient for properly handling overload situations. For instance, 2411 a simplistic approach would be to send the 503 response with a Retry- 2412 After header set to a fixed value. However, this can cause the 2413 situation where multiple RTSP clients again send requests to a proxy 2414 or server at roughly the same time which may again cause an overload 2415 situation, or if the "old" overload situation is not yet solved, 2416 i.e., the length indicated in the Retry-After header was too short. 2418 An RTSP server or proxy in an overload situation must select the 2419 value of the Retry-After header carefully and in dependency of its 2420 current load situation. It is RECOMMENDED to increase the length 2421 proportional with the current load of the server, i.e., an increasing 2422 workload should result in an increased length of the indicated 2423 unavailability. It is RECOMMENDED to not send the same value in the 2424 Retry-After header to all requesting proxies and clients, but to add 2425 a variation to the mean value of the Retry-After header. 2427 Another issue are load balancing RTSP proxies, i.e., where an RTSP 2428 proxy is used to select amongst a set of RTSP servers to handle the 2429 requests, or when multiple server addresses are available for a given 2430 server name. The proxy or client may receive a 503 (Service 2431 Unavailable) from one of its RTSP servers or a TCP timeout (if the 2432 server is even unable to handle the request message). The proxy or 2433 client simply retries the other addresses, but may also receive a 503 2434 (Service Unavailable) response or TCP timeouts from those addresses. 2435 In such a situation, where none of the RTSP servers/addresses can 2436 handle the request, the RTSP agent has to wait before it can send any 2437 new requests to the RTSP server. Any additional request to a 2438 specific address MUST be delayed according to the Retry-After headers 2439 received. For addresses where no response was received or TCP 2440 timeout occurred, an initial wait timer SHOULD be set to 5 seconds. 2441 That timer MUST be doubled for each additional failure to connect or 2442 receive response. It is RECOMMENDED to not set the same value in the 2443 timer, but to add a variation to the mean value. 2445 11. Capability Handling 2447 This section describes the available capability handling mechanism 2448 which allows RTSP to be extended. Extensions to this version of the 2449 protocol are basically done in two ways. First, new headers can be 2450 added. Secondly, new methods can be added. The capability handling 2451 mechanism is designed to handle both cases. 2453 When a method is added, the involved parties can use the OPTIONS 2454 method to discover whether it is supported. This is done by issuing 2455 an OPTIONS request to the other party. Depending on the URI it will 2456 either apply in regards to a certain media resource, the whole server 2457 in general, or simply the next hop. The OPTIONS response MUST 2458 contain a Public header which declares all methods supported for the 2459 indicated resource. 2461 It is not necessary to use OPTIONS to discover support of a method, 2462 as the client could simply try the method. If the receiver of the 2463 request does not support the method it will respond with an error 2464 code indicating the method is either not implemented (501) or does 2465 not apply for the resource (405). The choice between the two 2466 discovery methods depends on the requirements of the service. 2468 Feature-Tags are defined to handle functionality additions that are 2469 not new methods. Each feature-tag represents a certain block of 2470 functionality. The amount of functionality that a feature-tag 2471 represents can vary significantly. A feature-tag can for example 2472 represent the functionality a single RTSP header provides. Another 2473 feature-tag can represent much more functionality, such as the 2474 "play.basic" feature-tag which represents the minimal media delivery 2475 for playback implementation. 2477 Feature-tags are used to determine whether the client, server or 2478 proxy supports the functionality that is necessary to achieve the 2479 desired service. To determine support of a feature-tag, several 2480 different headers can be used, each explained below: 2482 Supported: This header is used to determine the complete set of 2483 functionality that both client and server have. The intended 2484 usage is to determine before one needs to use a functionality 2485 that it is supported. It can be used in any method, but 2486 OPTIONS is the most suitable one as it at the same time 2487 determines all methods that are implemented. When sending a 2488 request the requester declares all its capabilities by 2489 including all supported feature-tags. This results in the 2490 receiver is learning the requester's feature support. The 2491 receiver then includes its set of features in the response. 2493 Proxy-Supported: This header is used similarly to the Supported 2494 header, but instead of giving the supported functionality of 2495 the client or server it provides both the requester and the 2496 responder a view of what functionality the proxy chain between 2497 the two supports. Proxies are required to add this header 2498 whenever the Supported header is present, but proxies may also 2499 add it independently of the requester. 2501 Require: This header can be included in any request where the end- 2502 point, i.e. the client or server, is required to understand the 2503 feature to correctly perform the request. This can, for 2504 example, be a SETUP request where the server is required to 2505 understand a certain parameter to be able to set up the media 2506 delivery correctly. Ignoring this parameter would not have the 2507 desired effect and is not acceptable. Therefore the end-point 2508 receiving a request containing a Require MUST negatively 2509 acknowledge any feature that it does not understand and not 2510 perform the request. The response in cases where features are 2511 not supported are 551 (Option Not Supported). Also the 2512 features that are not supported are given in the Unsupported 2513 header in the response. 2515 Proxy-Require: This header has the same purpose and workings as 2516 Require except that it only applies to proxies and not the end- 2517 point. Features that need to be supported by both proxies and 2518 end-points need to be included in both the Require and Proxy- 2519 Require header. 2521 Unsupported: This header is used in a 551 error response, to 2522 indicate which features were not supported. Such a response is 2523 only the result of the usage of the Require and/or Proxy- 2524 Require header where one or more features where not supported. 2525 This information allows the requester to make the best of 2526 situations as it knows which features are not supported. 2528 12. Pipelining Support 2530 Pipelining is a general method to improve performance of request 2531 response protocols by allowing the requesting agent to have more than 2532 one request outstanding and send them over the same persistent 2533 connection. For RTSP, where the relative order of requests will 2534 matter, it is important to maintain the order of the requests. 2535 Because of this, the responding agent MUST process the incoming 2536 requests in their sending order. The sending order can be determined 2537 by the CSeq header and its sequence number. For TCP the delivery 2538 order will be the same between two agents, as the sending order. The 2539 processing of the request MUST also have been finished before 2540 processing the next request from the same agent. The responses MUST 2541 be sent in the order the requests were processed. 2543 RTSP 2.0 has extended support for pipelining compared to RTSP 1.0. 2544 The major improvement is to allow all requests to setup and initiate 2545 media delivery to be pipelined after each other. This is 2546 accomplished by the utilization of the Pipelined-Requests header (see 2547 Section 18.32). This header allows a client to request that two or 2548 more requests are processed in the same RTSP session context which 2549 the first request creates. In other words, a client can request that 2550 two or more media streams are set-up and then played without needing 2551 to wait for a single response. This speeds up the initial startup 2552 time for an RTSP session with at least one RTT. 2554 If a pipelined request builds on the successful completion of one or 2555 more prior requests the requester must verify that all requests were 2556 executed as expected. A common example will be two SETUP requests 2557 and a PLAY request. In case one of the SETUP fails unexpectedly, the 2558 PLAY request can still be successfully executed. However, the 2559 resulting presentation will not be as expected by the requesting 2560 client, as only a single media instead of two will be played. In 2561 this case the client can send a PAUSE request, correct the failing 2562 SETUP request and then request it to be played. 2564 13. Method Definitions 2566 The method indicates what is to be performed on the resource 2567 identified by the Request-URI. The method name is case-sensitive. 2568 New methods may be defined in the future. Method names MUST NOT 2569 start with a $ character (decimal 36) and MUST be a token as defined 2570 by the ABNF [RFC5234] in the syntax chapter Section 20. The methods 2571 are summarized in Table 7. 2573 +---------------+-----------+--------+-------------+-------------+ 2574 | method | direction | object | Server req. | Client req. | 2575 +---------------+-----------+--------+-------------+-------------+ 2576 | DESCRIBE | C -> S | P,S | recommended | recommended | 2577 | | | | | | 2578 | GET_PARAMETER | C -> S | P,S | optional | optional | 2579 | | | | | | 2580 | | S -> C | P,S | optional | optional | 2581 | | | | | | 2582 | OPTIONS | C -> S | P,S | required | required | 2583 | | | | | | 2584 | | S -> C | P,S | optional | optional | 2585 | | | | | | 2586 | PAUSE | C -> S | P,S | required | required | 2587 | | | | | | 2588 | PLAY | C -> S | P,S | required | required | 2589 | | | | | | 2590 | PLAY_NOTIFY | S -> C | P,S | required | required | 2591 | | | | | | 2592 | REDIRECT | S -> C | P,S | optional | required | 2593 | | | | | | 2594 | SETUP | C -> S | S | required | required | 2595 | | | | | | 2596 | SET_PARAMETER | C -> S | P,S | required | optional | 2597 | | | | | | 2598 | | S -> C | P,S | optional | optional | 2599 | | | | | | 2600 | TEARDOWN | C -> S | P,S | required | required | 2601 | | | | | | 2602 | | S -> C | P | required | required | 2603 +---------------+-----------+--------+-------------+-------------+ 2605 Table 7: Overview of RTSP methods, their direction, and what objects 2606 (P: presentation, S: stream) they operate on. 2608 Note on Table 7: GET_PARAMETER is optional. For example, a fully 2609 functional server can be built to deliver media without any 2610 parameters. SET_PARAMETER is required, however, due to its usage 2611 for keep-alive. PAUSE is now required because it is the only way 2612 of leaving the Play state without terminating the whole session. 2614 If an RTSP agent does not support a particular method, it MUST return 2615 501 (Not Implemented) and the requesting RTSP agent, in turn, SHOULD 2616 NOT try this method again for the given agent / resource combination. 2617 An RTSP proxy whose main function is to log or audit and not modify 2618 transport or media handling in any way MAY forward RTSP messages with 2619 unknown methods. Note that the proxy still needs to perform the 2620 minimal required processing, like adding the Via header. 2622 13.1. OPTIONS 2624 The semantics of the RTSP OPTIONS method is similar to that of the 2625 HTTP OPTIONS method described in [H9.2]. In RTSP however, OPTIONS is 2626 bi-directional, in that a client can request it to a server and vice 2627 versa. A client MUST implement the capability to send an OPTIONS 2628 request and a server or a proxy MUST implement the capability to 2629 respond to an OPTIONS request. The client, server or proxy MAY also 2630 implement the converse of their required capability, but still retain 2631 the prior mentioned about what is a "MUST implement". 2633 An OPTIONS request may be issued at any time. Such a request does 2634 not modify the session state. However, it may prolong the session 2635 lifespan (see below). The URI in an OPTIONS request determines the 2636 scope of the request and the corresponding response. If the Request- 2637 URI refers to a specific media resource on a given host, the scope is 2638 limited to the set of methods supported for that media resource by 2639 the indicated RTSP agent. A Request-URI with only the host address 2640 limits the scope to the specified RTSP agent's general capabilities 2641 without regard to any specific media. If the Request-URI is an 2642 asterisk ("*"), the scope is limited to the general capabilities of 2643 the next hop (i.e. the RTSP agent in direct communication with the 2644 request sender). 2646 Regardless of scope of the request, the Public header MUST always be 2647 included in the OPTIONS response listing the methods that are 2648 supported by the responding RTSP agent. In addition, if the scope of 2649 the request is limited to a media resource, the Allow header MUST be 2650 included in the response to enumerate the set of methods that are 2651 allowed for that resource unless the set of methods completely 2652 matches the set in the Public header. If the given resource is not 2653 available, the RTSP agent SHOULD return an appropriate response code 2654 such as 3rr or 4xx. The Supported header MAY be included in the 2655 request to query the set of features that are supported by the 2656 responding RTSP agent. 2658 The OPTIONS method can be used to keep an RTSP session alive. 2659 However, this is not the preferred way of session keep-alive 2660 signaling, see Section 18.47. An OPTIONS request intended for 2661 keeping alive an RTSP session MUST include the Session header with 2662 the associated session ID. Such a request SHOULD also use the media 2663 or the aggregated control URI as the Request-URI. 2665 Example: 2667 C->S: OPTIONS rtsp://server.example.com RTSP/2.0 2668 CSeq: 1 2669 User-Agent: PhonyClient/1.2 2670 Proxy-Require: gzipped-messages 2671 Supported: play.basic 2673 S->C: RTSP/2.0 200 OK 2674 CSeq: 1 2675 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS 2676 Supported: play.basic, setup.rtp.rtcp.mux, play.scale 2677 Server: PhonyServer/1.1 2679 Note that some of the feature-tags in Supported and Proxy-Require are 2680 fictional features. 2682 13.2. DESCRIBE 2684 The DESCRIBE method is used to retrieve the description of a 2685 presentation or media object from a server. The Request-URI of the 2686 DESCRIBE request identifies the media resource of interest. The 2687 client MAY include the Accept header in the request to list the 2688 description formats that it understands. The server MUST respond 2689 with a description of the requested resource and return the 2690 description in the message body of the response, if the DESCRIBE 2691 method request can be successfully fulfilled. The DESCRIBE reply- 2692 response pair constitutes the media initialization phase of RTSP. 2694 The DESCRIBE response SHOULD contain all media initialization 2695 information for the resource(s) that it describes. Servers SHOULD 2696 NOT use the DESCRIBE response as a means of media indirection by 2697 having the description point at another server; instead, using the 2698 3rr responses is RECOMMENDED. 2700 By forcing a DESCRIBE response to contain all media initialization 2701 information for the set of streams that it describes, and 2702 discouraging the use of DESCRIBE for media indirection, any 2703 looping problems can be avoided that might have resulted from 2704 other approaches. 2706 Example: 2708 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/2.0 2709 CSeq: 312 2710 User-Agent: PhonyClient/1.2 2711 Accept: application/sdp, application/example 2713 S->C: RTSP/2.0 200 OK 2714 CSeq: 312 2715 Date: Thu, 23 Jan 1997 15:35:06 GMT 2716 Server: PhonyServer/1.1 2717 Content-Base: rtsp://server.example.com/fizzle/foo/ 2718 Content-Type: application/sdp 2719 Content-Length: 358 2721 v=0 2722 o=mhandley 2890844526 2890842807 IN IP4 192.0.2.46 2723 s=SDP Seminar 2724 i=A Seminar on the session description protocol 2725 u=http://www.example.com/lectures/sdp.ps 2726 e=seminar@example.com (Seminar Management) 2727 c=IN IP4 0.0.0.0 2728 a=control:* 2729 t=2873397496 2873404696 2730 m=audio 3456 RTP/AVP 0 2731 a=control:audio 2732 m=video 2232 RTP/AVP 31 2733 a=control:video 2735 Media initialization is a requirement for any RTSP-based system, but 2736 the RTSP specification does not dictate that this is required to be 2737 done via the DESCRIBE method. There are three ways that an RTSP 2738 client may receive initialization information: 2740 o via an RTSP DESCRIBE request 2742 o via some other protocol (HTTP, email attachment, etc.) 2744 o via some form of user interface 2746 If a client obtains a valid description from an alternate source, the 2747 client MAY use this description for initialization purposes without 2748 issuing a DESCRIBE request for the same media. The client should use 2749 any MTag to either validate the presentation description or make the 2750 session establishment conditional on being valid. 2752 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2753 and highly recommended that minimal clients support the ability to 2754 act as "helper applications" that accept a media initialization file 2755 from a user interface, and/or other means that are appropriate to the 2756 operating environment of the clients. 2758 13.3. SETUP 2760 Note: The states described in this section and the following are 2761 described in detail in Appendix B. 2763 The SETUP request for an URI specifies the transport mechanism to be 2764 used for the streamed media. The SETUP method may be used in two 2765 different cases; Create an RTSP session and change the transport 2766 parameters of already set up media stream(s). SETUP can be used in 2767 all three states; Init, and Ready, for both purposes and in PLAY to 2768 change the transport parameters. There is also a third possible 2769 usage for the SETUP method which is not specified in this memo: 2770 adding a media to a session. Using SETUP to add media to an existing 2771 session, when the session is in Play state, is unspecified. 2773 The Transport header, see Section 18.52, specifies the media 2774 transport parameters acceptable to the client for data transmission; 2775 the response will contain the transport parameters selected by the 2776 server. This allows the client to enumerate in descending order of 2777 preference the transport mechanisms and parameters acceptable to it, 2778 while the server can select the most appropriate. It is expected 2779 that the session description format used will enable the client to 2780 select a limited number of possible configurations that are offered 2781 to the server to choose from. All transport related parameters SHALL 2782 be included in the Transport header; the use of other headers for 2783 this purpose is NOT RECOMMENDED due to middleboxes, such as firewalls 2784 or NATs. 2786 For the benefit of any intervening firewalls, a client MUST indicate 2787 the known transport parameters, even if it has no influence over 2788 these parameters, for example, where the server advertises a fixed 2789 multicast address as destination. 2791 Since SETUP includes all transport initialization information, 2792 firewalls and other intermediate network devices (which need this 2793 information) are spared the more arduous task of parsing the 2794 DESCRIBE response, which has been reserved for media 2795 initialization. 2797 The client MUST include the Accept-Ranges header in the request 2798 indicating all supported unit formats in the Range header. This 2799 allows the server to know which formats it may use in future session 2800 related responses, such as a PLAY response without any range in the 2801 request. If the client does not support a time format necessary for 2802 the presentation, the server MUST respond using 456 (Header Field Not 2803 Valid for Resource) and include the Accept-Ranges header with the 2804 range unit formats supported for the resource. 2806 In a SETUP response the server MUST include the Accept-Ranges header 2807 (see Section 18.5) to indicate which time formats are acceptable to 2808 use for this media resource. 2810 The SETUP response 200 OK MUST include the Media-Properties header 2811 (see Section 18.28 ). The combination of the parameters of the 2812 Media-Properties header indicates the nature of the content present 2813 in the session (see also Section 4.9). For example, a live stream 2814 with time shifting is indicated by 2816 o Random Access set to Random-Access, 2818 o Content Modifications set to Time Progressing, 2820 o Retention set to Time-Duration (with specific recording window 2821 time value). 2823 The SETUP response 200 OK MUST include the Media-Range header (see 2824 Section 18.29) if the media is Time-Progressing. 2826 A basic example for SETUP: 2828 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 2829 CSeq: 302 2830 Transport: RTP/AVP;unicast;dest_addr=":4588"/":4589", 2831 RTP/AVP/TCP;unicast;interleaved=0-1 2832 Accept-Ranges: NPT, UTC 2833 User-Agent: PhonyClient/1.2 2835 S->C: RTSP/2.0 200 OK 2836 CSeq: 302 2837 Date: Thu, 23 Jan 1997 15:35:06 GMT 2838 Server: PhonyServer/1.1 2839 Session: 47112344;timeout=60 2840 Transport: RTP/AVP;unicast;dest_addr="192.0.2.53:4588"/ 2841 "192.0.2.53:4589"; src_addr="198.51.100.241:6256"/ 2842 "198.51.100.241:6257"; ssrc=2A3F93ED 2843 Accept-Ranges: NPT 2844 Media-Properties: Random-Access=3.2, Time-Progressing, 2845 Time-Duration=3600.0 2846 Media-Range: npt=0-2893.23 2848 In the above example the client wants to create an RTSP session 2849 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2850 The transport parameters acceptable to the client are either RTP/AVP/ 2851 UDP (UDP per default) to be received on client port 4588 and 4589 at 2852 the address the RTSP setup connection comes from or RTP/AVP 2853 interleaved on the RTSP control channel. The server selects the RTP/ 2854 AVP/UDP transport and adds the address and ports it will send and 2855 receive RTP and RTCP from, and the RTP SSRC that will be used by the 2856 server. 2858 The server MUST generate a session identifier in response to a 2859 successful SETUP request, unless a SETUP request to a server includes 2860 a session identifier or a Pipelined-Requests header referencing an 2861 existing session context, in which case the server MUST bundle this 2862 SETUP request into the existing session (aggregated session) or 2863 return error 459 (Aggregate Operation Not Allowed) (see 2864 Section 17.4.24). An Aggregate control URI MUST be used to control 2865 an aggregated session. This URI MUST be different from the stream 2866 control URIs of the individual media streams included in the 2867 aggregate (see Section 13.4.2 for aggregated sessions and for the 2868 particular URIs see Appendix D.1.1). The Aggregate control URI is to 2869 be specified by the session description if the server supports 2870 aggregated control and aggregated control is desired for the session. 2871 However, even if aggregated control is offered the client MAY chose 2872 to not set up the session in aggregated control. If an Aggregate 2873 control URI is not specified in the session description, it is 2874 normally an indication that non-aggregated control should be used. 2875 The SETUP of media streams in an aggregate which has not been given 2876 an aggregated control URI is unspecified. 2878 While the session ID sometimes carries enough information for 2879 aggregate control of a session, the Aggregate control URI is still 2880 important for some methods such as SET_PARAMETER where the control 2881 URI enables the resource in question to be easily identified. The 2882 Aggregate control URI is also useful for proxies, enabling them to 2883 route the request to the appropriate server, and for logging, 2884 where it is useful to note the actual resource that a request was 2885 operating on. 2887 A session will exist until it is either removed by a TEARDOWN request 2888 or is timed-out by the server. The server MAY remove a session that 2889 has not demonstrated liveness signs from the client(s) within a 2890 certain timeout period. The default timeout value is 60 seconds; the 2891 server MAY set this to a different value and indicate so in the 2892 timeout field of the Session header in the SETUP response. For 2893 further discussion see Section 18.47. Signs of liveness for an RTSP 2894 session are: 2896 o Any RTSP request from a client which includes a Session header 2897 with that session's ID. 2899 o If RTP is used as a transport for the underlying media streams, an 2900 RTCP sender or receiver report from the client(s) for any of the 2901 media streams in that RTSP session. RTCP Sender Reports may for 2902 example be received in sessions where the server is invited into a 2903 conference session and is valid for keep-alive. 2905 If a SETUP request on a session fails for any reason, the session 2906 state, as well as transport and other parameters for associated 2907 streams MUST remain unchanged from their values as if the SETUP 2908 request had never been received by the server. 2910 13.3.1. Changing Transport Parameters 2912 A client MAY issue a SETUP request for a stream that is already set 2913 up or playing in the session to change transport parameters, which a 2914 server MAY allow. If it does not allow changing of parameters, it 2915 MUST respond with error 455 (Method Not Valid In This State). The 2916 reasons to support changing transport parameters include allowing 2917 application layer mobility and flexibility to utilize the best 2918 available transport as it becomes available. If a client receives a 2919 455 when trying to change transport parameters while the server is in 2920 Play state, it MAY try to put the server in Ready state using PAUSE, 2921 before issuing the SETUP request again. If that also fails the 2922 changing of transport parameters will require that the client 2923 performs a TEARDOWN of the affected media and then to set it up 2924 again. For an aggregated session avoiding tearing down all the media 2925 at the same time will avoid the creation of a new session. 2927 All transport parameters MAY be changed. However, the primary usage 2928 expected is to either change the transport protocol completely, like 2929 switching from Interleaved TCP mode to UDP or vice versa, or to 2930 change the delivery address. 2932 In a SETUP response for a request to change the transport parameters 2933 while in Play state, the server MUST include the Range to indicate at 2934 what point the new transport parameters will be used. Further, if 2935 RTP is used for delivery, the server MUST also include the RTP-Info 2936 header to indicate at what timestamp and RTP sequence number the 2937 change will take place. If both RTP-Info and Range are included in 2938 the response the "rtp_time" parameter and start point in the Range 2939 header MUST be for the corresponding time, i.e., be used in the same 2940 way as for PLAY to ensure the correct synchronization information is 2941 available. 2943 If the transport parameters change while in Play state results in a 2944 change of synchronization related information, for example changing 2945 RTP SSRC, the server MUST provide in the SETUP response the necessary 2946 synchronization information. However, the server is RECOMMENDED to 2947 avoid changing the synchronization information if possible. 2949 13.4. PLAY 2951 This section describes the usage of the PLAY method in general, for 2952 aggregated sessions, and in different usage scenarios. 2954 13.4.1. General Usage 2956 The PLAY method tells the server to start sending data via the 2957 mechanism specified in SETUP and which part of the media should be 2958 played out. PLAY requests are valid when the session is in Ready or 2959 Play states. A PLAY request MUST include a Session header to 2960 indicate which session the request applies to. 2962 Upon receipt of the PLAY request, the server MUST position the normal 2963 play time to the beginning of the range specified in the received 2964 Range header and deliver stream data until the end of the range if 2965 given, until a new PLAY request is received, or until the end of the 2966 media is reached. If no Range header is present in the PLAY request 2967 the server SHALL play from current pause point until the end of 2968 media. The pause point defaults at session start to the beginning of 2969 the media. For media that is time-progressing and has no retention, 2970 the pause point will always be set equal to NPT "now", i.e., the 2971 current delivery point. The pause point may also be set to a 2972 particular point in the media by the PAUSE method, see Section 13.6. 2973 The pause point for media that is currently playing is equal to the 2974 current media position. For time-progressing media with time-limited 2975 retention, if the pause point represents a position that is older 2976 than what is retained by the server, the pause point will be moved to 2977 the oldest retained. 2979 What range values are valid depends on the type of content. For 2980 content that isn't time progressing the range value is valid if the 2981 given range is part of any media within the aggregate. In other 2982 words the valid media range for the aggregate is the union of all of 2983 the media components in the aggregate. If a given range value points 2984 outside of the media, the response MUST be the 457 (Invalid Range) 2985 error code and include the Media-Range header (Section 18.29) with 2986 the valid range for the media. Except for time progressing content 2987 where the client requests a start point prior to what is retained, 2988 the start point is adjusted to the oldest retained content. For a 2989 start point that is beyond the media front edge, i.e. beyond the 2990 current value for "now", the server SHALL adjust the start value to 2991 the current front edge. The Range header's stop point value may 2992 point beyond the current media edge. In that case, the server SHALL 2993 deliver media from the requested (and possibly adjusted) start point 2994 until the provided stop point, or the end of the media is reached 2995 prior to the specified stop point. Please note that if one simply 2996 wants to play from a particular start point until the end of media 2997 using a Range header with an implicit stop point is RECOMMENDED. 2999 If a client requests to start playing at the end of media, either 3000 explicitly with a Range header or implicitly with a pause point that 3001 is at the end of media, a 457 (Invalid Range) error MUST be sent and 3002 include the Media-Range header (Section 18.29). It is specified 3003 below that the Range header also must be included in the response and 3004 that it will carry the pause point in the media, in the case of the 3005 session being in Ready State. Note that this also applies if the 3006 pause point or requested start point is at the beginning of the media 3007 and a Scale header (Section 18.44) is included with a negative value 3008 (playing backwards). 3010 For media with random access properties a client may express its 3011 preference on which policy for start point selection the server shall 3012 use. This is done by including the Seek-Style header (Section 18.45) 3013 in the PLAY request. The Seek-Style applied will effect the content 3014 of the Range header as it will be adjusted to indicate from what 3015 point the media actually is delivered. 3017 A client desiring to play the media from the beginning MUST send a 3018 PLAY request with a Range header pointing at the beginning, e.g. 3019 "npt=0-". If a PLAY request is received without a Range header and 3020 media delivery has stopped at the end, the server SHOULD respond with 3021 a 457 "Invalid Range" error response. In that response, the current 3022 pause point MUST be included in a Range header. 3024 All range specifiers in this specification allow for ranges with an 3025 implicit start point (e.g. "npt=-30"). When used in a PLAY request, 3026 the server treats this as a request to start or resume delivery from 3027 the current pause point, ending at the end time specified in the 3028 Range header. If the pause point is located later than the given end 3029 value, a 457 (Invalid Range) response MUST be given. 3031 The example below will play seconds 10 through 25. It also requests 3032 the server to deliver media from the first Random Access Point prior 3033 to the indicated start point. 3035 C->S: PLAY rtsp://audio.example.com/audio RTSP/2.0 3036 CSeq: 835 3037 Session: 12345678 3038 Range: npt=10-25 3039 Seek-Style: RAP 3040 User-Agent: PhonyClient/1.2 3042 Servers MUST include a "Range" header in any PLAY response, even if 3043 no Range header was present in the request. The response MUST use 3044 the same format as the request's range header contained. If no Range 3045 header was in the request, the format used in any previous PLAY 3046 request within the session SHOULD be used. If no format has been 3047 indicated in a previous request the server MAY use any time format 3048 supported by the media and indicated in the Accept-Ranges header in 3049 the SETUP request. It is RECOMMENDED that NPT is used if supported 3050 by the media. 3052 For any error response to a PLAY request, the server's response 3053 depends on the current session state. If the session is in Ready 3054 state, the current pause-point is returned using Range header with 3055 the pause point as the explicit start-point and an implicit stop- 3056 point. For time-progressing content where the pause-point moves with 3057 real-time due to limited retention, the current pause point is 3058 returned. For sessions in Play state, the current playout point and 3059 the remaining parts of the range request is returned. For any media 3060 with retention longer than 0 seconds the currently valid Media-Range 3061 header SHALL also be included in the response. 3063 A PLAY response MAY include a header carrying synchronization 3064 information. As the information necessary is dependent on the media 3065 transport format, further rules specifying the header and its usage 3066 are needed. For RTP the RTP-Info header is specified, see 3067 Section 18.43, and used in the following example. 3069 Here is a simple example for a single audio stream where the client 3070 requests the media starting from 3.52 seconds and to the end. The 3071 server sends a 200 OK response with the actual play time which is 10 3072 ms prior (3.51) and the RTP-Info header that contains the necessary 3073 parameters for the RTP stack. 3075 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3076 CSeq: 836 3077 Session: 12345678 3078 Range: npt=3.52- 3079 User-Agent: PhonyClient/1.2 3081 S->C: RTSP/2.0 200 OK 3082 CSeq: 836 3083 Date: Thu, 23 Jan 1997 15:35:06 GMT 3084 Server: PhonyServer/1.0 3085 Range: npt=3.51-324.39 3086 Seek-Style: First-Prior 3087 RTP-Info:url="rtsp://example.com/audio" 3088 ssrc=0D12F123:seq=14783;rtptime=2345962545 3090 S->C: RTP Packet TS=2345962545 => NPT=3.51 3091 Media duration=0.16 seconds 3093 The server replies with the actual start point that will be 3094 delivered. This may differ from the requested range if alignment of 3095 the requested range to valid frame boundaries is required for the 3096 media source. Note that some media streams in an aggregate may need 3097 to be delivered from even earlier points. Also, some media formats 3098 have a very long duration per individual data unit, therefore it 3099 might be necessary for the client to parse the data unit, and select 3100 where to start. The server SHALL also indicate which policy it uses 3101 for selecting the actual start point by including a Seek-Style 3102 header. 3104 In the following example the client receives the first media packet 3105 that stretches all the way up and past the requested playtime. Thus, 3106 it is the client's decision whether to render to the user the time 3107 between 3.52 and 7.05, or to skip it. In most cases it is probably 3108 most suitable not to render that time period. 3110 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3111 CSeq: 836 3112 Session: 12345678 3113 Range: npt=7.05- 3114 User-Agent: PhonyClient/1.2 3116 S->C: RTSP/2.0 200 OK 3117 CSeq: 836 3118 Date: Thu, 23 Jan 1997 15:35:06 GMT 3119 Server: PhonyServer/1.0 3120 Range: npt=3.52- 3121 Seek-Style: First-Prior 3122 RTP-Info:url="rtsp://example.com/audio" 3123 ssrc=0D12F123:seq=14783;rtptime=2345962545 3125 S->C: RTP Packet TS=2345962545 => NPT=3.52 3126 Duration=4.15 seconds 3128 After playing the desired range, the presentation does NOT change to 3129 the Ready state, media delivery simply stops. A PAUSE request MUST 3130 be issued to make the stream enter the Ready state. A PLAY request 3131 while the stream is still in the Play state is legal, and can be 3132 issued without an intervening PAUSE request. Such a request MUST 3133 replace the current PLAY action with the new one requested, i.e. 3134 being handled the same as the request was received in Ready state. 3135 In the case the range in Range header has an implicit start time 3136 (-endtime), the server MUST continue to play from where it currently 3137 was until the specified end point. This is useful to change the end 3138 to at another point than in the previous request. 3140 The following example plays the whole presentation starting at SMPTE 3141 time code 0:10:20 until the end of the clip. Note: The RTP-Info 3142 headers has been broken into several lines, where following lines 3143 start with whitespace as allowed by the syntax. 3145 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/2.0 3146 CSeq: 833 3147 Session: 12345678 3148 Range: smpte=0:10:20- 3149 User-Agent: PhonyClient/1.2 3151 S->C: RTSP/2.0 200 OK 3152 CSeq: 833 3153 Date: Thu, 23 Jan 1997 15:35:06 GMT 3154 Session: 12345678 3155 Server: PhonyServer/1.0 3156 Range: smpte=0:10:22-0:15:45 3157 Seek-Style: Next 3158 RTP-Info:url="rtsp://example.com/twister.en" 3159 ssrc=0D12F123:seq=14783;rtptime=2345962545 3161 For playing back a recording of a live presentation, it may be 3162 desirable to use clock units: 3164 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/2.0 3165 CSeq: 835 3166 Session: 12345678 3167 Range: clock=19961108T142300Z-19961108T143520Z 3168 User-Agent: PhonyClient/1.2 3170 S->C: RTSP/2.0 200 OK 3171 CSeq: 835 3172 Date: Thu, 23 Jan 1997 15:35:06 GMT 3173 Session: 12345678 3174 Server: PhonyServer/1.0 3175 Range: clock=19961108T142300Z-19961108T143520Z 3176 Seek-Style: Next 3177 RTP-Info:url="rtsp://example.com/meeting.en" 3178 ssrc=0D12F123:seq=53745;rtptime=484589019 3180 13.4.2. Aggregated Sessions 3182 PLAY requests can operate on sessions controlling a single media and 3183 on aggregated sessions controlling multiple media. 3185 In an aggregated session the PLAY request MUST contain an aggregated 3186 control URI. A server MUST respond with error 460 (Only Aggregate 3187 Operation Allowed) if the client PLAY Request-URI is for a single 3188 media. The media in an aggregate MUST be played in sync. If a 3189 client wants individual control of the media, it needs to use 3190 separate RTSP sessions for each media. 3192 For aggregated sessions where the initial SETUP request (creating a 3193 session) is followed by one or more additional SETUP requests, a PLAY 3194 request MAY be pipelined after those additional SETUP requests 3195 without awaiting their responses. This procedure can reduce the 3196 delay from start of session establishment until media play-out has 3197 started with one round trip time. However, a client needs to be 3198 aware that using this procedure will result in the playout of the 3199 server state established at the time of processing the PLAY, i.e., 3200 after the processing of all the requests prior to the PLAY request in 3201 the pipeline. This state may not be the intended one due to failure 3202 of any of the prior requests. A client can easily determine this 3203 based on the responses from those requests. In case of failure, the 3204 client can halt the media playout using PAUSE and try to establish 3205 the intended state again before issuing another PLAY request. 3207 13.4.3. Updating current PLAY Requests 3209 Clients can issue PLAY requests while the stream is in Play state and 3210 thus updating their request. 3212 The important difference compared to a PLAY request in Ready state is 3213 the handling of the current play point and how the Range header in 3214 the request is constructed. The session is actively playing media 3215 and the play point will be moving, making the exact time a request 3216 will take action hard to predict. Depending on how the PLAY header 3217 appears two different cases exist: total replacement or continuation. 3218 A total replacement is signaled by having the first range 3219 specification have an explicit start value, e.g. "npt=45-" or 3220 "npt=45-60", in which case the server stops playout at the current 3221 playout point and then starts delivering media according to the Range 3222 header. This is equivalent to having the client first send a PAUSE 3223 and then a new PLAY request that isn't based on the pause point. In 3224 the case of continuation the first range specifier has an implicit 3225 start point and an explicit stop value (Z), e.g. "npt=-60", which 3226 indicate that it MUST convert the range specifier being played prior 3227 to this PLAY request (X to Y) into (X to Z) and continue as this was 3228 the request originally played. If the current delivery point is 3229 beyond the stop point, the server SHALL immediately pause delivery. 3230 As the request has been completed successfully it shall be responded 3231 with 200 OK. A PLAY_NOTIFY with end-of-stream is also sent to 3232 indicate the actual stop point. The pause point is set to the 3233 requested stop point. 3235 Following is an example of this behavior: The server has received 3236 requests to play ranges 10 to 15. If the new PLAY request arrives at 3237 the server 4 seconds after the previous one, it will take effect 3238 while the server still plays the first range (10-15). The server 3239 changes the current play to continue to 25 seconds, i.e. the 3240 equivalent single request would be PLAY with "range: npt=10-25". 3242 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3243 CSeq: 834 3244 Session: 12345678 3245 Range: npt=10-15 3246 User-Agent: PhonyClient/1.2 3248 S->C: RTSP/2.0 200 OK 3249 CSeq: 834 3250 Date: Thu, 23 Jan 1997 15:35:06 GMT 3251 Session: 12345678 3252 Server: PhonyServer/1.0 3253 Range: npt=10-15 3254 Seek-Style: Next 3255 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3256 ssrc=0D12F123:seq=5712;rtptime=934207921, 3257 url="rtsp://example.com/fizzle/videotrack" 3258 ssrc=789DAF12:seq=57654;rtptime=2792482193 3259 Session: 12345678 3261 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3262 CSeq: 835 3263 Session: 12345678 3264 Range: npt=-25 3265 User-Agent: PhonyClient/1.2 3267 S->C: RTSP/2.0 200 OK 3268 CSeq: 835 3269 Date: Thu, 23 Jan 1997 15:35:09 GMT 3270 Session: 12345678 3271 Server: PhonyServer/1.0 3272 Range: npt=14-25 3273 Seek-Style: Next 3274 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3275 ssrc=0D12F123:seq=5712;rtptime=934239921, 3276 url="rtsp://example.com/fizzle/videotrack" 3277 ssrc=789DAF12:seq=57654;rtptime=2792842193 3279 A common use of a PLAY request while in Play state is changing the 3280 scale of the media, i.e., entering or leaving from fast forward or 3281 fast rewind. The client can issue an updating PLAY request that is 3282 either a continuation or a complete replacement, as discussed above 3283 this section. We give an example of a client that is requesting a 3284 fast forward (scale=2) without giving a stop point and then change 3285 from fast forward to regular playout (scale = 1). In the second PLAY 3286 request the time is set explicitly to be where ever the server 3287 currently plays out (npt=now-) and the server responds with the 3288 actual playback point where the new scale actually takes effect 3289 (npt=2:17:27.144-). 3291 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3292 CSeq: 2034 3293 Session: 12345678 3294 Range: npt=now- 3295 Scale: 2.0 3296 User-Agent: PhonyClient/1.2 3298 S->C: RTSP/2.0 200 OK 3299 CSeq: 2034 3300 Date: Thu, 23 Jan 1997 15:35:06 GMT 3301 Session: 12345678 3302 Server: PhonyServer/1.0 3303 Range: npt=2:17:21.394- 3304 Seek-Style: Next 3305 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3306 ssrc=0D12F123:seq=5712;rtptime=934207921, 3307 url="rtsp://example.com/fizzle/videotrack" 3308 ssrc=789DAF12:seq=57654;rtptime=2792482193 3310 [playing in fast forward and now returning to scale = 1] 3312 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3313 CSeq: 2035 3314 Session: 12345678 3315 Range: npt=now- 3316 Scale: 1.0 3317 User-Agent: PhonyClient/1.2 3319 S->C: RTSP/2.0 200 OK 3320 CSeq: 2035 3321 Date: Thu, 23 Jan 1997 15:35:09 GMT 3322 Session: 12345678 3323 Server: PhonyServer/1.0 3324 Range: npt=2:17:27.144- 3325 Seek-Style: Next 3326 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3327 ssrc=0D12F123:seq=5712;rtptime=934239921, 3328 url="rtsp://example.com/fizzle/videotrack" 3329 ssrc=789DAF12:seq=57654;rtptime=2792842193 3331 13.4.4. Playing On-Demand Media 3333 On-demand media is indicated by the content of the Media-Properties 3334 header in the SETUP response by (see also Section 18.28): 3336 o Random-Access property is set to Random Access; 3337 o Content Modifications set to Immutable; 3339 o Retention set to Unlimited or Time-Limited. 3341 Playing on-demand media follows the general usage as described in 3342 Section 13.4.1. 3344 13.4.5. Playing Dynamic On-Demand Media 3346 Dynamic on-demand media is indicated by the content of the Media- 3347 Properties header in the SETUP response by (see also Section 18.28): 3349 o RandomAccess set to Random-Access; 3351 o Content Modifications set to Dynamic; 3353 o Retention set to Unlimited or Time-Limited. 3355 Playing on-demand media follows the general usage as described in 3356 Section 13.4.1 as long as the media has not been changed. 3358 There are two ways for the client to be informed about changes of 3359 media resources in Play state. The client will receive a PLAY_NOTIFY 3360 request with Notify-Reason header set to media-properties-update (see 3361 Section 13.5.2. The client can use the value of the Media-Range to 3362 decide further actions, if the Media-Range header is present in the 3363 PLAY_NOTIFY request. The second way is that the client issues a 3364 GET_PARAMETER request without a body but including a Media-Range 3365 header. The 200 OK response MUST include the current Media-Range 3366 header (see Section 18.29). 3368 13.4.6. Playing Live Media 3370 Live media is indicated by the content of the Media-Properties header 3371 in the SETUP response by (see also Section 18.28): 3373 o Random-Access set to No-Seeking; 3375 o Content Modifications set to Time-Progressing; 3377 o Retention with Time-Duration set to 0.0. 3379 For live media, the SETUP response 200 OK MUST include the Media- 3380 Range header (see Section 18.29). 3382 A client MAY send PLAY requests without the Range header. If the 3383 request includes the Range header it MUST use a symbolic value 3384 representing "now". For NPT that range specification is "npt=now-". 3386 The server MUST include the Range header in the response and it MUST 3387 indicate an explicit time value and not a symbolic value. In other 3388 words, "npt=now-" is not valid to be used in the response. Instead 3389 the time since session start is recommended expressed as an open 3390 interval, e.g. "npt=96.23-". An absolute time value (clock) for the 3391 corresponding time MAY be given, i.e. "clock=20030213T143205Z-". The 3392 UTC clock format can only be used if client has shown support for it 3393 using the Accept-Ranges header. 3395 13.4.7. Playing Live with Recording 3397 Certain media servers may offer recording services of live sessions 3398 to their clients. This recording would normally be from the 3399 beginning of the media session. Clients can randomly access the 3400 media between now and the beginning of the media session. This live 3401 media with recording is indicated by the content of the Media- 3402 Properties header in the SETUP response by (see also Section 18.28): 3404 o Random-Access set to Random-Access; 3406 o Content Modifications set to Time-Progressing; 3408 o Retention set to Time-limited or Unlimited 3410 The SETUP response 200 OK MUST include the Media-Range header (see 3411 Section 18.29) for this type of media. For live media with 3412 recording, the Range header indicates the current delivery point in 3413 the media and the Media-Range header indicates the currently 3414 available media window around the current time. This window can 3415 cover recorded content in the past (seen from current time in the 3416 media) or recorded content in the future (seen from current time in 3417 the media). The server adjusts the delivery point to the requested 3418 border of the window, if the client requests a delivery point that is 3419 located outside the recording windows, e.g., if requested to far in 3420 the past, the server selects the oldest range in the recording. The 3421 considerations in Section 13.5.3 apply, if a client requests delivery 3422 with Scale (Section 18.44) values other than 1.0 (Normal playback 3423 rate) while delivering live media with recording. 3425 13.4.8. Playing Live with Time-Shift 3427 Certain media servers may offer time-shift services to their clients. 3428 This time shift records a fixed interval in the past, i.e., a sliding 3429 window recording mechanism, but not past this interval. Clients can 3430 randomly access the media between now and the interval. This live 3431 media with recording is indicated by the content of the Media- 3432 Properties header in the SETUP response by (see also Section 18.28): 3434 o Random-Access set to Random-Access; 3436 o Content Modifications set to Time-Progressing; 3438 o Retention set to Time-Duration and a value indicating the 3439 recording interval (>0). 3441 The SETUP response 200 OK MUST include the Media-Range header (see 3442 Section 18.29) for this type of media. For live media with recording 3443 the Range header indicates the current time in the media and the 3444 Media Range indicates a window around the current time. This window 3445 can cover recorded content in the past (seen from current time in the 3446 media) or recorded content in the future (seen from current time in 3447 the media). The server adjusts the play point to the requested 3448 border of the window, if the client requests a play point that is 3449 located outside the recording windows, e.g., if requested too far in 3450 the past, the server selects the oldest range in the recording. The 3451 considerations in Section 13.5.3 apply, if a client requests delivery 3452 using a Scale (Section 18.44) value other than 1.0 (Normal playback 3453 rate) while delivering live media with time-shift. 3455 13.5. PLAY_NOTIFY 3457 The PLAY_NOTIFY method is issued by a server to inform a client about 3458 an asynchronous event for a session in Play state. The Session 3459 header MUST be presented in a PLAY_NOTIFY request and indicates the 3460 scope of the request. Sending of PLAY_NOTIFY requests requires a 3461 persistent connection between server and client, otherwise there is 3462 no way for the server to send this request method to the client. 3464 PLAY_NOTIFY requests have an end-to-end (i.e. server to client) 3465 scope, as they carry the Session header, and apply only to the given 3466 session. The client SHOULD immediately return a response to the 3467 server. 3469 PLAY_NOTIFY requests MAY be used with a message body, depending on 3470 the value of the Notify-Reason header. It is described in the 3471 particular section for each Notify-Reason if a message body is used. 3472 However, currently there is no Notify-Reason that allows using a 3473 message body. In this case, there is a need to obey some limitations 3474 when adding new Notify-Reasons that intend to use a message body: the 3475 server can send any type of message body, but it is not ensured that 3476 the client can understand the received message body. This is related 3477 to DESCRIBE (see Section 13.2 ), but in this particular case the 3478 client can state its acceptable message bodies by using the Accept 3479 header. In the case of PLAY_NOTIFY, the server does not know which 3480 message bodies are understood by the client. 3482 The Notify-Reason header (see Section 18.31) specifies the reason why 3483 the server sends the PLAY_NOTIFY request. This is extensible and new 3484 reasons MAY be added in the future (see Section 22.8). In case the 3485 client does not understand the reason for the notification it MUST 3486 respond with a 465 (Notification Reason Unknown) (Section 17.4.30) 3487 error code. Servers can send PLAY_NOTIFY with these types: 3489 o end-of-stream (see Section 13.5.1); 3491 o media-properties-update (see Section 13.5.2); 3493 o scale-change (see Section 13.5.3). 3495 13.5.1. End-of-Stream 3497 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3498 indicates the completion or near completion of the PLAY request and 3499 the ending delivery of the media stream(s). The request MUST NOT be 3500 issued unless the server is in the Play state. The end of the media 3501 stream delivery notification may be used to indicate either a 3502 successful completion of the PLAY request currently being served, or 3503 to indicate some error resulting in failure to complete the request. 3504 The Request-Status header (Section 18.40) MUST be included to 3505 indicate which request the notification is for and its completion 3506 status. The message response status codes (Section 8.1.1) are used 3507 to indicate how the PLAY request concluded. The sender of a 3508 PLAY_NOTIFY can issue an updated PLAY_NOTIFY, in the case of a 3509 PLAY_NOTIFY sent with wrong information. For instance, a PLAY_NOTIFY 3510 was issued before reaching the end-of-stream, but some error occurred 3511 resulting in that the previously sent PLAY_NOTIFY contained a wrong 3512 time when the stream will end. In this case a new PLAY_NOTIFY MUST 3513 be sent including the correct status for the completion and all 3514 additional information. 3516 PLAY_NOTIFY requests with Notify-Reason header set to end-of-stream 3517 MUST include a Range header and the Scale header if the scale value 3518 is not 1. The Range header indicates the point in the stream or 3519 streams where delivery is ending with the timescale that was used by 3520 the server in the PLAY response for the request being fulfilled. The 3521 server MUST NOT use the "now" constant in the Range header; it MUST 3522 use the actual numeric end position in the proper timescale. When 3523 end-of-stream notifications are issued prior to having sent the last 3524 media packets, this is evident as the end time in the Range header is 3525 beyond the current time in the media being received by the client, 3526 e.g., "npt=-15", if npt is currently at 14.2 seconds. The Scale 3527 header is to be included so that it is evident if the media time 3528 scale is moving backwards and/or have a non-default pace. The end- 3529 of-stream notification does not prevent the client from sending a new 3530 PLAY request. 3532 If RTP is used as media transport, a RTP-Info header MUST be 3533 included, and the RTP-Info header MUST indicate the last sequence 3534 number in the seq parameter. 3536 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3537 MUST NOT carry a message body. 3539 This example request notifies the client about a future end-of-stream 3540 event: 3541 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3542 CSeq: 854 3543 Notify-Reason: end-of-stream 3544 Request-Status: cseq=853 status=200 reason="OK" 3545 Range: npt=-145 3546 RTP-Info:url="rtsp://example.com/audio" 3547 ssrc=0D12F123:seq=14783;rtptime=2345962545 3548 Session: uZ3ci0K+Ld-M 3549 Date: Mon, 08 Mar 2010 13:37:16 GMT 3551 C->S: RTSP/2.0 200 OK 3552 CSeq: 854 3553 User-Agent: PhonyClient/1.2 3554 Session: uZ3ci0K+Ld-M 3556 13.5.2. Media-Properties-Update 3558 A PLAY_NOTIFY request with Notify-Reason header set to media- 3559 properties-update indicates an update of the media properties for the 3560 given session (see Section 18.28) and/or the available media range 3561 that can be played as indicated by Media-Range (Section 18.29). 3562 PLAY_NOTIFY requests with Notify-Reason header set to media- 3563 properties-update MUST include a Media-Properties and Date header and 3564 SHOULD include a Media-Range header. 3566 This notification MUST be sent for media that are time-progressing 3567 every time an event happens that changes the basis for making 3568 estimates on how the media range progress. In addition it is 3569 RECOMMENDED that the server sends these notifications every 5 minutes 3570 for time-progressing content to ensure the long-term stability of the 3571 client estimation and allowing for clock skew detection by the 3572 client. Requests for the just mentioned reasons MUST include Media- 3573 Range header to provide current Media duration and the Range header 3574 to indicate the current playing point and any remaining parts of the 3575 requested range. 3577 The recommendation for sending updates every 5 minutes is due to 3578 any clock skew issues. In 5 minutes the clock skew should not 3579 become too significant as this is not used for media playback and 3580 synchronization, only for determining which content is available 3581 to the user. 3583 A PLAY_NOTIFY request with Notify-Reason header set to media- 3584 properties-update MUST NOT carry a message body. 3585 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3586 Date: Tue, 14 Apr 2008 15:48:06 GMT 3587 CSeq: 854 3588 Notify-Reason: media-properties-update 3589 Session: uZ3ci0K+Ld-M 3590 Media-Properties: Time-Progressing, 3591 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3592 Media-Range: npt=0-1:37:21.394 3593 Range: npt=1:15:49.873- 3595 C->S: RTSP/2.0 200 OK 3596 CSeq: 854 3597 User-Agent: PhonyClient/1.2 3598 Session: uZ3ci0K+Ld-M 3600 13.5.3. Scale-Change 3602 The server may be forced to change the rate, when a client requests 3603 delivery using a Scale (Section 18.44) value other than 1.0 (normal 3604 playback rate). For time progressing media with some retention, i.e. 3605 the server stores already sent content, a client requesting to play 3606 with Scale values larger than 1 may catch up with the front end of 3607 the media. The server will then be unable to continue to provide 3608 content at Scale larger than 1 as content is only made available by 3609 the server at Scale=1. Another case is when Scale < 1 and the media 3610 retention is time-duration limited. In this case the delivery point 3611 can reach the oldest media unit available, and further playback at 3612 this scale becomes impossible as there will be no media available. 3613 To avoid having the client lose any media, the scale will need to be 3614 adjusted to the same rate at which the media is removed from the 3615 storage buffer, commonly Scale = 1.0. 3617 Another case is when the content itself consists of spliced pieces or 3618 is dynamically updated. In these cases the server may be required to 3619 change from one supported scale value (different than Scale=1.0) to 3620 another. In this case the server will pick the closest value and 3621 inform the client of what it has picked. In these cases the media 3622 properties will also be sent updating the supported Scale values. 3623 This enables a client to adjust the used Scale value. 3625 To minimize impact on playback in any of the above cases the server 3626 MUST modify the playback properties and set Scale to a supportable 3627 value and continue delivery of the media. When doing this 3628 modification it MUST send a PLAY_NOTIFY message with the Notify- 3629 Reason header set to "scale-change". The request MUST contain a 3630 Range header with the media time where the change took effect, a 3631 Scale header with the new value in use, Session header with the ID 3632 for the session it applies to and a Date header with the server 3633 wallclock time of the change. For time progressing content also the 3634 Media-Range and the Media-Properties at this point in time MUST be 3635 included. The Media-Properties header MUST be included if the scale 3636 change was due to the content changing what scale values that is 3637 supported. 3639 For media streams being delivered using RTP also a RTP-Info header 3640 MUST be included. It MUST contain the rtptime parameter with a value 3641 corresponding to the point of change in that media and optionally 3642 also the sequence number. 3644 A PLAY_NOTIFY request with Notify-Reason header set to "Scale-Change" 3645 MUST NOT carry a message body. 3647 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3648 Date: Tue, 14 Apr 2008 15:48:06 GMT 3649 CSeq: 854 3650 Notify-Reason: scale-change 3651 Session: uZ3ci0K+Ld-M 3652 Media-Properties: Time-Progressing, 3653 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3654 Media-Range: npt=0-1:37:21.394 3655 Range: npt=1:37:21.394- 3656 Scale: 1 3657 RTP-Info: url="rtsp://example.com/fizzle/foo/audio" 3658 ssrc=0D12F123:rtptime=2345962545 3660 C->S: RTSP/2.0 200 OK 3661 CSeq: 854 3662 User-Agent: PhonyClient/1.2 3663 Session: uZ3ci0K+Ld-M 3665 13.6. PAUSE 3667 The PAUSE request causes the stream delivery to immediately be 3668 interrupted (halted). A PAUSE request MUST be done either with the 3669 aggregated control URI for aggregated sessions, resulting in all 3670 media being halted, or the media URI for non-aggregated sessions. 3671 Any attempt to do muting of a single media with a PAUSE request in an 3672 aggregated session MUST be responded to with error 460 (Only 3673 Aggregate Operation Allowed). After resuming playback, 3674 synchronization of the tracks MUST be maintained. Any server 3675 resources are kept, though servers MAY close the session and free 3676 resources after being paused for the duration specified with the 3677 timeout parameter of the Session header in the SETUP message. 3679 Example: 3681 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3682 CSeq: 834 3683 Session: 12345678 3684 User-Agent: PhonyClient/1.2 3686 S->C: RTSP/2.0 200 OK 3687 CSeq: 834 3688 Date: Thu, 23 Jan 1997 15:35:06 GMT 3689 Range: npt=45.76-75.00 3691 The PAUSE request causes stream delivery to be interrupted 3692 immediately on receipt of the message and the pause point is set to 3693 the current point in the presentation. That pause point in the media 3694 stream needs to be maintained. A subsequent PLAY request without 3695 Range header resume from the pause point and plays until media end. 3697 The pause point after any PAUSE request MUST be returned to the 3698 client by adding a Range header with what remains unplayed of the 3699 PLAY request's range. For media with random access properties, if 3700 one desires to resume playing a ranged request, one simply includes 3701 the Range header from the PAUSE response and includes the Seek-Style 3702 header with the Next policy in the PLAY request. For media that is 3703 time-progressing and has retention duration=0 the follow-up PLAY 3704 request to start media delivery again, will need to use "npt=now-" 3705 and not the answer given in the response to PAUSE. 3707 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3708 CSeq: 834 3709 Session: 12345678 3710 Range: npt=10-30 3711 User-Agent: PhonyClient/1.2 3713 S->C: RTSP/2.0 200 OK 3714 CSeq: 834 3715 Date: Thu, 23 Jan 1997 15:35:06 GMT 3716 Server: PhonyServer/1.0 3717 Range: npt=10-30 3718 Seek-Style: First-Prior 3719 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3720 ssrc=0D12F123:seq=5712;rtptime=934207921, 3721 url="rtsp://example.com/fizzle/videotrack" 3722 ssrc=4FAD8726:seq=57654;rtptime=2792482193 3723 Session: 12345678 3725 After 11 seconds, i.e. at 21 seconds into the presentation: 3726 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3727 CSeq: 835 3728 Session: 12345678 3729 User-Agent: PhonyClient/1.2 3731 S->C: RTSP/2.0 200 OK 3732 CSeq: 835 3733 Date: 23 Jan 1997 15:35:17 GMT 3734 Server: PhonyServer/1.0 3735 Range: npt=21-30 3736 Session: 12345678 3738 If a client issues a PAUSE request and the server acknowledges and 3739 enters the Ready state, the proper server response, if the player 3740 issues another PAUSE, is still 200 OK. The 200 OK response MUST 3741 include the Range header with the current pause point. See examples 3742 below: 3744 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3745 CSeq: 834 3746 Session: 12345678 3747 User-Agent: PhonyClient/1.2 3749 S->C: RTSP/2.0 200 OK 3750 CSeq: 834 3751 Session: 12345678 3752 Date: Thu, 23 Jan 1997 15:35:06 GMT 3753 Range: npt=45.76-98.36 3755 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3756 CSeq: 835 3757 Session: 12345678 3758 User-Agent: PhonyClient/1.2 3760 S->C: RTSP/2.0 200 OK 3761 CSeq: 835 3762 Session: 12345678 3763 Date: 23 Jan 1997 15:35:07 GMT 3764 Range: npt=45.76-98.36 3766 13.7. TEARDOWN 3768 13.7.1. Client to Server 3770 The TEARDOWN client to server request stops the stream delivery for 3771 the given URI, freeing the resources associated with it. A TEARDOWN 3772 request MAY be performed on either an aggregated or a media control 3773 URI. However, some restrictions apply depending on the current 3774 state. The TEARDOWN request MUST contain a Session header indicating 3775 what session the request applies to. 3777 A TEARDOWN using the aggregated control URI or the media URI in a 3778 session under non-aggregated control (single media session) MAY be 3779 done in any state (Ready and Play). A successful request MUST result 3780 in that media delivery being immediately halted and the session state 3781 being destroyed. This MUST be indicated through the lack of a 3782 Session header in the response. 3784 A TEARDOWN using a media URI in an aggregated session MAY only be 3785 done in Ready state. Such a request only removes the indicated media 3786 stream and associated resources from the session. This may result in 3787 that a session returns to non-aggregated control, due to that it only 3788 contains a single media after the requests completion. A session 3789 that will exist after the processing of the TEARDOWN request MUST in 3790 the response to that TEARDOWN request contain a Session header. Thus 3791 the presence of the Session header indicates to the receiver of the 3792 response if the session is still existing or has been removed. 3794 Example: 3796 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/2.0 3797 CSeq: 892 3798 Session: 12345678 3799 User-Agent: PhonyClient/1.2 3801 S->C: RTSP/2.0 200 OK 3802 CSeq: 892 3803 Server: PhonyServer/1.0 3805 13.7.2. Server to Client 3807 The server can send TEARDOWN requests in the server to client 3808 direction to indicate that the server has been forced to terminate 3809 the ongoing session. This may happen for several reasons, such as 3810 server maintenance without available backup, or that the session has 3811 been inactive for extended periods of time. The reason is provided 3812 in the Terminate-Reason header (Section 18.50). 3814 When a RTSP client has maintained a RTSP session that otherwise is 3815 inactive for an extended period of time the server may reclaim the 3816 resources. That is done by issuing a TEARDOWN request with the 3817 Terminate-Reason set to "Session-Timeout". This MAY be done when the 3818 client has been inactive in the RTSP session for more than one 3819 Session Timeout period (Section 18.47). However, the server is 3820 RECOMMENDED to not perform this operation until an extended period of 3821 inactivity has passed. The time period is considered extended when 3822 it is 10 times the Session Timeout period. Consideration of the 3823 application of the server and its content should be performed when 3824 configuring what is considered as extended period of time. 3826 In case the server needs to stop providing service to the established 3827 sessions and there is no server to point at in a REDIRECT request, 3828 then TEARDOWN SHALL be used to terminate the session. This method 3829 can also be used when non-recoverable internal errors have happened 3830 and the server has no other option then to terminate the sessions. 3832 The TEARDOWN request MUST be done only on the session aggregate 3833 control URI (i.e., it is not allowed to terminate individual media 3834 streams, if it is a session aggregate) and MUST include the following 3835 headers; Session and Terminate-Reason headers. The request only 3836 applies to the session identified in the Session header. The server 3837 may include a message to the client's user with the "user-msg" 3838 parameter. 3840 The TEARDOWN request may alternatively be done on the wild card URI * 3841 and without any session header. The scope of such a request is 3842 limited to the next-hop (i.e. the RTSP agent in direct communication 3843 with the server) and applies, as well, to the control connection 3844 between the next-hop RTSP agent and the server. This request 3845 indicates that all sessions and pending requests being managed via 3846 the control connection are terminated. Any intervening proxies 3847 SHOULD do all of the following in the order listed: 3849 1. respond to the TEARDOWN request 3851 2. disconnect the control channel from the requesting server 3853 3. pass the TEARDOWN request to each applicable client (typically 3854 those clients with an active session or an unanswered request) 3856 Note: The proxy is responsible for accepting TEARDOWN responses 3857 from its clients; these responses MUST NOT be passed on to either 3858 the original server or the target server in the redirect. 3860 13.8. GET_PARAMETER 3862 The GET_PARAMETER request retrieves the value of any specified 3863 parameter or parameters for a presentation or stream specified in the 3864 URI. If the Session header is present in a request, the value of a 3865 parameter MUST be retrieved in the specified session context. There 3866 are two ways of specifying the parameters to be retrieved. The first 3867 is by including headers which have been defined such that you can use 3868 them for this purpose. Headers for this purpose should allow empty, 3869 or stripped value parts to avoid having to specify bogus data when 3870 indicating the desire to retrieve a value. The successful completion 3871 of the request should also be evident from any filled out values in 3872 the response. The Media-Range header (Section 18.29) is one such 3873 header. The other way is to specify a message body that lists the 3874 parameter(s) that are desired to be retrieved. The Content-Type 3875 header (Section 18.18) is used to specify which format the message 3876 body has. 3878 The headers that MAY be used for retrieving their current value using 3879 GET_PARAMETER are: 3881 o Accept-Ranges 3883 o Media-Range 3885 o Media-Properties 3886 o Range 3888 o RTP-Info 3890 The method MAY also be used without a message body or any header that 3891 request parameters for keep-alive purpose. The keep-alive timer has 3892 been updated for any request that is successful, i.e., a 200 OK 3893 response is received. Any non-required header present in such a 3894 request may or may not have been processed. Normally the presence of 3895 filled out values in the header will be indication that the header 3896 has been processed. However, for cases when this is difficult to 3897 determine, it is recommended to use a feature-tag and the Require 3898 header. Due to this reason it is usually easier if any parameters to 3899 be retrieved are sent in the body, rather than using any header. 3901 Parameters specified within the body of the message must all be 3902 understood by the request receiving agent. If one or more parameters 3903 are not understood a 451 (Parameter Not Understood) MUST be sent 3904 including a body listing these parameters that weren't understood. 3905 If all parameters are understood their values are filled in and 3906 returned in the response message body. 3908 Example: 3910 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3911 CSeq: 431 3912 User-Agent: PhonyClient/1.2 3913 Session: 12345678 3914 Content-Length: 26 3915 Content-Type: text/parameters 3917 packets_received 3918 jitter 3920 C->S: RTSP/2.0 200 OK 3921 CSeq: 431 3922 Session: 12345678 3923 Server: PhonyServer/1.1 3924 Date: Mon, 08 Mar 2010 13:43:23 GMT 3925 Content-Length: 38 3926 Content-Type: text/parameters 3928 packets_received: 10 3929 jitter: 0.3838 3931 13.9. SET_PARAMETER 3933 This method requests to set the value of a parameter or a set of 3934 parameters for a presentation or stream specified by the URI. The 3935 method MAY also be used without a message body. It is the 3936 RECOMMENDED method to be used in a request sent for the sole purpose 3937 of updating the keep-alive timer. If this request is successful, 3938 i.e. a 200 OK response is received, then the keep-alive timer has 3939 been updated. Any non-required header present in such a request may 3940 or may not have been processed. To allow a client to determine if 3941 any such header has been processed, it is necessary to use a feature 3942 tag and the Require header. Due to this reason it is RECOMMENDED 3943 that any parameters are sent in the body, rather than using any 3944 header. 3946 A request is RECOMMENDED to only contain a single parameter to allow 3947 the client to determine why a particular request failed. If the 3948 request contains several parameters, the server MUST only act on the 3949 request if all of the parameters can be set successfully. A server 3950 MUST allow a parameter to be set repeatedly to the same value, but it 3951 MAY disallow changing parameter values. If the receiver of the 3952 request does not understand or cannot locate a parameter, error 451 3953 (Parameter Not Understood) MUST be used. In the case a parameter is 3954 not allowed to change, the error code is 458 (Parameter Is Read- 3955 Only). The response body MUST contain only the parameters that have 3956 errors. Otherwise no body MUST be returned. 3958 Note: transport parameters for the media stream MUST only be set with 3959 the SETUP command. 3961 Restricting setting transport parameters to SETUP is for the 3962 benefit of firewalls. 3964 The parameters are split in a fine-grained fashion so that there 3965 can be more meaningful error indications. However, it may make 3966 sense to allow the setting of several parameters if an atomic 3967 setting is desirable. Imagine device control where the client 3968 does not want the camera to pan unless it can also tilt to the 3969 right angle at the same time. 3971 Example: 3973 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3974 CSeq: 421 3975 User-Agent: PhonyClient/1.2 3976 Session: iixT43KLc 3977 Date: Mon, 08 Mar 2010 14:45:04 GMT 3978 Content-length: 20 3979 Content-type: text/parameters 3981 barparam: barstuff 3983 S->C: RTSP/2.0 451 Parameter Not Understood 3984 CSeq: 421 3985 Session: iixT43KLc 3986 Server: PhonyServer/1.0 3987 Date: Mon, 08 Mar 2010 14:44:56 GMT 3988 Content-length: 20 3989 Content-type: text/parameters 3991 barparam: barstuff 3993 13.10. REDIRECT 3995 The REDIRECT method is issued by a server to inform a client that the 3996 service provided will be terminated and where a corresponding service 3997 can be provided instead. This may happen for different reasons. One 3998 is that the server is being administered such that it must stop 3999 providing service. Thus the client is required to connect to another 4000 server location to access the resource indicated by the Request-URI. 4002 The REDIRECT request SHALL contain a Terminate-Reason header 4003 (Section 18.50) to inform the client of the reason for the request. 4004 Additional parameters related to the reason may also be included. 4005 The intention here is to allow a server administrator to do a 4006 controlled shutdown of the RTSP server. That requires sufficient 4007 time to inform all entities having associated state with the server 4008 and for them to perform a controlled migration from this server to a 4009 fall back server. 4011 A REDIRECT request with a Session header has end-to-end (i.e. server 4012 to client) scope and applies only to the given session. Any 4013 intervening proxies SHOULD NOT disconnect the control channel while 4014 there are other remaining end-to-end sessions. The REQUIRED Location 4015 header MUST contain a complete absolute URI pointing to the resource 4016 to which the client SHOULD reconnect. Specifically, the Location 4017 MUST NOT contain just the host and port. A client may receive a 4018 REDIRECT request with a Session header, if and only if, an end-to-end 4019 session has been established. 4021 A client may receive a REDIRECT request without a Session header at 4022 any time when it has communication or a connection established with a 4023 server. The scope of such a request is limited to the next-hop (i.e. 4024 the RTSP agent in direct communication with the server) and applies 4025 to all sessions controlled, as well as the control connection between 4026 the next-hop RTSP agent and the server. A REDIRECT request without a 4027 Session header indicates that all sessions and pending requests being 4028 managed via the control connection MUST be redirected. The Location 4029 header, if included in such a request, SHOULD contain an absolute URI 4030 with only the host address and the OPTIONAL port number of the server 4031 to which the RTSP agent SHOULD reconnect. Any intervening proxies 4032 SHOULD do all of the following in the order listed: 4034 1. respond to the REDIRECT request 4036 2. disconnect the control channel from the requesting server 4038 3. connect to the server at the given host address 4040 4. pass the REDIRECT request to each applicable client (typically 4041 those clients with an active session or an unanswered request) 4043 Note: The proxy is responsible for accepting REDIRECT responses 4044 from its clients; these responses MUST NOT be passed on to either 4045 the original server or the redirected server. 4047 When the server lacks any alternative server and needs to terminate a 4048 session or all sessions the TEARDOWN request SHALL be used instead. 4050 When no Terminate-Reason "time" parameter are included in a REDIRECT 4051 request, the client SHALL perform the redirection immediately and 4052 return a response to the server. The server shall consider the 4053 session as terminated and can free any associated state after it 4054 receives the successful (2xx) response. The server MAY close the 4055 signaling connection upon receiving the response and the client 4056 SHOULD close the signaling connection after sending the 2xx response. 4057 The exception to this is when the client has several sessions on the 4058 server being managed by the given signaling connection. In this 4059 case, the client SHOULD close the connection when it has received and 4060 responded to REDIRECT requests for all the sessions managed by the 4061 signaling connection. 4063 The Terminate-Reason header "time" parameter MAY be used to indicate 4064 the wallclock time by when the redirection MUST have taken place. To 4065 allow a client to determine that redirect time without being time 4066 synchronized with the server, the server MUST include a Date header 4067 in the request. The client should have terminated the session and 4068 closed the control connection before the redirection time-line 4069 terminated. The server MAY simply cease to provide service when the 4070 deadline time has been reached, or it may issue TEARDOWN requests to 4071 the remaining sessions. 4073 If the REDIRECT request times out following the rules in Section 10.4 4074 the server MAY terminate the session or transport connection that 4075 would be redirected by the request. This is a safeguard against 4076 misbehaving clients that refuse to respond to a REDIRECT request. 4077 That should not provide any benefit. 4079 After a REDIRECT request has been processed, a client that wants to 4080 continue to send or receive media for the resource identified by the 4081 Request-URI will have to establish a new session with the designated 4082 host. If the URI given in the Location header is a valid resource 4083 URI, a client SHOULD issue a DESCRIBE request for the URI. 4085 Note: The media resource indicated by the Location header can be 4086 identical, slightly different or totally different. This is the 4087 reason why a new DESCRIBE request SHOULD be issued. 4089 If the Location header contains only a host address, the client MAY 4090 assume that the media on the new server is identical to the media on 4091 the old server, i.e. all media configuration information from the old 4092 session is still valid except for the host address. However, the 4093 usage of conditional SETUP using MTag identifiers are RECOMMENDED to 4094 verify the assumption. 4096 This example request redirects traffic for this session to the new 4097 server at the given absolute time: 4099 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/2.0 4100 CSeq: 732 4101 Location: rtsp://s2.example.com:8001 4102 Terminate-Reason: Server-Admin ;time=19960213T143205Z 4103 Session: uZ3ci0K+Ld-M 4104 Date: Thu, 13 Feb 1996 14:30:43 GMT 4106 C->S: RTSP/2.0 200 OK 4107 CSeq: 732 4108 User-Agent: PhonyClient/1.2 4109 Session: uZ3ci0K+Ld-M 4111 14. Embedded (Interleaved) Binary Data 4113 In order to fulfill certain requirements on the network side, e.g. in 4114 conjunction with network address translators that block RTP traffic 4115 over UDP, it may be necessary to interleave RTSP messages and media 4116 stream data. This interleaving should generally be avoided unless 4117 necessary since it complicates client and server operation and 4118 imposes additional overhead. Also, head of line blocking may cause 4119 problems. Interleaved binary data SHOULD only be used if RTSP is 4120 carried over TCP. Interleaved data is not allowed inside RTSP 4121 messages. 4123 Stream data such as RTP packets is encapsulated by an ASCII dollar 4124 sign (36 decimal), followed by a one-byte channel identifier, 4125 followed by the length of the encapsulated binary data as a binary, 4126 two-byte integer in network byte order. The stream data follows 4127 immediately afterwards, without a CRLF, but including the upper-layer 4128 protocol headers. Each $ block MUST contain exactly one upper-layer 4129 protocol data unit, e.g., one RTP packet. 4130 0 1 2 3 4131 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 4132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4133 | "$" = 36 | Channel ID | Length in bytes | 4134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4135 : Length number of bytes of binary data : 4136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4138 The channel identifier is defined in the Transport header with the 4139 interleaved parameter (Section 18.52). 4141 When the transport choice is RTP, RTCP messages are also interleaved 4142 by the server over the TCP connection. The usage of RTCP messages is 4143 indicated by including an interval containing a second channel in the 4144 interleaved parameter of the Transport header, see Section 18.52. If 4145 RTCP is used, packets MUST be sent on the first available channel 4146 higher than the RTP channel. The channels are bi-directional, using 4147 the same Channel ID in both directions, and therefore RTCP traffic is 4148 sent on the second channel in both directions. 4150 RTCP is sometimes needed for synchronization when two or more 4151 streams are interleaved in such a fashion. Also, this provides a 4152 convenient way to tunnel RTP/RTCP packets through the TCP control 4153 connection when required by the network configuration and transfer 4154 them onto UDP when possible. 4156 C->S: SETUP rtsp://example.com/bar.file RTSP/2.0 4157 CSeq: 2 4158 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4159 Accept-Ranges: NPT, SMPTE, UTC 4160 User-Agent: PhonyClient/1.2 4162 S->C: RTSP/2.0 200 OK 4163 CSeq: 2 4164 Date: Thu, 05 Jun 1997 18:57:18 GMT 4165 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 4166 Session: 12345678 4167 Accept-Ranges: NPT 4168 Media-Properties: Random-Access=0.2, Immutable, Unlimited 4170 C->S: PLAY rtsp://example.com/bar.file RTSP/2.0 4171 CSeq: 3 4172 Session: 12345678 4173 User-Agent: PhonyClient/1.2 4175 S->C: RTSP/2.0 200 OK 4176 CSeq: 3 4177 Session: 12345678 4178 Date: Thu, 05 Jun 1997 18:57:19 GMT 4179 RTP-Info: url="rtsp://example.com/bar.file" 4180 ssrc=0D12F123:seq=232433;rtptime=972948234 4181 Range: npt=0-56.8 4182 Seek-Style: RAP 4184 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4185 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4186 S->C: $006{2 byte length}{"length" bytes RTCP packet} 4188 15. Proxies 4190 RTSP Proxies are RTSP agents that are located in between a client and 4191 a server. A proxy can take on both the role as a client and as 4192 server depending on what it tries to accomplish. Proxies are also 4193 introduced for several different reasons and the below listed are 4194 often combined. 4196 In general there are two categories of RTSP proxies, transparent (of 4197 which the client is not aware) and the non-transparent proxies (of 4198 which the client is aware). Transparent proxies are not visible to 4199 the client in terms of the transport layer connection, e.g., TCP for 4200 RTSP, as there is only a single transport connection which is 4201 terminated at the RTSP client and the RTSP server. In the case of 4202 non-transparent proxies, there are two transport layer connections, 4203 one from the RTSP client to the RTSP proxy and a second from the RTSP 4204 proxy to the RTSP server. 4206 There are these types of RTSP proxies: 4208 Caching Proxy: This type of proxy is used to reduce the workload on 4209 servers and connections. By caching the description and media 4210 streams, i.e., the presentation, the proxy can serve a client 4211 with content, but without requesting it from the server once it 4212 has been cached and has not become stale. See the caching 4213 Section 16. This type of proxy is also expected to understand 4214 RTSP end-point functionality, i.e., functionality identified in 4215 the Require header in addition to what Proxy-Require demands. 4217 Translator Proxy: This type of proxy is used to ensure that an RTSP 4218 client gets access to servers and content on an external 4219 network or using content encodings not supported by the client. 4220 The proxy performs the necessary translation of addresses, 4221 protocols or encodings. This type of proxy is expected to also 4222 understand RTSP end-point functionality, i.e. functionality 4223 identified in the Require header in addition to what Proxy- 4224 Require demands. 4226 Access Proxy: This type of proxy is used to ensure that an RTSP 4227 client gets access to servers on an external network. Thus 4228 this proxy is placed on the border between two domains, e.g. a 4229 private address space and the public Internet. The proxy 4230 performs the necessary translation, usually addresses. This 4231 type of proxy is required to redirect the media to itself or a 4232 controlled gateway that performs the translation before the 4233 media can reach the client. 4235 Security Proxy: This type of proxy is used to help facilitate 4236 security functions around RTSP. For example when having a 4237 firewalled network, the security proxy requests that the 4238 necessary pinholes in the firewall are opened when a client in 4239 the protected network wants to access media streams on the 4240 external side. This proxy can also limit the client's access 4241 to certain types of content. This proxy can perform its 4242 function without redirecting the media between the server and 4243 client. However, in deployments with private address spaces 4244 this proxy is likely to be combined with the access proxy. 4245 Anyway, the functionality of this proxy is usually closely tied 4246 into understanding all aspects of the media transport. 4248 Auditing Proxy: RTSP proxies can also provide network owners with a 4249 logging and audit point for RTSP sessions, e.g. for 4250 corporations that track their employees usage of the network. 4251 This type of proxy can perform its function without inserting 4252 itself or any other node in the media transport. This proxy 4253 type can also accept unknown methods as it doesn't interfere 4254 with the clients' requests. 4256 All types of proxies can be used also when using secured 4257 communication with TLS as RTSP 2.0 allows the client to approve 4258 certificate chains used for connection establishment from a proxy, 4259 see Section 19.3.2. However, that trust model may not be suitable 4260 for all types of deployment. In those cases, the secured sessions do 4261 by-pass the proxies. 4263 Access proxies SHOULD NOT be used in equipment like NATs and 4264 firewalls that aren't expected to be regularly maintained, like home 4265 or small office equipment. In these cases it is better to use the 4266 NAT traversal procedures defined for RTSP 2.0 4267 [I-D.ietf-mmusic-rtsp-nat]. The reason for these recommendations is 4268 that any extensions of RTSP resulting in new media transport 4269 protocols or profiles, new parameters, etc. may fail in a proxy that 4270 isn't maintained. This would impede RTSP's future development and 4271 usage. 4273 15.1. Proxies and Protocol Extensions 4275 The existence of proxies must always be considered when developing 4276 new RTSP extensions. Most types of proxies will need to implement 4277 any new method to operate correctly in the presence of that 4278 extension. New headers can be introduced and will not be blocked by 4279 older proxies. However, it is important to consider if this header 4280 and its function is required to be understood by the proxy or can be 4281 forwarded. If the header needs to be understood, a feature-tag 4282 representing the functionality MUST be included in the Proxy-Require 4283 header. Below are guidelines for analysis if the header needs to be 4284 understood. The transport header and its parameters also shows that 4285 headers that are extensible and require correct interpretation in the 4286 proxy also require handling rules. 4288 Whether a proxy needs to understand a header is not easy to 4289 determine, as they serve a broad variety of functions. When 4290 evaluating if a header needs to be understood, one can divide the 4291 functionality into three main categories: 4293 Media modifying: The caching and translator proxies are modifying 4294 the actual media and therefore need to understand also the request 4295 directed to the server that affects how the media is rendered. 4296 Thus, this type of proxy needs to also understand the server side 4297 functionality. 4299 Transport modifying: The access and the security proxy both need to 4300 understand how the transport is performed, either for opening 4301 pinholes or to translate the outer headers, e.g., IP and UDP. 4303 Non-modifying: The audit proxy is special in that it does not modify 4304 the messages in other ways than to insert the Via header. That 4305 makes it possible for this type to forward RTSP messages that 4306 contain different types of unknown methods, headers or header 4307 parameters. 4309 Based on the above classification, one should evaluate if the new 4310 functionality requires the Transport modifying type of proxies to 4311 understand it or not. 4313 15.2. Multiplexing and Demultiplexing of Messages 4315 RTSP proxies may have to multiplex multiple RTSP sessions from their 4316 clients towards RTSP servers. This requires that RTSP requests from 4317 multiple clients are multiplexed onto a common connection for 4318 requests outgoing to an RTSP server and on the way back the responses 4319 are demultiplexed from the server to per client responses. On the 4320 protocol level this requires that request and response messages are 4321 handled in both ways, requiring that there is a mechanism to 4322 correlate what request/response pair exchanged between proxy and 4323 server is mapped to what client (or client request). 4325 This multiplexing of requests and demultiplexing of responses is done 4326 by using the CSeq header field (see Section 18.19). The proxy has to 4327 rewrite the CSeq in requests to the server and responses from the 4328 server and remember what CSeq is mapped to what client. 4330 16. Caching 4332 In HTTP, request-response pairs are cached. RTSP differs 4333 significantly in that respect. Responses are not cacheable, with the 4334 exception of the presentation description returned by DESCRIBE. 4335 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 4336 not return any data, caching is not really an issue for these 4337 requests.) However, it is desirable for the continuous media data, 4338 typically delivered out-of-band with respect to RTSP, to be cached, 4339 as well as the session description. 4341 On receiving a SETUP or PLAY request, a proxy ascertains whether it 4342 has an up-to-date copy of the continuous media content and its 4343 description. It can determine whether the copy is up-to-date by 4344 issuing a SETUP or DESCRIBE request, respectively, and comparing the 4345 Last-Modified header with that of the cached copy. If the copy is 4346 not up-to-date, it modifies the SETUP transport parameters as 4347 appropriate and forwards the request to the origin server. 4348 Subsequent control commands such as PLAY or PAUSE then pass the proxy 4349 unmodified. The proxy delivers the continuous media data to the 4350 client, while possibly making a local copy for later reuse. The 4351 exact allowed behavior of the cache is given by the cache-response 4352 directives described in Section 18.10. A cache MUST answer any 4353 DESCRIBE requests if it is currently serving the stream to the 4354 requester, as it is possible that low-level details of the stream 4355 description may have changed on the origin-server. 4357 Note that an RTSP cache, is of the "cut-through" variety. Rather 4358 than retrieving the whole resource from the origin server, the cache 4359 simply copies the streaming data as it passes by on its way to the 4360 client. Thus, it does not introduce additional latency. 4362 To the client, an RTSP proxy cache appears like a regular media 4363 server. To the media origin server an RTSP proxy cache appears like 4364 a client. Just as an HTTP cache has to store the content type, 4365 content language, and so on for the objects it caches, a media cache 4366 has to store the presentation description. Typically, a cache 4367 eliminates all transport-references (e.g., multicast information) 4368 from the presentation description, since these are independent of the 4369 data delivery from the cache to the client. Information on the 4370 encodings remains the same. If the cache is able to translate the 4371 cached media data, it would create a new presentation description 4372 with all the encoding possibilities it can offer. 4374 16.1. Validation Model 4376 When a cache has a stale entry that it would like to use as a 4377 response to a client's request, it first has to check with the origin 4378 server (or possibly an intermediate cache with a fresh response) to 4379 see if its cached entry is still usable. We call this "validating" 4380 the cache entry. Since we do not want to have to pay the overhead of 4381 retransmitting the full response if the cached entry is good, and we 4382 do not want to pay the overhead of an extra round trip if the cached 4383 entry is invalid, the RTSP protocol supports the use of conditional 4384 methods. 4386 The key protocol features for supporting conditional methods are 4387 those concerned with "cache validators." When an origin server 4388 generates a full response, it attaches some sort of validator to it, 4389 which is kept with the cache entry. When a client (user agent or 4390 proxy cache) makes a conditional request for a resource for which it 4391 has a cache entry, it includes the associated validator in the 4392 request. 4394 The server then checks that validator against the current validator 4395 for the requested resource, and, if they match (see Section 16.1.3), 4396 it responds with a special status code (usually, 304 (Not Modified)) 4397 and no message body. Otherwise, it returns a full response 4398 (including message body). Thus, we avoid transmitting the full 4399 response if the validator matches, and we avoid an extra round trip 4400 if it does not match. 4402 In RTSP, a conditional request looks exactly the same as a normal 4403 request for the same resource, except that it carries a special 4404 header (which includes the validator) that implicitly turns the 4405 method (usually DESCRIBE or SETUP) into a conditional. 4407 The protocol includes both positive and negative senses of cache- 4408 validating conditions. That is, it is possible to request either 4409 that a method be performed if and only if a validator matches or if 4410 and only if no validators match. 4412 Note: a response that lacks a validator may still be cached, and 4413 served from cache until it expires, unless this is explicitly 4414 prohibited by a cache-control directive (see Section 18.10). 4415 However, a cache cannot do a conditional retrieval if it does not 4416 have a validator for the resource, which means it will not be 4417 refreshable after it expires. 4419 Media streams that are being adapted based on the transport capacity 4420 between the server and the cache makes caching more difficult. A 4421 server needs to consider how it views caching of media streams that 4422 it adapts and potentially instruct any caches to not cache such 4423 streams. 4425 16.1.1. Last-Modified Dates 4427 The Last-Modified header (Section 18.26) value is often used as a 4428 cache validator. In simple terms, a cache entry is considered to be 4429 valid if the content has not been modified since the Last-Modified 4430 value. 4432 16.1.2. Message Body Tag Cache Validators 4434 The MTag response-header field value, a message body tag, provides 4435 for an "opaque" cache validator. This might allow more reliable 4436 validation in situations where it is inconvenient to store 4437 modification dates, where the one-second resolution of RTSP-date 4438 values is not sufficient, or where the origin server wishes to avoid 4439 certain paradoxes that might arise from the use of modification 4440 dates. 4442 Message body tags are described in Section 4.8 4444 16.1.3. Weak and Strong Validators 4446 Since both origin servers and caches will compare two validators to 4447 decide if they represent the same or different entities, one normally 4448 would expect that if the message body (i.e., the presentation 4449 description) or any associated message body headers changes in any 4450 way, then the associated validator would change as well. If this is 4451 true, then we call this validator a "strong validator." We call 4452 message body (i.e., the presentation description) or any associated 4453 message body headers an entity for a better understanding. 4455 However, there might be cases when a server prefers to change the 4456 validator only on semantically significant changes, and not when 4457 insignificant aspects of the entity change. A validator that does 4458 not always change when the resource changes is a "weak validator." 4460 Message body tags are normally "strong validators," but the protocol 4461 provides a mechanism to tag a message body tag as "weak." One can 4462 think of a strong validator as one that changes whenever the bits of 4463 an entity changes, while a weak value changes whenever the meaning of 4464 an entity changes. Alternatively, one can think of a strong 4465 validator as part of an identifier for a specific entity, while a 4466 weak validator is part of an identifier for a set of semantically 4467 equivalent entities. 4469 Note: One example of a strong validator is an integer that is 4470 incremented in stable storage every time an entity is changed. 4472 An entity's modification time, if represented with one-second 4473 resolution, could be a weak validator, since it is possible that 4474 the resource might be modified twice during a single second. 4476 Support for weak validators is optional. However, weak validators 4477 allow for more efficient caching of equivalent objects. 4479 A "use" of a validator is either when a client generates a request 4480 and includes the validator in a validating header field, or when a 4481 server compares two validators. 4483 Strong validators are usable in any context. Weak validators are 4484 only usable in contexts that do not depend on exact equality of an 4485 entity. For example, either kind is usable for a conditional 4486 DESCRIBE of a full entity. However, only a strong validator is 4487 usable for a sub-range retrieval, since otherwise the client might 4488 end up with an internally inconsistent entity. 4490 Clients MAY issue DESCRIBE requests with either weak validators or 4491 strong validators. Clients MUST NOT use weak validators in other 4492 forms of requests. 4494 The only function that the RTSP protocol defines on validators is 4495 comparison. There are two validator comparison functions, depending 4496 on whether the comparison context allows the use of weak validators 4497 or not: 4499 o The strong comparison function: in order to be considered equal, 4500 both validators MUST be identical in every way, and both MUST NOT 4501 be weak. 4503 o The weak comparison function: in order to be considered equal, 4504 both validators MUST be identical in every way, but either or both 4505 of them MAY be tagged as "weak" without affecting the result. 4507 A message body tag is strong unless it is explicitly tagged as weak. 4509 A Last-Modified time, when used as a validator in a request, is 4510 implicitly weak unless it is possible to deduce that it is strong, 4511 using the following rules: 4513 o The validator is being compared by an origin server to the actual 4514 current validator for the entity and, 4516 o That origin server reliably knows that the associated entity did 4517 not change more than once during the second covered by the 4518 presented validator. 4520 OR 4522 o The validator is about to be used by a client in an If-Modified- 4523 Since, because the client has a cache entry for the associated 4524 entity, and 4526 o That cache entry includes a Date value, which gives the time when 4527 the origin server sent the original response, and 4529 o The presented Last-Modified time is at least 60 seconds before the 4530 Date value. 4532 OR 4534 o The validator is being compared by an intermediate cache to the 4535 validator stored in its cache entry for the entity, and 4537 o That cache entry includes a Date value, which gives the time when 4538 the origin server sent the original response, and 4540 o The presented Last-Modified time is at least 60 seconds before the 4541 Date value. 4543 This method relies on the fact that if two different responses were 4544 sent by the origin server during the same second, but both had the 4545 same Last-Modified time, then at least one of those responses would 4546 have a Date value equal to its Last-Modified time. The arbitrary 60- 4547 second limit guards against the possibility that the Date and Last- 4548 Modified values are generated from different clocks, or at somewhat 4549 different times during the preparation of the response. An 4550 implementation MAY use a value larger than 60 seconds, if it is 4551 believed that 60 seconds is too short. 4553 If a client wishes to perform a sub-range retrieval on a value for 4554 which it has only a Last-Modified time and no opaque validator, it 4555 MAY do this only if the Last-Modified time is strong in the sense 4556 described here. 4558 16.1.4. Rules for When to Use Message Body Tags and Last-Modified Dates 4560 We adopt a set of rules and recommendations for origin servers, 4561 clients, and caches regarding when various validator types ought to 4562 be used, and for what purposes. 4564 RTSP origin servers: 4566 o SHOULD send a message body tag validator unless it is not feasible 4567 to generate one. 4569 o MAY send a weak message body tag instead of a strong message body 4570 tag, if performance considerations support the use of weak message 4571 body tags, or if it is unfeasible to send a strong message body 4572 tag. 4574 o SHOULD send a Last-Modified value if it is feasible to send one, 4575 unless the risk of a breakdown in semantic transparency that could 4576 result from using this date in an If-Modified-Since header would 4577 lead to serious problems. 4579 In other words, the preferred behavior for an RTSP origin server is 4580 to send both a strong message body tag and a Last-Modified value. 4582 In order to be legal, a strong message body tag MUST change whenever 4583 the associated entity value changes in any way. A weak message body 4584 tag SHOULD change whenever the associated entity changes in a 4585 semantically significant way. 4587 Note: in order to provide semantically transparent caching, an 4588 origin server MUST avoid reusing a specific strong message body 4589 tag value for two different entities, or reusing a specific weak 4590 message body tag value for two semantically different entities. 4591 Cache entries might persist for arbitrarily long periods, 4592 regardless of expiration times, so it might be inappropriate to 4593 expect that a cache will never again attempt to validate an entry 4594 using a validator that it obtained at some point in the past. 4596 RTSP clients: 4598 o If a message body tag has been provided by the origin server, MUST 4599 use that message body tag in any cache-conditional request (using 4600 If-Match or If-None-Match). 4602 o If only a Last-Modified value has been provided by the origin 4603 server, SHOULD use that value in non-subrange cache-conditional 4604 requests (using If-Modified-Since). 4606 o If both a message body tag and a Last-Modified value have been 4607 provided by the origin server, SHOULD use both validators in 4608 cache-conditional requests. 4610 An RTSP origin server, upon receiving a conditional request that 4611 includes both a Last-Modified date (e.g., in an If-Modified-Since 4612 header) and one or more message body tags (e.g., in an If-Match, If- 4613 None-Match, or If-Range header field) as cache validators, MUST NOT 4614 return a response status of 304 (Not Modified) unless doing so is 4615 consistent with all of the conditional header fields in the request. 4617 Note: The general principle behind these rules is that RTSP 4618 servers and clients should transmit as much non-redundant 4619 information as is available in their responses and requests. RTSP 4620 systems receiving this information will make the most conservative 4621 assumptions about the validators they receive. 4623 16.1.5. Non-validating Conditionals 4625 The principle behind message body tags is that only the service 4626 author knows the semantics of a resource well enough to select an 4627 appropriate cache validation mechanism, and the specification of any 4628 validator comparison function more complex than byte-equality would 4629 open up a can of worms. Thus, comparisons of any other headers are 4630 never used for purposes of validating a cache entry. 4632 16.2. Invalidation After Updates or Deletions 4634 The effect of certain methods performed on a resource at the origin 4635 server might cause one or more existing cache entries to become non- 4636 transparently invalid. That is, although they might continue to be 4637 "fresh," they do not accurately reflect what the origin server would 4638 return for a new request on that resource. 4640 There is no way for the RTSP protocol to guarantee that all such 4641 cache entries are marked invalid. For example, the request that 4642 caused the change at the origin server might not have gone through 4643 the proxy where a cache entry is stored. However, several rules help 4644 reduce the likelihood of erroneous behavior. 4646 In this section, the phrase "invalidate an entity" means that the 4647 cache will either remove all instances of that entity from its 4648 storage, or will mark these as "invalid" and in need of a mandatory 4649 revalidation before they can be returned in response to a subsequent 4650 request. 4652 Some RTSP methods MUST cause a cache to invalidate an entity. This 4653 is either the entity referred to by the Request-URI, or by the 4654 Location or Content-Location headers (if present). These methods 4655 are: 4657 o DESCRIBE 4658 o SETUP 4660 In order to prevent denial of service attacks, an invalidation based 4661 on the URI in a Location or Content-Location header MUST only be 4662 performed if the host part is the same as in the Request-URI. 4664 A cache that passes through requests for methods it does not 4665 understand SHOULD invalidate any entities referred to by the Request- 4666 URI. 4668 17. Status Code Definitions 4670 Where applicable, HTTP status [H10] codes are reused. Status codes 4671 that have the same meaning are not repeated here. See Table 4 in 4672 Section 8.1 for a listing of which status codes may be returned by 4673 which requests. All error messages, 4xx and 5xx MAY return a body 4674 containing further information about the error. 4676 17.1. Success 1xx 4678 17.1.1. 100 Continue 4680 The client SHOULD continue with its request. This interim response 4681 is used to inform the client that the initial part of the request has 4682 been received and has not yet been rejected by the server. The 4683 client SHOULD continue by sending the remainder of the request or, if 4684 the request has already been completed, ignore this response. The 4685 server MUST send a final response after the request has been 4686 completed. 4688 17.2. Success 2xx 4690 This class of status code indicates that the client's request was 4691 successfully received, understood, and accepted. 4693 17.2.1. 200 OK 4695 The request has succeeded. The information returned with the 4696 response is dependent on the method used in the request. 4698 17.3. Redirection 3xx 4700 The notation "3rr" indicates response codes from 300 to 399 inclusive 4701 which are meant for redirection. The response code 304 is excluded 4702 from this set, as it is not used for redirection. 4704 Within RTSP, redirection may be used for load balancing or 4705 redirecting stream requests to a server topologically closer to the 4706 client. Mechanisms to determine topological proximity are beyond the 4707 scope of this specification. 4709 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 4710 that they are used if necessary before a session is established, 4711 i.e., in response to DESCRIBE or SETUP. However, in cases where a 4712 server is not able to send a REDIRECT request to the client, the 4713 server MAY need to resort to using 3rr responses to inform a client 4714 with an established session about the need for redirecting the 4715 session. If a 3rr response is received for a request in relation to 4716 an established session, the client SHOULD send a TEARDOWN request for 4717 the session, and MAY reestablish the session using the resource 4718 indicated by the Location. 4720 If the Location header is used in a response it MUST contain an 4721 absolute URI pointing out the media resource the client is redirected 4722 to, the URI MUST NOT only contain the host name. 4724 17.3.1. 301 Moved Permanently 4726 The requested resource is moved permanently and resides now at the 4727 URI given by the Location header. The user client SHOULD redirect 4728 automatically to the given URI. This response MUST NOT contain a 4729 message-body. The Location header MUST be included in the response. 4731 17.3.2. 302 Found 4733 The requested resource resides temporarily at the URI given by the 4734 Location header. The Location header MUST be included in the 4735 response. This response is intended to be used for many types of 4736 temporary redirects; e.g., load balancing. It is RECOMMENDED that 4737 the server set the reason phrase to something more meaningful than 4738 "Found" in these cases. The user client SHOULD redirect 4739 automatically to the given URI. This response MUST NOT contain a 4740 message-body. 4742 This example shows a client being redirected to a different server: 4744 C->S: SETUP rtsp://example.com/fizzle/foo RTSP/2.0 4745 CSeq: 2 4746 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4747 Accept-Ranges: NPT, SMPTE, UTC 4748 User-Agent: PhonyClient/1.2 4750 S->C: RTSP/2.0 302 Try Other Server 4751 CSeq: 2 4752 Location: rtsp://s2.example.com:8001/fizzle/foo 4754 17.3.3. 303 See Other 4756 This status code MUST NOT be used in RTSP 2.0. However, it was 4757 allowed in RTSP 1.0 [RFC 2326]. 4759 17.3.4. 304 Not Modified 4761 If the client has performed a conditional DESCRIBE or SETUP (see 4762 Section 18.24) and the requested resource has not been modified, the 4763 server SHOULD send a 304 response. This response MUST NOT contain a 4764 message-body. 4766 The response MUST include the following header fields: 4768 o Date 4770 o MTag and/or Content-Location, if the header(s) would have been 4771 sent in a 200 response to the same request. 4773 o Expires and Cache-Control if the field-value might differ from 4774 that sent in any previous response for the same variant. 4776 This response is independent for the DESCRIBE and SETUP requests. 4777 That is, a 304 response to DESCRIBE does NOT imply that the resource 4778 content is unchanged (only the session description) and a 304 4779 response to SETUP does NOT imply that the resource description is 4780 unchanged. The MTag and If-Match headers may be used to link the 4781 DESCRIBE and SETUP in this manner. 4783 17.3.5. 305 Use Proxy 4785 The requested resource MUST be accessed through the proxy given by 4786 the Location field. The Location field gives the URI of the proxy. 4787 The recipient is expected to repeat this single request via the 4788 proxy. 305 responses MUST only be generated by origin servers. 4790 17.4. Client Error 4xx 4792 17.4.1. 400 Bad Request 4794 The request could not be understood by the server due to malformed 4795 syntax. The client SHOULD NOT repeat the request without 4796 modifications. If the request does not have a CSeq header, the 4797 server MUST NOT include a CSeq in the response. 4799 17.4.2. 401 Unauthorized 4801 The request requires user authentication. The response MUST include 4802 a WWW-Authenticate header (Section 18.56) field containing a 4803 challenge applicable to the requested resource. The client MAY 4804 repeat the request with a suitable Authorization header field. If 4805 the request already included Authorization credentials, then the 401 4806 response indicates that authorization has been refused for those 4807 credentials. If the 401 response contains the same challenge as the 4808 prior response, and the user agent has already attempted 4809 authentication at least once, then the user SHOULD be presented the 4810 message body that was given in the response, since that message body 4811 might include relevant diagnostic information. HTTP access 4812 authentication is explained in [RFC2617]. 4814 17.4.3. 402 Payment Required 4816 This code is reserved for future use. 4818 17.4.4. 403 Forbidden 4820 The server understood the request, but is refusing to fulfill it. 4821 Authorization will not help and the request SHOULD NOT be repeated. 4822 If the server wishes to make public why the request has not been 4823 fulfilled, it SHOULD describe the reason for the refusal in the 4824 message body. If the server does not wish to make this information 4825 available to the client, the status code 404 (Not Found) can be used 4826 instead. 4828 17.4.5. 404 Not Found 4830 The server has not found anything matching the Request-URI. No 4831 indication is given of whether the condition is temporary or 4832 permanent. The 410 (Gone) status code SHOULD be used if the server 4833 knows, through some internally configurable mechanism, that an old 4834 resource is permanently unavailable and has no forwarding address. 4835 This status code is commonly used when the server does not wish to 4836 reveal exactly why the request has been refused, or when no other 4837 response is applicable. 4839 17.4.6. 405 Method Not Allowed 4841 The method specified in the request is not allowed for the resource 4842 identified by the Request-URI. The response MUST include an Allow 4843 header containing a list of valid methods for the requested resource. 4844 This status code is also to be used if a request attempts to use a 4845 method not indicated during SETUP. 4847 17.4.7. 406 Not Acceptable 4849 The resource identified by the request is only capable of generating 4850 response message bodies which have content characteristics not 4851 acceptable according to the Accept headers sent in the request. 4853 The response SHOULD include a message body containing a list of 4854 available message body characteristics and location(s) from which the 4855 user or user agent can choose the one most appropriate. The message 4856 body format is specified by the media type given in the Content-Type 4857 header field. Depending upon the format and the capabilities of the 4858 user agent, selection of the most appropriate choice MAY be performed 4859 automatically. However, this specification does not define any 4860 standard for such automatic selection. 4862 If the response could be unacceptable, a user agent SHOULD 4863 temporarily stop receipt of more data and query the user for a 4864 decision on further actions. 4866 17.4.8. 407 Proxy Authentication Required 4868 This code is similar to 401 (Unauthorized) (Section 17.4.2), but 4869 indicates that the client must first authenticate itself with the 4870 proxy. The proxy MUST return a Proxy-Authenticate header field 4871 (Section 18.33) containing a challenge applicable to the proxy for 4872 the requested resource. 4874 17.4.9. 408 Request Timeout 4876 The client did not produce a request within the time that the server 4877 was prepared to wait. The client MAY repeat the request without 4878 modifications at any later time. 4880 17.4.10. 410 Gone 4882 The requested resource is no longer available at the server and the 4883 forwarding address is not known. This condition is expected to be 4884 considered permanent. If the server does not know, or has no 4885 facility to determine, whether or not the condition is permanent, the 4886 status code 404 (Not Found) SHOULD be used instead. This response is 4887 cacheable unless indicated otherwise. 4889 The 410 response is primarily intended to assist the task of 4890 repository maintenance by notifying the recipient that the resource 4891 is intentionally unavailable and that the server owners desire that 4892 remote links to that resource be removed. Such an event is common 4893 for limited-time, promotional services and for resources belonging to 4894 individuals no longer working at the server's site. It is not 4895 necessary to mark all permanently unavailable resources as "gone" or 4896 to keep the mark for any length of time -- that is left to the 4897 discretion of the owner of the server. 4899 17.4.11. 411 Length Required 4901 The server refuses to accept the request without a defined Content- 4902 Length. The client MAY repeat the request if it adds a valid 4903 Content-Length header field containing the length of the message-body 4904 in the request message. 4906 17.4.12. 412 Precondition Failed 4908 The precondition given in one or more of the 'if-' request-header 4909 fields evaluated to false when it was tested on the server. See 4910 these sections for the 'if-' headers: If-Match Section 18.23, If- 4911 Modified-Since Section 18.24, and If-None-Match Section 18.25. This 4912 response code allows the client to place preconditions on the current 4913 resource meta information (header field data) and thus prevent the 4914 requested method from being applied to a resource other than the one 4915 intended. 4917 17.4.13. 413 Request Message Body Too Large 4919 The server is refusing to process a request because the request 4920 message body is larger than the server is willing or able to process. 4921 The server MAY close the connection to prevent the client from 4922 continuing the request. 4924 If the condition is temporary, the server SHOULD include a Retry- 4925 After header field to indicate that it is temporary and after what 4926 time the client MAY try again. 4928 17.4.14. 414 Request-URI Too Long 4930 The server is refusing to service the request because the Request-URI 4931 is longer than the server is willing to interpret. This rare 4932 condition is only likely to occur when a client has used a request 4933 with long query information, when the client has descended into a URI 4934 "black hole" of redirection (e.g., a redirected URI prefix that 4935 points to a suffix of itself), or when the server is under attack by 4936 a client attempting to exploit security holes present in some servers 4937 using fixed-length buffers for reading or manipulating the Request- 4938 URI. 4940 17.4.15. 415 Unsupported Media Type 4942 The server is refusing to service the request because the message 4943 body of the request is in a format not supported by the requested 4944 resource for the requested method. 4946 17.4.16. 451 Parameter Not Understood 4948 The recipient of the request does not support one or more parameters 4949 contained in the request. When returning this error message the 4950 sender SHOULD return a message body containing the offending 4951 parameter(s). 4953 17.4.17. 452 reserved 4955 This status code MUST NOT be used in RTSP 2.0. However, it was 4956 allowed in RTSP 1.0 [RFC 2326]. 4958 17.4.18. 453 Not Enough Bandwidth 4960 The request was refused because there was insufficient bandwidth. 4961 This may, for example, be the result of a resource reservation 4962 failure. 4964 17.4.19. 454 Session Not Found 4966 The RTSP session identifier in the Session header is missing, 4967 invalid, or has timed out. 4969 17.4.20. 455 Method Not Valid in This State 4971 The client or server cannot process this request in its current 4972 state. The response MUST contain an Allow header to make error 4973 recovery possible. 4975 17.4.21. 456 Header Field Not Valid for Resource 4977 The server could not act on a required request header. For example, 4978 if PLAY contains the Range header field but the stream does not allow 4979 seeking. This error message may also be used for specifying when the 4980 time format in Range is impossible for the resource. In that case 4981 the Accept-Ranges header MUST be returned to inform the client of 4982 which format(s) that are allowed. 4984 17.4.22. 457 Invalid Range 4986 The Range value given is out of bounds, e.g., beyond the end of the 4987 presentation. 4989 17.4.23. 458 Parameter Is Read-Only 4991 The parameter to be set by SET_PARAMETER can be read but not 4992 modified. When returning this error message the sender SHOULD return 4993 a message body containing the offending parameter(s). 4995 17.4.24. 459 Aggregate Operation Not Allowed 4997 The requested method may not be applied on the URI in question since 4998 it is an aggregate (presentation) URI. The method may be applied on 4999 a media URI. 5001 17.4.25. 460 Only Aggregate Operation Allowed 5003 The requested method may not be applied on the URI in question since 5004 it is not an aggregate control (presentation) URI. The method may be 5005 applied on the aggregate control URI. 5007 17.4.26. 461 Unsupported Transport 5009 The Transport field did not contain a supported transport 5010 specification. 5012 17.4.27. 462 Destination Unreachable 5014 The data transmission channel could not be established because the 5015 client address could not be reached. This error will most likely be 5016 the result of a client attempt to place an invalid dest_addr 5017 parameter in the Transport field. 5019 17.4.28. 463 Destination Prohibited 5021 The data transmission channel was not established because the server 5022 prohibited access to the client address. This error is most likely 5023 the result of a client attempt to redirect media traffic to another 5024 destination with a dest_addr parameter in the Transport header. 5026 17.4.29. 464 Data Transport Not Ready Yet 5028 The data transmission channel to the media destination is not yet 5029 ready for carrying data. However, the responding agent still expects 5030 that the data transmission channel will be established at some point 5031 in time. Note, however, that this may result in a permanent failure 5032 like 462 "Destination Unreachable". 5034 An example when this error may occur is in the case a client sends a 5035 PLAY request to a server prior to ensuring that the TCP connections 5036 negotiated for carrying media data was successfully established (In 5037 violation of this specification). The server would use this error 5038 code to indicate that the requested action could not be performed due 5039 to the failure of completing the connection establishment. 5041 17.4.30. 465 Notification Reason Unknown 5043 This indicates that the client has received a PLAY_NOTIFY 5044 (Section 13.5) with a Notify-Reason header (Section 18.31) unknown to 5045 the client. 5047 17.4.31. 466 Key Management Error 5049 This indicates that there has been an error in a Key Management 5050 function used in conjunction with a request. For example usage of 5051 MIKEY [RFC3830] according to Appendix C.1.4.1 may result in this 5052 error. 5054 17.4.32. 470 Connection Authorization Required 5056 The secured connection attempt needs user or client authorization 5057 before proceeding. The next hops certificate is included in this 5058 response in the Accept-Credentials header. 5060 17.4.33. 471 Connection Credentials not accepted 5062 When performing a secure connection over multiple connections, an 5063 intermediary has refused to connect to the next hop and carry out the 5064 request due to unacceptable credentials for the used policy. 5066 17.4.34. 472 Failure to establish secure connection 5068 A proxy fails to establish a secure connection to the next hop RTSP 5069 agent. This is primarily caused by a fatal failure at the TLS 5070 handshake, for example due to server not accepting any cipher suites. 5072 17.5. Server Error 5xx 5074 Response status codes beginning with the digit "5" indicate cases in 5075 which the server is aware that it has erred or is incapable of 5076 performing the request The server SHOULD include a message body 5077 containing an explanation of the error situation, and whether it is a 5078 temporary or permanent condition. User agents SHOULD display any 5079 included message body to the user. These response codes are 5080 applicable to any request method. 5082 17.5.1. 500 Internal Server Error 5084 The server encountered an unexpected condition which prevented it 5085 from fulfilling the request. 5087 17.5.2. 501 Not Implemented 5089 The server does not support the functionality required to fulfill the 5090 request. This is the appropriate response when the server does not 5091 recognize the request method and is not capable of supporting it for 5092 any resource. 5094 17.5.3. 502 Bad Gateway 5096 The server, while acting as a gateway or proxy, received an invalid 5097 response from the upstream server it accessed in attempting to 5098 fulfill the request. 5100 17.5.4. 503 Service Unavailable 5102 The server is currently unable to handle the request due to a 5103 temporary overloading or maintenance of the server. The implication 5104 is that this is a temporary condition which will be alleviated after 5105 some delay. If known, the length of the delay MAY be indicated in a 5106 Retry-After header. If no Retry-After is given, the client SHOULD 5107 handle the response as it would for a 500 response. The client MUST 5108 honor the length, if given in the Retry-After header. 5110 Note: The existence of the 503 status code does not imply that 5111 a server must use it when becoming overloaded. Some servers 5112 may wish to simply refuse the connection. 5114 17.5.5. 504 Gateway Timeout 5116 The server, while acting as a proxy, did not receive a timely 5117 response from the upstream server specified by the URI or some other 5118 auxiliary server (e.g., DNS) it needed to access in attempting to 5119 complete the request. 5121 17.5.6. 505 RTSP Version Not Supported 5123 The server does not support, or refuses to support, the RTSP protocol 5124 version that was used in the request message. The server is 5125 indicating that it is unable or unwilling to complete the request 5126 using the same major version as the client other than with this error 5127 message. The response SHOULD contain a message body describing why 5128 that version is not supported and what other protocols are supported 5129 by that server. 5131 17.5.7. 551 Option not supported 5133 A feature-tag given in the Require or the Proxy-Require fields was 5134 not supported. The Unsupported header MUST be returned stating the 5135 feature for which there is no support. 5137 18. Header Field Definitions 5139 +---------------+----------------+--------+---------+------+ 5140 | method | direction | object | acronym | Body | 5141 +---------------+----------------+--------+---------+------+ 5142 | DESCRIBE | C -> S | P,S | DES | r | 5143 | | | | | | 5144 | GET_PARAMETER | C -> S, S -> C | P,S | GPR | R,r | 5145 | | | | | | 5146 | OPTIONS | C -> S, S -> C | P,S | OPT | | 5147 | | | | | | 5148 | PAUSE | C -> S | P,S | PSE | | 5149 | | | | | | 5150 | PLAY | C -> S | P,S | PLY | | 5151 | | | | | | 5152 | PLAY_NOTIFY | S -> C | P,S | PNY | R | 5153 | | | | | | 5154 | REDIRECT | S -> C | P,S | RDR | | 5155 | | | | | | 5156 | SETUP | C -> S | S | STP | | 5157 | | | | | | 5158 | SET_PARAMETER | C -> S, S -> C | P,S | SPR | R,r | 5159 | | | | | | 5160 | TEARDOWN | C -> S | P,S | TRD | | 5161 | | | | | | 5162 | | S -> C | P | TRD | | 5163 +---------------+----------------+--------+---------+------+ 5165 Table 8: Overview of RTSP methods, their direction, and what objects 5166 (P: presentation, S: stream) they operate on. Body notes if a method 5167 is allowed to carry body and in which direction, R = Request, 5168 r=response. Note: It is allowed for all error messages 4xx and 5xx to 5169 have a body 5171 The general syntax for header fields is covered in Section 5.2. This 5172 section lists the full set of header fields along with notes on 5173 meaning, and usage. The syntax definition for header fields are 5174 present in Section 20.2.3. Throughout this section, we use [HX.Y] to 5175 informational refer to Section X.Y of the current HTTP/1.1 5176 specification RFC 2616 [RFC2616]. Examples of each header field are 5177 given. 5179 Information about header fields in relation to methods and proxy 5180 processing is summarized in Table 9, Table 10, Table 11, and 5181 Table 12. 5183 The "where" column describes the request and response types in which 5184 the header field can be used. Values in this column are: 5186 R: header field may only appear in requests; 5188 r: header field may only appear in responses; 5190 2xx, 4xx, etc.: A numerical value or range indicates response codes 5191 with which the header field can be used; 5193 c: header field is copied from the request to the response. 5195 An empty entry in the "where" column indicates that the header field 5196 may be present in both requests and responses. 5198 The "proxy" column describes the operations a proxy may perform on a 5199 header field. An empty proxy column indicates that the proxy MUST 5200 NOT do any changes to that header, all allowed operations are 5201 explicitly stated: 5203 a: A proxy can add or concatenate the header field if not present. 5205 m: A proxy can modify an existing header field value. 5207 d: A proxy can delete a header field value. 5209 r: A proxy needs to be able to read the header field, and thus 5210 this header field cannot be encrypted. 5212 The rest of the columns relate to the presence of a header field in a 5213 method. The method names when abbreviated, are according to Table 8: 5215 c: Conditional; requirements on the header field depend on the 5216 context of the message. 5218 m: The header field is mandatory. 5220 m*: The header field SHOULD be sent, but clients/servers need to be 5221 prepared to receive messages without that header field. 5223 o: The header field is optional. 5225 *: The header field MUST be present if the message body is not 5226 empty. See Section 18.16, Section 18.18 and Section 5.3 for 5227 details. 5229 -: The header field is not applicable. 5231 "Optional" means that a Client/Server MAY include the header field in 5232 a request or response. The Client/Server behavior when receiving 5233 such headers varies, for some it may ignore the header field, in 5234 other cases it is a request to process the header. This is regulated 5235 by the method and header descriptions. Example of headers that 5236 require processing are the Require and Proxy-Require header fields 5237 discussed in Section 18.41 and Section 18.35. A "mandatory" header 5238 field MUST be present in a request, and MUST be understood by the 5239 Client/Server receiving the request. A mandatory response header 5240 field MUST be present in the response, and the header field MUST be 5241 understood by the Client/Server processing the response. "Not 5242 applicable" means that the header field MUST NOT be present in a 5243 request. If one is placed in a request by mistake, it MUST be 5244 ignored by the Client/Server receiving the request. Similarly, a 5245 header field labeled "not applicable" for a response means that the 5246 Client/Server MUST NOT place the header field in the response, and 5247 the Client/Server MUST ignore the header field in the response. 5249 An RTSP agent MUST ignore extension headers that are not understood. 5251 The From and Location header fields contain an URI. If the URI 5252 contains a comma, or semicolon, the URI MUST be enclosed in double 5253 quotes ("). Any URI parameters are contained within these quotes. 5254 If the URI is not enclosed in double quote, any semicolon-delimited 5255 parameters are header-parameters, not URI parameters. 5257 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 5258 | Header | Where | Pro | DE | OPT | STP | PLY | PSE | TRD | 5259 | | | xy | S | | | | | | 5260 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 5261 | Accept | R | | o | - | - | - | - | - | 5262 | | | | | | | | | | 5263 | Accept-Credentia | R | rm | o | o | o | o | o | o | 5264 | ls | | | | | | | | | 5265 | | | | | | | | | | 5266 | Accept-Encoding | R | r | o | - | - | - | - | - | 5267 | | | | | | | | | | 5268 | Accept-Language | R | r | o | - | - | - | - | - | 5269 | | | | | | | | | | 5270 | Accept-Ranges | R | r | - | - | m | - | - | - | 5271 | | | | | | | | | | 5272 | Accept-Ranges | r | r | - | - | m | - | - | - | 5273 | | | | | | | | | | 5274 | Accept-Ranges | 456 | r | - | - | - | m | - | - | 5275 | | | | | | | | | | 5276 | Allow | r | am | c | c | c | - | - | - | 5277 | | | | | | | | | | 5278 | Allow | 405 | am | m | m | m | m | m | m | 5279 | | | | | | | | | | 5280 | Authorization | R | | o | o | o | o | o | o | 5281 | | | | | | | | | | 5282 | Bandwidth | R | | o | o | o | o | - | - | 5283 | | | | | | | | | | 5284 | Blocksize | R | | o | - | o | o | - | - | 5285 | | | | | | | | | | 5286 | Cache-Control | | r | o | - | o | - | - | - | 5287 | | | | | | | | | | 5288 | Connection | | ad | o | o | o | o | o | o | 5289 | | | | | | | | | | 5290 | Connection-Crede | 470,4 | ar | o | o | o | o | o | o | 5291 | ntials | 07 | | | | | | | | 5292 | | | | | | | | | | 5293 | Content-Base | r | | o | - | - | - | - | - | 5294 | | | | | | | | | | 5295 | Content-Base | 4xx,5 | | o | o | o | o | o | o | 5296 | | xx | | | | | | | | 5297 | | | | | | | | | | 5298 | Content-Encoding | R | r | - | - | - | - | - | - | 5299 | | | | | | | | | | 5300 | Content-Encoding | r | r | o | - | - | - | - | - | 5301 | | | | | | | | | | 5302 | Content-Encoding | 4xx,5 | r | o | o | o | o | o | o | 5303 | | xx | | | | | | | | 5304 | | | | | | | | | | 5305 | Content-Language | R | r | - | - | - | - | - | - | 5306 | | | | | | | | | | 5307 | Content-Language | r | r | o | - | - | - | - | - | 5308 | | | | | | | | | | 5309 | Content-Language | 4xx,5 | r | o | o | o | o | o | o | 5310 | | xx | | | | | | | | 5311 | | | | | | | | | | 5312 | Content-Length | r | r | * | - | - | - | - | - | 5313 | | | | | | | | | | 5314 | Content-Length | 4xx,5 | r | * | * | * | * | * | * | 5315 | | xx | | | | | | | | 5316 | | | | | | | | | | 5317 | Content-Location | r | r | o | - | - | - | - | - | 5318 | | | | | | | | | | 5319 | Content-Location | 4xx,5 | r | o | o | o | o | o | o | 5320 | | xx | | | | | | | | 5321 | | | | | | | | | | 5322 | Content-Type | r | r | * | - | - | - | - | - | 5323 | | | | | | | | | | 5324 | Content-Type | 4xx,5 | ar | * | * | * | * | * | * | 5325 | | xx | | | | | | | | 5326 | | | | | | | | | | 5327 | CSeq | Rc | rm | m | m | m | m | m | m | 5328 | | | | | | | | | | 5329 | Date | | am | o/ | o/* | o/* | o/* | o/* | o/* | 5330 | | | | * | | | | | | 5331 | | | | | | | | | | 5332 | Expires | r | r | o | - | o | - | - | - | 5333 | | | | | | | | | | 5334 | From | R | r | o | o | o | o | o | o | 5335 | | | | | | | | | | 5336 | If-Match | R | r | - | - | o | - | - | - | 5337 | | | | | | | | | | 5338 | If-Modified-Sinc | R | r | o | - | o | - | - | - | 5339 | e | | | | | | | | | 5340 | | | | | | | | | | 5341 | If-None-Match | R | r | o | - | o | - | - | - | 5342 | | | | | | | | | | 5343 | Last-Modified | r | r | o | - | o | - | - | - | 5344 | | | | | | | | | | 5345 | Location | 3rr | | o | o | o | o | o | o | 5346 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 5348 Table 9: Overview of RTSP header fields (A-L) related to methods 5349 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 5351 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 5352 | Header | Where | Prox | DES | OPT | STP | PLY | PSE | TRD | 5353 | | | y | | | | | | | 5354 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 5355 | Media- | | | - | - | m | m | m | - | 5356 | Properties | | | | | | | | | 5357 | | | | | | | | | | 5358 | Media-Range | | | - | - | m | m | m | - | 5359 | | | | | | | | | | 5360 | MTag | r | r | o | - | o | - | - | - | 5361 | | | | | | | | | | 5362 | Pipelined-Requ | | amdr | - | o | o | o | o | o | 5363 | ests | | | | | | | | | 5364 | | | | | | | | | | 5365 | Proxy- | 407 | amr | m | m | m | m | m | m | 5366 | Authenticate | | | | | | | | | 5367 | | | | | | | | | | 5368 | Proxy- | R | rd | o | o | o | o | o | o | 5369 | Authorization | | | | | | | | | 5370 | | | | | | | | | | 5371 | Proxy- Require | R | ar | o | o | o | o | o | o | 5372 | | | | | | | | | | 5373 | Proxy- Require | r | r | c | c | c | c | c | c | 5374 | | | | | | | | | | 5375 | Proxy- | R | amr | c | c | c | c | c | c | 5376 | Supported | | | | | | | | | 5377 | Proxy- | r | | c | c | c | c | c | c | 5378 | Supported | | | | | | | | | 5379 | | | | | | | | | | 5380 | Public | r | amr | - | m | - | - | - | - | 5381 | | | | | | | | | | 5382 | Public | 501 | amr | m | m | m | m | m | m | 5383 | | | | | | | | | | 5384 | Range | R | | - | - | - | o | - | - | 5385 | | | | | | | | | | 5386 | Range | r | | - | - | c | m | m | - | 5387 | | | | | | | | | | 5388 | Referrer | R | | o | o | o | o | o | o | 5389 | | | | | | | | | | 5390 | Request- | R | | - | - | - | - | - | - | 5391 | Status | | | | | | | | | 5392 | | | | | | | | | | 5393 | Require | R | | o | o | o | o | o | o | 5394 | | | | | | | | | | 5395 | Retry-After | 3rr,5 | | o | o | o | o | o | - | 5396 | | 03 | | | | | | | | 5397 | | | | | | | | | | 5398 | Retry-After | 413 | | o | - | - | - | - | - | 5399 | | | | | | | | | | 5400 | RTP-Info | r | | - | - | c | c | - | - | 5401 | | | | | | | | | | 5402 | Scale | R | r | - | - | - | o | - | - | 5403 | | | | | | | | | | 5404 | Scale | r | amr | - | - | - | c | - | - | 5405 | | | | | | | | | | 5406 | Seek-Style | R | | - | - | - | o | - | - | 5407 | | | | | | | | | | 5408 | Seek-Style | r | | - | - | - | m | - | - | 5409 | | | | | | | | | | 5410 | Server | R | r | - | o | - | - | - | o | 5411 | | | | | | | | | | 5412 | Server | r | r | o | o | o | o | o | o | 5413 | | | | | | | | | | 5414 | Session | R | r | - | o | o | m | m | m | 5415 | | | | | | | | | | 5416 | Session | r | r | - | c | m | m | m | o | 5417 | | | | | | | | | | 5418 | Speed | R | admr | - | - | - | o | - | - | 5419 | | | | | | | | | | 5420 | Speed | r | admr | - | - | - | c | - | - | 5421 | | | | | | | | | | 5422 | Supported | R | amr | o | o | o | o | o | o | 5423 | | | | | | | | | | 5424 | Supported | r | amr | c | c | c | c | c | c | 5425 | Terminate-Reas | R | r | - | - | - | - | - | - | 5426 | on | | | | | | | | | 5427 | | | | | | | | | | 5428 | Timestamp | R | admr | o | o | o | o | o | o | 5429 | | | | | | | | | | 5430 | Timestamp | c | admr | m | m | m | m | m | m | 5431 | | | | | | | | | | 5432 | Transport | | mr | - | - | m | - | - | - | 5433 | | | | | | | | | | 5434 | Unsupported | r | | c | c | c | c | c | c | 5435 | | | | | | | | | | 5436 | User-Agent | R | | m* | m* | m* | m* | m* | m* | 5437 | | | | | | | | | | 5438 | Via | R | amr | o | o | o | o | o | o | 5439 | | | | | | | | | | 5440 | Via | c | dr | m | m | m | m | m | m | 5441 | | | | | | | | | | 5442 | WWW- | 401 | | m | m | m | m | m | m | 5443 | Authenticate | | | | | | | | | 5444 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 5446 Table 10: Overview of RTSP header fields (M-W) related to methods 5447 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 5449 +------------------------+---------+-------+-----+-----+-----+-----+ 5450 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 5451 +------------------------+---------+-------+-----+-----+-----+-----+ 5452 | Accept | R | arm | o | o | - | - | 5453 | | | | | | | | 5454 | Accept-Credentials | R | rm | o | o | o | - | 5455 | | | | | | | | 5456 | Accept-Encoding | R | r | o | o | o | - | 5457 | | | | | | | | 5458 | Accept-Language | R | r | o | o | o | - | 5459 | | | | | | | | 5460 | Accept-Ranges | | rm | o | - | - | - | 5461 | | | | | | | | 5462 | Allow | 405 | amr | m | m | m | - | 5463 | | | | | | | | 5464 | Authorization | R | | o | o | o | - | 5465 | | | | | | | | 5466 | Bandwidth | R | | - | o | - | - | 5467 | | | | | | | | 5468 | Blocksize | R | | - | o | - | - | 5469 | | | | | | | | 5470 | Cache-Control | | r | o | o | - | - | 5471 | | | | | | | | 5472 | Connection | | | o | o | o | o | 5473 | Connection-Credentials | 470,407 | ar | o | o | o | - | 5474 | | | | | | | | 5475 | Content-Base | R | | o | o | - | - | 5476 | | | | | | | | 5477 | Content-Base | r | | o | o | - | - | 5478 | | | | | | | | 5479 | Content-Base | 4xx,5xx | | o | o | o | o | 5480 | | | | | | | | 5481 | Content-Encoding | R | r | o | o | - | - | 5482 | | | | | | | | 5483 | Content-Encoding | r | r | o | o | - | - | 5484 | | | | | | | | 5485 | Content-Encoding | 4xx,5xx | r | o | o | o | o | 5486 | | | | | | | | 5487 | Content-Language | R | r | o | o | - | - | 5488 | | | | | | | | 5489 | Content-Language | r | r | o | o | - | - | 5490 | | | | | | | | 5491 | Content-Language | 4xx,5xx | r | o | o | o | o | 5492 | | | | | | | | 5493 | Content-Length | R | r | * | * | - | - | 5494 | | | | | | | | 5495 | Content-Length | r | r | * | * | - | - | 5496 | | | | | | | | 5497 | Content-Length | 4xx,5xx | r | * | * | * | * | 5498 | | | | | | | | 5499 | Content-Location | R | | o | o | - | - | 5500 | | | | | | | | 5501 | Content-Location | r | | o | o | - | - | 5502 | | | | | | | | 5503 | Content-Location | 4xx,5xx | | o | o | o | o | 5504 | | | | | | | | 5505 | Content-Type | R | | * | * | - | - | 5506 | | | | | | | | 5507 | Content-Type | r | | * | * | - | - | 5508 | | | | | | | | 5509 | Content-Type | 4xx,5xx | | * | * | * | * | 5510 | | | | | | | | 5511 | CSeq | R,c | mr | m | m | m | m | 5512 | | | | | | | | 5513 | Date | R | a | o | o | m | o | 5514 | | | | | | | | 5515 | Date | r | am | o | o | o | o | 5516 | | | | | | | | 5517 | Expires | r | r | - | - | - | - | 5518 | | | | | | | | 5519 | From | R | r | o | o | o | - | 5520 | | | | | | | | 5521 | If-Match | R | r | - | - | - | - | 5522 | | | | | | | | 5523 | If-Modified-Since | R | am | o | - | - | - | 5524 | | | | | | | | 5525 | If-None-Match | R | am | o | - | - | - | 5526 | | | | | | | | 5527 | Last-Modified | R | r | - | - | - | - | 5528 | | | | | | | | 5529 | Last-Modified | r | r | o | - | - | - | 5530 | | | | | | | | 5531 | Location | 3rr | | o | o | o | - | 5532 | | | | | | | | 5533 | Location | R | | - | - | m | - | 5534 | | | | | | | | 5535 | Media-Properties | R | amr | o | - | - | c | 5536 | | | | | | | | 5537 | Media-Properties | r | mr | c | - | - | - | 5538 | | | | | | | | 5539 | Media-Range | R | | o | - | - | c | 5540 | | | | | | | | 5541 | Media-Range | r | | c | - | - | - | 5542 | | | | | | | | 5543 | MTag | r | r | o | - | - | - | 5544 | | | | | | | | 5545 | Notify-Reason | R | | - | - | - | m | 5546 | | | | | | | | 5547 | Pipelined-Requests | R | amdr | o | o | - | - | 5548 | | | | | | | | 5549 | Proxy-Authenticate | 407 | amr | m | m | m | - | 5550 | | | | | | | | 5551 | Proxy-Authorization | R | rd | o | o | o | - | 5552 | | | | | | | | 5553 | Proxy-Require | R | ar | o | o | o | - | 5554 | | | | | | | | 5555 | Proxy-Require | r | r | c | c | c | - | 5556 | | | | | | | | 5557 | Proxy-Supported | R | amr | c | c | c | - | 5558 | | | | | | | | 5559 | Proxy-Supported | r | | c | c | c | - | 5560 | | | | | | | | 5561 | Public | 501 | admr | m | m | m | - | 5562 +------------------------+---------+-------+-----+-----+-----+-----+ 5564 Table 11: Overview of RTSP header fields (A-P) related to methods 5565 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5567 +------------------+---------+-------+-----+-----+-----+-----+ 5568 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 5569 +------------------+---------+-------+-----+-----+-----+-----+ 5570 | Range | R | | o | - | o | m | 5571 | | | | | | | | 5572 | Referrer | R | | o | o | o | - | 5573 | | | | | | | | 5574 | Request-Status | R | | - | - | - | c | 5575 | | | | | | | | 5576 | Require | R | r | o | o | o | - | 5577 | | | | | | | | 5578 | Retry-After | 3rr,503 | | o | o | - | - | 5579 | | | | | | | | 5580 | Retry-After | 413 | | o | o | - | - | 5581 | | | | | | | | 5582 | RTP-Info | R | r | o | - | - | C | 5583 | | | | | | | | 5584 | RTP-Info | r | r | c | - | - | - | 5585 | | | | | | | | 5586 | Scale | | | - | - | - | c | 5587 | | | | | | | | 5588 | Seek-Style | | | - | - | - | - | 5589 | | | | | | | | 5590 | Server | R | r | o | o | o | o | 5591 | | | | | | | | 5592 | Server | r | r | o | o | - | - | 5593 | | | | | | | | 5594 | Session | R | r | o | o | o | m | 5595 | | | | | | | | 5596 | Session | r | r | c | c | o | m | 5597 | | | | | | | | 5598 | Speed | | | - | - | - | - | 5599 | | | | | | | | 5600 | Supported | R | adrm | o | o | o | - | 5601 | | | | | | | | 5602 | Supported | r | adrm | c | c | c | - | 5603 | | | | | | | | 5604 | Terminate-Reason | R | r | - | - | m | - | 5605 | | | | | | | | 5606 | Timestamp | R | adrm | o | o | o | - | 5607 | | | | | | | | 5608 | Timestamp | c | adrm | m | m | m | - | 5609 | | | | | | | | 5610 | Transport | | mr | - | - | - | - | 5611 | | | | | | | | 5612 | Unsupported | r | arm | c | c | c | - | 5613 | | | | | | | | 5614 | User-Agent | R | r | m* | m* | - | - | 5615 | User-Agent | r | r | m* | m* | m* | m* | 5616 | | | | | | | | 5617 | Via | R | amr | o | o | o | - | 5618 | | | | | | | | 5619 | Via | c | dr | m | m | m | - | 5620 | | | | | | | | 5621 | WWW-Authenticate | 401 | | m | m | m | - | 5622 +------------------+---------+-------+-----+-----+-----+-----+ 5624 Table 12: Overview of RTSP header fields (R-W) related to methods 5625 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5627 18.1. Accept 5629 The Accept request-header field can be used to specify certain 5630 presentation description and parameter media types [RFC4288] which 5631 are acceptable for the response to DESCRIBE and GET_PARAMETER 5632 requests. 5634 See Section 20.2.3 for the syntax. 5636 Example of use: 5637 Accept: application/example ;q=1.0, application/sdp 5639 18.2. Accept-Credentials 5641 The Accept-Credentials header is a request header used to indicate to 5642 any trusted intermediary how to handle further secured connections to 5643 proxies or servers. See Section 19 for the usage of this header. It 5644 MUST NOT be included in server to client requests. 5646 In a request the header MUST contain the method (User, Proxy, or Any) 5647 for approving credentials selected by the requester. The method MUST 5648 NOT be changed by any proxy, unless it is "Proxy" when a proxy MAY 5649 change it to "user" to take the role of user approving each further 5650 hop. If the method is "User" the header contains zero or more of 5651 credentials that the client accepts. The header may contain zero 5652 credentials in the first RTSP request to a RTSP server when using the 5653 "User" method. This as the client has not yet received any 5654 credentials to accept. Each credential MUST consist of one URI 5655 identifying the proxy or server, the hash algorithm identifier, and 5656 the hash over that agent's DER encoded certificate [RFC5280] in 5657 Base64 [RFC4648]. All RTSP clients and proxies MUST implement the 5658 SHA-256[FIPS-pub-180-2] algorithm for computation of the hash of the 5659 DER encoded certificate. The SHA-256 algorithm is identified by the 5660 token "sha-256". 5662 The intention with allowing for other hash algorithms is to enable 5663 the future retirement of algorithms that are not implemented 5664 somewhere else than here. Thus the definition of future algorithms 5665 for this purpose is intended to be extremely limited. A feature tag 5666 can be used to ensure that support for the replacement algorithm 5667 exist. 5669 Example: 5670 Accept-Credentials:User 5671 "rtsps://proxy2.example.com/";sha-256;exaIl9VMbQMOFGClx5rXnPJKVNI=, 5672 "rtsps://server.example.com/";sha-256;lurbjj5khhB0NhIuOXtt4bBRH1M= 5674 18.3. Accept-Encoding 5676 The Accept-Encoding request-header field is similar to Accept, but 5677 restricts the content-codings (see Section 18.14),i.e. transformation 5678 codings of the message body, such as gzip compression, that are 5679 acceptable in the response. 5681 A server tests whether a content-coding is acceptable, according to 5682 an Accept-Encoding field, using these rules: 5684 1. If the content-coding is one of the content-codings listed in the 5685 Accept-Encoding field, then it is acceptable, unless it is 5686 accompanied by a qvalue of 0. (As defined in [H3.9], a qvalue of 5687 0 means "not acceptable.") 5689 2. The special "*" symbol in an Accept-Encoding field matches any 5690 available content-coding not explicitly listed in the header 5691 field. 5693 3. If multiple content-codings are acceptable, then the acceptable 5694 content-coding with the highest non-zero qvalue is preferred. 5696 4. The "identity" content-coding is always acceptable, i.e. no 5697 transformation at all, unless specifically refused because the 5698 Accept-Encoding field includes "identity;q=0", or because the 5699 field includes "*;q=0" and does not explicitly include the 5700 "identity" content-coding. If the Accept-Encoding field-value is 5701 empty, then only the "identity" encoding is acceptable. 5703 If an Accept-Encoding field is present in a request, and if the 5704 server cannot send a response which is acceptable according to the 5705 Accept-Encoding header, then the server SHOULD send an error response 5706 with the 406 (Not Acceptable) status code. 5708 If no Accept-Encoding field is present in a request, the server MAY 5709 assume that the client will accept any content coding. In this case, 5710 if "identity" is one of the available content-codings, then the 5711 server SHOULD use the "identity" content-coding, unless it has 5712 additional information that a different content-coding is meaningful 5713 to the client. 5715 18.4. Accept-Language 5717 The Accept-Language request-header field is similar to Accept, but 5718 restricts the set of natural languages that are preferred as a 5719 response to the request. Note that the language specified applies to 5720 the presentation description and any reason phrases, but not the 5721 media content. 5723 A language tag identifies a natural language spoken, written, or 5724 otherwise conveyed by human beings for communication of information 5725 to other human beings. Computer languages are explicitly excluded. 5726 The syntax and registry of RTSP 2.0 language tags is the same as that 5727 defined by [RFC5646]. 5729 Each language-range MAY be given an associated quality value which 5730 represents an estimate of the user's preference for the languages 5731 specified by that range. The quality value defaults to "q=1". For 5732 example: 5734 Accept-Language: da, en-gb;q=0.8, en;q=0.7 5736 would mean: "I prefer Danish, but will accept British English and 5737 other types of English." A language-range matches a language-tag if 5738 it exactly equals the full tag, or if it exactly equals a prefix of 5739 the tag, i.e., the primary-tag in the ABNF, such that the character 5740 following primary-tag is "-". The special range "*", if present in 5741 the Accept-Language field, matches every tag not matched by any other 5742 range present in the Accept-Language field. 5744 Note: This use of a prefix matching rule does not imply that 5745 language tags are assigned to languages in such a way that it is 5746 always true that if a user understands a language with a certain 5747 tag, then this user will also understand all languages with tags 5748 for which this tag is a prefix. The prefix rule simply allows the 5749 use of prefix tags if this is the case. 5751 In the process of selecting a language, each language-tag is assigned 5752 a qualification factor, i.e., if a language being supported by the 5753 client is actually supported by the server and what "preference" 5754 level the language achieves. The quality value (q-value) of the 5755 longest language-range in the field that matches the language-tag is 5756 assigned as the qualification factor for a particular language-tag. 5757 If no language-range in the field matches the tag, the language 5758 qualification factor assigned is 0. If no Accept-Language header is 5759 present in the request, the server SHOULD assume that all languages 5760 are equally acceptable. If an Accept-Language header is present, 5761 then all languages which are assigned a qualification factor greater 5762 than 0 are acceptable. 5764 18.5. Accept-Ranges 5766 The Accept-Ranges general-header field allows indication of the 5767 format supported in the Range header. The client MUST include the 5768 header in SETUP requests to indicate which formats it support to 5769 receive in PLAY and PAUSE responses, and REDIRECT requests. The 5770 server MUST include the header in SETUP and 456 error responses to 5771 indicate the formats supported for the resource indicated by the 5772 request URI. The header MAY be included in GET_PARAMETER request and 5773 response pairs. The GET_PARAMETER request MUST contain a Session 5774 header to identify the session context the request is related to. 5775 The requester and responder will indicate their capabilities 5776 regarding Range formats respectively. 5778 Accept-Ranges: NPT, SMPTE 5780 The syntax is defined in Section 20.2.3. 5782 18.6. Allow 5784 The Allow message-header field lists the methods supported by the 5785 resource identified by the Request-URI. The purpose of this field is 5786 to strictly inform the recipient of valid methods associated with the 5787 resource. An Allow header field MUST be present in a 405 (Method Not 5788 Allowed) response. The Allow header MUST also be present in all 5789 OPTIONS responses where the content of the header will not include 5790 exactly the same methods as listed in the Public header. 5792 The Allow MUST also be included in SETUP and DESCRIBE responses, if 5793 the methods allowed for the resource is different than the complete 5794 set of methods defined in this memo. 5796 Example of use: 5797 Allow: SETUP, PLAY, SET_PARAMETER, DESCRIBE 5799 18.7. Authorization 5801 An RTSP client that wishes to authenticate itself with a server using 5802 authentication mechanism from HTTP [RFC2617] , usually, but not 5803 necessarily, after receiving a 401 response, does so by including an 5804 Authorization request-header field with the request. The 5805 Authorization field value consists of credentials containing the 5806 authentication information of the user agent for the realm of the 5807 resource being requested. 5809 If a request is authenticated and a realm specified, the same 5810 credentials SHOULD be valid for all other requests within this realm 5811 (assuming that the authentication scheme itself does not require 5812 otherwise, such as credentials that vary according to a challenge 5813 value or using synchronized clocks). 5815 When a shared cache (see Section 16) receives a request containing an 5816 Authorization field, it MUST NOT return the corresponding response as 5817 a reply to any other request, unless one of the following specific 5818 exceptions holds: 5820 1. If the response includes the "max-age" cache-control directive, 5821 the cache MAY use that response in replying to a subsequent 5822 request. But (if the specified maximum age has passed) a proxy 5823 cache MUST first revalidate it with the origin server, using the 5824 request-headers from the new request to allow the origin server 5825 to authenticate the new request. (This is the defined behavior 5826 for max-age.) If the response includes "max-age=0", the proxy 5827 MUST always revalidate it before re-using it. 5829 2. If the response includes the "must-revalidate" cache-control 5830 directive, the cache MAY use that response in replying to a 5831 subsequent request. But if the response is stale, all caches 5832 MUST first revalidate it with the origin server, using the 5833 request-headers from the new request to allow the origin server 5834 to authenticate the new request. 5836 3. If the response includes the "public" cache-control directive, it 5837 MAY be returned in reply to any subsequent request. 5839 18.8. Bandwidth 5841 The Bandwidth request-header field describes the estimated bandwidth 5842 available to the client, expressed as a positive integer and measured 5843 in kilobits per second. The bandwidth available to the client may 5844 change during an RTSP session, e.g., due to mobility, congestion, 5845 etc. 5847 Clients may not be able to accurately determine the available 5848 bandwidth, for example due to that first hop is not a bottleneck. 5849 For example most local area networks (LAN) will not be a bottleneck 5850 if the server is not in the same LAN. Thus link speeds of WLAN or 5851 Ethernet networks are normally not a basis for estimating the 5852 available bandwidth. Cellular devices or other devices directly 5853 connected to a modem or connection enabling device may more 5854 accurately estimate the bottleneck bandwidth and what is reasonable 5855 share of it for RTSP controlled media. The client will also need to 5856 take into account other traffic sharing the bottleneck. For example 5857 by only assigning a certain fraction to RTSP and its media streams. 5858 It is RECOMMENDED that only clients that have accurate and explicit 5859 information about bandwidth bottlenecks uses this header. 5861 This header is not a substitute for proper congestion control. It is 5862 only a method providing an initial estimate and coarsely determines 5863 if the selected content can be delivered at all. 5865 Example: 5866 Bandwidth: 62360 5868 18.9. Blocksize 5870 The Blocksize request-header field is sent from the client to the 5871 media server asking the server for a particular media packet size. 5872 This packet size does not include lower-layer headers such as IP, 5873 UDP, or RTP. The server is free to use a blocksize which is lower 5874 than the one requested. The server MAY truncate this packet size to 5875 the closest multiple of the minimum, media-specific block size, or 5876 override it with the media-specific size if necessary. The block 5877 size MUST be a positive decimal number, measured in octets. The 5878 server only returns an error (4xx) if the value is syntactically 5879 invalid. 5881 18.10. Cache-Control 5883 The Cache-Control general-header field is used to specify directives 5884 that MUST be obeyed by all caching mechanisms along the request/ 5885 response chain. 5887 Cache directives MUST be passed through by a proxy or gateway 5888 application, regardless of their significance to that application, 5889 since the directives may be applicable to all recipients along the 5890 request/response chain. It is not possible to specify a cache- 5891 directive for a specific cache. 5893 Cache-Control should only be specified in a DESCRIBE, GET_PARAMETER, 5894 SET_PARAMETER and SETUP request and its response. Note: Cache- 5895 Control does not govern only the caching of responses as for HTTP, 5896 instead it also applies to the media stream identified by the SETUP 5897 request. The RTSP requests are generally not cacheable, for further 5898 information see Section 16. Below is the description of the cache 5899 directives that can be included in the Cache-Control header. 5901 no-cache: Indicates that the media stream MUST NOT be cached 5902 anywhere. This allows an origin server to prevent caching even 5903 by caches that have been configured to return stale responses 5904 to client requests. Note, there is no security function 5905 enforcing that the content can't be cached. 5907 public: Indicates that the media stream is cacheable by any cache. 5909 private: Indicates that the media stream is intended for a single 5910 user and MUST NOT be cached by a shared cache. A private (non- 5911 shared) cache may cache the media streams. 5913 no-transform: An intermediate cache (proxy) may find it useful to 5914 convert the media type of a certain stream. A proxy might, for 5915 example, convert between video formats to save cache space or 5916 to reduce the amount of traffic on a slow link. Serious 5917 operational problems may occur, however, when these 5918 transformations have been applied to streams intended for 5919 certain kinds of applications. For example, applications for 5920 medical imaging, scientific data analysis and those using end- 5921 to-end authentication all depend on receiving a stream that is 5922 bit-for-bit identical to the original media stream. Therefore, 5923 if a response includes the no-transform directive, an 5924 intermediate cache or proxy MUST NOT change the encoding of the 5925 stream. Unlike HTTP, RTSP does not provide for partial 5926 transformation at this point, e.g., allowing translation into a 5927 different language. 5929 only-if-cached: In some cases, such as times of extremely poor 5930 network connectivity, a client may want a cache to return only 5931 those media streams that it currently has stored, and not to 5932 receive these from the origin server. To do this, the client 5933 may include the only-if-cached directive in a request. If it 5934 receives this directive, a cache SHOULD either respond using a 5935 cached media stream that is consistent with the other 5936 constraints of the request, or respond with a 504 (Gateway 5937 Timeout) status. However, if a group of caches is being 5938 operated as a unified system with good internal connectivity, 5939 such a request MAY be forwarded within that group of caches. 5941 max-stale: Indicates that the client is willing to accept a media 5942 stream that has exceeded its expiration time. If max-stale is 5943 assigned a value, then the client is willing to accept a 5944 response that has exceeded its expiration time by no more than 5945 the specified number of seconds. If no value is assigned to 5946 max-stale, then the client is willing to accept a stale 5947 response of any age. 5949 min-fresh: Indicates that the client is willing to accept a media 5950 stream whose freshness lifetime is no less than its current age 5951 plus the specified time in seconds. That is, the client wants 5952 a response that will still be fresh for at least the specified 5953 number of seconds. 5955 must-revalidate: When the must-revalidate directive is present in a 5956 SETUP response received by a cache, that cache MUST NOT use the 5957 entry after it becomes stale to respond to a subsequent request 5958 without first revalidating it with the origin server. That is, 5959 the cache is required to do an end-to-end revalidation every 5960 time, if, based solely on the origin server's Expires, the 5961 cached response is stale. 5963 proxy-revalidate: The proxy-revalidate directive has the same 5964 meaning as the must-revalidate directive, except that it does 5965 not apply to non-shared user agent caches. It can be used on a 5966 response to an authenticated request to permit the user's cache 5967 to store and later return the response without needing to 5968 revalidate it (since it has already been authenticated once by 5969 that user), while still requiring proxies that service many 5970 users to revalidate each time (in order to make sure that each 5971 user has been authenticated). Note that such authenticated 5972 responses also need the public cache control directive in order 5973 to allow them to be cached at all. 5975 max-age: When an intermediate cache is forced, by means of a max- 5976 age=0 directive, to revalidate its own cache entry, and the 5977 client has supplied its own validator in the request, the 5978 supplied validator might differ from the validator currently 5979 stored with the cache entry. In this case, the cache MAY use 5980 either validator in making its own request without affecting 5981 semantic transparency. 5983 However, the choice of validator might affect performance. The best 5984 approach is for the intermediate cache to use its own validator when 5985 making its request. If the server replies with 304 (Not Modified), 5986 then the cache can return its now validated copy to the client with a 5987 200 (OK) response. If the server replies with a new message body and 5988 cache validator, however, the intermediate cache can compare the 5989 returned validator with the one provided in the client's request, 5990 using the strong comparison function. If the client's validator is 5991 equal to the origin server's, then the intermediate cache simply 5992 returns 304 (Not Modified). Otherwise, it returns the new message 5993 body with a 200 (OK) response. 5995 18.11. Connection 5997 The Connection general-header field allows the sender to specify 5998 options that are desired for that particular connection and MUST NOT 5999 be communicated by proxies over further connections. 6001 RTSP 2.0 proxies MUST parse the Connection header field before a 6002 message is forwarded and, for each connection-token in this field, 6003 remove any header field(s) from the message with the same name as the 6004 connection-token. Connection options are signaled by the presence of 6005 a connection-token in the Connection header field, not by any 6006 corresponding additional header field(s), since the additional header 6007 field may not be sent if there are no parameters associated with that 6008 connection option. 6010 Message headers listed in the Connection header MUST NOT include end- 6011 to-end headers, such as Cache-Control. 6013 RTSP 2.0 defines the "close" connection option for the sender to 6014 signal that the connection will be closed after completion of the 6015 response. For example, Connection: close in either the request or 6016 the response header fields indicates that the connection SHOULD NOT 6017 be considered `persistent' (Section 10.2) after the current request/ 6018 response is complete. 6020 The use of the connection option "close" in RTSP messages SHOULD be 6021 limited to error messages when the server is unable to recover and 6022 therefore see it necessary to close the connection. The reason is 6023 that the client has the choice of continuing using a connection 6024 indefinitely, as long as it sends valid messages. 6026 18.12. Connection-Credentials 6028 The Connection-Credentials response header is used to carry the chain 6029 of credentials of any next hop that need to be approved by the 6030 requester. It MUST only be used in server to client responses. 6032 The Connection-Credentials header in an RTSP response MUST, if 6033 included, contain the credential information (in form of a list of 6034 certificates providing the chain of certification) of the next hop 6035 that an intermediary needs to securely connect to. The header MUST 6036 include the URI of the next hop (proxy or server) and a base64 6037 [RFC4648] encoded binary structure containing a sequence of DER 6038 encoded X.509v3 certificates[RFC5280] . 6040 The binary structure starts with the number of certificates 6041 (NR_CERTS) included as a 16 bit unsigned integer. This is followed 6042 by NR_CERTS number of 16 bit unsigned integers providing the size in 6043 octets of each DER encoded certificate. This is followed by NR_CERTS 6044 number of DER encoded X.509v3 certificates in a sequence (chain). 6045 The proxy or server's certificate must come first in the structure. 6046 Each following certificate must directly certify the one preceding 6047 it. Because certificate validation requires that root keys be 6048 distributed independently, the self-signed certificate which 6049 specifies the root certificate authority may optionally be omitted 6050 from the chain, under the assumption that the remote end must already 6051 possess it in order to validate it in any case. 6053 Example: 6055 Connection-Credentials:"rtsps://proxy2.example.com/";MIIDNTCC... 6057 Where MIIDNTCC... is a BASE64 encoding of the following structure: 6059 0 1 2 3 6060 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 6061 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6062 | Number of certificates | Size of certificate #1 | 6063 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6064 | Size of certificate #2 | Size of certificate #3 | 6065 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6066 : DER Encoding of Certificate #1 : 6067 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6068 : DER Encoding of Certificate #2 : 6069 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6070 : DER Encoding of Certificate #3 : 6071 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6073 18.13. Content-Base 6075 The Content-Base message-header field may be used to specify the base 6076 URI for resolving relative URIs within the message body. 6078 Content-Base: rtsp://media.example.com/movie/twister/ 6080 If no Content-Base field is present, the base URI of an message body 6081 is defined either by its Content-Location (if that Content-Location 6082 URI is an absolute URI) or the URI used to initiate the request, in 6083 that order of precedence. Note, however, that the base URI of the 6084 contents within the message-body may be redefined within that 6085 message-body. 6087 18.14. Content-Encoding 6089 The Content-Encoding header field is used as a modifier to the media- 6090 type. When present, its value indicates what additional content 6091 codings have been applied to the message body, and thus what decoding 6092 mechanisms must be applied in order to obtain the media-type 6093 referenced by the Content-Type header field. Content-Encoding is 6094 primarily used to allow a document to be compressed without losing 6095 the identity of its underlying media type. 6097 The content-coding is a characteristic of the message body identified 6098 by the Request-URI. Typically, the message body is stored with this 6099 encoding and is only decoded before rendering or analogous usage. 6100 However, a non-transparent proxy MAY modify the content-coding if the 6101 new coding is known to be acceptable to the recipient, unless the 6102 "no-transform" cache-control directive is present in the message. 6104 If the content-coding of a message body is not "identity", then the 6105 response MUST include a Content-Encoding Message-body header that 6106 lists the non-identity content-coding(s) used. 6108 If the content-coding of a message body in a request message is not 6109 acceptable to the origin server, the server SHOULD respond with a 6110 status code of 415 (Unsupported Media Type). 6112 If multiple encodings have been applied to a message body, the 6113 content codings MUST be listed in the order in which they were 6114 applied, first to last from left to right. Additional information 6115 about the encoding parameters MAY be provided by other header fields 6116 not defined by this specification. 6118 18.15. Content-Language 6120 The Content-Language header field describes the natural language(s) 6121 of the intended audience for the enclosed message body. Note that 6122 this might not be equivalent to all the languages used within the 6123 message body. 6125 Language tags are mentioned in Section 18.4. The primary purpose of 6126 Content-Language is to allow a user to identify and differentiate 6127 entities according to the user's own preferred language. Thus, if 6128 the body content is intended only for a Danish-literate audience, the 6129 appropriate field is 6131 Content-Language: da 6133 If no Content-Language is specified, the default is that the content 6134 is intended for all language audiences. This might mean that the 6135 sender does not consider it to be specific to any natural language, 6136 or that the sender does not know for which language it is intended. 6138 Multiple languages MAY be listed for content that is intended for 6139 multiple audiences. For example, a rendition of the "Treaty of 6140 Waitangi," presented simultaneously in the original Maori and English 6141 versions, would call for 6143 Content-Language: mi, en 6145 However, just because multiple languages are present within a message 6146 body does not mean that it is intended for multiple linguistic 6147 audiences. An example would be a beginner's language primer, such as 6148 "A First Lesson in Latin," which is clearly intended to be used by an 6149 English-literate audience. In this case, the Content-Language would 6150 properly only include "en". 6152 Content-Language MAY be applied to any media type -- it is not 6153 limited to textual documents. 6155 18.16. Content-Length 6157 The Content-Length general-header field contains the length of the 6158 message body of the RTSP message (i.e. after the double CRLF 6159 following the last header). Unlike HTTP, it MUST be included in all 6160 messages that carry a message body beyond the header portion of the 6161 RTSP message. If it is missing, a default value of zero is assumed. 6162 Any Content-Length greater than or equal to zero is a valid value. 6164 18.17. Content-Location 6166 The Content-Location header field MAY be used to supply the resource 6167 location for the message body enclosed in the message when that body 6168 is accessible from a location separate from the requested resource's 6169 URI. A server SHOULD provide a Content-Location for the variant 6170 corresponding to the response message body; especially in the case 6171 where a resource has multiple variants associated with it, and those 6172 entities actually have separate locations by which they might be 6173 individually accessed, the server SHOULD provide a Content-Location 6174 for the particular variant which is returned. 6176 As example, if an RTSP client performs a DESCRIBE request on a given 6177 resource, e.g., "rtsp://a.example.com/movie/Plan9FromOuterSpace", 6178 then the server may use additional information, such as the User- 6179 Agent header, to determine the capabilities of the agent. The server 6180 will then return a media description tailored to that class of RTSP 6181 agents. To indicate which specific description the agent receives 6182 the resource identifier 6183 ("rtsp://a.example.com/movie/Plan9FromOuterSpace/FullHD.sdp") is 6184 provided in Content-Location, while the description is still a valid 6185 response for the generic resource identifier. Thus enabling both 6186 debugging and cache operation as discussed below. 6188 The Content-Location value is not a replacement for the original 6189 requested URI; it is only a statement of the location of the resource 6190 corresponding to this particular variant at the time of the request. 6191 Future requests MAY specify the Content-Location URI as the request 6192 URI if the desire is to identify the source of that particular 6193 variant. This is useful if the RTSP agent desires to verify if the 6194 resource variant is current through a conditional request. 6196 A cache cannot assume that a message body with a Content-Location 6197 different from the URI used to retrieve it can be used to respond to 6198 later requests on that Content-Location URI. However, the Content- 6199 Location can be used to differentiate between multiple variants 6200 retrieved from a single requested resource. 6202 If the Content-Location is a relative URI, the relative URI is 6203 interpreted relative to the Request-URI. 6205 Note, that Content-Location can be used in some cases to derive the 6206 base-URI for relative URI present in session description formats. 6207 This needs to be taken into account when Content-Location is used. 6208 The easiest way to avoid needing to consider that issue is to include 6209 the Content-Base whenever the Content-Location is included. 6211 Note also, when using Media Tags in conjunction with Content-Location 6212 it is important that the different versions have different MTags, 6213 even if provided under different Content-Location URIs. This as they 6214 have still been provided under the same request URI. 6216 Note also, as in most cases the URI used in the DESCRIBE and the 6217 SETUP requests are different, the URI provided in a DESCRIBE Content- 6218 Location response can't directly be used in a SETUP request. Instead 6219 the extra step of resolving URIs combined with the media descriptions 6220 indication, like with SDP's a=control attribute. 6222 18.18. Content-Type 6224 The Content-Type header indicates the media type of the message body 6225 sent to the recipient. Note that the content types suitable for RTSP 6226 are likely to be restricted in practice to presentation descriptions 6227 and parameter-value types. 6229 18.19. CSeq 6231 The CSeq general-header field specifies the sequence number for an 6232 RTSP request-response pair. This field MUST be present in all 6233 requests and responses. For every RTSP request containing the given 6234 sequence number, the corresponding response will have the same 6235 number. Any retransmitted request MUST contain the same sequence 6236 number as the original (i.e., the sequence number is not incremented 6237 for retransmissions of the same request). For each new RTSP request 6238 the CSeq value MUST be incremented by one. The initial sequence 6239 number MAY be any number, however, it is RECOMMENDED to start at 0. 6240 Each sequence number series is unique between each requester and 6241 responder, i.e., the client has one series for its request to a 6242 server and the server has another when sending request to the client. 6243 Each requester and responder is identified with its socket address 6244 (IP address and port number). 6246 Proxies that aggregate several sessions on the same transport will 6247 have to ensure that the requests sent towards a particular server 6248 have a joint sequence number space, i.e., they will regularly need to 6249 renumber the CSeq header field in requests (from proxy to server) and 6250 responses (from server to proxy) to fulfill the rules for the header. 6251 The proxy MUST increase the CSeq by one for each request it 6252 transmits, without regard of different sessions. 6254 Example: 6255 CSeq: 239 6257 18.20. Date 6259 The Date header field represents the date and time at which the 6260 message was originated. The inclusion of the Date header in RTSP 6261 message follows these rules: 6263 o An RTSP message, sent either by the client or the server, 6264 containing a body MUST include a Date header, if the sending host 6265 has a clock; 6267 o Clients and servers are RECOMMENDED to include a Date header in 6268 all other RTSP messages, if the sending host has a clock; 6270 o If the server does not have a clock that can provide a reasonable 6271 approximation of the current time, its responses MUST NOT include 6272 a Date header field. In this case, this rule MUST be followed: 6273 Some origin server implementations might not have a clock 6274 available. An origin server without a clock MUST NOT assign 6275 Expires or Last-Modified values to a response, unless these values 6276 were associated with the resource by a system or user with a 6277 reliable clock. It MAY assign an Expires value that is known, at 6278 or before server configuration time, to be in the past (this 6279 allows "pre-expiration" of responses without storing separate 6280 Expires values for each resource). 6282 A received message that does not have a Date header field MUST be 6283 assigned one by the recipient if the message will be cached by that 6284 recipient. An RTSP implementation without a clock MUST NOT cache 6285 responses without revalidating them on every use. An RTSP cache, 6286 especially a shared cache, SHOULD use a mechanism, such as NTP, to 6287 synchronize its clock with a reliable external standard. 6289 The RTSP-date sent in a Date header SHOULD NOT represent a date and 6290 time subsequent to the generation of the message. It SHOULD 6291 represent the best available approximation of the date and time of 6292 message generation, unless the implementation has no means of 6293 generating a reasonably accurate date and time. In theory, the date 6294 ought to represent the moment just before the message body is 6295 generated. In practice, the date can be generated at any time during 6296 the message origination without affecting its semantic value. 6298 18.21. Expires 6300 The Expires message-header field gives a date and time after which 6301 the description or media-stream should be considered stale. The 6302 interpretation depends on the method: 6304 DESCRIBE response: The Expires header indicates a date and time 6305 after which the presentation description (body) SHOULD be 6306 considered stale. 6308 SETUP response: The Expires header indicate a date and time after 6309 which the media stream SHOULD be considered stale. 6311 A stale cache entry may not normally be returned by a cache (either a 6312 proxy cache or an user agent cache) unless it is first validated with 6313 the origin server (or with an intermediate cache that has a fresh 6314 copy of the message body). See Section 16 for further discussion of 6315 the expiration model. 6317 The presence of an Expires field does not imply that the original 6318 resource will change or cease to exist at, before, or after that 6319 time. 6321 The format is an absolute date and time as defined by RTSP-date. An 6322 example of its use is 6323 Expires: Thu, 01 Dec 1994 16:00:00 GMT 6325 RTSP/2.0 clients and caches MUST treat other invalid date formats, 6326 especially including the value "0", as having occurred in the past 6327 (i.e., already expired). 6329 To mark a response as "already expired," an origin server should use 6330 an Expires date that is equal to the Date header value. To mark a 6331 response as "never expires," an origin server SHOULD use an Expires 6332 date approximately one year from the time the response is sent. 6333 RTSP/2.0 servers SHOULD NOT send Expires dates more than one year in 6334 the future. 6336 18.22. From 6338 The From request-header field, if given, SHOULD contain an Internet 6339 e-mail address for the human user who controls the requesting user 6340 agent. The address SHOULD be machine-usable, as defined by "mailbox" 6341 in [RFC1123]. 6343 This header field MAY be used for logging purposes and as a means for 6344 identifying the source of invalid or unwanted requests. It SHOULD 6345 NOT be used as an insecure form of access protection. The 6346 interpretation of this field is that the request is being performed 6347 on behalf of the person given, who accepts responsibility for the 6348 method performed. In particular, robot agents SHOULD include this 6349 header so that the person responsible for running the robot can be 6350 contacted if problems occur on the receiving end. 6352 The Internet e-mail address in this field MAY be separate from the 6353 Internet host which issued the request. For example, when a request 6354 is passed through a proxy the original issuer's address SHOULD be 6355 used. 6357 The client SHOULD NOT send the From header field without the user's 6358 approval, as it might conflict with the user's privacy interests or 6359 their site's security policy. It is strongly recommended that the 6360 user be able to disable, enable, and modify the value of this field 6361 at any time prior to a request. 6363 18.23. If-Match 6365 The If-Match request-header field is especially useful for ensuring 6366 the integrity of the presentation description, independent of how the 6367 presentation description was received. The presentation description 6368 can be fetched via means external to RTSP (such as HTTP) or via the 6369 DESCRIBE message. In the case of retrieving the presentation 6370 description via RTSP, the server implementation is guaranteeing the 6371 integrity of the description between the time of the DESCRIBE message 6372 and the SETUP message. By including the MTag given in or with the 6373 session description in an If-Match header part of the SETUP request, 6374 the client ensures that resources set up are matching the 6375 description. A SETUP request with the If-Match header for which the 6376 MTag validation check fails, MUST generate a response using 412 6377 (Precondition Failed). 6379 This validation check is also very useful if a session has been 6380 redirected from one server to another. 6382 18.24. If-Modified-Since 6384 The If-Modified-Since request-header field is used with the DESCRIBE 6385 and SETUP methods to make them conditional. If the requested variant 6386 has not been modified since the time specified in this field, a 6387 description will not be returned from the server (DESCRIBE) or a 6388 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 6389 response MUST be returned without any message-body. 6391 An example of the field is: 6392 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 6394 18.25. If-None-Match 6396 This request header can be used with one or several message body tags 6397 to make DESCRIBE requests conditional. A client that has one or more 6398 message bodies previously obtained from the resource, can verify that 6399 none of those entities is current by including a list of their 6400 associated message body tags in the If-None-Match header field. The 6401 purpose of this feature is to allow efficient updates of cached 6402 information with a minimum amount of transaction overhead. As a 6403 special case, the value "*" matches any current entity of the 6404 resource. 6406 If any of the message body tags match the message body tag of the 6407 message body that would have been returned in the response to a 6408 similar DESCRIBE request (without the If-None-Match header) on that 6409 resource, or if "*" is given and any current entity exists for that 6410 resource, then the server MUST NOT perform the requested method, 6411 unless required to do so because the resource's modification date 6412 fails to match that supplied in an If-Modified-Since header field in 6413 the request. Instead, if the request method was DESCRIBE, the server 6414 SHOULD respond with a 304 (Not Modified) response, including the 6415 cache-related header fields (particularly MTag) of one of the message 6416 bodies that matched. For all other request methods, the server MUST 6417 respond with a status of 412 (Precondition Failed). 6419 See Section 16.1.3 for rules on how to determine if two message body 6420 tags match. 6422 If none of the message body tags match, then the server MAY perform 6423 the requested method as if the If-None-Match header field did not 6424 exist, but MUST also ignore any If-Modified-Since header field(s) in 6425 the request. That is, if no message body tags match, then the server 6426 MUST NOT return a 304 (Not Modified) response. 6428 If the request would, without the If-None-Match header field, result 6429 in anything other than a 2xx or 304 status, then the If-None-Match 6430 header MUST be ignored. (See Section 16.1.4 for a discussion of 6431 server behavior when both If-Modified-Since and If-None-Match appear 6432 in the same request.) 6434 The result of a request having both an If-None-Match header field and 6435 an If-Match header field is unspecified and MUST be considered an 6436 illegal request. 6438 18.26. Last-Modified 6440 The Last-Modified message-header field indicates the date and time at 6441 which the origin server believes the presentation description or 6442 media stream was last modified. For the method DESCRIBE, the header 6443 field indicates the last modification date and time of the 6444 description, for SETUP that of the media stream. 6446 An origin server MUST NOT send a Last-Modified date which is later 6447 than the server's time of message origination. In such cases, where 6448 the resource's last modification would indicate some time in the 6449 future, the server MUST replace that date with the message 6450 origination date. 6452 An origin server SHOULD obtain the Last-Modified value of the message 6453 body as close as possible to the time that it generates the Date 6454 value of its response. This allows a recipient to make an accurate 6455 assessment of the message body's modification time, especially if the 6456 message body changes near the time that the response is generated. 6458 RTSP servers SHOULD send Last-Modified whenever feasible. 6460 18.27. Location 6462 The Location response-header field is used to redirect the recipient 6463 to a location other than the Request-URI for completion of the 6464 request or identification of a new resource. For 3xx responses, the 6465 location SHOULD indicate the server's preferred URI for automatic 6466 redirection to the resource. The field value consists of a single 6467 absolute URI. 6469 Note: The Content-Location header field (Section 18.17) differs from 6470 Location in that the Content-Location identifies the original 6471 location of the message body enclosed in the request. It is 6472 therefore possible for a response to contain header fields for both 6473 Location and Content-Location. Also, see Section 16.2 for cache 6474 requirements of some methods. 6476 18.28. Media-Properties 6478 This general header is used in SETUP response or PLAY_NOTIFY requests 6479 to indicate the media's properties that currently are applicable to 6480 the RTSP session. PLAY_NOTIFY MAY be used to modify these properties 6481 at any point. However, the client SHOULD have received the update 6482 prior to any action related to the new media properties take effect. 6483 For aggregated sessions, the Media-Properties header will be returned 6484 in each SETUP response. The header received in the latest response 6485 is the one that applies on the whole session from this point until 6486 any future update. The header MAY be included without value in 6487 GET_PARAMETER requests to the server with a Session header included 6488 to query the current Media-Properties for the session. The responder 6489 MUST include the current session's media properties. 6491 The media properties expressed by this header is the one applicable 6492 to all media in the RTSP session. For aggregated sessions, the 6493 header expressed the combined media-properties. As a result, 6494 aggregation of media MAY result in a change of the media properties, 6495 and thus the content of the Media-Properties header contained in 6496 subsequent SETUP responses. 6498 The header contains a list of property values that are applicable to 6499 the currently setup media or aggregate of media as indicated by the 6500 RTSP URI in the request. No ordering is enforced within the header. 6501 Property values should be grouped into a single group that handles a 6502 particular orthogonal property. Values or groups that express 6503 multiple properties SHOULD NOT be used. The list of properties that 6504 can be expressed MAY be extended at any time. Unknown property 6505 values MUST be ignored. 6507 This specification defines the following 4 groups and their property 6508 values: 6510 Random Access: 6512 Random-Access: Indicates that random access is possible. May 6513 optionally include a floating point value in seconds indicating 6514 the longest duration between any two random access points in 6515 the media. 6517 Begining-Only: Seeking is limited to the beginning only. 6519 No-Seeking: No seeking is possible. 6521 Content Modifications: 6523 Immutable: The content will not be changed during the life-time 6524 of the RTSP session. 6526 Dynamic: The content may be changed based on external methods or 6527 triggers 6529 Time-Progressing The media accessible progresses as wallclock 6530 time progresses. 6532 Retention: 6534 Unlimited: Content will be retained for the duration of the life- 6535 time of the RTSP session. 6537 Time-Limited: Content will be retained at least until the 6538 specified wallclock time. The time must be provided in the 6539 absolute time format specified in Section 4.6. 6541 Time-Duration Each individual media unit is retained for at least 6542 the specified time duration. This definition allows for 6543 retaining data with a time based sliding window. The time 6544 duration is expressed as floating point number in seconds. 0.0 6545 is a valid value as this indicates that no data is retained in 6546 a time-progressing session. 6548 Supported Scale: 6550 Scales: A quoted comma separated list of one or more decimal 6551 values or ranges of scale values supported by the content in 6552 arbitrary order. A range has a start and stop value separated 6553 by a colon. A range indicates that the content supports fine 6554 grained selection of scale values. Fine grained allows for 6555 steps at least as small as one tenth of a scale value. A 6556 content is considered to support fine grained selection when 6557 the server in response to a given scale value can produce 6558 content with an actual scale that is less than 1 tenth of scale 6559 unit, i.e., 0.1, from the requested value. Negative values are 6560 supported. The value 0 has no meaning and MUST NOT be used. 6562 Examples of this header for on-demand content and a live stream 6563 without recording are: 6565 On-demand: 6566 Media-Properties: Random-Access=2.5s, Unlimited, Immutable, 6567 Scales="-20, -10, -4, 0.5:1.5, 4, 8, 10, 15, 20" 6569 Live stream without recording/timeshifting: 6570 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0.0 6572 18.29. Media-Range 6574 The Media-Range general header is used to give the range of the media 6575 at the time of sending the RTSP message. This header MUST be 6576 included in SETUP response, and PLAY and PAUSE response for media 6577 that are Time-Progressing, and PLAY and PAUSE response after any 6578 change for media that are Dynamic, and in PLAY_NOTIFY request that 6579 are sent due to Media-Property-Update. Media-Range header without 6580 any range specifications MAY be included in GET_PARAMETER requests to 6581 the server to request the current range. The server MUST in this 6582 case include the current range at the time of sending the response. 6584 The header MUST include range specifications for all time formats 6585 supported for the media, as indicated in Accept-Ranges header 6586 (Section 18.5) when setting up the media. The server MAY include 6587 more than one range specification of any given time format to 6588 indicate media that has non-continuous range. 6590 For media that has the Time-Progressing property, the Media-Range 6591 values will only be valid for the particular point in time when it 6592 was issued. As wallclock progresses so will also the media range. 6593 However, it shall be assumed that media time progresses in direct 6594 relationship to wallclock time (with the exception of clock skew) so 6595 that a reasonably accurate estimation of the media range can be 6596 calculated. 6598 18.30. MTag 6600 The MTag response header MAY be included in DESCRIBE, GET_PARAMETER 6601 or SETUP responses. The message body tags (Section 4.8) returned in 6602 a DESCRIBE response, and the one in SETUP refers to the presentation, 6603 i.e. both the returned session description and the media stream. 6604 This allows for verification that one has the right session 6605 description to a media resource at the time of the SETUP request. 6606 However, it has the disadvantage that a change in any of the parts 6607 results in invalidation of all the parts. 6609 If the MTag is provided both inside the message body, e.g. within the 6610 "a=mtag" attribute in SDP, and in the response message, then both 6611 tags MUST be identical. It is RECOMMENDED that the MTag is primarily 6612 given in the RTSP response message, to ensure that caches can use the 6613 MTag without requiring content inspection. However, for session 6614 descriptions that are distributed outside of RTSP, for example using 6615 HTTP, etc. it will be necessary to include the message body tag in 6616 the session description as specified in Appendix D.1.9. 6618 SETUP and DESCRIBE requests can be made conditional upon the MTag 6619 using the headers If-Match (Section 18.23) and If-None-Match ( 6620 Section 18.25). 6622 18.31. Notify-Reason 6624 The Notify Reason header is solely used in the PLAY_NOTIFY method. 6625 It indicates the reason why the server has sent the asynchronous 6626 PLAY_NOTIFY request (see Section 13.5). 6628 18.32. Pipelined-Requests 6630 The Pipelined-Requests general header is used to indicate that a 6631 request is to be executed in the context created by a previous 6632 request(s). The primary usage of this header is to allow pipelining 6633 of SETUP requests so that any additional SETUP request after the 6634 first one does not need to wait for the session ID to be sent back to 6635 the requesting agent. The header contains a unique identifier that 6636 is scoped by the persistent connection used to send the requests. 6638 Upon receiving a request with the Pipelined-Requests the responding 6639 agent MUST look up if there exists a binding between this Pipelined- 6640 Requests identifier for the current persistent connection and an RTSP 6641 session ID. If that exists then the received request is processed 6642 the same way as if it contained the Session header with the found 6643 session ID. If there does not exist a mapping and no Session header 6644 is included in the request, the responding agent MUST create a 6645 binding upon the successful completion of a session creating request, 6646 i.e. SETUP. A binding MUST NOT be created, if the request failed to 6647 create an RTSP session. In case the request contains both a Session 6648 header and the Pipelined-Requests header the Pipelined-Requests MUST 6649 be ignored. 6651 Note: Based on the above definition at least the first request 6652 containing a new unique Pipelined-Requests will be required to be a 6653 SETUP request (unless the protocol is extended with new methods of 6654 creating a session). After that first one, additional SETUP requests 6655 or request of any type using the RTSP session context may include the 6656 Pipelined-Requests header. 6658 When responding to any request that contained the Pipelined-Requests 6659 header the server MUST also include the Session header when a binding 6660 to a session context exist. An RTSP agent that knows the session ID 6661 SHOULD NOT use the Pipelined-Requests header in any request and only 6662 use the Session header. This as the Session identifier is persistent 6663 across transport contexts, like TCP connections, which the Pipelined- 6664 Requests identifier is not. 6666 The RTSP agent sending the request with a Pipelined-Requests header 6667 has the responsibility for using a unique and previously unused 6668 identifier within the transport context. Currently only a TCP 6669 connection is defined as such transport context. A server MUST 6670 delete the Pipelined-Requests identifier and its binding to a session 6671 upon the termination of that session. Despite the previous mandate, 6672 RTSP agents are RECOMMENDED to not reuse identifiers to allow for 6673 better error handling and logging. 6675 RTSP Proxies may need to translate Pipelined-Requests identifier 6676 values from incoming requests to outgoing to allow for aggregation of 6677 requests onto a persistent connection. 6679 18.33. Proxy-Authenticate 6681 The Proxy-Authenticate response-header field MUST be included as part 6682 of a 407 (Proxy Authentication Required) response. The field value 6683 consists of a challenge that indicates the authentication scheme and 6684 parameters applicable to the proxy for this Request-URI. 6686 The HTTP access authentication process is described in [RFC2617]. 6687 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 6688 only to the current connection and SHOULD NOT be passed on to 6689 downstream agents. However, an intermediate proxy might need to 6690 obtain its own credentials by requesting them from the downstream 6691 agent, which in some circumstances will appear as if the proxy is 6692 forwarding the Proxy-Authenticate header field. 6694 18.34. Proxy-Authorization 6696 The Proxy-Authorization request-header field allows the client to 6697 identify itself (or its user) to a proxy which requires 6698 authentication. The Proxy-Authorization field value consists of 6699 credentials containing the authentication information of the user 6700 agent for the proxy and/or realm of the resource being requested. 6702 The HTTP access authentication process is described in [RFC2617]. 6703 Unlike Authorization, the Proxy-Authorization header field applies 6704 only to the next outbound proxy that demanded authentication using 6705 the Proxy-Authenticate field. When multiple proxies are used in a 6706 chain, the Proxy-Authorization header field is consumed by the first 6707 outbound proxy that was expecting to receive credentials. A proxy 6708 MAY relay the credentials from the client request to the next proxy 6709 if that is the mechanism by which the proxies cooperatively 6710 authenticate a given request. 6712 18.35. Proxy-Require 6714 The Proxy-Require request-header field is used to indicate proxy- 6715 sensitive features that MUST be supported by the proxy. Any Proxy- 6716 Require header features that are not supported by the proxy MUST be 6717 negatively acknowledged by the proxy to the client using the 6718 Unsupported header. The proxy MUST use the 551 (Option Not 6719 Supported) status code in the response. Any feature-tag included in 6720 the Proxy-Require does not apply to the end-point (server or client). 6721 To ensure that a feature is supported by both proxies and servers the 6722 tag needs to be included in also a Require header. 6724 See Section 18.41 for more details on the mechanics of this message 6725 and a usage example. See discussion in the proxies section 6726 (Section 15.1) about when to consider that a feature requires proxy 6727 support. 6729 Example of use: 6730 Proxy-Require: play.basic 6732 18.36. Proxy-Supported 6734 The Proxy-Supported header field enumerates all the extensions 6735 supported by the proxy using feature-tags. The header carries the 6736 intersection of extensions supported by the forwarding proxies. The 6737 Proxy-Supported header MAY be included in any request by a proxy. It 6738 MUST be added by any proxy if the Supported header is present in a 6739 request. When present in a request, the receiver MUST in the 6740 response copy the received Proxy-Supported header. 6742 The Proxy-Supported header field contains a list of feature-tags 6743 applicable to proxies, as described in Section 4.7. The list is the 6744 intersection of all feature-tags understood by the proxies. To 6745 achieve an intersection, the proxy adding the Proxy-Supported header 6746 includes all proxy feature-tags it understands. Any proxy receiving 6747 a request with the header, MUST check the list and removes any 6748 feature-tag(s) it does not support. A Proxy-Supported header present 6749 in the response MUST NOT be touched by the proxies. 6751 Example: 6753 C->P1: OPTIONS rtsp://example.com/ RTSP/2.0 6754 Supported: foo, bar, blech 6755 User-Agent: PhonyClient/1.2 6757 P1->P2: OPTIONS rtsp://example.com/ RTSP/2.0 6758 Supported: foo, bar, blech 6759 Proxy-Supported: proxy-foo, proxy-bar, proxy-blech 6760 Via: 2.0 pro.example.com 6762 P2->S: OPTIONS rtsp://example.com/ RTSP/2.0 6763 Supported: foo, bar, blech 6764 Proxy-Supported: proxy-foo, proxy-blech 6765 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6767 S->C: RTSP/2.0 200 OK 6768 Supported: foo, bar, baz 6769 Proxy-Supported: proxy-foo, proxy-blech 6770 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6771 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6773 18.37. Public 6775 The Public response header field lists the set of methods supported 6776 by the response sender. This header applies to the general 6777 capabilities of the sender and its only purpose is to indicate the 6778 sender's capabilities to the recipient. The methods listed may or 6779 may not be applicable to the Request-URI; the Allow header field 6780 (Section 18.6) MAY be used to indicate methods allowed for a 6781 particular URI. 6783 Example of use: 6784 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6786 In the event that there are proxies between the sender and the 6787 recipient of a response, each intervening proxy MUST modify the 6788 Public header field to remove any methods that are not supported via 6789 that proxy. The resulting Public header field will contain an 6790 intersection of the sender's methods and the methods allowed through 6791 by the intervening proxies. 6793 In general, proxies should allow all methods to transparently pass 6794 through from the sending RTSP agent to the receiving RTSP agent, 6795 but there may be cases where this is not desirable for a given 6796 proxy. Modification of the Public response header field by the 6797 intervening proxies ensures that the request sender gets an 6798 accurate response indicating the methods that can be used on the 6799 target agent via the proxy chain. 6801 18.38. Range 6803 The Range header specifies a time range in PLAY (Section 13.4), PAUSE 6804 (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and 6805 PLAY_NOTIFY (Section 13.5) requests and responses. It MAY be 6806 included in GET_PARAMETER requests from the client to the server with 6807 only a Range format and no value to request the current media 6808 position, whether the session is in Play or Ready state in the 6809 included format. The server SHALL, if supporting the range format, 6810 respond with the current playing point or pause point as the start of 6811 the range. If an explicit stop point was used in the previous PLAY 6812 request, then that value shall be included as stop point. Note that 6813 if the server is currently under any type of media playback 6814 manipulation affecting the interpretation of Range, like Scale, that 6815 is also required to be included in any GET_PARAMETER response to 6816 provide complete information. 6818 The range can be specified in a number of units. This specification 6819 defines smpte (Section 4.4), npt (Section 4.5), and clock 6820 (Section 4.6) range units. While byte ranges [H14.35.1] and other 6821 extended units MAY be used, their behavior is unspecified since they 6822 are not normally meaningful in RTSP. Servers supporting the Range 6823 header MUST understand the NPT range format and SHOULD understand the 6824 SMPTE range format. If the Range header is sent in a time format 6825 that is not understood, the recipient SHOULD return 456 (Header Field 6826 Not Valid for Resource) and include an Accept-Ranges header 6827 indicating the supported time formats for the given resource. 6829 Example: 6830 Range: clock=19960213T143205Z- 6832 The Range header contains a range of one single range format. A 6833 range is a half-open interval with a start and an end point, 6834 including the start point, but excluding the end point. A range may 6835 either be fully specified with explicit values for start point and 6836 end point, or have either start or end point be implicit. An 6837 implicit start point indicates the session's pause point, and if no 6838 pause point is set the start of the content. An implicit end point 6839 indicates the end of the content. The usage of both implicit start 6840 and end point is not allowed in the same range header, however, the 6841 exclusion of the range header has that meaning, i.e. from pause point 6842 (or start) until end of content. 6844 Regarding the half-open intervals; a range of A-B starts exactly 6845 at time A, but ends just before B. Only the start time of a media 6846 unit such as a video or audio frame is relevant. For example, 6847 assume that video frames are generated every 40 ms. A range of 6848 10.0-10.1 would include a video frame starting at 10.0 or later 6849 time and would include a video frame starting at 10.08, even 6850 though it lasted beyond the interval. A range of 10.0-10.08, on 6851 the other hand, would exclude the frame at 10.08. 6853 Please note the difference between NPT time scales' "now" and an 6854 implicit start value. Implicit value reference the current pause- 6855 point. While "now" is the currently ongoing time. In a time- 6856 progressing session with recording (retention for some or full 6857 time) the pause point may be 2 min into the session while now 6858 could be 1 hour into the session. 6860 By default, range intervals increase, where the second point is 6861 larger than the first point. 6863 Example: 6864 Range: npt=10-15 6866 However, range intervals can also decrease if the Scale header (see 6867 Section 18.44) indicates a negative scale value. For example, this 6868 would be the case when a playback in reverse is desired. 6870 Example: 6871 Scale: -1 6872 Range: npt=15-10 6874 Decreasing ranges are still half open intervals as described above. 6875 Thus, for range A-B, A is closed and B is open. In the above 6876 example, 15 is closed and 10 is open. An exception to this rule is 6877 the case when B=0 in a decreasing range. In this case, the range is 6878 closed on both ends, as otherwise there would be no way to reach 0 on 6879 a reverse playback for formats that have such a notion, like NPT and 6880 SMPTE. 6882 Example: 6883 Scale: -1 6884 Range: npt=15-0 6886 In this range both 15 and 0 are closed. 6888 A decreasing range interval without a corresponding negative Scale 6889 header is not valid. 6891 18.39. Referrer 6893 The Referrer request-header field allows the client to specify, for 6894 the server's benefit, the address (URI) of the resource from which 6895 the Request-URI was obtained. The URI refers to that of the 6896 presentation description, typically retrieved via HTTP. The Referrer 6897 request-header allows a server to generate lists of back-links to 6898 resources for interest, logging, optimized caching, etc. It also 6899 allows obsolete or mistyped links to be traced for maintenance. The 6900 Referrer field MUST NOT be sent if the Request-URI was obtained from 6901 a source that does not have its own URI, such as input from the user 6902 keyboard. 6904 If the field value is a relative URI, it SHOULD be interpreted 6905 relative to the Request-URI. The URI MUST NOT include a fragment. 6907 Because the source of a link might be private information or might 6908 reveal an otherwise private information source, it is strongly 6909 recommended that the user be able to select whether or not the 6910 Referrer field is sent. For example, a streaming client could have a 6911 toggle switch for openly/anonymously, which would respectively 6912 enable/disable the sending of Referrer and From information. 6914 Clients SHOULD NOT include a Referrer header field in a (non-secure) 6915 RTSP request if the referring page was transferred with a secure 6916 protocol. 6918 18.40. Request-Status 6920 This request header is used to indicate the end result for requests 6921 that takes time to complete, such a PLAY (Section 13.4). It is sent 6922 in PLAY_NOTIFY (Section 13.5) with the end-of-stream reason to report 6923 how the PLAY request concluded, either in success or in failure. The 6924 header carries a reference to the request it reports on using the 6925 CSeq number for the session indicated by the Session header in the 6926 request. It provides both a numerical status code (according to 6927 Section 8.1.1) and a human readable reason phrase. 6929 Example: 6930 Request-Status: cseq=63 status=500 reason="Media data unavailable" 6932 18.41. Require 6934 The Require request-header field is used by clients to ensure that 6935 the other end-point supports features that are required in respect to 6936 this request. It can also be used to query if the other end-point 6937 supports certain features, however, the use of the Supported 6938 (Section 18.49) is much more effective in this purpose. The server 6939 MUST respond to this header by using the Unsupported header to 6940 negatively acknowledge those feature-tags which are NOT supported. 6941 The response MUST use the error code 551 (Option Not Supported). 6942 This header does not apply to proxies, for the same functionality in 6943 respect to proxies see Proxy-Require header (Section 18.35) with the 6944 exception of media modifying proxies. Media modifying proxies, due 6945 to their nature of handling media in a way that is very similar to a 6946 server, do need to understand also the server features to correctly 6947 serve the client. 6949 This is to make sure that the client-server interaction will 6950 proceed without delay when all features are understood by both 6951 sides, and only slow down if features are not understood (as in 6952 the example below). For a well-matched client-server pair, the 6953 interaction proceeds quickly, saving a round-trip often required 6954 by negotiation mechanisms. In addition, it also removes state 6955 ambiguity when the client requires features that the server does 6956 not understand. 6958 Example (Not complete): 6959 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/2.0 6960 CSeq: 302 6961 Require: funky-feature 6962 Funky-Parameter: funkystuff 6964 S->C: RTSP/2.0 551 Option not supported 6965 CSeq: 302 6966 Unsupported: funky-feature 6968 In this example, "funky-feature" is the feature-tag which indicates 6969 to the client that the fictional Funky-Parameter field is required. 6970 The relationship between "funky-feature" and Funky-Parameter is not 6971 communicated via the RTSP exchange, since that relationship is an 6972 immutable property of "funky-feature" and thus should not be 6973 transmitted with every exchange. 6975 Proxies and other intermediary devices MUST ignore this header. If a 6976 particular extension requires that intermediate devices support it, 6977 the extension should be tagged in the Proxy-Require field instead 6978 (see Section 18.35). See discussion in the proxies section 6979 (Section 15.1) about when to consider that a feature requires proxy 6980 support. 6982 18.42. Retry-After 6984 The Retry-After response-header field can be used with a 503 (Service 6985 Unavailable) response to indicate how long the service is expected to 6986 be unavailable to the requesting client. This field MAY also be used 6987 with any 3xx (Redirection) response to indicate the minimum time the 6988 user-agent is asked to wait before issuing the redirected request. 6989 The value of this field can be either an RTSP-date or an integer 6990 number of seconds (in decimal) after the time of the response. 6992 Example: 6994 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT 6995 Retry-After: 120 6997 In the latter example, the delay is 2 minutes. 6999 18.43. RTP-Info 7001 The RTP-Info general header field is used to set RTP-specific 7002 parameters in the PLAY and GET_PARAMETER responses or a PLAY_NOTIFY 7003 and GET_PARAMETER requests. For streams using RTP as transport 7004 protocol the RTP-Info header SHOULD be part of a 200 response to 7005 PLAY. 7007 The exclusion of the RTP-Info in a PLAY response for RTP 7008 transported media will result in that a client needs to 7009 synchronize the media streams using RTCP. This may have negative 7010 impact as the RTCP can be lost, and does not need to be 7011 particularly timely in its arrival. Also functionality as 7012 informing the client from which packet a seek has occurred is 7013 affected. 7015 The RTP-Info MAY be included in SETUP responses to provide 7016 synchronization information when changing transport parameters, see 7017 Section 13.3. The RTP-Info header and the Range header MAY be 7018 included in a GET_PARAMETER request from client to server without any 7019 values to request the current playback point and corresponding RTP 7020 synchronization information. When the RTP-Info header is included in 7021 a Request also the Range header MUST be included (Note, Range header 7022 only MAY be used). The server response SHALL include both the Range 7023 header and the RTP-Info header. If the session is in Play state, 7024 then the value of the Range header SHALL be filled in with the 7025 current playback point and with the corresponding RTP-Info values. 7026 If the server is another state, no values are included in the RTP- 7027 Info header. The header is included in PLAY_NOTIFY requests with the 7028 Notify-Reason of end-of-stream to provide RTP information about the 7029 end of the stream. 7031 The header can carry the following parameters: 7033 url: Indicates the stream URI for which the following RTP parameters 7034 correspond, this URI MUST be the same as used in the SETUP 7035 request for this media stream. Any relative URI MUST use the 7036 Request-URI as base URI. This parameter MUST be present. 7038 ssrc: The Synchronization source (SSRC) that the RTP timestamp and 7039 sequence number provided applies to. This parameter MUST be 7040 present. 7042 seq: Indicates the sequence number of the first packet of the stream 7043 that is direct result of the request. This allows clients to 7044 gracefully deal with packets when seeking. The client uses 7045 this value to differentiate packets that originated before the 7046 seek from packets that originated after the seek. Note that a 7047 client may not receive the packet with the expressed sequence 7048 number, and instead packets with a higher sequence number, due 7049 to packet loss or reordering. This parameter is RECOMMENDED to 7050 be present. 7052 rtptime: MUST indicate the RTP timestamp value corresponding to the 7053 start time value in the Range response header, or if not 7054 explicitly given the implied start point. The client uses this 7055 value to calculate the mapping of RTP time to NPT or other 7056 media timescale. This parameter SHOULD be present to ensure 7057 inter-media synchronization is achieved. There exists no 7058 requirement that any received RTP packet will have the same RTP 7059 timestamp value as the one in the parameter used to establish 7060 synchronization. 7062 A mapping from RTP timestamps to NTP timestamps (wallclock) is 7063 available via RTCP. However, this information is not sufficient 7064 to generate a mapping from RTP timestamps to media clock time 7065 (NPT, etc.). Furthermore, in order to ensure that this 7066 information is available at the necessary time (immediately at 7067 startup or after a seek), and that it is delivered reliably, this 7068 mapping is placed in the RTSP control channel. 7070 In order to compensate for drift for long, uninterrupted 7071 presentations, RTSP clients should additionally map NPT to NTP, 7072 using initial RTCP sender reports to do the mapping, and later 7073 reports to check drift against the mapping. 7075 Example: 7077 Range:npt=3.25-15 7078 RTP-Info:url="rtsp://example.com/foo/audio" ssrc=0A13C760:seq=45102; 7079 rtptime=12345678,url="rtsp://example.com/foo/video" 7080 ssrc=9A9DE123:seq=30211;rtptime=29567112 7082 Lets assume that Audio uses a 16kHz RTP timestamp clock and Video 7083 a 90kHz RTP timestamp clock. Then the media synchronization is 7084 depicted in the following way. 7086 NPT 3.0---3.1---3.2-X-3.3---3.4---3.5---3.6 7087 Audio PA A 7088 Video V PV 7090 X: NPT time value = 3.25, from Range header. 7091 A: RTP timestamp value for Audio from RTP-Info header (12345678). 7092 V: RTP timestamp value for Video from RTP-Info header (29567112). 7093 PA: RTP audio packet carrying an RTP timestamp of 12344878. Which 7094 corresponds to NPT = (12344878 - A) / 16000 + 3.25 = 3.2 7095 PV: RTP video packet carrying an RTP timestamp of 29573412. Which 7096 corresponds to NPT = (29573412 - V) / 90000 + 3.25 = 3.32 7098 18.44. Scale 7100 A scale value of 1 indicates normal play at the normal forward 7101 viewing rate. If not 1, the value corresponds to the rate with 7102 respect to normal viewing rate. For example, a ratio of 2 indicates 7103 twice the normal viewing rate ("fast forward") and a ratio of 0.5 7104 indicates half the normal viewing rate. In other words, a ratio of 2 7105 has content time increase at twice the playback time. For every 7106 second of elapsed (wallclock) time, 2 seconds of content time will be 7107 delivered. A negative value indicates reverse direction. For 7108 certain media transports this may require certain considerations to 7109 work consistent, see Appendix C.1 for description on how RTP handles 7110 this. 7112 The transmitted data rate SHOULD NOT be changed by selection of a 7113 different scale value. The resulting bit-rate should be reasonably 7114 close to the nominal bit-rate of the content for Scale = 1. The 7115 server has to actively manipulate the data when needed to meet the 7116 bitrate constraints. Implementation of scale changes depends on the 7117 server and media type. For video, a server may, for example, deliver 7118 only key frames or selected frames. For audio, it may time-scale the 7119 audio while preserving pitch or, less desirably, deliver fragments of 7120 audio, or completely mute the audio. 7122 The server and content may restrict the range of scale values that it 7123 supports. The supported values are indicated by the Media-Properties 7124 header (Section 18.28). The client SHOULD only indicate request 7125 values to be supported. However, as the values may change as the 7126 content progresses a requested value may no longer be valid when the 7127 request arrives. Thus, a non-supported value in a request does not 7128 generate an error, only forces the server to choose the closest 7129 value. The response MUST always contain the actual scale value 7130 chosen by the server. 7132 If the server does not implement the possibility to scale, it will 7133 not return a Scale header. A server supporting Scale operations for 7134 PLAY MUST indicate this with the use of the "play.scale" feature-tag. 7136 When indicating a negative scale for a reverse playback, the Range 7137 header MUST indicate a decreasing range as described in 7138 Section 18.38. 7140 Example of playing in reverse at 3.5 times normal rate: 7141 Scale: -3.5 7142 Range: npt=15-10 7144 18.45. Seek-Style 7146 When a client sends a PLAY request with a Range header to perform a 7147 random access to the media, the client does not know if the server 7148 will pick the first media samples or the first random access point 7149 prior to the request range. Depending on use case, the client may 7150 have a strong preference. To express this preference and provide the 7151 client with information on how the server actually acted on that 7152 preference the Seek-Style header is defined. 7154 Seek-Style is a general header that MAY be included in any PLAY 7155 request to indicate the client's preference for any media stream that 7156 has random access properties. The server MUST always include the 7157 header in any PLAY response for media with random access properties 7158 to indicate what policy was applied. A server that receives an 7159 unknown Seek-Style policy MUST ignore it and select the server 7160 default policy. A client receiving an unknown policy MUST ignore it 7161 and use the Range header and any media synchronization information as 7162 basis to determine what the server did. 7164 This specification defines the following seek policies that may be 7165 requested (see also Section 4.9.1): 7167 RAP: Random Access Point (RAP) is the behavior of requesting the 7168 server to locate the closest previous random access point that 7169 exists in the media aggregate and deliver from that. By 7170 requesting a RAP, media quality will be the best possible as all 7171 media will be delivered from a point where full media state can be 7172 established in the media decoder. 7174 CoRAP: Conditional Random Access Point (CoRAP) is a variant of the 7175 above RAP behavior. This policy is primarily intended for cases 7176 where there is larger distance between the random access points in 7177 the media. CoRAP is conditioned on that there is a Random Access 7178 Point closer to the requested start point than to the current 7179 pause point. This policy assumes that the media state existing 7180 prior to the pause is usable if delivery is continued. If the 7181 client or server knows that this is not the fact the RAP policy 7182 should be used. In other words: in most cases when the client 7183 requests a start point prior to the current pause point, a valid 7184 decoding dependency chain from the media delivered prior to the 7185 pause and to the requested media unit will not exist. If the 7186 server searched to a random access point the server MUST return 7187 the CoRAP policy in the Seek-Style header and adjust the Range 7188 header to reflect the position of the picked RAP. In case the 7189 random access point is further away and the server selects to 7190 continue from the current pause point it MUST include the "Next" 7191 policy in the Seek-Style header and adjust the Range header start 7192 point to the current pause point. 7194 First-Prior: The first-prior policy will start delivery with the 7195 media unit that has a playout time first prior to the requested 7196 time. For discrete media that would only include media units that 7197 would still be rendered at the request time. For continuous media 7198 that is media that will be rendered during the requested start 7199 time of the range. 7201 Next: The next media units after the provided start time of the 7202 range. For continuous framed media that would mean the first next 7203 frame after the provided time. For discrete media the first unit 7204 that is to be rendered after the provided time. The main usage 7205 for this case is when the client knows it has all media up to a 7206 certain point and would like to continue delivery so that a 7207 complete non-interrupted media playback can be achieved. Example 7208 of such scenarios include switching from a broadcast/multicast 7209 delivery to a unicast based delivery. This policy MUST only be 7210 used on the client's explicit request. 7212 Please note that these expressed preferences exist for optimizing the 7213 startup time or the media quality. The "Next" policy breaks the 7214 normal definition of the Range header to enable a client to request 7215 media with minimal overlap, although some may still occur for 7216 aggregated sessions. RAP and First-Prior both fulfill the 7217 requirement of providing media from the requested range and forward. 7218 However, unless RAP is used, the media quality for many media codecs 7219 using predictive methods can be severely degraded unless additional 7220 data is available as, for example, already buffered, or through other 7221 side channels. 7223 18.46. Server 7225 The Server response-header field contains information about the 7226 software used by the origin server to handle the request. The field 7227 can contain multiple product tokens and comments identifying the 7228 server and any significant subproducts. The product tokens are 7229 listed in order of their significance for identifying the 7230 application. 7232 Example: 7233 Server: PhonyServer/1.0 7235 If the response is being forwarded through a proxy, the proxy 7236 application MUST NOT modify the Server response-header. Instead, it 7237 SHOULD include a Via field (Section 18.55). If the response is 7238 generated by the proxy, the proxy application MUST return the Server 7239 response-header as previously returned by the server. 7241 18.47. Session 7243 The Session request-header and response-header field identifies an 7244 RTSP session. An RTSP session is created by the server as a result 7245 of a successful SETUP request and in the response the session 7246 identifier is given to the client. The RTSP session exists until 7247 destroyed by a TEARDOWN, REDIRECT or timed out by the server. 7249 The session identifier is chosen by the server (see Section 4.3) and 7250 MUST be returned in the SETUP response. Once a client receives a 7251 session identifier, it MUST be included in any request related to 7252 that session. This means that the Session header MUST be included in 7253 a request, using the following methods: PLAY, PAUSE, and TEARDOWN, 7254 and MAY be included in SETUP, OPTIONS, SET_PARAMETER, GET_PARAMETER, 7255 and REDIRECT, and MUST NOT be included in DESCRIBE. The Session 7256 header MUST NOT be included in the following methods, if these 7257 requests are pipelined and if the session identifier is not yet 7258 known: PLAY, PAUSE, TEARDOWN, SETUP, OPTIONS SET_PARAMETER, and 7259 GET_PARAMETER. 7261 In an RTSP response the session header MUST be included in methods, 7262 SETUP, PLAY, and PAUSE, and MAY be included in methods, TEARDOWN, and 7263 REDIRECT, and if included in the request of the following methods it 7264 MUST also be included in the response, OPTIONS, GET_PARAMETER, and 7265 SET_PARAMETER, and MUST NOT be included in DESCRIBE responses. 7267 Note that a session identifier identifies an RTSP session across 7268 transport sessions or connections. RTSP requests for a given session 7269 can use different URIs (Presentation and media URIs). Note, that 7270 there are restrictions depending on the session which URIs that are 7271 acceptable for a given method. However, multiple "user" sessions for 7272 the same URI from the same client will require use of different 7273 session identifiers. 7275 The session identifier is needed to distinguish several delivery 7276 requests for the same URI coming from the same client. 7278 The response 454 (Session Not Found) MUST be returned if the session 7279 identifier is invalid. 7281 The header MAY include the session timeout period. If not explicitly 7282 provided this value is set to 60 seconds. As this affects how often 7283 session keep-alives are needed values smaller than 30 seconds are not 7284 recommended. However, larger than default values can be useful in 7285 applications of RTSP that have inactive but established sessions for 7286 longer time periods. 7288 60 seconds was chosen as session timeout value due to: Resulting 7289 in not too frequent keep-alive messages and having low sensitivity 7290 to variations in request response timing. If one reduces the 7291 timeout value to below 30 seconds the corresponding request 7292 response timeout becomes a significant part of the session 7293 timeout. 60 seconds also allows for reasonably rapid recovery of 7294 committed server resources in case of client failure. 7296 18.48. Speed 7298 The Speed request-header field requests the server to deliver 7299 specific amounts of nominal media time per unit of delivery time, 7300 contingent on the server's ability and desire to serve the media 7301 stream at the given speed. The client requests the delivery speed to 7302 be within a given range with a lower and upper bound. The server 7303 SHALL deliver at the highest possible speed within the range, but not 7304 faster than the upper-bound, for which the underlying network path 7305 can support the resulting transport data rates. As long as any speed 7306 value within the given range can be provided the server SHALL NOT 7307 modify the media quality. Only if the server is unable to deliver 7308 media at the speed value provided by the lower bound shall it reduce 7309 the media quality. 7311 Implementation of the Speed functionality by the server is OPTIONAL. 7312 The server can indicate its support through a feature-tag, 7313 play.speed. The lack of a Speed header in the response is an 7314 indication of lack of support of this functionality. 7316 The speed parameter values are expressed as a positive decimal value, 7317 e.g., a value of 2.0 indicates that data is to be delivered twice as 7318 fast as normal. A speed value of zero is invalid. The range is 7319 specified in the form "lower bound - upper bound". The lower bound 7320 value may be smaller or equal to the upper bound. All speeds may not 7321 be possible to support. Therefore the server MAY modify the 7322 requested values to the closest supported. The actual supported 7323 speed MUST be included in the response. Note, however, that the use 7324 cases may vary and that Speed value ranges such as 0.7 - 0.8, 7325 0.3-2.0, 1.0-2.5, 2.5-2.5 all have their usage. 7327 Example: 7329 Speed: 1.0-2.5 7331 Use of this header changes the bandwidth used for data delivery. It 7332 is meant for use in specific circumstances where delivery of the 7333 presentation at a higher or lower rate is desired. The main use 7334 cases are buffer operations or local scale operations. Implementors 7335 should keep in mind that bandwidth for the session may be negotiated 7336 beforehand (by means other than RTSP), and therefore re-negotiation 7337 may be necessary. To perform Speed operations the server needs to 7338 ensure that the network path can support the resulting bit-rate. 7339 Thus the media transport needs to support feedback so that the server 7340 can react and adapt to the available bitrate. 7342 18.49. Supported 7344 The Supported header enumerates all the extensions supported by the 7345 client or server using feature tags. The header carries the 7346 extensions supported by the message sending client or server. The 7347 Supported header MAY be included in any request. When present in a 7348 request, the receiver MUST respond with its corresponding Supported 7349 header. Note that the Supported header is also included in 4xx and 7350 5xx responses. 7352 The Supported header contains a list of feature-tags, described in 7353 Section 4.7, that are understood by the client or server. 7355 Example: 7357 C->S: OPTIONS rtsp://example.com/ RTSP/2.0 7358 Supported: foo, bar, blech 7359 User-Agent: PhonyClient/1.2 7361 S->C: RTSP/2.0 200 OK 7362 Supported: bar, blech, baz 7364 18.50. Terminate-Reason 7366 The Terminate-Reason request header allows the server when sending a 7367 REDIRECT or TEARDOWN request to provide a reason for the session 7368 termination and any additional information. This specification 7369 identifies three reasons for Redirections and may be extended in the 7370 future: 7372 Server-Admin: The server needs to be shutdown for some 7373 administrative reason. 7375 Session-Timeout: A client's session is kept alive for extended 7376 periods of time and the server has determined that it needs to 7377 reclaim the resources associated with this session. 7379 Internal-Error An internal error that is impossible to recover from 7380 has occurred forcing the server to terminate the session. 7382 The Server may provide additional parameters containing information 7383 around the redirect. This specification defines the following ones. 7385 time: Provides a wallclock time when the server will stop provide 7386 any service. 7388 user-msg: An UTF-8 text string with a message from the server to the 7389 user. This message SHOULD be displayed to the user. 7391 18.51. Timestamp 7393 The Timestamp general-header describes when the agent sent the 7394 request. The value of the timestamp is of significance only to the 7395 agent and may use any timescale. The responding agent MUST echo the 7396 exact same value and MAY, if it has accurate information about this, 7397 add a floating point number indicating the number of seconds that has 7398 elapsed since it has received the request. The timestamp can be used 7399 by the agent to compute the round-trip time to the responding agent 7400 so that it can adjust the timeout value for retransmissions when 7401 running over an unreliable protocol. It also resolves retransmission 7402 ambiguities for unreliable transport of RTSP. 7404 Note that the present specification provides only for reliable 7405 transport of RTSP messages. The Timestamp general-header is 7406 specified in case the protocol is extended in the future to use 7407 unreliable transport. 7409 18.52. Transport 7411 The Transport request and response header indicates which transport 7412 protocol is to be used and configures its parameters such as 7413 destination address, compression, multicast time-to-live and 7414 destination port for a single stream. It sets those values not 7415 already determined by a presentation description. 7417 A Transport request header MAY contain a list of transport options 7418 acceptable to the client, in the form of multiple transport 7419 specification entries. Transport specifications are comma separated, 7420 listed in decreasing order of preference. Parameters may be added to 7421 each transport specification, separated by a semicolon. The server 7422 MUST return a Transport response-header in the response to indicate 7423 the values actually chosen if any. If the transport specification is 7424 not supported, no transport header is returned and the request MUST 7425 be responded using the status code 461 (Unsupported Transport) 7426 (Section 17.4.26). In case more than one transport specification was 7427 present in the request, the server MUST return the single (transport- 7428 spec) which was actually chosen, if any. The number of transport- 7429 spec entries is expected to be limited as the client will get 7430 guidance on what configurations that are possible from the 7431 presentation description. 7433 The Transport header MAY also be used in subsequent SETUP requests to 7434 change transport parameters. A server MAY refuse to change 7435 parameters of an existing stream. 7437 A transport specification may only contain one of any given parameter 7438 within it. Parameters MAY be given in any order. Additionally, it 7439 may only contain either of the unicast or the multicast transport 7440 type parameter. All parameters need to be understood in a transport 7441 specification, if not, the transport specification MUST be ignored. 7442 An RTSP proxy of any type that uses or modifies the transport 7443 specification, e.g. access proxy or security proxy, MUST remove 7444 specifications with unknown parameters before forwarding the RTSP 7445 message. If that results in no remaining transport specification the 7446 proxy SHALL send a 461 (Unsupported Transport) (Section 17.4.26) 7447 response without any Transport header. 7449 The Transport header is restricted to describing a single media 7450 stream. (RTSP can also control multiple streams as a single 7451 entity.) Making it part of RTSP rather than relying on a 7452 multitude of session description formats greatly simplifies 7453 designs of firewalls. 7455 The general syntax for the transport specifier is a list of slash 7456 separated tokens: 7458 Value1/Value2/Value3... 7459 Which for RTP transports take the form: 7460 RTP/profile/lower-transport. 7462 The default value for the "lower-transport" parameters is specific to 7463 the profile. For RTP/AVP, the default is UDP. 7465 There are two different methods for how to specify where the media 7466 should be delivered for unicast transport: 7468 dest_addr: The presence of this parameter and its values indicates 7469 the destination address or addresses (host address and port 7470 pairs for IP flows) necessary for the media transport. 7472 No dest_addr: The lack of the dest_addr parameter indicates that the 7473 server MUST send media to same address for which the RTSP 7474 messages originates. 7476 The choice of method for indicating where the media is to be 7477 delivered depends on the use case. In some cases the only allowed 7478 method will be to use no explicit address indication and have the 7479 server deliver media to the source of the RTSP messages. 7481 For Multicast there is several methods for specifying addresses but 7482 they are different in how they work compared with unicast: 7484 dest_addr with client picked address: The address and relevant 7485 parameters, like TTL (scope), for the actual multicast group to 7486 deliver the media to. There are security implications 7487 (Section 21) with this method that need to be addressed if 7488 using this method because a RTSP server can be used as a DoS 7489 attacker on an existing multicast group. 7491 dest_addr using Session Description Information: The information 7492 included in the transport header can all be coming from the 7493 session description, e.g. the SDP c= and m= line. This 7494 mitigates some of the security issues of the previous methods 7495 as it is the session provider that picks the multicast group 7496 and scope. The client MUST include the information if it is 7497 available in the session description. 7499 No dest_addr: The behavior when no explicit multicast group is 7500 present in a request is not defined. 7502 An RTSP proxy will need to take care. If the media is not desired to 7503 be routed through the proxy, the proxy will need to introduce the 7504 destination indication. 7506 Below are the configuration parameters associated with transport: 7508 General parameters: 7510 unicast / multicast: This parameter is a mutually exclusive 7511 indication of whether unicast or multicast delivery will be 7512 attempted. One of the two values MUST be specified. Clients 7513 that are capable of handling both unicast and multicast 7514 transmission needs to indicate such capability by including two 7515 full transport-specs with separate parameters for each. 7517 layers: The number of multicast layers to be used for this media 7518 stream. The layers are sent to consecutive addresses starting 7519 at the dest_addr address. If the parameter is not included, it 7520 defaults to a single layer. 7522 dest_addr: A general destination address parameter that can contain 7523 one or more address specifications. Each combination of 7524 protocol/profile/lower transport needs to have the format and 7525 interpretation of its address specification defined. For RTP/ 7526 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 7527 containing a host address and port. Note, only a single 7528 destination parameter per transport spec is intended. The 7529 usage of multiple destinations to distribute a single media to 7530 multiple entities is unspecified. 7532 The client originating the RTSP request MAY specify the 7533 destination address of the stream recipient with the host 7534 address part of the tuple. When the destination address is 7535 specified, the recipient may be a different party than the 7536 originator of the request. To avoid becoming the unwitting 7537 perpetrator of a remote-controlled denial-of-service attack, a 7538 server MUST perform security checks (see Section 21.2.1) and 7539 SHOULD log such attempts before allowing the client to direct a 7540 media stream to a recipient address not chosen by the server. 7541 Implementations cannot rely on TCP as reliable means of client 7542 identification. If the server does not allow the host address 7543 part of the tuple to be set, it MUST return 463 (Destination 7544 Prohibited). 7546 The host address part of the tuple MAY be empty, for example 7547 ":58044", in cases when only destination port is desired to be 7548 specified. Responses to requests including the Transport 7549 header with a dest_addr parameter SHOULD include the full 7550 destination address that is actually used by the server. The 7551 server MUST NOT remove address information present already in 7552 the request when responding unless the protocol requires it. 7554 src_addr: A general source address parameter that can contain one or 7555 more address specifications. Each combination of protocol/ 7556 profile/lower transport needs to have the format and 7557 interpretation of its address specification defined. For RTP/ 7558 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 7559 containing a host address and port. 7561 This parameter MUST be specified by the server if it transmits 7562 media packets from another address than the one RTSP messages 7563 are sent to. This will allow the client to verify source 7564 address and give it a destination address for its RTCP feedback 7565 packets, if RTP is used. The address or addresses indicated in 7566 the src_addr parameter SHOULD be used both for sending and 7567 receiving of the media streams data packets. The main reasons 7568 are threefold: First, indicating the port and source address(s) 7569 lets the receiver know where from the packets is expected to 7570 originate. Secondly, traversal of NATs is greatly simplified 7571 when traffic is flowing symmetrically over a NAT binding. 7572 Thirdly, certain NAT traversal mechanisms, needs to know to 7573 which address and port to send so called "binding packets" from 7574 the receiver to the sender, thus creating an address binding in 7575 the NAT that the sender to receiver packet flow can use. 7577 This information may also be available through SDP. 7578 However, since this is more a feature of transport than 7579 media initialization, the authoritative source for this 7580 information should be in the SETUP response. 7582 mode: The mode parameter indicates the methods to be supported for 7583 this session. Currently defined valid values are "PLAY". If 7584 not provided, the default is "PLAY". The "RECORD" value was 7585 defined in RFC 2326 and is in this specification unspecified 7586 but reserved. RECORD and other values may be specified in the 7587 future. 7589 interleaved: The interleaved parameter implies mixing the media 7590 stream with the control stream in whatever protocol is being 7591 used by the control stream, using the mechanism defined in 7592 Section 14. The argument provides the channel number to be 7593 used in the $ block (see Section 14) and MUST be present. This 7594 parameter MAY be specified as an interval, e.g., 7595 interleaved=4-5 in cases where the transport choice for the 7596 media stream requires it, e.g., for RTP with RTCP. The channel 7597 number given in the request is only a guidance from the client 7598 to the server on what channel number(s) to use. The server MAY 7599 set any valid channel number in the response. The declared 7600 channel(s) are bi-directional, so both end-parties MAY send 7601 data on the given channel. One example of such usage is the 7602 second channel used for RTCP, where both server and client send 7603 RTCP packets on the same channel. 7605 This allows RTP/RTCP to be handled similarly to the way 7606 that it is done with UDP, i.e., one channel for RTP and 7607 the other for RTCP. 7609 MIKEY: This parameter is used in conjunction with transport 7610 specifications that can utilize MIKEY [RFC3830] for security 7611 context establishment. So far only the SRTP based RTP profiles 7612 SAVP and SAVPF can utilize MIKEY and this is defined in 7613 Appendix C.1.4.1. This parameter can be included both in 7614 request and response messages. The binary MIKEY message SHALL 7615 be BASE64 [RFC4648] encoded before being included in the value 7616 part of the parameter. 7618 Multicast-specific: 7620 ttl: multicast time-to-live for IPv4. When included in requests the 7621 value indicate the TTL value that the client requests the 7622 server to use. In a response, the value actually being used by 7623 the server is returned. A server will need to consider what 7624 values that are reasonable and also the authority of the user 7625 to set this value. Corresponding functions are not needed for 7626 IPv6 as the scoping is part of the IPv6 multicast address 7627 [RFC4291]. 7629 RTP-specific: 7631 These parameters MAY only be used if the media transport protocol is 7632 RTP. 7634 ssrc: The ssrc parameter, if included in a SETUP response, indicates 7635 the RTP SSRC [RFC3550] value(s) that will be used by the media 7636 server for RTP packets within the stream. It is expressed as 7637 an eight digit hexadecimal value. 7639 The ssrc parameter MUST NOT be specified in requests. The 7640 functionality of specifying the ssrc parameter in a SETUP 7641 request is deprecated as it is incompatible with the 7642 specification of RTP in RFC 3550[RFC3550]. If the parameter is 7643 included in the Transport header of a SETUP request, the server 7644 SHOULD ignore it, and choose appropriate SSRCs for the stream. 7645 The server SHOULD set the ssrc parameter in the Transport 7646 header of the response. 7648 RTCP-mux: Use to negotiate the usage of RTP and RTCP multiplexing 7649 [RFC5761] on a single underlying transport stream / flow. The 7650 presence of this parameter in a SETUP request indicates the 7651 client's support and requires the server to use RTP and RTCP 7652 multiplexing. The client SHALL only include one transport 7653 stream in the Transport header specification. To provide the 7654 server with a choice between using RTP/RTCP multiplexing or 7655 not, two different transport header specifications must be 7656 included. 7658 The parameters setup and connection defined below MAY only be used if 7659 the media transport protocol of the lower-level transport is 7660 connection-oriented (such as TCP). However, these parameters MUST 7661 NOT be used when interleaving data over the RTSP control connection. 7663 setup: Clients use the setup parameter on the Transport line in a 7664 SETUP request, to indicate the roles it wishes to play in a TCP 7665 connection. This parameter is adapted from [RFC4145]. We 7666 discuss the use of this parameter in RTP/AVP/TCP non- 7667 interleaved transport in Appendix C.2.2; the discussion below 7668 is limited to syntactic issues. Clients may specify the 7669 following values for the setup parameter: 7671 ["active:"] The client will initiate an outgoing connection. 7673 ["passive":] The client will accept an incoming connection. 7675 ["actpass":] The client is willing to accept an incoming 7676 connection or to initiate an outgoing connection. 7678 If a client does not specify a setup value, the "active" value 7679 is assumed. 7681 In response to a client SETUP request where the setup parameter 7682 is set to "active", a server's 2xx reply MUST assign the setup 7683 parameter to "passive" on the Transport header line. 7685 In response to a client SETUP request where the setup parameter 7686 is set to "passive", a server's 2xx reply MUST assign the setup 7687 parameter to "active" on the Transport header line. 7689 In response to a client SETUP request where the setup parameter 7690 is set to "actpass", a server's 2xx reply MUST assign the setup 7691 parameter to "active" or "passive" on the Transport header 7692 line. 7694 Note that the "holdconn" value for setup is not defined for 7695 RTSP use, and MUST NOT appear on a Transport line. 7697 connection: Clients use the setup parameter on the Transport line in 7698 a SETUP request, to indicate the SETUP request prefers the 7699 reuse of an existing connection between client and server (in 7700 which case the client sets the "connection" parameter to 7701 "existing"), or that the client requires the creation of a new 7702 connection between client and server (in which cast the client 7703 sets the "connection" parameter to "new"). Typically, clients 7704 use the "new" value for the first SETUP request for a URL, and 7705 "existing" for subsequent SETUP requests for a URL. 7707 If a client SETUP request assigns the "new" value to 7708 "connection", the server response MUST also assign the "new" 7709 value to "connection" on the Transport line. 7711 If a client SETUP request assigns the "existing" value to 7712 "connection", the server response MUST assign a value of 7713 "existing" or "new" to "connection" on the Transport line, at 7714 its discretion. 7716 The default value of "connection" is "existing", for all SETUP 7717 requests (initial and subsequent). 7719 The combination of transport protocol, profile and lower transport 7720 needs to be defined. A number of combinations are defined in the 7721 Appendix C. 7723 Below is a usage example, showing a client advertising the capability 7724 to handle multicast or unicast, preferring multicast. Since this is 7725 a unicast-only stream, the server responds with the proper transport 7726 parameters for unicast. 7728 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 7729 CSeq: 302 7730 Transport: RTP/AVP;multicast;mode="PLAY", 7731 RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7732 "192.0.2.5:3457";mode="PLAY" 7733 Accept-Ranges: NPT, SMPTE, UTC 7734 User-Agent: PhonyClient/1.2 7736 S->C: RTSP/2.0 200 OK 7737 CSeq: 302 7738 Date: Thu, 23 Jan 1997 15:35:06 GMT 7739 Session: 47112344 7740 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7741 "192.0.2.5:3457";src_addr="192.0.2.224:6256"/ 7742 "192.0.2.224:6257";mode="PLAY" 7743 Accept-Ranges: NPT 7744 Media-Properties: Random-Access=0.6, Dynamic, 7745 Time-Limited=20081128T165900 7747 18.53. Unsupported 7749 The Unsupported response-header lists the features not supported by 7750 the responding RTSP agent. In the case where the feature was 7751 specified via the Proxy-Require field (Section 18.35), if there is a 7752 proxy on the path between the client and the server, the proxy MUST 7753 send a response message with a status code of 551 (Option Not 7754 Supported). The request MUST NOT be forwarded. 7756 See Section 18.41 for a usage example. 7758 18.54. User-Agent 7760 The User-Agent general-header field contains information about the 7761 user agent originating the request. This is for statistical 7762 purposes, the tracing of protocol violations, and automated 7763 recognition of user agents for the sake of tailoring responses to 7764 avoid particular user agent limitations. User agents SHOULD include 7765 this field with requests. The field can contain multiple product 7766 tokens and comments identifying the agent and any subproducts which 7767 form a significant part of the user agent. By convention, the 7768 product tokens are listed in order of their significance for 7769 identifying the application. 7771 Example: 7772 User-Agent: PhonyClient/1.2 7774 18.55. Via 7776 The Via general-header field MUST be used by proxies to indicate the 7777 intermediate protocols and recipients between the user agent and the 7778 server on requests, and between the origin server and the client on 7779 responses. The field is intended to be used for tracking message 7780 forwards, avoiding request loops, and identifying the protocol 7781 capabilities of all senders along the request/response chain. 7783 Multiple Via field values represents each proxy that has forwarded 7784 the message. Each recipient MUST append its information such that 7785 the end result is ordered according to the sequence of forwarding 7786 applications. 7788 Proxies (e.g., Access Proxy or Translator Proxy) SHOULD NOT, by 7789 default, forward the names and ports of hosts within the private/ 7790 protected region. This information SHOULD only be propagated if 7791 explicitly enabled. If not enabled, the via-received of any host 7792 behind the firewall/NAT SHOULD be replaced by an appropriate 7793 pseudonym for that host. 7795 For organizations that have strong privacy requirements for hiding 7796 internal structures, a proxy MAY combine an ordered subsequence of 7797 Via header field entries with identical sent-protocol values into a 7798 single such entry. Applications MUST NOT combine entries which have 7799 different received-protocol values. 7801 18.56. WWW-Authenticate 7803 The WWW-Authenticate response-header field MUST be included in 401 7804 (Unauthorized) response messages. The field value consists of at 7805 least one challenge that indicates the authentication scheme(s) and 7806 parameters applicable to the Request-URI. 7808 The HTTP access authentication process is described in [RFC2617]. 7809 User agents are advised to take special care in parsing the WWW- 7810 Authenticate field value as it might contain more than one challenge, 7811 or if more than one WWW-Authenticate header field is provided, the 7812 contents of a challenge itself can contain a comma-separated list of 7813 authentication parameters. 7815 19. Security Framework 7817 The RTSP security framework consists of two high level components: 7818 the pure authentication mechanisms based on HTTP authentication, and 7819 the message transport protection based on TLS, which is independent 7820 of RTSP. Because of the similarity in syntax and usage between RTSP 7821 servers and HTTP servers, the security for HTTP is re-used to a large 7822 extent. 7824 19.1. RTSP and HTTP Authentication 7826 RTSP and HTTP share common authentication schemes, and thus follow 7827 the same usage guidelines as specified in [RFC2617] and also in 7828 [H15]. Servers SHOULD implement both basic and digest [RFC2617] 7829 authentication. Clients MUST implement both basic and digest 7830 authentication [RFC2617] so that a server that requires the client to 7831 authenticate can trust that the capability is present. 7833 It should be stressed that using the HTTP authentication alone does 7834 not provide full control message security. Therefore, in 7835 environments requiring tighter security for the control messages, TLS 7836 SHOULD be used, see Section 19.2. 7838 19.2. RTSP over TLS 7840 RTSP agents MUST implement RTSP over TLS as defined in this section 7841 and the next Section 19.3. RTSP MUST follow the same guidelines with 7842 regards to TLS [RFC5246] usage as specified for HTTP, see [RFC2818]. 7843 RTSP over TLS is separated from unsecured RTSP both on URI level and 7844 port level. Instead of using the "rtsp" scheme identifier in the 7845 URI, the "rtsps" scheme identifier MUST be used to signal RTSP over 7846 TLS. If no port is given in a URI with the "rtsps" scheme, port 322 7847 MUST be used for TLS over TCP/IP. 7849 When a client tries to setup an insecure channel to the server (using 7850 the "rtsp" URI), and the policy for the resource requires a secure 7851 channel, the server MUST redirect the client to the secure service by 7852 sending a 301 redirect response code together with the correct 7853 Location URI (using the "rtsps" scheme). A user or client MAY 7854 upgrade a non secured URI to a secured by changing the scheme from 7855 "rtsp" to "rtsps". A server implementing support for "rtsps" MUST 7856 allow this. 7858 It should be noted that TLS allows for mutual authentication (when 7859 using both server and client certificates). Still, one of the more 7860 common ways TLS is used is to only provide server side authentication 7861 (often to avoid client certificates). TLS is then used in addition 7862 to HTTP authentication, providing transport security and server 7863 authentication, while HTTP Authentication is used to authenticate the 7864 client. 7866 RTSP includes the possibility to keep a TCP session up between the 7867 client and server, throughout the RTSP session lifetime. It may be 7868 convenient to keep the TCP session, not only to save the extra setup 7869 time for TCP, but also the extra setup time for TLS (even if TLS uses 7870 the resume function, there will be almost two extra round trips). 7871 Still, when TLS is used, such behavior introduces extra active state 7872 in the server, not only for TCP and RTSP, but also for TLS. This may 7873 increase the vulnerability to DoS attacks. 7875 In addition to these recommendations, Section 19.3 gives further 7876 recommendations of TLS usage with proxies. 7878 19.3. Security and Proxies 7880 The nature of a proxy is often to act as a "man-in-the-middle", while 7881 security is often about preventing the existence of a "man-in-the- 7882 middle". This section provides clients with the possibility to use 7883 proxies even when applying secure transports (TLS) between the RTSP 7884 agents. The TLS proxy mechanism allows for server and proxy 7885 identification using certificates. However, the client cannot be 7886 identified based on certificates. The client needs to select between 7887 using the procedure specified below or using a TLS connection 7888 directly (by-passing any proxies) to the server. The choice may be 7889 dependent on policies. 7891 There are basically two categories of proxies, the transparent 7892 proxies (of which the client is not aware) and the non-transparent 7893 proxies (of which the client is aware), see Section 15 for an 7894 introduction to RTSP proxies. An infrastructure based on proxies 7895 requires that the trust model is such that both client and servers 7896 can trust the proxies to handle the RTSP messages correctly. To be 7897 able to trust a proxy, the client and server also needs to be aware 7898 of the proxy. Hence, transparent proxies cannot generally be seen as 7899 trusted and will not work well with security (unless they work only 7900 at transport layer). In the rest of this section any reference to 7901 proxy will be to a non-transparent proxy, which inspects or 7902 manipulates the RTSP messages. 7904 HTTP Authentication is built on the assumption of proxies and can 7905 provide user-proxy authentication and proxy-proxy/server 7906 authentication in addition to the client-server authentication. 7908 When TLS is applied and a proxy is used, the client will connect to 7909 the proxy's address when connecting to any RTSP server. This implies 7910 that for TLS, the client will authenticate the proxy server and not 7911 the end server. Note that when the client checks the server 7912 certificate in TLS, it MUST check the proxy's identity (URI or 7913 possibly other known identity) against the proxy's identity as 7914 presented in the proxy's Certificate message. 7916 The problem is that for a proxy accepted by the client, the proxy 7917 needs to be provided information on which grounds it should accept 7918 the next-hop certificate. Both the proxy and the user may have rules 7919 for this, and the user should have the possibility to select the 7920 desired behavior. To handle this case, the Accept-Credentials header 7921 (See Section 18.2) is used, where the client can request the proxy/ 7922 proxies to relay back the chain of certificates used to authenticate 7923 any intermediate proxies as well as the server. The assumption that 7924 the proxies are viewed as trusted, gives the user a possibility to 7925 enforce policies to each trusted proxy of whether it should accept 7926 the next agent in the chain. However, it should be noted that not 7927 all deployments will return the chain of certificates used to 7928 authenticate any intermediate proxies as well as the server. An 7929 operator of such a deployment may want to hide its topology from the 7930 client. It should be noted well that the client does not have any 7931 insight into the proxy's operation. Even if the proxy is trusted, it 7932 can still return an incomplete chain of certificates. 7934 A proxy MUST use TLS for the next hop if the RTSP request includes a 7935 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between 7936 client and proxy, or between proxy and proxy), even if the resource 7937 and the end server are not required to use it. The proxy MUST, when 7938 initiating the next hop TLS connection, use the incoming TLS 7939 connections cipher suite list, only modified by removing any cipher 7940 suites that the proxy does not support. In case a proxy fails to 7941 establish a TLS connection due to cipher suite mismatch between proxy 7942 and next hop proxy or server, this is indicated using error code 472 7943 (Failure to establish secure connection). 7945 19.3.1. Accept-Credentials 7947 The Accept-Credentials header can be used by the client to distribute 7948 simple authorization policies to intermediate proxies. The client 7949 includes the Accept-Credentials header to dictate how the proxy 7950 treats the server/next proxy certificate. There are currently three 7951 methods defined: 7953 Any, which means that the proxy (or proxies) MUST accept whatever 7954 certificate presented. This is of course not a recommended 7955 option to use, but may be useful in certain circumstances (such 7956 as testing). 7958 Proxy, which means that the proxy (or proxies) MUST use its own 7959 policies to validate the certificate and decide whether to 7960 accept it or not. This is convenient in cases where the user 7961 has a strong trust relation with the proxy. Reasons why a 7962 strong trust relation may exist are; personal/company proxy, 7963 proxy has a out-of-band policy configuration mechanism. 7965 User, which means that the proxy (or proxies) MUST send credential 7966 information about the next hop to the client for authorization. 7967 The client can then decide whether the proxy should accept the 7968 certificate or not. See Section 19.3.2 for further details. 7970 If the Accept-Credentials header is not included in the RTSP request 7971 from the client, then the "Proxy" method MUST be used as default. If 7972 another method than the "Proxy" is to be used, then the Accept- 7973 Credentials header MUST be included in all of the RTSP requests from 7974 the client. This is because it cannot be assumed that the proxy 7975 always keeps the TLS state or the user's previous preference between 7976 different RTSP messages (in particular if the time interval between 7977 the messages is long). 7979 With the "Any" and "Proxy" methods the proxy will apply the policy as 7980 defined for each method. If the policy does not accept the 7981 credentials of the next hop, the proxy MUST respond with a message 7982 using status code 471 (Connection Credentials not accepted). 7984 An RTSP request in the direction server to client MUST NOT include 7985 the Accept-Credentials header. As for the non-secured communication, 7986 the possibility for these requests depends on the presence of a 7987 client established connection. However, if the server to client 7988 request is in relation to a session established over a TLS secured 7989 channel, it MUST be sent in a TLS secured connection. That secured 7990 connection MUST also be the one used by the last client to server 7991 request. If no such transport connection exists at the time when the 7992 server desires to send the request, the server MUST discard the 7993 message. 7995 Further policies MAY be defined and registered, but should be done so 7996 with caution. 7998 19.3.2. User approved TLS procedure 8000 For the "User" method, each proxy MUST perform the following 8001 procedure for each RTSP request: 8003 o Setup the TLS session to the next hop if not already present (i.e. 8004 run the TLS handshake, but do not send the RTSP request). 8006 o Extract the peer certificate chain for the TLS session. 8008 o Check if a matching identity and hash of the peer certificate is 8009 present in the Accept-Credentials header. If present, send the 8010 message to the next hop, and conclude these procedures. If not, 8011 go to the next step. 8013 o The proxy responds to the RTSP request with a 470 or 407 response 8014 code. The 407 response code MAY be used when the proxy requires 8015 both user and connection authorization from user or client. In 8016 this message the proxy MUST include a Connection-Credentials 8017 header, see Section 18.12 with the next hop's identity and 8018 certificate. 8020 The client MUST upon receiving a 470 or 407 response with Connection- 8021 Credentials header take the decision on whether to accept the 8022 certificate or not (if it cannot do so, the user SHOULD be 8023 consulted). If the certificate is accepted, the client has to again 8024 send the RTSP request. In that request the client has to include the 8025 Accept-Credentials header including the hash over the DER encoded 8026 certificate for all trusted proxies in the chain. 8028 Example: 8030 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8031 CSeq: 2 8032 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8033 "192.0.2.5:4589" 8034 Accept-Ranges: NPT, SMPTE, UTC 8035 Accept-Credentials: User 8037 P->C: RTSP/2.0 470 Connection Authorization Required 8038 CSeq: 2 8039 Connection-Credentials: "rtsps://test.example.org"; 8040 MIIDNTCCAp... 8042 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8043 CSeq: 3 8044 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8045 "192.0.2.5:4589" 8046 Accept-Credentials: User "rtsps://test.example.org";sha-256; 8047 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 8048 Accept-Ranges: NPT, SMPTE, UTC 8050 P->S: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8051 CSeq: 3 8052 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8053 "192.0.2.5:4589" 8054 Via: RTSP/2.0 proxy.example.org 8055 Accept-Credentials: User "rtsps://test.example.org";sha-256; 8056 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 8057 Accept-Ranges: NPT, SMPTE, UTC 8059 One implication of this process is that the connection for secured 8060 RTSP messages may take significantly more round-trip times for the 8061 first message. A complete extra message exchange between the proxy 8062 connecting to the next hop and the client results because of the 8063 process for approval for each hop. However, if each message contains 8064 the chain of proxies that the requester accepts, the remaining 8065 message exchange should not be delayed. The procedure of including 8066 the credentials in each request rather than building state in each 8067 proxy, avoids the need for revocation procedures. 8069 20. Syntax 8071 The RTSP syntax is described in an Augmented Backus-Naur Form (ABNF) 8072 as defined in RFC 5234 [RFC5234]. It uses the basic definitions 8073 present in RFC 5234. 8075 Please note that ABNF strings, e.g. "Accept", are case insensitive 8076 as specified in section 2.3 of RFC 5234. 8078 The RTSP syntax makes use of the ISO 10646 character set in UTF-8 8079 encoding RFC 3629 [RFC3629]. 8081 20.1. Base Syntax 8083 RTSP header values can be folded onto multiple lines if the 8084 continuation line begins with a space or horizontal tab. All linear 8085 white space, including folding, has the same semantics as SP. A 8086 recipient MAY replace any linear white space with a single SP before 8087 interpreting the field value or forwarding the message downstream. 8088 This is intended to behave exactly as HTTP/1.1 as described in RFC 8089 2616 [RFC2616]. The SWS construct is used when linear white space is 8090 optional, generally between tokens and separators. 8092 To separate the header name from the rest of value, a colon is used, 8093 which, by the above rule, allows whitespace before, but no line 8094 break, and whitespace after, including a line break. The HCOLON 8095 defines this construct. 8097 OCTET = %x00-FF ; any 8-bit sequence of data 8098 CHAR = %x01-7F ; any US-ASCII character (octets 1 - 127) 8099 UPALPHA = %x41-5A ; any US-ASCII uppercase letter "A".."Z" 8100 LOALPHA = %x61-7A ;any US-ASCII lowercase letter "a".."z" 8101 ALPHA = UPALPHA / LOALPHA 8102 DIGIT = %x30-39 ; any US-ASCII digit "0".."9" 8103 CTL = %x00-1F / %x7F ; any US-ASCII control character 8104 ; (octets 0 - 31) and DEL (127) 8105 CR = %x0D ; US-ASCII CR, carriage return (13) 8106 LF = %x0A ; US-ASCII LF, linefeed (10) 8107 SP = %x20 ; US-ASCII SP, space (32) 8108 HT = %x09 ; US-ASCII HT, horizontal-tab (9) 8109 BACKSLASH = %x5C ; US-ASCII backslash (92) 8110 CRLF = CR LF 8111 LWS = [CRLF] 1*( SP / HT ) ; Line-breaking White Space 8112 SWS = [LWS] ; Separating White Space 8113 HCOLON = *( SP / HT ) ":" SWS 8114 TEXT = %x20-7E / %x80-FF ; any OCTET except CTLs 8115 tspecials = "(" / ")" / "<" / ">" / "@" 8116 / "," / ";" / ":" / BACKSLASH / DQUOTE 8117 / "/" / "[" / "]" / "?" / "=" 8118 / "{" / "}" / SP / HT 8119 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 8120 / %x41-5A / %x5E-7A / %x7C / %x7E) 8121 ; 1* 8122 quoted-string = ( DQUOTE *qdtext DQUOTE ) 8123 qdtext = %x20-21 / %x23-5B / %x5D-7E / quoted-pair 8124 / UTF8-NONASCII 8125 ; No DQUOTE and no "\" 8126 quoted-pair = "\\" / ( "\" DQUOTE ) 8127 ctext = %x20-27 / %x2A-7E 8128 / %x80-FF ; any OCTET except CTLs, "(" and ")" 8129 generic-param = token [ EQUAL gen-value ] 8130 gen-value = token / host / quoted-string 8132 safe = "$" / "-" / "_" / "." / "+" 8133 extra = "!" / "*" / "'" / "(" / ")" / "," 8134 rtsp-extra = "!" / "*" / "'" / "(" / ")" 8136 HEX = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" 8137 / "a" / "b" / "c" / "d" / "e" / "f" 8138 LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" 8139 ; lowercase "a-f" Hex 8140 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 8142 unreserved = ALPHA / DIGIT / safe / extra 8143 rtsp-unreserved = ALPHA / DIGIT / safe / rtsp-extra 8145 base64 = *base64-unit [base64-pad] 8146 base64-unit = 4base64-char 8147 base64-pad = (2base64-char "==") / (3base64-char "=") 8148 base64-char = ALPHA / DIGIT / "+" / "/" 8149 SLASH = SWS "/" SWS ; slash 8150 EQUAL = SWS "=" SWS ; equal 8151 LPAREN = SWS "(" SWS ; left parenthesis 8152 RPAREN = SWS ")" SWS ; right parenthesis 8153 COMMA = SWS "," SWS ; comma 8154 SEMI = SWS ";" SWS ; semicolon 8155 COLON = SWS ":" SWS ; colon 8156 MINUS = SWS "-" SWS ; minus/dash 8157 LDQUOT = SWS DQUOTE ; open double quotation mark 8158 RDQUOT = DQUOTE SWS ; close double quotation mark 8159 RAQUOT = ">" SWS ; right angle quote 8160 LAQUOT = SWS "<" ; left angle quote 8162 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 8163 UTF8-NONASCII = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4 8164 UTF8-CONT = %x80-BF 8166 POS-FLOAT = 1*12DIGIT ["." 1*9DIGIT] 8167 FLOAT = ["-"] POS-FLOAT 8169 20.2. RTSP Protocol Definition 8171 20.2.1. Generic Protocol elements 8172 RTSP-IRI = schemes ":" IRI-rest 8173 IRI-rest = ihier-part [ "?" iquery ] 8174 ihier-part = "//" iauthority ipath-abempty 8175 RTSP-IRI-ref = RTSP-IRI / irelative-ref 8176 irelative-ref = irelative-part [ "?" iquery ] 8177 irelative-part = "//" iauthority ipath-abempty 8178 / ipath-absolute 8179 / ipath-noscheme 8180 / ipath-empty 8182 iauthority = < As defined in RFC 3987> 8183 ipath = ipath-abempty ; begins with "/" or is empty 8184 / ipath-absolute ; begins with "/" but not "//" 8185 / ipath-noscheme ; begins with a non-colon segment 8186 / ipath-rootless ; begins with a segment 8187 / ipath-empty ; zero characters 8189 ipath-abempty = *( "/" isegment ) 8190 ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] 8191 ipath-noscheme = isegment-nz-nc *( "/" isegment ) 8192 ipath-rootless = isegment-nz *( "/" isegment ) 8193 ipath-empty = 0 8195 isegment = *ipchar [";" *ipchar] 8196 isegment-nz = 1*ipchar [";" *ipchar] 8197 / ";" *ipchar 8198 isegment-nz-nc = (1*ipchar-nc [";" *ipchar-nc]) 8199 / ";" *ipchar-nc 8200 ; non-zero-length segment without any colon ":" 8202 ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" 8203 ipchar-nc = iunreserved / pct-encoded / sub-delims / "@" 8205 iquery = < As defined in RFC 3987> 8206 iunreserved = < As defined in RFC 3987> 8207 pct-encoded = < As defined in RFC 3987> 8208 RTSP-URI = schemes ":" URI-rest 8209 RTSP-REQ-URI = schemes ":" URI-req-rest 8210 RTSP-URI-Ref = RTSP-URI / RTSP-Relative 8211 RTSP-REQ-Ref = RTSP-REQ-URI / RTSP-REQ-Rel 8212 schemes = "rtsp" / "rtsps" / scheme 8213 scheme = < As defined in RFC 3986> 8214 URI-rest = hier-part [ "?" query ] 8215 URI-req-rest = hier-part [ "?" query ] 8216 ; Note fragment part not allowed in requests 8217 hier-part = "//" authority path-abempty 8219 RTSP-Relative = relative-part [ "?" query ] 8220 RTSP-REQ-Rel = relative-part [ "?" query ] 8221 relative-part = "//" authority path-abempty 8222 / path-absolute 8223 / path-noscheme 8224 / path-empty 8226 authority = < As defined in RFC 3986> 8227 query = < As defined in RFC 3986> 8229 path = path-abempty ; begins with "/" or is empty 8230 / path-absolute ; begins with "/" but not "//" 8231 / path-noscheme ; begins with a non-colon segment 8232 / path-rootless ; begins with a segment 8233 / path-empty ; zero characters 8235 path-abempty = *( "/" segment ) 8236 path-absolute = "/" [ segment-nz *( "/" segment ) ] 8237 path-noscheme = segment-nz-nc *( "/" segment ) 8238 path-rootless = segment-nz *( "/" segment ) 8239 path-empty = 0 8241 segment = *pchar [";" *pchar] 8242 segment-nz = ( 1*pchar [";" *pchar]) / (";" *pchar) 8243 segment-nz-nc = ( 1*pchar-nc [";" *pchar-nc]) / (";" *pchar-nc) 8244 ; non-zero-length segment without any colon ":" 8246 pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 8247 pchar-nc = unreserved / pct-encoded / sub-delims / "@" 8249 sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 8250 / "*" / "+" / "," / "=" 8252 smpte-range = smpte-type ["=" smpte-range-spec] 8253 ; See section 3.4 8254 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 8255 / ( "-" smpte-time ) 8256 smpte-type = "smpte" / "smpte-30-drop" 8257 / "smpte-25" / smpte-type-extension 8258 ; other timecodes may be added 8259 smpte-type-extension = "smpte" token 8260 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 8261 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 8263 npt-range = "npt" ["=" npt-range-spec] 8264 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 8265 npt-time = "now" / npt-sec / npt-hhmmss 8266 npt-sec = 1*19DIGIT [ "." 1*9DIGIT ] 8267 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ] 8268 npt-hh = 1*19DIGIT ; any positive number 8269 npt-mm = 1*2DIGIT ; 0-59 8270 npt-ss = 1*2DIGIT ; 0-59 8272 utc-range = "clock" ["=" utc-range-spec] 8273 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 8274 utc-time = utc-date "T" utc-clock "Z" 8275 utc-date = 8DIGIT 8276 utc-clock = 6DIGIT [ "." 1*9DIGIT ] 8278 feature-tag = token 8280 session-id = 1*256( ALPHA / DIGIT / safe ) 8282 extension-header = header-name HCOLON header-value 8283 header-name = token 8284 header-value = *(TEXT-UTF8char / UTF8-CONT / LWS) 8286 20.2.2. Message Syntax 8287 RTSP-message = Request / Response ; RTSP/2.0 messages 8289 Request = Request-Line 8290 *((general-header 8291 / request-header 8292 / message-header) CRLF) 8293 CRLF 8294 [ message-body-data ] 8296 Response = Status-Line 8297 *((general-header 8298 / response-header 8299 / message-header) CRLF) 8300 CRLF 8301 [ message-body-data ] 8303 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 8305 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 8306 Method = "DESCRIBE" 8307 / "GET_PARAMETER" 8308 / "OPTIONS" 8309 / "PAUSE" 8310 / "PLAY" 8311 / "PLAY_NOTIFY" 8312 / "REDIRECT" 8313 / "SETUP" 8314 / "SET_PARAMETER" 8315 / "TEARDOWN" 8316 / extension-method 8318 extension-method = token 8320 Request-URI = "*" / RTSP-REQ-URI 8321 RTSP-Version = "RTSP/" 1*DIGIT "." 1*DIGIT 8323 message-body-data = 1*OCTET 8325 Status-Code = "100" ; Continue 8326 / "200" ; OK 8327 / "301" ; Moved Permanently 8328 / "302" ; Found 8329 / "303" ; See Other 8330 / "304" ; Not Modified 8331 / "305" ; Use Proxy 8332 / "400" ; Bad Request 8333 / "401" ; Unauthorized 8334 / "402" ; Payment Required 8335 / "403" ; Forbidden 8336 / "404" ; Not Found 8337 / "405" ; Method Not Allowed 8338 / "406" ; Not Acceptable 8339 / "407" ; Proxy Authentication Required 8340 / "408" ; Request Time-out 8341 / "410" ; Gone 8342 / "411" ; Length Required 8343 / "412" ; Precondition Failed 8344 / "413" ; Request Message Body Too Large 8345 / "414" ; Request-URI Too Large 8346 / "415" ; Unsupported Media Type 8347 / "451" ; Parameter Not Understood 8348 / "452" ; reserved 8349 / "453" ; Not Enough Bandwidth 8350 / "454" ; Session Not Found 8351 / "455" ; Method Not Valid in This State 8352 / "456" ; Header Field Not Valid for Resource 8353 / "457" ; Invalid Range 8354 / "458" ; Parameter Is Read-Only 8355 / "459" ; Aggregate operation not allowed 8356 / "460" ; Only aggregate operation allowed 8357 / "461" ; Unsupported Transport 8358 / "462" ; Destination Unreachable 8359 / "463" ; Destination Prohibited 8360 / "464" ; Data Transport Not Ready Yet 8361 / "465" ; Notification Reason Unknown 8362 / "466" ; Key Management Error 8363 / "470" ; Connection Authorization Required 8364 / "471" ; Connection Credentials not accepted 8365 / "472" ; Failure to establish secure connection 8366 / "500" ; Internal Server Error 8367 / "501" ; Not Implemented 8368 / "502" ; Bad Gateway 8369 / "503" ; Service Unavailable 8370 / "504" ; Gateway Time-out 8371 / "505" ; RTSP Version not supported 8372 / "551" ; Option not supported 8373 / extension-code 8375 extension-code = 3DIGIT 8377 Reason-Phrase = 1*(TEXT-UTF8char / HT / SP) 8378 general-header = Cache-Control 8379 / Connection 8380 / CSeq 8381 / Date 8382 / Media-Properties 8383 / Media-Range 8384 / Pipelined-Requests 8385 / Proxy-Supported 8386 / Seek-Style 8387 / Server 8388 / Supported 8389 / Timestamp 8390 / User-Agent 8391 / Via 8392 / extension-header 8394 request-header = Accept 8395 / Accept-Credentials 8396 / Accept-Encoding 8397 / Accept-Language 8398 / Authorization 8399 / Bandwidth 8400 / Blocksize 8401 / From 8402 / If-Match 8403 / If-Modified-Since 8404 / If-None-Match 8405 / Notify-Reason 8406 / Proxy-Require 8407 / Range 8408 / Referrer 8409 / Request-Status 8410 / Require 8411 / Scale 8412 / Session 8413 / Speed 8414 / Supported 8415 / Terminate-Reason 8416 / Transport 8417 / extension-header 8419 response-header = Accept-Credentials 8420 / Accept-Ranges 8421 / Connection-Credentials 8422 / MTag 8423 / Location 8424 / Proxy-Authenticate 8425 / Public 8426 / Range 8427 / Retry-After 8428 / RTP-Info 8429 / Scale 8430 / Session 8431 / Speed 8432 / Transport 8433 / Unsupported 8434 / WWW-Authenticate 8435 / extension-header 8437 message-header = Allow 8438 / Content-Base 8439 / Content-Encoding 8440 / Content-Language 8441 / Content-Length 8442 / Content-Location 8443 / Content-Type 8444 / Expires 8445 / Last-Modified 8446 / extension-header 8448 20.2.3. Header Syntax 8450 Accept = "Accept" HCOLON 8451 [ accept-range *(COMMA accept-range) ] 8452 accept-range = media-type-range [SEMI accept-params] 8453 media-type-range = ( "*/*" 8454 / ( m-type SLASH "*" ) 8455 / ( m-type SLASH m-subtype ) 8456 ) *( SEMI m-parameter ) 8457 accept-params = "q" EQUAL qvalue *(SEMI generic-param ) 8458 qvalue = ( "0" [ "." *3DIGIT ] ) 8459 / ( "1" [ "." *3("0") ] ) 8460 Accept-Credentials = "Accept-Credentials" HCOLON cred-decision 8461 cred-decision = ("User" [LWS cred-info]) 8462 / "Proxy" 8463 / "Any" 8464 / (token [LWS 1*header-value]) 8465 ; For future extensions 8467 cred-info = cred-info-data *(COMMA cred-info-data) 8469 cred-info-data = DQUOTE RTSP-REQ-URI DQUOTE SEMI hash-alg 8470 SEMI base64 8471 hash-alg = "sha-256" / extension-alg 8472 extension-alg = token 8473 Accept-Encoding = "Accept-Encoding" HCOLON 8474 [ encoding *(COMMA encoding) ] 8475 encoding = codings [SEMI accept-params] 8476 codings = content-coding / "*" 8477 content-coding = token 8478 Accept-Language = "Accept-Language" HCOLON 8479 language *(COMMA language) 8480 language = language-range [SEMI accept-params] 8481 language-range = language-tag / "*" 8482 language-tag = primary-tag *( "-" subtag ) 8483 primary-tag = 1*8ALPHA 8484 subtag = 1*8ALPHA 8485 Accept-Ranges = "Accept-Ranges" HCOLON acceptable-ranges 8486 acceptable-ranges = (range-unit *(COMMA range-unit)) 8487 range-unit = "NPT" / "SMPTE" / "UTC" / extension-format 8488 extension-format = token 8489 Allow = "Allow" HCOLON Method *(COMMA Method) 8490 Authorization = "Authorization" HCOLON credentials 8491 credentials = ("Digest" LWS digest-response) 8492 / other-response 8493 digest-response = dig-resp *(COMMA dig-resp) 8494 dig-resp = username / realm / nonce / digest-uri 8495 / dresponse / algorithm / cnonce 8496 / opaque / message-qop 8497 / nonce-count / auth-param 8498 username = "username" EQUAL username-value 8499 username-value = quoted-string 8500 digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT 8501 digest-uri-value = RTSP-REQ-URI 8502 message-qop = "qop" EQUAL qop-value 8503 cnonce = "cnonce" EQUAL cnonce-value 8504 cnonce-value = nonce-value 8505 nonce-count = "nc" EQUAL nc-value 8506 nc-value = 8LHEX 8507 dresponse = "response" EQUAL request-digest 8508 request-digest = LDQUOT 32LHEX RDQUOT 8509 auth-param = auth-param-name EQUAL 8510 ( token / quoted-string ) 8511 auth-param-name = token 8512 other-response = auth-scheme LWS auth-param 8513 *(COMMA auth-param) 8514 auth-scheme = token 8515 Bandwidth = "Bandwidth" HCOLON 1*19DIGIT 8517 Blocksize = "Blocksize" HCOLON 1*9DIGIT 8519 Cache-Control = "Cache-Control" HCOLON cache-directive 8520 *(COMMA cache-directive) 8521 cache-directive = cache-rqst-directive 8522 / cache-rspns-directive 8524 cache-rqst-directive = "no-cache" 8525 / "max-stale" [EQUAL delta-seconds] 8526 / "min-fresh" EQUAL delta-seconds 8527 / "only-if-cached" 8528 / cache-extension 8530 cache-rspns-directive = "public" 8531 / "private" 8532 / "no-cache" 8533 / "no-transform" 8534 / "must-revalidate" 8535 / "proxy-revalidate" 8536 / "max-age" EQUAL delta-seconds 8537 / cache-extension 8539 cache-extension = token [EQUAL (token / quoted-string)] 8540 delta-seconds = 1*19DIGIT 8542 Connection = "Connection" HCOLON connection-token 8543 *(COMMA connection-token) 8544 connection-token = "close" / token 8546 Connection-Credentials = "Connection-Credentials" HCOLON cred-chain 8547 cred-chain = DQUOTE RTSP-REQ-URI DQUOTE SEMI base64 8549 Content-Base = "Content-Base" HCOLON RTSP-URI 8550 Content-Encoding = "Content-Encoding" HCOLON 8551 content-coding *(COMMA content-coding) 8552 Content-Language = "Content-Language" HCOLON 8553 language-tag *(COMMA language-tag) 8554 Content-Length = "Content-Length" HCOLON 1*19DIGIT 8555 Content-Location = "Content-Location" HCOLON RTSP-REQ-Ref 8556 Content-Type = "Content-Type" HCOLON media-type 8557 media-type = m-type SLASH m-subtype *(SEMI m-parameter) 8558 m-type = discrete-type / composite-type 8559 discrete-type = "text" / "image" / "audio" / "video" 8560 / "application" / extension-token 8561 composite-type = "message" / "multipart" / extension-token 8562 extension-token = ietf-token / x-token 8563 ietf-token = token 8564 x-token = "x-" token 8565 m-subtype = extension-token / iana-token 8566 iana-token = token 8567 m-parameter = m-attribute EQUAL m-value 8568 m-attribute = token 8569 m-value = token / quoted-string 8571 CSeq = "CSeq" HCOLON cseq-nr 8572 cseq-nr = 1*9DIGIT 8573 Date = "Date" HCOLON RTSP-date 8574 RTSP-date = rfc1123-date ; HTTP-date 8575 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 8576 date1 = 2DIGIT SP month SP 4DIGIT 8577 ; day month year (e.g., 02 Jun 1982) 8578 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 8579 ; 00:00:00 - 23:59:59 8580 wkday = "Mon" / "Tue" / "Wed" 8581 / "Thu" / "Fri" / "Sat" / "Sun" 8582 month = "Jan" / "Feb" / "Mar" / "Apr" 8583 / "May" / "Jun" / "Jul" / "Aug" 8584 / "Sep" / "Oct" / "Nov" / "Dec" 8586 Expires = "Expires" HCOLON RTSP-date 8587 From = "From" HCOLON from-spec 8588 from-spec = ( name-addr / addr-spec ) *( SEMI from-param ) 8589 name-addr = [ display-name ] LAQUOT addr-spec RAQUOT 8590 addr-spec = RTSP-REQ-URI / absolute-URI 8591 absolute-URI = < As defined in RFC 3986> 8592 display-name = *(token LWS) / quoted-string 8593 from-param = tag-param / generic-param 8594 tag-param = "tag" EQUAL token 8595 If-Match = "If-Match" HCOLON ("*" / message-tag-list) 8596 message-tag-list = message-tag *(COMMA message-tag) 8597 message-tag = [ weak ] opaque-tag 8598 weak = "W/" 8599 opaque-tag = quoted-string 8600 If-Modified-Since = "If-Modified-Since" HCOLON RTSP-date 8601 If-None-Match = "If-None-Match" HCOLON ("*" / message-tag-list) 8602 Last-Modified = "Last-Modified" HCOLON RTSP-date 8603 Location = "Location" HCOLON RTSP-REQ-URI 8604 Media-Properties = "Media-Properties" HCOLON [media-prop-list] 8605 media-prop-list = media-prop-value *(COMMA media-prop-value) 8606 media-prop-value = ("Random-Access" [EQUAL POS-FLOAT]) 8607 / "Begining-Only" 8608 / "No-Seeking" 8609 / "Immutable" 8610 / "Dynamic" 8611 / "Time-Progressing" 8612 / "Unlimited" 8613 / ("Time-Limited" EQUAL utc-time) 8614 / ("Time-Duration" EQUAL POS-FLOAT) 8615 / ("Scales" EQUAL scale-value-list) 8616 / media-prop-ext 8617 media-prop-ext = token [EQUAL (1*rtsp-unreserved / quoted-string)] 8618 scale-value-list = DQUOTE scale-entry *(COMMA scale-entry) DQUOTE 8619 scale-entry = scale-value / (scale-value COLON scale-value) 8620 scale-value = FLOAT 8621 Media-Range = "Media-Range" HCOLON [ranges-list] 8622 ranges-list = ranges-spec *(COMMA ranges-spec) 8623 MTag = "MTag" HCOLON message-tag 8624 Notify-Reason = "Notify-Reason" HCOLON Notify-Reas-val 8625 Notify-Reas-val = "end-of-stream" 8626 / "media-properties-update" 8627 / "scale-change" 8628 / Notify-Reason-extension 8629 Notify-Reason-extension = token 8630 Pipelined-Requests = "Pipelined-Requests" HCOLON startup-id 8631 startup-id = 1*8DIGIT 8633 Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge-list 8634 challenge-list = challenge *(COMMA challenge) 8635 challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) 8636 / other-challenge 8637 other-challenge = auth-scheme LWS auth-param 8638 *(COMMA auth-param) 8639 digest-cln = realm / domain / nonce 8640 / opaque / stale / algorithm 8641 / qop-options / auth-param 8642 realm = "realm" EQUAL realm-value 8643 realm-value = quoted-string 8644 domain = "domain" EQUAL LDQUOT RTSP-REQ-Ref 8645 *(1*SP RTSP-REQ-Ref ) RDQUOT 8646 nonce = "nonce" EQUAL nonce-value 8647 nonce-value = quoted-string 8648 opaque = "opaque" EQUAL quoted-string 8649 stale = "stale" EQUAL ( "true" / "false" ) 8650 algorithm = "algorithm" EQUAL ("MD5" / "MD5-sess" / token) 8651 qop-options = "qop" EQUAL LDQUOT qop-value 8652 *("," qop-value) RDQUOT 8653 qop-value = "auth" / "auth-int" / token 8654 Proxy-Require = "Proxy-Require" HCOLON feature-tag-list 8655 feature-tag-list = feature-tag *(COMMA feature-tag) 8656 Proxy-Supported = "Proxy-Supported" HCOLON [feature-tag-list] 8658 Public = "Public" HCOLON Method *(COMMA Method) 8660 Range = "Range" HCOLON ranges-spec 8662 ranges-spec = npt-range / utc-range / smpte-range 8663 / range-ext 8664 range-ext = extension-format ["=" range-value] 8665 range-value = 1*(rtsp-unreserved / quoted-string / ":" ) 8667 Referrer = "Referrer" HCOLON (absolute-URI / RTSP-URI-Ref) 8668 Request-Status = "Request-Status" HCOLON req-status-info 8669 req-status-info = cseq-info LWS status-info LWS reason-info 8670 cseq-info = "cseq" EQUAL cseq-nr 8671 status-info = "status" EQUAL Status-Code 8672 reason-info = "reason" EQUAL DQUOTE Reason-Phrase DQUOTE 8673 Require = "Require" HCOLON feature-tag-list 8674 RTP-Info = "RTP-Info" HCOLON [rtsp-info-spec 8675 *(COMMA rtsp-info-spec)] 8676 rtsp-info-spec = stream-url 1*ssrc-parameter 8677 stream-url = "url" EQUAL DQUOTE RTSP-REQ-Ref DQUOTE 8678 ssrc-parameter = LWS "ssrc" EQUAL ssrc HCOLON 8679 ri-parameter *(SEMI ri-parameter) 8680 ri-parameter = ("seq" EQUAL 1*5DIGIT) 8681 / ("rtptime" EQUAL 1*10DIGIT) 8682 / generic-param 8684 Retry-After = "Retry-After" HCOLON ( RTSP-date / delta-seconds ) 8685 Scale = "Scale" HCOLON scale-value 8686 Seek-Style = "Seek-Style" HCOLON Seek-S-values 8687 Seek-S-values = "RAP" 8688 / "CoRAP" 8689 / "First-Prior" 8690 / "Next" 8691 / Seek-S-value-ext 8692 Seek-S-value-ext = token 8694 Server = "Server" HCOLON ( product / comment ) 8695 *(LWS (product / comment)) 8696 product = token [SLASH product-version] 8697 product-version = token 8698 comment = LPAREN *( ctext / quoted-pair) RPAREN 8700 Session = "Session" HCOLON session-id 8701 [ SEMI "timeout" EQUAL delta-seconds ] 8703 Speed = "Speed" HCOLON lower-bound MINUS upper-bound 8704 lower-bound = POS-FLOAT 8705 upper-bound = POS-FLOAT 8707 Supported = "Supported" HCOLON [feature-tag-list] 8708 Terminate-Reason = "Terminate-Reason" HCOLON TR-Info 8709 TR-Info = TR-Reason *(SEMI TR-Parameter) 8710 TR-Reason = "Session-Timeout" 8711 / "Server-Admin" 8712 / "Internal-Error" 8713 / token 8714 TR-Parameter = TR-time / TR-user-msg / generic-param 8715 TR-time = "time" EQUAL utc-time 8716 TR-user-msg = "user-msg" EQUAL quoted-string 8718 Timestamp = "Timestamp" HCOLON timestamp-value [LWS delay] 8719 timestamp-value = *19DIGIT [ "." *9DIGIT ] 8720 delay = *9DIGIT [ "." *9DIGIT ] 8722 Transport = "Transport" HCOLON transport-spec 8723 *(COMMA transport-spec) 8724 transport-spec = transport-id *trns-parameter 8725 transport-id = trans-id-rtp / other-trans 8726 trans-id-rtp = "RTP/" profile ["/" lower-transport] 8727 ; no LWS is allowed inside transport-id 8728 other-trans = token *("/" token) 8730 profile = "AVP" / "SAVP" / "AVPF" / "SAVPF" / token 8731 lower-transport = "TCP" / "UDP" / token 8732 trns-parameter = (SEMI ( "unicast" / "multicast" )) 8733 / (SEMI "interleaved" EQUAL channel [ "-" channel ]) 8734 / (SEMI "ttl" EQUAL ttl) 8735 / (SEMI "layers" EQUAL 1*DIGIT) 8736 / (SEMI "ssrc" EQUAL ssrc *(SLASH ssrc)) 8737 / (SEMI "mode" EQUAL mode-spec) 8738 / (SEMI "dest_addr" EQUAL addr-list) 8739 / (SEMI "src_addr" EQUAL addr-list) 8740 / (SEMI "setup" EQUAL contrans-setup) 8741 / (SEMI "connection" EQUAL contrans-con) 8742 / (SEMI "RTCP-mux") 8743 / (SEMI "MIKEY" EQUAL MIKEY-Value) 8744 / (SEMI trn-param-ext) 8745 contrans-setup = "active" / "passive" / "actpass" 8746 contrans-con = "new" / "existing" 8747 trn-param-ext = par-name [EQUAL trn-par-value] 8748 par-name = token 8749 trn-par-value = *(rtsp-unreserved / quoted-string) 8750 ttl = 1*3DIGIT ; 0 to 255 8751 ssrc = 8HEX 8752 channel = 1*3DIGIT ; 0 to 255 8753 MIKEY-Value = base64 8754 mode-spec = ( DQUOTE mode *(COMMA mode) DQUOTE ) 8755 mode = "PLAY" / token 8756 addr-list = quoted-addr *(SLASH quoted-addr) 8757 quoted-addr = DQUOTE (host-port / extension-addr) DQUOTE 8758 host-port = ( host [":" port] ) 8759 / ( ":" port ) 8760 extension-addr = 1*qdtext 8761 host = < As defined in RFC 3986> 8762 port = < As defined in RFC 3986> 8763 Unsupported = "Unsupported" HCOLON feature-tag-list 8765 User-Agent = "User-Agent" HCOLON ( product / comment ) 8766 *(LWS (product / comment)) 8768 field-name-list = field-name *(COMMA field-name) 8769 field-name = token 8770 Via = "Via" HCOLON via-parm *(COMMA via-parm) 8771 via-parm = sent-protocol LWS sent-by *( SEMI via-params ) 8772 via-params = via-ttl / via-maddr 8773 / via-received / via-extension 8774 via-ttl = "ttl" EQUAL ttl 8775 via-maddr = "maddr" EQUAL host 8776 via-received = "received" EQUAL (IPv4address / IPv6address) 8777 IPv4address = < As defined in RFC 3986> 8778 IPv6address = < As defined in RFC 3986> 8779 via-extension = generic-param 8780 sent-protocol = protocol-name SLASH protocol-version 8781 SLASH transport-prot 8782 protocol-name = "RTSP" / token 8783 protocol-version = token 8784 transport-prot = "UDP" / "TCP" / "TLS" / other-transport 8785 other-transport = token 8786 sent-by = host [ COLON port ] 8788 WWW-Authenticate = "WWW-Authenticate" HCOLON challenge-list 8790 20.3. SDP extension Syntax 8792 This section defines in ABNF the SDP extensions defined for RTSP. 8793 See Appendix D for the definition of the extensions in text. 8795 control-attribute = "a=control:" *SP RTSP-REQ-Ref CRLF 8797 a-range-def = "a=range:" ranges-spec CRLF 8799 a-mtag-def = "a=mtag:" message-tag CRLF 8801 21. Security Considerations 8803 The security considerations and threats around RTSP and its usage can 8804 be divided into considerations around the signaling protocol itself 8805 and the issues related to the media stream delivery. However, when 8806 it comes to mitigations of security threats, a threat depending on 8807 the media stream delivery may in fact be mitigated by a mechanism in 8808 the signaling protocol. 8810 There are several chapters and appendix in this document that define 8811 security solutions for the protocol. We will reference them when 8812 discussing the threats below. But the reader should take special 8813 notice of the Security Framework (Section 19) and the specification 8814 of how to use SRTP and its key-mangement (Appendix C.1.4) to achieve 8815 certain aspects of the media security. 8817 21.1. Signaling Protocol Threats 8819 This section focuses on issues related to the signaling protocol. 8820 Because of the similarity in syntax and usage between RTSP servers 8821 and HTTP servers, the security considerations outlined in [H15] apply 8822 also. 8824 Specifically, please note the following: 8826 Abuse of Server Log Information: RTSP and HTTP servers will 8827 presumably have similar logging mechanisms, and thus should be 8828 equally guarded in protecting the contents of those logs, thus 8829 protecting the privacy of the users of the servers. See 8830 [H15.1.1] for HTTP server recommendations regarding server 8831 logs. 8833 Transfer of Sensitive Information: There is no reason to believe 8834 that information transferred or controlled via RTSP may be any 8835 less sensitive than that normally transmitted via HTTP. 8836 Therefore, all of the precautions regarding the protection of 8837 data privacy and user privacy apply to implementors of RTSP 8838 clients, servers, and proxies. See [H15.1.2] for further 8839 details. 8841 Attacks Based On File and Path Names: Though RTSP URIs are opaque 8842 handles that do not necessarily have file system semantics, it 8843 is anticipated that many implementations will translate 8844 portions of the Request-URIs directly to file system calls. In 8845 such cases, file systems SHOULD follow the precautions outlined 8846 in [H15.5], such as checking for ".." in path components. 8848 Personal Information: RTSP clients are often privy to the same 8849 information that HTTP clients are (user name, location, etc.) 8850 and thus should be equally sensitive. See [H15.1] for further 8851 recommendations. 8853 Privacy Issues Connected to Accept Headers: Since may of the same 8854 "Accept" headers exist in RTSP as in HTTP, the same caveats 8855 outlined in [H15.1.4] with regards to their use should be 8856 followed. 8858 DNS Spoofing: Presumably, given the longer connection times 8859 typically associated to RTSP sessions relative to HTTP 8860 sessions, RTSP client DNS optimizations should be less 8861 prevalent. Nonetheless, the recommendations provided in 8862 [H15.3] are still relevant to any implementation which attempts 8863 to rely on a DNS-to-IP mapping to hold beyond a single use of 8864 the mapping. 8866 Location Headers and Spoofing: If a single server supports multiple 8867 organizations that do not trust each another, then it MUST 8868 check the values of Location and Content-Location header fields 8869 in responses that are generated under control of said 8870 organizations to make sure that they do not attempt to 8871 invalidate resources over which they have no authority. 8872 ([H15.4]) 8874 In addition to the recommendations in the current HTTP specification 8875 (RFC 2616 [RFC2616], as of this writing) and also of the previous RFC 8876 2068 [RFC2068], future HTTP specifications may provide additional 8877 guidance on security issues. 8879 The following are added considerations for RTSP implementations. 8881 Session hijacking: Since there is no or little relation between a 8882 transport layer connection and an RTSP session, it is possible 8883 for a malicious client to issue requests with random session 8884 identifiers which could affect other clients of an unsuspecting 8885 server. To mitigate this the server SHALL use a large, random 8886 and non-sequential session identifier to minimize the 8887 possibility of this kind of attack. However, unless the RTSP 8888 signaling is always confidentiality protected, e.g. using TLS, 8889 an on-path attacker will be able to hijack a session. To 8890 prevent session hijacking client authentication needs to be 8891 performed and only the authenticated client creating the 8892 session SHALL be able to access that session. 8894 Authentication: Servers SHOULD implement both basic and digest 8895 [RFC2617] authentication. In environments requiring tighter 8896 security for the control messages, the transport layer 8897 mechanism TLS [RFC5246] SHOULD be used. 8899 Persistently suspicious behavior: RTSP servers SHOULD return error 8900 code 403 (Forbidden) upon receiving a single instance of 8901 behavior which is deemed a security risk. RTSP servers SHOULD 8902 also be aware of attempts to probe the server for weaknesses 8903 and entry points and MAY arbitrarily disconnect and ignore 8904 further requests from clients which are deemed to be in 8905 violation of local security policy. 8907 TLS through proxies: If one uses the possibility to connect TLS in 8908 multiple legs (Section 19.3) one really needs to be aware of 8909 the trust model. That procedure requires full faith and trust 8910 in all proxies, which will be identified, that one allows to 8911 connect through. They are men in the middle and have access to 8912 all that goes on over the TLS connection. Thus it is important 8913 to consider if that trust model is acceptable in the actual 8914 application. Further discussion of the actual trust model is 8915 in Section 19.3. 8917 Resource Exhaustion: As RTSP is a stateful protocol and establishes 8918 resource usage on the server there is a clear possibility to 8919 attack the server by trying to overbook these resources to 8920 perform a denial of service attack. This attack can be both 8921 against ongoing sessions and to prevent others from 8922 establishing sessions. RTSP agents will need to have 8923 mechanisms to prevent single peers from consuming extensive 8924 amounts of resources. The methods for guarding against this 8925 are varied and depends on the agent's role and capabilities and 8926 policies. Each implementation has to carefully consider their 8927 methods and policies to mitigate this threat. For example 8928 regarding handling of connections there are recommendations in 8929 Section 10.7. 8931 The above threats and considerations have resulted in a set of 8932 security functions and mechanisms built into or used by the protocol. 8933 The signaling protocol relies on two security features defined in the 8934 Security Framework (Section 19) namely client authentication using 8935 HTTP authentication and TLS based transport protection of the 8936 signaling messages. Both of these mechanisms are required to be 8937 implemented by any RTSP agent. 8939 A number of different security mitigations have been designed into 8940 the protocol and will be present by following the specification as 8941 written, for example by ensuring sufficient amount of entropy in the 8942 randomly generated session identifiers when not using client 8943 authentication to prevent session hijacking. When client 8944 authentication is used the protection against hijacking will be 8945 strongly improved by scoping the accessible sessions to the one this 8946 client identity has created. Some of the above threats are such that 8947 the implementation of the RTSP functionality itself needs to consider 8948 which policy and strategy it uses to mitigate them. 8950 21.2. Media Stream Delivery Threats 8952 The fact that RTSP establishes and controls a media stream delivery 8953 results in a set of security issues related to the media streams. 8954 This section will attempt to analyze general threats, however the 8955 choice of media stream transport protocol, like RTP will result in 8956 some differences in threats and what mechanisms that exist to 8957 mitigate them. Thus it becomes important that each specification of 8958 a new media stream transport and delivery protocol usable by RTSP 8959 requires its own security analysis. This section includes one for 8960 RTP. 8962 The set of general threats from or by the media stream delivery 8963 itself are: 8965 Concentrated denial-of-service attack: The protocol offers the 8966 opportunity for a remote-controlled denial-of-service (DoS) 8967 attack, where the media stream is the hammer in that DoS attack. 8968 See Section 21.2.1. 8970 Media Confidentiality: The media delivery may contain content of any 8971 type and it is not possible in general to determine how sensitive 8972 this content is from a confidentiality point. Thus it is a strong 8973 requirement that any media delivery protocol provides a method for 8974 providing confidentiality of the actual media content. In 8975 addition to the media level confidentiality it becomes critical 8976 that no resource identifiers used in the signaling are exposed to 8977 an attacker as they may have human understandable names, or may be 8978 also available to the attacker so they can determine the content 8979 the user was delivered. Thus also the signaling protocol must 8980 provide confidentiality protection of any information related to 8981 the media resource. 8983 Media Integrity and Authentication: There are several reasons, such 8984 as discrediting the target, misinformation of the target, why an 8985 attacker will have interest to substitute the media stream sent 8986 out from the RTSP server with one of the attacker's creation or 8987 selection. Therefore it is important that the media protocol 8988 provides mechanisms to verify the source authentication, integrity 8989 and prevent replay attacks on the media stream. 8991 Scope of Multicast: If RTSP is used to control the transmission of 8992 media onto a multicast network it is needed to consider the scope 8993 that delivery has. RTSP supports the TTL Transport header 8994 parameter to indicate this scope for IPv4. IPv6 has a different 8995 mechanism for scope boundary. However, such scope control has 8996 risks, as it may be set too large and distribute media beyond the 8997 intended scope. 8999 Below (Section 21.2.2) we do a protocol specific analysis of security 9000 considerations for RTP based media transport. In that section we 9001 also make clear the requirements on implementing security functions 9002 for RTSP agents supporting media delivery over RTP. 9004 21.2.1. Remote Denial of Service Attack 9006 The attacker may initiate traffic flows to one or more IP addresses 9007 by specifying them as the destination in SETUP requests. While the 9008 attacker's IP address may be known in this case, this is not always 9009 useful in prevention of more attacks or ascertaining the attackers 9010 identity. Thus, an RTSP server MUST only allow client-specified 9011 destinations for RTSP-initiated traffic flows if the server has 9012 ensured that the specified destination address accepts receiving 9013 media through different security mechanisms. Security mechanisms 9014 that are acceptable in an increased generality are: 9016 o Verification of the client's identity against a database of known 9017 users using RTSP authentication mechanisms (preferably digest 9018 authentication or stronger) 9020 o A list of addresses that accept to be media destinations, 9021 especially considering user identity 9023 o Media path based verification 9025 The server SHOULD NOT allow the destination field to be set unless a 9026 mechanism exists in the system to authorize the request originator to 9027 direct streams to the recipient. It is preferred that this 9028 authorization be performed by the media recipient (destination) 9029 itself and the credentials passed along to the server. However, in 9030 certain cases, such as when the recipient address is a multicast 9031 group, or when the recipient is unable to communicate with the server 9032 in an out-of-band manner, this may not be possible. In these cases 9033 the server may chose another method such as a server-resident 9034 authorization list to ensure that the request originator has the 9035 proper credentials to request stream delivery to the recipient. 9037 One solution that performs the necessary verification of acceptance 9038 of media suitable for unicast based delivery is the ICE based NAT 9039 traversal method described in [I-D.ietf-mmusic-rtsp-nat]. This 9040 mechanism uses random passwords and username so that the probability 9041 of unintended indication as a valid media destination is very low. 9042 In addition the server includes in its STUN requests a cookie 9043 (consisting of random material) that the destination echoes back, 9044 thus the solution also safe-guards against having an off-path 9045 attacker being able to spoof the STUN checks. This leaves this 9046 solution vulnerable only to on-path attackers that can see the STUN 9047 requests go to the target of attack and thus forge a response. 9049 For delivery to multicast addresses there is a need for another 9050 solution which is not specified in this memo. 9052 21.2.2. RTP Security analysis 9054 RTP is a commonly used media transport protocol and has been the most 9055 common choice for RTSP 1.0 implementations. The core RTP protocol 9056 has been in use for a long time and it has well-known security 9057 properties and the RTP security consideration (Section 9 of 9058 [RFC3550]) needs to be reviewed. In perspective of the usage of RTP 9059 in context of RTSP the following properties should be noted: 9061 Stream Additions: RTP has support for multiple simultaneous media 9062 streams in each RTP session. As some use cases require support 9063 for non-synchronized adding and removal of media streams and their 9064 identifiers an attacker can easily insert additional media streams 9065 into a session context that according to protocol design is 9066 intended to be played out. Another threat vector is one of denial 9067 of service by exhausting the resources of the RTP session 9068 receiver, for example by using a large number of SSRC identifiers 9069 simultaneously. The strong mitigation of this is to ensure that 9070 one cryptographically authenticates any incoming packet flow to 9071 the RTP session. Weak mitigations like blocking additional media 9072 streams in session contexts easily lead to a denial of service 9073 vulnerability in addition to preventing certain RTP extensions or 9074 use cases which rely on multiple media streams, such as RTP 9075 retransmission [RFC4588] to function. 9077 Forged Feedback: The built in RTP control Protocol (RTCP) also 9078 offers a large attack surface for a couple of different types of 9079 attacks. One venue is to send RTCP feedback to the media sender 9080 indicating large amounts of packet loss and thus trigger a media 9081 bit-rate adaptation response from the sender resulting in lowered 9082 media quality and potentially shut down of the media stream. 9083 Another attack is to perform a resource exhaustion attack on the 9084 receiver by using many SSRC identifiers to create large state 9085 tables and increase the RTCP related processing demands. 9087 RTP/RTCP Extensions: RTP and RTCP extensions generally provide 9088 additional and sometimes extremely powerful tools to do denial of 9089 service or service disruption. For example the Code Control 9090 Message [RFC5104] RTCP extensions enables both locking down the 9091 bit-rate to low values and disrupt video quality by requesting 9092 Intra frames. 9094 Taking into account the above general discussion in Section 21.2 and 9095 the RTP specific discussion in this section it is clear that strong 9096 security mechanism to protect RTP is necessary to support. Therefore 9097 this specification has the following requirements on RTP security 9098 functions for all RTSP agents that handles media streams and where 9099 the media stream transport is done using RTP. 9101 RTSP agents supporting RTP MUST implement Secure RTP (SRTP) [RFC3711] 9102 and thus the SAVP profile. In addition the secure AVP profile 9103 (SAVPF) [RFC5124] MUST also be supported if the AVPF profile is 9104 implemented. This specification requires no additional crypto 9105 transforms or configuration values beyond the mandatory to implement 9106 in RFC3711, i.e. AES-CM and HMAC-SHA1. The default key-management 9107 mechanism which MUST be implemented is the one defined in the MIKEY 9108 Key Establishment (Appendix C.1.4.1). The MIKEY implementation MUST 9109 implement the necessary functions for MIKEY-RSA-R mode [RFC4738] and 9110 in addition the SRTP parameter negotiation necessary to negotiate the 9111 supported SRTP transforms and parameters. 9113 22. IANA Considerations 9115 This section sets up a number of registries for RTSP 2.0 that should 9116 be maintained by IANA. These registries are separate from any 9117 registries existing for RTSP 1.0. For each registry there is a 9118 description of what it is required to contain, what specification is 9119 needed when adding an entry with IANA, and finally the entries that 9120 this document needs to register. See also the Section 2.7 "Extending 9121 RTSP". There is also an IANA registration of three SDP attributes. 9123 Registries or entries in registries which have been made for RTSP 1.0 9124 are not moved to RTSP 2.0. The registries and entries in registries 9125 of RTSP 1.0 and RTSP 2.0 are independent. If any registry or entry 9126 in a registry is also required in RTSP 2.0, it MUST follow the below 9127 defined procedure to allocate the registry or entry in a registry. 9129 The sections describing how to register an item uses some of the 9130 requirements level described in RFC 5226 [RFC5226], namely "First 9131 Come, First Served", "Expert Review, "Specification Required", and 9132 "Standards Action". 9134 In case a registry requires a contact person, the authors are the 9135 contact person for any entries created by this document. 9137 A registration request to IANA MUST contain the following 9138 information: 9140 o A name of the item to register according to the rules specified by 9141 the intended registry. 9143 o Indication of who has change control over the feature (for 9144 example, IETF, ISO, ITU-T, other international standardization 9145 bodies, a consortium, a particular company or group of companies, 9146 or an individual); 9148 o A reference to a further description, if available, for example 9149 (in decreasing order of preference) an RFC, a published standard, 9150 a published paper, a patent filing, a technical report, documented 9151 source code or a computer manual; 9153 o For proprietary features, contact information (postal and email 9154 address); 9156 22.1. Feature-tags 9157 22.1.1. Description 9159 When a client and server try to determine what part and functionality 9160 of the RTSP specification and any future extensions that its counter 9161 part implements there is need for a namespace. This registry 9162 contains named entries representing certain functionality. 9164 The usage of feature-tags is explained in Section 11 and 9165 Section 13.1. 9167 22.1.2. Registering New Feature-tags with IANA 9169 The registering of feature-tags is done on a first come, first served 9170 basis. 9172 The name of the feature MUST follow these rules: The name may be of 9173 any length, but SHOULD be no more than twenty characters long. The 9174 name MUST NOT contain any spaces, or control characters. The 9175 registration MUST indicate if the feature-tag applies to clients, 9176 servers, or proxies only or any combinations of these. Any 9177 proprietary feature MUST have as the first part of the name a vendor 9178 tag, which identifies the organization. The registry entries consist 9179 of the feature tag, a one paragraph description of what it 9180 represents, its applicability (server, client, proxy, any 9181 combination) and a reference to its specification where applicable. 9183 Examples for a vendor tag describing a proprietary feature are: 9185 vendorA.specfeat01 9187 vendorA.specfeat02 9189 22.1.3. Registered entries 9191 The following feature-tags are defined in this specification and 9192 hereby registered. The change control belongs to the IETF. 9194 play.basic: The implementation for delivery and playback operations 9195 according to the core RTSP specification, as defined in this 9196 memo. Applies for both clients, servers and proxies. 9198 play.scale: Support of scale operations for media playback. Applies 9199 only for servers. 9201 play.speed: Support of the speed functionality for media delivery. 9202 Applies only for servers. 9204 setup.rtp.rtcp.mux Support of the RTP and RTCP multiplexing as 9205 discussed in Appendix C.1.6.4. Applies for both client and 9206 servers and any media caching proxy. 9208 This should be represented by IANA as a table with the feature tags, 9209 contact person and their references. 9211 22.2. RTSP Methods 9213 22.2.1. Description 9215 Methods are described in Section Section 13. Extending the protocol 9216 with new methods allow for totally new functionality. 9218 22.2.2. Registering New Methods with IANA 9220 A new method MUST be registered through an IETF Standards Action. 9221 The reason is that new methods may radically change the protocol's 9222 behavior and purpose. 9224 A specification for a new RTSP method MUST consist of the following 9225 items: 9227 o A method name which follows the ABNF rules for methods. 9229 o A clear specification what a request using the method does and 9230 what responses are expected. Which directions the method is used, 9231 C->S or S->C or both. How the use of headers, if any, modifies 9232 the behavior and effect of the method. 9234 o A list or table specifying which of the IANA registered headers 9235 that are allowed to be used with the method in request or/and 9236 response. The list or table SHOULD follow the format of tables in 9237 Section 18. 9239 o Describe how the method relates to network proxies. 9241 22.2.3. Registered Entries 9243 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 9244 GET_PARAMETER, OPTIONS, PAUSE, PLAY, PLAY_NOTIFY, REDIRECT, SETUP, 9245 SET_PARAMETER, and TEARDOWN. The initial table of the registry is 9246 provided below. 9248 Method Directionality Reference 9249 ----------------------------------------------------- 9250 DESCRIBE C->S [RFCXXXX] 9251 GET_PARAMETER C->S, S->C [RFCXXXX] 9252 OPTIONS C->S, S->C [RFCXXXX] 9253 PAUSE C->S [RFCXXXX] 9254 PLAY C->S [RFCXXXX] 9255 PLAY_NOTIFY S->C [RFCXXXX] 9256 REDIRECT S->C [RFCXXXX] 9257 SETUP C->S [RFCXXXX] 9258 SET_PARAMETER C->S, S->C [RFCXXXX] 9259 TEARDOWN C->S, S->C [RFCXXXX] 9261 22.3. RTSP Status Codes 9263 22.3.1. Description 9265 A status code is the three digit number used to convey information in 9266 RTSP response messages, see Section 8. The number space is limited 9267 and care should be taken not to fill the space. 9269 22.3.2. Registering New Status Codes with IANA 9271 A new status code registration follows the policy of IETF Review. A 9272 specification for a new status code MUST specify the following: 9274 o The registered number. 9276 o A description of what the status code means and the expected 9277 behavior of the sender and receiver of the code. 9279 22.3.3. Registered Entries 9281 RFCXXXX, registers the numbered status code defined in the ABNF entry 9282 "Status-Code" except "extension-code" (that defines the syntax 9283 allowed for future extensions) in Section 20.2.2. 9285 22.4. RTSP Headers 9287 22.4.1. Description 9289 By specifying new headers a method(s) can be enhanced in many 9290 different ways. An unknown header will be ignored by the receiving 9291 agent. If the new header is vital for a certain functionality, a 9292 feature-tag for the functionality can be created and demanded to be 9293 used by the counter-part with the inclusion of a Require header 9294 carrying the feature-tag. 9296 22.4.2. Registering New Headers with IANA 9298 Registrations in the registry can be done following the Expert Review 9299 policy. A specification SHOULD be provided, preferably an IETF RFC 9300 or other Standards Developing Organization specification. The 9301 minimal information in a registration request is the header name and 9302 the contact information. 9304 The specification SHOULD contain the following information: 9306 o The name of the header. 9308 o An ABNF specification of the header syntax. 9310 o A list or table specifying when the header may be used, 9311 encompassing all methods, their request or response, the direction 9312 (C->S or S->C). 9314 o How the header is to be handled by proxies. 9316 o A description of the purpose of the header. 9318 22.4.3. Registered entries 9320 All headers specified in Section 18 in RFCXXXX are to be registered. 9321 The Registry is to include header name and reference. 9323 Furthermore the following legacy RTSP headers defined in other 9324 specifications are registered with header name, reference and 9325 description according to below list. Note: These references may not 9326 fulfill all of the above rules for registrations due to their legacy 9327 status. 9329 o x-wap-profile defined in [TS-26234]. The x-wap-profile request 9330 header contains one or more absolute URLs to the requesting 9331 agent's device capability profile. 9333 o x-wap-profile-diff defined in [TS-26234]. The x-wap-profile-diff 9334 request header contains a subset of a device capability profile. 9336 o x-wap-profile-warning defined in [TS-26234]. The x-wap-profile- 9337 warning is a response header that contains error codes explaining 9338 to what extent the server has been able to match the terminal 9339 request in regards to device capability profile as described using 9340 x-wap-profile and x-wap-profile-diff headers. 9342 o x-predecbufsize defined in [TS-26234]. This response header 9343 provides an RTSP agent with the TS 26.234 Annex G hypothetical 9344 pre-decoder buffer size. 9346 o x-initpredecbufperiod defined in [TS-26234]. This response header 9347 provides an RTSP agent with the TS 26.234 Annex G hypothetical 9348 pre-decoder buffering period. 9350 o x-initpostdecbufperiod defined in [TS-26234]. This response 9351 header provides an RTSP agent with the TS 26.234 Annex G post- 9352 decoder buffering period. 9354 o 3gpp-videopostdecbufsize defined in [TS-26234]. This response 9355 header provides an RTSP agent with the TS 26.234 defined post- 9356 decoder buffer size usable for H.264 (AVC) video streams. 9358 o 3GPP-Link-Char defined in [TS-26234]. This request header 9359 provides the RTSP server with the RTSP client's link 9360 charateristics as deterimined from the radio interface. The 9361 information that can be provided are guaranteed bit-rate, maximum 9362 bit-rate and maximum transfer delay. 9364 o 3GPP-Adaptation defined in [TS-26234]. This general header is 9365 part of the bit-rate adaptation solution specified for PSS. It 9366 provides the RTSP client's buffer sizes and target buffer levels 9367 to the server and responses are used to acknowledge the support 9368 and values. 9370 o 3GPP-QoE-Metrics defined in [TS-26234]. This general header is 9371 used by PSS RTSP agents to negotiate the quality of experince 9372 metrics that a client should gather and report to the server. 9374 o 3GPP-QoE-Feedback defined in [TS-26234]. This request header is 9375 used by RTSP clients supporting PSS to report the actual values of 9376 the metrics gathered in its quality of experince metering. 9378 The use of "x-" is NOT RECOMMENDED but the above headers in the 9379 register list were defined prior to the clarification. 9381 22.5. Accept-Credentials 9383 The security framework's TLS connection mechanism has two registrable 9384 entities. 9386 22.5.1. Accept-Credentials policies 9388 In Section 19.3.1 three policies for how to handle certificates are 9389 specified. Further policies may be defined and MUST be registered 9390 with IANA using the following rules: 9392 o Registering requires an IETF Standards Action 9394 o A registration is required to name a contact person. 9396 o Name of the policy. 9398 o A describing text that explains how the policy works for handling 9399 the certificates. 9401 This specification registers the following values: 9403 Any 9405 Proxy 9407 User 9409 22.5.2. Accept-Credentials hash algorithms 9411 The Accept-Credentials header (See Section 18.2) allows for the usage 9412 of other algorithms for hashing the DER records of accepted entities. 9413 The registration of any future algorithm is expected to be extremely 9414 rare and could also cause interoperability problems. Therefore the 9415 bar for registering new algorithms is intentionally placed high. 9417 Any registration of a new hash algorithm MUST fulfill the following 9418 requirement: 9420 o Follow the IETF Standards Action policy. 9422 o A definition of the algorithm and its identifier meeting the 9423 "token" ABNF requirement. 9425 The registered value is: 9426 Hash Alg. Id Reference 9427 ------------------------ 9428 sha-256 [RFCXXXX] 9430 22.6. Cache-Control Cache Directive Extensions 9432 There exists a number of cache directives which can be sent in the 9433 Cache-Control header. A registry for these cache directives MUST be 9434 defined with the following rules: 9436 o Registering requires an IETF Standards Action or IESG Approval. 9438 o A registration is required to contain a contact person. 9440 o Name of the directive and a definition of the value, if any. 9442 o Specification if it is a request or response directive. 9444 o A describing text that explains how the cache directive is used 9445 for RTSP controlled media streams. 9447 This specification registers the following values: 9449 no-cache: 9451 public: 9453 private: 9455 no-transform: 9457 only-if-cached: 9459 max-stale: 9461 min-fresh: 9463 must-revalidate: 9465 proxy-revalidate: 9467 max-age: 9469 The registry should be represented as: Name of the directive, contact 9470 person and reference. 9472 22.7. Media Properties 9474 22.7.1. Description 9476 The media streams being controlled by RTSP can have many different 9477 properties. The media properties required to cover the use cases 9478 that were in mind when writing the specification are defined. 9479 However, it can be expected that further innovation will result in 9480 new use cases or media streams with properties not covered by the 9481 ones specified here. Thus new media properties can be specified. As 9482 new media properties may need a substantial amount of new definitions 9483 to correctly specify behavior for this property the bar is intended 9484 to be high. 9486 22.7.2. Registration Rules 9488 Registering a new media property MUST fulfill the following 9489 requirements 9491 o Follow the Specification Required policy and get the approval of 9492 the designated Expert. 9494 o Have an ABNF definition of the media property value name that 9495 meets "media-prop-ext" definition 9497 o A Contact Person for the Registration 9499 o Description of all changes to the behavior of the RTSP protocol as 9500 result of these changes. 9502 22.7.3. Registered Values 9504 This specification registers the 9 values listed in Section 18.28. 9505 The registry should be represented as: Name of the media property, 9506 contact person and reference. 9508 22.8. Notify-Reason header 9510 22.8.1. Description 9512 Notify-Reason values are used for indicating the reason the 9513 notification was sent. Each reason has its associated rules on what 9514 headers and information that may or must be included in the 9515 notification. New notification behaviors need to be specified to 9516 enable interoperable usage, thus a specification of each new value is 9517 required. 9519 22.8.2. Registration Rules 9521 Registrations for new Notify-Reason value MUST fulfill the following 9522 requirements 9524 o Follow the Specification Required policy and get the approval of 9525 the designated Expert. 9527 o An ABNF definition of the Notify reason value name that meets 9528 "Notify-Reason-extension" definition 9530 o A Contact Person for the Registration 9532 o Description of which headers shall be included in the request and 9533 response, when it should be sent, and any effect it has on the 9534 server client state. 9536 22.8.3. Registered Values 9538 This specification registers 3 values defined in the Notify-Reas-val 9539 ABNF, Section 20.2.3: 9541 end-of-stream: This Notify-Reason value indicates the end of a media 9542 stream. 9544 media-properties-update: This Notify-Reason value allows the server 9545 to indicate that the properties of the media has changed during 9546 the playout. 9548 scale-change: This Notify-Reason value allows the server to notify 9549 the client about a change in the Scale of the media. 9551 The registry entries should be represented in the registry as: Name, 9552 short description, contact and reference. 9554 22.9. Range header formats 9556 22.9.1. Description 9558 The Range header (Section 18.38) allows for different range formats. 9559 New ones may be registered, but moderation should be applied as it 9560 makes interoperability more difficult. 9562 22.9.2. Registration Rules 9564 A registration MUST fulfill the following requirements: 9566 o Follow the Specification Required policy. 9568 o An ABNF definition of the range format that fulfills the "range- 9569 ext" definition. 9571 o A Contact person for the registration. 9573 o Rules for how one handles the range when using a negative Scale. 9575 22.9.3. Registered Values 9577 The registry should be represented as: Name of the range format, 9578 contact person and reference. This specification registers the 9579 following values. 9581 npt: Normal Play Time 9583 clock: UTC Clock format 9585 smpte: SMPTE Timestamps 9587 smpte-30-drop: SMPTE Timestamps 9589 smpte-25: SMPTE Timestamps 9591 22.10. Terminate-Reason Header 9593 The Terminate-Reason header (Section 18.50) has two registries for 9594 extensions. 9596 22.10.1. Redirect Reasons 9598 Registrations are done under the policy of Expert Review. The 9599 registered value needs to follow the Terminate-Reason ABNF, i.e., be 9600 a token. The specification needs to provide a definition of what 9601 procedures are to be followed when a client receives this redirect 9602 reason. This specification registers three values: 9604 o Session-Timeout 9606 o Server-Admin 9608 o Internal-Error 9610 The registry should be represented as: Name of the Redirect Reason, 9611 contact person and reference. 9613 22.10.2. Terminate-Reason Header Parameters 9615 Registrations are done under the policy of Specification Required. 9616 The registrations must define a syntax for the parameter that also 9617 follows the syntax allowed by the RTSP 2.0 specification. A contact 9618 person is also required. This specification registers: 9620 o time 9622 o user-msg 9624 The registry should be represented as: Name of the Terminate Reason, 9625 contact person and reference. 9627 22.11. RTP-Info header parameters 9629 22.11.1. Description 9631 The RTP-Info header (Section 18.43) carries one or more parameter 9632 value pairs with information about a particular point in the RTP 9633 stream. RTP extensions or new usages may need new types of 9634 information. As RTP information that could be needed is likely to be 9635 generic enough and to maximize the interoperability, new registration 9636 requires Specification Required. 9638 22.11.2. Registration Rules 9640 Registrations for new RTP-Info value MUST fulfill the following 9641 requirements 9643 o Follow the Specification Required policy and get the approval of 9644 the designated Expert. 9646 o Have an ABNF definition that meets the "generic-param" definition 9648 o A Contact Person for the Registration 9650 22.11.3. Registered Values 9652 This specification registers the following parameter value pairs: 9654 o url 9656 o ssrc 9658 o seq 9660 o rtptime 9662 The registry should be represented as: Name of the parameter, contact 9663 person and reference. 9665 22.12. Seek-Style Policies 9667 22.12.1. Description 9669 New seek policies may be registered, however, a large number of these 9670 will complicate implementation substantially. The impact of unknown 9671 policies is that the server will not honor the unknown and use the 9672 server default policy instead. 9674 22.12.2. Registration Rules 9676 Registrations of new Seek-Style polices MUST fulfill the following 9677 requirements 9679 o Follow the Specification Required policy. 9681 o Have an ABNF definition of the Seek-Style policy name that meets 9682 "Seek-S-value-ext" definition 9684 o A Contact Person for the Registration 9686 o Description of which headers shall be included in the request and 9687 response, when it should be sent, and any affect it has on the 9688 server client state. 9690 22.12.3. Registered Values 9692 This specification registers 4 values: 9694 o RAP 9696 o CoRAP 9698 o First-Prior 9700 o Next 9702 The registry should be represented as: Name of the Seek-Style Policy, 9703 short description, contact person and reference. 9705 22.13. Transport Header Registries 9707 The transport header contains a number of parameters which have 9708 possibilities for future extensions. Therefore registries for these 9709 need to be defined. 9711 22.13.1. Transport Protocol Specification 9713 A registry for the parameter transport-protocol specification MUST be 9714 defined with the following rules: 9716 o Registering uses the policy of Specification Required. 9718 o A contact person or organization with address and email. 9720 o A value definition that are following the ABNF syntax definition 9721 of "transport-id" Section 20.2.3. 9723 o A describing text that explains how the registered value are used 9724 in RTSP. 9726 The registry should be represented as: The protocol ID string, 9727 contact person and reference. 9729 This specification registers the following values: 9731 RTP/AVP: Use of the RTP [RFC3550] protocol for media transport in 9732 combination with the "RTP profile for audio and video 9733 conferences with minimal control" [RFC3551] over UDP. The 9734 usage is explained in RFC XXXX, Appendix C.1. 9736 RTP/AVP/UDP: the same as RTP/AVP. 9738 RTP/AVPF: Use of the RTP [RFC3550] protocol for media transport in 9739 combination with the "Extended RTP Profile for RTCP-based 9740 Feedback (RTP/AVPF)" [RFC4585] over UDP. The usage is 9741 explained in RFC XXXX, Appendix C.1. 9743 RTP/AVPF/UDP: the same as RTP/AVPF. 9745 RTP/SAVP: Use of the RTP [RFC3550] protocol for media transport in 9746 combination with the "The Secure Real-time Transport Protocol 9747 (SRTP)" [RFC3711] over UDP. The usage is explained in RFC 9748 XXXX, Appendix C.1. 9750 RTP/SAVP/UDP: the same as RTP/SAVP. 9752 RTP/SAVPF: Use of the RTP[RFC3550] protocol for media transport in 9753 combination with the Extended Secure RTP Profile for Real-time 9754 Transport Control Protocol (RTCP)-Based Feedback (RTP/SAVPF) 9755 [RFC5124] over UDP. The usage is explained in RFC XXXX, 9756 Appendix C.1. 9758 RTP/SAVPF/UDP: the same as RTP/SAVPF. 9760 RTP/AVP/TCP: Use of the RTP [RFC3550] protocol for media transport 9761 in combination with the "RTP profile for audio and video 9762 conferences with minimal control" [RFC3551] over TCP. The 9763 usage is explained in RFC XXXX, Appendix C.2.2. 9765 RTP/AVPF/TCP: Use of the RTP [RFC3550] protocol for media transport 9766 in combination with the "Extended RTP Profile for RTCP-based 9767 Feedback (RTP/AVPF)" [RFC4585] over TCP. The usage is 9768 explained in RFC XXXX, Appendix C.2.2. 9770 RTP/SAVP/TCP: Use of the RTP [RFC3550] protocol for media transport 9771 in combination with the "The Secure Real-time Transport 9772 Protocol (SRTP)" [RFC3711] over TCP. The usage is explained in 9773 RFC XXXX, Appendix C.2.2. 9775 RTP/SAVPF/TCP: Use of the RTP [RFC3550] protocol for media transport 9776 in combination with the "Extended Secure RTP Profile for Real- 9777 time Transport Control Protocol (RTCP)-Based Feedback (RTP/ 9778 SAVPF)" [RFC5124] over TCP. The usage is explained in RFC 9779 XXXX, Appendix C.2.2. 9781 22.13.2. Transport modes 9783 A registry for the transport parameter mode MUST be defined with the 9784 following rules: 9786 o Registering requires an IETF Standards Action. 9788 o A contact person or organization with address and email. 9790 o A value definition that are following the ABNF "token" definition 9791 Section 20.2.3. 9793 o A describing text that explains how the registered value are used 9794 in RTSP. 9796 This specification registers 1 value: 9798 PLAY: See RFC XXXX. 9800 22.13.3. Transport Parameters 9802 A registry for parameters that may be included in the Transport 9803 header MUST be defined with the following rules: 9805 o Registering uses the Specification Required policy. 9807 o A value definition that are following the ABNF "token" definition 9808 Section 20.2.3. 9810 o A describing text that explains how the registered value are used 9811 in RTSP. 9813 This specification registers all the transport parameters defined in 9814 Section 18.52. This is a copy of this list: 9816 o unicast 9817 o multicast 9819 o interleaved 9821 o ttl 9823 o layers 9825 o ssrc 9827 o mode 9829 o dest_addr 9831 o src_addr 9833 o setup 9835 o connection 9837 o RTCP-mux 9839 o MIKEY 9841 22.14. URI Schemes 9843 This specification defines two URI schemes ("rtsp" and "rtsps") and 9844 reserves a third one ("rtspu"). These URI schemes are defined in 9845 existing registries which are not created by RTSP. Registrations are 9846 following RFC 4395[RFC4395]. 9848 22.14.1. The rtsp URI Scheme 9850 URI scheme name: rtsp 9852 Status: Permanent 9854 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9856 URI scheme semantics: The rtsp scheme is used to indicate resources 9857 accessible through the usage of the Real-time Streaming 9858 Protocol (RTSP). RTSP allows different operations on the 9859 resource identified by the URI, but the primary purpose is the 9860 streaming delivery of the resource to a client. However, the 9861 operations that are currently defined are: DESCRIBE, 9862 GET_PARAMETER, OPTIONS, PLAY, PLAY_NOTIFY, PAUSE, REDIRECT, 9863 SETUP, SET_PARAMETER, and TEARDOWN. 9865 Encoding considerations: IRIs in this scheme are defined and needs 9866 to be encoded as RTSP URIs when used within the RTSP protocol. 9867 That encoding is done according to RFC 3987. 9869 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9870 2326), RTSP 2.0 (RFC XXXX) 9872 Interoperability considerations: The extensions in the URI syntax 9873 performed between RTSP 1.0 and 2.0 can create interoperability 9874 issues. The changes are: 9876 Support for IPV6 literal in host part and future IP 9877 literals through RFC 3986 defined mechanism. 9879 A new relative format to use in the RTSP protocol 9880 elements that is not required to start with "/". 9882 Security considerations: All the security threats identified in 9883 Section 7 of RFC 3986 apply also to this scheme. They need to 9884 be reviewed and considered in any implementation utilizing this 9885 scheme. 9887 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9889 Author/Change controller: IETF 9891 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9893 22.14.2. The rtsps URI Scheme 9895 URI scheme name: rtsps 9897 Status: Permanent 9899 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9901 URI scheme semantics: The rtsps scheme is used to indicate resources 9902 accessible through the usage of the Real-time Streaming 9903 Protocol (RTSP) over TLS. RTSP allows different operations on 9904 the resource identified by the URI, but the primary purpose is 9905 the streaming delivery of the resource to a client. However, 9906 the operations that are currently defined are: DESCRIBE, 9907 GET_PARAMETER, OPTIONS, PLAY, PLAY_NOTIFY, PAUSE, REDIRECT, 9908 SETUP, SET_PARAMETER, and TEARDOWN. 9910 Encoding considerations: IRIs in this scheme are defined and needs 9911 to be encoded as RTSP URIs when used within the RTSP protocol. 9912 That encoding is done according to RFC 3987. 9914 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9915 2326), RTSP 2.0 (RFC XXXX) 9917 Interoperability considerations: The extensions in the URI syntax 9918 performed between RTSP 1.0 and 2.0 can create interoperability 9919 issues. The changes are: 9921 Support for IPV6 literal in host part and future IP 9922 literals through RFC 3986 defined mechanism. 9924 A new relative format to use in the RTSP protocol 9925 elements that is not required to start with "/". 9927 Security considerations: All the security threats identified in 9928 Section 7 of RFC 3986 apply also to this scheme. They need to 9929 be reviewed and considered in any implementation utilizing this 9930 scheme. 9932 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9934 Author/Change controller: IETF 9936 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9938 22.14.3. The rtspu URI Scheme 9940 URI scheme name: rtspu 9942 Status: Permanent 9944 URI scheme syntax: See Section 3.2 of RFC 2326. 9946 URI scheme semantics: The rtspu scheme is used to indicate resources 9947 accessible through the usage of the Real-time Streaming 9948 Protocol (RTSP) over unreliable datagram transport. RTSP 9949 allows different operations on the resource identified by the 9950 URI, but the primary purpose is the streaming delivery of the 9951 resource to a client. However, the operations that are 9952 currently defined are: DESCRIBE, GET_PARAMETER, OPTIONS, 9953 REDIRECT,PLAY, PLAY_NOTIFY, PAUSE, SETUP, SET_PARAMETER, and 9954 TEARDOWN. 9956 Encoding considerations: IRIs in this scheme are not defined. 9958 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9959 2326) 9961 Interoperability considerations: The definition of the transport 9962 mechanism of RTSP over UDP has interoperability issues. That 9963 makes the usage of this scheme problematic. 9965 Security considerations: All the security threats identified in 9966 Section 7 of RFC 3986 apply also to this scheme. They needs to 9967 be reviewed and considered in any implementation utilizing this 9968 scheme. 9970 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9972 Author/Change controller: IETF 9974 References: RFC 2326 9976 22.15. SDP attributes 9978 This specification defines three SDP [RFC4566] attributes that it is 9979 requested that IANA register. 9981 SDP Attribute ("att-field"): 9983 Attribute name: range 9984 Long form: Media Range Attribute 9985 Type of name: att-field 9986 Type of attribute: Media and session level 9987 Subject to charset: No 9988 Purpose: RFC XXXX 9989 Reference: RFC XXXX, RFC 2326 9990 Values: See ABNF definition. 9992 Attribute name: control 9993 Long form: RTSP control URI 9994 Type of name: att-field 9995 Type of attribute: Media and session level 9996 Subject to charset: No 9997 Purpose: RFC XXXX 9998 Reference: RFC XXXX, RFC 2326 9999 Values: Absolute or Relative URIs. 10001 Attribute name: mtag 10002 Long form: Message Tag 10003 Type of name: att-field 10004 Type of attribute: Media and session level 10005 Subject to charset: No 10006 Purpose: RFC XXXX 10007 Reference: RFC XXXX 10008 Values: See ABNF definition 10010 22.16. Media Type Registration for text/parameters 10012 Type name: text 10014 Subtype name: parameters 10016 Required parameters: 10018 Optional parameters: charset: The charset parameter is applicable to 10019 the encoding of the parameter values. The default charset is 10020 UTF-8, if the 'charset' parameter is not present. 10022 Encoding considerations: 8bit 10024 Security considerations: This format may carry any type of 10025 parameters. Some can have security requirements, like privacy, 10026 confidentiality or integrity requirements. The format has no 10027 built in security protection. For the usage it was defined the 10028 transport can be protected between server and client using TLS. 10029 However, care must be taken to consider if also the proxies are 10030 trusted with the parameters in case hop-by-hop security is used. 10031 If stored as file in file systemi, the necessary precautions need 10032 to be taken in relation to the parameters requirements including 10033 object security such as S/MIME [RFC5751]. 10035 Interoperability considerations: This media type was mentioned as a 10036 fictional example in [RFC2326], but was not formally specified. 10037 This has resulted in usage of this media type which may not match 10038 its formal definition. 10040 Published specification: RFC XXXX, Appendix F. 10042 Applications that use this media type: Applications that use RTSP 10043 and have additional parameters they like to read and set using the 10044 RTSP GET_PARAMETER and SET_PARAMETER methods. 10046 Additional information: 10048 Magic number(s): 10050 File extension(s): 10052 Macintosh file type code(s): 10054 Person & email address to contact for further information: Magnus 10055 Westerlund (magnus.westerlund@ericsson.com) 10057 Intended usage: Common 10059 Restrictions on usage: None 10061 Author: Magnus Westerlund (magnus.westerlund@ericsson.com) 10063 Change controller: IETF 10065 Addition Notes: 10067 23. References 10069 23.1. Normative References 10071 [FIPS-pub-180-2] 10072 National Institute of Standards and Technology (NIST), 10073 "Federal Information Processing Standards Publications 10074 (FIPS PUBS) 180-2: Secure Hash Standard", August 2002. 10076 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 10077 August 1980. 10079 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 10080 RFC 793, September 1981. 10082 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 10083 Requirement Levels", BCP 14, RFC 2119, March 1997. 10085 [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 10086 (IPv6) Specification", RFC 2460, December 1998. 10088 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 10089 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 10090 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 10092 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 10093 Leach, P., Luotonen, A., and L. Stewart, "HTTP 10094 Authentication: Basic and Digest Access Authentication", 10095 RFC 2617, June 1999. 10097 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 10099 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 10100 Jacobson, "RTP: A Transport Protocol for Real-Time 10101 Applications", STD 64, RFC 3550, July 2003. 10103 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 10104 Video Conferences with Minimal Control", STD 65, RFC 3551, 10105 July 2003. 10107 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10108 10646", STD 63, RFC 3629, November 2003. 10110 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 10111 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 10112 RFC 3711, March 2004. 10114 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 10116 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 10117 August 2004. 10119 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 10120 Resource Identifier (URI): Generic Syntax", STD 66, 10121 RFC 3986, January 2005. 10123 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 10124 Identifiers (IRIs)", RFC 3987, January 2005. 10126 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 10127 Requirements for Security", BCP 106, RFC 4086, June 2005. 10129 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 10130 Registration Procedures", RFC 4288, December 2005. 10132 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 10133 Architecture", RFC 4291, February 2006. 10135 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 10136 Registration Procedures for New URI Schemes", BCP 35, 10137 RFC 4395, February 2006. 10139 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 10140 Description Protocol", RFC 4566, July 2006. 10142 [RFC4567] Arkko, J., Lindholm, F., Naslund, M., Norrman, K., and E. 10143 Carrara, "Key Management Extensions for Session 10144 Description Protocol (SDP) and Real Time Streaming 10145 Protocol (RTSP)", RFC 4567, July 2006. 10147 [RFC4571] Lazzaro, J., "Framing Real-time Transport Protocol (RTP) 10148 and RTP Control Protocol (RTCP) Packets over Connection- 10149 Oriented Transport", RFC 4571, July 2006. 10151 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 10152 "Extended RTP Profile for Real-time Transport Control 10153 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 10154 July 2006. 10156 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 10157 Encodings", RFC 4648, October 2006. 10159 [RFC4738] Ignjatic, D., Dondeti, L., Audet, F., and P. Lin, "MIKEY- 10160 RSA-R: An Additional Mode of Key Distribution in 10161 Multimedia Internet KEYing (MIKEY)", RFC 4738, 10162 November 2006. 10164 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 10165 Real-time Transport Control Protocol (RTCP)-Based Feedback 10166 (RTP/SAVPF)", RFC 5124, February 2008. 10168 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 10169 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 10170 May 2008. 10172 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 10173 Specifications: ABNF", STD 68, RFC 5234, January 2008. 10175 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 10176 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 10178 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 10179 Housley, R., and W. Polk, "Internet X.509 Public Key 10180 Infrastructure Certificate and Certificate Revocation List 10181 (CRL) Profile", RFC 5280, May 2008. 10183 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 10184 Languages", BCP 47, RFC 5646, September 2009. 10186 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 10187 Mail Extensions (S/MIME) Version 3.2 Message 10188 Specification", RFC 5751, January 2010. 10190 [RFC5761] Perkins, C. and M. Westerlund, "Multiplexing RTP Data and 10191 Control Packets on a Single Port", RFC 5761, April 2010. 10193 [RFC5888] Camarillo, G. and H. Schulzrinne, "The Session Description 10194 Protocol (SDP) Grouping Framework", RFC 5888, June 2010. 10196 [TS-26234] 10197 Third Generation Partnership Project (3GPP), "Transparent 10198 end-to-end Packet-switched Streaming Service (PSS); 10199 Protocols and codecs; Technical Specification 26.234", 10200 December 2002. 10202 23.2. Informative References 10204 [I-D.ietf-mmusic-rtsp-nat] 10205 Goldberg, J., Westerlund, M., and T. Zeng, "A Network 10206 Address Translator (NAT) Traversal mechanism for media 10207 controlled by Real-Time Streaming Protocol (RTSP)", 10208 draft-ietf-mmusic-rtsp-nat-14 (work in progress), 10209 November 2012. 10211 [ISO.13818-6.1995] 10212 International Organization for Standardization, 10213 "Information technology - Generic coding of moving 10214 pictures and associated audio information - part 6: 10215 Extension for digital storage media and control", 10216 ISO Draft Standard 13818-6, November 1995. 10218 [ISO.8601.2000] 10219 International Organization for Standardization, "Data 10220 elements and interchange formats - Information interchange 10221 - Representation of dates and times", ISO/IEC Standard 10222 8601, December 2000. 10224 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 10225 and Support", STD 3, RFC 1123, October 1989. 10227 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 10228 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 10229 RFC 2068, January 1997. 10231 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 10232 Streaming Protocol (RTSP)", RFC 2326, April 1998. 10234 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 10235 Translator (NAT) Terminology and Considerations", 10236 RFC 2663, August 1999. 10238 [RFC2822] Resnick, P., "Internet Message Format", RFC 2822, 10239 April 2001. 10241 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 10242 Announcement Protocol", RFC 2974, October 2000. 10244 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 10245 A., Peterson, J., Sparks, R., Handley, M., and E. 10246 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 10247 June 2002. 10249 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 10250 the Session Description Protocol (SDP)", RFC 4145, 10251 September 2005. 10253 [RFC4588] Rey, J., Leon, D., Miyazaki, A., Varsa, V., and R. 10254 Hakenberg, "RTP Retransmission Payload Format", RFC 4588, 10255 July 2006. 10257 [RFC5104] Wenger, S., Chandra, U., Westerlund, M., and B. Burman, 10258 "Codec Control Messages in the RTP Audio-Visual Profile 10259 with Feedback (AVPF)", RFC 5104, February 2008. 10261 [RFC5583] Schierl, T. and S. Wenger, "Signaling Media Decoding 10262 Dependency in the Session Description Protocol (SDP)", 10263 RFC 5583, July 2009. 10265 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 10266 Time Protocol Version 4: Protocol and Algorithms 10267 Specification", RFC 5905, June 2010. 10269 [RFC6298] Paxson, V., Allman, M., Chu, J., and M. Sargent, 10270 "Computing TCP's Retransmission Timer", RFC 6298, 10271 June 2011. 10273 [Stevens98] 10274 Stevens, W., "Unix Networking Programming - Volume 1, 10275 second edition", 1998. 10277 Appendix A. Examples 10279 This section contains several different examples trying to illustrate 10280 possible ways of using RTSP. The examples can also help with the 10281 understanding of how functions of RTSP work. However, remember that 10282 these are examples and the normative and syntax description in the 10283 other sections take precedence. Please also note that many of the 10284 examples contain syntax illegal line breaks to accommodate the 10285 formatting restriction that the RFC series impose. 10287 A.1. Media on Demand (Unicast) 10289 This is an example of media on demand streaming of a media stored in 10290 a container file. For purposes of this example, a container file is 10291 a storage entity in which multiple continuous media types pertaining 10292 to the same end-user presentation are present. In effect, the 10293 container file represents an RTSP presentation, with each of its 10294 components being RTSP controlled media streams. Container files are 10295 a widely used means to store such presentations. While the 10296 components are transported as independent streams, it is desirable to 10297 maintain a common context for those streams at the server end. 10299 This enables the server to keep a single storage handle open 10300 easily. It also allows treating all the streams equally in case 10301 of any priorization of streams by the server. 10303 It is also possible that the presentation author may wish to prevent 10304 selective retrieval of the streams by the client in order to preserve 10305 the artistic effect of the combined media presentation. Similarly, 10306 in such a tightly bound presentation, it is desirable to be able to 10307 control all the streams via a single control message using an 10308 aggregate URI. 10310 The following is an example of using a single RTSP session to control 10311 multiple streams. It also illustrates the use of aggregate URIs. In 10312 a container file it is also desirable to not write any URI parts 10313 which are not kept, when the container is distributed, like the host 10314 and most of the path element. Therefore this example also uses the 10315 "*" and relative URI in the delivered SDP. 10317 Also this presentation description (SDP) is not cachable, as the 10318 Expires header is set to an equal value with date indicating 10319 immediate expiration of its valididty. 10321 Client C requests a presentation from media server M. The movie is 10322 stored in a container file. The client has obtained an RTSP URI to 10323 the container file. 10325 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10326 CSeq: 1 10327 User-Agent: PhonyClient/1.2 10329 M->C: RTSP/2.0 200 OK 10330 CSeq: 1 10331 Server: PhonyServer/1.0 10332 Date: Thu, 24 Jan 1997 15:35:06 GMT 10333 Content-Type: application/sdp 10334 Content-Length: 271 10335 Content-Base: rtsp://example.com/twister.3gp/ 10336 Expires: 24 Jan 1997 15:35:06 GMT 10338 v=0 10339 o=- 2890844256 2890842807 IN IP4 198.51.100.5 10340 s=RTSP Session 10341 i=An Example of RTSP Session Usage 10342 e=adm@example.com 10343 c=IN IP4 0.0.0.0 10344 a=control: * 10345 a=range: npt=0-0:10:34.10 10346 t=0 0 10347 m=audio 0 RTP/AVP 0 10348 a=control: trackID=1 10349 m=video 0 RTP/AVP 26 10350 a=control: trackID=4 10352 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10353 CSeq: 2 10354 User-Agent: PhonyClient/1.2 10355 Require: play.basic 10356 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10357 Accept-Ranges: NPT, SMPTE, UTC 10359 M->C: RTSP/2.0 200 OK 10360 CSeq: 2 10361 Server: PhonyServer/1.0 10362 Transport: RTP/AVP;unicast; ssrc=93CB001E; 10363 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10364 src_addr="198.51.100.5:9000"/"198.51.100.5:9001" 10365 Session: 12345678 10366 Expires: 24 Jan 1997 15:35:12 GMT 10367 Date: 24 Jan 1997 15:35:12 GMT 10368 Accept-Ranges: NPT 10369 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10371 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10372 CSeq: 3 10373 User-Agent: PhonyClient/1.2 10374 Require: play.basic 10375 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10376 Session: 12345678 10377 Accept-Ranges: NPT, SMPTE, UTC 10379 M->C: RTSP/2.0 200 OK 10380 CSeq: 3 10381 Server: PhonyServer/1.0 10382 Transport: RTP/AVP;unicast; ssrc=A813FC13; 10383 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003"; 10384 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10386 Session: 12345678 10387 Expires: 24 Jan 1997 15:35:13 GMT 10388 Date: 24 Jan 1997 15:35:13 GMT 10389 Accept-Range: NPT 10390 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10392 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10393 CSeq: 4 10394 User-Agent: PhonyClient/1.2 10395 Range: npt=30- 10396 Seek-Style: RAP 10397 Session: 12345678 10399 M->C: RTSP/2.0 200 OK 10400 CSeq: 4 10401 Server: PhonyServer/1.0 10402 Date: 24 Jan 1997 15:35:14 GMT 10403 Session: 12345678 10404 Range: npt=30-634.10 10405 Seek-Style: RAP 10406 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10407 ssrc=0D12F123:seq=12345;rtptime=3450012, 10408 url="rtsp://example.com/twister.3gp/trackID=1" 10409 ssrc=4F312DD8:seq=54321;rtptime=2876889 10411 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/2.0 10412 CSeq: 5 10413 User-Agent: PhonyClient/1.2 10414 Session: 12345678 10416 # Pause happens 0.87 seconds after starting to play 10418 M->C: RTSP/2.0 200 OK 10419 CSeq: 5 10420 Server: PhonyServer/1.0 10421 Date: 24 Jan 1997 15:36:01 GMT 10422 Session: 12345678 10423 Range: npt=30.87-634.10 10425 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10426 CSeq: 6 10427 User-Agent: PhonyClient/1.2 10428 Range: npt=30.87-634.10 10429 Seek-Style: Next 10430 Session: 12345678 10432 M->C: RTSP/2.0 200 OK 10433 CSeq: 6 10434 Server: PhonyServer/1.0 10435 Date: 24 Jan 1997 15:36:01 GMT 10436 Session: 12345678 10437 Range: npt=30.87-634.10 10438 Seek-Style: Next 10439 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10440 ssrc=0D12F123:seq=12555;rtptime=6330012, 10441 url="rtsp://example.com/twister.3gp/trackID=1" 10442 ssrc=4F312DD8:seq=55021;rtptime=3132889 10444 C->M: TEARDOWN rtsp://example.com/twister.3gp/ RTSP/2.0 10445 CSeq: 7 10446 User-Agent: PhonyClient/1.2 10447 Session: 12345678 10449 M->C: RTSP/2.0 200 OK 10450 CSeq: 7 10451 Server: PhonyServer/1.0 10452 Date: 24 Jan 1997 15:49:34 GMT 10454 A.2. Media on Demand using Pipelining 10456 This example is basically the example above (Appendix A.1), but now 10457 utilizing pipelining to speed up the setup. It requires only two 10458 round trip times until the media starts flowing. First of all, the 10459 session description is retrieved to determine what media resources 10460 need to be setup. In the second step, one sends the necessary SETUP 10461 requests and the PLAY request to initiate media delivery. 10463 Client C requests a presentation from media server M. The movie is 10464 stored in a container file. The client has obtained an RTSP URI to 10465 the container file. 10467 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10468 CSeq: 1 10469 User-Agent: PhonyClient/1.2 10471 M->C: RTSP/2.0 200 OK 10472 CSeq: 1 10473 Server: PhonyServer/1.0 10474 Date: Thu, 23 Jan 1997 15:35:06 GMT 10475 Content-Type: application/sdp 10476 Content-Length: 271 10477 Content-Base: rtsp://example.com/twister.3gp/ 10478 Expires: 24 Jan 1997 15:35:06 GMT 10480 v=0 10481 o=- 2890844256 2890842807 IN IP4 192.0.2.5 10482 s=RTSP Session 10483 i=An Example of RTSP Session Usage 10484 e=adm@example.com 10485 c=IN IP4 0.0.0.0 10486 a=control: * 10487 a=range: npt=0-0:10:34.10 10488 t=0 0 10489 m=audio 0 RTP/AVP 0 10490 a=control: trackID=1 10491 m=video 0 RTP/AVP 26 10492 a=control: trackID=4 10494 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10495 CSeq: 2 10496 User-Agent: PhonyClient/1.2 10497 Require: play.basic 10498 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10499 Accept-Ranges: NPT, SMPTE, UTC 10500 Pipelined-Requests: 7654 10502 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10503 CSeq: 3 10504 User-Agent: PhonyClient/1.2 10505 Require: play.basic 10506 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10507 Accept-Ranges: NPT, SMPTE, UTC 10508 Pipelined-Requests: 7654 10510 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10511 CSeq: 4 10512 User-Agent: PhonyClient/1.2 10513 Range: npt=0- 10514 Seek-Style: RAP 10515 Pipelined-Requests: 7654 10517 M->C: RTSP/2.0 200 OK 10518 CSeq: 2 10519 Server: PhonyServer/1.0 10520 Transport: RTP/AVP;unicast; 10521 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10522 src_addr="198.51.100.5:9000"/"198.51.100.5:9001"; 10523 ssrc=93CB001E 10524 Session: 12345678 10525 Expires: 24 Jan 1997 15:35:12 GMT 10526 Date: 23 Jan 1997 15:35:12 GMT 10527 Accept-Ranges: NPT 10528 Pipelined-Requests: 7654 10529 Media-Properties: Random-Access=0.2, Immutable, Unlimited 10531 M->C: RTSP/2.0 200 OK 10532 CSeq: 3 10533 Server: PhonyServer/1.0 10534 Transport: RTP/AVP;unicast; 10535 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003; 10536 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10537 ssrc=A813FC13 10538 Session: 12345678 10539 Expires: 24 Jan 1997 15:35:13 GMT 10540 Date: 23 Jan 1997 15:35:13 GMT 10541 Accept-Range: NPT 10542 Pipelined-Requests: 7654 10543 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10545 M->C: RTSP/2.0 200 OK 10546 CSeq: 4 10547 Server: PhonyServer/1.0 10548 Date: 23 Jan 1997 15:35:14 GMT 10549 Session: 12345678 10550 Range: npt=0-623.10 10551 Seek-Style: RAP 10552 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10553 ssrc=0D12F123:seq=12345;rtptime=3450012, 10554 url="rtsp://example.com/twister.3gp/trackID=1" 10555 ssrc=4F312DD8:seq=54321;rtptime=2876889 10556 Pipelined-Requests: 7654 10558 A.3. Media on Demand (Unicast) 10560 An alternative example of media on demand with a bit more tweaks is 10561 the following. Client C requests a movie distributed from two 10562 different media servers A (audio.example.com) and V ( 10563 video.example.com). The media description is stored on a web server 10564 W. The media description contains descriptions of the presentation 10565 and all its streams, including the codecs that are available, dynamic 10566 RTP payload types, the protocol stack, and content information such 10567 as language or copyright restrictions. It may also give an 10568 indication about the timeline of the movie. 10570 In this example, the client is only interested in the last part of 10571 the movie. 10573 C->W: GET /twister.sdp HTTP/1.1 10574 Host: www.example.com 10575 Accept: application/sdp 10577 W->C: HTTP/1.1 200 OK 10578 Date: Thu, 23 Jan 1997 15:35:06 GMT 10579 Content-Type: application/sdp 10580 Content-Length: 278 10581 Expires: 23 Jan 1998 15:35:06 GMT 10583 v=0 10584 o=- 2890844526 2890842807 IN IP4 198.51.100.5 10585 s=RTSP Session 10586 e=adm@example.com 10587 c=IN IP4 0.0.0.0 10588 a=range:npt=0-1:49:34 10589 t=0 0 10590 m=audio 0 RTP/AVP 0 10591 a=control:rtsp://audio.example.com/twister/audio.en 10592 m=video 0 RTP/AVP 31 10593 a=control:rtsp://video.example.com/twister/video 10595 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/2.0 10596 CSeq: 1 10597 User-Agent: PhonyClient/1.2 10598 Transport: RTP/AVP/UDP;unicast;dest_addr=":3056"/":3057", 10599 RTP/AVP/TCP;unicast;interleaved=0-1 10600 Accept-Ranges: NPT, SMPTE, UTC 10602 A->C: RTSP/2.0 200 OK 10603 CSeq: 1 10604 Session: 12345678 10605 Transport: RTP/AVP/UDP;unicast; 10606 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10607 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10608 Date: 23 Jan 1997 15:35:12 GMT 10609 Server: PhonyServer/1.0 10610 Expires: 24 Jan 1997 15:35:12 GMT 10611 Cache-Control: public 10612 Accept-Ranges: NPT, SMPTE 10613 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10615 C->V: SETUP rtsp://video.example.com/twister/video RTSP/2.0 10616 CSeq: 1 10617 User-Agent: PhonyClient/1.2 10618 Transport: RTP/AVP/UDP;unicast; 10619 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059", 10620 RTP/AVP/TCP;unicast;interleaved=0-1 10621 Accept-Ranges: NPT, SMPTE, UTC 10623 V->C: RTSP/2.0 200 OK 10624 CSeq: 1 10625 Session: 23456789 10626 Transport: RTP/AVP/UDP;unicast; 10627 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059"; 10628 src_addr="198.51.100.5:5002"/"198.51.100.5:5003" 10629 Date: 23 Jan 1997 15:35:12 GMT 10630 Server: PhonyServer/1.0 10631 Cache-Control: public 10632 Expires: 24 Jan 1997 15:35:12 GMT 10633 Accept-Ranges: NPT, SMPTE 10634 Media-Properties: Random-Access=1.2, Immutable, Unlimited 10636 C->V: PLAY rtsp://video.example.com/twister/video RTSP/2.0 10637 CSeq: 2 10638 User-Agent: PhonyClient/1.2 10639 Session: 23456789 10640 Range: smpte=0:10:00- 10642 V->C: RTSP/2.0 200 OK 10643 CSeq: 2 10644 Session: 23456789 10645 Range: smpte=0:10:00-1:49:23 10646 Seek-Style: First-Prior 10647 RTP-Info: url="rtsp://video.example.com/twister/video" 10648 ssrc=A17E189D:seq=12312232;rtptime=78712811 10649 Server: PhonyServer/2.0 10650 Date: 23 Jan 1997 15:35:13 GMT 10652 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/2.0 10653 CSeq: 2 10654 User-Agent: PhonyClient/1.2 10655 Session: 12345678 10656 Range: smpte=0:10:00- 10658 A->C: RTSP/2.0 200 OK 10659 CSeq: 2 10660 Session: 12345678 10661 Range: smpte=0:10:00-1:49:23 10662 Seek-Style: First-Prior 10663 RTP-Info: url="rtsp://audio.example.com/twister/audio.en" 10664 ssrc=3D124F01:seq=876655;rtptime=1032181 10665 Server: PhonyServer/1.0 10666 Date: 23 Jan 1997 15:35:13 GMT 10668 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/2.0 10669 CSeq: 3 10670 User-Agent: PhonyClient/1.2 10671 Session: 12345678 10673 A->C: RTSP/2.0 200 OK 10674 CSeq: 3 10675 Server: PhonyServer/1.0 10676 Date: 23 Jan 1997 15:36:52 GMT 10678 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/2.0 10679 CSeq: 3 10680 User-Agent: PhonyClient/1.2 10681 Session: 23456789 10683 V->C: RTSP/2.0 200 OK 10684 CSeq: 3 10685 Server: PhonyServer/2.0 10686 Date: 23 Jan 1997 15:36:52 GMT 10688 Even though the audio and video track are on two different servers 10689 that may start at slightly different times and may drift with respect 10690 to each other over time, the client can perform initial 10691 synchronization of the two media using RTP-Info and Range received in 10692 the PLAY responses. If the two servers are time synchronized the 10693 RTCP packets can also be used to maintain synchronization. 10695 A.4. Single Stream Container Files 10697 Some RTSP servers may treat all files as though they are "container 10698 files", yet other servers may not support such a concept. Because of 10699 this, clients needs to use the rules set forth in the session 10700 description for Request-URIs, rather than assuming that a consistent 10701 URI may always be used throughout. Below is an example of how a 10702 multi-stream server might expect a single-stream file to be served: 10704 C->S: DESCRIBE rtsp://foo.example.com/test.wav RTSP/2.0 10705 Accept: application/x-rtsp-mh, application/sdp 10706 CSeq: 1 10707 User-Agent: PhonyClient/1.2 10709 S->C: RTSP/2.0 200 OK 10710 CSeq: 1 10711 Content-base: rtsp://foo.example.com/test.wav/ 10712 Content-type: application/sdp 10713 Content-length: 163 10714 Server: PhonyServer/1.0 10715 Date: Thu, 23 Jan 1997 15:35:06 GMT 10716 Expires: 23 Jan 1997 17:00:00 GMT 10718 v=0 10719 o=- 872653257 872653257 IN IP4 192.0.2.5 10720 s=mu-law wave file 10721 i=audio test 10722 c=IN IP4 0.0.0.0 10723 t=0 0 10724 a=control: * 10725 m=audio 0 RTP/AVP 0 10726 a=control:streamid=0 10728 C->S: SETUP rtsp://foo.example.com/test.wav/streamid=0 RTSP/2.0 10729 Transport: RTP/AVP/UDP;unicast; 10730 dest_addr=":6970"/":6971";mode="PLAY" 10731 CSeq: 2 10732 User-Agent: PhonyClient/1.2 10733 Accept-Ranges: NPT, SMPTE, UTC 10735 S->C: RTSP/2.0 200 OK 10736 Transport: RTP/AVP/UDP;unicast; 10737 dest_addr="192.0.2.53:6970"/"192.0.2.53:6971"; 10738 src_addr="198.51.100.5:6970"/"198.51.100.5:6971"; 10739 mode="PLAY";ssrc=EAB98712 10740 CSeq: 2 10741 Session: 2034820394 10742 Expires: 23 Jan 1997 16:00:00 GMT 10743 Server: PhonyServer/1.0 10744 Date: 23 Jan 1997 15:35:07 GMT 10745 Accept-Ranges: NPT 10746 Media-Properties: Random-Acces=0.5, Immutable, Unlimited 10748 C->S: PLAY rtsp://foo.example.com/test.wav/ RTSP/2.0 10749 CSeq: 3 10750 User-Agent: PhonyClient/1.2 10751 Session: 2034820394 10753 S->C: RTSP/2.0 200 OK 10754 CSeq: 3 10755 Server: PhonyServer/1.0 10756 Date: 23 Jan 1997 15:35:08 GMT 10757 Session: 2034820394 10758 Range: npt=0-600 10759 Seek-Style: RAP 10760 RTP-Info: url="rtsp://foo.example.com/test.wav/streamid=0" 10761 ssrc=0D12F123:seq=981888;rtptime=3781123 10763 Note the different URI in the SETUP command, and then the switch back 10764 to the aggregate URI in the PLAY command. This makes complete sense 10765 when there are multiple streams with aggregate control, but is less 10766 than intuitive in the special case where the number of streams is 10767 one. However, the server has declared the aggregated control URI in 10768 the SDP and therefore this is legal. 10770 In this case, it is also required that servers accept implementations 10771 that use the non-aggregated interpretation and use the individual 10772 media URI, like this: 10774 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/2.0 10775 CSeq: 3 10776 User-Agent: PhonyClient/1.2 10777 Session: 2034820394 10779 A.5. Live Media Presentation Using Multicast 10781 The media server M chooses the multicast address and port. Here, it 10782 is assumed that the web server only contains a pointer to the full 10783 description, while the media server M maintains the full description. 10785 C->W: GET /sessions.html HTTP/1.1 10786 Host: www.example.com 10788 W->C: HTTP/1.1 200 OK 10789 Content-Type: text/html 10791 10792 ... 10793 10794 Streamed Live Music performance 10795 ... 10796 10798 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/2.0 10799 CSeq: 1 10800 Supported: play.basic, play.scale 10801 User-Agent: PhonyClient/1.2 10803 M->C: RTSP/2.0 200 OK 10804 CSeq: 1 10805 Content-Type: application/sdp 10806 Content-Length: 183 10807 Server: PhonyServer/1.0 10808 Date: Thu, 23 Jan 1997 15:35:06 GMT 10809 Supported: play.basic 10811 v=0 10812 o=- 2890844526 2890842807 IN IP4 192.0.2.5 10813 s=RTSP Session 10814 t=0 0 10815 m=audio 3456 RTP/AVP 0 10816 c=IN IP4 233.252.0.54/16 10817 a=control: rtsp://live.example.com/concert/audio 10818 a=range:npt=0- 10820 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/2.0 10821 CSeq: 2 10822 Transport: RTP/AVP;multicast; 10823 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10824 Accept-Ranges: NPT, SMPTE, UTC 10825 User-Agent: PhonyClient/1.2 10827 M->C: RTSP/2.0 200 OK 10828 CSeq: 2 10829 Server: PhonyServer/1.0 10830 Date: Thu, 23 Jan 1997 15:35:06 GMT 10831 Transport: RTP/AVP;multicast; 10832 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10833 ;ssrc=4D12AB92/0DF876A3 10834 Session: 0456804596 10835 Accept-Ranges: NPT, UTC 10836 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0 10838 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/2.0 10839 CSeq: 3 10840 Session: 0456804596 10841 User-Agent: PhonyClient/1.2 10843 M->C: RTSP/2.0 200 OK 10844 CSeq: 3 10845 Server: PhonyServer/1.0 10846 Date: 23 Jan 1997 15:35:07 GMT 10847 Session: 0456804596 10848 Seek-Style: Next 10849 Range:npt=1256- 10850 RTP-Info: url="rtsp://live.example.com/concert/audio" 10851 ssrc=0D12F123:seq=1473; rtptime=80000 10853 A.6. Capability Negotiation 10855 This example illustrates how the client and server determine their 10856 capability to support a special feature, in this case "play.scale". 10857 The server, through the clients request and the included Supported 10858 header, learns the client supports RTSP 2.0, and also supports the 10859 playback time scaling feature of RTSP. The server's response 10860 contains the following feature related information to the client; it 10861 supports the basic media delivery functions (play.basic), the 10862 extended functionality of time scaling of content (play.scale), and 10863 one "example.com" proprietary feature (com.example.flight). The 10864 client also learns the methods supported (Public header) by the 10865 server for the indicated resource. 10867 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/2.0 10868 CSeq: 1 10869 Supported: play.basic, play.scale 10870 User-Agent: PhonyClient/1.2 10872 S->C: RTSP/2.0 200 OK 10873 CSeq: 1 10874 Public: OPTIONS,SETUP,PLAY,PAUSE,TEARDOWN,DESCRIBE,GET_PARAMETER 10875 Allow: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, DESCRIBE 10876 Server: PhonyServer/2.0 10877 Supported: play.basic, play.scale, com.example.flight 10879 When the client sends its SETUP request it tells the server that it 10880 requires support of the play.scale feature for this session by 10881 including the Require header. 10883 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/2.0 10884 CSeq: 3 10885 User-Agent: PhonyClient/1.2 10886 Transport: RTP/AVP/UDP;unicast; 10887 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057", 10888 RTP/AVP/TCP;unicast;interleaved=0-1 10889 Require: play.scale 10890 Accept-Ranges: NPT, SMPTE, UTC 10891 User-Agent: PhonyClient/1.2 10893 S->C: RTSP/2.0 200 OK 10894 CSeq: 3 10895 Session: 12345678 10896 Transport: RTP/AVP/UDP;unicast; 10897 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10898 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10899 Server: PhonyServer/2.0 10900 Accept-Ranges: NPT, SMPTE 10901 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10903 Appendix B. RTSP Protocol State Machine 10905 The RTSP session state machine describes the behavior of the protocol 10906 from RTSP session initialization through RTSP session termination. 10908 The State machine is defined on a per session basis which is uniquely 10909 identified by the RTSP session identifier. The session may contain 10910 one or more media streams depending on state. If a single media 10911 stream is part of the session it is in non-aggregated control. If 10912 two or more is part of the session it is in aggregated control. 10914 The below state machine is an informative description of the 10915 protocols behavior. In case of ambiguity with the earlier parts of 10916 this specification, the description in the earlier parts take 10917 precedence. 10919 B.1. States 10921 The state machine contains three states, described below. For each 10922 state there exists a table which shows which requests and events are 10923 allowed and whether they will result in a state change. 10925 Init: Initial state no session exists. 10927 Ready: Session is ready to start playing. 10929 Play: Session is playing, i.e. sending media stream data in the 10930 direction S->C. 10932 B.2. State variables 10934 This representation of the state machine needs more than its state to 10935 work. A small number of variables are also needed and they are 10936 explained below. 10938 NRM: The number of media streams part of this session. 10940 RP: Resume point, the point in the presentation time line at which 10941 a request to continue playing will resume from. A time format 10942 for the variable is not mandated. 10944 B.3. Abbreviations 10946 To make the state tables more compact a number of abbreviations are 10947 used, which are explained below. 10949 IFI: IF Implemented. 10951 md: Media 10953 PP: Pause Point, the point in the presentation time line at which 10954 the presentation was paused. 10956 Prs: Presentation, the complete multimedia presentation. 10958 RedP: Redirect Point, the point in the presentation time line at 10959 which a REDIRECT was specified to occur. 10961 SES: Session. 10963 B.4. State Tables 10965 This section contains a table for each state. The table contains all 10966 the requests and events that this state is allowed to act on. The 10967 events which are method names are, unless noted, requests with the 10968 given method in the direction client to server (C->S). In some cases 10969 there exist one or more requisite. The response column tells what 10970 type of response actions should be performed. Possible actions that 10971 are requested for an event include: response codes, e.g., 200, 10972 headers that need to be included in the response, setting of state 10973 variables, or setting of other session related parameters. The new 10974 state column tells which state the state machine changes to. 10976 The response to a valid request meeting the requisites is normally a 10977 2xx (SUCCESS) unless otherwise noted in the response column. The 10978 exceptions need to be given a response according to the response 10979 column. If the request does not meet the requisite, is erroneous or 10980 some other type of error occurs, the appropriate response code is to 10981 be sent. If the response code is a 4xx the session state is 10982 unchanged. A response code of 3rr will result in that the session is 10983 ended and its state is changed to Init. A response code of 304 10984 results in no state change. However, there are restrictions to when 10985 a 3rr response may be used. A 5xx response does not result in any 10986 change of the session state, except if the error is not possible to 10987 recover from. A unrecoverable error results in the ending of the 10988 session. As it in the general case can't be determined if it was a 10989 unrecoverable error or not the client will be required to test. In 10990 the case that the next request after a 5xx is responded with 454 10991 (Session Not Found) the client knows that the session has ended. For 10992 any request message that cannot be responded to within the time 10993 defined in Section 10.4, a 100 response must be sent. 10995 The server will timeout the session after the period of time 10996 specified in the SETUP response, if no activity from the client is 10997 detected. Therefore there exists a timeout event for all states 10998 except Init. 11000 In the case that NRM = 1 the presentation URI is equal to the media 11001 URI or a specified presentation URI. For NRM > 1 the presentation 11002 URI needs to be other than any of the medias that are part of the 11003 session. This applies to all states. 11005 +---------------+-----------------+---------------------------------+ 11006 | Event | Prerequisite | Response | 11007 +---------------+-----------------+---------------------------------+ 11008 | DESCRIBE | Needs REDIRECT | 3rr, Redirect | 11009 | | | | 11010 | DESCRIBE | | 200, Session description | 11011 | | | | 11012 | OPTIONS | Session ID | 200, Reset session timeout | 11013 | | | timer | 11014 | | | | 11015 | OPTIONS | | 200 | 11016 | | | | 11017 | SET_PARAMETER | Valid parameter | 200, change value of parameter | 11018 | | | | 11019 | GET_PARAMETER | Valid parameter | 200, return value of parameter | 11020 +---------------+-----------------+---------------------------------+ 11022 Table 13: None state-machine changing events 11024 The methods in Table 13 do not have any effect on the state machine 11025 or the state variables. However, some methods do change other 11026 session related parameters, for example SET_PARAMETER which will set 11027 the parameter(s) specified in its body. Also all of these methods 11028 that allow Session header will also update the keep-alive timer for 11029 the session. 11031 +------------------+----------------+-----------+-------------------+ 11032 | Action | Requisite | New State | Response | 11033 +------------------+----------------+-----------+-------------------+ 11034 | SETUP | | Ready | NRM=1, RP=0.0 | 11035 | | | | | 11036 | SETUP | Needs Redirect | Init | 3rr Redirect | 11037 | | | | | 11038 | S -> C: REDIRECT | No Session hdr | Init | Terminate all SES | 11039 +------------------+----------------+-----------+-------------------+ 11041 Table 14: State: Init 11043 The initial state of the state machine, see Table 14 can only be left 11044 by processing a correct SETUP request. As seen in the table the two 11045 state variables are also set by a correct request. This table also 11046 shows that a correct SETUP can in some cases be redirected to another 11047 URI and/or server by a 3rr response. 11049 +-------------+------------------------+---------+------------------+ 11050 | Action | Requisite | New | Response | 11051 | | | State | | 11052 +-------------+------------------------+---------+------------------+ 11053 | SETUP | New URI | Ready | NRM +=1 | 11054 | | | | | 11055 | SETUP | URI Setup prior | Ready | Change transport | 11056 | | | | param | 11057 | | | | | 11058 | TEARDOWN | Prs URI, | Init | No session hdr, | 11059 | | | | NRM = 0 | 11060 | | | | | 11061 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 11062 | | | | NRM = 0 | 11063 | | | | | 11064 | TEARDOWN | md URI,NRM>1 | Ready | Session hdr, NRM | 11065 | | | | -= 1 | 11066 | | | | | 11067 | PLAY | Prs URI, No range | Play | Play from RP | 11068 | | | | | 11069 | PLAY | Prs URI, Range | Play | According to | 11070 | | | | range | 11071 | | | | | 11072 | PLAY | md URI, NRM=1, Range | Play | According to | 11073 | | | | range | 11074 | | | | | 11075 | PLAY | md URI, NRM=1 | Play | Play from RP | 11076 | | | | | 11077 | PAUSE | Prs URI | Ready | Return PP | 11078 | | | | | 11079 | SC:REDIRECT | Terminate-Reason | Ready | Set RedP | 11080 | | | | | 11081 | SC:REDIRECT | No Terminate-Reason | Init | Session is | 11082 | | time parameter | | removed | 11083 | | | | | 11084 | Timeout | | Init | | 11085 | | | | | 11086 | RedP | | Init | TEARDOWN of | 11087 | reached | | | session | 11088 +-------------+------------------------+---------+------------------+ 11090 Table 15: State: Ready 11092 In the Ready state, see Table 15, some of the actions are depending 11093 on the number of media streams (NRM) in the session, i.e., aggregated 11094 or non-aggregated control. A SETUP request in the Ready state can 11095 either add one more media stream to the session or, if the media 11096 stream (same URI) already is part of the session, change the 11097 transport parameters. TEARDOWN is depending on both the Request-URI 11098 and the number of media streams within the session. If the Request- 11099 URI is the presentations URI the whole session is torn down. If a 11100 media URI is used in the TEARDOWN request and more than one media 11101 exists in the session, the session will remain and a session header 11102 is returned in the response. If only a single media stream remains 11103 in the session when performing a TEARDOWN with a media URI the 11104 session is removed. The number of media streams remaining after 11105 tearing down a media stream determines the new state. 11107 +----------------+-----------------------+--------+-----------------+ 11108 | Action | Requisite | New | Response | 11109 | | | State | | 11110 +----------------+-----------------------+--------+-----------------+ 11111 | PAUSE | Prs URI | Ready | Set RP to | 11112 | | | | present point | 11113 | | | | | 11114 | End of media | All media | Play | Set RP = End of | 11115 | | | | media | 11116 | | | | | 11117 | End of range | | Play | Set RP = End of | 11118 | | | | range | 11119 | | | | | 11120 | PLAY | Prs URI, No range | Play | Play from | 11121 | | | | present point | 11122 | | | | | 11123 | PLAY | Prs URI, Range | Play | According to | 11124 | | | | range | 11125 | | | | | 11126 | SC:PLAY_NOTIFY | | Play | 200 | 11127 | | | | | 11128 | SETUP | New URI | Play | 455 | 11129 | | | | | 11130 | SETUP | Setuped URI | Play | 455 | 11131 | | | | | 11132 | SETUP | Setuped URI, IFI | Play | Change | 11133 | | | | transport | 11134 | | | | param. | 11135 | | | | | 11136 | TEARDOWN | Prs URI | Init | No session hdr | 11137 | | | | | 11138 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 11139 | | | | NRM=0 | 11140 | | | | | 11141 | TEARDOWN | md URI | Play | 455 | 11142 | | | | | 11143 | SC:REDIRECT | Terminate Reason with | Play | Set RedP | 11144 | | Time parameter | | | 11145 | | | | | 11146 | SC:REDIRECT | | Init | Session is | 11147 | | | | removed | 11148 | | | | | 11149 | RedP reached | | Init | TEARDOWN of | 11150 | | | | session | 11151 | | | | | 11152 | Timeout | | Init | Stop Media | 11153 | | | | playout | 11154 +----------------+-----------------------+--------+-----------------+ 11155 Table 16: State: Play 11157 The Play state table, see Table 16, contains a number of requests 11158 that need a presentation URI (labeled as Prs URI) to work on (i.e., 11159 the presentation URI has to be used as the Request-URI). This is due 11160 to the exclusion of non-aggregated stream control in sessions with 11161 more than one media stream. 11163 To avoid inconsistencies between the client and server, automatic 11164 state transitions are avoided. This can be seen at for example "End 11165 of media" event when all media has finished playing, the session 11166 still remains in Play state. An explicit PAUSE request needs to be 11167 sent to change the state to Ready. It may appear that there exist 11168 automatic transitions in "RedP reached" and "PP reached". However, 11169 they are requested and acknowledged before they take place. The time 11170 at which the transition will happen is known by looking at the range 11171 header. If the client sends a request close in time to these 11172 transitions it needs to be prepared for receiving error messages, as 11173 the state may or may not have changed. 11175 Appendix C. Media Transport Alternatives 11177 This section defines how certain combinations of protocols, profiles 11178 and lower transports are used. This includes the usage of the 11179 Transport header's source and destination address parameters 11180 "src_addr" and "dest_addr". 11182 C.1. RTP 11184 This section defines the interaction of RTSP with respect to the RTP 11185 protocol [RFC3550]. It also defines any necessary media transport 11186 signaling with regards to RTP. 11188 The available RTP profiles and lower layer transports are described 11189 below along with rules on signaling the available combinations. 11191 C.1.1. AVP 11193 The usage of the "RTP Profile for Audio and Video Conferences with 11194 Minimal Control" [RFC3551] when using RTP for media transport over 11195 different lower layer transport protocols is defined below in regards 11196 to RTSP. 11198 One such case is defined within this document: the use of embedded 11199 (interleaved) binary data as defined in Section 14. The usage of 11200 this method is indicated by including the "interleaved" parameter. 11202 When using embedded binary data the "src_addr" and "dest_addr" MUST 11203 NOT be used. This addressing and multiplexing is used as defined 11204 with use of channel numbers and the interleaved parameter. 11206 C.1.2. AVP/UDP 11208 This part describes sending of RTP [RFC3550] over lower transport 11209 layer UDP [RFC0768] according to the profile "RTP Profile for Audio 11210 and Video Conferences with Minimal Control" defined in RFC 3551 11211 [RFC3551]. This profile requires one or two uni- or bi-directional 11212 UDP flows per media stream. The first UDP flow is for RTP and the 11213 second is for RTCP. Embedding of RTP data with the RTSP messages, in 11214 accordance with Section 14, SHOULD NOT be performed when RTSP 11215 messages are transported over unreliable transport protocols, like 11216 UDP [RFC0768]. 11218 The RTP/UDP and RTCP/UDP flows can be established using the Transport 11219 header's "src_addr", and "dest_addr" parameters. 11221 In RTSP PLAY mode, the transmission of RTP packets from client to 11222 server is unspecified. The behavior in regards to such RTP packets 11223 MAY be defined in future. 11225 The "src_addr" and "dest_addr" parameters are used in the following 11226 way for media delivery and playback mode, i.e. Mode=PLAY: 11228 o The "src_addr" and "dest_addr" parameters MUST contain either 1 or 11229 2 address specifications. 11231 o Each address specification for RTP/AVP/UDP or RTP/AVP/TCP MUST 11232 contain either: 11234 * both an address and a port number, or 11236 * a port number without an address. 11238 o The first address and port pair given in either of the parameters 11239 applies to the RTP stream. The second address and port pair if 11240 present applies to the RTCP stream. 11242 o The RTP/UDP packets from the server to the client MUST be sent to 11243 the address and port given by the first address and port pair of 11244 the "dest_addr" parameter. 11246 o The RTCP/UDP packets from the server to the client MUST be sent to 11247 the address and port given by the second address and port pair of 11248 the "dest_addr" parameter. If no second pair is specified RTCP 11249 MUST NOT be sent. 11251 o The RTCP/UDP packets from the client to the server MUST be sent to 11252 the address and port given by the second address and port pair of 11253 the "src_addr" parameter. If no second pair is given RTCP MUST 11254 NOT be sent. 11256 o The RTP/UDP packets from the client to the server MUST be sent to 11257 the address and port given by the first address and port pair of 11258 the "src_addr" parameter. 11260 o RTP and RTCP Packets SHOULD be sent from the corresponding 11261 receiver port, i.e. RTCP packets from the server should be sent 11262 from the "src_addr" parameters second address port pair. 11264 C.1.3. AVPF/UDP 11266 The RTP profile "Extended RTP Profile for RTCP-based Feedback (RTP/ 11267 AVPF)" [RFC4585] MAY be used as RTP profiles in sessions using RTP. 11268 All that is defined for AVP MUST also apply for AVPF. 11270 The usage of AVPF is indicated by the media initialization protocol 11271 used. In the case of SDP it is indicated by media lines (m=) 11272 containing the profile RTP/AVPF. That SDP MAY also contain further 11273 AVPF related SDP attributes configuring the AVPF session regarding 11274 reporting interval and feedback messages to be used [RFC4585]. This 11275 configuration MUST be followed. 11277 C.1.4. SAVP/UDP 11279 The RTP profile "The Secure Real-time Transport Protocol (SRTP)" 11280 [RFC3711] is an RTP profile (SAVP) that MAY be used in RTSP sessions 11281 using RTP. All that is defined for AVP MUST also apply for SAVP. 11283 The usage of SRTP requires that a security context is established. 11284 The default key-management unless otherwise signalled SHALL be MIKEY 11285 in RSA-R mode as defined in Appendix C.1.4.1, and not according to 11286 the procedure defined in "Key Management Extensions for Session 11287 Description Protocol (SDP) and Real Time Streaming Protocol (RTSP)" 11288 [RFC4567]. The reason is that RFC 4567 sends the initial MIKEY 11289 message in SDP, thus both requiring the usage of the DESCRIBE method 11290 and forcing the server to keep state for clients performing DESCRIBE 11291 in anticipation that they might require key management. 11293 MIKEY is selected as default method for establishing SRTP 11294 cryptographic context within an RTSP session as it can be embedded in 11295 the RTSP messages, while still ensuring confidentiality of content of 11296 the keying material, even when using hop-by-hop TLS security for the 11297 RTSP messages. This method does also support pipelining of the RTSP 11298 messages. 11300 C.1.4.1. MIKEY Key Establishment 11302 This method for using MIKEY [RFC3830] to establish the SRTP 11303 cryptographic context is initiated in the client's SETUP request, and 11304 the server's response to the SETUP carries the MIKEY response. This 11305 ensures that the crypto context establishment happens simultaneously 11306 with the establishment of the media stream being protected. By using 11307 MIKEY's RSA-R mode [RFC4738] the client can be the initiator and 11308 still allow the server to set the parameters in accordance with the 11309 actual media stream. 11311 The SRTP cryptographic context establishment is done according to the 11312 following process: 11314 1. The client determines that SAVP or SAVPF shall be used from 11315 media description format, e.g. SDP. If no other key management 11316 method is explicitly signalled, then MIKEY SHALL be used as 11317 defined herein. This specification does not specify an explicit 11318 method for indicating this SRTP cryptographic context 11319 establishment method, but future specifications may. 11321 2. The client SHALL establish a TLS connection for RTSP messages, 11322 directly or hop by hop with the server. If hop-by-hop TLS 11323 security is used, the User method SHALL be indicated in the 11324 Accept-Credentials header. We do note that using hop-by-hop 11325 does allow the proxy to insert itself as a man in the middle 11326 also in the MIKEY exchange by providing one of its certificates, 11327 rather than the server's in the Connection-Credentials header. 11328 The client SHALL therefore validate the server certificate. 11330 3. The client retrieves the server's certificate from a direct TLS 11331 connection, or if hop by hop from Connection-Credentials header. 11332 The client then checks that the server certificate is valid and 11333 belongs to the server. 11335 4. The client forms the MIKEY Initiator message using RSA-R mode in 11336 unicast mode as specified in [RFC4738]. The client SHOULD use 11337 the same certificate for TLS and in MIKEY to enable the server 11338 to bind the two together. The client's certificate SHALL be 11339 included in the MIKEY message. The client SHALL indicate its 11340 SRTP capabilities in the message. 11342 5. The MIKEY message from the previous step is base64 [RFC4648] 11343 encoded and becomes the value of the MIKEY parameter that is 11344 included in the transport specification(s) that specifies a SRTP 11345 based profile (SAVP, SAVPF) in the SETUP request. 11347 6. Any proxy encountering the MIKEY parameter SHALL forward it 11348 without modification. A proxy requiring to understand transport 11349 specification which doesn't support SAVP/SAVPF with MIKEY will 11350 discard the whole transport specification. Most types of 11351 proxies can easily support SAVP and SAVPF with MIKEY. If 11352 possible bypassing the proxy should be tried. 11354 7. The server upon receiving the SETUP request, will need to decide 11355 upon the transport specification to use, if multiple are 11356 included by the client. In the determination of which transport 11357 specifications that are supported and preferred, the server 11358 SHOULD decode the MIKEY message to take the embedded SRTP 11359 parameters into account. If all transport specs require SRTP 11360 but no MIKEY parameter or other supported keying method is 11361 included, the server SHALL respond with 403. 11363 8. Upon generating a response the following outcomes can occur: 11365 * A transport spec not using SRTP and MIKEY is selected. Thus 11366 the response will not contain any MIKEY parameter. 11368 * A transport spec using SRTP and MIKEY is selected but an 11369 error is encountered in the MIKEY processing. In that case 11370 an RTSP error response code of 466 "Key Management Error" 11371 SHALL be used. A MIKEY message describing the error MAY be 11372 included. 11374 * A transport spec using SRTP and MIKEY is selected and a MIKEY 11375 response message can be created. The server SHOULD use the 11376 same certificate for TLS and in MIKEY to enable client to 11377 bind the two together. If a different certificate is used it 11378 SHALL be included in the MIKEY message. It is RECOMMENDED 11379 that the envelope key cache type is set to 'Cache' and that a 11380 single envelope key is reused for all MIKEY messages to the 11381 client. That message is included in the MIKEY parameter part 11382 of the single selected transport specification in the SETUP 11383 response. The server will set the SRTP parameters as 11384 preferred for this media stream within the supported range by 11385 the client. 11387 9. The server transmits the SETUP response back to the client. 11389 10. The client receives the SETUP response and if the response code 11390 indicates a successful request it decodes the MIKEY message and 11391 establishes the SRTP cryptographic context from the parameters 11392 in the MIKEY response. 11394 In the above method the client's certificate may be self-signed in 11395 cases where the client's identity is not necessary to authenticate 11396 and the security goal is only to ensure that the RTSP signaling 11397 client is the same as the one receiving the SRTP security context. 11399 C.1.5. SAVPF/UDP 11401 The RTP profile "Extended Secure RTP Profile for RTCP-based Feedback 11402 (RTP/SAVPF)" [RFC5124] is an RTP profile (SAVPF) that MAY be used in 11403 RTSP sessions using RTP. All that is defined for AVPF MUST also 11404 apply for SAVPF. 11406 The usage of SRTP requires that a cryptographic context is 11407 established. The default mechanism for establishing that security 11408 association is to use MIKEY[RFC3830] with RTSP as defined in 11409 Appendix C.1.4.1. 11411 C.1.6. RTCP usage with RTSP 11413 RTCP has several usages when RTP is used for media transport as 11414 explained below. Due to that RTCP MUST be supported if an RTSP agent 11415 handles RTP. 11417 C.1.6.1. Media synchronization 11419 RTCP provides media synchronization and clock drift compensation. 11420 The initial media synchronization is available from RTP-Info header. 11421 However, to be able to handle any clock drift between the media 11422 streams, RTCP is needed. 11424 C.1.6.2. RTSP Session keep-alive 11426 RTCP traffic from the RTSP client to the RTSP server MUST function as 11427 keep-alive. This requires an RTSP server supporting RTP to use the 11428 received RTCP packets as indications that the client desires the 11429 related RTSP session to be kept alive. 11431 C.1.6.3. Bit-rate adaption 11433 RTCP Receiver reports and any additional feedback from the client 11434 MUST be used to adapt the bit-rate used over the transport for all 11435 cases when RTP is sent over UDP. An RTP sender without reserved 11436 resources MUST NOT use more than its fair share of the available 11437 resources. This can be determined by comparing on short to medium 11438 term (some seconds) the used bit-rate and adapt it so that the RTP 11439 sender sends at a bit-rate comparable to what a TCP sender would 11440 achieve on average over the same path. 11442 C.1.6.4. RTP and RTCP Multiplexing 11444 RTSP can be used to negotiate the usage of RTP and RTCP multiplexing 11445 as described in [RFC5761]. This allows servers and client to reduce 11446 the amount of resources required for the session by only requiring 11447 one underlying transport stream per media stream instead of two when 11448 using RTP and RTCP. This lessens the server port consumption and 11449 also the necessary state and keep-alive work when operating across 11450 Network and Address Translators [RFC2663]. 11452 Content must be prepared with some consideration for RTP and RTCP 11453 multiplexing, mainly ensuring that the RTP payload types used do not 11454 collide with the ones used for RTCP packet types. This option likely 11455 needs explicit support from the content unless the RTP payload types 11456 can be remapped by the server and that is correctly reflected in the 11457 session description. Beyond that support of this feature should come 11458 at little cost and much gain. 11460 It is recommended that if the content and server support RTP and RTCP 11461 multiplexing that this is indicated in the session description, for 11462 example using the SDP attribute "a=rtcp-mux". If the SDP message 11463 contains the a=rtcp-mux attribute for a media stream, the server MUST 11464 support RTP and RTCP multiplexing. If indicated or otherwise desired 11465 by the client it can include the Transport parameter "RTCP-mux" in 11466 any transport specification where it desires to use RTCP-mux. The 11467 server will indicate if it supports RTCP-mux. Servers and Clients 11468 SHOULD support RTP and RTCP multiplexing. 11470 For capability exchange, an RTSP feature tag for RTP and RTCP 11471 multiplexing is defined: "setup.rtp.rtcp.mux". 11473 C.2. RTP over TCP 11475 Transport of RTP over TCP can be done in two ways: over independent 11476 TCP connections using RFC 4571 [RFC4571] or interleaved in the RTSP 11477 control connection. In both cases the protocol MUST be "rtp" and the 11478 lower layer MUST be TCP. The profile may be any of the above 11479 specified ones; AVP, AVPF, SAVP or SAVPF. 11481 C.2.1. Interleaved RTP over TCP 11483 The use of embedded (interleaved) binary data transported on the RTSP 11484 connection is possible as specified in Section 14. When using this 11485 declared combination of interleaved binary data the RTSP messages 11486 MUST be transported over TCP. TLS may or may not be used. 11488 One should, however, consider that this will result in all media 11489 streams go through any proxy. Using independent TCP connections can 11490 avoid that issue. 11492 C.2.2. RTP over independent TCP 11494 In this Appendix, we describe the sending of RTP [RFC3550] over lower 11495 transport layer TCP [RFC0793] according to "Framing Real-time 11496 Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over 11497 Connection-Oriented Transport" [RFC4571]. This Appendix adapts the 11498 guidelines for using RTP over TCP within SIP/SDP [RFC4145] to work 11499 with RTSP. 11501 A client codes the support of RTP over independent TCP by specifying 11502 an RTP/AVP/TCP transport option without an interleaved parameter in 11503 the Transport line of a SETUP request. This transport option MUST 11504 include the "unicast" parameter. 11506 If the client wishes to use RTP with RTCP, two ports (or two address/ 11507 port pairs) are specified by the dest_addr parameter. If the client 11508 wishes to use RTP without RTCP, one port (or one address/port pair) 11509 is specified by the dest_addr parameter. If the client wishes to 11510 multiplex RTP and RTCP on a single port (see Appendix C.1.6.4), one 11511 port (or one address/port pair) is specified by the dest_addr 11512 parameter. Ordering rules of dest_addr ports follow the rules for 11513 RTP/AVP/UDP. 11515 If the client wishes to play the active role in initiating the TCP 11516 connection, it MAY set the "setup" parameter (See Section 18.52) on 11517 the Transport line to be "active", or it MAY omit the setup 11518 parameter, as active is the default. If the client signals the 11519 active role, the ports for all dest_addr values MUST be set to 9 (the 11520 discard port). 11522 If the client wishes to play the passive role in TCP connection 11523 initiation, it MUST set the "setup" parameter on the Transport line 11524 to be "passive". If the client is able to assume the active or the 11525 passive role, it MUST set the "setup" parameter on the Transport line 11526 to be "actpass". In either case, the dest_addr port value for RTP 11527 MUST be set to the TCP port number on which the client is expecting 11528 to receive the RTP stream connection, and the dest_addr port value 11529 for RTCP MUST be set to the TCP port number on which the client is 11530 expecting to receive the RTCP stream connection. In the case that 11531 the client wishes to multiplex RTP and RTCP on a single port, one 11532 port is specified by the dest_addr parameter, as mentioned earlier in 11533 this section. 11535 If upon receipt of a non-interleaved RTP/AVP/TCP SETUP request, a 11536 server decides to accept this requested option, the 2xx reply MUST 11537 contain a Transport option that specifies RTP/AVP/TCP (without using 11538 the interleaved parameter, and with using the unicast parameter). 11539 The dest_addr parameter value MUST be echoed from the parameter value 11540 in the client request unless the destination address (only port) was 11541 not provided in which case the server MAY include the source address 11542 of the RTSP TCP connection with the port number unchanged. 11544 In addition, the server reply MUST set the setup parameter on the 11545 Transport line, to indicate the role the server will play in the 11546 connection setup. Permissible values are "active" (if a client set 11547 "setup" to "passive" or "actpass") and "passive" (if a client set 11548 "setup" to "active" or "actpass"). 11550 If a server sets "setup" to "passive", the "src_addr" in the reply 11551 MUST indicate the ports the server is willing to receive an RTP 11552 connection and (if the client requested an RTCP connection by 11553 specifying two dest_addr ports or address/port pairs) an RTCP 11554 connection. If a server sets "setup" to "active", the ports 11555 specified in "src_addr" MUST be set to 9. The server MAY use the 11556 "ssrc" parameter, following the guidance in Section 18.52. The 11557 server sets only one port in the case that the client has indicated 11558 only a single port. Port ordering for src_addr follows the rules for 11559 RTP/AVP/UDP. 11561 Servers MUST support taking the passive role and MAY support taking 11562 the active role. Servers with a public IP address take the passive 11563 role, thus enabling clients behind NATs and Firewalls a better chance 11564 of successful connect to the server by actively connecting outwards. 11565 Therefore the clients are RECOMMENDED to take the active role. 11567 After sending (receiving) a 2xx reply for a SETUP method for a non- 11568 interleaved RTP/AVP/TCP media stream, the active party SHOULD 11569 initiate the TCP connection as soon as possible. The client MUST NOT 11570 send a PLAY request prior to the establishment of all the TCP 11571 connections negotiated using SETUP for the session. In case the 11572 server receives a PLAY request in a session that has not yet 11573 established all the TCP connections, it MUST respond using the 464 11574 "Data Transport Not Ready Yet" (Section 17.4.29) error code. 11576 Once the PLAY request for a media resource transported over non- 11577 interleaved RTP/AVP/TCP occurs, media begins to flow from server to 11578 client over the RTP TCP connection, and RTCP packets flow 11579 bidirectionally over the RTCP TCP connection. As in the RTP/UDP 11580 case, client to server traffic on the TCP port is unspecified by this 11581 memo. The packets that travel on these connections MUST be framed 11582 using the protocol defined in [RFC4571], not by the framing defined 11583 for interleaving RTP over the RTSP control connection defined in 11584 Section 14. 11586 A successful PAUSE request for a media being transported over RTP/ 11587 AVP/TCP pauses the flow of packets over the connections, without 11588 closing the connections. A successful TEARDOWN request signals that 11589 the TCP connections for RTP and RTCP are to be closed as soon as 11590 possible. 11592 Subsequent SETUP requests on an already-SETUP RTP/AVP/TCP URI may be 11593 ambiguous in the following way: does the client wish to open up new 11594 TCP RTP and RTCP connections for the URI, or does the client wish to 11595 continue using the existing TCP RTP and RTCP connections? The client 11596 SHOULD use the "connection" parameter (defined in Section 18.52) on 11597 the Transport line to make its intention clear (by setting 11598 "connection" to "new" if new connections are needed, and by setting 11599 "connection" to "existing" if the existing connections are to be 11600 used). After a 2xx reply for a SETUP request for a new connection, 11601 parties should close the pre-existing connections, after waiting a 11602 suitable period for any stray RTP or RTCP packets to arrive. 11604 The usage of SRTP, i.e., either SAVP or SAVPF profiles, requires that 11605 a security association is established. The default mechanism for 11606 establishing that security association is to use MIKEY[RFC3830] with 11607 RTSP as defined Appendix C.1.4.1. 11609 Below, we rewrite part of the example media on demand example shown 11610 in Appendix A.1 to use RTP/AVP/TCP non-interleaved: 11612 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 11613 CSeq: 1 11614 User-Agent: PhonyClient/1.2 11616 M->C: RTSP/2.0 200 OK 11617 CSeq: 1 11618 Server: PhonyServer/1.0 11619 Date: Thu, 23 Jan 1997 15:35:06 GMT 11620 Content-Type: application/sdp 11621 Content-Length: 227 11622 Content-Base: rtsp://example.com/twister.3gp/ 11623 Expires: 24 Jan 1997 15:35:06 GMT 11625 v=0 11626 o=- 2890844256 2890842807 IN IP4 198.51.100.34 11627 s=RTSP Session 11628 i=An Example of RTSP Session Usage 11629 e=adm@example.com 11630 c=IN IP4 0.0.0.0 11631 a=control: * 11632 a=range: npt=0-0:10:34.10 11633 t=0 0 11634 m=audio 0 RTP/AVP 0 11635 a=control: trackID=1 11637 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 11638 CSeq: 2 11639 User-Agent: PhonyClient/1.2 11640 Require: play.basic 11641 Transport: RTP/AVP/TCP;unicast;dest_addr=":9"/":9"; 11642 setup=active;connection=new 11643 Accept-Ranges: NPT, SMPTE, UTC 11645 M->C: RTSP/2.0 200 OK 11646 CSeq: 2 11647 Server: PhonyServer/1.0 11648 Transport: RTP/AVP/TCP;unicast; 11649 dest_addr=":9"/":9"; 11650 src_addr="198.51.100.5:53478"/"198.51.100:54091"; 11651 setup=passive;connection=new;ssrc=93CB001E 11652 Session: 12345678 11653 Expires: 24 Jan 1997 15:35:12 GMT 11654 Date: 23 Jan 1997 15:35:12 GMT 11655 Accept-Ranges: NPT 11656 Media-Properties: Random-Access=0.8, Immutable, Unlimited 11658 C->M: TCP Connection Establishment x2 11660 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 11661 CSeq: 4 11662 User-Agent: PhonyClient/1.2 11663 Range: npt=30- 11664 Session: 12345678 11666 M->C: RTSP/2.0 200 OK 11667 CSeq: 4 11668 Server: PhonyServer/1.0 11669 Date: 23 Jan 1997 15:35:14 GMT 11670 Session: 12345678 11671 Range: npt=30-623.10 11672 Seek-Style: First-Prior 11673 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=1" 11674 ssrc=4F312DD8:seq=54321;rtptime=2876889 11676 C.3. Handling Media Clock Time Jumps in the RTP Media Layer 11678 RTSP allows media clients to control selected, non-contiguous 11679 sections of media presentations, rendering those streams with an RTP 11680 media layer [RFC3550]. Two cases occur, the first is when a new PLAY 11681 request replaces an old ongoing request and the new request results 11682 in a jump in the media. This should produce in the RTP layer a 11683 continuous media stream. A client may also directly following a 11684 completed PLAY request perform a new PLAY request. This will result 11685 in some gap in the media layer. The below text will look into both 11686 cases. 11688 A PLAY request that replaces an ongoing request allows the media 11689 layer rendering the RTP stream without being affected by jumps in 11690 media clock time. The RTP timestamps for the new media range is set 11691 so that they become continuous with the previous media range in the 11692 previous request. The RTP sequence number for the first packet in 11693 the new range will be the next following the last packet in the 11694 previous range, i.e. monotonically increasing. The goal is to allow 11695 the media rendering layer to work without interruption or 11696 reconfiguration across the jumps in media clock. This should be 11697 possible in all cases of replaced PLAY requests for media that has 11698 random-access properties. In this case care is needed to align 11699 frames or similar media dependent structures. 11701 In cases where jumps in media clock time are a result of RTSP 11702 signaling operations arriving after a completed PLAY operation, the 11703 request timing will result in that media becomes non-continuous. The 11704 server becomes unable to send the media so that it arrives timely and 11705 still carry timestamps to make the media stream continuous. In these 11706 cases the server will produce RTP streams where there are gaps in the 11707 RTP timeline for the media. In such cases, if the media has frame 11708 structure, aligning the timestamp for the next frame with the 11709 previous structure reduces the burden to render this media. The gap 11710 should represent the time the server hasn't been serving media, e.g. 11711 the time between the end of the media stream or a PAUSE request and 11712 the new PLAY request. In these cases the RTP sequence number would 11713 normally be monotonically increasing across the gap. 11715 For RTSP sessions with media that lacks random access properties, 11716 such as live streams, any media clock jump is commonly the result of 11717 a correspondingly long pause of delivery. The RTP timestamp will 11718 have increased in direct proportion to the duration of the paused 11719 delivery. Note also that in this case the RTP sequence number should 11720 be the next packet number. If not, the RTCP packet loss reporting 11721 will indicate as loss all packets not received between the point of 11722 pausing and later resuming. This may trigger congestion avoidance 11723 mechanisms. An allowed exception from the above recommendation on 11724 monotonically increasing RTP sequence number is live media streams, 11725 likely being relayed. In this case, when the client resumes 11726 delivery, it will get the media that is currently being delivered to 11727 the server itself. For this type of basic delivery of live streams 11728 to multiple users over unicast, individual rewriting of RTP sequence 11729 numbers becomes quite a burden. For solutions that anyway caches 11730 media, timeshifts, etc, the rewriting should be a minor issue. 11732 The goal when handling jumps in media clock time is that the provided 11733 stream is continuous without gaps in RTP timestamp or sequence 11734 number. However, when delivery has been halted for some reason the 11735 RTP timestamp when resuming MUST represent the duration the delivery 11736 was halted. RTP sequence number MUST generally be the next number, 11737 i.e. monotonically increasing modulo 65536. For media resources with 11738 the properties Time-Progressing and Time-Duration=0.0 the server MAY 11739 create RTP media streams with RTP sequence number jumps in them due 11740 to the client first halting delivery and later resuming it (PAUSE and 11741 then later PLAY). However, servers utilizing this exception must 11742 take into consideration the resulting RTCP receiver reports that 11743 likely contain loss reports for all the packets part of the 11744 discontinuity. A client cannot rely on that a server will align when 11745 resuming playing even if it is RECOMMENDED. The RTP-Info header will 11746 provide information on how the server acts in each case. 11748 We cannot assume that the RTSP client can communicate with the RTP 11749 media agent, as the two may be independent processes. If the RTP 11750 timestamp shows the same gap as the NPT, the media agent will 11751 assume that there is a pause in the presentation. If the jump in 11752 NPT is large enough, the RTP timestamp may roll over and the media 11753 agent may believe later packets to be duplicates of packets just 11754 played out. Having the RTP timestamp jump will also affect the 11755 RTCP measurements based on this. 11757 As an example, assume an RTP timestamp frequency of 8000 Hz, a 11758 packetization interval of 100 ms and an initial sequence number and 11759 timestamp of zero. 11761 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11762 CSeq: 4 11763 Session: abcdefgh 11764 Range: npt=10-15 11765 User-Agent: PhonyClient/1.2 11767 S->C: RTSP/2.0 200 OK 11768 CSeq: 4 11769 Session: abcdefgh 11770 Range: npt=10-15 11771 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11772 ssrc=0D12F123:seq=0;rtptime=0 11774 The ensuing RTP data stream is depicted below: 11776 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11777 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11778 . . . 11779 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 11781 Upon the completion of the requested delivery the server sends a 11782 PLAY_NOTIFY 11783 S->C: PLAY_NOTIFY rtsp://example.com/fizzle RTSP/2.0 11784 CSeq: 5 11785 Notify-Reason: end-of-stream 11786 Request-Status: cseq=4 status=200 reason="OK" 11787 Range: npt=-15 11788 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 11789 ssrc=0D12F123:seq=49;rtptime=39200 11790 Session: abcdefgh 11792 C->S: RTSP/2.0 200 OK 11793 CSeq: 5 11794 User-Agent: PhonyClient/1.2 11796 Upon the completion of the play range, the client follows up with a 11797 request to PLAY from a new NPT. 11799 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11800 CSeq: 6 11801 Session: abcdefg 11802 Range: npt=18-20 11803 User-Agent: PhonyClient/1.2 11805 S->C: RTSP/2.0 200 OK 11806 CSeq: 6 11807 Session: abcdefg 11808 Range: npt=18-20 11809 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11810 ssrc=0D12F123:seq=50;rtptime=40100 11812 The ensuing RTP data stream is depicted below: 11814 S->C: RTP packet - seq = 50, rtptime = 40100, NPT time = 18s 11815 S->C: RTP packet - seq = 51, rtptime = 40900, NPT time = 18.1s 11816 . . . 11817 S->C: RTP packet - seq = 69, rtptime = 55300, NPT time = 19.9s 11819 In this example, first, NPT 10 through 15 is played, then the client 11820 requests the server to skip ahead and play NPT 18 through 20. The 11821 first segment is presented as RTP packets with sequence numbers 0 11822 through 49 and timestamp 0 through 39,200. The second segment 11823 consists of RTP packets with sequence number 50 through 69, with 11824 timestamps 40,100 through 55,200. While there is a gap in the NPT, 11825 there is no gap in the sequence number space of the RTP data stream. 11827 The RTP timestamp gap is present in the above example due to the time 11828 it takes to perform the second play request, in this case 12.5 ms 11829 (100/8000). 11831 C.4. Handling RTP Timestamps after PAUSE 11833 During a PAUSE / PLAY interaction in an RTSP session, the duration of 11834 time for which the RTP transmission was halted MUST be reflected in 11835 the RTP timestamp of each RTP stream. The duration can be calculated 11836 for each RTP stream as the time elapsed from when the last RTP packet 11837 was sent before the PAUSE request was received and when the first RTP 11838 packet was sent after the subsequent PLAY request was received. The 11839 duration includes all latency incurred and processing time required 11840 to complete the request. 11842 The RTP RFC [RFC3550] states that: The RTP timestamp for each unit 11843 [packet] would be related to the wallclock time at which the unit 11844 becomes current on the virtual presentation timeline. 11846 In order to satisfy the requirements of [RFC3550], the RTP 11847 timestamp space needs to increase continuously with real time. 11848 While this is not optimal for stored media, it is required for RTP 11849 and RTCP to function as intended. Using a continuous RTP 11850 timestamp space allows the same timestamp model for both stored 11851 and live media and allows better opportunity to integrate both 11852 types of media under a single control. 11854 As an example, assume a clock frequency of 8000 Hz, a packetization 11855 interval of 100 ms and an initial sequence number and timestamp of 11856 zero. 11858 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11859 CSeq: 4 11860 Session: abcdefg 11861 Range: npt=10-15 11862 User-Agent: PhonyClient/1.2 11864 S->C: RTSP/2.0 200 OK 11865 CSeq: 4 11866 Session: abcdefg 11867 Range: npt=10-15 11868 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11869 ssrc=0D12F123:seq=0;rtptime=0 11871 The ensuing RTP data stream is depicted below: 11873 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11874 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11875 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 11876 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 11878 The client then sends a PAUSE request: 11880 C->S: PAUSE rtsp://example.com/fizzle RTSP/2.0 11881 CSeq: 5 11882 Session: abcdefg 11883 User-Agent: PhonyClient/1.2 11885 S->C: RTSP/2.0 200 OK 11886 CSeq: 5 11887 Session: abcdefg 11888 Range: npt=10.4-15 11890 20 seconds elapse and then the client sends a PLAY request. In 11891 addition the server requires 15 ms to process the request: 11893 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11894 CSeq: 6 11895 Session: abcdefg 11896 User-Agent: PhonyClient/1.2 11898 S->C: RTSP/2.0 200 OK 11899 CSeq: 6 11900 Session: abcdefg 11901 Range: npt=10.4-15 11902 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11903 ssrc=0D12F123:seq=4;rtptime=164400 11905 The ensuing RTP data stream is depicted below: 11907 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 11908 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 11909 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 11911 First, NPT 10 through 10.3 is played, then a PAUSE is received by the 11912 server. After 20 seconds a PLAY is received by the server which 11913 takes 15 ms to process. The duration of time for which the session 11914 was paused is reflected in the RTP timestamp of the RTP packets sent 11915 after this PLAY request. 11917 A client can use the RTSP range header and RTP-Info header to map NPT 11918 time of a presentation with the RTP timestamp. 11920 Note: In RFC 2326 [RFC2326], this matter was not clearly defined and 11921 was misunderstood commonly. However, for RTSP 2.0 it is expected 11922 that this will be handled correctly and no exception handling will be 11923 required. 11925 Note further: It may be required to reset some of the state to ensure 11926 the correct media decoding and the usual jitter-buffer handling when 11927 issuing a PLAY request. 11929 C.5. RTSP / RTP Integration 11931 For certain datatypes, tight integration between the RTSP layer and 11932 the RTP layer will be necessary. This by no means precludes the 11933 above restrictions. Combined RTSP/RTP media clients should use the 11934 RTP-Info field to determine whether incoming RTP packets were sent 11935 before or after a seek or before or after a PAUSE. 11937 C.6. Scaling with RTP 11939 For scaling (see Section 18.44), RTP timestamps should correspond to 11940 the rendering timing. For example, when playing video recorded at 30 11941 frames/second at a scale of two and speed (Section 18.48) of one, the 11942 server would drop every second frame to maintain and deliver video 11943 packets with the normal timestamp spacing of 3,000 per frame, but NPT 11944 would increase by 1/15 second for each video frame. 11946 Note: The above scaling puts requirements on the media codec or a 11947 media stream to support it. For example motion JPEG or other non- 11948 predictive video coding can easier handle the above example. 11950 C.7. Maintaining NPT synchronization with RTP timestamps 11952 The client can maintain a correct display of NPT (Normal Play Time) 11953 by noting the RTP timestamp value of the first packet arriving after 11954 repositioning. The sequence parameter of the RTP-Info 11955 (Section 18.43) header provides the first sequence number of the next 11956 segment. 11958 C.8. Continuous Audio 11960 For continuous audio, the server SHOULD set the RTP marker bit at the 11961 beginning of serving a new PLAY request or at jumps in timeline. 11962 This allows the client to perform playout delay adaptation. 11964 C.9. Multiple Sources in an RTP Session 11966 Note that more than one SSRC MAY be sent in the media stream. If it 11967 happens all sources are expected to be rendered simultaneously. 11969 C.10. Usage of SSRCs and the RTCP BYE Message During an RTSP Session 11971 The RTCP BYE message indicates the end of use of a given SSRC. If 11972 all sources leave an RTP session, it can, in most cases, be assumed 11973 to have ended. Therefore, a client or server MUST NOT send an RTCP 11974 BYE message until it has finished using a SSRC. A server SHOULD keep 11975 using a SSRC until the RTP session is terminated. Prolonging the use 11976 of a SSRC allows the established synchronization context associated 11977 with that SSRC to be used to synchronize subsequent PLAY requests 11978 even if the PLAY response is late. 11980 An SSRC collision with the SSRC that transmits media does also have 11981 consequences, as it will normally force the media sender to change 11982 its SSRC in accordance with the RTP specification [RFC3550]. 11983 However, an RTSP server may wait and see if the client changes and 11984 thus resolve the conflict to minimize the impact. As media sender 11985 SSRC change will result in a loss of synchronization context, and 11986 require any receiver to wait for RTCP sender reports for all media 11987 requiring synchronization before being able to play out synchronized. 11988 Due to these reasons a client joining a session should take care to 11989 not select the same SSRC(s) as the server indicates in the ssrc 11990 Transport header parameter. Any SSRC signalled in the Transport 11991 header MUST be avoided. A client detecting a collision prior to 11992 sending any RTP or RTCP messages SHALL also select a new SSRC. 11994 C.11. Future Additions 11996 It is the intention that any future protocol or profile regarding 11997 media delivery and lower transport should be easy to add to RTSP. 11998 This section provides the necessary steps that needs to be meet. 12000 The following things needs to be considered when adding a new 12001 protocol or profile for use with RTSP: 12003 o The protocol or profile needs to define a name tag representing 12004 it. This tag is required to be an ABNF "token" to be possible to 12005 use in the Transport header specification. 12007 o The useful combinations of protocol, profiles and lower layer 12008 transport for this extension needs to be defined. For each 12009 combination declare the necessary parameters to use in the 12010 Transport header. 12012 o For new media protocols the interaction with RTSP needs to be 12013 addressed. One important factor will be the media 12014 synchronization. It may be necessary to have new headers similar 12015 to RTP info to carry this information. 12017 o Discuss congestion control for media, especially if transport 12018 without built in congestion control is used. 12020 See the IANA section (Section 22) for information how to register new 12021 attributes. 12023 Appendix D. Use of SDP for RTSP Session Descriptions 12025 The Session Description Protocol (SDP, [RFC4566]) may be used to 12026 describe streams or presentations in RTSP. This description is 12027 typically returned in reply to a DESCRIBE request on an URI from a 12028 server to a client, or received via HTTP from a server to a client. 12030 This appendix describes how an SDP file determines the operation of 12031 an RTSP session. SDP as is provides no mechanism by which a client 12032 can distinguish, without human guidance, between several media 12033 streams to be rendered simultaneously and a set of alternatives 12034 (e.g., two audio streams spoken in different languages). The SDP 12035 extension "Grouping of Media Lines in the Session Description 12036 Protocol (SDP)" [RFC5888] provides such functionality to some degree. 12037 Appendix D.4 describes the usage of SDP media line grouping for RTSP. 12039 D.1. Definitions 12041 The terms "session-level", "media-level" and other key/attribute 12042 names and values used in this appendix are to be used as defined in 12043 SDP[RFC4566]: 12045 D.1.1. Control URI 12047 The "a=control:" attribute is used to convey the control URI. This 12048 attribute is used both for the session and media descriptions. If 12049 used for individual media, it indicates the URI to be used for 12050 controlling that particular media stream. If found at the session 12051 level, the attribute indicates the URI for aggregate control 12052 (presentation URI). The session level URI MUST be different from any 12053 media level URI. The presence of a session level control attribute 12054 MUST be interpreted as support for aggregated control. The control 12055 attribute MUST be present on media level unless the presentation only 12056 contains a single media stream, in which case the attribute MAY be 12057 present on the session level only and then also apply to that single 12058 media stream. 12060 ABNF for the attribute is defined in Section 20.3. 12062 Example: 12063 a=control:rtsp://example.com/foo 12065 This attribute MAY contain either relative or absolute URIs, 12066 following the rules and conventions set out in RFC 3986 [RFC3986]. 12067 Implementations MUST look for a base URI in the following order: 12069 1. the RTSP Content-Base field; 12070 2. the RTSP Content-Location field; 12072 3. the RTSP Request-URI. 12074 If this attribute contains only an asterisk (*), then the URI MUST be 12075 treated as if it were an empty embedded URI, and thus inherit the 12076 entire base URI. 12078 Note, RFC 2326 was very unclear on the processing of relative URI 12079 and several RTSP 1.0 implementations at the point of publishing 12080 this document did not perform RFC 3986 processing to determine the 12081 resulting URI, instead simple concatenation is common. To avoid 12082 this issue completely it is recommended to use absolute URI in the 12083 SDP. 12085 The URI handling for SDPs from container files need special 12086 consideration. For example let's assume that a container file has 12087 the URI: "rtsp://example.com/container.mp4". Let's further assume 12088 this URI is the base URI, and that there is an absolute media level 12089 URI: "rtsp://example.com/container.mp4/trackID=2". A relative media 12090 level URI that resolves in accordance with RFC 3986 [RFC3986] to the 12091 above given media URI is: "container.mp4/trackID=2". It is usually 12092 not desirable to need to include in or modify the SDP stored within 12093 the container file with the server local name of the container file. 12094 To avoid this, one can modify the base URI used to include a trailing 12095 slash, e.g. "rtsp://example.com/container.mp4/". In this case the 12096 relative URI for the media will only need to be: "trackID=2". 12097 However, this will also mean that using "*" in the SDP will result in 12098 control URI including the trailing slash, i.e. 12099 "rtsp://example.com/container.mp4/". 12101 Note: The usage of TrackID in the above is not a standardized 12102 form, but one example out of several similar strings such as 12103 TrackID, Track_ID, StreamID that is used by different server 12104 vendors to indicate a particular piece of media inside a container 12105 file. 12107 D.1.2. Media Streams 12109 The "m=" field is used to enumerate the streams. It is expected that 12110 all the specified streams will be rendered with appropriate 12111 synchronization. If the session is over multicast, the port number 12112 indicated SHOULD be used for reception. The client MAY try to 12113 override the destination port, through the Transport header. The 12114 servers MAY allow this, the response will indicate if allowed or not. 12115 If the session is unicast, the port numbers are the ones RECOMMENDED 12116 by the server to the client, about which receiver ports to use; the 12117 client MUST still include its receiver ports in its SETUP request. 12119 The client MAY ignore this recommendation. If the server has no 12120 preference, it SHOULD set the port number value to zero. 12122 The "m=" lines contain information about which transport protocol, 12123 profile, and possibly lower-layer is to be used for the media stream. 12124 The combination of transport, profile and lower layer, like RTP/AVP/ 12125 UDP needs to be defined for how to be used with RTSP. The currently 12126 defined combinations are defined in Appendix C, further combinations 12127 MAY be specified. 12129 Example: 12130 m=audio 0 RTP/AVP 31 12132 D.1.3. Payload Type(s) 12134 The payload type(s) are specified in the "m=" line. In case the 12135 payload type is a static payload type from RFC 3551 [RFC3551], no 12136 other information may be required. In case it is a dynamic payload 12137 type, the media attribute "rtpmap" is used to specify what the media 12138 is. The "encoding name" within the "rtpmap" attribute may be one of 12139 those specified in RFC 3551 (Sections 5 and 6), or media type 12140 registered with IANA [RFC4288], or an experimental encoding as 12141 specified in SDP (RFC 4566 [RFC4566]). Codec-specific parameters are 12142 not specified in this field, but rather in the "fmtp" attribute 12143 described below. 12145 The selection of the RTP payload type numbers used may be required to 12146 consider RTP and RTCP Multiplexing [RFC5761] if that is to be 12147 supported by the server. 12149 D.1.4. Format-Specific Parameters 12151 Format-specific parameters are conveyed using the "fmtp" media 12152 attribute. The syntax of the "fmtp" attribute is specific to the 12153 encoding(s) that the attribute refers to. Note that some of the 12154 format specific parameters may be specified outside of the fmtp 12155 parameters, like for example the "ptime" attribute for most audio 12156 encodings. 12158 D.1.5. Directionality of media stream 12160 The SDP attributes "a=sendrecv", "a=recvonly" and "a=sendonly" 12161 provide instructions about the direction the media streams flow 12162 within a session. When using RTSP the SDP can be delivered to a 12163 client using either RTSP DESCRIBE or a number of RTSP external 12164 methods, like HTTP, FTP, and email. Based on this the SDP applies to 12165 how the RTSP client will see the complete session. Thus media 12166 streams delivered from the RTSP server to the client, would be given 12167 the "a=recvonly" attribute. 12169 The direction attributes are not commonly used in SDPs for RTSP, but 12170 may occur. "a=recvonly" in a SDP provided to the RTSP client MUST 12171 indicate that media delivery will only occur in the direction from 12172 the RTSP server to the client. In SDP provided to the RTSP client 12173 that lacks any of the directionality attributes (a=recvonly, 12174 a=sendonly, a=sendrecv) MUST behave as if the "a=recvonly" attribute 12175 was received. Note that this overrules the normal default rule 12176 defined in SDP[RFC4566]. The usage of "a=sendonly" or "a=sendrecv" 12177 is not defined, nor is the interpretation of SDP by other entities 12178 than the RTSP client. 12180 D.1.6. Range of Presentation 12182 The "a=range" attribute defines the total time range of the stored 12183 session or an individual media. Non-seekable live sessions can be 12184 indicated as specified below, while the length of live sessions can 12185 be deduced from the "t=" and "r=" SDP parameters. 12187 The attribute is both a session and a media level attribute. For 12188 presentations that contain media streams of the same duration, the 12189 range attribute SHOULD only be used at session-level. In case of 12190 different lengths the range attribute MUST be given at media level 12191 for all media, and SHOULD NOT be given at session level. If the 12192 attribute is present at both media level and session level the media 12193 level values MUST be used. 12195 Note: Usually one will specify the same length for all media, even if 12196 there isn't media available for the full duration on all media. 12197 However, that requires that the server accepts PLAY requests within 12198 that range. 12200 Servers MUST take care to provide RTSP Range (see Section 18.38) 12201 values that are consistent with what is presented in the SDP for the 12202 content. There is no reason for non dynamic content, like media 12203 clips provided on demand to have inconsistent values. Inconsistent 12204 values between the SDP and the actual values for the content handled 12205 by the server is likely to generate some failure, like 457 "Invalid 12206 Range", in case the client uses PLAY requests with a Range header. 12207 In case the content is dynamic in length and it is infeasible to 12208 provide a correct value in the SDP the server is recommended to 12209 describe this as non-seekable content (see below). The server MAY 12210 override that property in the response to a PLAY request using the 12211 correct values in the Range header. 12213 The unit is specified first, followed by the value range. The units 12214 and their values are as defined in Section 4.4, Section 4.5 and 12215 Section 4.6 and MAY be extended with further formats. Any open ended 12216 range (start-), i.e. without stop range, is of unspecified duration 12217 and MUST be considered as non-seekable content unless this property 12218 is overridden. Multiple instances carrying different clock formats 12219 MAY be included at either session or media level. 12221 ABNF for the attribute is defined in Section 20.3. 12223 Examples: 12224 a=range:npt=0-34.4368 12225 a=range:clock=19971113T211503Z-19971113T220300Z 12226 Non seekable stream of unknown duration: 12227 a=range:npt=0- 12229 D.1.7. Time of Availability 12231 The "t=" field defines when the SDP is valid. For on-demand content 12232 the server SHOULD indicate a stop time value for which it guarantees 12233 the description to be valid, and a start time that is equal to or 12234 before the time at which the DESCRIBE request was received. It MAY 12235 also indicate start and stop times of 0, meaning that the session is 12236 always available. 12238 For sessions that are of live type, i.e. specific start time, unknown 12239 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 12240 to indicate the start time of the event. The stop time SHOULD be 12241 given so that the live event will have ended at that time, while 12242 still not be unnecessary long into the future. 12244 D.1.8. Connection Information 12246 In SDP used with RTSP, the "c=" field contains the destination 12247 address for the media stream. If a multicast address is specified 12248 the client SHOULD use this address in any SETUP request as 12249 destination address, including any additional parameters, such as 12250 TTL. For on-demand unicast streams and some multicast streams, the 12251 destination address MAY be specified by the client via the SETUP 12252 request, thus overriding any specified address. To identify streams 12253 without a fixed destination address, where the client is required to 12254 specify a destination address, the "c=" field SHOULD be set to a null 12255 value. For addresses of type "IP4", this value MUST be "0.0.0.0", 12256 and for type "IP6", this value MUST be "0:0:0:0:0:0:0:0" (can also be 12257 written as "::"), i.e. the unspecified address according to RFC 4291 12258 [RFC4291]. 12260 D.1.9. Message Body Tag 12262 The optional "a=mtag" attribute identifies a version of the session 12263 description. It is opaque to the client. SETUP requests may include 12264 this identifier in the If-Match field (see Section 18.23) to only 12265 allow session establishment if this attribute value still corresponds 12266 to that of the current description. The attribute value is opaque 12267 and may contain any character allowed within SDP attribute values. 12269 ABNF for the attribute is defined in Section 20.3. 12271 Example: 12272 a=mtag:"158bb3e7c7fd62ce67f12b533f06b83a" 12274 One could argue that the "o=" field provides identical 12275 functionality. However, it does so in a manner that would put 12276 constraints on servers that need to support multiple session 12277 description types other than SDP for the same piece of media 12278 content. 12280 D.2. Aggregate Control Not Available 12282 If a presentation does not support aggregate control no session level 12283 "a=control:" attribute is specified. For a SDP with multiple media 12284 sections specified, each section will have its own control URI 12285 specified via the "a=control:" attribute. 12287 Example: 12288 v=0 12289 o=- 2890844256 2890842807 IN IP4 192.0.2.56 12290 s=I came from a web page 12291 e=adm@example.com 12292 c=IN IP4 0.0.0.0 12293 t=0 0 12294 m=video 8002 RTP/AVP 31 12295 a=control:rtsp://audio.example.com/movie.aud 12296 m=audio 8004 RTP/AVP 3 12297 a=control:rtsp://video.example.com/movie.vid 12299 Note that the position of the control URI in the description implies 12300 that the client establishes separate RTSP control sessions to the 12301 servers audio.example.com and video.example.com. 12303 It is recommended that an SDP file contains the complete media 12304 initialization information even if it is delivered to the media 12305 client through non-RTSP means. This is necessary as there is no 12306 mechanism to indicate that the client should request more detailed 12307 media stream information via DESCRIBE. 12309 D.3. Aggregate Control Available 12311 In this scenario, the server has multiple streams that can be 12312 controlled as a whole. In this case, there are both a media-level 12313 "a=control:" attributes, which are used to specify the stream URIs, 12314 and a session-level "a=control:" attribute which is used as the 12315 Request-URI for aggregate control. If the media-level URI is 12316 relative, it is resolved to absolute URIs according to Appendix D.1.1 12317 above. 12319 Example: 12320 C->M: DESCRIBE rtsp://example.com/movie RTSP/2.0 12321 CSeq: 1 12322 User-Agent: PhonyClient/1.2 12324 M->C: RTSP/2.0 200 OK 12325 CSeq: 1 12326 Date: Thu, 23 Jan 1997 15:35:06 GMT 12327 Expires: Thu, 23 Jan 1997 16:35:06 GMT 12328 Content-Type: application/sdp 12329 Content-Base: rtsp://example.com/movie/ 12330 Content-Length: 227 12332 v=0 12333 o=- 2890844256 2890842807 IN IP4 192.0.2.211 12334 s=I contain 12335 i= 12336 e=adm@example.com 12337 c=IN IP4 0.0.0.0 12338 a=control:* 12339 t=0 0 12340 m=video 8002 RTP/AVP 31 12341 a=control:trackID=1 12342 m=audio 8004 RTP/AVP 3 12343 a=control:trackID=2 12345 In this example, the client is recommended to establish a single RTSP 12346 session to the server, and uses the URIs 12347 rtsp://example.com/movie/trackID=1 and 12348 rtsp://example.com/movie/trackID=2 to set up the video and audio 12349 streams, respectively. The URI rtsp://example.com/movie/, which is 12350 resolved from the "*", controls the whole presentation (movie). 12352 A client is not required to issue SETUP requests for all streams 12353 within an aggregate object. Servers should allow the client to ask 12354 for only a subset of the streams. 12356 D.4. Grouping of Media Lines in SDP 12358 For some types of media it is desirable to express a relationship 12359 between various media components, for instance, for lip 12360 synchronization or Scalable Video Codec (SVC) [RFC5583]. This 12361 relationship is expressed on the SDP level by grouping of media 12362 lines, as described in [RFC5888] and can be exposed to RTSP. 12364 For RTSP it is mainly important to know how to handle grouped medias 12365 received by means of SDP, i.e., if the media are under aggregate 12366 control (see Appendix D.3) or if aggregate control is not available 12367 (see Appendix D.2). 12369 It is RECOMMENDED that grouped medias are handled by aggregate 12370 control, to give the client the ability to control either the whole 12371 presentation or single medias. 12373 D.5. RTSP external SDP delivery 12375 There are some considerations that need to be made when the session 12376 description is delivered to the client outside of RTSP, for example 12377 via HTTP or email. 12379 First of all, the SDP needs to contain absolute URIs, since relative 12380 will in most cases not work as the delivery will not correctly 12381 forward the base URI. 12383 The writing of the SDP session availability information, i.e. "t=" 12384 and "r=", needs to be carefully considered. When the SDP is fetched 12385 by the DESCRIBE method, the probability that it is valid is very 12386 high. However, the same is much less certain for SDPs distributed 12387 using other methods. Therefore the publisher of the SDP should take 12388 care to follow the recommendations about availability in the SDP 12389 specification [RFC4566] in Section 4.2. 12391 Appendix E. RTSP Use Cases 12393 This Appendix describes the most important and considered use cases 12394 for RTSP. They are listed in descending order of importance in 12395 regards to ensuring that all necessary functionality is present. 12396 This specification only fully supports usage of the two first. Also 12397 in these first two cases, there are special cases or exceptions that 12398 are not supported without extensions, e.g. the redirection of media 12399 delivery to another address than the controlling agent's (client's). 12401 E.1. On-demand Playback of Stored Content 12403 An RTSP capable server stores content suitable for being streamed to 12404 a client. A client desiring playback of any of the stored content 12405 uses RTSP to set up the media transport required to deliver the 12406 desired content. RTSP is then used to initiate, halt and manipulate 12407 the actual transmission (playout) of the content. RTSP is also 12408 required to provide necessary description and synchronization 12409 information for the content. 12411 The above high level description can be broken down into a number of 12412 functions that RTSP needs to be capable of. 12414 Presentation Description: Provide initialization information about 12415 the presentation (content); for example, which media codecs are 12416 needed for the content. Other information that is important 12417 includes the number of media streams the presentation contains, 12418 the transport protocols used for the media streams, and 12419 identifiers for these media streams. This information is 12420 required before setup of the content is possible and to 12421 determine if the client is even capable of using the content. 12423 This information need not be sent using RTSP; other external 12424 protocols can be used to transmit the transport presentation 12425 descriptions. Two good examples are the use of HTTP [RFC2616] 12426 or email to fetch or receive presentation descriptions like SDP 12427 [RFC4566] 12429 Setup: Set up some or all of the media streams in a presentation. 12430 The setup itself consists of selecting the protocol for media 12431 transport and the necessary parameters for the protocol, like 12432 addresses and ports. 12434 Control of Transmission: After the necessary media streams have been 12435 established the client can request the server to start 12436 transmitting the content. The client must be allowed to start 12437 or stop the transmission of the content at arbitrary times. 12438 The client must also be able to start the transmission at any 12439 point in the timeline of the presentation. 12441 Synchronization: For media transport protocols like RTP [RFC3550] it 12442 might be beneficial to carry synchronization information within 12443 RTSP. This may be due to either the lack of inter-media 12444 synchronization within the protocol itself, or the potential 12445 delay before the synchronization is established (which is the 12446 case for RTP when using RTCP). 12448 Termination: Terminate the established contexts. 12450 For this use case there are a number of assumptions about how it 12451 works. These are: 12453 On-Demand content: The content is stored at the server and can be 12454 accessed at any time during a time period when it is intended 12455 to be available. 12457 Independent sessions: A server is capable of serving a number of 12458 clients simultaneously, including from the same piece of 12459 content at different points in that presentations time-line. 12461 Unicast Transport: Content for each individual client is transmitted 12462 to them using unicast traffic. 12464 It is also possible to redirect the media traffic to a different 12465 destination than that of the agent controlling the traffic. However, 12466 allowing this without appropriate mechanisms for checking that the 12467 destination approves of this allows for distributed denial of service 12468 attacks (DDoS). 12470 E.2. Unicast Distribution of Live Content 12472 This use case is similar to the above on-demand content case (see 12473 Appendix E.1) the difference is the nature of the content itself. 12474 Live content is continuously distributed as it becomes available from 12475 a source; i.e., the main difference from on-demand is that one starts 12476 distributing content before the end of it has become available to the 12477 server. 12479 In many cases the consumer of live content is only interested in 12480 consuming what actually happens "now"; i.e., very similar to 12481 broadcast TV. However, in this case it is assumed that there exists 12482 no broadcast or multicast channel to the users, and instead the 12483 server functions as a distribution node, sending the same content to 12484 multiple receivers, using unicast traffic between server and client. 12485 This unicast traffic and the transport parameters are individually 12486 negotiated for each receiving client. 12488 Another aspect of live content is that it often has a very limited 12489 time of availability, as it is only available for the duration of the 12490 event the content covers. An example of such a live content could be 12491 a music concert which lasts 2 hour and starts at a predetermined 12492 time. Thus there is a need to announce when and for how long the 12493 live content is available. 12495 In some cases, the server providing live content may be saving some 12496 or all of the content to allow clients to pause the stream and resume 12497 it from the paused point, or to "rewind" and play continuously from a 12498 point earlier than the live point. Hence, this use case does not 12499 necessarily exclude playing from other than the live point of the 12500 stream, playing with scales other than 1.0, etc. 12502 E.3. On-demand Playback using Multicast 12504 It is possible to use RTSP to request that media be delivered to a 12505 multicast group. The entity setting up the session (the controller) 12506 will then control when and what media is delivered to the group. 12507 This use case has some potential for denial of service attacks by 12508 flooding a multicast group. Therefore, a mechanism is needed to 12509 indicate that the group actually accepts the traffic from the RTSP 12510 server. 12512 An open issue in this use case is how one ensures that all receivers 12513 listening to the multicast or broadcast receives the session 12514 presentation configuring the receivers. This specification has to 12515 rely on an external solution to solve this issue. 12517 E.4. Inviting an RTSP server into a conference 12519 If one has an established conference or group session, it is possible 12520 to have an RTSP server distribute media to the whole group. 12521 Transmission to the group is simplest when controlled by a single 12522 participant or leader of the conference. Shared control might be 12523 possible, but would require further investigation and possibly 12524 extensions. 12526 This use case assumes that there exists either multicast or a 12527 conference focus that redistribute media to all participants. 12529 This use case is intended to be able to handle the following 12530 scenario: A conference leader or participant (hereafter called the 12531 controller) has some pre-stored content on an RTSP server that he 12532 wants to share with the group. The controller sets up an RTSP 12533 session at the streaming server for this content and retrieves the 12534 session description for the content. The destination for the media 12535 content is set to the shared multicast group or conference focus. 12537 When desired by the controller, he/she can start and stop the 12538 transmission of the media to the conference group. 12540 There are several issues with this use case that are not solved by 12541 this core specification for RTSP: 12543 Denial of service: To avoid an RTSP server from being an unknowing 12544 participant in a denial of service attack the server needs to 12545 be able to verify the destination's acceptance of the media. 12546 Such a mechanism to verify the approval of received media does 12547 not yet exist; instead, only policies can be used, which can be 12548 made to work in controlled environments. 12550 Distributing the presentation description to all participants in the 12551 group: To enable a media receiver to correctly decode the content 12552 the media configuration information needs to be distributed 12553 reliably to all participants. This will most likely require 12554 support from an external protocol. 12556 Passing control of the session: If it is desired to pass control of 12557 the RTSP session between the participants, some support will be 12558 required by an external protocol to exchange state information 12559 and possibly floor control of who is controlling the RTSP 12560 session. 12562 E.5. Live Content using Multicast 12564 This use case in its simplest form does not require any use of RTSP 12565 at all; this is what multicast conferences being announced with SAP 12566 [RFC2974] and SDP are intended to handle. However, in use cases 12567 where more advanced features like access control to the multicast 12568 session are desired, RTSP could be used for session establishment. 12570 A client desiring to join a live multicasted media session with 12571 cryptographic (encryption) access control could use RTSP in the 12572 following way. The source of the session announces the session and 12573 gives all interested an RTSP URI. The client connects to the server 12574 and requests the presentation description, allowing configuration for 12575 reception of the media. In this step it is possible for the client 12576 to use secured transport and any desired level of authentication; for 12577 example, for billing or access control. An RTSP link also allows for 12578 load balancing between multiple servers. 12580 If these were the only goals, they could be achieved by simply using 12581 HTTP. However, for cases where the sender likes to keep track of 12582 each individual receiver of a session, and possibly use the session 12583 as a side channel for distributing key-updates or other information 12584 on a per-receiver basis, and the full set of receivers is not known 12585 prior to the session start, the state establishment that RTSP 12586 provides can be beneficial. In this case a client would establish an 12587 RTSP session for this multicast group with the RTSP server. The RTSP 12588 server will not transmit any media, but instead will point to the 12589 multicast group. The client and server will be able to keep the 12590 session alive for as long as the receiver participates in the session 12591 thus enabling, for example, the server to push updates to the client. 12593 This use case will most likely not be able to be implemented without 12594 some extensions to the server-to-client push mechanism. Here the 12595 PLAY_NOTIFY method (see Section 13.5) with a suitable extension could 12596 provide clear benefits. 12598 Appendix F. Text format for Parameters 12600 A resource of type "text/parameters" consists of either 1) a list of 12601 parameters (for a query) or 2) a list of parameters and associated 12602 values (for an response or setting of the parameter). Each entry of 12603 the list is a single line of text. Parameters are separated from 12604 values by a colon. The parameter name MUST only use US-ASCII visible 12605 characters while the values are UTF-8 text strings. The media type 12606 registration form is in Section 22.16. 12608 There is a potential interoperability issue for this format. It was 12609 named in RFC 2326 but never defined, even if used in examples that 12610 hint at the syntax. This format matches the purpose and its syntax 12611 supports the examples provided. However, it goes further by allowing 12612 UTF-8 in the value part, thus usage of UTF-8 strings may not be 12613 supported. However, as individual parameters are not defined, the 12614 using application anyway needs to have out-of-band agreement or using 12615 feature-tag to determine if the end-point supports the parameters. 12617 The ABNF [RFC5234] grammar for "text/parameters" content is: 12619 file = *((parameter / parameter-value) CRLF) 12620 parameter = 1*visible-except-colon 12621 parameter-value = parameter *WSP ":" value 12622 visible-except-colon = %x21-39 / %x3B-7E ; VCHAR - ":" 12623 value = *(TEXT-UTF8char / WSP) 12624 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 12625 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 12626 / %xE0-EF 2UTF8-CONT 12627 / %xF0-F7 3UTF8-CONT 12628 / %xF8-FB 4UTF8-CONT 12629 / %xFC-FD 5UTF8-CONT 12630 UTF8-CONT = %x80-BF 12631 WSP = ; Space or HTAB 12632 VCHAR = 12633 CRLF = 12635 Appendix G. Requirements for Unreliable Transport of RTSP 12637 This section provides anyone intending to define how to transport of 12638 RTSP messages over a unreliable transport protocol with some 12639 information learned by the attempt in RFC 2326 [RFC2326]. RFC 2326 12640 defined both an URI scheme and some basic functionality for transport 12641 of RTSP messages over UDP, however, it was not sufficient for 12642 reliable usage and successful interoperability. 12644 The RTSP scheme defined for unreliable transport of RTSP messages was 12645 "rtspu". It has been reserved by this specification as at least one 12646 commercial implementation exists, thus avoiding any collisions in the 12647 name space. 12649 The following considerations should exist for operation of RTSP over 12650 an unreliable transport protocol: 12652 o Request shall be acknowledged by the receiver. If there is no 12653 acknowledgement, the sender may resend the same message after a 12654 timeout of one round-trip time (RTT). Any retransmissions due to 12655 lack of acknowledgement must carry the same sequence number as the 12656 original request. 12658 o The round-trip time can be estimated as in TCP (RFC 6298) 12659 [RFC6298], with an initial round-trip value of 500 ms. An 12660 implementation may cache the last RTT measurement as the initial 12661 value for future connections. 12663 o The Timestamp header (Section 18.51) is used to avoid the 12664 retransmission ambiguity problem [Stevens98]. 12666 o The registered default port for RTSP over UDP for the server is 12667 554. 12669 o RTSP messages can be carried over any lower-layer transport 12670 protocol that is 8-bit clean. 12672 o RTSP messages are vulnerable to bit errors and should not be 12673 subjected to them. 12675 o Source authentication, or at least validation that RTSP messages 12676 comes from the same entity becomes extremely important, as session 12677 hijacking may be substantially easier for RTSP message transport 12678 using an unreliable protocol like UDP than for TCP. 12680 There are two RTSP headers that are primarily intended for being used 12681 by the unreliable handling of RTSP messages and which will be 12682 maintained: 12684 o CSeq: See Section 18.19 12686 o Timestamp: See Section 18.51 12688 Appendix H. Backwards Compatibility Considerations 12690 This section contains notes on issues about backwards compatibility 12691 with clients or servers being implemented according to RFC 2326 12692 [RFC2326]. Note that there exists no requirement to implement RTSP 12693 1.0; in fact we recommend against it as it is difficult to do in an 12694 interoperable way. 12696 A server implementing RTSP/2.0 MUST include an RTSP-Version of 12697 RTSP/2.0 in all responses to requests containing RTSP-Version 12698 RTSP/2.0. If a server receives an RTSP/1.0 request, it MAY respond 12699 with an RTSP/1.0 response if it chooses to support RFC 2326. If the 12700 server chooses not to support RFC 2326, it MUST respond with a 505 12701 (RTSP Version not supported) status code. A server MUST NOT respond 12702 to an RTSP-Version RTSP/1.0 request with an RTSP-Version RTSP/2.0 12703 response. 12705 Clients implementing RTSP/2.0 MAY use an OPTIONS request with a RTSP- 12706 Version of 2.0 to determine whether a server supports RTSP/2.0. If 12707 the server responds with either an RTSP-Version of 1.0 or a status 12708 code of 505 (RTSP Version not supported), the client will have to use 12709 RTSP/1.0 requests if it chooses to support RFC 2326. 12711 H.1. Play Request in Play State 12713 The behavior in the server when a Play is received in Play state has 12714 changed (Section 13.4). In RFC 2326, the new PLAY request would be 12715 queued until the current Play completed. Any new PLAY request now 12716 takes effect immediately replacing the previous request. 12718 H.2. Using Persistent Connections 12720 Some server implementations of RFC 2326 maintain a one-to-one 12721 relationship between a connection and an RTSP session. Such 12722 implementations require clients to use a persistent connection to 12723 communicate with the server and when a client closes its connection, 12724 the server may remove the RTSP session. This is worth noting if a 12725 RTSP 2.0 client also supporting 1.0 connects to a 1.0 server. 12727 Appendix I. Changes 12729 This appendix briefly lists the differences between RTSP 1.0 12730 [RFC2326] and RTSP 2.0 for an informational purpose. For 12731 implementers of RTSP 2.0 it is recommended to read carefully through 12732 this memo and not to rely on the list of changes below to adapt from 12733 RTSP 1.0 to RTSP 2.0, as RTSP 2.0 is not intended to be backwards 12734 compatible with RTSP 1.0 [RFC2326] other than the version negotiation 12735 mechanism. 12737 I.1. Brief Overview 12739 The following protocol elements were removed in RTSP 2.0 compared to 12740 RTSP 1.0: 12742 o there is no section on minimal implementation anymore, but more 12743 the definition of RTSP 2.0 core; 12745 o the RECORD and ANNOUNCE methods and all related functionality 12746 (including 201 (Created) and 250 (Low On Storage Space) status 12747 codes); 12749 o the use of UDP for RTSP message transport was removed due to 12750 missing interest and to broken specification; 12752 o the use of PLAY method for keep-alive in Play state. 12754 The following protocol elements were added or changed in RTSP 2.0 12755 compared to RTSP 1.0: 12757 o RTSP session TEARDOWN from the server to the client; 12759 o IPv6 support; 12761 o extended IANA registries (e.g., transport headers parameters, 12762 transport-protocol, profile, lower-transport, and mode); 12764 o request pipelining for quick session start-up; 12766 o fully reworked state-machine; 12768 o RTSP messages now use URIs rather then URLs; 12770 o incorporated much of related HTTP text ([RFC2616]) in this memo, 12771 compared to just referencing the sections in HTTP, to avoid 12772 ambiguities; 12774 o the REDIRECT method was expanded and diversified for different 12775 situations; 12777 o Includes a new section about how to setup different media 12778 transport alternatives and their profiles, and lower layer 12779 protocols. This caused the appendix on RTP interaction to be 12780 moved there instead of being in the part which describes RTP. The 12781 section also includes guidelines what to consider when writing 12782 usage guidelines for new protocols and profiles; 12784 o Added an asynchronous notification method PLAY_NOTIFY. This 12785 method is used by the RTSP server to asynchronously notify clients 12786 about session changes while in Play state. To a limited extent 12787 this is comparable with some implementations of ANNOUNCE in RTSP 12788 1.0 not intended for Recording. 12790 I.2. Detailed List of Changes 12792 Compared to RTSP 1.0 (RFC 2326), the below changes has been made when 12793 defining RTSP 2.0. Note that this list does not reflect minor 12794 changes in wording or correction of typographical errors. 12796 o The section on minimal implementation was deleted without 12797 substitution. 12799 o The Transport header has been changed in the following way: 12801 * The ABNF has been changed to define that extensions are 12802 possible, and that unknown parameters result in that servers 12803 ignore the transport specification. 12805 * To prevent backwards compatibility issues, any extension or new 12806 parameter requires the usage of a feature-tag combined with the 12807 Require header. 12809 * Syntax unclarities with the Mode parameter have been resolved. 12811 * Syntax error with ";" for multicast and unicast has been 12812 resolved. 12814 * Two new addressing parameters have been defined, src_addr and 12815 dest_addr. These replace the parameters "port", "client_port", 12816 "server_port", "destination", "source". 12818 * Support for IPv6 explicit addresses in all address fields has 12819 been included. 12821 * To handle URI definitions that contain ";" or "," a quoted URI 12822 format has been introduced and is required. 12824 * Defined IANA registries for the transport headers parameters, 12825 transport-protocol, profile, lower-transport, and mode. 12827 * The transport headers interleaved parameter's text was made 12828 more strict and uses formal requirements levels. It was also 12829 clarified that the interleaved channels are symmetric and that 12830 it is the server that sets the channel numbers. 12832 * It has been clarified that the client can't request of the 12833 server to use a certain RTP SSRC, using a request with the 12834 transport parameter SSRC. 12836 * Syntax definition for SSRC has been clarified to require 8HEX. 12837 It has also been extended to allow multiple values for clients 12838 supporting this version. 12840 * Clarified the text on the transport headers "dest_addr" 12841 parameters regarding what security precautions the server is 12842 required to perform. 12844 o The Range formats has been changed in the following way: 12846 * The NPT format has been given an initial NPT identifier that 12847 must now be used. 12849 * All formats now support initial open ended formats of type 12850 "npt=-10" and also format only "Range: smpte" ranges for usage 12851 with GET_PARAMETER requests. 12853 o RTSP message handling has been changed in the following way: 12855 * RTSP messages now use URIs rather then URLs. 12857 * It has been clarified that a 4xx message due to missing CSeq 12858 header shall be returned without a CSeq header. 12860 * The 300 (Multiple Choices) response code has been removed. 12862 * Rules for how to handle timing out RTSP messages has been 12863 added. 12865 * Extended Pipelining rules allowing for quick session startup. 12867 o The HTTP references have been updated to RFC 2616 and RFC 2617. 12868 Most of the text has been copied and then altered to fit RTSP into 12869 this specification. Public, and the Content-Base header has also 12870 been imported from RFC 2068 so that they are defined in the RTSP 12871 specification. Known effects on RTSP due to HTTP clarifications: 12873 * Content-Encoding header can include encoding of type 12874 "identity". 12876 o The state machine section has been completely rewritten. It now 12877 includes more details and is also more clear about the model used. 12879 o An IANA section has been included which contains a number of 12880 registries and their rules. This will allow us to use IANA to 12881 keep track of RTSP extensions. 12883 o The transport of RTSP messages has seen the following changes: 12885 * The use of UDP for RTSP message transport has been deprecated 12886 due to missing interest and to broken specification. 12888 * The rules for how TCP connections are to be handled has been 12889 clarified. Now it is made clear that servers should not close 12890 the TCP connection unless they have been unused for significant 12891 time. 12893 * Strong recommendations why server and clients should use 12894 persistent connections have also been added. 12896 * There is now a requirement on the servers to handle non- 12897 persistent connections as this provides fault tolerance. 12899 * Added wording on the usage of Connection:Close for RTSP. 12901 * Specified usage of TLS for RTSP messages, including a scheme to 12902 approve a proxy's TLS connection to the next hop. 12904 o The following header related changes have been made: 12906 * Accept-Ranges response header is added. This header clarifies 12907 which range formats that can be used for a resource. 12909 * Fixed the missing definitions for the Cache-Control header. 12910 Also added to the syntax definition the missing delta-seconds 12911 for max-stale and min-fresh parameters. 12913 * Put requirement on CSeq header that the value is increased by 12914 one for each new RTSP request. A Recommendation to start at 0 12915 has also been added. 12917 * Added requirement that the Date header must be used for all 12918 messages with message body and the Server should always include 12919 it. 12921 * Removed possibility of using Range header with Scale header to 12922 indicate when it is to be activated, since it can't work as 12923 defined. Also added rule that lack of Scale header in response 12924 indicates lack of support for the header. Feature-tags for 12925 scaled playback has been defined. 12927 * The Speed header must now be responded to indicate support and 12928 the actual speed going to be used. A feature-tag is defined. 12929 Notes on congestion control were also added. 12931 * The Supported header was borrowed from SIP [RFC3261] to help 12932 with the feature negotiation in RTSP. 12934 * Clarified that the Timestamp header can be used to resolve 12935 retransmission ambiguities. 12937 * The Session header text has been expanded with an explanation 12938 on keep alive and which methods to use. SET_PARAMETER is now 12939 recommended to use if only keep-alive within RTSP is desired. 12941 * It has been clarified how the Range header formats are used to 12942 indicate pause points in the PAUSE response. 12944 * Clarified that RTP-Info URIs that are relative, use the 12945 Request-URI as base URI. Also clarified that the used URI must 12946 be the one that was used in the SETUP request. The URIs are 12947 now also required to be quoted. The header also expresses the 12948 SSRC for the provided RTP timestamp and sequence number values. 12950 * Added text that requires the Range to always be present in PLAY 12951 responses. Clarified what should be sent in case of live 12952 streams. 12954 * The headers table has been updated using a structure borrowed 12955 from SIP. Those tables convey much more information and should 12956 provide a good overview of the available headers. 12958 * It has been clarified that any message with a message body is 12959 required to have a Content-Length header. This was the case in 12960 RFC 2326, but could be misinterpreted. 12962 * ETag has changed name to MTag. 12964 * To resolve functionality around MTag. The MTag and If-None- 12965 Match header have been added from HTTP with necessary 12966 clarification in regards to RTSP operation. 12968 * Imported the Public header from HTTP RFC 2068 [RFC2068] since 12969 it has been removed from HTTP due to lack of use. Public is 12970 used quite frequently in RTSP. 12972 * Clarified rules for populating the Public header so that it is 12973 an intersection of the capabilities of all the RTSP agents in a 12974 chain. 12976 * Added the Media-Range header for listing the current 12977 availability of the media range. 12979 * Added the Notify-Reason header for giving the reason when 12980 sending PLAY_NOTIFY requests. 12982 * A new header Seek-Style has been defined to direct and inform 12983 how any seek operation should/have been performed. 12985 o The Protocol Syntax has been changed in the following way: 12987 * All ABNF definitions are updated according to the rules defined 12988 in RFC 5234 [RFC5234] and have been gathered in a separate 12989 Section 20. 12991 * The ABNF for the User-Agent and Server headers have been 12992 corrected. 12994 * Some definitions in the introduction regarding the RTSP session 12995 have been changed. 12997 * The protocol has been made fully IPv6 capable. 12999 * The CHAR rule has been changed to exclude NULL. 13001 o The Status codes have been changed in the following way: 13003 * The use of status code 303 "See Other" has been deprecated as 13004 it does not make sense to use in RTSP. 13006 * When sending response 451 and 458 the response body should 13007 contain the offending parameters. 13009 * Clarification on when a 3rr redirect status code can be 13010 received has been added. This includes receiving 3rr as a 13011 result of a request within a established session. This 13012 provides clarification to a previous unspecified behavior. 13014 * Removed the 201 (Created) and 250 (Low On Storage Space) status 13015 codes as they are only relevant to recording, which is 13016 deprecated. 13018 * Several new Status codes have been defined: 464 "Data Transport 13019 Not Ready Yet", 465 "Notification Reason Unknown", 470 13020 "Connection Authorization Required", 471 "Connection 13021 Credentials not accepted", 472 "Failure to establish secure 13022 connection". 13024 o The following functionality has been deprecated from the protocol: 13026 * The use of Queued Play. 13028 * The use of PLAY method for keep-alive in Play state. 13030 * The RECORD and ANNOUNCE methods and all related functionality. 13031 Some of the syntax has been removed. 13033 * The possibility to use timed execution of methods with the time 13034 parameter in the Range header. 13036 * The description on how rtspu works is not part of the core 13037 specification and will require external description. Only that 13038 it exists is defined here and some requirements for the 13039 transport is provided. 13041 o The following changes have been made in relation to methods: 13043 * The OPTIONS method has been clarified with regards to the use 13044 of the Public and Allow headers. 13046 * Added text clarifying the usage of SET_PARAMETER for keep-alive 13047 and usage without any body. 13049 * PLAY method is now allowed to be pipelined with the pipelining 13050 of one or more SETUP requests following the initial that 13051 generates the session for aggregated control. 13053 * REDIRECT has been expanded and diversified for different 13054 situations. 13056 * Added a new method PLAY_NOTIFY. This method is used by the 13057 RTSP server to asynchronously notify clients about session 13058 changes. 13060 o Wrote a new section about how to setup different media transport 13061 alternatives and their profiles, and lower layer protocols. This 13062 caused the appendix on RTP interaction to be moved there instead 13063 of being in the part which describes RTP. The section also 13064 includes guidelines what to consider when writing usage guidelines 13065 for new protocols and profiles. 13067 o Setup and usage of independent TCP connections for transport of 13068 RTP has been specified. 13070 o Added a new section describing the available mechanisms to 13071 determine if functionality is supported, called "Capability 13072 Handling". Renamed option-tags to feature-tags. 13074 o Added a contributors section with people who have contributed 13075 actual text to the specification. 13077 o Added a section Use Cases that describes the major use cases for 13078 RTSP. 13080 o Clarified the usage of a=range and how to indicate live content 13081 that are not seekable with this header. 13083 o Text specifying the special behavior of PLAY for live content. 13085 Appendix J. Acknowledgements 13087 This memorandum defines RTSP version 2.0 which is a revision of the 13088 Proposed Standard RTSP version 1.0 which is defined in [RFC2326]. 13089 The authors of RFC 2326 are Henning Schulzrinne, Anup Rao, and Robert 13090 Lanphier. 13092 Both RTSP version 1.0 and RTSP version 2.0 borrow format and 13093 descriptions from HTTP/1.1. 13095 This document has benefited greatly from the comments of all those 13096 participating in the MMUSIC-WG. In addition to those already 13097 mentioned, the following individuals have contributed to this 13098 specification: 13100 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 13101 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 13102 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 13103 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 13104 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Ingemar Johansson, 13105 Anders Klemets, Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo 13106 F. Llach, Thomas Marshall, Rob McCool, David Oran, Joerg Ott, Maria 13107 Papadopouli, Sujal Patel, Ema Patki, Alagu Periyannan, Colin Perkins, 13108 Igor Plotnikov, Jonathan Sergent, Pinaki Shah, David Singer, Lior 13109 Sion, Jeff Smith, Alexander Sokolsky, Dale Stammen, John Francis 13110 Stracke, Maureen Chesire, David Walker, Geetha Srikantan, Stephan 13111 Wenger, Pekka Pessi, Jae-Hwan Kim, Holger Schmidt, Stephen Farrell, 13112 Xavier Marjou, Joe Pallas, Martti Mela, Byungjo Yoon and Patrick 13113 Hoffman, Jinhang Choi, Ross Finlayson, and especially to Flemming 13114 Andreasen. 13116 J.1. Contributors 13118 The following people have made written contributions that were 13119 included in the specification: 13121 o Tom Marshall contributed text on the usage of 3rr status codes. 13123 o Thomas Zheng contributed text on the usage of the Range in PLAY 13124 responses and proposed an earlier version of the PLAY_NOTIFY 13125 method. 13127 o Sean Sheedy contributed text on the timeout behavior of RTSP 13128 messages and connections, the 463 status code, and proposed an 13129 earlier version of the PLAY_NOTIFY method. 13131 o Greg Sherwood proposed an earlier version of the PLAY_NOTIFY 13132 method. 13134 o Fredrik Lindholm contributed text about the RTSP security 13135 framework. 13137 o John Lazzaro contributed the text for RTP over Independent TCP. 13139 o Aravind Narasimhan contributed by rewriting Media Transport 13140 Alternatives (Appendix C) and editorial improvements on a number 13141 of places in the specification. 13143 o Torbjorn Einarsson has done some editorial improvements of the 13144 text. 13146 Appendix K. RFC Editor Consideration 13148 Please replace RFC XXXX with the RFC number this specification 13149 receives. 13151 Authors' Addresses 13153 Henning Schulzrinne 13154 Columbia University 13155 1214 Amsterdam Avenue 13156 New York, NY 10027 13157 USA 13159 Email: schulzrinne@cs.columbia.edu 13161 Anup Rao 13162 Cisco 13163 USA 13165 Email: anrao@cisco.com 13167 Rob Lanphier 13168 Seattle, WA 13169 USA 13171 Email: robla@robla.net 13173 Magnus Westerlund 13174 Ericsson AB 13175 Faeroegatan 6 13176 STOCKHOLM, SE-164 80 13177 SWEDEN 13179 Email: magnus.westerlund@ericsson.com 13181 Martin Stiemerling 13182 NEC Laboratories Europe, NEC Europe Ltd. 13183 Kurfuersten-Anlage 36 13184 Heidelberg 69115 13185 Germany 13187 Phone: +49 (0) 6221 4342 113 13188 Email: martin.stiemerling@neclab.eu 13189 URI: http://ietf.stiemerling.org