idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-28.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 (October 28, 2011) is 4564 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 4188, but not defined == Missing Reference: 'H15' is mentioned on line 8817, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 9262, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. '3gpp-26234' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-pub-180-2' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 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) == Outdated reference: A later version (-22) exists of draft-ietf-mmusic-rtsp-nat-11 -- Obsolete informational reference (is this intentional?): RFC 1644 (Obsoleted by RFC 6247) -- Obsolete informational reference (is this intentional?): RFC 2068 (Obsoleted by RFC 2616) -- Obsolete informational reference (is this intentional?): RFC 2326 (Obsoleted by RFC 7826) -- Obsolete informational reference (is this intentional?): RFC 2822 (Obsoleted by RFC 5322) Summary: 10 errors (**), 0 flaws (~~), 6 warnings (==), 11 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: April 30, 2012 R. Lanphier 8 M. Westerlund 9 Ericsson AB 10 M. Stiemerling (Ed.) 11 NEC 12 October 28, 2011 14 Real Time Streaming Protocol 2.0 (RTSP) 15 draft-ietf-mmusic-rfc2326bis-28 17 Abstract 19 This memorandum defines RTSP version 2.0 which obsoletes RTSP version 20 1.0 which is defined in RFC 2326. 22 The Real Time Streaming Protocol, or RTSP, is an application-level 23 protocol for setup and control of the delivery of data with real-time 24 properties. RTSP provides an extensible framework to enable 25 controlled, on-demand delivery of real-time data, such as audio and 26 video. Sources of data can include both live data feeds and stored 27 clips. This protocol is intended to control multiple data delivery 28 sessions, provide a means for choosing delivery channels such as UDP, 29 multicast UDP and TCP, and provide a means for choosing delivery 30 mechanisms based upon RTP (RFC 3550). 32 Status of this Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at http://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on April 30, 2012. 49 Copyright Notice 51 Copyright (c) 2011 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (http://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 This document may contain material from IETF Documents or IETF 65 Contributions published or made publicly available before November 66 10, 2008. The person(s) controlling the copyright in some of this 67 material may not have granted the IETF Trust the right to allow 68 modifications of such material outside the IETF Standards Process. 69 Without obtaining an adequate license from the person(s) controlling 70 the copyright in such materials, this document may not be modified 71 outside the IETF Standards Process, and derivative works of it may 72 not be created outside the IETF Standards Process, except to format 73 it for publication as an RFC or to translate it into languages other 74 than English. 76 Table of Contents 78 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 11 79 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 13 80 2.1. Presentation Description . . . . . . . . . . . . . . . . 13 81 2.2. Session Establishment . . . . . . . . . . . . . . . . . 14 82 2.3. Media Delivery Control . . . . . . . . . . . . . . . . . 15 83 2.4. Session Parameter Manipulations . . . . . . . . . . . . 17 84 2.5. Media Delivery . . . . . . . . . . . . . . . . . . . . . 17 85 2.5.1. Media Delivery Manipulations . . . . . . . . . . . . 18 86 2.6. Session Maintenance and Termination . . . . . . . . . . 20 87 2.7. Extending RTSP . . . . . . . . . . . . . . . . . . . . . 21 88 3. Document Conventions . . . . . . . . . . . . . . . . . . . . 23 89 3.1. Notational Conventions . . . . . . . . . . . . . . . . . 23 90 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . 23 91 4. Protocol Parameters . . . . . . . . . . . . . . . . . . . . . 27 92 4.1. RTSP Version . . . . . . . . . . . . . . . . . . . . . . 27 93 4.2. RTSP IRI and URI . . . . . . . . . . . . . . . . . . . . 27 94 4.3. Session Identifiers . . . . . . . . . . . . . . . . . . 29 95 4.4. SMPTE Relative Timestamps . . . . . . . . . . . . . . . 29 96 4.5. Normal Play Time . . . . . . . . . . . . . . . . . . . . 30 97 4.6. Absolute Time . . . . . . . . . . . . . . . . . . . . . 31 98 4.7. Feature-Tags . . . . . . . . . . . . . . . . . . . . . . 31 99 4.8. Message Body Tags . . . . . . . . . . . . . . . . . . . 31 100 4.9. Media Properties . . . . . . . . . . . . . . . . . . . . 32 101 4.9.1. Random Access and Seeking . . . . . . . . . . . . . 33 102 4.9.2. Retention . . . . . . . . . . . . . . . . . . . . . 33 103 4.9.3. Content Modifications . . . . . . . . . . . . . . . 34 104 4.9.4. Supported Scale Factors . . . . . . . . . . . . . . 34 105 4.9.5. Mapping to the Attributes . . . . . . . . . . . . . 34 106 5. RTSP Message . . . . . . . . . . . . . . . . . . . . . . . . 35 107 5.1. Message Types . . . . . . . . . . . . . . . . . . . . . 35 108 5.2. Message Headers . . . . . . . . . . . . . . . . . . . . 35 109 5.3. Message Body . . . . . . . . . . . . . . . . . . . . . . 36 110 5.4. Message Length . . . . . . . . . . . . . . . . . . . . . 36 111 6. General Header Fields . . . . . . . . . . . . . . . . . . . . 38 112 7. Request . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 113 7.1. Request Line . . . . . . . . . . . . . . . . . . . . . . 39 114 7.2. Request Header Fields . . . . . . . . . . . . . . . . . 41 115 8. Response . . . . . . . . . . . . . . . . . . . . . . . . . . 43 116 8.1. Status-Line . . . . . . . . . . . . . . . . . . . . . . 43 117 8.1.1. Status Code and Reason Phrase . . . . . . . . . . . 43 118 8.2. Response Headers . . . . . . . . . . . . . . . . . . . . 46 119 9. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 48 120 9.1. Message-Body Header Fields . . . . . . . . . . . . . . . 48 121 9.2. Message Body . . . . . . . . . . . . . . . . . . . . . . 49 122 10. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 50 123 10.1. Reliability and Acknowledgements . . . . . . . . . . . . 50 124 10.2. Using Connections . . . . . . . . . . . . . . . . . . . 51 125 10.3. Closing Connections . . . . . . . . . . . . . . . . . . 53 126 10.4. Timing Out Connections and RTSP Messages . . . . . . . . 54 127 10.5. Showing Liveness . . . . . . . . . . . . . . . . . . . . 55 128 10.6. Use of IPv6 . . . . . . . . . . . . . . . . . . . . . . 56 129 10.7. Overload Control . . . . . . . . . . . . . . . . . . . . 56 130 11. Capability Handling . . . . . . . . . . . . . . . . . . . . . 58 131 12. Pipelining Support . . . . . . . . . . . . . . . . . . . . . 60 132 13. Method Definitions . . . . . . . . . . . . . . . . . . . . . 61 133 13.1. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . 62 134 13.2. DESCRIBE . . . . . . . . . . . . . . . . . . . . . . . . 63 135 13.3. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . 65 136 13.3.1. Changing Transport Parameters . . . . . . . . . . . 68 137 13.4. PLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 69 138 13.4.1. General Usage . . . . . . . . . . . . . . . . . . . 69 139 13.4.2. Aggregated Sessions . . . . . . . . . . . . . . . . 74 140 13.4.3. Updating current PLAY Requests . . . . . . . . . . . 75 141 13.4.4. Playing On-Demand Media . . . . . . . . . . . . . . 77 142 13.4.5. Playing Dynamic On-Demand Media . . . . . . . . . . 78 143 13.4.6. Playing Live Media . . . . . . . . . . . . . . . . . 78 144 13.4.7. Playing Live with Recording . . . . . . . . . . . . 79 145 13.4.8. Playing Live with Time-Shift . . . . . . . . . . . . 79 146 13.5. PLAY_NOTIFY . . . . . . . . . . . . . . . . . . . . . . 80 147 13.5.1. End-of-Stream . . . . . . . . . . . . . . . . . . . 81 148 13.5.2. Media-Properties-Update . . . . . . . . . . . . . . 82 149 13.5.3. Scale-Change . . . . . . . . . . . . . . . . . . . . 83 150 13.6. PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 84 151 13.7. TEARDOWN . . . . . . . . . . . . . . . . . . . . . . . . 87 152 13.7.1. Client to Server . . . . . . . . . . . . . . . . . . 87 153 13.7.2. Server to Client . . . . . . . . . . . . . . . . . . 88 154 13.8. GET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 89 155 13.9. SET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 91 156 13.10. REDIRECT . . . . . . . . . . . . . . . . . . . . . . . . 92 157 14. Embedded (Interleaved) Binary Data . . . . . . . . . . . . . 95 158 15. Status Code Definitions . . . . . . . . . . . . . . . . . . . 97 159 15.1. Success 1xx . . . . . . . . . . . . . . . . . . . . . . 97 160 15.1.1. 100 Continue . . . . . . . . . . . . . . . . . . . . 97 161 15.2. Success 2xx . . . . . . . . . . . . . . . . . . . . . . 97 162 15.2.1. 200 OK . . . . . . . . . . . . . . . . . . . . . . . 97 163 15.3. Redirection 3xx . . . . . . . . . . . . . . . . . . . . 97 164 15.3.1. 301 Moved Permanently . . . . . . . . . . . . . . . 98 165 15.3.2. 302 Found . . . . . . . . . . . . . . . . . . . . . 98 166 15.3.3. 303 See Other . . . . . . . . . . . . . . . . . . . 98 167 15.3.4. 304 Not Modified . . . . . . . . . . . . . . . . . . 98 168 15.3.5. 305 Use Proxy . . . . . . . . . . . . . . . . . . . 99 169 15.4. Client Error 4xx . . . . . . . . . . . . . . . . . . . . 99 170 15.4.1. 400 Bad Request . . . . . . . . . . . . . . . . . . 99 171 15.4.2. 401 Unauthorized . . . . . . . . . . . . . . . . . . 99 172 15.4.3. 402 Payment Required . . . . . . . . . . . . . . . . 100 173 15.4.4. 403 Forbidden . . . . . . . . . . . . . . . . . . . 100 174 15.4.5. 404 Not Found . . . . . . . . . . . . . . . . . . . 100 175 15.4.6. 405 Method Not Allowed . . . . . . . . . . . . . . . 100 176 15.4.7. 406 Not Acceptable . . . . . . . . . . . . . . . . . 100 177 15.4.8. 407 Proxy Authentication Required . . . . . . . . . 101 178 15.4.9. 408 Request Timeout . . . . . . . . . . . . . . . . 101 179 15.4.10. 410 Gone . . . . . . . . . . . . . . . . . . . . . . 101 180 15.4.11. 411 Length Required . . . . . . . . . . . . . . . . 101 181 15.4.12. 412 Precondition Failed . . . . . . . . . . . . . . 102 182 15.4.13. 413 Request Message Body Too Large . . . . . . . . . 102 183 15.4.14. 414 Request-URI Too Long . . . . . . . . . . . . . . 102 184 15.4.15. 415 Unsupported Media Type . . . . . . . . . . . . . 102 185 15.4.16. 451 Parameter Not Understood . . . . . . . . . . . . 102 186 15.4.17. 452 reserved . . . . . . . . . . . . . . . . . . . . 102 187 15.4.18. 453 Not Enough Bandwidth . . . . . . . . . . . . . . 103 188 15.4.19. 454 Session Not Found . . . . . . . . . . . . . . . 103 189 15.4.20. 455 Method Not Valid in This State . . . . . . . . . 103 190 15.4.21. 456 Header Field Not Valid for Resource . . . . . . 103 191 15.4.22. 457 Invalid Range . . . . . . . . . . . . . . . . . 103 192 15.4.23. 458 Parameter Is Read-Only . . . . . . . . . . . . . 103 193 15.4.24. 459 Aggregate Operation Not Allowed . . . . . . . . 103 194 15.4.25. 460 Only Aggregate Operation Allowed . . . . . . . . 103 195 15.4.26. 461 Unsupported Transport . . . . . . . . . . . . . 104 196 15.4.27. 462 Destination Unreachable . . . . . . . . . . . . 104 197 15.4.28. 463 Destination Prohibited . . . . . . . . . . . . . 104 198 15.4.29. 464 Data Transport Not Ready Yet . . . . . . . . . . 104 199 15.4.30. 465 Notification Reason Unknown . . . . . . . . . . 104 200 15.4.31. 466 Key Management Error . . . . . . . . . . . . . . 104 201 15.4.32. 470 Connection Authorization Required . . . . . . . 105 202 15.4.33. 471 Connection Credentials not accepted . . . . . . 105 203 15.4.34. 472 Failure to establish secure connection . . . . . 105 204 15.5. Server Error 5xx . . . . . . . . . . . . . . . . . . . . 105 205 15.5.1. 500 Internal Server Error . . . . . . . . . . . . . 105 206 15.5.2. 501 Not Implemented . . . . . . . . . . . . . . . . 105 207 15.5.3. 502 Bad Gateway . . . . . . . . . . . . . . . . . . 105 208 15.5.4. 503 Service Unavailable . . . . . . . . . . . . . . 106 209 15.5.5. 504 Gateway Timeout . . . . . . . . . . . . . . . . 106 210 15.5.6. 505 RTSP Version Not Supported . . . . . . . . . . . 106 211 15.5.7. 551 Option not supported . . . . . . . . . . . . . . 106 212 16. Header Field Definitions . . . . . . . . . . . . . . . . . . 107 213 16.1. Accept . . . . . . . . . . . . . . . . . . . . . . . . . 117 214 16.2. Accept-Credentials . . . . . . . . . . . . . . . . . . . 117 215 16.3. Accept-Encoding . . . . . . . . . . . . . . . . . . . . 118 216 16.4. Accept-Language . . . . . . . . . . . . . . . . . . . . 119 217 16.5. Accept-Ranges . . . . . . . . . . . . . . . . . . . . . 120 218 16.6. Allow . . . . . . . . . . . . . . . . . . . . . . . . . 120 219 16.7. Authorization . . . . . . . . . . . . . . . . . . . . . 120 220 16.8. Bandwidth . . . . . . . . . . . . . . . . . . . . . . . 121 221 16.9. Blocksize . . . . . . . . . . . . . . . . . . . . . . . 122 222 16.10. Cache-Control . . . . . . . . . . . . . . . . . . . . . 122 223 16.11. Connection . . . . . . . . . . . . . . . . . . . . . . . 125 224 16.12. Connection-Credentials . . . . . . . . . . . . . . . . . 125 225 16.13. Content-Base . . . . . . . . . . . . . . . . . . . . . . 126 226 16.14. Content-Encoding . . . . . . . . . . . . . . . . . . . . 126 227 16.15. Content-Language . . . . . . . . . . . . . . . . . . . . 127 228 16.16. Content-Length . . . . . . . . . . . . . . . . . . . . . 128 229 16.17. Content-Location . . . . . . . . . . . . . . . . . . . . 128 230 16.18. Content-Type . . . . . . . . . . . . . . . . . . . . . . 129 231 16.19. CSeq . . . . . . . . . . . . . . . . . . . . . . . . . . 129 232 16.20. Date . . . . . . . . . . . . . . . . . . . . . . . . . . 130 233 16.21. Expires . . . . . . . . . . . . . . . . . . . . . . . . 131 234 16.22. From . . . . . . . . . . . . . . . . . . . . . . . . . . 131 235 16.23. If-Match . . . . . . . . . . . . . . . . . . . . . . . . 132 236 16.24. If-Modified-Since . . . . . . . . . . . . . . . . . . . 132 237 16.25. If-None-Match . . . . . . . . . . . . . . . . . . . . . 133 238 16.26. Last-Modified . . . . . . . . . . . . . . . . . . . . . 134 239 16.27. Location . . . . . . . . . . . . . . . . . . . . . . . . 134 240 16.28. Media-Properties . . . . . . . . . . . . . . . . . . . . 134 241 16.29. Media-Range . . . . . . . . . . . . . . . . . . . . . . 136 242 16.30. MTag . . . . . . . . . . . . . . . . . . . . . . . . . . 137 243 16.31. Notify-Reason . . . . . . . . . . . . . . . . . . . . . 137 244 16.32. Pipelined-Requests . . . . . . . . . . . . . . . . . . . 137 245 16.33. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . 139 246 16.34. Proxy-Authorization . . . . . . . . . . . . . . . . . . 139 247 16.35. Proxy-Require . . . . . . . . . . . . . . . . . . . . . 139 248 16.36. Proxy-Supported . . . . . . . . . . . . . . . . . . . . 140 249 16.37. Public . . . . . . . . . . . . . . . . . . . . . . . . . 141 250 16.38. Range . . . . . . . . . . . . . . . . . . . . . . . . . 141 251 16.39. Referrer . . . . . . . . . . . . . . . . . . . . . . . . 143 252 16.40. Request-Status . . . . . . . . . . . . . . . . . . . . . 144 253 16.41. Require . . . . . . . . . . . . . . . . . . . . . . . . 144 254 16.42. Retry-After . . . . . . . . . . . . . . . . . . . . . . 145 255 16.43. RTP-Info . . . . . . . . . . . . . . . . . . . . . . . . 145 256 16.44. Scale . . . . . . . . . . . . . . . . . . . . . . . . . 148 257 16.45. Seek-Style . . . . . . . . . . . . . . . . . . . . . . . 149 258 16.46. Server . . . . . . . . . . . . . . . . . . . . . . . . . 150 259 16.47. Session . . . . . . . . . . . . . . . . . . . . . . . . 151 260 16.48. Speed . . . . . . . . . . . . . . . . . . . . . . . . . 152 261 16.49. Supported . . . . . . . . . . . . . . . . . . . . . . . 153 262 16.50. Terminate-Reason . . . . . . . . . . . . . . . . . . . . 153 263 16.51. Timestamp . . . . . . . . . . . . . . . . . . . . . . . 154 264 16.52. Transport . . . . . . . . . . . . . . . . . . . . . . . 154 265 16.53. Unsupported . . . . . . . . . . . . . . . . . . . . . . 161 266 16.54. User-Agent . . . . . . . . . . . . . . . . . . . . . . . 161 267 16.55. Vary . . . . . . . . . . . . . . . . . . . . . . . . . . 162 268 16.56. Via . . . . . . . . . . . . . . . . . . . . . . . . . . 162 269 16.57. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . 163 270 17. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 271 17.1. Proxies and Protocol Extensions . . . . . . . . . . . . 165 272 17.2. Multiplexing and Demultiplexing of Messages . . . . . . 166 273 18. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 274 18.1. Validation Model . . . . . . . . . . . . . . . . . . . . 167 275 18.1.1. Last-Modified Dates . . . . . . . . . . . . . . . . 169 276 18.1.2. Message Body Tag Cache Validators . . . . . . . . . 169 277 18.1.3. Weak and Strong Validators . . . . . . . . . . . . . 169 278 18.1.4. Rules for When to Use Message Body Tags and 279 Last-Modified Dates . . . . . . . . . . . . . . . . 171 280 18.1.5. Non-validating Conditionals . . . . . . . . . . . . 173 281 18.2. Invalidation After Updates or Deletions . . . . . . . . 173 282 19. Security Framework . . . . . . . . . . . . . . . . . . . . . 175 283 19.1. RTSP and HTTP Authentication . . . . . . . . . . . . . . 175 284 19.2. RTSP over TLS . . . . . . . . . . . . . . . . . . . . . 175 285 19.3. Security and Proxies . . . . . . . . . . . . . . . . . . 176 286 19.3.1. Accept-Credentials . . . . . . . . . . . . . . . . . 177 287 19.3.2. User approved TLS procedure . . . . . . . . . . . . 178 288 20. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 289 20.1. Base Syntax . . . . . . . . . . . . . . . . . . . . . . 181 290 20.2. RTSP Protocol Definition . . . . . . . . . . . . . . . . 183 291 20.2.1. Generic Protocol elements . . . . . . . . . . . . . 183 292 20.2.2. Message Syntax . . . . . . . . . . . . . . . . . . . 186 293 20.2.3. Header Syntax . . . . . . . . . . . . . . . . . . . 190 294 20.3. SDP extension Syntax . . . . . . . . . . . . . . . . . . 199 295 21. Security Considerations . . . . . . . . . . . . . . . . . . . 200 296 21.1. Remote denial of Service Attack . . . . . . . . . . . . 202 297 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 204 298 22.1. Feature-tags . . . . . . . . . . . . . . . . . . . . . . 204 299 22.1.1. Description . . . . . . . . . . . . . . . . . . . . 205 300 22.1.2. Registering New Feature-tags with IANA . . . . . . . 205 301 22.1.3. Registered entries . . . . . . . . . . . . . . . . . 205 302 22.2. RTSP Methods . . . . . . . . . . . . . . . . . . . . . . 206 303 22.2.1. Description . . . . . . . . . . . . . . . . . . . . 206 304 22.2.2. Registering New Methods with IANA . . . . . . . . . 206 305 22.2.3. Registered Entries . . . . . . . . . . . . . . . . . 206 306 22.3. RTSP Status Codes . . . . . . . . . . . . . . . . . . . 207 307 22.3.1. Description . . . . . . . . . . . . . . . . . . . . 207 308 22.3.2. Registering New Status Codes with IANA . . . . . . . 207 309 22.3.3. Registered Entries . . . . . . . . . . . . . . . . . 207 310 22.4. RTSP Headers . . . . . . . . . . . . . . . . . . . . . . 207 311 22.4.1. Description . . . . . . . . . . . . . . . . . . . . 207 312 22.4.2. Registering New Headers with IANA . . . . . . . . . 208 313 22.4.3. Registered entries . . . . . . . . . . . . . . . . . 208 314 22.5. Accept-Credentials . . . . . . . . . . . . . . . . . . . 209 315 22.5.1. Accept-Credentials policies . . . . . . . . . . . . 209 316 22.5.2. Accept-Credentials hash algorithms . . . . . . . . . 209 317 22.6. Cache-Control Cache Directive Extensions . . . . . . . . 210 318 22.7. Media Properties . . . . . . . . . . . . . . . . . . . . 211 319 22.7.1. Description . . . . . . . . . . . . . . . . . . . . 211 320 22.7.2. Registration Rules . . . . . . . . . . . . . . . . . 211 321 22.7.3. Registered Values . . . . . . . . . . . . . . . . . 211 322 22.8. Notify-Reason header . . . . . . . . . . . . . . . . . . 211 323 22.8.1. Description . . . . . . . . . . . . . . . . . . . . 211 324 22.8.2. Registration Rules . . . . . . . . . . . . . . . . . 212 325 22.8.3. Registered Values . . . . . . . . . . . . . . . . . 212 326 22.9. Range header formats . . . . . . . . . . . . . . . . . . 212 327 22.9.1. Description . . . . . . . . . . . . . . . . . . . . 212 328 22.9.2. Registration Rules . . . . . . . . . . . . . . . . . 212 329 22.9.3. Registered Values . . . . . . . . . . . . . . . . . 213 330 22.10. Terminate-Reason Header . . . . . . . . . . . . . . . . 213 331 22.10.1. Redirect Reasons . . . . . . . . . . . . . . . . . . 213 332 22.10.2. Terminate-Reason Header Parameters . . . . . . . . . 213 333 22.11. RTP-Info header parameters . . . . . . . . . . . . . . . 214 334 22.11.1. Description . . . . . . . . . . . . . . . . . . . . 214 335 22.11.2. Registration Rules . . . . . . . . . . . . . . . . . 214 336 22.11.3. Registered Values . . . . . . . . . . . . . . . . . 214 337 22.12. Seek-Style Policies . . . . . . . . . . . . . . . . . . 215 338 22.12.1. Description . . . . . . . . . . . . . . . . . . . . 215 339 22.12.2. Registration Rules . . . . . . . . . . . . . . . . . 215 340 22.12.3. Registered Values . . . . . . . . . . . . . . . . . 215 341 22.13. Transport Header Registries . . . . . . . . . . . . . . 215 342 22.13.1. Transport Protocol Specification . . . . . . . . . . 216 343 22.13.2. Transport modes . . . . . . . . . . . . . . . . . . 217 344 22.13.3. Transport Parameters . . . . . . . . . . . . . . . . 217 345 22.14. URI Schemes . . . . . . . . . . . . . . . . . . . . . . 218 346 22.14.1. The rtsp URI Scheme . . . . . . . . . . . . . . . . 218 347 22.14.2. The rtsps URI Scheme . . . . . . . . . . . . . . . . 219 348 22.14.3. The rtspu URI Scheme . . . . . . . . . . . . . . . . 220 349 22.15. SDP attributes . . . . . . . . . . . . . . . . . . . . . 221 350 22.16. Media Type Registration for text/parameters . . . . . . 222 351 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 224 352 23.1. Normative References . . . . . . . . . . . . . . . . . . 224 353 23.2. Informative References . . . . . . . . . . . . . . . . . 226 354 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 229 355 A.1. Media on Demand (Unicast) . . . . . . . . . . . . . . . 229 356 A.2. Media on Demand using Pipelining . . . . . . . . . . . . 233 357 A.3. Media on Demand (Unicast) . . . . . . . . . . . . . . . 235 358 A.4. Single Stream Container Files . . . . . . . . . . . . . 239 359 A.5. Live Media Presentation Using Multicast . . . . . . . . 241 360 A.6. Capability Negotiation . . . . . . . . . . . . . . . . . 242 361 Appendix B. RTSP Protocol State Machine . . . . . . . . . . . . 244 362 B.1. States . . . . . . . . . . . . . . . . . . . . . . . . . 244 363 B.2. State variables . . . . . . . . . . . . . . . . . . . . 244 364 B.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . 244 365 B.4. State Tables . . . . . . . . . . . . . . . . . . . . . . 245 366 Appendix C. Media Transport Alternatives . . . . . . . . . . . . 251 367 C.1. RTP . . . . . . . . . . . . . . . . . . . . . . . . . . 251 368 C.1.1. AVP . . . . . . . . . . . . . . . . . . . . . . . . 251 369 C.1.2. AVP/UDP . . . . . . . . . . . . . . . . . . . . . . 251 370 C.1.3. AVPF/UDP . . . . . . . . . . . . . . . . . . . . . . 252 371 C.1.4. SAVP/UDP . . . . . . . . . . . . . . . . . . . . . . 253 372 C.1.5. SAVPF/UDP . . . . . . . . . . . . . . . . . . . . . 255 373 C.1.6. RTCP usage with RTSP . . . . . . . . . . . . . . . . 255 374 C.2. RTP over TCP . . . . . . . . . . . . . . . . . . . . . . 257 375 C.2.1. Interleaved RTP over TCP . . . . . . . . . . . . . . 257 376 C.2.2. RTP over independent TCP . . . . . . . . . . . . . . 257 377 C.3. Handling Media Clock Time Jumps in the RTP Media Layer . 261 378 C.4. Handling RTP Timestamps after PAUSE . . . . . . . . . . 265 379 C.5. RTSP / RTP Integration . . . . . . . . . . . . . . . . . 267 380 C.6. Scaling with RTP . . . . . . . . . . . . . . . . . . . . 267 381 C.7. Maintaining NPT synchronization with RTP timestamps . . 267 382 C.8. Continuous Audio . . . . . . . . . . . . . . . . . . . . 267 383 C.9. Multiple Sources in an RTP Session . . . . . . . . . . . 267 384 C.10. Usage of SSRCs and the RTCP BYE Message During an 385 RTSP Session . . . . . . . . . . . . . . . . . . . . . . 267 386 C.11. Future Additions . . . . . . . . . . . . . . . . . . . . 268 387 Appendix D. Use of SDP for RTSP Session Descriptions . . . . . . 269 388 D.1. Definitions . . . . . . . . . . . . . . . . . . . . . . 269 389 D.1.1. Control URI . . . . . . . . . . . . . . . . . . . . 269 390 D.1.2. Media Streams . . . . . . . . . . . . . . . . . . . 270 391 D.1.3. Payload Type(s) . . . . . . . . . . . . . . . . . . 271 392 D.1.4. Format-Specific Parameters . . . . . . . . . . . . . 271 393 D.1.5. Directionality of media stream . . . . . . . . . . . 271 394 D.1.6. Range of Presentation . . . . . . . . . . . . . . . 272 395 D.1.7. Time of Availability . . . . . . . . . . . . . . . . 273 396 D.1.8. Connection Information . . . . . . . . . . . . . . . 273 397 D.1.9. Message Body Tag . . . . . . . . . . . . . . . . . . 273 398 D.2. Aggregate Control Not Available . . . . . . . . . . . . 274 399 D.3. Aggregate Control Available . . . . . . . . . . . . . . 275 400 D.4. Grouping of Media Lines in SDP . . . . . . . . . . . . . 276 401 D.5. RTSP external SDP delivery . . . . . . . . . . . . . . . 276 402 Appendix E. RTSP Use Cases . . . . . . . . . . . . . . . . . . . 277 403 E.1. On-demand Playback of Stored Content . . . . . . . . . . 277 404 E.2. Unicast Distribution of Live Content . . . . . . . . . . 278 405 E.3. On-demand Playback using Multicast . . . . . . . . . . . 279 406 E.4. Inviting an RTSP server into a conference . . . . . . . 279 407 E.5. Live Content using Multicast . . . . . . . . . . . . . . 280 408 Appendix F. Text format for Parameters . . . . . . . . . . . . . 282 409 Appendix G. Requirements for Unreliable Transport of RTSP . . . 283 410 Appendix H. Backwards Compatibility Considerations . . . . . . . 285 411 H.1. Play Request in Play State . . . . . . . . . . . . . . . 285 412 H.2. Using Persistent Connections . . . . . . . . . . . . . . 285 413 Appendix I. Changes . . . . . . . . . . . . . . . . . . . . . . 286 414 I.1. Brief Overview . . . . . . . . . . . . . . . . . . . . . 286 415 I.2. Detailed List of Changes . . . . . . . . . . . . . . . . 287 416 Appendix J. Acknowledgements . . . . . . . . . . . . . . . . . . 294 417 J.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 294 418 Appendix K. RFC Editor Consideration . . . . . . . . . . . . . . 296 419 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 297 421 1. Introduction 423 This memo defines version 2.0 of the Real Time Streaming Protocol 424 (RTSP 2.0). RTSP 2.0 is an application-level protocol for setup and 425 control over the delivery of data with real-time properties, 426 typically streaming media. Streaming media is, for instance, video 427 on demand or audio live streaming. Put simply, RTSP acts as a 428 "network remote control" for multimedia servers, similar to the 429 remote control for a DVD player. 431 The protocol operates between RTSP 2.0 clients and servers, but also 432 supports the usage of proxies placed between clients and servers. 433 Clients can request information about streaming media from servers by 434 asking for a description of the media or use media description 435 provided externally. The media delivery protocol is used to 436 establish the media streams described by the media description. 437 Clients can then request to play out the media, pause it, or stop it 438 completely, as known from DVD players remote control or media 439 players. The requested media can consist of multiple audio and video 440 streams that are delivered as a time-synchronized streams from 441 servers to clients. 443 RTSP 2.0 is a replacement of RTSP 1.0 [RFC2326] and obsoletes that 444 specification. This protocol is based on RTSP 1.0 but is not 445 backwards compatible other than in the basic version negotiation 446 mechanism. The changes are documented in Appendix I. There are many 448 reasons why RTSP 2.0 can't be backwards compatible with RTSP 1.0 but 449 some of the main ones are: 451 o Most headers that needed to be extensible did not define the 452 allowed syntax, preventing safe deployment of extensions; 454 o The changed behavior of the PLAY method when received in Play 455 state; 457 o Changed behavior of the extensibility model and its mechanism; 459 o The change of syntax for some headers. 461 In summary, there are so many small details that changing version 462 became necessary to enable clarification and consistent behavior. 464 This document is structured as follows. It begins with an overview 465 of the protocol operations and its functions in an informal way. 466 Then a set of definitions of used terms and document conventions is 467 introduced. It is followed by the actual RTSP 2.0 core protocol 468 specification. The appendixes describe and define some 469 functionalities that are not part of the core RTSP specification, but 470 which are still important to enable some usages. Among them, the RTP 471 usage is defined in Appendix C and the SDP usage with RTSP is defined 472 in Appendix D, which are two mandatory appendixes. While others 473 include a number of informational parts discussing the changes, use 474 cases, different considerations or motivations. 476 2. Protocol Overview 478 This section provides an informative overview of the different 479 mechanisms in the RTSP 2.0 protocol, to give the reader a high level 480 understanding before getting into all the different details. In case 481 of conflict with this description and the later sections, the later 482 sections take precedence. For more information about considered use 483 cases for RTSP see Appendix E. 485 RTSP 2.0 is a bi-directional request and response protocol that first 486 establishes a context including content resources (the media) and 487 then controls the delivery of these content resources from the 488 provider to the consumer. RTSP has three fundamental parts: Session 489 Establishment, Media Delivery Control, and an extensibility model 490 described below. The protocol is based on some assumptions about 491 existing functionality to provide a complete solution for client 492 controlled real-time media delivery. 494 RTSP uses text-based messages, requests and responses, that may 495 contain a binary message body. An RTSP request starts with a method 496 line that identifies the method, the protocol and version and the 497 resource to act on. Following the method line are a number of RTSP 498 headers. This part is ended by two consecutive carriage return line 499 feed (CRLF) character pairs. The message body if present follows the 500 two CRLF and the body's length is described by a message header. 501 RTSP responses are similar, but start with a response line with the 502 protocol and version, followed by a status code and a reason phrase. 503 RTSP messages are sent over a reliable transport protocol between the 504 client and server. RTSP 2.0 requires clients and servers to 505 implement TCP, and TLS over TCP, as mandatory transports for RTSP 506 messages. 508 2.1. Presentation Description 510 RTSP exists to provide access to multi-media presentations and 511 content, but tries to be agnostic about the media type or the actual 512 media delivery protocol that is used. To enable a client to 513 implement a complete system, an RTSP-external mechanism for 514 describing the presentation and the delivery protocol(s) is used. 515 RTSP assumes that this description is either delivered completely out 516 of bands or as a data object in the response to a client's request 517 using the DESCRIBE method (Section 13.2). 519 Parameters that commonly have to be included in the Presentation 520 Description are the following: 522 o Number of media streams; 523 o The resource identifier for each media stream/resource that is to 524 be controlled by RTSP; 526 o The protocol that each media stream is to be delivered over; 528 o Transport protocol parameters that are not negotiated or vary with 529 each client; 531 o Media encoding information enabling a client to correctly decode 532 the media upon reception; 534 o An aggregate control resource identifier. 536 RTSP uses its own URI schemes ("rtsp" and "rtsps") to reference media 537 resources and aggregates under common control. 539 This specification describes in Appendix D how one uses SDP [RFC4566] 540 for Presentation Description 542 2.2. Session Establishment 544 The RTSP client can request the establishment of an RTSP session 545 after having used the presentation description to determine which 546 media streams are available, and also which media delivery protocol 547 is used and their particular resource identifiers. The RTSP session 548 is a common context between the client and the server that consists 549 of one or more media resources that are to be under common media 550 delivery control. 552 The client creates an RTSP session by sending a request using the 553 SETUP method (Section 13.3) to the server. In the SETUP request the 554 client also includes all the transport parameters necessary to enable 555 the media delivery protocol to function in the "Transport" header 556 (Section 16.52). This includes parameters that are pre-established 557 by the presentation description but necessary for any middlebox to 558 correctly handle the media delivery protocols. The Transport header 559 in a request may contain multiple alternatives for media delivery in 560 a prioritized list, which the server can select from. These 561 alternatives are typically based on information in the presentation 562 description. 564 The server determines if the media resource is available upon 565 receiving a SETUP request and if any of the transport parameter 566 specifications are acceptable. If that is successful, an RTSP 567 session context is created and the relevant parameters and state is 568 stored. An identifier is created for the RTSP session and included 569 in the response in the Session header (Section 16.47). The SETUP 570 response includes a Transport header that specifies which of the 571 alternatives has been selected and relevant parameters. 573 A SETUP request that references an existing RTSP session but 574 identifies a new media resource is a request to add that media 575 resource under common control with the already present media 576 resources in an aggregated session. A client can expect this to work 577 for all media resources under RTSP control within a multi-media 578 content. However, aggregating resources from different content are 579 likely to be refused by the server. The RTSP session as aggregate is 580 referenced by the aggregate control URI, even if the RTSP session 581 only contains a single media. 583 To avoid an extra round trip in the session establishment of 584 aggregated RTSP sessions, RTSP 2.0 supports pipelined requests; i.e., 585 the client can send multiple requests back-to-back without waiting 586 first for the completion of any of them. The client uses client- 587 selected identifier in the Pipelined-Requests header to instruct the 588 server to bind multiple requests together as if they included the 589 session identifier. 591 The SETUP response also provides additional information about the 592 established sessions in a couple of different headers. The Media- 593 Properties header includes a number of properties that apply for the 594 aggregate that is valuable when doing media delivery control and 595 configuring user interface. The Accept-Ranges header informs the 596 client about which range formats that the server supports with these 597 media resources. The Media-Range header inform the client about the 598 time range of the media currently available. 600 2.3. Media Delivery Control 602 After having established an RTSP session, the client can start 603 controlling the media delivery. The basic operations are Start by 604 using the PLAY method (Section 13.4) and Halt by using the PAUSE 605 method (Section 13.6). PLAY also allows for choosing the starting 606 media position from which the server should deliver the media. The 607 positioning is done by using the Range header (Section 16.38) that 608 supports several different time formats: Normal Play Time (NPT) 609 (Section 4.5), SMPTE Timestamps (Section 4.4) and absolute time 610 (Section 4.6). The Range header does further allow the client to 611 specify a position where delivery should end, thus allowing a 612 specific interval to be delivered. 614 The support for positioning/searching within a content depends on the 615 content's media properties. Content exists in a number of different 616 types, such as: on-demand, live, and live with simultaneous 617 recording. Even within these categories there are differences in how 618 the content is generated and distributed, which affect how it can be 619 accessed for playback. The properties applicable for the RTSP 620 session are provided by the server in the SETUP response using the 621 Media-Properties header (Section 16.28). These are expressed using 622 one or several independent attributes. A first attribute is Random 623 Access, which expresses if positioning can be done, and with what 624 granularity. Another aspect is whether the content will change 625 during the lifetime of the session. While on-demand content will 626 provided in full from the beginning, a live stream being recorded 627 results in the length of the accessible content growing as the 628 session goes on. There also exist content that is dynamically built 629 by another protocol than RTSP and thus also changes in steps during 630 the session, but maybe not continuously. Furthermore, when content 631 is recorded, there are cases where not the complete content is 632 maintained, but, for example, only the last hour. All these 633 properties result in the need for mechanisms that will be discussed 634 below. 636 When the client accesses on-demand content that allows random access, 637 the client can issue the PLAY request for any point in the content 638 between the start and the end. The server will deliver media from 639 the closest random access point prior to the requested point and 640 indicate that in its PLAY response. If the client issues a PAUSE, 641 the delivery will be halted and the point at which the server stopped 642 will be reported back in the response. The client can later resume 643 by sending a PLAY request without a range header. When the server is 644 about to complete the PLAY request by delivering the end of the 645 content or the requested range, the server will send a PLAY_NOTIFY 646 request indicating this. 648 When playing live content with no extra functions, such as recording, 649 the client will receive the live media from the server after having 650 sent a PLAY request. Seeking in such content is not possible as the 651 server does not store it, but only forwards it from the source of the 652 session. Thus delivery continues until the client sends a PAUSE 653 request, tears down the session, or the content ends. 655 For live sessions that are being recorded the client will need to 656 keep track of how the recording progresses. Upon session 657 establishment the client will learn the current duration of the 658 recording from the Media-Range header. As the recording is ongoing 659 the content grows in direct relation to the passed time. Therefore, 660 each server's response to a PLAY request will contain the current 661 Media-Range header. The server should also regularly send every 5 662 minutes the current media range in a PLAY_NOTIFY request. If the 663 live transmission ends, the server must send a PLAY_NOTIFY request 664 with the updated Media-Properties indicating that the content stopped 665 being a recorded live session and instead became on-demand content; 666 the request also contains the final media range. While the live 667 delivery continues the client can request to play the current live 668 point by using the NPT timescale symbol "now", or it can request a 669 specific point in the available content by an explicit range request 670 for that point. If the requested point is outside of the available 671 interval the server will adjust the position to the closest available 672 point, i.e., either at the beginning or the end. 674 A special case of recording is that where the recording is not 675 retained longer than a specific time period, thus as the live 676 delivery continues the client can access any media within a moving 677 window that covers, for example, "now" to "now" minus 1 hour. A 678 client that pauses on a specific point within the content may not be 679 able to retrieve the content anymore. If the client waits too long 680 before resuming the pause point, the content may no longer be 681 available. In this case the pause point will be adjusted to the end 682 of the available media. 684 2.4. Session Parameter Manipulations 686 A session may have additional state or functionality that effects how 687 the server or client treats the session, content, how it functions, 688 or feedback on how well the session works. Such extensions are not 689 defined in this specification, but may be done in various extensions. 690 RTSP has two methods for retrieving and setting parameter values on 691 either the client or the server: GET_PARAMETER (Section 13.8) and 692 SET_PARAMETER (Section 13.9). These methods carry the parameters in 693 a message body of the appropriate format. One can also use headers 694 to query state with the GET_PARAMETER method. As an example, clients 695 needing to know the current media-range for a time-progressing 696 session can use the GET_PARAMETER method and include the media-range. 697 Furthermore, synchronization information can be requested by using a 698 combination of RTP-Info and Range. 700 RTSP 2.0 does not have a strong mechanism for providing negotiation 701 of which headers, or parameters and their formats, that can be used. 702 However, responses will indicate request headers or parameters that 703 are not supported. A priori determination of what features are 704 available needs to be done through out-of-band mechanisms, like the 705 session description, or through the usage of feature tags 706 (Section 4.7). 708 2.5. Media Delivery 710 The delivery of media to the RTSP client is done with a protocol 711 outside of RTSP and this protocol is determined during the session 712 establishment. This document specifies how media is delivered with 713 RTP over UDP, TCP or the RTSP control connection. Additional 714 protocols may be specified in the future based on demand. 716 The usage of RTP as media delivery protocol requires some additional 717 information to function well. The PLAY response contains information 718 to enable reliable and timely delivery of how a client should 719 synchronize different sources in the different RTP sessions. It also 720 provides a mapping between RTP timestamps and the content time scale. 721 When the server wants to notify the client about the completion of 722 the media delivery, it sends a PLAY_NOTIFY request to the client. 723 The PLAY_NOTIFY request includes information about the stream end, 724 including the last RTP sequence number for each stream, thus enabling 725 the client to empty the buffer smoothly. 727 2.5.1. Media Delivery Manipulations 729 The basic playback functionality of RTSP enables delivery of a range 730 of requested content to the client at the pace intended by the 731 content's creator. However, RTSP can also manipulate the delivery to 732 the client in two ways. 734 Scale: The ratio of media content time delivered per unit playback 735 time. 737 Speed: The ratio of playback time delivered per unit of wallclock 738 time. 740 Both affect the media delivery per time unit. However, they 741 manipulate two independent time scales and the effects are possible 742 to combine. 744 Scale is used for fast forward or slow motion control as it changes 745 the amount of content timescale that should be played back per time 746 unit. Scale > 1.0, means fast forward, e.g. Scale=2.0 results in 747 that 2 seconds of content is played back every second of playback. 748 Scale = 1.0 is the default value that is used if no Scale is 749 specified, i.e., playback at the content's original rate. Scale 750 values between 0 and 1.0 is providing for slow motion. Scale can be 751 negative to allow for reverse playback in either regular pace (Scale 752 = -1.0) or fast backwards (Scale < -1.0) or slow motion backwards 753 (-1.0 < Scale < 0). Scale = 0 is equal to pause and is not allowed. 755 In most cases the realization of scale means server side manipulation 756 of the media to ensure that the client can actually play it back. 757 These media manipulation and when they are needed are highly media- 758 type dependent. Let's consider an example with two common media 759 types audio and video. 761 It is very difficult to modify the playback rate of audio. A maximum 762 of 10-30% is possible by changing the pitch-rate of speech. Music 763 goes out of tune if one tries to manipulate the playback rate by 764 resampling it. This is a well known problem and audio is commonly 765 muted or played back in short segments with skips to keep up with the 766 current playback point. 768 For video it is possible to manipulate the frame rate, although the 769 rendering capabilities are often limited to certain frame rates. 770 Also the allowed bitrates in decoding, the structure used in the 771 encoding and the dependency between frames and other capabilities of 772 the rendering device limits the possible manipulations. Therefore, 773 the basic fast forward capabilities often are implemented by 774 selecting certain subsets of frames. 776 Due to the media restrictions, the possible scale values are commonly 777 restricted to the set of realizable scale ratios. To enable the 778 clients to select from the possible scale values, RTSP can signal the 779 supported Scale ratios for the content. To support aggregated or 780 dynamic content, where this may change during the ongoing session and 781 dependent on the location within the content, a mechanism for 782 updating the media properties and the currently used scale factor 783 exist. 785 Speed affects how much of the playback timeline is delivered in a 786 given wallclock period. The default is Speed = 1 which means to 787 deliver at the same rate the media is consumed. Speed > 1 means that 788 the receiver will get content faster than it regularly would consume 789 it. Speed < 1 means that delivery is slower than the regular media 790 rate. Speed values of 0 or lower have no meaning and are not 791 allowed. This mechanism enables two general functionalities. One is 792 client side scale operations, i.e. the client receives all the frames 793 and makes the adjustment to the playback locally. The second is 794 delivery control for buffering of media. By specifying a speed over 795 1.0 the client can build up the amount of playback time it has 796 present in its buffers to a level that is sufficient for its needs. 798 A naive implementation of Speed would only affect the transmission 799 schedule of the media and has a clear impact on the needed bandwidth. 800 This would result in the data rate being proportional to the speed 801 factor. Speed = 1.5, i.e., 50% faster than normal delivery, would 802 result in a 50% increase in the data transport rate. If that can be 803 supported or not depends solely on the underlying network path. 804 Scale may also have some impact on the required bandwidth due to the 805 manipulation of the content in the new playback schedule. An example 806 is fast forward where only the independently decodable intra frames 807 are included in the media stream. This usage of solely intra frames 808 increases the data rate significantly compared to a normal sequence 809 with the same number of frames, where most frames are encoded using 810 prediction. 812 This potential increase of the data rate needs to be handled by the 813 media sender. The client has requested that the media will be 814 delivered in a specific way, which should be honored. However, the 815 media sender cannot ignore if the network path between the sender and 816 the receiver can't handle the resulting media stream. In that case 817 the media stream needs to be adapted to fit the available resources 818 of the path. This can result in a reduced media quality. 820 The need for bitrate adaptation becomes especially problematic in 821 connection with the Speed semantics. If the goal is to fill up the 822 buffer, the client may not want to do that at the cost of reduced 823 quality. If the client wants to make local playout changes then it 824 may actually require that the requested speed be honored. To resolve 825 this issue, Speed uses a range so that both cases can be supported. 826 The server is requested to use the highest possible speed value 827 within the range which is compatible with the available bandwidth. 828 As long as the server can maintain a speed value within the range it 829 shall not change the media quality, but instead modify the actual 830 delivery rate in response to available bandwidth and reflect this in 831 the Speed value in the response. However, if this is not possible, 832 the server should instead modify the media quality to respect the 833 lowest speed value and the available bandwidth. 835 This functionality enables the local scaling implementation to use a 836 tight range, or even a range where the lower bound equals the upper 837 bound, to identify that it requires the server to deliver the 838 requested amount of media time per delivery time independent of how 839 much it needs to adapt the media quality to fit within the available 840 path bandwidth. For buffer filling, it is suitable to use a range 841 with a reasonable span and with a lower bound at the nominal media 842 rate 1.0, such as 1.0 - 2.5. If the client wants to reduce the 843 buffer, it can specify an upper bound that is below 1.0 to force the 844 server to deliver slower than the nominal media rate. 846 2.6. Session Maintenance and Termination 848 The session context that has been established is kept alive by having 849 the client show liveness. This is done in two main ways: 851 o Media transport protocol keep-alive. RTCP may be used when using 852 RTP. 854 o Any RTSP request referencing the session context. 856 Section 10.5 discusses the methods for showing liveness in more 857 depth. If the client fails to show liveness for more than the 858 established session timeout value (normally 60 seconds), the server 859 may terminate the context. Other values may be selected by the 860 server through the inclusion of the timeout parameter in the session 861 header. 863 The session context is normally terminated by the client sending a 864 TEARDOWN request to the server referencing the aggregated control 865 URI. An individual media resource can be removed from a session 866 context by a TEARDOWN request referencing that particular media 867 resource. If all media resources are removed from a session context, 868 the session context is terminated. 870 A client may keep the session alive indefinitely if allowed by the 871 server; however, it is recommended to release the session context 872 when an extended period of time without media delivery activity has 873 passed. The client can re-establish the session context if required 874 later. What constitutes an extended period of time is dependent on 875 the server and its usage. It is recommended that the client 876 terminates the session before 10*times the session timeout value has 877 passed. A server may terminate the session after one session timeout 878 period without any client activity beyond keep-alive. When a server 879 terminates the session context, it does that by sending a TEARDOWN 880 request indicating the reason. 882 A server can also request that the client tear down the session and 883 re-establish it at an alternative server, as may be needed for 884 maintenance. This is done by using the REDIRECT method. The 885 Terminate-Reason header is used to indicate when and why. The 886 Location header indicates where it should connect if there is an 887 alternative server available. When the deadline expires, the server 888 simply stops providing the service. To achieve a clean closure, the 889 client needs to initiate session termination prior to the deadline. 890 In case the server has no other server to redirect to, and wants to 891 close the session for maintenance, it shall use the TEARDOWN method 892 with a Terminate-Reason header. 894 2.7. Extending RTSP 896 RTSP is quite a versatile protocol which supports extensions in many 897 different directions. Even this core specification contains several 898 blocks of functionality that are optional to implement. The use case 899 and need for the protocol deployment should determine what parts are 900 implemented. Allowing for extensions makes it possible for RTSP to 901 reach out to additional use cases. However, extensions will affect 902 the interoperability of the protocol and therefore it is important 903 that they can be added in a structured way. 905 The client can learn the capability of a server by using the OPTIONS 906 method (Section 13.1) and the Supported header (Section 16.49). It 907 can also try and possibly fail using new methods, or require that 908 particular features are supported using the Require or Proxy-Require 909 header. 911 The RTSP protocol in itself can be extended in three ways, listed 912 here in order of the magnitude of changes supported: 914 o Existing methods can be extended with new parameters, for example, 915 headers, as long as these parameters can be safely ignored by the 916 recipient. If the client needs negative acknowledgment when a 917 method extension is not supported, a tag corresponding to the 918 extension may be added in the field of the Require or Proxy- 919 Require headers (see Section 16.35). 921 o New methods can be added. If the recipient of the message does 922 not understand the request, it must respond with error code 501 923 (Not Implemented) so that the sender can avoid using this method 924 again. A client may also use the OPTIONS method to inquire about 925 methods supported by the server. The server must list the methods 926 it supports using the Public response header. 928 o A new version of the protocol can be defined, allowing almost all 929 aspects (except the position of the protocol version number) to 930 change. A new version of the protocol must be registered through 931 an IETF standard track document. 933 The basic capability discovery mechanism can be used to both discover 934 support for a certain feature and to ensure that a feature is 935 available when performing a request. For a detailed explanation of 936 this see Section 11. 938 New media delivery protocols may be added and negotiated at session 939 establishment, in addition to extensions to the core protocol. 940 Certain types of protocol manipulations can be done through parameter 941 formats using SET_PARAMETER and GET_PARAMETER. 943 3. Document Conventions 945 3.1. Notational Conventions 947 Since a few of the definitions are identical to HTTP/1.1, this 948 specification only points to the section where they are defined 949 rather than copying it. For brevity, [HX.Y] is to be taken to refer 950 to Section X.Y of the current HTTP/1.1 specification ([RFC2616]). 952 All the mechanisms specified in this document are described in both 953 prose and the Augmented Backus-Naur form (ABNF) described in detail 954 in [RFC5234]. 956 Indented and smaller-type paragraphs are used to provide informative 957 background and motivation. This is intended to give readers who were 958 not involved with the formulation of the specification an 959 understanding of why things are the way they are in RTSP. 961 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 962 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 963 "OPTIONAL" in this document are to be interpreted as described in 964 [RFC2119]. 966 The word, "unspecified" is used to indicate functionality or features 967 that are not defined in this specification. Such functionality 968 cannot be used in a standardized manner without further definition in 969 an extension specification to RTSP. 971 3.2. Terminology 973 Aggregate control: The concept of controlling multiple streams using 974 a single timeline, generally maintained by the server. A client, 975 for example, uses aggregate control when it issues a single play 976 or pause message to simultaneously control both the audio and 977 video in a movie. A session which is under aggregate control is 978 referred to as an aggregated session. 980 Aggregate control URI: The URI used in an RTSP request to refer to 981 and control an aggregated session. It normally, but not always, 982 corresponds to the presentation URI specified in the session 983 description. See Section 13.3 for more information. 985 Client: The client requests media service from the media server. 987 Connection: A transport layer virtual circuit established between 988 two programs for the purpose of communication. 990 Container file: A file which may contain multiple media streams 991 which often constitutes a presentation when played together. The 992 concept of a container file is not embedded in the protocol. 993 However, RTSP servers may offer aggregate control on the media 994 streams within these files. 996 Continuous media: Data where there is a timing relationship between 997 source and sink; that is, the sink needs to reproduce the timing 998 relationship that existed at the source. The most common examples 999 of continuous media are audio and motion video. Continuous media 1000 can be real-time (interactive or conversational), where there is a 1001 "tight" timing relationship between source and sink, or streaming 1002 where the relationship is less strict. 1004 Feature-tag: A tag representing a certain set of functionality, i.e. 1005 a feature. 1007 IRI: Internationalized Resource Identifier, is the same as an URI, 1008 with the exception that it allows characters from the whole 1009 Universal Character Set (Unicode/ISO 10646), rather than the US- 1010 ASCII only. See [RFC3987] for more information. 1012 Live: Normally used to describe a presentation or session with media 1013 coming from an ongoing event. This generally results in the 1014 session having an unbound or only loosely defined duration, and 1015 sometimes no seek operations are possible. 1017 Media initialization: Datatype/codec specific initialization. This 1018 includes such things as clock rates, color tables, etc. Any 1019 transport-independent information which is required by a client 1020 for playback of a media stream occurs in the media initialization 1021 phase of stream setup. 1023 Media parameter: Parameter specific to a media type that may be 1024 changed before or during stream delivery. 1026 Media server: The server providing media delivery services for one 1027 or more media streams. Different media streams within a 1028 presentation may originate from different media servers. A media 1029 server may reside on the same host or on a different host from 1030 which the presentation is invoked. 1032 (Media) stream: A single media instance, e.g., an audio stream or a 1033 video stream as well as a single whiteboard or shared application 1034 group. When using RTP, a stream consists of all RTP and RTCP 1035 packets created by a source within an RTP session. 1037 Message: The basic unit of RTSP communication, consisting of a 1038 structured sequence of octets matching the syntax defined in 1039 Section 20 and transmitted over a connection or a connectionless 1040 transport. A message is either a Request or a Response. 1042 Message Body: The information transferred as the payload of a 1043 message (Request and response). A message body consists of meta- 1044 information in the form of message-body headers and content in the 1045 form of a message-body, as described in Section 9. 1047 Non-Aggregated Control: Control of a single media stream. 1049 Presentation: A set of one or more streams presented to the client 1050 as a complete media feed and described by a presentation 1051 description as defined below. Presentations with more than one 1052 media stream are often handled in RTSP under aggregate control. 1054 Presentation description: A presentation description contains 1055 information about one or more media streams within a presentation, 1056 such as the set of encodings, network addresses and information 1057 about the content. Other IETF protocols such as SDP ([RFC4566]) 1058 use the term "session" for a presentation. The presentation 1059 description may take several different formats, including but not 1060 limited to the session description protocol format, SDP. 1062 Response: An RTSP response to a Request. One type of RTSP message. 1063 If an HTTP response is meant, it is indicated explicitly. 1065 Request: An RTSP request. One type of RTSP message. If an HTTP 1066 request is meant, it is indicated explicitly. 1068 Request-URI: The URI used in a request to indicate the resource on 1069 which the request is to be performed. 1071 RTSP agent: Refers to either an RTSP client, an RTSP server, or an 1072 RTSP proxy. In this specification, there are many capabilities 1073 that are common to these three entities such as the capability to 1074 send requests or receive responses. This term will be used when 1075 describing functionality that is applicable to all three of these 1076 entities. 1078 RTSP session: A stateful abstraction upon which the main control 1079 methods of RTSP operate. An RTSP session is a common context; it 1080 is created and maintained on client's request and can be destroyed 1081 by either the client or server. It is established by an RTSP 1082 server upon the completion of a successful SETUP request (when a 1083 200 OK response is sent) and is labeled with a session identifier 1084 at that time. The session exists until timed out by the server or 1085 explicitly removed by a TEARDOWN request. An RTSP session is a 1086 stateful entity; an RTSP server maintains an explicit session 1087 state machine (see Appendix B) where most state transitions are 1088 triggered by client requests. The existence of a session implies 1089 the existence of state about the session's media streams and their 1090 respective transport mechanisms. A given session can have one or 1091 more media streams associated with it. An RTSP server uses the 1092 session to aggregate control over multiple media streams. 1094 Origin Server: The server on which a given resource resides. 1096 Transport initialization: The negotiation of transport information 1097 (e.g., port numbers, transport protocols) between the client and 1098 the server. 1100 URI: Universal Resource Identifier, see [RFC3986]. The URIs used in 1101 RTSP are generally URLs as they give a location for the resource. 1102 As URLs are a subset of URIs, they will be referred to as URIs to 1103 cover also the cases when an RTSP URI would not be an URL. 1105 URL: Universal Resource Locator, is an URI which identifies the 1106 resource through its primary access mechanism, rather than 1107 identifying the resource by name or by some other attribute(s) of 1108 that resource. 1110 4. Protocol Parameters 1112 4.1. RTSP Version 1114 This specification defines version 2.0 of RTSP. 1116 RTSP uses a "." numbering scheme to indicate versions 1117 of the protocol. The protocol versioning policy is intended to allow 1118 the sender to indicate the format of a message and its capacity for 1119 understanding further RTSP communication, rather than the features 1120 obtained via that communication. No change is made to the version 1121 number for the addition of message components which do not affect 1122 communication behavior or which only add to extensible field values. 1124 The number is incremented when the changes made to the 1125 protocol add features which do not change the general message parsing 1126 algorithm, but which may add to the message semantics and imply 1127 additional capabilities of the sender. The number is 1128 incremented when the format of a message within the protocol is 1129 changed. The version of an RTSP message is indicated by an RTSP- 1130 Version field in the first line of the message. Note that the major 1131 and minor numbers MUST be treated as separate integers and that each 1132 MAY be incremented higher than a single digit. Thus, RTSP/2.4 is a 1133 lower version than RTSP/2.13, which in turn is lower than RTSP/12.3. 1134 Leading zeros MUST be ignored by recipients and MUST NOT be sent. 1136 4.2. RTSP IRI and URI 1138 RTSP 2.0 defines and registers three URI schemes "rtsp", "rtsps" and 1139 "rtspu". The usage of the last, "rtspu", is unspecified in RTSP 2.0, 1140 and is defined here to register and reserve the URI scheme that is 1141 defined in RTSP 1.0. The "rtspu" scheme indicates unspecified 1142 transport of the RTSP messages over unreliable transport (UDP in RTSP 1143 1.0). An RTSP server MUST response with an error code indicating the 1144 "rtspu" scheme is not implemented (501) to a request that carries a 1145 "rtspu" URI scheme. The details of the syntax of "rtsp" and "rtsps" 1146 URIs has been changed from RTSP 1.0. 1148 This specification also defines the format of the RTSP IRI [RFC3987] 1149 that can be used as RTSP resource identifiers and locators, in web 1150 pages, user interfaces, on paper, etc. However, the RTSP request 1151 message format only allows usage of the absolute URI format. The 1152 RTSP IRI format MUST use the rules and transformation for IRIs to 1153 URIs, as defined in [RFC3987]. This way RTSP 2.0 URIs for request 1154 can be produced from an RTSP IRI. 1156 The RTSP IRI and URI are both syntax restricted compared to the 1157 generic syntax defined in [RFC3986] and [RFC3987]: 1159 o An absolute URI requires the authority part; i.e., a host identity 1160 must be provided. 1162 o Parameters in the path element are prefixed with the reserved 1163 separator ";". 1165 The RTSP URI and IRI are case sensitive, with the exception of those 1166 parts that [RFC3986] and [RFC3987] defines as case-insensitive; for 1167 example, the scheme and host part. 1169 The fragment identifier is used as defined in sections 3.5 and 4.3 of 1170 [RFC3986], i.e. the fragment is to be stripped from the IRI by the 1171 requester and not included in the request URI. The user agent needs 1172 to interpret the value of the fragment based on the media type the 1173 request relates to; i.e., the media type indicated in Content-Type 1174 header in the response to DESCRIBE. 1176 The syntax of any URI query string is unspecified and responder 1177 (usually the server) specific. The query is, from the requester's 1178 perspective, an opaque string and needs to be handled as such. 1179 Please note that relative URI with queries are difficult to handle 1180 due to the RFC 3986 relative URI handling rules. Any change of the 1181 path element using a relative URI results in the stripping of the 1182 query, which means the relative part needs to contain the query. 1184 The URI scheme "rtsp" requires that commands are issued via a 1185 reliable protocol (within the Internet, TCP), while the scheme 1186 "rtsps" identifies a reliable transport using secure transport (TLS 1187 [RFC5246], see (Section 19). 1189 For the scheme "rtsp", if no port number is provided in the authority 1190 part of the URI port number 554 MUST be used. For the scheme 1191 "rtsps", the TCP port 322 is registered and MUST be assumed. 1193 A presentation or a stream is identified by a textual media 1194 identifier, using the character set and escape conventions of URIs 1195 [RFC3986]. URIs may refer to a stream or an aggregate of streams; 1196 i.e., a presentation. Accordingly, requests described in 1197 (Section 13) can apply to either the whole presentation or an 1198 individual stream within the presentation. Note that some request 1199 methods can only be applied to streams, not presentations, and vice 1200 versa. 1202 For example, the RTSP URI: 1204 rtsp://media.example.com:554/twister/audiotrack 1206 may identify the audio stream within the presentation "twister", 1207 which can be controlled via RTSP requests issued over a TCP 1208 connection to port 554 of host media.example.com. 1210 Also, the RTSP URI: 1212 rtsp://media.example.com:554/twister 1214 identifies the presentation "twister", which may be composed of audio 1215 and video streams, but could also be something else like a random 1216 media redirector. 1218 This does not imply a standard way to reference streams in URIs. 1219 The presentation description defines the hierarchical 1220 relationships in the presentation and the URIs for the individual 1221 streams. A presentation description may name a stream "a.mov" and 1222 the whole presentation "b.mov". 1224 The path components of the RTSP URI are opaque to the client and do 1225 not imply any particular file system structure for the server. 1227 This decoupling also allows presentation descriptions to be used 1228 with non-RTSP media control protocols simply by replacing the 1229 scheme in the URI. 1231 4.3. Session Identifiers 1233 Session identifiers are strings of length 8-128 characters. A 1234 session identifier MUST be chosen cryptographically random (see 1235 [RFC4086]). It is RECOMMENDED that it contains 128 bits of entropy, 1236 i.e. approximately 22 characters from a high quality generator (see 1237 Section 21). However, note that the session identifier does not 1238 provide any security against session hijacking unless it is kept 1239 confidential by the client, server and trusted proxies. 1241 4.4. SMPTE Relative Timestamps 1243 A SMPTE relative timestamp expresses time relative to the start of 1244 the clip. Relative timestamps are expressed as SMPTE time codes for 1245 frame-level access accuracy. The time code has the format 1247 hours:minutes:seconds:frames.subframes, 1249 with the origin at the start of the clip. The default SMPTE format 1250 is "SMPTE 30 drop" format, with frame rate is 29.97 frames per 1251 second. Other SMPTE codes MAY be supported (such as "SMPTE 25") 1252 through the use of "smpte-type". For SMPTE 30, the "frames" field in 1253 the time value can assume the values 0 through 29. The difference 1254 between 30 and 29.97 frames per second is handled by dropping the 1255 first two frame indices (values 00 and 01) of every minute, except 1256 every tenth minute. If the frame and the subframe values are zero, 1257 they may be omitted. Subframes are measured in one-hundredth of a 1258 frame. 1260 Examples: 1262 smpte=10:12:33:20- 1263 smpte=10:07:33- 1264 smpte=10:07:00-10:07:33:05.01 1265 smpte-25=10:07:00-10:07:33:05.01 1267 4.5. Normal Play Time 1269 Normal play time (NPT) indicates the stream absolute position 1270 relative to the beginning of the presentation, not to be confused 1271 with the Network Time Protocol (NTP) [RFC5905]. The timestamp 1272 consists of two parts: the mandatory first part may be expressed in 1273 either seconds or hours, minutes, and seconds. The optional second 1274 part consists of a decimal point and decimal figures and indicates 1275 fractions of a second. 1277 The beginning of a presentation corresponds to 0.0 seconds. Negative 1278 values are not defined. 1280 The special constant "now" is defined as the current instant of a 1281 live event. It MAY only be used for live events, and MUST NOT be 1282 used for on-demand (i.e., non-live) content. 1284 NPT is defined as in DSM-CC [ISO.13818-6.1995]: "Intuitively, NPT is 1285 the clock the viewer associates with a program. It is often 1286 digitally displayed on a VCR. NPT advances normally when in normal 1287 play mode (scale = 1), advances at a faster rate when in fast scan 1288 forward (high positive scale ratio), decrements when in scan reverse 1289 (negative scale ratio) and is fixed in pause mode. NPT is 1290 (logically) equivalent to SMPTE time codes." 1292 Examples: 1294 npt=123.45-125 1295 npt=12:05:35.3- 1296 npt=now- 1297 The syntax conforms to ISO 8601 [ISO.8601.2000]. The npt-sec 1298 notation is optimized for automatic generation, the npt-hhmmss 1299 notation for consumption by human readers. The "now" constant 1300 allows clients to request to receive the live feed rather than the 1301 stored or time-delayed version. This is needed since neither 1302 absolute time nor zero time are appropriate for this case. 1304 4.6. Absolute Time 1306 Absolute time is expressed as ISO 8601 [ISO.8601.2000] timestamps, 1307 using UTC (GMT). Fractions of a second may be indicated. 1309 Example for November 8, 1996 at 14h 37 min and 20 and a quarter 1310 seconds UTC: 1312 19961108T143720.25Z 1314 4.7. Feature-Tags 1316 Feature-tags are unique identifiers used to designate features in 1317 RTSP. These tags are used in Require (Section 16.41), Proxy-Require 1318 (Section 16.35), Proxy-Supported (Section 16.36), Supported 1319 (Section 16.49) and Unsupported (Section 16.53) header fields. 1321 A feature-tag definition MUST indicate which combination of clients, 1322 servers or proxies it applies to. 1324 The creator of a new RTSP feature-tag should either prefix the 1325 feature-tag with a reverse domain name (e.g., 1326 "com.example.mynewfeature" is an apt name for a feature whose 1327 inventor can be reached at "example.com"), or register the new 1328 feature-tag with the Internet Assigned Numbers Authority (IANA) (see 1329 IANA Section 22). 1331 The usage of feature-tags is further described in Section 11 that 1332 deals with capability handling. 1334 4.8. Message Body Tags 1336 Message body tags are opaque strings that are used to compare two 1337 message bodies from the same resource, for example in caches or to 1338 optimize setup after a redirect. Message body tags can be carried in 1339 the MTag header (see Section 16.30) or in SDP (see Appendix D.1.9). 1340 MTag is similar to ETag in HTTP/1.1. 1342 A message body tag MUST be unique across all versions of all message 1343 bodies associated with a particular resource. A given message body 1344 tag value MAY be used for message bodies obtained by requests on 1345 different URIs. The use of the same message body tag value in 1346 conjunction with message bodies obtained by requests on different 1347 URIs does not imply the equivalence of those message bodies 1349 Message body tags are used in RTSP to make some methods conditional. 1350 The methods are made conditional through the inclusion of headers; 1351 see "If-Match" (Section 16.23) and "If-None-Match" (Section 16.25). 1352 Note that RTSP message body tags apply to the complete presentation; 1353 i.e., both the presentation description and the individual media 1354 streams. Thus message body tags can be used to verify at setup time 1355 after a redirect that the same session description applies to the 1356 media at the new location using the If-Match header. 1358 4.9. Media Properties 1360 When an RTSP server handles media, it is important to consider the 1361 different properties a media instance for delivery and playback can 1362 have. This specification considers the below listed media properties 1363 in its protocol operations. They are derived from the differences 1364 between a number of supported usages. 1366 On-demand: Media that has a fixed (given) duration that doesn't 1367 change during the life time of the RTSP session and is known at 1368 the time of the creation of the session. It is expected that the 1369 content of the media will not change, even if the representation, 1370 i.e encoding, quality, etc, may change. Generally one can seek, 1371 i.e. request any range, within the media. 1373 Dynamic On-demand: This is a variation of the on-demand case where 1374 external methods are used to manipulate the actual content of the 1375 media setup for the RTSP session. The main example is a content 1376 defined by a playlist. 1378 Live: Live media represents a progressing content stream (such as 1379 broadcast TV) where the duration may or may not be known. It is 1380 not seekable, only the content presently being delivered can be 1381 accessed. 1383 Live with Recording: A Live stream that is combined with a server- 1384 side capability to store and retain the content of the live 1385 session, and allow for random access delivery within the part of 1386 the already recorded content. The actual behavior of the media 1387 stream is very much dependent on the retention policy for the 1388 media stream; either the server will be able to capture the 1389 complete media stream, or it will have a limitation in how much 1390 will be retained. The media range will dynamically change as the 1391 session progress. For servers with a limited amount of storage 1392 available for recording, there will typically be a sliding window 1393 that moves forwards while new data is made available and older 1394 data is discarded. 1396 To cover the above usages, the following media properties with 1397 appropriate values are specified: 1399 4.9.1. Random Access and Seeking 1401 Random Access is the ability to specify and get media delivered from 1402 any point inside the content, an operation called seeking. This 1403 possibility is signaled using the Seek-Style header (see 1404 Section 16.45) which can take the following different values: 1406 Random Access: The media is seekable to any out of a large number of 1407 points within the media. Due to media encoding limitations, a 1408 particular point may not be reachable, but seeking to a point 1409 close by is enabled. A floating point number of seconds may be 1410 provided to express the worst case distance between random access 1411 points. 1413 Conditional Random Access: Based on the above Random Access but 1414 intended to handle a case where the distance in the media between 1415 random access points is large, and where small seek forward using 1416 Random Access would move the client further away than the current 1417 point. 1419 Return To Start: Seeking is only possible to the beginning of the 1420 content. 1422 No seeking: Seeking is not possible at all. 1424 4.9.2. Retention 1426 Media may have different retention policies in place that affect the 1427 operation on media. The following different media retention policies 1428 are envisioned and taken into consideration where applicable: 1430 Unlimited: The media will not be removed as long as the RTSP session 1431 is in existence. 1433 Time Limited: The media will not be removed before given wallclock 1434 time. After that time it may or may not be available any more. 1436 Duration limited: Each individual unit of the media will be retained 1437 for the specified duration. 1439 4.9.3. Content Modifications 1441 There is also the question of how the content may change during time 1442 for a given media resource: 1444 Immutable: The content of the media will not change, even if the 1445 representation, i.e., encoding, quality, etc., may change. 1447 Dynamic: Between explicit updates the media content will not change, 1448 but the content may change due to external methods or triggers, 1449 such as playlists. 1451 Time Progressing: As times progresses new content will become 1452 available. If the content also is retained it will become longer 1453 as everything between the start point and the point currently 1454 being made available can be accessed. If the media server uses a 1455 sliding window policy for retention, the start point will also 1456 change as time progresses. 1458 4.9.4. Supported Scale Factors 1460 Content often supports only a limited set or range of scales when 1461 delivering the media.. To enable the client to know what values or 1462 ranges of scale operations that the whole content or the current 1463 position supports, a media properties attribute for this is defined 1464 which contains a list with the values and/or ranges that are 1465 supported. The attribute is named "Scales". It may be updated at 1466 any point in the content due to content consisting of spliced pieces 1467 or content being dynamically updated by out-of-band mechanisms. 1469 4.9.5. Mapping to the Attributes 1471 This section shows examples of how one would map the above usages to 1472 the properties and their values. 1474 On-demand: Random Access: Random Access=5s, Content Modifications: 1475 Immutable, Retention: unlimited or time limited. 1477 Dynamic On-demand: Random Access: Random Access=3s, Content 1478 Modifications: Dynamic, Retention: unlimited or time limited. 1480 Live: Random Access: No seeking, Content Modifications: Time 1481 Progressing, Retention: Duration limited=0.0s 1483 Live with Recording: Random Access: Random Access=3s, Content 1484 Modifications: Time Progressing, Retention: Duration limited=2H 1486 5. RTSP Message 1488 RTSP is a text-based protocol and uses the ISO 10646 character set in 1489 UTF-8 encoding RFC 3629 [RFC3629]. Lines MUST be terminated by CRLF. 1491 Text-based protocols make it easier to add optional parameters in 1492 a self-describing manner. Since the number of parameters and the 1493 frequency of commands is low, processing efficiency is not a 1494 concern. Text-based protocols, if done carefully, also allow easy 1495 implementation of research prototypes in scripting languages such 1496 as TCL, Visual Basic and Perl. 1498 The ISO 10646 character set avoids tricky character set switching, 1499 but is invisible to the application as long as US-ASCII is being 1500 used. This is also the encoding used for RTCP [RFC3550]. 1502 Requests contain methods, the object the method is operating upon and 1503 parameters to further describe the method. Methods are idempotent 1504 unless otherwise noted. Methods are also designed to require little 1505 or no state maintenance at the media server. 1507 5.1. Message Types 1509 RTSP messages consist of requests from client to server, or server to 1510 client, and responses in the reverse direction. Request (Section 7) 1511 and Response (Section 8) messages use a format based on the generic 1512 message format of RFC 2822 [RFC2822] for transferring bodies (the 1513 payload of the message). Both types of messages consist of a start- 1514 line, zero or more header fields (also known as "headers"), an empty 1515 line (i.e., a line with nothing preceding the CRLF) indicating the 1516 end of the header, and possibly the data of the message body. 1518 generic-message = start-line 1519 *(message-header CRLF) 1520 CRLF 1521 [ message-body-data ] 1522 start-line = Request-Line | Status-Line 1524 In the interest of robustness, agents MUST ignore any empty line(s) 1525 received where a Request-Line or Response-Line is expected. In other 1526 words, if the agent is reading the protocol stream at the beginning 1527 of a message and receives a CRLF first, it MUST ignore the CRLF. 1529 5.2. Message Headers 1531 RTSP header fields (see Section 16) include general-header, request- 1532 header, response-header, and message-body header fields. 1534 The order in which header fields with differing field names are 1535 received is not significant. However, it is "good practice" to send 1536 general-header fields first, followed by request-header or response- 1537 header fields, and ending with the Message-body header fields. 1539 Multiple message-header fields with the same field-name MAY be 1540 present in a message if and only if the entire field-value for that 1541 header field is defined as a comma-separated list. It MUST be 1542 possible to combine the multiple header fields into one "field-name: 1543 field-value" pair, without changing the semantics of the message, by 1544 appending each subsequent field-value to the first, each separated by 1545 a comma. The order in which header fields with the same field-name 1546 are received is therefore significant to the interpretation of the 1547 combined field value, and thus a proxy MUST NOT change the order of 1548 these field values when a message is forwarded. 1550 Unknown message headers MUST be ignored (skipping over the header to 1551 the next protocol element, and not causing an error) by a RTSP server 1552 or client. An RTSP Proxy MUST forward unknown message headers. 1553 Message headers defined outside of this specification that are 1554 required to be interpreted by the RTSP agent will need to use feature 1555 tags (Section 4.7) and include them in the appropriate Require 1556 (Section 16.41) or Proxy-Require (Section 16.35) header. 1558 5.3. Message Body 1560 The message body (if any) of an RTSP message is used to carry further 1561 information for a particular resource associated with the request or 1562 response. An example of a message body is the Session Description 1563 Protocol (SDP). 1565 The presence of a message body in either a request or a response MUST 1566 be signaled by the inclusion of a Content-Length header (see 1567 Section 16.16). A message body MUST NOT be included in a request or 1568 response if the specification of the particular method (see Method 1569 Definitions (Section 13)) does not allow sending a message body. 1571 5.4. Message Length 1573 When a message body is included in a message, the length of that body 1574 is determined by one of the following (in order of precedence): 1576 1. Any response message which MUST NOT include a message body (such 1577 as the 1xx, 204, and 304 responses) is always terminated by the 1578 first empty line after the header fields, regardless of the 1579 message-header fields present in the message. (Note: An empty 1580 line is a line with nothing preceding the CRLF.) 1582 2. If a Content-Length header(Section 16.16) is present, its value 1583 in bytes represents the length of the message-body. If this 1584 header field is not present, a value of zero is assumed. 1586 Unlike an HTTP message, an RTSP message MUST contain a Content-Length 1587 header whenever it contains a message body. Note that RTSP does not 1588 support the HTTP/1.1 "chunked" transfer coding (see [H3.6.1]). 1590 Given the moderate length of presentation descriptions returned, 1591 the server should always be able to determine its length, even if 1592 it is generated dynamically, making the chunked transfer encoding 1593 unnecessary. 1595 6. General Header Fields 1597 General headers are headers that may be used in both requests and 1598 responses. The general headers are listed in Table 1: 1600 +--------------------+--------------------+ 1601 | Header Name | Defined in Section | 1602 +--------------------+--------------------+ 1603 | Accept-Ranges | Section 16.5 | 1604 | | | 1605 | Cache-Control | Section 16.10 | 1606 | | | 1607 | Connection | Section 16.11 | 1608 | | | 1609 | CSeq | Section 16.19 | 1610 | | | 1611 | Date | Section 16.20 | 1612 | | | 1613 | Media-Properties | Section 16.28 | 1614 | | | 1615 | Media-Range | Section 16.29 | 1616 | | | 1617 | Pipelined-Requests | Section 16.32 | 1618 | | | 1619 | Proxy-Supported | Section 16.36 | 1620 | | | 1621 | RTP-Info | Section 16.43 | 1622 | | | 1623 | Seek-Style | Section 16.45 | 1624 | | | 1625 | Supported | Section 16.49 | 1626 | | | 1627 | Timestamp | Section 16.51 | 1628 | | | 1629 | Via | Section 16.56 | 1630 +--------------------+--------------------+ 1632 Table 1: The general headers used in RTSP 1634 7. Request 1636 A request message uses the format outlined below regardless of the 1637 direction of a request, client to server or server to client: 1639 o Request line, containing the method to be applied to the resource, 1640 the identifier of the resource, and the protocol version in use; 1642 o Zero or more Header lines, that can be of the following types: 1643 general headers (Section 6), request headers (Section 7.2), or 1644 message body headers (Section 9.1); 1646 o One empty line (CRLF) to indicate the end of the header section; 1648 o Optionally a message-body, consisting of one or more lines. The 1649 length of the message body in bytes is indicated by the Content- 1650 Length message header. 1652 7.1. Request Line 1654 The request line provides the key information about the request: what 1655 method, on what resources and using which RTSP version. The methods 1656 that are defined by this specification are listed in Table 2. 1658 +---------------+--------------------+ 1659 | Method | Defined in Section | 1660 +---------------+--------------------+ 1661 | DESCRIBE | Section 13.2 | 1662 | | | 1663 | GET_PARAMETER | Section 13.8 | 1664 | | | 1665 | OPTIONS | Section 13.1 | 1666 | | | 1667 | PAUSE | Section 13.6 | 1668 | | | 1669 | PLAY | Section 13.4 | 1670 | | | 1671 | PLAY_NOTIFY | Section 13.5 | 1672 | | | 1673 | REDIRECT | Section 13.10 | 1674 | | | 1675 | SETUP | Section 13.3 | 1676 | | | 1677 | SET_PARAMETER | Section 13.9 | 1678 | | | 1679 | TEARDOWN | Section 13.7 | 1680 +---------------+--------------------+ 1682 Table 2: The RTSP Methods 1684 The syntax of the RTSP request line is the following: 1686 SP SP CRLF 1688 Note: This syntax cannot be freely changed in future versions of 1689 RTSP. This line needs to remain parsable by older RTSP 1690 implementations since it indicates the RTSP version of the message. 1692 In contrast to HTTP/1.1 [RFC2616], RTSP requests identify the 1693 resource through an absolute RTSP URI (including scheme, host, and 1694 port) (see Section 4.2) rather than just the absolute path. 1696 HTTP/1.1 requires servers to understand the absolute URI, but 1697 clients are supposed to use the Host request header. This is 1698 purely needed for backward-compatibility with HTTP/1.0 servers, a 1699 consideration that does not apply to RTSP. 1701 An asterisk "*" can be used instead of an absolute URI in the 1702 Request-URI part to indicate that the request does not apply to a 1703 particular resource, but to the server or proxy itself, and is only 1704 allowed when the request method does not necessarily apply to a 1705 resource. 1707 For example: 1709 OPTIONS * RTSP/2.0 1711 An OPTIONS in this form will determine the capabilities of the server 1712 or the proxy that first receives the request. If the capability of 1713 the specific server needs to be determined, without regard to the 1714 capability of an intervening proxy, the server should be addressed 1715 explicitly with an absolute URI that contains the server's address. 1717 For example: 1719 OPTIONS rtsp://example.com RTSP/2.0 1721 7.2. Request Header Fields 1723 The RTSP headers in Table 3 can be included in a request, as request 1724 headers, to modify the specifics of the request. Some of these 1725 headers may also be used in the response to a request, as response 1726 headers, to modify the specifics of a response (Section 8.2). 1728 +--------------------+--------------------+ 1729 | Header | Defined in Section | 1730 +--------------------+--------------------+ 1731 | Accept | Section 16.1 | 1732 | | | 1733 | Accept-Credentials | Section 16.2 | 1734 | | | 1735 | Accept-Encoding | Section 16.3 | 1736 | | | 1737 | Accept-Language | Section 16.4 | 1738 | | | 1739 | Authorization | Section 16.7 | 1740 | | | 1741 | Bandwidth | Section 16.8 | 1742 | | | 1743 | Blocksize | Section 16.9 | 1744 | | | 1745 | From | Section 16.22 | 1746 | | | 1747 | If-Match | Section 16.23 | 1748 | | | 1749 | If-Modified-Since | Section 16.24 | 1750 | | | 1751 | If-None-Match | Section 16.25 | 1752 | | | 1753 | Notify-Reason | Section 16.31 | 1754 | | | 1755 | Proxy-Require | Section 16.35 | 1756 | | | 1757 | Range | Section 16.38 | 1758 | | | 1759 | Referrer | Section 16.39 | 1760 | | | 1761 | Request-Status | Section 16.40 | 1762 | | | 1763 | Require | Section 16.41 | 1764 | | | 1765 | Scale | Section 16.44 | 1766 | | | 1767 | Session | Section 16.47 | 1768 | | | 1769 | Speed | Section 16.48 | 1770 | | | 1771 | Supported | Section 16.49 | 1772 | | | 1773 | Terminate-Reason | Section 16.50 | 1774 | | | 1775 | Transport | Section 16.52 | 1776 | | | 1777 | User-Agent | Section 16.54 | 1778 +--------------------+--------------------+ 1780 Table 3: The RTSP request headers 1782 Detailed header definition are provided in Section 16. 1784 New request headers may be defined. If the receiver of the request 1785 is required to understand the request header, the request MUST 1786 include a corresponding feature tag in a Require or Proxy-Require 1787 header to ensure the processing of the header. 1789 8. Response 1791 After receiving and interpreting a request message, the recipient 1792 responds with an RTSP response message. Normally, there is only one, 1793 final, response. Only responses using the response code class 1xx, 1794 are allowed to send one or more 1xx response messages prior to the 1795 final response message. 1797 The valid response codes and the methods they can be used with are 1798 listed in Table 4. 1800 8.1. Status-Line 1802 The first line of a Response message is the Status-Line, consisting 1803 of the protocol version followed by a numeric status code and the 1804 textual phrase associated with the status code, with each element 1805 separated by SP characters. No CR or LF is allowed except in the 1806 final CRLF sequence. 1808 SP SP CRLF 1810 8.1.1. Status Code and Reason Phrase 1812 The Status-Code element is a 3-digit integer result code of the 1813 attempt to understand and satisfy the request. These codes are fully 1814 defined in Section 15. The Reason-Phrase is intended to give a short 1815 textual description of the Status-Code. The Status-Code is intended 1816 for use by automata and the Reason-Phrase is intended for the human 1817 user. The client is not required to examine or display the Reason- 1818 Phrase. 1820 The first digit of the Status-Code defines the class of response. 1821 The last two digits do not have any categorization role. There are 5 1822 values for the first digit: 1824 1xx: Informational - Request received, continuing process 1826 2xx: Success - The action was successfully received, understood, and 1827 accepted 1829 3rr: Redirection - Further action needs to be taken in order to 1830 complete the request 1832 4xx: Client Error - The request contains bad syntax or cannot be 1833 fulfilled 1835 5xx: Server Error - The server failed to fulfill an apparently valid 1836 request 1838 The individual values of the numeric status codes defined for 1839 RTSP/2.0, and an example set of corresponding Reason-Phrases, are 1840 presented in Table 4. The reason phrases listed here are only 1841 recommended; they may be replaced by local equivalents without 1842 affecting the protocol. Note that RTSP adopts most HTTP/1.1 1843 [RFC2616] status codes and adds RTSP-specific status codes starting 1844 at x50 to avoid conflicts with future HTTP status codes that are 1845 desirable to import into RTSP. 1847 RTSP status codes are extensible. RTSP applications are not required 1848 to understand the meaning of all registered status codes, though such 1849 understanding is obviously desirable. However, applications MUST 1850 understand the class of any status code, as indicated by the first 1851 digit, and treat any unrecognized response as being equivalent to the 1852 x00 status code of that class, with the exception that an 1853 unrecognized response MUST NOT be cached. For example, if an 1854 unrecognized status code of 431 is received by the client, it can 1855 safely assume that there was something wrong with its request and 1856 treat the response as if it had received a 400 status code. In such 1857 cases, user agents SHOULD present to the user the message body 1858 returned with the response, since that message body is likely to 1859 include human-readable information which will explain the unusual 1860 status. 1862 +------+---------------------------------+--------------------------+ 1863 | Code | Reason | Method | 1864 +------+---------------------------------+--------------------------+ 1865 | 100 | Continue | all | 1866 | | | | 1867 | | | | 1868 | 200 | OK | all | 1869 | | | | 1870 | | | | 1871 | 301 | Moved Permanently | all | 1872 | | | | 1873 | 302 | Found | all | 1874 | | | | 1875 | 303 | reserved | n/a | 1876 | | | | 1877 | 304 | Not Modified | all | 1878 | | | | 1879 | 305 | Use Proxy | all | 1880 | | | | 1881 | | | | 1882 | 400 | Bad Request | all | 1883 | 401 | Unauthorized | all | 1884 | | | | 1885 | 402 | Payment Required | all | 1886 | | | | 1887 | 403 | Forbidden | all | 1888 | | | | 1889 | 404 | Not Found | all | 1890 | | | | 1891 | 405 | Method Not Allowed | all | 1892 | | | | 1893 | 406 | Not Acceptable | all | 1894 | | | | 1895 | 407 | Proxy Authentication Required | all | 1896 | | | | 1897 | 408 | Request Timeout | all | 1898 | | | | 1899 | 410 | Gone | all | 1900 | | | | 1901 | 411 | Length Required | all | 1902 | | | | 1903 | 412 | Precondition Failed | DESCRIBE, SETUP | 1904 | | | | 1905 | 413 | Request Message Body Too Large | all | 1906 | | | | 1907 | 414 | Request-URI Too Long | all | 1908 | | | | 1909 | 415 | Unsupported Media Type | all | 1910 | | | | 1911 | 451 | Parameter Not Understood | SET_PARAMETER, | 1912 | | | GET_PARAMETER | 1913 | | | | 1914 | 452 | reserved | n/a | 1915 | | | | 1916 | 453 | Not Enough Bandwidth | SETUP | 1917 | | | | 1918 | 454 | Session Not Found | all | 1919 | | | | 1920 | 455 | Method Not Valid In This State | all | 1921 | | | | 1922 | 456 | Header Field Not Valid | all | 1923 | | | | 1924 | 457 | Invalid Range | PLAY, PAUSE | 1925 | | | | 1926 | 458 | Parameter Is Read-Only | SET_PARAMETER | 1927 | | | | 1928 | 459 | Aggregate Operation Not Allowed | all | 1929 | | | | 1930 | 460 | Only Aggregate Operation | all | 1931 | | Allowed | | 1932 | | | | 1933 | 461 | Unsupported Transport | all | 1934 | | | | 1935 | 462 | Destination Unreachable | all | 1936 | | | | 1937 | 463 | Destination Prohibited | SETUP | 1938 | | | | 1939 | 464 | Data Transport Not Ready Yet | PLAY | 1940 | | | | 1941 | 465 | Notification Reason Unknown | PLAY_NOTIFY | 1942 | | | | 1943 | 466 | Key Management Error | all | 1944 | | | | 1945 | 470 | Connection Authorization | all | 1946 | | Required | | 1947 | | | | 1948 | 471 | Connection Credentials not | all | 1949 | | accepted | | 1950 | | | | 1951 | 472 | Failure to establish secure | all | 1952 | | connection | | 1953 | | | | 1954 | | | | 1955 | 500 | Internal Server Error | all | 1956 | | | | 1957 | 501 | Not Implemented | all | 1958 | | | | 1959 | 502 | Bad Gateway | all | 1960 | | | | 1961 | 503 | Service Unavailable | all | 1962 | | | | 1963 | 504 | Gateway Timeout | all | 1964 | | | | 1965 | 505 | RTSP Version Not Supported | all | 1966 | | | | 1967 | 551 | Option Not Support | all | 1968 +------+---------------------------------+--------------------------+ 1970 Table 4: Status codes and their usage with RTSP methods 1972 8.2. Response Headers 1974 The response-header allows the request recipient to pass additional 1975 information about the response which cannot be placed in the Status- 1976 Line. This header gives information about the server and about 1977 further access to the resource identified by the Request-URI. All 1978 headers currently classified as response headers are listed in 1979 Table 5. 1981 +------------------------+--------------------+ 1982 | Header | Defined in Section | 1983 +------------------------+--------------------+ 1984 | Connection-Credentials | Section 16.12 | 1985 | | | 1986 | Location | Section 16.27 | 1987 | | | 1988 | MTag | Section 16.30 | 1989 | | | 1990 | Proxy-Authenticate | Section 16.33 | 1991 | | | 1992 | Public | Section 16.37 | 1993 | | | 1994 | Range | Section 16.38 | 1995 | | | 1996 | Retry-After | Section 16.42 | 1997 | | | 1998 | Scale | Section 16.44 | 1999 | | | 2000 | Session | Section 16.47 | 2001 | | | 2002 | Server | Section 16.46 | 2003 | | | 2004 | Speed | Section 16.48 | 2005 | | | 2006 | Transport | Section 16.52 | 2007 | | | 2008 | Unsupported | Section 16.53 | 2009 | | | 2010 | Vary | Section 16.55 | 2011 | | | 2012 | WWW-Authenticate | Section 16.57 | 2013 +------------------------+--------------------+ 2015 Table 5: The RTSP response headers 2017 Response-header names can be extended reliably only in combination 2018 with a change in the protocol version. However, the usage of 2019 feature-tags in the request allows the responding party to learn the 2020 capability of the receiver of the response. A new or experimental 2021 header MAY be given the semantics of response-header if all parties 2022 in the communication recognize them to be response-header. 2023 Unrecognized headers in responses are treated as message-headers and 2024 hence MUST be ignored. 2026 9. Message Body 2028 Request and Response messages MAY transfer a message body, if not 2029 otherwise restricted by the request method or response status code. 2030 The message body consists of the content data itself (see also 2031 Section 5.2. 2033 The SET_PARAMETER and GET_PARAMETER request and response, and 2034 DESCRIBE response MAY have a message body. All 4xx and 5xx responses 2035 MAY also have a message body. 2037 In this section, both sender and recipient refer to either the client 2038 or the server, depending on who sends and who receives the message 2039 body. 2041 9.1. Message-Body Header Fields 2043 Message-body header fields define meta-information about the content 2044 data in the message body. The message-body header fields are listed 2045 in Table 6. 2047 +------------------+--------------------+ 2048 | Header | Defined in Section | 2049 +------------------+--------------------+ 2050 | Allow | Section 16.6 | 2051 | | | 2052 | Content-Base | Section 16.13 | 2053 | | | 2054 | Content-Encoding | Section 16.14 | 2055 | | | 2056 | Content-Language | Section 16.15 | 2057 | | | 2058 | Content-Length | Section 16.16 | 2059 | | | 2060 | Content-Location | Section 16.17 | 2061 | | | 2062 | Content-Type | Section 16.18 | 2063 | | | 2064 | Expires | Section 16.21 | 2065 | | | 2066 | Last-Modified | Section 16.26 | 2067 +------------------+--------------------+ 2069 Table 6: The RTSP message-body headers 2071 The extension-header mechanism allows additional message-body header 2072 fields to be defined without changing the protocol, but these fields 2073 cannot be assumed to be recognizable by the recipient. Unrecognized 2074 header fields MUST be ignored by the recipient and forwarded by 2075 proxies. 2077 9.2. Message Body 2079 An RTSP message with a message body MUST include the Content-Type and 2080 Content-Length headers. When a message body is included with a 2081 message, the data type of that content data is determined via the 2082 header fields Content-Type and Content-Encoding. 2084 Content-Type specifies the media type of the underlying data. 2085 Content-Encoding may be used to indicate any additional content 2086 codings applied to the data, usually for the purpose of data 2087 compression, that are a property of the requested resource. There is 2088 no default encoding. 2090 The Content-Length of a message is the length of the content, 2091 measured in bytes. 2093 10. Connections 2095 RTSP requests can be transmitted using the two different connection 2096 scenarios listed below: 2098 o persistent - a transport connection is used for several request/ 2099 response transactions; 2101 o transient - a transport connection is used for a single request/ 2102 response transaction. 2104 RFC 2326 attempted to specify an optional mechanism for transmitting 2105 RTSP messages in connectionless mode over a transport protocol such 2106 as UDP. However, it was not specified in sufficient detail to allow 2107 for interoperable implementations. In an attempt to reduce 2108 complexity and scope, and due to lack of interest, RTSP 2.0 does not 2109 attempt to define a mechanism for supporting RTSP over UDP or other 2110 connectionless transport protocols. A side-effect of this is that 2111 RTSP requests MUST NOT be sent to multicast groups since no 2112 connection can be established with a specific receiver in multicast 2113 environments. 2115 Certain RTSP headers, such as the CSeq header (Section 16.19), which 2116 may appear to be relevant only to connectionless transport scenarios 2117 are still retained and MUST be implemented according to the 2118 specification. In the case of CSeq, it is quite useful for matching 2119 responses to requests if the requests are pipelined (see Section 12). 2120 It is also useful in proxies for keeping track of the different 2121 requests when aggregating several client requests on a single TCP 2122 connection. 2124 10.1. Reliability and Acknowledgements 2126 Since RTSP messages are transmitted using reliable transport 2127 protocols, they MUST NOT be retransmitted at the RTSP protocol level. 2128 Instead, the implementation must rely on the underlying transport to 2129 provide reliability. The RTSP implementation may use any indication 2130 of reception acknowledgment of the message from the underlying 2131 transport protocols to optimize the RTSP behavior. 2133 If both the underlying reliable transport such as TCP and the RTSP 2134 application retransmit requests, each packet loss or message loss 2135 may result in two retransmissions. The receiver typically cannot 2136 take advantage of the application-layer retransmission since the 2137 transport stack will not deliver the application-layer 2138 retransmission before the first attempt has reached the receiver. 2139 If the packet loss is caused by congestion, multiple 2140 retransmissions at different layers will exacerbate the 2141 congestion. 2143 Lack of acknowledgment of an RTSP request should be handled within 2144 the constraints of the connection timeout considerations described 2145 below (Section 10.4). 2147 10.2. Using Connections 2149 A TCP transport can be used for both persistent connections (for 2150 several message exchanges) and transient connections (for a single 2151 message exchange). Implementations of this specification MUST 2152 support RTSP over TCP. The scheme of the RTSP URI (Section 4.2) 2153 indicates the default port that the server will listen on if the port 2154 is not explicitly given. 2156 A server MUST handle both persistent and transient connections. 2158 Transient connections facilitate mechanisms for fault tolerance. 2159 They also allow for application layer mobility. A server and 2160 client pair that support transient connections can survive the 2161 loss of a TCP connection; e.g., due to a NAT timeout. When the 2162 client has discovered that the TCP connection has been lost, it 2163 can set up a new one when there is need to communicate again. 2165 A persistent connection is RECOMMENDED to be used for all 2166 transactions between the server and client, including messages for 2167 multiple RTSP sessions. However, a persistent connection MAY be 2168 closed after a few message exchanges. For example, a client may use 2169 a persistent connection for the initial SETUP and PLAY message 2170 exchanges in a session and then close the connection. Later, when 2171 the client wishes to send a new request, such as a PAUSE for the 2172 session, a new connection would be opened. This connection may 2173 either be transient or persistent. 2175 An RTSP agent SHOULD NOT have more than one connection to the server 2176 at any given point. If a client or proxy handles multiple RTSP 2177 sessions on the same server, it SHOULD use only one connection for 2178 managing those sessions. 2180 This saves connection resources on the server. It also reduces 2181 complexity by enabling the server to maintain less state about its 2182 sessions and connections. 2184 RTSP allows a server to send requests to a client. However, this can 2185 be supported only if a client establishes a persistent connection 2186 with the server. In cases where a persistent connection does not 2187 exist between a server and its client, due to the lack of a signaling 2188 channel the server may be forced to silently discard RTSP messages, 2189 and may even drop an RTSP session without notifying the client. An 2190 example of such a case is when the server desires to send a REDIRECT 2191 request for an RTSP session to the client but is not able to do so 2192 because it cannot reach the client. A server that attempts to send a 2193 request to a client that has no connection currently to the server 2194 SHOULD discard the request directly, but it MAY queue it for later 2195 delivery. However, if the server queues the request it SHOULD when 2196 adding additional requests to the queue ensure to remove older 2197 requests that are now redundant. 2199 Without a persistent connection between the client and the server, 2200 the media server has no reliable way of reaching the client. 2201 Because the likely failure of server to client established 2202 connections the server will not even attempt establishing any 2203 connection. 2205 The sending of client and server requests can be asynchronous events. 2206 To avoid deadlock situations both client and server MUST be able to 2207 send and receive requests simultaneously. As an RTSP response may be 2208 queued up for transmission, reception or processing behind the peer 2209 RTSP agent's own requests, all RTSP agents are required to have a 2210 certain capability of handling outstanding messages. A potential 2211 issue is that outstanding requests may timeout despite them being 2212 processed by the peer due to the response is caught in the queue 2213 behind a number of request that the RTSP agent is processing but that 2214 take some time to complete. To avoid this problem an RTSP agent is 2215 recommended to buffer incoming messages locally so that any response 2216 messages can be processed immediately upon reception. If responses 2217 are separated from requests and directly forwarded for processing, 2218 not only can the result be used immediately, the state associated 2219 with that outstanding request can also be released. However, 2220 buffering a number of requests on the receiving RTSP agent consumes 2221 resources and enables a resource exhaustion attack on the agent. 2222 Therefore this buffer should be limited so that an unreasonable 2223 number of requests or total message size is not allowed to consume 2224 the receiving agent's resources. In most APIs, having the receiving 2225 agent stop reading from the TCP socket will result in TCP's window 2226 being clamped. Thus forcing the buffering onto the sending agent 2227 when the load is larger than expected. However, as both RTSP message 2228 sizes and frequency may be changed in the future by protocol 2229 extensions, an agent should be careful against taking harsher 2230 measurements against a potential attack. When under attack an RTSP 2231 agent can close TCP connections and release state associated with 2232 that TCP connection. 2234 To provide some guidance on what is reasonable the following 2235 guidelines are given. It is RECOMMENDED that: 2237 o an RTSP agent should not have more than 10 outstanding requests 2238 per RTSP session; 2240 o an RTSP agent should not have more than 10 outstanding requests 2241 that are not related to an RTSP session or that are requesting to 2242 create an RTSP session. 2244 In light of the above, it is RECOMMENDED that clients use persistent 2245 connections whenever possible. A client that supports persistent 2246 connections MAY "pipeline" its requests (see Section 12). 2248 10.3. Closing Connections 2250 The client MAY close a connection at any point when no outstanding 2251 request/response transactions exist for any RTSP session being 2252 managed through the connection. The server, however, SHOULD NOT 2253 close a connection until all RTSP sessions being managed through the 2254 connection have been timed out (Section 16.47). A server SHOULD NOT 2255 close a connection immediately after responding to a session-level 2256 TEARDOWN request for the last RTSP session being controlled through 2257 the connection. Instead, it should wait for a reasonable amount of 2258 time for the client to receive the TEARDOWN response, take 2259 appropriate action, and initiate the connection closing. The server 2260 SHOULD wait at least 10 seconds after sending the TEARDOWN response 2261 before closing the connection. 2263 This is to ensure that the client has time to issue a SETUP for a 2264 new session on the existing connection after having torn the last 2265 one down. 10 seconds should give the client ample opportunity to 2266 get its message to the server. 2268 A server SHOULD NOT close the connection directly as a result of 2269 responding to a request with an error code. 2271 Certain error responses such as "460 Only Aggregate Operation 2272 Allowed" (Section 15.4.25) are used for negotiating capabilities 2273 of a server with respect to content or other factors. In such 2274 cases, it is inefficient for the server to close a connection on 2275 an error response. Also, such behavior would prevent 2276 implementation of advanced/special types of requests or result in 2277 extra overhead for the client when testing for new features. On 2278 the flip side, keeping connections open after sending an error 2279 response poses a Denial of Service security risk (Section 21). 2281 The server MAY close a connection if it receives an incomplete 2282 message and if the message is not completed within a reasonable 2283 amount of time. It is RECOMMENDED that the server waits at least 10 2284 seconds for the completion of a message or for the next part of the 2285 message to arrive (which is an indication that the transport and the 2286 client are still alive). Servers believing they are under attack or 2287 otherwise starved for resources during that event MAY consider using 2288 a shorter timeout. 2290 If a server closes a connection while the client is attempting to 2291 send a new request, the client will have to close its current 2292 connection, establish a new connection and send its request over the 2293 new connection. 2295 An RTSP message SHOULD NOT be terminated by closing the connection. 2296 Such a message MAY be considered to be incomplete by the receiver and 2297 discarded. An RTSP message is properly terminated as defined in 2298 Section 5. 2300 10.4. Timing Out Connections and RTSP Messages 2302 Receivers of a request (responder) SHOULD respond to requests in a 2303 timely manner even when a reliable transport such as TCP is used. 2304 Similarly, the sender of a request (requester) SHOULD wait for a 2305 sufficient time for a response before concluding that the responder 2306 will not be acting upon its request. 2308 A responder SHOULD respond to all requests within 5 seconds. If the 2309 responder recognizes that processing of a request will take longer 2310 than 5 seconds, it SHOULD send a 100 (Continue) response as soon as 2311 possible. It SHOULD continue sending a 100 response every 5 seconds 2312 thereafter until it is ready to send the final response to the 2313 requester. After sending a 100 response, the receiver MUST send a 2314 final response indicating the success or failure of the request. 2316 A requester SHOULD wait at least 10 seconds for a response before 2317 concluding that the responder will not be responding to its request. 2318 After receiving a 100 response, the requester SHOULD continue waiting 2319 for further responses. If more than 10 seconds elapses without 2320 receiving any response, the requester MAY assume that the responder 2321 is unresponsive and abort the connection. 2323 A requester SHOULD wait longer than 10 seconds for a response if it 2324 is experiencing significant transport delays on its connection to the 2325 responder. The requester is capable of determining the RTT of the 2326 request/response cycle using the Timestamp header (Section 16.51) in 2327 any RTSP request. 2329 10 seconds was chosen for the following reasons. It gives TCP 2330 time to perform a couple of retransmissions, even if operating on 2331 default values. It is short enough that users may not abandon the 2332 process themselves. However, it should be noted that 10 seconds 2333 can be aggressive on certain type of networks. The 5 seconds 2334 value for 1xx messages is half the timeout giving a reasonable 2335 change of successful delivery before timeout happens on the 2336 requester side. 2338 10.5. Showing Liveness 2340 The mechanisms for showing liveness of the client is, any RTSP 2341 request with a Session header, if RTP & RTCP is used an RTCP message, 2342 or through any other used media protocol capable of indicating 2343 liveness of the RTSP client. It is RECOMMENDED that a client does 2344 not wait to the last second of the timeout before trying to send a 2345 liveness message. The RTSP message may be lost or when using 2346 reliable protocols, such as TCP, the message may take some time to 2347 arrive safely at the receiver. To show liveness between RTSP request 2348 issued to accomplish other things, the following mechanisms can be 2349 used, in descending order of preference: 2351 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 2352 RTCP is used to report transport statistics, it MUST also work 2353 as keep alive. The server can determine the client by network 2354 address and port together with the fact that the client is 2355 reporting on the servers SSRC(s). A downside of using RTCP is 2356 that it only gives statistical guarantees to reach the server. 2357 However, the probability of a false client timeout is so low 2358 that it can be ignored in most cases. For example, assume a 2359 session with 60 seconds timeout and enough bitrate assigned to 2360 RTCP messages to send a message from client to server on 2361 average every 5 seconds. That client has, for a network with 5 2362 % packet loss, the probability to fail showing liveness sign in 2363 that session within the timeout interval of 2.4*E-16. Sessions 2364 with shorter timeouts, or much higher packet loss, or small 2365 RTCP bandwidths SHOULD also use any of the mechanisms below. 2367 SET_PARAMETER: When using SET_PARAMETER for keep alive, no body 2368 SHOULD be included. This method is the RECOMMENDED RTSP method 2369 to use for a request intended only to perform keep-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 support was not present in RTSP 1.0 (RFC 2326). RTSP 2392 2.0 has been updated for explicit IPv6 support. Implementations of 2393 RTSP 2.0 MUST understand literal IPv6 addresses in URIs and headers. 2395 10.7. Overload Control 2397 Overload in RTSP can occur when servers and proxies have insufficient 2398 resources to complete the processing of a request. An improper 2399 handling of such an overload situation at proxies and servers can 2400 impact the operation of the RTSP deployment, and probably worsen the 2401 situation. RTSP defines the 503 (Service Unavailable) response 2402 (Section 15.5.4) to let servers and proxies notify requesting proxies 2403 and RTSP clients about an overload situation. In conjunction with 2404 the Retry-After header (Section 16.42) the server or proxy can 2405 indicate the time after the requesting entity can send another 2406 request to the proxy or server. 2408 Simply implementing and using the 503 (Service Unavailable) is not 2409 sufficient for properly handling overload situations. For instance, 2410 a simplistic approach would be to send the 503 response with a Retry- 2411 After header set to a fixed value. However, this can cause the 2412 situation where multiple RTSP clients again send requests to a proxy 2413 or server at roughly the same time which may again cause an overload 2414 situation, or if the "old" overload situation is not yet solved, 2415 i.e., the length indicated in the Retry-After header was too short. 2417 An RTSP server or proxy in an overload situation must select the 2418 value of the Retry-After header carefully and in dependency of its 2419 current load situation. It is RECOMMENDED to increase the length 2420 proportional with the current load of the server, i.e., an increasing 2421 workload should result in an increased length of the indicated 2422 unavailability. It is RECOMMENDED to not send the same value in the 2423 Retry-After header to all requesting proxies and clients, but to add 2424 a variation to the mean value of the Retry-After header. 2426 Another issue are load balancing RTSP proxies, i.e., where an RTSP 2427 proxy is used to select amongst a set of RTSP servers to handle the 2428 requests, or when multiple server addresses are available for a given 2429 server name. The proxy or client may receive a 503 (Service 2430 Unavailable) from one of its RTSP servers or a TCP timeout (if the 2431 server is even unable to handled the request message). The proxy or 2432 client simply retries the other addresses, but may also receive a 503 2433 (Service Unavailable) response or TCP timeouts from those addresses. 2434 In such a situation, where none of the RTSP servers/addresses can 2435 handle the request, the RTSP agent has to wait before it can send any 2436 new requests to the RTSP server. Any additional request to a 2437 specific address MUST be delayed according to the Retry-After headers 2438 received. For addresses where no response was received or TCP 2439 timeout occurred, an initial wait timer SHOULD be set to 5 seconds. 2440 That timer MUST be doubled for each additional failure to connect or 2441 receive response. It is RECOMMENDED to not set the same value in the 2442 timer, but to add a variation to the mean value. 2444 11. Capability Handling 2446 This section describes the available capability handling mechanism 2447 which allows RTSP to be extended. Extensions to this version of the 2448 protocol are basically done in two ways. First, new headers can be 2449 added. Secondly, new methods can be added. The capability handling 2450 mechanism is designed to handle both cases. 2452 When a method is added, the involved parties can use the OPTIONS 2453 method to discover whether it is supported. This is done by issuing 2454 an OPTIONS request to the other party. Depending on the URI it will 2455 either apply in regards to a certain media resource, the whole server 2456 in general, or simply the next hop. The OPTIONS response MUST 2457 contain a Public header which declares all methods supported for the 2458 indicated resource. 2460 It is not necessary to use OPTIONS to discover support of a method, 2461 as the client could simply try the method. If the receiver of the 2462 request does not support the method it will respond with an error 2463 code indicating the method is either not implemented (501) or does 2464 not apply for the resource (405). The choice between the two 2465 discovery methods depends on the requirements of the service. 2467 Feature-Tags are defined to handle functionality additions that are 2468 not new methods. Each feature-tag represents a certain block of 2469 functionality. The amount of functionality that a feature-tag 2470 represents can vary significantly. A feature-tag can for example 2471 represent the functionality a single RTSP header provides. Another 2472 feature-tag can represent much more functionality, such as the 2473 "play.basic" feature-tag which represents the minimal media delivery 2474 for playback implementation. 2476 Feature-tags are used to determine whether the client, server or 2477 proxy supports the functionality that is necessary to achieve the 2478 desired service. To determine support of a feature-tag, several 2479 different headers can be used, each explained below: 2481 Supported: This header is used to determine the complete set of 2482 functionality that both client and server have. The intended 2483 usage is to determine before one needs to use a functionality 2484 that it is supported. It can be used in any method, but 2485 OPTIONS is the most suitable one as it at the same time 2486 determines all methods that are implemented. When sending a 2487 request the requester declares all its capabilities by 2488 including all supported feature-tags. This results in the 2489 receiver learns the requester's feature support. The receiver 2490 then includes its set of features in the response. 2492 Proxy-Supported: This header is used similarly to the Supported 2493 header, but instead of giving the supported functionality of 2494 the client or server it provides both the requester and the 2495 responder a view of what functionality the proxy chain between 2496 the two supports. Proxies are required to add this header 2497 whenever the Supported header is present, but proxies may also 2498 add it independently of the requester. 2500 Require: This header can be included in any request where the end- 2501 point, i.e. the client or server, is required to understand the 2502 feature to correctly perform the request. This can, for 2503 example, be a SETUP request where the server is required to 2504 understand a certain parameter to be able to set up the media 2505 delivery correctly. Ignoring this parameter would not have the 2506 desired effect and is not acceptable. Therefore the end-point 2507 receiving a request containing a Require MUST negatively 2508 acknowledge any feature that it does not understand and not 2509 perform the request. The response in cases where features are 2510 not supported are 551 (Option Not Supported). Also the 2511 features that are not supported are given in the Unsupported 2512 header in the response. 2514 Proxy-Require: This header has the same purpose and workings as 2515 Require except that it only applies to proxies and not the end- 2516 point. Features that need to be supported by both proxies and 2517 end-points need to be included in both the Require and Proxy- 2518 Require header. 2520 Unsupported: This header is used in a 551 error response, to 2521 indicate which features were not supported. Such a response is 2522 only the result of the usage of the Require and/or Proxy- 2523 Require header where one or more feature where not supported. 2524 This information allows the requester to make the best of 2525 situations as it knows which features are not supported. 2527 12. Pipelining Support 2529 Pipelining is a general method to improve performance of request 2530 response protocols by allowing the requesting agent to have more than 2531 one request outstanding and send them over the same persistent 2532 connection. For RTSP, where the relative order of requests will 2533 matter, it is important to maintain the order of the requests. 2534 Because of this, the responding agent MUST process the incoming 2535 requests in their sending order. The sending order can be determined 2536 by the CSeq header and its sequence number. For TCP the delivery 2537 order will be the same as the sending order. The processing of the 2538 request MUST also have been finished before processing the next 2539 request from the same agent. The responses MUST be sent in the order 2540 the requests were processed. 2542 RTSP 2.0 has extended support for pipelining compared to RTSP 1.0. 2543 The major improvement is to allow all requests to setup and initiate 2544 media delivery to be pipelined after each other. This is 2545 accomplished by the utilization of the Pipelined-Requests header (see 2546 Section 16.32). This header allows a client to request that two or 2547 more requests are processed in the same RTSP session context which 2548 the first request creates. In other words, a client can request that 2549 two or more media streams are set-up and then played without needing 2550 to wait for a single response. This speeds up the initial startup 2551 time for an RTSP session with at least one RTT. 2553 If a pipelined request builds on the successful completion of one or 2554 more prior requests the requester must verify that all requests were 2555 executed as expected. A common example will be two SETUP requests 2556 and a PLAY request. In case one of the SETUP fails unexpectedly, the 2557 PLAY request can still be successfully executed. However, the 2558 resulting presentation will not be as expected by the requesting 2559 client, as only a single media instead of two will be played. In 2560 this case the client can send a PAUSE request, correct the failing 2561 SETUP request and then request it to be played. 2563 13. Method Definitions 2565 The method indicates what is to be performed on the resource 2566 identified by the Request-URI. The method name is case-sensitive. 2567 New methods may be defined in the future. Method names MUST NOT 2568 start with a $ character (decimal 36) and MUST be a token as defined 2569 by the ABNF [RFC5234] in the syntax chapter Section 20. The methods 2570 are summarized in Table 7. 2572 +---------------+-----------+--------+-------------+-------------+ 2573 | method | direction | object | Server req. | Client req. | 2574 +---------------+-----------+--------+-------------+-------------+ 2575 | DESCRIBE | C -> S | P,S | recommended | recommended | 2576 | | | | | | 2577 | GET_PARAMETER | C -> S | P,S | optional | optional | 2578 | | | | | | 2579 | | S -> C | P,S | optional | optional | 2580 | | | | | | 2581 | OPTIONS | C -> S | P,S | required | required | 2582 | | | | | | 2583 | | S -> C | P,S | optional | optional | 2584 | | | | | | 2585 | PAUSE | C -> S | P,S | required | required | 2586 | | | | | | 2587 | PLAY | C -> S | P,S | required | required | 2588 | | | | | | 2589 | PLAY_NOTIFY | S -> C | P,S | required | required | 2590 | | | | | | 2591 | REDIRECT | S -> C | P,S | optional | required | 2592 | | | | | | 2593 | SETUP | C -> S | S | required | required | 2594 | | | | | | 2595 | SET_PARAMETER | C -> S | P,S | required | optional | 2596 | | | | | | 2597 | | S -> C | P,S | optional | optional | 2598 | | | | | | 2599 | TEARDOWN | C -> S | P,S | required | required | 2600 | | | | | | 2601 | | S -> C | P | required | required | 2602 +---------------+-----------+--------+-------------+-------------+ 2604 Table 7: Overview of RTSP methods, their direction, and what objects 2605 (P: presentation, S: stream) they operate on. 2607 Note on Table 7: GET_PARAMETER is optional. For example, a fully 2608 functional server can be built to deliver media without any 2609 parameters. SET_PARAMETER is required, however, due to its usage 2610 for keep-alive. PAUSE is now required because it is the only way 2611 of leaving the Play state without terminating the whole session. 2613 If an RTSP agent does not support a particular method, it MUST return 2614 501 (Not Implemented) and the requesting RTSP agent, in turn, SHOULD 2615 NOT try this method again for the given agent / resource combination. 2616 An RTSP proxy whose main function is to log or audit and not modify 2617 transport or media handling in any way MAY forward RTSP messages with 2618 unknown methods. Note that the proxy still needs to perform the 2619 minimal required processing, like adding the Via header. 2621 13.1. OPTIONS 2623 The semantics of the RTSP OPTIONS method is similar to that of the 2624 HTTP OPTIONS method described in [H9.2]. In RTSP however, OPTIONS is 2625 bi-directional, in that a client can request it to a server and vice 2626 versa. A client MUST implement the capability to send an OPTIONS 2627 request and a server or a proxy MUST implement the capability to 2628 respond to an OPTIONS request. The client, server or proxy MAY also 2629 implement the converse of their required capability, but still retain 2630 the prior mentioned about what is a "MUST implement". 2632 An OPTIONS request may be issued at any time. Such a request does 2633 not modify the session state. However, it may prolong the session 2634 lifespan (see below). The URI in an OPTIONS request determines the 2635 scope of the request and the corresponding response. If the Request- 2636 URI refers to a specific media resource on a given host, the scope is 2637 limited to the set of methods supported for that media resource by 2638 the indicated RTSP agent. A Request-URI with only the host address 2639 limits the scope to the specified RTSP agent's general capabilities 2640 without regard to any specific media. If the Request-URI is an 2641 asterisk ("*"), the scope is limited to the general capabilities of 2642 the next hop (i.e. the RTSP agent in direct communication with the 2643 request sender). 2645 Regardless of scope of the request, the Public header MUST always be 2646 included in the OPTIONS response listing the methods that are 2647 supported by the responding RTSP agent. In addition, if the scope of 2648 the request is limited to a media resource, the Allow header MUST be 2649 included in the response to enumerate the set of methods that are 2650 allowed for that resource unless the set of methods completely 2651 matches the set in the Public header. If the given resource is not 2652 available, the RTSP agent SHOULD return an appropriate response code 2653 such as 3rr or 4xx. The Supported header MAY be included in the 2654 request to query the set of features that are supported by the 2655 responding RTSP agent. 2657 The OPTIONS method can be used to keep an RTSP session alive. 2658 However, this is not the preferred way of session keep-alive 2659 signaling, see Section 16.47. An OPTIONS request intended for 2660 keeping alive an RTSP session MUST include the Session header with 2661 the associated session ID. Such a request SHOULD also use the media 2662 or the aggregated control URI as the Request-URI. 2664 Example: 2666 C->S: OPTIONS rtsp://server.example.com RTSP/2.0 2667 CSeq: 1 2668 User-Agent: PhonyClient/1.2 2669 Proxy-Require: gzipped-messages 2670 Supported: play.basic 2672 S->C: RTSP/2.0 200 OK 2673 CSeq: 1 2674 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS 2675 Supported: play.basic, setup.rtp.rtcp.mux, play.scale 2676 Server: PhonyServer/1.1 2678 Note that some of the feature-tags in Supported and Proxy-Require are 2679 fictional features. 2681 13.2. DESCRIBE 2683 The DESCRIBE method is used to retrieve the description of a 2684 presentation or media object from a server. The Request-URI of the 2685 DESCRIBE request identifies the media resource of interest. The 2686 client MAY include the Accept header in the request to list the 2687 description formats that it understands. The server MUST respond 2688 with a description of the requested resource and return the 2689 description in the message body of the response, if the DESCRIBE 2690 method request can be successfully fulfilled. The DESCRIBE reply- 2691 response pair constitutes the media initialization phase of RTSP. 2693 The DESCRIBE response SHOULD contain all media initialization 2694 information for the resource(s) that it describes. Servers SHOULD 2695 NOT use the DESCRIBE response as a means of media indirection by 2696 having the description point at another server; instead, using the 2697 3rr responses is RECOMMENDED. 2699 By forcing a DESCRIBE response to contain all media initialization 2700 information for the set of streams that it describes, and 2701 discouraging the use of DESCRIBE for media indirection, any 2702 looping problems can be avoided that might have resulted from 2703 other approaches. 2705 Example: 2707 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/2.0 2708 CSeq: 312 2709 User-Agent: PhonyClient/1.2 2710 Accept: application/sdp, application/example 2712 S->C: RTSP/2.0 200 OK 2713 CSeq: 312 2714 Date: Thu, 23 Jan 1997 15:35:06 GMT 2715 Server: PhonyServer/1.1 2716 Content-Base: rtsp://server.example.com/fizzle/foo/ 2717 Content-Type: application/sdp 2718 Content-Length: 358 2720 v=0 2721 o=mhandley 2890844526 2890842807 IN IP4 192.0.2.46 2722 s=SDP Seminar 2723 i=A Seminar on the session description protocol 2724 u=http://www.example.com/lectures/sdp.ps 2725 e=seminar@example.com (Seminar Management) 2726 c=IN IP4 0.0.0.0 2727 a=control:* 2728 t=2873397496 2873404696 2729 m=audio 3456 RTP/AVP 0 2730 a=control:audio 2731 m=video 2232 RTP/AVP 31 2732 a=control:video 2734 Media initialization is a requirement for any RTSP-based system, but 2735 the RTSP specification does not dictate that this is required to be 2736 done via the DESCRIBE method. There are three ways that an RTSP 2737 client may receive initialization information: 2739 o via an RTSP DESCRIBE request 2741 o via some other protocol (HTTP, email attachment, etc.) 2743 o via some form of user interface 2745 If a client obtains a valid description from an alternate source, the 2746 client MAY use this description for initialization purposes without 2747 issuing a DESCRIBE request for the same media. The client should use 2748 any MTag to either validate the presentation description or make the 2749 session establishment conditional on being valid. 2751 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2752 and highly recommended that minimal clients support the ability to 2753 act as "helper applications" that accept a media initialization file 2754 from a user interface, and/or other means that are appropriate to the 2755 operating environment of the clients. 2757 13.3. SETUP 2759 Note: The states described in this section and the following are 2760 described in detail in Appendix B. 2762 The SETUP request for an URI specifies the transport mechanism to be 2763 used for the streamed media. The SETUP method may be used in two 2764 different cases; Create an RTSP session and change the transport 2765 parameters of already set up media stream. SETUP can be used in all 2766 three states; Init, and Ready, for both purposes and in PLAY to 2767 change the transport parameters. There is also a third possible 2768 usage for the SETUP method which is not specified in this memo: 2769 adding a media to a session. Using SETUP to add media to an existing 2770 session, when the session is in Play state, is unspecified. 2772 The Transport header, see Section 16.52, specifies the media 2773 transport parameters acceptable to the client for data transmission; 2774 the response will contain the transport parameters selected by the 2775 server. This allows the client to enumerate in descending order of 2776 preference the transport mechanisms and parameters acceptable to it, 2777 while the server can select the most appropriate. It is expected 2778 that the session description format used will enable the client to 2779 select a limited number of possible configurations that are offered 2780 to the server to choose from. All transport related parameters SHALL 2781 be included in the Transport header; the use of other headers for 2782 this purpose is NOT RECOMMENDED due to middleboxes, such as firewalls 2783 or NATs. 2785 For the benefit of any intervening firewalls, a client MUST indicate 2786 the known transport parameters, even if it has no influence over 2787 these parameters, for example, where the server advertises a fixed 2788 multicast address as destination. 2790 Since SETUP includes all transport initialization information, 2791 firewalls and other intermediate network devices (which need this 2792 information) are spared the more arduous task of parsing the 2793 DESCRIBE response, which has been reserved for media 2794 initialization. 2796 The client MUST include the Accept-Ranges header in the request 2797 indicating all supported unit formats in the Range header. This 2798 allows the server to know which formats it may use in future session 2799 related responses, such as a PLAY response without any range in the 2800 request. If the client does not support a time format necessary for 2801 the presentation the server MUST respond using 456 (Header Field Not 2802 Valid for Resource) and include the Accept-Ranges header with the 2803 range unit formats supported for the resource. 2805 In a SETUP response the server MUST include the Accept-Ranges header 2806 (see Section 16.5) to indicate which time formats are acceptable to 2807 use for this media resource. 2809 The SETUP response 200 OK MUST include the Media-Properties header 2810 (see Section 16.28 ). The combination of the parameters of the 2811 Media-Properties header indicates the nature of the content present 2812 in the session (see also Section 4.9). For example, a live stream 2813 with time shifting is indicated by 2815 o Random Access set to Random-Access, 2817 o Content Modifications set to Time Progressing, 2819 o Retention set to Time-Duration (with specific recording window 2820 time value). 2822 The SETUP response 200 OK MUST include the Media-Range header (see 2823 Section 16.29) if the media is Time-Progressing. 2825 A basic example for SETUP: 2827 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 2828 CSeq: 302 2829 Transport: RTP/AVP;unicast;dest_addr=":4588"/":4589", 2830 RTP/AVP/TCP;unicast;interleaved=0-1 2831 Accept-Ranges: NPT, UTC 2832 User-Agent: PhonyClient/1.2 2834 S->C: RTSP/2.0 200 OK 2835 CSeq: 302 2836 Date: Thu, 23 Jan 1997 15:35:06 GMT 2837 Server: PhonyServer/1.1 2838 Session: 47112344;timeout=60 2839 Transport: RTP/AVP;unicast;dest_addr="192.0.2.53:4588"/ 2840 "192.0.2.53:4589"; src_addr="198.51.100.241:6256"/ 2841 "198.51.100.241:6257"; ssrc=2A3F93ED 2842 Accept-Ranges: NPT 2843 Media-Properties: Random-Access=3.2, Time-Progressing, 2844 Time-Duration=3600.0 2845 Media-Range: npt=0-2893.23 2847 In the above example the client wants to create an RTSP session 2848 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2849 The transport parameters acceptable to the client are either RTP/AVP/ 2850 UDP (UDP per default) to be received on client port 4588 and 4589 at 2851 the address the RTSP setup connection comes from or RTP/AVP 2852 interleaved on the RTSP control channel. The server selects the RTP/ 2853 AVP/UDP transport and adds the address and ports it will send and 2854 receive RTP and RTCP from, and the RTP SSRC that will be used by the 2855 server. 2857 The server MUST generate a session identifier in response to a 2858 successful SETUP request, unless a SETUP request to a server includes 2859 a session identifier or a Pipelined-Requests header referencing an 2860 existing session context, in which case the server MUST bundle this 2861 setup request into the existing session (aggregated session) or 2862 return error 459 (Aggregate Operation Not Allowed) (see 2863 Section 15.4.24). An Aggregate control URI MUST be used to control 2864 an aggregated session. This URI MUST be different from the stream 2865 control URIs of the individual media streams included in the 2866 aggregate (see Section 13.4.2 for aggregated sessions and for the 2867 particular URIs see Appendix D.1.1). The Aggregate control URI is to 2868 be specified by the session description if the server supports 2869 aggregated control and aggregated control is desired for the session. 2870 However, even if aggregated control is offered the client MAY chose 2871 to not set up the session in aggregated control. If an Aggregate 2872 control URI is not specified in the session description, it is 2873 normally an indication that non-aggregated control should be used. 2874 The SETUP of media streams in an aggregate which has not been given 2875 an aggregated control URI is unspecified. 2877 While the session ID sometimes carries enough information for 2878 aggregate control of a session, the Aggregate control URI is still 2879 important for some methods such as SET_PARAMETER where the control 2880 URI enables the resource in question to be easily identified. The 2881 Aggregate control URI is also useful for proxies, enabling them to 2882 route the request to the appropriate server, and for logging, 2883 where it is useful to note the actual resource that a request was 2884 operating on. 2886 A session will exist until it is either removed by a TEARDOWN request 2887 or is timed-out by the server. The server MAY remove a session that 2888 has not demonstrated liveness signs from the client(s) within a 2889 certain timeout period. The default timeout value is 60 seconds; the 2890 server MAY set this to a different value and indicate so in the 2891 timeout field of the Session header in the SETUP response. For 2892 further discussion see Section 16.47. Signs of liveness for an RTSP 2893 session are: 2895 o Any RTSP request from a client which includes a Session header 2896 with that session's ID. 2898 o If RTP is used as a transport for the underlying media streams, an 2899 RTCP sender or receiver report from the client(s) for any of the 2900 media streams in that RTSP session. RTCP Sender Reports may for 2901 example be received in sessions where the server is invited into a 2902 conference session and is valid for keep-alive. 2904 If a SETUP request on a session fails for any reason, the session 2905 state, as well as transport and other parameters for associated 2906 streams MUST remain unchanged from their values as if the SETUP 2907 request had never been received by the server. 2909 13.3.1. Changing Transport Parameters 2911 A client MAY issue a SETUP request for a stream that is already set 2912 up or playing in the session to change transport parameters, which a 2913 server MAY allow. If it does not allow changing of parameters, it 2914 MUST respond with error 455 (Method Not Valid In This State). The 2915 reasons to support changing transport parameters include allowing 2916 application layer mobility and flexibility to utilize the best 2917 available transport as it becomes available. If a client receives a 2918 455 when trying to change transport parameters while the server is in 2919 Play state, it MAY try to put the server in ready state using PAUSE, 2920 before issuing the SETUP request again. If that also fails the 2921 changing of transport parameters will require that the client 2922 performs a TEARDOWN of the affected media and then to set it up 2923 again. For an aggregated session avoiding tearing down all the media 2924 at the same time will avoid the creation of a new session. 2926 All transport parameters MAY be changed. However, the primary usage 2927 expected is to either change the transport protocol completely, like 2928 switching from Interleaved TCP mode to UDP or vice versa, or to 2929 change the delivery address. 2931 In a SETUP response for a request to change the transport parameters 2932 while in Play state, the server MUST include the Range to indicate at 2933 what point the new transport parameters will be used. Further, if 2934 RTP is used for delivery, the server MUST also include the RTP-Info 2935 header to indicate at what timestamp and RTP sequence number the 2936 change will take place. If both RTP-Info and Range are included in 2937 the response the "rtp_time" parameter and start point in the Range 2938 header MUST be for the corresponding time, i.e. be used in the same 2939 way as for PLAY to ensure the correct synchronization information is 2940 available. 2942 If the transport parameters change while in Play state results in a 2943 change of synchronization related information, for example changing 2944 RTP SSRC, the server MUST provide in the SETUP response the necessary 2945 synchronization information. However, the server is RECOMMENDED to 2946 avoid changing the synchronization information if possible. 2948 13.4. PLAY 2950 This section describes the usage of the PLAY method in general, for 2951 aggregated sessions, and in different usage scenarios. 2953 13.4.1. General Usage 2955 The PLAY method tells the server to start sending data via the 2956 mechanism specified in SETUP and which part of the media should be 2957 played out. PLAY requests are valid when the session is in Ready or 2958 Play states. A PLAY request MUST include a Session header to 2959 indicate which session the request applies to. 2961 Upon receipt of the PLAY request, the server MUST position the normal 2962 play time to the beginning of the range specified in the received 2963 Range header and deliver stream data until the end of the range if 2964 given, until a new PLAY request is received, or until the end of the 2965 media is reached. If no Range header is present in the PLAY request 2966 the server SHALL play from current pause point until the end of 2967 media. The pause point defaults at session start to the beginning of 2968 the media. For media that is time-progressing and has no retention, 2969 the pause point will always be set equal to NPT "now", i.e., the 2970 current delivery point. The pause point may also be set to a 2971 particular point in the media by the PAUSE method, see Section 13.6. 2972 The pause point for media that is currently playing is equal to the 2973 current media position. For time-progressing media with time-limited 2974 retention, if the pause point represents a position that is older 2975 than what is retained by the server, the pause point will be moved to 2976 the oldest retained. 2978 What range values are valid depends on the type of content. For 2979 content that isn't time progressing the range value is valid if the 2980 given range is part of any media within the aggregate. In other 2981 words the valid media range for the aggregate is the union of all of 2982 the media components in the aggregate. If a given range value points 2983 outside of the media, the response MUST be the 457 (Invalid Range) 2984 error code and include the Media-Range header (Section 16.29) with 2985 the valid range for the media. Except for time progressing content 2986 where the client requests a start point prior to what is retained, 2987 the start point is adjusted to the oldest retained content. For a 2988 start point that is beyond the media front edge, i.e. beyond the 2989 current value for "now", the server SHALL adjust the start value to 2990 the current front edge. The Range header's stop point value may 2991 point beyond the current media edge. In that case, the server SHALL 2992 deliver media from the requested (and possibly adjusted) start point 2993 until the provided stop point, or the end of the media is reached 2994 prior to the specified stop point. Please note that if one simply 2995 wants to play from a particular start point until the end of media 2996 using a Range header with an implicit stop point is RECOMMENDED. 2998 If a client requests to start playing at the end of media, either 2999 explicitly with a Range header or implicitly with a pause point that 3000 is at the end of media, a 457 (Invalid Range) error MUST be sent and 3001 include the Media-Range header (Section 16.29). It is specified 3002 below that the Range header also must be included in the response and 3003 that it will carry the pause point in the media, in the case of the 3004 session being in Ready State. Note that this also applies if the 3005 pause point or requested start point is at the beginning of the media 3006 and a Scale header (Section 16.44) is included with a negative value 3007 (playing backwards). 3009 For media with random access properties a client may express its 3010 preference on which policy for start point selection the server shall 3011 use. This is done by including the Seek-Style header (Section 16.45) 3012 in the PLAY request. The Seek-Style applied will effect the content 3013 of the Range header as it will be adjusted to indicate from what 3014 point the media actually is delivered. 3016 A client desiring to play the media from the beginning MUST send a 3017 PLAY request with a Range header pointing at the beginning, e.g. 3018 npt=0-. If a PLAY request is received without a Range header and 3019 media delivery has stopped at the end, the server SHOULD respond with 3020 a 457 "Invalid Range" error response. In that response, the current 3021 pause point MUST be included in a Range header. 3023 All range specifiers in this specification allow for ranges with an 3024 implicit start point (e.g. "npt=-30"). When used in a PLAY request, 3025 the server treats this as a request to start or resume delivery from 3026 the current pause point, ending at the end time specified in the 3027 Range header. If the pause point is located later than the given end 3028 value, a 457 (Invalid Range) response MUST be given. 3030 The example below will play seconds 10 through 25. It also requests 3031 the server to deliver media from the first Random Access Point prior 3032 to the indicated start point. 3034 C->S: PLAY rtsp://audio.example.com/audio RTSP/2.0 3035 CSeq: 835 3036 Session: 12345678 3037 Range: npt=10-25 3038 Seek-Style: RAP 3039 User-Agent: PhonyClient/1.2 3041 Servers MUST include a "Range" header in any PLAY response, even if 3042 no Range header was present in the request. The response MUST use 3043 the same format as the request's range header contained. If no Range 3044 header was in the request, the format used in any previous PLAY 3045 request within the session SHOULD be used. If no format has been 3046 indicated in a previous request the server MAY use any time format 3047 supported by the media and indicated in the Accept-Ranges header in 3048 the SETUP request. It is RECOMMENDED that NPT is used if supported 3049 by the media. 3051 For any error response to a PLAY request, the server's response 3052 depends on the current session state. If the session is in Ready 3053 state, the current pause-point is returned using Range header with 3054 the pause point as the explicit start-point and an implicit stop- 3055 point. For time-progressing content where the pause-point moves with 3056 real-time due to limited retention, the current pause point is 3057 returned. For sessions in Play state, the current playout point and 3058 the remaining parts of the range request is returned. For any media 3059 with retention longer than 0 seconds the currently valid Media-Range 3060 header SHALL also be included in the response. 3062 A PLAY response MAY include a header carrying synchronization 3063 information. As the information necessary is dependent on the media 3064 transport format, further rules specifying the header and its usage 3065 are needed. For RTP the RTP-Info header is specified, see 3066 Section 16.43, and used in the following example. 3068 Here is a simple example for a single audio stream where the client 3069 requests the media starting from 3.52 seconds and to the end. The 3070 server sends a 200 OK response with the actual play time which is 10 3071 ms prior (3.51) and the RTP-Info header that contains the necessary 3072 parameters for the RTP stack. 3074 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3075 CSeq: 836 3076 Session: 12345678 3077 Range: npt=3.52- 3078 User-Agent: PhonyClient/1.2 3080 S->C: RTSP/2.0 200 OK 3081 CSeq: 836 3082 Date: Thu, 23 Jan 1997 15:35:06 GMT 3083 Server: PhonyServer/1.0 3084 Range: npt=3.51-324.39 3085 Seek-Style: First-Prior 3086 RTP-Info:url="rtsp://example.com/audio" 3087 ssrc=0D12F123:seq=14783;rtptime=2345962545 3089 S->C: RTP Packet TS=2345962545 => NPT=3.51 3090 Media duration=0.16 seconds 3092 The server replies with the actual start point that will be 3093 delivered. This may differ from the requested range if alignment of 3094 the requested range to valid frame boundaries is required for the 3095 media source. Note that some media streams in an aggregate may need 3096 to be delivered from even earlier points. Also, some media formats 3097 have a very long duration per individual data unit, therefore it 3098 might be necessary for the client to parse the data unit, and select 3099 where to start. The server SHALL also indicate which policy it uses 3100 for selecting the actual start point by including a Seek-Style 3101 header. 3103 In the following example the client receives the first media packet 3104 that stretches all the way up and past the requested playtime. Thus, 3105 it is the client's decision whether to render to the user the time 3106 between 3.52 and 7.05, or to skip it. In most cases it is probably 3107 most suitable not to render that time period. 3109 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3110 CSeq: 836 3111 Session: 12345678 3112 Range: npt=7.05- 3113 User-Agent: PhonyClient/1.2 3115 S->C: RTSP/2.0 200 OK 3116 CSeq: 836 3117 Date: Thu, 23 Jan 1997 15:35:06 GMT 3118 Server: PhonyServer/1.0 3119 Range: npt=3.52- 3120 Seek-Style: First-Prior 3121 RTP-Info:url="rtsp://example.com/audio" 3122 ssrc=0D12F123:seq=14783;rtptime=2345962545 3124 S->C: RTP Packet TS=2345962545 => NPT=3.52 3125 Duration=4.15 seconds 3127 After playing the desired range, the presentation does NOT change to 3128 the Ready state, media delivery simply stops. A PAUSE request MUST 3129 be issued to make the stream enter the Ready state. A PLAY request 3130 while the stream is still in the Play state is legal, and can be 3131 issued without an intervening PAUSE request. Such a request MUST 3132 replace the current PLAY action with the new one requested, i.e. 3133 being handled the same as the request was received in Ready state. 3134 In the case the range in Range header has an implicit start time 3135 (-endtime), the server MUST continue to play from where it currently 3136 was until the specified end point. This is useful to change end at 3137 another point than in the previous request. 3139 The following example plays the whole presentation starting at SMPTE 3140 time code 0:10:20 until the end of the clip. Note: The RTP-Info 3141 headers has been broken into several lines, where following lines 3142 start with whitespace as allowed by the syntax. 3144 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/2.0 3145 CSeq: 833 3146 Session: 12345678 3147 Range: smpte=0:10:20- 3148 User-Agent: PhonyClient/1.2 3150 S->C: RTSP/2.0 200 OK 3151 CSeq: 833 3152 Date: Thu, 23 Jan 1997 15:35:06 GMT 3153 Session: 12345678 3154 Server: PhonyServer/1.0 3155 Range: smpte=0:10:22-0:15:45 3156 Seek-Style: Next 3157 RTP-Info:url="rtsp://example.com/twister.en" 3158 ssrc=0D12F123:seq=14783;rtptime=2345962545 3160 For playing back a recording of a live presentation, it may be 3161 desirable to use clock units: 3163 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/2.0 3164 CSeq: 835 3165 Session: 12345678 3166 Range: clock=19961108T142300Z-19961108T143520Z 3167 User-Agent: PhonyClient/1.2 3169 S->C: RTSP/2.0 200 OK 3170 CSeq: 835 3171 Date: Thu, 23 Jan 1997 15:35:06 GMT 3172 Session: 12345678 3173 Server: PhonyServer/1.0 3174 Range: clock=19961108T142300Z-19961108T143520Z 3175 Seek-Style: Next 3176 RTP-Info:url="rtsp://example.com/meeting.en" 3177 ssrc=0D12F123:seq=53745;rtptime=484589019 3179 13.4.2. Aggregated Sessions 3181 PLAY requests can operate on sessions controlling a single media and 3182 on aggregated sessions controlling multiple media. 3184 In an aggregated session the PLAY request MUST contain an aggregated 3185 control URI. A server MUST respond with error 460 (Only Aggregate 3186 Operation Allowed) if the client PLAY Request-URI is for a single 3187 media. The media in an aggregate MUST be played in sync. If a 3188 client wants individual control of the media, it needs to use 3189 separate RTSP sessions for each media. 3191 For aggregated sessions where the initial SETUP request (creating a 3192 session) is followed by one or more additional SETUP requests, a PLAY 3193 request MAY be pipelined after those additional SETUP requests 3194 without awaiting their responses. This procedure can reduce the 3195 delay from start of session establishment until media play-out has 3196 started with one round trip time. However, a client needs to be 3197 aware that using this procedure will result in the playout of the 3198 server state established at the time of processing the PLAY, i.e., 3199 after the processing of all the requests prior to the PLAY request in 3200 the pipeline. This state may not be the intended one due to failure 3201 of any of the prior requests. A client can easily determine this 3202 based on the responses from those requests. In case of failure, the 3203 client can halt the media playout using PAUSE and try to establish 3204 the intended state again before issuing another PLAY request. 3206 13.4.3. Updating current PLAY Requests 3208 Clients can issue PLAY requests while the stream is in Play state and 3209 thus updating their request. 3211 The important difference compared to a PLAY request in Ready state is 3212 the handling of the current play point and how the Range header in 3213 request is constructed. The session is actively playing media and 3214 the play point will be moving, making the exact time a request will 3215 take action hard to predict. Depending on how the PLAY header 3216 appears two different cases exist: total replacement or continuation. 3217 A total replacement is signaled by having the first range 3218 specification have an explicit start value, e.g. npt=45- or 3219 npt=45-60, in which case the server stops playout at the current 3220 playout point and then starts delivering media according to the Range 3221 header. This is equivalent to having the client first send a PAUSE 3222 and then a new PLAY request that isn't based on the pause point. In 3223 the case of continuation the first range specifier has an implicit 3224 start point and an explicit stop value (Z), e.g. npt=-60, which 3225 indicate that it MUST convert the range specifier being played prior 3226 to this PLAY request (X to Y) into (X to Z) and continue as this was 3227 the request originally played. If the current delivery point is 3228 beyond the stop point, the server SHALL immediately pause delivery. 3229 As the request has been completed successfully it shall be responded 3230 with 200 OK. A PLAY_NOTIFY with end-of-stream is also sent to 3231 indicate the actual stop point. The pause point is set to the 3232 requested stop point. 3234 Following is an example of this behavior: The server has received 3235 requests to play ranges 10 to 15. If the new PLAY request arrives at 3236 the server 4 seconds after the previous one, it will take effect 3237 while the server still plays the first range (10-15). The server 3238 changes the current play to continue to 25 seconds, i.e. the 3239 equivalent single request would be PLAY with range: npt=10-25. 3241 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3242 CSeq: 834 3243 Session: 12345678 3244 Range: npt=10-15 3245 User-Agent: PhonyClient/1.2 3247 S->C: RTSP/2.0 200 OK 3248 CSeq: 834 3249 Date: Thu, 23 Jan 1997 15:35:06 GMT 3250 Session: 12345678 3251 Server: PhonyServer/1.0 3252 Range: npt=10-15 3253 Seek-Style: Next 3254 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3255 ssrc=0D12F123:seq=5712;rtptime=934207921, 3256 url="rtsp://example.com/fizzle/videotrack" 3257 ssrc=789DAF12:seq=57654;rtptime=2792482193 3258 Session: 12345678 3260 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3261 CSeq: 835 3262 Session: 12345678 3263 Range: npt=-25 3264 User-Agent: PhonyClient/1.2 3266 S->C: RTSP/2.0 200 OK 3267 CSeq: 835 3268 Date: Thu, 23 Jan 1997 15:35:09 GMT 3269 Session: 12345678 3270 Server: PhonyServer/1.0 3271 Range: npt=14-25 3272 Seek-Style: Next 3273 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3274 ssrc=0D12F123:seq=5712;rtptime=934239921, 3275 url="rtsp://example.com/fizzle/videotrack" 3276 ssrc=789DAF12:seq=57654;rtptime=2792842193 3278 A common use of a PLAY request while in Play state is changing the 3279 scale of the media, i.e., entering or leaving from fast forward or 3280 fast rewind. The client can issue an updating PLAY request that is 3281 either a continuation or a complete replacement, as discussed above 3282 this section. We give an example of a client that is requesting a 3283 fast forward (scale=2) without giving a stop point and then change 3284 from fast forward to regular playout (scale = 1). 3286 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3287 CSeq: 2034 3288 Session: 12345678 3289 Range: npt=now- 3290 Scale: 2.0 3291 User-Agent: PhonyClient/1.2 3293 S->C: RTSP/2.0 200 OK 3294 CSeq: 2034 3295 Date: Thu, 23 Jan 1997 15:35:06 GMT 3296 Session: 12345678 3297 Server: PhonyServer/1.0 3298 Range: npt=2:17:21.394- 3299 Seek-Style: Next 3300 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3301 ssrc=0D12F123:seq=5712;rtptime=934207921, 3302 url="rtsp://example.com/fizzle/videotrack" 3303 ssrc=789DAF12:seq=57654;rtptime=2792482193 3305 [playing in fast forward and now returning to scale = 1] 3307 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3308 CSeq: 2035 3309 Session: 12345678 3310 Range: npt=now- 3311 Scale: 1.0 3312 User-Agent: PhonyClient/1.2 3314 S->C: RTSP/2.0 200 OK 3315 CSeq: 2035 3316 Date: Thu, 23 Jan 1997 15:35:09 GMT 3317 Session: 12345678 3318 Server: PhonyServer/1.0 3319 Range: npt=2:17:27.144- 3320 Seek-Style: Next 3321 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3322 ssrc=0D12F123:seq=5712;rtptime=934239921, 3323 url="rtsp://example.com/fizzle/videotrack" 3324 ssrc=789DAF12:seq=57654;rtptime=2792842193 3326 13.4.4. Playing On-Demand Media 3328 On-demand media is indicated by the content of the Media-Properties 3329 header in the SETUP response by (see also Section 16.28): 3331 o Random-Access property is set to Random Access; 3332 o Content Modifications set to Immutable; 3334 o Retention set to Unlimited or Time-Limited. 3336 Playing on-demand media follows the general usage as described in 3337 Section 13.4.1. 3339 13.4.5. Playing Dynamic On-Demand Media 3341 Dynamic on-demand media is indicated by the content of the Media- 3342 Properties header in the SETUP response by (see also Section 16.28): 3344 o RandomAccess set to Random-Access; 3346 o Content Modifications set to Dynamic; 3348 o Retention set to Unlimited or Time-Limited. 3350 Playing on-demand media follows the general usage as described in 3351 Section 13.4.1 as long as the media has not been changed. 3353 There are two ways for the client to be informed about changes of 3354 media resources in Play state. The client will receive a PLAY_NOTIFY 3355 request with Notify-Reason header set to media-properties-update (see 3356 Section 13.5.2. The client can use the value of the Media-Range to 3357 decide further actions, if the Media-Range header is present in the 3358 PLAY_NOTIFY request. The second way is that the client issues a 3359 GET_PARAMETER request without a body but including a Media-Range 3360 header. The 200 OK response MUST include the current Media-Range 3361 header (see Section 16.29). 3363 13.4.6. Playing Live Media 3365 Live media is indicated by the content of the Media-Properties header 3366 in the SETUP response by (see also Section 16.28): 3368 o Random-Access set to No-Seeking; 3370 o Content Modifications set to Time-Progressing; 3372 o Retention with Time-Duration set to 0.0. 3374 For live media, the SETUP response 200 OK MUST include the Media- 3375 Range header (see Section 16.29). 3377 A client MAY send PLAY requests without the Range header. If the 3378 request includes the Range header it MUST use a symbolic value 3379 representing "now". For NPT that range specification is "npt=now-". 3381 The server MUST include the Range header in the response and it MUST 3382 indicate an explicit time value and not a symbolic value. In other 3383 words, "npt=now-" is not valid to be used in the response. Instead 3384 the time since session start is recommended expressed as an open 3385 interval, e.g. "npt=96.23-". An absolute time value (clock) for the 3386 corresponding time MAY be given, i.e. "clock=20030213T143205Z-". The 3387 UTC clock format can only be used if client has shown support for it 3388 using the Accept-Ranges header. 3390 13.4.7. Playing Live with Recording 3392 Certain media servers may offer recording services of live sessions 3393 to their clients. This recording would normally be from the 3394 beginning of the media session. Clients can randomly access the 3395 media between now and the beginning of the media session. This live 3396 media with recording is indicated by the content of the Media- 3397 Properties header in the SETUP response by (see also Section 16.28): 3399 o Random-Access set to Random-Access; 3401 o Content Modifications set to Time-Progressing; 3403 o Retention set to Time-limited or Unlimited 3405 The SETUP response 200 OK MUST include the Media-Range header (see 3406 Section 16.29) for this type of media. For live media with 3407 recording, the Range header indicates the current delivery point in 3408 the media and the Media-Range header indicates the currently 3409 available media window around the current time. This window can 3410 cover recorded content in the past (seen from current time in the 3411 media) or recorded content in the future (seen from current time in 3412 the media). The server adjusts the delivery point to the requested 3413 border of the window, if the client requests a delivery point that is 3414 located outside the recording windows, e.g., if requested to far in 3415 the past, the server selects the oldest range in the recording. The 3416 considerations in Section 13.5.3 apply, if a client requests delivery 3417 with Scale (Section 16.44) values other than 1.0 (Normal playback 3418 rate) while delivering live media with recording. 3420 13.4.8. Playing Live with Time-Shift 3422 Certain media servers may offer time-shift services to their clients. 3423 This time shift records a fixed interval in the past, i.e., a sliding 3424 window recording mechanism, but not past this interval. Clients can 3425 randomly access the media between now and the interval. This live 3426 media with recording is indicated by the content of the Media- 3427 Properties header in the SETUP response by (see also Section 16.28): 3429 o Random-Access set to Random-Access; 3431 o Content Modifications set to Time-Progressing; 3433 o Retention set to Time-Duration and a value indicating the 3434 recording interval (>0). 3436 The SETUP response 200 OK MUST include the Media-Range header (see 3437 Section 16.29) for this type of media. For live media with recording 3438 the Range header indicates the current time in the media and the 3439 Media Range indicates a window around the current time. This window 3440 can cover recorded content in the past (seen from current time in the 3441 media) or recorded content in the future (seen from current time in 3442 the media). The server adjusts the play point to the requested 3443 border of the window, if the client requests a play point that is 3444 located outside the recording windows, e.g., if requested too far in 3445 the past, the server selects the oldest range in the recording. The 3446 considerations in Section 13.5.3 apply, if a client requests delivery 3447 using a Scale (Section 16.44) value other than 1.0 (Normal playback 3448 rate) while delivering live media with time-shift. 3450 13.5. PLAY_NOTIFY 3452 The PLAY_NOTIFY method is issued by a server to inform a client about 3453 an asynchronous event for a session in Play state. The Session 3454 header MUST be presented in a PLAY_NOTIFY request and indicates the 3455 scope of the request. Sending of PLAY_NOTIFY requests requires a 3456 persistent connection between server and client, otherwise there is 3457 no way for the server to send this request method to the client. 3459 PLAY_NOTIFY requests have an end-to-end (i.e. server to client) 3460 scope, as they carry the Session header, and apply only to the given 3461 session. The client SHOULD immediately return a response to the 3462 server. 3464 PLAY_NOTIFY requests MAY be used with a message body, depending on 3465 the value of the Notify-Reason header. It is described in the 3466 particular section for each Notify-Reason if a message body is used. 3467 However, currently there is no Notify-Reason that allows using a 3468 message body. In this case, there is a need to obey some limitations 3469 when adding new Notify-Reasons that intend to use a message body: the 3470 server can send any type of message body, but it is not ensured that 3471 the client can understand the received message body. This is related 3472 to DESCRIBE (see Section 13.2 ), but in this particular case the 3473 client can state its acceptable message bodies by using the Accept 3474 header. In the case of PLAY_NOTIFY, the server does not know which 3475 message bodies are understood by the client. 3477 The Notify-Reason header (see Section 16.31) specifies the reason why 3478 the server sends the PLAY_NOTIFY request. This is extensible and new 3479 reasons MAY be added in the future (see Section 22.8). In case the 3480 client does not understand the reason for the notification it MUST 3481 respond with an 465 (Notification Reason Unknown) (Section 15.4.30) 3482 error code. Servers can send PLAY_NOTIFY with these types: 3484 o end-of-stream (see Section 13.5.1); 3486 o media-properties-update (see Section 13.5.2); 3488 o scale-change (see Section 13.5.3). 3490 13.5.1. End-of-Stream 3492 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3493 indicates the completion or near completion of the PLAY request and 3494 the ending delivery of the media stream(s). The request MUST NOT be 3495 issued unless the server is in the Play state. The end of the media 3496 stream delivery notification may be used to indicate either a 3497 successful completion of the PLAY request currently being served, or 3498 to indicate some error resulting in failure to complete the request. 3499 The Request-Status header (Section 16.40) MUST be included to 3500 indicate which request the notification is for and its completion 3501 status. The message response status codes (Section 8.1.1) are used 3502 to indicate how the PLAY request concluded. The sender of a 3503 PLAY_NOTIFY can issue an updated PLAY_NOTIFY, in the case of a 3504 PLAY_NOTIFY sent with wrong information. For instance, a PLAY_NOTIFY 3505 was issued before reaching the end-of-stream, but some error occurred 3506 resulting in that the previously sent PLAY_NOTIFY contained a wrong 3507 time when the stream will end. In this case a new PLAY_NOTIFY MUST 3508 be sent including the correct status for the completion and all 3509 additional information. 3511 PLAY_NOTIFY requests with Notify-Reason header set to end-of-stream 3512 MUST include a Range header and the Scale header if the scale value 3513 is not 1. The Range header indicates the point in the stream or 3514 streams where delivery is ending with the timescale that was used by 3515 the server in the PLAY response for the request being fulfilled. The 3516 server MUST NOT use the "now" constant in the Range header; it MUST 3517 use the actual numeric end position in the proper timescale. When 3518 end-of-stream notifications are issued prior to having sent the last 3519 media packets, this is evident as the end time in the Range header is 3520 beyond the current time in the media being received by the client, 3521 e.g., npt=-15, if npt is currently at 14.2 seconds. The Scale header 3522 is to be included so that it is evident if the media time scale is 3523 moving backwards and/or have a non-default pace. The end-of-stream 3524 notification does not prevent the client from sending a new PLAY 3525 request. 3527 If RTP is used as media transport, a RTP-Info header MUST be 3528 included, and the RTP-Info header MUST indicate the last sequence 3529 number in the seq parameter. 3531 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3532 MUST NOT carry a message body. 3534 This example request notifies the client about a future end-of-stream 3535 event: 3537 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3538 CSeq: 854 3539 Notify-Reason: end-of-stream 3540 Request-Status: cseq=853 status=200 reason="OK" 3541 Range: npt=-145 3542 RTP-Info:url="rtsp://example.com/audio" 3543 ssrc=0D12F123:seq=14783;rtptime=2345962545 3544 Session: uZ3ci0K+Ld-M 3545 Date: Mon, 08 Mar 2010 13:37:16 GMT 3547 C->S: RTSP/2.0 200 OK 3548 CSeq: 854 3549 User-Agent: PhonyClient/1.2 3550 Session: uZ3ci0K+Ld-M 3552 13.5.2. Media-Properties-Update 3554 A PLAY_NOTIFY request with Notify-Reason header set to media- 3555 properties-update indicates an update of the media properties for the 3556 given session (see Section 16.28) and/or the available media range 3557 that can be played as indicated by Media-Range (Section 16.29). 3558 PLAY_NOTIFY requests with Notify-Reason header set to media- 3559 properties-update MUST include a Media-Properties and Date header and 3560 SHOULD include a Media-Range header. 3562 This notification MUST be sent for media that are time-progressing 3563 every time an event happens that changes the basis for making 3564 estimates on how the media range progress. In addition it is 3565 RECOMMENDED that the server sends these notifications every 5 minutes 3566 for time-progressing content to ensure the long-term stability of the 3567 client estimation and allowing for clock skew detection by the 3568 client. Requests for the just mentioned reasons MUST include Media- 3569 Range header to provide current Media duration and the Range header 3570 to indicate the current playing point and any remaining parts of the 3571 requested range. 3573 The recommendation for sending updates every 5 minutes is due to 3574 any clock skew issues. In 5 minutes the clock skew should not 3575 become too significant as this is not used for media playback and 3576 synchronization, only for determining which content is available 3577 to the user. 3579 A PLAY_NOTIFY request with Notify-Reason header set to media- 3580 properties-update MUST NOT carry a message body. 3582 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3583 Date: Tue, 14 Apr 2008 15:48:06 GMT 3584 CSeq: 854 3585 Notify-Reason: media-properties-update 3586 Session: uZ3ci0K+Ld-M 3587 Media-Properties: Time-Progressing, 3588 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3589 Media-Range: npt=0-1:37:21.394 3590 Range: npt=1:15:49.873- 3592 C->S: RTSP/2.0 200 OK 3593 CSeq: 854 3594 User-Agent: PhonyClient/1.2 3595 Session: uZ3ci0K+Ld-M 3597 13.5.3. Scale-Change 3599 The server may be forced to change the rate, when a client request 3600 delivery using a Scale (Section 16.44) value other than 1.0 (normal 3601 playback rate). For time progressing media with some retention, i.e. 3602 the server stores already sent content, a client requesting to play 3603 with Scale values larger than 1 may catch up with the front end of 3604 the media. The server will then be unable to continue to provide 3605 content at Scale larger than 1 as content is only made available by 3606 the server at Scale=1. Another case is when Scale < 1 and the media 3607 retention is time-duration limited. In this case the delivery point 3608 can reach the oldest media unit available, and further playback at 3609 this scale becomes impossible as there will be no media available. 3610 To avoid having the client lose any media, the scale will need to be 3611 adjusted to the same rate at which the media is removed from the 3612 storage buffer, commonly Scale = 1.0. 3614 Another case is when the content itself consists of spliced pieces or 3615 is dynamically updated. In these cases the server may be required to 3616 change from one supported scale value (different than Scale=1.0) to 3617 another. In this case the server will pick the closest value and 3618 inform the client of what it has picked. In these cases the media 3619 properties will also be sent updating the supported Scale values. 3620 This enables a client to adjust the used Scale value. 3622 To minimize impact on playback in any of the above cases the server 3623 MUST modify the playback properties and set Scale to a supportable 3624 value and continue delivery of the media. When doing this 3625 modification it MUST send a PLAY_NOTIFY message with the Notify- 3626 Reason header set to "scale-change". The request MUST contain a 3627 Range header with the media time where the change took effect, a 3628 Scale header with the new value in use, Session header with the ID 3629 for the session it applies to and a Date header with the server 3630 wallclock time of the change. For time progressing content also the 3631 Media-Range and the Media-Properties at this point in time MUST be 3632 included. The Media-Properties header MUST be included if the scale 3633 change was due to the content changing what scale values that is 3634 supported. 3636 For media streams being delivered using RTP also a RTP-Info header 3637 MUST be included. It MUST contain the rtptime parameter with a value 3638 corresponding to the point of change in that media and optionally 3639 also the sequence number. 3641 A PLAY_NOTIFY request with Notify-Reason header set to "Scale-Change" 3642 MUST NOT carry a message body. 3644 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3645 Date: Tue, 14 Apr 2008 15:48:06 GMT 3646 CSeq: 854 3647 Notify-Reason: scale-change 3648 Session: uZ3ci0K+Ld-M 3649 Media-Properties: Time-Progressing, 3650 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3651 Media-Range: npt=0-1:37:21.394 3652 Range: npt=1:37:21.394- 3653 Scale: 1 3654 RTP-Info: url="rtsp://example.com/fizzle/foo/audio" 3655 ssrc=0D12F123:rtptime=2345962545 3657 C->S: RTSP/2.0 200 OK 3658 CSeq: 854 3659 User-Agent: PhonyClient/1.2 3660 Session: uZ3ci0K+Ld-M 3662 13.6. PAUSE 3664 The PAUSE request causes the stream delivery to immediately be 3665 interrupted (halted). A PAUSE request MUST be done either with the 3666 aggregated control URI for aggregated sessions, resulting in all 3667 media being halted, or the media URI for non-aggregated sessions. 3668 Any attempt to do muting of a single media with a PAUSE request in an 3669 aggregated session MUST be responded to with error 460 (Only 3670 Aggregate Operation Allowed). After resuming playback, 3671 synchronization of the tracks MUST be maintained. Any server 3672 resources are kept, though servers MAY close the session and free 3673 resources after being paused for the duration specified with the 3674 timeout parameter of the Session header in the SETUP message. 3676 Example: 3678 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3679 CSeq: 834 3680 Session: 12345678 3681 User-Agent: PhonyClient/1.2 3683 S->C: RTSP/2.0 200 OK 3684 CSeq: 834 3685 Date: Thu, 23 Jan 1997 15:35:06 GMT 3686 Range: npt=45.76-75.00 3688 The PAUSE request causes stream delivery to be interrupted 3689 immediately on receipt of the message and the pause point is set to 3690 the current point in the presentation. That pause point in the media 3691 stream needs to be maintained. A subsequent PLAY request without 3692 Range header resume from the pause point and plays until media end. 3694 The pause point after any PAUSE request MUST be returned to the 3695 client by adding a Range header with what remains unplayed of the 3696 PLAY request's range. For media with random access properties, if 3697 one desires to resume playing a ranged request, one simply includes 3698 the Range header from the PAUSE response and includes the Seek-Style 3699 header with the Next policy in the PLAY request. For media that is 3700 time-progressing and has retention duration=0 the follow-up PLAY 3701 request to start media delivery again, will need to use "npt=now-" 3702 and not the answer given in the response to PAUSE. 3704 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3705 CSeq: 834 3706 Session: 12345678 3707 Range: npt=10-30 3708 User-Agent: PhonyClient/1.2 3710 S->C: RTSP/2.0 200 OK 3711 CSeq: 834 3712 Date: Thu, 23 Jan 1997 15:35:06 GMT 3713 Server: PhonyServer/1.0 3714 Range: npt=10-30 3715 Seek-Style: First-Prior 3716 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3717 ssrc=0D12F123:seq=5712;rtptime=934207921, 3718 url="rtsp://example.com/fizzle/videotrack" 3719 ssrc=4FAD8726:seq=57654;rtptime=2792482193 3720 Session: 12345678 3722 After 11 seconds, i.e. at 21 seconds into the presentation: 3723 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3724 CSeq: 835 3725 Session: 12345678 3726 User-Agent: PhonyClient/1.2 3728 S->C: RTSP/2.0 200 OK 3729 CSeq: 835 3730 Date: 23 Jan 1997 15:35:17 GMT 3731 Server: PhonyServer/1.0 3732 Range: npt=21-30 3733 Session: 12345678 3735 If a client issues a PAUSE request and the server acknowledges and 3736 enters the Ready state, the proper server response, if the player 3737 issues another PAUSE, is still 200 OK. The 200 OK response MUST 3738 include the Range header with the current pause point. See examples 3739 below: 3741 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3742 CSeq: 834 3743 Session: 12345678 3744 User-Agent: PhonyClient/1.2 3746 S->C: RTSP/2.0 200 OK 3747 CSeq: 834 3748 Session: 12345678 3749 Date: Thu, 23 Jan 1997 15:35:06 GMT 3750 Range: npt=45.76-98.36 3752 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3753 CSeq: 835 3754 Session: 12345678 3755 User-Agent: PhonyClient/1.2 3757 S->C: RTSP/2.0 200 OK 3758 CSeq: 835 3759 Session: 12345678 3760 Date: 23 Jan 1997 15:35:07 GMT 3761 Range: npt=45.76-98.36 3763 13.7. TEARDOWN 3765 13.7.1. Client to Server 3767 The TEARDOWN client to server request stops the stream delivery for 3768 the given URI, freeing the resources associated with it. A TEARDOWN 3769 request MAY be performed on either an aggregated or a media control 3770 URI. However, some restrictions apply depending on the current 3771 state. The TEARDOWN request MUST contain a Session header indicating 3772 what session the request applies to. 3774 A TEARDOWN using the aggregated control URI or the media URI in a 3775 session under non-aggregated control (single media session) MAY be 3776 done in any state (Ready and Play). A successful request MUST result 3777 in that media delivery being immediately halted and the session state 3778 being destroyed. This MUST be indicated through the lack of a 3779 Session header in the response. 3781 A TEARDOWN using a media URI in an aggregated session MAY only be 3782 done in Ready state. Such a request only removes the indicated media 3783 stream and associated resources from the session. This may result in 3784 that a session returns to non-aggregated control, due to that it only 3785 contains a single media after the requests completion. A session 3786 that will exist after the processing of the TEARDOWN request MUST in 3787 the response to that TEARDOWN request contain a Session header. Thus 3788 the presence of the Session header indicates to the receiver of the 3789 response if the session is still existing or has been removed. 3791 Example: 3793 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/2.0 3794 CSeq: 892 3795 Session: 12345678 3796 User-Agent: PhonyClient/1.2 3798 S->C: RTSP/2.0 200 OK 3799 CSeq: 892 3800 Server: PhonyServer/1.0 3802 13.7.2. Server to Client 3804 The server can send TEARDOWN requests in the server to client 3805 direction to indicate that the server has been forced to terminate 3806 the ongoing session. This may happen for several reasons, such as 3807 server maintenance without available backup, or that the session has 3808 been inactive for extended periods of time. The reason is provided 3809 in the Terminate-Reason header (Section 16.50). 3811 When a RTSP client has maintained a RTSP session that otherwise is 3812 inactive for an extended period of time the server may reclaim the 3813 resources. That is done by issuing a TEARDOWN request with the 3814 Terminate-Reason set to "Session-Timeout". This MAY be done when the 3815 client has been inactive in the RTSP session for more than one 3816 Session Timeout period (Section 16.47). However, the server is 3817 RECOMMENDED to not perform this operation until an extended period of 3818 inactivity has passed. The time period is considered extended when 3819 it is 10 times the Session Timeout period. Consideration of the 3820 application of the server and its content should be performed when 3821 configuring what is considered as extended period of time. 3823 In case the server needs to stop providing service to the established 3824 sessions and there is no server to point at in a REDIRECT request, 3825 then TEARDOWN SHALL be used to terminate the session. This method 3826 can also be used when non-recoverable internal errors have happened 3827 and the server has no other option then to terminate the sessions. 3829 The TEARDOWN request MUST be done only on the session aggregate 3830 control URI (i.e., it is not allowed to terminate individual media 3831 streams, if it is a session aggregate) and MUST include the following 3832 headers; Session and Terminate-Reason headers. The request only 3833 applies to the session identified in the Session header. The server 3834 may include a message to the client's user with the "user-msg" 3835 parameter. 3837 The TEARDOWN request may alternatively be done on the wild card URI * 3838 and without any session header. The scope of such a request is 3839 limited to the next-hop (i.e. the RTSP agent in direct communication 3840 with the server) and applies, as well, to the control connection 3841 between the next-hop RTSP agent and the server. This request 3842 indicates that all sessions and pending requests being managed via 3843 the control connection are terminated. Any intervening proxies 3844 SHOULD do all of the following in the order listed: 3846 1. respond to the TEARDOWN request 3848 2. disconnect the control channel from the requesting server 3850 3. pass the TEARDOWN request to each applicable client (typically 3851 those clients with an active session or an unanswered request) 3853 Note: The proxy is responsible for accepting TEARDOWN responses 3854 from its clients; these responses MUST NOT be passed on to either 3855 the original server or the target server in the redirect. 3857 13.8. GET_PARAMETER 3859 The GET_PARAMETER request retrieves the value of any specified 3860 parameter or parameters for a presentation or stream specified in the 3861 URI. If the Session header is present in a request, the value of a 3862 parameter MUST be retrieved in the specified session context. There 3863 are two ways of specifying the parameters to be retrieved. The first 3864 is by including headers which have been defined such that you can use 3865 them for this purpose. Headers for this purpose should allow empty, 3866 or stripped value parts to avoid having to specify bogus data when 3867 indicating the desire to retrieve a value. The successful completion 3868 of the request should also be evident from any filled out values in 3869 the response. The Media-Range header (Section 16.29) is one such 3870 header. The other way is to specify a message body that lists the 3871 parameter(s) that are desired to be retrieved. The Content-Type 3872 header (Section 16.18) is used to specify which format the message 3873 body has. 3875 The headers that MAY be used for retrieving their current value using 3876 GET_PARAMETER are: 3878 o Accept-Ranges 3880 o Media-Range 3882 o Media-Properties 3883 o Range 3885 o RTP-Info 3887 The method MAY also be used without a message body or any header that 3888 request parameters for keep-alive purpose. The keep-alive timer has 3889 been updated for any request that is successful, i.e., a 200 OK 3890 response is received. Any non-required header present in such a 3891 request may or may not have been processed. Normally the presence of 3892 filled out values in the header will be indication that the header 3893 has been processed. However, for cases when this is difficult to 3894 determine, it is recommended to use a feature-tag and the Require 3895 header. Due to this reason it is usually easier if any parameters to 3896 be retrieved are sent in the body, rather than using any header. 3898 Parameters specified within the body of the message must all be 3899 understood by the request receiving agent. If one or more parameters 3900 are not understood a 451 (Parameter Not Understood) MUST be sent 3901 including a body listing these parameters that weren't understood. 3902 If all parameters are understood their values are filled in and 3903 returned in the response message body. 3905 Example: 3907 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3908 CSeq: 431 3909 User-Agent: PhonyClient/1.2 3910 Session: 12345678 3911 Content-Length: 26 3912 Content-Type: text/parameters 3914 packets_received 3915 jitter 3917 C->S: RTSP/2.0 200 OK 3918 CSeq: 431 3919 Session: 12345678 3920 Server: PhonyServer/1.1 3921 Date: Mon, 08 Mar 2010 13:43:23 GMT 3922 Content-Length: 38 3923 Content-Type: text/parameters 3925 packets_received: 10 3926 jitter: 0.3838 3928 13.9. SET_PARAMETER 3930 This method requests to set the value of a parameter or a set of 3931 parameters for a presentation or stream specified by the URI. The 3932 method MAY also be used without a message body. It is the 3933 RECOMMENDED method to be used in a request sent for the sole purpose 3934 of updating the keep-alive timer. If this request is successful, 3935 i.e. a 200 OK response is received, then the keep-alive timer has 3936 been updated. Any non-required header present in such a request may 3937 or may not have been processed. To allow a client to determine if 3938 any such header has been processed, it is necessary to use a feature 3939 tag and the Require header. Due to this reason it is RECOMMENDED 3940 that any parameters are sent in the body, rather than using any 3941 header. 3943 A request is RECOMMENDED to only contain a single parameter to allow 3944 the client to determine why a particular request failed. If the 3945 request contains several parameters, the server MUST only act on the 3946 request if all of the parameters can be set successfully. A server 3947 MUST allow a parameter to be set repeatedly to the same value, but it 3948 MAY disallow changing parameter values. If the receiver of the 3949 request does not understand or cannot locate a parameter, error 451 3950 (Parameter Not Understood) MUST be used. In the case a parameter is 3951 not allowed to change, the error code is 458 (Parameter Is Read- 3952 Only). The response body MUST contain only the parameters that have 3953 errors. Otherwise no body MUST be returned. 3955 Note: transport parameters for the media stream MUST only be set with 3956 the SETUP command. 3958 Restricting setting transport parameters to SETUP is for the 3959 benefit of firewalls. 3961 The parameters are split in a fine-grained fashion so that there 3962 can be more meaningful error indications. However, it may make 3963 sense to allow the setting of several parameters if an atomic 3964 setting is desirable. Imagine device control where the client 3965 does not want the camera to pan unless it can also tilt to the 3966 right angle at the same time. 3968 Example: 3970 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3971 CSeq: 421 3972 User-Agent: PhonyClient/1.2 3973 Session: iixT43KLc 3974 Date: Mon, 08 Mar 2010 14:45:04 GMT 3975 Content-length: 20 3976 Content-type: text/parameters 3978 barparam: barstuff 3980 S->C: RTSP/2.0 451 Parameter Not Understood 3981 CSeq: 421 3982 Session: iixT43KLc 3983 Server: PhonyServer/1.0 3984 Date: Mon, 08 Mar 2010 14:44:56 GMT 3985 Content-length: 20 3986 Content-type: text/parameters 3988 barparam: barstuff 3990 13.10. REDIRECT 3992 The REDIRECT method is issued by a server to inform a client that the 3993 service provided will be terminated and where a corresponding service 3994 can be provided instead. This may happen for different reasons. One 3995 is that the server is being administered such that it must stop 3996 providing service. Thus the client is required to connect to another 3997 server location to access the resource indicated by the Request-URI. 3999 The REDIRECT request SHALL contain a Terminate-Reason header 4000 (Section 16.50) to inform the client of the reason for the request. 4001 Additional parameters related to the reason may also be included. 4002 The intention here is to allow a server administrator to do a 4003 controlled shutdown of the RTSP server. That requires sufficient 4004 time to inform all entities having associated state with the server 4005 and for them to perform a controlled migration from this server to a 4006 fall back server. 4008 A REDIRECT request with a Session header has end-to-end (i.e. server 4009 to client) scope and applies only to the given session. Any 4010 intervening proxies SHOULD NOT disconnect the control channel while 4011 there are other remaining end-to-end sessions. The REQUIRED Location 4012 header MUST contain a complete absolute URI pointing to the resource 4013 to which the client SHOULD reconnect. Specifically, the Location 4014 MUST NOT contain just the host and port. A client may receive a 4015 REDIRECT request with a Session header, if and only if, an end-to-end 4016 session has been established. 4018 A client may receive a REDIRECT request without a Session header at 4019 any time when it has communication or a connection established with a 4020 server. The scope of such a request is limited to the next-hop (i.e. 4021 the RTSP agent in direct communication with the server) and applies 4022 to all sessions controlled, as well as the control connection between 4023 the next-hop RTSP agent and the server. A REDIRECT request without a 4024 Session header indicates that all sessions and pending requests being 4025 managed via the control connection MUST be redirected. The REQUIRED 4026 Location header, if included in such a request, SHOULD contain an 4027 absolute URI with only the host address and the OPTIONAL port number 4028 of the server to which the RTSP agent SHOULD reconnect. Any 4029 intervening proxies SHOULD do all of the following in the order 4030 listed: 4032 1. respond to the REDIRECT request 4034 2. disconnect the control channel from the requesting server 4036 3. connect to the server at the given host address 4038 4. pass the REDIRECT request to each applicable client (typically 4039 those clients with an active session or an unanswered request) 4041 Note: The proxy is responsible for accepting REDIRECT responses 4042 from its clients; these responses MUST NOT be passed on to either 4043 the original server or the redirected server. 4045 When the server lacks any alternative server and needs to terminate a 4046 session or all sessions the TEARDOWN request SHALL be used instead. 4048 When no Terminate-Reason "time" parameter are included in a REDIRECT 4049 request, the client SHALL perform the redirection immediately and 4050 return a response to the server. The server shall consider the 4051 session as terminated and can free any associated state after it 4052 receives the successful (2xx) response. The server MAY close the 4053 signaling connection upon receiving the response and the client 4054 SHOULD close the signaling connection after sending the 2xx response. 4055 The exception to this is when the client has several sessions on the 4056 server being managed by the given signaling connection. In this 4057 case, the client SHOULD close the connection when it has received and 4058 responded to REDIRECT requests for all the sessions managed by the 4059 signaling connection. 4061 The Terminate-Reason header "time" parameter MAY be used to indicate 4062 the wallclock time by when the redirection MUST have taken place. To 4063 allow a client to determine that redirect time without being time 4064 synchronized with the server, the server MUST include a Date header 4065 in the request. The client should have before the redirection time- 4066 line terminated the session and closed the control connection. The 4067 server MAY simple cease to provide service when the deadline time has 4068 been reached, or it may issue TEARDOWN requests to the remaining 4069 sessions. 4071 If the REDIRECT request times out following the rules in Section 10.4 4072 the server MAY terminate the session or transport connection that 4073 would be redirected by the request. This is a safeguard against 4074 misbehaving clients that refuse to respond to a REDIRECT request. 4075 That should not provide any benefit. 4077 After a REDIRECT request has been processed, a client that wants to 4078 continue to send or receive media for the resource identified by the 4079 Request-URI will have to establish a new session with the designated 4080 host. If the URI given in the Location header is a valid resource 4081 URI, a client SHOULD issue a DESCRIBE request for the URI. 4083 Note: The media resource indicated by the Location header can be 4084 identical, slightly different or totally different. This is the 4085 reason why a new DESCRIBE request SHOULD be issued. 4087 If the Location header contains only a host address, the client MAY 4088 assume that the media on the new server is identical to the media on 4089 the old server, i.e. all media configuration information from the old 4090 session is still valid except for the host address. However, the 4091 usage of conditional SETUP using MTag identifiers are RECOMMENDED to 4092 verify the assumption. 4094 This example request redirects traffic for this session to the new 4095 server at the given absolute time: 4097 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/2.0 4098 CSeq: 732 4099 Location: rtsp://s2.example.com:8001 4100 Terminate-Reason: Server-Admin ;time=19960213T143205Z 4101 Session: uZ3ci0K+Ld-M 4102 Date: Thu, 13 Feb 1996 14:30:43 GMT 4104 C->S: RTSP/2.0 200 OK 4105 CSeq: 732 4106 User-Agent: PhonyClient/1.2 4107 Session: uZ3ci0K+Ld-M 4109 14. Embedded (Interleaved) Binary Data 4111 In order to fulfill certain requirements on the network side, e.g. in 4112 conjunction with network address translators that block RTP traffic 4113 over UDP, it may be necessary to interleave RTSP messages and media 4114 stream data. This interleaving should generally be avoided unless 4115 necessary since it complicates client and server operation and 4116 imposes additional overhead. Also, head of line blocking may cause 4117 problems. Interleaved binary data SHOULD only be used if RTSP is 4118 carried over TCP. Interleaved data is not allowed inside RTSP 4119 messages. 4121 Stream data such as RTP packets is encapsulated by an ASCII dollar 4122 sign (36 decimal), followed by a one-byte channel identifier, 4123 followed by the length of the encapsulated binary data as a binary, 4124 two-byte integer in network byte order. The stream data follows 4125 immediately afterwards, without a CRLF, but including the upper-layer 4126 protocol headers. Each $ block MUST contain exactly one upper-layer 4127 protocol data unit, e.g., one RTP packet. 4128 0 1 2 3 4129 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 4130 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4131 | "$" = 36 | Channel ID | Length in bytes | 4132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4133 : Length number of bytes of binary data : 4134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4136 The channel identifier is defined in the Transport header with the 4137 interleaved parameter (Section 16.52). 4139 When the transport choice is RTP, RTCP messages are also interleaved 4140 by the server over the TCP connection. The usage of RTCP messages is 4141 indicated by including an interval containing a second channel in the 4142 interleaved parameter of the Transport header, see Section 16.52. If 4143 RTCP is used, packets MUST be sent on the first available channel 4144 higher than the RTP channel. The channels are bi-directional, using 4145 the same ChannelD in both directions, and therefore RTCP traffic are 4146 sent on the second channel in both directions. 4148 RTCP is sometimes needed for synchronization when two or more 4149 streams are interleaved in such a fashion. Also, this provides a 4150 convenient way to tunnel RTP/RTCP packets through the TCP control 4151 connection when required by the network configuration and transfer 4152 them onto UDP when possible. 4154 C->S: SETUP rtsp://example.com/bar.file RTSP/2.0 4155 CSeq: 2 4156 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4157 Accept-Ranges: NPT, SMPTE, UTC 4158 User-Agent: PhonyClient/1.2 4160 S->C: RTSP/2.0 200 OK 4161 CSeq: 2 4162 Date: Thu, 05 Jun 1997 18:57:18 GMT 4163 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 4164 Session: 12345678 4165 Accept-Ranges: NPT 4166 Media-Properties: Random-Access=0.2, Immutable, Unlimited 4168 C->S: PLAY rtsp://example.com/bar.file RTSP/2.0 4169 CSeq: 3 4170 Session: 12345678 4171 User-Agent: PhonyClient/1.2 4173 S->C: RTSP/2.0 200 OK 4174 CSeq: 3 4175 Session: 12345678 4176 Date: Thu, 05 Jun 1997 18:57:19 GMT 4177 RTP-Info: url="rtsp://example.com/bar.file" 4178 ssrc=0D12F123:seq=232433;rtptime=972948234 4179 Range: npt=0-56.8 4180 Seek-Style: RAP 4182 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4183 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4184 S->C: $006{2 byte length}{"length" bytes RTCP packet} 4186 15. Status Code Definitions 4188 Where applicable, HTTP status [H10] codes are reused. Status codes 4189 that have the same meaning are not repeated here. See Table 4 in 4190 Section 8.1 for a listing of which status codes may be returned by 4191 which requests. All error messages, 4xx and 5xx MAY return a body 4192 containing further information about the error. 4194 15.1. Success 1xx 4196 15.1.1. 100 Continue 4198 The client SHOULD continue with its request. This interim response 4199 is used to inform the client that the initial part of the request has 4200 been received and has not yet been rejected by the server. The 4201 client SHOULD continue by sending the remainder of the request or, if 4202 the request has already been completed, ignore this response. The 4203 server MUST send a final response after the request has been 4204 completed. 4206 15.2. Success 2xx 4208 This class of status code indicates that the client's request was 4209 successfully received, understood, and accepted. 4211 15.2.1. 200 OK 4213 The request has succeeded. The information returned with the 4214 response is dependent on the method used in the request. 4216 15.3. Redirection 3xx 4218 The notation "3rr" indicates response codes from 300 to 399 inclusive 4219 which are meant for redirection. The response code 304 is excluded 4220 from this set, as it is not used for redirection. 4222 Within RTSP, redirection may be used for load balancing or 4223 redirecting stream requests to a server topologically closer to the 4224 client. Mechanisms to determine topological proximity are beyond the 4225 scope of this specification. 4227 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 4228 that they are used if necessary before a session is established, 4229 i.e., in response to DESCRIBE or SETUP. However, in cases where a 4230 server is not able to send a REDIRECT request to the client, the 4231 server MAY need to resort to using 3rr responses to inform a client 4232 with an established session about the need for redirecting the 4233 session. If a 3rr response is received for a request in relation to 4234 an established session, the client SHOULD send a TEARDOWN request for 4235 the session, and MAY reestablish the session using the resource 4236 indicated by the Location. 4238 If the Location header is used in a response it MUST contain an 4239 absolute URI pointing out the media resource the client is redirected 4240 to, the URI MUST NOT only contain the host name. 4242 15.3.1. 301 Moved Permanently 4244 The requested resource is moved permanently and resides now at the 4245 URI given by the location header. The user client SHOULD redirect 4246 automatically to the given URI. This response MUST NOT contain a 4247 message-body. The Location header MUST be included in the response. 4249 15.3.2. 302 Found 4251 The requested resource resides temporarily at the URI given by the 4252 Location header. The Location header MUST be included in the 4253 response. This response is intended to be used for many types of 4254 temporary redirects; e.g., load balancing. It is RECOMMENDED that 4255 the server set the reason phrase to something more meaningful than 4256 "Found" in these cases. The user client SHOULD redirect 4257 automatically to the given URI. This response MUST NOT contain a 4258 message-body. 4260 This example shows a client being redirected to a different server: 4262 C->S: SETUP rtsp://example.com/fizzle/foo RTSP/2.0 4263 CSeq: 2 4264 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4265 Accept-Ranges: NPT, SMPTE, UTC 4266 User-Agent: PhonyClient/1.2 4268 S->C: RTSP/2.0 302 Try Other Server 4269 CSeq: 2 4270 Location: rtsp://s2.example.com:8001/fizzle/foo 4272 15.3.3. 303 See Other 4274 This status code MUST NOT be used in RTSP 2.0. However, it was 4275 allowed to use in RTSP 1.0 (RFC 2326). 4277 15.3.4. 304 Not Modified 4279 If the client has performed a conditional DESCRIBE or SETUP (see 4280 Section 16.24) and the requested resource has not been modified, the 4281 server SHOULD send a 304 response. This response MUST NOT contain a 4282 message-body. 4284 The response MUST include the following header fields: 4286 o Date 4288 o MTag and/or Content-Location, if the header(s) would have been 4289 sent in a 200 response to the same request. 4291 o Expires, Cache-Control, and/or Vary, if the field-value might 4292 differ from that sent in any previous response for the same 4293 variant. 4295 This response is independent for the DESCRIBE and SETUP requests. 4296 That is, a 304 response to DESCRIBE does NOT imply that the resource 4297 content is unchanged (only the session description) and a 304 4298 response to SETUP does NOT imply that the resource description is 4299 unchanged. The MTag and If-Match headers may be used to link the 4300 DESCRIBE and SETUP in this manner. 4302 15.3.5. 305 Use Proxy 4304 The requested resource MUST be accessed through the proxy given by 4305 the Location field. The Location field gives the URI of the proxy. 4306 The recipient is expected to repeat this single request via the 4307 proxy. 305 responses MUST only be generated by origin servers. 4309 15.4. Client Error 4xx 4311 15.4.1. 400 Bad Request 4313 The request could not be understood by the server due to malformed 4314 syntax. The client SHOULD NOT repeat the request without 4315 modifications. If the request does not have a CSeq header, the 4316 server MUST NOT include a CSeq in the response. 4318 15.4.2. 401 Unauthorized 4320 The request requires user authentication. The response MUST include 4321 a WWW-Authenticate header (Section 16.57) field containing a 4322 challenge applicable to the requested resource. The client MAY 4323 repeat the request with a suitable Authorization header field. If 4324 the request already included Authorization credentials, then the 401 4325 response indicates that authorization has been refused for those 4326 credentials. If the 401 response contains the same challenge as the 4327 prior response, and the user agent has already attempted 4328 authentication at least once, then the user SHOULD be presented the 4329 message body that was given in the response, since that message body 4330 might include relevant diagnostic information. HTTP access 4331 authentication is explained in [RFC2617]. 4333 15.4.3. 402 Payment Required 4335 This code is reserved for future use. 4337 15.4.4. 403 Forbidden 4339 The server understood the request, but is refusing to fulfill it. 4340 Authorization will not help and the request SHOULD NOT be repeated. 4341 If the server wishes to make public why the request has not been 4342 fulfilled, it SHOULD describe the reason for the refusal in the 4343 message body. If the server does not wish to make this information 4344 available to the client, the status code 404 (Not Found) can be used 4345 instead. 4347 15.4.5. 404 Not Found 4349 The server has not found anything matching the Request-URI. No 4350 indication is given of whether the condition is temporary or 4351 permanent. The 410 (Gone) status code SHOULD be used if the server 4352 knows, through some internally configurable mechanism, that an old 4353 resource is permanently unavailable and has no forwarding address. 4354 This status code is commonly used when the server does not wish to 4355 reveal exactly why the request has been refused, or when no other 4356 response is applicable. 4358 15.4.6. 405 Method Not Allowed 4360 The method specified in the request is not allowed for the resource 4361 identified by the Request-URI. The response MUST include an Allow 4362 header containing a list of valid methods for the requested resource. 4363 This status code is also to be used if a request attempts to use a 4364 method not indicated during SETUP. 4366 15.4.7. 406 Not Acceptable 4368 The resource identified by the request is only capable of generating 4369 response message bodies which have content characteristics not 4370 acceptable according to the Accept headers sent in the request. 4372 The response SHOULD include a message body containing a list of 4373 available message body characteristics and location(s) from which the 4374 user or user agent can choose the one most appropriate. The message 4375 body format is specified by the media type given in the Content-Type 4376 header field. Depending upon the format and the capabilities of the 4377 user agent, selection of the most appropriate choice MAY be performed 4378 automatically. However, this specification does not define any 4379 standard for such automatic selection. 4381 If the response could be unacceptable, a user agent SHOULD 4382 temporarily stop receipt of more data and query the user for a 4383 decision on further actions. 4385 15.4.8. 407 Proxy Authentication Required 4387 This code is similar to 401 (Unauthorized) (Section 15.4.2), but 4388 indicates that the client must first authenticate itself with the 4389 proxy. The proxy MUST return a Proxy-Authenticate header field 4390 (Section 16.33) containing a challenge applicable to the proxy for 4391 the requested resource. 4393 15.4.9. 408 Request Timeout 4395 The client did not produce a request within the time that the server 4396 was prepared to wait. The client MAY repeat the request without 4397 modifications at any later time. 4399 15.4.10. 410 Gone 4401 The requested resource is no longer available at the server and the 4402 forwarding address is not known. This condition is expected to be 4403 considered permanent. If the server does not know, or has no 4404 facility to determine, whether or not the condition is permanent, the 4405 status code 404 (Not Found) SHOULD be used instead. This response is 4406 cacheable unless indicated otherwise. 4408 The 410 response is primarily intended to assist the task of 4409 repository maintenance by notifying the recipient that the resource 4410 is intentionally unavailable and that the server owners desire that 4411 remote links to that resource be removed. Such an event is common 4412 for limited-time, promotional services and for resources belonging to 4413 individuals no longer working at the server's site. It is not 4414 necessary to mark all permanently unavailable resources as "gone" or 4415 to keep the mark for any length of time -- that is left to the 4416 discretion of the owner of the server. 4418 15.4.11. 411 Length Required 4420 The server refuses to accept the request without a defined Content- 4421 Length. The client MAY repeat the request if it adds a valid 4422 Content-Length header field containing the length of the message-body 4423 in the request message. 4425 15.4.12. 412 Precondition Failed 4427 The precondition given in one or more of the request-header fields 4428 evaluated to false when it was tested on the server. This response 4429 code allows the client to place preconditions on the current resource 4430 meta information (header field data) and thus prevent the requested 4431 method from being applied to a resource other than the one intended. 4433 15.4.13. 413 Request Message Body Too Large 4435 The server is refusing to process a request because the request 4436 message body is larger than the server is willing or able to process. 4437 The server MAY close the connection to prevent the client from 4438 continuing the request. 4440 If the condition is temporary, the server SHOULD include a Retry- 4441 After header field to indicate that it is temporary and after what 4442 time the client MAY try again. 4444 15.4.14. 414 Request-URI Too Long 4446 The server is refusing to service the request because the Request-URI 4447 is longer than the server is willing to interpret. This rare 4448 condition is only likely to occur when a client has used a request 4449 with long query information, when the client has descended into a URI 4450 "black hole" of redirection (e.g., a redirected URI prefix that 4451 points to a suffix of itself), or when the server is under attack by 4452 a client attempting to exploit security holes present in some servers 4453 using fixed-length buffers for reading or manipulating the Request- 4454 URI. 4456 15.4.15. 415 Unsupported Media Type 4458 The server is refusing to service the request because the message 4459 body of the request is in a format not supported by the requested 4460 resource for the requested method. 4462 15.4.16. 451 Parameter Not Understood 4464 The recipient of the request does not support one or more parameters 4465 contained in the request. When returning this error message the 4466 sender SHOULD return a message body containing the offending 4467 parameter(s). 4469 15.4.17. 452 reserved 4471 This error code was removed from RFC 2326 [RFC2326] as it is 4472 obsolete. This error code MUST NOT be used anymore. 4474 15.4.18. 453 Not Enough Bandwidth 4476 The request was refused because there was insufficient bandwidth. 4477 This may, for example, be the result of a resource reservation 4478 failure. 4480 15.4.19. 454 Session Not Found 4482 The RTSP session identifier in the Session header is missing, 4483 invalid, or has timed out. 4485 15.4.20. 455 Method Not Valid in This State 4487 The client or server cannot process this request in its current 4488 state. The response MUST contain an Allow header to make error 4489 recovery possible. 4491 15.4.21. 456 Header Field Not Valid for Resource 4493 The server could not act on a required request header. For example, 4494 if PLAY contains the Range header field but the stream does not allow 4495 seeking. This error message may also be used for specifying when the 4496 time format in Range is impossible for the resource. In that case 4497 the Accept-Ranges header MUST be returned to inform the client of 4498 which format(s) that are allowed. 4500 15.4.22. 457 Invalid Range 4502 The Range value given is out of bounds, e.g., beyond the end of the 4503 presentation. 4505 15.4.23. 458 Parameter Is Read-Only 4507 The parameter to be set by SET_PARAMETER can be read but not 4508 modified. When returning this error message the sender SHOULD return 4509 a message body containing the offending parameter(s). 4511 15.4.24. 459 Aggregate Operation Not Allowed 4513 The requested method may not be applied on the URI in question since 4514 it is an aggregate (presentation) URI. The method may be applied on 4515 a media URI. 4517 15.4.25. 460 Only Aggregate Operation Allowed 4519 The requested method may not be applied on the URI in question since 4520 it is not an aggregate control (presentation) URI. The method may be 4521 applied on the aggregate control URI. 4523 15.4.26. 461 Unsupported Transport 4525 The Transport field did not contain a supported transport 4526 specification. 4528 15.4.27. 462 Destination Unreachable 4530 The data transmission channel could not be established because the 4531 client address could not be reached. This error will most likely be 4532 the result of a client attempt to place an invalid dest_addr 4533 parameter in the Transport field. 4535 15.4.28. 463 Destination Prohibited 4537 The data transmission channel was not established because the server 4538 prohibited access to the client address. This error is most likely 4539 the result of a client attempt to redirect media traffic to another 4540 destination with a dest_addr parameter in the Transport header. 4542 15.4.29. 464 Data Transport Not Ready Yet 4544 The data transmission channel to the media destination is not yet 4545 ready for carrying data. However, the responding agent still expects 4546 that the data transmission channel will be established at some point 4547 in time. Note, however, that this may result in a permanent failure 4548 like 462 "Destination Unreachable". 4550 An example when this error may occur is in the case a client sends a 4551 PLAY request to a server prior to ensuring that the TCP connections 4552 negotiated for carrying media data was successfully established (In 4553 violation of this specification). The server would use this error 4554 code to indicate that the requested action could not be performed due 4555 to the failure of completing the connection establishment. 4557 15.4.30. 465 Notification Reason Unknown 4559 This indicates that the client has received a PLAY_NOTIFY 4560 (Section 13.5) with a Notify-Reason header (Section 16.31) unknown to 4561 the client. 4563 15.4.31. 466 Key Management Error 4565 This indicates that there has been an error in a Key Management 4566 function used in conjunction with a request. For example usage of 4567 MIKEY according to Appendix C.1.4.1 may result in this error. 4569 15.4.32. 470 Connection Authorization Required 4571 The secured connection attempt needs user or client authorization 4572 before proceeding. The next hops certificate is included in this 4573 response in the Accept-Credentials header. 4575 15.4.33. 471 Connection Credentials not accepted 4577 When performing a secure connection over multiple connections, an 4578 intermediary has refused to connect to the next hop and carry out the 4579 request due to unacceptable credentials for the used policy. 4581 15.4.34. 472 Failure to establish secure connection 4583 A proxy fails to establish a secure connection to the next hop RTSP 4584 agent. This is primarily caused by a fatal failure at the TLS 4585 handshake, for example due to server not accepting any cipher suites. 4587 15.5. Server Error 5xx 4589 Response status codes beginning with the digit "5" indicate cases in 4590 which the server is aware that it has erred or is incapable of 4591 performing the request The server SHOULD include a message body 4592 containing an explanation of the error situation, and whether it is a 4593 temporary or permanent condition. User agents SHOULD display any 4594 included message body to the user. These response codes are 4595 applicable to any request method. 4597 15.5.1. 500 Internal Server Error 4599 The server encountered an unexpected condition which prevented it 4600 from fulfilling the request. 4602 15.5.2. 501 Not Implemented 4604 The server does not support the functionality required to fulfill the 4605 request. This is the appropriate response when the server does not 4606 recognize the request method and is not capable of supporting it for 4607 any resource. 4609 15.5.3. 502 Bad Gateway 4611 The server, while acting as a gateway or proxy, received an invalid 4612 response from the upstream server it accessed in attempting to 4613 fulfill the request. 4615 15.5.4. 503 Service Unavailable 4617 The server is currently unable to handle the request due to a 4618 temporary overloading or maintenance of the server. The implication 4619 is that this is a temporary condition which will be alleviated after 4620 some delay. If known, the length of the delay MAY be indicated in a 4621 Retry-After header. If no Retry-After is given, the client SHOULD 4622 handle the response as it would for a 500 response. The client MUST 4623 honor the length, if given in the Retry-After header. 4625 Note: The existence of the 503 status code does not imply that 4626 a server must use it when becoming overloaded. Some servers 4627 may wish to simply refuse the connection. 4629 15.5.5. 504 Gateway Timeout 4631 The server, while acting as a proxy, did not receive a timely 4632 response from the upstream server specified by the URI or some other 4633 auxiliary server (e.g., DNS) it needed to access in attempting to 4634 complete the request. 4636 15.5.6. 505 RTSP Version Not Supported 4638 The server does not support, or refuses to support, the RTSP protocol 4639 version that was used in the request message. The server is 4640 indicating that it is unable or unwilling to complete the request 4641 using the same major version as the client other than with this error 4642 message. The response SHOULD contain a message body describing why 4643 that version is not supported and what other protocols are supported 4644 by that server. 4646 15.5.7. 551 Option not supported 4648 A feature-tag given in the Require or the Proxy-Require fields was 4649 not supported. The Unsupported header MUST be returned stating the 4650 feature for which there is no support. 4652 16. Header Field Definitions 4654 +---------------+----------------+--------+---------+------+ 4655 | method | direction | object | acronym | Body | 4656 +---------------+----------------+--------+---------+------+ 4657 | DESCRIBE | C -> S | P,S | DES | r | 4658 | | | | | | 4659 | GET_PARAMETER | C -> S, S -> C | P,S | GPR | R,r | 4660 | | | | | | 4661 | OPTIONS | C -> S, S -> C | P,S | OPT | | 4662 | | | | | | 4663 | PAUSE | C -> S | P,S | PSE | | 4664 | | | | | | 4665 | PLAY | C -> S | P,S | PLY | | 4666 | | | | | | 4667 | PLAY_NOTIFY | S -> C | P,S | PNY | R | 4668 | | | | | | 4669 | REDIRECT | S -> C | P,S | RDR | | 4670 | | | | | | 4671 | SETUP | C -> S | S | STP | | 4672 | | | | | | 4673 | SET_PARAMETER | C -> S, S -> C | P,S | SPR | R,r | 4674 | | | | | | 4675 | TEARDOWN | C -> S | P,S | TRD | | 4676 | | | | | | 4677 | | S -> C | P | TRD | | 4678 +---------------+----------------+--------+---------+------+ 4680 Table 8: Overview of RTSP methods, their direction, and what objects 4681 (P: presentation, S: stream) they operate on. Body notes if a method 4682 is allowed to carry body and in which direction, R = Request, 4683 r=response. Note: It is allowed for all error messages 4xx and 5xx to 4684 have a body 4686 The general syntax for header fields is covered in Section 5.2. This 4687 section lists the full set of header fields along with notes on 4688 meaning, and usage. The syntax definition for header fields are 4689 present in Section 20.2.3. Throughout this section, we use [HX.Y] to 4690 informational refer to Section X.Y of the current HTTP/1.1 4691 specification RFC 2616 [RFC2616]. Examples of each header field are 4692 given. 4694 Information about header fields in relation to methods and proxy 4695 processing is summarized in Table 9, Table 10, Table 11, and 4696 Table 12. 4698 The "where" column describes the request and response types in which 4699 the header field can be used. Values in this column are: 4701 R: header field may only appear in requests; 4703 r: header field may only appear in responses; 4705 2xx, 4xx, etc.: A numerical value or range indicates response codes 4706 with which the header field can be used; 4708 c: header field is copied from the request to the response. 4710 An empty entry in the "where" column indicates that the header field 4711 may be present in both requests and responses. 4713 The "proxy" column describes the operations a proxy may perform on a 4714 header field. An empty proxy column indicates that the proxy MUST 4715 NOT do any changes to that header, all allowed operations are 4716 explicitly stated: 4718 a: A proxy can add or concatenate the header field if not present. 4720 m: A proxy can modify an existing header field value. 4722 d: A proxy can delete a header field value. 4724 r: A proxy needs to be able to read the header field, and thus 4725 this header field cannot be encrypted. 4727 The rest of the columns relate to the presence of a header field in a 4728 method. The method names when abbreviated, are according to Table 8: 4730 c: Conditional; requirements on the header field depend on the 4731 context of the message. 4733 m: The header field is mandatory. 4735 m*: The header field SHOULD be sent, but clients/servers need to be 4736 prepared to receive messages without that header field. 4738 o: The header field is optional. 4740 *: The header field MUST be present if the message body is not 4741 empty. See Section 16.16, Section 16.18 and Section 5.3 for 4742 details. 4744 -: The header field is not applicable. 4746 "Optional" means that a Client/Server MAY include the header field in 4747 a request or response. The Client/Server behavior when receiving 4748 such headers varies, for some it may ignore the header field, in 4749 other cases it is a request to process the header. This is regulated 4750 by the method and header descriptions. Example of headers that 4751 require processing are the Require and Proxy-Require header fields 4752 discussed in Section 16.41 and Section 16.35. A "mandatory" header 4753 field MUST be present in a request, and MUST be understood by the 4754 Client/Server receiving the request. A mandatory response header 4755 field MUST be present in the response, and the header field MUST be 4756 understood by the Client/Server processing the response. "Not 4757 applicable" means that the header field MUST NOT be present in a 4758 request. If one is placed in a request by mistake, it MUST be 4759 ignored by the Client/Server receiving the request. Similarly, a 4760 header field labeled "not applicable" for a response means that the 4761 Client/Server MUST NOT place the header field in the response, and 4762 the Client/Server MUST ignore the header field in the response. 4764 An RTSP agent MUST ignore extension headers that are not understood. 4766 The From and Location header fields contain an URI. If the URI 4767 contains a comma, or semicolon, the URI MUST be enclosed in double 4768 quotes ("). Any URI parameters are contained within these quotes. 4769 If the URI is not enclosed in double quote, any semicolon-delimited 4770 parameters are header-parameters, not URI parameters. 4772 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4773 | Header | Where | Pro | DE | OPT | STP | PLY | PSE | TRD | 4774 | | | xy | S | | | | | | 4775 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4776 | Accept | R | | o | - | - | - | - | - | 4777 | | | | | | | | | | 4778 | Accept-Credentia | R | rm | o | o | o | o | o | o | 4779 | ls | | | | | | | | | 4780 | | | | | | | | | | 4781 | Accept-Encoding | R | r | o | - | - | - | - | - | 4782 | | | | | | | | | | 4783 | Accept-Language | R | r | o | - | - | - | - | - | 4784 | | | | | | | | | | 4785 | Accept-Ranges | R | r | - | - | m | - | - | - | 4786 | | | | | | | | | | 4787 | Accept-Ranges | r | r | - | - | m | - | - | - | 4788 | | | | | | | | | | 4789 | Accept-Ranges | 456 | r | - | - | - | m | - | - | 4790 | | | | | | | | | | 4791 | Allow | r | am | c | c | c | - | - | - | 4792 | | | | | | | | | | 4793 | Allow | 405 | am | m | m | m | m | m | m | 4794 | | | | | | | | | | 4795 | Authorization | R | | o | o | o | o | o | o | 4796 | | | | | | | | | | 4797 | Bandwidth | R | | o | o | o | o | - | - | 4798 | | | | | | | | | | 4799 | Blocksize | R | | o | - | o | o | - | - | 4800 | | | | | | | | | | 4801 | Cache-Control | | r | o | - | o | - | - | - | 4802 | | | | | | | | | | 4803 | Connection | | ad | o | o | o | o | o | o | 4804 | | | | | | | | | | 4805 | Connection-Crede | 470,4 | ar | o | o | o | o | o | o | 4806 | ntials | 07 | | | | | | | | 4807 | | | | | | | | | | 4808 | Content-Base | r | | o | - | - | - | - | - | 4809 | | | | | | | | | | 4810 | Content-Base | 4xx,5 | | o | o | o | o | o | o | 4811 | | xx | | | | | | | | 4812 | | | | | | | | | | 4813 | Content-Encoding | R | r | - | - | - | - | - | - | 4814 | | | | | | | | | | 4815 | Content-Encoding | r | r | o | - | - | - | - | - | 4816 | | | | | | | | | | 4817 | Content-Encoding | 4xx,5 | r | o | o | o | o | o | o | 4818 | | xx | | | | | | | | 4819 | | | | | | | | | | 4820 | Content-Language | R | r | - | - | - | - | - | - | 4821 | | | | | | | | | | 4822 | Content-Language | r | r | o | - | - | - | - | - | 4823 | | | | | | | | | | 4824 | Content-Language | 4xx,5 | r | o | o | o | o | o | o | 4825 | | xx | | | | | | | | 4826 | | | | | | | | | | 4827 | Content-Length | r | r | * | - | - | - | - | - | 4828 | | | | | | | | | | 4829 | Content-Length | 4xx,5 | r | * | * | * | * | * | * | 4830 | | xx | | | | | | | | 4831 | | | | | | | | | | 4832 | Content-Location | r | r | o | - | - | - | - | - | 4833 | | | | | | | | | | 4834 | Content-Location | 4xx,5 | r | o | o | o | o | o | o | 4835 | | xx | | | | | | | | 4836 | | | | | | | | | | 4837 | Content-Type | r | r | * | - | - | - | - | - | 4838 | | | | | | | | | | 4839 | Content-Type | 4xx,5 | ar | * | * | * | * | * | * | 4840 | | xx | | | | | | | | 4841 | | | | | | | | | | 4842 | CSeq | Rc | rm | m | m | m | m | m | m | 4843 | | | | | | | | | | 4844 | Date | | am | o/ | o/* | o/* | o/* | o/* | o/* | 4845 | | | | * | | | | | | 4846 | | | | | | | | | | 4847 | Expires | r | r | o | - | - | - | - | - | 4848 | | | | | | | | | | 4849 | From | R | r | o | o | o | o | o | o | 4850 | | | | | | | | | | 4851 | If-Match | R | r | - | - | o | - | - | - | 4852 | | | | | | | | | | 4853 | If-Modified-Sinc | R | r | o | - | o | - | - | - | 4854 | e | | | | | | | | | 4855 | | | | | | | | | | 4856 | If-None-Match | R | r | o | - | o | - | - | - | 4857 | | | | | | | | | | 4858 | Last-Modified | r | r | o | - | o | - | - | - | 4859 | | | | | | | | | | 4860 | Location | 3rr | | o | o | o | o | o | o | 4861 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4863 Table 9: Overview of RTSP header fields (A-L) related to methods 4864 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4866 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 4867 | Header | Where | Prox | DES | OPT | STP | PLY | PSE | TRD | 4868 | | | y | | | | | | | 4869 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 4870 | Media- | | | - | - | m | m | m | - | 4871 | Properties | | | | | | | | | 4872 | | | | | | | | | | 4873 | Media-Range | | | - | - | m | m | m | - | 4874 | | | | | | | | | | 4875 | MTag | r | r | o | - | o | - | - | - | 4876 | | | | | | | | | | 4877 | Pipelined-Requ | | amdr | - | o | o | o | o | o | 4878 | ests | | | | | | | | | 4879 | | | | | | | | | | 4880 | Proxy- | 407 | amr | m | m | m | m | m | m | 4881 | Authenticate | | | | | | | | | 4882 | | | | | | | | | | 4883 | Proxy- | R | rd | o | o | o | o | o | o | 4884 | Authorization | | | | | | | | | 4885 | | | | | | | | | | 4886 | Proxy- Require | R | ar | o | o | o | o | o | o | 4887 | | | | | | | | | | 4888 | Proxy- Require | r | r | c | c | c | c | c | c | 4889 | | | | | | | | | | 4890 | Proxy- | R | amr | c | c | c | c | c | c | 4891 | Supported | | | | | | | | | 4892 | Proxy- | r | | c | c | c | c | c | c | 4893 | Supported | | | | | | | | | 4894 | | | | | | | | | | 4895 | Public | r | amr | - | m | - | - | - | - | 4896 | | | | | | | | | | 4897 | Public | 501 | amr | m | m | m | m | m | m | 4898 | | | | | | | | | | 4899 | Range | R | | - | - | - | o | - | - | 4900 | | | | | | | | | | 4901 | Range | r | | - | - | c | m | m | - | 4902 | | | | | | | | | | 4903 | Referrer | R | | o | o | o | o | o | o | 4904 | | | | | | | | | | 4905 | Request- | R | | - | - | - | - | - | - | 4906 | Status | | | | | | | | | 4907 | | | | | | | | | | 4908 | Require | R | | o | o | o | o | o | o | 4909 | | | | | | | | | | 4910 | Retry-After | 3rr,5 | | o | o | o | o | o | - | 4911 | | 03 | | | | | | | | 4912 | | | | | | | | | | 4913 | Retry-After | 413 | | o | - | - | - | - | - | 4914 | | | | | | | | | | 4915 | RTP-Info | r | | - | - | c | c | - | - | 4916 | | | | | | | | | | 4917 | Scale | R | r | - | - | - | o | - | - | 4918 | | | | | | | | | | 4919 | Scale | r | amr | - | - | - | c | - | - | 4920 | | | | | | | | | | 4921 | Seek-Style | R | | - | - | - | o | - | - | 4922 | | | | | | | | | | 4923 | Seek-Style | r | | - | - | - | m | - | - | 4924 | | | | | | | | | | 4925 | Server | R | r | - | o | - | - | - | o | 4926 | | | | | | | | | | 4927 | Server | r | r | o | o | o | o | o | o | 4928 | | | | | | | | | | 4929 | Session | R | r | - | o | o | m | m | m | 4930 | | | | | | | | | | 4931 | Session | r | r | - | c | m | m | m | o | 4932 | | | | | | | | | | 4933 | Speed | R | admr | - | - | - | o | - | - | 4934 | | | | | | | | | | 4935 | Speed | r | admr | - | - | - | c | - | - | 4936 | | | | | | | | | | 4937 | Supported | R | amr | o | o | o | o | o | o | 4938 | | | | | | | | | | 4939 | Supported | r | amr | c | c | c | c | c | c | 4940 | Terminate-Reas | R | r | - | - | - | - | - | - | 4941 | on | | | | | | | | | 4942 | | | | | | | | | | 4943 | Timestamp | R | admr | o | o | o | o | o | o | 4944 | | | | | | | | | | 4945 | Timestamp | c | admr | m | m | m | m | m | m | 4946 | | | | | | | | | | 4947 | Transport | | mr | - | - | m | - | - | - | 4948 | | | | | | | | | | 4949 | Unsupported | r | | c | c | c | c | c | c | 4950 | | | | | | | | | | 4951 | User-Agent | R | | m* | m* | m* | m* | m* | m* | 4952 | | | | | | | | | | 4953 | Vary | r | | c | c | c | c | c | c | 4954 | | | | | | | | | | 4955 | Via | R | amr | o | o | o | o | o | o | 4956 | | | | | | | | | | 4957 | Via | c | dr | m | m | m | m | m | m | 4958 | | | | | | | | | | 4959 | WWW- | 401 | | m | m | m | m | m | m | 4960 | Authenticate | | | | | | | | | 4961 +----------------+-------+------+-----+-----+-----+-----+-----+-----+ 4963 Table 10: Overview of RTSP header fields (M-W) related to methods 4964 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4966 +------------------------+---------+-------+-----+-----+-----+-----+ 4967 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4968 +------------------------+---------+-------+-----+-----+-----+-----+ 4969 | Accept | R | arm | o | o | - | - | 4970 | | | | | | | | 4971 | Accept-Credentials | R | rm | o | o | o | - | 4972 | | | | | | | | 4973 | Accept-Encoding | TBD | TBD | TBD | TBD | TBD | TBD | 4974 | | | | | | | | 4975 | Accept-Language | TBD | TBD | TBD | TBD | TBD | TBD | 4976 | | | | | | | | 4977 | Accept-Ranges | | rm | o | - | - | - | 4978 | | | | | | | | 4979 | Allow | 405 | amr | m | m | m | - | 4980 | | | | | | | | 4981 | Authorization | R | | o | o | o | - | 4982 | | | | | | | | 4983 | Bandwidth | R | | - | o | - | - | 4984 | | | | | | | | 4985 | Blocksize | R | | - | o | - | - | 4986 | | | | | | | | 4987 | Cache-Control | | r | o | o | - | - | 4988 | Connection | | | o | o | o | o | 4989 | | | | | | | | 4990 | Connection-Credentials | 470,407 | ar | o | o | o | - | 4991 | | | | | | | | 4992 | Content-Base | R | | o | o | - | - | 4993 | | | | | | | | 4994 | Content-Base | r | | o | o | - | - | 4995 | | | | | | | | 4996 | Content-Base | 4xx,5xx | | o | o | o | o | 4997 | | | | | | | | 4998 | Content-Encoding | R | r | o | o | - | - | 4999 | | | | | | | | 5000 | Content-Encoding | r | r | o | o | - | - | 5001 | | | | | | | | 5002 | Content-Encoding | 4xx,5xx | r | o | o | o | o | 5003 | | | | | | | | 5004 | Content-Language | R | r | o | o | - | - | 5005 | | | | | | | | 5006 | Content-Language | r | r | o | o | - | - | 5007 | | | | | | | | 5008 | Content-Language | 4xx,5xx | r | o | o | o | o | 5009 | | | | | | | | 5010 | Content-Length | R | r | * | * | - | - | 5011 | | | | | | | | 5012 | Content-Length | r | r | * | * | - | - | 5013 | | | | | | | | 5014 | Content-Length | 4xx,5xx | r | * | * | * | * | 5015 | | | | | | | | 5016 | Content-Location | R | | o | o | - | - | 5017 | | | | | | | | 5018 | Content-Location | r | | o | o | - | - | 5019 | | | | | | | | 5020 | Content-Location | 4xx,5xx | | o | o | o | o | 5021 | | | | | | | | 5022 | Content-Type | R | | * | * | - | - | 5023 | | | | | | | | 5024 | Content-Type | r | | * | * | - | - | 5025 | | | | | | | | 5026 | Content-Type | 4xx,5xx | | * | * | * | * | 5027 | | | | | | | | 5028 | CSeq | R,c | mr | m | m | m | m | 5029 | | | | | | | | 5030 | Date | R | a | o | o | m | o | 5031 | | | | | | | | 5032 | Date | r | am | o | o | o | o | 5033 | | | | | | | | 5034 | Expires | TBD | TBD | TBD | TBD | TBD | TBD | 5035 | | | | | | | | 5036 | From | R | r | o | o | o | - | 5037 | | | | | | | | 5038 | If-Match | TBD | TBD | TBD | TBD | TBD | TBD | 5039 | | | | | | | | 5040 | If-Modified-Since | R | am | o | - | - | - | 5041 | | | | | | | | 5042 | If-None-Match | R | am | o | - | - | - | 5043 | | | | | | | | 5044 | Last-Modified | R | r | - | - | - | - | 5045 | | | | | | | | 5046 | Last-Modified | r | r | o | - | - | - | 5047 | | | | | | | | 5048 | Location | 3rr | | o | o | o | - | 5049 | | | | | | | | 5050 | Location | R | | - | - | m | - | 5051 | | | | | | | | 5052 | Media-Properties | R | amr | o | - | - | c | 5053 | | | | | | | | 5054 | Media-Properties | r | mr | c | - | - | - | 5055 | | | | | | | | 5056 | Media-Range | R | | o | - | - | c | 5057 | | | | | | | | 5058 | Media-Range | r | | c | - | - | - | 5059 | | | | | | | | 5060 | MTag | TBD | TBD | TBD | TBD | TBD | TBD | 5061 | | | | | | | | 5062 | Notify-Reason | R | | - | - | - | m | 5063 | | | | | | | | 5064 | Pipelined-Requests | R | amdr | o | o | - | - | 5065 | | | | | | | | 5066 | Proxy-Authenticate | 407 | amr | m | m | m | - | 5067 | | | | | | | | 5068 | Proxy-Authorization | R | rd | o | o | o | - | 5069 | | | | | | | | 5070 | Proxy-Require | R | ar | o | o | o | - | 5071 | | | | | | | | 5072 | Proxy-Require | r | r | c | c | c | - | 5073 | | | | | | | | 5074 | Proxy-Supported | R | amr | c | c | c | - | 5075 | | | | | | | | 5076 | Proxy-Supported | r | | c | c | c | - | 5077 | | | | | | | | 5078 | Public | 501 | admr | m | m | m | - | 5079 +------------------------+---------+-------+-----+-----+-----+-----+ 5081 Table 11: Overview of RTSP header fields (A-P) related to methods 5082 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5084 +------------------+---------+-------+-----+-----+-----+-----+ 5085 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 5086 +------------------+---------+-------+-----+-----+-----+-----+ 5087 | Range | R | | o | - | o | m | 5088 | | | | | | | | 5089 | Referrer | R | | o | o | o | - | 5090 | | | | | | | | 5091 | Request-Status | R | | - | - | - | c | 5092 | | | | | | | | 5093 | Require | R | r | o | o | o | - | 5094 | | | | | | | | 5095 | Retry-After | 3rr,503 | | o | o | - | - | 5096 | | | | | | | | 5097 | Retry-After | 413 | | o | o | - | - | 5098 | | | | | | | | 5099 | RTP-Info | R | r | o | - | - | C | 5100 | | | | | | | | 5101 | RTP-Info | r | r | c | - | - | - | 5102 | | | | | | | | 5103 | Scale | | | - | - | - | c | 5104 | | | | | | | | 5105 | Seek-Style | | | - | - | - | - | 5106 | | | | | | | | 5107 | Server | R | r | o | o | o | o | 5108 | | | | | | | | 5109 | Server | r | r | o | o | - | - | 5110 | | | | | | | | 5111 | Session | R | r | o | o | o | m | 5112 | | | | | | | | 5113 | Session | r | r | c | c | o | m | 5114 | | | | | | | | 5115 | Speed | | | - | - | - | - | 5116 | | | | | | | | 5117 | Supported | R | adrm | o | o | o | - | 5118 | | | | | | | | 5119 | Supported | r | adrm | c | c | c | - | 5120 | | | | | | | | 5121 | Terminate-Reason | R | r | - | - | m | - | 5122 | | | | | | | | 5123 | Timestamp | R | adrm | o | o | o | - | 5124 | | | | | | | | 5125 | Timestamp | c | adrm | m | m | m | - | 5126 | | | | | | | | 5127 | Transport | TBD | TBD | TBD | TBD | TBD | TBD | 5128 | | | | | | | | 5129 | Unsupported | r | arm | c | c | c | - | 5130 | | | | | | | | 5131 | User-Agent | R | r | m* | m* | - | - | 5132 | User-Agent | r | r | m* | m* | m* | m* | 5133 | | | | | | | | 5134 | Vary | r | | c | c | - | - | 5135 | | | | | | | | 5136 | Via | R | amr | o | o | o | - | 5137 | | | | | | | | 5138 | Via | c | dr | m | m | m | - | 5139 | | | | | | | | 5140 | WWW-Authenticate | 401 | | m | m | m | - | 5141 +------------------+---------+-------+-----+-----+-----+-----+ 5143 Table 12: Overview of RTSP header fields (R-W) related to methods 5144 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5146 16.1. Accept 5148 The Accept request-header field can be used to specify certain 5149 presentation description and parameter media types [RFC4288] which 5150 are acceptable for the response to DESCRIBE and GET_PARAMETER 5151 requests. 5153 See Section 20.2.3 for the syntax. 5155 Example of use: 5156 Accept: application/example ;q=1.0, application/sdp 5158 16.2. Accept-Credentials 5160 The Accept-Credentials header is a request header used to indicate to 5161 any trusted intermediary how to handle further secured connections to 5162 proxies or servers. See Section 19 for the usage of this header. It 5163 MUST NOT be included in server to client requests. 5165 In a request the header MUST contain the method (User, Proxy, or Any) 5166 for approving credentials selected by the requester. The method MUST 5167 NOT be changed by any proxy, unless it is "Proxy" when a proxy MAY 5168 change it to "user" to take the role of user approving each further 5169 hop. If the method is "User" the header contains zero or more of 5170 credentials that the client accepts. The header may contain zero 5171 credentials in the first RTSP request to a RTSP server when using the 5172 "User" method. This as the client has not yet received any 5173 credentials to accept. Each credential MUST consist of one URI 5174 identifying the proxy or server, the hash algorithm identifier, and 5175 the hash over that agent's DER encoded certificate [RFC5280] in 5176 Base64 [RFC4648]. All RTSP clients and proxies MUST implement the 5177 SHA-256[FIPS-pub-180-2] algorithm for computation of the hash of the 5178 DER encoded certificate. The SHA-256 algorithm is identified by the 5179 token "sha-256". 5181 The intention with allowing for other hash algorithms is to enable 5182 the future retirement of algorithms that are not implemented 5183 somewhere else than here. Thus the definition of future algorithms 5184 for this purpose is intended to be extremely limited. A feature tag 5185 can be used to ensure that support for the replacement algorithm 5186 exist. 5188 Example: 5189 Accept-Credentials:User 5190 "rtsps://proxy2.example.com/";sha-256;exaIl9VMbQMOFGClx5rXnPJKVNI=, 5191 "rtsps://server.example.com/";sha-256;lurbjj5khhB0NhIuOXtt4bBRH1M= 5193 16.3. Accept-Encoding 5195 The Accept-Encoding request-header field is similar to Accept, but 5196 restricts the content-codings (see Section 16.14),i.e. transformation 5197 codings of the message body, such as gzip compression, that are 5198 acceptable in the response. 5200 A server tests whether a content-coding is acceptable, according to 5201 an Accept-Encoding field, using these rules: 5203 1. If the content-coding is one of the content-codings listed in the 5204 Accept-Encoding field, then it is acceptable, unless it is 5205 accompanied by a qvalue of 0. (As defined in [H3.9], a qvalue of 5206 0 means "not acceptable.") 5208 2. The special "*" symbol in an Accept-Encoding field matches any 5209 available content-coding not explicitly listed in the header 5210 field. 5212 3. If multiple content-codings are acceptable, then the acceptable 5213 content-coding with the highest non-zero qvalue is preferred. 5215 4. The "identity" content-coding is always acceptable, i.e. no 5216 transformation at all, unless specifically refused because the 5217 Accept-Encoding field includes "identity;q=0", or because the 5218 field includes "*;q=0" and does not explicitly include the 5219 "identity" content-coding. If the Accept-Encoding field-value is 5220 empty, then only the "identity" encoding is acceptable. 5222 If an Accept-Encoding field is present in a request, and if the 5223 server cannot send a response which is acceptable according to the 5224 Accept-Encoding header, then the server SHOULD send an error response 5225 with the 406 (Not Acceptable) status code. 5227 If no Accept-Encoding field is present in a request, the server MAY 5228 assume that the client will accept any content coding. In this case, 5229 if "identity" is one of the available content-codings, then the 5230 server SHOULD use the "identity" content-coding, unless it has 5231 additional information that a different content-coding is meaningful 5232 to the client. 5234 16.4. Accept-Language 5236 The Accept-Language request-header field is similar to Accept, but 5237 restricts the set of natural languages that are preferred as a 5238 response to the request. Note that the language specified applies to 5239 the presentation description and any reason phrases, but not the 5240 media content. 5242 A language tag identifies a natural language spoken, written, or 5243 otherwise conveyed by human beings for communication of information 5244 to other human beings. Computer languages are explicitly excluded. 5245 The syntax and registry of RTSP 2.0 language tags is the same as that 5246 defined by [RFC5646]. 5248 Each language-range MAY be given an associated quality value which 5249 represents an estimate of the user's preference for the languages 5250 specified by that range. The quality value defaults to "q=1". For 5251 example: 5253 Accept-Language: da, en-gb;q=0.8, en;q=0.7 5255 would mean: "I prefer Danish, but will accept British English and 5256 other types of English." A language-range matches a language-tag if 5257 it exactly equals the full tag, or if it exactly equals a prefix of 5258 the tag, i.e., the primary-tag in the ABNF, such that the character 5259 following primary-tag is "-". The special range "*", if present in 5260 the Accept-Language field, matches every tag not matched by any other 5261 range present in the Accept-Language field. 5263 Note: This use of a prefix matching rule does not imply that 5264 language tags are assigned to languages in such a way that it is 5265 always true that if a user understands a language with a certain 5266 tag, then this user will also understand all languages with tags 5267 for which this tag is a prefix. The prefix rule simply allows the 5268 use of prefix tags if this is the case. 5270 In the process of selecting a language, each language-tag is assigned 5271 a qualification factor, i.e., if a language being supported by the 5272 client is actually supported by the server and what "preference" 5273 level the language achieves. The quality value (q-value) of the 5274 longest language-range in the field that matches the language-tag is 5275 assigned as the qualification factor for a particalr language-tag. 5276 If no language-range in the field matches the tag, the language 5277 qualification factor assigned is 0. If no Accept-Language header is 5278 present in the request, the server SHOULD assume that all languages 5279 are equally acceptable. If an Accept-Language header is present, 5280 then all languages which are assigned a qualification factor greater 5281 than 0 are acceptable. 5283 16.5. Accept-Ranges 5285 The Accept-Ranges general-header field allows indication of the 5286 format supported in the Range header. The client MUST include the 5287 header in SETUP requests to indicate which formats it support to 5288 receive in PLAY and PAUSE responses, and REDIRECT requests. The 5289 server MUST include the header in SETUP and 456 error responses to 5290 indicate the formats supported for the resource indicated by the 5291 request URI. The header MAY be included in GET_PARAMETER request and 5292 response pairs. The GET_PARAMETER request MUST contain a Session 5293 header to identify the session context the request is related to. 5294 The requester and responder will indicate their capabilities 5295 regarding Range formats respectively. 5297 Accept-Ranges: NPT, SMPTE 5299 The syntax is defined in Section 20.2.3. 5301 16.6. Allow 5303 The Allow message-header field lists the methods supported by the 5304 resource identified by the Request-URI. The purpose of this field is 5305 to strictly inform the recipient of valid methods associated with the 5306 resource. An Allow header field MUST be present in a 405 (Method Not 5307 Allowed) response. The Allow header MUST also be present in all 5308 OPTIONS responses where the content of the header will not include 5309 exactly the same methods as listed in the Public header. 5311 The Allow MUST also be included in SETUP and DESCRIBE responses, if 5312 the methods allowed for the resource is different than the complete 5313 set of methods defined in this memo. 5315 Example of use: 5316 Allow: SETUP, PLAY, SET_PARAMETER, DESCRIBE 5318 16.7. Authorization 5320 An RTSP client that wishes to authenticate itself with a server using 5321 authentication mechanism from HTTP [RFC2617] , usually, but not 5322 necessarily, after receiving a 401 response, does so by including an 5323 Authorization request-header field with the request. The 5324 Authorization field value consists of credentials containing the 5325 authentication information of the user agent for the realm of the 5326 resource being requested. 5328 If a request is authenticated and a realm specified, the same 5329 credentials SHOULD be valid for all other requests within this realm 5330 (assuming that the authentication scheme itself does not require 5331 otherwise, such as credentials that vary according to a challenge 5332 value or using synchronized clocks). 5334 When a shared cache (see Section 18) receives a request containing an 5335 Authorization field, it MUST NOT return the corresponding response as 5336 a reply to any other request, unless one of the following specific 5337 exceptions holds: 5339 1. If the response includes the "max-age" cache-control directive, 5340 the cache MAY use that response in replying to a subsequent 5341 request. But (if the specified maximum age has passed) a proxy 5342 cache MUST first revalidate it with the origin server, using the 5343 request-headers from the new request to allow the origin server 5344 to authenticate the new request. (This is the defined behavior 5345 for max-age.) If the response includes "max-age=0", the proxy 5346 MUST always revalidate it before re-using it. 5348 2. If the response includes the "must-revalidate" cache-control 5349 directive, the cache MAY use that response in replying to a 5350 subsequent request. But if the response is stale, all caches 5351 MUST first revalidate it with the origin server, using the 5352 request-headers from the new request to allow the origin server 5353 to authenticate the new request. 5355 3. If the response includes the "public" cache-control directive, it 5356 MAY be returned in reply to any subsequent request. 5358 16.8. Bandwidth 5360 The Bandwidth request-header field describes the estimated bandwidth 5361 available to the client, expressed as a positive integer and measured 5362 in kilobits per second. The bandwidth available to the client may 5363 change during an RTSP session, e.g., due to mobility, congestion, 5364 etc. 5366 Clients may not be able to accurately determine the available 5367 bandwidth, for example due to that first hop is not a bottleneck. 5368 For example most local area networks (LAN) will not be a bottleneck 5369 if the server is not in the same LAN. Thus link speeds of WLAN or 5370 Ethernet networks are normally not a basis for estimating the 5371 available bandwidth. Cellular devices or other devices directly 5372 connected to a modem or connection enabling device may more 5373 accurately estimate the bottleneck bandwidth and what is reasonable 5374 share of it for RTSP controlled media. The client will also need to 5375 take into account other traffic sharing the bottleneck. For example 5376 by only assigning a certain fraction to RTSP and its media streams. 5377 It is RECOMMENDED that only clients that has accurate and explicit 5378 information about bandwidth bottlenecks uses this header. 5380 This header is not a substitute for proper congestion control. Only 5381 a method providing an initial estimate and coarsely determine if the 5382 selected content can be delivered at all. 5384 Example: 5385 Bandwidth: 62360 5387 16.9. Blocksize 5389 The Blocksize request-header field is sent from the client to the 5390 media server asking the server for a particular media packet size. 5391 This packet size does not include lower-layer headers such as IP, 5392 UDP, or RTP. The server is free to use a blocksize which is lower 5393 than the one requested. The server MAY truncate this packet size to 5394 the closest multiple of the minimum, media-specific block size, or 5395 override it with the media-specific size if necessary. The block 5396 size MUST be a positive decimal number, measured in octets. The 5397 server only returns an error (4xx) if the value is syntactically 5398 invalid. 5400 16.10. Cache-Control 5402 The Cache-Control general-header field is used to specify directives 5403 that MUST be obeyed by all caching mechanisms along the request/ 5404 response chain. 5406 Cache directives MUST be passed through by a proxy or gateway 5407 application, regardless of their significance to that application, 5408 since the directives may be applicable to all recipients along the 5409 request/response chain. It is not possible to specify a cache- 5410 directive for a specific cache. 5412 Cache-Control should only be specified in a DESCRIBE, GET_PARAMETER, 5413 SET_PARAMETER and SETUP request and its response. Note: Cache- 5414 Control does not govern only the caching of responses as for HTTP, 5415 instead it also applies to the media stream identified by the SETUP 5416 request. The RTSP requests are generally not cacheable, for further 5417 information see Section 18. Below is the description of the cache 5418 directives that can be included in the Cache-Control header. 5420 no-cache: Indicates that the media stream MUST NOT be cached 5421 anywhere. This allows an origin server to prevent caching even 5422 by caches that have been configured to return stale responses 5423 to client requests. Note, there is no security function 5424 enforcing that the content can't be cached. 5426 public: Indicates that the media stream is cacheable by any cache. 5428 private: Indicates that the media stream is intended for a single 5429 user and MUST NOT be cached by a shared cache. A private (non- 5430 shared) cache may cache the media streams. 5432 no-transform: An intermediate cache (proxy) may find it useful to 5433 convert the media type of a certain stream. A proxy might, for 5434 example, convert between video formats to save cache space or 5435 to reduce the amount of traffic on a slow link. Serious 5436 operational problems may occur, however, when these 5437 transformations have been applied to streams intended for 5438 certain kinds of applications. For example, applications for 5439 medical imaging, scientific data analysis and those using end- 5440 to-end authentication all depend on receiving a stream that is 5441 bit-for-bit identical to the original media stream. Therefore, 5442 if a response includes the no-transform directive, an 5443 intermediate cache or proxy MUST NOT change the encoding of the 5444 stream. Unlike HTTP, RTSP does not provide for partial 5445 transformation at this point, e.g., allowing translation into a 5446 different language. 5448 only-if-cached: In some cases, such as times of extremely poor 5449 network connectivity, a client may want a cache to return only 5450 those media streams that it currently has stored, and not to 5451 receive these from the origin server. To do this, the client 5452 may include the only-if-cached directive in a request. If it 5453 receives this directive, a cache SHOULD either respond using a 5454 cached media stream that is consistent with the other 5455 constraints of the request, or respond with a 504 (Gateway 5456 Timeout) status. However, if a group of caches is being 5457 operated as a unified system with good internal connectivity, 5458 such a request MAY be forwarded within that group of caches. 5460 max-stale: Indicates that the client is willing to accept a media 5461 stream that has exceeded its expiration time. If max-stale is 5462 assigned a value, then the client is willing to accept a 5463 response that has exceeded its expiration time by no more than 5464 the specified number of seconds. If no value is assigned to 5465 max-stale, then the client is willing to accept a stale 5466 response of any age. 5468 min-fresh: Indicates that the client is willing to accept a media 5469 stream whose freshness lifetime is no less than its current age 5470 plus the specified time in seconds. That is, the client wants 5471 a response that will still be fresh for at least the specified 5472 number of seconds. 5474 must-revalidate: When the must-revalidate directive is present in a 5475 SETUP response received by a cache, that cache MUST NOT use the 5476 entry after it becomes stale to respond to a subsequent request 5477 without first revalidating it with the origin server. That is, 5478 the cache is required to do an end-to-end revalidation every 5479 time, if, based solely on the origin server's Expires, the 5480 cached response is stale. 5482 proxy-revalidate: The proxy-revalidate directive has the same 5483 meaning as the must-revalidate directive, except that it does 5484 not apply to non-shared user agent caches. It can be used on a 5485 response to an authenticated request to permit the user's cache 5486 to store and later return the response without needing to 5487 revalidate it (since it has already been authenticated once by 5488 that user), while still requiring proxies that service many 5489 users to revalidate each time (in order to make sure that each 5490 user has been authenticated). Note that such authenticated 5491 responses also need the public cache control directive in order 5492 to allow them to be cached at all. 5494 max-age: When an intermediate cache is forced, by means of a max- 5495 age=0 directive, to revalidate its own cache entry, and the 5496 client has supplied its own validator in the request, the 5497 supplied validator might differ from the validator currently 5498 stored with the cache entry. In this case, the cache MAY use 5499 either validator in making its own request without affecting 5500 semantic transparency. 5502 However, the choice of validator might affect performance. The best 5503 approach is for the intermediate cache to use its own validator when 5504 making its request. If the server replies with 304 (Not Modified), 5505 then the cache can return its now validated copy to the client with a 5506 200 (OK) response. If the server replies with a new message body and 5507 cache validator, however, the intermediate cache can compare the 5508 returned validator with the one provided in the client's request, 5509 using the strong comparison function. If the client's validator is 5510 equal to the origin server's, then the intermediate cache simply 5511 returns 304 (Not Modified). Otherwise, it returns the new message 5512 body with a 200 (OK) response. 5514 16.11. Connection 5516 The Connection general-header field allows the sender to specify 5517 options that are desired for that particular connection and MUST NOT 5518 be communicated by proxies over further connections. 5520 RTSP 2.0 proxies MUST parse the Connection header field before a 5521 message is forwarded and, for each connection-token in this field, 5522 remove any header field(s) from the message with the same name as the 5523 connection-token. Connection options are signaled by the presence of 5524 a connection-token in the Connection header field, not by any 5525 corresponding additional header field(s), since the additional header 5526 field may not be sent if there are no parameters associated with that 5527 connection option. 5529 Message headers listed in the Connection header MUST NOT include end- 5530 to-end headers, such as Cache-Control. 5532 RTSP 2.0 defines the "close" connection option for the sender to 5533 signal that the connection will be closed after completion of the 5534 response. For example, Connection: close in either the request or 5535 the response header fields indicates that the connection SHOULD NOT 5536 be considered `persistent' (Section 10.2) after the current request/ 5537 response is complete. 5539 The use of the connection option "close" in RTSP messages SHOULD be 5540 limited to error messages when the server is unable to recover and 5541 therefore see it necessary to close the connection. The reason is 5542 that the client has the choice of continuing using a connection 5543 indefinitely, as long as it sends valid messages. 5545 16.12. Connection-Credentials 5547 The Connection-Credentials response header is used to carry the chain 5548 of credentials of any next hop that need to be approved by the 5549 requester. It MUST only be used in server to client responses. 5551 The Connection-Credentials header in an RTSP response MUST, if 5552 included, contain the credential information (in form of a list of 5553 certificates providing the chain of certification) of the next hop 5554 that an intermediary needs to securely connect to. The header MUST 5555 include the URI of the next hop (proxy or server) and a base64 5556 [RFC4648] encoded binary structure containing a sequence of DER 5557 encoded X.509v3 certificates[RFC5280] . 5559 The binary structure starts with the number of certificates 5560 (NR_CERTS) included as a 16 bit unsigned integer. This is followed 5561 by NR_CERTS number of 16 bit unsigned integers providing the size in 5562 octets of each DER encoded certificate. This is followed by NR_CERTS 5563 number of DER encoded X.509v3 certificates in a sequence (chain). 5564 The proxy or server's certificate must come first in the structure. 5565 Each following certificate must directly certify the one preceding 5566 it. Because certificate validation requires that root keys be 5567 distributed independently, the self-signed certificate which 5568 specifies the root certificate authority may optionally be omitted 5569 from the chain, under the assumption that the remote end must already 5570 possess it in order to validate it in any case. 5572 Example: 5574 Connection-Credentials:"rtsps://proxy2.example.com/";MIIDNTCC... 5576 Where MIIDNTCC... is a BASE64 encoding of the following structure: 5578 0 1 2 3 5579 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 5580 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5581 | Number of certificates | Size of certificate #1 | 5582 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5583 | Size of certificate #2 | Size of certificate #3 | 5584 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5585 : DER Encoding of Certificate #1 : 5586 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5587 : DER Encoding of Certificate #2 : 5588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5589 : DER Encoding of Certificate #3 : 5590 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5592 16.13. Content-Base 5594 The Content-Base message-header field may be used to specify the base 5595 URI for resolving relative URIs within the message body. 5597 Content-Base: rtsp://media.example.com/movie/twister/ 5599 If no Content-Base field is present, the base URI of an message body 5600 is defined either by its Content-Location (if that Content-Location 5601 URI is an absolute URI) or the URI used to initiate the request, in 5602 that order of precedence. Note, however, that the base URI of the 5603 contents within the message-body may be redefined within that 5604 message-body. 5606 16.14. Content-Encoding 5608 The Content-Encoding header field is used as a modifier to the media- 5609 type. When present, its value indicates what additional content 5610 codings have been applied to the message body, and thus what decoding 5611 mechanisms must be applied in order to obtain the media-type 5612 referenced by the Content-Type header field. Content-Encoding is 5613 primarily used to allow a document to be compressed without losing 5614 the identity of its underlying media type. 5616 The content-coding is a characteristic of the message body identified 5617 by the Request-URI. Typically, the message body is stored with this 5618 encoding and is only decoded before rendering or analogous usage. 5619 However, a non-transparent proxy MAY modify the content-coding if the 5620 new coding is known to be acceptable to the recipient, unless the 5621 "no-transform" cache-control directive is present in the message. 5623 If the content-coding of a message body is not "identity", then the 5624 response MUST include a Content-Encoding Message-body header that 5625 lists the non-identity content-coding(s) used. 5627 If the content-coding of a message body in a request message is not 5628 acceptable to the origin server, the server SHOULD respond with a 5629 status code of 415 (Unsupported Media Type). 5631 If multiple encodings have been applied to a message body, the 5632 content codings MUST be listed in the order in which they were 5633 applied, first to last from left to right. Additional information 5634 about the encoding parameters MAY be provided by other header fields 5635 not defined by this specification. 5637 16.15. Content-Language 5639 The Content-Language header field describes the natural language(s) 5640 of the intended audience for the enclosed message body. Note that 5641 this might not be equivalent to all the languages used within the 5642 message body. 5644 Language tags are mentioned in Section 16.4. The primary purpose of 5645 Content-Language is to allow a user to identify and differentiate 5646 entities according to the user's own preferred language. Thus, if 5647 the body content is intended only for a Danish-literate audience, the 5648 appropriate field is 5650 Content-Language: da 5652 If no Content-Language is specified, the default is that the content 5653 is intended for all language audiences. This might mean that the 5654 sender does not consider it to be specific to any natural language, 5655 or that the sender does not know for which language it is intended. 5657 Multiple languages MAY be listed for content that is intended for 5658 multiple audiences. For example, a rendition of the "Treaty of 5659 Waitangi," presented simultaneously in the original Maori and English 5660 versions, would call for 5662 Content-Language: mi, en 5664 However, just because multiple languages are present within a message 5665 body does not mean that it is intended for multiple linguistic 5666 audiences. An example would be a beginner's language primer, such as 5667 "A First Lesson in Latin," which is clearly intended to be used by an 5668 English-literate audience. In this case, the Content-Language would 5669 properly only include "en". 5671 Content-Language MAY be applied to any media type -- it is not 5672 limited to textual documents. 5674 16.16. Content-Length 5676 The Content-Length general-header field contains the length of the 5677 message body of the RTSP message (i.e. after the double CRLF 5678 following the last header). Unlike HTTP, it MUST be included in all 5679 messages that carry a message body beyond the header portion of the 5680 RTSP message. If it is missing, a default value of zero is assumed. 5681 Any Content-Length greater than or equal to zero is a valid value. 5683 16.17. Content-Location 5685 The Content-Location header field MAY be used to supply the resource 5686 location for the message body enclosed in the message when that body 5687 is accessible from a location separate from the requested resource's 5688 URI. A server SHOULD provide a Content-Location for the variant 5689 corresponding to the response message body; especially in the case 5690 where a resource has multiple variants associated with it, and those 5691 entities actually have separate locations by which they might be 5692 individually accessed, the server SHOULD provide a Content-Location 5693 for the particular variant which is returned. 5695 The Content-Location value is not a replacement for the original 5696 requested URI; it is only a statement of the location of the resource 5697 corresponding to this particular variant at the time of the request. 5698 Future requests MAY specify the Content-Location URI as the request 5699 URI if the desire is to identify the source of that particular 5700 variant. This is useful if the RTSP agent desires to verify if the 5701 resource variant is current through a conditional request. 5703 A cache cannot assume that a message body with a Content-Location 5704 different from the URI used to retrieve it can be used to respond to 5705 later requests on that Content-Location URI. However, the Content- 5706 Location can be used to differentiate between multiple variants 5707 retrieved from a single requested resource. 5709 If the Content-Location is a relative URI, the relative URI is 5710 interpreted relative to the Request-URI. 5712 Note, that Content-Location can be used in some cases to derive the 5713 base-URI for relative URI present in session description formats. 5714 This needs to be taken into account when Content-Location is used. 5715 The easiest way to avoid needing to consider that issue is to include 5716 the Content-Base whenever the Content-Location is included. 5718 Note also, when using Media Tags in conjunction with Content-Location 5719 it is important that the different versions have different MTags, 5720 even if provided under different Content-Location URIs. This as they 5721 have still been provided under the same request URI. 5723 Note also, as in most cases the URI used in the DESCRIBE and the 5724 SETUP requests are different, the URI provided in a DESCRIBE Content- 5725 Location response can't directly be used in a SETUP request. Instead 5726 the extra step of resolving URIs combined with the media descriptions 5727 indication, like with SDP's a=control attribute. 5729 16.18. Content-Type 5731 The Content-Type header indicates the media type of the message body 5732 sent to the recipient. Note that the content types suitable for RTSP 5733 are likely to be restricted in practice to presentation descriptions 5734 and parameter-value types. 5736 16.19. CSeq 5738 The CSeq general-header field specifies the sequence number for an 5739 RTSP request-response pair. This field MUST be present in all 5740 requests and responses. For every RTSP request containing the given 5741 sequence number, the corresponding response will have the same 5742 number. Any retransmitted request MUST contain the same sequence 5743 number as the original (i.e., the sequence number is not incremented 5744 for retransmissions of the same request). For each new RTSP request 5745 the CSeq value MUST be incremented by one. The initial sequence 5746 number MAY be any number, however, it is RECOMMENDED to start at 0. 5747 Each sequence number series is unique between each requester and 5748 responder, i.e., the client has one series for its request to a 5749 server and the server has another when sending request to the client. 5750 Each requester and responder is identified with its socket address 5751 (IP address and port number). 5753 Proxies that aggregate several sessions on the same transport will 5754 have to ensure that the requests sent towards a particular server 5755 have a joint sequence number space, i.e., they will regularly need to 5756 renumber the CSeq header field in requests (from proxy to server) and 5757 responses (from server to proxy) to fulfill the rules for the header. 5758 The proxy MUST increase the CSeq by one for each request it 5759 transmits, without regard of different sessions. 5761 Example: 5762 CSeq: 239 5764 16.20. Date 5766 The Date header field represents the date and time at which the 5767 message was originated. The inclusion of the Date header in RTSP 5768 message follows these rules: 5770 o An RTSP message, sent either by the client or the server, 5771 containing a body MUST include a Date header, if the sending host 5772 has a clock; 5774 o Clients and servers are RECOMMENDED to include a Date header in 5775 all other RTSP messages, if the sending host has a clock; 5777 o If the server does not have a clock that can provide a reasonable 5778 approximation of the current time, its responses MUST NOT include 5779 a Date header field. In this case, this rule MUST be followed: 5780 Some origin server implementations might not have a clock 5781 available. An origin server without a clock MUST NOT assign 5782 Expires or Last-Modified values to a response, unless these values 5783 were associated with the resource by a system or user with a 5784 reliable clock. It MAY assign an Expires value that is known, at 5785 or before server configuration time, to be in the past (this 5786 allows "pre-expiration" of responses without storing separate 5787 Expires values for each resource). 5789 A received message that does not have a Date header field MUST be 5790 assigned one by the recipient if the message will be cached by that 5791 recipient . An RTSP implementation without a clock MUST NOT cache 5792 responses without revalidating them on every use. An RTSP cache, 5793 especially a shared cache, SHOULD use a mechanism, such as NTP, to 5794 synchronize its clock with a reliable external standard. 5796 The RTSP-date sent in a Date header SHOULD NOT represent a date and 5797 time subsequent to the generation of the message. It SHOULD 5798 represent the best available approximation of the date and time of 5799 message generation, unless the implementation has no means of 5800 generating a reasonably accurate date and time. In theory, the date 5801 ought to represent the moment just before the message body is 5802 generated. In practice, the date can be generated at any time during 5803 the message origination without affecting its semantic value. 5805 16.21. Expires 5807 The Expires message-header field gives a date and time after which 5808 the description or media-stream should be considered stale. The 5809 interpretation depends on the method: 5811 DESCRIBE response: The Expires header indicates a date and time 5812 after which the presentation description (body) SHOULD be 5813 considered stale. 5815 SETUP response: The Expires header indicate a date and time after 5816 which the media stream SHOULD be considered stale. 5818 A stale cache entry may not normally be returned by a cache (either a 5819 proxy cache or an user agent cache) unless it is first validated with 5820 the origin server (or with an intermediate cache that has a fresh 5821 copy of the message body). See Section 18 for further discussion of 5822 the expiration model. 5824 The presence of an Expires field does not imply that the original 5825 resource will change or cease to exist at, before, or after that 5826 time. 5828 The format is an absolute date and time as defined by RTSP-date. An 5829 example of its use is 5830 Expires: Thu, 01 Dec 1994 16:00:00 GMT 5832 RTSP/2.0 clients and caches MUST treat other invalid date formats, 5833 especially including the value "0", as having occurred in the past 5834 (i.e., already expired). 5836 To mark a response as "already expired," an origin server should use 5837 an Expires date that is equal to the Date header value. To mark a 5838 response as "never expires," an origin server SHOULD use an Expires 5839 date approximately one year from the time the response is sent. 5840 RTSP/2.0 servers SHOULD NOT send Expires dates more than one year in 5841 the future. 5843 16.22. From 5845 The From request-header field, if given, SHOULD contain an Internet 5846 e-mail address for the human user who controls the requesting user 5847 agent. The address SHOULD be machine-usable, as defined by "mailbox" 5848 in [RFC1123]. 5850 This header field MAY be used for logging purposes and as a means for 5851 identifying the source of invalid or unwanted requests. It SHOULD 5852 NOT be used as an insecure form of access protection. The 5853 interpretation of this field is that the request is being performed 5854 on behalf of the person given, who accepts responsibility for the 5855 method performed. In particular, robot agents SHOULD include this 5856 header so that the person responsible for running the robot can be 5857 contacted if problems occur on the receiving end. 5859 The Internet e-mail address in this field MAY be separate from the 5860 Internet host which issued the request. For example, when a request 5861 is passed through a proxy the original issuer's address SHOULD be 5862 used. 5864 The client SHOULD NOT send the From header field without the user's 5865 approval, as it might conflict with the user's privacy interests or 5866 their site's security policy. It is strongly recommended that the 5867 user be able to disable, enable, and modify the value of this field 5868 at any time prior to a request. 5870 16.23. If-Match 5872 The If-Match request-header field is especially useful for ensuring 5873 the integrity of the presentation description, independent of how the 5874 presentation description was received. The presentation description 5875 can be fetched via means external to RTSP (such as HTTP) or via the 5876 DESCRIBE message. In the case of retrieving the presentation 5877 description via RTSP, the server implementation is guaranteeing the 5878 integrity of the description between the time of the DESCRIBE message 5879 and the SETUP message. By including the MTag given in or with the 5880 session description in an If-Match header part of the SETUP request, 5881 the client ensures that resources set up are matching the 5882 description. A SETUP request with the If-Match header for which the 5883 MTag validation check fails, MUST response using 412 (Precondition 5884 Failed). 5886 This validation check is also very useful if a session has been 5887 redirected from one server to another. 5889 16.24. If-Modified-Since 5891 The If-Modified-Since request-header field is used with the DESCRIBE 5892 and SETUP methods to make them conditional. If the requested variant 5893 has not been modified since the time specified in this field, a 5894 description will not be returned from the server (DESCRIBE) or a 5895 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 5896 response MUST be returned without any message-body. 5898 An example of the field is: 5899 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 5901 16.25. If-None-Match 5903 This request header can be used with one or several message body tags 5904 to make DESCRIBE requests conditional. A client that has one or more 5905 message bodies previously obtained from the resource, can verify that 5906 none of those entities is current by including a list of their 5907 associated message body tags in the If-None-Match header field. The 5908 purpose of this feature is to allow efficient updates of cached 5909 information with a minimum amount of transaction overhead. As a 5910 special case, the value "*" matches any current entity of the 5911 resource. 5913 If any of the message body tags match the message body tag of the 5914 message body that would have been returned in the response to a 5915 similar DESCRIBE request (without the If-None-Match header) on that 5916 resource, or if "*" is given and any current entity exists for that 5917 resource, then the server MUST NOT perform the requested method, 5918 unless required to do so because the resource's modification date 5919 fails to match that supplied in an If-Modified-Since header field in 5920 the request. Instead, if the request method was DESCRIBE, the server 5921 SHOULD respond with a 304 (Not Modified) response, including the 5922 cache-related header fields (particularly MTag) of one of the message 5923 bodies that matched. For all other request methods, the server MUST 5924 respond with a status of 412 (Precondition Failed). 5926 See Section 18.1.3 for rules on how to determine if two message body 5927 tags match. 5929 If none of the message body tags match, then the server MAY perform 5930 the requested method as if the If-None-Match header field did not 5931 exist, but MUST also ignore any If-Modified-Since header field(s) in 5932 the request. That is, if no message body tags match, then the server 5933 MUST NOT return a 304 (Not Modified) response. 5935 If the request would, without the If-None-Match header field, result 5936 in anything other than a 2xx or 304 status, then the If-None-Match 5937 header MUST be ignored. (See Section 18.1.4 for a discussion of 5938 server behavior when both If-Modified-Since and If-None-Match appear 5939 in the same request.) 5941 The result of a request having both an If-None-Match header field and 5942 an If-Match header field is unspecified and MUST be considered an 5943 illegal request. 5945 16.26. Last-Modified 5947 The Last-Modified message-header field indicates the date and time at 5948 which the origin server believes the presentation description or 5949 media stream was last modified. For the method DESCRIBE, the header 5950 field indicates the last modification date and time of the 5951 description, for SETUP that of the media stream. 5953 An origin server MUST NOT send a Last-Modified date which is later 5954 than the server's time of message origination. In such cases, where 5955 the resource's last modification would indicate some time in the 5956 future, the server MUST replace that date with the message 5957 origination date. 5959 An origin server SHOULD obtain the Last-Modified value of the message 5960 body as close as possible to the time that it generates the Date 5961 value of its response. This allows a recipient to make an accurate 5962 assessment of the message body's modification time, especially if the 5963 message body changes near the time that the response is generated. 5965 RTSP servers SHOULD send Last-Modified whenever feasible. 5967 16.27. Location 5969 The Location response-header field is used to redirect the recipient 5970 to a location other than the Request-URI for completion of the 5971 request or identification of a new resource. For 3xx responses, the 5972 location SHOULD indicate the server's preferred URI for automatic 5973 redirection to the resource. The field value consists of a single 5974 absolute URI. 5976 Note: The Content-Location header field (Section 16.17) differs from 5977 Location in that the Content-Location identifies the original 5978 location of the message body enclosed in the request. It is 5979 therefore possible for a response to contain header fields for both 5980 Location and Content-Location. Also, see Section 18.2 for cache 5981 requirements of some methods. 5983 16.28. Media-Properties 5985 This general header is used in SETUP response or PLAY_NOTIFY requests 5986 to indicate the media's properties that currently are applicable to 5987 the RTSP session. PLAY_NOTIFY MAY be used to modify these properties 5988 at any point. However, the client SHOULD have received the update 5989 prior to any action related to the new media properties take effect. 5990 For aggregated sessions, the Media-Properties header will be returned 5991 in each SETUP response. The header received in the latest response 5992 is the one that applies on the whole session from this point until 5993 any future update. The header MAY be included without value in 5994 GET_PARAMETER requests to the server with a Session header included 5995 to query the current Media-Properties for the session. The responder 5996 MUST include the current session's media properties. 5998 The media properties expressed by this header is the one applicable 5999 to all media in the RTSP session. For aggregated sessions, the 6000 header expressed the combined media-properties. As a result, 6001 aggregation of media MAY result in a change of the media properties, 6002 and thus the content of the Media-Properties header contained in 6003 subsequent SETUP responses. 6005 The header contains a list of property values that are applicable to 6006 the currently setup media or aggregate of media as indicated by the 6007 RTSP URI in the request. No ordering is enforced within the header. 6008 Property values should be grouped into a single group that handles a 6009 particular orthogonal property. Values or groups that express 6010 multiple properties SHOULD NOT be used. The list of properties that 6011 can be expressed MAY be extended at any time. Unknown property 6012 values MUST be ignored. 6014 This specification defines the following 4 groups and their property 6015 values: 6017 Random Access: 6019 Random-Access: Indicates that random access is possible. May 6020 optionally include a floating point value in seconds indicating 6021 the longest duration between any two random access points in 6022 the media. 6024 Begining-Only: Seeking is limited to the beginning only. 6026 No-Seeking: No seeking is possible. 6028 Content Modifications: 6030 Immutable: The content will not be changed during the life-time 6031 of the RTSP session. 6033 Dynamic: The content may be changed based on external methods or 6034 triggers 6036 Time-Progressing The media accessible progresses as wallclock 6037 time progresses. 6039 Retention: 6041 Unlimited: Content will be retained for the duration of the life- 6042 time of the RTSP session. 6044 Time-Limited: Content will be retained at least until the 6045 specified wallclock time. The time must be provided in the 6046 absolute time format specified in Section 4.6. 6048 Time-Duration Each individual media unit is retained for at least 6049 the specified time duration. This definition allows for 6050 retaining data with a time based sliding window. The time 6051 duration is expressed as floating point number in seconds. 0.0 6052 is a valid value as this indicates that no data is retained in 6053 a time-progressing session. 6055 Supported Scale: 6057 Scales: A quoted comma separated list of one or more decimal 6058 values or ranges of scale values supported by the content in 6059 arbitrary order. A range has a start and stop value separated 6060 by a colon. A range indicates that the content supports fine 6061 grained selection of scale values. Fine grained allows for 6062 steps at least as small as one tenth of a scale value. 6063 Negative values are supported. The value 0 has no meaning and 6064 MUST NOT be used. 6066 Examples of this header for on-demand content and a live stream 6067 without recording are: 6069 On-demand: 6070 Media-Properties: Random-Access=2.5s, Unlimited, Immutable, 6071 Scales="-20, -10, -4, 0.5:1.5, 4, 8, 10, 15, 20" 6073 Live stream without recording/timeshifting: 6074 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0.0 6076 16.29. Media-Range 6078 The Media-Range general header is used to give the range of the media 6079 at the time of sending the RTSP message. This header MUST be 6080 included in SETUP response, and PLAY and PAUSE response for media 6081 that are Time-Progressing, and PLAY and PAUSE response after any 6082 change for media that are Dynamic, and in PLAY_NOTIFY request that 6083 are sent due to Media-Property-Update. Media-Range header without 6084 any range specifications MAY be included in GET_PARAMETER requests to 6085 the server to request the current range. The server MUST in this 6086 case include the current range at the time of sending the response. 6088 The header MUST include range specifications for all time formats 6089 supported for the media, as indicated in Accept-Ranges header 6090 (Section 16.5) when setting up the media. The server MAY include 6091 more than one range specification of any given time format to 6092 indicate media that has non-continuous range. 6094 For media that has the Time-Progressing property, the Media-Range 6095 values will only be valid for the particular point in time when it 6096 was issued. As wallclock progresses so will also the media range. 6097 However, it shall be assumed that media time progresses in direct 6098 relationship to wallclock time (with the exception of clock skew) so 6099 that a reasonably accurate estimation of the media range can be 6100 calculated. 6102 16.30. MTag 6104 The MTag response header MAY be included in DESCRIBE, GET_PARAMETER 6105 or SETUP responses. The message body tags (Section 4.8) returned in 6106 a DESCRIBE response, and the one in SETUP refers to the presentation, 6107 i.e. both the returned session description and the media stream. 6108 This allows for verification that one has the right session 6109 description to a media resource at the time of the SETUP request. 6110 However, it has the disadvantage that a change in any of the parts 6111 results in invalidation of all the parts. 6113 If the MTag is provided both inside the message body, e.g. within the 6114 "a=mtag" attribute in SDP, and in the response message, then both 6115 tags MUST be identical. It is RECOMMENDED that the MTag is primarily 6116 given in the RTSP response message, to ensure that caches can use the 6117 MTag without requiring content inspection. However, for session 6118 descriptions that are distributed outside of RTSP, for example using 6119 HTTP, etc. it will be necessary to include the message body tag in 6120 the session description as specified in Appendix D.1.9. 6122 SETUP and DESCRIBE requests can be made conditional upon the MTag 6123 using the headers If-Match (Section 16.23) and If-None-Match ( 6124 Section 16.25). 6126 16.31. Notify-Reason 6128 The Notify Reason header is solely used in the PLAY_NOTIFY method. 6129 It indicates the reason why the server has sent the asynchronous 6130 PLAY_NOTIFY request (see Section 13.5). 6132 16.32. Pipelined-Requests 6134 The Pipelined-Requests general header is used to indicate that a 6135 request is to be executed in the context created by a previous 6136 request(s). The primary usage of this header is to allow pipelining 6137 of SETUP requests so that any additional SETUP request after the 6138 first one does not need to wait for the session ID to be sent back to 6139 the requesting agent. The header contains a unique identifier that 6140 is scoped by the persistent connection used to send the requests. 6142 Upon receiving a request with the Pipelined-Requests the responding 6143 agent MUST look up if there exists a binding between this Pipelined- 6144 Requests identifier for the current persistent connection and an RTSP 6145 session ID. If that exists then the received request is processed 6146 the same way as if it contained the Session header with the found 6147 session ID. If there does not exist a mapping and no Session header 6148 is included in the request, the responding agent MUST create a 6149 binding upon the successful completion of a session creating request, 6150 i.e. SETUP. A binding MUST NOT be created, if the request failed to 6151 create an RTSP session. In case the request contains both a Session 6152 header and the Pipelined-Requests header the Pipelined-Requests MUST 6153 be ignored. 6155 Note: Based on the above definition at least the first request 6156 containing a new unique Pipelined-Requests will be required to be a 6157 SETUP request (unless the protocol is extended with new methods of 6158 creating a session). After that first one, additional SETUP requests 6159 or request of any type using the RTSP session context may include the 6160 Pipelined-Requests header. 6162 When responding to any request that contained the Pipelined-Requests 6163 header the server MUST also include the Session header when a binding 6164 to a session context exist. An RTSP agent that knows the session ID 6165 SHOULD NOT use the Pipelined-Requests header in any request and only 6166 use the Session header. This as the Session identifier is persistent 6167 across transport contexts, like TCP connections, which the Pipelined- 6168 Requests identifier is not. 6170 The RTSP agent sending the request with a Pipelined-Requests header 6171 has the responsibility for using a unique and previously unused 6172 identifier within the transport context. Currently only a TCP 6173 connection is defined as such transport context. A server MUST 6174 delete the Pipelined-Requests identifier and its binding to a session 6175 upon the termination of that session. Despite the previous mandate, 6176 RTSP agents are RECOMMENDED to not reuse identifiers to allow for 6177 better error handling and logging. 6179 RTSP Proxies may need to translate Pipelined-Requests identifier 6180 values from incoming request to outgoing to allow for aggregation of 6181 requests onto a persistent connection. 6183 16.33. Proxy-Authenticate 6185 The Proxy-Authenticate response-header field MUST be included as part 6186 of a 407 (Proxy Authentication Required) response. The field value 6187 consists of a challenge that indicates the authentication scheme and 6188 parameters applicable to the proxy for this Request-URI. 6190 The HTTP access authentication process is described in [RFC2617]. 6191 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 6192 only to the current connection and SHOULD NOT be passed on to 6193 downstream agents. However, an intermediate proxy might need to 6194 obtain its own credentials by requesting them from the downstream 6195 agent, which in some circumstances will appear as if the proxy is 6196 forwarding the Proxy-Authenticate header field. 6198 16.34. Proxy-Authorization 6200 The Proxy-Authorization request-header field allows the client to 6201 identify itself (or its user) to a proxy which requires 6202 authentication. The Proxy-Authorization field value consists of 6203 credentials containing the authentication information of the user 6204 agent for the proxy and/or realm of the resource being requested. 6206 The HTTP access authentication process is described in [RFC2617]. 6207 Unlike Authorization, the Proxy-Authorization header field applies 6208 only to the next outbound proxy that demanded authentication using 6209 the Proxy-Authenticate field. When multiple proxies are used in a 6210 chain, the Proxy-Authorization header field is consumed by the first 6211 outbound proxy that was expecting to receive credentials. A proxy 6212 MAY relay the credentials from the client request to the next proxy 6213 if that is the mechanism by which the proxies cooperatively 6214 authenticate a given request. 6216 16.35. Proxy-Require 6218 The Proxy-Require request-header field is used to indicate proxy- 6219 sensitive features that MUST be supported by the proxy. Any Proxy- 6220 Require header features that are not supported by the proxy MUST be 6221 negatively acknowledged by the proxy to the client using the 6222 Unsupported header. The proxy MUST use the 551 (Option Not 6223 Supported) status code in the response. Any feature-tag included in 6224 the Proxy-Require does not apply to the end-point (server or client). 6225 To ensure that a feature is supported by both proxies and servers the 6226 tag needs to be included in also a Require header. 6228 See Section 16.41 for more details on the mechanics of this message 6229 and a usage example. See discussion in the proxies section 6230 (Section 17.1) about when to consider that a feature requires proxy 6231 support. 6233 Example of use: 6234 Proxy-Require: play.basic 6236 16.36. Proxy-Supported 6238 The Proxy-Supported header field enumerates all the extensions 6239 supported by the proxy using feature-tags. The header carries the 6240 intersection of extensions supported by the forwarding proxies. The 6241 Proxy-Supported header MAY be included in any request by a proxy. It 6242 MUST be added by any proxy if the Supported header is present in a 6243 request. When present in a request, the receiver MUST in the 6244 response copy the received Proxy-Supported header. 6246 The Proxy-Supported header field contains a list of feature-tags 6247 applicable to proxies, as described in Section 4.7. The list is the 6248 intersection of all feature-tags understood by the proxies. To 6249 achieve an intersection, the proxy adding the Proxy-Supported header 6250 includes all proxy feature-tags it understands. Any proxy receiving 6251 a request with the header, MUST check the list and removes any 6252 feature-tag(s) it does not support. A Proxy-Supported header present 6253 in the response MUST NOT be touched by the proxies. 6255 Example: 6256 C->P1: OPTIONS rtsp://example.com/ RTSP/2.0 6257 Supported: foo, bar, blech 6258 User-Agent: PhonyClient/1.2 6260 P1->P2: OPTIONS rtsp://example.com/ RTSP/2.0 6261 Supported: foo, bar, blech 6262 Proxy-Supported: proxy-foo, proxy-bar, proxy-blech 6263 Via: 2.0 pro.example.com 6265 P2->S: OPTIONS rtsp://example.com/ RTSP/2.0 6266 Supported: foo, bar, blech 6267 Proxy-Supported: proxy-foo, proxy-blech 6268 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6270 S->C: RTSP/2.0 200 OK 6271 Supported: foo, bar, baz 6272 Proxy-Supported: proxy-foo, proxy-blech 6273 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6274 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6276 16.37. Public 6278 The Public response header field lists the set of methods supported 6279 by the response sender. This header applies to the general 6280 capabilities of the sender and its only purpose is to indicate the 6281 sender's capabilities to the recipient. The methods listed may or 6282 may not be applicable to the Request-URI; the Allow header field 6283 (Section 16.6) MAY be used to indicate methods allowed for a 6284 particular URI. 6286 Example of use: 6287 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6289 In the event that there are proxies between the sender and the 6290 recipient of a response, each intervening proxy MUST modify the 6291 Public header field to remove any methods that are not supported via 6292 that proxy. The resulting Public header field will contain an 6293 intersection of the sender's methods and the methods allowed through 6294 by the intervening proxies. 6296 In general, proxies should allow all methods to transparently pass 6297 through from the sending RTSP agent to the receiving RTSP agent, 6298 but there may be cases where this is not desirable for a given 6299 proxy. Modification of the Public response header field by the 6300 intervening proxies ensures that the request sender gets an 6301 accurate response indicating the methods that can be used on the 6302 target agent via the proxy chain. 6304 16.38. Range 6306 The Range header specifies a time range in PLAY (Section 13.4), PAUSE 6307 (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and 6308 PLAY_NOTIFY (Section 13.5) requests and responses. It MAY be 6309 included in GET_PARAMETER requests from the client to the server with 6310 only a Range format and no value to request the current media 6311 position, whether the session is in Play or Ready state in the 6312 included format. The server SHALL, if supporting the range format, 6313 respond with the current playing point or pause point as the start of 6314 the range. If an explicit stop point was used in the previous PLAY 6315 request, then that value shall be included as stop point. Note that 6316 if the server is currently under any type of media playback 6317 manipulation affecting the interpretation of Range, like Scale, that 6318 is also required to be included in any GET_PARAMETER response to 6319 provide complete information. 6321 The range can be specified in a number of units. This specification 6322 defines smpte (Section 4.4), npt (Section 4.5), and clock 6323 (Section 4.6) range units. While byte ranges [H14.35.1] and other 6324 extended units MAY be used, their behavior is unspecified since they 6325 are not normally meaningful in RTSP. Servers supporting the Range 6326 header MUST understand the NPT range format and SHOULD understand the 6327 SMPTE range format. If the Range header is sent in a time format 6328 that is not understood, the recipient SHOULD return 456 (Header Field 6329 Not Valid for Resource) and include an Accept-Ranges header 6330 indicating the supported time formats for the given resource. 6332 Example: 6333 Range: clock=19960213T143205Z- 6335 The Range header contains a range of one single range format. A 6336 range is a half-open interval with a start and an end point, 6337 including the start point, but excluding the end point. A range may 6338 either be fully specified with explicit values for start point and 6339 end point, or have either start or end point be implicit. An 6340 implicit start point indicates the session's pause point, and if no 6341 pause point is set the start of the content. An implicit end point 6342 indicates the end of the content. The usage of both implicit start 6343 and end point is not allowed in the same range header, however, the 6344 exclusion of the range header has that meaning, i.e. from pause point 6345 (or start) until end of content. 6347 Regarding the half-open intervals; a range of A-B starts exactly 6348 at time A, but ends just before B. Only the start time of a media 6349 unit such as a video or audio frame is relevant. For example, 6350 assume that video frames are generated every 40 ms. A range of 6351 10.0-10.1 would include a video frame starting at 10.0 or later 6352 time and would include a video frame starting at 10.08, even 6353 though it lasted beyond the interval. A range of 10.0-10.08, on 6354 the other hand, would exclude the frame at 10.08. 6356 Please note the difference between NPT time scales' "now" and an 6357 implicit start value. Implicit value reference the current pause- 6358 point. While "now" is the currently ongoing time. In a time- 6359 progressing session with recording (retention for some or full 6360 time) the pause point may be 2 min into the session while now 6361 could be 1 hour into the session. 6363 By default, range intervals increase, where the second point is 6364 larger than the first point. 6366 Example: 6367 Range: npt=10-15 6369 However, range intervals can also decrease if the Scale header (see 6370 Section 16.44) indicates a negative scale value. For example, this 6371 would be the case when a playback in reverse is desired. 6373 Example: 6374 Scale: -1 6375 Range: npt=15-10 6377 Decreasing ranges are still half open intervals as described above. 6378 Thus, for range A-B, A is closed and B is open. In the above 6379 example, 15 is closed and 10 is open. An exception to this rule is 6380 the case when B=0 in a decreasing range. In this case, the range is 6381 closed on both ends, as otherwise there would be no way to reach 0 on 6382 a reverse playback for formats that have such a notion, like NPT and 6383 SMPTE. 6385 Example: 6386 Scale: -1 6387 Range: npt=15-0 6389 In this range both 15 and 0 are closed. 6391 A decreasing range interval without a corresponding negative Scale 6392 header is not valid. 6394 16.39. Referrer 6396 The Referrer request-header field allows the client to specify, for 6397 the server's benefit, the address (URI) of the resource from which 6398 the Request-URI was obtained. The URI refers to that of the 6399 presentation description, typically retrieved via HTTP. The Referrer 6400 request-header allows a server to generate lists of back-links to 6401 resources for interest, logging, optimized caching, etc. It also 6402 allows obsolete or mistyped links to be traced for maintenance. The 6403 Referrer field MUST NOT be sent if the Request-URI was obtained from 6404 a source that does not have its own URI, such as input from the user 6405 keyboard. 6407 If the field value is a relative URI, it SHOULD be interpreted 6408 relative to the Request-URI. The URI MUST NOT include a fragment. 6410 Because the source of a link might be private information or might 6411 reveal an otherwise private information source, it is strongly 6412 recommended that the user be able to select whether or not the 6413 Referrer field is sent. For example, a streaming client could have a 6414 toggle switch for openly/anonymously, which would respectively 6415 enable/disable the sending of Referrer and From information. 6417 Clients SHOULD NOT include a Referrer header field in a (non-secure) 6418 RTSP request if the referring page was transferred with a secure 6419 protocol. 6421 16.40. Request-Status 6423 This request header is used to indicate the end result for requests 6424 that takes time to complete, such a PLAY (Section 13.4). It is sent 6425 in PLAY_NOTIFY (Section 13.5) with the end-of-stream reason to report 6426 how the PLAY request concluded, either in success or in failure. The 6427 header carries a reference to the request it reports on using the 6428 CSeq number for the session indicated by the Session header in the 6429 request. It provides both a numerical status code (according to 6430 Section 8.1.1) and a human readable reason phrase. 6432 Example: 6433 Request-Status: cseq=63 status=500 reason="Media data unavailable" 6435 16.41. Require 6437 The Require request-header field is used by clients or servers to 6438 ensure that the other end-point supports features that are required 6439 in respect to this request. It can also be used to query if the 6440 other end-point supports certain features, however, the use of the 6441 Supported (Section 16.49) is much more effective in this purpose. 6442 The server MUST respond to this header by using the Unsupported 6443 header to negatively acknowledge those feature-tags which are NOT 6444 supported. The response MUST use the error code 551 (Option Not 6445 Supported). This header does not apply to proxies, for the same 6446 functionality in respect to proxies see Proxy-Require header 6447 (Section 16.35) with the exception of media modifying proxies. Media 6448 modifying proxies, due to their nature of handling media in a way 6449 that is very similar to a server, do need to understand also the 6450 server features to correctly serve the client. 6452 This is to make sure that the client-server interaction will 6453 proceed without delay when all features are understood by both 6454 sides, and only slow down if features are not understood (as in 6455 the example below). For a well-matched client-server pair, the 6456 interaction proceeds quickly, saving a round-trip often required 6457 by negotiation mechanisms. In addition, it also removes state 6458 ambiguity when the client requires features that the server does 6459 not understand. 6461 Example (Not complete): 6463 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/2.0 6464 CSeq: 302 6465 Require: funky-feature 6466 Funky-Parameter: funkystuff 6468 S->C: RTSP/2.0 551 Option not supported 6469 CSeq: 302 6470 Unsupported: funky-feature 6472 In this example, "funky-feature" is the feature-tag which indicates 6473 to the client that the fictional Funky-Parameter field is required. 6474 The relationship between "funky-feature" and Funky-Parameter is not 6475 communicated via the RTSP exchange, since that relationship is an 6476 immutable property of "funky-feature" and thus should not be 6477 transmitted with every exchange. 6479 Proxies and other intermediary devices MUST ignore this header. If a 6480 particular extension requires that intermediate devices support it, 6481 the extension should be tagged in the Proxy-Require field instead 6482 (see Section 16.35). See discussion in the proxies section 6483 (Section 17.1) about when to consider that a feature requires proxy 6484 support. 6486 16.42. Retry-After 6488 The Retry-After response-header field can be used with a 503 (Service 6489 Unavailable) response to indicate how long the service is expected to 6490 be unavailable to the requesting client. This field MAY also be used 6491 with any 3xx (Redirection) response to indicate the minimum time the 6492 user-agent is asked to wait before issuing the redirected request. 6493 The value of this field can be either an RTSP-date or an integer 6494 number of seconds (in decimal) after the time of the response. 6496 Example: 6497 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT 6498 Retry-After: 120 6500 In the latter example, the delay is 2 minutes. 6502 16.43. RTP-Info 6504 The RTP-Info general header field is used to set RTP-specific 6505 parameters in the PLAY and GET_PARAMETER responses or a PLAY_NOTIFY 6506 and GET_PARAMETER requests. For streams using RTP as transport 6507 protocol the RTP-Info header SHOULD be part of a 200 response to 6508 PLAY. 6510 The exclusion of the RTP-Info in a PLAY response for RTP 6511 transported media will result in that a client needs to 6512 synchronize the media streams using RTCP. This may have negative 6513 impact as the RTCP can be lost, and does not need to be 6514 particularly timely in its arrival. Also functionality as 6515 informing the client from which packet a seek has occurred is 6516 affected. 6518 The RTP-Info MAY be included in SETUP responses to provide 6519 synchronization information when changing transport parameters, see 6520 Section 13.3. The RTP-Info header and the Range header MAY be 6521 included in a GET_PARAMETER request from client to server without any 6522 values to request the current playback point and corresponding RTP 6523 synchronization information. When the RTP-Info header is included in 6524 a Request also the Range header MUST be included (Note, Range header 6525 only MAY be used). The server response SHALL include both the Range 6526 header and the RTP-Info header. If the session is in Play state, 6527 then the value of the Range header SHALL be filled in with the 6528 current playback point and with the corresponding RTP-Info values. 6529 If the server is another state, no values are included in the RTP- 6530 Info header. The header is included in PLAY_NOTIFY requests with the 6531 Notify-Reason of end-of-stream to provide RTP information about the 6532 end of the stream. 6534 The header can carry the following parameters: 6536 url: Indicates the stream URI for which the following RTP parameters 6537 correspond, this URI MUST be the same as used in the SETUP 6538 request for this media stream. Any relative URI MUST use the 6539 Request-URI as base URI. This parameter MUST be present. 6541 ssrc: The Synchronization source (SSRC) that the RTP timestamp and 6542 sequence number provided applies to. This parameter MUST be 6543 present. 6545 seq: Indicates the sequence number of the first packet of the stream 6546 that is direct result of the request. This allows clients to 6547 gracefully deal with packets when seeking. The client uses 6548 this value to differentiate packets that originated before the 6549 seek from packets that originated after the seek. Note that a 6550 client may not receive the packet with the expressed sequence 6551 number, and instead packets with a higher sequence number, due 6552 to packet loss or reordering. This parameter is RECOMMENDED to 6553 be present. 6555 rtptime: MUST indicate the RTP timestamp value corresponding to the 6556 start time value in the Range response header, or if not 6557 explicitly given the implied start point. The client uses this 6558 value to calculate the mapping of RTP time to NPT or other 6559 media timescale. This parameter SHOULD be present to ensure 6560 inter-media synchronization is achieved. There exists no 6561 requirement that any received RTP packet will have the same RTP 6562 timestamp value as the one in the parameter used to establish 6563 synchronization. 6565 A mapping from RTP timestamps to NTP timestamps (wallclock) is 6566 available via RTCP. However, this information is not sufficient 6567 to generate a mapping from RTP timestamps to media clock time 6568 (NPT, etc.). Furthermore, in order to ensure that this 6569 information is available at the necessary time (immediately at 6570 startup or after a seek), and that it is delivered reliably, this 6571 mapping is placed in the RTSP control channel. 6573 In order to compensate for drift for long, uninterrupted 6574 presentations, RTSP clients should additionally map NPT to NTP, 6575 using initial RTCP sender reports to do the mapping, and later 6576 reports to check drift against the mapping. 6578 Example: 6579 Range:npt=3.25-15 6580 RTP-Info:url="rtsp://example.com/foo/audio" ssrc=0A13C760:seq=45102; 6581 rtptime=12345678,url="rtsp://example.com/foo/video" 6582 ssrc=9A9DE123:seq=30211;rtptime=29567112 6584 Lets assume that Audio uses a 16kHz RTP timestamp clock and Video 6585 a 90kHz RTP timestamp clock. Then the media synchronization is 6586 depicted in the following way. 6588 NPT 3.0---3.1---3.2-X-3.3---3.4---3.5---3.6 6589 Audio PA A 6590 Video V PV 6592 X: NPT time value = 3.25, from Range header. 6593 A: RTP timestamp value for Audio from RTP-Info header (12345678). 6594 V: RTP timestamp value for Video from RTP-Info header (29567112). 6595 PA: RTP audio packet carrying an RTP timestamp of 12344878. Which 6596 corresponds to NPT = (12344878 - A) / 16000 + 3.25 = 3.2 6597 PV: RTP video packet carrying an RTP timestamp of 29573412. Which 6598 corresponds to NPT = (29573412 - V) / 90000 + 3.25 = 3.32 6600 16.44. Scale 6602 A scale value of 1 indicates normal play at the normal forward 6603 viewing rate. If not 1, the value corresponds to the rate with 6604 respect to normal viewing rate. For example, a ratio of 2 indicates 6605 twice the normal viewing rate ("fast forward") and a ratio of 0.5 6606 indicates half the normal viewing rate. In other words, a ratio of 2 6607 has content time increase at twice the playback time. For every 6608 second of elapsed (wallclock) time, 2 seconds of content time will be 6609 delivered. A negative value indicates reverse direction. For 6610 certain media transports this may require certain considerations to 6611 work consistent, see Appendix C.1 for description on how RTP handles 6612 this. 6614 The transmitted data rate SHOULD NOT be changed by selection of a 6615 different scale value. The resulting bit-rate should be reasonably 6616 close to the nominal bit-rate of the content for Scale = 1. The 6617 server has to actively manipulate the data when needed to meet the 6618 bitrate constraints. Implementation of scale changes depends on the 6619 server and media type. For video, a server may, for example, deliver 6620 only key frames or selected frames. For audio, it may time-scale the 6621 audio while preserving pitch or, less desirably, deliver fragments of 6622 audio, or completely mute the audio. 6624 The server and content may restrict the range of scale values that it 6625 supports. The supported values are indicated by the Media-Properties 6626 header (Section 16.28). The client SHOULD only indicate values 6627 indicated to be supported. However, as the values may change as the 6628 content progresses a requested value may no longer be valid when the 6629 request arrives. Thus, a non-supported value in a request does not 6630 generate an error, only forces the server to choose the closest 6631 value. The response MUST always contain the actual scale value 6632 chosen by the server. 6634 If the server does not implement the possibility to scale, it will 6635 not return a Scale header. A server supporting Scale operations for 6636 PLAY MUST indicate this with the use of the "play.scale" feature-tag. 6638 When indicating a negative scale for a reverse playback, the Range 6639 header MUST indicate a decreasing range as described in 6640 Section 16.38. 6642 Example of playing in reverse at 3.5 times normal rate: 6643 Scale: -3.5 6644 Range: npt=15-10 6646 16.45. Seek-Style 6648 When a client sends a PLAY request with a Range header to perform a 6649 random access to the media, the client does not know if the server 6650 will pick the first media samples or the first random access point 6651 prior to the request range. Depending on use case, the client may 6652 have a strong preference. To express this preference and provide the 6653 client with information on how the server actually acted on that 6654 preference the Seek-Style header is defined. 6656 Seek-Style is a general header that MAY be included in any PLAY 6657 request to indicate the client's preference for any media stream that 6658 has random access properties. The server MUST always include the 6659 header in any PLAY response for media with random access properties 6660 to indicate what policy was applied. A server that receives an 6661 unknown Seek-Style policy MUST ignore it and select the server 6662 default policy. A client receiving an unknown policy MUST ignore it 6663 and use the Range header and any media synchronization information as 6664 basis to determine what the server did. 6666 This specification defines the following seek policies that may be 6667 requested (see also Section 4.9.1): 6669 RAP: Random Access Point (RAP) is the behavior of requesting the 6670 server to locate the closest previous random access point that 6671 exists in the media aggregate and deliver from that. By 6672 requesting a RAP, media quality will be the best possible as all 6673 media will be delivered from a point where full media state can be 6674 established in the media decoder. 6676 CoRAP: Conditional Random Access Point (CoRAP) is a variant of the 6677 above RAP behavior. This policy is primarily intended for cases 6678 where there is larger distance between the random access points in 6679 the media. CoRAP is conditioned on that there is a Random Access 6680 Point closer to the requested start point than to the current 6681 pause point. This policy assumes that the media state existing 6682 prior to the pause is usable if delivery is continued. If the 6683 client or server knows that this is not the fact the RAP policy 6684 should be used. In other words: in most cases when the client 6685 requests a start point prior to the current pause point, a valid 6686 decoding dependency chain from the media delivered prior to the 6687 pause and to the requested media unit will not exist. If the 6688 server searched to a random access point the server MUST return 6689 the CoRAP policy in the Seek-Style header and adjust the Range 6690 header to reflect the position of the picked RAP. In case the 6691 random access point is further away and the server selects to 6692 continue from the current pause point it MUST include the "Next" 6693 policy in the Seek-Style header and adjust the Range header start 6694 point to the current pause point. 6696 First-Prior: The first-prior policy will start delivery with the 6697 media unit that has a playout time first prior to the requested 6698 time. For discrete media that would only include media units that 6699 would still be rendered at the request time. For continuous media 6700 that is media that will be rendered during the requested start 6701 time of the range. 6703 Next: The next media units after the provided start time of the 6704 range. For continuous framed media that would mean the first next 6705 frame after the provided time. For discrete media the first unit 6706 that is to be rendered after the provided time. The main usage 6707 for this case is when the client knows it has all media up to a 6708 certain point and would like to continue delivery so that a 6709 complete non-interrupted media playback can be achieved. Example 6710 of such scenarios include switching from a broadcast/multicast 6711 delivery to a unicast based delivery. This policy MUST only be 6712 used on the client's explicit request. 6714 Please note that these expressed preferences exist for optimizing the 6715 startup time or the media quality. The "Next" policy breaks the 6716 normal definition of the Range header to enable a client to request 6717 media with minimal overlap, although some may still occur for 6718 aggregated sessions. RAP and First-Prior both fulfill the 6719 requirement of providing media from the requested range and forward. 6720 However, unless RAP is used, the media quality for many media codecs 6721 using predictive methods can be severely degraded unless additional 6722 data is available as, for example, already buffered, or through other 6723 side channels. 6725 16.46. Server 6727 The Server response-header field contains information about the 6728 software used by the origin server to handle the request. The field 6729 can contain multiple product tokens and comments identifying the 6730 server and any significant subproducts. The product tokens are 6731 listed in order of their significance for identifying the 6732 application. 6734 Example: 6735 Server: PhonyServer/1.0 6737 If the response is being forwarded through a proxy, the proxy 6738 application MUST NOT modify the Server response-header. Instead, it 6739 SHOULD include a Via field (Section 16.56). If the response is 6740 generated by the proxy, the proxy application MUST return the Server 6741 response-header as previously returned by the server. 6743 16.47. Session 6745 The Session request-header and response-header field identifies an 6746 RTSP session. An RTSP session is created by the server as a result 6747 of a successful SETUP request and in the response the session 6748 identifier is given to the client. The RTSP session exists until 6749 destroyed by a TEARDOWN, REDIRECT or timed out by the server. 6751 The session identifier is chosen by the server (see Section 4.3) and 6752 MUST be returned in the SETUP response. Once a client receives a 6753 session identifier, it MUST be included in any request related to 6754 that session. This means that the Session header MUST be included in 6755 a request, using the following methods: PLAY, PAUSE, and TEARDOWN, 6756 and MAY be included in SETUP, OPTIONS, SET_PARAMETER, GET_PARAMETER, 6757 and REDIRECT, and MUST NOT be included in DESCRIBE. The Session 6758 header MUST NOT be included in the following methods, if these 6759 requests are pipelined and if the session identifier is not yet 6760 known: PLAY, PAUSE, TEARDOWN, SETUP, OPTIONS SET_PARAMETER, and 6761 GET_PARAMETER. 6763 In an RTSP response the session header MUST be included in methods, 6764 SETUP, PLAY, and PAUSE, and MAY be included in methods, TEARDOWN, and 6765 REDIRECT, and if included in the request of the following methods it 6766 MUST also be included in the response, OPTIONS, GET_PARAMETER, and 6767 SET_PARAMETER, and MUST NOT be included in DESCRIBE responses. 6769 Note that a session identifier identifies an RTSP session across 6770 transport sessions or connections. RTSP requests for a given session 6771 can use different URIs (Presentation and media URIs). Note, that 6772 there are restrictions depending on the session which URIs that are 6773 acceptable for a given method. However, multiple "user" sessions for 6774 the same URI from the same client will require use of different 6775 session identifiers. 6777 The session identifier is needed to distinguish several delivery 6778 requests for the same URI coming from the same client. 6780 The response 454 (Session Not Found) MUST be returned if the session 6781 identifier is invalid. 6783 The header MAY include the session timeout period. If not explicitly 6784 provided this value is set to 60 seconds. As this affects how often 6785 session keep-alives are needed values smaller than 30 seconds are not 6786 recommended. However, larger than default values can be useful in 6787 applications of RTSP that have inactive but established sessions for 6788 longer time periods. 6790 60 seconds was chosen as session timeout value due to: Resulting 6791 in not too frequent keep-alive messages and having low sensitivity 6792 to variations in request response timing. If one reduces the 6793 timeout value to below 30 seconds the corresponding request 6794 response timeout becomes a significant part of the session 6795 timeout. 60 seconds also allows for reasonably rapid recovery of 6796 committed server resources in case of client failure. 6798 16.48. Speed 6800 The Speed request-header field requests the server to deliver 6801 specific amounts of nominal media time per unit of delivery time, 6802 contingent on the server's ability and desire to serve the media 6803 stream at the given speed. The client requests the delivery speed to 6804 be within a given range with a lower and upper bound. The server 6805 SHALL deliver at the highest possible speed within the range, but not 6806 faster than the upper-bound, for which the underlying network path 6807 can support the resulting transport data rates. As long as any speed 6808 value within the given range can be provided the server SHALL NOT 6809 modify the media quality. Only if the server is unable to deliver 6810 media at the speed value provided by the lower bound shall it reduce 6811 the media quality. 6813 Implementation of the Speed functionality by the server is OPTIONAL. 6814 The server can indicate its support through a feature-tag, 6815 play.speed. The lack of a Speed header in the response is an 6816 indication of lack of support of this functionality. 6818 The speed parameter values are expressed as a positive decimal value, 6819 e.g., a value of 2.0 indicates that data is to be delivered twice as 6820 fast as normal. A speed value of zero is invalid. The range is 6821 specified in the form "lower bound - upper bound". The lower bound 6822 value may be smaller or equal to the upper bound. All speeds may not 6823 be possible to support. Therefore the server MAY modify the 6824 requested values to the closest supported. The actual supported 6825 speed MUST be included in the response. Note, however, that the use 6826 cases may vary and that Speed value ranges such as 0.7 - 0.8, 6827 0.3-2.0, 1.0-2.5, 2.5-2.5 all have their usage. 6829 Example: 6831 Speed: 1.0-2.5 6833 Use of this header changes the bandwidth used for data delivery. It 6834 is meant for use in specific circumstances where delivery of the 6835 presentation at a higher or lower rate is desired. The main use 6836 cases are buffer operations or local scale operations. Implementors 6837 should keep in mind that bandwidth for the session may be negotiated 6838 beforehand (by means other than RTSP), and therefore re-negotiation 6839 may be necessary. To perform Speed operations the server needs to 6840 ensure that the network path can support the resulting bit-rate. 6841 Thus the media transport needs to support feedback so that the server 6842 can react and adapt to the available bitrate. 6844 16.49. Supported 6846 The Supported header enumerates all the extensions supported by the 6847 client or server using feature tags. The header carries the 6848 extensions supported by the message sending client or server. The 6849 Supported header MAY be included in any request. When present in a 6850 request, the receiver MUST respond with its corresponding Supported 6851 header. Note that the Supported header is also included in 4xx and 6852 5xx responses. 6854 The Supported header contains a list of feature-tags, described in 6855 Section 4.7, that are understood by the client or server. 6857 Example: 6859 C->S: OPTIONS rtsp://example.com/ RTSP/2.0 6860 Supported: foo, bar, blech 6861 User-Agent: PhonyClient/1.2 6863 S->C: RTSP/2.0 200 OK 6864 Supported: bar, blech, baz 6866 16.50. Terminate-Reason 6868 The Terminate-Reason request header allows the server when sending a 6869 REDIRECT or TEARDOWN request to provide a reason for the session 6870 termination and any additional information. This specification 6871 identifies three reasons for Redirections and may be extended in the 6872 future: 6874 Server-Admin: The server needs to be shutdown for some 6875 administrative reason. 6877 Session-Timeout: A client's session is kept alive for extended 6878 periods of time and the server has determined that it needs to 6879 reclaim the resources associated with this session. 6881 Internal-Error An internal error that is impossible to recover from 6882 has occurred forcing the server to terminate the session. 6884 The Server may provide additional parameters containing information 6885 around the redirect. This specification defines the following ones. 6887 time: Provides a wallclock time when the server will stop provide 6888 any service. 6890 user-msg: An UTF-8 text string with a message from the server to the 6891 user. This message SHOULD be displayed to the user. 6893 16.51. Timestamp 6895 The Timestamp general-header describes when the agent sent the 6896 request. The value of the timestamp is of significance only to the 6897 agent and may use any timescale. The responding agent MUST echo the 6898 exact same value and MAY, if it has accurate information about this, 6899 add a floating point number indicating the number of seconds that has 6900 elapsed since it has received the request. The timestamp can be used 6901 by the agent to compute the round-trip time to the responding agent 6902 so that it can adjust the timeout value for retransmissions when 6903 running over an unreliable protocol. It also resolves retransmission 6904 ambiguities for unreliable transport of RTSP. 6906 Note that the present specification provides only for reliable 6907 transport of RTSP messages. The Timestamp general-header is 6908 specified in case the protocol is extended in the future to use 6909 unreliable transport. 6911 16.52. Transport 6913 The Transport request and response header indicates which transport 6914 protocol is to be used and configures its parameters such as 6915 destination address, compression, multicast time-to-live and 6916 destination port for a single stream. It sets those values not 6917 already determined by a presentation description. 6919 A Transport request header MAY contain a list of transport options 6920 acceptable to the client, in the form of multiple transport 6921 specification entries. Transport specifications are comma separated, 6922 listed in decreasing order of preference. Parameters may be added to 6923 each transport specification, separated by a semicolon. The server 6924 MUST return a Transport response-header in the response to indicate 6925 the values actually chosen if any. If the transport specification is 6926 not supported, no transport header is returned and the request MUST 6927 be responded using the status code 461 (Unsupported Transport) 6928 (Section 15.4.26). In case more than one transport specification was 6929 present in the request, the server MUST return the single (transport- 6930 spec) which was actually chosen, if any. The number of transport- 6931 spec entries is expected to be limited as the client will get 6932 guidance on what configurations that are possible from the 6933 presentation description. 6935 The Transport header MAY also be used in subsequent SETUP requests to 6936 change transport parameters. A server MAY refuse to change 6937 parameters of an existing stream. 6939 A transport specification may only contain one of any given parameter 6940 within it. Parameters MAY be given in any order. Additionally, it 6941 may only contain either of the unicast or the multicast transport 6942 type parameter. All parameters need to be understood in a transport 6943 specification, if not, the transport specification MUST be ignored. 6944 RTSP proxies of any type that uses or modifies the transport 6945 specification, e.g. access proxy or security proxy, MUST remove 6946 specifications with unknown parameters before forwarding the RTSP 6947 message. If that result in no remaining transport specification the 6948 proxy SHALL send a 461 (Unsupported Transport) (Section 15.4.26) 6949 response without any Transport header. 6951 The Transport header is restricted to describing a single media 6952 stream. (RTSP can also control multiple streams as a single 6953 entity.) Making it part of RTSP rather than relying on a 6954 multitude of session description formats greatly simplifies 6955 designs of firewalls. 6957 The general syntax for the transport specifier is a list of slash 6958 separated tokens: 6959 Value1/Value2/Value3... 6960 Which for RTP transports take the form: 6961 RTP/profile/lower-transport. 6963 The default value for the "lower-transport" parameters is specific to 6964 the profile. For RTP/AVP, the default is UDP. 6966 There are two different methods for how to specify where the media 6967 should be delivered for unicast transport: 6969 dest_addr: The presence of this parameter and its values indicates 6970 the destination address or addresses (host address and port 6971 pairs for IP flows) necessary for the media transport. 6973 No dest_addr: The lack of the dest_addr parameter indicates that the 6974 server MUST send media to same address for which the RTSP 6975 messages originates. 6977 The choice of method for indicating where the media is to be 6978 delivered depends on the use case. In some cases the only allowed 6979 method will be to use no explicit address indication and have the 6980 server deliver media to the source of the RTSP messages. 6982 For Multicast there is several methods for specifying addresses but 6983 they are different in how they work compared with unicast: 6985 dest_addr with client picked address: The address and relevant 6986 parameters like TTL (scope) for the actual multicast group to 6987 deliver the media to. There are security implications 6988 (Section 21) with this method that needs to be addressed if 6989 using this method because a RTSP server can be used as a DoS 6990 attacker on an existing multicast group. 6992 dest_addr using Session Description Information: The information 6993 included in the transport header can all be coming from the 6994 session description, e.g. the SDP c= and m= line. This 6995 mitigates some of the security issues of the previous methods 6996 as it is the session provider that picks the multicast group 6997 and scope. The client MUST include the information if it is 6998 available in the session description. 7000 No dest_addr: The behavior when no explicit multicast group is 7001 present in a request is not defined. 7003 An RTSP proxy will need to take care. If the media is not desired to 7004 be routed through the proxy, the proxy will need to introduce the 7005 destination indication. 7007 Below are the configuration parameters associated with transport: 7009 General parameters: 7011 unicast / multicast: This parameter is a mutually exclusive 7012 indication of whether unicast or multicast delivery will be 7013 attempted. One of the two values MUST be specified. Clients 7014 that are capable of handling both unicast and multicast 7015 transmission needs to indicate such capability by including two 7016 full transport-specs with separate parameters for each. 7018 layers: The number of multicast layers to be used for this media 7019 stream. The layers are sent to consecutive addresses starting 7020 at the dest_addr address. If the parameter is not included, it 7021 defaults to a single layer. 7023 dest_addr: A general destination address parameter that can contain 7024 one or more address specifications. Each combination of 7025 protocol/profile/lower transport needs to have the format and 7026 interpretation of its address specification defined. For RTP/ 7027 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 7028 containing a host address and port. Note, only a single 7029 destination parameter per transport spec is intended. The 7030 usage of multiple destinations to distribute a single media to 7031 multiple entities is unspecified. 7033 The client originating the RTSP request MAY specify the 7034 destination address of the stream recipient with the host 7035 address part of the tuple. When the destination address is 7036 specified, the recipient may be a different party than the 7037 originator of the request. To avoid becoming the unwitting 7038 perpetrator of a remote-controlled denial-of-service attack, a 7039 server MUST perform security checks (see Section 21.1) and 7040 SHOULD log such attempts before allowing the client to direct a 7041 media stream to a recipient address not chosen by the server. 7042 Implementations cannot rely on TCP as reliable means of client 7043 identification. If the server does not allow the host address 7044 part of the tuple to be set, it MUST return 463 (Destination 7045 Prohibited). 7047 The host address part of the tuple MAY be empty, for example 7048 ":58044", in cases when only destination port is desired to be 7049 specified. Responses to requests including the Transport 7050 header with a dest_addr parameter SHOULD include the full 7051 destination address that is actually used by the server. The 7052 server MUST NOT remove address information present already in 7053 the request when responding unless the protocol requires it. 7055 src_addr: A general source address parameter that can contain one or 7056 more address specifications. Each combination of protocol/ 7057 profile/lower transport needs to have the format and 7058 interpretation of its address specification defined. For RTP/ 7059 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 7060 containing a host address and port. 7062 This parameter MUST be specified by the server if it transmits 7063 media packets from another address than the one RTSP messages 7064 are sent to. This will allow the client to verify source 7065 address and give it a destination address for its RTCP feedback 7066 packets, if RTP is used. The address or addresses indicated in 7067 the src_addr parameter SHOULD be used both for sending and 7068 receiving of the media streams data packets. The main reasons 7069 are threefold: First, indicating the port and source address(s) 7070 lets the receiver know where from the packets is expected to 7071 originate. Secondly, traversal of NATs is greatly simplified 7072 when traffic is flowing symmetrically over an NAT binding. 7073 Thirdly, certain NAT traversal mechanisms, needs to know to 7074 which address and port to send so called "binding packets" from 7075 the receiver to the sender, thus creating an address binding in 7076 the NAT that the sender to receiver packet flow can use. 7078 This information may also be available through SDP. 7079 However, since this is more a feature of transport than 7080 media initialization, the authoritative source for this 7081 information should be in the SETUP response. 7083 mode: The mode parameter indicates the methods to be supported for 7084 this session. Currently defined valid values are "PLAY". If 7085 not provided, the default is "PLAY". The "RECORD" value was 7086 defined in RFC 2326 and is in this specification unspecified 7087 but reserved. RECORD and other values may be specified in the 7088 future. 7090 interleaved: The interleaved parameter implies mixing the media 7091 stream with the control stream in whatever protocol is being 7092 used by the control stream, using the mechanism defined in 7093 Section 14. The argument provides the channel number to be 7094 used in the $ block Section 14 and MUST be present. This 7095 parameter MAY be specified as a interval, e.g., interleaved=4-5 7096 in cases where the transport choice for the media stream 7097 requires it, e.g., for RTP with RTCP. The channel number given 7098 in the request is only a guidance from the client to the server 7099 on what channel number(s) to use. The server MAY set any valid 7100 channel number in the response. The declared channel(s) are 7101 bi-directional, so both end-parties MAY send data on the given 7102 channel. One example of such usage is the second channel used 7103 for RTCP, where both server and client send RTCP packets on the 7104 same channel. 7106 This allows RTP/RTCP to be handled similarly to the way 7107 that it is done with UDP, i.e., one channel for RTP and 7108 the other for RTCP. 7110 MIKEY: This parameter is used in conjunction with transport 7111 specifications that can utilize MIKEY for security context 7112 establishment. So far only the SRTP based RTP profiles SAVP 7113 and SAVPF can utilize MIKEY and this is defined in 7114 Appendix C.1.4.1. This parameter can be included both in 7115 request and response messages. The binary MIKEY message SHALL 7116 be BASE64 [RFC4648] encoded before being included in the value 7117 part of the parameter. 7119 Multicast-specific: 7121 ttl: multicast time-to-live for IPv4. When included in requests the 7122 value indicate the TTL value that the client request the server 7123 to use. In a response, the value actually being used by the 7124 server is returned. A server will need to consider what values 7125 that are reasonable and also the authority of the user to set 7126 this value. Corresponding functions are not needed for IPv6 as 7127 the scoping is part of the address. 7129 RTP-specific: 7131 These parameters MAY only be used if the media transport protocol is 7132 RTP. 7134 ssrc: The ssrc parameter, if included in a SETUP response, indicates 7135 the RTP SSRC [RFC3550] value(s) that will be used by the media 7136 server for RTP packets within the stream. It is expressed as 7137 an eight digit hexadecimal value. 7139 The ssrc parameter MUST NOT be specified in requests. The 7140 functionality of specifying the ssrc parameter in a SETUP 7141 request is deprecated as it is incompatible with the 7142 specification of RTP in RFC 3550[RFC3550]. If the parameter is 7143 included in the Transport header of a SETUP request, the server 7144 SHOULD ignore it, and choose appropriate SSRCs for the stream. 7145 The server SHOULD set the ssrc parameter in the Transport 7146 header of the response. 7148 RTCP-mux: Use to negotiate the usage of RTP and RTCP multiplexing 7149 [RFC5761] on a single underlying transport stream / flow. The 7150 presence of this parameter in a SETUP request indicates the 7151 clients support and requires the server to use RTP and RTCP 7152 multiplexing. The client SHALL only include one transport 7153 stream in the Transport header specification. To provide the 7154 server with a choice between using RTP/RTCP multiplexing or 7155 not, two different transport header specifications must be 7156 included. 7158 The parameters setup and connection defined below MAY only be used if 7159 the media transport protocol of the lower-level transport is 7160 connection-oriented (such as TCP). However, these parameters MUST 7161 NOT be used when interleaving data over the RTSP control connection. 7163 setup: Clients use the setup parameter on the Transport line in a 7164 SETUP request, to indicate the roles it wishes to play in a TCP 7165 connection. This parameter is adapted from [RFC4145]. We 7166 discuss the use of this parameter in RTP/AVP/TCP non- 7167 interleaved transport in Appendix C.2.2; the discussion below 7168 is limited to syntactic issues. Clients may specify the 7169 following values for the setup parameter: ["active":] The 7170 client will initiate an outgoing connection. ["passive":] The 7171 client will accept an incoming connection. ["actpass":] The 7172 client is willing to accept an incoming connection or to 7173 initiate an outgoing connection. 7175 If a client does not specify a setup value, the "active" value 7176 is assumed. 7178 In response to a client SETUP request where the setup parameter 7179 is set to "active", a server's 2xx reply MUST assign the setup 7180 parameter to "passive" on the Transport header line. 7182 In response to a client SETUP request where the setup parameter 7183 is set to "passive", a server's 2xx reply MUST assign the setup 7184 parameter to "active" on the Transport header line. 7186 In response to a client SETUP request where the setup parameter 7187 is set to "actpass", a server's 2xx reply MUST assign the setup 7188 parameter to "active" or "passive" on the Transport header 7189 line. 7191 Note that the "holdconn" value for setup is not defined for 7192 RTSP use, and MUST NOT appear on a Transport line. 7194 connection: Clients use the setup parameter on the Transport line in 7195 a SETUP request, to indicate the SETUP request prefers the 7196 reuse of an existing connection between client and server (in 7197 which case the client sets the "connection" parameter to 7198 "existing"), or that the client requires the creation of a new 7199 connection between client and server (in which cast the client 7200 sets the "connection" parameter to "new"). Typically, clients 7201 use the "new" value for the first SETUP request for a URL, and 7202 "existing" for subsequent SETUP requests for a URL. 7204 If a client SETUP request assigns the "new" value to 7205 "connection", the server response MUST also assign the "new" 7206 value to "connection" on the Transport line. 7208 If a client SETUP request assigns the "existing" value to 7209 "connection", the server response MUST assign a value of 7210 "existing" or "new" to "connection" on the Transport line, at 7211 its discretion. 7213 The default value of "connection" is "existing", for all SETUP 7214 requests (initial and subsequent). 7216 The combination of transport protocol, profile and lower transport 7217 needs to be defined. A number of combinations are defined in the 7218 Appendix C. 7220 Below is a usage example, showing a client advertising the capability 7221 to handle multicast or unicast, preferring multicast. Since this is 7222 a unicast-only stream, the server responds with the proper transport 7223 parameters for unicast. 7225 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 7226 CSeq: 302 7227 Transport: RTP/AVP;multicast;mode="PLAY", 7228 RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7229 "192.0.2.5:3457";mode="PLAY" 7230 Accept-Ranges: NPT, SMPTE, UTC 7231 User-Agent: PhonyClient/1.2 7233 S->C: RTSP/2.0 200 OK 7234 CSeq: 302 7235 Date: Thu, 23 Jan 1997 15:35:06 GMT 7236 Session: 47112344 7237 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7238 "192.0.2.5:3457";src_addr="192.0.2.224:6256"/ 7239 "192.0.2.224:6257";mode="PLAY" 7240 Accept-Ranges: NPT 7241 Media-Properties: Random-Access=0.6, Dynamic, 7242 Time-Limited=20081128T165900 7244 16.53. Unsupported 7246 The Unsupported response-header lists the features not supported by 7247 the responding RTSP agent. In the case where the feature was 7248 specified via the Proxy-Require field (Section 16.35), if there is a 7249 proxy on the path between the client and the server, the proxy MUST 7250 send a response message with a status code of 551 (Option Not 7251 Supported). The request MUST NOT be forwarded. 7253 See Section 16.41 for a usage example. 7255 16.54. User-Agent 7257 The User-Agent general-header field contains information about the 7258 user agent originating the request. This is for statistical 7259 purposes, the tracing of protocol violations, and automated 7260 recognition of user agents for the sake of tailoring responses to 7261 avoid particular user agent limitations. User agents SHOULD include 7262 this field with requests. The field can contain multiple product 7263 tokens and comments identifying the agent and any subproducts which 7264 form a significant part of the user agent. By convention, the 7265 product tokens are listed in order of their significance for 7266 identifying the application. 7268 Example: 7270 User-Agent: PhonyClient/1.2 7272 16.55. Vary 7274 The Vary field value indicates the set of request-header fields that 7275 fully determines, while the response is fresh, whether a cache is 7276 permitted to use the response to reply to a subsequent request 7277 without revalidation. For uncacheable or stale responses, the Vary 7278 field value advises the user agent about the criteria that were used 7279 to select the representation. A Vary field value of "*" implies that 7280 a cache cannot determine from the request headers of a subsequent 7281 request whether this response is the appropriate representation. 7283 An RTSP server SHOULD include a Vary header field with any cacheable 7284 response that is subject to server-driven negotiation. Doing so 7285 allows a cache to properly interpret future requests on that resource 7286 and informs the user agent about the presence of negotiation on that 7287 resource. A server MAY include a Vary header field with a non- 7288 cacheable response that is subject to server-driven negotiation, 7289 since this might provide the user agent with useful information about 7290 the dimensions over which the response varies at the time of the 7291 response. 7293 A Vary field value consisting of a list of field-names signals that 7294 the representation selected for the response is based on a selection 7295 algorithm which considers ONLY the listed request-header field values 7296 in selecting the most appropriate representation. A cache MAY assume 7297 that the same selection will be made for future requests with the 7298 same values for the listed field names, for the duration of time for 7299 which the response is fresh. 7301 The field-names given are not limited to the set of standard request- 7302 header fields defined by this specification. Field names are case- 7303 insensitive. 7305 A Vary field value of "*" signals that unspecified parameters not 7306 limited to the request-headers (e.g., the network address of the 7307 client), play a role in the selection of the response representation. 7308 The "*" value MUST NOT be generated by a proxy server; it may only be 7309 generated by an origin server. 7311 16.56. Via 7313 The Via general-header field MUST be used by proxies to indicate the 7314 intermediate protocols and recipients between the user agent and the 7315 server on requests, and between the origin server and the client on 7316 responses. The field is intended to be used for tracking message 7317 forwards, avoiding request loops, and identifying the protocol 7318 capabilities of all senders along the request/response chain. 7320 Multiple Via field values represents each proxy that has forwarded 7321 the message. Each recipient MUST append its information such that 7322 the end result is ordered according to the sequence of forwarding 7323 applications. 7325 Proxies (e.g., Access Proxy or Translator Proxy) SHOULD NOT, by 7326 default, forward the names and ports of hosts within the private/ 7327 protected region. This information SHOULD only be propagated if 7328 explicitly enabled. If not enabled, the via-received of any host 7329 behind the firewall/NAT SHOULD be replaced by an appropriate 7330 pseudonym for that host. 7332 For organizations that have strong privacy requirements for hiding 7333 internal structures, a proxy MAY combine an ordered subsequence of 7334 Via header field entries with identical sent-protocol values into a 7335 single such entry. Applications MUST NOT combine entries which have 7336 different received-protocol values. 7338 16.57. WWW-Authenticate 7340 The WWW-Authenticate response-header field MUST be included in 401 7341 (Unauthorized) response messages. The field value consists of at 7342 least one challenge that indicates the authentication scheme(s) and 7343 parameters applicable to the Request-URI. 7345 The HTTP access authentication process is described in [RFC2617]. 7346 User agents are advised to take special care in parsing the WWW- 7347 Authenticate field value as it might contain more than one challenge, 7348 or if more than one WWW-Authenticate header field is provided, the 7349 contents of a challenge itself can contain a comma-separated list of 7350 authentication parameters. 7352 17. Proxies 7354 RTSP Proxies are RTSP agents that are located in between a client and 7355 a server. A proxy can take on both the role as a client and as 7356 server depending on what it tries to accomplish. Proxies are also 7357 introduced for several different reasons and the below listed are 7358 often combined. 7360 In general there are two categories of RTSP proxies, transparent (of 7361 which the client is not aware) and the non-transparent proxies (of 7362 which the client is aware). Transparent proxies are not visible to 7363 the client in terms of that the transport layer connection, e.g., TCP 7364 for RTSP, as there is only a single transport connection which is 7365 terminated at the RTSP client and the RTSP server. In the case of 7366 non-transparent proxies, there are two transport layer connections, 7367 one from the RTSP client to the RTSP proxy and a second from the RTSP 7368 proxy to the RTSP server. 7370 There are these types of RTSP proxies: 7372 Caching Proxy: This type of proxy is used to reduce the workload on 7373 servers and connections. By caching the description and media 7374 streams, i.e., the presentation, the proxy can serve a client 7375 with content, but without requesting it from the server once it 7376 has been cached and has not become stale. See the caching 7377 Section 18. This type of proxy is also expected to understand 7378 RTSP end-point functionality, i.e., functionality identified in 7379 the Require header in addition to what Proxy-Require demands. 7381 Translator Proxy: This type of proxy is used to ensure that an RTSP 7382 client gets access to servers and content on an external 7383 network or using content encodings not supported by the client. 7384 The proxy performs the necessary translation of addresses, 7385 protocols or encodings. This type of proxy is expected to also 7386 understand RTSP end-point functionality, i.e. functionality 7387 identified in the Require header in addition to what Proxy- 7388 Require demands. 7390 Access Proxy: This type of proxy is used to ensure that an RTSP 7391 clients get access to servers on an external network. Thus 7392 this proxy is placed on the border between two domains, e.g. a 7393 private address space and the public Internet. The proxy 7394 performs the necessary translation, usually addresses. This 7395 type of proxy is required to redirect the media to itself or a 7396 controlled gateway that performs the translation before the 7397 media can reach the client. 7399 Security Proxy: This type of proxy is used to help facilitate 7400 security functions around RTSP. For example when having a 7401 firewalled network, the security proxy request that the 7402 necessary pinholes in the firewall are opened when a client in 7403 the protected network wants to access media streams on the 7404 external side. This proxy can also limit the clients access to 7405 certain types of content. This proxy can perform its function 7406 without redirecting the media between the server and client. 7407 However, in deployments with private address spaces this proxy 7408 is likely to be combined with the access proxy. Anyway, the 7409 functionality of this proxy is usually closely tied into 7410 understanding all aspects of the media transport. 7412 Auditing Proxy: RTSP proxies can also provide network owners with a 7413 logging and audit point for RTSP sessions, e.g. for 7414 corporations that track their employees usage of the network. 7415 This type of proxy can perform its function without inserting 7416 itself or any other node in the media transport. This proxy 7417 type can also accept unknown methods as it doesn't interfere 7418 with the clients' requests. 7420 All types of proxies can be used also when using secured 7421 communication with TLS as RTSP 2.0 allows the client to approve 7422 certificate chains used for connection establishment from a proxy, 7423 see Section 19.3.2. However, that trust model may not be suitable 7424 for all types of deployment. In those cases, the secured sessions do 7425 by-pass of the proxies. 7427 Access proxies SHOULD NOT be used in equipment like NATs and 7428 firewalls that aren't expected to be regularly maintained, like home 7429 or small office equipment. In these cases it is better to use the 7430 NAT traversal procedures defined for RTSP 2.0 7431 [I-D.ietf-mmusic-rtsp-nat]. The reason for these recommendations is 7432 that any extensions of RTSP resulting in new media transport 7433 protocols or profiles, new parameters, etc. may fail in a proxy that 7434 isn't maintained. This would impede RTSP's future development and 7435 usage. 7437 17.1. Proxies and Protocol Extensions 7439 The existence of proxies must always be considered when developing 7440 new RTSP extensions. Most types of proxies will need to implement 7441 any new method to operate correctly in the presence of that 7442 extension. New headers can be introduced and will not be blocked by 7443 older proxies. However, it is important to consider if this header 7444 and its function is required to be understood by the proxy or can be 7445 forwarded. If the header needs to be understood, a feature-tag 7446 representing the functionality MUST be included in the Proxy-Require 7447 header. Below are guidelines for analysis if the header needs to be 7448 understood. The transport header and its parameters also shows that 7449 headers that are extensible and require correct interpretation in the 7450 proxy also require handling rules. 7452 Whether a proxy needs to understand a header is not easy to 7453 determine, as they serve a broad variety of functions. When 7454 evaluating if a header needs to be understood, one can divide the 7455 functionality into three main categories: 7457 Media modifying: The caching and translator proxies are modifying 7458 the actual media and therefore needs to understand also request 7459 directed to the server that affects how the media is rendered. 7460 Thus, this type of proxy needs to also understand the server side 7461 functionality. 7463 Transport modifying: The access and the security proxy both need to 7464 understand how the transport is performed, either for opening 7465 pinholes or to translate the outer headers, e.g. IP and UDP. 7467 Non-modifying: The audit proxy is special in that it does not modify 7468 the messages in other ways than to insert the Via header. That 7469 makes it possible for this type to forward RTSP messages that 7470 contain different types of unknown methods, headers or header 7471 parameters. 7473 Based on the above classification, one should evaluate if the new 7474 functionality requires the Transport modifying type of proxies to 7475 understand it or not. 7477 17.2. Multiplexing and Demultiplexing of Messages 7479 RTSP proxies may have to multiplex multiple RTSP sessions from their 7480 clients towards RTSP servers. This requires that RTSP requests from 7481 multiple clients are multiplexed onto a common connection for 7482 requests outgoing to an RTSP server and on the way back the responses 7483 are demultiplexed from the server to per client responses. On the 7484 protocol level this requires that request and response messages are 7485 handled in both ways, requiring that there is a mechanism to 7486 correlate what request/response pair exchanged between proxy and 7487 server is mapped to what client (or client request). 7489 This multiplexing of requests and demultiplexing of responses is done 7490 by using the CSeq header field (see Section 16.19). The proxy has to 7491 rewrite the CSeq in requests to the server and responses from the 7492 server and remember what CSeq is mapped to what client. 7494 18. Caching 7496 In HTTP, request-response pairs are cached. RTSP differs 7497 significantly in that respect. Responses are not cacheable, with the 7498 exception of the presentation description returned by DESCRIBE. 7499 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 7500 not return any data, caching is not really an issue for these 7501 requests.) However, it is desirable for the continuous media data, 7502 typically delivered out-of-band with respect to RTSP, to be cached, 7503 as well as the session description. 7505 On receiving a SETUP or PLAY request, a proxy ascertains whether it 7506 has an up-to-date copy of the continuous media content and its 7507 description. It can determine whether the copy is up-to-date by 7508 issuing a SETUP or DESCRIBE request, respectively, and comparing the 7509 Last-Modified header with that of the cached copy. If the copy is 7510 not up-to-date, it modifies the SETUP transport parameters as 7511 appropriate and forwards the request to the origin server. 7512 Subsequent control commands such as PLAY or PAUSE then pass the proxy 7513 unmodified. The proxy delivers the continuous media data to the 7514 client, while possibly making a local copy for later reuse. The 7515 exact allowed behavior of the cache is given by the cache-response 7516 directives described in Section 16.10. A cache MUST answer any 7517 DESCRIBE requests if it is currently serving the stream to the 7518 requester, as it is possible that low-level details of the stream 7519 description may have changed on the origin-server. 7521 Note that an RTSP cache, is of the "cut-through" variety. Rather 7522 than retrieving the whole resource from the origin server, the cache 7523 simply copies the streaming data as it passes by on its way to the 7524 client. Thus, it does not introduce additional latency. 7526 To the client, an RTSP proxy cache appears like a regular media 7527 server, to the media origin server like a client. Just as an HTTP 7528 cache has to store the content type, content language, and so on for 7529 the objects it caches, a media cache has to store the presentation 7530 description. Typically, a cache eliminates all transport-references 7531 (e.g., multicast information) from the presentation description, 7532 since these are independent of the data delivery from the cache to 7533 the client. Information on the encodings remains the same. If the 7534 cache is able to translate the cached media data, it would create a 7535 new presentation description with all the encoding possibilities it 7536 can offer. 7538 18.1. Validation Model 7540 When a cache has a stale entry that it would like to use as a 7541 response to a client's request, it first has to check with the origin 7542 server (or possibly an intermediate cache with a fresh response) to 7543 see if its cached entry is still usable. We call this "validating" 7544 the cache entry. Since we do not want to have to pay the overhead of 7545 retransmitting the full response if the cached entry is good, and we 7546 do not want to pay the overhead of an extra round trip if the cached 7547 entry is invalid, the RTSP protocol supports the use of conditional 7548 methods. 7550 The key protocol features for supporting conditional methods are 7551 those concerned with "cache validators." When an origin server 7552 generates a full response, it attaches some sort of validator to it, 7553 which is kept with the cache entry. When a client (user agent or 7554 proxy cache) makes a conditional request for a resource for which it 7555 has a cache entry, it includes the associated validator in the 7556 request. 7558 The server then checks that validator against the current validator 7559 for the requested resource, and, if they match (see Section 18.1.3), 7560 it responds with a special status code (usually, 304 (Not Modified)) 7561 and no message body. Otherwise, it returns a full response 7562 (including message body). Thus, we avoid transmitting the full 7563 response if the validator matches, and we avoid an extra round trip 7564 if it does not match. 7566 In RTSP, a conditional request looks exactly the same as a normal 7567 request for the same resource, except that it carries a special 7568 header (which includes the validator) that implicitly turns the 7569 method (usually DESCRIBE or SETUP) into a conditional. 7571 The protocol includes both positive and negative senses of cache- 7572 validating conditions. That is, it is possible to request either 7573 that a method be performed if and only if a validator matches or if 7574 and only if no validators match. 7576 Note: a response that lacks a validator may still be cached, and 7577 served from cache until it expires, unless this is explicitly 7578 prohibited by a cache-control directive (see Section 16.10). 7579 However, a cache cannot do a conditional retrieval if it does not 7580 have a validator for the resource, which means it will not be 7581 refreshable after it expires. 7583 Media streams that are being adapted based on the transport capacity 7584 between the server and the cache makes caching more difficult. A 7585 server needs to consider how it views caching of media streams that 7586 it adapts and potentially instruct any caches to not cache such 7587 streams. 7589 18.1.1. Last-Modified Dates 7591 The Last-Modified header (Section 16.26) value is often used as a 7592 cache validator. In simple terms, a cache entry is considered to be 7593 valid if the content has not been modified since the Last-Modified 7594 value. 7596 18.1.2. Message Body Tag Cache Validators 7598 The MTag response-header field value, a message body tag, provides 7599 for an "opaque" cache validator. This might allow more reliable 7600 validation in situations where it is inconvenient to store 7601 modification dates, where the one-second resolution of RTSP-date 7602 values is not sufficient, or where the origin server wishes to avoid 7603 certain paradoxes that might arise from the use of modification 7604 dates. 7606 Message body tags are described in Section 4.8 7608 18.1.3. Weak and Strong Validators 7610 Since both origin servers and caches will compare two validators to 7611 decide if they represent the same or different entities, one normally 7612 would expect that if the message body (i.e., the presentation 7613 description) or any associated message body headers changes in any 7614 way, then the associated validator would change as well. If this is 7615 true, then we call this validator a "strong validator." We call 7616 message body (i.e., the presentation description) or any associated 7617 message body headers an entity for a better understanding. 7619 However, there might be cases when a server prefers to change the 7620 validator only on semantically significant changes, and not when 7621 insignificant aspects of the entity change. A validator that does 7622 not always change when the resource changes is a "weak validator." 7624 Message body tags are normally "strong validators," but the protocol 7625 provides a mechanism to tag a message body tag as "weak." One can 7626 think of a strong validator as one that changes whenever the bits of 7627 an entity changes, while a weak value changes whenever the meaning of 7628 an entity changes. Alternatively, one can think of a strong 7629 validator as part of an identifier for a specific entity, while a 7630 weak validator is part of an identifier for a set of semantically 7631 equivalent entities. 7633 Note: One example of a strong validator is an integer that is 7634 incremented in stable storage every time an entity is changed. 7636 An entity's modification time, if represented with one-second 7637 resolution, could be a weak validator, since it is possible that 7638 the resource might be modified twice during a single second. 7640 Support for weak validators is optional. However, weak validators 7641 allow for more efficient caching of equivalent objects. 7643 A "use" of a validator is either when a client generates a request 7644 and includes the validator in a validating header field, or when a 7645 server compares two validators. 7647 Strong validators are usable in any context. Weak validators are 7648 only usable in contexts that do not depend on exact equality of an 7649 entity. For example, either kind is usable for a conditional 7650 DESCRIBE of a full entity. However, only a strong validator is 7651 usable for a sub-range retrieval, since otherwise the client might 7652 end up with an internally inconsistent entity. 7654 Clients MAY issue DESCRIBE requests with either weak validators or 7655 strong validators. Clients MUST NOT use weak validators in other 7656 forms of requests. 7658 The only function that the RTSP protocol defines on validators is 7659 comparison. There are two validator comparison functions, depending 7660 on whether the comparison context allows the use of weak validators 7661 or not: 7663 o The strong comparison function: in order to be considered equal, 7664 both validators MUST be identical in every way, and both MUST NOT 7665 be weak. 7667 o The weak comparison function: in order to be considered equal, 7668 both validators MUST be identical in every way, but either or both 7669 of them MAY be tagged as "weak" without affecting the result. 7671 A message body tag is strong unless it is explicitly tagged as weak. 7673 A Last-Modified time, when used as a validator in a request, is 7674 implicitly weak unless it is possible to deduce that it is strong, 7675 using the following rules: 7677 o The validator is being compared by an origin server to the actual 7678 current validator for the entity and, 7680 o That origin server reliably knows that the associated entity did 7681 not change more than once during the second covered by the 7682 presented validator. 7684 OR 7686 o The validator is about to be used by a client in an If-Modified- 7687 Since, because the client has a cache entry for the associated 7688 entity, and 7690 o That cache entry includes a Date value, which gives the time when 7691 the origin server sent the original response, and 7693 o The presented Last-Modified time is at least 60 seconds before the 7694 Date value. 7696 OR 7698 o The validator is being compared by an intermediate cache to the 7699 validator stored in its cache entry for the entity, and 7701 o That cache entry includes a Date value, which gives the time when 7702 the origin server sent the original response, and 7704 o The presented Last-Modified time is at least 60 seconds before the 7705 Date value. 7707 This method relies on the fact that if two different responses were 7708 sent by the origin server during the same second, but both had the 7709 same Last-Modified time, then at least one of those responses would 7710 have a Date value equal to its Last-Modified time. The arbitrary 60- 7711 second limit guards against the possibility that the Date and Last- 7712 Modified values are generated from different clocks, or at somewhat 7713 different times during the preparation of the response. An 7714 implementation MAY use a value larger than 60 seconds, if it is 7715 believed that 60 seconds is too short. 7717 If a client wishes to perform a sub-range retrieval on a value for 7718 which it has only a Last-Modified time and no opaque validator, it 7719 MAY do this only if the Last-Modified time is strong in the sense 7720 described here. 7722 18.1.4. Rules for When to Use Message Body Tags and Last-Modified Dates 7724 We adopt a set of rules and recommendations for origin servers, 7725 clients, and caches regarding when various validator types ought to 7726 be used, and for what purposes. 7728 RTSP origin servers: 7730 o SHOULD send a message body tag validator unless it is not feasible 7731 to generate one. 7733 o MAY send a weak message body tag instead of a strong message body 7734 tag, if performance considerations support the use of weak message 7735 body tags, or if it is unfeasible to send a strong message body 7736 tag. 7738 o SHOULD send a Last-Modified value if it is feasible to send one, 7739 unless the risk of a breakdown in semantic transparency that could 7740 result from using this date in an If-Modified-Since header would 7741 lead to serious problems. 7743 In other words, the preferred behavior for an RTSP origin server is 7744 to send both a strong message body tag and a Last-Modified value. 7746 In order to be legal, a strong message body tag MUST change whenever 7747 the associated entity value changes in any way. A weak message body 7748 tag SHOULD change whenever the associated entity changes in a 7749 semantically significant way. 7751 Note: in order to provide semantically transparent caching, an 7752 origin server MUST avoid reusing a specific strong message body 7753 tag value for two different entities, or reusing a specific weak 7754 message body tag value for two semantically different entities. 7755 Cache entries might persist for arbitrarily long periods, 7756 regardless of expiration times, so it might be inappropriate to 7757 expect that a cache will never again attempt to validate an entry 7758 using a validator that it obtained at some point in the past. 7760 RTSP clients: 7762 o If a message body tag has been provided by the origin server, MUST 7763 use that message body tag in any cache-conditional request (using 7764 If-Match or If-None-Match). 7766 o If only a Last-Modified value has been provided by the origin 7767 server, SHOULD use that value in non-subrange cache-conditional 7768 requests (using If-Modified-Since). 7770 o If both a message body tag and a Last-Modified value have been 7771 provided by the origin server, SHOULD use both validators in 7772 cache-conditional requests. 7774 An RTSP origin server, upon receiving a conditional request that 7775 includes both a Last-Modified date (e.g., in an If-Modified-Since 7776 header) and one or more message body tags (e.g., in an If-Match, If- 7777 None-Match, or If-Range header field) as cache validators, MUST NOT 7778 return a response status of 304 (Not Modified) unless doing so is 7779 consistent with all of the conditional header fields in the request. 7781 Note: The general principle behind these rules is that RTSP 7782 servers and clients should transmit as much non-redundant 7783 information as is available in their responses and requests. RTSP 7784 systems receiving this information will make the most conservative 7785 assumptions about the validators they receive. 7787 18.1.5. Non-validating Conditionals 7789 The principle behind message body tags is that only the service 7790 author knows the semantics of a resource well enough to select an 7791 appropriate cache validation mechanism, and the specification of any 7792 validator comparison function more complex than byte-equality would 7793 open up a can of worms. Thus, comparisons of any other headers are 7794 never used for purposes of validating a cache entry. 7796 18.2. Invalidation After Updates or Deletions 7798 The effect of certain methods performed on a resource at the origin 7799 server might cause one or more existing cache entries to become non- 7800 transparently invalid. That is, although they might continue to be 7801 "fresh," they do not accurately reflect what the origin server would 7802 return for a new request on that resource. 7804 There is no way for the RTSP protocol to guarantee that all such 7805 cache entries are marked invalid. For example, the request that 7806 caused the change at the origin server might not have gone through 7807 the proxy where a cache entry is stored. However, several rules help 7808 reduce the likelihood of erroneous behavior. 7810 In this section, the phrase "invalidate an entity" means that the 7811 cache will either remove all instances of that entity from its 7812 storage, or will mark these as "invalid" and in need of a mandatory 7813 revalidation before they can be returned in response to a subsequent 7814 request. 7816 Some RTSP methods MUST cause a cache to invalidate an entity. This 7817 is either the entity referred to by the Request-URI, or by the 7818 Location or Content-Location headers (if present). These methods 7819 are: 7821 o DESCRIBE 7822 o SETUP 7824 In order to prevent denial of service attacks, an invalidation based 7825 on the URI in a Location or Content-Location header MUST only be 7826 performed if the host part is the same as in the Request-URI. 7828 A cache that passes through requests for methods it does not 7829 understand SHOULD invalidate any entities referred to by the Request- 7830 URI. 7832 19. Security Framework 7834 The RTSP security framework consists of two high level components: 7835 the pure authentication mechanisms based on HTTP authentication, and 7836 the message transport protection based on TLS, which is independent 7837 of RTSP. Because of the similarity in syntax and usage between RTSP 7838 servers and HTTP servers, the security for HTTP is re-used to a large 7839 extent. 7841 19.1. RTSP and HTTP Authentication 7843 RTSP and HTTP share common authentication schemes, and thus follow 7844 the same usage guidelines as specified in [RFC2617] and also in 7845 [H15]. Servers SHOULD implement both basic and digest [RFC2617] 7846 authentication. Clients MUST implement both basic and digest 7847 authentication [RFC2617] so that a server that requires the client to 7848 authenticate can trust that the capability is present. 7850 It should be stressed that using the HTTP authentication alone does 7851 not provide full control message security. Therefore, in 7852 environments requiring tighter security for the control messages, TLS 7853 SHOULD be used, see Section 19.2. 7855 19.2. RTSP over TLS 7857 RTSP MUST follow the same guidelines with regards to TLS [RFC5246] 7858 usage as specified for HTTP, see [RFC2818]. RTSP over TLS is 7859 separated from unsecured RTSP both on URI level and port level. 7860 Instead of using the "rtsp" scheme identifier in the URI, the "rtsps" 7861 scheme identifier MUST be used to signal RTSP over TLS. If no port 7862 is given in a URI with the "rtsps" scheme, port 322 MUST be used for 7863 TLS over TCP/IP. 7865 When a client tries to setup an insecure channel to the server (using 7866 the "rtsp" URI), and the policy for the resource requires a secure 7867 channel, the server MUST redirect the client to the secure service by 7868 sending a 301 redirect response code together with the correct 7869 Location URI (using the "rtsps" scheme). A user or client MAY 7870 upgrade a non secured URI to a secured by changing the scheme from 7871 "rtsp" to "rtsps". A server implementing support for "rtsps" MUST 7872 allow this. 7874 It should be noted that TLS allows for mutual authentication (when 7875 using both server and client certificates). Still, one of the more 7876 common ways TLS is used is to only provide server side authentication 7877 (often to avoid client certificates). TLS is then used in addition 7878 to HTTP authentication, providing transport security and server 7879 authentication, while HTTP Authentication is used to authenticate the 7880 client. 7882 RTSP includes the possibility to keep a TCP session up between the 7883 client and server, throughout the RTSP session lifetime. It may be 7884 convenient to keep the TCP session, not only to save the extra setup 7885 time for TCP, but also the extra setup time for TLS (even if TLS uses 7886 the resume function, there will be almost two extra round trips). 7887 Still, when TLS is used, such behavior introduces extra active state 7888 in the server, not only for TCP and RTSP, but also for TLS. This may 7889 increase the vulnerability to DoS attacks. 7891 In addition to these recommendations, Section 19.3 gives further 7892 recommendations of TLS usage with proxies. 7894 19.3. Security and Proxies 7896 The nature of a proxy is often to act as a "man-in-the-middle", while 7897 security is often about preventing the existence of a "man-in-the- 7898 middle". This section provides clients with the possibility to use 7899 proxies even when applying secure transports (TLS) between the RTSP 7900 agents. The TLS proxy mechanism allows for server and proxy 7901 identification using certificates. However, the client can not be 7902 identified based on certificates. The client needs to select between 7903 using the procedure specified below or using a TLS connection 7904 directly (by-passing any proxies) to the server. The choice may be 7905 dependent on policies. 7907 There are basically two categories of proxies, the transparent 7908 proxies (of which the client is not aware) and the non-transparent 7909 proxies (of which the client is aware), see Section Section 17 for an 7910 introduction to RTSP proxies. An infrastructure based on proxies 7911 requires that the trust model is such that both client and servers 7912 can trust the proxies to handle the RTSP messages correctly. To be 7913 able to trust a proxy, the client and server also needs to be aware 7914 of the proxy. Hence, transparent proxies cannot generally be seen as 7915 trusted and will not work well with security (unless they work only 7916 at transport layer). In the rest of this section any reference to 7917 proxy will be to a non-transparent proxy, which inspects or 7918 manipulate the RTSP messages. 7920 HTTP Authentication is built on the assumption of proxies and can 7921 provide user-proxy authentication and proxy-proxy/server 7922 authentication in addition to the client-server authentication. 7924 When TLS is applied and a proxy is used, the client will connect to 7925 the proxy's address when connecting to any RTSP server. This implies 7926 that for TLS, the client will authenticate the proxy server and not 7927 the end server. Note that when the client checks the server 7928 certificate in TLS, it MUST check the proxy's identity (URI or 7929 possibly other known identity) against the proxy's identity as 7930 presented in the proxy's Certificate message. 7932 The problem is that for a proxy accepted by the client, the proxy 7933 needs to be provided information on which grounds it should accept 7934 the next-hop certificate. Both the proxy and the user may have rules 7935 for this, and the user have the possibility to select the desired 7936 behavior. To handle this case, the Accept-Credentials header (See 7937 Section 16.2) is used, where the client can force the proxy/proxies 7938 to relay back the chain of certificates used to authenticate any 7939 intermediate proxies as well as the server. Given the assumption 7940 that the proxies are viewed as trusted, it gives the user a 7941 possibility to enforce policies to each trusted proxy of whether it 7942 should accept the next agent in the chain. 7944 A proxy MUST use TLS for the next hop if the RTSP request includes a 7945 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between 7946 client and proxy, or between proxy and proxy), even if the resource 7947 and the end server are not required to use it. The proxy MUST, when 7948 initiating the next hop TLS connection, use the incoming TLS 7949 connections cipher suite list, only modified by removing any cipher 7950 suits that the proxy does not support. In case a proxy fails to 7951 establish a TLS connection due to cipher suite mismatch between proxy 7952 and next hop proxy or server, this is indicated using error code 472 7953 (Failure to establish secure connection). 7955 19.3.1. Accept-Credentials 7957 The Accept-Credentials header can be used by the client to distribute 7958 simple authorization policies to intermediate proxies. The client 7959 includes the Accept-Credentials header to dictate how the proxy 7960 treats the server/next proxy certificate. There are currently three 7961 methods defined: 7963 Any, which means that the proxy (or proxies) MUST accept whatever 7964 certificate presented. This is of course not a recommended 7965 option to use, but may be useful in certain circumstances (such 7966 as testing). 7968 Proxy, which means that the proxy (or proxies) MUST use its own 7969 policies to validate the certificate and decide whether to 7970 accept it or not. This is convenient in cases where the user 7971 has a strong trust relation with the proxy. Reason why a 7972 strong trust relation may exist are; personal/company proxy, 7973 proxy has a out-of-band policy configuration mechanism. 7975 User, which means that the proxy (or proxies) MUST send credential 7976 information about the next hop to the client for authorization. 7977 The client can then decide whether the proxy should accept the 7978 certificate or not. See Section 19.3.2 for further details. 7980 If the Accept-Credentials header is not included in the RTSP request 7981 from the client, then the "Proxy" method MUST be used as default. If 7982 another method than the "Proxy" is to be used, then the Accept- 7983 Credentials header MUST be included in all of the RTSP requests from 7984 the client. This is because it cannot be assumed that the proxy 7985 always keeps the TLS state or the users previous preference between 7986 different RTSP messages (in particular if the time interval between 7987 the messages is long). 7989 With the "Any" and "Proxy" methods the proxy will apply the policy as 7990 defined for each method. If the policy does not accept the 7991 credentials of the next hop, the proxy MUST respond with a message 7992 using status code 471 (Connection Credentials not accepted). 7994 An RTSP request in the direction server to client MUST NOT include 7995 the Accept-Credentials header. As for the non-secured communication, 7996 the possibility for these requests depends on the presence of a 7997 client established connection. However, if the server to client 7998 request is in relation to a session established over a TLS secured 7999 channel, it MUST be sent in a TLS secured connection. That secured 8000 connection MUST also be the one used by the last client to server 8001 request. If no such transport connection exist at the time when the 8002 server desires to send the request, the server MUST discard the 8003 message. 8005 Further policies MAY be defined and registered, but should be done so 8006 with caution. 8008 19.3.2. User approved TLS procedure 8010 For the "User" method, each proxy MUST perform the following 8011 procedure for each RTSP request: 8013 o Setup the TLS session to the next hop if not already present (i.e. 8014 run the TLS handshake, but do not send the RTSP request). 8016 o Extract the peer certificate chain for the TLS session. 8018 o Check if a matching identity and hash of the peer certificate is 8019 present in the Accept-Credentials header. If present, send the 8020 message to the next hop, and conclude these procedures. If not, 8021 go to the next step. 8023 o The proxy responds to the RTSP request with a 470 or 407 response 8024 code. The 407 response code MAY be used when the proxy requires 8025 both user and connection authorization from user or client. In 8026 this message the proxy MUST include a Connection-Credentials 8027 header, see Section 16.12 with the next hop's identity and 8028 certificate. 8030 The client MUST upon receiving a 470 or 407 response with Connection- 8031 Credentials header take the decision on whether to accept the 8032 certificate or not (if it cannot do so, the user SHOULD be 8033 consulted). If the certificate is accepted, the client has to again 8034 send the RTSP request. In that request the client has to include the 8035 Accept-Credentials header including the hash over the DER encoded 8036 certificate for all trusted proxies in the chain. 8038 Example: 8040 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8041 CSeq: 2 8042 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8043 "192.0.2.5:4589" 8044 Accept-Ranges: NPT, SMPTE, UTC 8045 Accept-Credentials: User 8047 P->C: RTSP/2.0 470 Connection Authorization Required 8048 CSeq: 2 8049 Connection-Credentials: "rtsps://test.example.org"; 8050 MIIDNTCCAp... 8052 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8053 CSeq: 3 8054 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8055 "192.0.2.5:4589" 8056 Accept-Credentials: User "rtsps://test.example.org";sha-256; 8057 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 8058 Accept-Ranges: NPT, SMPTE, UTC 8060 P->S: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8061 CSeq: 3 8062 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8063 "192.0.2.5:4589" 8064 Via: RTSP/2.0 proxy.example.org 8065 Accept-Credentials: User "rtsps://test.example.org";sha-256; 8066 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 8067 Accept-Ranges: NPT, SMPTE, UTC 8069 One implication of this process is that the connection for secured 8070 RTSP messages may take significantly more round-trip times for the 8071 first message. A complete extra message exchange between the proxy 8072 connecting to the next hop and the client results because of the 8073 process for approval for each hop. However, if each message contains 8074 the chain of proxies that the requester accepts, the remaining 8075 message exchange should not be delayed. The procedure of including 8076 the credentials in each request rather than building state in each 8077 proxy, avoids the need for revocation procedures. 8079 20. Syntax 8081 The RTSP syntax is described in an Augmented Backus-Naur Form (ABNF) 8082 as defined in RFC 5234 [RFC5234]. It uses the basic definitions 8083 present in RFC 5234. 8085 Please note that ABNF strings, e.g. "Accept", are case insensitive 8086 as specified in section 2.3 of RFC 5234. 8088 20.1. Base Syntax 8090 RTSP header values can be folded onto multiple lines if the 8091 continuation line begins with a space or horizontal tab. All linear 8092 white space, including folding, has the same semantics as SP. A 8093 recipient MAY replace any linear white space with a single SP before 8094 interpreting the field value or forwarding the message downstream. 8095 This is intended to behave exactly as HTTP/1.1 as described in RFC 8096 2616 [RFC2616]. The SWS construct is used when linear white space is 8097 optional, generally between tokens and separators. 8099 To separate the header name from the rest of value, a colon is used, 8100 which, by the above rule, allows whitespace before, but no line 8101 break, and whitespace after, including a line break. The HCOLON 8102 defines this construct. 8104 OCTET = %x00-FF ; any 8-bit sequence of data 8105 CHAR = %x01-7F ; any US-ASCII character (octets 1 - 127) 8106 UPALPHA = %x41-5A ; any US-ASCII uppercase letter "A".."Z" 8107 LOALPHA = %x61-7A ;any US-ASCII lowercase letter "a".."z" 8108 ALPHA = UPALPHA / LOALPHA 8109 DIGIT = %x30-39 ; any US-ASCII digit "0".."9" 8110 CTL = %x00-1F / %x7F ; any US-ASCII control character 8111 ; (octets 0 - 31) and DEL (127) 8112 CR = %x0D ; US-ASCII CR, carriage return (13) 8113 LF = %x0A ; US-ASCII LF, linefeed (10) 8114 SP = %x20 ; US-ASCII SP, space (32) 8115 HT = %x09 ; US-ASCII HT, horizontal-tab (9) 8116 DQ = %x22 ; US-ASCII double-quote mark (34) 8117 BACKSLASH = %x5C ; US-ASCII backslash (92) 8118 CRLF = CR LF 8119 LWS = [CRLF] 1*( SP / HT ) ; Line-breaking White Space 8120 SWS = [LWS] ; Separating White Space 8121 HCOLON = *( SP / HT ) ":" SWS 8122 TEXT = %x20-7E / %x80-FF ; any OCTET except CTLs 8123 tspecials = "(" / ")" / "<" / ">" / "@" 8124 / "," / ";" / ":" / BACKSLASH / DQ 8125 / "/" / "[" / "]" / "?" / "=" 8126 / "{" / "}" / SP / HT 8127 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 8128 / %x41-5A / %x5E-7A / %x7C / %x7E) 8129 ; 1* 8130 quoted-string = ( DQ *qdtext DQ ) 8131 qdtext = %x20-21 / %x23-7E / %x80-FF / UTF8-NONASCII 8132 ; any UTF-8 TEXT except <"> 8133 quoted-pair = BACKSLASH CHAR 8134 ctext = %x20-27 / %x2A-7E 8135 / %x80-FF ; any OCTET except CTLs, "(" and ")" 8136 generic-param = token [ EQUAL gen-value ] 8137 gen-value = token / host / quoted-string 8139 safe = "$" / "-" / "_" / "." / "+" 8140 extra = "!" / "*" / "'" / "(" / ")" / "," 8141 rtsp-extra = "!" / "*" / "'" / "(" / ")" 8143 HEX = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" 8144 / "a" / "b" / "c" / "d" / "e" / "f" 8145 LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" 8146 ; lowercase "a-f" Hex 8147 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 8149 unreserved = ALPHA / DIGIT / safe / extra 8150 rtsp-unreserved = ALPHA / DIGIT / safe / rtsp-extra 8152 base64 = *base64-unit [base64-pad] 8153 base64-unit = 4base64-char 8154 base64-pad = (2base64-char "==") / (3base64-char "=") 8155 base64-char = ALPHA / DIGIT / "+" / "/" 8156 SLASH = SWS "/" SWS ; slash 8157 EQUAL = SWS "=" SWS ; equal 8158 LPAREN = SWS "(" SWS ; left parenthesis 8159 RPAREN = SWS ")" SWS ; right parenthesis 8160 COMMA = SWS "," SWS ; comma 8161 SEMI = SWS ";" SWS ; semicolon 8162 COLON = SWS ":" SWS ; colon 8163 MINUS = SWS "-" SWS ; minus/dash 8164 LDQUOT = SWS DQ ; open double quotation mark 8165 RDQUOT = DQ SWS ; close double quotation mark 8166 RAQUOT = ">" SWS ; right angle quote 8167 LAQUOT = SWS "<" ; left angle quote 8169 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 8170 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 8171 / %xE0-EF 2UTF8-CONT 8172 / %xF0-F7 3UTF8-CONT 8173 / %xF8-FB 4UTF8-CONT 8174 / %xFC-FD 5UTF8-CONT 8175 UTF8-CONT = %x80-BF 8177 POS-FLOAT = 1*12DIGIT ["." 1*9DIGIT] 8178 FLOAT = ["-"] POS-FLOAT 8180 20.2. RTSP Protocol Definition 8182 20.2.1. Generic Protocol elements 8183 RTSP-IRI = schemes ":" IRI-rest 8184 IRI-rest = ihier-part [ "?" iquery ] [ "#" ifragment ] 8185 ihier-part = "//" iauthority ipath-abempty 8186 RTSP-IRI-ref = RTSP-IRI / irelative-ref 8187 irelative-ref = irelative-part [ "?" iquery ] [ "#" ifragment ] 8188 irelative-part = "//" iauthority ipath-abempty 8189 / ipath-absolute 8190 / ipath-noscheme 8191 / ipath-empty 8193 iauthority = < As defined in RFC 3987> 8194 ipath = ipath-abempty ; begins with "/" or is empty 8195 / ipath-absolute ; begins with "/" but not "//" 8196 / ipath-noscheme ; begins with a non-colon segment 8197 / ipath-rootless ; begins with a segment 8198 / ipath-empty ; zero characters 8200 ipath-abempty = *( "/" isegment ) 8201 ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] 8202 ipath-noscheme = isegment-nz-nc *( "/" isegment ) 8203 ipath-rootless = isegment-nz *( "/" isegment ) 8204 ipath-empty = 0 8206 isegment = *ipchar [";" *ipchar] 8207 isegment-nz = 1*ipchar [";" *ipchar] 8208 / ";" *ipchar 8209 isegment-nz-nc = (1*ipchar-nc [";" *ipchar-nc]) 8210 / ";" *ipchar-nc 8211 ; non-zero-length segment without any colon ":" 8213 ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" 8214 ipchar-nc = iunreserved / pct-encoded / sub-delims / "@" 8216 iquery = < As defined in RFC 3987> 8217 ifragment = < As defined in RFC 3987> 8218 iunreserved = < As defined in RFC 3987> 8219 pct-encoded = < As defined in RFC 3987> 8220 RTSP-URI = schemes ":" URI-rest 8221 RTSP-REQ-URI = schemes ":" URI-req-rest 8222 RTSP-URI-Ref = RTSP-URI / RTSP-Relative 8223 RTSP-REQ-Ref = RTSP-REQ-URI / RTSP-REQ-Rel 8224 schemes = "rtsp" / "rtsps" / scheme 8225 scheme = < As defined in RFC 3986> 8226 URI-rest = hier-part [ "?" query ] [ "#" fragment ] 8227 URI-req-rest = hier-part [ "?" query ] 8228 ; Note fragment part not allowed in requests 8229 hier-part = "//" authority path-abempty 8231 RTSP-Relative = relative-part [ "?" query ] [ "#" fragment ] 8232 RTSP-REQ-Rel = relative-part [ "?" query ] 8233 relative-part = "//" authority path-abempty 8234 / path-absolute 8235 / path-noscheme 8236 / path-empty 8238 authority = < As defined in RFC 3986> 8239 query = < As defined in RFC 3986> 8240 fragment = < As defined in RFC 3986> 8242 path = path-abempty ; begins with "/" or is empty 8243 / path-absolute ; begins with "/" but not "//" 8244 / path-noscheme ; begins with a non-colon segment 8245 / path-rootless ; begins with a segment 8246 / path-empty ; zero characters 8248 path-abempty = *( "/" segment ) 8249 path-absolute = "/" [ segment-nz *( "/" segment ) ] 8250 path-noscheme = segment-nz-nc *( "/" segment ) 8251 path-rootless = segment-nz *( "/" segment ) 8252 path-empty = 0 8254 segment = *pchar [";" *pchar] 8255 segment-nz = ( 1*pchar [";" *pchar]) / (";" *pchar) 8256 segment-nz-nc = ( 1*pchar-nc [";" *pchar-nc]) / (";" *pchar-nc) 8257 ; non-zero-length segment without any colon ":" 8259 pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 8260 pchar-nc = unreserved / pct-encoded / sub-delims / "@" 8262 sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 8263 / "*" / "+" / "," / "=" 8265 smpte-range = smpte-type ["=" smpte-range-spec] 8266 ; See section 3.4 8267 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 8268 / ( "-" smpte-time ) 8269 smpte-type = "smpte" / "smpte-30-drop" 8270 / "smpte-25" / smpte-type-extension 8271 ; other timecodes may be added 8272 smpte-type-extension = "smpte" token 8273 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 8274 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 8276 npt-range = "npt" ["=" npt-range-spec] 8277 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 8278 npt-time = "now" / npt-sec / npt-hhmmss 8279 npt-sec = 1*19DIGIT [ "." 1*9DIGIT ] 8280 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ] 8281 npt-hh = 1*19DIGIT ; any positive number 8282 npt-mm = 1*2DIGIT ; 0-59 8283 npt-ss = 1*2DIGIT ; 0-59 8285 utc-range = "clock" ["=" utc-range-spec] 8286 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 8287 utc-time = utc-date "T" utc-clock "Z" 8288 utc-date = 8DIGIT 8289 utc-clock = 6DIGIT [ "." 1*9DIGIT ] 8291 feature-tag = token 8293 session-id = 1*256( ALPHA / DIGIT / safe ) 8295 extension-header = header-name HCOLON header-value 8296 header-name = token 8297 header-value = *(TEXT-UTF8char / UTF8-CONT / LWS) 8299 20.2.2. Message Syntax 8300 RTSP-message = Request / Response ; RTSP/2.0 messages 8302 Request = Request-Line 8303 *((general-header 8304 / request-header 8305 / message-header) CRLF) 8306 CRLF 8307 [ message-body-data ] 8309 Response = Status-Line 8310 *((general-header 8311 / response-header 8312 / message-header) CRLF) 8313 CRLF 8314 [ message-body-data ] 8316 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 8318 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 8319 Method = "DESCRIBE" 8320 / "GET_PARAMETER" 8321 / "OPTIONS" 8322 / "PAUSE" 8323 / "PLAY" 8324 / "PLAY_NOTIFY" 8325 / "REDIRECT" 8326 / "SETUP" 8327 / "SET_PARAMETER" 8328 / "TEARDOWN" 8329 / extension-method 8331 extension-method = token 8333 Request-URI = "*" / RTSP-REQ-URI 8334 RTSP-Version = "RTSP/" 1*DIGIT "." 1*DIGIT 8336 message-body-data = 1*OCTET 8338 Status-Code = "100" ; Continue 8339 / "200" ; OK 8340 / "301" ; Moved Permanently 8341 / "302" ; Found 8342 / "303" ; See Other 8343 / "304" ; Not Modified 8344 / "305" ; Use Proxy 8345 / "400" ; Bad Request 8346 / "401" ; Unauthorized 8347 / "402" ; Payment Required 8348 / "403" ; Forbidden 8349 / "404" ; Not Found 8350 / "405" ; Method Not Allowed 8351 / "406" ; Not Acceptable 8352 / "407" ; Proxy Authentication Required 8353 / "408" ; Request Time-out 8354 / "410" ; Gone 8355 / "411" ; Length Required 8356 / "412" ; Precondition Failed 8357 / "413" ; Request Message Body Too Large 8358 / "414" ; Request-URI Too Large 8359 / "415" ; Unsupported Media Type 8360 / "451" ; Parameter Not Understood 8361 / "452" ; reserved 8362 / "453" ; Not Enough Bandwidth 8363 / "454" ; Session Not Found 8364 / "455" ; Method Not Valid in This State 8365 / "456" ; Header Field Not Valid for Resource 8366 / "457" ; Invalid Range 8367 / "458" ; Parameter Is Read-Only 8368 / "459" ; Aggregate operation not allowed 8369 / "460" ; Only aggregate operation allowed 8370 / "461" ; Unsupported Transport 8371 / "462" ; Destination Unreachable 8372 / "463" ; Destination Prohibited 8373 / "464" ; Data Transport Not Ready Yet 8374 / "465" ; Notification Reason Unknown 8375 / "466" ; Key Management Error 8376 / "470" ; Connection Authorization Required 8377 / "471" ; Connection Credentials not accepted 8378 / "472" ; Failure to establish secure connection 8379 / "500" ; Internal Server Error 8380 / "501" ; Not Implemented 8381 / "502" ; Bad Gateway 8382 / "503" ; Service Unavailable 8383 / "504" ; Gateway Time-out 8384 / "505" ; RTSP Version not supported 8385 / "551" ; Option not supported 8386 / extension-code 8388 extension-code = 3DIGIT 8390 Reason-Phrase = 1*(TEXT-UTF8char / HT / SP) 8391 general-header = Cache-Control 8392 / Connection 8393 / CSeq 8394 / Date 8395 / Media-Properties 8396 / Media-Range 8397 / Pipelined-Requests 8398 / Proxy-Supported 8399 / Seek-Style 8400 / Server 8401 / Supported 8402 / Timestamp 8403 / User-Agent 8404 / Via 8405 / extension-header 8407 request-header = Accept 8408 / Accept-Credentials 8409 / Accept-Encoding 8410 / Accept-Language 8411 / Authorization 8412 / Bandwidth 8413 / Blocksize 8414 / From 8415 / If-Match 8416 / If-Modified-Since 8417 / If-None-Match 8418 / Notify-Reason 8419 / Proxy-Require 8420 / Range 8421 / Referrer 8422 / Request-Status 8423 / Require 8424 / Scale 8425 / Session 8426 / Speed 8427 / Supported 8428 / Terminate-Reason 8429 / Transport 8430 / extension-header 8432 response-header = Accept-Credentials 8433 / Accept-Ranges 8434 / Connection-Credentials 8435 / MTag 8436 / Location 8437 / Proxy-Authenticate 8438 / Public 8439 / Range 8440 / Retry-After 8441 / RTP-Info 8442 / Scale 8443 / Session 8444 / Speed 8445 / Transport 8446 / Unsupported 8447 / Vary 8448 / WWW-Authenticate 8449 / extension-header 8451 message-header = Allow 8452 / Content-Base 8453 / Content-Encoding 8454 / Content-Language 8455 / Content-Length 8456 / Content-Location 8457 / Content-Type 8458 / Expires 8459 / Last-Modified 8460 / extension-header 8462 20.2.3. Header Syntax 8464 Accept = "Accept" HCOLON 8465 [ accept-range *(COMMA accept-range) ] 8466 accept-range = media-type-range [SEMI accept-params] 8467 media-type-range = ( "*/*" 8468 / ( m-type SLASH "*" ) 8469 / ( m-type SLASH m-subtype ) 8470 ) *( SEMI m-parameter ) 8471 accept-params = "q" EQUAL qvalue *(SEMI generic-param ) 8472 qvalue = ( "0" [ "." *3DIGIT ] ) 8473 / ( "1" [ "." *3("0") ] ) 8474 Accept-Credentials = "Accept-Credentials" HCOLON cred-decision 8475 cred-decision = ("User" [LWS cred-info]) 8476 / "Proxy" 8477 / "Any" 8478 / (token [LWS 1*header-value]) 8479 ; For future extensions 8480 cred-info = cred-info-data *(COMMA cred-info-data) 8482 cred-info-data = DQ RTSP-REQ-URI DQ SEMI hash-alg SEMI base64 8483 hash-alg = "sha-256" / extension-alg 8484 extension-alg = token 8485 Accept-Encoding = "Accept-Encoding" HCOLON 8486 [ encoding *(COMMA encoding) ] 8487 encoding = codings [SEMI accept-params] 8488 codings = content-coding / "*" 8489 content-coding = token 8490 Accept-Language = "Accept-Language" HCOLON 8491 language *(COMMA language) 8492 language = language-range [SEMI accept-params] 8493 language-range = language-tag / "*" 8494 language-tag = primary-tag *( "-" subtag ) 8495 primary-tag = 1*8ALPHA 8496 subtag = 1*8ALPHA 8497 Accept-Ranges = "Accept-Ranges" HCOLON acceptable-ranges 8498 acceptable-ranges = (range-unit *(COMMA range-unit)) 8499 range-unit = "NPT" / "SMPTE" / "UTC" / extension-format 8500 extension-format = token 8501 Allow = "Allow" HCOLON Method *(COMMA Method) 8502 Authorization = "Authorization" HCOLON credentials 8503 credentials = ("Digest" LWS digest-response) 8504 / other-response 8505 digest-response = dig-resp *(COMMA dig-resp) 8506 dig-resp = username / realm / nonce / digest-uri 8507 / dresponse / algorithm / cnonce 8508 / opaque / message-qop 8509 / nonce-count / auth-param 8510 username = "username" EQUAL username-value 8511 username-value = quoted-string 8512 digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT 8513 digest-uri-value = RTSP-REQ-URI 8514 message-qop = "qop" EQUAL qop-value 8515 cnonce = "cnonce" EQUAL cnonce-value 8516 cnonce-value = nonce-value 8517 nonce-count = "nc" EQUAL nc-value 8518 nc-value = 8LHEX 8519 dresponse = "response" EQUAL request-digest 8520 request-digest = LDQUOT 32LHEX RDQUOT 8521 auth-param = auth-param-name EQUAL 8522 ( token / quoted-string ) 8523 auth-param-name = token 8524 other-response = auth-scheme LWS auth-param 8525 *(COMMA auth-param) 8526 auth-scheme = token 8527 Bandwidth = "Bandwidth" HCOLON 1*19DIGIT 8529 Blocksize = "Blocksize" HCOLON 1*9DIGIT 8531 Cache-Control = "Cache-Control" HCOLON cache-directive 8532 *(COMMA cache-directive) 8533 cache-directive = cache-rqst-directive 8534 / cache-rspns-directive 8536 cache-rqst-directive = "no-cache" 8537 / "max-stale" [EQUAL delta-seconds] 8538 / "min-fresh" EQUAL delta-seconds 8539 / "only-if-cached" 8540 / cache-extension 8542 cache-rspns-directive = "public" 8543 / "private" 8544 / "no-cache" 8545 / "no-transform" 8546 / "must-revalidate" 8547 / "proxy-revalidate" 8548 / "max-age" EQUAL delta-seconds 8549 / cache-extension 8551 cache-extension = token [EQUAL (token / quoted-string)] 8552 delta-seconds = 1*19DIGIT 8554 Connection = "Connection" HCOLON connection-token 8555 *(COMMA connection-token) 8556 connection-token = "close" / token 8558 Connection-Credentials = "Connection-Credentials" HCOLON cred-chain 8559 cred-chain = DQ RTSP-REQ-URI DQ SEMI base64 8561 Content-Base = "Content-Base" HCOLON RTSP-URI 8562 Content-Encoding = "Content-Encoding" HCOLON 8563 content-coding *(COMMA content-coding) 8564 Content-Language = "Content-Language" HCOLON 8565 language-tag *(COMMA language-tag) 8566 Content-Length = "Content-Length" HCOLON 1*19DIGIT 8567 Content-Location = "Content-Location" HCOLON RTSP-REQ-Ref 8568 Content-Type = "Content-Type" HCOLON media-type 8569 media-type = m-type SLASH m-subtype *(SEMI m-parameter) 8570 m-type = discrete-type / composite-type 8571 discrete-type = "text" / "image" / "audio" / "video" 8572 / "application" / extension-token 8573 composite-type = "message" / "multipart" / extension-token 8574 extension-token = ietf-token / x-token 8575 ietf-token = token 8576 x-token = "x-" token 8577 m-subtype = extension-token / iana-token 8578 iana-token = token 8579 m-parameter = m-attribute EQUAL m-value 8580 m-attribute = token 8581 m-value = token / quoted-string 8583 CSeq = "CSeq" HCOLON cseq-nr 8584 cseq-nr = 1*9DIGIT 8585 Date = "Date" HCOLON RTSP-date 8586 RTSP-date = rfc1123-date ; HTTP-date 8587 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 8588 date1 = 2DIGIT SP month SP 4DIGIT 8589 ; day month year (e.g., 02 Jun 1982) 8590 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 8591 ; 00:00:00 - 23:59:59 8592 wkday = "Mon" / "Tue" / "Wed" 8593 / "Thu" / "Fri" / "Sat" / "Sun" 8594 month = "Jan" / "Feb" / "Mar" / "Apr" 8595 / "May" / "Jun" / "Jul" / "Aug" 8596 / "Sep" / "Oct" / "Nov" / "Dec" 8598 Expires = "Expires" HCOLON RTSP-date 8599 From = "From" HCOLON from-spec 8600 from-spec = ( name-addr / addr-spec ) *( SEMI from-param ) 8601 name-addr = [ display-name ] LAQUOT addr-spec RAQUOT 8602 addr-spec = RTSP-REQ-URI / absolute-URI 8603 absolute-URI = < As defined in RFC 3986> 8604 display-name = *(token LWS) / quoted-string 8605 from-param = tag-param / generic-param 8606 tag-param = "tag" EQUAL token 8607 If-Match = "If-Match" HCOLON ("*" / message-tag-list) 8608 message-tag-list = message-tag *(COMMA message-tag) 8609 message-tag = [ weak ] opaque-tag 8610 weak = "W/" 8611 opaque-tag = quoted-string 8612 If-Modified-Since = "If-Modified-Since" HCOLON RTSP-date 8613 If-None-Match = "If-None-Match" HCOLON ("*" / message-tag-list) 8614 Last-Modified = "Last-Modified" HCOLON RTSP-date 8615 Location = "Location" HCOLON RTSP-REQ-URI 8616 Media-Properties = "Media-Properties" HCOLON [media-prop-list] 8617 media-prop-list = media-prop-value *(COMMA media-prop-value) 8618 media-prop-value = ("Random-Access" [EQUAL POS-FLOAT]) 8619 / "Begining-Only" 8620 / "No-Seeking" 8621 / "Immutable" 8622 / "Dynamic" 8623 / "Time-Progressing" 8624 / "Unlimited" 8625 / ("Time-Limited" EQUAL utc-time) 8626 / ("Time-Duration" EQUAL POS-FLOAT) 8627 / ("Scales" EQUAL scale-value-list) 8628 / media-prop-ext 8629 media-prop-ext = token [EQUAL (1*rtsp-unreserved / quoted-string)] 8630 scale-value-list = DQ scale-entry *(COMMA scale-entry) DQ 8631 scale-entry = scale-value / (scale-value COLON scale-value) 8632 scale-value = FLOAT 8633 Media-Range = "Media-Range" HCOLON [ranges-list] 8634 ranges-list = ranges-spec *(COMMA ranges-spec) 8635 MTag = "MTag" HCOLON message-tag 8636 Notify-Reason = "Notify-Reason" HCOLON Notify-Reas-val 8637 Notify-Reas-val = "end-of-stream" 8638 / "media-properties-update" 8639 / "scale-change" 8640 / Notify-Reason-extension 8641 Notify-Reason-extension = token 8642 Pipelined-Requests = "Pipelined-Requests" HCOLON startup-id 8643 startup-id = 1*8DIGIT 8645 Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge-list 8646 challenge-list = challenge *(COMMA challenge) 8647 challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) 8648 / other-challenge 8649 other-challenge = auth-scheme LWS auth-param 8650 *(COMMA auth-param) 8651 digest-cln = realm / domain / nonce 8652 / opaque / stale / algorithm 8653 / qop-options / auth-param 8654 realm = "realm" EQUAL realm-value 8655 realm-value = quoted-string 8656 domain = "domain" EQUAL LDQUOT RTSP-REQ-Ref 8657 *(1*SP RTSP-REQ-Ref ) RDQUOT 8658 nonce = "nonce" EQUAL nonce-value 8659 nonce-value = quoted-string 8660 opaque = "opaque" EQUAL quoted-string 8661 stale = "stale" EQUAL ( "true" / "false" ) 8662 algorithm = "algorithm" EQUAL ("MD5" / "MD5-sess" / token) 8663 qop-options = "qop" EQUAL LDQUOT qop-value 8664 *("," qop-value) RDQUOT 8665 qop-value = "auth" / "auth-int" / token 8666 Proxy-Require = "Proxy-Require" HCOLON feature-tag-list 8667 feature-tag-list = feature-tag *(COMMA feature-tag) 8668 Proxy-Supported = "Proxy-Supported" HCOLON [feature-tag-list] 8670 Public = "Public" HCOLON Method *(COMMA Method) 8672 Range = "Range" HCOLON ranges-spec 8674 ranges-spec = npt-range / utc-range / smpte-range 8675 / range-ext 8676 range-ext = extension-format ["=" range-value] 8677 range-value = 1*(rtsp-unreserved / quoted-string / ":" ) 8679 Referrer = "Referrer" HCOLON (absolute-URI / RTSP-URI-Ref) 8680 Request-Status = "Request-Status" HCOLON req-status-info 8681 req-status-info = cseq-info LWS status-info LWS reason-info 8682 cseq-info = "cseq" EQUAL cseq-nr 8683 status-info = "status" EQUAL Status-Code 8684 reason-info = "reason" EQUAL DQ Reason-Phrase DQ 8685 Require = "Require" HCOLON feature-tag-list 8686 RTP-Info = "RTP-Info" HCOLON [rtsp-info-spec 8687 *(COMMA rtsp-info-spec)] 8688 rtsp-info-spec = stream-url 1*ssrc-parameter 8689 stream-url = "url" EQUAL DQ RTSP-REQ-Ref DQ 8690 ssrc-parameter = LWS "ssrc" EQUAL ssrc HCOLON 8691 ri-parameter *(SEMI ri-parameter) 8692 ri-parameter = ("seq" EQUAL 1*5DIGIT) 8693 / ("rtptime" EQUAL 1*10DIGIT) 8694 / generic-param 8696 Retry-After = "Retry-After" HCOLON ( RTSP-date / delta-seconds ) 8697 Scale = "Scale" HCOLON scale-value 8698 Seek-Style = "Seek-Style" HCOLON Seek-S-values 8699 Seek-S-values = "RAP" 8700 / "CoRAP" 8701 / "First-Prior" 8702 / "Next" 8703 / Seek-S-value-ext 8704 Seek-S-value-ext = token 8706 Server = "Server" HCOLON ( product / comment ) 8707 *(LWS (product / comment)) 8708 product = token [SLASH product-version] 8709 product-version = token 8710 comment = LPAREN *( ctext / quoted-pair) RPAREN 8712 Session = "Session" HCOLON session-id 8713 [ SEMI "timeout" EQUAL delta-seconds ] 8715 Speed = "Speed" HCOLON lower-bound MINUS upper-bound 8716 lower-bound = POS-FLOAT 8717 upper-bound = POS-FLOAT 8719 Supported = "Supported" HCOLON [feature-tag-list] 8720 Terminate-Reason = "Terminate-Reason" HCOLON TR-Info 8721 TR-Info = TR-Reason *(SEMI TR-Parameter) 8722 TR-Reason = "Session-Timeout" 8723 / "Server-Admin" 8724 / "Internal-Error" 8725 / token 8726 TR-Parameter = TR-time / TR-user-msg / generic-param 8727 TR-time = "time" EQUAL utc-time 8728 TR-user-msg = "user-msg" EQUAL quoted-string 8730 Timestamp = "Timestamp" HCOLON timestamp-value [LWS delay] 8731 timestamp-value = *19DIGIT [ "." *9DIGIT ] 8732 delay = *9DIGIT [ "." *9DIGIT ] 8734 Transport = "Transport" HCOLON transport-spec 8735 *(COMMA transport-spec) 8736 transport-spec = transport-id *trns-parameter 8737 transport-id = trans-id-rtp / other-trans 8738 trans-id-rtp = "RTP/" profile ["/" lower-transport] 8739 ; no LWS is allowed inside transport-id 8740 other-trans = token *("/" token) 8742 profile = "AVP" / "SAVP" / "AVPF" / "SAVPF" / token 8743 lower-transport = "TCP" / "UDP" / token 8744 trns-parameter = (SEMI ( "unicast" / "multicast" )) 8745 / (SEMI "interleaved" EQUAL channel [ "-" channel ]) 8746 / (SEMI "ttl" EQUAL ttl) 8747 / (SEMI "layers" EQUAL 1*DIGIT) 8748 / (SEMI "ssrc" EQUAL ssrc *(SLASH ssrc)) 8749 / (SEMI "mode" EQUAL mode-spec) 8750 / (SEMI "dest_addr" EQUAL addr-list) 8751 / (SEMI "src_addr" EQUAL addr-list) 8752 / (SEMI "setup" EQUAL contrans-setup) 8753 / (SEMI "connection" EQUAL contrans-con) 8754 / (SEMI "RTCP-mux") 8755 / (SEMI "MIKEY" EQUAL MIKEY-Value) 8756 / (SEMI trn-param-ext) 8757 contrans-setup = "active" / "passive" / "actpass" 8758 contrans-con = "new" / "existing" 8759 trn-param-ext = par-name [EQUAL trn-par-value] 8760 par-name = token 8761 trn-par-value = *(rtsp-unreserved / quoted-string) 8762 ttl = 1*3DIGIT ; 0 to 255 8763 ssrc = 8HEX 8764 channel = 1*3DIGIT ; 0 to 255 8765 MIKEY-Value = base64 8766 mode-spec = ( DQ mode *(COMMA mode) DQ ) 8767 mode = "PLAY" / token 8768 addr-list = quoted-addr *(SLASH quoted-addr) 8769 quoted-addr = DQ (host-port / extension-addr) DQ 8770 host-port = ( host [":" port] ) 8771 / ( ":" port ) 8772 extension-addr = 1*qdtext 8773 host = < As defined in RFC 3986> 8774 port = < As defined in RFC 3986> 8775 Unsupported = "Unsupported" HCOLON feature-tag-list 8777 User-Agent = "User-Agent" HCOLON ( product / comment ) 8778 *(LWS (product / comment)) 8780 Vary = "Vary" HCOLON ( "*" / field-name-list) 8781 field-name-list = field-name *(COMMA field-name) 8782 field-name = token 8783 Via = "Via" HCOLON via-parm *(COMMA via-parm) 8784 via-parm = sent-protocol LWS sent-by *( SEMI via-params ) 8785 via-params = via-ttl / via-maddr 8786 / via-received / via-extension 8787 via-ttl = "ttl" EQUAL ttl 8788 via-maddr = "maddr" EQUAL host 8789 via-received = "received" EQUAL (IPv4address / IPv6address) 8790 IPv4address = < As defined in RFC 3986> 8791 IPv6address = < As defined in RFC 3986> 8792 via-extension = generic-param 8793 sent-protocol = protocol-name SLASH protocol-version 8794 SLASH transport-prot 8795 protocol-name = "RTSP" / token 8796 protocol-version = token 8797 transport-prot = "UDP" / "TCP" / "TLS" / other-transport 8798 other-transport = token 8799 sent-by = host [ COLON port ] 8801 WWW-Authenticate = "WWW-Authenticate" HCOLON challenge-list 8803 20.3. SDP extension Syntax 8805 This section defines in ABNF the SDP extensions defined for RTSP. 8806 See Appendix D for the definition of the extensions in text. 8808 control-attribute = "a=control:" *SP RTSP-REQ-Ref CRLF 8810 a-range-def = "a=range:" ranges-spec CRLF 8812 a-mtag-def = "a=mtag:" message-tag CRLF 8814 21. Security Considerations 8816 Because of the similarity in syntax and usage between RTSP servers 8817 and HTTP servers, the security considerations outlined in [H15] apply 8818 also. 8820 Specifically, please note the following: 8822 Abuse of Server Log Information: RTSP and HTTP servers will 8823 presumably have similar logging mechanisms, and thus should be 8824 equally guarded in protecting the contents of those logs, thus 8825 protecting the privacy of the users of the servers. See 8826 [H15.1.1] for HTTP server recommendations regarding server 8827 logs. 8829 Transfer of Sensitive Information: There is no reason to believe 8830 that information transferred or controlled via RTSP may be any 8831 less sensitive than that normally transmitted via HTTP. 8832 Therefore, all of the precautions regarding the protection of 8833 data privacy and user privacy apply to implementors of RTSP 8834 clients, servers, and proxies. See [H15.1.2] for further 8835 details. 8837 Attacks Based On File and Path Names: Though RTSP URIs are opaque 8838 handles that do not necessarily have file system semantics, it 8839 is anticipated that many implementations will translate 8840 portions of the Request-URIs directly to file system calls. In 8841 such cases, file systems SHOULD follow the precautions outlined 8842 in [H15.5], such as checking for ".." in path components. 8844 Personal Information: RTSP clients are often privy to the same 8845 information that HTTP clients are (user name, location, etc.) 8846 and thus should be equally sensitive. See [H15.1] for further 8847 recommendations. 8849 Privacy Issues Connected to Accept Headers: Since may of the same 8850 "Accept" headers exist in RTSP as in HTTP, the same caveats 8851 outlined in [H15.1.4] with regards to their use should be 8852 followed. 8854 DNS Spoofing: Presumably, given the longer connection times 8855 typically associated to RTSP sessions relative to HTTP 8856 sessions, RTSP client DNS optimizations should be less 8857 prevalent. Nonetheless, the recommendations provided in 8858 [H15.3] are still relevant to any implementation which attempts 8859 to rely on a DNS-to-IP mapping to hold beyond a single use of 8860 the mapping. 8862 Location Headers and Spoofing: If a single server supports multiple 8863 organizations that do not trust each another, then it needs to 8864 check the values of Location and Content-Location header fields 8865 in responses that are generated under control of said 8866 organizations to make sure that they do not attempt to 8867 invalidate resources over which they have no authority. 8868 ([H15.4]) 8870 In addition to the recommendations in the current HTTP specification 8871 (RFC 2616 [RFC2616], as of this writing) and also of the previous RFC 8872 2068 [RFC2068], future HTTP specifications may provide additional 8873 guidance on security issues. 8875 The following are added considerations for RTSP implementations. 8877 Concentrated denial-of-service attack: The protocol offers the 8878 opportunity for a remote-controlled denial-of-service attack. 8879 See Section 21.1. 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 would affect unsuspecting clients. The 8885 server SHOULD use a large, random and non-sequential session 8886 identifier to minimize the possibility of this kind of attack. 8887 However, unless the RTSP signaling is always confidentiality 8888 protected, e.g. using TLS, an on-path attacker will be able to 8889 hijack a session. For real session security, client 8890 authentication needs to be performed. 8892 Authentication: Servers SHOULD implement both basic and digest 8893 [RFC2617] authentication. In environments requiring tighter 8894 security for the control messages, the transport layer 8895 mechanism TLS [RFC5246] SHOULD be used. 8897 Stream issues: RTSP only provides for stream control. Stream 8898 delivery issues are not covered in this section, nor in the 8899 rest of this draft. RTSP implementations will most likely rely 8900 on other protocols such as RTP, IP multicast, RSVP and IGMP, 8901 and should address security considerations brought up in those 8902 and other applicable specifications. 8904 Persistently suspicious behavior: RTSP servers SHOULD return error 8905 code 403 (Forbidden) upon receiving a single instance of 8906 behavior which is deemed a security risk. RTSP servers SHOULD 8907 also be aware of attempts to probe the server for weaknesses 8908 and entry points and MAY arbitrarily disconnect and ignore 8909 further requests from clients which are deemed to be in 8910 violation of local security policy. 8912 Scope of Multicast: If RTSP is used to control the transmission of 8913 media onto a multicast network it is needed to consider the 8914 scope that delivery has. RTSP supports the TTL Transport 8915 header parameter to indicate this scope for IPv4. However, 8916 such scope control is risks, as it may be set too large and 8917 distribute media beyond the intended scope. 8919 TLS through proxies: If one uses the possibility to connect TLS in 8920 multiple legs (Section 19.3) one really needs to be aware of 8921 the trust model. That procedure requires full faith and trust 8922 in all proxies that one allows to connect through. They are 8923 men in the middle and have access to all that goes on over the 8924 TLS connection. Thus it is important to consider if that trust 8925 model is acceptable in the actual application. 8927 Resource Exhaustion: As RTSP is a stateful protocol and establish 8928 resource usage on the server there is a clear possibility to 8929 attack the server by trying to overbook these resources to 8930 perform a denial of service attack. This attack can be both 8931 against ongoing sessions and to prevent others from 8932 establishing sessions. RTSP agents will need to have 8933 mechanisms to prevent single peers from consuming extensive 8934 amounts of resources. 8936 21.1. Remote denial of Service Attack 8938 The attacker may initiate traffic flows to one or more IP addresses 8939 by specifying them as the destination in SETUP requests. While the 8940 attacker's IP address may be known in this case, this is not always 8941 useful in prevention of more attacks or ascertaining the attackers 8942 identity. Thus, an RTSP server MUST only allow client-specified 8943 destinations for RTSP-initiated traffic flows if the server has 8944 ensured that the specified destination address accepts receiving 8945 media through different security mechanisms. Security mechanisms 8946 that are acceptable in an increased generality are: 8948 o Verification of the client's identity against a database of known 8949 users using RTSP authentication mechanisms (preferably digest 8950 authentication or stronger) 8952 o A list of addresses that accept to be media destinations, 8953 especially considering user identity 8955 o Media path based verification 8957 The server SHOULD NOT allow the destination field to be set unless a 8958 mechanism exists in the system to authorize the request originator to 8959 direct streams to the recipient. It is preferred that this 8960 authorization be performed by the media recipient (destination) 8961 itself and the credentials passed along to the server. However, in 8962 certain cases, such as when recipient address is a multicast group, 8963 or when the recipient is unable to communicate with the server in an 8964 out-of-band manner, this may not be possible. In these cases the 8965 server may chose another method such as a server-resident 8966 authorization list to ensure that the request originator has the 8967 proper credentials to request stream delivery to the recipient. 8969 One solution that performs the necessary verification of acceptance 8970 of media suitable for unicast based delivery is the ICE based NAT 8971 traversal method described in [I-D.ietf-mmusic-rtsp-nat]. By using 8972 random passwords and username the probability of unintended 8973 indication as a valid media destination is very low. If the server 8974 include in its STUN requests a cookie (consisting of random material) 8975 that the destination echoes back the solution is also safe against 8976 having a off-path attacker being able to spoof the STUN checks. This 8977 leaves this solution vulnerable only to on-path attackers that can 8978 see the STUN requests go to the target of attack. 8980 For delivery to multicast addresses there is a need for another 8981 solution which is not specified in this memo. 8983 22. IANA Considerations 8985 This section sets up a number of registries for RTSP 2.0 that should 8986 be maintained by IANA. These registries are separate from any 8987 registries existing for RTSP 1.0. For each registry there is a 8988 description on what it is required to contain, what specification is 8989 needed when adding an entry with IANA, and finally the entries that 8990 this document needs to register. See also the Section 2.7 "Extending 8991 RTSP". There is also an IANA registration of two SDP attributes. 8993 Registries or entries in registries which have been made for RTSP 1.0 8994 are not moved to RTSP 2.0. The registries and entries in registries 8995 of RTSP 1.0 and RTSP 2.0 are indenpendent. If any registry or entry 8996 in a registry is also required in RTSP 2.0, it must follow the below 8997 defined procedure to allocated the registry or entry in a registry. 8999 The sections describing how to register an item uses some of the 9000 requirements level described in RFC 5226 [RFC5226], namely "First 9001 Come, First Served", "Expert Review, "Specification Required", and 9002 "Standards Action". 9004 In case a registry requires a contact person, the authors are the 9005 contact person for any entries created by this document. 9007 A registration request to IANA MUST contain the following 9008 information: 9010 o A name of the item to register according to the rules specified by 9011 the intended registry. 9013 o Indication of who has change control over the feature (for 9014 example, IETF, ISO, ITU-T, other international standardization 9015 bodies, a consortium, a particular company or group of companies, 9016 or an individual); 9018 o A reference to a further description, if available, for example 9019 (in decreasing order of preference) an RFC, a published standard, 9020 a published paper, a patent filing, a technical report, documented 9021 source code or a computer manual; 9023 o For proprietary features, contact information (postal and email 9024 address); 9026 22.1. Feature-tags 9027 22.1.1. Description 9029 When a client and server try to determine what part and functionality 9030 of the RTSP specification and any future extensions that its counter 9031 part implements there is need for a namespace. This registry 9032 contains named entries representing certain functionality. 9034 The usage of feature-tags is explained in Section 11 and 9035 Section 13.1. 9037 22.1.2. Registering New Feature-tags with IANA 9039 The registering of feature-tags is done on a first come, first served 9040 basis. 9042 The name of the feature MUST follow these rules: The name may be of 9043 any length, but SHOULD be no more than twenty characters long. The 9044 name MUST NOT contain any spaces, or control characters. The 9045 registration MUST indicate if the feature-tag applies to clients, 9046 servers, or proxies only or any combinations of these. Any 9047 proprietary feature MUST have as the first part of the name a vendor 9048 tag, which identifies the organization. The registry entries 9049 consists of the feature tag, a one paragraph description of what it 9050 represents, its applicability (server, client, proxy, any 9051 combination) and a reference to its specification where applicable. 9053 22.1.3. Registered entries 9055 The following feature-tags are defined in this specification and 9056 hereby registered. The change control belongs to the IETF. 9058 play.basic: The implementation for delivery and playback operations 9059 according to the core RTSP specification, as defined in this 9060 memo. Applies for both clients, servers and proxies. 9062 play.scale: Support of scale operations for media playback. Applies 9063 only for servers. 9065 play.speed: Support of the speed functionality for media delivery. 9066 Applies only for servers. 9068 setup.rtp.rtcp.mux Support of the RTP and RTCP multiplexing as 9069 discussed in Appendix C.1.6.4. Applies for both client and 9070 servers and any media caching proxy. 9072 This should be represented by IANA as table with the feature tags, 9073 contact person and their references. 9075 22.2. RTSP Methods 9077 22.2.1. Description 9079 What a method is, is described in Section Section 13. Extending the 9080 protocol with new methods allow for totally new functionality. 9082 22.2.2. Registering New Methods with IANA 9084 A new method MUST be registered through an IETF Standards Action. 9085 The reason is that new methods may radically change the protocol's 9086 behavior and purpose. 9088 A specification for a new RTSP method MUST consist of the following 9089 items: 9091 o A method name which follows the ABNF rules for methods. 9093 o A clear specification what a request using the method does and 9094 what responses are expected. Which directions the method is used, 9095 C->S or S->C or both. How the use of headers, if any, modifies 9096 the behavior and effect of the method. 9098 o A list or table specifying which of the IANA registered headers 9099 that are allowed to be used with the method in request or/and 9100 response. The list or table SHOULD follow the format of tables in 9101 Section Section 16. 9103 o Describe how the method relates to network proxies. 9105 22.2.3. Registered Entries 9107 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 9108 GET_PARAMETER, OPTIONS, PAUSE, PLAY, PLAY_NOTIFY, REDIRECT, SETUP, 9109 SET_PARAMETER, and TEARDOWN. The initial table of the registry is 9110 below provided. 9112 Method Directionality Reference 9113 ----------------------------------------------------- 9114 DESCRIBE C->S [RFCXXXX] 9115 GET_PARAMETER C->S, S->C [RFCXXXX] 9116 OPTIONS C->S, S->C [RFCXXXX] 9117 PAUSE C->S [RFCXXXX] 9118 PLAY C->S [RFCXXXX] 9119 PLAY_NOTIFY S->C [RFCXXXX] 9120 REDIRECT S->C [RFCXXXX] 9121 SETUP C->S [RFCXXXX] 9122 SET_PARAMETER C->S, S->C [RFCXXXX] 9123 TEARDOWN C->S, S->C [RFCXXXX] 9125 22.3. RTSP Status Codes 9127 22.3.1. Description 9129 A status code is the three digit numbers used to convey information 9130 in RTSP response messages, see Section 8. The number space is 9131 limited and care should be taken not to fill the space. 9133 22.3.2. Registering New Status Codes with IANA 9135 A new status code registration follows the policy of IETF Review. A 9136 specification for a new status code MUST specify the following: 9138 o The registered number. 9140 o A description what the status code means and the expected behavior 9141 of the sender and receiver of the code. 9143 22.3.3. Registered Entries 9145 RFCXXXX, registers the numbered status code defined in the ABNF entry 9146 "Status-Code" except "extension-code" (that defines the syntax 9147 allowed for future extensions) in Section 20.2.2. 9149 22.4. RTSP Headers 9151 22.4.1. Description 9153 By specifying new headers a method(s) can be enhanced in many 9154 different ways. An unknown header will be ignored by the receiving 9155 agent. If the new header is vital for a certain functionality, a 9156 feature-tag for the functionality can be created and demanded to be 9157 used by the counter-part with the inclusion of a Require header 9158 carrying the feature-tag. 9160 22.4.2. Registering New Headers with IANA 9162 Registrations in the registry can be done following the Expert Review 9163 policy. A specification SHOULD be provided, preferably an IETF RFC 9164 or other Standards Developing Organization specification. The 9165 minimal information in a registration request is the header name and 9166 the contact information. 9168 The specification SHOULD contain the following information: 9170 o The name of the header. 9172 o An ABNF specification of the header syntax. 9174 o A list or table specifying when the header may be used, 9175 encompassing all methods, their request or response, the direction 9176 (C->S or S->C). 9178 o How the header is to be handled by proxies. 9180 o A description of the purpose of the header. 9182 22.4.3. Registered entries 9184 All headers specified in Section 16 in RFCXXXX are to be registered. 9185 The Registry is to include header name, description, and reference. 9187 Furthermore the following RTSP headers defined in other 9188 specifications are registered: 9190 o x-wap-profile defined in [3gpp-26234]. 9192 o x-wap-profile-diff defined in [3gpp-26234]. 9194 o x-wap-profile-warning defined in [3gpp-26234]. 9196 o x-predecbufsize defined in [3gpp-26234]. 9198 o x-initpredecbufperiod defined in [3gpp-26234]. 9200 o x-initpostdecbufperiod defined in [3gpp-26234]. 9202 o 3gpp-videopostdecbufsize defined in [3gpp-26234]. 9204 o 3GPP-Link-Char defined in [3gpp-26234]. 9206 o 3GPP-Adaptation defined in [3gpp-26234]. 9208 o 3GPP-QoE-Metrics defined in [3gpp-26234]. 9210 o 3GPP-QoE-Feedback defined in [3gpp-26234]. 9212 The use of "x-" is NOT RECOMMENDED but the above headers in the 9213 register list was defined prior to the clarification. 9215 22.5. Accept-Credentials 9217 The security framework's TLS connection mechanism has two registrable 9218 entities. 9220 22.5.1. Accept-Credentials policies 9222 In Section 19.3.1 three policies for how to handle certificates are 9223 specified. Further policies may be defined and MUST be registered 9224 with IANA using the following rules: 9226 o Registering requires an IETF Standards Action 9228 o A registration is required to name a contact person. 9230 o Name of the policy. 9232 o A describing text that explains how the policy works for handling 9233 the certificates. 9235 This specification registers the following values: 9237 Any 9239 Proxy 9241 User 9243 22.5.2. Accept-Credentials hash algorithms 9245 The Accept-Credentials header (See Section 16.2) allows for the usage 9246 of other algorithms for hashing the DER records of accepted entities. 9247 The registration of any future algorithm is expected to be extremely 9248 rare and could also cause interoperability problems. Therefore the 9249 bar for registering new algorithms is intentionally placed high. 9251 Any registration of a new hash algorithm MUST fulfill the following 9252 requirement: 9254 o Follow the IETF Standards Action policy. 9256 o A definition of the algorithm and its identifier meeting the 9257 "token" ABNF requirement. 9259 The registered value is: 9260 Hash Alg. Id Reference 9261 ------------------------ 9262 sha-256 [RFCXXXX] 9264 22.6. Cache-Control Cache Directive Extensions 9266 There exists a number of cache directives which can be sent in the 9267 Cache-Control header. A registry for these cache directives MUST be 9268 defined with the following rules: 9270 o Registering requires an IETF Standards Action or IESG Approval. 9272 o A registration is required to contain a contact person. 9274 o Name of the directive and a definition of the value, if any. 9276 o Specification if it is a request or response directive. 9278 o A describing text that explains how the cache directive is used 9279 for RTSP controlled media streams. 9281 This specification registers the following values: 9283 no-cache: 9285 public: 9287 private: 9289 no-transform: 9291 only-if-cached: 9293 max-stale: 9295 min-fresh: 9297 must-revalidate: 9299 proxy-revalidate: 9301 max-age: 9303 The registry should be represented as: Name of the directive, contact 9304 person and reference. 9306 22.7. Media Properties 9308 22.7.1. Description 9310 The media streams being controlled by RTSP can have many different 9311 properties. The media properties required to cover the use cases 9312 that was in mind when writing the specification are defined. 9313 However, it can be expected that further innovation will result in 9314 new use cases or media streams with properties not covered by the 9315 ones specified here. Thus new media properties can be specified. As 9316 new media properties may need a substantial amount of new definitions 9317 to correctly specify behavior for this property the bar is intended 9318 to be high. 9320 22.7.2. Registration Rules 9322 Registering new media property MUST fulfill the following 9323 requirements 9325 o Follow the Specification Required policy and get the approval of 9326 the designated Expert. 9328 o Have an ABNF definition of the media property value name that 9329 meets "media-prop-ext" definition 9331 o A Contact Person for the Registration 9333 o Description of all changes to the behavior of the RTSP protocol as 9334 result of these changes. 9336 22.7.3. Registered Values 9338 This specification registers the 9 values listed in Section 16.28. 9339 The registry should be represented as: Name of the media property, 9340 contact person and reference. 9342 22.8. Notify-Reason header 9344 22.8.1. Description 9346 Notify-Reason values are used for indicating the reason the 9347 notification was sent. Each reason has its associated rules on what 9348 headers and information that may or must be included in the 9349 notification. New notification behaviors need to be specified to 9350 enable interoperable usage, thus a specification of each new value is 9351 required. 9353 22.8.2. Registration Rules 9355 Registrations for new Notify-Reason value MUST fulfill the following 9356 requirements 9358 o Follow the Specification Required policy and get the approval of 9359 the designated Expert. 9361 o An ABNF definition of the Notify reason value name that meets 9362 "Notify-Reason-extension" definition 9364 o A Contact Person for the Registration 9366 o Description of which headers shall be included in the request and 9367 response, when it should be sent, and any effect it has on the 9368 server client state. 9370 22.8.3. Registered Values 9372 This specification registers 3 values defined in the Notify-Reas-val 9373 ABNFSection 20.2.3: 9375 o end-of-stream 9377 o media-properties-update 9379 o scale-change 9381 The registry entries should be represented in the registry as: Name, 9382 short description, contact and reference. 9384 22.9. Range header formats 9386 22.9.1. Description 9388 The Range header (Section 16.38) allows for different range formats. 9389 New ones may be registered, but moderation should be applied as it 9390 makes interoperability more difficult. 9392 22.9.2. Registration Rules 9394 A registration MUST fulfill the following requirements: 9396 o Follow the Specification Required policy. 9398 o An ABNF definition of the range format that fulfills the "range- 9399 ext" definition. 9401 o A Contact person for the registration. 9403 o Rules for how one handles the range when using a negative Scale. 9405 22.9.3. Registered Values 9407 The registry should be represented as: Name of the range format, 9408 contact person and reference. This specification registers the 9409 following values. 9411 npt: Normal Play Time 9413 clock: UTC Clock format 9415 smpte: SMPTE Timestamps 9417 22.10. Terminate-Reason Header 9419 The Terminate-Reason header (Section 16.50) has two registries for 9420 extensions. 9422 22.10.1. Redirect Reasons 9424 Registrations are done under the policy of Expert Review. The 9425 registered value needs to follow syntax, i.e. be a token. The 9426 specification needs to provide a definition of what procedures are to 9427 be followed when a client receives this redirect reason. This 9428 specification registers two values: 9430 o Session-Timeout 9432 o Server-Admin 9434 The registry should be represented as: Name of the Redirect Reason, 9435 contact person and reference. 9437 22.10.2. Terminate-Reason Header Parameters 9439 Registrations are done under the policy of Specification Required. 9440 The registrations must define a syntax for the parameter that also 9441 follows the syntax allowed by the RTSP 2.0 specification. A contact 9442 person is also required. This specification registers: 9444 o time 9446 o user-msg 9448 The registry should be represented as: Name of the Terminate Reason, 9449 contact person and reference. 9451 22.11. RTP-Info header parameters 9453 22.11.1. Description 9455 The RTP-Info header (Section 16.43) carries one or more parameter 9456 value pairs with information about a particular point in the RTP 9457 stream. RTP extensions or new usages may need new types of 9458 information. As RTP information that could be needed is likely to be 9459 generic enough and to maximize the interoperability registration 9460 requires Specification Required. 9462 22.11.2. Registration Rules 9464 Registrations for new RTP-Info value MUST fulfill the following 9465 requirements 9467 o Follow the Specification Required policy and get the approval of 9468 the designated Expert. 9470 o Have an ABNF definition that meets the "generic-param" definition 9472 o A Contact Person for the Registration 9474 22.11.3. Registered Values 9476 This specification registers 2 parameter value pairs: 9478 o url 9480 o ssrc 9482 o seq 9484 o rtptime 9486 The registry should be represented as: Name of the parameter, contact 9487 person and reference. 9489 22.12. Seek-Style Policies 9491 22.12.1. Description 9493 New seek policies may be registered, however, a large number of these 9494 will complicate implementation substantially. The impact of unknown 9495 policies is that the server will not honor the unknown and use the 9496 server default policy instead. 9498 22.12.2. Registration Rules 9500 Registrations of new Seek-Style polices MUST fulfill the following 9501 requirements 9503 o Follow the Specification Required policy. 9505 o Have an ABNF definition of the Seek-Style policy name that meets 9506 "Seek-S-value-ext" definition 9508 o A Contact Person for the Registration 9510 o Description of which headers shall be included in the request and 9511 response, when it should be sent, and any affect it has on the 9512 server client state. 9514 22.12.3. Registered Values 9516 This specification registers 4 values: 9518 o RAP 9520 o CoRAP 9522 o First-Prior 9524 o Next 9526 The registry should be represented as: Name of the Seek-Style Policy, 9527 short description, contact person and reference. 9529 22.13. Transport Header Registries 9531 The transport header contains a number of parameters which have 9532 possibilities for future extensions. Therefore registries for these 9533 need to be defined. 9535 22.13.1. Transport Protocol Specification 9537 A registry for the parameter transport-protocol specification MUST be 9538 defined with the following rules: 9540 o Registering uses the policy of Specification Required. 9542 o A contact person or organization with address and email. 9544 o A value definition that are following the ABNF syntax definition 9545 of "transport-id" Section 20.2.3. 9547 o A describing text that explains how the registered value are used 9548 in RTSP. 9550 The registry should be represented as: The protocol ID string, 9551 contact person and reference. 9553 This specification registers the following values: 9555 RTP/AVP: Use of the RTP [RFC3550] protocol for media transport in 9556 combination with the "RTP profile for audio and video 9557 conferences with minimal control" [RFC3551] over UDP. The 9558 usage is explained in RFC XXXX, Appendix C.1. 9560 RTP/AVP/UDP: the same as RTP/AVP. 9562 RTP/AVPF: Use of the RTP [RFC3550] protocol for media transport in 9563 combination with the "Extended RTP Profile for RTCP-based 9564 Feedback (RTP/AVPF)" [RFC4585] over UDP. The usage is 9565 explained in RFC XXXX, Appendix C.1. 9567 RTP/AVPF/UDP: the same as RTP/AVPF. 9569 RTP/SAVP: Use of the RTP [RFC3550] protocol for media transport in 9570 combination with the "The Secure Real-time Transport Protocol 9571 (SRTP)" [RFC3711] over UDP. The usage is explained in RFC 9572 XXXX, Appendix C.1. 9574 RTP/SAVP/UDP: the same as RTP/SAVP. 9576 RTP/SAVPF: Use of the RTP[RFC3550] protocol for media transport in 9577 combination with the Extended Secure RTP Profile for Real-time 9578 Transport Control Protocol (RTCP)-Based Feedback (RTP/SAVPF) 9579 [RFC5124] over UDP. The usage is explained in RFC XXXX, 9580 Appendix C.1. 9582 RTP/SAVPF/UDP: the same as RTP/SAVPF. 9584 RTP/AVP/TCP: Use of the RTP [RFC3550] protocol for media transport 9585 in combination with the "RTP profile for audio and video 9586 conferences with minimal control" [RFC3551] over TCP. The 9587 usage is explained in RFC XXXX, Appendix C.2.2. 9589 RTP/AVPF/TCP: Use of the RTP [RFC3550] protocol for media transport 9590 in combination with the "Extended RTP Profile for RTCP-based 9591 Feedback (RTP/AVPF)" [RFC4585] over TCP. The usage is 9592 explained in RFC XXXX, Appendix C.2.2. 9594 RTP/SAVP/TCP: Use of the RTP [RFC3550] protocol for media transport 9595 in combination with the "The Secure Real-time Transport 9596 Protocol (SRTP)" [RFC3711] over TCP. The usage is explained in 9597 RFC XXXX, Appendix C.2.2. 9599 RTP/SAVPF/TCP: Use of the RTP [RFC3550] protocol for media transport 9600 in combination with the "Extended Secure RTP Profile for Real- 9601 time Transport Control Protocol (RTCP)-Based Feedback (RTP/ 9602 SAVPF)" [RFC5124] over TCP. The usage is explained in RFC 9603 XXXX, Appendix C.2.2. 9605 22.13.2. Transport modes 9607 A registry for the transport parameter mode MUST be defined with the 9608 following rules: 9610 o Registering requires an IETF Standards Action. 9612 o A contact person or organization with address and email. 9614 o A value definition that are following the ABNF "token" definition 9615 Section 20.2.3. 9617 o A describing text that explains how the registered value are used 9618 in RTSP. 9620 This specification registers 1 value: 9622 PLAY: See RFC XXXX. 9624 22.13.3. Transport Parameters 9626 A registry for parameters that may be included in the Transport 9627 header MUST be defined with the following rules: 9629 o Registering uses the Specification Required policy. 9631 o A value definition that are following the ABNF "token" definition 9632 Section 20.2.3. 9634 o A describing text that explains how the registered value are used 9635 in RTSP. 9637 This specification registers all the transport parameters defined in 9638 Section 16.52. This is a copy of this list: 9640 o unicast 9642 o multicast 9644 o interleaved 9646 o ttl 9648 o layers 9650 o ssrc 9652 o mode 9654 o dest_addr 9656 o src_addr 9658 o setup 9660 o connection 9662 o RTCP-mux 9664 o MIKEY 9666 22.14. URI Schemes 9668 This specification defines two URI schemes ("rtsp" and "rtsps") and 9669 reserves a third one ("rtspu"). These URI schemes are defined in 9670 existing registries which are not created by RTSP. Registrations are 9671 following RFC 4395[RFC4395]. 9673 22.14.1. The rtsp URI Scheme 9674 URI scheme name: rtsp 9676 Status: Permanent 9678 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9680 URI scheme semantics: The rtsp scheme is used to indicate resources 9681 accessible through the usage of the Real-time Streaming 9682 Protocol (RTSP). RTSP allows different operations on the 9683 resource identified by the URI, but the primary purpose is the 9684 streaming delivery of the resource to a client. However, the 9685 operations that are currently defined are: DESCRIBE, 9686 GET_PARAMETER, OPTIONS, PLAY, PLAY_NOTIFY, PAUSE, SETUP, 9687 SET_PARAMETER, and TEARDOWN. 9689 Encoding considerations: IRIs in this scheme are defined and needs 9690 to be encoded as RTSP URIs when used within the RTSP protocol. 9691 That encoding is done according to RFC 3987. 9693 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9694 2326), RTSP 2.0 (RFC XXXX) 9696 Interoperability considerations: The change in URI syntax performed 9697 between RTSP 1.0 and 2.0 can create interoperability issues. 9699 Security considerations: All the security threats identified in 9700 Section 7 of RFC 3986 applies also to this scheme. They need 9701 to be reviewed and considered in any implementation utilizing 9702 this scheme. 9704 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9706 Author/Change controller: IETF 9708 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9710 22.14.2. The rtsps URI Scheme 9712 URI scheme name: rtsps 9714 Status: Permanent 9716 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9718 URI scheme semantics: The rtsps scheme is used to indicate resources 9719 accessible through the usage of the Real-time Streaming 9720 Protocol (RTSP) over TLS. RTSP allows different operations on 9721 the resource identified by the URI, but the primary purpose is 9722 the streaming delivery of the resource to a client. However, 9723 the operations that are currently defined are: DESCRIBE, 9724 GET_PARAMETER, OPTIONS, PLAY, PLAY_NOTIFY, PAUSE, SETUP, 9725 SET_PARAMETER, and TEARDOWN. 9727 Encoding considerations: IRIs in this scheme are defined and needs 9728 to be encoded as RTSP URIs when used within the RTSP protocol. 9729 That encoding is done according to RFC 3987. 9731 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9732 2326), RTSP 2.0 (RFC XXXX) 9734 Interoperability considerations: The change in URI syntax performed 9735 between RTSP 1.0 and 2.0 can create interoperability issues. 9737 Security considerations: All the security threats identified in 9738 Section 7 of RFC 3986 applies also to this scheme. They need 9739 to be reviewed and considered in any implementation utilizing 9740 this scheme. 9742 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9744 Author/Change controller: IETF 9746 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9748 22.14.3. The rtspu URI Scheme 9750 URI scheme name: rtspu 9752 Status: Permanent 9754 URI scheme syntax: See Section 3.2 of RFC 2326. 9756 URI scheme semantics: The rtspu scheme is used to indicate resources 9757 accessible through the usage of the Real-time Streaming 9758 Protocol (RTSP) over unreliable datagram transport. RTSP 9759 allows different operations on the resource identified by the 9760 URI, but the primary purpose is the streaming delivery of the 9761 resource to a client. However, the operations that are 9762 currently defined are: DESCRIBE, GET_PARAMETER, OPTIONS, PLAY, 9763 PLAY_NOTIFY, PAUSE, SETUP, SET_PARAMETER, and TEARDOWN. 9765 Encoding considerations: IRIs in this scheme are not defined. 9767 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9768 2326) 9770 Interoperability considerations: The definition of the transport 9771 mechanism of RTSP over UDP has interoperability issues. That 9772 makes the usage of this scheme problematic. 9774 Security considerations: All the security threats identified in 9775 Section 7 of RFC 3986 applies also to this scheme. They needs 9776 to be reviewed and considered in any implementation utilizing 9777 this scheme. 9779 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9781 Author/Change controller: IETF 9783 References: RFC 2326 9785 22.15. SDP attributes 9787 This specification defines three SDP [RFC4566] attributes that it is 9788 requested that IANA register. 9790 SDP Attribute ("att-field"): 9792 Attribute name: range 9793 Long form: Media Range Attribute 9794 Type of name: att-field 9795 Type of attribute: Media and session level 9796 Subject to charset: No 9797 Purpose: RFC XXXX 9798 Reference: RFC XXXX, RFC 2326 9799 Values: See ABNF definition. 9801 Attribute name: control 9802 Long form: RTSP control URI 9803 Type of name: att-field 9804 Type of attribute: Media and session level 9805 Subject to charset: No 9806 Purpose: RFC XXXX 9807 Reference: RFC XXXX, RFC 2326 9808 Values: Absolute or Relative URIs. 9810 Attribute name: mtag 9811 Long form: Message Tag 9812 Type of name: att-field 9813 Type of attribute: Media and session level 9814 Subject to charset: No 9815 Purpose: RFC XXXX 9816 Reference: RFC XXXX 9817 Values: See ABNF definition 9819 22.16. Media Type Registration for text/parameters 9821 Type name: text 9823 Subtype name: parameters 9825 Required parameters: 9827 Optional parameters: 9829 Encoding considerations: 9831 Security considerations: This format may carry any type of 9832 parameters. Some can have security requirements, like privacy, 9833 confidentiality or integrity requirements. The format has no 9834 built in security protection. For the usage it was defined the 9835 transport can be protected between server and client using TLS. 9836 However, care must be take to consider if also the proxies are 9837 trusted with the parameters in case hop-by-hop security is used. 9838 If stored as file in file system the necessary precautions needs 9839 to be taken in relation to the parameters requirements including 9840 object security such as S/MIME [RFC5751]. 9842 Interoperability considerations: This media type was mentioned as a 9843 fictional example in RFC 2326 but was not formally specified. 9844 This has resulted in usage of this media type which may not match 9845 its formal definition. 9847 Published specification: RFC XXXX, Appendix F. 9849 Applications that use this media type: Applications that use RTSP 9850 and have additional parameters they like to read and set using the 9851 RTSP GET_PARAMETER and SET_PARAMETER methods. 9853 Additional information: 9855 Magic number(s): 9857 File extension(s): 9859 Macintosh file type code(s): 9861 Person & email address to contact for further information: Magnus 9862 Westerlund (magnus.westerlund@ericsson.com) 9864 Intended usage: Common 9866 Restrictions on usage: None 9868 Author: Magnus Westerlund (magnus.westerlund@ericsson.com) 9870 Change controller: IETF 9872 Addition Notes: 9874 23. References 9876 23.1. Normative References 9878 [3gpp-26234] 9879 Third Generation Partnership Project (3GPP), "Transparent 9880 end-to-end Packet-switched Streaming Service (PSS); 9881 Protocols and codecs; Technical Specification 26.234", 9882 December 2002. 9884 [FIPS-pub-180-2] 9885 National Institute of Standards and Technology (NIST), 9886 "Federal Information Processing Standards Publications 9887 (FIPS PUBS) 180-2: Secure Hash Standard", August 2002. 9889 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 9890 August 1980. 9892 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 9893 RFC 793, September 1981. 9895 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 9896 Requirement Levels", BCP 14, RFC 2119, March 1997. 9898 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 9899 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 9900 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 9902 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 9903 Leach, P., Luotonen, A., and L. Stewart, "HTTP 9904 Authentication: Basic and Digest Access Authentication", 9905 RFC 2617, June 1999. 9907 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 9909 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 9910 Jacobson, "RTP: A Transport Protocol for Real-Time 9911 Applications", STD 64, RFC 3550, July 2003. 9913 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 9914 Video Conferences with Minimal Control", STD 65, RFC 3551, 9915 July 2003. 9917 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 9918 10646", STD 63, RFC 3629, November 2003. 9920 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 9921 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 9922 RFC 3711, March 2004. 9924 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 9925 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 9926 August 2004. 9928 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 9929 Resource Identifier (URI): Generic Syntax", STD 66, 9930 RFC 3986, January 2005. 9932 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 9933 Identifiers (IRIs)", RFC 3987, January 2005. 9935 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 9936 Requirements for Security", BCP 106, RFC 4086, June 2005. 9938 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 9939 Registration Procedures", BCP 13, RFC 4288, December 2005. 9941 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 9942 Architecture", RFC 4291, February 2006. 9944 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 9945 Registration Procedures for New URI Schemes", BCP 35, 9946 RFC 4395, February 2006. 9948 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 9949 Description Protocol", RFC 4566, July 2006. 9951 [RFC4567] Arkko, J., Lindholm, F., Naslund, M., Norrman, K., and E. 9952 Carrara, "Key Management Extensions for Session 9953 Description Protocol (SDP) and Real Time Streaming 9954 Protocol (RTSP)", RFC 4567, July 2006. 9956 [RFC4571] Lazzaro, J., "Framing Real-time Transport Protocol (RTP) 9957 and RTP Control Protocol (RTCP) Packets over Connection- 9958 Oriented Transport", RFC 4571, July 2006. 9960 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 9961 "Extended RTP Profile for Real-time Transport Control 9962 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 9963 July 2006. 9965 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 9966 Encodings", RFC 4648, October 2006. 9968 [RFC4738] Ignjatic, D., Dondeti, L., Audet, F., and P. Lin, "MIKEY- 9969 RSA-R: An Additional Mode of Key Distribution in 9970 Multimedia Internet KEYing (MIKEY)", RFC 4738, 9971 November 2006. 9973 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 9974 Real-time Transport Control Protocol (RTCP)-Based Feedback 9975 (RTP/SAVPF)", RFC 5124, February 2008. 9977 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 9978 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 9979 May 2008. 9981 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 9982 Specifications: ABNF", STD 68, RFC 5234, January 2008. 9984 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 9985 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 9987 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 9988 Housley, R., and W. Polk, "Internet X.509 Public Key 9989 Infrastructure Certificate and Certificate Revocation List 9990 (CRL) Profile", RFC 5280, May 2008. 9992 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 9993 Languages", BCP 47, RFC 5646, September 2009. 9995 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 9996 Mail Extensions (S/MIME) Version 3.2 Message 9997 Specification", RFC 5751, January 2010. 9999 [RFC5761] Perkins, C. and M. Westerlund, "Multiplexing RTP Data and 10000 Control Packets on a Single Port", RFC 5761, April 2010. 10002 23.2. Informative References 10004 [I-D.ietf-mmusic-rtsp-nat] 10005 Goldberg, J., Westerlund, M., and T. Zeng, "A Network 10006 Address Translator (NAT) Traversal mechanism for media 10007 controlled by Real-Time Streaming Protocol (RTSP)", 10008 draft-ietf-mmusic-rtsp-nat-11 (work in progress), 10009 October 2011. 10011 [ISO.13818-6.1995] 10012 International Organization for Standardization, 10013 "Information technology - Generic coding of moving 10014 pictures and associated audio information - part 6: 10015 Extension for digital storage media and control", 10016 ISO Draft Standard 13818-6, November 1995. 10018 [ISO.8601.2000] 10019 International Organization for Standardization, "Data 10020 elements and interchange formats - Information interchange 10021 - Representation of dates and times", ISO/IEC Standard 10022 8601, December 2000. 10024 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 10025 and Support", STD 3, RFC 1123, October 1989. 10027 [RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions 10028 Functional Specification", RFC 1644, July 1994. 10030 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 10031 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 10032 RFC 2068, January 1997. 10034 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 10035 Streaming Protocol (RTSP)", RFC 2326, April 1998. 10037 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 10038 Translator (NAT) Terminology and Considerations", 10039 RFC 2663, August 1999. 10041 [RFC2822] Resnick, P., "Internet Message Format", RFC 2822, 10042 April 2001. 10044 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 10045 Announcement Protocol", RFC 2974, October 2000. 10047 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 10048 A., Peterson, J., Sparks, R., Handley, M., and E. 10049 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 10050 June 2002. 10052 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 10053 the Session Description Protocol (SDP)", RFC 4145, 10054 September 2005. 10056 [RFC5583] Schierl, T. and S. Wenger, "Signaling Media Decoding 10057 Dependency in the Session Description Protocol (SDP)", 10058 RFC 5583, July 2009. 10060 [RFC5888] Camarillo, G. and H. Schulzrinne, "The Session Description 10061 Protocol (SDP) Grouping Framework", RFC 5888, June 2010. 10063 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 10064 Time Protocol Version 4: Protocol and Algorithms 10065 Specification", RFC 5905, June 2010. 10067 [Stevens98] 10068 Stevens, W., "Unix Networking Programming - Volume 1, 10069 second edition", 1998. 10071 Appendix A. Examples 10073 This section contains several different examples trying to illustrate 10074 possible ways of using RTSP. The examples can also help with the 10075 understanding of how functions of RTSP work. However, remember that 10076 these are examples and the normative and syntax description in the 10077 other sections takes precedence. Please also note that many of the 10078 examples contain syntax illegal line breaks to accommodate the 10079 formatting restriction that the RFC series impose. 10081 A.1. Media on Demand (Unicast) 10083 This is an example of media on demand streaming of a media stored in 10084 a container file. For purposes of this example, a container file is 10085 a storage entity in which multiple continuous media types pertaining 10086 to the same end-user presentation are present. In effect, the 10087 container file represents an RTSP presentation, with each of its 10088 components being RTSP controlled media streams. Container files are 10089 a widely used means to store such presentations. While the 10090 components are transported as independent streams, it is desirable to 10091 maintain a common context for those streams at the server end. 10093 This enables the server to keep a single storage handle open 10094 easily. It also allows treating all the streams equally in case 10095 of any priorization of streams by the server. 10097 It is also possible that the presentation author may wish to prevent 10098 selective retrieval of the streams by the client in order to preserve 10099 the artistic effect of the combined media presentation. Similarly, 10100 in such a tightly bound presentation, it is desirable to be able to 10101 control all the streams via a single control message using an 10102 aggregate URI. 10104 The following is an example of using a single RTSP session to control 10105 multiple streams. It also illustrates the use of aggregate URIs. In 10106 a container file it is also desirable to not write any URI parts 10107 which is not kept, when the container is distributed, like the host 10108 and most of the path element. Therefore this example also uses the 10109 "*" and relative URI in the delivered SDP. 10111 Also this presentation description (SDP) is not cachable, as the 10112 Expires header is set to an equal value with date indicating 10113 immediate expiration of its valididty. 10115 Client C requests a presentation from media server M. The movie is 10116 stored in a container file. The client has obtained an RTSP URI to 10117 the container file. 10119 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10120 CSeq: 1 10121 User-Agent: PhonyClient/1.2 10123 M->C: RTSP/2.0 200 OK 10124 CSeq: 1 10125 Server: PhonyServer/1.0 10126 Date: Thu, 24 Jan 1997 15:35:06 GMT 10127 Content-Type: application/sdp 10128 Content-Length: 271 10129 Content-Base: rtsp://example.com/twister.3gp/ 10130 Expires: 24 Jan 1997 15:35:06 GMT 10132 v=0 10133 o=- 2890844256 2890842807 IN IP4 198.51.100.5 10134 s=RTSP Session 10135 i=An Example of RTSP Session Usage 10136 e=adm@example.com 10137 c=IN IP4 0.0.0.0 10138 a=control: * 10139 a=range: npt=0-0:10:34.10 10140 t=0 0 10141 m=audio 0 RTP/AVP 0 10142 a=control: trackID=1 10143 m=video 0 RTP/AVP 26 10144 a=control: trackID=4 10146 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10147 CSeq: 2 10148 User-Agent: PhonyClient/1.2 10149 Require: play.basic 10150 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10151 Accept-Ranges: NPT, SMPTE, UTC 10153 M->C: RTSP/2.0 200 OK 10154 CSeq: 2 10155 Server: PhonyServer/1.0 10156 Transport: RTP/AVP;unicast; ssrc=93CB001E; 10157 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10158 src_addr="198.51.100.5:9000"/"198.51.100.5:9001" 10159 Session: 12345678 10160 Expires: 24 Jan 1997 15:35:12 GMT 10161 Date: 24 Jan 1997 15:35:12 GMT 10162 Accept-Ranges: NPT 10163 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10165 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10166 CSeq: 3 10167 User-Agent: PhonyClient/1.2 10168 Require: play.basic 10169 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10170 Session: 12345678 10171 Accept-Ranges: NPT, SMPTE, UTC 10173 M->C: RTSP/2.0 200 OK 10174 CSeq: 3 10175 Server: PhonyServer/1.0 10176 Transport: RTP/AVP;unicast; ssrc=A813FC13; 10177 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003"; 10178 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10180 Session: 12345678 10181 Expires: 24 Jan 1997 15:35:13 GMT 10182 Date: 24 Jan 1997 15:35:13 GMT 10183 Accept-Range: NPT 10184 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10186 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10187 CSeq: 4 10188 User-Agent: PhonyClient/1.2 10189 Range: npt=30- 10190 Seek-Style: RAP 10191 Session: 12345678 10193 M->C: RTSP/2.0 200 OK 10194 CSeq: 4 10195 Server: PhonyServer/1.0 10196 Date: 24 Jan 1997 15:35:14 GMT 10197 Session: 12345678 10198 Range: npt=30-634.10 10199 Seek-Style: RAP 10200 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10201 ssrc=0D12F123:seq=12345;rtptime=3450012, 10202 url="rtsp://example.com/twister.3gp/trackID=1" 10203 ssrc=4F312DD8:seq=54321;rtptime=2876889 10205 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/2.0 10206 CSeq: 5 10207 User-Agent: PhonyClient/1.2 10208 Session: 12345678 10210 M->C: RTSP/2.0 200 OK 10211 CSeq: 5 10212 Server: PhonyServer/1.0 10213 Date: 24 Jan 1997 15:36:01 GMT 10214 Session: 12345678 10215 Range: npt=30.87-634.10 10217 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10218 CSeq: 6 10219 User-Agent: PhonyClient/1.2 10220 Range: npt=30.87-634.10 10221 Seek-Style: Next 10222 Session: 12345678 10224 M->C: RTSP/2.0 200 OK 10225 CSeq: 6 10226 Server: PhonyServer/1.0 10227 Date: 24 Jan 1997 15:36:01 GMT 10228 Session: 12345678 10229 Range: npt=30.87-634.10 10230 Seek-Style: Next 10231 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10232 ssrc=0D12F123:seq=12555;rtptime=6330012, 10233 url="rtsp://example.com/twister.3gp/trackID=1" 10234 ssrc=4F312DD8:seq=55021;rtptime=3132889 10236 C->M: TEARDOWN rtsp://example.com/twister.3gp/ RTSP/2.0 10237 CSeq: 7 10238 User-Agent: PhonyClient/1.2 10239 Session: 12345678 10241 M->C: RTSP/2.0 200 OK 10242 CSeq: 7 10243 Server: PhonyServer/1.0 10244 Date: 24 Jan 1997 15:49:34 GMT 10246 A.2. Media on Demand using Pipelining 10248 This example is basically the example above (Appendix A.1), but now 10249 utilizing pipelining to speed up the setup. It requires only two 10250 round trip times until the media starts flowing. First of all, the 10251 session description is retrieved to determine what media resources 10252 need to be setup. In the second step, one sends the necessary SETUP 10253 requests and the PLAY request to initiate media delivery. 10255 Client C requests a presentation from media server M. The movie is 10256 stored in a container file. The client has obtained an RTSP URI to 10257 the container file. 10259 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10260 CSeq: 1 10261 User-Agent: PhonyClient/1.2 10263 M->C: RTSP/2.0 200 OK 10264 CSeq: 1 10265 Server: PhonyServer/1.0 10266 Date: Thu, 23 Jan 1997 15:35:06 GMT 10267 Content-Type: application/sdp 10268 Content-Length: 271 10269 Content-Base: rtsp://example.com/twister.3gp/ 10270 Expires: 24 Jan 1997 15:35:06 GMT 10272 v=0 10273 o=- 2890844256 2890842807 IN IP4 192.0.2.5 10274 s=RTSP Session 10275 i=An Example of RTSP Session Usage 10276 e=adm@example.com 10277 c=IN IP4 0.0.0.0 10278 a=control: * 10279 a=range: npt=0-0:10:34.10 10280 t=0 0 10281 m=audio 0 RTP/AVP 0 10282 a=control: trackID=1 10283 m=video 0 RTP/AVP 26 10284 a=control: trackID=4 10286 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10287 CSeq: 2 10288 User-Agent: PhonyClient/1.2 10289 Require: play.basic 10290 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10291 Accept-Ranges: NPT, SMPTE, UTC 10292 Pipelined-Requests: 7654 10294 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10295 CSeq: 3 10296 User-Agent: PhonyClient/1.2 10297 Require: play.basic 10298 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10299 Accept-Ranges: NPT, SMPTE, UTC 10300 Pipelined-Requests: 7654 10302 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10303 CSeq: 4 10304 User-Agent: PhonyClient/1.2 10305 Range: npt=0- 10306 Seek-Style: RAP 10307 Pipelined-Requests: 7654 10309 M->C: RTSP/2.0 200 OK 10310 CSeq: 2 10311 Server: PhonyServer/1.0 10312 Transport: RTP/AVP;unicast; 10313 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10314 src_addr="198.51.100.5:9000"/"198.51.100.5:9001"; 10315 ssrc=93CB001E 10316 Session: 12345678 10317 Expires: 24 Jan 1997 15:35:12 GMT 10318 Date: 23 Jan 1997 15:35:12 GMT 10319 Accept-Ranges: NPT 10320 Pipelined-Requests: 7654 10321 Media-Properties: Random-Access=0.2, Immutable, Unlimited 10323 M->C: RTSP/2.0 200 OK 10324 CSeq: 3 10325 Server: PhonyServer/1.0 10326 Transport: RTP/AVP;unicast; 10327 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003; 10328 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10329 ssrc=A813FC13 10330 Session: 12345678 10331 Expires: 24 Jan 1997 15:35:13 GMT 10332 Date: 23 Jan 1997 15:35:13 GMT 10333 Accept-Range: NPT 10334 Pipelined-Requests: 7654 10335 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10337 M->C: RTSP/2.0 200 OK 10338 CSeq: 4 10339 Server: PhonyServer/1.0 10340 Date: 23 Jan 1997 15:35:14 GMT 10341 Session: 12345678 10342 Range: npt=0-623.10 10343 Seek-Style: RAP 10344 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10345 ssrc=0D12F123:seq=12345;rtptime=3450012, 10346 url="rtsp://example.com/twister.3gp/trackID=1" 10347 ssrc=4F312DD8:seq=54321;rtptime=2876889 10348 Pipelined-Requests: 7654 10350 A.3. Media on Demand (Unicast) 10352 An alternative example of media on demand with a bit more tweaks is 10353 the following. Client C requests a movie distributed from two 10354 different media servers A (audio.example.com) and V ( 10355 video.example.com). The media description is stored on a web server 10356 W. The media description contains descriptions of the presentation 10357 and all its streams, including the codecs that are available, dynamic 10358 RTP payload types, the protocol stack, and content information such 10359 as language or copyright restrictions. It may also give an 10360 indication about the timeline of the movie. 10362 In this example, the client is only interested in the last part of 10363 the movie. 10365 C->W: GET /twister.sdp HTTP/1.1 10366 Host: www.example.com 10367 Accept: application/sdp 10369 W->C: HTTP/1.0 200 OK 10370 Date: Thu, 23 Jan 1997 15:35:06 GMT 10371 Content-Type: application/sdp 10372 Content-Length: 278 10373 Expires: 23 Jan 1998 15:35:06 GMT 10375 v=0 10376 o=- 2890844526 2890842807 IN IP4 198.51.100.5 10377 s=RTSP Session 10378 e=adm@example.com 10379 c=IN IP4 0.0.0.0 10380 a=range:npt=0-1:49:34 10381 t=0 0 10382 m=audio 0 RTP/AVP 0 10383 a=control:rtsp://audio.example.com/twister/audio.en 10384 m=video 0 RTP/AVP 31 10385 a=control:rtsp://video.example.com/twister/video 10387 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/2.0 10388 CSeq: 1 10389 User-Agent: PhonyClient/1.2 10390 Transport: RTP/AVP/UDP;unicast;dest_addr=":3056"/":3057", 10391 RTP/AVP/TCP;unicast;interleaved=0-1 10392 Accept-Ranges: NPT, SMPTE, UTC 10394 A->C: RTSP/2.0 200 OK 10395 CSeq: 1 10396 Session: 12345678 10397 Transport: RTP/AVP/UDP;unicast; 10398 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10399 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10400 Date: 23 Jan 1997 15:35:12 GMT 10401 Server: PhonyServer/1.0 10402 Expires: 24 Jan 1997 15:35:12 GMT 10403 Cache-Control: public 10404 Accept-Ranges: NPT, SMPTE 10405 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10407 C->V: SETUP rtsp://video.example.com/twister/video RTSP/2.0 10408 CSeq: 1 10409 User-Agent: PhonyClient/1.2 10410 Transport: RTP/AVP/UDP;unicast; 10411 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059", 10412 RTP/AVP/TCP;unicast;interleaved=0-1 10413 Accept-Ranges: NPT, SMPTE, UTC 10415 V->C: RTSP/2.0 200 OK 10416 CSeq: 1 10417 Session: 23456789 10418 Transport: RTP/AVP/UDP;unicast; 10419 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059"; 10420 src_addr="198.51.100.5:5002"/"198.51.100.5:5003" 10421 Date: 23 Jan 1997 15:35:12 GMT 10422 Server: PhonyServer/1.0 10423 Cache-Control: public 10424 Expires: 24 Jan 1997 15:35:12 GMT 10425 Accept-Ranges: NPT, SMPTE 10426 Media-Properties: Random-Access=1.2, Immutable, Unlimited 10428 C->V: PLAY rtsp://video.example.com/twister/video RTSP/2.0 10429 CSeq: 2 10430 User-Agent: PhonyClient/1.2 10431 Session: 23456789 10432 Range: smpte=0:10:00- 10434 V->C: RTSP/2.0 200 OK 10435 CSeq: 2 10436 Session: 23456789 10437 Range: smpte=0:10:00-1:49:23 10438 Seek-Style: First-Prior 10439 RTP-Info: url="rtsp://video.example.com/twister/video" 10440 ssrc=A17E189D:seq=12312232;rtptime=78712811 10441 Server: PhonyServer/2.0 10442 Date: 23 Jan 1997 15:35:13 GMT 10444 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/2.0 10445 CSeq: 2 10446 User-Agent: PhonyClient/1.2 10447 Session: 12345678 10448 Range: smpte=0:10:00- 10450 A->C: RTSP/2.0 200 OK 10451 CSeq: 2 10452 Session: 12345678 10453 Range: smpte=0:10:00-1:49:23 10454 Seek-Style: First-Prior 10455 RTP-Info: url="rtsp://audio.example.com/twister/audio.en" 10456 ssrc=3D124F01:seq=876655;rtptime=1032181 10457 Server: PhonyServer/1.0 10458 Date: 23 Jan 1997 15:35:13 GMT 10460 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/2.0 10461 CSeq: 3 10462 User-Agent: PhonyClient/1.2 10463 Session: 12345678 10465 A->C: RTSP/2.0 200 OK 10466 CSeq: 3 10467 Server: PhonyServer/1.0 10468 Date: 23 Jan 1997 15:36:52 GMT 10470 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/2.0 10471 CSeq: 3 10472 User-Agent: PhonyClient/1.2 10473 Session: 23456789 10475 V->C: RTSP/2.0 200 OK 10476 CSeq: 3 10477 Server: PhonyServer/2.0 10478 Date: 23 Jan 1997 15:36:52 GMT 10480 Even though the audio and video track are on two different servers 10481 that may start at slightly different times and may drift with respect 10482 to each other over time, the client can perform initial 10483 synchronization of the two media using RTP-Info and Range received in 10484 the PLAY responses. If the two servers are time synchronized the 10485 RTCP packets can also be used to maintain synchronization. 10487 A.4. Single Stream Container Files 10489 Some RTSP servers may treat all files as though they are "container 10490 files", yet other servers may not support such a concept. Because of 10491 this, clients needs to use the rules set forth in the session 10492 description for Request-URIs, rather than assuming that a consistent 10493 URI may always be used throughout. Below is an example of how a 10494 multi-stream server might expect a single-stream file to be served: 10496 C->S: DESCRIBE rtsp://foo.example.com/test.wav RTSP/2.0 10497 Accept: application/x-rtsp-mh, application/sdp 10498 CSeq: 1 10499 User-Agent: PhonyClient/1.2 10501 S->C: RTSP/2.0 200 OK 10502 CSeq: 1 10503 Content-base: rtsp://foo.example.com/test.wav/ 10504 Content-type: application/sdp 10505 Content-length: 163 10506 Server: PhonyServer/1.0 10507 Date: Thu, 23 Jan 1997 15:35:06 GMT 10508 Expires: 23 Jan 1997 17:00:00 GMT 10510 v=0 10511 o=- 872653257 872653257 IN IP4 192.0.2.5 10512 s=mu-law wave file 10513 i=audio test 10514 c=IN IP4 0.0.0.0 10515 t=0 0 10516 a=control: * 10517 m=audio 0 RTP/AVP 0 10518 a=control:streamid=0 10520 C->S: SETUP rtsp://foo.example.com/test.wav/streamid=0 RTSP/2.0 10521 Transport: RTP/AVP/UDP;unicast; 10522 dest_addr=":6970"/":6971";mode="PLAY" 10523 CSeq: 2 10524 User-Agent: PhonyClient/1.2 10525 Accept-Ranges: NPT, SMPTE, UTC 10527 S->C: RTSP/2.0 200 OK 10528 Transport: RTP/AVP/UDP;unicast; 10529 dest_addr="192.0.2.53:6970"/"192.0.2.53:6971"; 10530 src_addr="198.51.100.5:6970"/"198.51.100.5:6971"; 10531 mode="PLAY";ssrc=EAB98712 10532 CSeq: 2 10533 Session: 2034820394 10534 Expires: 23 Jan 1997 16:00:00 GMT 10535 Server: PhonyServer/1.0 10536 Date: 23 Jan 1997 15:35:07 GMT 10537 Accept-Ranges: NPT 10538 Media-Properties: Random-Acces=0.5, Immutable, Unlimited 10540 C->S: PLAY rtsp://foo.example.com/test.wav/ RTSP/2.0 10541 CSeq: 3 10542 User-Agent: PhonyClient/1.2 10543 Session: 2034820394 10545 S->C: RTSP/2.0 200 OK 10546 CSeq: 3 10547 Server: PhonyServer/1.0 10548 Date: 23 Jan 1997 15:35:08 GMT 10549 Session: 2034820394 10550 Range: npt=0-600 10551 Seek-Style: RAP 10552 RTP-Info: url="rtsp://foo.example.com/test.wav/streamid=0" 10553 ssrc=0D12F123:seq=981888;rtptime=3781123 10555 Note the different URI in the SETUP command, and then the switch back 10556 to the aggregate URI in the PLAY command. This makes complete sense 10557 when there are multiple streams with aggregate control, but is less 10558 than intuitive in the special case where the number of streams is 10559 one. However, the server has declared the aggregated control URI in 10560 the SDP and therefore this is legal. 10562 In this case, it is also required that servers accept implementations 10563 that use the non-aggregated interpretation and use the individual 10564 media URI, like this: 10566 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/2.0 10567 CSeq: 3 10568 User-Agent: PhonyClient/1.2 10569 Session: 2034820394 10571 A.5. Live Media Presentation Using Multicast 10573 The media server M chooses the multicast address and port. Here, it 10574 is assumed that the web server only contains a pointer to the full 10575 description, while the media server M maintains the full description. 10577 C->W: GET /sessions.html HTTP/1.1 10578 Host: www.example.com 10580 W->C: HTTP/1.1 200 OK 10581 Content-Type: text/html 10583 10584 ... 10585 10586 Streamed Live Music performance 10587 ... 10588 10590 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/2.0 10591 CSeq: 1 10592 Supported: play.basic, play.scale 10593 User-Agent: PhonyClient/1.2 10595 M->C: RTSP/2.0 200 OK 10596 CSeq: 1 10597 Content-Type: application/sdp 10598 Content-Length: 183 10599 Server: PhonyServer/1.0 10600 Date: Thu, 23 Jan 1997 15:35:06 GMT 10601 Supported: play.basic 10603 v=0 10604 o=- 2890844526 2890842807 IN IP4 192.0.2.5 10605 s=RTSP Session 10606 t=0 0 10607 m=audio 3456 RTP/AVP 0 10608 c=IN IP4 233.252.0.54/16 10609 a=control: rtsp://live.example.com/concert/audio 10610 a=range:npt=0- 10612 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/2.0 10613 CSeq: 2 10614 Transport: RTP/AVP;multicast; 10615 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10616 Accept-Ranges: NPT, SMPTE, UTC 10617 User-Agent: PhonyClient/1.2 10619 M->C: RTSP/2.0 200 OK 10620 CSeq: 2 10621 Server: PhonyServer/1.0 10622 Date: Thu, 23 Jan 1997 15:35:06 GMT 10623 Transport: RTP/AVP;multicast; 10624 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10625 ;ssrc=4D12AB92/0DF876A3 10626 Session: 0456804596 10627 Accept-Ranges: NPT, UTC 10628 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0 10630 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/2.0 10631 CSeq: 3 10632 Session: 0456804596 10633 User-Agent: PhonyClient/1.2 10635 M->C: RTSP/2.0 200 OK 10636 CSeq: 3 10637 Server: PhonyServer/1.0 10638 Date: 23 Jan 1997 15:35:07 GMT 10639 Session: 0456804596 10640 Seek-Style: Next 10641 Range:npt=1256- 10642 RTP-Info: url="rtsp://live.example.com/concert/audio" 10643 ssrc=0D12F123:seq=1473; rtptime=80000 10645 A.6. Capability Negotiation 10647 This example illustrates how the client and server determines their 10648 capability to support a special feature, in this case "play.scale". 10649 The server, through the clients request and the included Supported 10650 header, learns the client supports RTSP 2.0, and also supports the 10651 playback time scaling feature of RTSP. The server's response 10652 contains the following feature related information to the client; it 10653 supports the basic media delivery functions (play.basic), the 10654 extended functionality of time scaling of content (play.scale), and 10655 one "example.com" proprietary feature (com.example.flight). The 10656 client also learns the methods supported (Public header) by the 10657 server for the indicated resource. 10659 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/2.0 10660 CSeq: 1 10661 Supported: play.basic, play.scale 10662 User-Agent: PhonyClient/1.2 10664 S->C: RTSP/2.0 200 OK 10665 CSeq: 1 10666 Public: OPTIONS,SETUP,PLAY,PAUSE,TEARDOWN,DESCRIBE,GET_PARAMETER 10667 Allow: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, DESCRIBE 10668 Server: PhonyServer/2.0 10669 Supported: play.basic, play.scale, com.example.flight 10671 When the client sends its SETUP request it tells the server that it 10672 requires support of the play.scale feature for this session by 10673 including the Require header. 10675 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/2.0 10676 CSeq: 3 10677 User-Agent: PhonyClient/1.2 10678 Transport: RTP/AVP/UDP;unicast; 10679 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057", 10680 RTP/AVP/TCP;unicast;interleaved=0-1 10681 Require: play.scale 10682 Accept-Ranges: NPT, SMPTE, UTC 10683 User-Agent: PhonyClient/1.2 10685 S->C: RTSP/2.0 200 OK 10686 CSeq: 3 10687 Session: 12345678 10688 Transport: RTP/AVP/UDP;unicast; 10689 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10690 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10691 Server: PhonyServer/2.0 10692 Accept-Ranges: NPT, SMPTE 10693 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10695 Appendix B. RTSP Protocol State Machine 10697 The RTSP session state machine describes the behavior of the protocol 10698 from RTSP session initialization through RTSP session termination. 10700 The State machine is defined on a per session basis which is uniquely 10701 identified by the RTSP session identifier. The session may contain 10702 one or more media streams depending on state. If a single media 10703 stream is part of the session it is in non-aggregated control. If 10704 two or more is part of the session it is in aggregated control. 10706 The below state machine is an informative description of the 10707 protocols behavior. In case of ambiguity with the earlier parts of 10708 this specification, the description in the earlier parts take 10709 precedence. 10711 B.1. States 10713 The state machine contains three states, described below. For each 10714 state there exist a table which shows which requests and events are 10715 allowed and whether they will result in a state change. 10717 Init: Initial state no session exists. 10719 Ready: Session is ready to start playing. 10721 Play: Session is playing, i.e. sending media stream data in the 10722 direction S->C. 10724 B.2. State variables 10726 This representation of the state machine needs more than its state to 10727 work. A small number of variables is also needed and they are 10728 explained below. 10730 NRM: The number of media streams part of this session. 10732 RP: Resume point, the point in the presentation time line at which 10733 a request to continue playing will resume from. A time format 10734 for the variable is not mandated. 10736 B.3. Abbreviations 10738 To make the state tables more compact a number of abbreviations are 10739 used, which are explained below. 10741 IFI: IF Implemented. 10743 md: Media 10745 PP: Pause Point, the point in the presentation time line at which 10746 the presentation was paused. 10748 Prs: Presentation, the complete multimedia presentation. 10750 RedP: Redirect Point, the point in the presentation time line at 10751 which a REDIRECT was specified to occur. 10753 SES: Session. 10755 B.4. State Tables 10757 This section contains a table for each state. The table contains all 10758 the requests and events that this state is allowed to act on. The 10759 events which are method names are, unless noted, requests with the 10760 given method in the direction client to server (C->S). In some cases 10761 there exist one or more requisite. The response column tells what 10762 type of response actions should be performed. Possible actions that 10763 are requested for an event includes: response codes, e.g. 200, 10764 headers that needs to be included in the response, setting of state 10765 variables, or setting of other session related parameters. The new 10766 state column tells which state the state machine changes to. 10768 The response to a valid request meeting the requisites is normally a 10769 2xx (SUCCESS) unless other noted in the response column. The 10770 exceptions need to be given a response according to the response 10771 column. If the request does not meet the requisite, is erroneous or 10772 some other type of error occur, the appropriate response code is to 10773 be sent. If the response code is a 4xx the session state is 10774 unchanged. A response code of 3rr will result in that the session is 10775 ended and its state is changed to Init. A response code of 304 10776 results in no state change. However, there are restrictions to when 10777 a 3rr response may be used. A 5xx response does not result in any 10778 change of the session state, except if the error is not possible to 10779 recover from. A unrecoverable error results in the ending of the 10780 session. As it in the general case can't be determined if it was a 10781 unrecoverable error or not the client will be required to test. In 10782 the case that the next request after a 5xx is responded with 454 10783 (Session Not Found) the client knows that the session has ended. For 10784 any request message that cannot be responded to within the time 10785 defined in Section 10.4, a 100 response must be sent. 10787 The server will timeout the session after the period of time 10788 specified in the SETUP response, if no activity from the client is 10789 detected. Therefore there exists a timeout event for all states 10790 except Init. 10792 In the case that NRM = 1 the presentation URI is equal to the media 10793 URI or a specified presentation URI. For NRM > 1 the presentation 10794 URI needs to be other than any of the medias that are part of the 10795 session. This applies to all states. 10797 +---------------+-----------------+---------------------------------+ 10798 | Event | Prerequisite | Response | 10799 +---------------+-----------------+---------------------------------+ 10800 | DESCRIBE | Needs REDIRECT | 3rr, Redirect | 10801 | | | | 10802 | DESCRIBE | | 200, Session description | 10803 | | | | 10804 | OPTIONS | Session ID | 200, Reset session timeout | 10805 | | | timer | 10806 | | | | 10807 | OPTIONS | | 200 | 10808 | | | | 10809 | SET_PARAMETER | Valid parameter | 200, change value of parameter | 10810 | | | | 10811 | GET_PARAMETER | Valid parameter | 200, return value of parameter | 10812 +---------------+-----------------+---------------------------------+ 10814 Table 13: None state-machine changing events 10816 The methods in Table 13 do not have any effect on the state machine 10817 or the state variables. However, some methods do change other 10818 session related parameters, for example SET_PARAMETER which will set 10819 the parameter(s) specified in its body. Also all of these methods 10820 that allow Session header will also update the keep-alive timer for 10821 the session. 10823 +------------------+----------------+-----------+-------------------+ 10824 | Action | Requisite | New State | Response | 10825 +------------------+----------------+-----------+-------------------+ 10826 | SETUP | | Ready | NRM=1, RP=0.0 | 10827 | | | | | 10828 | SETUP | Needs Redirect | Init | 3rr Redirect | 10829 | | | | | 10830 | S -> C: REDIRECT | No Session hdr | Init | Terminate all SES | 10831 +------------------+----------------+-----------+-------------------+ 10833 Table 14: State: Init 10835 The initial state of the state machine, see Table 14 can only be left 10836 by processing a correct SETUP request. As seen in the table the two 10837 state variables are also set by a correct request. This table also 10838 shows that a correct SETUP can in some cases be redirected to another 10839 URI and/or server by a 3rr response. 10841 +-------------+------------------------+---------+------------------+ 10842 | Action | Requisite | New | Response | 10843 | | | State | | 10844 +-------------+------------------------+---------+------------------+ 10845 | SETUP | New URI | Ready | NRM +=1 | 10846 | | | | | 10847 | SETUP | URI Setup prior | Ready | Change transport | 10848 | | | | param | 10849 | | | | | 10850 | TEARDOWN | Prs URI, | Init | No session hdr, | 10851 | | | | NRM = 0 | 10852 | | | | | 10853 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10854 | | | | NRM = 0 | 10855 | | | | | 10856 | TEARDOWN | md URI,NRM>1 | Ready | Session hdr, NRM | 10857 | | | | -= 1 | 10858 | | | | | 10859 | PLAY | Prs URI, No range | Play | Play from RP | 10860 | | | | | 10861 | PLAY | Prs URI, Range | Play | According to | 10862 | | | | range | 10863 | | | | | 10864 | PLAY | md URI, NRM=1, Range | Play | According to | 10865 | | | | range | 10866 | | | | | 10867 | PLAY | md URI, NRM=1 | Play | Play from RP | 10868 | | | | | 10869 | PAUSE | Prs URI | Ready | Return PP | 10870 | | | | | 10871 | SC:REDIRECT | Terminate-Reason | Ready | Set RedP | 10872 | | | | | 10873 | SC:REDIRECT | No Terminate-Reason | Init | Session is | 10874 | | time parameter | | removed | 10875 | | | | | 10876 | Timeout | | Init | | 10877 | | | | | 10878 | RedP | | Init | TEARDOWN of | 10879 | reached | | | session | 10880 +-------------+------------------------+---------+------------------+ 10882 Table 15: State: Ready 10884 In the Ready state, see Table 15, some of the actions are depending 10885 on the number of media streams (NRM) in the session, i.e., aggregated 10886 or non-aggregated control. A SETUP request in the Ready state can 10887 either add one more media stream to the session or, if the media 10888 stream (same URI) already is part of the session, change the 10889 transport parameters. TEARDOWN is depending on both the Request-URI 10890 and the number of media stream within the session. If the Request- 10891 URI is the presentations URI the whole session is torn down. If a 10892 media URI is used in the TEARDOWN request and more than one media 10893 exists in the session, the session will remain and a session header 10894 is returned in the response. If only a single media stream remains 10895 in the session when performing a TEARDOWN with a media URI the 10896 session is removed. The number of media streams remaining after 10897 tearing down a media stream determines the new state. 10899 +----------------+-----------------------+--------+-----------------+ 10900 | Action | Requisite | New | Response | 10901 | | | State | | 10902 +----------------+-----------------------+--------+-----------------+ 10903 | PAUSE | Prs URI | Ready | Set RP to | 10904 | | | | present point | 10905 | | | | | 10906 | End of media | All media | Play | Set RP = End of | 10907 | | | | media | 10908 | | | | | 10909 | End of range | | Play | Set RP = End of | 10910 | | | | range | 10911 | | | | | 10912 | PLAY | Prs URI, No range | Play | Play from | 10913 | | | | present point | 10914 | | | | | 10915 | PLAY | Prs URI, Range | Play | According to | 10916 | | | | range | 10917 | | | | | 10918 | SC:PLAY_NOTIFY | | Play | 200 | 10919 | | | | | 10920 | SETUP | New URI | Play | 455 | 10921 | | | | | 10922 | SETUP | Setuped URI | Play | 455 | 10923 | | | | | 10924 | SETUP | Setuped URI, IFI | Play | Change | 10925 | | | | transport | 10926 | | | | param. | 10927 | | | | | 10928 | TEARDOWN | Prs URI | Init | No session hdr | 10929 | | | | | 10930 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10931 | | | | NRM=0 | 10932 | | | | | 10933 | TEARDOWN | md URI | Play | 455 | 10934 | | | | | 10935 | SC:REDIRECT | Terminate Reason with | Play | Set RedP | 10936 | | Time parameter | | | 10937 | | | | | 10938 | SC:REDIRECT | | Init | Session is | 10939 | | | | removed | 10940 | | | | | 10941 | RedP reached | | Init | TEARDOWN of | 10942 | | | | session | 10943 | | | | | 10944 | Timeout | | Init | Stop Media | 10945 | | | | playout | 10946 +----------------+-----------------------+--------+-----------------+ 10947 Table 16: State: Play 10949 The Play state table, see Table 16, contains a number of requests 10950 that need a presentation URI (labeled as Prs URI) to work on (i.e., 10951 the presentation URI has to be used as the Request-URI). This is due 10952 to the exclusion of non-aggregated stream control in sessions with 10953 more than one media stream. 10955 To avoid inconsistencies between the client and server, automatic 10956 state transitions are avoided. This can be seen at for example "End 10957 of media" event when all media has finished playing, the session 10958 still remains in Play state. An explicit PAUSE request needs to be 10959 sent to change the state to Ready. It may appear that there exist 10960 automatic transitions in "RedP reached" and "PP reached". However, 10961 they are requested and acknowledged before they take place. The time 10962 at which the transition will happen is known by looking at the range 10963 header. If the client sends a request close in time to these 10964 transitions it needs to be prepared for receiving error messages, as 10965 the state may or may not have changed. 10967 Appendix C. Media Transport Alternatives 10969 This section defines how certain combinations of protocols, profiles 10970 and lower transports are used. This includes the usage of the 10971 Transport header's source and destination address parameters 10972 "src_addr" and "dest_addr". 10974 C.1. RTP 10976 This section defines the interaction of RTSP with respect to the RTP 10977 protocol [RFC3550]. It also defines any necessary media transport 10978 signalling with regards to RTP. 10980 The available RTP profiles and lower layer transports are described 10981 below along with rules on signalling the available combinations. 10983 C.1.1. AVP 10985 The usage of the "RTP Profile for Audio and Video Conferences with 10986 Minimal Control" [RFC3551] when using RTP for media transport over 10987 different lower layer transport protocols is defined below in regards 10988 to RTSP. 10990 One such case is defined within this document, the use of embedded 10991 (interleaved) binary data as defined in Section 14. The usage of 10992 this method is indicated by including the "interleaved" parameter. 10994 When using embedded binary data the "src_addr" and "dest_addr" MUST 10995 NOT be used. This addressing and multiplexing is used as defined 10996 with use of channel numbers and the interleaved parameter. 10998 C.1.2. AVP/UDP 11000 This part describes sending of RTP [RFC3550] over lower transport 11001 layer UDP [RFC0768] according to the profile "RTP Profile for Audio 11002 and Video Conferences with Minimal Control" defined in RFC 3551 11003 [RFC3551]. This profile requires one or two uni- or bi-directional 11004 UDP flows per media stream. The first UDP flow is for RTP and the 11005 second is for RTCP. Embedding of RTP data with the RTSP messages, in 11006 accordance with Section 14, SHOULD NOT be performed when RTSP 11007 messages are transported over unreliable transport protocols, like 11008 UDP [RFC0768]. 11010 The RTP/UDP and RTCP/UDP flows can be established using the Transport 11011 header's "src_addr", and "dest_addr" parameters. 11013 In RTSP PLAY mode, the transmission of RTP packets from client to 11014 server is unspecified. The behavior in regards to such RTP packets 11015 MAY be defined in future. 11017 The "src_addr" and "dest_addr" parameters are used in the following 11018 way for media delivery and playback mode, i.e. Mode=PLAY: 11020 o The "src_addr" and "dest_addr" parameters MUST contain either 1 or 11021 2 address specifications. 11023 o Each address specification for RTP/AVP/UDP or RTP/AVP/TCP MUST 11024 contain either: 11026 * both an address and a port number, or 11028 * a port number without an address. 11030 o The first address and port pair given in either of the parameters 11031 applies to the RTP stream. The second address and port pair if 11032 present applies to the RTCP stream. 11034 o The RTP/UDP packets from the server to the client MUST be sent to 11035 the address and port given by the first address and port pair of 11036 the "dest_addr" parameter. 11038 o The RTCP/UDP packets from the server to the client MUST be sent to 11039 the address and port given by the second address and port pair of 11040 the "dest_addr" parameter. If no second pair is specified RTCP 11041 MUST NOT be sent. 11043 o The RTCP/UDP packets from the client to the server MUST be sent to 11044 the address and port given by the second address and port pair of 11045 the "src_addr" parameter. If no second pair is given RTCP MUST 11046 NOT be sent. 11048 o The RTP/UDP packets from the client to the server MUST be sent to 11049 the address and port given by the first address and port pair of 11050 the "src_addr" parameter. 11052 o RTP and RTCP Packets SHOULD be sent from the corresponding 11053 receiver port, i.e. RTCP packets from the server should be sent 11054 from the "src_addr" parameters second address port pair. 11056 C.1.3. AVPF/UDP 11058 The RTP profile "Extended RTP Profile for RTCP-based Feedback (RTP/ 11059 AVPF)" [RFC4585] MAY be used as RTP profiles in sessions using RTP. 11060 All that is defined for AVP MUST also apply for AVPF. 11062 The usage of AVPF is indicated by the media initialization protocol 11063 used. In the case of SDP it is indicated by media lines (m=) 11064 containing the profile RTP/AVPF. That SDP MAY also contain further 11065 AVPF related SDP attributes configuring the AVPF session regarding 11066 reporting interval and feedback messages to be used. This 11067 configuration MUST be followed. 11069 C.1.4. SAVP/UDP 11071 The RTP profile "The Secure Real-time Transport Protocol (SRTP)" 11072 [RFC3711] is an RTP profile (SAVP) that MAY be used in RTSP sessions 11073 using RTP. All that is defined for AVP MUST also apply for SAVP. 11075 The usage of SRTP requires that a security context is established. 11076 The default key-management unless otherwise signalled shall be MIKEY 11077 in RSA-R mode as defined in Appendix C.1.4.1, and not according to 11078 the procedure defined in "Key Management Extensions for Session 11079 Description Protocol (SDP) and Real Time Streaming Protocol (RTSP)" 11080 [RFC4567]. The reason is that RFC 4567 sends the initial MIKEY 11081 message in SDP, thus both requiring the usage of the DESCRIBE method 11082 and forcing the server to keep state for clients performing DESCRIBE 11083 in anticipation that they might require key management. 11085 MIKEY is selected as default method for establishing SRTP 11086 cryptographic context within an RTSP session as it can be embedded in 11087 the RTSP messages, while still ensuring confidentiality of content of 11088 the keying material, even when using hop-by-hop TLS security for the 11089 RTSP messages. This method does also support pipelining of the RTSP 11090 messages. 11092 C.1.4.1. MIKEY Key Establishment 11094 This method for using MIKEY to establish the SRTP cryptographic 11095 context is initiated in the client's SETUP request, and the servers 11096 response to the SETUP carries the MIKEY response. Thus ensuring that 11097 the crypto context establishment happens simultaneously with the 11098 establishment of the media stream being protected. By using MIKEY's 11099 RSA-R mode [RFC4738] the client can be the initiator and still allow 11100 the server to set the parameters in accordance with the actual media 11101 stream. 11103 The SRTP cryptographic context establishment is done according to the 11104 following process: 11106 1. The client determines that SAVP or SAVPF shall be used from 11107 media description format, e.g. SDP. If no other key management 11108 method is explicitly signalled, then MIKEY SHALL be used as 11109 defined herein. This specification does not specify an explicit 11110 method for indicating this SRTP cryptographic context 11111 establishment method, but future specifications may. 11113 2. The client SHALL establish a TLS connection for RTSP messages, 11114 directly or hop by hop with the server. If hop-by-hop TLS 11115 security is used, the User method SHALL be indicated in the 11116 Accept-Credentials header. We do note that using hop-by-hop 11117 does allow the proxy to insert itself as a man in the middle 11118 also in the MIKEY exchange by providing one of its certificates, 11119 rather than the server's in the Connection-Credentials header. 11120 The client SHALL therefore validate the server certificate. 11122 3. The client retrieves the servers certificate from a direct TLS 11123 connection, or if hop by hop from Connection-Credentials header. 11124 The client then checks that the server certificate is valid and 11125 belongs to the server. 11127 4. The client forms the MIKEY Initiator message using RSA-R mode in 11128 unicast mode as specified in [RFC4738]. The client SHOULD use 11129 the same certificate for TLS and in MIKEY to enable the server 11130 to bind the two together. The client's certificate SHALL be 11131 included in the MIKEY message. The client SHALL indicate its 11132 SRTP capabilities in the message. 11134 5. The MIKEY message from the previous step is base64 [RFC4648] 11135 encoded and becomes the value of the MIKEY parameter that is 11136 included in the transport specification(s) that specifies a SRTP 11137 based profile (SAVP, SAVPF) in the SETUP request. 11139 6. Any proxy encountering the MIKEY parameter SHALL forward it 11140 without modification. A proxy requiring to understand transport 11141 specification which doesn't support SAVP/SAVPF with MIKEY will 11142 discard the whole transport specification. Most types of proxy 11143 can easily support SAVP and SAVPF with MIKEY. If possible 11144 bypassing the proxy should be tried. 11146 7. The server upon receiving the SETUP request, will need to decide 11147 upon the transport specification to use, if multiple are 11148 included by the client. In the determination of which transport 11149 specifications that are supported and preferred, the server 11150 SHOULD decode the MIKEY message to take the embedded SRTP 11151 parameters into account. If all transport specs require SRTP 11152 but no MIKEY parameter or other supported keying method is 11153 included, the server SHALL respond with 403. 11155 8. Upon generating a response the following outcomes can occur: 11157 * A transport spec not using SRTP and MIKEY is selected. Thus 11158 the response will not contain any MIKEY parameter. 11160 * A transport spec using SRTP and MIKEY is selected but an 11161 error is encountered in the MIKEY processing. In that case 11162 an RTSP error response code of 466 "Key Management Error" 11163 SHALL be used. A MIKEY message describing the error MAY be 11164 included. 11166 * A transport spec using SRTP and MIKEY is selected and a MIKEY 11167 response message can be created. The server SHOULD use the 11168 same certificate for TLS and in MIKEY to enable client to 11169 bind the two together. If a different certificate is used it 11170 SHALL be included in the MIKEY message. It is RECOMMENDED 11171 that the envelope key cache type is set to 'Cache' and that a 11172 single envelope key is reused for all MIKEY messages to the 11173 client. That message is included in the MIKEY parameter part 11174 of the single selected transport specification in the SETUP 11175 response. The server will set the SRTP parameters as 11176 preferred for this media stream within the supported range by 11177 the client. 11179 9. The server transmits the SETUP response back to the client. 11181 10. The client receives the SETUP response and if the response code 11182 indicates a successful request it decodes the MIKEY message and 11183 establish the SRTP cryptographic context from the parameters in 11184 the MIKEY response. 11186 In the above method the client's certificate may be self-signed in 11187 cases where the client's identity is not necessary to establish and 11188 the security goal is only to ensure that the RTSP signalling client 11189 is the same as the one receiving the SRTP security context. 11191 C.1.5. SAVPF/UDP 11193 The RTP profile "Extended Secure RTP Profile for RTCP-based Feedback 11194 (RTP/SAVPF)" [RFC5124] is an RTP profile (SAVPF) that MAY be used in 11195 RTSP sessions using RTP. All that is defined for AVP MUST also apply 11196 for SAVPF. 11198 The usage of SRTP requires that a cryptographic context is 11199 established. The default mechanism for establishing that security 11200 association is to use MIKEY[RFC3830] with RTSP as defined in 11201 Appendix C.1.4.1. 11203 C.1.6. RTCP usage with RTSP 11205 RTCP has several usages when RTP is used for media transport as 11206 explained below. Due to that RTCP MUST be supported if an RTSP agent 11207 handles RTP. 11209 C.1.6.1. Media synchronization 11211 RTCP provides media synchronization and clock drift compensation. 11212 The initial media synchronization is available from RTP-Info header. 11213 However, to be able to handle any clock drift between the media 11214 streams, RTCP is needed. 11216 C.1.6.2. RTSP Session keep-alive 11218 RTCP traffic from the RTSP client to the RTSP server MUST function as 11219 keep-alive. This requires an RTSP server supporting RTP to use the 11220 received RTCP packets as indications that the client desires the 11221 related RTSP session to be kept alive. 11223 C.1.6.3. Bit-rate adaption 11225 RTCP Receiver reports and any additional feedback from the client 11226 MUST be used to adapt the bit-rate used over the transport for all 11227 cases when RTP is sent over UDP. An RTP sender without reserved 11228 resources MUST NOT use more than its fair share of the available 11229 resources. This can be determined by comparing on short to medium 11230 term (some seconds) the used bit-rate and adapt it so that the RTP 11231 sender sends at a bit-rate comparable to what a TCP sender would 11232 achieve on average over the same path. 11234 C.1.6.4. RTP and RTCP Multiplexing 11236 RTSP can be used to negotiate the usage of RTP and RTCP multiplexing 11237 as described in [RFC5761]. This allows servers and client to reduce 11238 the amount of resources required for the session by only requiring 11239 one underlying transport stream per media stream instead of two when 11240 using RTP and RTCP. This lessens the server port consumption and 11241 also the necessary state and keep-alive work when operating across 11242 Network and Address Translators [RFC2663]. 11244 Content must be prepared with some consideration for RTP and RTCP 11245 multiplexing, mainly ensuring that the RTP payload types used do not 11246 collide with the ones used for RTCP packet types. This option likely 11247 needs explicit support from the content unless the RTP payload types 11248 can be remapped by the server and that is correctly reflected in the 11249 session description. Beyond that support of this feature should come 11250 at little cost and much gain. 11252 It is recommended that if the content and server support RTP and RTCP 11253 multiplexing that this is indicated in the session description, for 11254 example using the SDP attribute "a=rtcp-mux". If the SDP message 11255 contains the a=rtcp-mux attribute for a media stream, the server MUST 11256 support RTP and RTCP multiplexing. If indicated or otherwise desired 11257 by the client it can include the Transport parameter "RTCP-mux" in 11258 any transport specification where it desires to use RTCP-mux. The 11259 server will indicate if it supports RTCP-mux. Servers and Clients 11260 SHOULD support RTP and RTCP multiplexing. 11262 For capability exchange, an RTSP feature tag for RTP and RTCP 11263 multiplexing is defined: "setup.rtp.rtcp.mux". 11265 C.2. RTP over TCP 11267 Transport of RTP over TCP can be done in two ways: over independent 11268 TCP connections using RFC 4571 [RFC4571] or interleaved in the RTSP 11269 control connection. In both cases the protocol MUST be "rtp" and the 11270 lower layer MUST be TCP. The profile may be any of the above 11271 specified ones; AVP, AVPF, SAVP or SAVPF. 11273 C.2.1. Interleaved RTP over TCP 11275 The use of embedded (interleaved) binary data transported on the RTSP 11276 connection is possible as specified in Section 14. When using this 11277 declared combination of interleaved binary data the RTSP messages 11278 MUST be transported over TCP. TLS may or may not be used. 11280 One should, however, consider that this will result in all media 11281 streams go through any proxy. Using independent TCP connections can 11282 avoid that issue. 11284 C.2.2. RTP over independent TCP 11286 In this Appendix, we describe the sending of RTP [RFC3550] over lower 11287 transport layer TCP [RFC0793] according to "Framing Real-time 11288 Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over 11289 Connection-Oriented Transport" [RFC4571]. This Appendix adapts the 11290 guidelines for using RTP over TCP within SIP/SDP [RFC4145] to work 11291 with RTSP. 11293 A client codes the support of RTP over independent TCP by specifying 11294 an RTP/AVP/TCP transport option without an interleaved parameter in 11295 the Transport line of a SETUP request. This transport option MUST 11296 include the "unicast" parameter. 11298 If the client wishes to use RTP with RTCP, two ports (or two address/ 11299 port pairs) are specified by the dest_addr parameter. If the client 11300 wishes to use RTP without RTCP, one port (or one address/port pair) 11301 is specified by the dest_addr parameter. Ordering rules of dest_addr 11302 ports follow the rules for RTP/AVP/UDP. 11304 If the client wishes to play the active role in initiating the TCP 11305 connection, it MAY set the "setup" parameter (See Section 16.52) on 11306 the Transport line to be "active", or it MAY omit the setup 11307 parameter, as active is the default. If the client signals the 11308 active role, the ports for all dest_addr values MUST be set to 9 (the 11309 discard port). 11311 If the client wishes to play the passive role in TCP connection 11312 initiation, it MUST set the "setup" parameter on the Transport line 11313 to be "passive". If the client is able to assume the active or the 11314 passive role, it MUST set the "setup" parameter on the Transport line 11315 to be "actpass". In either case, the dest_addr port value for RTP 11316 MUST be set to the TCP port number on which the client is expecting 11317 to receive the RTP stream connection, and the dest_addr port value 11318 for RTCP MUST be set to the TCP port number on which the client is 11319 expecting to receive the RTCP stream connection. 11321 If upon receipt of a non-interleaved RTP/AVP/TCP SETUP request, a 11322 server decides to accept this requested option, the 2xx reply MUST 11323 contain a Transport option that specifies RTP/AVP/TCP (without using 11324 the interleaved parameter, and with using the unicast parameter). 11325 The dest_addr parameter value MUST be echoed from the parameter value 11326 in the client request unless the destination address (only port) was 11327 not provided in which case the server MAY include the source address 11328 of the RTSP TCP connection with the port number unchanged. 11330 In addition, the server reply MUST set the setup parameter on the 11331 Transport line, to indicate the role the server will play in the 11332 connection setup. Permissible values are "active" (if a client set 11333 "setup" to "passive" or "actpass") and "passive" (if a client set 11334 "setup" to "active" or "actpass"). 11336 If a server sets "setup" to "passive", the "src_addr" in the reply 11337 MUST indicate the ports the server is willing to receive an RTP 11338 connection and (if the client requested an RTCP connection by 11339 specifying two dest_addr ports or address/port pairs) and RTCP 11340 connection. If a server sets "setup" to "active", the ports 11341 specified in "src_addr" MUST be set to 9. The server MAY use the 11342 "ssrc" parameter, following the guidance in Section 16.52. Port 11343 ordering for src_addr follows the rules for RTP/AVP/UDP. 11345 Servers MUST support taking the passive role and MAY support taking 11346 the active role. Servers with a public IP address take the passive 11347 role, thus enabling clients behind NATs and Firewalls a better chance 11348 of successful connect to the server by actively connecting outwards. 11349 Therefore the clients are RECOMMENDED to take the active role. 11351 After sending (receiving) a 2xx reply for a SETUP method for a non- 11352 interleaved RTP/AVP/TCP media stream, the active party SHOULD 11353 initiate the TCP connection as soon as possible. The client MUST NOT 11354 send a PLAY request prior to the establishment of all the TCP 11355 connections negotiated using SETUP for the session. In case the 11356 server receives a PLAY request in a session that has not yet 11357 established all the TCP connections, it MUST respond using the 464 11358 "Data Transport Not Ready Yet" (Section 15.4.29) error code. 11360 Once the PLAY request for a media resource transported over non- 11361 interleaved RTP/AVP/TCP occurs, media begins to flow from server to 11362 client over the RTP TCP connection, and RTCP packets flow 11363 bidirectionally over the RTCP TCP connection. As in the RTP/UDP 11364 case, client to server traffic on the TCP port is unspecified by this 11365 memo. The packets that travel on these connections MUST be framed 11366 using the protocol defined in [RFC4571], not by the framing defined 11367 for interleaving RTP over the RTSP control connection defined in 11368 Section 14. 11370 A successful PAUSE request for a media being transported over RTP/ 11371 AVP/TCP pauses the flow of packets over the connections, without 11372 closing the connections. A successful TEARDOWN request signals that 11373 the TCP connections for RTP and RTCP are to be closed as soon as 11374 possible. 11376 Subsequent SETUP requests on an already-SETUP RTP/AVP/TCP URI may be 11377 ambiguous in the following way: does the client wish to open up new 11378 TCP RTP and RTCP connections for the URI, or does the client wish to 11379 continue using the existing TCP RTP and RTCP connections? The client 11380 SHOULD use the "connection" parameter (defined in Section 16.52) on 11381 the Transport line to make its intention clear (by setting 11382 "connection" to "new" if new connections are needed, and by setting 11383 "connection" to "existing" if the existing connections are to be 11384 used). After a 2xx reply for a SETUP request for a new connection, 11385 parties should close the pre-existing connections, after waiting a 11386 suitable period for any stray RTP or RTCP packets to arrive. 11388 The usage of SRTP, i.e. either SAVP or SAVPF profiles requires that a 11389 security association is established. The default mechanism for 11390 establishing that security association is to use MIKEY[RFC3830] with 11391 RTSP as defined Appendix C.1.4.1. 11393 Below, we rewrite part of the example media on demand example shown 11394 in Appendix A.1 to use RTP/AVP/TCP non-interleaved: 11396 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 11397 CSeq: 1 11398 User-Agent: PhonyClient/1.2 11400 M->C: RTSP/2.0 200 OK 11401 CSeq: 1 11402 Server: PhonyServer/1.0 11403 Date: Thu, 23 Jan 1997 15:35:06 GMT 11404 Content-Type: application/sdp 11405 Content-Length: 227 11406 Content-Base: rtsp://example.com/twister.3gp/ 11407 Expires: 24 Jan 1997 15:35:06 GMT 11409 v=0 11410 o=- 2890844256 2890842807 IN IP4 198.51.100.34 11411 s=RTSP Session 11412 i=An Example of RTSP Session Usage 11413 e=adm@example.com 11414 c=IN IP4 0.0.0.0 11415 a=control: * 11416 a=range: npt=0-0:10:34.10 11417 t=0 0 11418 m=audio 0 RTP/AVP 0 11419 a=control: trackID=1 11421 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 11422 CSeq: 2 11423 User-Agent: PhonyClient/1.2 11424 Require: play.basic 11425 Transport: RTP/AVP/TCP;unicast;dest_addr=":9"/":9"; 11426 setup=active;connection=new 11427 Accept-Ranges: NPT, SMPTE, UTC 11429 M->C: RTSP/2.0 200 OK 11430 CSeq: 2 11431 Server: PhonyServer/1.0 11432 Transport: RTP/AVP/TCP;unicast; 11433 dest_addr=":9"/":9"; 11434 src_addr="198.51.100.5:53478"/"198.51.100:54091"; 11435 setup=passive;connection=new;ssrc=93CB001E 11436 Session: 12345678 11437 Expires: 24 Jan 1997 15:35:12 GMT 11438 Date: 23 Jan 1997 15:35:12 GMT 11439 Accept-Ranges: NPT 11440 Media-Properties: Random-Access=0.8, Immutable, Unlimited 11442 C->M: TCP Connection Establishment x2 11444 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 11445 CSeq: 4 11446 User-Agent: PhonyClient/1.2 11447 Range: npt=30- 11448 Session: 12345678 11450 M->C: RTSP/2.0 200 OK 11451 CSeq: 4 11452 Server: PhonyServer/1.0 11453 Date: 23 Jan 1997 15:35:14 GMT 11454 Session: 12345678 11455 Range: npt=30-623.10 11456 Seek-Style: First-Prior 11457 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=1" 11458 ssrc=4F312DD8:seq=54321;rtptime=2876889 11460 C.3. Handling Media Clock Time Jumps in the RTP Media Layer 11462 RTSP allows media clients to control selected, non-contiguous 11463 sections of media presentations, rendering those streams with an RTP 11464 media layer [RFC3550]. Two cases occur, the first is when a new PLAY 11465 request replaces an old ongoing request and the new request results 11466 in a jump in the media. This should produce in the RTP layer a 11467 continuous media stream. A client may also directly following a 11468 completed PLAY request perform a new PLAY request. This will result 11469 in some gap in the media layer. The below text will look into both 11470 cases. 11472 A PLAY request that replaces an ongoing request allows the media 11473 layer rendering the RTP stream without being affected by jumps in 11474 media clock time. The RTP timestamps for the new media range is set 11475 so that they become continuous with the previous media range in the 11476 previous request. The RTP sequence number for the first packet in 11477 the new range will be the next following the last packet in the 11478 previous range, i.e. monotonically increasing. The goal is to allow 11479 the media rendering layer to work without interruption or 11480 reconfiguration across the jumps in media clock. This should be 11481 possible in all cases of replaced PLAY requests for media that has 11482 random-access properties. In this case care is needed to align 11483 frames or similar media dependent structures. 11485 In cases where jumps in media clock time are a result of RTSP 11486 signalling operations arriving after a completed PLAY operation, the 11487 request timing will result in that media becomes non-continuous. The 11488 server becomes unable to send the media so that it arrives timely and 11489 still carry timestamps to make the media stream continuous. In these 11490 cases the server will produce RTP streams where there are gaps in the 11491 RTP timeline for the media. In such cases, if the media has frame 11492 structure, aligning the timestamp for the next frame with the 11493 previous structure reduces the burden to render this media. The gap 11494 should represent the time the server hasn't been serving media, e.g. 11495 the time between the end of the media stream or a PAUSE request and 11496 the new PLAY request. In these cases the RTP sequence number would 11497 normally be monotonically increasing across the gap. 11499 For RTSP sessions with media that lacks random access properties, 11500 such as live streams, any media clock jump is commonly the result of 11501 a correspondingly long pause of delivery. The RTP timestamp will 11502 have increased in direct proportion to the duration of the paused 11503 delivery. Note also that in this case the RTP sequence number should 11504 be the next packet number. If not, the RTCP packet loss reporting 11505 will indicate as loss all packets not received between the point of 11506 pausing and later resuming. This may trigger congestion avoidance 11507 mechanisms. An allowed exception from the above recommendation on 11508 monotonically increasing RTP sequence number is live media streams, 11509 likely being relayed. In this case, when the client resumes 11510 delivery, it will get the media that is currently being delivered to 11511 the server itself. For this type of basic delivery of live streams 11512 to multiple users over unicast, individual rewriting of RTP sequence 11513 numbers becomes quite a burden. For solutions that anyway caches 11514 media, timeshifts, etc, the rewriting should be a minor issue. 11516 The goal when handling jumps in media clock time is that the provided 11517 stream is continuous without gaps in RTP timestamp or sequence 11518 number. However, when delivery has been halted for some reason the 11519 RTP timestamp when resuming MUST represent the duration the delivery 11520 was halted. RTP sequence number MUST generally be the next number, 11521 i.e. monotonically increasing modulo 65536. For media resources with 11522 the properties Time-Progressing and Time-Duration=0.0 the server MAY 11523 create RTP media streams with RTP sequence number jumps in them due 11524 to the client first halting delivery and later resuming it (PAUSE and 11525 then later PLAY). However, servers utilizing this exception must 11526 take into consideration the resulting RTCP receiver reports that 11527 likely contains loss reports for all the packets part of the 11528 discontinuity. A client cannot rely on that a server will align when 11529 resuming playing even if it is RECOMMENDED. The RTP-Info header will 11530 provide information on how the server acts in each case. 11532 We cannot assume that the RTSP client can communicate with the RTP 11533 media agent, as the two may be independent processes. If the RTP 11534 timestamp shows the same gap as the NPT, the media agent will 11535 assume that there is a pause in the presentation. If the jump in 11536 NPT is large enough, the RTP timestamp may roll over and the media 11537 agent may believe later packets to be duplicates of packets just 11538 played out. Having the RTP timestamp jump will also affect the 11539 RTCP measurements based on this. 11541 As an example, assume an RTP timestamp frequency of 8000 Hz, a 11542 packetization interval of 100 ms and an initial sequence number and 11543 timestamp of zero. 11545 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11546 CSeq: 4 11547 Session: abcdefgh 11548 Range: npt=10-15 11549 User-Agent: PhonyClient/1.2 11551 S->C: RTSP/2.0 200 OK 11552 CSeq: 4 11553 Session: abcdefgh 11554 Range: npt=10-15 11555 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11556 ssrc=0D12F123:seq=0;rtptime=0 11558 The ensuing RTP data stream is depicted below: 11560 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11561 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11562 . . . 11563 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 11565 Upon the completion of the requested delivery the server sends a 11566 PLAY_NOTIFY 11567 S->C: PLAY_NOTIFY rtsp://example.com/fizzle RTSP/2.0 11568 CSeq: 5 11569 Notify-Reason: end-of-stream 11570 Request-Status: cseq=4 status=200 reason="OK" 11571 Range: npt=-15 11572 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 11573 ssrc=0D12F123:seq=49;rtptime=39200 11574 Session: abcdefgh 11576 C->S: RTSP/2.0 200 OK 11577 CSeq: 5 11578 User-Agent: PhonyClient/1.2 11580 Upon the completion of the play range, the client follows up with a 11581 request to PLAY from a new NPT. 11583 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11584 CSeq: 6 11585 Session: abcdefg 11586 Range: npt=18-20 11587 User-Agent: PhonyClient/1.2 11589 S->C: RTSP/2.0 200 OK 11590 CSeq: 6 11591 Session: abcdefg 11592 Range: npt=18-20 11593 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11594 ssrc=0D12F123:seq=50;rtptime=40100 11596 The ensuing RTP data stream is depicted below: 11598 S->C: RTP packet - seq = 50, rtptime = 40100, NPT time = 18s 11599 S->C: RTP packet - seq = 51, rtptime = 40900, NPT time = 18.1s 11600 . . . 11601 S->C: RTP packet - seq = 69, rtptime = 55300, NPT time = 19.9s 11603 In this example, first, NPT 10 through 15 is played, then the client 11604 requests the server to skip ahead and play NPT 18 through 20. The 11605 first segment is presented as RTP packets with sequence numbers 0 11606 through 49 and timestamp 0 through 39,200. The second segment 11607 consists of RTP packets with sequence number 50 through 69, with 11608 timestamps 40,100 through 55,200. While there is a gap in the NPT, 11609 there is no gap in the sequence number space of the RTP data stream. 11611 The RTP timestamp gap is present in the above example due to the time 11612 it takes to perform the second play request, in this case 12.5 ms 11613 (100/8000). 11615 C.4. Handling RTP Timestamps after PAUSE 11617 During a PAUSE / PLAY interaction in an RTSP session, the duration of 11618 time for which the RTP transmission was halted MUST be reflected in 11619 the RTP timestamp of each RTP stream. The duration can be calculated 11620 for each RTP stream as the time elapsed from when the last RTP packet 11621 was sent before the PAUSE request was received and when the first RTP 11622 packet was sent after the subsequent PLAY request was received. The 11623 duration includes all latency incurred and processing time required 11624 to complete the request. 11626 The RTP RFC [RFC3550] states that: The RTP timestamp for each unit 11627 [packet] would be related to the wallclock time at which the unit 11628 becomes current on the virtual presentation timeline. 11630 In order to satisfy the requirements of [RFC3550], the RTP 11631 timestamp space needs to increase continuously with real time. 11632 While this is not optimal for stored media, it is required for RTP 11633 and RTCP to function as intended. Using a continuous RTP 11634 timestamp space allows the same timestamp model for both stored 11635 and live media and allows better opportunity to integrate both 11636 types of media under a single control. 11638 As an example, assume a clock frequency of 8000 Hz, a packetization 11639 interval of 100 ms and an initial sequence number and timestamp of 11640 zero. 11642 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11643 CSeq: 4 11644 Session: abcdefg 11645 Range: npt=10-15 11646 User-Agent: PhonyClient/1.2 11648 S->C: RTSP/2.0 200 OK 11649 CSeq: 4 11650 Session: abcdefg 11651 Range: npt=10-15 11652 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11653 ssrc=0D12F123:seq=0;rtptime=0 11655 The ensuing RTP data stream is depicted below: 11657 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11658 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11659 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 11660 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 11662 The client then sends a PAUSE request: 11664 C->S: PAUSE rtsp://example.com/fizzle RTSP/2.0 11665 CSeq: 5 11666 Session: abcdefg 11667 User-Agent: PhonyClient/1.2 11669 S->C: RTSP/2.0 200 OK 11670 CSeq: 5 11671 Session: abcdefg 11672 Range: npt=10.4-15 11674 20 seconds elapse and then the client sends a PLAY request. In 11675 addition the server requires 15 ms to process the request: 11677 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11678 CSeq: 6 11679 Session: abcdefg 11680 User-Agent: PhonyClient/1.2 11682 S->C: RTSP/2.0 200 OK 11683 CSeq: 6 11684 Session: abcdefg 11685 Range: npt=10.4-15 11686 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11687 ssrc=0D12F123:seq=4;rtptime=164400 11689 The ensuing RTP data stream is depicted below: 11691 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 11692 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 11693 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 11695 First, NPT 10 through 10.3 is played, then a PAUSE is received by the 11696 server. After 20 seconds a PLAY is received by the server which 11697 takes 15ms to process. The duration of time for which the session 11698 was paused is reflected in the RTP timestamp of the RTP packets sent 11699 after this PLAY request. 11701 A client can use the RTSP range header and RTP-Info header to map NPT 11702 time of a presentation with the RTP timestamp. 11704 Note: In RFC 2326 [RFC2326], this matter was not clearly defined and 11705 was misunderstood commonly. However, for RTSP 2.0 it is expected 11706 that this will be handled correctly and no exception handling will be 11707 required. 11709 Note Further: To ensure correct media decoding and usually jitter- 11710 buffer handling reseting some of the state when issuing a PLAY 11711 request is needed. 11713 C.5. RTSP / RTP Integration 11715 For certain datatypes, tight integration between the RTSP layer and 11716 the RTP layer will be necessary. This by no means precludes the 11717 above restrictions. Combined RTSP/RTP media clients should use the 11718 RTP-Info field to determine whether incoming RTP packets were sent 11719 before or after a seek or before or after a PAUSE. 11721 C.6. Scaling with RTP 11723 For scaling (see Section 16.44), RTP timestamps should correspond to 11724 the rendering timing. For example, when playing video recorded at 30 11725 frames/second at a scale of two and speed (Section 16.48) of one, the 11726 server would drop every second frame to maintain and deliver video 11727 packets with the normal timestamp spacing of 3,000 per frame, but NPT 11728 would increase by 1/15 second for each video frame. 11730 Note: The above scaling puts requirements on the media codec or a 11731 media stream to support it. For example motion JPEG or other non- 11732 predictive video coding can easier handle the above example. 11734 C.7. Maintaining NPT synchronization with RTP timestamps 11736 The client can maintain a correct display of NPT (Normal Play Time) 11737 by noting the RTP timestamp value of the first packet arriving after 11738 repositioning. The sequence parameter of the RTP-Info 11739 (Section 16.43) header provides the first sequence number of the next 11740 segment. 11742 C.8. Continuous Audio 11744 For continuous audio, the server SHOULD set the RTP marker bit at the 11745 beginning of serving a new PLAY request or at jumps in timeline. 11746 This allows the client to perform playout delay adaptation. 11748 C.9. Multiple Sources in an RTP Session 11750 Note that more than one SSRC MAY be sent in the media stream. If it 11751 happens all sources are expected to be rendered simultaneously. 11753 C.10. Usage of SSRCs and the RTCP BYE Message During an RTSP Session 11755 The RTCP BYE message indicates the end of use of a given SSRC. If 11756 all sources leave an RTP session, it can, in most cases, be assumed 11757 to have ended. Therefore, a client or server MUST NOT send an RTCP 11758 BYE message until it has finished using a SSRC. A server SHOULD keep 11759 using a SSRC until the RTP session is terminated. Prolonging the use 11760 of a SSRC allows the established synchronization context associated 11761 with that SSRC to be used to synchronize subsequent PLAY requests 11762 even if the PLAY response is late. 11764 An SSRC collision with the SSRC that transmits media does also have 11765 consequences, as it will normally force the media sender to change 11766 its SSRC in accordance with the RTP specification[RFC3550]. However, 11767 an RTSP server may wait and see if the client changes and thus 11768 resolve the conflict to minimize the impact. As media sender SSRC 11769 change will result in a loss of synchronization context, and require 11770 any receiver to wait for RTCP sender reports for all media requiring 11771 synchronization before being able to play out synchronized. Due to 11772 these reasons a client joining a session should take care to not 11773 select the same SSRC(s) as the server indicates in the ssrc Transport 11774 header parameter. Any SSRC signalled in the Transport header MUST be 11775 avoided. A client detecting a collision prior to sending any RTP or 11776 RTCP messages SHALL also select a new SSRC. 11778 C.11. Future Additions 11780 It is the intention that any future protocol or profile regarding 11781 media delivery and lower transport should be easy to add to RTSP. 11782 This section provides the necessary steps that needs to be meet. 11784 The following things needs to be considered when adding a new 11785 protocol or profile for use with RTSP: 11787 o The protocol or profile needs to define a name tag representing 11788 it. This tag is required to be an ABNF "token" to be possible to 11789 use in the Transport header specification. 11791 o The useful combinations of protocol, profiles and lower layer 11792 transport for this extension needs to be defined. For each 11793 combination declare the necessary parameters to use in the 11794 Transport header. 11796 o For new media protocols the interaction with RTSP needs to be 11797 addressed. One important factor will be the media 11798 synchronization. May need new headers similar to RTP info to 11799 carry information. 11801 o Discuss congestion control for media, especially if transport 11802 without built in congestion control is used. 11804 See the IANA section (Section 22) for information how to register new 11805 attributes. 11807 Appendix D. Use of SDP for RTSP Session Descriptions 11809 The Session Description Protocol (SDP, [RFC4566]) may be used to 11810 describe streams or presentations in RTSP. This description is 11811 typically returned in reply to a DESCRIBE request on an URI from a 11812 server to a client, or received via HTTP from a server to a client. 11814 This appendix describes how an SDP file determines the operation of 11815 an RTSP session. SDP as is provides no mechanism by which a client 11816 can distinguish, without human guidance, between several media 11817 streams to be rendered simultaneously and a set of alternatives 11818 (e.g., two audio streams spoken in different languages). The SDP 11819 extension "Grouping of Media Lines in the Session Description 11820 Protocol (SDP)" [RFC5888] provides such functionality to some degree. 11821 Appendix D.4 describes the usage of SDP media line grouping for RTSP. 11823 D.1. Definitions 11825 The terms "session-level", "media-level" and other key/attribute 11826 names and values used in this appendix are to be used as defined in 11827 SDP[RFC4566]: 11829 D.1.1. Control URI 11831 The "a=control:" attribute is used to convey the control URI. This 11832 attribute is used both for the session and media descriptions. If 11833 used for individual media, it indicates the URI to be used for 11834 controlling that particular media stream. If found at the session 11835 level, the attribute indicates the URI for aggregate control 11836 (presentation URI). The session level URI MUST be different from any 11837 media level URI. The presence of a session level control attribute 11838 MUST be interpreted as support for aggregated control. The control 11839 attribute MUST be present on media level unless the presentation only 11840 contains a single media stream, in which case the attribute MAY only 11841 be present on the session level and then also apply to that single 11842 media level. 11844 ABNF for the attribute is defined in Section 20.3. 11846 Example: 11847 a=control:rtsp://example.com/foo 11849 This attribute MAY contain either relative or absolute URIs, 11850 following the rules and conventions set out in RFC 3986 [RFC3986]. 11851 Implementations MUST look for a base URI in the following order: 11853 1. the RTSP Content-Base field; 11854 2. the RTSP Content-Location field; 11856 3. the RTSP Request-URI. 11858 If this attribute contains only an asterisk (*), then the URI MUST be 11859 treated as if it were an empty embedded URI, and thus inherit the 11860 entire base URI. 11862 Note, RFC 2326 was very unclear on the processing of relative URI 11863 and several RTSP 1.0 implementations at the point of publishing 11864 this document did not perform RFC 3986 processing to determine the 11865 resulting URI, instead simple concatenation is common. To avoid 11866 this issue completely it is recommended to use absolute URI in the 11867 SDP. 11869 The URI handling for SDPs from container files need special 11870 consideration. For example lets assume that a container file has the 11871 URI: "rtsp://example.com/container.mp4". Lets further assume this 11872 URI is the base URI, and that there is an absolute media level URI: 11873 "rtsp://example.com/container.mp4/trackID=2". A relative media level 11874 URI that resolves in accordance with RFC 3986 [RFC3986] to the above 11875 given media URI is: "container.mp4/trackID=2". It is usually not 11876 desirable to need to include in or modify the SDP stored within the 11877 container file with the server local name of the container file. To 11878 avoid this, one can modify the base URI used to include a trailing 11879 slash, e.g. "rtsp://example.com/container.mp4/". In this case the 11880 relative URI for the media will only need to be: "trackID=2". 11881 However, this will also mean that using "*" in the SDP will result in 11882 control URI including the trailing slash, i.e. 11883 "rtsp://example.com/container.mp4/". 11885 Note: The usage of TrackID in the above is not a standardized 11886 form, but one example out of several similar strings such as 11887 TrackID, Track_ID, StreamID that is used by different server 11888 vendors to indicate a particular piece of media inside a container 11889 file. 11891 D.1.2. Media Streams 11893 The "m=" field is used to enumerate the streams. It is expected that 11894 all the specified streams will be rendered with appropriate 11895 synchronization. If the session is over multicast, the port number 11896 indicated SHOULD be used for reception. The client MAY try to 11897 override the destination port, through the Transport header. The 11898 servers MAY allow this, the response will indicate if allowed or not. 11899 If the session is unicast, the port numbers are the ones RECOMMENDED 11900 by the server to the client, about which receiver ports to use; the 11901 client MUST still include its receiver ports in its SETUP request. 11903 The client MAY ignore this recommendation. If the server has no 11904 preference, it SHOULD set the port number value to zero. 11906 The "m=" lines contain information about which transport protocol, 11907 profile, and possibly lower-layer is to be used for the media stream. 11908 The combination of transport, profile and lower layer, like RTP/AVP/ 11909 UDP needs to be defined for how to be used with RTSP. The currently 11910 defined combinations are defined in Appendix C, further combinations 11911 MAY be specified. 11913 Example: 11914 m=audio 0 RTP/AVP 31 11916 D.1.3. Payload Type(s) 11918 The payload type(s) are specified in the "m=" line. In case the 11919 payload type is a static payload type from RFC 3551 [RFC3551], no 11920 other information may be required. In case it is a dynamic payload 11921 type, the media attribute "rtpmap" is used to specify what the media 11922 is. The "encoding name" within the "rtpmap" attribute may be one of 11923 those specified in RFC 3551 (Sections 5 and 6), or media type 11924 registered with IANA [RFC4288], or an experimental encoding as 11925 specified in SDP (RFC 4566 [RFC4566]). Codec-specific parameters are 11926 not specified in this field, but rather in the "fmtp" attribute 11927 described below. 11929 The selection of the RTP payload type numbers used may be required to 11930 consider RTP and RTCP Multiplexing [RFC5761] if that is to be 11931 supported by the server. 11933 D.1.4. Format-Specific Parameters 11935 Format-specific parameters are conveyed using the "fmtp" media 11936 attribute. The syntax of the "fmtp" attribute is specific to the 11937 encoding(s) that the attribute refers to. Note that some of the 11938 format specific parameters may be specified outside of the fmtp 11939 parameters, like for example the "ptime" attribute for most audio 11940 encodings. 11942 D.1.5. Directionality of media stream 11944 The SDP attributes "a=sendrecv", "a=recvonly" and "a=sendonly" 11945 provide instructions about the direction the media streams flow 11946 within a session. When using RTSP the SDP can be delivered to a 11947 client using either RTSP DESCRIBE or a number of RTSP external 11948 methods, like HTTP, FTP, and email. Based on this the SDP applies to 11949 how the RTSP client will see the complete session. Thus media 11950 streams delivered from the RTSP server to the client, would be given 11951 the "a=recvonly" attribute. 11953 The direction attributes are not commonly used in SDPs for RTSP, but 11954 may occur. "a=recvonly" in a SDP provided to the RTSP client MUST 11955 indicate that media delivery will only occur in the direction from 11956 the RTSP server to the client. In SDP provided to the RTSP client 11957 that lacks any of the directionality attributes (a=recvonly, 11958 a=sendonly, a=sendrecv) MUST behave as if the "a=recvonly" attribute 11959 was received. Note that this overrules the normal default rule 11960 defined in SDP[RFC4566]. The usage of "a=sendonly" or "a=sendrecv" 11961 is not defined, nor is the interpretation of SDP by other entities 11962 than the RTSP client. 11964 D.1.6. Range of Presentation 11966 The "a=range" attribute defines the total time range of the stored 11967 session or an individual media. Non-seekable live sessions can be 11968 indicated as specified below, while the length of live sessions can 11969 be deduced from the "t" and "r" SDP parameters. 11971 The attribute is both a session and a media level attribute. For 11972 presentations that contain media streams of the same durations, the 11973 range attribute SHOULD only be used at session-level. In case of 11974 different length the range attribute MUST be given at media level for 11975 all media, and SHOULD NOT be given at session level. If the 11976 attribute is present at both media level and session level the media 11977 level values MUST be used. 11979 Note: Usually one will specify the same length for all media, even if 11980 there isn't media available for the full duration on all media. 11981 However, that requires that the server accepts PLAY requests within 11982 that range. 11984 Servers MUST take care to provide RTSP Range (see Section 16.38) 11985 values that are consistent with what is presented in the SDP for the 11986 content. There is no reason for non dynamic content, like media 11987 clips provided on demand to have inconsistent values. Inconsistent 11988 values between the SDP and the actual values for the content handled 11989 by the server is likely to generate some failure, like 457 "Invalid 11990 Range", in case the client uses PLAY requests with a Range header. 11991 In case the content is dynamic in length and it is infeasible to 11992 provide a correct value in the SDP the server is recommended to 11993 describe this as non-seekable content (see below). The server MAY 11994 override that property in the response to a PLAY request using the 11995 correct values in the Range header. 11997 The unit is specified first, followed by the value range. The units 11998 and their values are as defined in Section 4.4, Section 4.5 and 11999 Section 4.6 and MAY be extended with further formats. Any open ended 12000 range (start-), i.e. without stop range, is of unspecified duration 12001 and MUST be considered as non-seekable content unless this property 12002 is overridden. Multiple instances carrying different clock formats 12003 MAY be included at either session or media level. 12005 ABNF for the attribute is defined in Section 20.3. 12007 Examples: 12008 a=range:npt=0-34.4368 12009 a=range:clock=19971113T211503Z-19971113T220300Z 12010 Non seekable stream of unknown duration: 12011 a=range:npt=0- 12013 D.1.7. Time of Availability 12015 The "t=" field defines when the SDP is valid. For on-demand content 12016 the server SHOULD indicate a stop time value for which it guarantees 12017 the description to be valid, and a start time that is equal to or 12018 before the time at which the DESCRIBE request was received. It MAY 12019 also indicate start and stop times of 0, meaning that the session is 12020 always available. 12022 For sessions that are of live type, i.e. specific start time, unknown 12023 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 12024 to indicate the start time of the event. The stop time SHOULD be 12025 given so that the live event will have ended at that time, while 12026 still not be unnecessary long into the future. 12028 D.1.8. Connection Information 12030 In SDP, the "c=" field contains the destination address for the media 12031 stream. If a multicast address is specified the client SHOULD use 12032 this address in any SETUP request as destination address, including 12033 any additional parameters, such as TTL. For on-demand unicast 12034 streams and some multicast streams, the destination address MAY be 12035 specified by the client via the SETUP request, thus overriding any 12036 specified address. To identify streams without a fixed destination 12037 address, where the client is required to specify a destination 12038 address, the "c=" field SHOULD be set to a null value. For addresses 12039 of type "IP4", this value MUST be "0.0.0.0", and for type "IP6", this 12040 value MUST be "0:0:0:0:0:0:0:0" (can also be written as "::"), i.e. 12041 the unspecified address according to RFC 4291 [RFC4291]. 12043 D.1.9. Message Body Tag 12045 The optional "a=mtag" attribute identifies a version of the session 12046 description. It is opaque to the client. SETUP requests may include 12047 this identifier in the If-Match field (see Section 16.23) to only 12048 allow session establishment if this attribute value still corresponds 12049 to that of the current description. The attribute value is opaque 12050 and may contain any character allowed within SDP attribute values. 12052 ABNF for the attribute is defined in Section 20.3. 12054 Example: 12055 a=mtag:"158bb3e7c7fd62ce67f12b533f06b83a" 12057 One could argue that the "o=" field provides identical 12058 functionality. However, it does so in a manner that would put 12059 constraints on servers that need to support multiple session 12060 description types other than SDP for the same piece of media 12061 content. 12063 D.2. Aggregate Control Not Available 12065 If a presentation does not support aggregate control no session level 12066 "a=control:" attribute is specified. For a SDP with multiple media 12067 sections specified, each section will have its own control URI 12068 specified via the "a=control:" attribute. 12070 Example: 12071 v=0 12072 o=- 2890844256 2890842807 IN IP4 192.0.2.56 12073 s=I came from a web page 12074 e=adm@example.com 12075 c=IN IP4 0.0.0.0 12076 t=0 0 12077 m=video 8002 RTP/AVP 31 12078 a=control:rtsp://audio.example.com/movie.aud 12079 m=audio 8004 RTP/AVP 3 12080 a=control:rtsp://video.example.com/movie.vid 12082 Note that the position of the control URI in the description implies 12083 that the client establishes separate RTSP control sessions to the 12084 servers audio.example.com and video.example.com. 12086 It is recommended that an SDP file contains the complete media 12087 initialization information even if it is delivered to the media 12088 client through non-RTSP means. This is necessary as there is no 12089 mechanism to indicate that the client should request more detailed 12090 media stream information via DESCRIBE. 12092 D.3. Aggregate Control Available 12094 In this scenario, the server has multiple streams that can be 12095 controlled as a whole. In this case, there are both a media-level 12096 "a=control:" attributes, which are used to specify the stream URIs, 12097 and a session-level "a=control:" attribute which is used as the 12098 Request-URI for aggregate control. If the media-level URI is 12099 relative, it is resolved to absolute URIs according to Appendix D.1.1 12100 above. 12102 Example: 12103 C->M: DESCRIBE rtsp://example.com/movie RTSP/2.0 12104 CSeq: 1 12105 User-Agent: PhonyClient/1.2 12107 M->C: RTSP/2.0 200 OK 12108 CSeq: 1 12109 Date: Thu, 23 Jan 1997 15:35:06 GMT 12110 Expires: Thu, 23 Jan 1997 16:35:06 GMT 12111 Content-Type: application/sdp 12112 Content-Base: rtsp://example.com/movie/ 12113 Content-Length: 227 12115 v=0 12116 o=- 2890844256 2890842807 IN IP4 192.0.2.211 12117 s=I contain 12118 i= 12119 e=adm@example.com 12120 c=IN IP4 0.0.0.0 12121 a=control:* 12122 t=0 0 12123 m=video 8002 RTP/AVP 31 12124 a=control:trackID=1 12125 m=audio 8004 RTP/AVP 3 12126 a=control:trackID=2 12128 In this example, the client is recommended to establish a single RTSP 12129 session to the server, and uses the URIs 12130 rtsp://example.com/movie/trackID=1 and 12131 rtsp://example.com/movie/trackID=2 to set up the video and audio 12132 streams, respectively. The URI rtsp://example.com/movie/, which is 12133 resolved from the "*", controls the whole presentation (movie). 12135 A client is not required to issue SETUP requests for all streams 12136 within an aggregate object. Servers should allow the client to ask 12137 for only a subset of the streams. 12139 D.4. Grouping of Media Lines in SDP 12141 For some types of media it is desirable to express a relationship 12142 between various media components, for instance, for lip 12143 synchronization or Scalable Video Codec (SVC) [RFC5583]. This 12144 relationship is expressed on the SDP level by grouping of media 12145 lines, as described in [RFC5888] and can be exposed to RTSP. 12147 For RTSP it is mainly important to know how to handle grouped medias 12148 received by means of SDP, i.e., if the media are under aggregate 12149 control (see Appendix D.3) or if aggregate control is not available 12150 (see Appendix D.2). 12152 It is RECOMMENDED that grouped medias are handled by aggregate 12153 control, to give the client the ability to control either the whole 12154 presentation or single medias. 12156 D.5. RTSP external SDP delivery 12158 There are some considerations that need to be made when the session 12159 description is delivered to the client outside of RTSP, for example 12160 via HTTP or email. 12162 First of all, the SDP needs to contain absolute URIs, since relative 12163 will in most cases not work as the delivery will not correctly 12164 forward the base URI. 12166 The writing of the SDP session availability information, i.e. "t=" 12167 and "r=", needs to be carefully considered. When the SDP is fetched 12168 by the DESCRIBE method, the probability that it is valid is very 12169 high. However, the same is much less certain for SDPs distributed 12170 using other methods. Therefore the publisher of the SDP should take 12171 care to follow the recommendations about availability in the SDP 12172 specification [RFC4566]. 12174 Appendix E. RTSP Use Cases 12176 This Appendix describes the most important and considered use cases 12177 for RTSP. They are listed in descending order of importance in 12178 regards to ensuring that all necessary functionality is present. 12179 This specification only fully supports usage of the two first. Also 12180 in these first two cases, there are special cases or exceptions that 12181 are not supported without extensions, e.g. the redirection of media 12182 delivery to another address than the controlling agent's (client's). 12184 E.1. On-demand Playback of Stored Content 12186 An RTSP capable server stores content suitable for being streamed to 12187 a client. A client desiring playback of any of the stored content 12188 uses RTSP to set up the media transport required to deliver the 12189 desired content. RTSP is then used to initiate, halt and manipulate 12190 the actual transmission (playout) of the content. RTSP is also 12191 required to provide necessary description and synchronization 12192 information for the content. 12194 The above high level description can be broken down into a number of 12195 functions that RTSP needs to be capable of. 12197 Presentation Description: Provide initialization information about 12198 the presentation (content); for example, which media codecs are 12199 needed for the content. Other information that is important 12200 includes the number of media streams the presentation contains, 12201 the transport protocols used for the media streams, and 12202 identifiers for these media streams. This information is 12203 required before setup of the content is possible and to 12204 determine if the client is even capable of using the content. 12206 This information need not be sent using RTSP; other external 12207 protocols can be used to transmit the transport presentation 12208 descriptions. Two good examples are the use of HTTP [RFC2616] 12209 or email to fetch or receive presentation descriptions like SDP 12210 [RFC4566] 12212 Setup: Set up some or all of the media streams in a presentation. 12213 The setup itself consists of selecting the protocol for media 12214 transport and the necessary parameters for the protocol, like 12215 addresses and ports. 12217 Control of Transmission: After the necessary media streams have been 12218 established the client can request the server to start 12219 transmitting the content. The client must be allowed to start 12220 or stop the transmission of the content at arbitrary times. 12221 The client must also be able to start the transmission at any 12222 point in the timeline of the presentation. 12224 Synchronization: For media transport protocols like RTP [RFC3550] it 12225 might be beneficial to carry synchronization information within 12226 RTSP. This may be due to either the lack of inter-media 12227 synchronization within the protocol itself, or the potential 12228 delay before the synchronization is established (which is the 12229 case for RTP when using RTCP). 12231 Termination: Terminate the established contexts. 12233 For this use case there are a number of assumptions about how it 12234 works. These are: 12236 On-Demand content: The content is stored at the server and can be 12237 accessed at any time during a time period when it is intended 12238 to be available. 12240 Independent sessions: A server is capable of serving a number of 12241 clients simultaneously, including from the same piece of 12242 content at different points in that presentations time-line. 12244 Unicast Transport: Content for each individual client is transmitted 12245 to them using unicast traffic. 12247 It is also possible to redirect the media traffic to a different 12248 destination than that of the agent controlling the traffic. However, 12249 allowing this without appropriate mechanisms for checking that the 12250 destination approves of this allows for distributed denial of service 12251 attacks (DDoS). 12253 E.2. Unicast Distribution of Live Content 12255 This use case is similar to the above on-demand content case (see 12256 Appendix E.1) the difference is the nature of the content itself. 12257 Live content is continuously distributed as it becomes available from 12258 a source; i.e., the main difference from on-demand is that one starts 12259 distributing content before the end of it has become available to the 12260 server. 12262 In many cases the consumer of live content is only interested in 12263 consuming what actually happens "now"; i.e., very similar to 12264 broadcast TV. However, in this case it is assumed that there exist 12265 no broadcast or multicast channel to the users, and instead the 12266 server functions as a distribution node, sending the same content to 12267 multiple receivers, using unicast traffic between server and client. 12268 This unicast traffic and the transport parameters are individually 12269 negotiated for each receiving client. 12271 Another aspect of live content is that it often has a very limited 12272 time of availability, as it is only available for the duration of the 12273 event the content covers. An example of such a live content could be 12274 a music concert which lasts 2 hour and starts at a predetermined 12275 time. Thus there is a need to announce when and for how long the 12276 live content is available. 12278 In some cases, the server providing live content may be saving some 12279 or all of the content to allow clients to pause the stream and resume 12280 it from the paused point, or to "rewind" and play continuously from a 12281 point earlier than the live point. Hence, this use case does not 12282 necessarily exclude playing from other than the live point of the 12283 stream, playing with scales other than 1.0, etc. 12285 E.3. On-demand Playback using Multicast 12287 It is possible to use RTSP to request that media be delivered to a 12288 multicast group. The entity setting up the session (the controller) 12289 will then control when and what media is delivered to the group. 12290 This use case has some potential for denial of service attacks by 12291 flooding a multicast group. Therefore, a mechanism is needed to 12292 indicate that the group actually accepts the traffic from the RTSP 12293 server. 12295 An open issue in this use case is how one ensures that all receivers 12296 listening to the multicast or broadcast receives the session 12297 presentation configuring the receivers. This specification has to 12298 rely on an external solution to solve this issue. 12300 E.4. Inviting an RTSP server into a conference 12302 If one has an established conference or group session, it is possible 12303 to have an RTSP server distribute media to the whole group. 12304 Transmission to the group is simplest when controlled by a single 12305 participant or leader of the conference. Shared control might be 12306 possible, but would require further investigation and possibly 12307 extensions. 12309 This use case assumes that there exists either multicast or a 12310 conference focus that redistribute media to all participants. 12312 This use case is intended to be able to handle the following 12313 scenario: A conference leader or participant (hereafter called the 12314 controller) has some pre-stored content on an RTSP server that he 12315 wants to share with the group. The controller sets up an RTSP 12316 session at the streaming server for this content and retrieves the 12317 session description for the content. The destination for the media 12318 content is set to the shared multicast group or conference focus. 12320 When desired by the controller, he/she can start and stop the 12321 transmission of the media to the conference group. 12323 There are several issues with this use case that are not solved by 12324 this core specification for RTSP: 12326 Denial of service: To avoid an RTSP server from being an unknowing 12327 participant in a denial of service attack the server needs to 12328 be able to verify the destination's acceptance of the media. 12329 Such a mechanism to verify the approval of received media does 12330 not yet exist; instead, only policies can be used, which can be 12331 made to work in controlled environments. 12333 Distributing the presentation description to all participants in the 12334 group: To enable a media receiver to correctly decode the content 12335 the media configuration information needs to be distributed 12336 reliably to all participants. This will most likely require 12337 support from an external protocol. 12339 Passing control of the session: If it is desired to pass control of 12340 the RTSP session between the participants, some support will be 12341 required by an external protocol to exchange state information 12342 and possibly floor control of who is controlling the RTSP 12343 session. 12345 E.5. Live Content using Multicast 12347 This use case in its simplest form does not require any use of RTSP 12348 at all; this is what multicast conferences being announced with SAP 12349 [RFC2974] and SDP are intended to handle. However, in use cases 12350 where more advanced features like access control to the multicast 12351 session are desired, RTSP could be used for session establishment. 12353 A client desiring to join a live multicasted media session with 12354 cryptographic (encryption) access control could use RTSP in the 12355 following way. The source of the session announces the session and 12356 gives all interested an RTSP URI. The client connects to the server 12357 and requests the presentation description, allowing configuration for 12358 reception of the media. In this step it is possible for the client 12359 to use secured transport and any desired level of authentication; for 12360 example, for billing or access control. An RTSP link also allows for 12361 load balancing between multiple servers. 12363 If these were the only goals, they could be achieved by simply using 12364 HTTP. However, for cases where the sender likes to keep track of 12365 each individual receiver of a session, and possibly use the session 12366 as a side channel for distributing key-updates or other information 12367 on a per-receiver basis, and the full set of receivers is not known 12368 prior to the session start, the state establishment that RTSP 12369 provides can be beneficial. In this case a client would establish an 12370 RTSP session for this multicast group with the RTSP server. The RTSP 12371 server will not transmit any media, but instead will point to the 12372 multicast group. The client and server will be able to keep the 12373 session alive for as long as the receiver participates in the session 12374 thus enabling, for example, the server to push updates to the client. 12376 This use case will most likely not be able to be implemented without 12377 some extensions to the server-to-client push mechanism. Here the 12378 PLAY_NOTIFY method (see Section 13.5) with a suitable extension could 12379 provide clear benefits. 12381 Appendix F. Text format for Parameters 12383 A resource of type "text/parameters" consists of either 1) a list of 12384 parameters (for a query) or 2) a list of parameters and associated 12385 values (for an response or setting of the parameter). Each entry of 12386 the list is a single line of text. Parameters are separated from 12387 values by a colon. The parameter name MUST only use US-ASCII visible 12388 characters while the values are UTF-8 text strings. The media type 12389 registration form is in Section 22.16. 12391 There is a potential interoperability issue for this format. It was 12392 named in RFC 2326 but never defined, even if used in examples that 12393 hint at the syntax. This format matches the purpose and its syntax 12394 supports the examples provided. However, it goes further by allowing 12395 UTF-8 in the value part, thus usage of UTF-8 strings may not be 12396 supported. However, as individual parameters are not defined, the 12397 using application anyway needs to have out-of-band agreement or using 12398 feature-tag to determine if the end-point supports the parameters. 12400 The ABNF [RFC5234] grammar for "text/parameters" content is: 12402 file = *((parameter / parameter-value) CRLF) 12403 parameter = 1*visible-except-colon 12404 parameter-value = parameter *WSP ":" value 12405 visible-except-colon = %x21-39 / %x3B-7E ; VCHAR - ":" 12406 value = *(TEXT-UTF8char / WSP) 12407 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 12408 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 12409 / %xE0-EF 2UTF8-CONT 12410 / %xF0-F7 3UTF8-CONT 12411 / %xF8-FB 4UTF8-CONT 12412 / %xFC-FD 5UTF8-CONT 12413 UTF8-CONT = %x80-BF 12414 WSP = ; Space or HTAB 12415 VCHAR = 12416 CRLF = 12418 Appendix G. Requirements for Unreliable Transport of RTSP 12420 This section provides anyone intending to define how to transport of 12421 RTSP messages over a unreliable transport protocol with some 12422 information learned by the attempt in RFC 2326 [RFC2326]. RFC 2326 12423 defined both an URI scheme and some basic functionality for transport 12424 of RTSP messages over UDP, however, it was not sufficient for 12425 reliable usage and successful interoperability. 12427 The RTSP scheme defined for unreliable transport of RTSP messages was 12428 "rtspu". It has been reserved by this specification as at least one 12429 commercial implementation exists, thus avoiding any collisions in the 12430 name space. 12432 The following considerations should exist for operation of RTSP over 12433 an unreliable transport protocol: 12435 o Request shall be acknowledged by the receiver. If there is no 12436 acknowledgement, the sender may resend the same message after a 12437 timeout of one round-trip time (RTT). Any retransmissions due to 12438 lack of acknowledgement must carry the same sequence number as the 12439 original request. 12441 o The round-trip time can be estimated as in TCP (RFC 1123) 12442 [RFC1123], with an initial round-trip value of 500 ms. An 12443 implementation may cache the last RTT measurement as the initial 12444 value for future connections. 12446 o If RTSP is used over a small-RTT LAN, standard procedures for 12447 optimizing initial TCP round trip estimates, such as those used in 12448 T/TCP (RFC 1644) [RFC1644], can be beneficial. 12450 o The Timestamp header (Section 16.51) is used to avoid the 12451 retransmission ambiguity problem [Stevens98]. 12453 o The registered default port for RTSP over UDP for the server is 12454 554. 12456 o RTSP messages can be carried over any lower-layer transport 12457 protocol that is 8-bit clean. 12459 o RTSP messages are vulnerable to bit errors and should not be 12460 subjected to them. 12462 o Source authentication, or at least validation that RTSP messages 12463 comes from the same entity becomes extremely important, as session 12464 hijacking may be substantially easier for RTSP message transport 12465 using an unreliable protocol like UDP than for TCP. 12467 There are two RTSP headers that are primarily intended for being used 12468 by the unreliable handling of RTSP messages and which will be 12469 maintained: 12471 o CSeq: See Section 16.19 12473 o Timestamp: See Section 16.51 12475 Appendix H. Backwards Compatibility Considerations 12477 This section contains notes on issues about backwards compatibility 12478 with clients or servers being implemented according to RFC 2326 12479 [RFC2326]. Note that there exists no requirement to implement RTSP 12480 1.0; in fact we recommend against it as it is difficult to do in an 12481 interoperable way. 12483 A server implementing RTSP/2.0 MUST include an RTSP-Version of 12484 RTSP/2.0 in all responses to requests containing RTSP-Version 12485 RTSP/2.0. If a server receives an RTSP/1.0 request, it MAY respond 12486 with an RTSP/1.0 response if it chooses to support RFC 2326. If the 12487 server chooses not to support RFC 2326, it MUST respond with a 505 12488 (RTSP Version not supported) status code. A server MUST NOT respond 12489 to an RTSP-Version RTSP/1.0 request with an RTSP-Version RTSP/2.0 12490 response. 12492 Clients implementing RTSP/2.0 MAY use an OPTIONS request with a RTSP- 12493 Version of 2.0 to determine whether a server supports RTSP/2.0. If 12494 the server responds with either an RTSP-Version of 1.0 or a status 12495 code of 505 (RTSP Version not supported), the client will have to use 12496 RTSP/1.0 requests if it chooses to support RFC 2326. 12498 H.1. Play Request in Play State 12500 The behavior in the server when a Play is received in Play state has 12501 changed (Section 13.4). In RFC 2326, the new PLAY request would be 12502 queued until the current Play completed. Any new PLAY request now 12503 takes effect immediately replacing the previous request. 12505 H.2. Using Persistent Connections 12507 Some server implementations of RFC 2326 maintain a one-to-one 12508 relationship between a connection and an RTSP session. Such 12509 implementations require clients to use a persistent connection to 12510 communicate with the server and when a client closes its connection, 12511 the server may remove the RTSP session. This is worth noting if a 12512 RTSP 2.0 client also supporting 1.0 connects to a 1.0 server. 12514 Appendix I. Changes 12516 This appendix briefly lists the differences between RTSP 1.0 12517 [RFC2326] and RTSP 2.0 for an informational purpose. For 12518 implementers of RTSP 2.0 it is recommended to read carefully through 12519 this memo and not to rely on the list of changes below to adapt from 12520 RTSP 1.0 to RTSP 2.0, as RTSP 2.0 is not intended to be backwards 12521 compatible with RTSP 1.0 [RFC2326] other than the version negotiation 12522 mechanism. 12524 I.1. Brief Overview 12526 The following protocol elements were removed in RTSP 2.0 compared to 12527 RTSP 1.0: 12529 o there is no section on minimal implementation anymore, but more 12530 the definition of RTSP 2.0 core; 12532 o the RECORD and ANNOUNCE methods and all related functionality 12533 (including 201 (Created) and 250 (Low On Storage Space) status 12534 codes); 12536 o the use of UDP for RTSP message transport was removed due to 12537 missing interest and to broken specification; 12539 o the use of PLAY method for keep-alive in Play state. 12541 The following protocol elements were added or changed in RTSP 2.0 12542 compared to RTSP 1.0: 12544 o RTSP session TEARDOWN from the server to the client; 12546 o IPv6 support; 12548 o extended IANA registries (e.g., transport headers parameters, 12549 transport-protocol, profile, lower-transport, and mode); 12551 o request pipelining for quick session start-up; 12553 o fully reworked state-machine; 12555 o RTSP messages now use URIs rather then URLs; 12557 o incorporated much of related HTTP text ([RFC2616]) in this memo, 12558 compared to just referencing the sections in HTTP, to avoid 12559 ambiguities; 12561 o the REDIRECT method was expanded and diversified for different 12562 situations; 12564 o Includes a new section about how to setup different media 12565 transport alternatives and their profiles, and lower layer 12566 protocols. This caused the appendix on RTP interaction to be 12567 moved there instead of being in the part which describes RTP. The 12568 section also includes guidelines what to consider when writing 12569 usage guidelines for new protocols and profiles; 12571 o Added an asynchronous notification method PLAY_NOTIFY. This 12572 method is used by the RTSP server to asynchronously notify clients 12573 about session changes while in Play state. To a limited extent 12574 this is comparable with some implementations of ANNOUNCE in RTSP 12575 1.0 not intended for Recording. 12577 I.2. Detailed List of Changes 12579 Compared to RTSP 1.0 (RFC 2326), the below changes has been made when 12580 defining RTSP 2.0. Note that this list does not reflect minor 12581 changes in wording or correction of typographical errors. 12583 o The section on minimal implementation was deleted without 12584 substitution. 12586 o The Transport header has been changed in the following way: 12588 * The ABNF has been changed to define that extensions are 12589 possible, and that unknown parameters result in that servers 12590 ignore the transport specification. 12592 * To prevent backwards compatibility issues, any extension or new 12593 parameter requires the usage of a feature-tag combined with the 12594 Require header. 12596 * Syntax unclarities with the Mode parameter has been resolved. 12598 * Syntax error with ";" for multicast and unicast has been 12599 resolved. 12601 * Two new addressing parameters has been defined, src_addr and 12602 dest_addr. These replaces the parameters "port", 12603 "client_port", "server_port", "destination", "source". 12605 * Support for IPv6 explicit addresses in all address fields has 12606 been included. 12608 * To handle URI definitions that contain ";" or "," a quoted URI 12609 format has been introduced and is required. 12611 * Defined IANA registries for the transport headers parameters, 12612 transport-protocol, profile, lower-transport, and mode. 12614 * The transport headers interleaved parameter's text was made 12615 more strict and uses formal requirements levels. It was also 12616 clarified that the interleaved channels are symmetric and that 12617 it is the server that sets the channel numbers. 12619 * It has been clarified that the client can't request of the 12620 server to use a certain RTP SSRC, using a request with the 12621 transport parameter SSRC. 12623 * Syntax definition for SSRC has been clarified to require 8HEX. 12624 It has also been extended to allow multiple values for clients 12625 supporting this version. 12627 * Clarified the text on the transport headers "dest_addr" 12628 parameters regarding what security precautions the server is 12629 required to perform. 12631 o The Range formats has been changed in the following way: 12633 * The NPT format has been given an initial NPT identifier that 12634 must now be used. 12636 * All formats now support initial open ended formats of type 12637 "npt=-10" and also format only "Range: smpte" ranges for usage 12638 with GET_PARAMETER requests. 12640 o RTSP message handling has been changed in the following way: 12642 * RTSP messages now use URIs rather then URLs. 12644 * It has been clarified that a 4xx message due to missing CSeq 12645 header shall be returned without a CSeq header. 12647 * The 300 (Multiple Choices) response code has been removed. 12649 * Rules for how to handle timing out RTSP messages has been 12650 added. 12652 * Extended Pipelining rules allowing for quick session startup. 12654 o The HTTP references have been updated to RFC 2616 and RFC 2617. 12655 Most of the text has been copied and then altered to fit RTSP into 12656 this specification. Public, and the Content-Base header has also 12657 been imported from RFC 2068 so that they are defined in the RTSP 12658 specification. Known effects on RTSP due to HTTP clarifications: 12660 * Content-Encoding header can include encoding of type 12661 "identity". 12663 o The state machine section has completely been rewritten. It 12664 includes now more details and is also more clear about the model 12665 used. 12667 o An IANA section has been included with contains a number of 12668 registries and their rules. This will allow us to use IANA to 12669 keep track of RTSP extensions. 12671 o The transport of RTSP messages has seen the following changes: 12673 * The use of UDP for RTSP message transport has been deprecated 12674 due to missing interest and to broken specification. 12676 * The rules for how TCP connections are to be handled has been 12677 clarified. Now it is made clear that servers should not close 12678 the TCP connection unless they have been unused for significant 12679 time. 12681 * Strong recommendations why server and clients should use 12682 persistent connections have also been added. 12684 * There is now a requirement on the servers to handle non- 12685 persistent connections as this provides fault tolerance. 12687 * Added wording on the usage of Connection:Close for RTSP. 12689 * specified usage of TLS for RTSP messages, including a scheme to 12690 approve a proxy's TLS connection to the next hop. 12692 o The following header related changes have been made: 12694 * Accept-Ranges response header is added. This header clarifies 12695 which range formats that can be used for a resource. 12697 * Fixed the missing definitions for the Cache-Control header. 12698 Also added to the syntax definition the missing delta-seconds 12699 for max-stale and min-fresh parameters. 12701 * Put requirement on CSeq header that the value is increased by 12702 one for each new RTSP request. A Recommendation to start at 0 12703 has also been added. 12705 * Added requirement that the Date header must be used for all 12706 messages with message body and the Server should always include 12707 it. 12709 * Removed possibility of using Range header with Scale header to 12710 indicate when it is to be activated, since it can't work as 12711 defined. Also added rule that lack of Scale header in response 12712 indicates lack of support for the header. Feature-tags for 12713 scaled playback has been defined. 12715 * The Speed header must now be responded to indicate support and 12716 the actual speed going to be used. A feature-tag is defined. 12717 Notes on congestion control were also added. 12719 * The Supported header was borrowed from SIP [RFC3261] to help 12720 with the feature negotiation in RTSP. 12722 * Clarified that the Timestamp header can be used to resolve 12723 retransmission ambiguities. 12725 * The Session header text has been expanded with an explanation 12726 on keep alive and which methods to use. SET_PARAMETER is now 12727 recommended to use if only keep-alive within RTSP is desired. 12729 * It has been clarified how the Range header formats are used to 12730 indicate pause points in the PAUSE response. 12732 * Clarified that RTP-Info URIs that are relative, use the 12733 Request-URI as base URI. Also clarified that the used URI must 12734 be the one that was used in the SETUP request. The URIs are 12735 now also required to be quoted. The header also expresses the 12736 SSRC for the provided RTP timestamp and sequence number values. 12738 * Added text that requires the Range to always be present in PLAY 12739 responses. Clarified what should be sent in case of live 12740 streams. 12742 * The headers table has been updated using a structure borrowed 12743 from SIP. Those tables carries much more information and 12744 should provide a good overview of the available headers. 12746 * It has been clarified that any message with a message body is 12747 required to have a Content-Length header. This was the case in 12748 RFC 2326, but could be misinterpreted. 12750 * ETag has changed name to MTag. 12752 * To resolve functionality around MTag. The MTag and If-None- 12753 Match header have been added from HTTP with necessary 12754 clarification in regards to RTSP operation. 12756 * Imported the Public header from HTTP RFC 2068 [RFC2068] since 12757 it has been removed from HTTP due to lack of use. Public is 12758 used quite frequently in RTSP. 12760 * Clarified rules for populating the Public header so that it is 12761 an intersection of the capabilities of all the RTSP agents in a 12762 chain. 12764 * Added the Media-Range header for listing the current 12765 availability of the media range. 12767 * Added the Notify-Reason header for giving the reason when 12768 sending PLAY_NOTIFY requests. 12770 * A new header Seek-Style has been defined to direct and inform 12771 how any seek operation should/have been performed. 12773 o The Protocol Syntax has been changed in the following way: 12775 * All ABNF definitions are updated according to the rules defined 12776 in RFC 5234 [RFC5234] and have been gathered in a separate 12777 Section 20. 12779 * The ABNF for the User-Agent and Server headers have been 12780 corrected. 12782 * Some definitions in the introduction regarding the RTSP session 12783 have been changed. 12785 * The protocol has been made fully IPv6 capable. 12787 * Added a fragment part to the RTSP URI. This seemed to be 12788 indicated by the note below the definition, however, it was not 12789 part of the ABNF. 12791 * The CHAR rule has been changed to exclude NULL. 12793 o The Status codes have been changed in the following way: 12795 * The use of status code 303 "See Other" has been deprecated as 12796 it does not make sense to use in RTSP. 12798 * When sending response 451 and 458 the response body should 12799 contain the offending parameters. 12801 * Clarification on when a 3rr redirect status code can be 12802 received has been added. This includes receiving 3rr as a 12803 result of a request within a established session. This 12804 provides clarification to a previous unspecified behavior. 12806 * Removed the 201 (Created) and 250 (Low On Storage Space) status 12807 codes as they are only relevant to recording, which is 12808 deprecated. 12810 * Several new Status codes have been defined: 464 "Data Transport 12811 Not Ready Yet", 465 "Notification Reason Unknown", 470 12812 "Connection Authorization Required", 471 "Connection 12813 Credentials not accepted", 472 "Failure to establish secure 12814 connection". 12816 o The following functionality has been deprecated from the protocol: 12818 * The use of Queued Play. 12820 * The use of PLAY method for keep-alive in Play state. 12822 * The RECORD and ANNOUNCE methods and all related functionality. 12823 Some of the syntax has been removed. 12825 * The possibility to use timed execution of methods with the time 12826 parameter in the Range header. 12828 * The description on how rtspu works is not part of the core 12829 specification and will require external description. Only that 12830 it exist is defined here and some requirements for the 12831 transport is provided. 12833 o The following changes have been made in relation to methods: 12835 * The OPTIONS method has been clarified with regards to the use 12836 of the Public and Allow headers. 12838 * Added text clarifying the usage of SET_PARAMETER for keep-alive 12839 and usage without any body. 12841 * PLAY method is now allowed to be pipelined with the pipelining 12842 of one or more SETUP requests following the initial that 12843 generates the session for aggregated control. 12845 * REDIRECT has been expanded and diversified for different 12846 situations. 12848 * Added a new method PLAY_NOTIFY. This method is used by the 12849 RTSP server to asynchronously notify clients about session 12850 changes. 12852 o Wrote a new section about how to setup different media transport 12853 alternatives and their profiles, and lower layer protocols. This 12854 caused the appendix on RTP interaction to be moved there instead 12855 of being in the part which describes RTP. The section also 12856 includes guidelines what to consider when writing usage guidelines 12857 for new protocols and profiles. 12859 o Setup and usage of independent TCP connections for transport of 12860 RTP has been specified. 12862 o Added a new section describing the available mechanisms to 12863 determine if functionality is supported, called "Capability 12864 Handling". Renamed option-tags to feature-tags. 12866 o Added a contributors section with people who have contributed 12867 actual text to the specification. 12869 o Added a section Use Cases that describes the major use cases for 12870 RTSP. 12872 o Clarified the usage of a=range and how to indicate live content 12873 that are not seekable with this header. 12875 o Text specifying the special behavior of PLAY for live content. 12877 Appendix J. Acknowledgements 12879 This memorandum defines RTSP version 2.0 which is a revision of the 12880 Proposed Standard RTSP version 1.0 which is defined in [RFC2326]. 12881 The authors of RFC 2326 are Henning Schulzrinne, Anup Rao, and Robert 12882 Lanphier. 12884 Both RTSP version 1.0 and RTSP version 2.0 borrow format and 12885 descriptions from HTTP/1.1. 12887 This document has benefited greatly from the comments of all those 12888 participating in the MMUSIC-WG. In addition to those already 12889 mentioned, the following individuals have contributed to this 12890 specification: 12892 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 12893 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 12894 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 12895 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 12896 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Ingemar Johansson, 12897 Anders Klemets, Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo 12898 F. Llach, Thomas Marshall, Rob McCool, David Oran, Joerg Ott, Maria 12899 Papadopouli, Sujal Patel, Ema Patki, Alagu Periyannan, Colin Perkins, 12900 Igor Plotnikov, Jonathan Sergent, Pinaki Shah, David Singer, Lior 12901 Sion, Jeff Smith, Alexander Sokolsky, Dale Stammen, John Francis 12902 Stracke, Maureen Chesire, David Walker, Geetha Srikantan, Stephan 12903 Wenger, Pekka Pessi, Jae-Hwan Kim, Holger Schmidt, Stephen Farrell, 12904 Xavier Marjou, Joe Pallas, Martti Mela, Byungjo Yoon and Patrick 12905 Hoffman, Jinhang Choi, Ross Finlayson, and especially to Flemming 12906 Andreasen. 12908 J.1. Contributors 12910 The following people have made written contributions that were 12911 included in the specification: 12913 o Tom Marshall contributed text on the usage of 3rr status codes. 12915 o Thomas Zheng contributed text on the usage of the Range in PLAY 12916 responses and proposed an earlier version of the PLAY_NOTIFY 12917 method. 12919 o Sean Sheedy contributed text on the timeout behavior of RTSP 12920 messages and connections, the 463 status code, and proposed an 12921 earlier version of the PLAY_NOTIFY method. 12923 o Greg Sherwood proposed an earlier version of the PLAY_NOTIFY 12924 method. 12926 o Fredrik Lindholm contributed text about the RTSP security 12927 framework. 12929 o John Lazzaro contributed the text for RTP over Independent TCP. 12931 o Aravind Narasimhan contributed by rewriting Media Transport 12932 Alternatives (Appendix C) and editorial improvements on a number 12933 of places in the specification. 12935 o Torbjorn Einarsson has done some editorial improvements of the 12936 text. 12938 Appendix K. RFC Editor Consideration 12940 Please replace RFC XXXX with the RFC number this specification 12941 receives. 12943 Authors' Addresses 12945 Henning Schulzrinne 12946 Columbia University 12947 1214 Amsterdam Avenue 12948 New York, NY 10027 12949 USA 12951 Email: schulzrinne@cs.columbia.edu 12953 Anup Rao 12954 Cisco 12955 USA 12957 Email: anrao@cisco.com 12959 Rob Lanphier 12960 Seattle, WA 12961 USA 12963 Email: robla@robla.net 12965 Magnus Westerlund 12966 Ericsson AB 12967 Faeroegatan 6 12968 STOCKHOLM, SE-164 80 12969 SWEDEN 12971 Email: magnus.westerlund@ericsson.com 12973 Martin Stiemerling 12974 NEC Laboratories Europe, NEC Europe Ltd. 12975 Kurfuersten-Anlage 36 12976 Heidelberg 69115 12977 Germany 12979 Phone: +49 (0) 6221 4342 113 12980 Email: martin.stiemerling@neclab.eu 12981 URI: http://ietf.stiemerling.org