idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-26.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 use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (November 17, 2010) is 4909 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 4165, but not defined == Missing Reference: 'H15' is mentioned on line 8757, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 9194, 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-09 -- 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 (~~), 7 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: May 21, 2011 R. Lanphier 7 M. Westerlund 8 Ericsson AB 9 M. Stiemerling (Ed.) 10 NEC 11 November 17, 2010 13 Real Time Streaming Protocol 2.0 (RTSP) 14 draft-ietf-mmusic-rfc2326bis-26 16 Abstract 18 This memorandum defines RTSP version 2.0 which obsoletes RTSP version 19 1.0 which is defined in RFC 2326. 21 The Real Time Streaming Protocol, or RTSP, is an application-level 22 protocol for setup and control of the delivery of data with real-time 23 properties. RTSP provides an extensible framework to enable 24 controlled, on-demand delivery of real-time data, such as audio and 25 video. Sources of data can include both live data feeds and stored 26 clips. This protocol is intended to control multiple data delivery 27 sessions, provide a means for choosing delivery channels such as UDP, 28 multicast UDP and TCP, and provide a means for choosing delivery 29 mechanisms based upon RTP (RFC 3550). 31 Status of this Memo 33 This Internet-Draft is submitted in full conformance with the 34 provisions of BCP 78 and BCP 79. 36 Internet-Drafts are working documents of the Internet Engineering 37 Task Force (IETF). Note that other groups may also distribute 38 working documents as Internet-Drafts. The list of current Internet- 39 Drafts is at http://datatracker.ietf.org/drafts/current/. 41 Internet-Drafts are draft documents valid for a maximum of six months 42 and may be updated, replaced, or obsoleted by other documents at any 43 time. It is inappropriate to use Internet-Drafts as reference 44 material or to cite them other than as "work in progress." 46 This Internet-Draft will expire on May 21, 2011. 48 Copyright Notice 50 Copyright (c) 2010 IETF Trust and the persons identified as the 51 document authors. All rights reserved. 53 This document is subject to BCP 78 and the IETF Trust's Legal 54 Provisions Relating to IETF Documents 55 (http://trustee.ietf.org/license-info) in effect on the date of 56 publication of this document. Please review these documents 57 carefully, as they describe your rights and restrictions with respect 58 to this document. Code Components extracted from this document must 59 include Simplified BSD License text as described in Section 4.e of 60 the Trust Legal Provisions and are provided without warranty as 61 described in the Simplified BSD License. 63 This document may contain material from IETF Documents or IETF 64 Contributions published or made publicly available before November 65 10, 2008. The person(s) controlling the copyright in some of this 66 material may not have granted the IETF Trust the right to allow 67 modifications of such material outside the IETF Standards Process. 68 Without obtaining an adequate license from the person(s) controlling 69 the copyright in such materials, this document may not be modified 70 outside the IETF Standards Process, and derivative works of it may 71 not be created outside the IETF Standards Process, except to format 72 it for publication as an RFC or to translate it into languages other 73 than English. 75 Table of Contents 77 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 11 78 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 13 79 2.1. Presentation Description . . . . . . . . . . . . . . . . 13 80 2.2. Session Establishment . . . . . . . . . . . . . . . . . 14 81 2.3. Media Delivery Control . . . . . . . . . . . . . . . . . 15 82 2.4. Session Parameter Manipulations . . . . . . . . . . . . 17 83 2.5. Media Delivery . . . . . . . . . . . . . . . . . . . . . 17 84 2.5.1. Media Delivery Manipulations . . . . . . . . . . . . 18 85 2.6. Session Maintenance and Termination . . . . . . . . . . 20 86 2.7. Extending RTSP . . . . . . . . . . . . . . . . . . . . . 21 87 3. Document Conventions . . . . . . . . . . . . . . . . . . . . 23 88 3.1. Notational Conventions . . . . . . . . . . . . . . . . . 23 89 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . 23 90 4. Protocol Parameters . . . . . . . . . . . . . . . . . . . . . 27 91 4.1. RTSP Version . . . . . . . . . . . . . . . . . . . . . . 27 92 4.2. RTSP IRI and URI . . . . . . . . . . . . . . . . . . . . 27 93 4.3. Session Identifiers . . . . . . . . . . . . . . . . . . 29 94 4.4. SMPTE Relative Timestamps . . . . . . . . . . . . . . . 29 95 4.5. Normal Play Time . . . . . . . . . . . . . . . . . . . . 30 96 4.6. Absolute Time . . . . . . . . . . . . . . . . . . . . . 31 97 4.7. Feature-Tags . . . . . . . . . . . . . . . . . . . . . . 31 98 4.8. Message Body Tags . . . . . . . . . . . . . . . . . . . 31 99 4.9. Media Properties . . . . . . . . . . . . . . . . . . . . 32 100 4.9.1. Random Access and Seeking . . . . . . . . . . . . . 33 101 4.9.2. Retention . . . . . . . . . . . . . . . . . . . . . 33 102 4.9.3. Content Modifications . . . . . . . . . . . . . . . 34 103 4.9.4. Supported Scale Factors . . . . . . . . . . . . . . 34 104 4.9.5. Mapping to the Attributes . . . . . . . . . . . . . 34 105 5. RTSP Message . . . . . . . . . . . . . . . . . . . . . . . . 35 106 5.1. Message Types . . . . . . . . . . . . . . . . . . . . . 35 107 5.2. Message Headers . . . . . . . . . . . . . . . . . . . . 35 108 5.3. Message Body . . . . . . . . . . . . . . . . . . . . . . 36 109 5.4. Message Length . . . . . . . . . . . . . . . . . . . . . 36 110 6. General Header Fields . . . . . . . . . . . . . . . . . . . . 38 111 7. Request . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 112 7.1. Request Line . . . . . . . . . . . . . . . . . . . . . . 39 113 7.2. Request Header Fields . . . . . . . . . . . . . . . . . 41 114 8. Response . . . . . . . . . . . . . . . . . . . . . . . . . . 43 115 8.1. Status-Line . . . . . . . . . . . . . . . . . . . . . . 43 116 8.1.1. Status Code and Reason Phrase . . . . . . . . . . . 43 117 8.2. Response Headers . . . . . . . . . . . . . . . . . . . . 46 118 9. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 48 119 9.1. Message-Body Header Fields . . . . . . . . . . . . . . . 48 120 9.2. Message Body . . . . . . . . . . . . . . . . . . . . . . 49 121 10. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 50 122 10.1. Reliability and Acknowledgements . . . . . . . . . . . . 50 123 10.2. Using Connections . . . . . . . . . . . . . . . . . . . 51 124 10.3. Closing Connections . . . . . . . . . . . . . . . . . . 53 125 10.4. Timing Out Connections and RTSP Messages . . . . . . . . 54 126 10.5. Showing Liveness . . . . . . . . . . . . . . . . . . . . 55 127 10.6. Use of IPv6 . . . . . . . . . . . . . . . . . . . . . . 56 128 10.7. Overload Control . . . . . . . . . . . . . . . . . . . . 56 129 11. Capability Handling . . . . . . . . . . . . . . . . . . . . . 58 130 12. Pipelining Support . . . . . . . . . . . . . . . . . . . . . 60 131 13. Method Definitions . . . . . . . . . . . . . . . . . . . . . 61 132 13.1. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . 62 133 13.2. DESCRIBE . . . . . . . . . . . . . . . . . . . . . . . . 63 134 13.3. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . 65 135 13.3.1. Changing Transport Parameters . . . . . . . . . . . 68 136 13.4. PLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 69 137 13.4.1. General Usage . . . . . . . . . . . . . . . . . . . 69 138 13.4.2. Aggregated Sessions . . . . . . . . . . . . . . . . 73 139 13.4.3. Updating current PLAY Requests . . . . . . . . . . . 74 140 13.4.4. Playing On-Demand Media . . . . . . . . . . . . . . 77 141 13.4.5. Playing Dynamic On-Demand Media . . . . . . . . . . 77 142 13.4.6. Playing Live Media . . . . . . . . . . . . . . . . . 77 143 13.4.7. Playing Live with Recording . . . . . . . . . . . . 78 144 13.4.8. Playing Live with Time-Shift . . . . . . . . . . . . 79 145 13.5. PLAY_NOTIFY . . . . . . . . . . . . . . . . . . . . . . 79 146 13.5.1. End-of-Stream . . . . . . . . . . . . . . . . . . . 80 147 13.5.2. Media-Properties-Update . . . . . . . . . . . . . . 81 148 13.5.3. Scale-Change . . . . . . . . . . . . . . . . . . . . 82 149 13.6. PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 84 150 13.7. TEARDOWN . . . . . . . . . . . . . . . . . . . . . . . . 86 151 13.7.1. Client to Server . . . . . . . . . . . . . . . . . . 86 152 13.7.2. Server to Client . . . . . . . . . . . . . . . . . . 87 153 13.8. GET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 88 154 13.9. SET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 89 155 13.10. REDIRECT . . . . . . . . . . . . . . . . . . . . . . . . 91 156 14. Embedded (Interleaved) Binary Data . . . . . . . . . . . . . 94 157 15. Status Code Definitions . . . . . . . . . . . . . . . . . . . 96 158 15.1. Success 1xx . . . . . . . . . . . . . . . . . . . . . . 96 159 15.1.1. 100 Continue . . . . . . . . . . . . . . . . . . . . 96 160 15.2. Success 2xx . . . . . . . . . . . . . . . . . . . . . . 96 161 15.2.1. 200 OK . . . . . . . . . . . . . . . . . . . . . . . 96 162 15.3. Redirection 3xx . . . . . . . . . . . . . . . . . . . . 96 163 15.3.1. 301 Moved Permanently . . . . . . . . . . . . . . . 97 164 15.3.2. 302 Found . . . . . . . . . . . . . . . . . . . . . 97 165 15.3.3. 303 See Other . . . . . . . . . . . . . . . . . . . 97 166 15.3.4. 304 Not Modified . . . . . . . . . . . . . . . . . . 97 167 15.3.5. 305 Use Proxy . . . . . . . . . . . . . . . . . . . 98 168 15.4. Client Error 4xx . . . . . . . . . . . . . . . . . . . . 98 169 15.4.1. 400 Bad Request . . . . . . . . . . . . . . . . . . 98 170 15.4.2. 401 Unauthorized . . . . . . . . . . . . . . . . . . 98 171 15.4.3. 402 Payment Required . . . . . . . . . . . . . . . . 99 172 15.4.4. 403 Forbidden . . . . . . . . . . . . . . . . . . . 99 173 15.4.5. 404 Not Found . . . . . . . . . . . . . . . . . . . 99 174 15.4.6. 405 Method Not Allowed . . . . . . . . . . . . . . . 99 175 15.4.7. 406 Not Acceptable . . . . . . . . . . . . . . . . . 99 176 15.4.8. 407 Proxy Authentication Required . . . . . . . . . 100 177 15.4.9. 408 Request Timeout . . . . . . . . . . . . . . . . 100 178 15.4.10. 410 Gone . . . . . . . . . . . . . . . . . . . . . . 100 179 15.4.11. 411 Length Required . . . . . . . . . . . . . . . . 100 180 15.4.12. 412 Precondition Failed . . . . . . . . . . . . . . 101 181 15.4.13. 413 Request Message Body Too Large . . . . . . . . . 101 182 15.4.14. 414 Request-URI Too Long . . . . . . . . . . . . . . 101 183 15.4.15. 415 Unsupported Media Type . . . . . . . . . . . . . 101 184 15.4.16. 451 Parameter Not Understood . . . . . . . . . . . . 101 185 15.4.17. 452 reserved . . . . . . . . . . . . . . . . . . . . 101 186 15.4.18. 453 Not Enough Bandwidth . . . . . . . . . . . . . . 102 187 15.4.19. 454 Session Not Found . . . . . . . . . . . . . . . 102 188 15.4.20. 455 Method Not Valid in This State . . . . . . . . . 102 189 15.4.21. 456 Header Field Not Valid for Resource . . . . . . 102 190 15.4.22. 457 Invalid Range . . . . . . . . . . . . . . . . . 102 191 15.4.23. 458 Parameter Is Read-Only . . . . . . . . . . . . . 102 192 15.4.24. 459 Aggregate Operation Not Allowed . . . . . . . . 102 193 15.4.25. 460 Only Aggregate Operation Allowed . . . . . . . . 102 194 15.4.26. 461 Unsupported Transport . . . . . . . . . . . . . 103 195 15.4.27. 462 Destination Unreachable . . . . . . . . . . . . 103 196 15.4.28. 463 Destination Prohibited . . . . . . . . . . . . . 103 197 15.4.29. 464 Data Transport Not Ready Yet . . . . . . . . . . 103 198 15.4.30. 465 Notification Reason Unknown . . . . . . . . . . 103 199 15.4.31. 466 Key Management Error . . . . . . . . . . . . . . 103 200 15.4.32. 470 Connection Authorization Required . . . . . . . 104 201 15.4.33. 471 Connection Credentials not accepted . . . . . . 104 202 15.4.34. 472 Failure to establish secure connection . . . . . 104 203 15.5. Server Error 5xx . . . . . . . . . . . . . . . . . . . . 104 204 15.5.1. 500 Internal Server Error . . . . . . . . . . . . . 104 205 15.5.2. 501 Not Implemented . . . . . . . . . . . . . . . . 104 206 15.5.3. 502 Bad Gateway . . . . . . . . . . . . . . . . . . 104 207 15.5.4. 503 Service Unavailable . . . . . . . . . . . . . . 105 208 15.5.5. 504 Gateway Timeout . . . . . . . . . . . . . . . . 105 209 15.5.6. 505 RTSP Version Not Supported . . . . . . . . . . . 105 210 15.5.7. 551 Option not supported . . . . . . . . . . . . . . 105 211 16. Header Field Definitions . . . . . . . . . . . . . . . . . . 106 212 16.1. Accept . . . . . . . . . . . . . . . . . . . . . . . . . 116 213 16.2. Accept-Credentials . . . . . . . . . . . . . . . . . . . 116 214 16.3. Accept-Encoding . . . . . . . . . . . . . . . . . . . . 117 215 16.4. Accept-Language . . . . . . . . . . . . . . . . . . . . 118 216 16.5. Accept-Ranges . . . . . . . . . . . . . . . . . . . . . 119 217 16.6. Allow . . . . . . . . . . . . . . . . . . . . . . . . . 119 218 16.7. Authorization . . . . . . . . . . . . . . . . . . . . . 119 219 16.8. Bandwidth . . . . . . . . . . . . . . . . . . . . . . . 120 220 16.9. Blocksize . . . . . . . . . . . . . . . . . . . . . . . 121 221 16.10. Cache-Control . . . . . . . . . . . . . . . . . . . . . 121 222 16.11. Connection . . . . . . . . . . . . . . . . . . . . . . . 123 223 16.12. Connection-Credentials . . . . . . . . . . . . . . . . . 124 224 16.13. Content-Base . . . . . . . . . . . . . . . . . . . . . . 125 225 16.14. Content-Encoding . . . . . . . . . . . . . . . . . . . . 125 226 16.15. Content-Language . . . . . . . . . . . . . . . . . . . . 126 227 16.16. Content-Length . . . . . . . . . . . . . . . . . . . . . 127 228 16.17. Content-Location . . . . . . . . . . . . . . . . . . . . 127 229 16.18. Content-Type . . . . . . . . . . . . . . . . . . . . . . 128 230 16.19. CSeq . . . . . . . . . . . . . . . . . . . . . . . . . . 128 231 16.20. Date . . . . . . . . . . . . . . . . . . . . . . . . . . 129 232 16.21. Expires . . . . . . . . . . . . . . . . . . . . . . . . 130 233 16.22. From . . . . . . . . . . . . . . . . . . . . . . . . . . 130 234 16.23. If-Match . . . . . . . . . . . . . . . . . . . . . . . . 131 235 16.24. If-Modified-Since . . . . . . . . . . . . . . . . . . . 131 236 16.25. If-None-Match . . . . . . . . . . . . . . . . . . . . . 132 237 16.26. Last-Modified . . . . . . . . . . . . . . . . . . . . . 132 238 16.27. Location . . . . . . . . . . . . . . . . . . . . . . . . 133 239 16.28. Media-Properties . . . . . . . . . . . . . . . . . . . . 133 240 16.29. Media-Range . . . . . . . . . . . . . . . . . . . . . . 135 241 16.30. MTag . . . . . . . . . . . . . . . . . . . . . . . . . . 136 242 16.31. Notify-Reason . . . . . . . . . . . . . . . . . . . . . 136 243 16.32. Pipelined-Requests . . . . . . . . . . . . . . . . . . . 136 244 16.33. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . 137 245 16.34. Proxy-Authorization . . . . . . . . . . . . . . . . . . 138 246 16.35. Proxy-Require . . . . . . . . . . . . . . . . . . . . . 138 247 16.36. Proxy-Supported . . . . . . . . . . . . . . . . . . . . 139 248 16.37. Public . . . . . . . . . . . . . . . . . . . . . . . . . 139 249 16.38. Range . . . . . . . . . . . . . . . . . . . . . . . . . 140 250 16.39. Referrer . . . . . . . . . . . . . . . . . . . . . . . . 142 251 16.40. Request-Status . . . . . . . . . . . . . . . . . . . . . 142 252 16.41. Require . . . . . . . . . . . . . . . . . . . . . . . . 143 253 16.42. Retry-After . . . . . . . . . . . . . . . . . . . . . . 144 254 16.43. RTP-Info . . . . . . . . . . . . . . . . . . . . . . . . 144 255 16.44. Scale . . . . . . . . . . . . . . . . . . . . . . . . . 146 256 16.45. Seek-Style . . . . . . . . . . . . . . . . . . . . . . . 147 257 16.46. Server . . . . . . . . . . . . . . . . . . . . . . . . . 149 258 16.47. Session . . . . . . . . . . . . . . . . . . . . . . . . 149 259 16.48. Speed . . . . . . . . . . . . . . . . . . . . . . . . . 150 260 16.49. Supported . . . . . . . . . . . . . . . . . . . . . . . 151 261 16.50. Terminate-Reason . . . . . . . . . . . . . . . . . . . . 152 262 16.51. Timestamp . . . . . . . . . . . . . . . . . . . . . . . 152 263 16.52. Transport . . . . . . . . . . . . . . . . . . . . . . . 153 264 16.53. Unsupported . . . . . . . . . . . . . . . . . . . . . . 160 265 16.54. User-Agent . . . . . . . . . . . . . . . . . . . . . . . 160 266 16.55. Vary . . . . . . . . . . . . . . . . . . . . . . . . . . 160 267 16.56. Via . . . . . . . . . . . . . . . . . . . . . . . . . . 161 268 16.57. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . 162 269 17. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 270 17.1. Proxies and Protocol Extensions . . . . . . . . . . . . 164 271 17.2. Multiplexing and Demultiplexing of Messages . . . . . . 165 272 18. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 273 18.1. Validation Model . . . . . . . . . . . . . . . . . . . . 166 274 18.1.1. Last-Modified Dates . . . . . . . . . . . . . . . . 168 275 18.1.2. Message Body Tag Cache Validators . . . . . . . . . 168 276 18.1.3. Weak and Strong Validators . . . . . . . . . . . . . 168 277 18.1.4. Rules for When to Use Message Body Tags and 278 Last-Modified Dates . . . . . . . . . . . . . . . . 170 279 18.1.5. Non-validating Conditionals . . . . . . . . . . . . 172 280 18.2. Invalidation After Updates or Deletions . . . . . . . . 172 281 19. Security Framework . . . . . . . . . . . . . . . . . . . . . 174 282 19.1. RTSP and HTTP Authentication . . . . . . . . . . . . . . 174 283 19.2. RTSP over TLS . . . . . . . . . . . . . . . . . . . . . 174 284 19.3. Security and Proxies . . . . . . . . . . . . . . . . . . 175 285 19.3.1. Accept-Credentials . . . . . . . . . . . . . . . . . 176 286 19.3.2. User approved TLS procedure . . . . . . . . . . . . 177 287 20. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 288 20.1. Base Syntax . . . . . . . . . . . . . . . . . . . . . . 180 289 20.2. RTSP Protocol Definition . . . . . . . . . . . . . . . . 182 290 20.2.1. Generic Protocol elements . . . . . . . . . . . . . 182 291 20.2.2. Message Syntax . . . . . . . . . . . . . . . . . . . 185 292 20.2.3. Header Syntax . . . . . . . . . . . . . . . . . . . 189 293 20.3. SDP extension Syntax . . . . . . . . . . . . . . . . . . 198 294 21. Security Considerations . . . . . . . . . . . . . . . . . . . 199 295 21.1. Remote denial of Service Attack . . . . . . . . . . . . 201 296 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 203 297 22.1. Feature-tags . . . . . . . . . . . . . . . . . . . . . . 203 298 22.1.1. Description . . . . . . . . . . . . . . . . . . . . 203 299 22.1.2. Registering New Feature-tags with IANA . . . . . . . 204 300 22.1.3. Registered entries . . . . . . . . . . . . . . . . . 204 301 22.2. RTSP Methods . . . . . . . . . . . . . . . . . . . . . . 204 302 22.2.1. Description . . . . . . . . . . . . . . . . . . . . 204 303 22.2.2. Registering New Methods with IANA . . . . . . . . . 205 304 22.2.3. Registered Entries . . . . . . . . . . . . . . . . . 205 305 22.3. RTSP Status Codes . . . . . . . . . . . . . . . . . . . 205 306 22.3.1. Description . . . . . . . . . . . . . . . . . . . . 205 307 22.3.2. Registering New Status Codes with IANA . . . . . . . 206 308 22.3.3. Registered Entries . . . . . . . . . . . . . . . . . 206 309 22.4. RTSP Headers . . . . . . . . . . . . . . . . . . . . . . 206 310 22.4.1. Description . . . . . . . . . . . . . . . . . . . . 206 311 22.4.2. Registering New Headers with IANA . . . . . . . . . 206 312 22.4.3. Registered entries . . . . . . . . . . . . . . . . . 207 313 22.5. Accept-Credentials . . . . . . . . . . . . . . . . . . . 207 314 22.5.1. Accept-Credentials policies . . . . . . . . . . . . 207 315 22.5.2. Accept-Credentials hash algorithms . . . . . . . . . 208 316 22.6. Cache-Control Cache Directive Extensions . . . . . . . . 208 317 22.7. Media Properties . . . . . . . . . . . . . . . . . . . . 209 318 22.7.1. Description . . . . . . . . . . . . . . . . . . . . 209 319 22.7.2. Registration Rules . . . . . . . . . . . . . . . . . 209 320 22.7.3. Registered Values . . . . . . . . . . . . . . . . . 210 321 22.8. Notify-Reason header . . . . . . . . . . . . . . . . . . 210 322 22.8.1. Description . . . . . . . . . . . . . . . . . . . . 210 323 22.8.2. Registration Rules . . . . . . . . . . . . . . . . . 210 324 22.8.3. Registered Values . . . . . . . . . . . . . . . . . 211 325 22.9. Range header formats . . . . . . . . . . . . . . . . . . 211 326 22.9.1. Description . . . . . . . . . . . . . . . . . . . . 211 327 22.9.2. Registration Rules . . . . . . . . . . . . . . . . . 211 328 22.9.3. Registered Values . . . . . . . . . . . . . . . . . 211 329 22.10. Terminate-Reason Header . . . . . . . . . . . . . . . . 212 330 22.10.1. Redirect Reasons . . . . . . . . . . . . . . . . . . 212 331 22.10.2. Terminate-Reason Header Parameters . . . . . . . . . 212 332 22.11. RTP-Info header parameters . . . . . . . . . . . . . . . 212 333 22.11.1. Description . . . . . . . . . . . . . . . . . . . . 212 334 22.11.2. Registration Rules . . . . . . . . . . . . . . . . . 213 335 22.11.3. Registered Values . . . . . . . . . . . . . . . . . 213 336 22.12. Seek-Style Policies . . . . . . . . . . . . . . . . . . 213 337 22.12.1. Description . . . . . . . . . . . . . . . . . . . . 213 338 22.12.2. Registration Rules . . . . . . . . . . . . . . . . . 213 339 22.12.3. Registered Values . . . . . . . . . . . . . . . . . 214 340 22.13. Transport Header Registries . . . . . . . . . . . . . . 214 341 22.13.1. Transport Protocol Specification . . . . . . . . . . 214 342 22.13.2. Transport modes . . . . . . . . . . . . . . . . . . 215 343 22.13.3. Transport Parameters . . . . . . . . . . . . . . . . 216 344 22.14. URI Schemes . . . . . . . . . . . . . . . . . . . . . . 216 345 22.14.1. The rtsp URI Scheme . . . . . . . . . . . . . . . . 216 346 22.14.2. The rtsps URI Scheme . . . . . . . . . . . . . . . . 217 347 22.14.3. The rtspu URI Scheme . . . . . . . . . . . . . . . . 218 348 22.15. SDP attributes . . . . . . . . . . . . . . . . . . . . . 219 349 22.16. Media Type Registration for text/parameters . . . . . . 220 350 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 222 351 23.1. Normative References . . . . . . . . . . . . . . . . . . 222 352 23.2. Informative References . . . . . . . . . . . . . . . . . 224 353 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 227 354 A.1. Media on Demand (Unicast) . . . . . . . . . . . . . . . 227 355 A.2. Media on Demand using Pipelining . . . . . . . . . . . . 231 356 A.3. Media on Demand (Unicast) . . . . . . . . . . . . . . . 233 357 A.4. Single Stream Container Files . . . . . . . . . . . . . 237 358 A.5. Live Media Presentation Using Multicast . . . . . . . . 239 359 A.6. Capability Negotiation . . . . . . . . . . . . . . . . . 240 360 Appendix B. RTSP Protocol State Machine . . . . . . . . . . . . 242 361 B.1. States . . . . . . . . . . . . . . . . . . . . . . . . . 242 362 B.2. State variables . . . . . . . . . . . . . . . . . . . . 242 363 B.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . 242 364 B.4. State Tables . . . . . . . . . . . . . . . . . . . . . . 243 365 Appendix C. Media Transport Alternatives . . . . . . . . . . . . 249 366 C.1. RTP . . . . . . . . . . . . . . . . . . . . . . . . . . 249 367 C.1.1. AVP . . . . . . . . . . . . . . . . . . . . . . . . 249 368 C.1.2. AVP/UDP . . . . . . . . . . . . . . . . . . . . . . 249 369 C.1.3. AVPF/UDP . . . . . . . . . . . . . . . . . . . . . . 250 370 C.1.4. SAVP/UDP . . . . . . . . . . . . . . . . . . . . . . 251 371 C.1.5. SAVPF/UDP . . . . . . . . . . . . . . . . . . . . . 253 372 C.1.6. RTCP usage with RTSP . . . . . . . . . . . . . . . . 253 373 C.2. RTP over TCP . . . . . . . . . . . . . . . . . . . . . . 255 374 C.2.1. Interleaved RTP over TCP . . . . . . . . . . . . . . 255 375 C.2.2. RTP over independent TCP . . . . . . . . . . . . . . 255 376 C.3. Handling Media Clock Time Jumps in the RTP Media Layer . 259 377 C.4. Handling RTP Timestamps after PAUSE . . . . . . . . . . 263 378 C.5. RTSP / RTP Integration . . . . . . . . . . . . . . . . . 265 379 C.6. Scaling with RTP . . . . . . . . . . . . . . . . . . . . 265 380 C.7. Maintaining NPT synchronization with RTP timestamps . . 265 381 C.8. Continuous Audio . . . . . . . . . . . . . . . . . . . . 265 382 C.9. Multiple Sources in an RTP Session . . . . . . . . . . . 265 383 C.10. Usage of SSRCs and the RTCP BYE Message During an 384 RTSP Session . . . . . . . . . . . . . . . . . . . . . . 265 385 C.11. Future Additions . . . . . . . . . . . . . . . . . . . . 266 386 Appendix D. Use of SDP for RTSP Session Descriptions . . . . . . 267 387 D.1. Definitions . . . . . . . . . . . . . . . . . . . . . . 267 388 D.1.1. Control URI . . . . . . . . . . . . . . . . . . . . 267 389 D.1.2. Media Streams . . . . . . . . . . . . . . . . . . . 268 390 D.1.3. Payload Type(s) . . . . . . . . . . . . . . . . . . 269 391 D.1.4. Format-Specific Parameters . . . . . . . . . . . . . 269 392 D.1.5. Directionality of media stream . . . . . . . . . . . 269 393 D.1.6. Range of Presentation . . . . . . . . . . . . . . . 270 394 D.1.7. Time of Availability . . . . . . . . . . . . . . . . 271 395 D.1.8. Connection Information . . . . . . . . . . . . . . . 271 396 D.1.9. Message Body Tag . . . . . . . . . . . . . . . . . . 271 397 D.2. Aggregate Control Not Available . . . . . . . . . . . . 272 398 D.3. Aggregate Control Available . . . . . . . . . . . . . . 272 399 D.4. Grouping of Media Lines in SDP . . . . . . . . . . . . . 273 400 D.5. RTSP external SDP delivery . . . . . . . . . . . . . . . 274 401 Appendix E. RTSP Use Cases . . . . . . . . . . . . . . . . . . . 275 402 E.1. On-demand Playback of Stored Content . . . . . . . . . . 275 403 E.2. Unicast Distribution of Live Content . . . . . . . . . . 276 404 E.3. On-demand Playback using Multicast . . . . . . . . . . . 277 405 E.4. Inviting an RTSP server into a conference . . . . . . . 277 406 E.5. Live Content using Multicast . . . . . . . . . . . . . . 278 407 Appendix F. Text format for Parameters . . . . . . . . . . . . . 280 408 Appendix G. Requirements for Unreliable Transport of RTSP . . . 281 409 Appendix H. Backwards Compatibility Considerations . . . . . . . 283 410 H.1. Play Request in Play State . . . . . . . . . . . . . . . 283 411 H.2. Using Persistent Connections . . . . . . . . . . . . . . 283 412 Appendix I. Open Issues . . . . . . . . . . . . . . . . . . . . 284 413 Appendix J. Changes . . . . . . . . . . . . . . . . . . . . . . 285 414 J.1. Brief Overview . . . . . . . . . . . . . . . . . . . . . 285 415 J.2. Detailed List of Changes . . . . . . . . . . . . . . . . 286 416 Appendix K. Acknowledgements . . . . . . . . . . . . . . . . . . 293 417 K.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 293 418 Appendix L. RFC Editor Consideration . . . . . . . . . . . . . . 295 419 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 296 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] that 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 J. There are many 447 reasons why RTSP 2.0 can't be backwards compatible with RTSP 1.0 but 448 some of the main ones are: 450 o Most headers that needed to be extensible did not define the 451 allowed syntax, preventing safe deployment of extensions; 453 o The changed behavior of the PLAY method when received in Play 454 state; 456 o Changed behavior of the extensibility model and its mechanism; 458 o The change of syntax for some headers. 460 In summary, there are so many small details that changing version 461 become necessary to enable clarification and consistent behavior. 463 This document is structured as follows. It begins with an overview 464 of the protocol operations and its functions in an informal way. 465 Then a set of definitions of used terms and document conventions is 466 introduced. It is followed by the actual protocol specification. In 467 the appendix some functionality that isn't core RTSP, but still 468 important to enable some usage, is defined. RTP usage is defined in 469 Appendix C and SDP usage with RTSP Appendix D, making these two 470 appendixes mandatory. This is followed by a number of informational 471 parts discussing the changes, use cases, different considerations or 472 motivations. 474 2. Protocol Overview 476 This section provides a informative overview of the different 477 mechanisms in the RTSP 2.0 protocol, to give the reader a high level 478 understanding before getting into all the different details. In case 479 of conflict with this description and the later sections, the later 480 sections take precedence. For more information about considered use 481 cases for RTSP see Appendix E. 483 RTSP 2.0 is a bi-directional request and response protocol that first 484 establishes a context including content resources (the media) and 485 then controls the delivery of these content resources from the 486 provider to the consumer. RTSP has three fundamental parts: Session 487 Establishment, Media Delivery Control, and an extensibility model 488 described below. The protocol is based on some assumptions about 489 existing functionality to provide a complete solution for client 490 controlled real-time media delivery. 492 RTSP uses text-based messages, requests and responses, that may 493 contain a binary message body. An RTSP request starts with a method 494 line that identifies the method, the protocol and version and the 495 resource to act on. Following the method line are a number of RTSP 496 headers. This part is ended by two consecutive carriage return line 497 feed (CRLF) character pairs. The message body if present follows the 498 two CRLF and the body's length are described by a message header. 499 RTSP responses are similar, but start with a response line with the 500 protocol and version, followed by a status code and a reason phrase. 501 RTSP messages are sent over a reliable transport protocol between the 502 client and server. RTSP 2.0 requires clients and servers to 503 implement TCP, and TLS over TCP, as mandatory transports for RTSP 504 messages. 506 2.1. Presentation Description 508 RTSP exists to provide access to multi-media presentations and 509 content, but tries to be agnostic about the media type or the actual 510 media delivery protocol that is used. To enable a client to 511 implement a complete system, an RTSP-external mechanism for 512 describing the presentation and the delivery protocol(s) is used. 513 RTSP assumes that this description is either delivered completely out 514 of bands or as a data object in the response to a client's request 515 using the DESCRIBE method (Section 13.2). 517 Parameters that commonly have to be included in the Content 518 Description are the following: 520 o Number of media streams 521 o The resource identifier for each media stream/resource that is to 522 be controlled by RTSP 524 o The protocol that each media stream is to be delivered over 526 o Transport protocol parameters that are not negotiated or vary with 527 each client 529 o Media encoding information enabling a client to correctly decode 530 it upon reception 532 o An aggregate control resource identifier 534 RTSP uses its own URI schemes ("rtsp" and "rtsps") to reference media 535 resources and aggregates under common control. 537 This specification describes in Appendix D how one uses SDP [RFC4566] 538 for Content Description 540 2.2. Session Establishment 542 The RTSP client can request the establishment of an RTSP session 543 after having used the presentation description to determine which 544 media streams are available, and also which media delivery protocol 545 is used and their particular resource identifiers. The RTSP session 546 is a common context between the client and the server that consist of 547 one or more media resources that are to be under common media 548 delivery control. 550 The client creates an RTSP session by sending a request using the 551 SETUP method (Section 13.3) to the server. In the SETUP request the 552 client also includes all the transport parameters necessary to enable 553 the media delivery protocol to function in the "Transport" header 554 (Section 16.52). This includes parameters that are pre-established 555 by the presentation description but necessary for any middlebox to 556 correctly handle the media delivery protocols. The Transport header 557 in a request may contain multiple alternatives for media delivery in 558 a prioritized list, which the server can select from. These 559 alternatives are typically based on information in the content 560 description. 562 The server determines if the media resource is available upon 563 receiving a SETUP request and if any of the transport parameter 564 specifications are acceptable. If that is successful, an RTSP 565 session context is created and the relevant parameters and state is 566 stored. An identifier is created for the RTSP session and included 567 in the response in the Session header (Section 16.47). The SETUP 568 response includes a Transport header that specifies which of the 569 alternatives has been selected and relevant parameters. 571 A SETUP request that references an existing RTSP session but 572 identifies a new media resource is a request to add that media 573 resource under common control with the already present media 574 resources in an aggregated session. A client can expect this to work 575 for all media resources under RTSP control within a multi-media 576 content. However, aggregating resources from different content are 577 likely to be refused by the server. The RTSP session as aggregate is 578 referenced by the aggregate control URI, even if the RTSP session 579 only contains a single media. 581 To avoid an extra round trip in the session establishment of 582 aggregated RTSP sessions, RTSP 2.0 supports pipelined requests; i.e., 583 the client can send multiple requests back-to-back without waiting 584 first for the completion of any of them. The client uses client- 585 selected identifier in the Pipelined-Requests header to instruct the 586 server to bind multiple requests together as if they included the 587 session identifier. 589 The SETUP response also provides additional information about the 590 established sessions in a couple of different headers. The Media- 591 Properties header includes a number of properties that apply for the 592 aggregate that is valuable when doing media delivery control and 593 configuring user interface. The Accept-Ranges header informs the 594 client about which range formats that the server supports with these 595 media resources. The Media-Range header inform the client about the 596 time range of the media currently available. 598 2.3. Media Delivery Control 600 After having established an RTSP session, the client can start 601 controlling the media delivery. The basic operations are Start by 602 using the PLAY method (Section 13.4) and Halt by using the PAUSE 603 method (Section 13.6). PLAY also allows for choosing the starting 604 media position from which the server should deliver the media. The 605 positioning is done using the Range header (Section 16.38) that 606 supports several different time formats: Normal Play Time 607 (Section 4.5), SMPTE Timestamps (Section 4.4) and absolute time 608 (Section 4.6). The Range header does further allow the client to 609 specify a position where delivery should end, thus allowing a 610 specific interval to be delivered. 612 The support for positioning/searching within a content depends on the 613 content's media properties. Content exists in a number of different 614 types, such as: on-demand, live, and live with simultaneous 615 recording. Even within these categories there are differences in how 616 the content is generated and distributed, which affect how it can be 617 accessed for playback. The properties applicable for the RTSP 618 session are provided by the server in the SETUP response using the 619 Media-Properties header (Section 16.28). These are expressed using 620 one or several independent attributes. A first attribute is Random 621 Access, which expresses if positioning can be done, and with what 622 granularity. Another aspect is whether the content will change 623 during the lifetime of the session. While on-demand content will 624 provided in full from the beginning, a live stream being recorded 625 results in the length of the accessible content growing as the 626 session goes on. There also exist content that is dynamically built 627 by another protocol than RTSP and thus also changes in steps during 628 the session, but maybe not continuously. Furthermore, when content 629 is recorded, there are cases where not the complete content is 630 maintained, but, for example, only the last hour. All these 631 properties result in the need for mechanisms that will be discussed 632 below. 634 When the client accesses on-demand content that allows random access 635 in, the client can issue the PLAY request for any point in the 636 content between the start and the end. The server will deliver media 637 from the closest random access point prior to the requested point and 638 indicate that in its PLAY response. If the client issues a PAUSE, 639 the delivery will be halted and the point at which the server stopped 640 will be reported back in the response. The client can later resume 641 by a sending PLAY request without a range header. When the server is 642 about to complete the PLAY request by delivering the end of the 643 content or the requested range, the server will send a PLAY_NOTIFY 644 request indicating this. 646 When playing live content with no extra functions, such as recording, 647 the client will receive the live media from the server after having 648 sent a PLAY request. Seeking in such content is not possible as the 649 server does not store it, but only forwards it from the source of the 650 session. Thus delivery continues until the client sends a PAUSE 651 request, tears down the session, or the content ends. 653 For live sessions that are being recorded the client will need to 654 keep track of how the recording progresses. Upon session 655 establishment the client will learn the current duration of the 656 recording from the Media-Range header. As the recording is ongoing 657 the content grows in direct relation to the passed time. Therefore, 658 each server's response to a PLAY request will contain the current 659 Media-Range header. The server should also regularly send every 5 660 minutes the current media range in a PLAY_NOTIFY request. If the 661 live transmission ends, the server must send a PLAY_NOTIFY request 662 with the updated Media-Properties indicating that the content stopped 663 being a recorded live session and instead become a on-demand content; 664 the request also contains the final media range. While the live 665 delivery continues the client can request to play the current live 666 point by using the NPT timescale symbol "now", or it can request a 667 specific point in the available content by an explicit range request 668 for that point. If the requested point is outside of the available 669 interval the server will adjust the position to the closest available 670 point, i.e., either at the beginning or the end. 672 A special case of recording is that where the recording is not 673 retained longer than a specific time period, thus as the live 674 delivery continues the client can access any media within a moving 675 window that covers, for example, "now" to "now" minus 1 hour. A 676 client that pauses on a specific point within the content may not be 677 able to retrieve the content anymore. If the client waits too long 678 before resuming the pause point, the content may no longer be 679 available. In this case the pause point will be adjusted to the end 680 of the available media. 682 2.4. Session Parameter Manipulations 684 A session may have additional state or functionality that effects how 685 the server or client treats the session, content, how it functions, 686 or feedback on how well the session works. Such extensions are not 687 defined in this specification, but may be done in various extensions. 688 RTSP has two methods for retrieving and setting parameter values on 689 either the client or the server: GET_PARAMETER (Section 13.8) and 690 SET_PARAMETER (Section 13.9). These methods carry the parameters in 691 a message body of the appropriate format. One can also use headers 692 to query state with the GET_PARAMETER method. As an example, clients 693 needing to know the current media-range for a time-progressing 694 session can use the GET_PARAMETER method and include the media-range. 695 Furthermore, synchronization information can be requested by using a 696 combination of RTP-Info and Range. 698 RTSP 2.0 does not have a strong mechanism for providing negotiation 699 of which headers, or parameters and their formats, that can be used. 700 However, responses will indicate request headers or parameters that 701 are not supported. A priori determination of what features are 702 available needs to be done through out-of-band mechanisms, like the 703 session description, or through the usage of feature tags 704 (Section 4.7). 706 2.5. Media Delivery 708 The delivery of media to the RTSP client is done with a protocol 709 outside of RTSP and this protocol is determined during the session 710 establishment. This document specifies how media is delivered with 711 RTP over UDP, TCP or the RTSP control connection. Additional 712 protocols may be specified in the future based on demand. 714 The usage of RTP as media delivery protocol requires some additional 715 information to function well. The PLAY response contains information 716 to enable reliable and timely deliver of how a client should 717 synchronize different sources in the different RTP sessions. It also 718 provides a mapping between RTP timestamps and the content time scale. 719 When the server want to notify the client about the completion of the 720 media delivery, it sends a PLAY_NOTIFY request to the client. The 721 PLAY_NOTIFY request includes information about the stream end, 722 including the last RTP sequence number for each stream, thus enabling 723 the client to empty the buffer smoothly. 725 2.5.1. Media Delivery Manipulations 727 The basic playback functionality of RTSP enables delivery of a range 728 of requested content to the client at the pace intended by the 729 content's creator. However, RTSP can also manipulate the delivery to 730 the client in two ways. 732 Scale: The ratio of media content time delivered per unit playback 733 time. 735 Speed: The ratio of playback time delivered per unit of wallclock 736 time. 738 Both affect the media delivery per time unit. However, they 739 manipulate two independent time scales and the effects are possible 740 to combine. 742 Scale is used for fast forward or slow motion control as it changes 743 the amount of content timescale that should be played back per time 744 unit. Scale > 1.0, means fast forward, e.g. Scale=2.0 results in 745 that 2 seconds of content is played back every second of playback. 746 Scale = 1.0 is the default value that is used if no Scale is 747 specified, i.e., playback at the content's original rate. Scale 748 values between 0 and 1.0 is providing for slow motion. Scale can be 749 negative to allow for reverse playback in either regular pace (Scale 750 = -1.0) or fast backwards (Scale < -1.0) or slow motion backwards 751 (-1.0 < Scale < 0). Scale = 0 is equal to pause and is not allowed. 753 In most cases the realization of scale means server side manipulation 754 of the media to ensure that the client can actually play it back. 755 These media manipulation and when they are needed are highly media- 756 type dependent. Lets exemplify with two common media types audio and 757 video. 759 It is very difficult to modify the playback rate of audio. A maximum 760 of 10-30% is possible by changing the pitch-rate of speech. Music 761 goes out of tune if one tries to manipulate the playback rate by 762 resampling it. This is a well known problem and audio is commonly 763 muted or played back in short segments with skips to keep up with the 764 current playback point. 766 For video is possible to manipulate the frame rate, although the 767 rendering capabilities are often limited to certain frame rates. 768 Also the allowed bitrates in decoding, the structured used in the 769 encoding and the dependency between frames and other capabilities of 770 the rendering device limits the possible manipulations. Therefore, 771 the basic fast forward capabilities often are implemented by 772 selecting certain subsets of frames. 774 Due to the media restrictions, the possible scale values are commonly 775 restricted to the set of realizable scale ratios. To enable the 776 clients to select from the possible scale values, RTSP can signal the 777 supported Scale ratios for the content. To support aggregated or 778 dynamic content, where this may change during the ongoing session and 779 dependent on the location within the content, a mechanism for 780 updating the media properties and the currently used scale factor 781 exist. 783 Speed affects how much of the playback timeline is delivered in a 784 given wallclock period. The default is Speed = 1 which means to 785 deliver at the same rate the media is consumed. Speed > 1 means that 786 the receiver will get content faster than it regularly would consume 787 it. Speed < 1 means that delivery is slower than the regular media 788 rate. Speed values of 0 or lower have no meaning and are not 789 allowed. This mechanism enables two general functionalities. One is 790 client side scale operations, i.e. the client receives all the frames 791 and makes the adjustment to the playback locally. The second is 792 delivery control for buffering of media. By specifying a speed over 793 1.0 the client can build up the amount of playback time it has 794 present in its buffers to a level that is sufficient for its needs. 796 A naive implementation of Speed would only affect the transmission 797 schedule of the media and has a clear impact on the needed bandwidth. 798 This would result in the data rate being proportional to the speed 799 factor. Speed = 1.5, i.e., 50% faster than normal delivery, would 800 result in a 50% increase in the data transport rate. If that can be 801 supported or not depends solely on the underlying network path. 802 Scale may also have some impact on the required bandwidth due to the 803 manipulation of the content in the new playback schedule. An example 804 is fast forward where only the independently decodable intra frames 805 are included in the media stream. This usage of solely intra frames 806 increases the data rate significantly compared to a normal sequence 807 with the same number of frames, where most frames are encoded using 808 prediction. 810 This potential increase of the data rate needs to be handled by the 811 media sender. The client has requested that the media will be 812 delivered in a specific way, which should be honored. However, the 813 media sender cannot ignore if the network path between the sender and 814 the receiver can't handle the resulting media stream. In that case 815 the media stream needs to be adapted to fit the available resources 816 of the path. This can result in a reduced media quality. 818 The need for bitrate adaptation becomes especially problematic in 819 connection with the Speed semantics. If the goal is to fill up the 820 buffer, the client may not want to do that at the cost of reduced 821 quality. If the client wants to make local playout changes then it 822 may actually require that the requested speed be honored. To resolve 823 this issue, Speed uses a range so that both cases can be supported. 824 The server is requested to use the highest possible speed value 825 within the range which is compatible with the available bandwidth. 826 As long as the server can maintain a speed value within the range it 827 shall not change the media quality, but instead modify the actual 828 delivery rate in response to available bandwidth and reflect this in 829 the Speed value in the response. However, if this is not possible, 830 the server should instead modify the media quality to respect the 831 lowest speed value and the available bandwidth. 833 This functionality enables the local scaling implementation to use a 834 tight range, or even a range where the lower bound equals the upper 835 bound, to identify that it requires the server to deliver the 836 requested amount of media time per delivery time independent of how 837 much it needs to adapt the media quality to fit within the available 838 path bandwidth. For buffer filling, it is suitable to use a range 839 with a reasonable span and with a lower bound at the nominal media 840 rate 1.0, such as 1.0 - 2.5. If the client wants to reduce the 841 buffer, it can specify an upper bound that is below 1.0 to force the 842 server to deliver slower than the nominal media rate. 844 2.6. Session Maintenance and Termination 846 The session context that has been established is kept alive by having 847 the client show liveness. This is done in two main ways: 849 o Media transport protocol keep-alive. RTCP may be used when using 850 RTP. 852 o Any RTSP request referencing the session context. 854 Section 10.5 discusses the methods for showing liveness in more 855 depth. If the client fails to show liveness for more than the 856 established session timeout value (normally 60 seconds), the server 857 may terminate the context. Other values may be selected by the 858 server through the inclusion of the timeout parameter in the session 859 header. 861 The session context is normally terminated by the client sending a 862 TEARDOWN request to the server referencing the aggregated control 863 URI. An individual media resource can be removed from a session 864 context by a TEARDOWN request referencing that particular media 865 resource. If all media resources are removed from a session context, 866 the session context is terminated. 868 A client may keep the session alive indefinitely if allowed by the 869 server; however, it is recommended to release the session context 870 when an extended period of time without media delivery activity has 871 passed. The client can re-establish the session context if required 872 later. What constitutes an extended period of time is dependent on 873 the server and its usage. It is recommended that the client 874 terminates the session before 10*times the session timeout value has 875 passed. A server may terminate the session after one session timeout 876 period without any client activity beyond keep-alive. When a server 877 terminates the session context, it does that by sending a TEARDOWN 878 request indicating the reason. 880 A server can also request that the client tear down the session and 881 re-establish it at an alternative server, as may be needed for 882 maintenance. This is done by using the REDIRECT method. The 883 Terminate-Reason header is used to indicate when and why. The 884 Location header indicates where it should connect if there is an 885 alternative server available. When the deadline expires, the server 886 simply stops providing the service. To achieve a clean closure, the 887 client needs to initiate session termination prior to the deadline. 888 In case the server has no other server to redirect to, and wants to 889 close the session for maintenance, it shall use the TEARDOWN method 890 with a Terminate-Reason header. 892 2.7. Extending RTSP 894 RTSP is quite a versatile protocol which supports extensions in many 895 different directions. Even this core specification contains several 896 blocks of functionality that are optional to implement. The use case 897 and need for the protocol deployment should determine what parts are 898 implemented. Allowing for extensions makes it possible for RTSP to 899 reach out to additional use cases. However, extensions will affect 900 the interoperability of the protocol and therefore it is important 901 that they can be added in a structured way. 903 The client can learn the capability of a server by using the OPTIONS 904 method (Section 13.1) and the Supported header (Section 16.49). It 905 can also try and possibly fail using new methods, or require that 906 particular features are supported using the Require or Proxy-Require 907 header. 909 The RTSP protocol in itself can be extended in three ways, listed 910 here in order of the magnitude of changes supported: 912 o Existing methods can be extended with new parameters, for example, 913 headers, as long as these parameters can be safely ignored by the 914 recipient. If the client needs negative acknowledgment when a 915 method extension is not supported, a tag corresponding to the 916 extension may be added in the field of the Require or Proxy- 917 Require headers (see Section 16.35). 919 o New methods can be added. If the recipient of the message does 920 not understand the request, it must respond with error code 501 921 (Not Implemented) so that the sender can avoid using this method 922 again. A client may also use the OPTIONS method to inquire about 923 methods supported by the server. The server must list the methods 924 it supports using the Public response header. 926 o A new version of the protocol can be defined, allowing almost all 927 aspects (except the position of the protocol version number) to 928 change. A new version of the protocol must be registered through 929 an IETF standard track document. 931 The basic capability discovery mechanism can be used to both discover 932 support for a certain feature and to ensure that a feature is 933 available when performing a request. For a detailed explanation of 934 this see Section 11. 936 New media delivery protocols may be added and negotiated at session 937 establishment, in addition to extension to the core protocol. 938 Certain types of protocol manipulations can be done through parameter 939 formats using SET_PARAMETER and GET_PARAMETER. 941 3. Document Conventions 943 3.1. Notational Conventions 945 Since a few of the definitions are identical to HTTP/1.1, this 946 specification only points to the section where they are defined 947 rather than copying it. For brevity, [HX.Y] is to be taken to refer 948 to Section X.Y of the current HTTP/1.1 specification ([RFC2616]). 950 All the mechanisms specified in this document are described in both 951 prose and the Augmented Backus-Naur form (ABNF) described in detail 952 in [RFC5234]. 954 Indented and smaller-type paragraphs are used to provide informative 955 background and motivation. This is intended to give readers who were 956 not involved with the formulation of the specification an 957 understanding of why things are the way they are in RTSP. 959 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 960 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 961 document are to be interpreted as described in [RFC2119]. 963 The word, "unspecified" is used to indicate functionality or features 964 that are not defined in this specification. Such functionality 965 cannot be used in a standardized manner without further definition in 966 an extension specification to RTSP. 968 3.2. Terminology 970 Aggregate control: The concept of controlling multiple streams using 971 a single timeline, generally maintained by the server. A client, 972 for example, uses aggregate control when it issues a single play 973 or pause message to simultaneously control both the audio and 974 video in a movie. A session which is under aggregate control is 975 referred to as an aggregated session. 977 Aggregate control URI: The URI used in an RTSP request to refer to 978 and control an aggregated session. It normally, but not always, 979 corresponds to the presentation URI specified in the session 980 description. See Section 13.3 for more information. 982 Client: The client requests media service from the media server. 984 Connection: A transport layer virtual circuit established between 985 two programs for the purpose of communication. 987 Container file: A file which may contain multiple media streams 988 which often constitutes a presentation when played together. The 989 concept of a container file is not embedded in the protocol. 990 However, RTSP servers may offer aggregate control on the media 991 streams within these files. 993 Continuous media: Data where there is a timing relationship between 994 source and sink; that is, the sink needs to reproduce the timing 995 relationship that existed at the source. The most common examples 996 of continuous media are audio and motion video. Continuous media 997 can be real-time (interactive or conversational), where there is a 998 "tight" timing relationship between source and sink, or streaming 999 where the relationship is less strict. 1001 Feature-tag: A tag representing a certain set of functionality, i.e. 1002 a feature. 1004 IRI: Internationalized Resource Identifier, is the same as an URI, 1005 with the exception that it allows characters from the whole 1006 Universal Character Set (Unicode/ISO 10646), rather than the US- 1007 ASCII only. See [RFC3987] for more information. 1009 Live: Normally used to describe a presentation or session with media 1010 coming from an ongoing event. This generally results in the 1011 session having an unbound or only loosely defined duration, and 1012 sometimes no seek operations are possible. 1014 Media initialization: Datatype/codec specific initialization. This 1015 includes such things as clock rates, color tables, etc. Any 1016 transport-independent information which is required by a client 1017 for playback of a media stream occurs in the media initialization 1018 phase of stream setup. 1020 Media parameter: Parameter specific to a media type that may be 1021 changed before or during stream delivery. 1023 Media server: The server providing media delivery services for one 1024 or more media streams. Different media streams within a 1025 presentation may originate from different media servers. A media 1026 server may reside on the same host or on a different host from 1027 which the presentation is invoked. 1029 (Media) stream: A single media instance, e.g., an audio stream or a 1030 video stream as well as a single whiteboard or shared application 1031 group. When using RTP, a stream consists of all RTP and RTCP 1032 packets created by a source within an RTP session. 1034 Message: The basic unit of RTSP communication, consisting of a 1035 structured sequence of octets matching the syntax defined in 1036 Section 20 and transmitted over a connection or a connectionless 1037 transport. A message is either a Request or a Response. 1039 Message Body: The information transferred as the payload of a 1040 message (Request and response). A message body consists of meta- 1041 information in the form of message-body headers and content in the 1042 form of a message-body, as described in Section 9. 1044 Non-Aggregated Control: Control of a single media stream. 1046 Presentation: A set of one or more streams presented to the client 1047 as a complete media feed and described by a presentation 1048 description as defined below. Presentations with more than one 1049 media stream are often handled in RTSP under aggregate control. 1051 Presentation description: A presentation description contains 1052 information about one or more media streams within a presentation, 1053 such as the set of encodings, network addresses and information 1054 about the content. Other IETF protocols such as SDP ([RFC4566]) 1055 use the term "session" for a presentation. The presentation 1056 description may take several different formats, including but not 1057 limited to the session description protocol format, SDP. 1059 Response: An RTSP response to a Request. One type of RTSP message. 1060 If an HTTP response is meant, it is indicated explicitly. 1062 Request: An RTSP request. One type of RTSP message. If an HTTP 1063 request is meant, it is indicated explicitly. 1065 Request-URI: The URI used in a request to indicate the resource on 1066 which the request is to be performed. 1068 RTSP agent: Refers to either an RTSP client, an RTSP server, or an 1069 RTSP proxy. In this specification, there are many capabilities 1070 that are common to these three entities such as the capability to 1071 send requests or receive responses. This term will be used when 1072 describing functionality that is applicable to all three of these 1073 entities. 1075 RTSP session: A stateful abstraction upon which the main control 1076 methods of RTSP operate. An RTSP session is a common context; it 1077 is created, maintained and destroyed on client's request. It is 1078 established by an RTSP server upon the completion of a successful 1079 SETUP request (when a 200 OK response is sent) and is labeled with 1080 a session identifier at that time. The session exists until timed 1081 out by the server or explicitly removed by a TEARDOWN request. An 1082 RTSP session is a stateful entity; an RTSP server maintains an 1083 explicit session state machine (see Appendix B) where most state 1084 transitions are triggered by client requests. The existence of a 1085 session implies the existence of state about the session's media 1086 streams and their respective transport mechanisms. A given 1087 session can have one or more media streams associated with it. An 1088 RTSP server uses the session to aggregate control over multiple 1089 media streams. 1091 Origin Server: The server on which a given resource resides. 1093 Transport initialization: The negotiation of transport information 1094 (e.g., port numbers, transport protocols) between the client and 1095 the server. 1097 URI: Universal Resource Identifier, see [RFC3986]. The URIs used in 1098 RTSP are generally URLs as they give a location for the resource. 1099 As URLs are a subset of URIs, they will be referred to as URIs to 1100 cover also the cases when an RTSP URI would not be an URL. 1102 URL: Universal Resource Locator, is an URI which identifies the 1103 resource through its primary access mechanism, rather than 1104 identifying the resource by name or by some other attribute(s) of 1105 that resource. 1107 4. Protocol Parameters 1109 4.1. RTSP Version 1111 This specification defines version 2.0 of RTSP. 1113 RTSP uses a "." numbering scheme to indicate versions 1114 of the protocol. The protocol versioning policy is intended to allow 1115 the sender to indicate the format of a message and its capacity for 1116 understanding further RTSP communication, rather than the features 1117 obtained via that communication. No change is made to the version 1118 number for the addition of message components which do not affect 1119 communication behavior or which only add to extensible field values. 1121 The number is incremented when the changes made to the 1122 protocol add features which do not change the general message parsing 1123 algorithm, but which may add to the message semantics and imply 1124 additional capabilities of the sender. The number is 1125 incremented when the format of a message within the protocol is 1126 changed. The version of an RTSP message is indicated by an RTSP- 1127 Version field in the first line of the message. Note that the major 1128 and minor numbers MUST be treated as separate integers and that each 1129 MAY be incremented higher than a single digit. Thus, RTSP/2.4 is a 1130 lower version than RTSP/2.13, which in turn is lower than RTSP/12.3. 1131 Leading zeros MUST be ignored by recipients and MUST NOT be sent. 1133 4.2. RTSP IRI and URI 1135 RTSP 2.0 defines and registers three URI schemes "rtsp", "rtsps" and 1136 "rtspu". The usage of the last, "rtspu", is unspecified in RTSP 2.0, 1137 and is defined here to register and reserve the URI scheme that is 1138 defined in RTSP 1.0. The "rtspu" scheme indicates unspecified 1139 transport of the RTSP messages over unreliable transport (UDP in RTSP 1140 1.0). A RTSP server MUST response with an error code indicating the 1141 "rtspu" scheme is not implemented (501) to a request that carries a 1142 "rtspu" URI scheme. The details of the syntax of "rtsp" and "rtsps" 1143 URIs has been changed from RTSP 1.0. 1145 This specification also defines the format of the RTSP IRI [RFC3987] 1146 that can be used as RTSP resource identifiers and locators, in web 1147 pages, user interfaces, on paper, etc. However, the RTSP request 1148 message format only allows usage of the absolute URI format. The 1149 RTSP IRI format MUST use the rules and transformation for IRIs 1150 defined in [RFC3987]. This way RTSP 2.0 URIs for request can be 1151 produced from an RTSP IRI. 1153 The RTSP IRI and URI are both syntax restricted compared to the 1154 generic syntax defined in [RFC3986] and [RFC3987]: 1156 o An absolute URI requires the authority part; i.e., a host identity 1157 must be provided. 1159 o Parameters in the path element are prefixed with the reserved 1160 separator ";". 1162 The RTSP URI and IRI is case sensitive, with the exception of those 1163 parts that [RFC3986] and [RFC3987] defines as case-insensitive; for 1164 example, the scheme and host part. 1166 The fragment identifier is used as defined in sections 3.5 and 4.3 of 1167 [RFC3986], i.e. the fragment is to be stripped from the IRI by the 1168 requester and not included in the request URI. The user agent needs 1169 to interpret the value of the fragment based on the media type the 1170 request relates to; i.e., the media type indicated in Content-Type 1171 header in the response to DESCRIBE. 1173 The syntax of any URI query string is unspecified and responder 1174 (usually the server) specific. The query is, from the requester's 1175 perspective, an opaque string and needs to be handled as such. 1176 Please note that relative URI with queries are difficult to handle 1177 due to the RFC 3986 relative URI handling rules. Any change of the 1178 path element using a relative URI results in the stripping of the 1179 query, which means the relative part needs to contain the query. 1181 The URI scheme "rtsp" requires that commands are issued via a 1182 reliable protocol (within the Internet, TCP), while the scheme 1183 "rtsps" identifies a reliable transport using secure transport (TLS 1184 [RFC5246], see (Section 19). 1186 For the scheme "rtsp", if no port number is provided in the authority 1187 part of the URI port number 554 MUST be used. For the scheme 1188 "rtsps", the TCP port 322 is registered and MUST be assumed. 1190 A presentation or a stream is identified by a textual media 1191 identifier, using the character set and escape conventions of URIs 1192 [RFC3986]. URIs may refer to a stream or an aggregate of streams; 1193 i.e., a presentation. Accordingly, requests described in 1194 (Section 13) can apply to either the whole presentation or an 1195 individual stream within the presentation. Note that some request 1196 methods can only be applied to streams, not presentations, and vice 1197 versa. 1199 For example, the RTSP URI: 1201 rtsp://media.example.com:554/twister/audiotrack 1203 may identify the audio stream within the presentation "twister", 1204 which can be controlled via RTSP requests issued over a TCP 1205 connection to port 554 of host media.example.com. 1207 Also, the RTSP URI: 1209 rtsp://media.example.com:554/twister 1211 identifies the presentation "twister", which may be composed of audio 1212 and video streams, but could also be something else like a random 1213 media redirector. 1215 This does not imply a standard way to reference streams in URIs. 1216 The presentation description defines the hierarchical 1217 relationships in the presentation and the URIs for the individual 1218 streams. A presentation description may name a stream "a.mov" and 1219 the whole presentation "b.mov". 1221 The path components of the RTSP URI are opaque to the client and do 1222 not imply any particular file system structure for the server. 1224 This decoupling also allows presentation descriptions to be used 1225 with non-RTSP media control protocols simply by replacing the 1226 scheme in the URI. 1228 4.3. Session Identifiers 1230 Session identifiers are strings of length 8-128 characters. A 1231 session identifier MUST be chosen cryptographically random (see 1232 [RFC4086]) . It is RECOMMENDED that it contains 128 bits of entropy, 1233 i.e. approximately 22 characters from a high quality generator. (see 1234 Section 21.) However, note that the session identifier does not 1235 provide any security against session hijacking unless it is kept 1236 confidential by the client, server and trusted proxies. 1238 4.4. SMPTE Relative Timestamps 1240 A SMPTE relative timestamp expresses time relative to the start of 1241 the clip. Relative timestamps are expressed as SMPTE time codes for 1242 frame-level access accuracy. The time code has the format 1244 hours:minutes:seconds:frames.subframes, 1246 with the origin at the start of the clip. The default SMPTE format 1247 is "SMPTE 30 drop" format, with frame rate is 29.97 frames per 1248 second. Other SMPTE codes MAY be supported (such as "SMPTE 25") 1249 through the use of "smpte-type". For SMPTE 30, the "frames" field in 1250 the time value can assume the values 0 through 29. The difference 1251 between 30 and 29.97 frames per second is handled by dropping the 1252 first two frame indices (values 00 and 01) of every minute, except 1253 every tenth minute. If the frame and the subframe values are zero, 1254 they may be omitted. Subframes are measured in one-hundredth of a 1255 frame. 1257 Examples: 1259 smpte=10:12:33:20- 1260 smpte=10:07:33- 1261 smpte=10:07:00-10:07:33:05.01 1262 smpte-25=10:07:00-10:07:33:05.01 1264 4.5. Normal Play Time 1266 Normal play time (NPT) indicates the stream absolute position 1267 relative to the beginning of the presentation, not to be confused 1268 with the Network Time Protocol (NTP) [RFC5905]. The timestamp 1269 consists of two parts: the mandatory first part may be expressed in 1270 either seconds or hours, minutes, and seconds. The optional second 1271 part consists of a decimal point and decimal figures and indicates 1272 fractions of a second. 1274 The beginning of a presentation corresponds to 0.0 seconds. Negative 1275 values are not defined. 1277 The special constant "now" is defined as the current instant of a 1278 live event. It MAY only be used for live events, and MUST NOT be 1279 used for on-demand (i.e., non-live) content. 1281 NPT is defined as in DSM-CC [ISO.13818-6.1995]: "Intuitively, NPT is 1282 the clock the viewer associates with a program. It is often 1283 digitally displayed on a VCR. NPT advances normally when in normal 1284 play mode (scale = 1), advances at a faster rate when in fast scan 1285 forward (high positive scale ratio), decrements when in scan reverse 1286 (negative scale ratio) and is fixed in pause mode. NPT is 1287 (logically) equivalent to SMPTE time codes." 1289 Examples: 1291 npt=123.45-125 1292 npt=12:05:35.3- 1293 npt=now- 1294 The syntax conforms to ISO 8601 [ISO.8601.2000]. The npt-sec 1295 notation is optimized for automatic generation, the npt-hhmmss 1296 notation for consumption by human readers. The "now" constant 1297 allows clients to request to receive the live feed rather than the 1298 stored or time-delayed version. This is needed since neither 1299 absolute time nor zero time are appropriate for this case. 1301 4.6. Absolute Time 1303 Absolute time is expressed as ISO 8601 [ISO.8601.2000] timestamps, 1304 using UTC (GMT). Fractions of a second may be indicated. 1306 Example for November 8, 1996 at 14h 37 min and 20 and a quarter 1307 seconds UTC: 1309 19961108T143720.25Z 1311 4.7. Feature-Tags 1313 Feature-tags are unique identifiers used to designate features in 1314 RTSP. These tags are used in Require (Section 16.41), Proxy-Require 1315 (Section 16.35), Proxy-Supported (Section 16.36), and Unsupported 1316 (Section 16.53) header fields. 1318 A feature-tag definition MUST indicate which combination of clients, 1319 servers or proxies they applies to. 1321 The creator of a new RTSP feature-tag should either prefix the 1322 feature-tag with a reverse domain name (e.g., 1323 "com.example.mynewfeature" is an apt name for a feature whose 1324 inventor can be reached at "example.com"), or register the new 1325 feature-tag with the Internet Assigned Numbers Authority (IANA) (see 1326 IANA Section 22). 1328 The usage of feature-tags is further described in Section 11 that 1329 deals with capability handling. 1331 4.8. Message Body Tags 1333 Message body tags are opaque strings that are used to compare two 1334 message bodies from the same resource, for example in caches or to 1335 optimize setup after a redirect. Message body tags can be carried in 1336 the MTag header (see Section 16.30) or in SDP (see Appendix D.1.9). 1337 MTag is similar to ETag in HTTP/1.1. 1339 A message body tag MUST be unique across all versions of all message 1340 bodies associated with a particular resource. A given message body 1341 tag value MAY be used for message bodies obtained by requests on 1342 different URIs. The use of the same message body tag value in 1343 conjunction with message bodies obtained by requests on different 1344 URIs does not imply the equivalence of those message bodies 1346 Message body tags are used in RTSP to make some methods conditional. 1347 The methods are made conditional through the inclusion of headers; 1348 see "If-Match" (Section 16.23) and "If-None-Match" (Section 16.25). 1349 Note that RTSP message body tags apply to the complete presentation; 1350 i.e., both the presentation description and the individual media 1351 streams. Thus message body tags can be used to verify at setup time 1352 after a redirect that the same session description applies to the 1353 media at the new location using the If-Match header. 1355 4.9. Media Properties 1357 When an RTSP server handles media, it is important to consider the 1358 different properties a media instance for delivery and playback can 1359 have. This specification considers the below listed media properties 1360 in its protocol operations. They are derived from the differences 1361 between a number of supported usages. 1363 On-demand: Media that has a fixed (given) duration that doesn't 1364 change during the life time of the RTSP session and is known at 1365 the time of the creation of the session. It is expected that the 1366 content of the media will not change, even if the representation, 1367 i.e encoding, quality, etc, may change. Generally one can seek, 1368 i.e. request any range, within the media. 1370 Dynamic On-demand: This is a variation of the on-demand case where 1371 external methods are used to manipulate the actual content of the 1372 media setup for the RTSP session. The main example is a content 1373 defined by a playlist. 1375 Live: Live media represents a progressing content stream (such as 1376 broadcast TV) where the duration may or may not be known. It is 1377 not seekable, only the content presently being delivered can be 1378 accessed. 1380 Live with Recording: A Live stream that is combined with a server- 1381 side capability to store and retain the content of the live 1382 session, and allow for random access delivery within the part of 1383 the already recorded content. The actual behavior of the media 1384 stream is very much dependent on the retention policy for the 1385 media stream; either the server will be able to capture the 1386 complete media stream, or it will have a limitation in how much 1387 will be retained. The media range will dynamically change as the 1388 session progress. For servers with a limited amount of storage 1389 available for recording, there will typically be a sliding window 1390 that moves forwards while new data is made available and older 1391 data is discarded. 1393 To cover the above usages, the following media properties with 1394 appropriate values are specified: 1396 4.9.1. Random Access and Seeking 1398 Random Access is the ability to specify and get media delivered from 1399 any point inside the content, an operation called seeking. This 1400 possibility is signaled using the Seek-Style header (see Section 1401 Section 16.45) which can take the following different values: 1403 Random Access: The media are seekable to any out of a large number 1404 of points within the media. Due to media encoding limitations, a 1405 particular point may not be reachable, but seeking to a point 1406 close by is enabled. A floating point number of seconds may be 1407 provided to express the worst case distance between random access 1408 points. 1410 Conditional Random Access: Based on the above Random Access but 1411 intended to handle a case where the distance in the media between 1412 random access points are large, and where small seek forward using 1413 Random Access would move the client further away then the current 1414 point. 1416 Return To Start: Seeking is only possible to the beginning of the 1417 content. 1419 No seeking: Seeking is not possible at all. 1421 4.9.2. Retention 1423 Media may have different retention policies in place that affect the 1424 operation on media. The following different media retention policies 1425 are envisioned and taken into consideration where applicable: 1427 Unlimited: The media will not be removed as long as the RTSP session 1428 is in existence. 1430 Time Limited: The media will not be removed before given wallclock 1431 time. After that time it may or may not be available any more. 1433 Duration limited: Each individual unit of the media will be retained 1434 for the specified duration. 1436 4.9.3. Content Modifications 1438 There is also the question of how the content may change during time 1439 for a give media resource: 1441 Immutable: The content of the media will not change, even if the 1442 representation, i.e., encoding, quality, etc., may change. 1444 Dynamic: Between explicit updates the media content will not change, 1445 but the content may change due to external methods or triggers, 1446 such as playlists. 1448 Time Progressing: As times progresses new content will become 1449 available. If the content also is retained it will become longer 1450 as everything between the start point and the point currently 1451 being made available can be accessed. If the media server uses a 1452 sliding window policy for retention, the start point will also 1453 change as time progresses. 1455 4.9.4. Supported Scale Factors 1457 Content often supports only a limited set or range of scales when 1458 delivering the media.. To enable the client to know what values or 1459 ranges of scale operations that the whole content or the current 1460 position supports, a media properties attribute for this is defined 1461 which contains a list with the values and/or ranges that are 1462 supported. The attribute is named "Scales". It may be updated at 1463 any point in the content due to content consisting of spliced pieces 1464 or content being dynamically updated by out-of-band mechanisms. 1466 4.9.5. Mapping to the Attributes 1468 This section shows examples of how one would map the above usages to 1469 the properties and their values. 1471 On-demand: Random Access: Random Access=5s, Content Modifications: 1472 Immutable, Retention: unlimited or time limited. 1474 Dynamic On-demand: Random Access: Random Access=3s, Content 1475 Modifications: Dynamic, Retention: unlimited or time limited. 1477 Live: Random Access: No seeking, Content Modifications: Time 1478 Progressing, Retention: Duration limited=0.0s 1480 Live with Recording: Random Access: Random Access=3s, Content 1481 Modifications: Time Progressing, Retention: Duration limited=2H 1483 5. RTSP Message 1485 RTSP is a text-based protocol and uses the ISO 10646 character set in 1486 UTF-8 encoding RFC 3629 [RFC3629]. Lines MUST be terminated by CRLF. 1488 Text-based protocols make it easier to add optional parameters in 1489 a self-describing manner. Since the number of parameters and the 1490 frequency of commands is low, processing efficiency is not a 1491 concern. Text-based protocols, if done carefully, also allow easy 1492 implementation of research prototypes in scripting languages such 1493 as TCL, Visual Basic and Perl. 1495 The ISO 10646 character set avoids tricky character set switching, 1496 but is invisible to the application as long as US-ASCII is being 1497 used. This is also the encoding used for RTCP [RFC3550]. 1499 Requests contain methods, the object the method is operating upon and 1500 parameters to further describe the method. Methods are idempotent 1501 unless otherwise noted. Methods are also designed to require little 1502 or no state maintenance at the media server. 1504 5.1. Message Types 1506 RTSP messages consist of requests from client to server, or server to 1507 client, and responses in the reverse direction. Request Section 7 1508 and Response Section 8 messages use a format based on the generic 1509 message format of RFC 2822 [RFC2822] for transferring bodies (the 1510 payload of the message). Both types of message consist of a start- 1511 line, zero or more header fields (also known as "headers"), an empty 1512 line (i.e., a line with nothing preceding the CRLF) indicating the 1513 end of the header, and possibly the data of the message-body. 1515 generic-message = start-line 1516 *(message-header CRLF) 1517 CRLF 1518 [ message-body-data ] 1519 start-line = Request-Line | Status-Line 1521 In the interest of robustness, servers MUST ignore any empty line(s) 1522 received where a Request-Line is expected. In other words, if the 1523 server is reading the protocol stream at the beginning of a message 1524 and receives a CRLF first, it should ignore the CRLF. 1526 5.2. Message Headers 1528 RTSP header fields (see Section 16) include general-header, request- 1529 header, response-header, and Message-body header fields. 1531 The order in which header fields with differing field names are 1532 received is not significant. However, it is "good practice" to send 1533 general-header fields first, followed by request-header or response- 1534 header fields, and ending with the Message-body header fields. 1536 Multiple message-header fields with the same field-name MAY be 1537 present in a message if and only if the entire field-value for that 1538 header field is defined as a comma-separated list. It MUST be 1539 possible to combine the multiple header fields into one "field-name: 1540 field-value" pair, without changing the semantics of the message, by 1541 appending each subsequent field-value to the first, each separated by 1542 a comma. The order in which header fields with the same field-name 1543 are received is therefore significant to the interpretation of the 1544 combined field value, and thus a proxy MUST NOT change the order of 1545 these field values when a message is forwarded. 1547 Unknown message headers MUST be ignored (skipping over the header to 1548 the next protocol element, and not causing an error) by a RTSP server 1549 or client. An RTSP Proxy MUST forward unknown message headers. 1550 Message headers defined outside of this specification that are 1551 required to be interpreted by the RTSP agent will need to use feature 1552 tags (Section 4.7) and include them in the appropriate Require 1553 (Section 16.41) or Proxy-Require (Section 16.35) header. 1555 5.3. Message Body 1557 The message-body (if any) of an RTSP message is used to carry further 1558 information for a particular resource associated with the request or 1559 response. An example of a message body is the Session Description 1560 Protocol (SDP). 1562 The presence of a message-body in either a request or a response MUST 1563 be signaled by the inclusion of a Content-Length header (see 1564 Section 16.16). 1566 The presence of a message-body in a request is signaled by the 1567 inclusion of a Content-Length header field in the RTSP message. A 1568 message-body MUST NOT be included in a request or response if the 1569 specification of the particular method (see Method Definitions 1570 (Section 13)) does not allow sending a message body. 1572 5.4. Message Length 1574 When a message body is included with a message, the length of that 1575 body is determined by one of the following (in order of precedence): 1577 1. Any response message which MUST NOT include a message body (such 1578 as the 1xx, 204, and 304 responses) is always terminated by the 1579 first empty line after the header fields, regardless of the 1580 message-header fields present in the message. (Note: An empty 1581 line is a line with nothing preceding the CRLF.) 1583 2. If a Content-Length header(Section 16.16) is present, its value 1584 in bytes represents the length of the message-body. If this 1585 header field is not present, a value of zero is assumed. 1587 Unlike an HTTP message, an RTSP message MUST contain a Content-Length 1588 header whenever it contains a message body. Note that RTSP does not 1589 support the HTTP/1.1 "chunked" transfer coding (see [H3.6.1]). 1591 Given the moderate length of presentation descriptions returned, 1592 the server should always be able to determine its length, even if 1593 it is generated dynamically, making the chunked transfer encoding 1594 unnecessary. 1596 6. General Header Fields 1598 General headers are headers that may be used in both requests and 1599 responses. The general headers are listed in Table 1: 1601 +--------------------+--------------------+ 1602 | Header Name | Defined in Section | 1603 +--------------------+--------------------+ 1604 | Accept-Ranges | Section 16.5 | 1605 | | | 1606 | Cache-Control | Section 16.10 | 1607 | | | 1608 | Connection | Section 16.11 | 1609 | | | 1610 | CSeq | Section 16.19 | 1611 | | | 1612 | Date | Section 16.20 | 1613 | | | 1614 | Media-Properties | Section 16.28 | 1615 | | | 1616 | Media-Range | Section 16.29 | 1617 | | | 1618 | Pipelined-Requests | Section 16.32 | 1619 | | | 1620 | Proxy-Supported | Section 16.36 | 1621 | | | 1622 | RTP-Info | Section 16.43 | 1623 | | | 1624 | Seek-Style | Section 16.45 | 1625 | | | 1626 | Supported | Section 16.49 | 1627 | | | 1628 | Timestamp | Section 16.51 | 1629 | | | 1630 | Via | Section 16.56 | 1631 +--------------------+--------------------+ 1633 Table 1: The general headers used in RTSP 1635 7. Request 1637 A request message uses the format outlined below regardless of the 1638 direction of a request, client to server or server to client: 1640 o Request line, containing the method to be applied to the resource, 1641 the identifier of the resource, and the protocol version in use; 1643 o Zero or more Header lines, that can be of the following types: 1644 general (Section 6), request (Section 7.2), or message 1645 body(Section 9.1); 1647 o One empty line (CRLF) to indicate the end of the header section; 1649 o Optionally a message-body, consisting of one or more lines. The 1650 length of the message body in bytes is indicated by the Content- 1651 Length message header. 1653 7.1. Request Line 1655 The request line provides the key information about the request: what 1656 method, on what resources and using which RTSP version. The methods 1657 that are defined by this specification are listed in Table 2. 1659 +---------------+--------------------+ 1660 | Method | Defined in Section | 1661 +---------------+--------------------+ 1662 | DESCRIBE | Section 13.2 | 1663 | | | 1664 | GET_PARAMETER | Section 13.8 | 1665 | | | 1666 | OPTIONS | Section 13.1 | 1667 | | | 1668 | PAUSE | Section 13.6 | 1669 | | | 1670 | PLAY | Section 13.4 | 1671 | | | 1672 | PLAY_NOTIFY | Section 13.5 | 1673 | | | 1674 | REDIRECT | Section 13.10 | 1675 | | | 1676 | SETUP | Section 13.3 | 1677 | | | 1678 | SET_PARAMETER | Section 13.9 | 1679 | | | 1680 | TEARDOWN | Section 13.7 | 1681 +---------------+--------------------+ 1683 Table 2: The RTSP Methods 1685 The syntax of the RTSP request line is the following: 1687 CRLF 1689 Note: This syntax cannot be freely changed in future versions of 1690 RTSP. This line needs to remain parsable by older RTSP 1691 implementations since it indicates the RTSP version of the message. 1693 In contrast to HTTP/1.1 [RFC2616], RTSP requests identify the 1694 resource through an absolute RTSP URI (including scheme, host, and 1695 port) (see Section 4.2) rather than just the absolute path. 1697 HTTP/1.1 requires servers to understand the absolute URI, but 1698 clients are supposed to use the Host request header. This is 1699 purely needed for backward-compatibility with HTTP/1.0 servers, a 1700 consideration that does not apply to RTSP. 1702 An asterisk "*" can be used instead of an absolute URI in the 1703 Request-URI part to indicate that the request does not apply to a 1704 particular resource, but to the server or proxy itself, and is only 1705 allowed when the request method does not necessarily apply to a 1706 resource. 1708 For example: 1710 OPTIONS * RTSP/2.0 1712 An OPTIONS in this form will determine the capabilities of the server 1713 or the proxy that first receives the request. If the capability of 1714 the specific server needs to be determined, without regard to the 1715 capability of an intervening proxy, the server should be addressed 1716 explicitly with an absolute URI that contains the server's address. 1718 For example: 1720 OPTIONS rtsp://example.com RTSP/2.0 1722 7.2. Request Header Fields 1724 The RTSP headers in Table 3 can be included in a request, as request 1725 headers, to modify the specifics of the request. Some of these 1726 headers may also be used in the response to a request, as response 1727 headers, to modify the specifics of a response (Section 8.2). 1729 +--------------------+--------------------+ 1730 | Header | Defined in Section | 1731 +--------------------+--------------------+ 1732 | Accept | Section 16.1 | 1733 | | | 1734 | Accept-Credentials | Section 16.2 | 1735 | | | 1736 | Accept-Encoding | Section 16.3 | 1737 | | | 1738 | Accept-Language | Section 16.4 | 1739 | | | 1740 | Authorization | Section 16.7 | 1741 | | | 1742 | Bandwidth | Section 16.8 | 1743 | | | 1744 | Blocksize | Section 16.9 | 1745 | | | 1746 | From | Section 16.22 | 1747 | | | 1748 | If-Match | Section 16.23 | 1749 | | | 1750 | If-Modified-Since | Section 16.24 | 1751 | | | 1752 | If-None-Match | Section 16.25 | 1753 | | | 1754 | Notify-Reason | Section 16.31 | 1755 | | | 1756 | Proxy-Require | Section 16.35 | 1757 | | | 1758 | Range | Section 16.38 | 1759 | | | 1760 | Terminate-Reason | Section 16.50 | 1761 | | | 1762 | Referrer | Section 16.39 | 1763 | | | 1764 | Request-Status | Section 16.40 | 1765 | | | 1766 | Require | Section 16.41 | 1767 | | | 1768 | Scale | Section 16.44 | 1769 | | | 1770 | Session | Section 16.47 | 1771 | | | 1772 | Speed | Section 16.48 | 1773 | | | 1774 | Supported | Section 16.49 | 1775 | | | 1776 | Transport | Section 16.52 | 1777 | | | 1778 | User-Agent | Section 16.54 | 1779 +--------------------+--------------------+ 1781 Table 3: The RTSP request headers 1783 Detailed header definition are provided in Section 16. 1785 New request headers may be defined. If the receiver of the request 1786 is required to understand the request header, the request MUST 1787 include a corresponding feature tag in a Require or Proxy-Require 1788 header to ensure the processing of the header. 1790 8. Response 1792 After receiving and interpreting a request message, the recipient 1793 responds with an RTSP response message. Normally, there is only one, 1794 final, response. Only responses using the response code class 1xx, 1795 that it is allowed to send one or more 1xx response messages prior to 1796 the final response message. 1798 The valid response codes and the methods they can be used with are 1799 listed in Table 4. 1801 8.1. Status-Line 1803 The first line of a Response message is the Status-Line, consisting 1804 of the protocol version followed by a numeric status code and the 1805 textual phrase associated with the status code, with each element 1806 separated by SP characters. No CR or LF is allowed except in the 1807 final CRLF sequence. 1809 SP SP CRLF 1811 8.1.1. Status Code and Reason Phrase 1813 The Status-Code element is a 3-digit integer result code of the 1814 attempt to understand and satisfy the request. These codes are fully 1815 defined in Section 15. The Reason-Phrase is intended to give a short 1816 textual description of the Status-Code. The Status-Code is intended 1817 for use by automata and the Reason-Phrase is intended for the human 1818 user. The client is not required to examine or display the Reason- 1819 Phrase. 1821 The first digit of the Status-Code defines the class of response. 1822 The last two digits do not have any categorization role. There are 5 1823 values for the first digit: 1825 1xx: Informational - Request received, continuing process 1827 2xx: Success - The action was successfully received, understood, and 1828 accepted 1830 3rr: Redirection - Further action needs to be taken in order to 1831 complete the request 1833 4xx: Client Error - The request contains bad syntax or cannot be 1834 fulfilled 1836 5xx: Server Error - The server failed to fulfill an apparently valid 1837 request 1839 The individual values of the numeric status codes defined for 1840 RTSP/2.0, and an example set of corresponding Reason-Phrases, are 1841 presented in Table 4. The reason phrases listed here are only 1842 recommended; they may be replaced by local equivalents without 1843 affecting the protocol. Note that RTSP adopts most HTTP/1.1 1844 [RFC2616] status codes and adds RTSP-specific status codes starting 1845 at x50 to avoid conflicts with future HTTP status codes that are 1846 desirable to import into RTSP. 1848 RTSP status codes are extensible. RTSP applications are not required 1849 to understand the meaning of all registered status codes, though such 1850 understanding is obviously desirable. However, applications MUST 1851 understand the class of any status code, as indicated by the first 1852 digit, and treat any unrecognized response as being equivalent to the 1853 x00 status code of that class, with the exception that an 1854 unrecognized response MUST NOT be cached. For example, if an 1855 unrecognized status code of 431 is received by the client, it can 1856 safely assume that there was something wrong with its request and 1857 treat the response as if it had received a 400 status code. In such 1858 cases, user agents SHOULD present to the user the message body 1859 returned with the response, since that message body is likely to 1860 include human-readable information which will explain the unusual 1861 status. 1863 +------+----------------------------------------+-----------------+ 1864 | Code | Reason | Method | 1865 +------+----------------------------------------+-----------------+ 1866 | 100 | Continue | all | 1867 | | | | 1868 | | | | 1869 | 200 | OK | all | 1870 | | | | 1871 | | | | 1872 | 301 | Moved Permanently | all | 1873 | | | | 1874 | 302 | Found | all | 1875 | | | | 1876 | 304 | Not Modified | all | 1877 | | | | 1878 | 305 | Use Proxy | all | 1879 | | | | 1880 | | | | 1881 | 400 | Bad Request | all | 1882 | | | | 1883 | 401 | Unauthorized | all | 1884 | 402 | Payment Required | all | 1885 | | | | 1886 | 403 | Forbidden | all | 1887 | | | | 1888 | 404 | Not Found | all | 1889 | | | | 1890 | 405 | Method Not Allowed | all | 1891 | | | | 1892 | 406 | Not Acceptable | all | 1893 | | | | 1894 | 407 | Proxy Authentication Required | all | 1895 | | | | 1896 | 408 | Request Timeout | all | 1897 | | | | 1898 | 410 | Gone | all | 1899 | | | | 1900 | 411 | Length Required | all | 1901 | | | | 1902 | 412 | Precondition Failed | DESCRIBE, SETUP | 1903 | | | | 1904 | 413 | Request Message Body Too Large | all | 1905 | | | | 1906 | 414 | Request-URI Too Long | all | 1907 | | | | 1908 | 415 | Unsupported Media Type | all | 1909 | | | | 1910 | 451 | Parameter Not Understood | SET_PARAMETER | 1911 | | | | 1912 | 452 | reserved | n/a | 1913 | | | | 1914 | 453 | Not Enough Bandwidth | SETUP | 1915 | | | | 1916 | 454 | Session Not Found | all | 1917 | | | | 1918 | 455 | Method Not Valid In This State | all | 1919 | | | | 1920 | 456 | Header Field Not Valid | all | 1921 | | | | 1922 | 457 | Invalid Range | PLAY, PAUSE | 1923 | | | | 1924 | 458 | Parameter Is Read-Only | SET_PARAMETER | 1925 | | | | 1926 | 459 | Aggregate Operation Not Allowed | all | 1927 | | | | 1928 | 460 | Only Aggregate Operation Allowed | all | 1929 | | | | 1930 | 461 | Unsupported Transport | all | 1931 | | | | 1932 | 462 | Destination Unreachable | all | 1933 | | | | 1934 | 463 | Destination Prohibited | SETUP | 1935 | | | | 1936 | 464 | Data Transport Not Ready Yet | PLAY | 1937 | | | | 1938 | 465 | Notification Reason Unknown | PLAY_NOTIFY | 1939 | | | | 1940 | 470 | Connection Authorization Required | all | 1941 | | | | 1942 | 471 | Connection Credentials not accepted | all | 1943 | | | | 1944 | 472 | Failure to establish secure connection | all | 1945 | | | | 1946 | | | | 1947 | 500 | Internal Server Error | all | 1948 | | | | 1949 | 501 | Not Implemented | all | 1950 | | | | 1951 | 502 | Bad Gateway | all | 1952 | | | | 1953 | 503 | Service Unavailable | all | 1954 | | | | 1955 | 504 | Gateway Timeout | all | 1956 | | | | 1957 | 505 | RTSP Version Not Supported | all | 1958 | | | | 1959 | 551 | Option Not Support | all | 1960 +------+----------------------------------------+-----------------+ 1962 Table 4: Status codes and their usage with RTSP methods 1964 8.2. Response Headers 1966 The response-header allows the request recipient to pass additional 1967 information about the response which cannot be placed in the Status- 1968 Line. This header give information about the server and about 1969 further access to the resource identified by the Request-URI. All 1970 headers currently classified as response headers are listed in 1971 Table 5. 1973 +------------------------+--------------------+ 1974 | Header | Defined in Section | 1975 +------------------------+--------------------+ 1976 | Connection-Credentials | Section 16.12 | 1977 | | | 1978 | MTag | Section 16.30 | 1979 | | | 1980 | Location | Section 16.27 | 1981 | | | 1982 | Proxy-Authenticate | Section 16.33 | 1983 | | | 1984 | Public | Section 16.37 | 1985 | | | 1986 | Range | Section 16.38 | 1987 | | | 1988 | Retry-After | Section 16.42 | 1989 | | | 1990 | Scale | Section 16.44 | 1991 | | | 1992 | Session | Section 16.47 | 1993 | | | 1994 | Server | Section 16.46 | 1995 | | | 1996 | Speed | Section 16.48 | 1997 | | | 1998 | Transport | Section 16.52 | 1999 | | | 2000 | Unsupported | Section 16.53 | 2001 | | | 2002 | Vary | Section 16.55 | 2003 | | | 2004 | WWW-Authenticate | Section 16.57 | 2005 +------------------------+--------------------+ 2007 Table 5: The RTSP response headers 2009 Response-header names can be extended reliably only in combination 2010 with a change in the protocol version. However, the usage of 2011 feature-tags in the request allows the responding party to learn the 2012 capability of the receiver of the response. A new or experimental 2013 header MAY be given the semantics of response-header if all parties 2014 in the communication recognize them to be response-header. 2015 Unrecognized headers in responses are treated as message-headers. 2017 9. Message Body 2019 Request and Response messages MAY transfer a message body, if not 2020 otherwise restricted by the request method or response status code. 2021 The message body consists of message-body header fields and the 2022 content data itself. 2024 The SET_PARAMETER and GET_PARAMETER request and response, and 2025 DESCRIBE response MAY have an message body. All 4xx and 5xx 2026 responses MAY also have an message body. 2028 In this section, both sender and recipient refer to either the client 2029 or the server, depending on who sends and who receives the message 2030 body. 2032 9.1. Message-Body Header Fields 2034 Message-body header fields define meta-information about the content 2035 data in the message body. The message-body header fields are listed 2036 in Table 6. 2038 +------------------+--------------------+ 2039 | Header | Defined in Section | 2040 +------------------+--------------------+ 2041 | Allow | Section 16.6 | 2042 | | | 2043 | Content-Base | Section 16.13 | 2044 | | | 2045 | Content-Encoding | Section 16.14 | 2046 | | | 2047 | Content-Language | Section 16.15 | 2048 | | | 2049 | Content-Length | Section 16.16 | 2050 | | | 2051 | Content-Location | Section 16.17 | 2052 | | | 2053 | Content-Type | Section 16.18 | 2054 | | | 2055 | Expires | Section 16.21 | 2056 | | | 2057 | Last-Modified | Section 16.26 | 2058 +------------------+--------------------+ 2060 Table 6: The RTSP message-body headers 2062 The extension-header mechanism allows additional message-body header 2063 fields to be defined without changing the protocol, but these fields 2064 cannot be assumed to be recognizable by the recipient. Unrecognized 2065 header fields MUST be ignored by the recipient and forwarded by 2066 proxies. 2068 9.2. Message Body 2070 RTSP message with an message body MUST include the Content-Type and 2071 Content-Length headers. When a message body is included with a 2072 message, the data type of that content data is determined via the 2073 header fields Content-Type and Content-Encoding. 2075 Content-Type specifies the media type of the underlying data. 2076 Content-Encoding may be used to indicate any additional content 2077 codings applied to the data, usually for the purpose of data 2078 compression, that are a property of the requested resource. There is 2079 no default encoding. 2081 The Content-Length of a message is the length of the content, 2082 measured in bytes. 2084 10. Connections 2086 RTSP requests can be transmitted using the two different connection 2087 scenarios listed below: 2089 o persistent - a transport connection is used for several request/ 2090 response transactions; 2092 o transient - a transport connection is used for a single request/ 2093 response transaction. 2095 RFC 2326 attempted to specify an optional mechanism for transmitting 2096 RTSP messages in connectionless mode over a transport protocol such 2097 as UDP. However, it was not specified in sufficient detail to allow 2098 for interoperable implementations. In an attempt to reduce 2099 complexity and scope, and due to lack of interest, RTSP 2.0 does not 2100 attempt to define a mechanism for supporting RTSP over UDP or other 2101 connectionless transport protocols. A side-effect of this is that 2102 RTSP requests MUST NOT be sent to multicast groups since no 2103 connection can be established with a specific receiver in multicast 2104 environments. 2106 Certain RTSP headers, such as the CSeq header (Section 16.19), which 2107 may appear to be relevant only to connectionless transport scenarios 2108 are still retained and must be implemented according to the 2109 specification. In the case of CSeq, it is quite useful for matching 2110 responses to requests if the requests are pipelined (see Section 12). 2111 It is also useful in proxies for keeping track of the different 2112 requests when aggregating several client requests on a single TCP 2113 connection. 2115 10.1. Reliability and Acknowledgements 2117 Since RTSP messages are transmitted using reliable transport 2118 protocols, they MUST NOT be retransmitted at the RTSP protocol level. 2119 Instead, the implementation must rely on the underlying transport to 2120 provide reliability. The RTSP implementation may use any indication 2121 of reception acknowledgment of the message from the underlying 2122 transport protocols to optimize the RTSP behavior. 2124 If both the underlying reliable transport such as TCP and the RTSP 2125 application retransmit requests, each packet loss or message loss 2126 may result in two retransmissions. The receiver typically cannot 2127 take advantage of the application-layer retransmission since the 2128 transport stack will not deliver the application-layer 2129 retransmission before the first attempt has reached the receiver. 2130 If the packet loss is caused by congestion, multiple 2131 retransmissions at different layers will exacerbate the 2132 congestion. 2134 Lack of acknowledgment of an RTSP request should be handled within 2135 the constraints of the connection timeout considerations described 2136 below (Section 10.4). 2138 10.2. Using Connections 2140 A TCP transport can be used for both persistent connections (for 2141 several message exchanges) and transient connections (for a single 2142 message exchange). Implementations of this specification MUST 2143 support RTSP over TCP. The scheme of the RTSP URI (Section 4.2) 2144 indicates the default port that the server will listen on if the port 2145 is not explicitly given. 2147 A server MUST handle both persistent and transient connections. 2149 Transient connections facilitate mechanisms for fault tolerance. 2150 They also allow for application layer mobility. A server and 2151 client pair that support transient connections can survive the 2152 loss of a TCP connection; e.g., due to a NAT timeout. When the 2153 client has discovered that the TCP connection has been lost, it 2154 can set up a new one when there is need to communicate again. 2156 A persistent connection is RECOMMENDED to be used for all 2157 transactions between the server and client, including messages for 2158 multiple RTSP sessions. However, a persistent connection MAY be 2159 closed after a few message exchanges. For example, a client may use 2160 a persistent connection for the initial SETUP and PLAY message 2161 exchanges in a session and then close the connection. Later, when 2162 the client wishes to send a new request, such as a PAUSE for the 2163 session, a new connection would be opened. This connection may 2164 either be transient or persistent. 2166 An RTSP agent SHOULD NOT have more than one connection to the server 2167 at any given point. If a client or proxy handles multiple RTSP 2168 sessions on the same server, it SHOULD use only one connection for 2169 managing those sessions. 2171 This saves connection resources on the server. It also reduces 2172 complexity by enabling the server to maintain less state about its 2173 sessions and connections. 2175 RTSP allows a server to send requests to a client. However, this can 2176 be supported only if a client establishes a persistent connection 2177 with the server. In cases where a persistent connection does not 2178 exist between a server and its client, due to the lack of a signaling 2179 channel the server may be forced to silently discard RTSP messages, 2180 and may even drop an RTSP session without notifying the client. An 2181 example of such a case is when the server desires to send a REDIRECT 2182 request for an RTSP session to the client but is not able to do so 2183 because it cannot reach the client. A server that attempts to send a 2184 request to a client that has no connection currently to the server 2185 SHOULD discard the request directly, but it MAY queue it for later 2186 delivery. However, if the server queues the request it should when 2187 adding additional requests to the queue ensure to remove older 2188 requests that are now redundant. 2190 Without a persistent connection between the client and the server, 2191 the media server has no reliable way of reaching the client. 2192 Because the likely failure of server to client established 2193 connections the server will not even attempt establishing any 2194 connection. 2196 The sending of client and server requests can be asynchronous events. 2197 To avoid deadlock situations both client and server MUST be able to 2198 send and receive requests simultaneously. As an RTSP response may be 2199 queued up for transmission, reception or processing behind the peer 2200 RTSP agent's own requests, all RTSP agents are required to have a 2201 certain capability of handling outstanding messages. A potential 2202 issue is that outstanding requests may timeout despite them being 2203 processed by the peer due to the response is caught in the queue 2204 behind a number of request that the RTSP agent is processing but that 2205 take some time to complete. To avoid this problem an RTSP agent is 2206 recommended to buffer incoming messages locally so that any response 2207 messages can be processed immediately upon reception. If responses 2208 are separated from requests and directly forwarded for processing, 2209 not only the result be used immediately, the state associated with 2210 that outstanding request can also be released. However, buffering a 2211 number of requests on the receiving RTSP agent consumes resources and 2212 enables a resource exhaustion attack on the agent. Therefore this 2213 buffer should be limited so that an unreasonable number of requests 2214 or total message size is not allowed to consume the receiving agent's 2215 resources. In most APIs having the receiving agent stop reading from 2216 the TCP socket will result in TCP's window being clamped. Thus 2217 forcing the buffering onto the sending agent when the load is larger 2218 than expected. However, as both RTSP message sizes and frequency may 2219 be changed in the future by protocol extensions, an agent should be 2220 careful against taking harsher measurements against a potential 2221 attack. When under attack an RTSP agent can close TCP connections 2222 and release state associated with that TCP connection. 2224 To provide some guidance on what is reasonable the following 2225 guidelines are given. An RTSP agent should not have more than 10 2226 outstanding requests per RTSP session. An RTSP agent should not have 2227 more than 10 outstanding requests that aren't related to an RTSP 2228 session or that are requesting to create an RTSP session. 2230 In light of the above, it is RECOMMENDED that clients use persistent 2231 connections whenever possible. A client that supports persistent 2232 connections MAY "pipeline" its requests (see Section 12). 2234 10.3. Closing Connections 2236 The client MAY close a connection at any point when no outstanding 2237 request/response transactions exist for any RTSP session being 2238 managed through the connection. The server, however, SHOULD NOT 2239 close a connection until all RTSP sessions being managed through the 2240 connection have been timed out (Section 16.47). A server SHOULD NOT 2241 close a connection immediately after responding to a session-level 2242 TEARDOWN request for the last RTSP session being controlled through 2243 the connection. Instead, it should wait for a reasonable amount of 2244 time for the client to receive the TEARDOWN response, take 2245 appropriate action, and initiate the connection closing. The server 2246 SHOULD wait at least 10 seconds after sending the TEARDOWN response 2247 before closing the connection. 2249 This is to ensure that the client has time to issue a SETUP for a 2250 new session on the existing connection after having torn the last 2251 one down. 10 seconds should give the client ample opportunity to 2252 get its message to the server. 2254 A server SHOULD NOT close the connection directly as a result of 2255 responding to a request with an error code. 2257 Certain error responses such as "460 Only Aggregate Operation 2258 Allowed" (Section 15.4.25) are used for negotiating capabilities 2259 of a server with respect to content or other factors. In such 2260 cases, it is inefficient for the server to close a connection on 2261 an error response. Also, such behavior would prevent 2262 implementation of advanced/special types of requests or result in 2263 extra overhead for the client when testing for new features. On 2264 the flip side, keeping connections open after sending an error 2265 response poses a Denial of Service security risk (Section 21). 2267 The server MAY close a connection if he receives an incomplete 2268 message and if the message is not completed within a reasonable 2269 amount of time. It is RECOMMENDED that the server waits at least 10 2270 second for the completion of a message or for the next part of the 2271 message to arrive (which is an indication that the transport and the 2272 client are still alive). Servers believing they are under attack or 2273 otherwise starved for resources during that event consider using a 2274 shorter timeout. 2276 If a server closes a connection while the client is attempting to 2277 send a new request, the client will have to close its current 2278 connection, establish a new connection and send its request over the 2279 new connection. 2281 An RTSP message should not be terminated by closing the connection. 2282 Such a message MAY be considered to be incomplete by the receiver and 2283 discarded. An RTSP message is properly terminated as defined in 2284 Section 5. 2286 10.4. Timing Out Connections and RTSP Messages 2288 Receivers of a request (responder) SHOULD respond to requests in a 2289 timely manner even when a reliable transport such as TCP is used. 2290 Similarly, the sender of a request (requester) SHOULD wait for a 2291 sufficient time for a response before concluding that the responder 2292 will not be acting upon its request. 2294 A responder SHOULD respond to all requests within 5 seconds. If the 2295 responder recognizes that processing of a request will take longer 2296 than 5 seconds, it SHOULD send a 100 (Continue) response as soon as 2297 possible. It SHOULD continue sending a 100 response every 5 seconds 2298 thereafter until it is ready to send the final response to the 2299 requester. After sending a 100 response, the receiver MUST send a 2300 final response indicating the success or failure of the request. 2302 A requester SHOULD wait at least 10 seconds for a response before 2303 concluding that the responder will not be responding to its request. 2304 After receiving a 100 response, the requester SHOULD continue waiting 2305 for further responses. If more than 10 seconds elapses without 2306 receiving any response, the requester MAY assume that the responder 2307 is unresponsive and abort the connection. 2309 A requester SHOULD wait longer than 10 seconds for a response if it 2310 is experiencing significant transport delays on its connection to the 2311 responder. The requester is capable of determining the RTT of the 2312 request/response cycle using the Timestamp header (Section 16.51) in 2313 any RTSP request. 2315 10 seconds was chosen for the following reasons. It gives TCP 2316 time to perform a couple of retransmissions, even if operating on 2317 default values. It is short enough that users may not abandon the 2318 process themselves. However, it should be noted that 10 seconds 2319 can be aggressive on certain type of networks. The 5 seconds 2320 value for 1xx messages is half the timeout giving a reasonable 2321 change of successful delivery before timeout happens on the 2322 requester side. 2324 10.5. Showing Liveness 2326 The mechanisms for showing liveness of the client is, any RTSP 2327 request with a Session header, if RTP & RTCP is used an RTCP message, 2328 or through any other used media protocol capable of indicating 2329 liveness of the RTSP client. It is RECOMMENDED that a client does 2330 not wait to the last second of the timeout before trying to send a 2331 liveness message. The RTSP message may be lost or when using 2332 reliable protocols, such as TCP, the message may take some time to 2333 arrive safely at the receiver. To show liveness between RTSP request 2334 issued to accomplish other things, the following mechanisms can be 2335 used, in descending order of preference: 2337 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 2338 RTCP is used to report transport statistics, it MUST also work 2339 as keep alive. The server can determine the client by network 2340 address and port together with the fact that the client is 2341 reporting on the servers SSRC(s). A downside of using RTCP is 2342 that it only gives statistical guarantees to reach the server. 2343 However, the probability of a false client timeout is so low 2344 that it can be ignored in most cases. For example, assume a 2345 session with 60 seconds timeout and enough bitrate assigned to 2346 RTCP messages to send a message from client to server on 2347 average every 5 seconds. That client have, for a network with 2348 5 % packet loss, the probability to fail showing liveness sign 2349 in that session within the timeout interval of 2.4*E-16. In 2350 sessions with shorter timeouts, or much higher packet loss, or 2351 small RTCP bandwidths SHOULD also use any of the mechanisms 2352 below. 2354 SET_PARAMETER: When using SET_PARAMETER for keep alive, no body 2355 SHOULD be included. This method is the RECOMMENDED RTSP method 2356 to use for a request intended only to perform keep-alive. 2358 GET_PARAMETER: When using GET_PARAMETER for keep alive, no body 2359 SHOULD be included. 2361 OPTIONS: This method is also usable, but it causes the server to 2362 perform more unnecessary processing and result in bigger 2363 responses than necessary for the task. The reason is that the 2364 server needs to determine the capabilities associated with the 2365 media resource to correctly populate the Public and Allow 2366 headers. 2368 The timeout parameter MAY be included in a SETUP response, and MUST 2369 NOT be included in requests. The server uses it to indicate to the 2370 client how long the server is prepared to wait between RTSP commands 2371 or other signs of life before closing the session due to lack of 2372 activity (see Appendix B). The timeout is measured in seconds, with 2373 a default of 60 seconds. The length of the session timeout MUST NOT 2374 be changed in an established session. 2376 10.6. Use of IPv6 2378 Explicit IPv6 support was not present in RTSP 1.0 (RFC 2326). RTSP 2379 2.0 has been updated for explicit IPv6 support. Implementations of 2380 RTSP 2.0 MUST understand literal IPv6 addresses in URIs and headers. 2382 10.7. Overload Control 2384 Overload in RTSP can occur when server and proxies have insufficient 2385 resources to complete the processing of a request. An improper 2386 handling of such an overload situation at proxies and servers can 2387 impact the operation of the RTSP deployment, probably worsen the 2388 situation. RTSP defines the 503 (Service Unavailable) response 2389 (Section Section 15.5.4) to let servers and proxies notify requesting 2390 proxies and RTSP clients about an overload situation. In conjunction 2391 with the Retry-After header (Section Section 16.42) the server or 2392 proxy can indicate the time after the requesting entity can send 2393 another request to the proxy or server. 2395 Simply implementing and using the 503 (Service Unavailable) is not 2396 sufficient enough for properly handling overload situations. For 2397 instance, a simplistic approach would be to send the 503 response 2398 with a Retry-After header set to a fixed value. However, this can 2399 cause the situation where multiple RTSP clients again send requests 2400 to a proxy or server at roughly the same time which may again cause 2401 an overload situation, or if the "old" overload situation is not yet 2402 solved, i.e., the length indicated in the Retry-After header was too 2403 short. 2405 An RTSP server or proxy in an overload situation must select the 2406 value of the Retry-After header carefully and in dependency of its 2407 current load situation. It is RECOMMENDED to increase the length 2408 proportional with the current load of the server, i.e., an increasing 2409 workload should result in an increased length of the indicated 2410 unavailability. It is RECOMMENDED to not send the same value in the 2411 Retry-After header to all requesting proxies and clients, but to add 2412 a variation the mean value of the Retry-After header. 2414 Another issue are load balancing RTSP proxies, i.e., where an RTSP 2415 proxy is used to select amongst a set of RTSP servers to handled the 2416 requests, or when multiple server addresses are available for a given 2417 server name. The proxy or client may receive a 503 (Service 2418 Unavailable) from one of its RTSP servers or a TCP timeout (if the 2419 server is even unable to handled the request message). The proxy or 2420 client simply retries the other addresses, but may also receive a 503 2421 (Service Unavailable) response or TCP timeouts from those addresses. 2422 In such a situation, where none of the RTSP servers/addresses can 2423 handled the request, the RTSP agent has to wait before it can send 2424 any new requests to the RTSP server. Any additional request to a 2425 specific address MUST be delayed according to the Retry-After headers 2426 received. For addresses where no response was received or TCP 2427 timeout occurred, an initial wait timer SHOULD be set to 5 seconds. 2428 That timer MUST be doubled for each additional failure to connect or 2429 receive response. 2431 11. Capability Handling 2433 This section describes the available capability handling mechanism 2434 which allows RTSP to be extended. Extensions to this version of the 2435 protocol are basically done in two ways. First, new headers can be 2436 added. Secondly, new methods can be added. The capability handling 2437 mechanism is designed to handle both cases. 2439 When a method is added, the involved parties can use the OPTIONS 2440 method to discover whether it is supported. This is done by issuing 2441 a OPTIONS request to the other party. Depending on the URI it will 2442 either apply in regards to a certain media resource, the whole server 2443 in general, or simply the next hop. The OPTIONS response MUST 2444 contain a Public header which declares all methods supported for the 2445 indicated resource. 2447 It is not necessary to use OPTIONS to discover support of a method, 2448 as the client could simply try the method. If the receiver of the 2449 request does not support the method it will respond with an error 2450 code indicating the method is either not implemented (501) or does 2451 not apply for the resource (405). The choice between the two 2452 discovery methods depends on the requirements of the service. 2454 Feature-Tags are defined to handle functionality additions that are 2455 not new methods. Each feature-tag represents a certain block of 2456 functionality. The amount of functionality that a feature-tag 2457 represents can vary significantly. A feature-tag can for example 2458 represent the functionality a single RTSP header provides. Another 2459 feature-tag can represent much more functionality, such as the 2460 "play.basic" feature-tag which represents the minimal media delivery 2461 for playback implementation. 2463 Feature-tags are used to determine whether the client, server or 2464 proxy supports the functionality that is necessary to achieve the 2465 desired service. To determine support of a feature-tag, several 2466 different headers can be used, each explained below: 2468 Supported: This header is used to determine the complete set of 2469 functionality that both client and server have. The intended 2470 usage is to determine before one needs to use a functionality 2471 that it is supported. It can be used in any method, but 2472 OPTIONS is the most suitable one as it at the same time 2473 determines all methods that are implemented. When sending a 2474 request the requester declares all its capabilities by 2475 including all supported feature-tags. This results in the 2476 receiver learns the requester's feature support. The receiver 2477 then includes its set of features in the response. 2479 Proxy-Supported: This header is used similarly to the Supported 2480 header, but instead of giving the supported functionality of 2481 the client or server it provides both the requester and the 2482 responder a view of what functionality the proxy chain between 2483 the two supports. Proxies are required to add this header 2484 whenever the Supported header is present, but proxies may also 2485 add it independently of the requester. 2487 Require: This header can be included in any request where the end- 2488 point, i.e. the client or server, is required to understand the 2489 feature to correctly perform the request. This can, for 2490 example, be a SETUP request where the server is required to 2491 understand a certain parameter to be able to set up the media 2492 delivery correctly. Ignoring this parameter would not have the 2493 desired effect and is not acceptable. Therefore the end-point 2494 receiving a request containing a Require MUST negatively 2495 acknowledge any feature that it does not understand and not 2496 perform the request. The response in cases where features are 2497 not supported are 551 (Option Not Supported). Also the 2498 features that are not supported are given in the Unsupported 2499 header in the response. 2501 Proxy-Require: This header has the same purpose and workings as 2502 Require except that it only applies to proxies and not the end- 2503 point. Features that need to be supported by both proxies and 2504 end-points need to be included in both the Require and Proxy- 2505 Require header. 2507 Unsupported: This header is used in a 551 error response, to 2508 indicate which features were not supported. Such a response is 2509 only the result of the usage of the Require and/or Proxy- 2510 Require header where one or more feature where not supported. 2511 This information allows the requester to make the best of 2512 situations as it knows which features are not supported. 2514 12. Pipelining Support 2516 Pipelining is a general method to improve performance of request 2517 response protocols by allowing the requesting agent to have more than 2518 one request outstanding and send them over the same persistent 2519 connection. For RTSP, where the relative order of requests will 2520 matter, it is important to maintain the order of the requests. 2521 Because of this, the responding agent MUST process the incoming 2522 requests in their sending order. The sending order can be determined 2523 by the CSeq header and its sequence number. For TCP the delivery 2524 order will be the same as the sending order. The processing of the 2525 request MUST also have been finished before processing the next 2526 request from the same agent. The responses MUST be sent in the order 2527 the requests were processed. 2529 RTSP 2.0 has extended support for pipelining compared to RTSP 1.0. 2530 The major improvement is to allow all requests to setup and initiate 2531 media delivery to be pipelined after each other. This is 2532 accomplished by the utilization of the Pipelined-Requests header (see 2533 Section 16.32). This header allows a client to request that two or 2534 more requests are processed in the same RTSP session context which 2535 the first request creates. In other words, a client can request that 2536 two or more media streams are set-up and then played without needing 2537 to wait for a single response. This speeds up the initial startup 2538 time for an RTSP session with at least one RTT. 2540 If a pipelined request builds on the successful completion of one or 2541 more prior requests the requester must verify that all requests were 2542 executed as expected. A common example will be two SETUP requests 2543 and a PLAY request. In case one of the SETUP fails unexpectedly, the 2544 PLAY request can still be successfully executed. However, the 2545 resulting presentation will not be as expected by the requesting 2546 client, as only a single media instead of two will be played. In 2547 this case the client can send a PAUSE request, correct the failing 2548 SETUP request and then request it to be played. 2550 13. Method Definitions 2552 The method indicates what is to be performed on the resource 2553 identified by the Request-URI. The method name is case-sensitive. 2554 New methods may be defined in the future. Method names MUST NOT 2555 start with a $ character (decimal 36) and MUST be a token as defined 2556 by the ABNF [RFC5234] in the syntax chapter Section 20. The methods 2557 are summarized in Table 7. 2559 +---------------+-----------+--------+-------------+-------------+ 2560 | method | direction | object | Server req. | Client req. | 2561 +---------------+-----------+--------+-------------+-------------+ 2562 | DESCRIBE | C -> S | P,S | recommended | recommended | 2563 | | | | | | 2564 | GET_PARAMETER | C -> S | P,S | optional | optional | 2565 | | | | | | 2566 | | S -> C | P,S | optional | optional | 2567 | | | | | | 2568 | OPTIONS | C -> S | P,S | required | required | 2569 | | | | | | 2570 | | S -> C | P,S | optional | optional | 2571 | | | | | | 2572 | PAUSE | C -> S | P,S | required | required | 2573 | | | | | | 2574 | PLAY | C -> S | P,S | required | required | 2575 | | | | | | 2576 | PLAY_NOTIFY | S -> C | P,S | required | required | 2577 | | | | | | 2578 | REDIRECT | S -> C | P,S | optional | required | 2579 | | | | | | 2580 | SETUP | C -> S | S | required | required | 2581 | | | | | | 2582 | SET_PARAMETER | C -> S | P,S | required | optional | 2583 | | | | | | 2584 | | S -> C | P,S | optional | optional | 2585 | | | | | | 2586 | TEARDOWN | C -> S | P,S | required | required | 2587 | | | | | | 2588 | | S -> C | P | required | required | 2589 +---------------+-----------+--------+-------------+-------------+ 2591 Table 7: Overview of RTSP methods, their direction, and what objects 2592 (P: presentation, S: stream) they operate on. 2594 Note on Table 7: GET_PARAMETER is recommended, but not required. 2595 For example, a fully functional server can be built to deliver 2596 media without any parameters. SET_PARAMETER is required, however, 2597 due to its usage for keep-alive. PAUSE is now required because it 2598 is the only way of leaving the Play state without terminating the 2599 whole session. 2601 If an RTSP agent does not support a particular method, it MUST return 2602 501 (Not Implemented) and the requesting RTSP agent, in turn, SHOULD 2603 NOT try this method again for the given agent / resource combination. 2604 An RTSP proxy whose main function is to log or audit and not modify 2605 transport or media handling in any way MAY forward RTSP messages with 2606 unknown methods. Note that the proxy still needs to perform the 2607 minimal required processing, like adding the Via header. 2609 13.1. OPTIONS 2611 The semantics of the RTSP OPTIONS method is similar to that of the 2612 HTTP OPTIONS method described in [H9.2]. In RTSP however, OPTIONS is 2613 bi-directional, in that a client can request it to a server and vice 2614 versa. A client MUST implement the capability to send an OPTIONS 2615 request and a server or a proxy MUST implement the capability to 2616 respond to an OPTIONS request. The client, server or proxy MAY also 2617 implement the converse of their required capability. 2619 An OPTIONS request may be issued at any time. Such a request does 2620 not modify the session state. However, it may prolong the session 2621 lifespan (see below). The URI in an OPTIONS request determines the 2622 scope of the request and the corresponding response. If the Request- 2623 URI refers to a specific media resource on a given host, the scope is 2624 limited to the set of methods supported for that media resource by 2625 the indicated RTSP agent. A Request-URI with only the host address 2626 limits the scope to the specified RTSP agent's general capabilities 2627 without regard to any specific media. If the Request-URI is an 2628 asterisk ("*"), the scope is limited to the general capabilities of 2629 the next hop (i.e. the RTSP agent in direct communication with the 2630 request sender). 2632 Regardless of scope of the request, the Public header MUST always be 2633 included in the OPTIONS response listing the methods that are 2634 supported by the responding RTSP agent. In addition, if the scope of 2635 the request is limited to a media resource, the Allow header MUST be 2636 included in the response to enumerate the set of methods that are 2637 allowed for that resource unless the set of methods completely 2638 matches the set in the Public header. If the given resource is not 2639 available, the RTSP agent SHOULD return an appropriate response code 2640 such as 3rr or 4xx. The Supported header MAY be included in the 2641 request to query the set of features that are supported by the 2642 responding RTSP agent. 2644 The OPTIONS method can be used to keep an RTSP session alive. 2645 However, this is not the preferred way of session keep-alive 2646 signaling, see Section 16.47. An OPTIONS request intended for 2647 keeping alive an RTSP session MUST include the Session header with 2648 the associated session ID. Such a request SHOULD also use the media 2649 or the aggregated control URI as the Request-URI. 2651 Example: 2653 C->S: OPTIONS rtsp://server.example.com RTSP/2.0 2654 CSeq: 1 2655 User-Agent: PhonyClient/1.2 2656 Proxy-Require: gzipped-messages 2657 Supported: play.basic 2659 S->C: RTSP/2.0 200 OK 2660 CSeq: 1 2661 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS 2662 Supported: play.basic, setup.rtp.rtcp.mux, play.scale 2663 Server: PhonyServer/1.1 2665 Note that some of the feature-tags in Supported and Proxy-Require are 2666 fictional features. 2668 13.2. DESCRIBE 2670 The DESCRIBE method is used to retrieve the description of a 2671 presentation or media object from a server. The Request-URI of the 2672 DESCRIBE request identifies the media resource of interest. The 2673 client MAY include the Accept header in the request to list the 2674 description formats that it understands. The server MUST respond 2675 with a description of the requested resource and return the 2676 description in the message body of the response, if the DESCRIBE 2677 method request can be successfully fulfilled. The DESCRIBE reply- 2678 response pair constitutes the media initialization phase of RTSP. 2680 The DESCRIBE response SHOULD contain all media initialization 2681 information for the resource(s) that it describes. Servers SHOULD 2682 NOT use the DESCRIBE response as a means of media indirection by 2683 having the description point at another server; instead, using the 2684 3rr responses is RECOMMENDED. 2686 By forcing a DESCRIBE response to contain all media initialization 2687 for the set of streams that it describes, and discouraging the use 2688 of DESCRIBE for media indirection, any looping problems can be 2689 avoided that might have resulted from other approaches. 2691 Example: 2693 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/2.0 2694 CSeq: 312 2695 User-Agent: PhonyClient/1.2 2696 Accept: application/sdp, application/example 2698 S->C: RTSP/2.0 200 OK 2699 CSeq: 312 2700 Date: Thu, 23 Jan 1997 15:35:06 GMT 2701 Server: PhonyServer/1.1 2702 Content-Base: rtsp://server.example.com/fizzle/foo/ 2703 Content-Type: application/sdp 2704 Content-Length: 358 2706 v=0 2707 o=mhandley 2890844526 2890842807 IN IP4 192.0.2.46 2708 s=SDP Seminar 2709 i=A Seminar on the session description protocol 2710 u=http://www.example.com/lectures/sdp.ps 2711 e=seminar@example.com (Seminar Management) 2712 c=IN IP4 0.0.0.0 2713 a=control:* 2714 t=2873397496 2873404696 2715 m=audio 3456 RTP/AVP 0 2716 a=control:audio 2717 m=video 2232 RTP/AVP 31 2718 a=control:video 2720 Media initialization is a requirement for any RTSP-based system, but 2721 the RTSP specification does not dictate that this is required to be 2722 done via the DESCRIBE method. There are three ways that an RTSP 2723 client may receive initialization information: 2725 o via an RTSP DESCRIBE request 2727 o via some other protocol (HTTP, email attachment, etc.) 2729 o via some form of user interface 2731 If a client obtains a valid description from an alternate source, the 2732 client MAY use this description for initialization purposes without 2733 issuing a DESCRIBE request for the same media. The client should use 2734 any MTag to either validate the presentation description or make the 2735 session establishment conditional on being valid. 2737 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2738 and highly recommended that minimal clients support the ability to 2739 act as "helper applications" that accept a media initialization file 2740 from a user interface, and/or other means that are appropriate to the 2741 operating environment of the clients. 2743 13.3. SETUP 2745 The SETUP request for an URI specifies the transport mechanism to be 2746 used for the streamed media. The SETUP method may be used in two 2747 different cases; Create an RTSP session and change the transport 2748 parameters of already set up media stream. SETUP can be used in all 2749 three states; Init, and Ready, for both purposes and in PLAY to 2750 change the transport parameters. There is also a third possible 2751 usage for the SETUP method which is not specified in this memo: 2752 adding a media to a session. Using SETUP to add media to an existing 2753 session, when the session is in Play state, is unspecified. 2755 The Transport header, see Section 16.52, specifies the media 2756 transport parameters acceptable to the client for data transmission; 2757 the response will contain the transport parameters selected by the 2758 server. This allows the client to enumerate in descending order of 2759 preference the transport mechanisms and parameters acceptable to it, 2760 while the server can select the most appropriate. It is expected 2761 that the session description format used will enable the client to 2762 select a limited number possible configurations that are offered to 2763 the server to choose from. All transport related parameters shall be 2764 included in the Transport header; the use of other headers for this 2765 purpose is discouraged due to middleboxes, such as firewalls or NATs. 2767 For the benefit of any intervening firewalls, a client MUST indicate 2768 the known transport parameters, even if it has no influence over 2769 these parameters, for example, where the server advertises a fixed 2770 multicast address as destination. 2772 Since SETUP includes all transport initialization information, 2773 firewalls and other intermediate network devices (which need this 2774 information) are spared the more arduous task of parsing the 2775 DESCRIBE response, which has been reserved for media 2776 initialization. 2778 The client MUST include the Accept-Ranges header in the request 2779 indicating all supported unit formats in the Range header. This 2780 allows the server to know which format it may use in future session 2781 related responses, such as a PLAY response without any range in the 2782 request. If the client does not support a time format necessary for 2783 the presentation the server MUST respond using 456 (Header Field Not 2784 Valid for Resource) and include the Accept-Ranges header with the 2785 range unit formats supported for the resource. 2787 In a SETUP response the server MUST include the Accept-Ranges header 2788 (see Section 16.5) to indicate which time formats are acceptable to 2789 use for this media resource. 2791 The SETUP response 200 OK MUST include the Media-Properties header 2792 (see Section 16.28 ). The combination of the parameters of the 2793 Media-Properties header indicate the nature of the content present in 2794 the session (see also Section 4.9). For example, a live stream with 2795 time shifting is indicated by 2797 o Random Access set to Random-Access, 2799 o Content Modifications set to Time Progressing, 2801 o Retention set to Time-Duration (with specific recording window 2802 time value). 2804 The SETUP response 200 OK MUST include the Media-Range header (see 2805 Section 16.29) if the media is Time-Progressing. 2807 A basic example for SETUP: 2809 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 2810 CSeq: 302 2811 Transport: RTP/AVP;unicast;dest_addr=":4588"/":4589", 2812 RTP/AVP/TCP;unicast;interleaved=0-1 2813 Accept-Ranges: NPT, UTC 2814 User-Agent: PhonyClient/1.2 2816 S->C: RTSP/2.0 200 OK 2817 CSeq: 302 2818 Date: Thu, 23 Jan 1997 15:35:06 GMT 2819 Server: PhonyServer/1.1 2820 Session: 47112344;timeout=60 2821 Transport: RTP/AVP;unicast;dest_addr="192.0.2.53:4588"/ 2822 "192.0.2.53:4589"; src_addr="198.51.100.241:6256"/ 2823 "198.51.100.241:6257"; ssrc=2A3F93ED 2824 Accept-Ranges: NPT 2825 Media-Properties: Random-Access=3.2, Time-Progressing, 2826 Time-Duration=3600.0 2827 Media-Range: npt=0-2893.23 2829 In the above example the client wants to create an RTSP session 2830 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2831 The transport parameters acceptable to the client is either RTP/AVP/ 2832 UDP (UDP per default) to be received on client port 4588 and 4589 at 2833 the address the RTSP setup connection comes from or RTP/AVP 2834 interleaved on the RTSP control channel. The server selects the RTP/ 2835 AVP/UDP transport and adds the address and ports it will send and 2836 received RTP and RTCP from, and the RTP SSRC that will be used by the 2837 server. 2839 The server MUST generate a session identifier in response to a 2840 successful SETUP request, unless a SETUP request to a server includes 2841 a session identifier or an Pipelined-Requests header referencing an 2842 existing session context, in which case the server MUST bundle this 2843 setup request into the existing session (aggregated session) or 2844 return error 459 (Aggregate Operation Not Allowed) (see 2845 Section 15.4.24). An Aggregate control URI MUST be used to control 2846 an aggregated session. This URI MUST be different from the stream 2847 control URIs of the individual media streams included in the 2848 aggregate. The Aggregate control URI is to be specified by the 2849 session description if the server supports aggregated control and 2850 aggregated control is desired for the session. However, even if 2851 aggregated control is offered the client MAY chose to not set up the 2852 session in aggregated control. If an Aggregate control URI is not 2853 specified in the session description, it is normally an indication 2854 that non-aggregated control should be used. The SETUP of media 2855 streams in an aggregate which has not been given an aggregated 2856 control URI is unspecified. 2858 While the session ID sometimes carries enough information for 2859 aggregate control of a session, the Aggregate control URI is still 2860 important for some methods such as SET_PARAMETER where the control 2861 URI enables the resource in question to be easily identified. The 2862 Aggregate control URI is also useful for proxies, enabling them to 2863 route the request to the appropriate server, and for logging, 2864 where it is useful to note the actual resource that a request was 2865 operating on. 2867 A session will exist until it is either removed by a TEARDOWN request 2868 or is timed-out by the server. The server MAY remove a session that 2869 has not demonstrated liveness signs from the client(s) within a 2870 certain timeout period. The default timeout value is 60 seconds; the 2871 server MAY set this to a different value and indicate so in the 2872 timeout field of the Session header in the SETUP response. For 2873 further discussion see Section 16.47. Signs of liveness for an RTSP 2874 session are: 2876 o Any RTSP request from a client which includes a Session header 2877 with that session's ID. 2879 o If RTP is used as a transport for the underlying media streams, an 2880 RTCP sender or receiver report from the client(s) for any of the 2881 media streams in that RTSP session. RTCP Sender Reports may for 2882 example be received in sessions where the server is invited into a 2883 conference session and is valid for keep-alive. 2885 If a SETUP request on a session fails for any reason, the session 2886 state, as well as transport and other parameters for associated 2887 streams MUST remain unchanged from their values as if the SETUP 2888 request had never been received by the server. 2890 13.3.1. Changing Transport Parameters 2892 A client MAY issue a SETUP request for a stream that is already set 2893 up or playing in the session to change transport parameters, which a 2894 server MAY allow. If it does not allow changing of parameters, it 2895 MUST respond with error 455 (Method Not Valid In This State). The 2896 reasons to support changing transport parameters include allowing 2897 application layer mobility and flexibility to utilize the best 2898 available transport as it becomes available. If a client receives a 2899 455 when trying to change transport parameters while the server is in 2900 Play state, it MAY try to put the server in ready state using PAUSE, 2901 before issuing the SETUP request again. If that also fails the 2902 changing of transport parameters will require that the client 2903 performs a TEARDOWN of the affected media and then to set it up 2904 again. In aggregated session avoiding tearing down all the media at 2905 the same time will avoid the creation of a new session. 2907 All transport parameters MAY be changed. However, the primary usage 2908 expected is to either change the transport protocol completely, like 2909 switching from Interleaved TCP mode to UDP or vice versa, or to 2910 change the delivery address. 2912 In a SETUP response for a request to change the transport parameters 2913 while in Play state, the server MUST include the Range to indicate at 2914 what point the new transport parameters will be used. Further, if 2915 RTP is used for delivery, the server MUST also include the RTP-Info 2916 header to indicate at what timestamp and RTP sequence number the 2917 change will take place. If both RTP-Info and Range are included in 2918 the response the "rtp_time" parameter and start point in the Range 2919 header MUST be for the corresponding time, i.e. be used in the same 2920 way as for PLAY to ensure the correct synchronization information is 2921 available. 2923 If the transport parameters change while in Play state results in a 2924 change of synchronization related information, for example changing 2925 RTP SSRC, the server MUST provide in the SETUP response the necessary 2926 synchronization information. However, the server is RECOMMENDED to 2927 avoid changing the synchronization information if possible. 2929 13.4. PLAY 2931 This section describes the usage of the PLAY method in general, for 2932 aggregated sessions, and in different usage scenarios. 2934 13.4.1. General Usage 2936 The PLAY method tells the server to start sending data via the 2937 mechanism specified in SETUP and which part of the media should be 2938 played out. PLAY requests are valid when the session is in Ready or 2939 Play states. A PLAY request MUST include a Session header to 2940 indicate which session the request applies to. 2942 Upon receipt of the PLAY request, the server MUST position the normal 2943 play time to the beginning of the range specified in the received 2944 Range header and deliver stream data until the end of the range if 2945 given, until a new PLAY request is received, or until the end of the 2946 media is reached. If no Range header is present in the PLAY request 2947 the server SHALL play from current pause point until the end of 2948 media. The pause point defaults at session start to the beginning of 2949 the media. For media that is time-progressing and has no retention, 2950 the pause point will always be set equal to NPT "now", i.e., the 2951 current delivery point. The pause point may also be set to a 2952 particular point in the media by the PAUSE method, see Section 13.6. 2953 The pause point for media that is currently playing is equal to the 2954 current media position. For time-progressing media with time-limited 2955 retention, if the pause point represents a position that is older 2956 than what is retained by the server, the pause point will be moved to 2957 the oldest retained. 2959 What range values are valid depends on the type of content. For 2960 content that isn't time progressing the range value is valid if the 2961 given range is part of any media within the aggregate. In other 2962 words the valid media range for the aggregate is the union of all of 2963 the media components in the aggregate. If a given range value points 2964 outside of the media, the response MUST be the 457 (Invalid Range) 2965 error code and include the Media-Range header (Section 16.29) with 2966 the valid range for the media. Except for time progressing content 2967 where the client requests a start point prior to what is retained, 2968 the start point is adjusted to the oldest retained content. For a 2969 start point that is beyond the media front edge, i.e. beyond the 2970 current value for "now", the server SHALL adjust the start value to 2971 the current front edge. The Range header's stop point value may 2972 point beyond the current media edge. In that case, the server SHALL 2973 deliver media from the requested (and possibly adjusted) start point 2974 until the provided stop point, or the end of the media is reached 2975 prior to the specified stop point. Please note that if one simply 2976 wants to play from a particular start point until the end of media 2977 using an Range header with an implicit stop point is RECOMMENDED. 2979 If a client requests to start playing at the end of media, either 2980 explicitly with a Range header or implicitly with a pause point that 2981 is at the end of media, a 457 (Invalid Range) error MUST be sent and 2982 include the Media-Range header (Section 16.29). Below is specified 2983 that the Range header also must be included, and will in the case of 2984 Ready State carry the pause point. Note that this also applies if 2985 the pause point or requested start point is at the beginning of the 2986 media and a Scale header (Section 16.44) is included with a negative 2987 value (playing backwards). 2989 For media with random access properties a client may express its 2990 preference on which policy for start point selection the server shall 2991 use. This is done by including the Seek-Style header (Section 16.45) 2992 in the PLAY request. The Seek-Style applied will effect the content 2993 of the Range header as it will be adjusted to indicate from what 2994 point the media actually is delivered. 2996 A client desiring to play the media from the beginning MUST send a 2997 PLAY request with a Range header pointing at the beginning, e.g. 2998 npt=0-. If a PLAY request is received without a Range header and 2999 media delivery has stopped at the end, the server SHOULD respond with 3000 a 457 "Invalid Range" error response. In that response, the current 3001 pause point MUST be included in a Range header. 3003 All range specifiers in this specification allow for ranges with an 3004 implicit start point (e.g. "npt=-30"). When used in a PLAY request, 3005 the server treats this as a request to start or resume delivery from 3006 the current pause point, ending at the end time specified in the 3007 Range header. If the pause point is located later than the given end 3008 value, a 457 (Invalid Range) response MUST be given. 3010 The example below will play seconds 10 through 25. It also requests 3011 the server to deliver media from the first Random Access Point prior 3012 to the indicated start point. 3014 C->S: PLAY rtsp://audio.example.com/audio RTSP/2.0 3015 CSeq: 835 3016 Session: 12345678 3017 Range: npt=10-25 3018 Seek-Style: RAP 3019 User-Agent: PhonyClient/1.2 3021 Servers MUST include a "Range" header in any PLAY response, even if 3022 no Range header was present in the request. The response MUST use 3023 the same format as the request's range header contained. If no Range 3024 header was in the request, the format used in any previous PLAY 3025 request within the session SHOULD be used. If no format has been 3026 indicated in a previous request the server MAY use any time format 3027 supported by the media and indicated in the Accept-Ranges header in 3028 the SETUP request. It is RECOMMENDED that NPT is used if supported 3029 by the media. 3031 For any error response to a PLAY request, the server's response 3032 depends on the current session state. If the session is in Ready 3033 state, the current pause-point is returned using Range header with 3034 the pause point as the explicit start-point and an implicit stop- 3035 point. For time-progressing content where the pause-point moves with 3036 real-time due to limited retention, the current pause point is 3037 returned. For sessions in Play state, the current playout point and 3038 the remaining parts of the range request is returned. For any media 3039 with retention longer than 0 seconds the currently valid Media-Range 3040 header SHALL also be included in the response. 3042 A PLAY response MAY include a header carrying synchronization 3043 information. As the information necessary is dependent on the media 3044 transport format, further rules specifying the header and its usage 3045 are needed. For RTP the RTP-Info header is specified, see 3046 Section 16.43, and used in the following example. 3048 Here is a simple example for a single audio stream where the client 3049 requests the media starting from 3.52 seconds and to the end. The 3050 server sends a 200 OK response with the actual play time which is 10 3051 ms prior (3.51) and the RTP-Info header that contains the necessary 3052 parameters for the RTP stack. 3054 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3055 CSeq: 836 3056 Session: 12345678 3057 Range: npt=3.52- 3058 User-Agent: PhonyClient/1.2 3060 S->C: RTSP/2.0 200 OK 3061 CSeq: 836 3062 Date: Thu, 23 Jan 1997 15:35:06 GMT 3063 Server: PhonyServer/1.0 3064 Range: npt=3.51-324.39 3065 Seek-Style: First-Prior 3066 RTP-Info:url="rtsp://example.com/audio" 3067 ssrc=0D12F123:seq=14783;rtptime=2345962545 3069 S->C: RTP Packet TS=2345962545 => NPT=3.51 3070 Media duration=0.16 seconds 3072 The server replies with the actual start point that will be 3073 delivered. This may differ from the requested range if alignment of 3074 the requested range to valid frame boundaries is required for the 3075 media source. Note that some media streams in an aggregate may need 3076 to be delivered from even earlier points. Also, some media formats 3077 have a very long duration per individual data unit, therefore it 3078 might be necessary for the client to parse the data unit, and select 3079 where to start. The server SHALL also indicate which policy it uses 3080 for selecting the actual start point by including a Seek-Style 3081 header. 3083 In the following example the client receives the first media packet 3084 that stretches all the way up and past the requested playtime. Thus, 3085 it is the client's decision whether to render to the user the time 3086 between 3.52 and 7.05, or to skip it. In most cases it is probably 3087 most suitable not to render that time period. 3089 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3090 CSeq: 836 3091 Session: 12345678 3092 Range: npt=7.05- 3093 User-Agent: PhonyClient/1.2 3095 S->C: RTSP/2.0 200 OK 3096 CSeq: 836 3097 Date: Thu, 23 Jan 1997 15:35:06 GMT 3098 Server: PhonyServer/1.0 3099 Range: npt=3.52- 3100 Seek-Style: First-Prior 3101 RTP-Info:url="rtsp://example.com/audio" 3102 ssrc=0D12F123:seq=14783;rtptime=2345962545 3104 S->C: RTP Packet TS=2345962545 => NPT=3.52 3105 Duration=4.15 seconds 3107 After playing the desired range, the presentation does NOT transition 3108 to the Ready state, media delivery simply stops. A PAUSE request 3109 MUST be issued before the stream enters the Ready state. A PLAY 3110 request while the stream is still in the Play state is legal, and can 3111 be issued without an intervening PAUSE request. Such a request MUST 3112 replace the current PLAY action with the new one requested, i.e. 3113 being handle the same as the request was received in Ready state. In 3114 the case the range in Range header has a implicit start time 3115 (-endtime), the server MUST continue to play from where it currently 3116 was until the specified end point. This is useful to change end at 3117 another point than in the previous request. 3119 The following example plays the whole presentation starting at SMPTE 3120 time code 0:10:20 until the end of the clip. Note: The RTP-Info 3121 headers has been broken into several lines, where following lines 3122 start with whitespace as allowed by the syntax. 3124 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/2.0 3125 CSeq: 833 3126 Session: 12345678 3127 Range: smpte=0:10:20- 3128 User-Agent: PhonyClient/1.2 3130 S->C: RTSP/2.0 200 OK 3131 CSeq: 833 3132 Date: Thu, 23 Jan 1997 15:35:06 GMT 3133 Session: 12345678 3134 Server: PhonyServer/1.0 3135 Range: smpte=0:10:22-0:15:45 3136 Seek-Style: Next 3137 RTP-Info:url="rtsp://example.com/twister.en" 3138 ssrc=0D12F123:seq=14783;rtptime=2345962545 3140 For playing back a recording of a live presentation, it may be 3141 desirable to use clock units: 3143 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/2.0 3144 CSeq: 835 3145 Session: 12345678 3146 Range: clock=19961108T142300Z-19961108T143520Z 3147 User-Agent: PhonyClient/1.2 3149 S->C: RTSP/2.0 200 OK 3150 CSeq: 835 3151 Date: Thu, 23 Jan 1997 15:35:06 GMT 3152 Session: 12345678 3153 Server: PhonyServer/1.0 3154 Range: clock=19961108T142300Z-19961108T143520Z 3155 Seek-Style: Next 3156 RTP-Info:url="rtsp://example.com/meeting.en" 3157 ssrc=0D12F123:seq=53745;rtptime=484589019 3159 13.4.2. Aggregated Sessions 3161 PLAY requests can operate on sessions controlling a single media and 3162 on aggregated sessions controlling multiple media. 3164 In an aggregated session the PLAY request MUST contain an aggregated 3165 control URI. A server MUST respond with error 460 (Only Aggregate 3166 Operation Allowed) if the client PLAY Request-URI is for a single 3167 media. The media in an aggregate MUST be played in sync. If a 3168 client wants individual control of the media, it needs to use 3169 separate RTSP sessions for each media. 3171 For aggregated sessions where the initial SETUP request (creating a 3172 session) is followed by one or more additional SETUP requests, a PLAY 3173 request MAY be pipelined after those additional SETUP requests 3174 without awaiting their responses. This procedure can reduce the 3175 delay from start of session establishment until media play-out has 3176 started with one round trip time. However, a client needs to be 3177 aware that using this procedure will result in the playout of the 3178 server state established at the time of processing the PLAY, i.e., 3179 after the processing of all the requests prior to the PLAY request in 3180 the pipeline. This state may not be the intended one due to failure 3181 of any of the prior requests. A client can easily determine this 3182 based on the responses from those requests. In case of failure, the 3183 client can halt the media playout using PAUSE and try to establish 3184 the intended state again before issuing another PLAY request. 3186 13.4.3. Updating current PLAY Requests 3188 Clients can issue PLAY requests while the stream is in Play state and 3189 thus updating their request. 3191 The important difference compared to a PLAY request in Ready state is 3192 the handling of the current play point and how the Range header in 3193 request is constructed. The session is actively playing media and 3194 the play point will be moving, making the exact time a request will 3195 take action is hard to predict. Depending on how the PLAY header 3196 appears two different cases exist: total replacement or continuation. 3197 A total replacement is signaled by having the first range 3198 specification have an explicit start value, e.g. npt=45- or 3199 npt=45-60, in which case the server stops playout at the current 3200 playout point and then starts delivering media according to the Range 3201 header. This is equivalent to having the client first send a PAUSE 3202 and then a new play request that isn't based on the pause point. In 3203 the case of continuation the first range specifier has an implicit 3204 start point and a explicit stop value (Z), e.g. npt=-60, which 3205 indicate that it MUST convert the range specifier being played prior 3206 to this PLAY request (X to Y) into (X to Z) and continue as this was 3207 the request originally played. If the current delivery point is 3208 beyond the stop point, the server SHALL immediately pause delivery. 3209 As the request has been completed successfully it shall be responded 3210 with 200 OK. A PLAY_NOTIFY with end-of-stream is also sent to 3211 indicate the actual stop point. The pause point is set to the 3212 requested stop point. 3214 Following is an example of this behavior: The server has received 3215 requests to play ranges 10 to 15. If the new PLAY request arrives at 3216 the server 4 seconds after the previous one, it will take effect 3217 while the server still plays the first range (10-15). The server 3218 changes the current play to continue to 25 seconds, i.e. the 3219 equivalent single request would be PLAY with range: npt=10-25. 3221 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3222 CSeq: 834 3223 Session: 12345678 3224 Range: npt=10-15 3225 User-Agent: PhonyClient/1.2 3227 S->C: RTSP/2.0 200 OK 3228 CSeq: 834 3229 Date: Thu, 23 Jan 1997 15:35:06 GMT 3230 Session: 12345678 3231 Server: PhonyServer/1.0 3232 Range: npt=10-15 3233 Seek-Style: Next 3234 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3235 ssrc=0D12F123:seq=5712;rtptime=934207921, 3236 url="rtsp://example.com/fizzle/videotrack" 3237 ssrc=789DAF12:seq=57654;rtptime=2792482193 3238 Session: 12345678 3240 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3241 CSeq: 835 3242 Session: 12345678 3243 Range: npt=-25 3244 User-Agent: PhonyClient/1.2 3246 S->C: RTSP/2.0 200 OK 3247 CSeq: 835 3248 Date: Thu, 23 Jan 1997 15:35:09 GMT 3249 Session: 12345678 3250 Server: PhonyServer/1.0 3251 Range: npt=14-25 3252 Seek-Style: Next 3253 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3254 ssrc=0D12F123:seq=5712;rtptime=934239921, 3255 url="rtsp://example.com/fizzle/videotrack" 3256 ssrc=789DAF12:seq=57654;rtptime=2792842193 3258 A common use of a PLAY request while in Play state is changing the 3259 scale of the media, i.e., entering or leaving from fast forward or 3260 fast rewind. The client can issue an updating PLAY request that is 3261 either a continuation or a complete replacement, as discussed above 3262 this section. We give an example of a client that is requesting a 3263 fast forward without giving a stop point and the change from fast 3264 forward to regular playout (scale = 1). 3266 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3267 CSeq: 2034 3268 Session: 12345678 3269 Range: npt=now- 3270 Scale: 2.0 3271 User-Agent: PhonyClient/1.2 3273 S->C: RTSP/2.0 200 OK 3274 CSeq: 2034 3275 Date: Thu, 23 Jan 1997 15:35:06 GMT 3276 Session: 12345678 3277 Server: PhonyServer/1.0 3278 Range: npt=2:17:21.394- 3279 Seek-Style: Next 3280 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3281 ssrc=0D12F123:seq=5712;rtptime=934207921, 3282 url="rtsp://example.com/fizzle/videotrack" 3283 ssrc=789DAF12:seq=57654;rtptime=2792482193 3284 Session: 12345678 3286 [playing in fast forward and now returning to scale = 1] 3288 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3289 CSeq: 2035 3290 Session: 12345678 3291 Range: npt=now- 3292 Scale: 1.0 3293 User-Agent: PhonyClient/1.2 3295 S->C: RTSP/2.0 200 OK 3296 CSeq: 2035 3297 Date: Thu, 23 Jan 1997 15:35:09 GMT 3298 Session: 12345678 3299 Server: PhonyServer/1.0 3300 Range: npt=2:19:32.144- 3301 Seek-Style: Next 3302 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3303 ssrc=0D12F123:seq=5712;rtptime=934239921, 3304 url="rtsp://example.com/fizzle/videotrack" 3305 ssrc=789DAF12:seq=57654;rtptime=2792842193 3307 13.4.4. Playing On-Demand Media 3309 On-demand media is indicated by the content of the Media-Properties 3310 header in the SETUP response by (see also Section 16.28): 3312 o Random-Access property is set to Random Access; 3314 o Content Modifications set to Immutable; 3316 o Retention set to Unlimited or Time-Limited. 3318 Playing on-demand media follows the general usage as described in 3319 Section 13.4.1. 3321 13.4.5. Playing Dynamic On-Demand Media 3323 Dynamic on-demand media is indicated by the content of the Media- 3324 Properties header in the SETUP response by (see also Section 16.28): 3326 o RandomAccess set to Random-Access; 3328 o Content Modifications set to Dynamic; 3330 o Retention set to Unlimited or Time-Limited. 3332 Playing on-demand media follows the general usage as described in 3333 Section 13.4.1 as long as the media has not been changed. 3335 There are two ways for the client to be informed about changes of 3336 media resources in Play state. The client will receive a PLAY_NOTIFY 3337 request with Notify-Reason header set to media-properties-update (see 3338 Section 13.5.2. The client can use the value of the Media-Range to 3339 decide further actions, if the Media-Range header is present in the 3340 PLAY_NOTIFY request. The second way is that the client issues a 3341 GET_PARAMETER request without a body but including a Media-Range 3342 header. The 200 OK response MUST include the current Media-Range 3343 header (see Section 16.29). 3345 13.4.6. Playing Live Media 3347 Live media is indicated by the content of the Media-Properties header 3348 in the SETUP response by (see also Section 16.28): 3350 o Random-Access set to No-Seeking; 3352 o Content Modifications set to Time-Progressing; 3353 o Retention with Time-Duration set to 0.0. 3355 For live media, the SETUP response 200 OK MUST include the Media- 3356 Range header (see Section 16.29). 3358 A client MAY send PLAY requests without the Range header. If the 3359 request includes the Range header it MUST use a symbolic value 3360 representing "now". For NPT that range specification is "npt=now-". 3361 The server MUST include the Range header in the response and it MUST 3362 indicate an explicit time value and not a symbolic value. In other 3363 words, "npt=now-" is not a valid to use in the response. Instead the 3364 time since session start is recommended expressed as an open 3365 interval, e.g. "npt=96.23-". An absolute time value (clock) for the 3366 corresponding time MAY be given, i.e. "clock=20030213T143205Z-". The 3367 UTC clock format can only be used if client has shown support for it 3368 using the Accept-Ranges header. 3370 13.4.7. Playing Live with Recording 3372 Certain media server may offer recording services of live sessions to 3373 their clients. This recording would normally be from the beginning 3374 of the media session. Clients can randomly access the media between 3375 now and the beginning of the media session. This live media with 3376 recording is indicated by the content of the Media-Properties header 3377 in the SETUP response by (see also Section 16.28): 3379 o Random-Access set to Random-Access; 3381 o Content Modifications set to Time-Progressing; 3383 o Retention set to Time-limited or Unlimited 3385 The SETUP response 200 OK MUST include the Media-Range header (see 3386 Section 16.29) for this type of media. For live media with 3387 recording, the Range header indicates the current delivery point in 3388 the media and the Media-Range header indicates the currently 3389 available media window around the current time. This window can 3390 cover recorded content in the past (seen from current time in the 3391 media) or recorded content in the future (seen from current time in 3392 the media). The server adjusts the delivery point to the requested 3393 border of the window, if the client requests a delivery point that is 3394 located outside the recording windows, e.g., if requested to far in 3395 the past, the server selects the oldest range in the recording. The 3396 considerations in Section 13.5.3 apply, if a client requests delivery 3397 with Scale (Section 16.44) values other than 1.0 (Normal playback 3398 rate) while delivering live media with recording. 3400 13.4.8. Playing Live with Time-Shift 3402 Certain media server may offer time-shift services to their clients. 3403 This time shift records a fixed interval in the past, i.e., a sliding 3404 window recording mechanism, but not past this interval. Clients can 3405 randomly access the media between now and the interval. This live 3406 media with recording is indicated by the content of the Media- 3407 Properties header in the SETUP response by (see also Section 16.28): 3409 o Random-Access set to Random-Access; 3411 o Content Modifications set to Time-Progressing; 3413 o Retention set to Time-Duration and a value indicating the 3414 recording interval (>0). 3416 The SETUP response 200 OK MUST include the Media-Range header (see 3417 Section 16.29) for this type of media. For live media with recording 3418 the Range header indicates the current time in the media and the 3419 Media Range indicates a window around the current time. This window 3420 can cover recorded content in the past (seen from current time in the 3421 media) or recorded content in the future (seen from current time in 3422 the media). The server adjusts the play point to the requested 3423 border of the window, if the client requests a play point that is 3424 located outside the recording windows, e.g., if requested too far in 3425 the past, the server selects the oldest range in the recording. The 3426 considerations in Section 13.5.3 apply, if a client requests delivery 3427 using a Scale (Section 16.44) value other than 1.0 (Normal playback 3428 rate) while delivering live media with time-shift. 3430 13.5. PLAY_NOTIFY 3432 The PLAY_NOTIFY method is issued by a server to inform a client about 3433 an asynchronous event for a session in Play state. The Session 3434 header MUST be presented in a PLAY_NOTIFY request and indicates the 3435 scope of the request. Sending of PLAY_NOTIFY requests requires a 3436 persistent connection between server and client, otherwise there is 3437 no way for the server to send this request method to the client. 3439 PLAY_NOTIFY requests have an end-to-end (i.e. server to client) 3440 scope, as they carry the Session header, and apply only to the given 3441 session. The client SHOULD immediately return a response to the 3442 server. 3444 PLAY_NOTIFY requests MAY be used with a message body, depending on 3445 the value of the Notify-Reason header. It is described in the 3446 particular section for each Notify-Reason if a message body is used. 3447 However, currently there is no Notify-Reason that allows using a 3448 message body. In this case, there is a need to obey some limitations 3449 when adding new Notify-Reasons that intend to use a message body: the 3450 server can send any type of message body, but it is not ensured that 3451 the client can understand the received message body. This is related 3452 to DESCRIBE (see Section 13.2 ), but in this particular case the 3453 client can state its acceptable message bodies by using the Accept 3454 header. In the case of PLAY_NOTIFY, the server does not know which 3455 message bodies are understood by the client. 3457 The Notify-Reason header (see Section 16.31) specifies the reason why 3458 the server sends the PLAY_NOTIFY request. This is extensible and new 3459 reasons MAY be added in the future. In case the client does not 3460 understand the reason for the notification it MUST respond with an 3461 465 (Notification Reason Unknown) (Section 15.4.30) error code. 3462 Servers can send PLAY_NOTIFY with these types: 3464 o end-of-stream (see Section 13.5.1); 3466 o media-properties-update (see Section 13.5.2); 3468 o scale-change (see Section 13.5.3). 3470 13.5.1. End-of-Stream 3472 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3473 indicates the completion or near completion of the PLAY request and 3474 the ending delivery of the media stream(s). The request MUST NOT be 3475 issued unless the server is in the Play state. The end of the media 3476 stream delivery notification may be used to indicate either a 3477 successful completion of the PLAY request currently being served, or 3478 to indicate some error resulting in failure to complete the request. 3479 The Request-Status header (Section 16.40) MUST be included to 3480 indicate which request the notification is for and its completion 3481 status. The message response status codes (Section 8.1.1) are used 3482 to indicate how the PLAY request concluded. The sender of a 3483 PLAY_NOTIFY can issue an updated PLAY_NOTIFY, in the case of a 3484 PLAY_NOTIFY sent with wrong information. For instance, a PLAY_NOTIFY 3485 was issued before reaching the end-of-stream, but some error occurred 3486 resulting in that the previously sent PLAY_NOTIFY contained a wrong 3487 time when the stream will end. In this case a new PLAY_NOTIFY MUST 3488 be sent including the correct status for the completion and all 3489 additional information. 3491 PLAY_NOTIFY requests with Notify-Reason header set to end-of-stream 3492 MUST include a Range header and the Scale header if the scale value 3493 is not 1. The Range header indicates the point in the stream or 3494 streams where delivery is ending with the timescale that was used by 3495 the server in the PLAY response for the request being fulfilled. The 3496 server MUST NOT use the "now" constant in the Range header; it MUST 3497 use the actual numeric end position in the proper timescale. When 3498 end-of-stream notifications are issued prior to having sent the last 3499 media packets, this is evident as the end time in the Range header is 3500 beyond the current time in the media being received by the client, 3501 e.g., npt=-15, if npt is currently at 14.2 seconds. The Scale header 3502 is to be included so that it is evident if the media time scale is 3503 moving backwards and/or have a non-default pace. The end-of-stream 3504 notification does not prevent the client from sending a new PLAY 3505 request. 3507 If RTP is used as media transport, a RTP-Info header MUST be 3508 included, and the RTP-Info header MUST indicate the last sequence 3509 number in the seq parameter. 3511 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3512 MUST NOT carry a message body. 3514 This example request notifies the client about a future end-of-stream 3515 event: 3517 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3518 CSeq: 854 3519 Notify-Reason: end-of-stream 3520 Request-Status: cseq=853 status=200 reason="OK" 3521 Range: npt=-145 3522 RTP-Info:url="rtsp://example.com/audio" 3523 ssrc=0D12F123:seq=14783;rtptime=2345962545 3524 Session: uZ3ci0K+Ld-M 3525 Date: Mon, 08 Mar 2010 13:37:16 GMT 3527 C->S: RTSP/2.0 200 OK 3528 CSeq: 854 3529 User-Agent: PhonyClient/1.2 3530 Session: uZ3ci0K+Ld-M 3532 13.5.2. Media-Properties-Update 3534 A PLAY_NOTIFY request with Notify-Reason header set to media- 3535 properties-update indicates an update of the media properties for the 3536 given session (see Section 16.28) and/or the available media range 3537 that can be played as indicated by Media-Range (Section 16.29). 3538 PLAY_NOTIFY requests with Notify-Reason header set to media- 3539 properties-update MUST include a Media-Properties and Date header and 3540 SHOULD include a Media-Range header. 3542 This notification MUST be sent for media that are time-progressing 3543 every time an event happens that changes the basis for making 3544 estimates on how the media range progress. In addition it is 3545 RECOMMENDED that the server sends these notifications every 5 minutes 3546 for time-progressing content to ensure the long-term stability of the 3547 client estimation and allowing for clock skew detection by the 3548 client. Requests for the just mentioned reasons MUST include Media- 3549 Range header to provide current Media duration and the Range header 3550 to indicate the current playing point and any remaining parts of the 3551 requested range. 3553 The recommendation for sending updates every 5 minutes is due to 3554 any clock skew issues. In 5 minutes the clock skew should not 3555 become too significant as this is not used for media playback and 3556 synchronization, only for determining which content is available 3557 to the user. 3559 A PLAY_NOTIFY request with Notify-Reason header set to media- 3560 properties-update MUST NOT carry a message body. 3562 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3563 Date: Tue, 14 Apr 2008 15:48:06 GMT 3564 CSeq: 854 3565 Notify-Reason: media-properties-update 3566 Session: uZ3ci0K+Ld-M 3567 Media-Properties: Time-Progressing, 3568 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3569 Media-Range: npt=0-1:37:21.394 3570 Range: npt=1:15:49.873- 3572 C->S: RTSP/2.0 200 OK 3573 CSeq: 854 3574 User-Agent: PhonyClient/1.2 3575 Session: uZ3ci0K+Ld-M 3577 13.5.3. Scale-Change 3579 The server may be forced to change the rate, when a client request 3580 delivery using a Scale (Section 16.44) value other than 1.0 (normal 3581 playback rate). For time progressing media with some retention, i.e. 3582 the server stores already sent content, a client requesting to play 3583 with Scale values larger than 1 may catch up with the front end of 3584 the media. The server will then be unable to continue to provide 3585 with content at Scale larger than 1 as content is only made available 3586 by the server at Scale=1. Another case is when Scale < 1 and the 3587 media retention is time-duration limited. In this case the delivery 3588 point can reach the oldest media unit available, and further playback 3589 at this scale becomes impossible as there will be no media available. 3590 To avoid having the client lose any media, the scale will need to be 3591 adjusted to the same rate at which the media is removed from the 3592 storage buffer, commonly Scale = 1.0. 3594 Another case is when the content itself consists of spliced pieces or 3595 is dynamically updated. In these cases the server may be required to 3596 change from one supported scale value (different than Scale=1.0) to 3597 another. In this case the server will pick the closest value and 3598 inform the client of what it has picked. In these case the media 3599 properties will also be sent updating the supported Scale values. 3600 This enables a client to adjust the used Scale value. 3602 To minimize impact on playback in any of the above cases the server 3603 MUST modify the playback properties and set Scale to a supportable 3604 value and continue delivery the media. When doing this modification 3605 it MUST send a PLAY_NOTIFY message with the Notify-Reason header set 3606 to "scale-change". The request MUST contain a Range header with the 3607 media time where the change took effect, a Scale header with the new 3608 value in use, Session header with the ID for the session it applies 3609 to and a Date header with the server wallclock time of the change. 3610 For time progressing content also the Media-Range and the Media- 3611 Properties at this point in time MUST be included. The Media- 3612 Properties header MUST be included if the scale change was due to the 3613 content changing what scale values that is supported. 3615 For media streams being delivered using RTP also a RTP-Info header 3616 MUST be included. It MUST contain the rtptime parameter with a value 3617 corresponding to the point of change in that media and optionally 3618 also the sequence number. 3620 A PLAY_NOTIFY request with Notify-Reason header set to "Scale-Change" 3621 MUST NOT carry a message body. 3623 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3624 Date: Tue, 14 Apr 2008 15:48:06 GMT 3625 CSeq: 854 3626 Notify-Reason: scale-change 3627 Session: uZ3ci0K+Ld-M 3628 Media-Properties: Time-Progressing, 3629 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3630 Media-Range: npt=0-1:37:21.394 3631 Range: npt=1:37:21.394- 3632 Scale: 1 3633 RTP-Info: url="rtsp://example.com/fizzle/foo/audio" 3634 ssrc=0D12F123:rtptime=2345962545 3636 C->S: RTSP/2.0 200 OK 3637 CSeq: 854 3638 User-Agent: PhonyClient/1.2 3639 Session: uZ3ci0K+Ld-M 3641 13.6. PAUSE 3643 The PAUSE request causes the stream delivery to immediately be 3644 interrupted (halted). A PAUSE request MUST be done either with the 3645 aggregated control URI for aggregated sessions, resulting in all 3646 media being halted, or the media URI for non-aggregated sessions. 3647 Any attempt to do muting of a single media with an PAUSE request in 3648 an aggregated session MUST be responded to with error 460 (Only 3649 Aggregate Operation Allowed). After resuming playback, 3650 synchronization of the tracks MUST be maintained. Any server 3651 resources are kept, though servers MAY close the session and free 3652 resources after being paused for the duration specified with the 3653 timeout parameter of the Session header in the SETUP message. 3655 Example: 3657 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3658 CSeq: 834 3659 Session: 12345678 3660 User-Agent: PhonyClient/1.2 3662 S->C: RTSP/2.0 200 OK 3663 CSeq: 834 3664 Date: Thu, 23 Jan 1997 15:35:06 GMT 3665 Range: npt=45.76-75.00 3667 The PAUSE request causes stream delivery to be interrupted 3668 immediately on receipt of the message and the pause point is set to 3669 the current point in the presentation. That pause point in the media 3670 stream needs to be maintained. A subsequent PLAY request without 3671 Range header resume from the pause point and play until media end. 3673 The pause point after any PAUSE request MUST be returned to the 3674 client by adding a Range header with what remains unplayed of the 3675 PLAY request's range. For media with random access properties, if 3676 one desires to resume playing a ranged request, one simply includes 3677 the Range header from the PAUSE response and include the Seek-Style 3678 header with the Next policy in the PLAY request. For media that is 3679 time-progressing and has retention duration=0 the follow-up PLAY 3680 request to start media delivery again, will need to use "npt=now-" 3681 and not the answer given in the response to PAUSE. 3683 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3684 CSeq: 834 3685 Session: 12345678 3686 Range: npt=10-30 3687 User-Agent: PhonyClient/1.2 3689 S->C: RTSP/2.0 200 OK 3690 CSeq: 834 3691 Date: Thu, 23 Jan 1997 15:35:06 GMT 3692 Server: PhonyServer/1.0 3693 Range: npt=10-30 3694 Seek-Style: First-Prior 3695 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3696 ssrc=0D12F123:seq=5712;rtptime=934207921, 3697 url="rtsp://example.com/fizzle/videotrack" 3698 ssrc=4FAD8726:seq=57654;rtptime=2792482193 3699 Session: 12345678 3701 After 11 seconds, i.e. at 21 seconds into the presentation: 3702 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3703 CSeq: 835 3704 Session: 12345678 3705 User-Agent: PhonyClient/1.2 3707 S->C: RTSP/2.0 200 OK 3708 CSeq: 835 3709 Date: 23 Jan 1997 15:35:09 GMT 3710 Server: PhonyServer/1.0 3711 Range: npt=21-30 3712 Session: 12345678 3714 If a client issues a PAUSE request and the server acknowledges and 3715 enters the Ready state, the proper server response, if the player 3716 issues another PAUSE, is still 200 OK. The 200 OK response MUST 3717 include the Range header with the current pause point. See examples 3718 below: 3720 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3721 CSeq: 834 3722 Session: 12345678 3723 User-Agent: PhonyClient/1.2 3725 S->C: RTSP/2.0 200 OK 3726 CSeq: 834 3727 Session: 12345678 3728 Date: Thu, 23 Jan 1997 15:35:06 GMT 3729 Range: npt=45.76-98.36 3731 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3732 CSeq: 835 3733 Session: 12345678 3734 User-Agent: PhonyClient/1.2 3736 S->C: RTSP/2.0 200 OK 3737 CSeq: 835 3738 Session: 12345678 3739 Date: 23 Jan 1997 15:35:07 GMT 3740 Range: npt=45.76-98.36 3742 13.7. TEARDOWN 3744 13.7.1. Client to Server 3746 The TEARDOWN client to server request stops the stream delivery for 3747 the given URI, freeing the resources associated with it. A TEARDOWN 3748 request MAY be performed on either an aggregated or a media control 3749 URI. However, some restrictions apply depending on the current 3750 state. The TEARDOWN request MUST contain a Session header indicating 3751 what session the request applies to. 3753 A TEARDOWN using the aggregated control URI or the media URI in a 3754 session under non-aggregated control (single media session) MAY be 3755 done in any state (Ready and Play). A successful request MUST result 3756 in that media delivery being immediately halted and the session state 3757 being destroyed. This MUST be indicated through the lack of a 3758 Session header in the response. 3760 A TEARDOWN using a media URI in an aggregated session MAY only be 3761 done in Ready state. Such a request only removes the indicated media 3762 stream and associated resources from the session. This may result in 3763 that a session returns to non-aggregated control, due to that it only 3764 contains a single media after the requests completion. A session 3765 that will exist after the processing of the TEARDOWN request MUST in 3766 the response to that TEARDOWN request contain a Session header. Thus 3767 the presence of the Session header indicates to the receiver of the 3768 response if the session is still existing or has been removed. 3770 Example: 3772 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/2.0 3773 CSeq: 892 3774 Session: 12345678 3775 User-Agent: PhonyClient/1.2 3777 S->C: RTSP/2.0 200 OK 3778 CSeq: 892 3779 Server: PhonyServer/1.0 3781 13.7.2. Server to Client 3783 The server can send TEARDOWN requests in the server to client 3784 direction to indicate that the server has been forced to terminate 3785 the ongoing session. This may happen for several reasons, such as 3786 server maintenance without available backup, or that the session has 3787 been inactive for extended periods of time. The reason is provided 3788 in the Terminate-Reason header (Section 16.50). 3790 When a RTSP client has maintained a RTSP session that otherwise is 3791 inactive for an extended period of time the server may reclaim the 3792 resources. That is done by issuing a TEARDOWN request with the 3793 Terminate-Reason set to "Session-Timeout". This MAY be done when the 3794 client has been inactive in the RTSP session for more than one 3795 Session Timeout period (Section 16.47). However, the server is 3796 RECOMMENDED to not perform this operation until an extended period of 3797 inactivity has passed. The time period is considered extended when 3798 it is 10 times the Session Timeout period. Consideration of the 3799 application of the server and its content should be performed when 3800 configuring what is considered as extended periods of time. 3802 In case the server needs to stop providing service to the established 3803 sessions and their is no server to point at in a REDIRECT request 3804 TEARDOWN shall be used to terminate the session. This method can 3805 also be used when non-recoverable internal errors have happened and 3806 the server has no other option then to terminate the sessions. 3808 The TEARDOWN request MUST be only done on the session aggregate 3809 control URI (i.e., it is not allowed to terminate individual media 3810 streams) and MUST include the following headers; Session and 3811 Terminate-Reason headers. The request only applies to the session 3812 identified in the Session header. The server may include a message 3813 to the client's user with the "user-msg" parameter. 3815 The TEARDOWN request may alternatively be done on the wild card URI * 3816 and without any session header. The scope of such a request is 3817 limited to the next-hop (i.e. the RTSP agent in direct communication 3818 with the server) and applies, as well, to the control connection 3819 between the next-hop RTSP agent and the server. This request 3820 indicates that all sessions and pending requests being managed via 3821 the control connection are terminated. Any intervening proxies 3822 SHOULD do all of the following in the order listed: 3824 1. respond to the TEARDOWN request 3826 2. disconnect the control channel from the requesting server 3828 3. pass the TEARDOWN request to each applicable client (typically 3829 those clients with an active session or an unanswered request) 3831 Note: The proxy is responsible for accepting TEARDOWN responses 3832 from its clients; these responses MUST NOT be passed on to either 3833 the original server or the target server in the redirect. 3835 13.8. GET_PARAMETER 3837 The GET_PARAMETER request retrieves the value of any specified 3838 parameter or parameters for a presentation or stream specified in the 3839 URI. If the Session header is present in a request, the value of a 3840 parameter MUST be retrieved in the specified session context. There 3841 are two ways of specifying the parameters to be retrieved. The first 3842 is by including headers which have been defined such that you can use 3843 them for this purpose. Headers for this purpose should allow empty, 3844 or stripped value parts to avoid having to specify bogus data when 3845 indicating the desire to retrieve a value. The successful completion 3846 of the request should also be evident from any filled out values in 3847 the response. The Media-Range header (Section 16.29) is one such 3848 header. The other way is to specify a message body that lists the 3849 parameter(s) that are desired to be retrieved. The Content-Type 3850 header (Section 16.18) is used to specify which format the message 3851 body has. 3853 The headers that MAY be used for retrieving their current value using 3854 GET_PARAMETER are: 3856 o Accept-Ranges 3858 o Media-Range 3860 o Media-Properties 3862 o Range 3863 o RTP-Info 3865 The method MAY also be used without a message body or any header that 3866 request parameters for keep-alive purpose. Any request that is 3867 successful, i.e., a 200 OK response is received, then the keep-alive 3868 timer has been updated. Any non-required header present in such a 3869 request may or may not been processed. Normally the presence of 3870 filled out values in the header will be indication that the header 3871 has been processed. However, for cases when this is difficult to 3872 determine, it is recommended to use a feature-tag and the Require 3873 header. Due to this reason it is usually easier if any parameters to 3874 be retrieved are sent in the body, rather than using any header. 3876 Parameters specified within the body of the message must all be 3877 understood by the request receiving agent. If one or more parameters 3878 are not understood a 451 (Parameter Not Understood) MUST be sent 3879 including a body listing these parameters that weren't understood. 3880 If all parameters are understood their values are filled in and 3881 returned in the response message body. 3883 Example: 3885 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3886 CSeq: 431 3887 User-Agent: PhonyClient/1.2 3888 Session: 12345678 3889 Content-Length: 26 3890 Content-Type: text/parameters 3892 packets_received 3893 jitter 3895 C->S: RTSP/2.0 200 OK 3896 CSeq: 431 3897 Session: 12345678 3898 Server: PhonyServer/1.1 3899 Date: Mon, 08 Mar 2010 13:43:23 GMT 3900 Content-Length: 38 3901 Content-Type: text/parameters 3903 packets_received: 10 3904 jitter: 0.3838 3906 13.9. SET_PARAMETER 3908 This method requests to set the value of a parameter or a set of 3909 parameters for a presentation or stream specified by the URI. The 3910 method MAY also be used without a message body. It is the 3911 RECOMMENDED method to be used in a request sent for the sole purpose 3912 of updating the keep-alive timer. If this request is successful, 3913 i.e. a 200 OK response is received, then the keep-alive timer has 3914 been updated. Any non-required header present in such a request may 3915 or may not been processed. To allow a client to determine if any 3916 such header has been processed, it is necessary to use a feature tag 3917 and the Require header. Due to this reason it is RECOMMENDED that 3918 any parameters are sent in the body, rather than using any header. 3920 A request is RECOMMENDED to only contain a single parameter to allow 3921 the client to determine why a particular request failed. If the 3922 request contains several parameters, the server MUST only act on the 3923 request if all of the parameters can be set successfully. A server 3924 MUST allow a parameter to be set repeatedly to the same value, but it 3925 MAY disallow changing parameter values. If the receiver of the 3926 request does not understand or cannot locate a parameter, error 451 3927 (Parameter Not Understood) MUST be used. In the case a parameter is 3928 not allowed to change, the error code is 458 (Parameter Is Read- 3929 Only). The response body MUST contain only the parameters that have 3930 errors. Otherwise no body MUST be returned. 3932 Note: transport parameters for the media stream MUST only be set with 3933 the SETUP command. 3935 Restricting setting transport parameters to SETUP is for the 3936 benefit of firewalls. 3938 The parameters are split in a fine-grained fashion so that there 3939 can be more meaningful error indications. However, it may make 3940 sense to allow the setting of several parameters if an atomic 3941 setting is desirable. Imagine device control where the client 3942 does not want the camera to pan unless it can also tilt to the 3943 right angle at the same time. 3945 Example: 3947 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3948 CSeq: 421 3949 User-Agent: PhonyClient/1.2 3950 Session: iixT43KLc 3951 Date: Mon, 08 Mar 2010 14:45:04 GMT 3952 Content-length: 20 3953 Content-type: text/parameters 3955 barparam: barstuff 3957 S->C: RTSP/2.0 451 Parameter Not Understood 3958 CSeq: 421 3959 Session: iixT43KLc 3960 Server: PhonyServer/1.0 3961 Date: Mon, 08 Mar 2010 14:44:56 GMT 3962 Content-length: 10 3963 Content-type: text/parameters 3965 barparam: barstuff 3967 13.10. REDIRECT 3969 The REDIRECT method is issued by a server to inform a client that the 3970 service provided will be terminated and where a corresponding service 3971 can be provided instead. This may happen for different reasons. One 3972 is that the server is being administrated such that it must stop 3973 providing service. Thus the client is required to connect to another 3974 server location to access the resource indicated by the Request-URI. 3976 The REDIRECT request SHALL contain a Terminate-Reason header 3977 (Section 16.50) to inform the client of the reason for the request. 3978 Additional parameters related to the reason may also be included. 3979 The intention here is to allow a server administrator to do a 3980 controlled shutdown of the RTSP server. That requires sufficient 3981 time to inform all entities having associated state with the server 3982 and for them to perform a controlled migration from this server to a 3983 fall back server. 3985 A REDIRECT request with a Session header has end-to-end (i.e. server 3986 to client) scope and applies only to the given session. Any 3987 intervening proxies SHOULD NOT disconnect the control channel while 3988 there are other remaining end-to-end sessions. The REQUIRED Location 3989 header MUST contain a complete absolute URI pointing to the resource 3990 to which the client SHOULD reconnect. Specifically, the Location 3991 MUST NOT contain just the host and port. A client may receive a 3992 REDIRECT request with a Session header, if and only if, an end-to-end 3993 session has been established. 3995 A client may receive a REDIRECT request without a Session header at 3996 any time when it has communication or a connection established with a 3997 server. The scope of such a request is limited to the next-hop (i.e. 3998 the RTSP agent in direct communication with the server) and applies 3999 to all sessions controlled, as well as the control connection between 4000 the next-hop RTSP agent and the server. A REDIRECT request without a 4001 Session header indicates that all sessions and pending requests being 4002 managed via the control connection MUST be redirected. The REQUIRED 4003 Location header, if included in such a request, SHOULD contain an 4004 absolute URI with only the host address and the OPTIONAL port number 4005 of the server to which the RTSP agent SHOULD reconnect. Any 4006 intervening proxies SHOULD do all of the following in the order 4007 listed: 4009 1. respond to the REDIRECT request 4011 2. disconnect the control channel from the requesting server 4013 3. connect to the server at the given host address 4015 4. pass the REDIRECT request to each applicable client (typically 4016 those clients with an active session or an unanswered request) 4018 Note: The proxy is responsible for accepting REDIRECT responses 4019 from its clients; these responses MUST NOT be passed on to either 4020 the original server or the redirected server. 4022 When the server lacks any alternative server and needs to terminate a 4023 session or all sessions the TEARDOWN request SHALL be used instead. 4025 When no Terminate-Reason "time" parameter are included in a REDIRECT 4026 request, the client SHALL perform the redirection immediately and 4027 return a response to the server. The server shall consider the 4028 session as terminated and can free any associated state after it 4029 receives the successful (2xx) response. The server MAY close the 4030 signaling connection upon receiving the response and the client 4031 SHOULD close the signaling connection after sending the 2xx response. 4032 The exception to this is when the client has several sessions on the 4033 server being managed by the given signaling connection. In this 4034 case, the client SHOULD close the connection when it has received and 4035 responded to REDIRECT requests for all the sessions managed by the 4036 signaling connection. 4038 The Terminate-Reason header "time" parameter MAY be used to indicate 4039 the wallclock time by when the redirection MUST have take place. To 4040 allow a client to determine that redirect time without being time 4041 synchronized with the server, the server MUST include a Date header 4042 in the request. The client should have before the redirection time- 4043 line terminated the session and close the control connection. The 4044 server MAY simple cease to provide service when the deadline time has 4045 been reached, or it may issue TEARDOWN requests to the remaining 4046 sessions. 4048 If the REDIRECT request times out following the rules in Section 10.4 4049 the server MAY terminate the session or transport connection that 4050 would be redirected by the request. This is a safeguard against 4051 misbehaving clients that refuse to respond to a REDIRECT request. 4052 That should not provide any benefit. 4054 After a REDIRECT request has been processed, a client that wants to 4055 continue to send or receive media for the resource identified by the 4056 Request-URI will have to establish a new session with the designated 4057 host. If the URI given in the Location header is a valid resource 4058 URI, a client SHOULD issue a DESCRIBE request for the URI. 4060 Note: The media resource indicated by the Location header can be 4061 identical, slightly different or totally different. This is the 4062 reason why a new DESCRIBE request SHOULD be issued. 4064 If the Location header contains only a host address, the client MAY 4065 assume that the media on the new server is identical to the media on 4066 the old server, i.e. all media configuration information from the old 4067 session is still valid except for the host address. However, the 4068 usage of conditional SETUP using MTag identifiers are RECOMMENDED to 4069 verify the assumption. 4071 This example request redirects traffic for this session to the new 4072 server at the given absolute time: 4074 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/2.0 4075 CSeq: 732 4076 Location: rtsp://s2.example.com:8001 4077 Terminate-Reason: Server-Admin ;time=19960213T143205Z 4078 Session: uZ3ci0K+Ld-M 4079 Date: Thu, 13 Feb 1996 14:30:43 GMT 4081 C->S: RTSP/2.0 200 OK 4082 CSeq: 732 4083 User-Agent: PhonyClient/1.2 4084 Session: uZ3ci0K+Ld-M 4086 14. Embedded (Interleaved) Binary Data 4088 In order to fulfill certain requirements on the network side, e.g. in 4089 conjunction with network address translators that block RTP traffic 4090 over UDP, it may be necessary to interleave RTSP messages and media 4091 stream data. This interleaving should generally be avoided unless 4092 necessary since it complicates client and server operation and 4093 imposes additional overhead. Also, head of line blocking may cause 4094 problems. Interleaved binary data SHOULD only be used if RTSP is 4095 carried over TCP. Interleaved data is not allowed inside RTSP 4096 messages. 4098 Stream data such as RTP packets is encapsulated by an ASCII dollar 4099 sign (36 decimal), followed by a one-byte channel identifier, 4100 followed by the length of the encapsulated binary data as a binary, 4101 two-byte integer in network byte order. The stream data follows 4102 immediately afterwards, without a CRLF, but including the upper-layer 4103 protocol headers. Each $ block MUST contain exactly one upper-layer 4104 protocol data unit, e.g., one RTP packet. 4105 0 1 2 3 4106 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 4107 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4108 | "$" = 36 | Channel ID | Length in bytes | 4109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4110 : Length number of bytes of binary data : 4111 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4113 The channel identifier is defined in the Transport header with the 4114 interleaved parameter (Section 16.52). 4116 When the transport choice is RTP, RTCP messages are also interleaved 4117 by the server over the TCP connection. The usage of RTCP messages is 4118 indicated by including a interval containing a second channel in the 4119 interleaved parameter of the Transport header, see Section 16.52. If 4120 RTCP is used, packets MUST be sent on the first available channel 4121 higher than the RTP channel. The channels are bi-directional, using 4122 the same ChannelD in both directions, and therefore RTCP traffic are 4123 sent on the second channel in both directions. 4125 RTCP is sometime needed for synchronization when two or more 4126 streams are interleaved in such a fashion. Also, this provides a 4127 convenient way to tunnel RTP/RTCP packets through the TCP control 4128 connection when required by the network configuration and transfer 4129 them onto UDP when possible. 4131 C->S: SETUP rtsp://example.com/bar.file RTSP/2.0 4132 CSeq: 2 4133 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4134 Accept-Ranges: NPT, SMPTE, UTC 4135 User-Agent: PhonyClient/1.2 4137 S->C: RTSP/2.0 200 OK 4138 CSeq: 2 4139 Date: Thu, 05 Jun 1997 18:57:18 GMT 4140 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 4141 Session: 12345678 4142 Accept-Ranges: NPT 4143 Media-Properties: Random-Access=0.2, Immutable, Unlimited 4145 C->S: PLAY rtsp://example.com/bar.file RTSP/2.0 4146 CSeq: 3 4147 Session: 12345678 4148 User-Agent: PhonyClient/1.2 4150 S->C: RTSP/2.0 200 OK 4151 CSeq: 3 4152 Session: 12345678 4153 Date: Thu, 05 Jun 1997 18:57:19 GMT 4154 RTP-Info: url="rtsp://example.com/bar.file" 4155 ssrc=0D12F123:seq=232433;rtptime=972948234 4156 Range: npt=0-56.8 4157 Seek-Style: RAP 4159 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4160 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4161 S->C: $006{2 byte length}{"length" bytes RTCP packet} 4163 15. Status Code Definitions 4165 Where applicable, HTTP status [H10] codes are reused. Status codes 4166 that have the same meaning are not repeated here. See Table 4 for a 4167 listing of which status codes may be returned by which requests. All 4168 error messages, 4xx and 5xx MAY return a body containing further 4169 information about the error. 4171 15.1. Success 1xx 4173 15.1.1. 100 Continue 4175 The client SHOULD continue with its request. This interim response 4176 is used to inform the client that the initial part of the request has 4177 been received and has not yet been rejected by the server. The 4178 client SHOULD continue by sending the remainder of the request or, if 4179 the request has already been completed, ignore this response. The 4180 server MUST send a final response after the request has been 4181 completed. 4183 15.2. Success 2xx 4185 This class of status code indicates that the client's request was 4186 successfully received, understood, and accepted. 4188 15.2.1. 200 OK 4190 The request has succeeded. The information returned with the 4191 response is dependent on the method used in the request. 4193 15.3. Redirection 3xx 4195 The notation "3rr" indicates response codes from 300 to 399 inclusive 4196 which are meant for redirection. The response code 304 is excluded 4197 from this set, as it is not used for redirection. 4199 Within RTSP, redirection may be used for load balancing or 4200 redirecting stream requests to a server topologically closer to the 4201 client. Mechanisms to determine topological proximity are beyond the 4202 scope of this specification. 4204 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 4205 that they are used if necessary before a session is established, 4206 i.e., in response to DESCRIBE or SETUP. However, in cases where a 4207 server is not able to send a REDIRECT request to the client, the 4208 server MAY need to resort to using 3rr responses to inform a client 4209 with an established session about the need for redirecting the 4210 session. If a 3rr response is received for a request in relation to 4211 an established session, the client SHOULD send a TEARDOWN request for 4212 the session, and MAY reestablish the session using the resource 4213 indicated by the Location. 4215 If the Location header is used in a response it MUST contain an 4216 absolute URI pointing out the media resource the client is redirected 4217 to, the URI MUST NOT only contain the host name. 4219 15.3.1. 301 Moved Permanently 4221 The request resource are moved permanently and resides now at the URI 4222 given by the location header. The user client SHOULD redirect 4223 automatically to the given URI. This response MUST NOT contain a 4224 message-body. The Location header MUST be included in the response. 4226 15.3.2. 302 Found 4228 The requested resource resides temporarily at the URI given by the 4229 Location header. The Location header MUST be included in the 4230 response. This response is intended to be used for many types of 4231 temporary redirects; e.g., load balancing. It is RECOMMENDED that 4232 the server set the reason phrase to something more meaningful than 4233 "Found" in these cases. The user client SHOULD redirect 4234 automatically to the given URI. This response MUST NOT contain a 4235 message-body. 4237 This example shows a client being redirected to a different server: 4239 C->S: SETUP rtsp://example.com/fizzle/foo RTSP/2.0 4240 CSeq: 2 4241 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4242 Accept-Ranges: NPT, SMPTE, UTC 4243 User-Agent: PhonyClient/1.2 4245 S->C: RTSP/2.0 302 Try Other Server 4246 CSeq: 2 4247 Location: rtsp://s2.example.com:8001/fizzle/foo 4249 15.3.3. 303 See Other 4251 This status code MUST NOT be used in RTSP 2.0. However, it was 4252 allowed to use in RTSP 1.0 (RFC 2326). 4254 15.3.4. 304 Not Modified 4256 If the client has performed a conditional DESCRIBE or SETUP (see 4257 Section 16.24) and the requested resource has not been modified, the 4258 server SHOULD send a 304 response. This response MUST NOT contain a 4259 message-body. 4261 The response MUST include the following header fields: 4263 o Date 4265 o MTag and/or Content-Location, if the header(s) would have been 4266 sent in a 200 response to the same request. 4268 o Expires, Cache-Control, and/or Vary, if the field-value might 4269 differ from that sent in any previous response for the same 4270 variant. 4272 This response is independent for the DESCRIBE and SETUP requests. 4273 That is, a 304 response to DESCRIBE does NOT imply that the resource 4274 content is unchanged (only the session description) and a 304 4275 response to SETUP does NOT imply that the resource description is 4276 unchanged. The MTag and If-Match headers may be used to link the 4277 DESCRIBE and SETUP in this manner. 4279 15.3.5. 305 Use Proxy 4281 The requested resource MUST be accessed through the proxy given by 4282 the Location field. The Location field gives the URI of the proxy. 4283 The recipient is expected to repeat this single request via the 4284 proxy. 305 responses MUST only be generated by origin servers. 4286 15.4. Client Error 4xx 4288 15.4.1. 400 Bad Request 4290 The request could not be understood by the server due to malformed 4291 syntax. The client SHOULD NOT repeat the request without 4292 modifications. If the request does not have a CSeq header, the 4293 server MUST NOT include a CSeq in the response. 4295 15.4.2. 401 Unauthorized 4297 The request requires user authentication. The response MUST include 4298 a WWW-Authenticate header (Section 16.57) field containing a 4299 challenge applicable to the requested resource. The client MAY 4300 repeat the request with a suitable Authorization header field. If 4301 the request already included Authorization credentials, then the 401 4302 response indicates that authorization has been refused for those 4303 credentials. If the 401 response contains the same challenge as the 4304 prior response, and the user agent has already attempted 4305 authentication at least once, then the user SHOULD be presented the 4306 message body that was given in the response, since that message body 4307 might include relevant diagnostic information. HTTP access 4308 authentication is explained in [RFC2617]. 4310 15.4.3. 402 Payment Required 4312 This code is reserved for future use. 4314 15.4.4. 403 Forbidden 4316 The server understood the request, but is refusing to fulfill it. 4317 Authorization will not help and the request SHOULD NOT be repeated. 4318 If the server wishes to make public why the request has not been 4319 fulfilled, it SHOULD describe the reason for the refusal in the 4320 message body. If the server does not wish to make this information 4321 available to the client, the status code 404 (Not Found) can be used 4322 instead. 4324 15.4.5. 404 Not Found 4326 The server has not found anything matching the Request-URI. No 4327 indication is given of whether the condition is temporary or 4328 permanent. The 410 (Gone) status code SHOULD be used if the server 4329 knows, through some internally configurable mechanism, that an old 4330 resource is permanently unavailable and has no forwarding address. 4331 This status code is commonly used when the server does not wish to 4332 reveal exactly why the request has been refused, or when no other 4333 response is applicable. 4335 15.4.6. 405 Method Not Allowed 4337 The method specified in the request is not allowed for the resource 4338 identified by the Request-URI. The response MUST include an Allow 4339 header containing a list of valid methods for the requested resource. 4340 This status code is also to be used if a request attempts to use a 4341 method not indicated during SETUP. 4343 15.4.7. 406 Not Acceptable 4345 The resource identified by the request is only capable of generating 4346 response message bodies which have content characteristics not 4347 acceptable according to the accept headers sent in the request. 4349 The response SHOULD include an message body containing a list of 4350 available message body characteristics and location(s) from which the 4351 user or user agent can choose the one most appropriate. The message 4352 body format is specified by the media type given in the Content-Type 4353 header field. Depending upon the format and the capabilities of the 4354 user agent, selection of the most appropriate choice MAY be performed 4355 automatically. However, this specification does not define any 4356 standard for such automatic selection. 4358 If the response could be unacceptable, a user agent SHOULD 4359 temporarily stop receipt of more data and query the user for a 4360 decision on further actions. 4362 15.4.8. 407 Proxy Authentication Required 4364 This code is similar to 401 (Unauthorized) (Section 15.4.2), but 4365 indicates that the client must first authenticate itself with the 4366 proxy. The proxy MUST return a Proxy-Authenticate header field 4367 (Section 16.33) containing a challenge applicable to the proxy for 4368 the requested resource. 4370 15.4.9. 408 Request Timeout 4372 The client did not produce a request within the time that the server 4373 was prepared to wait. The client MAY repeat the request without 4374 modifications at any later time. 4376 15.4.10. 410 Gone 4378 The requested resource is no longer available at the server and the 4379 forwarding address is not known. This condition is expected to be 4380 considered permanent. If the server does not know, or has no 4381 facility to determine, whether or not the condition is permanent, the 4382 status code 404 (Not Found) SHOULD be used instead. This response is 4383 cacheable unless indicated otherwise. 4385 The 410 response is primarily intended to assist the task of 4386 repository maintenance by notifying the recipient that the resource 4387 is intentionally unavailable and that the server owners desire that 4388 remote links to that resource be removed. Such an event is common 4389 for limited-time, promotional services and for resources belonging to 4390 individuals no longer working at the server's site. It is not 4391 necessary to mark all permanently unavailable resources as "gone" or 4392 to keep the mark for any length of time -- that is left to the 4393 discretion of the owner of the server. 4395 15.4.11. 411 Length Required 4397 The server refuses to accept the request without a defined Content- 4398 Length. The client MAY repeat the request if it adds a valid 4399 Content-Length header field containing the length of the message-body 4400 in the request message. 4402 15.4.12. 412 Precondition Failed 4404 The precondition given in one or more of the request-header fields 4405 evaluated to false when it was tested on the server. This response 4406 code allows the client to place preconditions on the current resource 4407 meta information (header field data) and thus prevent the requested 4408 method from being applied to a resource other than the one intended. 4410 15.4.13. 413 Request Message Body Too Large 4412 The server is refusing to process a request because the request 4413 message body is larger than the server is willing or able to process. 4414 The server MAY close the connection to prevent the client from 4415 continuing the request. 4417 If the condition is temporary, the server SHOULD include a Retry- 4418 After header field to indicate that it is temporary and after what 4419 time the client MAY try again. 4421 15.4.14. 414 Request-URI Too Long 4423 The server is refusing to service the request because the Request-URI 4424 is longer than the server is willing to interpret. This rare 4425 condition is only likely to occur when a client has used a request 4426 with long query information, when the client has descended into a URI 4427 "black hole" of redirection (e.g., a redirected URI prefix that 4428 points to a suffix of itself), or when the server is under attack by 4429 a client attempting to exploit security holes present in some servers 4430 using fixed-length buffers for reading or manipulating the Request- 4431 URI. 4433 15.4.15. 415 Unsupported Media Type 4435 The server is refusing to service the request because the message 4436 body of the request is in a format not supported by the requested 4437 resource for the requested method. 4439 15.4.16. 451 Parameter Not Understood 4441 The recipient of the request does not support one or more parameters 4442 contained in the request. When returning this error message the 4443 sender SHOULD return a message body containing the offending 4444 parameter(s). 4446 15.4.17. 452 reserved 4448 This error code was removed from RFC 2326 [RFC2326] as it is 4449 obsolete. This error code MUST NOT be used anymore. 4451 15.4.18. 453 Not Enough Bandwidth 4453 The request was refused because there was insufficient bandwidth. 4454 This may, for example, be the result of a resource reservation 4455 failure. 4457 15.4.19. 454 Session Not Found 4459 The RTSP session identifier in the Session header is missing, 4460 invalid, or has timed out. 4462 15.4.20. 455 Method Not Valid in This State 4464 The client or server cannot process this request in its current 4465 state. The response MUST contain an Allow header to make error 4466 recovery possible. 4468 15.4.21. 456 Header Field Not Valid for Resource 4470 The server could not act on a required request header. For example, 4471 if PLAY contains the Range header field but the stream does not allow 4472 seeking. This error message may also be used for specifying when the 4473 time format in Range is impossible for the resource. In that case 4474 the Accept-Ranges header MUST be returned to inform the client of 4475 which format(s) that are allowed. 4477 15.4.22. 457 Invalid Range 4479 The Range value given is out of bounds, e.g., beyond the end of the 4480 presentation. 4482 15.4.23. 458 Parameter Is Read-Only 4484 The parameter to be set by SET_PARAMETER can be read but not 4485 modified. When returning this error message the sender SHOULD return 4486 a message body containing the offending parameter(s). 4488 15.4.24. 459 Aggregate Operation Not Allowed 4490 The requested method may not be applied on the URI in question since 4491 it is an aggregate (presentation) URI. The method may be applied on 4492 a media URI. 4494 15.4.25. 460 Only Aggregate Operation Allowed 4496 The requested method may not be applied on the URI in question since 4497 it is not an aggregate control (presentation) URI. The method may be 4498 applied on the aggregate control URI. 4500 15.4.26. 461 Unsupported Transport 4502 The Transport field did not contain a supported transport 4503 specification. 4505 15.4.27. 462 Destination Unreachable 4507 The data transmission channel could not be established because the 4508 client address could not be reached. This error will most likely be 4509 the result of a client attempt to place an invalid dest_addr 4510 parameter in the Transport field. 4512 15.4.28. 463 Destination Prohibited 4514 The data transmission channel was not established because the server 4515 prohibited access to the client address. This error is most likely 4516 the result of a client attempt to redirect media traffic to another 4517 destination with a dest_addr parameter in the Transport header. 4519 15.4.29. 464 Data Transport Not Ready Yet 4521 The data transmission channel to the media destination is not yet 4522 ready for carrying data. However, the responding agent still expects 4523 that the data transmission channel will be established at some point 4524 in time. Note, however, that this may result in a permanent failure 4525 like 462 "Destination Unreachable". 4527 An example when this error may occur is in the case a client sends a 4528 PLAY request to a server prior to ensuring that the TCP connections 4529 negotiated for carrying media data was successful established (In 4530 violation of this specification). The server would use this error 4531 code to indicate that the requested action could not be performed due 4532 to the failure of completing the connection establishment. 4534 15.4.30. 465 Notification Reason Unknown 4536 This indicates that the client has received a PLAY_NOTIFY 4537 (Section 13.5) with a Notify-Reason header (Section 16.31) unknown to 4538 the client. 4540 15.4.31. 466 Key Management Error 4542 This indicates that there has been an error in a Key Management 4543 function used in conjunction with a request. For example usage of 4544 MIKEY according to Appendix C.1.4.1 may result in this error. 4546 15.4.32. 470 Connection Authorization Required 4548 The secured connection attempt needs user or client authorization 4549 before proceeding. The next hops certificate is included in this 4550 response in the Accept-Credentials header. 4552 15.4.33. 471 Connection Credentials not accepted 4554 When performing a secure connection over multiple connections, a 4555 intermediary has refused to connect to the next hop and carry out the 4556 request due to unacceptable credentials for the used policy. 4558 15.4.34. 472 Failure to establish secure connection 4560 A proxy fails to establish a secure connection to the next hop RTSP 4561 agent. This is primarily caused by a fatal failure at the TLS 4562 handshake, for example due to server not accepting any cipher suits. 4564 15.5. Server Error 5xx 4566 Response status codes beginning with the digit "5" indicate cases in 4567 which the server is aware that it has erred or is incapable of 4568 performing the request The server SHOULD include an message body 4569 containing an explanation of the error situation, and whether it is a 4570 temporary or permanent condition. User agents SHOULD display any 4571 included message body to the user. These response codes are 4572 applicable to any request method. 4574 15.5.1. 500 Internal Server Error 4576 The server encountered an unexpected condition which prevented it 4577 from fulfilling the request. 4579 15.5.2. 501 Not Implemented 4581 The server does not support the functionality required to fulfill the 4582 request. This is the appropriate response when the server does not 4583 recognize the request method and is not capable of supporting it for 4584 any resource. 4586 15.5.3. 502 Bad Gateway 4588 The server, while acting as a gateway or proxy, received an invalid 4589 response from the upstream server it accessed in attempting to 4590 fulfill the request. 4592 15.5.4. 503 Service Unavailable 4594 The server is currently unable to handle the request due to a 4595 temporary overloading or maintenance of the server. The implication 4596 is that this is a temporary condition which will be alleviated after 4597 some delay. If known, the length of the delay MAY be indicated in a 4598 Retry-After header. If no Retry-After is given, the client SHOULD 4599 handle the response as it would for a 500 response. The client MUST 4600 honor the length, if given in the Retry-After header. 4602 Note: The existence of the 503 status code does not imply that 4603 a server must use it when becoming overloaded. Some servers 4604 may wish to simply refuse the connection. 4606 15.5.5. 504 Gateway Timeout 4608 The server, while acting as a proxy, did not receive a timely 4609 response from the upstream server specified by the URI or some other 4610 auxiliary server (e.g. DNS) it needed to access in attempting to 4611 complete the request. 4613 15.5.6. 505 RTSP Version Not Supported 4615 The server does not support, or refuses to support, the RTSP protocol 4616 version that was used in the request message. The server is 4617 indicating that it is unable or unwilling to complete the request 4618 using the same major version as the client other than with this error 4619 message. The response SHOULD contain an message body describing why 4620 that version is not supported and what other protocols are supported 4621 by that server. 4623 15.5.7. 551 Option not supported 4625 A feature-tag given in the Require or the Proxy-Require fields was 4626 not supported. The Unsupported header MUST be returned stating the 4627 feature for which there is no support. 4629 16. Header Field Definitions 4631 +---------------+----------------+--------+---------+------+ 4632 | method | direction | object | acronym | Body | 4633 +---------------+----------------+--------+---------+------+ 4634 | DESCRIBE | C -> S | P,S | DES | r | 4635 | | | | | | 4636 | GET_PARAMETER | C -> S, S -> C | P,S | GPR | R,r | 4637 | | | | | | 4638 | OPTIONS | C -> S, S -> C | P,S | OPT | | 4639 | | | | | | 4640 | PAUSE | C -> S | P,S | PSE | | 4641 | | | | | | 4642 | PLAY | C -> S | P,S | PLY | | 4643 | | | | | | 4644 | PLAY_NOTIFY | S -> C | P,S | PNY | R | 4645 | | | | | | 4646 | REDIRECT | S -> C | P,S | RDR | | 4647 | | | | | | 4648 | SETUP | C -> S | S | STP | | 4649 | | | | | | 4650 | SET_PARAMETER | C -> S, S -> C | P,S | SPR | R,r | 4651 | | | | | | 4652 | TEARDOWN | C -> S | P,S | TRD | | 4653 | | | | | | 4654 | | S -> C | P | TRD | | 4655 +---------------+----------------+--------+---------+------+ 4657 Table 8: Overview of RTSP methods, their direction, and what objects 4658 (P: presentation, S: stream) they operate on. Body notes if a method 4659 is allowed to carry body and in which direction, R = Request, 4660 r=response. Note: It is allowed for all error messages 4xx and 5xx to 4661 have a body 4663 The general syntax for header fields is covered in Section 5.2. This 4664 section lists the full set of header fields along with notes on 4665 meaning, and usage. The syntax definition for header fields are 4666 present in Section 20.2.3. Throughout this section, we use [HX.Y] to 4667 informational refer to Section X.Y of the current HTTP/1.1 4668 specification RFC 2616 [RFC2616]. Examples of each header field are 4669 given. 4671 Information about header fields in relation to methods and proxy 4672 processing is summarized in Table 9, Table 10, Table 11, and 4673 Table 12. 4675 The "where" column describes the request and response types in which 4676 the header field can be used. Values in this column are: 4678 R: header field may only appear in requests; 4680 r: header field may only appear in responses; 4682 2xx, 4xx, etc.: A numerical value or range indicates response codes 4683 with which the header field can be used; 4685 c: header field is copied from the request to the response. 4687 An empty entry in the "where" column indicates that the header field 4688 may be present in both requests and responses. 4690 The "proxy" column describes the operations a proxy may perform on a 4691 header field. An empty proxy column indicates that the proxy MUST 4692 NOT do any changes to that header, all allowed operations are 4693 explicitly stated: 4695 a: A proxy can add or concatenate the header field if not present. 4697 m: A proxy can modify an existing header field value. 4699 d: A proxy can delete a header field value. 4701 r: A proxy needs to be able to read the header field, and thus 4702 this header field cannot be encrypted. 4704 The rest of the columns relate to the presence of a header field in a 4705 method. The method names when abbreviated, are according to Table 8: 4707 c: Conditional; requirements on the header field depend on the 4708 context of the message. 4710 m: The header field is mandatory. 4712 m*: The header field SHOULD be sent, but clients/servers need to be 4713 prepared to receive messages without that header field. 4715 o: The header field is optional. 4717 *: The header field MUST be present if the message body is not 4718 empty. See Section 16.16, Section 16.18 and Section 5.3 for 4719 details. 4721 -: The header field is not applicable. 4723 "Optional" means that a Client/Server MAY include the header field in 4724 a request or response. The Client/Server behavior when receiving 4725 such headers varies, for some it may ignore the header field, in 4726 other case it is request to process the header. This is regulated by 4727 the method and header descriptions. Example of headers that require 4728 processing are the Require and Proxy-Require header fields discussed 4729 in Section 16.41 and Section 16.35. A "mandatory" header field MUST 4730 be present in a request, and MUST be understood by the Client/Server 4731 receiving the request. A mandatory response header field MUST be 4732 present in the response, and the header field MUST be understood by 4733 the Client/Server processing the response. "Not applicable" means 4734 that the header field MUST NOT be present in a request. If one is 4735 placed in a request by mistake, it MUST be ignored by the Client/ 4736 Server receiving the request. Similarly, a header field labeled "not 4737 applicable" for a response means that the Client/Server MUST NOT 4738 place the header field in the response, and the Client/Server MUST 4739 ignore the header field in the response. 4741 An RTSP agent MUST ignore extension headers that are not understood. 4743 The From and Location header fields contain an URI. If the URI 4744 contains a comma, or semicolon, the URI MUST be enclosed in double 4745 quotes ("). Any URI parameters are contained within these quotes. 4746 If the URI is not enclosed in double quotas, any semicolon- delimited 4747 parameters are header-parameters, not URI parameters. 4749 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4750 | Header | Where | Pro | DE | OPT | STP | PLY | PSE | TRD | 4751 | | | xy | S | | | | | | 4752 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4753 | Accept | R | | o | - | - | - | - | - | 4754 | | | | | | | | | | 4755 | Accept-Credentia | R | rm | o | o | o | o | o | o | 4756 | ls | | | | | | | | | 4757 | | | | | | | | | | 4758 | Accept-Encoding | R | r | o | - | - | - | - | - | 4759 | | | | | | | | | | 4760 | Accept-Language | R | r | o | - | - | - | - | - | 4761 | | | | | | | | | | 4762 | Accept-Ranges | R | r | - | - | m | - | - | - | 4763 | | | | | | | | | | 4764 | Accept-Ranges | r | r | - | - | m | - | - | - | 4765 | | | | | | | | | | 4766 | Accept-Ranges | 456 | r | - | - | - | m | - | - | 4767 | | | | | | | | | | 4768 | Allow | r | am | c | c | c | - | - | - | 4769 | | | | | | | | | | 4770 | Allow | 405 | am | m | m | m | m | m | m | 4771 | | | | | | | | | | 4772 | Authorization | R | | o | o | o | o | o | o | 4773 | | | | | | | | | | 4774 | Bandwidth | R | | o | o | o | o | - | - | 4775 | | | | | | | | | | 4776 | Blocksize | R | | o | - | o | o | - | - | 4777 | | | | | | | | | | 4778 | Cache-Control | | r | o | - | o | - | - | - | 4779 | | | | | | | | | | 4780 | Connection | | ad | o | o | o | o | o | o | 4781 | | | | | | | | | | 4782 | Connection-Crede | 470,4 | ar | o | o | o | o | o | o | 4783 | ntials | 07 | | | | | | | | 4784 | | | | | | | | | | 4785 | Content-Base | r | | o | - | - | - | - | - | 4786 | | | | | | | | | | 4787 | Content-Base | 4xx,5 | | o | o | o | o | o | o | 4788 | | xx | | | | | | | | 4789 | | | | | | | | | | 4790 | Content-Encoding | R | r | - | - | - | - | - | - | 4791 | | | | | | | | | | 4792 | Content-Encoding | r | r | o | - | - | - | - | - | 4793 | | | | | | | | | | 4794 | Content-Encoding | 4xx,5 | r | o | o | o | o | o | o | 4795 | | xx | | | | | | | | 4796 | | | | | | | | | | 4797 | Content-Language | R | r | - | - | - | - | - | - | 4798 | | | | | | | | | | 4799 | Content-Language | r | r | o | - | - | - | - | - | 4800 | | | | | | | | | | 4801 | Content-Language | 4xx,5 | r | o | o | o | o | o | o | 4802 | | xx | | | | | | | | 4803 | | | | | | | | | | 4804 | Content-Length | r | r | * | - | - | - | - | - | 4805 | | | | | | | | | | 4806 | Content-Length | 4xx,5 | r | * | * | * | * | * | * | 4807 | | xx | | | | | | | | 4808 | | | | | | | | | | 4809 | Content-Location | r | r | o | - | - | - | - | - | 4810 | | | | | | | | | | 4811 | Content-Location | 4xx,5 | r | o | o | o | o | o | o | 4812 | | xx | | | | | | | | 4813 | | | | | | | | | | 4814 | Content-Type | r | r | * | - | - | - | - | - | 4815 | | | | | | | | | | 4816 | Content-Type | 4xx,5 | ar | * | * | * | * | * | * | 4817 | | xx | | | | | | | | 4818 | | | | | | | | | | 4819 | CSeq | Rc | rm | m | m | m | m | m | m | 4820 | | | | | | | | | | 4821 | Date | | am | o/ | o/* | o/* | o/* | o/* | o/* | 4822 | | | | * | | | | | | 4823 | | | | | | | | | | 4824 | Expires | r | r | o | - | - | - | - | - | 4825 | | | | | | | | | | 4826 | From | R | r | o | o | o | o | o | o | 4827 | | | | | | | | | | 4828 | If-Match | R | r | - | - | o | - | - | - | 4829 | | | | | | | | | | 4830 | If-Modified-Sinc | R | r | o | - | o | - | - | - | 4831 | e | | | | | | | | | 4832 | | | | | | | | | | 4833 | If-None-Match | R | r | o | - | o | - | - | - | 4834 | | | | | | | | | | 4835 | Last-Modified | r | r | o | - | o | - | - | - | 4836 | | | | | | | | | | 4837 | Location | 3rr | | o | o | o | o | o | o | 4838 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4840 Table 9: Overview of RTSP header fields (A-L) related to methods 4841 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4843 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4844 | Header | Where | Prox | DES | OPT | STP | PLY | PSE | TRD | 4845 | | | y | | | | | | | 4846 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4847 | Media- | | | - | - | m | m | m | - | 4848 | Properties | | | | | | | | | 4849 | | | | | | | | | | 4850 | Media-Range | | | - | - | m | m | m | - | 4851 | | | | | | | | | | 4852 | MTag | r | r | o | - | o | - | - | - | 4853 | | | | | | | | | | 4854 | Pipelined- | | amdr | - | o | o | o | o | o | 4855 | Requests | | | | | | | | | 4856 | | | | | | | | | | 4857 | Proxy- | 407 | amr | m | m | m | m | m | m | 4858 | Authenticate | | | | | | | | | 4859 | | | | | | | | | | 4860 | Proxy- | R | rd | o | o | o | o | o | o | 4861 | Authorization | | | | | | | | | 4862 | | | | | | | | | | 4863 | Proxy- | R | ar | o | o | o | o | o | o | 4864 | Require | | | | | | | | | 4865 | | | | | | | | | | 4866 | Proxy- | r | r | c | c | c | c | c | c | 4867 | Require | | | | | | | | | 4868 | | | | | | | | | | 4869 | Proxy- | R | amr | c | c | c | c | c | c | 4870 | Supported | | | | | | | | | 4871 | | | | | | | | | | 4872 | Proxy- | r | | c | c | c | c | c | c | 4873 | Supported | | | | | | | | | 4874 | | | | | | | | | | 4875 | Public | r | amr | - | m | - | - | - | - | 4876 | | | | | | | | | | 4877 | Public | 501 | amr | m | m | m | m | m | m | 4878 | | | | | | | | | | 4879 | Range | R | | - | - | - | o | - | - | 4880 | | | | | | | | | | 4881 | Range | r | | - | - | c | m | m | - | 4882 | | | | | | | | | | 4883 | Terminate-Rea | R | r | - | - | - | - | - | - | 4884 | son | | | | | | | | | 4885 | | | | | | | | | | 4886 | Referrer | R | | o | o | o | o | o | o | 4887 | | | | | | | | | | 4888 | Request- | R | | - | - | - | - | - | - | 4889 | Status | | | | | | | | | 4890 | | | | | | | | | | 4891 | Require | R | | o | o | o | o | o | o | 4892 | | | | | | | | | | 4893 | Retry-After | 3rr,50 | | o | o | o | o | o | - | 4894 | | 3 | | | | | | | | 4895 | | | | | | | | | | 4896 | Retry-After | 413 | | o | - | - | - | - | - | 4897 | | | | | | | | | | 4898 | RTP-Info | r | | - | - | c | c | - | - | 4899 | | | | | | | | | | 4900 | Scale | R | r | - | - | - | o | - | - | 4901 | | | | | | | | | | 4902 | Scale | r | amr | - | - | - | c | - | - | 4903 | | | | | | | | | | 4904 | Seek-Style | R | | - | - | - | o | - | - | 4905 | | | | | | | | | | 4906 | Seek-Style | r | | - | - | - | m | - | - | 4907 | | | | | | | | | | 4908 | Server | R | r | - | o | - | - | - | o | 4909 | | | | | | | | | | 4910 | Server | r | r | o | o | o | o | o | o | 4911 | | | | | | | | | | 4912 | Session | R | r | - | o | o | m | m | m | 4913 | | | | | | | | | | 4914 | Session | r | r | - | c | m | m | m | o | 4915 | | | | | | | | | | 4916 | Speed | R | admr | - | - | - | o | - | - | 4917 | Speed | r | admr | - | - | - | c | - | - | 4918 | | | | | | | | | | 4919 | Supported | R | amr | o | o | o | o | o | o | 4920 | | | | | | | | | | 4921 | Supported | r | amr | c | c | c | c | c | c | 4922 | | | | | | | | | | 4923 | Timestamp | R | admr | o | o | o | o | o | o | 4924 | | | | | | | | | | 4925 | Timestamp | c | admr | m | m | m | m | m | m | 4926 | | | | | | | | | | 4927 | Transport | | mr | - | - | m | - | - | - | 4928 | | | | | | | | | | 4929 | Unsupported | r | | c | c | c | c | c | c | 4930 | | | | | | | | | | 4931 | User-Agent | R | | m* | m* | m* | m* | m* | m* | 4932 | | | | | | | | | | 4933 | Vary | r | | c | c | c | c | c | c | 4934 | | | | | | | | | | 4935 | Via | R | amr | o | o | o | o | o | o | 4936 | | | | | | | | | | 4937 | Via | c | dr | m | m | m | m | m | m | 4938 | | | | | | | | | | 4939 | WWW- | 401 | | m | m | m | m | m | m | 4940 | Authenticate | | | | | | | | | 4941 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4943 Table 10: Overview of RTSP header fields (P-W) related to methods 4944 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4946 +------------------------+---------+-------+-----+-----+-----+-----+ 4947 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4948 +------------------------+---------+-------+-----+-----+-----+-----+ 4949 | Accept | R | arm | o | o | - | - | 4950 | | | | | | | | 4951 | Accept-Credentials | R | rm | o | o | o | - | 4952 | | | | | | | | 4953 | Accept-Ranges | | rm | o | - | - | - | 4954 | | | | | | | | 4955 | Allow | 405 | amr | m | m | m | - | 4956 | | | | | | | | 4957 | Authorization | R | | o | o | o | - | 4958 | | | | | | | | 4959 | Bandwidth | R | | - | o | - | - | 4960 | | | | | | | | 4961 | Blocksize | R | | - | o | - | - | 4962 | | | | | | | | 4963 | Connection | | | o | o | o | o | 4964 | | | | | | | | 4965 | Cache-Control | | r | o | o | - | - | 4966 | | | | | | | | 4967 | Connection-Credentials | 470,407 | ar | o | o | o | - | 4968 | | | | | | | | 4969 | Content-Base | R | | o | o | - | - | 4970 | | | | | | | | 4971 | Content-Base | r | | o | o | - | - | 4972 | | | | | | | | 4973 | Content-Base | 4xx,5xx | | o | o | o | o | 4974 | | | | | | | | 4975 | Content-Encoding | R | r | o | o | - | - | 4976 | | | | | | | | 4977 | Content-Encoding | r | r | o | o | - | - | 4978 | | | | | | | | 4979 | Content-Encoding | 4xx,5xx | r | o | o | o | o | 4980 | | | | | | | | 4981 | Content-Language | R | r | o | o | - | - | 4982 | | | | | | | | 4983 | Content-Language | r | r | o | o | - | - | 4984 | | | | | | | | 4985 | Content-Language | 4xx,5xx | r | o | o | o | o | 4986 | | | | | | | | 4987 | Content-Length | R | r | * | * | - | - | 4988 | | | | | | | | 4989 | Content-Length | r | r | * | * | - | - | 4990 | | | | | | | | 4991 | Content-Length | 4xx,5xx | r | * | * | * | * | 4992 | | | | | | | | 4993 | Content-Location | R | | o | o | - | - | 4994 | | | | | | | | 4995 | Content-Location | r | | o | o | - | - | 4996 | | | | | | | | 4997 | Content-Location | 4xx,5xx | | o | o | o | o | 4998 | | | | | | | | 4999 | Content-Type | R | | * | * | - | - | 5000 | | | | | | | | 5001 | Content-Type | r | | * | * | - | - | 5002 | | | | | | | | 5003 | Content-Type | 4xx,5xx | | * | * | * | * | 5004 | | | | | | | | 5005 | CSeq | R,c | mr | m | m | m | m | 5006 | | | | | | | | 5007 | Date | R | a | o | o | m | o | 5008 | | | | | | | | 5009 | Date | r | am | o | o | o | o | 5010 | | | | | | | | 5011 | If-Modified-Since | R | am | o | - | - | - | 5012 | | | | | | | | 5013 | If-None-Match | R | am | o | - | - | - | 5014 | | | | | | | | 5015 | From | R | r | o | o | o | - | 5016 | | | | | | | | 5017 | Last-Modified | R | r | - | - | - | - | 5018 | | | | | | | | 5019 | Last-Modified | r | r | o | - | - | - | 5020 | | | | | | | | 5021 | Location | 3rr | | o | o | o | - | 5022 | | | | | | | | 5023 | Location | R | | - | - | m | - | 5024 | | | | | | | | 5025 | Media-Properties | R | amr | o | - | - | c | 5026 | | | | | | | | 5027 | Media-Properties | r | mr | c | - | - | - | 5028 | | | | | | | | 5029 | Media-Range | R | | o | - | - | c | 5030 | | | | | | | | 5031 | Media-Range | r | | c | - | - | - | 5032 | | | | | | | | 5033 | Notify-Reason | R | | - | - | - | m | 5034 | | | | | | | | 5035 | Pipelined-Requests | R | amdr | o | o | - | - | 5036 | | | | | | | | 5037 | Proxy-Authenticate | 407 | amr | m | m | m | - | 5038 | | | | | | | | 5039 | Proxy-Authorization | R | rd | o | o | o | - | 5040 | | | | | | | | 5041 | Proxy-Require | R | ar | o | o | o | - | 5042 | | | | | | | | 5043 | Proxy-Require | r | r | c | c | c | - | 5044 | | | | | | | | 5045 | Proxy-Supported | R | amr | c | c | c | - | 5046 | | | | | | | | 5047 | Proxy-Supported | r | | c | c | c | - | 5048 | | | | | | | | 5049 | Public | 501 | admr | m | m | m | - | 5050 +------------------------+---------+-------+-----+-----+-----+-----+ 5052 Table 11: Overview of RTSP header fields (A-P) related to methods 5053 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5055 +------------------+---------+-------+-----+-----+-----+-----+ 5056 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 5057 +------------------+---------+-------+-----+-----+-----+-----+ 5058 | Range | R | | o | - | o | m | 5059 | | | | | | | | 5060 | Referrer | R | | o | o | o | - | 5061 | Request-Status | R | | - | - | - | c | 5062 | | | | | | | | 5063 | Require | R | r | o | o | o | - | 5064 | | | | | | | | 5065 | Retry-After | 3rr,503 | | o | o | - | - | 5066 | | | | | | | | 5067 | Retry-After | 413 | | o | o | - | - | 5068 | | | | | | | | 5069 | RTP-Info | R | r | o | - | - | C | 5070 | | | | | | | | 5071 | RTP-Info | r | r | c | - | - | - | 5072 | | | | | | | | 5073 | Scale | | | - | - | - | c | 5074 | | | | | | | | 5075 | Seek-Style | | | - | - | - | - | 5076 | | | | | | | | 5077 | Session | R | r | o | o | o | m | 5078 | | | | | | | | 5079 | Session | r | r | c | c | o | m | 5080 | | | | | | | | 5081 | Server | R | r | o | o | o | o | 5082 | | | | | | | | 5083 | Server | r | r | o | o | - | - | 5084 | | | | | | | | 5085 | Speed | | | - | - | - | - | 5086 | | | | | | | | 5087 | Supported | R | adrm | o | o | o | - | 5088 | | | | | | | | 5089 | Supported | r | adrm | c | c | c | - | 5090 | | | | | | | | 5091 | Terminate-Reason | R | r | - | - | m | - | 5092 | | | | | | | | 5093 | Timestamp | R | adrm | o | o | o | - | 5094 | | | | | | | | 5095 | Timestamp | c | adrm | m | m | m | - | 5096 | | | | | | | | 5097 | Unsupported | r | arm | c | c | c | - | 5098 | | | | | | | | 5099 | User-Agent | R | r | m* | m* | - | - | 5100 | | | | | | | | 5101 | User-Agent | r | r | m* | m* | m* | m* | 5102 | | | | | | | | 5103 | Vary | r | | c | c | - | - | 5104 | | | | | | | | 5105 | Via | R | amr | o | o | o | - | 5106 | | | | | | | | 5107 | Via | c | dr | m | m | m | - | 5108 | | | | | | | | 5109 | WWW-Authenticate | 401 | | m | m | m | - | 5110 +------------------+---------+-------+-----+-----+-----+-----+ 5112 Table 12: Overview of RTSP header fields (R-W) related to methods 5113 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5115 16.1. Accept 5117 The Accept request-header field can be used to specify certain 5118 presentation description and parameter media types [RFC4288] which 5119 are acceptable for the response to DESCRIBE and GET_PARAMETER 5120 requests. 5122 See Section 20.2.3 for the syntax. 5124 Example of use: 5125 Accept: application/example ;q=1.0, application/sdp 5127 16.2. Accept-Credentials 5129 The Accept-Credentials header is a request header used to indicate to 5130 any trusted intermediary how to handle further secured connections to 5131 proxies or servers. See Section 19 for the usage of this header. It 5132 MUST NOT be included in server to client requests. 5134 In a request the header MUST contain the method (User, Proxy, or Any) 5135 for approving credentials selected by the requester. The method MUST 5136 NOT be changed by any proxy, unless it is "proxy" when a proxy MAY 5137 change it to "user" to take the role of user approving each further 5138 hop. If the method is "User" the header contains zero or more of 5139 credentials that the client accepts. The header may contain zero 5140 credentials in the first RTSP request to a RTSP server when using the 5141 "User" method. This as the client has not yet received any 5142 credentials to accept. Each credential MUST consist of one URI 5143 identifying the proxy or server, the hash algorithm identifier, and 5144 the hash over that agent's DER encoded certificate [RFC5280] in 5145 Base64 [RFC4648]. All RTSP clients and proxies MUST implement the 5146 SHA-256[FIPS-pub-180-2] algorithm for computation of the hash of the 5147 DER encoded certificate. The SHA-256 algorithm is identified by the 5148 token "sha-256". 5150 The intention with allowing for other hash algorithms is to enable 5151 the future retirement of algorithms that are not implemented 5152 somewhere else than here. Thus the definition of future algorithms 5153 for this purpose is intended to be extremely limited. A feature tag 5154 can be used to ensure that support for the replacement algorithm 5155 exist. 5157 Example: 5158 Accept-Credentials:User 5159 "rtsps://proxy2.example.com/";sha-256;exaIl9VMbQMOFGClx5rXnPJKVNI=, 5160 "rtsps://server.example.com/";sha-256;lurbjj5khhB0NhIuOXtt4bBRH1M= 5162 16.3. Accept-Encoding 5164 The Accept-Encoding request-header field is similar to Accept, but 5165 restricts the content-codings, i.e. transformation codings of the 5166 message body like gzip compression, that are acceptable in the 5167 response. 5169 A server tests whether a content-coding is acceptable, according to 5170 an Accept-Encoding field, using these rules: 5172 1. If the content-coding is one of the content-codings listed in the 5173 Accept-Encoding field, then it is acceptable, unless it is 5174 accompanied by a qvalue of 0. (As defined in section 3.9, a 5175 qvalue of 0 means "not acceptable.") 5177 2. The special "*" symbol in an Accept-Encoding field matches any 5178 available content-coding not explicitly listed in the header 5179 field. 5181 3. If multiple content-codings are acceptable, then the acceptable 5182 content-coding with the highest non-zero qvalue is preferred. 5184 4. The "identity" content-coding is always acceptable, i.e. no 5185 transformation at all, unless specifically refused because the 5186 Accept-Encoding field includes "identity;q=0", or because the 5187 field includes "*;q=0" and does not explicitly include the 5188 "identity" content-coding. If the Accept-Encoding field-value is 5189 empty, then only the "identity" encoding is acceptable. 5191 If an Accept-Encoding field is present in a request, and if the 5192 server cannot send a response which is acceptable according to the 5193 Accept-Encoding header, then the server SHOULD send an error response 5194 with the 406 (Not Acceptable) status code. 5196 If no Accept-Encoding field is present in a request, the server MAY 5197 assume that the client will accept any content coding. In this case, 5198 if "identity" is one of the available content-codings, then the 5199 server SHOULD use the "identity" content-coding, unless it has 5200 additional information that a different content-coding is meaningful 5201 to the client. 5203 16.4. Accept-Language 5205 The Accept-Language request-header field is similar to Accept, but 5206 restricts the set of natural languages that are preferred as a 5207 response to the request. Note that the language specified applies to 5208 the presentation description and any reason phrases, but not the 5209 media content. 5211 A language tag identifies a natural language spoken, written, or 5212 otherwise conveyed by human beings for communication of information 5213 to other human beings. Computer languages are explicitly excluded. 5214 The syntax and registry of RTSP 2.0 language tags is the same as that 5215 defined by [RFC5646]. 5217 Each language-range MAY be given an associated quality value which 5218 represents an estimate of the user's preference for the languages 5219 specified by that range. The quality value defaults to "q=1". For 5220 example: 5222 Accept-Language: da, en-gb;q=0.8, en;q=0.7 5224 would mean: "I prefer Danish, but will accept British English and 5225 other types of English." A language-range matches a language-tag if 5226 it exactly equals the tag, or if it exactly equals a prefix of the 5227 tag such that the first tag character following the prefix is "-". 5228 The special range "*", if present in the Accept-Language field, 5229 matches every tag not matched by any other range present in the 5230 Accept-Language field. 5232 Note: This use of a prefix matching rule does not imply that 5233 language tags are assigned to languages in such a way that it is 5234 always true that if a user understands a language with a certain 5235 tag, then this user will also understand all languages with tags 5236 for which this tag is a prefix. The prefix rule simply allows the 5237 use of prefix tags if this is the case. 5239 The language quality factor assigned to a language-tag by the Accept- 5240 Language field is the quality value of the longest language-range in 5241 the field that matches the language-tag. If no language-range in the 5242 field matches the tag, the language quality factor assigned is 0. If 5243 no Accept-Language header is present in the request, the server 5244 SHOULD assume that all languages are equally acceptable. If an 5245 Accept-Language header is present, then all languages which are 5246 assigned a quality factor greater than 0 are acceptable. 5248 16.5. Accept-Ranges 5250 The Accept-Ranges general-header field allows indication of the 5251 format supported in the Range header. The client MUST include the 5252 header in SETUP requests to indicate which formats it support to 5253 receive in PLAY and PAUSE responses, and REDIRECT requests. The 5254 server MUST include the header in SETUP and 456 error responses to 5255 indicate the formats supported for the resource indicated by the 5256 request URI. The header MAY be included in GET_PARAMETER request and 5257 response pairs. The GET_PARAMETER request MUST contain a Session 5258 header to identify the session context the request are related to. 5259 The requester and responder will indicate their capabilities 5260 regarding Range formats respectively. 5262 Accept-Ranges: NPT, SMPTE 5264 The syntax is defined in Section 20.2.3. 5266 16.6. Allow 5268 The Allow message-header field lists the methods supported by the 5269 resource identified by the Request-URI. The purpose of this field is 5270 to strictly inform the recipient of valid methods associated with the 5271 resource. An Allow header field MUST be present in a 405 (Method Not 5272 Allowed) response. The Allow header MUST also be present in all 5273 OPTIONS responses where the content of the header will not include 5274 exactly the same methods as listed in the Public header. 5276 The Allow MUST also be included in SETUP and DESCRIBE responses, if 5277 the methods allowed for the resource is different than the minimal 5278 implementation set. 5280 Example of use: 5281 Allow: SETUP, PLAY, SET_PARAMETER, DESCRIBE 5283 16.7. Authorization 5285 An RTSP client that wishes to authenticate itself with a server using 5286 authentication mechanism from HTTP [RFC2617] , usually, but not 5287 necessarily, after receiving a 401 response, does so by including an 5288 Authorization request-header field with the request. The 5289 Authorization field value consists of credentials containing the 5290 authentication information of the user agent for the realm of the 5291 resource being requested. 5293 If a request is authenticated and a realm specified, the same 5294 credentials SHOULD be valid for all other requests within this realm 5295 (assuming that the authentication scheme itself does not require 5296 otherwise, such as credentials that vary according to a challenge 5297 value or using synchronized clocks). 5299 When a shared cache (see Section 18) receives a request containing an 5300 Authorization field, it MUST NOT return the corresponding response as 5301 a reply to any other request, unless one of the following specific 5302 exceptions holds: 5304 1. If the response includes the "max-age" cache-control directive, 5305 the cache MAY use that response in replying to a subsequent 5306 request. But (if the specified maximum age has passed) a proxy 5307 cache MUST first revalidate it with the origin server, using the 5308 request-headers from the new request to allow the origin server 5309 to authenticate the new request. (This is the defined behavior 5310 for max-age.) If the response includes "max-age=0", the proxy 5311 MUST always revalidate it before re-using it. 5313 2. If the response includes the "must-revalidate" cache-control 5314 directive, the cache MAY use that response in replying to a 5315 subsequent request. But if the response is stale, all caches 5316 MUST first revalidate it with the origin server, using the 5317 request-headers from the new request to allow the origin server 5318 to authenticate the new request. 5320 3. If the response includes the "public" cache-control directive, it 5321 MAY be returned in reply to any subsequent request. 5323 16.8. Bandwidth 5325 The Bandwidth request-header field describes the estimated bandwidth 5326 available to the client, expressed as a positive integer and measured 5327 in kilobits per second. The bandwidth available to the client may 5328 change during an RTSP session, e.g., due to mobility, congestion, 5329 etc. 5331 Clients may not be able to accurately determine the available 5332 bandwidth, for example due to that first hop is not a bottleneck. 5333 For example most local area networks (LAN) will not be a bottleneck 5334 if the server is not in the same LAN. Thus link speeds of WLAN or 5335 Ethernet networks are normally not a basis for estimating the 5336 available bandwidth. Cellular devices or other devices directly 5337 connected to an modem or connection enabling device may more 5338 accurately estimate the bottleneck bandwidth and what is reasonable 5339 share of it for RTSP controlled media. The client will also need to 5340 take into account other traffic sharing the bottleneck. For example 5341 by only assigning a certain fraction to RTSP and its media streams. 5342 It is RECOMMENDED that only clients that has accurate and explicit 5343 information about bandwidth bottlenecks uses this header. 5345 This header is not a substitute for proper congestion control. Only 5346 a method providing an initial estimate and coarsely determine if the 5347 selected content can be delivered at all. 5349 Example: 5350 Bandwidth: 62360 5352 16.9. Blocksize 5354 The Blocksize request-header field is sent from the client to the 5355 media server asking the server for a particular media packet size. 5356 This packet size does not include lower-layer headers such as IP, 5357 UDP, or RTP. The server is free to use a blocksize which is lower 5358 than the one requested. The server MAY truncate this packet size to 5359 the closest multiple of the minimum, media-specific block size, or 5360 override it with the media-specific size if necessary. The block 5361 size MUST be a positive decimal number, measured in octets. The 5362 server only returns an error (4xx) if the value is syntactically 5363 invalid. 5365 16.10. Cache-Control 5367 The Cache-Control general-header field is used to specify directives 5368 that MUST be obeyed by all caching mechanisms along the request/ 5369 response chain. 5371 Cache directives MUST be passed through by a proxy or gateway 5372 application, regardless of their significance to that application, 5373 since the directives may be applicable to all recipients along the 5374 request/response chain. It is not possible to specify a cache- 5375 directive for a specific cache. 5377 Cache-Control should only be specified in a DESCRIBE, GET_PARAMETER, 5378 SET_PARAMETER and SETUP request and its response. Note: Cache- 5379 Control does not govern only the caching of responses as for HTTP, 5380 instead it also applies to the media stream identified by the SETUP 5381 request. The RTSP requests are generally not cacheable, for further 5382 information see Section 18. Below is the description of the cache 5383 directives that can be included in the Cache-Control header. 5385 no-cache: Indicates that the media stream MUST NOT be cached 5386 anywhere. This allows an origin server to prevent caching even 5387 by caches that have been configured to return stale responses 5388 to client requests. Note, there is no security function 5389 enforcing that the content can't be cached. 5391 public: Indicates that the media stream is cacheable by any cache. 5393 private: Indicates that the media stream is intended for a single 5394 user and MUST NOT be cached by a shared cache. A private (non- 5395 shared) cache may cache the media streams. 5397 no-transform: An intermediate cache (proxy) may find it useful to 5398 convert the media type of a certain stream. A proxy might, for 5399 example, convert between video formats to save cache space or 5400 to reduce the amount of traffic on a slow link. Serious 5401 operational problems may occur, however, when these 5402 transformations have been applied to streams intended for 5403 certain kinds of applications. For example, applications for 5404 medical imaging, scientific data analysis and those using end- 5405 to-end authentication all depend on receiving a stream that is 5406 bit-for-bit identical to the original media stream. Therefore, 5407 if a response includes the no-transform directive, an 5408 intermediate cache or proxy MUST NOT change the encoding of the 5409 stream. Unlike HTTP, RTSP does not provide for partial 5410 transformation at this point, e.g., allowing translation into a 5411 different language. 5413 only-if-cached: In some cases, such as times of extremely poor 5414 network connectivity, a client may want a cache to return only 5415 those media streams that it currently has stored, and not to 5416 receive these from the origin server. To do this, the client 5417 may include the only-if-cached directive in a request. If it 5418 receives this directive, a cache SHOULD either respond using a 5419 cached media stream that is consistent with the other 5420 constraints of the request, or respond with a 504 (Gateway 5421 Timeout) status. However, if a group of caches is being 5422 operated as a unified system with good internal connectivity, 5423 such a request MAY be forwarded within that group of caches. 5425 max-stale: Indicates that the client is willing to accept a media 5426 stream that has exceeded its expiration time. If max-stale is 5427 assigned a value, then the client is willing to accept a 5428 response that has exceeded its expiration time by no more than 5429 the specified number of seconds. If no value is assigned to 5430 max-stale, then the client is willing to accept a stale 5431 response of any age. 5433 min-fresh: Indicates that the client is willing to accept a media 5434 stream whose freshness lifetime is no less than its current age 5435 plus the specified time in seconds. That is, the client wants 5436 a response that will still be fresh for at least the specified 5437 number of seconds. 5439 must-revalidate: When the must-revalidate directive is present in a 5440 SETUP response received by a cache, that cache MUST NOT use the 5441 entry after it becomes stale to respond to a subsequent request 5442 without first revalidating it with the origin server. That is, 5443 the cache is required to do an end-to-end revalidation every 5444 time, if, based solely on the origin server's Expires, the 5445 cached response is stale.) 5447 proxy-revalidate: The proxy-revalidate directive has the same 5448 meaning as the must-revalidate directive, except that it does 5449 not apply to non-shared user agent caches. It can be used on a 5450 response to an authenticated request to permit the user's cache 5451 to store and later return the response without needing to 5452 revalidate it (since it has already been authenticated once by 5453 that user), while still requiring proxies that service many 5454 users to revalidate each time (in order to make sure that each 5455 user has been authenticated). Note that such authenticated 5456 responses also need the public cache control directive in order 5457 to allow them to be cached at all. 5459 max-age: When an intermediate cache is forced, by means of a max- 5460 age=0 directive, to revalidate its own cache entry, and the 5461 client has supplied its own validator in the request, the 5462 supplied validator might differ from the validator currently 5463 stored with the cache entry. In this case, the cache MAY use 5464 either validator in making its own request without affecting 5465 semantic transparency. 5467 However, the choice of validator might affect performance. The best 5468 approach is for the intermediate cache to use its own validator when 5469 making its request. If the server replies with 304 (Not Modified), 5470 then the cache can return its now validated copy to the client with a 5471 200 (OK) response. If the server replies with a new message body and 5472 cache validator, however, the intermediate cache can compare the 5473 returned validator with the one provided in the client's request, 5474 using the strong comparison function. If the client's validator is 5475 equal to the origin server's, then the intermediate cache simply 5476 returns 304 (Not Modified). Otherwise, it returns the new message 5477 body with a 200 (OK) response. 5479 16.11. Connection 5481 The Connection general-header field allows the sender to specify 5482 options that are desired for that particular connection and MUST NOT 5483 be communicated by proxies over further connections. 5485 RTSP 2.0 proxies MUST parse the Connection header field before a 5486 message is forwarded and, for each connection-token in this field, 5487 remove any header field(s) from the message with the same name as the 5488 connection-token. Connection options are signaled by the presence of 5489 a connection-token in the Connection header field, not by any 5490 corresponding additional header field(s), since the additional header 5491 field may not be sent if there are no parameters associated with that 5492 connection option. 5494 Message headers listed in the Connection header MUST NOT include end- 5495 to-end headers, such as Cache-Control. 5497 RTSP 2.0 defines the "close" connection option for the sender to 5498 signal that the connection will be closed after completion of the 5499 response. For example, Connection: close in either the request or 5500 the response header fields indicates that the connection SHOULD NOT 5501 be considered `persistent' (Section 10.2) after the current request/ 5502 response is complete. 5504 The use of the connection option "close" in RTSP messages SHOULD be 5505 limited to error messages when the server is unable to recover and 5506 therefore see it necessary to close the connection. The reason is 5507 that the client has the choice of continuing using a connection 5508 indefinitely, as long as it sends valid messages. 5510 16.12. Connection-Credentials 5512 The Connection-Credentials response header is used to carry the chain 5513 of credentials of any next hop that need to be approved by the 5514 requester. It MUST only be used in server to client responses. 5516 The Connection-Credentials header in an RTSP response MUST, if 5517 included, contain the credential information (in form of a list of 5518 certificates providing the chain of certification) of the next hop 5519 that an intermediary needs to securely connect to. The header MUST 5520 include the URI of the next hop (proxy or server) and a base64 5521 [RFC4648] encoded binary structure containing a sequence of DER 5522 encoded X.509v3 certificates[RFC5280] . 5524 The binary structure starts with the number of certificates 5525 (NR_CERTS) included as a 16 bit unsigned integer. This is followed 5526 by NR_CERTS number of 16 bit unsigned integers providing the size in 5527 octets of each DER encoded certificate. This is followed by NR_CERTS 5528 number of DER encoded X.509v3 certificates in a sequence (chain). 5529 The proxy or server's certificate must come first in the structure. 5530 Each following certificate must directly certify the one preceding 5531 it. Because certificate validation requires that root keys be 5532 distributed independently, the self-signed certificate which 5533 specifies the root certificate authority may optionally be omitted 5534 from the chain, under the assumption that the remote end must already 5535 possess it in order to validate it in any case. 5537 Example: 5539 Connection-Credentials:"rtsps://proxy2.example.com/";MIIDNTCC... 5541 Where MIIDNTCC... is a BASE64 encoding of the following structure: 5543 0 1 2 3 5544 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 5545 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5546 | Number of certificates | Size of certificate #1 | 5547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5548 | Size of certificate #2 | Size of certificate #3 | 5549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5550 : DER Encoding of Certificate #1 : 5551 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5552 : DER Encoding of Certificate #2 : 5553 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5554 : DER Encoding of Certificate #3 : 5555 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5557 16.13. Content-Base 5559 The Content-Base message-header field may be used to specify the base 5560 URI for resolving relative URIs within the message body. 5562 Content-Base: rtsp://media.example.com/movie/twister/ 5564 If no Content-Base field is present, the base URI of an message body 5565 is defined either by its Content-Location (if that Content-Location 5566 URI is an absolute URI) or the URI used to initiate the request, in 5567 that order of precedence. Note, however, that the base URI of the 5568 contents within the message-body may be redefined within that 5569 message-body. 5571 16.14. Content-Encoding 5573 The Content-Encoding header field is used as a modifier to the media- 5574 type. When present, its value indicates what additional content 5575 codings have been applied to the message body, and thus what decoding 5576 mechanisms must be applied in order to obtain the media-type 5577 referenced by the Content-Type header field. Content-Encoding is 5578 primarily used to allow a document to be compressed without losing 5579 the identity of its underlying media type. 5581 The content-coding is a characteristic of the message body identified 5582 by the Request-URI. Typically, the message body is stored with this 5583 encoding and is only decoded before rendering or analogous usage. 5584 However, a non-transparent proxy MAY modify the content-coding if the 5585 new coding is known to be acceptable to the recipient, unless the 5586 "no-transform" cache-control directive is present in the message. 5588 If the content-coding of an message body is not "identity", then the 5589 response MUST include a Content-Encoding Message-body header that 5590 lists the non-identity content-coding(s) used. 5592 If the content-coding of an message body in a request message is not 5593 acceptable to the origin server, the server SHOULD respond with a 5594 status code of 415 (Unsupported Media Type). 5596 If multiple encodings have been applied to a message body, the 5597 content codings MUST be listed in the order in which they were 5598 applied, first to last from left to right. Additional information 5599 about the encoding parameters MAY be provided by other header fields 5600 not defined by this specification. 5602 16.15. Content-Language 5604 The Content-Language header field describes the natural language(s) 5605 of the intended audience for the enclosed message body. Note that 5606 this might not be equivalent to all the languages used within the 5607 message body. 5609 Language tags are mentioned in Section 16.4. The primary purpose of 5610 Content-Language is to allow a user to identify and differentiate 5611 entities according to the user's own preferred language. Thus, if 5612 the body content is intended only for a Danish-literate audience, the 5613 appropriate field is 5615 Content-Language: da 5617 If no Content-Language is specified, the default is that the content 5618 is intended for all language audiences. This might mean that the 5619 sender does not consider it to be specific to any natural language, 5620 or that the sender does not know for which language it is intended. 5622 Multiple languages MAY be listed for content that is intended for 5623 multiple audiences. For example, a rendition of the "Treaty of 5624 Waitangi," presented simultaneously in the original Maori and English 5625 versions, would call for 5626 Content-Language: mi, en 5628 However, just because multiple languages are present within an 5629 message body does not mean that it is intended for multiple 5630 linguistic audiences. An example would be a beginner's language 5631 primer, such as "A First Lesson in Latin," which is clearly intended 5632 to be used by an English-literate audience. In this case, the 5633 Content-Language would properly only include "en". 5635 Content-Language MAY be applied to any media type -- it is not 5636 limited to textual documents. 5638 16.16. Content-Length 5640 The Content-Length general-header field contains the length of the 5641 message body of the RTSP message (i.e. after the double CRLF 5642 following the last header). Unlike HTTP, it MUST be included in all 5643 messages that carry a message body beyond the header portion of the 5644 RTSP message. If it is missing, a default value of zero is assumed. 5645 Any Content-Length greater than or equal to zero is a valid value. 5647 16.17. Content-Location 5649 The Content-Location header field MAY be used to supply the resource 5650 location for the message body enclosed in the message when that body 5651 is accessible from a location separate from the requested resource's 5652 URI. A server SHOULD provide a Content-Location for the variant 5653 corresponding to the response message body; especially in the case 5654 where a resource has multiple variants associated with it, and those 5655 entities actually have separate locations by which they might be 5656 individually accessed, the server SHOULD provide a Content-Location 5657 for the particular variant which is returned. 5659 The Content-Location value is not a replacement for the original 5660 requested URI; it is only a statement of the location of the resource 5661 corresponding to this particular variant at the time of the request. 5662 Future requests MAY specify the Content-Location URI as the request 5663 URI if the desire is to identify the source of that particular 5664 variant. This is useful if the RTSP agent desires verify if the 5665 resource variant is current through a conditional request. 5667 A cache cannot assume that an message body with a Content-Location 5668 different from the URI used to retrieve it can be used to respond to 5669 later requests on that Content-Location URI. However, the Content- 5670 Location can be used to differentiate between multiple variants 5671 retrieved from a single requested resource. 5673 If the Content-Location is a relative URI, the relative URI is 5674 interpreted relative to the Request-URI. 5676 Note, that Content-Location can be used in some cases to derive the 5677 base-URI for relative URI present in session description formats. 5678 This needs to be taken into account when Content-Location is used. 5679 The easiest way to avoid needing to consider that issue is to include 5680 the Content-Base whenever the Content-Location is included. 5682 Note also, when using Media Tags in conjunction with Content-Location 5683 it is important that the different versions have different MTags, 5684 even if provided under different Content-Location URIs. This as they 5685 have still been provided under the same request URI. 5687 Note also, as in most cases as the URI used in the DESCRIBE and the 5688 SETUP requests are different the URI provided in a DESCRIBE Content- 5689 Location response can't directly be used in a SETUP request. Instead 5690 the extra step of resolving URIs combined with the media descriptions 5691 indication, like with SDP's a=control attribute. 5693 16.18. Content-Type 5695 The Content-Type header indicates the media type of the message body 5696 sent to the recipient. Note that the content types suitable for RTSP 5697 are likely to be restricted in practice to presentation descriptions 5698 and parameter-value types. 5700 16.19. CSeq 5702 The CSeq general-header field specifies the sequence number for an 5703 RTSP request-response pair. This field MUST be present in all 5704 requests and responses. For every RTSP request containing the given 5705 sequence number, the corresponding response will have the same 5706 number. Any retransmitted request MUST contain the same sequence 5707 number as the original (i.e. the sequence number is not incremented 5708 for retransmissions of the same request). For each new RTSP request 5709 the CSeq value MUST be incremented by one. The initial sequence 5710 number MAY be any number, however, it is RECOMMENDED to start at 0. 5711 Each sequence number series is unique between each requester and 5712 responder, i.e. the client has one series for its request to a server 5713 and the server has another when sending request to the client. Each 5714 requester and responder is identified with its network address. 5716 Proxies that aggregate several sessions on the same transport will 5717 have to ensure that the requests sent towards a particular server 5718 have a joint sequence number space, i.e., they will regularly need to 5719 renumber the CSeq header field in requests (from proxy to server) and 5720 responses (from server to proxy) to fulfill the rules for the header. 5721 The proxy MUST increase the CSeq by one for each request it 5722 transmits, without regard of different sessions. 5724 Example: 5725 CSeq: 239 5727 16.20. Date 5729 The Date header field represents the date and time at which the 5730 message was originated. The inclusion of the Date header in RTSP 5731 message follows these rules: 5733 o An RTSP message, sent either by the client or the server, 5734 containing a body MUST include a Date header, if the sending host 5735 has a clock; 5737 o Clients and servers are RECOMMENDED to include a Date header in 5738 all other RTSP messages, if the sending host has a clock; 5740 o If the server does not have a clock that can provide a reasonable 5741 approximation of the current time, its responses MUST NOT include 5742 a Date header field. In this case, this rule MUST be followed: 5743 Some origin server implementations might not have a clock 5744 available. An origin server without a clock MUST NOT assign 5745 Expires or Last- Modified values to a response, unless these 5746 values were associated with the resource by a system or user with 5747 a reliable clock. It MAY assign an Expires value that is known, 5748 at or before server configuration time, to be in the past (this 5749 allows "pre-expiration" of responses without storing separate 5750 Expires values for each resource). 5752 A received message that does not have a Date header field MUST be 5753 assigned one by the recipient if the message will be cached by that 5754 recipient . An RTSP implementation without a clock MUST NOT cache 5755 responses without revalidating them on every use. An RTSP cache, 5756 especially a shared cache, SHOULD use a mechanism, such as NTP, to 5757 synchronize its clock with a reliable external standard. 5759 The RTSP-date sent in a Date header SHOULD NOT represent a date and 5760 time subsequent to the generation of the message. It SHOULD 5761 represent the best available approximation of the date and time of 5762 message generation, unless the implementation has no means of 5763 generating a reasonably accurate date and time. In theory, the date 5764 ought to represent the moment just before the message body is 5765 generated. In practice, the date can be generated at any time during 5766 the message origination without affecting its semantic value. 5768 16.21. Expires 5770 The Expires message-header field gives a date and time after which 5771 the description or media-stream should be considered stale. The 5772 interpretation depends on the method: 5774 DESCRIBE response: The Expires header indicates a date and time 5775 after which the presentation description (body) SHOULD be 5776 considered stale. 5778 SETUP response: The Expires header indicate a date and time after 5779 which the media stream SHOULD be considered stale. 5781 A stale cache entry may not normally be returned by a cache (either a 5782 proxy cache or an user agent cache) unless it is first validated with 5783 the origin server (or with an intermediate cache that has a fresh 5784 copy of the message body). See Section 18 for further discussion of 5785 the expiration model. 5787 The presence of an Expires field does not imply that the original 5788 resource will change or cease to exist at, before, or after that 5789 time. 5791 The format is an absolute date and time as defined by RTSP-date. An 5792 example of its use is 5793 Expires: Thu, 01 Dec 1994 16:00:00 GMT 5795 RTSP/2.0 clients and caches MUST treat other invalid date formats, 5796 especially including the value "0", as having occurred in the past 5797 (i.e., already expired). 5799 To mark a response as "already expired," an origin server should use 5800 an Expires date that is equal to the Date header value. To mark a 5801 response as "never expires," an origin server SHOULD use an Expires 5802 date approximately one year from the time the response is sent. 5803 RTSP/2.0 servers SHOULD NOT send Expires dates more than one year in 5804 the future. 5806 16.22. From 5808 The From request-header field, if given, SHOULD contain an Internet 5809 e-mail address for the human user who controls the requesting user 5810 agent. The address SHOULD be machine-usable, as defined by "mailbox" 5811 in [RFC1123]. 5813 This header field MAY be used for logging purposes and as a means for 5814 identifying the source of invalid or unwanted requests. It SHOULD 5815 NOT be used as an insecure form of access protection. The 5816 interpretation of this field is that the request is being performed 5817 on behalf of the person given, who accepts responsibility for the 5818 method performed. In particular, robot agents SHOULD include this 5819 header so that the person responsible for running the robot can be 5820 contacted if problems occur on the receiving end. 5822 The Internet e-mail address in this field MAY be separate from the 5823 Internet host which issued the request. For example, when a request 5824 is passed through a proxy the original issuer's address SHOULD be 5825 used. 5827 The client SHOULD NOT send the From header field without the user's 5828 approval, as it might conflict with the user's privacy interests or 5829 their site's security policy. It is strongly recommended that the 5830 user be able to disable, enable, and modify the value of this field 5831 at any time prior to a request. 5833 16.23. If-Match 5835 The If-Match request-header field is especially useful for ensuring 5836 the integrity of the presentation description, independent of how the 5837 presentation description was received. The presentation description 5838 can be fetched via means external to RTSP (such as HTTP) or via the 5839 DESCRIBE message. In the case of retrieving the presentation 5840 description via RTSP, the server implementation is guaranteeing the 5841 integrity of the description between the time of the DESCRIBE message 5842 and the SETUP message. By including the MTag given in or with the 5843 session description in a If-Match header part of the SETUP request, 5844 the client ensures that resources set up are matching the 5845 description. A SETUP request with the If-Match header for which the 5846 MTag validation check fails, MUST response using 412 (Precondition 5847 Failed). 5849 This validation check is also very useful if a session has been 5850 redirected from one server to another. 5852 16.24. If-Modified-Since 5854 The If-Modified-Since request-header field is used with the DESCRIBE 5855 and SETUP methods to make them conditional. If the requested variant 5856 has not been modified since the time specified in this field, a 5857 description will not be returned from the server (DESCRIBE) or a 5858 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 5859 response MUST be returned without any message-body. 5861 An example of the field is: 5862 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 5864 16.25. If-None-Match 5866 This request header can be used with one or several message body tags 5867 to make DESCRIBE requests conditional. A client that has one or more 5868 message bodies previously obtained from the resource, can verify that 5869 none of those entities is current by including a list of their 5870 associated message body tags in the If-None-Match header field. The 5871 purpose of this feature is to allow efficient updates of cached 5872 information with a minimum amount of transaction overhead. As a 5873 special case, the value "*" matches any current entity of the 5874 resource. 5876 if any of the message body tags match the message body tag of the 5877 message body that would have been returned in the response to a 5878 similar DESCRIBE request (without the If-None-Match header) on that 5879 resource, or if "*" is given and any current entity exists for that 5880 resource, then the server MUST NOT perform the requested method, 5881 unless required to do so because the resource's modification date 5882 fails to match that supplied in an If-Modified-Since header field in 5883 the request. Instead, if the request method was DESCRIBE, the server 5884 SHOULD respond with a 304 (Not Modified) response, including the 5885 cache-related header fields (particularly MTag) of one of the message 5886 bodies that matched. For all other request methods, the server MUST 5887 respond with a status of 412 (Precondition Failed). 5889 See Section 18.1.3 for rules on how to determine if two message body 5890 tags match. 5892 If none of the message body tags match, then the server MAY perform 5893 the requested method as if the If-None-Match header field did not 5894 exist, but MUST also ignore any If-Modified-Since header field(s) in 5895 the request. That is, if no message body tags match, then the server 5896 MUST NOT return a 304 (Not Modified) response. 5898 If the request would, without the If-None-Match header field, result 5899 in anything other than a 2xx or 304 status, then the If-None-Match 5900 header MUST be ignored. (See Section 18.1.4 for a discussion of 5901 server behavior when both If-Modified-Since and If-None-Match appear 5902 in the same request.) 5904 The result of a request having both an If-None-Match header field and 5905 an If-Match header field is unspecified and MUST be considered an 5906 illegal request. 5908 16.26. Last-Modified 5910 The Last-Modified message-header field indicates the date and time at 5911 which the origin server believes the presentation description or 5912 media stream was last modified. For the method DESCRIBE, the header 5913 field indicates the last modification date and time of the 5914 description, for SETUP that of the media stream. 5916 An origin server MUST NOT send a Last-Modified date which is later 5917 than the server's time of message origination. In such cases, where 5918 the resource's last modification would indicate some time in the 5919 future, the server MUST replace that date with the message 5920 origination date. 5922 An origin server SHOULD obtain the Last-Modified value of the message 5923 body as close as possible to the time that it generates the Date 5924 value of its response. This allows a recipient to make an accurate 5925 assessment of the message body's modification time, especially if the 5926 message body changes near the time that the response is generated. 5928 RTSP servers SHOULD send Last-Modified whenever feasible. 5930 16.27. Location 5932 The Location response-header field is used to redirect the recipient 5933 to a location other than the Request-URI for completion of the 5934 request or identification of a new resource. For 3xx responses, the 5935 location SHOULD indicate the server's preferred URI for automatic 5936 redirection to the resource. The field value consists of a single 5937 absolute URI. 5939 Note: The Content-Location header field (Section 16.17) differs from 5940 Location in that the Content-Location identifies the original 5941 location of the message body enclosed in the request. It is 5942 therefore possible for a response to contain header fields for both 5943 Location and Content-Location. Also, see Section 18.2 for cache 5944 requirements of some methods. 5946 16.28. Media-Properties 5948 This general header is used in SETUP response or PLAY_NOTIFY requests 5949 to indicate the media's properties that currently are applicable to 5950 the RTSP session. PLAY_NOTIFY MAY be used to modify these properties 5951 at any point. However, the client SHOULD have received the update 5952 prior to that any action related to the new media properties take 5953 effect. For aggregated sessions, the Media-Properties header will be 5954 returned in each SETUP response. The header received in the latest 5955 response is the one that applies on the whole session from this point 5956 until any future update. The header MAY be included without value in 5957 GET_PARAMETER requests to the server with a Session header included 5958 to query the current Media-Properties for the session. The responder 5959 MUST include the current session's media properties. 5961 The media properties expressed by this header is the one applicable 5962 to all media in the RTSP session. For aggregated sessions, the 5963 header expressed the combined media-properties. As a result 5964 aggregation of media MAY result in a change of the media properties, 5965 and thus the content of the Media-Properties header contained in 5966 subsequent SETUP responses. 5968 The header contains a list of property values that are applicable to 5969 the currently setup media or aggregate of media as indicated by the 5970 RTSP URI in the request. No ordering are enforced within the header. 5971 Property values should be grouped into a single group that handles a 5972 particular orthogonal property. Values or groups that express 5973 multiple properties SHOULD NOT be used. The list of properties that 5974 can be expressed MAY be extended at any time. Unknown property 5975 values MUST be ignored. 5977 This specification defines the following 4 groups and their property 5978 values: 5980 Random Access: 5982 Random-Access: Indicates that random access is possible. May 5983 optionally include a floating point value in seconds indicating 5984 the longest duration between any two random access points in 5985 the media. 5987 Begining-Only: Seeking is limited to the beginning only. 5989 No-Seeking: No seeking is possible. 5991 Content Modifications: 5993 Immutable: The content will not be changed during the life-time 5994 of the RTSP session. 5996 Dynamic: The content may be changed based on external methods or 5997 triggers 5999 Time-Progressing The media accessible progress as wallclock time 6000 progresses. 6002 Retention: 6004 Unlimited: Content will be retained for the duration of the life- 6005 time of the RTSP session. 6007 Time-Limited: Content will be retained at least until the 6008 specified wallclock time. The time must be provided in the 6009 absolute time format specified in Section 4.6. 6011 Time-Duration Each individual media unit is retained for at least 6012 the specified time duration. This definition allows for 6013 retaining data with a time based sliding window. The time 6014 duration is expressed as floating point number in seconds. 0.0 6015 is a valid value as this indicates that no data is retained in 6016 a time-progressing session. 6018 Supported Scale: 6020 Scales: A quoted comma separated list of one or more decimal 6021 values or ranges of scale values supported by the content in 6022 arbitrary order. A range has a start and stop value separated 6023 by a colon. A range indicates that the content supports fine 6024 grained selection of scale values. Fine grained allows for 6025 steps at least as small as one tenth of a scale value. 6026 Negative values are supported. The value 0 have no meaning and 6027 must not be used. 6029 Examples of this header for on-demand content and a live stream 6030 without recording are: 6032 On-demand: 6033 Media-Properties: Random-Access=2.5s, Unlimited, Immutable, 6034 Scales="-20, -10, -4, 0.5:1.5, 4, 8, 10, 15, 20" 6036 Live stream without recording/timeshifting: 6037 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0.0 6039 16.29. Media-Range 6041 The Media-Range general header is used to give the range of the media 6042 at the time of sending the RTSP message. This header MUST be 6043 included in SETUP response, and PLAY and PAUSE response for media 6044 that are Time-Progressing, and PLAY and PAUSE response after any 6045 change for media that are Dynamic, and in PLAY_NOTIFY request that 6046 are sent due to Media-Property-Update. Media-Range header without 6047 any range specifications MAY be included in GET_PARAMETER requests to 6048 the server to request the current range. The server MUST in this 6049 case include the current range at the time of sending the response. 6051 The header MUST include range specifications for all time formats 6052 supported for the media, as indicated in Accept-Ranges header 6053 (Section 16.5) when setting up the media. The server MAY include 6054 more than one range specification of any given time format to 6055 indicate media that has non-continuous range. 6057 For media that has the Time-Progressing property, the Media-Range 6058 values will only be valid for the particular point in time when it 6059 was issued. As wallclock progresses so will also the media range. 6060 However, it shall be assumed that media time progress in direct 6061 relationship to wallclock time (with the exception of clock skew) so 6062 that a reasonably accurate estimation of the media range can be 6063 calculated. 6065 16.30. MTag 6067 The MTag response header MAY be included in DESCRIBE, GET_PARAMETER 6068 or SETUP responses. The message body tags (Section 4.8) returned in 6069 a DESCRIBE response, and the one in SETUP refers to the presentation, 6070 i.e. both the returned session description and the media stream. 6071 This allows for verification that one has the right session 6072 description to a media resource at the time of the SETUP request. 6073 However, it has the disadvantage that a change in any of the parts 6074 results in invalidation of all the parts. 6076 If the MTag is provided both inside the message body, e.g. within the 6077 "a=mtag" attribute in SDP, and in the response message, then both 6078 tags MUST be identical. It is RECOMMENDED that the MTag is primarily 6079 given in the RTSP response message, to ensure that caches can use the 6080 MTag without requiring content inspection. However, for session 6081 descriptions that are distributed outside of RTSP, for example using 6082 HTTP, etc. it will be necessary to include the message body tag in 6083 the session description as specified in Appendix D.1.9. 6085 SETUP and DESCRIBE requests can be made conditional upon the MTag 6086 using the headers If-Match (Section 16.23) and If-None-Match ( 6087 Section 16.25). 6089 16.31. Notify-Reason 6091 The Notify Reason header is solely used in the PLAY_NOTIFY method. 6092 It indicates the reason why the server has sent the asynchronous 6093 PLAY_NOTIFY request (see Section 13.5). 6095 16.32. Pipelined-Requests 6097 The Pipelined-Requests general header is used to indicate that a 6098 request is to be executed in the context created by a previous 6099 request(s). The primary usage of this header is to allow pipelining 6100 of SETUP requests so that any additional SETUP request after the 6101 first one does not need to wait for the session ID to be sent back to 6102 the requesting agent. The header contains a unique identifier that 6103 is scoped by the persistent connection used to send the requests. 6105 Upon receiving a request with the Pipelined-Requests the responding 6106 agent MUST look up if there exists a binding between this Pipelined- 6107 Requests identifier for the current persistent connection and an RTSP 6108 session ID. If that exists then the received request is processed 6109 the same way as if it contained the Session header with the found 6110 session ID. If there does not exist a mapping and no Session header 6111 is included in the request, the responding agent MUST create a 6112 binding upon the successful completion of a session creating request, 6113 i.e. SETUP. A binding MUST NOT be created, if the request failed to 6114 create an RTSP session. In case the request contains both a Session 6115 header and the Pipelined-Requests header the Pipelined-Requests MUST 6116 be ignored. 6118 Note: Based on the above definition at least the first request 6119 containing a new unique Pipelined-Requests will be required to be a 6120 SETUP request (unless the protocol is extended with new methods of 6121 creating a session). After that first one, additional SETUP requests 6122 or request of any type using the RTSP session context may include the 6123 Pipelined-Requests header. 6125 When responding to any request that contained the Pipelined-Requests 6126 header the server MUST also include the Session header when a binding 6127 to a session context exist. A RTSP agent that knows the session ID 6128 SHOULD NOT use the Pipelined-Requests header in any request and only 6129 use the Session header. This as the Session identifier is persistent 6130 across transport contexts, like TCP connections, which the Pipelined- 6131 Requests identifier is not. 6133 The RTSP agent sending the request with a Pipelined-Requests header 6134 has the responsibility for using a unique and previously unused 6135 identifier within the transport context. Currently only a TCP 6136 connection is defined as such transport context. A server MUST 6137 delete the Pipelined-Requests identifier and its binding to a session 6138 upon the termination of that session. Despite the previous mandate, 6139 RTSP agents are RECOMMENDED to not reuse identifiers to allow for 6140 better error handling and logging. 6142 RTSP Proxies may need to translate Pipelined-Requests identifier 6143 values from incoming request to outgoing to allow for aggregation of 6144 requests onto a persistent connection. 6146 16.33. Proxy-Authenticate 6148 The Proxy-Authenticate response-header field MUST be included as part 6149 of a 407 (Proxy Authentication Required) response. The field value 6150 consists of a challenge that indicates the authentication scheme and 6151 parameters applicable to the proxy for this Request-URI. 6153 The HTTP access authentication process is described in [RFC2617]. 6154 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 6155 only to the current connection and SHOULD NOT be passed on to 6156 downstream agents. However, an intermediate proxy might need to 6157 obtain its own credentials by requesting them from the downstream 6158 agent, which in some circumstances will appear as if the proxy is 6159 forwarding the Proxy-Authenticate header field. 6161 16.34. Proxy-Authorization 6163 The Proxy-Authorization request-header field allows the client to 6164 identify itself (or its user) to a proxy which requires 6165 authentication. The Proxy-Authorization field value consists of 6166 credentials containing the authentication information of the user 6167 agent for the proxy and/or realm of the resource being requested. 6169 The HTTP access authentication process is described in [RFC2617]. 6170 Unlike Authorization, the Proxy-Authorization header field applies 6171 only to the next outbound proxy that demanded authentication using 6172 the Proxy- Authenticate field. When multiple proxies are used in a 6173 chain, the Proxy-Authorization header field is consumed by the first 6174 outbound proxy that was expecting to receive credentials. A proxy 6175 MAY relay the credentials from the client request to the next proxy 6176 if that is the mechanism by which the proxies cooperatively 6177 authenticate a given request. 6179 16.35. Proxy-Require 6181 The Proxy-Require request-header field is used to indicate proxy- 6182 sensitive features that MUST be supported by the proxy. Any Proxy- 6183 Require header features that are not supported by the proxy MUST be 6184 negatively acknowledged by the proxy to the client using the 6185 Unsupported header. The proxy MUST use the 551 (Option Not 6186 Supported) status code in the response. Any feature-tag included in 6187 the Proxy-Require does not apply to the end-point (server or client). 6188 To ensure that a feature is supported by both proxies and servers the 6189 tag needs to be included in also a Require header. 6191 See Section 16.41 for more details on the mechanics of this message 6192 and a usage example. See discussion in the proxies section 6193 (Section 17.1) about when to consider that a feature requires proxy 6194 support. 6196 Example of use: 6197 Proxy-Require: play.basic 6199 16.36. Proxy-Supported 6201 The Proxy-Supported header field enumerates all the extensions 6202 supported by the proxy using feature-tags. The header carries the 6203 intersection of extensions supported by the forwarding proxies. The 6204 Proxy-Supported header MAY be included in any request by a proxy. It 6205 MUST be added by any proxy if the Supported header is present in a 6206 request. When present in a request, the receiver MUST in the 6207 response copy the received Proxy-Supported header. 6209 The Proxy-Supported header field contains a list of feature-tags 6210 applicable to proxies, as described in Section 4.7. The list are the 6211 intersection of all feature-tags understood by the proxies. To 6212 achieve an intersection, the proxy adding the Proxy-Supported header 6213 includes all proxy feature-tags it understands. Any proxy receiving 6214 a request with the header, checks the list and removes any feature- 6215 tag it do not support. A Proxy-Supported header present in the 6216 response MUST NOT be touched by the proxies. 6218 Example: 6219 C->P1: OPTIONS rtsp://example.com/ RTSP/2.0 6220 Supported: foo, bar, blech 6221 User-Agent: PhonyClient/1.2 6223 P1->P2: OPTIONS rtsp://example.com/ RTSP/2.0 6224 Supported: foo, bar, blech 6225 Proxy-Supported: proxy-foo, proxy-bar, proxy-blech 6226 Via: 2.0 pro.example.com 6228 P2->S: OPTIONS rtsp://example.com/ RTSP/2.0 6229 Supported: foo, bar, blech 6230 Proxy-Supported: proxy-foo, proxy-blech 6231 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6233 S->C: RTSP/2.0 200 OK 6234 Supported: foo, bar, baz 6235 Proxy-Supported: proxy-foo, proxy-blech 6236 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6237 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6239 16.37. Public 6241 The Public response header field lists the set of methods supported 6242 by the response sender. This header applies to the general 6243 capabilities of the sender and its only purpose is to indicate the 6244 sender's capabilities to the recipient. The methods listed may or 6245 may not be applicable to the Request-URI; the Allow header field 6246 (Section 16.6) MAY be used to indicate methods allowed for a 6247 particular URI. 6249 Example of use: 6250 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6252 In the event that there are proxies between the sender and the 6253 recipient of a response, each intervening proxy MUST modify the 6254 Public header field to remove any methods that are not supported via 6255 that proxy. The resulting Public header field will contain an 6256 intersection of the sender's methods and the methods allowed through 6257 by the intervening proxies. 6259 In general, proxies should allow all methods to transparently pass 6260 through from the sending RTSP agent to the receiving RTSP agent, 6261 but there may be cases where this is not desirable for a given 6262 proxy. Modification of the Public response header field by the 6263 intervening proxies ensures that the request sender gets an 6264 accurate response indicating the methods that can be used on the 6265 target agent via the proxy chain. 6267 16.38. Range 6269 The Range header specifies a time range in PLAY (Section 13.4), PAUSE 6270 (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and 6271 PLAY_NOTIFY (Section 13.5) requests and responses. It MAY be 6272 included in GET_PARAMETER requests from the client to the server with 6273 only a Range format and no value to request the current media 6274 position, whether the session is in Play or Ready state in the 6275 included format. The server SHALL, if supporting the range format, 6276 respond with the current playing point or pause point as the start of 6277 the range. If an explicit stop point was used in the previous PLAY 6278 request, then that value shall be included as stop point. Note that 6279 if the server is currently under any type of media playback 6280 manipulation affecting the interpretation of Range, like Scale, that 6281 is also required to be included in any GET_PARAMETER response to 6282 provide complete information. 6284 The range can be specified in a number of units. This specification 6285 defines smpte (Section 4.4), npt (Section 4.5), and clock 6286 (Section 4.6) range units. While byte ranges [H14.35.1] and other 6287 extended units MAY be used, their behavior is unspecified since they 6288 are not normally meaningful in RTSP. Servers supporting the Range 6289 header MUST understand the NPT range format and SHOULD understand the 6290 SMPTE range format. If the Range header is sent in a time format 6291 that is not understood, the recipient SHOULD return 456 (Header Field 6292 Not Valid for Resource) and include an Accept-Ranges header 6293 indicating the supported time formats for the given resource. 6295 Example: 6296 Range: clock=19960213T143205Z- 6298 The Range header contains a range of one single range format. A 6299 range is a half-open interval with a start and an end point, 6300 including the start point, but excluding the end point. A range may 6301 either be fully specified with explicit values for start point and 6302 end point, or have either start or end point be implicit. An 6303 implicit start point indicates the session's pause point, and if no 6304 pause point is set the start of the content. An implicit end point 6305 indicates the end of the content. The usage of both implicit start 6306 and end point is not allowed in the same range header, however, the 6307 exclusion of the range header has that meaning, i.e. from pause point 6308 (or start) until end of content. 6310 Regarding the half-open intervals; a range of A-B starts exactly 6311 at time A, but ends just before B. Only the start time of a media 6312 unit such as a video or audio frame is relevant. For example, 6313 assume that video frames are generated every 40 ms. A range of 6314 10.0-10.1 would include a video frame starting at 10.0 or later 6315 time and would include a video frame starting at 10.08, even 6316 though it lasted beyond the interval. A range of 10.0-10.08, on 6317 the other hand, would exclude the frame at 10.08. 6319 Please note the difference between NPT time scales' "now" and an 6320 implicit start value. Implicit value reference the current pause- 6321 point. While "now" is the currently ongoing time. In a time- 6322 progressing session with recording (retention for some or full 6323 time) the pause point may be 2 min into the session while now 6324 could be 1 hour into the session. 6326 By default, range intervals increase, where the second point is 6327 larger than the first point. 6329 Example: 6330 Range: npt=10-15 6332 However, range intervals can also decrease if the Scale header (see 6333 Section 16.44) indicates a negative scale value. For example, this 6334 would be the case when a playback in reverse is desired. 6336 Example: 6337 Scale: -1 6338 Range: npt=15-10 6340 Decreasing ranges are still half open intervals as described above. 6341 Thus, for range A-B, A is closed and B is open. In the above 6342 example, 15 is closed and 10 is open. An exception to this rule is 6343 the case when B=0 in a decreasing range. In this case, the range is 6344 closed on both ends, as otherwise there would be no way to reach 0 on 6345 a reverse playback for formats that have such a notion, like NPT and 6346 SMPTE. 6348 Example: 6349 Scale: -1 6350 Range: npt=15-0 6352 In this range both 15 and 0 are closed. 6354 A decreasing range interval without a corresponding negative Scale 6355 header is not valid. 6357 16.39. Referrer 6359 The Referrer request-header field allows the client to specify, for 6360 the server's benefit, the address (URI) of the resource from which 6361 the Request-URI was obtained. The URI refers to that of the 6362 presentation description, typically retrieved via HTTP. The Referrer 6363 request-header allows a server to generate lists of back-links to 6364 resources for interest, logging, optimized caching, etc. It also 6365 allows obsolete or mistyped links to be traced for maintenance. The 6366 Referrer field MUST NOT be sent if the Request-URI was obtained from 6367 a source that does not have its own URI, such as input from the user 6368 keyboard. 6370 If the field value is a relative URI, it SHOULD be interpreted 6371 relative to the Request-URI. The URI MUST NOT include a fragment. 6373 Because the source of a link might be private information or might 6374 reveal an otherwise private information source, it is strongly 6375 recommended that the user be able to select whether or not the 6376 Referrer field is sent. For example, a streaming client could have a 6377 toggle switch for openly/anonymously, which would respectively 6378 enable/disable the sending of Referee and From information. 6380 Clients SHOULD NOT include a Referee header field in a (non-secure) 6381 RTSP request if the referring page was transferred with a secure 6382 protocol. 6384 16.40. Request-Status 6386 This request header is used to indicate the end result for requests 6387 that takes time to complete, such a PLAY (Section 13.4). It is sent 6388 in PLAY_NOTIFY (Section 13.5) with the end-of-stream reason to report 6389 how the PLAY request concluded, either in success or in failure. The 6390 header carries a reference to the request it reports on using the 6391 CSeq number for the session indicated by the Session header in the 6392 request. It provides both a numerical status code (according to 6393 Section 8.1.1) and a human readable reason phrase. 6395 Example: 6396 Request-Status: cseq=63 status=500 reason="Media data unavailable" 6398 16.41. Require 6400 The Require request-header field is used by clients or servers to 6401 ensure that the other end-point supports features that are required 6402 in respect to this request. It can also be used to query if the 6403 other end-point supports certain features, however, the use of the 6404 Supported (Section 16.49) is much more effective in this purpose. 6405 The server MUST respond to this header by using the Unsupported 6406 header to negatively acknowledge those feature-tags which are NOT 6407 supported. The response MUST use the error code 551 (Option Not 6408 Supported). This header does not apply to proxies, for the same 6409 functionality in respect to proxies see Proxy-Require header 6410 (Section 16.35) with the exception of media modifying proxies. Media 6411 modifying proxies due to their nature of handling media in a way that 6412 is very similar to what a server, do need to understand also the 6413 server features to correctly serve the client. 6415 This is to make sure that the client-server interaction will 6416 proceed without delay when all features are understood by both 6417 sides, and only slow down if features are not understood (as in 6418 the example below). For a well-matched client-server pair, the 6419 interaction proceeds quickly, saving a round-trip often required 6420 by negotiation mechanisms. In addition, it also removes state 6421 ambiguity when the client requires features that the server does 6422 not understand. 6424 Example (Not complete): 6425 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/2.0 6426 CSeq: 302 6427 Require: funky-feature 6428 Funky-Parameter: funkystuff 6430 S->C: RTSP/2.0 551 Option not supported 6431 CSeq: 302 6432 Unsupported: funky-feature 6434 In this example, "funky-feature" is the feature-tag which indicates 6435 to the client that the fictional Funky-Parameter field is required. 6436 The relationship between "funky-feature" and Funky-Parameter is not 6437 communicated via the RTSP exchange, since that relationship is an 6438 immutable property of "funky-feature" and thus should not be 6439 transmitted with every exchange. 6441 Proxies and other intermediary devices MUST ignore this header. If a 6442 particular extension requires that intermediate devices support it, 6443 the extension should be tagged in the Proxy-Require field instead 6444 (see Section 16.35). See discussion in the proxies section 6445 (Section 17.1) about when to consider that a feature requires proxy 6446 support. 6448 16.42. Retry-After 6450 The Retry-After response-header field can be used with a 503 (Service 6451 Unavailable) response to indicate how long the service is expected to 6452 be unavailable to the requesting client. This field MAY also be used 6453 with any 3xx (Redirection) response to indicate the minimum time the 6454 user-agent is asked wait before issuing the redirected request. The 6455 value of this field can be either an RTSP-date or an integer number 6456 of seconds (in decimal) after the time of the response. 6458 Example: 6459 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT 6460 Retry-After: 120 6462 In the latter example, the delay is 2 minutes. 6464 16.43. RTP-Info 6466 The RTP-Info general field is used to set RTP-specific parameters in 6467 the PLAY and GET_PARAMETER responses or a PLAY_NOTIFY and 6468 GET_PARAMETER requests. For streams using RTP as transport protocol 6469 the RTP-Info header SHOULD be part of a 200 response to PLAY. 6471 The exclusion of the RTP-Info in a PLAY response for RTP 6472 transported media will result in that a client needs to 6473 synchronize the media streams using RTCP. This may have negative 6474 impact as the RTCP can be lost, and does not need to be 6475 particularly timely in their arrival. Also functionality as 6476 informing the client from which packet a seek has occurred is 6477 affected. 6479 The RTP-Info MAY be included in SETUP responses to provide 6480 synchronization information when changing transport parameters, see 6481 Section 13.3. The RTP-Info header and the Range header MAY be 6482 included in a GET_PARAMETER request from client to server without any 6483 values to request the current playback point and corresponding. RTP 6484 synchronization information. When the RTP-Info header is included in 6485 a Request also the Range header MUST be included (Note, Range header 6486 only MAY be used). The server response SHALL include both the Range 6487 header and the RTP-Info header. If the session is in Play state, 6488 then the value of the Range header SHALL be filled in with the 6489 current playback point and with the corresponding RTP-Info values. 6490 If the server is another state, no values are included in the RTP- 6491 Info header. The header is included in PLAY_NOTIFY requests with the 6492 Notify-Reason of end-of-stream to provide RTP information about the 6493 end of the stream. 6495 The header can carry the following parameters: 6497 url: Indicates the stream URI which for which the following RTP 6498 parameters correspond, this URI MUST be the same used in the 6499 SETUP request for this media stream. Any relative URI MUST use 6500 the Request-URI as base URI. This parameter MUST be present. 6502 ssrc: The Synchronization source (SSRC) that the RTP timestamp and 6503 sequence number provide applies to. This parameter MUST be 6504 present. 6506 seq: Indicates the sequence number of the first packet of the stream 6507 that is direct result of the request. This allows clients to 6508 gracefully deal with packets when seeking. The client uses 6509 this value to differentiate packets that originated before the 6510 seek from packets that originated after the seek. Note that a 6511 client may not receive the packet with the expressed sequence 6512 number, and instead packets with a higher sequence number, due 6513 to packet loss or reordering. This parameter is RECOMMENDED to 6514 be present. 6516 rtptime: MUST indicate the RTP timestamp value corresponding to the 6517 start time value in the Range response header, or if not 6518 explicitly given the implied start point. The client uses this 6519 value to calculate the mapping of RTP time to NPT or other 6520 media timescale. This parameter SHOULD be present to ensure 6521 inter-media synchronization is achieved. There exist no 6522 requirement that any received RTP packet will have the same RTP 6523 timestamp value as the one in the parameter used to establish 6524 synchronization. 6526 A mapping from RTP timestamps to NTP timestamps (wallclock) is 6527 available via RTCP. However, this information is not sufficient 6528 to generate a mapping from RTP timestamps to media clock time 6529 (NPT, etc.). Furthermore, in order to ensure that this 6530 information is available at the necessary time (immediately at 6531 startup or after a seek), and that it is delivered reliably, this 6532 mapping is placed in the RTSP control channel. 6534 In order to compensate for drift for long, uninterrupted 6535 presentations, RTSP clients should additionally map NPT to NTP, 6536 using initial RTCP sender reports to do the mapping, and later 6537 reports to check drift against the mapping. 6539 Example: 6540 Range:npt=3.25-15 6541 RTP-Info:url="rtsp://example.com/foo/audio" ssrc=0A13C760:seq=45102; 6542 rtptime=12345678,url="rtsp://example.com/foo/video" 6543 ssrc=9A9DE123:seq=30211;rtptime=29567112 6545 Lets assume that Audio uses a 16kHz RTP timestamp clock and Video 6546 a 90kHz RTP timestamp clock. Then the media synchronization is 6547 depicted in the following way. 6549 NPT 3.0---3.1---3.2-X-3.3---3.4---3.5---3.6 6550 Audio PA A 6551 Video V PV 6553 X: NPT time value = 3.25, from Range header. 6554 A: RTP timestamp value for Audio from RTP-Info header (12345678). 6555 V: RTP timestamp value for Video from RTP-Info header (29567112). 6556 PA: RTP audio packet carrying an RTP timestamp of 12344878. Which 6557 corresponds to NPT = (12344878 - A) / 16000 + 3.25 = 3.2 6558 PV: RTP video packet carrying an RTP timestamp of 29573412. Which 6559 corresponds to NPT = (29573412 - V) / 90000 + 3.25 = 3.32 6561 16.44. Scale 6563 A scale value of 1 indicates normal play at the normal forward 6564 viewing rate. If not 1, the value corresponds to the rate with 6565 respect to normal viewing rate. For example, a ratio of 2 indicates 6566 twice the normal viewing rate ("fast forward") and a ratio of 0.5 6567 indicates half the normal viewing rate. In other words, a ratio of 2 6568 has content time increase at twice the playback time. For every 6569 second of elapsed (wallclock) time, 2 seconds of content time will be 6570 delivered. A negative value indicates reverse direction. For 6571 certain media transports this may require certain considerations to 6572 work consistent, see Appendix C.1 for description on how RTP handles 6573 this. 6575 The transmitted data rate SHOULD NOT be changed by selection of a 6576 different scale value. The resulting bit-rate should be reasonably 6577 close to the nominal bit-rate of the content for Scale = 1. The 6578 server has to actively manipulate the data when needed to meet the 6579 bitrate constraints. Implementation of scale changes depends on the 6580 server and media type. For video, a server may, for example, deliver 6581 only key frames or selected frames. For audio, it may time-scale the 6582 audio while preserving pitch or, less desirably, deliver fragments of 6583 audio, or completely mute the audio. 6585 The server and content may restrict the range of scale values that it 6586 supports. The supported values are indicated by the Media-Properties 6587 header (Section 16.28). The client SHOULD only indicate values 6588 indicated to be supported. However, as the values may change as the 6589 content progresses a requested value may no longer be valid when the 6590 request arrives. Thus, a non-supported value in a request does not 6591 generate an error, only forces the server to choose the closest 6592 value. The response MUST always contain the actual scale value 6593 chosen by the server. 6595 If the server does not implement the possibility to scale, it will 6596 not return a Scale header. A server supporting Scale operations for 6597 PLAY MUST indicate this with the use of the "play.scale" feature-tag. 6599 When indicating a negative scale for a reverse playback, the Range 6600 header MUST indicate a decreasing range as described in 6601 Section 16.38. 6603 Example of playing in reverse at 3.5 times normal rate: 6604 Scale: -3.5 6605 Range: npt=15-10 6607 16.45. Seek-Style 6609 When a client sends a PLAY request with a Range header to perform a 6610 random access to the media, the client does not know if the server 6611 will pick the first media samples or the first random access point 6612 prior to the request range. Depending on use case, the client may 6613 have a strong preference. To express this preference and provide the 6614 client with information on how the server actually acted on that 6615 preference the Seek-Style header is defined. 6617 Seek-Style is a general header that MAY be included in any PLAY 6618 request to indicate the client's preference for any media stream that 6619 has random access properties. The server MUST always include the 6620 header in any PLAY response for media with random access properties 6621 to indicate what policy was applied. A server that receives a 6622 unknown Seek-Style policy MUST ignore it and select the server 6623 default policy. A client receiving an unknown policy MUST ignore it 6624 and use the Range header and any media synchronization information as 6625 basis to determine what the server did. 6627 This specification defines the following seek policies that may be 6628 requested (see also Section Section 4.9.1): 6630 RAP: Random Access Point (RAP) is the behavior of requesting the 6631 server to locate the closest previous random access point that 6632 exist in the media aggregate and deliver from that. By requesting 6633 a RAP, media quality will be the best possible as all media will 6634 be delivered from a point where full media state can be 6635 established in the media decoder. 6637 CoRAP: Conditional Random Access Point (CoRAP) is a variant of the 6638 above RAP behavior. This policy is primarily intended for cases 6639 where there are larger distance between the random access points 6640 in the media. CoRAP is conditioned on that there is a Random 6641 Access Point closer to the requested start point than to the 6642 current pause point. This policy assumes that the media state 6643 existing prior to the pause is usable if delivery is continued. 6644 If the client or server knows that this is not the fact the RAP 6645 policy should be used. In other words: in most cases when the 6646 client requests a start point prior to the current pause point, a 6647 valid decoding dependency chain from the media delivered prior to 6648 the pause and to the requested media unit will not exist. If the 6649 server searched to a random access point the server MUST return 6650 the CoRAP policy in the Seek-Style header and adjust the Range 6651 header to reflect the position of the picked RAP. In case the 6652 random access point is further away and the server selects to 6653 continue from the current pause point it MUST include the "Next" 6654 policy in the Seek-Style header and adjust the Range header start 6655 point to the current pause point. 6657 First-Prior: The first-prior policy will start delivery with the 6658 media unit that has a playout time first prior to the requested 6659 time. For discrete media that would only include media units that 6660 would still be rendered at the request time. For continuous media 6661 that is media that will be render during the requested start time 6662 of the range. 6664 Next: The next media units after the provided start time of the 6665 range. For continuous framed media that would mean the first next 6666 frame after the provided time. For discrete media the first unit 6667 that is to be rendered after the provided time. The main usage is 6668 for this case is when the client knows it has all media up to a 6669 certain point and would like to continue delivery so that a 6670 complete non-interrupted media playback can be achieved. Example 6671 of such scenarios include switching from a broadcast/multicast 6672 delivery to a unicast based delivery. This policy MUST only be 6673 used on the client's explicit request. 6675 Please note that these expressed preferences exist for optimizing the 6676 startup time or the media quality. The "Next" policy breaks the 6677 normal definition of the Range header to enable a client to request 6678 media with minimal overlap, although some may still occur for 6679 aggregated sessions. RAP and First-Prior both fulfill the 6680 requirement of providing media from the requested range and forward. 6681 However, unless RAP is used, the media quality for many media codecs 6682 using predictive methods can be severely degraded unless additional 6683 data is available as, for example, already buffered, or through other 6684 side channels. 6686 16.46. Server 6688 The Server response-header field contains information about the 6689 software used by the origin server to handle the request. The field 6690 can contain multiple product tokens and comments identifying the 6691 server and any significant subproducts. The product tokens are 6692 listed in order of their significance for identifying the 6693 application. 6695 Example: 6696 Server: PhonyServer/1.0 6698 If the response is being forwarded through a proxy, the proxy 6699 application MUST NOT modify the Server response-header. Instead, it 6700 SHOULD include a Via field (Section 16.56). 6702 16.47. Session 6704 The Session request-header and response-header field identifies an 6705 RTSP session. An RTSP session is created by the server as a result 6706 of a successful SETUP request and in the response the session 6707 identifier is given to the client. The RTSP session exist until 6708 destroyed by a TEARDOWN, REDIRECT or timed out by the server. 6710 The session identifier is chosen by the server (see Section 4.3) and 6711 MUST be returned in the SETUP response. Once a client receives a 6712 session identifier, it MUST be included in any request related to 6713 that session. This means that the Session header MUST be included in 6714 a request using the following methods: PLAY, PAUSE, and TEARDOWN, and 6715 MAY be included in SETUP, OPTIONS, SET_PARAMETER, GET_PARAMETER, and 6716 REDIRECT, and MUST NOT be included in DESCRIBE. In an RTSP response 6717 the session header MUST be included in methods, SETUP, PLAY, and 6718 PAUSE, and MAY be included in methods, TEARDOWN, and REDIRECT, and if 6719 included in the request of the following methods it MUST also be 6720 included in the response, OPTIONS, GET_PARAMETER, and SET_PARAMETER, 6721 and MUST NOT be included in DESCRIBE. 6723 Note that a session identifier identifies an RTSP session across 6724 transport sessions or connections. RTSP requests for a given session 6725 can use different URIs (Presentation and media URIs). Note, that 6726 there are restrictions depending on the session which URIs that are 6727 acceptable for a given method. However, multiple "user" sessions for 6728 the same URI from the same client will require use of different 6729 session identifiers. 6731 The session identifier is needed to distinguish several delivery 6732 requests for the same URI coming from the same client. 6734 The response 454 (Session Not Found) MUST be returned if the session 6735 identifier is invalid. 6737 The header MAY include the session timeout period. If not explicitly 6738 provided this value is set to 60 seconds. As this affects how often 6739 session keep-alives are needed values smaller than 30 seconds are not 6740 recommended. However, larger than default values can be useful in 6741 applications of RTSP that have inactive but established sessions for 6742 longer time periods. 6744 60 seconds was chosen as session timeout value due to: Resulting 6745 in not to frequent keep-alive messages and having low sensitivity 6746 to variations in request response timing. If one reduces the 6747 timeout value to below 30 seconds the corresponding request 6748 response timeout becomes a significant part of the session 6749 timeout. 60 seconds also allows for reasonably rapid recovery of 6750 committed server resources in case of client failure. 6752 16.48. Speed 6754 The Speed request-header field requests the server to deliver 6755 specific amounts of nominal media time per unit of delivery time, 6756 contingent on the server's ability and desire to serve the media 6757 stream at the given speed. The client requests the delivery speed to 6758 be within a given range with an lower and upper bound. The server 6759 SHALL deliver at the highest possible speed within the range, but not 6760 faster than the upper-bound, for which the underlying network path 6761 can support the resulting transport data rates. As long as any speed 6762 value within the given range can be provided the server SHALL NOT 6763 modify the media quality. Only if the server is unable to delivery 6764 media at the speed value provided by the lower bound shall it reduce 6765 the media quality. 6767 Implementation of the Speed functionality by the server is OPTIONAL. 6768 The server can indicate its support through a feature-tag, 6769 play.speed. The lack of a Speed header in the response is an 6770 indication of lack of support of this functionality. 6772 The speed parameter values are expressed as a positive decimal value, 6773 e.g., a value of 2.0 indicates that data is to be delivered twice as 6774 fast as normal. A speed value of zero is invalid. The range is 6775 specified in the form "lower bound - upper bound". The lower bound 6776 value may be smaller or equal to the upper bound. All speeds may not 6777 be possible to support. Therefore the server MAY modify the 6778 requested values to the closest supported. The actual supported 6779 speed MUST be included in the response. Note, however, that the use 6780 cases may vary and that Speed value ranges such as 0.7 - 0.8, 6781 0.3-2.0, 1.0-2.5, 2.5-2.5 all have their usage. 6783 Example: 6785 Speed: 1.0-2.5 6787 Use of this header changes the bandwidth used for data delivery. It 6788 is meant for use in specific circumstances where delivery of the 6789 presentation at a higher or lower rate is desired. The main use 6790 cases are buffer operations or local scale operations. Implementors 6791 should keep in mind that bandwidth for the session may be negotiated 6792 beforehand (by means other than RTSP), and therefore re-negotiation 6793 may be necessary. To perform Speed operations the server needs to 6794 ensure that the network path can support the resulting bit-rate. 6795 Thus the media transport needs to support feedback so that the server 6796 can react and adapt to the available bitrate. 6798 16.49. Supported 6800 The Supported header enumerates all the extensions supported by the 6801 client or server using feature tags. The header carries the 6802 extensions supported by the message sending client or server. The 6803 Supported header MAY be included in any request. When present in a 6804 request, the receiver MUST respond with its corresponding Supported 6805 header. Note that the supported headers is also included in 4xx and 6806 5xx responses. 6808 The Supported header contains a list of feature-tags, described in 6809 Section 4.7, that are understood by the client or server. 6811 Example: 6813 C->S: OPTIONS rtsp://example.com/ RTSP/2.0 6814 Supported: foo, bar, blech 6815 User-Agent: PhonyClient/1.2 6817 S->C: RTSP/2.0 200 OK 6818 Supported: bar, blech, baz 6820 16.50. Terminate-Reason 6822 The Terminate-Reason request header allows the server when sending a 6823 REDIRECT or TEARDOWN request to provide a reason for the session 6824 termination and any additional information. This specification 6825 identifies three reasons for Redirections and may be extended in the 6826 future: 6828 Server-Admin: The server needs to be shutdown for some 6829 administrative reason. 6831 Session-Timeout: A client's session is kept alive for extended 6832 periods of time and the server has determined that it needs to 6833 reclaim the resources associated with this session. 6835 Internal-Error An internal error that is impossible to recover from 6836 has occurred forcing the server to terminate the session. 6838 The Server may provide additional parameters containing information 6839 around the redirect. This specification defines the following ones. 6841 time: Provides a wallclock time when the server will stop provide 6842 any service. 6844 user-msg: An UTF-8 text string with a message from the server to the 6845 user. This message SHOULD be displayed to the user. 6847 16.51. Timestamp 6849 The Timestamp general-header describes when the agent sent the 6850 request. The value of the timestamp is of significance only to the 6851 agent and may use any timescale. The responding agent MUST echo the 6852 exact same value and MAY, if it has accurate information about this, 6853 add a floating point number indicating the number of seconds that has 6854 elapsed since it has received the request. The timestamp can be used 6855 by the agent to compute the round-trip time to the responding agent 6856 so that it can adjust the timeout value for retransmissions when 6857 running over a unreliable protocol. It also resolves retransmission 6858 ambiguities for unreliable transport of RTSP. 6860 Note that the present specification provides only for reliable 6861 transport of RTSP messages. The Timestamp general-header is 6862 specified in case the protocol is extended in the future to use 6863 unreliable transport. 6865 16.52. Transport 6867 The Transport request and response header indicates which transport 6868 protocol is to be used and configures its parameters such as 6869 destination address, compression, multicast time-to-live and 6870 destination port for a single stream. It sets those values not 6871 already determined by a presentation description. 6873 A Transport request header MAY contain a list of transport options 6874 acceptable to the client, in the form of multiple transport 6875 specification entries. Transport specifications are comma separated, 6876 listed in decreasing order of preference. Parameters may be added to 6877 each transport specification, separated by a semicolon. The server 6878 MUST return a Transport response-header in the response to indicate 6879 the values actually chosen if any. If the transport specification is 6880 not supported, no transport header is returned and the request MUST 6881 be responded using the status code 461 (Unsupported Transport) 6882 (Section 15.4.26). In case more than one transport specification was 6883 present in the request, the server MUST return the single (transport- 6884 spec) which was actually chosen, if any. The number of transport- 6885 spec entries is expected to be limited as the client will get 6886 guidance on what configurations that are possible from the 6887 presentation description. 6889 The Transport header MAY also be used in subsequent SETUP requests to 6890 change transport parameters. A server MAY refuse to change 6891 parameters of an existing stream. 6893 A transport specification may only contain one of any given parameter 6894 within it. Parameters MAY be given in any order. Additionally, it 6895 may only contain either of the unicast or the multicast transport 6896 type parameter. All parameters need to be understood in a transport 6897 specification, if not, the transport specification MUST be ignored. 6898 RTSP proxies of any type that uses or modifies the transport 6899 specification, e.g. access proxy or security proxy, MUST remove 6900 specifications with unknown parameters before forwarding the RTSP 6901 message. If that result in no remaining transport specification the 6902 proxy shall send a 461 (Unsupported Transport) (Section 15.4.26) 6903 response without any Transport header. 6905 The Transport header is restricted to describing a single media 6906 stream. (RTSP can also control multiple streams as a single 6907 entity.) Making it part of RTSP rather than relying on a 6908 multitude of session description formats greatly simplifies 6909 designs of firewalls. 6911 The general syntax for the transport specifier is a list of slash 6912 separated tokens: 6914 Value1/Value2/Value3... 6915 Which for RTP transports take the form: 6916 RTP/profile/lower-transport. 6918 The default value for the "lower-transport" parameters is specific to 6919 the profile. For RTP/AVP, the default is UDP. 6921 There are two different methods for how to specify where the media 6922 should be delivered for unicast transport: 6924 dest_addr: The presence of this parameter and its values indicates 6925 the destination address or addresses (host address and port 6926 pairs for IP flows) necessary for the media transport. 6928 No dest_addr: The lack of the dest_addr parameter indicates that the 6929 server MUST send media to same address for which the RTSP 6930 messages originates. 6932 The choice of method for indicating where the media is to be 6933 delivered depends on the use case. In some case the only allowed 6934 method will be to use no explicit address indication and have the 6935 server deliver media to the source of the RTSP messages. 6937 For Multicast there is several methods for specifying addresses but 6938 they are different in how they work compared with unicast: 6940 dest_addr with client picked address: The address and relevant 6941 parameters like TTL (scope) for the actual multicast group to 6942 deliver the media to. There are security implications 6943 (Section 21) with this method that needs to be addressed if 6944 using this method because a RTSP server can be used as a DoS 6945 attacker on a existing multicast group. 6947 dest_addr using Session Description Information: The information 6948 included in the transport header can all be coming from the 6949 session description, e.g. the SDP c= and m= line. This 6950 mitigates some of the security issues of the previous methods 6951 as it is the session provider that picks the multicast group 6952 and scope. The client MUST include the information if it is 6953 available in the session description. 6955 No dest_addr: The behavior when no explicit multicast group is 6956 present in a request is not defined. 6958 An RTSP proxy will need to take care. If the media is not desired to 6959 be routed through the proxy, the proxy will need to introduce the 6960 destination indication. 6962 Below are the configuration parameters associated with transport: 6964 General parameters: 6966 unicast / multicast: This parameter is a mutually exclusive 6967 indication of whether unicast or multicast delivery will be 6968 attempted. One of the two values MUST be specified. Clients 6969 that are capable of handling both unicast and multicast 6970 transmission needs to indicate such capability by including two 6971 full transport-specs with separate parameters for each. 6973 layers: The number of multicast layers to be used for this media 6974 stream. The layers are sent to consecutive addresses starting 6975 at the dest_addr address. If the parameter is not included, it 6976 defaults to a single layer. 6978 dest_addr: A general destination address parameter that can contain 6979 one or more address specifications. Each combination of 6980 protocol/profile/lower transport needs to have the format and 6981 interpretation of its address specification defined. For RTP/ 6982 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 6983 containing a host address and port. Note, only a single 6984 destination parameter per transport spec is intended. The 6985 usage of multiple destination to distribute a single media to 6986 multiple entities is unspecified. 6988 The client originating the RTSP request MAY specify the 6989 destination address of the stream recipient with the host 6990 address part of the tuple. When the destination address is 6991 specified, the recipient may be a different party than the 6992 originator of the request. To avoid becoming the unwitting 6993 perpetrator of a remote-controlled denial-of-service attack, a 6994 server MUST perform security checks (see Section 21.1) and 6995 SHOULD log such attempts before allowing the client to direct a 6996 media stream to a recipient address not chosen by the server. 6997 Implementations cannot rely on TCP as reliable means of client 6998 identification. If the server does not allow the host address 6999 part of the tuple to be set, it MUST return 463 (Destination 7000 Prohibited). 7002 The host address part of the tuple MAY be empty, for example 7003 ":58044", in cases when only destination port is desired to be 7004 specified. Responses to requests including the Transport 7005 header with a dest_addr parameter SHOULD include the full 7006 destination address that is actually used by the server. The 7007 server MUST NOT remove address information present already in 7008 the request when responding unless the protocol requires it. 7010 src_addr: A general source address parameter that can contain one or 7011 more address specifications. Each combination of protocol/ 7012 profile/lower transport needs to have the format and 7013 interpretation of its address specification defined. For RTP/ 7014 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 7015 containing a host address and port. 7017 This parameter MUST be specified by the server if it transmits 7018 media packets from another address than the one RTSP messages 7019 are sent to. This will allow the client to verify source 7020 address and give it a destination address for its RTCP feedback 7021 packets if RTP is used. The address or addresses indicated in 7022 the src_addr parameter SHOULD be used both for sending and 7023 receiving of the media streams data packets. The main reasons 7024 are threefold: First, indicating the port and source address(s) 7025 lets the receiver know where from the packets is expected to 7026 originate. Secondly, traversal of NATs are greatly simplified 7027 when traffic is flowing symmetrically over a NAT binding. 7028 Thirdly, certain NAT traversal mechanisms, needs to know to 7029 which address and port to send so called "binding packets" from 7030 the receiver to the sender, thus creating a address binding in 7031 the NAT that the sender to receiver packet flow can use. 7033 This information may also be available through SDP. 7034 However, since this is more a feature of transport than 7035 media initialization, the authoritative source for this 7036 information should be in the SETUP response. 7038 mode: The mode parameter indicates the methods to be supported for 7039 this session. Currently defined valid values are "PLAY". If 7040 not provided, the default is "PLAY". The "RECORD" value was 7041 defined in RFC 2326 and is in this specification unspecified 7042 but reserved. RECORD and other values may be specified in the 7043 future. 7045 interleaved: The interleaved parameter implies mixing the media 7046 stream with the control stream in whatever protocol is being 7047 used by the control stream, using the mechanism defined in 7048 Section 14. The argument provides the channel number to be 7049 used in the $ statement and MUST be present. This parameter 7050 MAY be specified as a interval, e.g., interleaved=4-5 in cases 7051 where the transport choice for the media stream requires it, 7052 e.g. for RTP with RTCP. The channel number given in the 7053 request are only a guidance from the client to the server on 7054 what channel number(s) to use. The server MAY set any valid 7055 channel number in the response. The declared channel(s) are 7056 bi-directional, so both end-parties MAY send data on the given 7057 channel. One example of such usage is the second channel used 7058 for RTCP, where both server and client sends RTCP packets on 7059 the same channel. 7061 This allows RTP/RTCP to be handled similarly to the way 7062 that it is done with UDP, i.e., one channel for RTP and 7063 the other for RTCP. 7065 MIKEY: This parameter is used in conjunction with transport 7066 specifications that can utilize MIKEY for security context 7067 establishment. So far only the SRTP based RTP profiles SAVP 7068 and SAVPF can utilize MIKEY and this is defined in 7069 Appendix C.1.4.1. This parameter can be included both in 7070 request and response messages. The binary MIKEY message SHALL 7071 be BASE64 [RFC4648] encoded before being included in the value 7072 part of the parameter. 7074 Multicast-specific: 7076 ttl: multicast time-to-live for IPv4. When included in requests the 7077 value indicate the TTL value that the client request the server 7078 to use. In a response, the value actually being used by the 7079 server is returned. A server will need to consider what values 7080 that are reasonable and also the authority of the user to set 7081 this value. Corresponding functions are not needed for IPv6 as 7082 the scoping is part of the address. 7084 RTP-specific: 7086 These parameters are MAY only be used if the media transport protocol 7087 is RTP. 7089 ssrc: The ssrc parameter, if included in a SETUP response, indicates 7090 the RTP SSRC [RFC3550] value(s) that will be used by the media 7091 server for RTP packets within the stream. It is expressed as 7092 an eight digit hexadecimal value. 7094 The ssrc parameter MUST NOT be specified in requests. The 7095 functionality of specifying the ssrc parameter in a SETUP 7096 request is deprecated as it is incompatible with the 7097 specification of RTP in RFC 3550[RFC3550]. If the parameter is 7098 included in the Transport header of a SETUP request, the server 7099 MAY ignore it, and choose appropriate SSRCs for the stream. 7100 The server MAY set the ssrc parameter in the Transport header 7101 of the response. 7103 RTCP-mux: Use to negotiate the usage of RTP and RTCP multiplexing 7104 [RFC5761] on a single underlying transport stream / flow. The 7105 presence of this parameter in a SETUP request indicates the 7106 clients support and requires the server to use RTP and RTCP 7107 multiplexing. The client SHALL only include one transport 7108 stream in the Transport header specification. To provide the 7109 server with a choice between using RTP/RTCP multiplexing or 7110 not, two different transport header specifications must be 7111 included. 7113 The parameters setup and connection defined below MAY only be used if 7114 the media transport protocol of the lower-level transport is 7115 connection-oriented (such as TCP). However, these parameters MUST 7116 NOT be used when interleaving data over the RTSP control connection. 7118 setup: Clients use the setup parameter on the Transport line in a 7119 SETUP request, to indicate the roles it wishes to play in a TCP 7120 connection. This parameter is adapted from [RFC4145]. We 7121 discuss the use of this parameter in RTP/AVP/TCP non- 7122 interleaved transport in Appendix C.2.2; the discussion below 7123 is limited to syntactic issues. Clients may specify the 7124 following values for the setup parameter: ["active":] The 7125 client will initiate an outgoing connection. ["passive":] The 7126 client will accept an incoming connection. ["actpass":] The 7127 client is willing to accept an incoming connection or to 7128 initiate an outgoing connection. 7130 If a client does not specify a setup value, the "active" value 7131 is assumed. 7133 In response to a client SETUP request where the setup parameter 7134 is set to "active", a server's 2xx reply MUST assign the setup 7135 parameter to "passive" on the Transport header line. 7137 In response to a client SETUP request where the setup parameter 7138 is set to "passive", a server's 2xx reply MUST assign the setup 7139 parameter to "active" on the Transport header line. 7141 In response to a client SETUP request where the setup parameter 7142 is set to "actpass", a server's 2xx reply MUST assign the setup 7143 parameter to "active" or "passive" on the Transport header 7144 line. 7146 Note that the "holdconn" value for setup is not defined for 7147 RTSP use, and MUST NOT appear on a Transport line. 7149 connection: Clients use the setup parameter on the Transport line in 7150 a SETUP request, to indicate the SETUP request prefers the 7151 reuse of an existing connection between client and server (in 7152 which case the client sets the "connection" parameter to 7153 "existing"), or that the client requires the creation of a new 7154 connection between client and server (in which cast the client 7155 sets the "connection" parameter to "new"). Typically, clients 7156 use the "new" value for the first SETUP request for a URL, and 7157 "existing" for subsequent SETUP requests for a URL. 7159 If a client SETUP request assigns the "new" value to 7160 "connection", the server response MUST also assign the "new" 7161 value to "connection" on the Transport line. 7163 If a client SETUP request assigns the "existing" value to 7164 "connection", the server response MUST assign a value of 7165 "existing" or "new" to "connection" on the Transport line, at 7166 its discretion. 7168 The default value of "connection" is "existing", for all SETUP 7169 requests (initial and subsequent). 7171 The combination of transport protocol, profile and lower transport 7172 needs to be defined. A number of combinations are defined in the 7173 Appendix C. 7175 Below is a usage example, showing a client advertising the capability 7176 to handle multicast or unicast, preferring multicast. Since this is 7177 a unicast-only stream, the server responds with the proper transport 7178 parameters for unicast. 7180 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 7181 CSeq: 302 7182 Transport: RTP/AVP;multicast;mode="PLAY", 7183 RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7184 "192.0.2.5:3457";mode="PLAY" 7185 Accept-Ranges: NPT, SMPTE, UTC 7186 User-Agent: PhonyClient/1.2 7188 S->C: RTSP/2.0 200 OK 7189 CSeq: 302 7190 Date: Thu, 23 Jan 1997 15:35:06 GMT 7191 Session: 47112344 7192 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7193 "192.0.2.5:3457";src_addr="192.0.2.224:6256"/ 7194 "192.0.2.224:6257";mode="PLAY" 7195 Accept-Ranges: NPT 7196 Media-Properties: Random-Access=0.6, Dynamic, 7197 Time-Limited=20081128T165900 7199 16.53. Unsupported 7201 The Unsupported response-header lists the features not supported by 7202 the responding RTSP agent. In the case where the feature was 7203 specified via the Proxy-Require field (Section 16.35), if there is a 7204 proxy on the path between the client and the server, the proxy MUST 7205 send a response message with a status code of 551 (Option Not 7206 Supported). The request MUST NOT be forwarded. 7208 See Section 16.41 for a usage example. 7210 16.54. User-Agent 7212 The User-Agent general-header field contains information about the 7213 user agent originating the request. This is for statistical 7214 purposes, the tracing of protocol violations, and automated 7215 recognition of user agents for the sake of tailoring responses to 7216 avoid particular user agent limitations. User agents SHOULD include 7217 this field with requests. The field can contain multiple product 7218 tokens and comments identifying the agent and any subproducts which 7219 form a significant part of the user agent. By convention, the 7220 product tokens are listed in order of their significance for 7221 identifying the application. 7223 Example: 7224 User-Agent: PhonyClient/1.2 7226 16.55. Vary 7228 The Vary field value indicates the set of request-header fields that 7229 fully determines, while the response is fresh, whether a cache is 7230 permitted to use the response to reply to a subsequent request 7231 without revalidation. For uncacheable or stale responses, the Vary 7232 field value advises the user agent about the criteria that were used 7233 to select the representation. A Vary field value of "*" implies that 7234 a cache cannot determine from the request headers of a subsequent 7235 request whether this response is the appropriate representation. 7237 An RTSP server SHOULD include a Vary header field with any cacheable 7238 response that is subject to server-driven negotiation. Doing so 7239 allows a cache to properly interpret future requests on that resource 7240 and informs the user agent about the presence of negotiation on that 7241 resource. A server MAY include a Vary header field with a non- 7242 cacheable response that is subject to server-driven negotiation, 7243 since this might provide the user agent with useful information about 7244 the dimensions over which the response varies at the time of the 7245 response. 7247 A Vary field value consisting of a list of field-names signals that 7248 the representation selected for the response is based on a selection 7249 algorithm which considers ONLY the listed request-header field values 7250 in selecting the most appropriate representation. A cache MAY assume 7251 that the same selection will be made for future requests with the 7252 same values for the listed field names, for the duration of time for 7253 which the response is fresh. 7255 The field-names given are not limited to the set of standard request- 7256 header fields defined by this specification. Field names are case- 7257 insensitive. 7259 A Vary field value of "*" signals that unspecified parameters not 7260 limited to the request-headers (e.g., the network address of the 7261 client), play a role in the selection of the response representation. 7262 The "*" value MUST NOT be generated by a proxy server; it may only be 7263 generated by an origin server. 7265 16.56. Via 7267 The Via general-header field MUST be used by proxies to indicate the 7268 intermediate protocols and recipients between the user agent and the 7269 server on requests, and between the origin server and the client on 7270 responses. The field is intended to be used for tracking message 7271 forwards, avoiding request loops, and identifying the protocol 7272 capabilities of all senders along the request/response chain. 7274 Multiple Via field values represents each proxy that has forwarded 7275 the message. Each recipient MUST append its information such that 7276 the end result is ordered according to the sequence of forwarding 7277 applications. 7279 Proxies (e.g., Access Proxy or Translator Proxy) SHOULD NOT, by 7280 default, forward the names and ports of hosts within the private/ 7281 protected region. This information SHOULD only be propagated if 7282 explicitly enabled. If not enabled, the via-received of any host 7283 behind the firewall/NAT SHOULD be replaced by an appropriate 7284 pseudonym for that host. 7286 For organizations that have strong privacy requirements for hiding 7287 internal structures, a proxy MAY combine an ordered subsequence of 7288 Via header field entries with identical sent-protocol values into a 7289 single such entry. Applications MUST NOT combine entries which have 7290 different received-protocol values. 7292 16.57. WWW-Authenticate 7294 The WWW-Authenticate response-header field MUST be included in 401 7295 (Unauthorized) response messages. The field value consists of at 7296 least one challenge that indicates the authentication scheme(s) and 7297 parameters applicable to the Request-URI. 7299 The HTTP access authentication process is described in [RFC2617]. 7300 User agents are advised to take special care in parsing the WWW- 7301 Authenticate field value as it might contain more than one challenge, 7302 or if more than one WWW-Authenticate header field is provided, the 7303 contents of a challenge itself can contain a comma-separated list of 7304 authentication parameters. 7306 17. Proxies 7308 RTSP Proxies are RTSP agents that sit in between a client and a 7309 server. A proxy can take on both the role as a client and as server 7310 depending on what it tries to accomplish. Proxies are also 7311 introduced for several different reasons and the below are often 7312 combined. 7314 Caching Proxy: This type of proxy is used to reduce the workload on 7315 servers and connections. By caching the description and media 7316 streams, i.e., the presentation, the proxy can serve a client 7317 with content, but without requesting it from the server once it 7318 has been cached and has not become stale. See the caching 7319 Section 18. This type of proxy is also expected to understand 7320 RTSP end-point functionality, i.e., functionality identified in 7321 the Require header in addition to what Proxy-Require demands. 7323 Translator Proxy: This type of proxy is used to ensure that an RTSP 7324 client get access to servers and content on an external network 7325 or using content encodings not supported by the client. The 7326 proxy performs the necessary translation of addresses, 7327 protocols or encodings. This type of proxy is expected to also 7328 understand RTSP end-point functionality, i.e. functionality 7329 identified in the Require header in addition to what Proxy- 7330 Require demands. 7332 Access Proxy: This type of proxy is used to ensure that a RTSP 7333 client get access to servers on an external network. Thus this 7334 proxy is placed on the border between two domains, e.g. a 7335 private address space and the public Internet. The proxy 7336 performs the necessary translation, usually addresses. This 7337 type of proxies are required to redirect the media to 7338 themselves or a controlled gateway that perform the translation 7339 before the media can reach the client. 7341 Security Proxy: This type of proxy is used to help facilitate 7342 security functions around RTSP. For example when having a 7343 firewalled network, the security proxy request that the 7344 necessary pinholes in the firewall is opened when a client in 7345 the protected network want to access media streams on the 7346 external side. This proxy can also limit the clients access to 7347 certain type of content. This proxy can perform its function 7348 without redirecting the media between the server and client. 7349 However, in deployments with private address spaces this proxy 7350 is likely to be combined with the access proxy. Anyway, the 7351 functionality of this proxy is usually closely tied into 7352 understand all aspects of the media transport. 7354 Auditing Proxy: RTSP proxies can also provide network owners with a 7355 logging and audit point for RTSP sessions, e.g. for 7356 corporations that tracks their employees usage of the network. 7357 This type of proxy can perform its function without inserting 7358 itself or any other node in the media transport. This proxy 7359 type can also accept unknown methods as it doesn't interfere 7360 with the clients' requests. 7362 All type of proxies can be used also when using secured communication 7363 with TLS as RTSP 2.0 allows the client to approve certificate chains 7364 used for connection establishment from a proxy, see Section 19.3.2. 7365 However, that trust model may not be suitable for all type of 7366 deployment. In those cases, the secured sessions do by-pass of the 7367 proxies. 7369 Access proxies SHOULD NOT be used in equipment like NATs and 7370 firewalls that aren't expected to be regularly maintained, like home 7371 or small office equipment. In these cases it is better to use the 7372 NAT traversal procedures defined for RTSP 2.0 7373 [I-D.ietf-mmusic-rtsp-nat]. The reason for these recommendations is 7374 that any extensions of RTSP resulting in new media transport 7375 protocols or profiles, new parameters etc may fail in a proxy that 7376 isn't maintained. This would impede RTSP's future development and 7377 usage. 7379 17.1. Proxies and Protocol Extensions 7381 The existence of proxies must always be considered when developing 7382 new RTSP extensions. Most types of proxies will need to implement 7383 any new method to operate correctly in the presence of that 7384 extension. New headers can be introduced and will not be blocked by 7385 older proxies. However, it is important to consider if this header 7386 and its function is required to be understood by the proxy or can be 7387 forwarded. If the header needs to be understood a feature-tag 7388 representing the functionality needs to be included in the Proxy- 7389 Require header. Below are guidelines for analysis if the header 7390 needs to be understood. The transport header and its parameters also 7391 shows that headers that are extensible and require correct 7392 interpretation in the proxy also require handling rules. 7394 Whether a proxy needs to understand a header is not easy to 7395 determine, as they serve a broad variety of functions. When 7396 evaluating if a header needs to be understood, one can divide the 7397 functionality into three main categories: 7399 Media modifying: The caching and translator proxies are modifying 7400 the actual media and therefore needs to understand also request 7401 directed to the server that affects how the media is rendered. 7402 Thus, this type of proxies needs to also understand the server 7403 side functionality. 7405 Transport modifying: The access and the security proxy both need to 7406 understand how the transport is performed, either for opening 7407 pinholes or to translate the outer headers, e.g. IP and UDP. 7409 Non-modifying: The audit proxy is special in that it do not modify 7410 the messages in other ways than to insert the Via header. That 7411 makes it possible for this type to forward RTSP message that 7412 contains different type of unknown methods, headers or header 7413 parameters. 7415 Based on the above classification, one should evaluate if the new 7416 functionality requires the Transport modifying type of proxies to 7417 understand it or not. 7419 17.2. Multiplexing and Demultiplexing of Messages 7421 RTSP proxies may have to multiplex multiple RTSP sessions from their 7422 clients towards RTSP servers. This requires that RTSP requests from 7423 multiple clients are multiplexed onto a common connection for 7424 requests outgoing to a RTSP server and on the way back the responses 7425 are demultiplexed from the server to per client responses. On the 7426 protocol level this requires that request and response messages are 7427 handled in both ways, requiring that there is a mechanism to 7428 correlated what request/response pair exchanged between proxy and 7429 server is mapped to what client (or client request). 7431 This multiplexing of requests and demultiplexing of responses is done 7432 by using the CSeq header field (see Section 16.19). The proxy has to 7433 rewrite the CSeq in requests to the server and responses from the 7434 server and remember what CSeq is mapped to what client. 7436 18. Caching 7438 In HTTP, response-request pairs are cached. RTSP differs 7439 significantly in that respect. Responses are not cacheable, with the 7440 exception of the presentation description returned by DESCRIBE. 7441 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 7442 not return any data, caching is not really an issue for these 7443 requests.) However, it is desirable for the continuous media data, 7444 typically delivered out-of-band with respect to RTSP, to be cached, 7445 as well as the session description. 7447 On receiving a SETUP or PLAY request, a proxy ascertains whether it 7448 has an up-to-date copy of the continuous media content and its 7449 description. It can determine whether the copy is up-to-date by 7450 issuing a SETUP or DESCRIBE request, respectively, and comparing the 7451 Last-Modified header with that of the cached copy. If the copy is 7452 not up-to-date, it modifies the SETUP transport parameters as 7453 appropriate and forwards the request to the origin server. 7454 Subsequent control commands such as PLAY or PAUSE then pass the proxy 7455 unmodified. The proxy delivers the continuous media data to the 7456 client, while possibly making a local copy for later reuse. The 7457 exact allowed behavior of the cache is given by the cache-response 7458 directives described in Section 16.10. A cache MUST answer any 7459 DESCRIBE requests if it is currently serving the stream to the 7460 requester, as it is possible that low-level details of the stream 7461 description may have changed on the origin-server. 7463 Note that an RTSP cache, is of the "cut-through" variety. Rather 7464 than retrieving the whole resource from the origin server, the cache 7465 simply copies the streaming data as it passes by on its way to the 7466 client. Thus, it does not introduce additional latency. 7468 To the client, an RTSP proxy cache appears like a regular media 7469 server, to the media origin server like a client. Just as an HTTP 7470 cache has to store the content type, content language, and so on for 7471 the objects it caches, a media cache has to store the presentation 7472 description. Typically, a cache eliminates all transport-references 7473 (that is, e.g. multicast information) from the presentation 7474 description, since these are independent of the data delivery from 7475 the cache to the client. Information on the encodings remains the 7476 same. If the cache is able to translate the cached media data, it 7477 would create a new presentation description with all the encoding 7478 possibilities it can offer. 7480 18.1. Validation Model 7482 When a cache has a stale entry that it would like to use as a 7483 response to a client's request, it first has to check with the origin 7484 server (or possibly an intermediate cache with a fresh response) to 7485 see if its cached entry is still usable. We call this "validating" 7486 the cache entry. Since we do not want to have to pay the overhead of 7487 retransmitting the full response if the cached entry is good, and we 7488 do not want to pay the overhead of an extra round trip if the cached 7489 entry is invalid, the RTSP protocol supports the use of conditional 7490 methods. 7492 The key protocol features for supporting conditional methods are 7493 those concerned with "cache validators." When an origin server 7494 generates a full response, it attaches some sort of validator to it, 7495 which is kept with the cache entry. When a client (user agent or 7496 proxy cache) makes a conditional request for a resource for which it 7497 has a cache entry, it includes the associated validator in the 7498 request. 7500 The server then checks that validator against the current validator 7501 for the requested resource, and, if they match (see Section 18.1.3), 7502 it responds with a special status code (usually, 304 (Not Modified)) 7503 and no message body. Otherwise, it returns a full response 7504 (including message body). Thus, we avoid transmitting the full 7505 response if the validator matches, and we avoid an extra round trip 7506 if it does not match. 7508 In RTSP, a conditional request looks exactly the same as a normal 7509 request for the same resource, except that it carries a special 7510 header (which includes the validator) that implicitly turns the 7511 method (usually DESCRIBE or SETUP) into a conditional. 7513 The protocol includes both positive and negative senses of cache- 7514 validating conditions. That is, it is possible to request either 7515 that a method be performed if and only if a validator matches or if 7516 and only if no validators match. 7518 Note: a response that lacks a validator may still be cached, and 7519 served from cache until it expires, unless this is explicitly 7520 prohibited by a cache-control directive (see Section 16.10). 7521 However, a cache cannot do a conditional retrieval if it does not 7522 have a validator for the resource, which means it will not be 7523 refreshable after it expires. 7525 Media streams that are being adapted based on the transport capacity 7526 between the server and the cache makes caching more difficult. A 7527 server needs to consider how it views caching of media streams that 7528 it adapts and potentially instruct any caches to not cache such 7529 streams. 7531 18.1.1. Last-Modified Dates 7533 The Last-Modified header (Section 16.26) value is often used as a 7534 cache validator. In simple terms, a cache entry is considered to be 7535 valid if the content has not been modified since the Last-Modified 7536 value. 7538 18.1.2. Message Body Tag Cache Validators 7540 The MTag response-header field value, an message body tag, provides 7541 for an "opaque" cache validator. This might allow more reliable 7542 validation in situations where it is inconvenient to store 7543 modification dates, where the one-second resolution of RTSP-date 7544 values is not sufficient, or where the origin server wishes to avoid 7545 certain paradoxes that might arise from the use of modification 7546 dates. 7548 Message body tags are described in Section 5.3 7550 18.1.3. Weak and Strong Validators 7552 Since both origin servers and caches will compare two validators to 7553 decide if they represent the same or different entities, one normally 7554 would expect that if the message body (i.e., the presentation 7555 description) or any associated message body headers changes in any 7556 way, then the associated validator would change as well. If this is 7557 true, then we call this validator a "strong validator." We call 7558 message body (i.e., the presentation description) or any associated 7559 message body headers an entity for a better understanding. 7561 However, there might be cases when a server prefers to change the 7562 validator only on semantically significant changes, and not when 7563 insignificant aspects of the entity change. A validator that does 7564 not always change when the resource changes is a "weak validator." 7566 Message body tags are normally "strong validators," but the protocol 7567 provides a mechanism to tag an message body tag as "weak." One can 7568 think of a strong validator as one that changes whenever the bits of 7569 an entity changes, while a weak value changes whenever the meaning of 7570 an entity changes. Alternatively, one can think of a strong 7571 validator as part of an identifier for a specific entity, while a 7572 weak validator is part of an identifier for a set of semantically 7573 equivalent entities. 7575 Note: One example of a strong validator is an integer that is 7576 incremented in stable storage every time an entity is changed. 7578 An entity's modification time, if represented with one-second 7579 resolution, could be a weak validator, since it is possible that 7580 the resource might be modified twice during a single second. 7582 Support for weak validators is optional. However, weak validators 7583 allow for more efficient caching of equivalent objects. 7585 A "use" of a validator is either when a client generates a request 7586 and includes the validator in a validating header field, or when a 7587 server compares two validators. 7589 Strong validators are usable in any context. Weak validators are 7590 only usable in contexts that do not depend on exact equality of an 7591 entity. For example, either kind is usable for a conditional 7592 DESCRIBE of a full entity. However, only a strong validator is 7593 usable for a sub-range retrieval, since otherwise the client might 7594 end up with an internally inconsistent entity. 7596 Clients MAY issue DESCRIBE requests with either weak validators or 7597 strong validators. Clients MUST NOT use weak validators in other 7598 forms of request. 7600 The only function that the RTSP protocol defines on validators is 7601 comparison. There are two validator comparison functions, depending 7602 on whether the comparison context allows the use of weak validators 7603 or not: 7605 o The strong comparison function: in order to be considered equal, 7606 both validators MUST be identical in every way, and both MUST NOT 7607 be weak. 7609 o The weak comparison function: in order to be considered equal, 7610 both validators MUST be identical in every way, but either or both 7611 of them MAY be tagged as "weak" without affecting the result. 7613 An message body tag is strong unless it is explicitly tagged as weak. 7615 A Last-Modified time, when used as a validator in a request, is 7616 implicitly weak unless it is possible to deduce that it is strong, 7617 using the following rules: 7619 o The validator is being compared by an origin server to the actual 7620 current validator for the entity and, 7622 o That origin server reliably knows that the associated entity did 7623 not change twice during the second covered by the presented 7624 validator. 7626 OR 7628 o The validator is about to be used by a client in an If-Modified- 7629 Since, because the client has a cache entry for the associated 7630 entity, and 7632 o That cache entry includes a Date value, which gives the time when 7633 the origin server sent the original response, and 7635 o The presented Last-Modified time is at least 60 seconds before the 7636 Date value. 7638 OR 7640 o The validator is being compared by an intermediate cache to the 7641 validator stored in its cache entry for the entity, and 7643 o That cache entry includes a Date value, which gives the time when 7644 the origin server sent the original response, and 7646 o The presented Last-Modified time is at least 60 seconds before the 7647 Date value. 7649 This method relies on the fact that if two different responses were 7650 sent by the origin server during the same second, but both had the 7651 same Last-Modified time, then at least one of those responses would 7652 have a Date value equal to its Last-Modified time. The arbitrary 60- 7653 second limit guards against the possibility that the Date and Last- 7654 Modified values are generated from different clocks, or at somewhat 7655 different times during the preparation of the response. An 7656 implementation MAY use a value larger than 60 seconds, if it is 7657 believed that 60 seconds is too short. 7659 If a client wishes to perform a sub-range retrieval on a value for 7660 which it has only a Last-Modified time and no opaque validator, it 7661 MAY do this only if the Last-Modified time is strong in the sense 7662 described here. 7664 18.1.4. Rules for When to Use Message Body Tags and Last-Modified Dates 7666 We adopt a set of rules and recommendations for origin servers, 7667 clients, and caches regarding when various validator types ought to 7668 be used, and for what purposes. 7670 RTSP origin servers: 7672 o SHOULD send an message body tag validator unless it is not 7673 feasible to generate one. 7675 o MAY send a weak message body tag instead of a strong message body 7676 tag, if performance considerations support the use of weak message 7677 body tags, or if it is unfeasible to send a strong message body 7678 tag. 7680 o SHOULD send a Last-Modified value if it is feasible to send one, 7681 unless the risk of a breakdown in semantic transparency that could 7682 result from using this date in an If-Modified-Since header would 7683 lead to serious problems. 7685 In other words, the preferred behavior for an RTSP origin server is 7686 to send both a strong message body tag and a Last-Modified value. 7688 In order to be legal, a strong message body tag MUST change whenever 7689 the associated entity value changes in any way. A weak message body 7690 tag SHOULD change whenever the associated entity changes in a 7691 semantically significant way. 7693 Note: in order to provide semantically transparent caching, an 7694 origin server must avoid reusing a specific strong message body 7695 tag value for two different entities, or reusing a specific weak 7696 message body tag value for two semantically different entities. 7697 Cache entries might persist for arbitrarily long periods, 7698 regardless of expiration times, so it might be inappropriate to 7699 expect that a cache will never again attempt to validate an entry 7700 using a validator that it obtained at some point in the past. 7702 RTSP clients: 7704 o If an message body tag has been provided by the origin server, 7705 MUST use that message body tag in any cache-conditional request 7706 (using If- Match or If-None-Match). 7708 o If only a Last-Modified value has been provided by the origin 7709 server, SHOULD use that value in non-subrange cache-conditional 7710 requests (using If-Modified-Since). 7712 o If both an message body tag and a Last-Modified value have been 7713 provided by the origin server, SHOULD use both validators in 7714 cache-conditional requests. 7716 An RTSP origin server, upon receiving a conditional request that 7717 includes both a Last-Modified date (e.g., in an If-Modified-Since 7718 header) and one or more message body tags (e.g., in an If-Match, If- 7719 None-Match, or If-Range header field) as cache validators, MUST NOT 7720 return a response status of 304 (Not Modified) unless doing so is 7721 consistent with all of the conditional header fields in the request. 7723 Note: The general principle behind these rules is that RTSP 7724 servers and clients should transmit as much non-redundant 7725 information as is available in their responses and requests. RTSP 7726 systems receiving this information will make the most conservative 7727 assumptions about the validators they receive. 7729 18.1.5. Non-validating Conditionals 7731 The principle behind message body tags is that only the service 7732 author knows the semantics of a resource well enough to select an 7733 appropriate cache validation mechanism, and the specification of any 7734 validator comparison function more complex than byte-equality would 7735 open up a can of worms. Thus, comparisons of any other headers are 7736 never used for purposes of validating a cache entry. 7738 18.2. Invalidation After Updates or Deletions 7740 The effect of certain methods performed on a resource at the origin 7741 server might cause one or more existing cache entries to become non- 7742 transparently invalid. That is, although they might continue to be 7743 "fresh," they do not accurately reflect what the origin server would 7744 return for a new request on that resource. 7746 There is no way for the RTSP protocol to guarantee that all such 7747 cache entries are marked invalid. For example, the request that 7748 caused the change at the origin server might not have gone through 7749 the proxy where a cache entry is stored. However, several rules help 7750 reduce the likelihood of erroneous behavior. 7752 In this section, the phrase "invalidate an entity" means that the 7753 cache will either remove all instances of that entity from its 7754 storage, or will mark these as "invalid" and in need of a mandatory 7755 revalidation before they can be returned in response to a subsequent 7756 request. 7758 Some RTSP methods MUST cause a cache to invalidate an entity. This 7759 is either the entity referred to by the Request-URI, or by the 7760 Location or Content-Location headers (if present). These methods 7761 are: 7763 o DESCRIBE 7764 o SETUP 7766 In order to prevent denial of service attacks, an invalidation based 7767 on the URI in a Location or Content-Location header MUST only be 7768 performed if the host part is the same as in the Request-URI. 7770 A cache that passes through requests for methods it does not 7771 understand SHOULD invalidate any entities referred to by the Request- 7772 URI. 7774 19. Security Framework 7776 The RTSP security framework consists of two high level components: 7777 the pure authentication mechanisms based on HTTP authentication, and 7778 the message transport protection based on TLS, which is independent 7779 of RTSP. Because of the similarity in syntax and usage between RTSP 7780 servers and HTTP servers, the security for HTTP is re-used to a large 7781 extent. 7783 19.1. RTSP and HTTP Authentication 7785 RTSP and HTTP share common authentication schemes, and thus follow 7786 the same usage guidelines as specified in[RFC2617] and also in [H15]. 7787 Servers SHOULD implement both basic and digest [RFC2617] 7788 authentication. Client MUST implement both basic and digest 7789 authentication [RFC2617] so that Server who requires the client to 7790 authenticate can trust that the capability is present. 7792 It should be stressed that using the HTTP authentication alone does 7793 not provide full control message security. Therefore, in 7794 environments requiring tighter security for the control messages, TLS 7795 SHOULD be used, see Section 19.2. 7797 19.2. RTSP over TLS 7799 RTSP MUST follow the same guidelines with regards to TLS [RFC5246] 7800 usage as specified for HTTP, see [RFC2818]. RTSP over TLS is 7801 separated from unsecured RTSP both on URI level and port level. 7802 Instead of using the "rtsp" scheme identifier in the URI, the "rtsps" 7803 scheme identifier MUST be used to signal RTSP over TLS. If no port 7804 is given in a URI with the "rtsps" scheme, port 322 MUST be used for 7805 TLS over TCP/IP. 7807 When a client tries to setup an insecure channel to the server (using 7808 the "rtsp" URI), and the policy for the resource requires a secure 7809 channel, the server MUST redirect the client to the secure service by 7810 sending a 301 redirect response code together with the correct 7811 Location URI (using the "rtsps" scheme). A user or client MAY 7812 upgrade a non secured URI to a secured by changing the scheme from 7813 "rtsp" to "rtsps". A server implementing support for "rtsps" MUST 7814 allow this. 7816 It should be noted that TLS allows for mutual authentication (when 7817 using both server and client certificates). Still, one of the more 7818 common ways TLS is used is to only provide server side authentication 7819 (often to avoid client certificates). TLS is then used in addition 7820 to HTTP authentication, providing transport security and server 7821 authentication, while HTTP Authentication is used to authenticate the 7822 client. 7824 RTSP includes the possibility to keep a TCP session up between the 7825 client and server, throughout the RTSP session lifetime. It may be 7826 convenient to keep the TCP session, not only to save the extra setup 7827 time for TCP, but also the extra setup time for TLS (even if TLS uses 7828 the resume function, there will be almost two extra round trips). 7829 Still, when TLS is used, such behavior introduces extra active state 7830 in the server, not only for TCP and RTSP, but also for TLS. This may 7831 increase the vulnerability to DoS attacks. 7833 In addition to these recommendations, Section 19.3 gives further 7834 recommendations of TLS usage with proxies. 7836 19.3. Security and Proxies 7838 The nature of a proxy is often to act as a "man-in-the-middle", while 7839 security is often about preventing the existence of a "man-in-the- 7840 middle". This section provides clients with the possibility to use 7841 proxies even when applying secure transports (TLS) between the RTSP 7842 agents. The TLS proxy mechanism allows for server and proxy 7843 identification using certificates. However, the client can not be 7844 identified based on certificates. The client needs to select between 7845 using the procedure specified below or using a TLS connection 7846 directly (by-passing any proxies) to the server. The choice may be 7847 dependent on policies. 7849 There are basically two categories of proxies, the transparent 7850 proxies (of which the client is not aware) and the non-transparent 7851 proxies (of which the client is aware). An infrastructure based on 7852 proxies requires that the trust model is such that both client and 7853 servers can trust the proxies to handle the RTSP messages correctly. 7854 To be able to trust a proxy, the client and server also needs to be 7855 aware of the proxy. Hence, transparent proxies cannot generally be 7856 seen as trusted and will not work well with security (unless they 7857 work only at transport layer). In the rest of this section any 7858 reference to proxy will be to a non-transparent proxy, which inspects 7859 or manipulate the RTSP messages. 7861 HTTP Authentication is built on the assumption of proxies and can 7862 provide user-proxy authentication and proxy-proxy/server 7863 authentication in addition to the client-server authentication. 7865 When TLS is applied and a proxy is used, the client will connect to 7866 the proxy's address when connecting to any RTSP server. This implies 7867 that for TLS, the client will authenticate the proxy server and not 7868 the end server. Note that when the client checks the server 7869 certificate in TLS, it MUST check the proxy's identity (URI or 7870 possibly other known identity) against the proxy's identity as 7871 presented in the proxy's Certificate message. 7873 The problem is that for a proxy accepted by the client, the proxy 7874 needs to be provided information on which grounds it should accept 7875 the next-hop certificate. Both the proxy and the user may have rules 7876 for this, and the user have the possibility to select the desired 7877 behavior. To handle this case, the Accept-Credentials header (See 7878 Section 16.2) is used, where the client can force the proxy/proxies 7879 to relay back the chain of certificates used to authenticate any 7880 intermediate proxies as well as the server. Given the assumption 7881 that the proxies are viewed as trusted, it gives the user a 7882 possibility to enforce policies to each trusted proxy of whether it 7883 should accept the next agent in the chain. 7885 A proxy MUST use TLS for the next hop if the RTSP request includes a 7886 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between 7887 client and proxy, or between proxy and proxy), even if the resource 7888 and the end server are not require to use it. The proxy MUST, when 7889 initiating the next hop TLS connection, use the incoming TLS 7890 connections cipher suite list, only modified by removing any cipher 7891 suits that the proxy does not support. In case a proxy fails to 7892 establish a TLS connection due to cipher suite mismatch between proxy 7893 and next hop proxy or server, this is indicated using error code 472 7894 (Failure to establish secure connection). 7896 19.3.1. Accept-Credentials 7898 The Accept-Credentials header can be used by the client to distribute 7899 simple authorization policies to intermediate proxies. The client 7900 includes the Accept-Credentials header to dictate how the proxy 7901 treats the server/next proxy certificate. There are currently three 7902 methods defined: 7904 Any, which means that the proxy (or proxies) MUST accept whatever 7905 certificate presented. This is of course not a recommended 7906 option to use, but may be useful in certain circumstances (such 7907 as testing). 7909 Proxy, which means that the proxy (or proxies) MUST use its own 7910 policies to validate the certificate and decide whether to 7911 accept it or not. This is convenient in cases where the user 7912 has a strong trust relation with the proxy. Reason why a 7913 strong trust relation may exist are; personal/company proxy, 7914 proxy has a out-of-band policy configuration mechanism. 7916 User, which means that the proxy (or proxies) MUST send credential 7917 information about the next hop to the client for authorization. 7918 The client can then decide whether the proxy should accept the 7919 certificate or not. See Section 19.3.2 for further details. 7921 If the Accept-Credentials header is not included in the RTSP request 7922 from the client, then the "Proxy" method MUST be used as default. If 7923 another method than the "Proxy" is to be used, then the Accept- 7924 Credentials header MUST be included in all of the RTSP request from 7925 the client. This is because it cannot be assumed that the proxy 7926 always keeps the TLS state or the users previous preference between 7927 different RTSP messages (in particular if the time interval between 7928 the messages is long). 7930 With the "Any" and "Proxy" methods the proxy will apply the policy as 7931 defined for respectively method. If the policy does not accept the 7932 credentials of the next hop, the proxy MUST respond with a message 7933 using status code 471 (Connection Credentials not accepted). 7935 An RTSP request in the direction server to client MUST NOT include 7936 the Accept-Credential header. As for the non-secured communication, 7937 the possibility for these requests depends on the presence of a 7938 client established connection. However, if the server to client 7939 request is in relation to a session established over a TLS secured 7940 channel, it MUST be sent in a TLS secured connection. That secured 7941 connection MUST also be the one used by the last client to server 7942 request. If no such transport connection exist at the time when the 7943 server desires to send the request, the server discard the message. 7945 Further policies MAY be defined and registered, but should be done so 7946 with caution. 7948 19.3.2. User approved TLS procedure 7950 For the "User" method, each proxy MUST perform the following 7951 procedure for each RTSP request: 7953 o Setup the TLS session to the next hop if not already present (i.e. 7954 run the TLS handshake, but do not send the RTSP request). 7956 o Extract the peer certificate chain for the TLS session. 7958 o Check if a matching identity and hash of the peer certificate is 7959 present in the Accept-Credentials header. If present, send the 7960 message to the next hop, and conclude these procedures. If not, 7961 go to the next step. 7963 o The proxy responds to the RTSP request with a 470 or 407 response 7964 code. The 407 response code MAY be used when the proxy requires 7965 both user and connection authorization from user or client. In 7966 this message the proxy MUST include a Connection-Credentials 7967 header, see Section 16.12 with the next hop's identity and 7968 certificate. 7970 The client MUST upon receiving a 470 or 407 response with Connection- 7971 Credentials header take the decision on whether to accept the 7972 certificate or not (if it cannot do so, the user SHOULD be 7973 consulted). If the certificate is accepted, the client has to again 7974 send the RTSP request. In that request the client has to include the 7975 Accept-Credentials header including the hash over the DER encoded 7976 certificate for all trusted proxies in the chain. 7978 Example: 7980 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7981 CSeq: 2 7982 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7983 "192.0.2.5:4589" 7984 Accept-Ranges: NPT, SMPTE, UTC 7985 Accept-Credentials: User 7987 P->C: RTSP/2.0 470 Connection Authorization Required 7988 CSeq: 2 7989 Connection-Credentials: "rtsps://test.example.org"; 7990 MIIDNTCCAp... 7992 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7993 CSeq: 3 7994 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7995 "192.0.2.5:4589" 7996 Accept-Credentials: User "rtsps://test.example.org";sha-256; 7997 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 7998 Accept-Ranges: NPT, SMPTE, UTC 8000 P->S: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 8001 CSeq: 3 8002 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 8003 "192.0.2.5:4589" 8004 Via: RTSP/2.0 proxy.example.org 8005 Accept-Credentials: User "rtsps://test.example.org";sha-256; 8006 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 8007 Accept-Ranges: NPT, SMPTE, UTC 8009 One implication of this process is that the connection for secured 8010 RTSP messages may take significantly more round-trip times for the 8011 first message. A complete extra message exchange between the proxy 8012 connecting to the next hop and the client results because of the 8013 process for approval for each hop. However, if each message contains 8014 the chain of proxies that the requester accepts, the remaining 8015 message exchange should not be delayed. The procedure of including 8016 the credentials in each request rather than building state in each 8017 proxy, avoids the need for revocation procedures. 8019 20. Syntax 8021 The RTSP syntax is described in an Augmented Backus-Naur Form (ABNF) 8022 as defined in RFC 5234 [RFC5234]. It uses the basic definitions 8023 present in RFC 5234. 8025 Please note that ABNF strings, e.g. "Accept", are case insensitive 8026 as specified in section 2.3 of RFC 5234. 8028 20.1. Base Syntax 8030 RTSP header values can be folded onto multiple lines if the 8031 continuation line begins with a space or horizontal tab. All linear 8032 white space, including folding, has the same semantics as SP. A 8033 recipient MAY replace any linear white space with a single SP before 8034 interpreting the field value or forwarding the message downstream. 8035 This is intended to behave exactly as HTTP/1.1 as described in RFC 8036 2616 [RFC2616]. The SWS construct is used when linear white space is 8037 optional, generally between tokens and separators. 8039 To separate the header name from the rest of value, a colon is used, 8040 which, by the above rule, allows whitespace before, but no line 8041 break, and whitespace after, including a line break. The HCOLON 8042 defines this construct. 8044 OCTET = %x00-FF ; any 8-bit sequence of data 8045 CHAR = %x01-7F ; any US-ASCII character (octets 1 - 127) 8046 UPALPHA = %x41-5A ; any US-ASCII uppercase letter "A".."Z" 8047 LOALPHA = %x61-7A ;any US-ASCII lowercase letter "a".."z" 8048 ALPHA = UPALPHA / LOALPHA 8049 DIGIT = %x30-39 ; any US-ASCII digit "0".."9" 8050 CTL = %x00-1F / %x7F ; any US-ASCII control character 8051 ; (octets 0 - 31) and DEL (127) 8052 CR = %x0D ; US-ASCII CR, carriage return (13) 8053 LF = %x0A ; US-ASCII LF, linefeed (10) 8054 SP = %x20 ; US-ASCII SP, space (32) 8055 HT = %x09 ; US-ASCII HT, horizontal-tab (9) 8056 DQ = %x22 ; US-ASCII double-quote mark (34) 8057 BACKSLASH = %x5C ; US-ASCII backslash (92) 8058 CRLF = CR LF 8059 LWS = [CRLF] 1*( SP / HT ) ; Line-breaking White Space 8060 SWS = [LWS] ; Separating White Space 8061 HCOLON = *( SP / HT ) ":" SWS 8062 TEXT = %x20-7E / %x80-FF ; any OCTET except CTLs 8063 tspecials = "(" / ")" / "<" / ">" / "@" 8064 / "," / ";" / ":" / BACKSLASH / DQ 8065 / "/" / "[" / "]" / "?" / "=" 8066 / "{" / "}" / SP / HT 8067 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 8068 / %x41-5A / %x5E-7A / %x7C / %x7E) 8069 ; 1* 8070 quoted-string = ( DQ *qdtext DQ ) 8071 qdtext = %x20-21 / %x23-7E / %x80-FF / UTF8-NONASCII 8072 ; any UTF-8 TEXT except <"> 8073 quoted-pair = BACKSLASH CHAR 8074 ctext = %x20-27 / %x2A-7E 8075 / %x80-FF ; any OCTET except CTLs, "(" and ")" 8076 generic-param = token [ EQUAL gen-value ] 8077 gen-value = token / host / quoted-string 8079 safe = "$" / "-" / "_" / "." / "+" 8080 extra = "!" / "*" / "'" / "(" / ")" / "," 8081 rtsp-extra = "!" / "*" / "'" / "(" / ")" 8083 HEX = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" 8084 / "a" / "b" / "c" / "d" / "e" / "f" 8085 LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" 8086 ; lowercase "a-f" Hex 8087 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 8089 unreserved = ALPHA / DIGIT / safe / extra 8090 rtsp-unreserved = ALPHA / DIGIT / safe / rtsp-extra 8092 base64 = *base64-unit [base64-pad] 8093 base64-unit = 4base64-char 8094 base64-pad = (2base64-char "==") / (3base64-char "=") 8095 base64-char = ALPHA / DIGIT / "+" / "/" 8096 SLASH = SWS "/" SWS ; slash 8097 EQUAL = SWS "=" SWS ; equal 8098 LPAREN = SWS "(" SWS ; left parenthesis 8099 RPAREN = SWS ")" SWS ; right parenthesis 8100 COMMA = SWS "," SWS ; comma 8101 SEMI = SWS ";" SWS ; semicolon 8102 COLON = SWS ":" SWS ; colon 8103 MINUS = SWS "-" SWS ; minus/dash 8104 LDQUOT = SWS DQ ; open double quotation mark 8105 RDQUOT = DQ SWS ; close double quotation mark 8106 RAQUOT = ">" SWS ; right angle quote 8107 LAQUOT = SWS "<" ; left angle quote 8109 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 8110 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 8111 / %xE0-EF 2UTF8-CONT 8112 / %xF0-F7 3UTF8-CONT 8113 / %xF8-FB 4UTF8-CONT 8114 / %xFC-FD 5UTF8-CONT 8115 UTF8-CONT = %x80-BF 8117 POS-FLOAT = 1*12DIGIT ["." 1*9DIGIT] 8118 FLOAT = ["-"] POS-FLOAT 8120 20.2. RTSP Protocol Definition 8122 20.2.1. Generic Protocol elements 8123 RTSP-IRI = schemes ":" IRI-rest 8124 IRI-rest = ihier-part [ "?" iquery ] [ "#" ifragment ] 8125 ihier-part = "//" iauthority ipath-abempty 8126 RTSP-IRI-ref = RTSP-IRI / irelative-ref 8127 irelative-ref = irelative-part [ "?" iquery ] [ "#" ifragment ] 8128 irelative-part = "//" iauthority ipath-abempty 8129 / ipath-absolute 8130 / ipath-noscheme 8131 / ipath-empty 8133 iauthority = < As defined in RFC 3987> 8134 ipath = ipath-abempty ; begins with "/" or is empty 8135 / ipath-absolute ; begins with "/" but not "//" 8136 / ipath-noscheme ; begins with a non-colon segment 8137 / ipath-rootless ; begins with a segment 8138 / ipath-empty ; zero characters 8140 ipath-abempty = *( "/" isegment ) 8141 ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] 8142 ipath-noscheme = isegment-nz-nc *( "/" isegment ) 8143 ipath-rootless = isegment-nz *( "/" isegment ) 8144 ipath-empty = 0 8146 isegment = *ipchar [";" *ipchar] 8147 isegment-nz = 1*ipchar [";" *ipchar] 8148 / ";" *ipchar 8149 isegment-nz-nc = (1*ipchar-nc [";" *ipchar-nc]) 8150 / ";" *ipchar-nc 8151 ; non-zero-length segment without any colon ":" 8153 ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" 8154 ipchar-nc = iunreserved / pct-encoded / sub-delims / "@" 8156 iquery = < As defined in RFC 3987> 8157 ifragment = < As defined in RFC 3987> 8158 iunreserved = < As defined in RFC 3987> 8159 pct-encoded = < As defined in RFC 3987> 8160 RTSP-URI = schemes ":" URI-rest 8161 RTSP-REQ-URI = schemes ":" URI-req-rest 8162 RTSP-URI-Ref = RTSP-URI / RTSP-Relative 8163 RTSP-REQ-Ref = RTSP-REQ-URI / RTSP-REQ-Rel 8164 schemes = "rtsp" / "rtsps" / scheme 8165 scheme = < As defined in RFC 3986> 8166 URI-rest = hier-part [ "?" query ] [ "#" fragment ] 8167 URI-req-rest = hier-part [ "?" query ] 8168 ; Note fragment part not allowed in requests 8169 hier-part = "//" authority path-abempty 8171 RTSP-Relative = relative-part [ "?" query ] [ "#" fragment ] 8172 RTSP-REQ-Rel = relative-part [ "?" query ] 8173 relative-part = "//" authority path-abempty 8174 / path-absolute 8175 / path-noscheme 8176 / path-empty 8178 authority = < As defined in RFC 3986> 8179 query = < As defined in RFC 3986> 8180 fragment = < As defined in RFC 3986> 8182 path = path-abempty ; begins with "/" or is empty 8183 / path-absolute ; begins with "/" but not "//" 8184 / path-noscheme ; begins with a non-colon segment 8185 / path-rootless ; begins with a segment 8186 / path-empty ; zero characters 8188 path-abempty = *( "/" segment ) 8189 path-absolute = "/" [ segment-nz *( "/" segment ) ] 8190 path-noscheme = segment-nz-nc *( "/" segment ) 8191 path-rootless = segment-nz *( "/" segment ) 8192 path-empty = 0 8194 segment = *pchar [";" *pchar] 8195 segment-nz = ( 1*pchar [";" *pchar]) / (";" *pchar) 8196 segment-nz-nc = ( 1*pchar-nc [";" *pchar-nc]) / (";" *pchar-nc) 8197 ; non-zero-length segment without any colon ":" 8199 pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 8200 pchar-nc = unreserved / pct-encoded / sub-delims / "@" 8202 sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 8203 / "*" / "+" / "," / "=" 8205 smpte-range = smpte-type ["=" smpte-range-spec] 8206 ; See section 3.4 8207 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 8208 / ( "-" smpte-time ) 8209 smpte-type = "smpte" / "smpte-30-drop" 8210 / "smpte-25" / smpte-type-extension 8211 ; other timecodes may be added 8212 smpte-type-extension = "smpte" token 8213 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 8214 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 8216 npt-range = "npt" ["=" npt-range-spec] 8217 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 8218 npt-time = "now" / npt-sec / npt-hhmmss 8219 npt-sec = 1*19DIGIT [ "." 1*9DIGIT ] 8220 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ] 8221 npt-hh = 1*19DIGIT ; any positive number 8222 npt-mm = 1*2DIGIT ; 0-59 8223 npt-ss = 1*2DIGIT ; 0-59 8225 utc-range = "clock" ["=" utc-range-spec] 8226 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 8227 utc-time = utc-date "T" utc-clock "Z" 8228 utc-date = 8DIGIT 8229 utc-clock = 6DIGIT [ "." 1*9DIGIT ] 8231 feature-tag = token 8233 session-id = 1*256( ALPHA / DIGIT / safe ) 8235 extension-header = header-name HCOLON header-value 8236 header-name = token 8237 header-value = *(TEXT-UTF8char / UTF8-CONT / LWS) 8239 20.2.2. Message Syntax 8240 RTSP-message = Request / Response ; RTSP/2.0 messages 8242 Request = Request-Line 8243 *((general-header 8244 / request-header 8245 / message-header) CRLF) 8246 CRLF 8247 [ message-body-data ] 8249 Response = Status-Line 8250 *((general-header 8251 / response-header 8252 / message-header) CRLF) 8253 CRLF 8254 [ message-body-data ] 8256 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 8258 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 8259 Method = "DESCRIBE" 8260 / "GET_PARAMETER" 8261 / "OPTIONS" 8262 / "PAUSE" 8263 / "PLAY" 8264 / "PLAY_NOTIFY" 8265 / "REDIRECT" 8266 / "SETUP" 8267 / "SET_PARAMETER" 8268 / "TEARDOWN" 8269 / extension-method 8271 extension-method = token 8273 Request-URI = "*" / RTSP-REQ-URI 8274 RTSP-Version = "RTSP/" 1*DIGIT "." 1*DIGIT 8276 message-body-data = 1*OCTET 8278 Status-Code = "100" ; Continue 8279 / "200" ; OK 8280 / "301" ; Moved Permanently 8281 / "302" ; Found 8282 / "303" ; See Other 8283 / "304" ; Not Modified 8284 / "305" ; Use Proxy 8285 / "400" ; Bad Request 8286 / "401" ; Unauthorized 8287 / "402" ; Payment Required 8288 / "403" ; Forbidden 8289 / "404" ; Not Found 8290 / "405" ; Method Not Allowed 8291 / "406" ; Not Acceptable 8292 / "407" ; Proxy Authentication Required 8293 / "408" ; Request Time-out 8294 / "410" ; Gone 8295 / "411" ; Length Required 8296 / "412" ; Precondition Failed 8297 / "413" ; Request Message Body Too Large 8298 / "414" ; Request-URI Too Large 8299 / "415" ; Unsupported Media Type 8300 / "451" ; Parameter Not Understood 8301 / "452" ; reserved 8302 / "453" ; Not Enough Bandwidth 8303 / "454" ; Session Not Found 8304 / "455" ; Method Not Valid in This State 8305 / "456" ; Header Field Not Valid for Resource 8306 / "457" ; Invalid Range 8307 / "458" ; Parameter Is Read-Only 8308 / "459" ; Aggregate operation not allowed 8309 / "460" ; Only aggregate operation allowed 8310 / "461" ; Unsupported Transport 8311 / "462" ; Destination Unreachable 8312 / "463" ; Destination Prohibited 8313 / "464" ; Data Transport Not Ready Yet 8314 / "465" ; Notification Reason Unknown 8315 / "466" ; Key Management Error 8316 / "470" ; Connection Authorization Required 8317 / "471" ; Connection Credentials not accepted 8318 / "472" ; Failure to establish secure connection 8319 / "500" ; Internal Server Error 8320 / "501" ; Not Implemented 8321 / "502" ; Bad Gateway 8322 / "503" ; Service Unavailable 8323 / "504" ; Gateway Time-out 8324 / "505" ; RTSP Version not supported 8325 / "551" ; Option not supported 8326 / extension-code 8328 extension-code = 3DIGIT 8330 Reason-Phrase = 1*(TEXT-UTF8char / HT / SP) 8331 general-header = Cache-Control 8332 / Connection 8333 / CSeq 8334 / Date 8335 / Media-Properties 8336 / Media-Range 8337 / Pipelined-Requests 8338 / Proxy-Supported 8339 / Seek-Style 8340 / Server 8341 / Supported 8342 / Timestamp 8343 / User-Agent 8344 / Via 8345 / extension-header 8347 request-header = Accept 8348 / Accept-Credentials 8349 / Accept-Encoding 8350 / Accept-Language 8351 / Authorization 8352 / Bandwidth 8353 / Blocksize 8354 / From 8355 / If-Match 8356 / If-Modified-Since 8357 / If-None-Match 8358 / Notify-Reason 8359 / Proxy-Require 8360 / Range 8361 / Referrer 8362 / Request-Status 8363 / Require 8364 / Scale 8365 / Session 8366 / Speed 8367 / Supported 8368 / Terminate-Reason 8369 / Transport 8370 / extension-header 8372 response-header = Accept-Credentials 8373 / Accept-Ranges 8374 / Connection-Credentials 8375 / MTag 8376 / Location 8377 / Proxy-Authenticate 8378 / Public 8379 / Range 8380 / Retry-After 8381 / RTP-Info 8382 / Scale 8383 / Session 8384 / Speed 8385 / Transport 8386 / Unsupported 8387 / Vary 8388 / WWW-Authenticate 8389 / extension-header 8391 message-header = Allow 8392 / Content-Base 8393 / Content-Encoding 8394 / Content-Language 8395 / Content-Length 8396 / Content-Location 8397 / Content-Type 8398 / Expires 8399 / Last-Modified 8400 / extension-header 8402 20.2.3. Header Syntax 8404 Accept = "Accept" HCOLON 8405 [ accept-range *(COMMA accept-range) ] 8406 accept-range = media-type-range [SEMI accept-params] 8407 media-type-range = ( "*/*" 8408 / ( m-type SLASH "*" ) 8409 / ( m-type SLASH m-subtype ) 8410 ) *( SEMI m-parameter ) 8411 accept-params = "q" EQUAL qvalue *(SEMI generic-param ) 8412 qvalue = ( "0" [ "." *3DIGIT ] ) 8413 / ( "1" [ "." *3("0") ] ) 8414 Accept-Credentials = "Accept-Credentials" HCOLON cred-decision 8415 cred-decision = ("User" [LWS cred-info]) 8416 / "Proxy" 8417 / "Any" 8418 / (token [LWS 1*header-value]) 8419 ; For future extensions 8420 cred-info = cred-info-data *(COMMA cred-info-data) 8422 cred-info-data = DQ RTSP-REQ-URI DQ SEMI hash-alg SEMI base64 8423 hash-alg = "sha-256" / extension-alg 8424 extension-alg = token 8425 Accept-Encoding = "Accept-Encoding" HCOLON 8426 [ encoding *(COMMA encoding) ] 8427 encoding = codings [SEMI accept-params] 8428 codings = content-coding / "*" 8429 content-coding = token 8430 Accept-Language = "Accept-Language" HCOLON 8431 language *(COMMA language) 8432 language = language-range [SEMI accept-params] 8433 language-range = language-tag / "*" 8434 language-tag = primary-tag *( "-" subtag ) 8435 primary-tag = 1*8ALPHA 8436 subtag = 1*8ALPHA 8437 Accept-Ranges = "Accept-Ranges" HCOLON acceptable-ranges 8438 acceptable-ranges = (range-unit *(COMMA range-unit)) 8439 range-unit = "NPT" / "SMPTE" / "UTC" / extension-format 8440 extension-format = token 8441 Allow = "Allow" HCOLON Method *(COMMA Method) 8442 Authorization = "Authorization" HCOLON credentials 8443 credentials = ("Digest" LWS digest-response) 8444 / other-response 8445 digest-response = dig-resp *(COMMA dig-resp) 8446 dig-resp = username / realm / nonce / digest-uri 8447 / dresponse / algorithm / cnonce 8448 / opaque / message-qop 8449 / nonce-count / auth-param 8450 username = "username" EQUAL username-value 8451 username-value = quoted-string 8452 digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT 8453 digest-uri-value = RTSP-REQ-URI 8454 message-qop = "qop" EQUAL qop-value 8455 cnonce = "cnonce" EQUAL cnonce-value 8456 cnonce-value = nonce-value 8457 nonce-count = "nc" EQUAL nc-value 8458 nc-value = 8LHEX 8459 dresponse = "response" EQUAL request-digest 8460 request-digest = LDQUOT 32LHEX RDQUOT 8461 auth-param = auth-param-name EQUAL 8462 ( token / quoted-string ) 8463 auth-param-name = token 8464 other-response = auth-scheme LWS auth-param 8465 *(COMMA auth-param) 8466 auth-scheme = token 8467 Bandwidth = "Bandwidth" HCOLON 1*19DIGIT 8469 Blocksize = "Blocksize" HCOLON 1*9DIGIT 8471 Cache-Control = "Cache-Control" HCOLON cache-directive 8472 *(COMMA cache-directive) 8473 cache-directive = cache-rqst-directive 8474 / cache-rspns-directive 8476 cache-rqst-directive = "no-cache" 8477 / "max-stale" [EQUAL delta-seconds] 8478 / "min-fresh" EQUAL delta-seconds 8479 / "only-if-cached" 8480 / cache-extension 8482 cache-rspns-directive = "public" 8483 / "private" 8484 / "no-cache" 8485 / "no-transform" 8486 / "must-revalidate" 8487 / "proxy-revalidate" 8488 / "max-age" EQUAL delta-seconds 8489 / cache-extension 8491 cache-extension = token [EQUAL (token / quoted-string)] 8492 delta-seconds = 1*19DIGIT 8494 Connection = "Connection" HCOLON connection-token 8495 *(COMMA connection-token) 8496 connection-token = "close" / token 8498 Connection-Credentials = "Connection-Credentials" HCOLON cred-chain 8499 cred-chain = DQ RTSP-REQ-URI DQ SEMI base64 8501 Content-Base = "Content-Base" HCOLON RTSP-URI 8502 Content-Encoding = "Content-Encoding" HCOLON 8503 content-coding *(COMMA content-coding) 8504 Content-Language = "Content-Language" HCOLON 8505 language-tag *(COMMA language-tag) 8506 Content-Length = "Content-Length" HCOLON 1*19DIGIT 8507 Content-Location = "Content-Location" HCOLON RTSP-REQ-Ref 8508 Content-Type = "Content-Type" HCOLON media-type 8509 media-type = m-type SLASH m-subtype *(SEMI m-parameter) 8510 m-type = discrete-type / composite-type 8511 discrete-type = "text" / "image" / "audio" / "video" 8512 / "application" / extension-token 8513 composite-type = "message" / "multipart" / extension-token 8514 extension-token = ietf-token / x-token 8515 ietf-token = token 8516 x-token = "x-" token 8517 m-subtype = extension-token / iana-token 8518 iana-token = token 8519 m-parameter = m-attribute EQUAL m-value 8520 m-attribute = token 8521 m-value = token / quoted-string 8523 CSeq = "CSeq" HCOLON cseq-nr 8524 cseq-nr = 1*9DIGIT 8525 Date = "Date" HCOLON RTSP-date 8526 RTSP-date = rfc1123-date ; HTTP-date 8527 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 8528 date1 = 2DIGIT SP month SP 4DIGIT 8529 ; day month year (e.g., 02 Jun 1982) 8530 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 8531 ; 00:00:00 - 23:59:59 8532 wkday = "Mon" / "Tue" / "Wed" 8533 / "Thu" / "Fri" / "Sat" / "Sun" 8534 month = "Jan" / "Feb" / "Mar" / "Apr" 8535 / "May" / "Jun" / "Jul" / "Aug" 8536 / "Sep" / "Oct" / "Nov" / "Dec" 8538 Expires = "Expires" HCOLON RTSP-date 8539 From = "From" HCOLON from-spec 8540 from-spec = ( name-addr / addr-spec ) *( SEMI from-param ) 8541 name-addr = [ display-name ] LAQUOT addr-spec RAQUOT 8542 addr-spec = RTSP-REQ-URI / absolute-URI 8543 absolute-URI = < As defined in RFC 3986> 8544 display-name = *(token LWS) / quoted-string 8545 from-param = tag-param / generic-param 8546 tag-param = "tag" EQUAL token 8547 If-Match = "If-Match" HCOLON ("*" / message-tag-list) 8548 message-tag-list = message-tag *(COMMA message-tag) 8549 message-tag = [ weak ] opaque-tag 8550 weak = "W/" 8551 opaque-tag = quoted-string 8552 If-Modified-Since = "If-Modified-Since" HCOLON RTSP-date 8553 If-None-Match = "If-None-Match" HCOLON ("*" / message-tag-list) 8554 Last-Modified = "Last-Modified" HCOLON RTSP-date 8555 Location = "Location" HCOLON RTSP-REQ-URI 8556 Media-Properties = "Media-Properties" HCOLON [media-prop-list] 8557 media-prop-list = media-prop-value *(COMMA media-prop-value) 8558 media-prop-value = ("Random-Access" [EQUAL POS-FLOAT]) 8559 / "Begining-Only" 8560 / "No-Seeking" 8561 / "Immutable" 8562 / "Dynamic" 8563 / "Time-Progressing" 8564 / "Unlimited" 8565 / ("Time-Limited" EQUAL utc-time) 8566 / ("Time-Duration" EQUAL POS-FLOAT) 8567 / ("Scales" EQUAL scale-value-list) 8568 / media-prop-ext 8569 media-prop-ext = token [EQUAL (1*rtsp-unreserved / quoted-string)] 8570 scale-value-list = DQ scale-entry *(COMMA scale-entry) DQ 8571 scale-entry = scale-value / (scale-value COLON scale-value) 8572 scale-value = FLOAT 8573 Media-Range = "Media-Range" HCOLON [ranges-list] 8574 ranges-list = ranges-spec *(COMMA ranges-spec) 8575 MTag = "MTag" HCOLON message-tag 8576 Notify-Reason = "Notify-Reason" HCOLON Notify-Reas-val 8577 Notify-Reas-val = "end-of-stream" 8578 / "media-properties-update" 8579 / "scale-change" 8580 / Notify-Reason-extension 8581 Notify-Reason-extension = token 8582 Pipelined-Requests = "Pipelined-Requests" HCOLON startup-id 8583 startup-id = 1*8DIGIT 8585 Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge-list 8586 challenge-list = challenge *(COMMA challenge) 8587 challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) 8588 / other-challenge 8589 other-challenge = auth-scheme LWS auth-param 8590 *(COMMA auth-param) 8591 digest-cln = realm / domain / nonce 8592 / opaque / stale / algorithm 8593 / qop-options / auth-param 8594 realm = "realm" EQUAL realm-value 8595 realm-value = quoted-string 8596 domain = "domain" EQUAL LDQUOT RTSP-REQ-Ref 8597 *(1*SP RTSP-REQ-Ref ) RDQUOT 8598 nonce = "nonce" EQUAL nonce-value 8599 nonce-value = quoted-string 8600 opaque = "opaque" EQUAL quoted-string 8601 stale = "stale" EQUAL ( "true" / "false" ) 8602 algorithm = "algorithm" EQUAL ("MD5" / "MD5-sess" / token) 8603 qop-options = "qop" EQUAL LDQUOT qop-value 8604 *("," qop-value) RDQUOT 8605 qop-value = "auth" / "auth-int" / token 8606 Proxy-Require = "Proxy-Require" HCOLON feature-tag-list 8607 feature-tag-list = feature-tag *(COMMA feature-tag) 8608 Proxy-Supported = "Proxy-Supported" HCOLON [feature-tag-list] 8610 Public = "Public" HCOLON Method *(COMMA Method) 8612 Range = "Range" HCOLON ranges-spec 8614 ranges-spec = npt-range / utc-range / smpte-range 8615 / range-ext 8616 range-ext = extension-format ["=" range-value] 8617 range-value = 1*(rtsp-unreserved / quoted-string / ":" ) 8619 Referrer = "Referrer" HCOLON (absolute-URI / RTSP-URI-Ref) 8620 Request-Status = "Request-Status" HCOLON req-status-info 8621 req-status-info = cseq-info LWS status-info LWS reason-info 8622 cseq-info = "cseq" EQUAL cseq-nr 8623 status-info = "status" EQUAL Status-Code 8624 reason-info = "reason" EQUAL DQ Reason-Phrase DQ 8625 Require = "Require" HCOLON feature-tag-list 8626 RTP-Info = "RTP-Info" HCOLON [rtsp-info-spec 8627 *(COMMA rtsp-info-spec)] 8628 rtsp-info-spec = stream-url 1*ssrc-parameter 8629 stream-url = "url" EQUAL DQ RTSP-REQ-Ref DQ 8630 ssrc-parameter = LWS "ssrc" EQUAL ssrc HCOLON 8631 ri-parameter *(SEMI ri-parameter) 8632 ri-parameter = ("seq" EQUAL 1*5DIGIT) 8633 / ("rtptime" EQUAL 1*10DIGIT) 8634 / generic-param 8636 Retry-After = "Retry-After" HCOLON ( RTSP-date / delta-seconds ) 8637 Scale = "Scale" HCOLON scale-value 8638 Seek-Style = "Seek-Style" HCOLON Seek-S-values 8639 Seek-S-values = "RAP" 8640 / "CoRAP" 8641 / "First-Prior" 8642 / "Next" 8643 / Seek-S-value-ext 8644 Seek-S-value-ext = token 8646 Server = "Server" HCOLON ( product / comment ) 8647 *(LWS (product / comment)) 8648 product = token [SLASH product-version] 8649 product-version = token 8650 comment = LPAREN *( ctext / quoted-pair) RPAREN 8652 Session = "Session" HCOLON session-id 8653 [ SEMI "timeout" EQUAL delta-seconds ] 8655 Speed = "Speed" HCOLON lower-bound MINUS upper-bound 8656 lower-bound = POS-FLOAT 8657 upper-bound = POS-FLOAT 8659 Supported = "Supported" HCOLON [feature-tag-list] 8660 Terminate-Reason = "Terminate-Reason" HCOLON TR-Info 8661 TR-Info = TR-Reason *(SEMI TR-Parameter) 8662 TR-Reason = "Session-Timeout" 8663 / "Server-Admin" 8664 / "Internal-Error" 8665 / token 8666 TR-Parameter = TR-time / TR-user-msg / generic-param 8667 TR-time = "time" EQUAL utc-time 8668 TR-user-msg = "user-msg" EQUAL quoted-string 8670 Timestamp = "Timestamp" HCOLON timestamp-value [LWS delay] 8671 timestamp-value = *19DIGIT [ "." *9DIGIT ] 8672 delay = *9DIGIT [ "." *9DIGIT ] 8674 Transport = "Transport" HCOLON transport-spec 8675 *(COMMA transport-spec) 8676 transport-spec = transport-id *trns-parameter 8677 transport-id = trans-id-rtp / other-trans 8678 trans-id-rtp = "RTP/" profile ["/" lower-transport] 8679 ; no LWS is allowed inside transport-id 8680 other-trans = token *("/" token) 8682 profile = "AVP" / "SAVP" / "AVPF" / token 8683 lower-transport = "TCP" / "UDP" / token 8684 trns-parameter = (SEMI ( "unicast" / "multicast" )) 8685 / (SEMI "interleaved" EQUAL channel [ "-" channel ]) 8686 / (SEMI "ttl" EQUAL ttl) 8687 / (SEMI "layers" EQUAL 1*DIGIT) 8688 / (SEMI "ssrc" EQUAL ssrc *(SLASH ssrc)) 8689 / (SEMI "mode" EQUAL mode-spec) 8690 / (SEMI "dest_addr" EQUAL addr-list) 8691 / (SEMI "src_addr" EQUAL addr-list) 8692 / (SEMI "setup" EQUAL contrans-setup) 8693 / (SEMI "connection" EQUAL contrans-con) 8694 / (SEMI "RTCP-mux") 8695 / (SEMI "MIKEY" EQUAL MIKEY-Value) 8696 / (SEMI trn-param-ext) 8697 contrans-setup = "active" / "passive" / "actpass" 8698 contrans-con = "new" / "existing" 8699 trn-param-ext = par-name [EQUAL trn-par-value] 8700 par-name = token 8701 trn-par-value = *(rtsp-unreserved / quoted-string) 8702 ttl = 1*3DIGIT ; 0 to 255 8703 ssrc = 8HEX 8704 channel = 1*3DIGIT ; 0 to 255 8705 MIKEY-Value = base64 8706 mode-spec = ( DQ mode *(COMMA mode) DQ ) 8707 mode = "PLAY" / token 8708 addr-list = quoted-addr *(SLASH quoted-addr) 8709 quoted-addr = DQ (host-port / extension-addr) DQ 8710 host-port = ( host [":" port] ) 8711 / ( ":" port ) 8712 extension-addr = 1*qdtext 8713 host = < As defined in RFC 3986> 8714 port = < As defined in RFC 3986> 8715 Unsupported = "Unsupported" HCOLON feature-tag-list 8717 User-Agent = "User-Agent" HCOLON ( product / comment ) 8718 *(LWS (product / comment)) 8720 Vary = "Vary" HCOLON ( "*" / field-name-list) 8721 field-name-list = field-name *(COMMA field-name) 8722 field-name = token 8723 Via = "Via" HCOLON via-parm *(COMMA via-parm) 8724 via-parm = sent-protocol LWS sent-by *( SEMI via-params ) 8725 via-params = via-ttl / via-maddr 8726 / via-received / via-extension 8727 via-ttl = "ttl" EQUAL ttl 8728 via-maddr = "maddr" EQUAL host 8729 via-received = "received" EQUAL (IPv4address / IPv6address) 8730 IPv4address = < As defined in RFC 3986> 8731 IPv6address = < As defined in RFC 3986> 8732 via-extension = generic-param 8733 sent-protocol = protocol-name SLASH protocol-version 8734 SLASH transport-prot 8735 protocol-name = "RTSP" / token 8736 protocol-version = token 8737 transport-prot = "UDP" / "TCP" / "TLS" / other-transport 8738 other-transport = token 8739 sent-by = host [ COLON port ] 8741 WWW-Authenticate = "WWW-Authenticate" HCOLON challenge-list 8743 20.3. SDP extension Syntax 8745 This section defines in ABNF the SDP extensions defined for RTSP. 8746 See Appendix D for the definition of the extensions in text. 8748 control-attribute = "a=control:" *SP RTSP-REQ-Ref CRLF 8750 a-range-def = "a=range:" ranges-spec CRLF 8752 a-mtag-def = "a=mtag:" message-tag CRLF 8754 21. Security Considerations 8756 Because of the similarity in syntax and usage between RTSP servers 8757 and HTTP servers, the security considerations outlined in [H15] apply 8758 also. 8760 Specifically, please note the following: 8762 Abuse of Server Log Information: RTSP and HTTP servers will 8763 presumably have similar logging mechanisms, and thus should be 8764 equally guarded in protecting the contents of those logs, thus 8765 protecting the privacy of the users of the servers. See 8766 [H15.1.1] for HTTP server recommendations regarding server 8767 logs. 8769 Transfer of Sensitive Information: There is no reason to believe 8770 that information transferred or controlled via RTSP may be any 8771 less sensitive than that normally transmitted via HTTP. 8772 Therefore, all of the precautions regarding the protection of 8773 data privacy and user privacy apply to implementors of RTSP 8774 clients, servers, and proxies. See [H15.1.2] for further 8775 details. 8777 Attacks Based On File and Path Names: Though RTSP URIs are opaque 8778 handles that do not necessarily have file system semantics, it 8779 is anticipated that many implementations will translate 8780 portions of the Request-URIs directly to file system calls. In 8781 such cases, file systems SHOULD follow the precautions outlined 8782 in [H15.5], such as checking for ".." in path components. 8784 Personal Information: RTSP clients are often privy to the same 8785 information that HTTP clients are (user name, location, etc.) 8786 and thus should be equally sensitive. See [H15.1] for further 8787 recommendations. 8789 Privacy Issues Connected to Accept Headers: Since may of the same 8790 "Accept" headers exist in RTSP as in HTTP, the same caveats 8791 outlined in [H15.1.4] with regards to their use should be 8792 followed. 8794 DNS Spoofing: Presumably, given the longer connection times 8795 typically associated to RTSP sessions relative to HTTP 8796 sessions, RTSP client DNS optimizations should be less 8797 prevalent. Nonetheless, the recommendations provided in 8798 [H15.3] are still relevant to any implementation which attempts 8799 to rely on a DNS-to-IP mapping to hold beyond a single use of 8800 the mapping. 8802 Location Headers and Spoofing: If a single server supports multiple 8803 organizations that do not trust each another, then it needs to 8804 check the values of Location and Content-Location header fields 8805 in responses that are generated under control of said 8806 organizations to make sure that they do not attempt to 8807 invalidate resources over which they have no authority. 8808 ([H15.4]) 8810 In addition to the recommendations in the current HTTP specification 8811 (RFC 2616 [RFC2616], as of this writing) and also of the previous RFC 8812 2068 [RFC2068], future HTTP specifications may provide additional 8813 guidance on security issues. 8815 The following are added considerations for RTSP implementations. 8817 Concentrated denial-of-service attack: The protocol offers the 8818 opportunity for a remote-controlled denial-of-service attack. 8819 See Section 21.1. 8821 Session hijacking: Since there is no or little relation between a 8822 transport layer connection and an RTSP session, it is possible 8823 for a malicious client to issue requests with random session 8824 identifiers which would affect unsuspecting clients. The 8825 server SHOULD use a large, random and non-sequential session 8826 identifier to minimize the possibility of this kind of attack. 8827 However, unless the RTSP signaling always are confidentiality 8828 protected, e.g. using TLS, an on-path attacker will be able to 8829 hijack a session. For real session security, client 8830 authentication needs to be performed. 8832 Authentication: Servers SHOULD implement both basic and digest 8833 [RFC2617] authentication. In environments requiring tighter 8834 security for the control messages, the transport layer 8835 mechanism TLS [RFC5246] SHOULD be used. 8837 Stream issues: RTSP only provides for stream control. Stream 8838 delivery issues are not covered in this section, nor in the 8839 rest of this draft. RTSP implementations will most likely rely 8840 on other protocols such as RTP, IP multicast, RSVP and IGMP, 8841 and should address security considerations brought up in those 8842 and other applicable specifications. 8844 Persistently suspicious behavior: RTSP servers SHOULD return error 8845 code 403 (Forbidden) upon receiving a single instance of 8846 behavior which is deemed a security risk. RTSP servers SHOULD 8847 also be aware of attempts to probe the server for weaknesses 8848 and entry points and MAY arbitrarily disconnect and ignore 8849 further requests clients which are deemed to be in violation of 8850 local security policy. 8852 Scope of Multicast: If RTSP is used to control the transmission of 8853 media onto a multicast network it is need to consider the scope 8854 that delivery has. RTSP supports the TTL Transport header 8855 parameter to indicate this scope. However, such scope control 8856 is risk as it may be set to large and distribute media beyond 8857 the intended scope. 8859 TLS through proxies: If one uses the possibility to connect TLS in 8860 multiple legs (Section 19.3 one really needs to be aware of the 8861 trust model. That procedure requires full faith and trust in 8862 all proxies that one allows to connect through. They are man 8863 in the middle and has access to all that goes on over the TLS 8864 connection. Thus it is important to consider if that trust 8865 model is acceptable in the actual application. 8867 Resource Exhaustion: As RTSP is a stateful protocol and establish 8868 resource usages on the server there is a clear possibility to 8869 attack the server by trying to overbook these resources to 8870 perform an denial of service attack. This attack can be both 8871 against ongoing sessions and to prevent others from 8872 establishing sessions. RTSP agents will need to have mechanism 8873 to prevent single peers from consuming extensive amounts of 8874 resources. 8876 21.1. Remote denial of Service Attack 8878 The attacker may initiate traffic flows to one or more IP addresses 8879 by specifying them as the destination in SETUP requests. While the 8880 attacker's IP address may be known in this case, this is not always 8881 useful in prevention of more attacks or ascertaining the attackers 8882 identity. Thus, an RTSP server MUST only allow client-specified 8883 destinations for RTSP-initiated traffic flows if the server has 8884 ensured that the specified destination address accepts receiving 8885 media through different security mechanisms. Security mechanisms 8886 that are acceptable in an increased generality are: 8888 o Verification of the client's identity, either against a database 8889 of known users using RTSP authentication mechanisms (preferably 8890 digest authentication or stronger) 8892 o A list of addresses that accept to be media destinations, 8893 especially considering user identity 8895 o Media path based verification 8897 The server SHOULD NOT allow the destination field to be set unless a 8898 mechanism exists in the system to authorize the request originator to 8899 direct streams to the recipient. It is preferred that this 8900 authorization be performed by the media recipient (destination) 8901 itself and the credentials passed along to the server. However, in 8902 certain cases, such as when recipient address is a multicast group, 8903 or when the recipient is unable to communicate with the server in an 8904 out-of-band manner, this may not be possible. In these cases the 8905 server may chose another method such as a server-resident 8906 authorization list to ensure that the request originator has the 8907 proper credentials to request stream delivery to the recipient. 8909 One solution that performs the necessary verification of acceptance 8910 of media suitable for unicast based delivery is the ICE based NAT 8911 traversal method described in [I-D.ietf-mmusic-rtsp-nat]. By using 8912 random passwords and username the probability of unintended 8913 indication as a valid media destination is very low. If the server 8914 include in its STUN requests a cookie (consisting of random material) 8915 that is the destination echo back the solution is also safe against 8916 having a off-path attacker being able to spoof the STUN checks. 8917 Leaving this solution vulnerable only to on-path attackers that can 8918 see the STUN requests go to the target of attack. 8920 For delivery to multicast addresses there is need for another 8921 solution which is not specified here. 8923 22. IANA Considerations 8925 This section sets up a number of registries for RTSP 2.0 that should 8926 be maintained by IANA. These registries are separate from any 8927 registries existing for RTSP 1.0. For each registry there is a 8928 description on what it is required to contain, what specification is 8929 needed when adding a entry with IANA, and finally the entries that 8930 this document needs to register. See also the Section 2.7 "Extending 8931 RTSP". There is also an IANA registration of two SDP attributes. 8933 The sections describing how to register an item uses some of the 8934 requirements level described in RFC 5226 [RFC5226], namely "First 8935 Come, First Served", "Expert Review, "Specification Required", and 8936 "Standards Action". 8938 In case a registry requires a contact person, the authors are the 8939 contact person for any entries created by this document. 8941 A registration request to IANA MUST contain the following 8942 information: 8944 o A name of the item to register according to the rules specified by 8945 the intended registry. 8947 o Indication of who has change control over the feature (for 8948 example, IETF, ISO, ITU-T, other international standardization 8949 bodies, a consortium, a particular company or group of companies, 8950 or an individual); 8952 o A reference to a further description, if available, for example 8953 (in decreasing order of preference) an RFC, a published standard, 8954 a published paper, a patent filing, a technical report, documented 8955 source code or a computer manual; 8957 o For proprietary features, contact information (postal and email 8958 address); 8960 22.1. Feature-tags 8962 22.1.1. Description 8964 When a client and server try to determine what part and functionality 8965 of the RTSP specification and any future extensions that its counter 8966 part implements there is need for a namespace. This registry 8967 contains named entries representing certain functionality. 8969 The usage of feature-tags is explained in Section 11 and 8970 Section 13.1. 8972 22.1.2. Registering New Feature-tags with IANA 8974 The registering of feature-tags is done on a first come, first served 8975 basis. 8977 The name of the feature MUST follow these rules: The name may be of 8978 any length, but SHOULD be no more than twenty characters long. The 8979 name MUST NOT contain any spaces, or control characters. The 8980 registration MUST indicate if the feature-tag applies to clients, 8981 servers, or proxies only or any combinations of these. Any 8982 proprietary feature MUST have as the first part of the name a vendor 8983 tag, which identifies the organization. The registry entries 8984 consists of the tag, a one paragraph description of what it 8985 represents, its applicability (server, client, proxy, any 8986 combination) and a reference to its specification where applicable. 8988 22.1.3. Registered entries 8990 The following feature-tags are in this specification defined and 8991 hereby registered. The change control belongs to the IETF. 8993 play.basic: The minimal implementation for delivery and playback 8994 operations according to this specification. Applies for both 8995 clients, servers and proxies. 8997 play.scale: Support of scale operations for media playback. Applies 8998 only for servers. 9000 play.speed: Support of the speed functionality for media delivery. 9001 Applies only for servers. 9003 setup.rtp.rtcp.mux Support of the RTP and RTCP multiplexing as 9004 discussed in Appendix C.1.6.4. Applies for both client and 9005 servers and any media caching proxy. 9007 This should be represented by IANA as table with the feature tags, 9008 contact person and their references. 9010 22.2. RTSP Methods 9012 22.2.1. Description 9014 What a method is, is described in section Section 13. Extending the 9015 protocol with new methods allow for totally new functionality. 9017 22.2.2. Registering New Methods with IANA 9019 A new method MUST be registered through an IETF Standards Action. 9020 The reason is that new methods may radically change the protocol's 9021 behavior and purpose. 9023 A specification for a new RTSP method MUST consist of the following 9024 items: 9026 o A method name which follows the ABNF rules for methods. 9028 o A clear specification what a request using the method does and 9029 what responses are expected. Which directions the method is used, 9030 C->S or S->C or both. How the use of headers, if any, modifies 9031 the behavior and effect of the method. 9033 o A list or table specifying which of the registered headers that 9034 are allowed to use with the method in request or/and response. 9036 o Describe how the method relates to network proxies. 9038 22.2.3. Registered Entries 9040 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 9041 GET_PARAMETER, OPTIONS, PAUSE, PLAY, PLAY_NOTIFY REDIRECT, SETUP, 9042 SET_PARAMETER, and TEARDOWN. The initial table of the registry is 9043 below provided. 9045 Method Directionality Reference 9046 ----------------------------------------------------- 9047 DESCRIBE C->S [RFCXXXX] 9048 GET_PARAMETER C->S, S->C [RFCXXXX] 9049 OPTIONS C->S, S->C [RFCXXXX] 9050 PAUSE C->S [RFCXXXX] 9051 PLAY C->S [RFCXXXX] 9052 PLAY_NOTIFY S->C [RFCXXXX] 9053 REDIRECT S->C [RFCXXXX] 9054 SETUP C->S [RFCXXXX] 9055 SET_PARAMETER C->S, S->C [RFCXXXX] 9056 TEARDOWN C->S, S->C [RFCXXXX] 9058 22.3. RTSP Status Codes 9060 22.3.1. Description 9062 A status code is the three digit numbers used to convey information 9063 in RTSP response messages, seeSection 8. The number space is limited 9064 and care should be taken not to fill the space. 9066 22.3.2. Registering New Status Codes with IANA 9068 A new status code registrations follows the policy of IETF Review. A 9069 specification for a new status code MUST specify the following: 9071 o The requested number. 9073 o A description what the status code means and the expected behavior 9074 of the sender and receiver of the code. 9076 22.3.3. Registered Entries 9078 RFCXXXX, registers the numbered status code defined in the ABNF entry 9079 "Status-Code" except "extension-code" (that defines the syntax 9080 allowed for future extensions) in Section 20.2.2. 9082 22.4. RTSP Headers 9084 22.4.1. Description 9086 By specifying new headers a method(s) can be enhanced in many 9087 different ways. An unknown header will be ignored by the receiving 9088 agent. If the new header is vital for a certain functionality, a 9089 feature-tag for the functionality can be created and demanded to be 9090 used by the counter-part with the inclusion of a Require header 9091 carrying the feature-tag. 9093 22.4.2. Registering New Headers with IANA 9095 Registrations in the registry can be done following the Expert Review 9096 policy. A specification SHOULD be provided, preferable an IETF RFC 9097 or other Standards Developing Organization specification. The 9098 minimal information in a registration request is the header name and 9099 the contact information. 9101 The specification SHOULD contain the following information: 9103 o The name of the header. 9105 o An ABNF specification of the header syntax. 9107 o A list or table specifying when the header may be used, 9108 encompassing all methods, their request or response, the direction 9109 (C->S or S->C). 9111 o How the header is to be handled by proxies. 9113 o A description of the purpose of the header. 9115 22.4.3. Registered entries 9117 All headers specified in Section 16 in RFCXXXX are to be registered. 9118 The Registry is to include header name, description, and reference. 9120 Furthermore the following RTSP headers defined in other 9121 specifications are registered: 9123 o x-wap-profile defined in [3gpp-26234]. 9125 o x-wap-profile-diff defined in [3gpp-26234]. 9127 o x-wap-profile-warning defined in [3gpp-26234]. 9129 o x-predecbufsize defined in [3gpp-26234]. 9131 o x-initpredecbufperiod defined in [3gpp-26234]. 9133 o x-initpostdecbufperiod defined in [3gpp-26234]. 9135 o 3gpp-videopostdecbufsize defined in [3gpp-26234]. 9137 o 3GPP-Link-Char defined in [3gpp-26234]. 9139 o 3GPP-Adaptation defined in [3gpp-26234]. 9141 o 3GPP-QoE-Metrics defined in [3gpp-26234]. 9143 o 3GPP-QoE-Feedback defined in [3gpp-26234]. 9145 The use of "x-" is NOT RECOMMENDED but the above headers in the 9146 register list was defined prior to the clarification. 9148 22.5. Accept-Credentials 9150 The security framework's TLS connection mechanism has two registrable 9151 entities. 9153 22.5.1. Accept-Credentials policies 9155 In Section 19.3.1 three policies for how to handle certificates are 9156 specified. Further policies may be defined and MUST be registered 9157 with IANA using the following rules: 9159 o Registering requires an IETF Standards Action 9160 o A registration is required to name a contact person. 9162 o Name of the policy. 9164 o A describing text that explains how the policy works for handling 9165 the certificates. 9167 This specification registers the following values: 9169 Any 9171 Proxy 9173 User 9175 22.5.2. Accept-Credentials hash algorithms 9177 The Accept-Credentials header (See Section 16.2) allows for the usage 9178 of other algorithms for hashing the DER records of accepted entities. 9179 The registration of any future algorithm is expected to be extremely 9180 rare and could also cause interoperability problems. Therefore the 9181 bar for registering new algorithms is intentionally placed high. 9183 Any registration of a new hash algorithm MUST fulfill the following 9184 requirement: 9186 o Follow the IETF Standards Action policy. 9188 o A definition of the algorithm and its identifier meeting the 9189 "token" ABNF requirement. 9191 The registered value is: 9192 Hash Alg. Id Reference 9193 ------------------------ 9194 sha-256 [RFCXXXX] 9196 22.6. Cache-Control Cache Directive Extensions 9198 There exist a number of cache directives which can be sent in the 9199 Cache-Control header. A registry for these cache directives MUST be 9200 defined with the following rules: 9202 o Registering requires an IETF Standards Action or IESG Approval. 9204 o A registration is required to contain a contact person. 9206 o Name of the directive and a definition of the value, if any. 9208 o Specification if it is an request or response directive. 9210 o A describing text that explains how the cache directive is used 9211 for RTSP controlled media streams. 9213 This specification registers the following values: 9215 no-cache: 9217 public: 9219 private: 9221 no-transform: 9223 only-if-cached: 9225 max-stale: 9227 min-fresh: 9229 must-revalidate: 9231 proxy-revalidate: 9233 max-age: 9235 The registry should be represented as: Name of the directive, contact 9236 person and reference. 9238 22.7. Media Properties 9240 22.7.1. Description 9242 The media streams being controlled by RTSP can have many different 9243 properties. The media properties required to cover the use cases 9244 that was in mind when writing the specification are defined. 9245 However, it can be expected that further innovation will result in 9246 new use cases or media streams with properties not covered by the 9247 ones specified here. Thus new media properties can be specified. As 9248 new media properties may need a substantial amount of new definitions 9249 to correctly specify behavior for this property the bar is intended 9250 to be high. 9252 22.7.2. Registration Rules 9254 Registering new media property MUST fulfill the following 9255 requirements 9256 o Follow the Specification Required policy and get the approval of 9257 the designated Expert. 9259 o Have an ABNF definition of the media property value name that 9260 meets "media-prop-ext" definition 9262 o A Contact Person for the Registration 9264 o Description of all changes to the behavior of the RTSP protocol as 9265 result of these changes. 9267 22.7.3. Registered Values 9269 This specification registers the 9 values listed in Section 16.28. 9270 The registry should be represented as: Name of the media property, 9271 contact person and reference. 9273 22.8. Notify-Reason header 9275 22.8.1. Description 9277 Notify-Reason values are used for indicating the reason the 9278 notification was sent. Each reason has its associated rules on what 9279 headers and information that may or must be included in the 9280 notification. New notification behaviors need to be specified to 9281 enable interoperable usage, thus a specification of each new value is 9282 required. 9284 22.8.2. Registration Rules 9286 Registrations for new Notify-Reason value MUST fulfill the following 9287 requirements 9289 o Follow the Specification Required policy and get the approval of 9290 the designated Expert. 9292 o Have a ABNF definition of the Notify reason value name that meets 9293 "Notify-Reason-extension" definition 9295 o A Contact Person for the Registration 9297 o Description of which headers shall be included in the request and 9298 response, when it should be sent, and any effect it has on the 9299 server client state. 9301 22.8.3. Registered Values 9303 This specification registers 3 values defined in the Notify-Reas-val 9304 ABNFSection 20.2.3: 9306 o end-of-stream 9308 o media-properties-update 9310 o scale-change 9312 The registry entries should be represented in the registry as: Name, 9313 short description, contact and reference. 9315 22.9. Range header formats 9317 22.9.1. Description 9319 The Range header (Section 16.38) allows for different range formats. 9320 New ones may be registered, but moderation should be applied as it 9321 makes interoperability more difficult. 9323 22.9.2. Registration Rules 9325 A registration MUST fulfill the following requirements: 9327 o Follow the Specification Required policy. 9329 o An ABNF definition of the range format that fulfills the "range- 9330 ext" definition. 9332 o A Contact person for the registration. 9334 o Rules for how one handles the range when using a negative Scale. 9336 22.9.3. Registered Values 9338 The registry should be represented as: Name of the range format, 9339 contact person and reference. This specification registers the 9340 following values. 9342 npt: Normal Play Time 9344 clock: UTC Clock format 9345 smpte: SMPTE Timestamps 9347 22.10. Terminate-Reason Header 9349 The Terminate-Reason header (Section 16.50) has two registries for 9350 extensions. 9352 22.10.1. Redirect Reasons 9354 Registrations are done under the policy of Expert Review. The 9355 registered value needs to follow syntax, i.e. be a token. The 9356 specification needs to provide definition of what the procedures that 9357 is to be followed when a client receives this redirect reason. This 9358 specification registers two values: 9360 o Session-Timeout 9362 o Server-Admin 9364 The registry should be represented as: Name of the Redirect Reason, 9365 contact person and reference. 9367 22.10.2. Terminate-Reason Header Parameters 9369 Registrations are done under the policy of Specification Required. 9370 The registrations must define a syntax for the parameter that also 9371 follows the allowed by the RTSP 2.0 specification. A contact person 9372 is also required. This specification registers: 9374 o time 9376 o user-msg 9378 The registry should be represented as: Name of the Terminate Reason, 9379 contact person and reference. 9381 22.11. RTP-Info header parameters 9383 22.11.1. Description 9385 The RTP-Info header (Section 16.43) carries one or more parameter 9386 value pairs with information about a particular point in the RTP 9387 stream. RTP extensions or new usages may need new types of 9388 information. As RTP information that could be needed is likely to be 9389 generic enough and to maximize the interoperability registration 9390 requires specification required. 9392 22.11.2. Registration Rules 9394 Registrations for new Notify-Reason value MUST fulfill the following 9395 requirements 9397 o Follow the Specification Required policy and get the approval of 9398 the designated Expert. 9400 o Have a ABNF definition that meets the "generic-param" definition 9402 o A Contact Person for the Registration 9404 22.11.3. Registered Values 9406 This specification registers 2 parameter value pairs: 9408 o seq 9410 o rtptime 9412 The registry should be represented as: Name of the parameter, contact 9413 person and reference. 9415 22.12. Seek-Style Policies 9417 22.12.1. Description 9419 New seek policies may be registered, however, a large number of these 9420 will complicate implementation substantially. The impact of unknown 9421 policies is that the server will not honor the unknown and use the 9422 server default policy instead. 9424 22.12.2. Registration Rules 9426 Registrations of new Seek-Style polices MUST fulfill the following 9427 requirements 9429 o Follow the Specification Required policy. 9431 o Have a ABNF definition of the Seek-Style policy name that meets 9432 "Seek-S-value-ext" definition 9434 o A Contact Person for the Registration 9436 o Description of which headers shall be included in the request and 9437 response, when it should be sent, and any affect it has on the 9438 server client state. 9440 22.12.3. Registered Values 9442 This specification registers 4 values: 9444 o RAP 9446 o CoRAP 9448 o First-Prior 9450 o Next 9452 The registry should be represented as: Name of the Seek-Style Policy, 9453 short description, contact person and reference. 9455 22.13. Transport Header Registries 9457 The transport header contains a number of parameters which have 9458 possibilities for future extensions. Therefore registries for these 9459 needs to be defined. 9461 22.13.1. Transport Protocol Specification 9463 A registry for the parameter transport-protocol specification MUST be 9464 defined with the following rules: 9466 o Registering uses the policy of Specification Required. 9468 o A contact person or organization with address and email. 9470 o A value definition that are following the ABNF syntax definition 9471 of "transport-id" Section 20.2.3. 9473 o A describing text that explains how the registered value are used 9474 in RTSP. 9476 The registry should be represented as: The protocol ID string, 9477 contact person and reference. 9479 This specification registers the following values: 9481 RTP/AVP: Use of the RTP[RFC3550] protocol for media transport in 9482 combination with the "RTP profile for audio and video 9483 conferences with minimal control"[RFC3551] over UDP. The usage 9484 is explained in RFC XXXX, Appendix C.1. 9486 RTP/AVP/UDP: the same as RTP/AVP. 9488 RTP/AVPF: Use of the RTP[RFC3550] protocol for media transport in 9489 combination with the "Extended RTP Profile for RTCP-based 9490 Feedback (RTP/AVPF)" [RFC4585] over UDP. The usage is 9491 explained in RFC XXXX, Appendix C.1. 9493 RTP/AVPF/UDP: the same as RTP/AVPF. 9495 RTP/SAVP: Use of the RTP[RFC3550] protocol for media transport in 9496 combination with the "The Secure Real-time Transport Protocol 9497 (SRTP)" [RFC3711] over UDP. The usage is explained in RFC 9498 XXXX, Appendix C.1. 9500 RTP/SAVP/UDP: the same as RTP/SAVP. 9502 RTP/SAVPF: Use of the RTP[RFC3550] protocol for media transport in 9503 combination with the "[RFC5124] over UDP. The usage is 9504 explained in RFC XXXX, Appendix C.1. 9506 RTP/SAVPF/UDP: the same as RTP/SAVPF. 9508 RTP/AVP/TCP: Use of the RTP[RFC3550] protocol for media transport in 9509 combination with the "RTP profile for audio and video 9510 conferences with minimal control"[RFC3551] over TCP. The usage 9511 is explained in RFC XXXX, Appendix C.2.2. 9513 RTP/AVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9514 in combination with the "Extended RTP Profile for RTCP-based 9515 Feedback (RTP/AVPF)"[RFC4585] over TCP. The usage is explained 9516 in RFC XXXX, Appendix C.2.2. 9518 RTP/SAVP/TCP: Use of the RTP[RFC3550] protocol for media transport 9519 in combination with the "The Secure Real-time Transport 9520 Protocol (SRTP)" [RFC3711] over TCP. The usage is explained in 9521 RFC XXXX, Appendix C.2.2. 9523 RTP/SAVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9524 in combination with the "Extended Secure RTP Profile for Real- 9525 time Transport Control Protocol (RTCP)-Based Feedback (RTP/ 9526 SAVPF)" [RFC5124] over TCP. The usage is explained in RFC 9527 XXXX, Appendix C.2.2. 9529 22.13.2. Transport modes 9531 A registry for the transport parameter mode MUST be defined with the 9532 following rules: 9534 o Registering requires an IETF Standards Action. 9536 o A contact person or organization with address and email. 9538 o A value definition that are following the ABNF "token" definition 9539 Section 20.2.3. 9541 o A describing text that explains how the registered value are used 9542 in RTSP. 9544 This specification registers 1 value: 9546 PLAY: See RFC XXXX. 9548 22.13.3. Transport Parameters 9550 A registry for parameters that may be included in the Transport 9551 header MUST be defined with the following rules: 9553 o Registering uses the Specification Required policy. 9555 o A value definition that are following the ABNF "token" definition 9556 Section 20.2.3. 9558 o A describing text that explains how the registered value are used 9559 in RTSP. 9561 This specification registers all the transport parameters defined in 9562 Section 16.52. 9564 22.14. URI Schemes 9566 This specification defines two URI schemes ("rtsp" and "rtsps") and 9567 reserves a third one ("rtspu"). Registrations are following RFC 9568 4395[RFC4395]. 9570 22.14.1. The rtsp URI Scheme 9572 URI scheme name: rtsp 9574 Status: Permanent 9576 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9578 URI scheme semantics: The rtsp scheme is used to indicate resources 9579 accessible through the usage of the Real-time Streaming 9580 Protocol (RTSP). RTSP allows different operations on the 9581 resource identified by the URI, but the primary purpose is the 9582 streaming delivery of the resource to a client. However, the 9583 operations that are currently defined are: Describing the 9584 resource for the purpose of configuring the receiving agent 9585 (DESCRIBE), configuring the delivery method and its addressing 9586 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9587 setting of resource related parameters (SET_PARAMETER and 9588 GET_PARAMETER, and termination of the session context created 9589 (TEARDOWN). 9591 Encoding considerations: IRIs in this scheme are defined and needs 9592 to be encoded as RTSP URIs when used within the RTSP protocol. 9593 That encoding is done according to RFC 3987. 9595 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9596 2326), RTSP 2.0 (RFC XXXX) 9598 Interoperability considerations: The change in URI syntax performed 9599 between RTSP 1.0 and 2.0 can create interoperability issues. 9601 Security considerations: All the security threats identified in 9602 Section 7 of RFC 3986 applies also to this scheme. They need 9603 to be reviewed and considered in any implementation utilizing 9604 this scheme. 9606 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9608 Author/Change controller: IETF 9610 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9612 22.14.2. The rtsps URI Scheme 9614 URI scheme name: rtsps 9616 Status: Permanent 9618 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9620 URI scheme semantics: The rtsps scheme is used to indicate resources 9621 accessible through the usage of the Real-time Streaming 9622 Protocol (RTSP) over TLS. RTSP allows different operations on 9623 the resource identified by the URI, but the primary purpose is 9624 the streaming delivery of the resource to a client. However, 9625 the operations that are currently defined are: Describing the 9626 resource for the purpose of configuring the receiving agent 9627 (DESCRIBE), configuring the delivery method and its addressing 9628 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9629 setting of resource related parameters (SET_PARAMETER and 9630 GET_PARAMETER, and termination of the session context created 9631 (TEARDOWN). 9633 Encoding considerations: IRIs in this scheme are defined and needs 9634 to be encoded as RTSP URIs when used within the RTSP protocol. 9635 That encoding is done according to RFC 3987. 9637 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9638 2326), RTSP 2.0 (RFC XXXX) 9640 Interoperability considerations: The change in URI syntax performed 9641 between RTSP 1.0 and 2.0 can create interoperability issues. 9643 Security considerations: All the security threats identified in 9644 Section 7 of RFC 3986 applies also to this scheme. They need 9645 to be reviewed and considered in any implementation utilizing 9646 this scheme. 9648 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9650 Author/Change controller: IETF 9652 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9654 22.14.3. The rtspu URI Scheme 9656 URI scheme name: rtspu 9658 Status: Permanent 9660 URI scheme syntax: See Section 3.2 of RFC 2326. 9662 URI scheme semantics: The rtspu scheme is used to indicate resources 9663 accessible through the usage of the Real-time Streaming 9664 Protocol (RTSP) over unreliable datagram transport. RTSP 9665 allows different operations on the resource identified by the 9666 URI, but the primary purpose is the streaming delivery of the 9667 resource to a client. However, the operations that are 9668 currently defined are: Describing the resource for the purpose 9669 of configuring the receiving agent (DESCRIBE), configuring the 9670 delivery method and its addressing (SETUP), controlling the 9671 delivery (PLAY and PAUSE), reading or setting of resource 9672 related parameters (SET_PARAMETER and GET_PARAMETER, and 9673 termination of the session context created (TEARDOWN). 9675 Encoding considerations: IRIs in this scheme are not defined. 9677 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9678 2326) 9680 Interoperability considerations: The definition of the transport 9681 mechanism of RTSP over UDP has interoperability issues. That 9682 makes the usage of this scheme problematic. 9684 Security considerations: All the security threats identified in 9685 Section 7 of RFC 3986 applies also to this scheme. They needs 9686 to be reviewed and considered in any implementation utilizing 9687 this scheme. 9689 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9691 Author/Change controller: IETF 9693 References: RFC 2326 9695 22.15. SDP attributes 9697 This specification defines three SDP [RFC4566] attributes that it is 9698 requested that IANA register. 9700 SDP Attribute ("att-field"): 9702 Attribute name: range 9703 Long form: Media Range Attribute 9704 Type of name: att-field 9705 Type of attribute: Media and session level 9706 Subject to charset: No 9707 Purpose: RFC XXXX 9708 Reference: RFC XXXX, RFC 2326 9709 Values: See ABNF definition. 9711 Attribute name: control 9712 Long form: RTSP control URI 9713 Type of name: att-field 9714 Type of attribute: Media and session level 9715 Subject to charset: No 9716 Purpose: RFC XXXX 9717 Reference: RFC XXXX, RFC 2326 9718 Values: Absolute or Relative URIs. 9720 Attribute name: mtag 9721 Long form: Message Tag 9722 Type of name: att-field 9723 Type of attribute: Media and session level 9724 Subject to charset: No 9725 Purpose: RFC XXXX 9726 Reference: RFC XXXX 9727 Values: See ABNF definition 9729 22.16. Media Type Registration for text/parameters 9731 Type name: text 9733 Subtype name: parameters 9735 Required parameters: 9737 Optional parameters: 9739 Encoding considerations: 9741 Security considerations: This format may carry any type of 9742 parameters. Some can clear have security requirements, like 9743 privacy, confidentiality or integrity requirements. The format 9744 has no built in security protection. For the usage it was defined 9745 the transport can be protected between server and client using 9746 TLS. However, care must be take to consider if also the proxies 9747 are trusted with the parameters in case hop-by-hop security is 9748 used. If stored as file in file system the necessary precautions 9749 needs to be taken in relation to the parameters requirements 9750 including object security such as S/MIME [RFC5751]. 9752 Interoperability considerations: This media type was mentioned as a 9753 fictional example in RFC 2326 but was not formally specified. 9754 This have resulted in usage of this media type which may not match 9755 its formal definition. 9757 Published specification: RFC XXXX, Appendix F. 9759 Applications that use this media type: Applications that use RTSP 9760 and have additional parameters they like to read and set using the 9761 RTSP GET_PARAMETER and SET_PARAMETER methods. 9763 Additional information: 9765 Magic number(s): 9767 File extension(s): 9769 Macintosh file type code(s): 9771 Person & email address to contact for further information: Magnus 9772 Westerlund (magnus.westerlund@ericsson.com) 9774 Intended usage: Common 9776 Restrictions on usage: None 9778 Author: Magnus Westerlund (magnus.westerlund@ericsson.com) 9780 Change controller: IETF 9782 Addition Notes: 9784 23. References 9786 23.1. Normative References 9788 [3gpp-26234] 9789 Third Generation Partnership Project (3GPP), "Transparent 9790 end-to-end Packet-switched Streaming Service (PSS); 9791 Protocols and codecs; Technical Specification 26.234", 9792 December 2002. 9794 [FIPS-pub-180-2] 9795 National Institute of Standards and Technology (NIST), 9796 "Federal Information Processing Standards Publications 9797 (FIPS PUBS) 180-2: Secure Hash Standard", August 2002. 9799 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 9800 August 1980. 9802 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 9803 RFC 793, September 1981. 9805 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 9806 Requirement Levels", BCP 14, RFC 2119, March 1997. 9808 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 9809 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 9810 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 9812 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 9813 Leach, P., Luotonen, A., and L. Stewart, "HTTP 9814 Authentication: Basic and Digest Access Authentication", 9815 RFC 2617, June 1999. 9817 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 9819 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 9820 Jacobson, "RTP: A Transport Protocol for Real-Time 9821 Applications", STD 64, RFC 3550, July 2003. 9823 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 9824 Video Conferences with Minimal Control", STD 65, RFC 3551, 9825 July 2003. 9827 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 9828 10646", STD 63, RFC 3629, November 2003. 9830 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 9831 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 9832 RFC 3711, March 2004. 9834 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 9835 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 9836 August 2004. 9838 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 9839 Resource Identifier (URI): Generic Syntax", STD 66, 9840 RFC 3986, January 2005. 9842 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 9843 Identifiers (IRIs)", RFC 3987, January 2005. 9845 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 9846 Requirements for Security", BCP 106, RFC 4086, June 2005. 9848 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 9849 Registration Procedures", BCP 13, RFC 4288, December 2005. 9851 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 9852 Architecture", RFC 4291, February 2006. 9854 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 9855 Registration Procedures for New URI Schemes", BCP 35, 9856 RFC 4395, February 2006. 9858 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 9859 Description Protocol", RFC 4566, July 2006. 9861 [RFC4567] Arkko, J., Lindholm, F., Naslund, M., Norrman, K., and E. 9862 Carrara, "Key Management Extensions for Session 9863 Description Protocol (SDP) and Real Time Streaming 9864 Protocol (RTSP)", RFC 4567, July 2006. 9866 [RFC4571] Lazzaro, J., "Framing Real-time Transport Protocol (RTP) 9867 and RTP Control Protocol (RTCP) Packets over Connection- 9868 Oriented Transport", RFC 4571, July 2006. 9870 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 9871 "Extended RTP Profile for Real-time Transport Control 9872 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 9873 July 2006. 9875 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 9876 Encodings", RFC 4648, October 2006. 9878 [RFC4738] Ignjatic, D., Dondeti, L., Audet, F., and P. Lin, "MIKEY- 9879 RSA-R: An Additional Mode of Key Distribution in 9880 Multimedia Internet KEYing (MIKEY)", RFC 4738, 9881 November 2006. 9883 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 9884 Real-time Transport Control Protocol (RTCP)-Based Feedback 9885 (RTP/SAVPF)", RFC 5124, February 2008. 9887 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 9888 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 9889 May 2008. 9891 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 9892 Specifications: ABNF", STD 68, RFC 5234, January 2008. 9894 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 9895 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 9897 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 9898 Housley, R., and W. Polk, "Internet X.509 Public Key 9899 Infrastructure Certificate and Certificate Revocation List 9900 (CRL) Profile", RFC 5280, May 2008. 9902 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 9903 Languages", BCP 47, RFC 5646, September 2009. 9905 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 9906 Mail Extensions (S/MIME) Version 3.2 Message 9907 Specification", RFC 5751, January 2010. 9909 [RFC5761] Perkins, C. and M. Westerlund, "Multiplexing RTP Data and 9910 Control Packets on a Single Port", RFC 5761, April 2010. 9912 23.2. Informative References 9914 [I-D.ietf-mmusic-rtsp-nat] 9915 Goldberg, J., Westerlund, M., and T. Zeng, "A Network 9916 Address Translator (NAT) Traversal mechanism for media 9917 controlled by Real-Time Streaming Protocol (RTSP)", 9918 draft-ietf-mmusic-rtsp-nat-09 (work in progress), 9919 January 2010. 9921 [ISO.13818-6.1995] 9922 International Organization for Standardization, 9923 "Information technology - Generic coding of moving 9924 pictures and associated audio information - part 6: 9925 Extension for digital storage media and control", 9926 ISO Draft Standard 13818-6, November 1995. 9928 [ISO.8601.2000] 9929 International Organization for Standardization, "Data 9930 elements and interchange formats - Information interchange 9931 - Representation of dates and times", ISO/IEC Standard 9932 8601, December 2000. 9934 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 9935 and Support", STD 3, RFC 1123, October 1989. 9937 [RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions 9938 Functional Specification", RFC 1644, July 1994. 9940 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 9941 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 9942 RFC 2068, January 1997. 9944 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 9945 Streaming Protocol (RTSP)", RFC 2326, April 1998. 9947 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 9948 Translator (NAT) Terminology and Considerations", 9949 RFC 2663, August 1999. 9951 [RFC2822] Resnick, P., "Internet Message Format", RFC 2822, 9952 April 2001. 9954 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 9955 Announcement Protocol", RFC 2974, October 2000. 9957 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 9958 A., Peterson, J., Sparks, R., Handley, M., and E. 9959 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 9960 June 2002. 9962 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 9963 the Session Description Protocol (SDP)", RFC 4145, 9964 September 2005. 9966 [RFC5583] Schierl, T. and S. Wenger, "Signaling Media Decoding 9967 Dependency in the Session Description Protocol (SDP)", 9968 RFC 5583, July 2009. 9970 [RFC5888] Camarillo, G. and H. Schulzrinne, "The Session Description 9971 Protocol (SDP) Grouping Framework", RFC 5888, June 2010. 9973 [RFC5905] Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network 9974 Time Protocol Version 4: Protocol and Algorithms 9975 Specification", RFC 5905, June 2010. 9977 [Stevens98] 9978 Stevens, W., "Unix Networking Programming - Volume 1, 9979 second edition", 1998. 9981 Appendix A. Examples 9983 This section contains several different examples trying to illustrate 9984 possible ways of using RTSP. The examples can also help with the 9985 understanding of how functions of RTSP work. However, remember that 9986 these are examples and the normative and syntax description in the 9987 other sections takes precedence. Please also note that many of the 9988 example contain syntax illegal line breaks to accommodate the 9989 formatting restriction that the RFC series impose. 9991 A.1. Media on Demand (Unicast) 9993 This is an example of media on demand streaming of a media stored in 9994 a container file. For purposes of this example, a container file is 9995 a storage entity in which multiple continuous media types pertaining 9996 to the same end-user presentation are present. In effect, the 9997 container file represents an RTSP presentation, with each of its 9998 components being RTSP controlled media streams. Container files are 9999 a widely used means to store such presentations. While the 10000 components are transported as independent streams, it is desirable to 10001 maintain a common context for those streams at the server end. 10003 This enables the server to keep a single storage handle open 10004 easily. It also allows treating all the streams equally in case 10005 of any priorization of streams by the server. 10007 It is also possible that the presentation author may wish to prevent 10008 selective retrieval of the streams by the client in order to preserve 10009 the artistic effect of the combined media presentation. Similarly, 10010 in such a tightly bound presentation, it is desirable to be able to 10011 control all the streams via a single control message using an 10012 aggregate URI. 10014 The following is an example of using a single RTSP session to control 10015 multiple streams. It also illustrates the use of aggregate URIs. In 10016 a container file it is also desirable to not write any URI parts 10017 which is not kept, when the container is distributed, like the host 10018 and most of the path element. Therefore this example also uses the 10019 "*" and relative URI in the delivered SDP. 10021 Also this presentation description (SDP) is not cachable, as the 10022 Expires header is set to an equal value with date indicating 10023 immediate expiration of its valididty. 10025 Client C requests a presentation from media server M. The movie is 10026 stored in a container file. The client has obtained an RTSP URI to 10027 the container file. 10029 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10030 CSeq: 1 10031 User-Agent: PhonyClient/1.2 10033 M->C: RTSP/2.0 200 OK 10034 CSeq: 1 10035 Server: PhonyServer/1.0 10036 Date: Thu, 23 Jan 1997 15:35:06 GMT 10037 Content-Type: application/sdp 10038 Content-Length: 271 10039 Content-Base: rtsp://example.com/twister.3gp/ 10040 Expires: 24 Jan 1997 15:35:06 GMT 10042 v=0 10043 o=- 2890844256 2890842807 IN IP4 198.51.100.5 10044 s=RTSP Session 10045 i=An Example of RTSP Session Usage 10046 e=adm@example.com 10047 c=IN IP4 0.0.0.0 10048 a=control: * 10049 a=range: npt=0-0:10:34.10 10050 t=0 0 10051 m=audio 0 RTP/AVP 0 10052 a=control: trackID=1 10053 m=video 0 RTP/AVP 26 10054 a=control: trackID=4 10056 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10057 CSeq: 2 10058 User-Agent: PhonyClient/1.2 10059 Require: play.basic 10060 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10061 Accept-Ranges: NPT, SMPTE, UTC 10063 M->C: RTSP/2.0 200 OK 10064 CSeq: 2 10065 Server: PhonyServer/1.0 10066 Transport: RTP/AVP;unicast; ssrc=93CB001E; 10067 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10068 src_addr="198.51.100.5:9000"/"198.51.100.5:9001" 10069 Session: 12345678 10070 Expires: 24 Jan 1997 15:35:12 GMT 10071 Date: 23 Jan 1997 15:35:12 GMT 10072 Accept-Ranges: NPT 10073 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10075 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10076 CSeq: 3 10077 User-Agent: PhonyClient/1.2 10078 Require: play.basic 10079 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10080 Session: 12345678 10081 Accept-Ranges: NPT, SMPTE, UTC 10083 M->C: RTSP/2.0 200 OK 10084 CSeq: 3 10085 Server: PhonyServer/1.0 10086 Transport: RTP/AVP;unicast; ssrc=A813FC13; 10087 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003"; 10088 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10090 Session: 12345678 10091 Expires: 24 Jan 1997 15:35:13 GMT 10092 Date: 23 Jan 1997 15:35:13 GMT 10093 Accept-Range: NPT 10094 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10096 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10097 CSeq: 4 10098 User-Agent: PhonyClient/1.2 10099 Range: npt=30- 10100 Seek-Style: RAP 10101 Session: 12345678 10103 M->C: RTSP/2.0 200 OK 10104 CSeq: 4 10105 Server: PhonyServer/1.0 10106 Date: 23 Jan 1997 15:35:14 GMT 10107 Session: 12345678 10108 Range: npt=30-623.10 10109 Seek-Style: RAP 10110 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10111 ssrc=0D12F123:seq=12345;rtptime=3450012, 10112 url="rtsp://example.com/twister.3gp/trackID=1" 10113 ssrc=4F312DD8:seq=54321;rtptime=2876889 10115 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/2.0 10116 CSeq: 5 10117 User-Agent: PhonyClient/1.2 10118 Session: 12345678 10120 M->C: RTSP/2.0 200 OK 10121 CSeq: 5 10122 Server: PhonyServer/1.0 10123 Date: 23 Jan 1997 15:36:01 GMT 10124 Session: 12345678 10125 Range: npt=34.57-623.10 10127 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10128 CSeq: 6 10129 User-Agent: PhonyClient/1.2 10130 Range: npt=34.57-623.10 10131 Seek-Style: Next 10132 Session: 12345678 10134 M->C: RTSP/2.0 200 OK 10135 CSeq: 6 10136 Server: PhonyServer/1.0 10137 Date: 23 Jan 1997 15:36:01 GMT 10138 Session: 12345678 10139 Range: npt=34.57-623.10 10140 Seek-Style: Next 10141 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10142 ssrc=0D12F123:seq=12555;rtptime=6330012, 10143 url="rtsp://example.com/twister.3gp/trackID=1" 10144 ssrc=4F312DD8:seq=55021;rtptime=3132889 10146 C->M: TEARDOWN rtsp://example.com/twister.3gp/ RTSP/2.0 10147 CSeq: 7 10148 User-Agent: PhonyClient/1.2 10149 Session: 12345678 10151 M->C: RTSP/2.0 200 OK 10152 CSeq: 7 10153 Server: PhonyServer/1.0 10154 Date: 23 Jan 1997 15:49:34 GMT 10156 A.2. Media on Demand using Pipelining 10158 This example is basically the example above (Appendix A.1), but now 10159 utilizing pipelining to speed up the setup. It requires only two 10160 round trip times until the media starts flowing. First of all, the 10161 session description is retrieved to determine what media resources 10162 need to be setup. In the second step, one sends the necessary SETUP 10163 requests and the PLAY request to initiate media delivery. 10165 Client C requests a presentation from media server M. The movie is 10166 stored in a container file. The client has obtained an RTSP URI to 10167 the container file. 10169 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10170 CSeq: 1 10171 User-Agent: PhonyClient/1.2 10173 M->C: RTSP/2.0 200 OK 10174 CSeq: 1 10175 Server: PhonyServer/1.0 10176 Date: Thu, 23 Jan 1997 15:35:06 GMT 10177 Content-Type: application/sdp 10178 Content-Length: 271 10179 Content-Base: rtsp://example.com/twister.3gp/ 10180 Expires: 24 Jan 1997 15:35:06 GMT 10182 v=0 10183 o=- 2890844256 2890842807 IN IP4 192.0.2.5 10184 s=RTSP Session 10185 i=An Example of RTSP Session Usage 10186 e=adm@example.com 10187 c=IN IP4 0.0.0.0 10188 a=control: * 10189 a=range: npt=0-0:10:34.10 10190 t=0 0 10191 m=audio 0 RTP/AVP 0 10192 a=control: trackID=1 10193 m=video 0 RTP/AVP 26 10194 a=control: trackID=4 10196 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10197 CSeq: 2 10198 User-Agent: PhonyClient/1.2 10199 Require: play.basic 10200 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10201 Accept-Ranges: NPT, SMPTE, UTC 10202 Pipelined-Requests: 7654 10204 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10205 CSeq: 3 10206 User-Agent: PhonyClient/1.2 10207 Require: play.basic 10208 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10209 Accept-Ranges: NPT, SMPTE, UTC 10210 Pipelined-Requests: 7654 10212 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10213 CSeq: 4 10214 User-Agent: PhonyClient/1.2 10215 Range: npt=0- 10216 Seek-Style: RAP 10217 Session: 12345678 10218 Pipelined-Requests: 7654 10220 M->C: RTSP/2.0 200 OK 10221 CSeq: 2 10222 Server: PhonyServer/1.0 10223 Transport: RTP/AVP;unicast; 10224 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10225 src_addr="198.51.100.5:9000"/"198.51.100.5:9001"; 10226 ssrc=93CB001E 10227 Session: 12345678 10228 Expires: 24 Jan 1997 15:35:12 GMT 10229 Date: 23 Jan 1997 15:35:12 GMT 10230 Accept-Ranges: NPT 10231 Pipelined-Requests: 7654 10232 Media-Properties: Random-Access=0.2, Immutable, Unlimited 10234 M->C: RTSP/2.0 200 OK 10235 CSeq: 3 10236 Server: PhonyServer/1.0 10237 Transport: RTP/AVP;unicast; 10238 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003; 10239 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10240 ssrc=A813FC13 10241 Session: 12345678 10242 Expires: 24 Jan 1997 15:35:13 GMT 10243 Date: 23 Jan 1997 15:35:13 GMT 10244 Accept-Range: NPT 10245 Pipelined-Requests: 7654 10246 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10248 M->C: RTSP/2.0 200 OK 10249 CSeq: 4 10250 Server: PhonyServer/1.0 10251 Date: 23 Jan 1997 15:35:14 GMT 10252 Session: 12345678 10253 Range: npt=0-623.10 10254 Seek-Style: RAP 10255 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10256 ssrc=0D12F123:seq=12345;rtptime=3450012, 10257 url="rtsp://example.com/twister.3gp/trackID=1" 10258 ssrc=4F312DD8:seq=54321;rtptime=2876889 10259 Pipelined-Requests: 7654 10261 A.3. Media on Demand (Unicast) 10263 An alternative example of media on demand with a bit more tweaks is 10264 the following. Client C requests a movie distributed from two 10265 different media servers A (audio.example.com) and V ( 10266 video.example.com). The media description is stored on a web server 10267 W. The media description contains descriptions of the presentation 10268 and all its streams, including the codecs that are available, dynamic 10269 RTP payload types, the protocol stack, and content information such 10270 as language or copyright restrictions. It may also give an 10271 indication about the timeline of the movie. 10273 In this example, the client is only interested in the last part of 10274 the movie. 10276 C->W: GET /twister.sdp HTTP/1.1 10277 Host: www.example.com 10278 Accept: application/sdp 10280 W->C: HTTP/1.0 200 OK 10281 Date: Thu, 23 Jan 1997 15:35:06 GMT 10282 Content-Type: application/sdp 10283 Content-Length: 278 10284 Expires: 23 Jan 1998 15:35:06 GMT 10286 v=0 10287 o=- 2890844526 2890842807 IN IP4 198.51.100.5 10288 s=RTSP Session 10289 e=adm@example.com 10290 c=IN IP4 0.0.0.0 10291 a=range:npt=0-1:49:34 10292 t=0 0 10293 m=audio 0 RTP/AVP 0 10294 a=control:rtsp://audio.example.com/twister/audio.en 10295 m=video 0 RTP/AVP 31 10296 a=control:rtsp://video.example.com/twister/video 10298 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/2.0 10299 CSeq: 1 10300 User-Agent: PhonyClient/1.2 10301 Transport: RTP/AVP/UDP;unicast;dest_addr=":3056"/":3057", 10302 RTP/AVP/TCP;unicast;interleaved=0-1 10303 Accept-Ranges: NPT, SMPTE, UTC 10305 A->C: RTSP/2.0 200 OK 10306 CSeq: 1 10307 Session: 12345678 10308 Transport: RTP/AVP/UDP;unicast; 10309 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10310 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10311 Date: 23 Jan 1997 15:35:12 GMT 10312 Server: PhonyServer/1.0 10313 Expires: 24 Jan 1997 15:35:12 GMT 10314 Cache-Control: public 10315 Accept-Ranges: NPT, SMPTE 10316 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10318 C->V: SETUP rtsp://video.example.com/twister/video RTSP/2.0 10319 CSeq: 1 10320 User-Agent: PhonyClient/1.2 10321 Transport: RTP/AVP/UDP;unicast; 10322 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059", 10323 RTP/AVP/TCP;unicast;interleaved=0-1 10324 Accept-Ranges: NPT, SMPTE, UTC 10326 V->C: RTSP/2.0 200 OK 10327 CSeq: 1 10328 Session: 23456789 10329 Transport: RTP/AVP/UDP;unicast; 10330 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059"; 10331 src_addr="198.51.100.5:5002"/"198.51.100.5:5003" 10332 Date: 23 Jan 1997 15:35:12 GMT 10333 Server: PhonyServer/1.0 10334 Cache-Control: public 10335 Expires: 24 Jan 1997 15:35:12 GMT 10336 Accept-Ranges: NPT, SMPTE 10337 Media-Properties: Random-Access=1.2, Immutable, Unlimited 10339 C->V: PLAY rtsp://video.example.com/twister/video RTSP/2.0 10340 CSeq: 2 10341 User-Agent: PhonyClient/1.2 10342 Session: 23456789 10343 Range: smpte=0:10:00- 10345 V->C: RTSP/2.0 200 OK 10346 CSeq: 2 10347 Session: 23456789 10348 Range: smpte=0:10:00-1:49:23 10349 Seek-Style: First-Prior 10350 RTP-Info: url="rtsp://video.example.com/twister/video" 10351 ssrc=A17E189D:seq=12312232;rtptime=78712811 10352 Server: PhonyServer/2.0 10353 Date: 23 Jan 1997 15:35:13 GMT 10355 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/2.0 10356 CSeq: 2 10357 User-Agent: PhonyClient/1.2 10358 Session: 12345678 10359 Range: smpte=0:10:00- 10361 A->C: RTSP/2.0 200 OK 10362 CSeq: 2 10363 Session: 12345678 10364 Range: smpte=0:10:00-1:49:23 10365 Seek-Style: First-Prior 10366 RTP-Info: url="rtsp://audio.example.com/twister/audio.en" 10367 ssrc=3D124F01:seq=876655;rtptime=1032181 10368 Server: PhonyServer/1.0 10369 Date: 23 Jan 1997 15:35:13 GMT 10371 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/2.0 10372 CSeq: 3 10373 User-Agent: PhonyClient/1.2 10374 Session: 12345678 10376 A->C: RTSP/2.0 200 OK 10377 CSeq: 3 10378 Server: PhonyServer/1.0 10379 Date: 23 Jan 1997 15:36:52 GMT 10381 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/2.0 10382 CSeq: 3 10383 User-Agent: PhonyClient/1.2 10384 Session: 23456789 10386 V->C: RTSP/2.0 200 OK 10387 CSeq: 3 10388 Server: PhonyServer/2.0 10389 Date: 23 Jan 1997 15:36:52 GMT 10391 Even though the audio and video track are on two different servers 10392 that may start at slightly different times and may drift with respect 10393 to each other over time, the client can perform initial 10394 synchronization of the two media using RTP-Info and Range received in 10395 the PLAY responses. If the two servers are time synchronized the 10396 RTCP packets can also be used to maintain synchronization. 10398 A.4. Single Stream Container Files 10400 Some RTSP servers may treat all files as though they are "container 10401 files", yet other servers may not support such a concept. Because of 10402 this, clients needs to use the rules set forth in the session 10403 description for Request-URIs, rather than assuming that a consistent 10404 URI may always be used throughout. Below are an example of how a 10405 multi-stream server might expect a single-stream file to be served: 10407 C->S: DESCRIBE rtsp://foo.example.com/test.wav RTSP/2.0 10408 Accept: application/x-rtsp-mh, application/sdp 10409 CSeq: 1 10410 User-Agent: PhonyClient/1.2 10412 S->C: RTSP/2.0 200 OK 10413 CSeq: 1 10414 Content-base: rtsp://foo.example.com/test.wav/ 10415 Content-type: application/sdp 10416 Content-length: 163 10417 Server: PhonyServer/1.0 10418 Date: Thu, 23 Jan 1997 15:35:06 GMT 10419 Expires: 23 Jan 1997 17:00:00 GMT 10421 v=0 10422 o=- 872653257 872653257 IN IP4 192.0.2.5 10423 s=mu-law wave file 10424 i=audio test 10425 c=IN IP4 0.0.0.0 10426 t=0 0 10427 a=control: * 10428 m=audio 0 RTP/AVP 0 10429 a=control:streamid=0 10431 C->S: SETUP rtsp://foo.example.com/test.wav/streamid=0 RTSP/2.0 10432 Transport: RTP/AVP/UDP;unicast; 10433 dest_addr=":6970"/":6971";mode="PLAY" 10434 CSeq: 2 10435 User-Agent: PhonyClient/1.2 10436 Accept-Ranges: NPT, SMPTE, UTC 10438 S->C: RTSP/2.0 200 OK 10439 Transport: RTP/AVP/UDP;unicast; 10440 dest_addr="192.0.2.53:6970"/"192.0.2.53:6971"; 10441 src_addr="198.51.100.5:6970"/"198.51.100.5:6971"; 10442 mode="PLAY";ssrc=EAB98712 10443 CSeq: 2 10444 Session: 2034820394 10445 Expires: 23 Jan 1997 16:00:00 GMT 10446 Server: PhonyServer/1.0 10447 Date: 23 Jan 1997 15:35:07 GMT 10448 Accept-Ranges: NPT 10449 Media-Properties: Random-Acces=0.5, Immutable, Unlimited 10451 C->S: PLAY rtsp://foo.example.com/test.wav/ RTSP/2.0 10452 CSeq: 3 10453 User-Agent: PhonyClient/1.2 10454 Session: 2034820394 10456 S->C: RTSP/2.0 200 OK 10457 CSeq: 3 10458 Server: PhonyServer/1.0 10459 Date: 23 Jan 1997 15:35:08 GMT 10460 Session: 2034820394 10461 Range: npt=0-600 10462 Seek-Style: RAP 10463 RTP-Info: url="rtsp://foo.example.com/test.wav/streamid=0" 10464 ssrc=0D12F123:seq=981888;rtptime=3781123 10466 Note the different URI in the SETUP command, and then the switch back 10467 to the aggregate URI in the PLAY command. This makes complete sense 10468 when there are multiple streams with aggregate control, but is less 10469 than intuitive in the special case where the number of streams is 10470 one. However, the server has declared that the aggregated control 10471 URI in the SDP and therefore this is legal. 10473 In this case, it is also required that servers accept implementations 10474 that use the non-aggregated interpretation and use the individual 10475 media URI, like this: 10477 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/2.0 10478 CSeq: 3 10479 User-Agent: PhonyClient/1.2 10480 Session: 2034820394 10482 A.5. Live Media Presentation Using Multicast 10484 The media server M chooses the multicast address and port. Here, it 10485 is assumed that the web server only contains a pointer to the full 10486 description, while the media server M maintains the full description. 10488 C->W: GET /sessions.html HTTP/1.1 10489 Host: www.example.com 10491 W->C: HTTP/1.1 200 OK 10492 Content-Type: text/html 10494 10495 ... 10496 10497 Streamed Live Music performance 10498 ... 10499 10501 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/2.0 10502 CSeq: 1 10503 Supported: play.basic, play.scale 10504 User-Agent: PhonyClient/1.2 10506 M->C: RTSP/2.0 200 OK 10507 CSeq: 1 10508 Content-Type: application/sdp 10509 Content-Length: 183 10510 Server: PhonyServer/1.0 10511 Date: Thu, 23 Jan 1997 15:35:06 GMT 10512 Supported: play.basic 10514 v=0 10515 o=- 2890844526 2890842807 IN IP4 192.0.2.5 10516 s=RTSP Session 10517 t=0 0 10518 m=audio 3456 RTP/AVP 0 10519 c=IN IP4 233.252.0.54/16 10520 a=control: rtsp://live.example.com/concert/audio 10521 a=range:npt=0- 10523 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/2.0 10524 CSeq: 2 10525 Transport: RTP/AVP;multicast; 10526 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10527 Accept-Ranges: NPT, SMPTE, UTC 10528 User-Agent: PhonyClient/1.2 10530 M->C: RTSP/2.0 200 OK 10531 CSeq: 2 10532 Server: PhonyServer/1.0 10533 Date: Thu, 23 Jan 1997 15:35:06 GMT 10534 Transport: RTP/AVP;multicast; 10535 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10536 ;ssrc=4D12AB92/0DF876A3 10537 Session: 0456804596 10538 Accept-Ranges: NPT, UTC 10539 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0 10541 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/2.0 10542 CSeq: 3 10543 Session: 0456804596 10544 User-Agent: PhonyClient/1.2 10546 M->C: RTSP/2.0 200 OK 10547 CSeq: 3 10548 Server: PhonyServer/1.0 10549 Date: 23 Jan 1997 15:35:07 GMT 10550 Session: 0456804596 10551 Seek-Style: Next 10552 Range:npt=1256- 10553 RTP-Info: url="rtsp://live.example.com/concert/audio" 10554 ssrc=0D12F123:seq=1473; rtptime=80000 10556 A.6. Capability Negotiation 10558 This examples illustrate how the client and server determines their 10559 capability to support a special feature, in this case "play.scale". 10560 The server, through the clients request and the included Supported 10561 header, learns the client supports RTSP 2.0, and also supports the 10562 playback time scaling feature of RTSP. The server's response 10563 contains the following feature related information to the client; it 10564 supports the basic media delivery functions (play.basic), the 10565 extended functionality of time scaling of content (play.scale), and 10566 one "example.com" proprietary feature (com.example.flight). The 10567 client also learns the methods supported (Public header) by the 10568 server for the indicated resource. 10570 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/2.0 10571 CSeq: 1 10572 Supported: play.basic, play.scale 10573 User-Agent: PhonyClient/1.2 10575 S->C: RTSP/2.0 200 OK 10576 CSeq: 1 10577 Public: OPTIONS,SETUP,PLAY,PAUSE,TEARDOWN,DESCRIBE,GET_PARAMETER 10578 Allow: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, DESCRIBE 10579 Server: PhonyServer/2.0 10580 Supported: play.basic, play.scale, com.example.flight 10582 When the client sends its SETUP request it tells the server that it 10583 requires support of the play.scale feature for this session by 10584 including the Require header. 10586 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/2.0 10587 CSeq: 3 10588 User-Agent: PhonyClient/1.2 10589 Transport: RTP/AVP/UDP;unicast; 10590 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057", 10591 RTP/AVP/TCP;unicast;interleaved=0-1 10592 Require: play.scale 10593 Accept-Ranges: NPT, SMPTE, UTC 10594 User-Agent: PhonyClient/1.2 10596 S->C: RTSP/2.0 200 OK 10597 CSeq: 3 10598 Session: 12345678 10599 Transport: RTP/AVP/UDP;unicast; 10600 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10601 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10602 Server: PhonyServer/2.0 10603 Accept-Ranges: NPT, SMPTE 10604 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10606 Appendix B. RTSP Protocol State Machine 10608 The RTSP session state machine describes the behavior of the protocol 10609 from RTSP session initialization through RTSP session termination. 10611 The State machine is defined on a per session basis which is uniquely 10612 identified by the RTSP session identifier. The session may contain 10613 one or more media streams depending on state. If a single media 10614 stream is part of the session it is in non-aggregated control. If 10615 two or more is part of the session it is in aggregated control. 10617 The below state machine is a informative description of the protocols 10618 behavior. In case of ambiguity with the earlier parts of this 10619 specification, the description in the earlier parts take precedence. 10621 B.1. States 10623 The state machine contains three states, described below. For each 10624 state there exist a table which shows which requests and events are 10625 allowed and whether they will result in a state change. 10627 Init: Initial state no session exists. 10629 Ready: Session is ready to start playing. 10631 Play: Session is playing, i.e. sending media stream data in the 10632 direction S->C. 10634 B.2. State variables 10636 This representation of the state machine needs more than its state to 10637 work. A small number of variables are also needed and is explained 10638 below. 10640 NRM: The number of media streams part of this session. 10642 RP: Resume point, the point in the presentation time line at which 10643 a request to continue playing will resume from. A time format 10644 for the variable is not mandated. 10646 B.3. Abbreviations 10648 To make the state tables more compact a number of abbreviations are 10649 used, which are explained below. 10651 IFI: IF Implemented. 10653 md: Media 10655 PP: Pause Point, the point in the presentation time line at which 10656 the presentation was paused. 10658 Prs: Presentation, the complete multimedia presentation. 10660 RedP: Redirect Point, the point in the presentation time line at 10661 which a REDIRECT was specified to occur. 10663 SES: Session. 10665 B.4. State Tables 10667 This section contains a table for each state. The table contains all 10668 the requests and events that this state is allowed to act on. The 10669 events which is method names are, unless noted, requests with the 10670 given method in the direction client to server (C->S). In some cases 10671 there exist one or more requisite. The response column tells what 10672 type of response actions should be performed. Possible actions that 10673 is requested for an event includes: response codes, e.g. 200, headers 10674 that needs to be included in the response, setting of state 10675 variables, or setting of other session related parameters. The new 10676 state column tells which state the state machine changes to. 10678 The response to a valid request meeting the requisites is normally a 10679 2xx (SUCCESS) unless other noted in the response column. The 10680 exceptions need to be given a response according to the response 10681 column. If the request does not meet the requisite, is erroneous or 10682 some other type of error occur, the appropriate response code is to 10683 be sent. If the response code is a 4xx the session state is 10684 unchanged. A response code of 3rr will result in that the session is 10685 ended and its state is changed to Init. A response code of 304 10686 results in no state change. However, there exist restrictions to 10687 when a 3rr response may be used. A 5xx response does not result in 10688 any change of the session state, except if the error is not possible 10689 to recover from. A unrecoverable error results in the ending of the 10690 session. As it in the general case can't be determined if it was a 10691 unrecoverable error or not the client will be required to test. In 10692 the case that the next request after a 5xx is responded with 454 10693 (Session Not Found) the client knows that the session has ended. For 10694 any request message that cannot be responded to within the time 10695 defined in Section 10.4, a 100 response must be sent. 10697 The server will timeout the session after the period of time 10698 specified in the SETUP response, if no activity from the client is 10699 detected. Therefore there exist a timeout event for all states 10700 except Init. 10702 In the case that NRM = 1 the presentation URI is equal to the media 10703 URI or a specified presentation URI. For NRM > 1 the presentation 10704 URI needs to be other than any of the medias that are part of the 10705 session. This applies to all states. 10707 +---------------+-----------------+---------------------------------+ 10708 | Event | Prerequisite | Response | 10709 +---------------+-----------------+---------------------------------+ 10710 | DESCRIBE | Needs REDIRECT | 3rr, Redirect | 10711 | | | | 10712 | DESCRIBE | | 200, Session description | 10713 | | | | 10714 | OPTIONS | Session ID | 200, Reset session timeout | 10715 | | | timer | 10716 | | | | 10717 | OPTIONS | | 200 | 10718 | | | | 10719 | SET_PARAMETER | Valid parameter | 200, change value of parameter | 10720 | | | | 10721 | GET_PARAMETER | Valid parameter | 200, return value of parameter | 10722 +---------------+-----------------+---------------------------------+ 10724 Table 13: None state-machine changing events 10726 The methods in Table 13 do not have any effect on the state machine 10727 or the state variables. However, some methods do change other 10728 session related parameters, for example SET_PARAMETER which will set 10729 the parameter(s) specified in its body. Also all of these methods 10730 that allows Session header will also update the keep-alive timer for 10731 the session. 10733 +------------------+----------------+-----------+-------------------+ 10734 | Action | Requisite | New State | Response | 10735 +------------------+----------------+-----------+-------------------+ 10736 | SETUP | | Ready | NRM=1, RP=0.0 | 10737 | | | | | 10738 | SETUP | Needs Redirect | Init | 3rr Redirect | 10739 | | | | | 10740 | S -> C: REDIRECT | No Session hdr | Init | Terminate all SES | 10741 +------------------+----------------+-----------+-------------------+ 10743 Table 14: State: Init 10745 The initial state of the state machine, see Table 14 can only be left 10746 by processing a correct SETUP request. As seen in the table the two 10747 state variables are also set by a correct request. This table also 10748 shows that a correct SETUP can in some cases be redirected to another 10749 URI and/or server by a 3rr response. 10751 +-------------+------------------------+---------+------------------+ 10752 | Action | Requisite | New | Response | 10753 | | | State | | 10754 +-------------+------------------------+---------+------------------+ 10755 | SETUP | New URI | Ready | NRM +=1 | 10756 | | | | | 10757 | SETUP | URI Setup prior | Ready | Change transport | 10758 | | | | param | 10759 | | | | | 10760 | TEARDOWN | Prs URI, | Init | No session hdr, | 10761 | | | | NRM = 0 | 10762 | | | | | 10763 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10764 | | | | NRM = 0 | 10765 | | | | | 10766 | TEARDOWN | md URI,NRM>1 | Ready | Session hdr, NRM | 10767 | | | | -= 1 | 10768 | | | | | 10769 | PLAY | Prs URI, No range | Play | Play from RP | 10770 | | | | | 10771 | PLAY | Prs URI, Range | Play | According to | 10772 | | | | range | 10773 | | | | | 10774 | PLAY | md URI, NRM=1, Range | Play | According to | 10775 | | | | range | 10776 | | | | | 10777 | PLAY | md URI, NRM=1 | Play | Play from RP | 10778 | | | | | 10779 | PAUSE | Prs URI | Ready | Return PP | 10780 | | | | | 10781 | SC:REDIRECT | Terminate-Reason | Ready | Set RedP | 10782 | | | | | 10783 | SC:REDIRECT | No Terminate-Reason | Init | Session is | 10784 | | time parameter | | removed | 10785 | | | | | 10786 | Timeout | | Init | | 10787 | | | | | 10788 | RedP | | Init | TEARDOWN of | 10789 | reached | | | session | 10790 +-------------+------------------------+---------+------------------+ 10792 Table 15: State: Ready 10794 In the Ready state, see Table 15, some of the actions are depending 10795 on the number of media streams (NRM) in the session, i.e., aggregated 10796 or non-aggregated control. A SETUP request in the Ready state can 10797 either add one more media stream to the session or, if the media 10798 stream (same URI) already is part of the session, change the 10799 transport parameters. TEARDOWN is depending on both the Request-URI 10800 and the number of media stream within the session. If the Request- 10801 URI is the presentations URI the whole session is torn down. If a 10802 media URI is used in the TEARDOWN request and more than one media 10803 exist in the session, the session will remain and a session header is 10804 returned in the response. If only a single media stream remains in 10805 the session when performing a TEARDOWN with a media URI the session 10806 is removed. The number of media streams remaining after tearing down 10807 a media stream determines the new state. 10809 +----------------+-----------------------+--------+-----------------+ 10810 | Action | Requisite | New | Response | 10811 | | | State | | 10812 +----------------+-----------------------+--------+-----------------+ 10813 | PAUSE | Prs URI | Ready | Set RP to | 10814 | | | | present point | 10815 | | | | | 10816 | End of media | All media | Play | Set RP = End of | 10817 | | | | media | 10818 | | | | | 10819 | End of range | | Play | Set RP = End of | 10820 | | | | range | 10821 | | | | | 10822 | PLAY | Prs URI, No range | Play | Play from | 10823 | | | | present point | 10824 | | | | | 10825 | PLAY | Prs URI, Range | Play | According to | 10826 | | | | range | 10827 | | | | | 10828 | SC:PLAY_NOTIFY | | Play | 200 | 10829 | | | | | 10830 | SETUP | New URI | Play | 455 | 10831 | | | | | 10832 | SETUP | Setuped URI | Play | 455 | 10833 | | | | | 10834 | SETUP | Setuped URI, IFI | Play | Change | 10835 | | | | transport | 10836 | | | | param. | 10837 | | | | | 10838 | TEARDOWN | Prs URI | Init | No session hdr | 10839 | | | | | 10840 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10841 | | | | NRM=0 | 10842 | | | | | 10843 | TEARDOWN | md URI | Play | 455 | 10844 | | | | | 10845 | SC:REDIRECT | Terminate Reason with | Play | Set RedP | 10846 | | Time parameter | | | 10847 | | | | | 10848 | SC:REDIRECT | | Init | Session is | 10849 | | | | removed | 10850 | | | | | 10851 | RedP reached | | Init | TEARDOWN of | 10852 | | | | session | 10853 | | | | | 10854 | Timeout | | Init | Stop Media | 10855 | | | | playout | 10856 +----------------+-----------------------+--------+-----------------+ 10857 Table 16: State: Play 10859 The Play state table, see Table 16, contains a number of requests 10860 that needs a presentation URI (labeled as Prs URI) to work on (i.e., 10861 the presentation URI has to be used as the Request-URI). This is due 10862 to the exclusion of non-aggregated stream control in sessions with 10863 more than one media stream. 10865 To avoid inconsistencies between the client and server, automatic 10866 state transitions are avoided. This can be seen at for example "End 10867 of media" event when all media has finished playing, the session 10868 still remain in Play state. An explicit PAUSE request needs to be 10869 sent to change the state to Ready. It may appear that there exist 10870 automatic transitions in "RedP reached" and "PP reached". However, 10871 they are requested and acknowledged before they take place. The time 10872 at which the transition will happen is known by looking at the range 10873 header. If the client sends a request close in time to these 10874 transitions it needs to be prepared for receiving error message, as 10875 the state may or may not have changed. 10877 Appendix C. Media Transport Alternatives 10879 This section defines how certain combinations of protocols, profiles 10880 and lower transports are used. This includes the usage of the 10881 Transport header's source and destination address parameters 10882 "src_addr" and "dest_addr". 10884 C.1. RTP 10886 This section defines the interaction of RTSP with respect to the RTP 10887 protocol [RFC3550]. It also defines any necessary media transport 10888 signalling with regards to RTP. 10890 The available RTP profiles and lower layer transports are described 10891 below along with rules on signalling the available combinations. 10893 C.1.1. AVP 10895 The usage of the "RTP Profile for Audio and Video Conferences with 10896 Minimal Control" [RFC3551] when using RTP for media transport over 10897 different lower layer transport protocols is defined below in regards 10898 to RTSP. 10900 One such case is defined within this document, the use of embedded 10901 (interleaved) binary data as defined in Section 14. The usage of 10902 this method is indicated by include the "interleaved" parameter. 10904 When using embedded binary data the "src_addr" and "dest_addr" MUST 10905 NOT be used. This addressing and multiplexing is used as defined 10906 with use of channel numbers and the interleaved parameter. 10908 C.1.2. AVP/UDP 10910 This part describes sending of RTP [RFC3550] over lower transport 10911 layer UDP [RFC0768] according to the profile "RTP Profile for Audio 10912 and Video Conferences with Minimal Control" defined in RFC 3551 10913 [RFC3551]. This profile requires one or two uni- or bi-directional 10914 UDP flows per media stream. The first UDP flow is for RTP and the 10915 second is for RTCP. Embedding of RTP data with the RTSP messages, in 10916 accordance with Section 14, SHOULD NOT be performed when RTSP 10917 messages are transported over unreliable transport protocols, like 10918 UDP [RFC0768]. 10920 The RTP/UDP and RTCP/UDP flows can be established using the Transport 10921 header's "src_addr", and "dest_addr" parameters. 10923 In RTSP PLAY mode, the transmission of RTP packets from client to 10924 server is unspecified. The behavior in regards to such RTP packets 10925 MAY be defined in future. 10927 The "src_addr" and "dest_addr" parameters are used in the following 10928 way for media delivery and playback mode, i.e. Mode=PLAY: 10930 o The "src_addr" and "dest_addr" parameters MUST contain either 1 or 10931 2 address specifications. 10933 o Each address specification for RTP/AVP/UDP or RTP/AVP/TCP MUST 10934 contain either: 10936 * both an address and a port number, or 10938 * a port number without an address. 10940 o The first address and port pair given in either of the parameters 10941 applies to the RTP stream. The second address and port pair if 10942 present applies to the RTCP stream. 10944 o The RTP/UDP packets from the server to the client MUST be sent to 10945 the address and port given by first address and port pair of the 10946 "dest_addr" parameter. 10948 o The RTCP/UDP packets from the server to the client MUST be sent to 10949 the address and port given by the second address and port pair of 10950 the "dest_addr" parameter. If no second pair is specified RTCP 10951 MUST NOT be sent. 10953 o The RTCP/UDP packets from the client to the server MUST be sent to 10954 the address and port given by the second address and port pair of 10955 the "src_addr" parameter. If no second pair is given RTCP MUST 10956 NOT be sent. 10958 o The RTP/UDP packets from the client to the server MUST be sent to 10959 the address and port given by the first address and port pair of 10960 the "src_addr" parameter. 10962 o RTP and RTCP Packets SHOULD be sent from the corresponding 10963 receiver port, i.e. RTCP packets from server should be sent from 10964 the "src_addr" parameters second address port pair. 10966 C.1.3. AVPF/UDP 10968 The RTP profile "Extended RTP Profile for RTCP-based Feedback (RTP/ 10969 AVPF)"[RFC4585] MAY be used as RTP profiles in session using RTP. 10970 All that is defined for AVP MUST also apply for AVPF. 10972 The usage of AVPF is indicated by the media initialization protocol 10973 used. In the case of SDP it is indicated by media lines (m=) 10974 containing the profile RTP/AVPF. That SDP MAY also contain further 10975 AVPF related SDP attributes configuring the AVPF session regarding 10976 reporting interval and feedback messages to be used. This 10977 configuration MUST be followed. 10979 C.1.4. SAVP/UDP 10981 The RTP profile "The Secure Real-time Transport Protocol (SRTP)" 10982 [RFC3711] is an RTP profile (SAVP) that MAY be used in RTSP sessions 10983 using RTP. All that is defined for AVP MUST also apply for SAVP. 10985 The usage of SRTP requires that a security context is established. 10986 The default key-management unless otherwise signalled shall be MIKEY 10987 in RSA-R mode as defined in Appendix C.1.4.1, and not according to 10988 the procedure defined in "Key Management Extensions for Session 10989 Description Protocol (SDP) and Real Time Streaming Protocol (RTSP)" 10990 [RFC4567]. The reason is that RFC 4567 sends the initial MIKEY 10991 message in SDP, thus both requiring the usage of the DESCRIBE method 10992 and forcing the server to keep state for client performing DESCRIBE 10993 in anticipation that they might require key management. 10995 MIKEY is selected as default method for establishing SRTP 10996 cryptographic context within an RTSP session as it can be embedded in 10997 the RTSP messages, while still ensuring confidentiality of content of 10998 the keying material, even when using hop-by-hop TLS security for the 10999 RTSP messages. This method does also support pipelining of the RTSP 11000 messages. 11002 C.1.4.1. MIKEY Key Establishment 11004 This method for using MIKEY to establish the SRTP cryptographic 11005 context is initiated in the client's SETUP request, and the servers 11006 response to the SETUP carries the MIKEY response. Thus ensuring that 11007 the crypto context establishment happens simultaneously with the 11008 establishment of the media stream being protected. By using MIKEY's 11009 RSA-R mode [RFC4738] the client can be initiator and still allow the 11010 server to set the parameters in accordance with the actual media 11011 stream. 11013 The SRTP cryptographic context establishment is done according to the 11014 following process: 11016 1. The client determines that SAVP or SAVPF shall be used from 11017 media description format, e.g. SDP. If no other key management 11018 method is explicitly signalled, then MIKEY SHALL be used as 11019 defined here in. This specification does not specify an 11020 explicit method for indicating this SRTP cryptographic context 11021 establishment method, but future specifications may. 11023 2. The client SHALL establish a TLS connection for RTSP messages, 11024 directly or hop by hop with the server. If hop-by-hop TLS 11025 security is used, the User method SHALL be indicated in the 11026 Accept-Credentials header. We do note that using hop-by-hop 11027 does allow the proxy to insert itself as a man in the middle 11028 also in the MIKEY exchange by providing one of its certificates, 11029 rather than the server's in the Connection-Credentials header. 11030 The client shall therefore validate the server certificate. 11032 3. The client retrieves the servers certificate from a direct TLS 11033 connection, or if hop by hop from Connection-Credentials header. 11034 The client then checks that the server certificate is valid and 11035 belongs to server. 11037 4. The client forms the MIKEY Initiator message using RSA-R mode in 11038 unicast mode as specified in [RFC4738]. The client SHOULD use 11039 the same certificate for TLS and in MIKEY to enable server to 11040 bind the two together. The client's certificate SHALL be 11041 included in the MIKEY message. The client SHALL indicate its 11042 SRTP capabilities in the message. 11044 5. The MIKEY message from the previous step is base64 [RFC4648] 11045 encoded and becomes the value of the MIKEY parameter that are 11046 included in the transport specification(s) that specifies a SRTP 11047 based profile (SAVP, SAVPF) in the SETUP request. 11049 6. Any proxy encountering the MIKEY parameter SHALL forward it 11050 without modification. A proxy requiring to understand transport 11051 specification which doesn't support SAVP/SAVPF with MIKEY will 11052 discard the whole transport specification. Most types of proxy 11053 can easily support SAVP and SAVPF with MIKEY. If possible 11054 bypassing the proxy should be tried. 11056 7. The server upon receiving the SETUP request, will need to decide 11057 upon the transport specification to use, if multiple are 11058 included by the client. In the determination of which transport 11059 specifications that are supported and preferred, the server 11060 should decode the MIKEY message to take the embedded SRTP 11061 parameters into account. If all transport specs require SRTP 11062 but no MIKEY parameter or other supported keying method is 11063 included, the server shall respond with 403. 11065 8. Upon generating a response the following outcomes can occur: 11067 * A transport spec not using SRTP and MIKEY is selected. Thus 11068 the answer will not contain any MIKEY parameter. 11070 * A transport spec using SRTP and MIKEY is selected but an 11071 error is encountered in the MIKEY processing. In that case 11072 an RTSP error response code of 466 "Key Management Error" 11073 SHALL be used. A MIKEY message describing the error MAY be 11074 included. 11076 * A transport spec using SRTP and MIKEY is selected and a MIKEY 11077 response message can be created. The server SHOULD use the 11078 same certificate for TLS and in MIKEY to enable client to 11079 bind the two together. If a different certificate is used it 11080 SHALL be included in the MIKEY message. It is RECOMMENDED 11081 that the envelope key cache type is set to 'Cache' and that a 11082 single envelope key is reused for all MIKEY messages to the 11083 client. That message is included in the MIKEY parameter part 11084 of the single selected transport specification in the SETUP 11085 response. The server will set the SRTP parameters as 11086 preferred for this media stream within the supported range by 11087 the client. 11089 9. The server transmits the SETUP response back to the client. 11091 10. The client receives the SETUP response and if the response code 11092 indicates a successful request it decodes the MIKEY message and 11093 establish the SRTP cryptographic context from the parameters in 11094 the MIKEY response. 11096 In the above method the client's certificate may be self-signed in 11097 cases where the client's identify is not necessary to establish and 11098 the security goal is only to ensure that the RTSP signalling client 11099 is the same as the one receiving the SRTP security context. 11101 C.1.5. SAVPF/UDP 11103 The RTP profile "Extended Secure RTP Profile for RTCP-based Feedback 11104 (RTP/SAVPF)" [RFC5124] is an RTP profile (SAVPF) that MAY be used in 11105 RTSP sessions using RTP. All that is defined for AVP MUST also apply 11106 for SAVPF. 11108 The usage of SRTP requires that a cryptographic context is 11109 established. The default mechanism for establishing that security 11110 association is to use MIKEY[RFC3830] with RTSP as defined 11111 Appendix C.1.4.1. 11113 C.1.6. RTCP usage with RTSP 11115 RTCP has several usages when RTP is used for media transport as 11116 explained below. Due to that RTCP MUST be supported if an RTSP agent 11117 handles RTP. 11119 C.1.6.1. Media synchronization 11121 RTCP provides media synchronization and clock drift compensation. 11122 The initial media synchronization is available from RTP-Info header. 11123 However, to be able to handle any clock drift between the media 11124 streams, RTCP is needed. 11126 C.1.6.2. RTSP Session keep-alive 11128 RTCP traffic from the RTSP client to the RTSP server MUST function as 11129 keep-alive. Which requires an RTSP server supporting RTP to use the 11130 received RTCP packets as indications that the client desires the 11131 related RTSP session to be kept alive. 11133 C.1.6.3. Bit-rate adaption 11135 RTCP Receiver reports and any additional feedback from the client 11136 MUST be used adapt the bit-rate used over the transport for all cases 11137 when RTP is sent over UDP. An RTP sender without reserved resources 11138 MUST NOT use more than its fair share of the available resources. 11139 This can be determined by comparing on short to medium term (some 11140 seconds) the used bit-rate and adapt it so that the RTP sender sends 11141 at a bit-rate comparable to what a TCP sender would achieve on 11142 average over the same path. 11144 C.1.6.4. RTP and RTCP Multiplexing 11146 RTSP can be used to negotiate the usage of RTP and RTCP multiplexing 11147 as described in [RFC5761]. This allows servers and client to reduce 11148 the amount of resources required for the session by only requiring 11149 one underlying transport stream per media stream instead of two when 11150 using RTP and RTCP. This lessens the server port consumption and 11151 also the necessary state and keep-alive work when operating across 11152 Network and Address Translators [RFC2663]. 11154 Content must be prepared with some consideration for RTP and RTCP 11155 multiplexing, mainly ensuring that the RTP payload types used does 11156 not collide with the ones used for RTCP packet types this option 11157 likely needs explicit support from the content unless the RTP payload 11158 types can be remapped by the server and that is correctly reflected 11159 in the session description. Beyond that support of this feature 11160 should come at little cost and much gain. 11162 It is recommended that if the content and server supports RTP and 11163 RTCP multiplexing that this is indicated in the session description, 11164 for example using the SDP attribute "a=rtcp-mux". If the SDP message 11165 contains the a=rtcp-mux attribute for a media stream, the server MUST 11166 support RTP and RTCP multiplexing. If indicated or otherwise desired 11167 by the client it can include the Transport parameter "RTCP-mux" in 11168 any transport specification where it desires to use RTCP-mux. The 11169 server will indicate if it supports RTCP-mux. Server and Client 11170 SHOULD support RTP and RTCP multiplexing. 11172 For capability exchange, an RTSP feature tag for RTP and RTCP 11173 multiplexing is defined: "setup.rtp.rtcp.mux". 11175 C.2. RTP over TCP 11177 Transport of RTP over TCP can be done in two ways, over independent 11178 TCP connections using RFC 4571 [RFC4571] or interleaved in the RTSP 11179 control connection. In both cases the protocol MUST be "rtp" and the 11180 lower layer MUST be TCP. The profile may be any of the above 11181 specified ones; AVP, AVPF, SAVP or SAVPF. 11183 C.2.1. Interleaved RTP over TCP 11185 The use of embedded (interleaved) binary data transported on the RTSP 11186 connection is possible as specified in Section 14. When using this 11187 declared combination of interleaved binary data the RTSP messages 11188 MUST be transported over TCP. TLS may or may not be used. 11190 One should, however, consider that this will result that all media 11191 streams go through any proxy. Using independent TCP connections can 11192 avoid that issue. 11194 C.2.2. RTP over independent TCP 11196 In this Appendix, we describe the sending of RTP [RFC3550] over lower 11197 transport layer TCP [RFC0793] according to "Framing Real-time 11198 Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over 11199 Connection-Oriented Transport" [RFC4571]. This Appendix adapts the 11200 guidelines for using RTP over TCP within SIP/SDP [RFC4145] to work 11201 with RTSP. 11203 A client codes the support of RTP over independent TCP by specifying 11204 an RTP/AVP/TCP transport option without an interleaved parameter in 11205 the Transport line of a SETUP request. This transport option MUST 11206 include the "unicast" parameter. 11208 If the client wishes to use RTP with RTCP, two ports (or two address/ 11209 port pairs) are specified by the dest_addr parameter. If the client 11210 wishes to use RTP without RTCP, one port (or one address/port pair) 11211 is specified by the dest_addr parameter. Ordering rules of dest_addr 11212 ports follow the rules for RTP/AVP/UDP. 11214 If the client wishes to play the active role in initiating the TCP 11215 connection, it MAY set the "setup" parameter (See Section 16.52) on 11216 the Transport line to be "active", or it MAY omit the setup 11217 parameter, as active is the default. If the client signals the 11218 active role, the ports for all dest_addr values MUST be set to 9 (the 11219 discard port). 11221 If the client wishes to play the passive role in TCP connection 11222 initiation, it MUST set the "setup" parameter on the Transport line 11223 to be "passive". If the client is able to assume the active or the 11224 passive role, it MUST set the "setup" parameter on the Transport line 11225 to be "actpass". In either case, the dest_addr port value for RTP 11226 MUST be set to the TCP port number on which the client is expecting 11227 to receive the RTP stream connection, and the dest_addr port value 11228 for RTCP MUST be set to the TCP port number on which the client is 11229 expecting to receive the RTCP stream connection. 11231 If upon receipt of a non-interleaved RTP/AVP/TCP SETUP request, a 11232 server decides to accept this requested option, the 2xx reply MUST 11233 contain a Transport option that specifies RTP/AVP/TCP (without using 11234 the interleaved parameter, and with using the unicast parameter). 11235 The dest_addr parameter value MUST be echoed from the parameter value 11236 in the client request unless the destination address (only port) was 11237 not provided in which can the server MAY include the source address 11238 of the RTSP TCP connection with the port number unchanged. 11240 In addition, the server reply MUST set the setup parameter on the 11241 Transport line, to indicate the role the server will play in the 11242 connection setup. Permissible values are "active" (if a client set 11243 "setup" to "passive" or "actpass") and "passive" (if a client set 11244 "setup" to "active" or "actpass"). 11246 If a server sets "setup" to "passive", the "src_addr" in the reply 11247 MUST indicate the ports the server is willing to receive an RTP 11248 connection and (if the client requested an RTCP connection by 11249 specifying two dest_addr ports or address/port pairs) and RTCP 11250 connection. If a server sets "setup" to "active", the ports 11251 specified in "src_addr" MUST be set to 9. The server MAY use the 11252 "ssrc" parameter, following the guidance in Section 16.52. Port 11253 ordering for src_addr follows the rules for RTP/AVP/UDP. 11255 Servers MUST support taking the passive role and MAY support taking 11256 the active role. Servers with a public IP address takes the passive 11257 role, thus enabling clients behind NATs and Firewalls to better 11258 chance of succesful connect to the server by actively connecting 11259 outwards. Therefore the clients are RECOMMENDED to take the active 11260 role. 11262 After sending (receiving) a 2xx reply for a SETUP method for a non- 11263 interleaved RTP/AVP/TCP media stream, the active party SHOULD 11264 initiate the TCP connection as soon as possible. The client MUST NOT 11265 send a PLAY request prior to the establishment of all the TCP 11266 connections negotiated using SETUP for the session. In case the 11267 server receives a PLAY request in a session that has not yet 11268 established all the TCP connections, it MUST respond using the 464 11269 "Data Transport Not Ready Yet" (Section 15.4.29) error code. 11271 Once the PLAY request for a media resource transported over non- 11272 interleaved RTP/AVP/TCP occurs, media begins to flow from server to 11273 client over the RTP TCP connection, and RTCP packets flow 11274 bidirectionally over the RTCP TCP connection. As in the RTP/UDP 11275 case, client to server traffic on the TCP port is unspecified by this 11276 memo. The packets that travel on these connections MUST be framed 11277 using the protocol defined in [RFC4571], not by the framing defined 11278 for interleaving RTP over the RTSP control connection defined in 11279 Section 14. 11281 A successful PAUSE request for a media being transported over RTP/ 11282 AVP/TCP pauses the flow of packets over the connections, without 11283 closing the connections. A successful TEARDOWN request signals that 11284 the TCP connections for RTP and RTCP are to be closed as soon as 11285 possible. 11287 Subsequent SETUP requests on an already-SETUP RTP/AVP/TCP URI may be 11288 ambiguous in the following way: does the client wish to open up new 11289 TCP RTP and RTCP connections for the URI, or does the client wish to 11290 continue using the existing TCP RTP and RTCP connections? The client 11291 SHOULD use the "connection" parameter (defined in Section 16.52) on 11292 the Transport line to make its intention clear in the regard (by 11293 setting "connection" to "new" if new connections are needed, and by 11294 setting "connection" to "existing" if the existing connections are to 11295 be used). After a 2xx reply for a SETUP request for a new 11296 connection, parties should close the pre-existing connections, after 11297 waiting a suitable period for any stray RTP or RTCP packets to 11298 arrive. 11300 The usage of SRTP, i.e. either SAVP or SAVPF profiles requires that a 11301 security association is established. The default mechanism for 11302 establishing that security association is to use MIKEY[RFC3830] with 11303 RTSP as defined Appendix C.1.4.1. 11305 Below, we rewrite part of the example media on demand example shown 11306 in Appendix A.1 to use RTP/AVP/TCP non-interleaved: 11308 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 11309 CSeq: 1 11310 User-Agent: PhonyClient/1.2 11312 M->C: RTSP/2.0 200 OK 11313 CSeq: 1 11314 Server: PhonyServer/1.0 11315 Date: Thu, 23 Jan 1997 15:35:06 GMT 11316 Content-Type: application/sdp 11317 Content-Length: 227 11318 Content-Base: rtsp://example.com/twister.3gp/ 11319 Expires: 24 Jan 1997 15:35:06 GMT 11321 v=0 11322 o=- 2890844256 2890842807 IN IP4 198.51.100.34 11323 s=RTSP Session 11324 i=An Example of RTSP Session Usage 11325 e=adm@example.com 11326 c=IN IP4 0.0.0.0 11327 a=control: * 11328 a=range: npt=0-0:10:34.10 11329 t=0 0 11330 m=audio 0 RTP/AVP 0 11331 a=control: trackID=1 11333 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 11334 CSeq: 2 11335 User-Agent: PhonyClient/1.2 11336 Require: play.basic 11337 Transport: RTP/AVP/TCP;unicast;dest_addr=":9"/":9"; 11338 setup=active;connection=new 11339 Accept-Ranges: NPT, SMPTE, UTC 11341 M->C: RTSP/2.0 200 OK 11342 CSeq: 2 11343 Server: PhonyServer/1.0 11344 Transport: RTP/AVP/TCP;unicast; 11345 dest_addr=":9"/":9"; 11346 src_addr="198.51.100.5:53478"/"198.51.100:54091"; 11347 setup=passive;connection=new;ssrc=93CB001E 11348 Session: 12345678 11349 Expires: 24 Jan 1997 15:35:12 GMT 11350 Date: 23 Jan 1997 15:35:12 GMT 11351 Accept-Ranges: NPT 11352 Media-Properties: Random-Access=0.8, Immutable, Unlimited 11354 C->M: TCP Connection Establishment x2 11356 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 11357 CSeq: 4 11358 User-Agent: PhonyClient/1.2 11359 Range: npt=30- 11360 Session: 12345678 11362 M->C: RTSP/2.0 200 OK 11363 CSeq: 4 11364 Server: PhonyServer/1.0 11365 Date: 23 Jan 1997 15:35:14 GMT 11366 Session: 12345678 11367 Range: npt=30-623.10 11368 Seek-Style: First-Prior 11369 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=1" 11370 ssrc=4F312DD8:seq=54321;rtptime=2876889 11372 C.3. Handling Media Clock Time Jumps in the RTP Media Layer 11374 RTSP allows media clients to control selected, non-contiguous 11375 sections of media presentations, rendering those streams with an RTP 11376 media layer [RFC3550]. Two cases occur, the first is when a new PLAY 11377 request replaces an old ongoing request and the new request results 11378 in a jump in the media. This should produce in the RTP layer a 11379 continuous media stream. A client may also directly following a 11380 completed PLAY request perform a new PLAY request. This will result 11381 in some gap in the media layer. The below text will look into both 11382 cases. 11384 A PLAY request that replaces a ongoing request allows the media layer 11385 rendering the RTP stream without being affected by jumps in media 11386 clock time. The RTP timestamps for the new media range is set so 11387 that they become continuous with the previous media range in the 11388 previous request. The RTP sequence number for the first packet in 11389 the new range will be the next following the last packet in the 11390 previous range, i.e. monotonically increasing. The goal is to allow 11391 the media rendering layer to work without interruption or 11392 reconfiguration across the jumps in media clock. This should be 11393 possible in all cases of replaced PLAY requests for media that has 11394 random-access properties. In this case care is needed to align 11395 frames or similar media dependent structures. 11397 In cases where jumps in media clock time are a result of RTSP 11398 signalling operations arriving after a completed PLAY operation, the 11399 request timing will result in that media becomes non-continuous. The 11400 server becomes unable to send the media so that it arrive timely and 11401 still carry timestamps to make the media stream continuous. In these 11402 cases the server will produce RTP streams where there are gaps in the 11403 RTP timeline for the media. In such cases, if the media has frame 11404 structure, aligning the timestamp for the next frame with the 11405 previous structure reduces the burden to render this media. The gap 11406 should represent the time the server hasn't been serving media, e.g. 11407 the time between the end of the media stream or a PAUSE request and 11408 the new PLAY request. In these cases the RTP sequence number would 11409 normally be monotonically increasing across the gap. 11411 For RTSP sessions with media that lacks random access properties, 11412 like live streams, any media clock jump is commonly result of 11413 correspondingly long pause of delivery. The RTP timestamp will have 11414 increased in direct proportion to the duration of the paused 11415 delivery. Note also that in this case the RTP sequence number should 11416 be the next packet number. If not, the RTCP packet loss reporting 11417 will indicate as loss all packets not received between the point of 11418 pausing and later resuming. This may trigger congestion avoidance 11419 mechanisms. An allowed exception from the above recommendation on 11420 monotonically increasing RTP sequence number is live media streams, 11421 likely being relayed. In this case, when the client resumes 11422 delivery, it will get the media that is currently being delivered to 11423 the server itself. For this type of basic delivery of live streams 11424 to multiple users over unicast, individual rewriting of RTP sequence 11425 numbers becomes quite a burden. For solutions that anyway caches 11426 media, timeshifts, etc, the rewriting should be a minor issue. 11428 The goal when handling jumps in media clock time is that the provided 11429 stream is continuous without gaps in RTP timestamp or sequence 11430 number. However, when delivery has been halted for some reason the 11431 RTP timestamp when resuming MUST represent the duration the delivery 11432 was halted. RTP sequence number MUST generally be the next number, 11433 i.e. monotonically increasing modulo 65536. For media resources with 11434 the properties Time-Progressing and Time-Duration=0.0 the server MAY 11435 create RTP media streams with RTP sequence number jumps in them due 11436 to client first halting delivery and later resuming it (PAUSE and 11437 then later PLAY). However, servers utilizing this exception must 11438 take into consideration the resulting RTCP receiver reports that 11439 likely contains loss report for all the packets part of the 11440 discontinuity. A client can not rely on that a server will align 11441 when resuming playing even if it is RECOMMENDED. The RTP-Info header 11442 will provide information on how the server acts in each case. 11444 We cannot assume that the RTSP client can communicate with the RTP 11445 media agent, as the two may be independent processes. If the RTP 11446 timestamp shows the same gap as the NPT, the media agent will 11447 assume that there is a pause in the presentation. If the jump in 11448 NPT is large enough, the RTP timestamp may roll over and the media 11449 agent may believe later packets to be duplicates of packets just 11450 played out. Having the RTP timestamp jump will also affect the 11451 RTCP measurements based on this. 11453 As an example, assume a RTP timestamp frequency of 8000 Hz, a 11454 packetization interval of 100 ms and an initial sequence number and 11455 timestamp of zero. 11457 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11458 CSeq: 4 11459 Session: abcdefgh 11460 Range: npt=10-15 11461 User-Agent: PhonyClient/1.2 11463 S->C: RTSP/2.0 200 OK 11464 CSeq: 4 11465 Session: abcdefgh 11466 Range: npt=10-15 11467 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11468 ssrc=0D12F123:seq=0;rtptime=0 11470 The ensuing RTP data stream is depicted below: 11472 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11473 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11474 . . . 11475 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 11477 Upon the completion of the requested delivery the server sends a 11478 PLAY_NOTIFY 11479 S->C: PLAY_NOTIFY rtsp://example.com/fizzle RTSP/2.0 11480 CSeq: 5 11481 Notify-Reason: end-of-stream 11482 Request-Status: cseq=4 status=200 reason="OK" 11483 Range: npt=-15 11484 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 11485 ssrc=0D12F123:seq=49;rtptime=39200 11486 Session: abcdefgh 11488 C->S: RTSP/2.0 200 OK 11489 CSeq: 5 11490 User-Agent: PhonyClient/1.2 11492 Upon the completion of the play range, the client follows up with a 11493 request to PLAY from a new NPT. 11495 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11496 CSeq: 6 11497 Session: abcdefg 11498 Range: npt=18-20 11499 User-Agent: PhonyClient/1.2 11501 S->C: RTSP/2.0 200 OK 11502 CSeq: 6 11503 Session: abcdefg 11504 Range: npt=18-20 11505 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11506 ssrc=0D12F123:seq=50;rtptime=40100 11508 The ensuing RTP data stream is depicted below: 11510 S->C: RTP packet - seq = 50, rtptime = 40100, NPT time = 18s 11511 S->C: RTP packet - seq = 51, rtptime = 40900, NPT time = 18.1s 11512 . . . 11513 S->C: RTP packet - seq = 69, rtptime = 55300, NPT time = 19.9s 11515 In this example, first, NPT 10 through 15 is played, then the client 11516 request the server to skip ahead and play NPT 18 through 20. The 11517 first segment is presented as RTP packets with sequence numbers 0 11518 through 49 and timestamp 0 through 39,200. The second segment 11519 consists of RTP packets with sequence number 50 through 69, with 11520 timestamps 40,100 through 55,200. While there is a gap in the NPT, 11521 there is no gap in the sequence number space of the RTP data stream. 11523 The RTP timestamp gap is present in the above example due to the time 11524 it takes to perform the second play request, in this case 12.5 ms 11525 (100/8000). 11527 C.4. Handling RTP Timestamps after PAUSE 11529 During a PAUSE / PLAY interaction in an RTSP session, the duration of 11530 time for which the RTP transmission was halted MUST be reflected in 11531 the RTP timestamp of each RTP stream. The duration can be calculated 11532 for each RTP stream as the time elapsed from when the last RTP packet 11533 was sent before the PAUSE request was received and when the first RTP 11534 packet was sent after the subsequent PLAY request was received. The 11535 duration includes all latency incurred and processing time required 11536 to complete the request. 11538 The RTP RFC [RFC3550] states that: The RTP timestamp for each unit 11539 [packet] would be related to the wallclock time at which the unit 11540 becomes current on the virtual presentation timeline. 11542 In order to satisfy the requirements of [RFC3550], the RTP 11543 timestamp space needs to increase continuously with real time. 11544 While this is not optimal for stored media, it is required for RTP 11545 and RTCP to function as intended. Using a continuous RTP 11546 timestamp space allows the same timestamp model for both stored 11547 and live media and allows better opportunity to integrate both 11548 types of media under a single control. 11550 As an example, assume a clock frequency of 8000 Hz, a packetization 11551 interval of 100 ms and an initial sequence number and timestamp of 11552 zero. 11554 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11555 CSeq: 4 11556 Session: abcdefg 11557 Range: npt=10-15 11558 User-Agent: PhonyClient/1.2 11560 S->C: RTSP/2.0 200 OK 11561 CSeq: 4 11562 Session: abcdefg 11563 Range: npt=10-15 11564 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11565 ssrc=0D12F123:seq=0;rtptime=0 11567 The ensuing RTP data stream is depicted below: 11569 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11570 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11571 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 11572 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 11574 The client then sends a PAUSE request: 11576 C->S: PAUSE rtsp://example.com/fizzle RTSP/2.0 11577 CSeq: 5 11578 Session: abcdefg 11579 User-Agent: PhonyClient/1.2 11581 S->C: RTSP/2.0 200 OK 11582 CSeq: 5 11583 Session: abcdefg 11584 Range: npt=10.4-15 11586 20 seconds elapse and then the client sends a PLAY request. In 11587 addition the server requires 15 ms to process the request: 11589 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11590 CSeq: 6 11591 Session: abcdefg 11592 User-Agent: PhonyClient/1.2 11594 S->C: RTSP/2.0 200 OK 11595 CSeq: 6 11596 Session: abcdefg 11597 Range: npt=10.4-15 11598 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11599 ssrc=0D12F123:seq=4;rtptime=164400 11601 The ensuing RTP data stream is depicted below: 11603 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 11604 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 11605 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 11607 First, NPT 10 through 10.3 is played, then a PAUSE is received by the 11608 server. After 20 seconds a PLAY is received by the server which take 11609 15ms to process. The duration of time for which the session was 11610 paused is reflected in the RTP timestamp of the RTP packets sent 11611 after this PLAY request. 11613 A client can use the RTSP range header and RTP-Info header to map NPT 11614 time of a presentation with the RTP timestamp. 11616 Note: In RFC 2326 [RFC2326], this matter was not clearly defined and 11617 was misunderstood commonly. However, for RTSP 2.0 it is expected 11618 that this will be handled correctly and no exception handling will be 11619 required. 11621 Note Further: To ensure correct media decoding and usually jitter- 11622 buffer handling reseting some of the state when issuing a PLAY 11623 request is needed. 11625 C.5. RTSP / RTP Integration 11627 For certain datatypes, tight integration between the RTSP layer and 11628 the RTP layer will be necessary. This by no means precludes the 11629 above restrictions. Combined RTSP/RTP media clients should use the 11630 RTP-Info field to determine whether incoming RTP packets were sent 11631 before or after a seek or before or after a PAUSE. 11633 C.6. Scaling with RTP 11635 For scaling (see Section 16.44), RTP timestamps should correspond to 11636 the rendering timing. For example, when playing video recorded at 30 11637 frames/second at a scale of two and speed (Section 16.48) of one, the 11638 server would drop every second frame to maintain and deliver video 11639 packets with the normal timestamp spacing of 3,000 per frame, but NPT 11640 would increase by 1/15 second for each video frame. 11642 Note: The above scaling puts requirements on the media codec or a 11643 media stream to support it. For example motion JPEG or other non- 11644 predictive video coding can easier handle the above example. 11646 C.7. Maintaining NPT synchronization with RTP timestamps 11648 The client can maintain a correct display of NPT (Normal Play Time) 11649 by noting the RTP timestamp value of the first packet arriving after 11650 repositioning. The sequence parameter of the RTP-Info 11651 (Section 16.43) header provides the first sequence number of the next 11652 segment. 11654 C.8. Continuous Audio 11656 For continuous audio, the server SHOULD set the RTP marker bit at the 11657 beginning of serving a new PLAY request or at jumps in timeline. 11658 This allows the client to perform playout delay adaptation. 11660 C.9. Multiple Sources in an RTP Session 11662 Note that more than one SSRC MAY be sent in the media stream. If it 11663 happens all sources are expected to be rendered simultaneously. 11665 C.10. Usage of SSRCs and the RTCP BYE Message During an RTSP Session 11667 The RTCP BYE message indicates the end of use of a given SSRC. If 11668 all sources leave an RTP session, it can, in most cases, be assumed 11669 to have ended. Therefore, a client or server MUST NOT send a RTCP 11670 BYE message until it has finished using a SSRC. A server SHOULD keep 11671 using a SSRC until the RTP session is terminated. Prolonging the use 11672 of a SSRC allows the established synchronization context associated 11673 with that SSRC to be used to synchronize subsequent PLAY requests 11674 even if the PLAY response is late. 11676 An SSRC collision with the SSRC that transmits media does also have 11677 consequences, as it will normally force the media sender to change 11678 its SSRC in accordance with the RTP specification[RFC3550]. However, 11679 a RTSP server may wait and see if the client changes and thus resolve 11680 the conflict to minimize the impact. As media sender SSRC change 11681 will result in a loss of synchronization context, and require any 11682 receiver to wait for RTCP sender reports for all media requiring 11683 synchronization before being able to play out synchronized. Due to 11684 these reasons a client joining a session should take care to not 11685 select the same SSRC(s) as the server indicates in the ssrc Transport 11686 header parameter. Any SSRC signalled in the Transport header MUST be 11687 avoided. A client detecting a collision prior to sending any RTP or 11688 RTCP messages SHALL also select a new SSRC. 11690 C.11. Future Additions 11692 It is the intention that any future protocol or profile regarding 11693 both for media delivery and lower transport should be easy to add to 11694 RTSP. This section provides the necessary steps that needs to be 11695 meet. 11697 The following things needs to be considered when adding a new 11698 protocol or profile for use with RTSP: 11700 o The protocol or profile needs to define a name tag representing 11701 it. This tag is required to be a ABNF "token" to be possible to 11702 use in the Transport header specification. 11704 o The useful combinations of protocol, profiles and lower layer 11705 transport for this extension needs to be defined. For each 11706 combination declare the necessary parameters to use in the 11707 Transport header. 11709 o For new media protocols the interaction with RTSP needs to be 11710 addressed. One important factor will be the media 11711 synchronization. May need new headers similar to RTP info to 11712 carry information. 11714 o Discuss congestion control for media, especially if transport 11715 without built in congestion control is used. 11717 See the IANA section (Section 22) for information how to register new 11718 attributes. 11720 Appendix D. Use of SDP for RTSP Session Descriptions 11722 The Session Description Protocol (SDP, [RFC4566]) may be used to 11723 describe streams or presentations in RTSP. This description is 11724 typically returned in reply to a DESCRIBE request on an URI from a 11725 server to a client, or received via HTTP from a server to a client. 11727 This appendix describes how an SDP file determines the operation of 11728 an RTSP session. SDP as is provides no mechanism by which a client 11729 can distinguish, without human guidance, between several media 11730 streams to be rendered simultaneously and a set of alternatives 11731 (e.g., two audio streams spoken in different languages). The SDP 11732 extension "Grouping of Media Lines in the Session Description 11733 Protocol (SDP)" [RFC5888] provides such functionality to some degree. 11734 Appendix D.4 describes the usage of SDP media line grouping for RTSP. 11736 D.1. Definitions 11738 The terms "session-level", "media-level" and other key/attribute 11739 names and values used in this appendix are to be used as defined in 11740 SDP[RFC4566]: 11742 D.1.1. Control URI 11744 The "a=control:" attribute is used to convey the control URI. This 11745 attribute is used both for the session and media descriptions. If 11746 used for individual media, it indicates the URI to be used for 11747 controlling that particular media stream. If found at the session 11748 level, the attribute indicates the URI for aggregate control 11749 (presentation URI). The session level URI MUST be different from any 11750 media level URI. The presence of a session level control attribute 11751 MUST be interpreted as support for aggregated control. The control 11752 attribute MUST be present on media level unless the presentation only 11753 contains a single media stream, in which case the attribute MAY only 11754 be present on the session level and then also apply to that single 11755 media level. 11757 ABNF for the attribute is defined in Section 20.3. 11759 Example: 11760 a=control:rtsp://example.com/foo 11762 This attribute MAY contain either relative or absolute URIs, 11763 following the rules and conventions set out in RFC 3986 [RFC3986]. 11764 Implementations MUST look for a base URI in the following order: 11766 1. the RTSP Content-Base field; 11767 2. the RTSP Content-Location field; 11769 3. the RTSP Request-URI. 11771 If this attribute contains only an asterisk (*), then the URI MUST be 11772 treated as if it were an empty embedded URI, and thus inherit the 11773 entire base URI. 11775 Note, RFC 2326 was very unclear on the processing of relative URI 11776 and several RTSP 1.0 implementations at the point of publishing 11777 this document did not perform RFC 3986 processing to determine the 11778 resulting URI, instead simple concatenation is common. To avoid 11779 this issue completely it is recommended to use absolute URI in the 11780 SDP. 11782 The URI handling for SDPs from container files need special 11783 consideration. For example lets assume that a container file has the 11784 URI: "rtsp://example.com/container.mp4". Lets further assume this 11785 URI is the base URI, and that there is a absolute media level URI: 11786 "rtsp://example.com/container.mp4/trackID=2". A relative media level 11787 URI that resolves in accordance with RFC 3986 [RFC3986] to the above 11788 given media URI is: "container.mp4/trackID=2". It is usually not 11789 desirable to need to include in or modify the SDP stored within the 11790 container file with the server local name of the container file. To 11791 avoid this, one can modify the base URI used to include a trailing 11792 slash, e.g. "rtsp://example.com/container.mp4/". In this case the 11793 relative URI for the media will only need to be: "trackID=2". 11794 However, this will also mean that using "*" in the SDP will result in 11795 control URI including the trailing slash, i.e. 11796 "rtsp://example.com/container.mp4/". 11798 Note: The usage of TrackID in the above is not an standardized 11799 form, but one example out of several similar strings such as 11800 TrackID, Track_ID, StreamID that is used by different server 11801 vendors to indicate a particular piece of media inside a container 11802 file. 11804 D.1.2. Media Streams 11806 The "m=" field is used to enumerate the streams. It is expected that 11807 all the specified streams will be rendered with appropriate 11808 synchronization. If the session is over multicast, the port number 11809 indicated SHOULD be used for reception. The client MAY try to 11810 override the destination port, through the Transport header. The 11811 servers MAY allow this, the response will indicate if allowed or not. 11812 If the session is unicast, the port numbers are the ones RECOMMENDED 11813 by the server to the client, about which receiver ports to use; the 11814 client MUST still include its receiver ports in its SETUP request. 11816 The client MAY ignore this recommendation. If the server has no 11817 preference, it SHOULD set the port number value to zero. 11819 The "m=" lines contain information about which transport protocol, 11820 profile, and possibly lower-layer is to be used for the media stream. 11821 The combination of transport, profile and lower layer, like RTP/AVP/ 11822 UDP needs to be defined for how to be used with RTSP. The currently 11823 defined combinations are defined in Appendix C, further combinations 11824 MAY be specified. 11826 Example: 11827 m=audio 0 RTP/AVP 31 11829 D.1.3. Payload Type(s) 11831 The payload type(s) are specified in the "m=" line. In case the 11832 payload type is a static payload type from RFC 3551 [RFC3551], no 11833 other information may be required. In case it is a dynamic payload 11834 type, the media attribute "rtpmap" is used to specify what the media 11835 is. The "encoding name" within the "rtpmap" attribute may be one of 11836 those specified in RFC 3551 (Sections 5 and 6), or an MIME type 11837 registered with IANA, or an experimental encoding as specified in SDP 11838 (RFC 4566 [RFC4566]). Codec-specific parameters are not specified in 11839 this field, but rather in the "fmtp" attribute described below. 11841 The selection of the RTP payload type numbers used may be required to 11842 consider RTP and RTCP Multiplexing [RFC5761] if that is to be 11843 supported by the server. 11845 D.1.4. Format-Specific Parameters 11847 Format-specific parameters are conveyed using the "fmtp" media 11848 attribute. The syntax of the "fmtp" attribute is specific to the 11849 encoding(s) that the attribute refers to. Note that some of the 11850 format specific parameters may be specified outside of the fmtp 11851 parameters, like for example the "ptime" attribute for most audio 11852 encodings. 11854 D.1.5. Directionality of media stream 11856 The SDP attributes "a=sendrecv", "a=recvonly" and "a=sendonly" 11857 provides instructions on which direction the media streams flow 11858 within a session. When using RTSP the SDP can be delivered to a 11859 client using either RTSP DESCRIBE or a number of RTSP external 11860 methods, like HTTP, FTP, and email. Based on this the SDP applies to 11861 how the RTSP client will see the complete session. Thus for media 11862 streams delivered from the RTSP server to the client would be given 11863 the "a=recvonly" attribute. 11865 The direction attributes are not commonly used in SDPs for RTSP, but 11866 may occur. "a=recvonly" in a SDP provided to the RTSP client MUST 11867 indicate that media delivery will only occur in the direction from 11868 the RTSP server to the client. In SDP provided to the RTSP client 11869 that lacks any of the directionality attributes (a=recvonly, 11870 a=sendonly, a=sendrecv) MUST behave as if the "a=recvonly" attribute 11871 was received. Note that this overrules the normal default rule 11872 defined in SDP[RFC4566]. The usage of "a=sendonly" or "a=sendrecv" 11873 is not defined, nor is the interpretation of SDP by other entities 11874 than the RTSP client. 11876 D.1.6. Range of Presentation 11878 The "a=range" attribute defines the total time range of the stored 11879 session or an individual media. Non-seekable live sessions can be 11880 indicated as specified below, while the length of live sessions can 11881 be deduced from the "t" and "r" SDP parameters. 11883 The attribute is both a session and a media level attribute. For 11884 presentations that contains media streams of the same durations, the 11885 range attribute SHOULD only be used at session-level. In case of 11886 different length the range attribute MUST be given at media level for 11887 all media, and SHOULD NOT be given at session level. If the 11888 attribute is present at both media level and session level the media 11889 level values MUST be used. 11891 Note: Usually one will specify the same length for all media, even if 11892 there isn't media available for the full duration on all media. 11893 However, that requires that the server accepts PLAY requests within 11894 that range. 11896 Servers MUST take care to provide RTSP Range (see Section 16.38) 11897 values that are consistent with what is presented in the SDP for the 11898 content. There is no reason for non dynamic content, like media 11899 clips provided on demand to have inconsistent values. Inconsistent 11900 values between the SDP and the actual values for the content handled 11901 by the server is likely to generate some failure, like 457 "Invalid 11902 Range", in case the client uses PLAY requests with a Range header. 11903 In case the content is dynamic in length and it is infeasible to 11904 provide a correct value in the SDP the server is recommended to 11905 describe this as non-seekable content (see below). The server MAY 11906 override that property in the response to a PLAY request using the 11907 correct values in the Range header. 11909 The unit is specified first, followed by the value range. The units 11910 and their values are as defined in Section 4.4, Section 4.5 and 11911 Section 4.6 and MAY be extended with further formats. Any open ended 11912 range (start-), i.e. without stop range, is of unspecified duration 11913 and MUST be considered as non-seekable content unless this property 11914 is overridden. Multiple instances carrying different clock formats 11915 MAY be included at either session or media level. 11917 ABNF for the attribute is defined in Section 20.3. 11919 Examples: 11920 a=range:npt=0-34.4368 11921 a=range:clock=19971113T211503Z-19971113T220300Z 11922 Non seekable stream of unknown duration: 11923 a=range:npt=0- 11925 D.1.7. Time of Availability 11927 The "t=" field defines when the SDP is valid. For on-demand content 11928 the server SHOULD indicate a stop time value for which it guarantees 11929 the description to be valid, and a start time that is equal to or 11930 before the time at which the DESCRIBE request was received. It MAY 11931 also indicate start and stop times of 0, meaning that the session is 11932 always available. 11934 For sessions that are of live type, i.e. specific start time, unknown 11935 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 11936 to indicate the start time of the event. The stop time SHOULD be 11937 given so that the live event will have ended at that time, while 11938 still not be unnecessary long into the future. 11940 D.1.8. Connection Information 11942 In SDP, the "c=" field contains the destination address for the media 11943 stream. If a multicast address is specified the client SHOULD use 11944 this address in any SETUP request as destination address, including 11945 any additional parameters, such as TTL. For on-demand unicast 11946 streams and some multicast streams, the destination address MAY be 11947 specified by the client via the SETUP request, thus overriding any 11948 specified address. To identify streams without a fixed destination 11949 address, where the client is required to specify a destination 11950 address, the "c=" field SHOULD be set to a null value. For addresses 11951 of type "IP4", this value MUST be "0.0.0.0", and for type "IP6", this 11952 value MUST be "0:0:0:0:0:0:0:0" (can also be written as "::"), i.e. 11953 the unspecified address according to RFC 4291 [RFC4291]. 11955 D.1.9. Message Body Tag 11957 The optional "a=mtag" attribute identifies a version of the session 11958 description. It is opaque to the client. SETUP requests may include 11959 this identifier in the If-Match field (see Section 16.23) to only 11960 allow session establishment if this attribute value still corresponds 11961 to that of the current description. The attribute value is opaque 11962 and may contain any character allowed within SDP attribute values. 11964 ABNF for the attribute is defined in Section 20.3. 11966 Example: 11967 a=mtag:"158bb3e7c7fd62ce67f12b533f06b83a" 11969 One could argue that the "o=" field provides identical 11970 functionality. However, it does so in a manner that would put 11971 constraints on servers that need to support multiple session 11972 description types other than SDP for the same piece of media 11973 content. 11975 D.2. Aggregate Control Not Available 11977 If a presentation does not support aggregate control no session level 11978 "a=control:" attribute is specified. For a SDP with multiple media 11979 sections specified, each section will have its own control URI 11980 specified via the "a=control:" attribute. 11982 Example: 11983 v=0 11984 o=- 2890844256 2890842807 IN IP4 192.0.2.56 11985 s=I came from a web page 11986 e=adm@example.com 11987 c=IN IP4 0.0.0.0 11988 t=0 0 11989 m=video 8002 RTP/AVP 31 11990 a=control:rtsp://audio.example.com/movie.aud 11991 m=audio 8004 RTP/AVP 3 11992 a=control:rtsp://video.example.com/movie.vid 11994 Note that the position of the control URI in the description implies 11995 that the client establishes separate RTSP control sessions to the 11996 servers audio.example.com and video.example.com. 11998 It is recommended that an SDP file contains the complete media 11999 initialization information even if it is delivered to the media 12000 client through non-RTSP means. This is necessary as there is no 12001 mechanism to indicate that the client should request more detailed 12002 media stream information via DESCRIBE. 12004 D.3. Aggregate Control Available 12006 In this scenario, the server has multiple streams that can be 12007 controlled as a whole. In this case, there are both a media-level 12008 "a=control:" attributes, which are used to specify the stream URIs, 12009 and a session-level "a=control:" attribute which is used as the 12010 Request-URI for aggregate control. If the media-level URI is 12011 relative, it is resolved to absolute URIs according to Appendix D.1.1 12012 above. 12014 Example: 12015 C->M: DESCRIBE rtsp://example.com/movie RTSP/2.0 12016 CSeq: 1 12017 User-Agent: PhonyClient/1.2 12019 M->C: RTSP/2.0 200 OK 12020 CSeq: 1 12021 Date: Thu, 23 Jan 1997 15:35:06 GMT 12022 Expires: Thu, 23 Jan 1997 16:35:06 GMT 12023 Content-Type: application/sdp 12024 Content-Base: rtsp://example.com/movie/ 12025 Content-Length: 227 12027 v=0 12028 o=- 2890844256 2890842807 IN IP4 192.0.2.211 12029 s=I contain 12030 i= 12031 e=adm@example.com 12032 c=IN IP4 0.0.0.0 12033 a=control:* 12034 t=0 0 12035 m=video 8002 RTP/AVP 31 12036 a=control:trackID=1 12037 m=audio 8004 RTP/AVP 3 12038 a=control:trackID=2 12040 In this example, the client is recommended to establish a single RTSP 12041 session to the server, and uses the URIs 12042 rtsp://example.com/movie/trackID=1 and 12043 rtsp://example.com/movie/trackID=2 to set up the video and audio 12044 streams, respectively. The URI rtsp://example.com/movie/, which is 12045 resolved from the "*", controls the whole presentation (movie). 12047 A client is not required to issues SETUP requests for all streams 12048 within an aggregate object. Servers should allow the client to ask 12049 for only a subset of the streams. 12051 D.4. Grouping of Media Lines in SDP 12053 For some types media it is desirable to express a relationship 12054 between various media components, for instance, for lip 12055 synchronization or Scalable Video Codec (SVC) [RFC5583]. This 12056 relationship is expressed on the SDP level by grouping of media 12057 lines, as described in [RFC5888] and can be exposed to RTSP. 12059 For RTSP it is mainly important to know how to handle grouped medias 12060 received by means of SDP, i.e., if the media are under aggregate 12061 control (see Appendix D.3) or if aggregate control is not available 12062 (see Appendix D.2). 12064 It is RECOMMENDED that grouped medias are handled by aggregate 12065 control, to give the client the ability to control either the whole 12066 presentation or single medias. 12068 Editor's note: how should the dependencies in [RFC5583] be handled 12069 in RTSP? 12071 D.5. RTSP external SDP delivery 12073 There are some considerations that need to be made when the session 12074 description is delivered to the client outside of RTSP, for example 12075 via HTTP or email. 12077 First of all, the SDP needs to contain absolute URIs, since relative 12078 will in most cases not work as the delivery will not correctly 12079 forward the base URI. 12081 The writing of the SDP session availability information, i.e. "t=" 12082 and "r=", needs to be carefully considered. When the SDP is fetched 12083 by the DESCRIBE method, the probability that it is valid is very 12084 high. However, the same are much less certain for SDPs distributed 12085 using other methods. Therefore the publisher of the SDP should take 12086 care to follow the recommendations about availability in the SDP 12087 specification [RFC4566]. 12089 Appendix E. RTSP Use Cases 12091 This Appendix describes the most important and considered use cases 12092 for RTSP. They are listed in descending order of importance in 12093 regards to ensuring that all necessary functionality is present. 12094 This specification only fully supports usage of the two first. Also 12095 in these first two cases, there are special cases or exceptions that 12096 are not supported without extensions, e.g. the redirection of media 12097 delivery to another address than the controlling agent's (client's). 12099 E.1. On-demand Playback of Stored Content 12101 An RTSP capable server stores content suitable for being streamed to 12102 a client. A client desiring playback of any of the stored content 12103 uses RTSP to set up the media transport required to deliver the 12104 desired content. RTSP is then used to initiate, halt and manipulate 12105 the actual transmission (playout) of the content. RTSP is also 12106 required to provide necessary description and synchronization 12107 information for the content. 12109 The above high level description can be broken down into a number of 12110 functions that RTSP needs to be capable of. 12112 Presentation Description: Provide initialization information about 12113 the presentation (content); for example, which media codecs are 12114 needed for the content. Other information that is important 12115 includes the number of media stream the presentation contains, 12116 the transport protocols used for the media streams, and 12117 identifiers for these media streams. This information is 12118 required before setup of the content is possible and to 12119 determine if the client is even capable of using the content. 12121 This information need not be sent using RTSP; other external 12122 protocols can be used to transmit the transport presentation 12123 descriptions. Two good examples are the use of HTTP [RFC2616] 12124 or email to fetch or receive presentation descriptions like SDP 12125 [RFC4566] 12127 Setup: Set up some or all of the media streams in a presentation. 12128 The setup itself consist of selecting the protocol for media 12129 transport and the necessary parameters for the protocol, like 12130 addresses and ports. 12132 Control of Transmission: After the necessary media streams have been 12133 established the client can request the server to start 12134 transmitting the content. The client must be allowed to start 12135 or stop the transmission of the content at arbitrary times. 12136 The client must also be able to start the transmission at any 12137 point in the timeline of the presentation. 12139 Synchronization: For media transport protocols like RTP [RFC3550] it 12140 might be beneficial to carry synchronization information within 12141 RTSP. This may be due to either the lack of inter-media 12142 synchronization within the protocol itself, or the potential 12143 delay before the synchronization is established (which is the 12144 case for RTP when using RTCP). 12146 Termination: Terminate the established contexts. 12148 For this use case there are a number of assumptions about how it 12149 works. These are: 12151 On-Demand content: The content is stored at the server and can be 12152 accessed at any time during a time period when it is intended 12153 to be available. 12155 Independent sessions: A server is capable of serving a number of 12156 clients simultaneously, including from the same piece of 12157 content at different points in that presentations time-line. 12159 Unicast Transport: Content for each individual client is transmitted 12160 to them using unicast traffic. 12162 It is also possible to redirect the media traffic to a different 12163 destination than that of the agent controlling the traffic. However, 12164 allowing this without appropriate mechanisms for checking that the 12165 destination approves of this allows for distributed denial of service 12166 attacks (DDoS). 12168 E.2. Unicast Distribution of Live Content 12170 This use case is similar to the above on-demand content case (see 12171 Appendix E.1) the difference is the nature of the content itself. 12172 Live content is continuously distributed as it becomes available from 12173 a source; i.e., the main difference from on-demand is that one starts 12174 distributing content before the end of it has become available to the 12175 server. 12177 In many cases the consumer of live content is only interested in 12178 consuming what is actually happens "now"; i.e., very similar to 12179 broadcast TV. However, in this case it is assumed that there exist 12180 no broadcast or multicast channel to the users, and instead the 12181 server functions as a distribution node, sending the same content to 12182 multiple receivers, using unicast traffic between server and client. 12183 This unicast traffic and the transport parameters are individually 12184 negotiated for each receiving client. 12186 Another aspect of live content is that it often has a very limited 12187 time of availability, as it is only is available for the duration of 12188 the event the content covers. An example of such a live content 12189 could be a music concert which lasts 2 hour and starts at a 12190 predetermined time. Thus there is need to announce when and for how 12191 long the live content is available. 12193 In some cases, the server providing live content may be saving some 12194 or all of the content to allow clients to pause the stream and resume 12195 it from the paused point, or to "rewind" and play continuously from a 12196 point earlier than the live point. Hence, this use case does not 12197 necessarily exclude playing from other than the live point of the 12198 stream, playing with scales other than 1.0, etc. 12200 E.3. On-demand Playback using Multicast 12202 It is possible to use RTSP to request that media be delivered to a 12203 multicast group. The entity setting up the session (the controller) 12204 will then control when and what media is delivered to the group. 12205 This use case has some potential for denial of service attacks by 12206 flooding a multicast group. Therefore, a mechanism is needed to 12207 indicate that the group actually accepts the traffic from the RTSP 12208 server. 12210 An open issue in this use case is how one ensures that all receivers 12211 listening to the multicast or broadcast receives the session 12212 presentation configuring the receivers. This specification has to 12213 rely on a external solution to solve this issue. 12215 E.4. Inviting an RTSP server into a conference 12217 If one has an established conference or group session, it is possible 12218 to have an RTSP server distribute media to the whole group. 12219 Transmission to the group is simplest when controlled by a single 12220 participant or leader of the conference. Shared control might be 12221 possible, but would require further investigation and possibly 12222 extensions. 12224 This use case assumes that there exists either multicast or a 12225 conference focus that redistribute media to all participants. 12227 This use case is intended to be able to handle the following 12228 scenario: A conference leader or participant (hereafter called the 12229 controller) has some pre-stored content on an RTSP server that he 12230 wants to share with the group. The controller sets up an RTSP 12231 session at the streaming server for this content and retrieves the 12232 session description for the content. The destination for the media 12233 content is set to the shared multicast group or conference focus. 12235 When desired by the controller, he/she can start and stop the 12236 transmission of the media to the conference group. 12238 There are several issues with this use case that are not solved by 12239 this core specification for RTSP: 12241 Denial of service: To avoid an RTSP server from being an unknowing 12242 participant in a denial of service attack the server needs to 12243 be able to verify the destination's acceptance of the media. 12244 Such a mechanism to verify the approval of received media does 12245 not yet exist; instead, only policies can be used, which can be 12246 made to work in controlled environments. 12248 Distributing the presentation description to all participants in the 12249 group: To enable a media receiver to correctly decode the content 12250 the media configuration information needs to be distributed 12251 reliably to all participants. This will most likely require 12252 support from an external protocol. 12254 Passing control of the session: If it is desired to pass control of 12255 the RTSP session between the participants, some support will be 12256 required by an external protocol to exchange state information 12257 and possibly floor control of who is controlling the RTSP 12258 session. 12260 If there interest in this use case, further work is required on the 12261 necessary extensions. 12263 E.5. Live Content using Multicast 12265 This use case in its simplest form does not require any use of RTSP 12266 at all; this is what multicast conferences being announced with SAP 12267 [RFC2974] and SDP are intended to handle. However, in use cases 12268 where more advanced features like access control to the multicast 12269 session are desired, RTSP could be used for session establishment. 12271 A client desiring to join a live multicasted media session with 12272 cryptographic (encryption) access control could use RTSP in the 12273 following way. The source of the session announces the session and 12274 gives all interested an RTSP URI. The client connects to the server 12275 and requests the presentation description, allowing configuration for 12276 reception of the media. In this step it is possible for the client 12277 to use secured transport and any desired level of authentication; for 12278 example, for billing or access control. An RTSP link also allows for 12279 load balancing between multiple servers. 12281 If these were the only goals, they could be achieved by simply using 12282 HTTP. However, for cases where the sender likes to keep track of 12283 each individual receiver of a session, and possibly use the session 12284 as a side channel for distributing key-updates or other information 12285 on a per-receiver basis, and the full set of receivers is not know 12286 prior to the session start, the state establishment that RTSP 12287 provides can be beneficial. In this case a client would establish an 12288 RTSP session for this multicast group with the RTSP server. The RTSP 12289 server will not transmit any media, but instead will point to the 12290 multicast group. The client and server will be able to keep the 12291 session alive for as long as the receiver participates in the session 12292 thus enabling, for example, the server to push updates to the client. 12294 This use case will most likely not be able to be implemented without 12295 some extensions to the server-to-client push mechanism. Here the 12296 PLAY_NOTIFY method (see Section 13.5) with a suitable extension could 12297 provide clear benefits. 12299 Appendix F. Text format for Parameters 12301 A resource of type "text/parameters" consists of either 1) a list of 12302 parameters (for a query) or 2) a list of parameters and associated 12303 values (for an response or setting of the parameter). Each entry of 12304 the list is a single line of text. Parameters are separated from 12305 values by a colon. The parameter name MUST only use US-ASCII visible 12306 characters while the values are UTF-8 text strings. The media type 12307 registration form is in Section 22.16. 12309 There exist a potential interoperability issue for this format. It 12310 was named in RFC 2326 but never defined, even if used in examples 12311 that hint at the syntax. This format matches the purpose and its 12312 syntax supports the examples provided. However, it goes further by 12313 allowing UTF-8 in the value part, thus usage of UTF-8 strings may not 12314 be supported. However, as individual parameters are not defined, the 12315 using application anyway needs to have out-of-band agreement or using 12316 feature-tag to determine if the end-point supports the parameters. 12318 The ABNF [RFC5234] grammar for "text/parameters" content is: 12320 file = *((parameter / parameter-value) CRLF) 12321 parameter = 1*visible-except-colon 12322 parameter-value = parameter *WSP ":" value 12323 visible-except-colon = %x21-39 / %x3B-7E ; VCHAR - ":" 12324 value = *(TEXT-UTF8char / WSP) 12325 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 12326 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 12327 / %xE0-EF 2UTF8-CONT 12328 / %xF0-F7 3UTF8-CONT 12329 / %xF8-FB 4UTF8-CONT 12330 / %xFC-FD 5UTF8-CONT 12331 UTF8-CONT = %x80-BF 12332 WSP = ; Space or HTAB 12333 VCHAR = 12334 CRLF = 12336 Appendix G. Requirements for Unreliable Transport of RTSP 12338 This section provides anyone intending to define how to transport of 12339 RTSP messages over a unreliable transport protocol with some 12340 information learned by the attempt in RFC 2326 [RFC2326]. RFC 2326 12341 define both an URI scheme and some basic functionality for transport 12342 of RTSP messages over UDP, however, it was not sufficient for 12343 reliable usage and successful interoperability. 12345 The RTSP scheme defined for unreliable transport of RTSP messages was 12346 "rtspu". It has been reserved by this specification as at least one 12347 commercial implementation exist, thus avoiding any collisions in the 12348 name space. 12350 The following considerations should exist for operation of RTSP over 12351 an unreliable transport protocol: 12353 o Request shall be acknowledged by the receiver. If there is no 12354 acknowledgement, the sender may resend the same message after a 12355 timeout of one round-trip time (RTT). Any retransmissions due to 12356 lack of acknowledgement must carry the same sequence number as the 12357 original request. 12359 o The round-trip time can be estimated as in TCP (RFC 1123) 12360 [RFC1123], with an initial round-trip value of 500 ms. An 12361 implementation may cache the last RTT measurement as the initial 12362 value for future connections. 12364 o If RTSP is used over a small-RTT LAN, standard procedures for 12365 optimizing initial TCP round trip estimates, such as those used in 12366 T/TCP (RFC 1644) [RFC1644], can be beneficial. 12368 o The Timestamp header (Section 16.51) is used to avoid the 12369 retransmission ambiguity problem [Stevens98]. 12371 o The registered default port for RTSP over UDP for the server is 12372 554. 12374 o RTSP messages can be carried over any lower-layer transport 12375 protocol that is 8-bit clean. 12377 o RTSP messages are vulnerable to bit errors and should not be 12378 subjected to them. 12380 o Source authentication, or at least validation that RTSP messages 12381 comes from the same entity becomes extremely important, as session 12382 hijacking may be substantially easier for RTSP message transport 12383 using an unreliable protocol like UDP than for TCP. 12385 There exist two RTSP headers thats primarily are intended for being 12386 used by the unreliable handling of RTSP messages and which will be 12387 maintained: 12389 o CSeq: See Section 16.19 12391 o Timestamp: See Section 16.51 12393 Appendix H. Backwards Compatibility Considerations 12395 This section contains notes on issues about backwards compatibility 12396 with clients or servers being implemented according to RFC 2326 12397 [RFC2326]. Note that there exists no requirement to implement RTSP 12398 1.0, in fact we recommend against it as it is difficult to do in an 12399 interoperable way. 12401 A server implementing RTSP/2.0 MUST include a RTSP-Version of 12402 RTSP/2.0 in all responses to requests containing RTSP-Version 12403 RTSP/2.0. If a server receives a RTSP/1.0 request, it MAY respond 12404 with a RTSP/1.0 response if it chooses to support RFC 2326. If the 12405 server chooses not to support RFC 2326, it MUST respond with a 505 12406 (RTSP Version not supported) status code. A server MUST NOT respond 12407 to a RTSP-Version RTSP/1.0 request with a RTSP-Version RTSP/2.0 12408 response. 12410 Clients implementing RTSP/2.0 MAY use an OPTIONS request with a RTSP- 12411 Version of 2.0 to determine whether a server supports RTSP/2.0. If 12412 the server responds with either a RTSP-Version of 1.0 or a status 12413 code of 505 (RTSP Version not supported), the client will have to use 12414 RTSP/1.0 requests if it chooses to support RFC 2326. 12416 H.1. Play Request in Play State 12418 The behavior in the server when a Play is received in Play state has 12419 changed (Section 13.4). In RFC 2326, the new PLAY request would be 12420 queued until the current Play completed. Any new PLAY request now 12421 take effect immediately replacing the previous request. 12423 H.2. Using Persistent Connections 12425 Some server implementations of RFC 2326 maintain a one-to-one 12426 relationship between a connection and an RTSP session. Such 12427 implementations require clients to use a persistent connection to 12428 communicate with the server and when a client closes its connection, 12429 the server may remove the RTSP session. This is worth noting if a 12430 RTSP 2.0 client also supporting 1.0 connects to a 1.0 server. 12432 Appendix I. Open Issues 12434 Open issues are filed and tracked in the bug and feature trackers at 12435 http://rtspspec.sourceforge.net. Open issues are discussed on MMUSIC 12436 list (mmusic@ietf.org). 12438 Note to RFC-editor: Please remove this section before publication of 12439 this document as an RFC. 12441 Appendix J. Changes 12443 This appendix briefly lists the differences between RTSP 1.0 12444 [RFC2326] and RTSP 2.0 for an informational purpose. For 12445 implementers of RTSP 2.0 it is recommended to read carefully through 12446 this memo and not to rely on the list of changes below to adapt from 12447 RTSP 1.0 to RTSP 2.0, as RTSP 2.0 is not intended to be backwards 12448 compatible with RTSP 1.0 [RFC2326] other than the version negotiation 12449 mechanism. 12451 J.1. Brief Overview 12453 The following protocol elements were removed in RTSP 2.0 compared to 12454 RTSP 1.0: 12456 o there is no section on minimal implementation anymore, but more 12457 the definition of RTSP 2.0 core; 12459 o the RECORD and ANNOUNCE methods and all related functionality 12460 (including 201 (Created) and 250 (Low On Storage Space) status 12461 codes); 12463 o the use of UDP for RTSP message transport was removed due to 12464 missing interest and to broken specification; 12466 o the use of PLAY method for keep-alive in Play state. 12468 The following protocol elements were added or changed in RTSP 2.0 12469 compared to RTSP 1.0: 12471 o RTSP session TEARDOWN from the server to the client; 12473 o IPv6 support; 12475 o extended IANA registries (e.g., transport headers parameters, 12476 transport-protocol, profile, lower-transport, and mode); 12478 o request pipelining for quick session start-up; 12480 o fully reworked state-machine; 12482 o RTSP messages now uses URIs rather then URLs; 12484 o incorporated much of related HTTP text ([RFC2616]) in this memo, 12485 compared to just referencing the sections in HTTP, to avoid 12486 ambiguities; 12488 o the REDIRECT method was expanded and diversified for different 12489 situations; 12491 o Includes a new section about how to setup different media 12492 transport alternatives and their profiles, and lower layer 12493 protocols. This resulted that the appendix on RTP interaction was 12494 moved there instead in the part describing RTP. The section also 12495 includes guidelines what to consider when writing usage guidelines 12496 for new protocols and profiles; 12498 o added an asynchronous notification method PLAY_NOTIFY. This 12499 method is used by the RTSP server to asynchronously notify clients 12500 about session changes while in Play state. To a limited extend 12501 this is comparable with some implementations of ANNOUNCE in RTSP 12502 1.0 not intended for Recording. 12504 J.2. Detailed List of Changes 12506 Compared to RTSP 1.0 (RFC 2326), the below changes has been made when 12507 defining RTSP 2.0. Note that this list does not reflect minor 12508 changes in wording or correction of typographical errors. 12510 o The section on minimal implementation was deleted without 12511 substitution. 12513 o The Transport header has been changed in the following way: 12515 * The ABNF has been changed to define that extensions are 12516 possible, and that unknown parameters results in that servers 12517 ignore the transport specification. 12519 * To prevent backwards compatibility issues, any extension or new 12520 parameter requires the usage of a feature-tag combined with the 12521 Require header. 12523 * Syntax unclarities with the Mode parameter has been resolved. 12525 * Syntax error with ";" for multicast and unicast has been 12526 resolved. 12528 * Two new addressing parameters has been defined, src_addr and 12529 dest_addr. These replaces the parameters "port", 12530 "client_port", "server_port", "destination", "source". 12532 * Support for IPv6 explicit addresses in all address fields has 12533 been included. 12535 * To handle URI definitions that contain ";" or "," a quoted URI 12536 format has been introduced and is required. 12538 * Defined IANA registries for the transport headers parameters, 12539 transport-protocol, profile, lower-transport, and mode. 12541 * The transport headers interleaved parameter's text was made 12542 more strict and use formal requirements levels. It was also 12543 clarified that the interleaved channels are symmetric and that 12544 it is the server that sets the channel numbers. 12546 * It has been clarified that the client can't request of the 12547 server to use a certain RTP SSRC, using a request with the 12548 transport parameter SSRC. 12550 * Syntax definition for SSRC has been clarified to require 8HEX. 12551 It has also been extended to allow multiple values for clients 12552 supporting this version. 12554 * Clarified the text on the transport headers "dest_addr" 12555 parameters regarding what security precautions the server is 12556 required to perform. 12558 o The Range formats has been changed in the following way: 12560 * The NPT format has been given a initial NPT identifier that 12561 must now be used. 12563 * All formats now support initial open ended formats of type 12564 "npt=-10" and also format only "Range: smpte" ranges for usage 12565 with GET_PARAMETER requests. 12567 o RTSP message handling has been changed in the following way: 12569 * RTSP messages now uses URIs rather then URLs. 12571 * It has been clarified that a 4xx message due to missing CSeq 12572 header shall be returned without a CSeq header. 12574 * The 300 (Multiple Choices) response code has been removed. 12576 * Rules for how to handle timing out RTSP messages has been 12577 added. 12579 * Extended Pipelining rules allowing for quick session startup. 12581 o The HTTP references has been updated to RFC 2616 and RFC 2617. 12582 Most of text has been copied and then altered to fit RTSP into 12583 this specification. Public, and the Content-Base header has also 12584 been imported from RFC 2068 so that they are defined in the RTSP 12585 specification. Known effects on RTSP due to HTTP clarifications: 12587 * Content-Encoding header can include encoding of type 12588 "identity". 12590 o The state machine section has completely been rewritten. It 12591 includes now more details and are also more clear about the model 12592 used. 12594 o A IANA section has been included with contains a number of 12595 registries and their rules. This will allow us to use IANA to 12596 keep track of RTSP extensions. 12598 o The transport of RTSP messages has seen the following changes: 12600 * The use of UDP for RTSP message transport has been deprecated 12601 due to missing interest and to broken specification. 12603 * The rules for how TCP connections is to be handled has been 12604 clarified. Now it is made clear that servers should not close 12605 the TCP connection unless they have been unused for significant 12606 time. 12608 * Strong recommendations why server and clients should use 12609 persistent connections has also been added. 12611 * There is now a requirement on the servers to handle non- 12612 persistent connections as this provides fault tolerance. 12614 * Added wording on the usage of Connection:Close for RTSP. 12616 * specified usage of TLS for RTSP messages, including a scheme to 12617 approve a proxies TLS connection to the next hop. 12619 o The following header related changes have been made: 12621 * Accept-Ranges response header is added. This header clarifies 12622 which range formats that can be used for a resource. 12624 * Fixed the missing definitions for the Cache-Control header. 12625 Also added to the syntax definition the missing delta-seconds 12626 for max-stale and min-fresh parameters. 12628 * Put requirement on CSeq header that the value is increased by 12629 one for each new RTSP request. A Recommendation to start at 0 12630 has also been added. 12632 * Added requirement that the Date header must be used for all 12633 messages with message body and the Server should always include 12634 it. 12636 * Removed possibility of using Range header with Scale header to 12637 indicate when it is to be activated, since it can't work as 12638 defined. Also added rule that lack of Scale header in response 12639 indicates lack of support for the header. Feature-tags for 12640 scaled playback has been defined. 12642 * The Speed header must now be responded to indicate support and 12643 the actual speed going to be used. A feature-tag is defined. 12644 Notes on congestion control was also added. 12646 * The Supported header was borrowed from SIP [RFC3261] to help 12647 with the feature negotiation in RTSP. 12649 * Clarified that the Timestamp header can be used to resolve 12650 retransmission ambiguities. 12652 * The Session header text has been expanded with a explanation on 12653 keep alive and which methods to use. SET_PARAMETER is now 12654 recommended to use if only keep-alive within RTSP is desired. 12656 * It has been clarified how the Range header formats is used to 12657 indicate pause points in the PAUSE response. 12659 * Clarified that RTP-Info URIs that are relative, use the 12660 Request-URI as base URI. Also clarified that the used URI must 12661 be the one that was used in the SETUP request. The URIs are 12662 now also required to be quoted. The header also expresses the 12663 SSRC for the provided RTP timestamp and sequence number values. 12665 * Added text that requires the Range to always be present in PLAY 12666 responses. Clarified what should be sent in case of live 12667 streams. 12669 * The headers table has been updated using a structured borrowed 12670 from SIP. Those tables carries much more information and 12671 should provide a good overview of the available headers. 12673 * It has been clarified that any message with a message body is 12674 required to have a Content-Length header. This was the case in 12675 RFC 2326, but could be misinterpreted. 12677 * ETag has changed name to MTag. 12679 * To resolve functionality around MTag. The MTag and If-None- 12680 Match header has been added from HTTP with necessary 12681 clarification in regards to RTSP operation. 12683 * Imported the Public header from HTTP RFC 2068 [RFC2068] since 12684 it has been removed from HTTP due to lack of use. Public is 12685 used quite frequently in RTSP. 12687 * Clarified rules for populating the Public header so that it is 12688 an intersection of the capabilities of all the RTSP agents in a 12689 chain. 12691 * Added the Media-Range header for listing the current 12692 availability of the media range. 12694 * Added the Notify-Reason header for giving the reason when 12695 sending PLAY_NOTIFY requests. 12697 * A new header Seek-Style has been defined to direct and inform 12698 how any seek operation should/have been performed. 12700 o The Protocol Syntax has been changed in the following way: 12702 * All ABNF definitions are updated according to the rules defined 12703 in RFC 5234 [RFC5234] and has been gathered in a separate 12704 Section 20. 12706 * The ABNF for the User-Agent and Server headers has been 12707 corrected. 12709 * Some definitions in the introduction regarding the RTSP session 12710 has been changed. 12712 * The protocol has been made fully IPv6 capable. 12714 * Added a fragment part to the RTSP URI. This seem to be 12715 indicated by the note below the definition, however, it was not 12716 part of the ABNF. 12718 * The CHAR rule has been changed to exclude NULL. 12720 o The Status codes have been changed in the following way: 12722 * The use of status code 303 "See Other" has been deprecated as 12723 it does not make sense to use in RTSP. 12725 * When sending response 451 and 458 the response body should 12726 contain the offending parameters. 12728 * Clarification on when a 3rr redirect status code can be 12729 received has been added. This includes receiving 3rr as a 12730 result of request within a established session. This provides 12731 clarification to a previous unspecified behavior. 12733 * Removed the 201 (Created) and 250 (Low On Storage Space) status 12734 codes as they are only relevant to recording, which is 12735 deprecated. 12737 * Several new Status codes has been defined: 464 "Data Transport 12738 Not Ready Yet", 465 "Notification Reason Unknown", 470 12739 "Connection Authorization Required", 471 "Connection 12740 Credentials not accepted", 472 "Failure to establish secure 12741 connection". 12743 o The following functionality has been deprecated from the protocol: 12745 * The use of Queued Play. 12747 * The use of PLAY method for keep-alive in Play state. 12749 * The RECORD and ANNOUNCE methods and all related functionality. 12750 Some of the syntax has been removed. 12752 * The possibility to use timed execution of methods with the time 12753 parameter in the Range header. 12755 * The description on how rtspu works is not part of the core 12756 specification and will require external description. Only that 12757 it exist is defined here and some requirements for the 12758 transport is provided. 12760 o The following changes has been made in relation to methods: 12762 * The OPTIONS method has been clarified with regards to the use 12763 of the Public and Allow headers. 12765 * Added text clarifying the usage of SET_PARAMETER for keep-alive 12766 and usage without any body. 12768 * PLAY method is now allowed to be pipelined with the pipelining 12769 of one or more SETUP requests following the initial that 12770 generates the session for aggregated control. 12772 * REDIRECT has been expanded and diversified for different 12773 situations. 12775 * Added a new method PLAY_NOTIFY. This method is used by the 12776 RTSP server to asynchronously notify clients about session 12777 changes. 12779 o Wrote a new section about how to setup different media transport 12780 alternatives and their profiles, and lower layer protocols. This 12781 resulted that the appendix on RTP interaction was moved there 12782 instead in the part describing RTP. The section also includes 12783 guidelines what to consider when writing usage guidelines for new 12784 protocols and profiles. 12786 o Setup and usage of independent TCP connections for transport of 12787 RTP has been specified. 12789 o Added a new section describing the available mechanisms to 12790 determine if functionality is supported, called "Capability 12791 Handling". Renamed option-tags to feature-tags. 12793 o Added a contributors section with people who have contributed 12794 actual text to the specification. 12796 o Added a section Use Cases that describes the major use cases for 12797 RTSP. 12799 o Clarified the usage of a=range and how to indicate live content 12800 that are not seekable with this header. 12802 o Text specifying the special behavior of PLAY for live content. 12804 Appendix K. Acknowledgements 12806 This memorandum defines RTSP version 2.0 which is a revision of the 12807 Proposed Standard RTSP version 1.0 which is defined in [RFC2326]. 12808 The authors of RFC 2326 are Henning Schulzrinne, Anup Rao, and Robert 12809 Lanphier. 12811 Both RTSP version 1.0 and RTSP version 2.0 borrow format and 12812 descriptions from HTTP/1.1. 12814 This document has benefited greatly from the comments of all those 12815 participating in the MMUSIC-WG. In addition to those already 12816 mentioned, the following individuals have contributed to this 12817 specification: 12819 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 12820 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 12821 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 12822 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 12823 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Ingemar Johansson, 12824 Anders Klemets, Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo 12825 F. Llach, Thomas Marshall, Rob McCool, David Oran, Joerg Ott, Maria 12826 Papadopouli, Sujal Patel, Ema Patki, Alagu Periyannan, Colin Perkins, 12827 Igor Plotnikov, Jonathan Sergent, Pinaki Shah, David Singer, Lior 12828 Sion, Jeff Smith, Alexander Sokolsky, Dale Stammen, John Francis 12829 Stracke, Maureen Chesire, David Walker, Geetha Srikantan, Stephan 12830 Wenger, Pekka Pessi, Jae-Hwan Kim, Holger Schmidt, Stephen Farrell, 12831 Xavier Marjou, Joe Pallas, Martti Mela, Byungjo Yoon and Patrick 12832 Hoffman, Jinhang Choi. 12834 K.1. Contributors 12836 The following people have made written contributions that were 12837 included in the specification: 12839 o Tom Marshall contributed text on the usage of 3rr status codes. 12841 o Thomas Zheng contributed text on the usage of the Range in PLAY 12842 responses and proposed an earlier version of the PLAY_NOTIFY 12843 method. 12845 o Sean Sheedy contributed text on the timeout behavior of RTSP 12846 messages and connections, the 463 status code, and proposed an 12847 earlier version of the PLAY_NOTIFY method. 12849 o Greg Sherwood proposed an earlier version of the PLAY_NOTIFY 12850 method. 12852 o Fredrik Lindholm contributed text about the RTSP security 12853 framework. 12855 o John Lazzaro contributed the text for RTP over Independent TCP. 12857 o Aravind Narasimhan contributed by rewriting Media Transport 12858 Alternatives (Appendix C) and editorial improvements on a number 12859 of places in the specification. 12861 o Torbjorn Einarsson has done some editorial approvements of the 12862 text. 12864 Appendix L. RFC Editor Consideration 12866 Please replace RFC XXXX with the RFC number this specification 12867 receives. 12869 Authors' Addresses 12871 Henning Schulzrinne 12872 Columbia University 12873 1214 Amsterdam Avenue 12874 New York, NY 10027 12875 USA 12877 Email: schulzrinne@cs.columbia.edu 12879 Anup Rao 12880 Cisco 12881 USA 12883 Email: anrao@cisco.com 12885 Rob Lanphier 12886 Seattle, WA 12887 USA 12889 Email: robla@robla.net 12891 Magnus Westerlund 12892 Ericsson AB 12893 Faeroegatan 6 12894 STOCKHOLM, SE-164 80 12895 SWEDEN 12897 Email: magnus.westerlund@ericsson.com 12899 Martin Stiemerling 12900 NEC Laboratories Europe, NEC Europe Ltd. 12901 Kurfuersten-Anlage 36 12902 Heidelberg 69115 12903 Germany 12905 Phone: +49 (0) 6221 4342 113 12906 Email: martin.stiemerling@neclab.eu 12907 URI: http://ietf.stiemerling.org