idnits 2.17.1 draft-ietf-mmusic-rfc2326bis-24.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 (July 2, 2010) is 5046 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 4114, but not defined == Missing Reference: 'H15' is mentioned on line 8656, but not defined == Missing Reference: 'RFCXXXX' is mentioned on line 9093, but not defined == Missing Reference: 'CSeq' is mentioned on line 12168, but not defined == Missing Reference: 'Timestamp' is mentioned on line 12170, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. '3gpp-26234' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-pub-180-2' ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3851 (Obsoleted by RFC 5751) ** Obsolete normative reference: RFC 4288 (Obsoleted by RFC 6838) ** Obsolete normative reference: RFC 4395 (Obsoleted by RFC 7595) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-22) exists of draft-ietf-mmusic-rtsp-nat-09 -- Obsolete informational reference (is this intentional?): RFC 822 (Obsoleted by RFC 2822) -- Obsolete informational reference (is this intentional?): RFC 1305 (Obsoleted by RFC 5905) -- Obsolete informational reference (is this intentional?): RFC 1644 (Obsoleted by RFC 6247) -- Obsolete informational reference (is this intentional?): RFC 2068 (Obsoleted by RFC 2616) -- Obsolete informational reference (is this intentional?): RFC 2326 (Obsoleted by RFC 7826) -- Obsolete informational reference (is this intentional?): RFC 3388 (Obsoleted by RFC 5888) Summary: 10 errors (**), 0 flaws (~~), 9 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MMUSIC Working Group H. Schulzrinne 3 Internet-Draft Columbia University 4 Obsoletes: 2326 (if approved) A. Rao 5 Intended status: Standards Track Cisco 6 Expires: January 3, 2011 R. Lanphier 8 M. Westerlund 9 Ericsson AB 10 M. Stiemerling (Ed.) 11 NEC 12 July 2, 2010 14 Real Time Streaming Protocol 2.0 (RTSP) 15 draft-ietf-mmusic-rfc2326bis-24 17 Abstract 19 This memorandum defines RTSP version 2.0 which obsoletes RTSP version 20 1.0 which is defined in RFC 2326. 22 The Real Time Streaming Protocol, or RTSP, is an application-level 23 protocol for setup and control of the delivery of data with real-time 24 properties. RTSP provides an extensible framework to enable 25 controlled, on-demand delivery of real-time data, such as audio and 26 video. Sources of data can include both live data feeds and stored 27 clips. This protocol is intended to control multiple data delivery 28 sessions, provide a means for choosing delivery channels such as UDP, 29 multicast UDP and TCP, and provide a means for choosing delivery 30 mechanisms based upon RTP (RFC 3550). 32 Status of this Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at http://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on January 3, 2011. 49 Copyright Notice 51 Copyright (c) 2010 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (http://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 This document may contain material from IETF Documents or IETF 65 Contributions published or made publicly available before November 66 10, 2008. The person(s) controlling the copyright in some of this 67 material may not have granted the IETF Trust the right to allow 68 modifications of such material outside the IETF Standards Process. 69 Without obtaining an adequate license from the person(s) controlling 70 the copyright in such materials, this document may not be modified 71 outside the IETF Standards Process, and derivative works of it may 72 not be created outside the IETF Standards Process, except to format 73 it for publication as an RFC or to translate it into languages other 74 than English. 76 Table of Contents 78 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 11 79 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 13 80 2.1. Presentation Description . . . . . . . . . . . . . . . . 13 81 2.2. Session Establishment . . . . . . . . . . . . . . . . . 14 82 2.3. Media Delivery Control . . . . . . . . . . . . . . . . . 15 83 2.4. Session Parameter Manipulations . . . . . . . . . . . . 17 84 2.5. Media Delivery . . . . . . . . . . . . . . . . . . . . . 17 85 2.5.1. Media Delivery Manipulations . . . . . . . . . . . . 18 86 2.6. Session Maintenance and Termination . . . . . . . . . . 20 87 2.7. Extending RTSP . . . . . . . . . . . . . . . . . . . . . 21 88 3. Document Conventions . . . . . . . . . . . . . . . . . . . . 23 89 3.1. Notational Conventions . . . . . . . . . . . . . . . . . 23 90 3.2. Terminology . . . . . . . . . . . . . . . . . . . . . . 23 91 4. Protocol Parameters . . . . . . . . . . . . . . . . . . . . . 27 92 4.1. RTSP Version . . . . . . . . . . . . . . . . . . . . . . 27 93 4.2. RTSP IRI and URI . . . . . . . . . . . . . . . . . . . . 27 94 4.3. Session Identifiers . . . . . . . . . . . . . . . . . . 29 95 4.4. SMPTE Relative Timestamps . . . . . . . . . . . . . . . 29 96 4.5. Normal Play Time . . . . . . . . . . . . . . . . . . . . 30 97 4.6. Absolute Time . . . . . . . . . . . . . . . . . . . . . 31 98 4.7. Feature-Tags . . . . . . . . . . . . . . . . . . . . . . 31 99 4.8. Message Body Tags . . . . . . . . . . . . . . . . . . . 31 100 4.9. Media Properties . . . . . . . . . . . . . . . . . . . . 32 101 4.9.1. Random Access and Seeking . . . . . . . . . . . . . 33 102 4.9.2. Retention . . . . . . . . . . . . . . . . . . . . . 33 103 4.9.3. Content Modifications . . . . . . . . . . . . . . . 34 104 4.9.4. Supported Scale Factors . . . . . . . . . . . . . . 34 105 4.9.5. Mapping to the Attributes . . . . . . . . . . . . . 34 106 5. RTSP Message . . . . . . . . . . . . . . . . . . . . . . . . 35 107 5.1. Message Types . . . . . . . . . . . . . . . . . . . . . 35 108 5.2. Message Headers . . . . . . . . . . . . . . . . . . . . 35 109 5.3. Message Body . . . . . . . . . . . . . . . . . . . . . . 36 110 5.4. Message Length . . . . . . . . . . . . . . . . . . . . . 36 111 6. General Header Fields . . . . . . . . . . . . . . . . . . . . 38 112 7. Request . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 113 7.1. Request Line . . . . . . . . . . . . . . . . . . . . . . 39 114 7.2. Request Header Fields . . . . . . . . . . . . . . . . . 41 115 8. Response . . . . . . . . . . . . . . . . . . . . . . . . . . 43 116 8.1. Status-Line . . . . . . . . . . . . . . . . . . . . . . 43 117 8.1.1. Status Code and Reason Phrase . . . . . . . . . . . 43 118 8.2. Response Headers . . . . . . . . . . . . . . . . . . . . 46 119 9. Message Body . . . . . . . . . . . . . . . . . . . . . . . . 48 120 9.1. Message-Body Header Fields . . . . . . . . . . . . . . . 48 121 9.2. Message Body . . . . . . . . . . . . . . . . . . . . . . 49 122 10. Connections . . . . . . . . . . . . . . . . . . . . . . . . . 50 123 10.1. Reliability and Acknowledgements . . . . . . . . . . . . 50 124 10.2. Using Connections . . . . . . . . . . . . . . . . . . . 51 125 10.3. Closing Connections . . . . . . . . . . . . . . . . . . 53 126 10.4. Timing Out Connections and RTSP Messages . . . . . . . . 54 127 10.5. Showing Liveness . . . . . . . . . . . . . . . . . . . . 55 128 10.6. Use of IPv6 . . . . . . . . . . . . . . . . . . . . . . 56 129 11. Capability Handling . . . . . . . . . . . . . . . . . . . . . 57 130 12. Pipelining Support . . . . . . . . . . . . . . . . . . . . . 59 131 13. Method Definitions . . . . . . . . . . . . . . . . . . . . . 60 132 13.1. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . 61 133 13.2. DESCRIBE . . . . . . . . . . . . . . . . . . . . . . . . 62 134 13.3. SETUP . . . . . . . . . . . . . . . . . . . . . . . . . 64 135 13.3.1. Changing Transport Parameters . . . . . . . . . . . 67 136 13.4. PLAY . . . . . . . . . . . . . . . . . . . . . . . . . . 68 137 13.4.1. General Usage . . . . . . . . . . . . . . . . . . . 68 138 13.4.2. Aggregated Sessions . . . . . . . . . . . . . . . . 72 139 13.4.3. Updating current PLAY Requests . . . . . . . . . . . 73 140 13.4.4. Playing On-Demand Media . . . . . . . . . . . . . . 76 141 13.4.5. Playing Dynamic On-Demand Media . . . . . . . . . . 76 142 13.4.6. Playing Live Media . . . . . . . . . . . . . . . . . 76 143 13.4.7. Playing Live with Recording . . . . . . . . . . . . 77 144 13.4.8. Playing Live with Time-Shift . . . . . . . . . . . . 78 145 13.5. PLAY_NOTIFY . . . . . . . . . . . . . . . . . . . . . . 78 146 13.5.1. End-of-Stream . . . . . . . . . . . . . . . . . . . 79 147 13.5.2. Media-Properties-Update . . . . . . . . . . . . . . 80 148 13.5.3. Scale-Change . . . . . . . . . . . . . . . . . . . . 81 149 13.6. PAUSE . . . . . . . . . . . . . . . . . . . . . . . . . 83 150 13.7. TEARDOWN . . . . . . . . . . . . . . . . . . . . . . . . 85 151 13.7.1. Client to Server . . . . . . . . . . . . . . . . . . 85 152 13.7.2. Server to Client . . . . . . . . . . . . . . . . . . 86 153 13.8. GET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 87 154 13.9. SET_PARAMETER . . . . . . . . . . . . . . . . . . . . . 88 155 13.10. REDIRECT . . . . . . . . . . . . . . . . . . . . . . . . 90 156 14. Embedded (Interleaved) Binary Data . . . . . . . . . . . . . 93 157 15. Status Code Definitions . . . . . . . . . . . . . . . . . . . 95 158 15.1. Success 1xx . . . . . . . . . . . . . . . . . . . . . . 95 159 15.1.1. 100 Continue . . . . . . . . . . . . . . . . . . . . 95 160 15.2. Success 2xx . . . . . . . . . . . . . . . . . . . . . . 95 161 15.2.1. 200 OK . . . . . . . . . . . . . . . . . . . . . . . 95 162 15.3. Redirection 3xx . . . . . . . . . . . . . . . . . . . . 95 163 15.3.1. 301 Moved Permanently . . . . . . . . . . . . . . . 96 164 15.3.2. 302 Found . . . . . . . . . . . . . . . . . . . . . 96 165 15.3.3. 303 See Other . . . . . . . . . . . . . . . . . . . 96 166 15.3.4. 304 Not Modified . . . . . . . . . . . . . . . . . . 96 167 15.3.5. 305 Use Proxy . . . . . . . . . . . . . . . . . . . 97 168 15.4. Client Error 4xx . . . . . . . . . . . . . . . . . . . . 97 169 15.4.1. 400 Bad Request . . . . . . . . . . . . . . . . . . 97 170 15.4.2. 401 Unauthorized . . . . . . . . . . . . . . . . . . 97 171 15.4.3. 402 Payment Required . . . . . . . . . . . . . . . . 98 172 15.4.4. 403 Forbidden . . . . . . . . . . . . . . . . . . . 98 173 15.4.5. 404 Not Found . . . . . . . . . . . . . . . . . . . 98 174 15.4.6. 405 Method Not Allowed . . . . . . . . . . . . . . . 98 175 15.4.7. 406 Not Acceptable . . . . . . . . . . . . . . . . . 98 176 15.4.8. 407 Proxy Authentication Required . . . . . . . . . 99 177 15.4.9. 408 Request Timeout . . . . . . . . . . . . . . . . 99 178 15.4.10. 410 Gone . . . . . . . . . . . . . . . . . . . . . . 99 179 15.4.11. 411 Length Required . . . . . . . . . . . . . . . . 99 180 15.4.12. 412 Precondition Failed . . . . . . . . . . . . . . 100 181 15.4.13. 413 Request Message Body Too Large . . . . . . . . . 100 182 15.4.14. 414 Request-URI Too Long . . . . . . . . . . . . . . 100 183 15.4.15. 415 Unsupported Media Type . . . . . . . . . . . . . 100 184 15.4.16. 451 Parameter Not Understood . . . . . . . . . . . . 100 185 15.4.17. 452 reserved . . . . . . . . . . . . . . . . . . . . 100 186 15.4.18. 453 Not Enough Bandwidth . . . . . . . . . . . . . . 101 187 15.4.19. 454 Session Not Found . . . . . . . . . . . . . . . 101 188 15.4.20. 455 Method Not Valid in This State . . . . . . . . . 101 189 15.4.21. 456 Header Field Not Valid for Resource . . . . . . 101 190 15.4.22. 457 Invalid Range . . . . . . . . . . . . . . . . . 101 191 15.4.23. 458 Parameter Is Read-Only . . . . . . . . . . . . . 101 192 15.4.24. 459 Aggregate Operation Not Allowed . . . . . . . . 101 193 15.4.25. 460 Only Aggregate Operation Allowed . . . . . . . . 101 194 15.4.26. 461 Unsupported Transport . . . . . . . . . . . . . 102 195 15.4.27. 462 Destination Unreachable . . . . . . . . . . . . 102 196 15.4.28. 463 Destination Prohibited . . . . . . . . . . . . . 102 197 15.4.29. 464 Data Transport Not Ready Yet . . . . . . . . . . 102 198 15.4.30. 465 Notification Reason Unknown . . . . . . . . . . 102 199 15.4.31. 470 Connection Authorization Required . . . . . . . 102 200 15.4.32. 471 Connection Credentials not accepted . . . . . . 103 201 15.4.33. 472 Failure to establish secure connection . . . . . 103 202 15.5. Server Error 5xx . . . . . . . . . . . . . . . . . . . . 103 203 15.5.1. 500 Internal Server Error . . . . . . . . . . . . . 103 204 15.5.2. 501 Not Implemented . . . . . . . . . . . . . . . . 103 205 15.5.3. 502 Bad Gateway . . . . . . . . . . . . . . . . . . 103 206 15.5.4. 503 Service Unavailable . . . . . . . . . . . . . . 103 207 15.5.5. 504 Gateway Timeout . . . . . . . . . . . . . . . . 104 208 15.5.6. 505 RTSP Version Not Supported . . . . . . . . . . . 104 209 15.5.7. 551 Option not supported . . . . . . . . . . . . . . 104 210 16. Header Field Definitions . . . . . . . . . . . . . . . . . . 105 211 16.1. Accept . . . . . . . . . . . . . . . . . . . . . . . . . 115 212 16.2. Accept-Credentials . . . . . . . . . . . . . . . . . . . 115 213 16.3. Accept-Encoding . . . . . . . . . . . . . . . . . . . . 116 214 16.4. Accept-Language . . . . . . . . . . . . . . . . . . . . 117 215 16.5. Accept-Ranges . . . . . . . . . . . . . . . . . . . . . 118 216 16.6. Allow . . . . . . . . . . . . . . . . . . . . . . . . . 118 217 16.7. Authorization . . . . . . . . . . . . . . . . . . . . . 118 218 16.8. Bandwidth . . . . . . . . . . . . . . . . . . . . . . . 119 219 16.9. Blocksize . . . . . . . . . . . . . . . . . . . . . . . 119 220 16.10. Cache-Control . . . . . . . . . . . . . . . . . . . . . 120 221 16.11. Connection . . . . . . . . . . . . . . . . . . . . . . . 122 222 16.12. Connection-Credentials . . . . . . . . . . . . . . . . . 123 223 16.13. Content-Base . . . . . . . . . . . . . . . . . . . . . . 124 224 16.14. Content-Encoding . . . . . . . . . . . . . . . . . . . . 124 225 16.15. Content-Language . . . . . . . . . . . . . . . . . . . . 125 226 16.16. Content-Length . . . . . . . . . . . . . . . . . . . . . 125 227 16.17. Content-Location . . . . . . . . . . . . . . . . . . . . 126 228 16.18. Content-Type . . . . . . . . . . . . . . . . . . . . . . 126 229 16.19. CSeq . . . . . . . . . . . . . . . . . . . . . . . . . . 126 230 16.20. Date . . . . . . . . . . . . . . . . . . . . . . . . . . 127 231 16.21. Expires . . . . . . . . . . . . . . . . . . . . . . . . 128 232 16.22. From . . . . . . . . . . . . . . . . . . . . . . . . . . 129 233 16.23. If-Match . . . . . . . . . . . . . . . . . . . . . . . . 129 234 16.24. If-Modified-Since . . . . . . . . . . . . . . . . . . . 130 235 16.25. If-None-Match . . . . . . . . . . . . . . . . . . . . . 130 236 16.26. Last-Modified . . . . . . . . . . . . . . . . . . . . . 131 237 16.27. Location . . . . . . . . . . . . . . . . . . . . . . . . 131 238 16.28. Media-Properties . . . . . . . . . . . . . . . . . . . . 132 239 16.29. Media-Range . . . . . . . . . . . . . . . . . . . . . . 134 240 16.30. MTag . . . . . . . . . . . . . . . . . . . . . . . . . . 134 241 16.31. Notify-Reason . . . . . . . . . . . . . . . . . . . . . 135 242 16.32. Pipelined-Requests . . . . . . . . . . . . . . . . . . . 135 243 16.33. Proxy-Authenticate . . . . . . . . . . . . . . . . . . . 136 244 16.34. Proxy-Authorization . . . . . . . . . . . . . . . . . . 136 245 16.35. Proxy-Require . . . . . . . . . . . . . . . . . . . . . 136 246 16.36. Proxy-Supported . . . . . . . . . . . . . . . . . . . . 137 247 16.37. Public . . . . . . . . . . . . . . . . . . . . . . . . . 138 248 16.38. Range . . . . . . . . . . . . . . . . . . . . . . . . . 139 249 16.39. Referrer . . . . . . . . . . . . . . . . . . . . . . . . 140 250 16.40. Request-Status . . . . . . . . . . . . . . . . . . . . . 141 251 16.41. Require . . . . . . . . . . . . . . . . . . . . . . . . 141 252 16.42. Retry-After . . . . . . . . . . . . . . . . . . . . . . 142 253 16.43. RTP-Info . . . . . . . . . . . . . . . . . . . . . . . . 143 254 16.44. Scale . . . . . . . . . . . . . . . . . . . . . . . . . 145 255 16.45. Seek-Style . . . . . . . . . . . . . . . . . . . . . . . 146 256 16.46. Server . . . . . . . . . . . . . . . . . . . . . . . . . 148 257 16.47. Session . . . . . . . . . . . . . . . . . . . . . . . . 148 258 16.48. Speed . . . . . . . . . . . . . . . . . . . . . . . . . 149 259 16.49. Supported . . . . . . . . . . . . . . . . . . . . . . . 150 260 16.50. Terminate-Reason . . . . . . . . . . . . . . . . . . . . 150 261 16.51. Timestamp . . . . . . . . . . . . . . . . . . . . . . . 151 262 16.52. Transport . . . . . . . . . . . . . . . . . . . . . . . 151 263 16.53. Unsupported . . . . . . . . . . . . . . . . . . . . . . 158 264 16.54. User-Agent . . . . . . . . . . . . . . . . . . . . . . . 158 265 16.55. Vary . . . . . . . . . . . . . . . . . . . . . . . . . . 159 266 16.56. Via . . . . . . . . . . . . . . . . . . . . . . . . . . 160 267 16.57. WWW-Authenticate . . . . . . . . . . . . . . . . . . . . 160 269 17. Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 270 17.1. Proxies and Protocol Extensions . . . . . . . . . . . . 162 271 17.2. Multiplexing and Demultiplexing of Messages . . . . . . 163 272 18. Caching . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 273 18.1. Validation Model . . . . . . . . . . . . . . . . . . . . 164 274 18.1.1. Last-Modified Dates . . . . . . . . . . . . . . . . 166 275 18.1.2. Message Body Tag Cache Validators . . . . . . . . . 166 276 18.1.3. Weak and Strong Validators . . . . . . . . . . . . . 166 277 18.1.4. Rules for When to Use Message Body Tags and 278 Last-Modified Dates . . . . . . . . . . . . . . . . 168 279 18.1.5. Non-validating Conditionals . . . . . . . . . . . . 170 280 18.2. Invalidation After Updates or Deletions . . . . . . . . 170 281 19. Security Framework . . . . . . . . . . . . . . . . . . . . . 172 282 19.1. RTSP and HTTP Authentication . . . . . . . . . . . . . . 172 283 19.2. RTSP over TLS . . . . . . . . . . . . . . . . . . . . . 172 284 19.3. Security and Proxies . . . . . . . . . . . . . . . . . . 173 285 19.3.1. Accept-Credentials . . . . . . . . . . . . . . . . . 174 286 19.3.2. User approved TLS procedure . . . . . . . . . . . . 175 287 20. Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 288 20.1. Base Syntax . . . . . . . . . . . . . . . . . . . . . . 178 289 20.2. RTSP Protocol Definition . . . . . . . . . . . . . . . . 180 290 20.2.1. Generic Protocol elements . . . . . . . . . . . . . 180 291 20.2.2. Message Syntax . . . . . . . . . . . . . . . . . . . 183 292 20.2.3. Header Syntax . . . . . . . . . . . . . . . . . . . 187 293 20.3. SDP extension Syntax . . . . . . . . . . . . . . . . . . 196 294 21. Security Considerations . . . . . . . . . . . . . . . . . . . 197 295 21.1. Remote denial of Service Attack . . . . . . . . . . . . 199 296 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 201 297 22.1. Feature-tags . . . . . . . . . . . . . . . . . . . . . . 201 298 22.1.1. Description . . . . . . . . . . . . . . . . . . . . 201 299 22.1.2. Registering New Feature-tags with IANA . . . . . . . 202 300 22.1.3. Registered entries . . . . . . . . . . . . . . . . . 202 301 22.2. RTSP Methods . . . . . . . . . . . . . . . . . . . . . . 202 302 22.2.1. Description . . . . . . . . . . . . . . . . . . . . 202 303 22.2.2. Registering New Methods with IANA . . . . . . . . . 203 304 22.2.3. Registered Entries . . . . . . . . . . . . . . . . . 203 305 22.3. RTSP Status Codes . . . . . . . . . . . . . . . . . . . 203 306 22.3.1. Description . . . . . . . . . . . . . . . . . . . . 203 307 22.3.2. Registering New Status Codes with IANA . . . . . . . 204 308 22.3.3. Registered Entries . . . . . . . . . . . . . . . . . 204 309 22.4. RTSP Headers . . . . . . . . . . . . . . . . . . . . . . 204 310 22.4.1. Description . . . . . . . . . . . . . . . . . . . . 204 311 22.4.2. Registering New Headers with IANA . . . . . . . . . 204 312 22.4.3. Registered entries . . . . . . . . . . . . . . . . . 205 313 22.5. Accept-Credentials . . . . . . . . . . . . . . . . . . . 205 314 22.5.1. Accept-Credentials policies . . . . . . . . . . . . 205 315 22.5.2. Accept-Credentials hash algorithms . . . . . . . . . 206 316 22.6. Cache-Control Cache Directive Extensions . . . . . . . . 206 317 22.7. Media Properties . . . . . . . . . . . . . . . . . . . . 207 318 22.7.1. Description . . . . . . . . . . . . . . . . . . . . 207 319 22.7.2. Registration Rules . . . . . . . . . . . . . . . . . 207 320 22.7.3. Registered Values . . . . . . . . . . . . . . . . . 208 321 22.8. Notify-Reason header . . . . . . . . . . . . . . . . . . 208 322 22.8.1. Description . . . . . . . . . . . . . . . . . . . . 208 323 22.8.2. Registration Rules . . . . . . . . . . . . . . . . . 208 324 22.8.3. Registered Values . . . . . . . . . . . . . . . . . 209 325 22.9. Range header formats . . . . . . . . . . . . . . . . . . 209 326 22.9.1. Description . . . . . . . . . . . . . . . . . . . . 209 327 22.9.2. Registration Rules . . . . . . . . . . . . . . . . . 209 328 22.9.3. Registered Values . . . . . . . . . . . . . . . . . 209 329 22.10. Terminate-Reason Header . . . . . . . . . . . . . . . . 210 330 22.10.1. Redirect Reasons . . . . . . . . . . . . . . . . . . 210 331 22.10.2. Terminate-Reason Header Parameters . . . . . . . . . 210 332 22.11. RTP-Info header parameters . . . . . . . . . . . . . . . 210 333 22.11.1. Description . . . . . . . . . . . . . . . . . . . . 210 334 22.11.2. Registration Rules . . . . . . . . . . . . . . . . . 211 335 22.11.3. Registered Values . . . . . . . . . . . . . . . . . 211 336 22.12. Seek-Style Policies . . . . . . . . . . . . . . . . . . 211 337 22.12.1. Description . . . . . . . . . . . . . . . . . . . . 211 338 22.12.2. Registration Rules . . . . . . . . . . . . . . . . . 211 339 22.12.3. Registered Values . . . . . . . . . . . . . . . . . 212 340 22.13. Transport Header Registries . . . . . . . . . . . . . . 212 341 22.13.1. Transport Protocol Specification . . . . . . . . . . 212 342 22.13.2. Transport modes . . . . . . . . . . . . . . . . . . 213 343 22.13.3. Transport Parameters . . . . . . . . . . . . . . . . 214 344 22.14. URI Schemes . . . . . . . . . . . . . . . . . . . . . . 214 345 22.14.1. The rtsp URI Scheme . . . . . . . . . . . . . . . . 214 346 22.14.2. The rtsps URI Scheme . . . . . . . . . . . . . . . . 215 347 22.14.3. The rtspu URI Scheme . . . . . . . . . . . . . . . . 216 348 22.15. SDP attributes . . . . . . . . . . . . . . . . . . . . . 217 349 22.16. Media Type Registration for text/parameters . . . . . . 218 350 23. References . . . . . . . . . . . . . . . . . . . . . . . . . 220 351 23.1. Normative References . . . . . . . . . . . . . . . . . . 220 352 23.2. Informative References . . . . . . . . . . . . . . . . . 222 353 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 225 354 A.1. Media on Demand (Unicast) . . . . . . . . . . . . . . . 225 355 A.2. Media on Demand using Pipelining . . . . . . . . . . . . 229 356 A.3. Media on Demand (Unicast) . . . . . . . . . . . . . . . 231 357 A.4. Single Stream Container Files . . . . . . . . . . . . . 235 358 A.5. Live Media Presentation Using Multicast . . . . . . . . 237 359 A.6. Capability Negotiation . . . . . . . . . . . . . . . . . 238 360 Appendix B. RTSP Protocol State Machine . . . . . . . . . . . . 240 361 B.1. States . . . . . . . . . . . . . . . . . . . . . . . . . 240 362 B.2. State variables . . . . . . . . . . . . . . . . . . . . 240 363 B.3. Abbreviations . . . . . . . . . . . . . . . . . . . . . 240 364 B.4. State Tables . . . . . . . . . . . . . . . . . . . . . . 241 366 Appendix C. Media Transport Alternatives . . . . . . . . . . . . 247 367 C.1. RTP . . . . . . . . . . . . . . . . . . . . . . . . . . 247 368 C.1.1. AVP . . . . . . . . . . . . . . . . . . . . . . . . 247 369 C.1.2. AVP/UDP . . . . . . . . . . . . . . . . . . . . . . 247 370 C.1.3. AVPF/UDP . . . . . . . . . . . . . . . . . . . . . . 248 371 C.1.4. SAVP/UDP . . . . . . . . . . . . . . . . . . . . . . 249 372 C.1.5. SAVPF/UDP . . . . . . . . . . . . . . . . . . . . . 249 373 C.1.6. RTCP usage with RTSP . . . . . . . . . . . . . . . . 249 374 C.2. RTP over TCP . . . . . . . . . . . . . . . . . . . . . . 250 375 C.2.1. Interleaved RTP over TCP . . . . . . . . . . . . . . 251 376 C.2.2. RTP over independent TCP . . . . . . . . . . . . . . 251 377 C.3. Handling Media Clock Time Jumps in the RTP Media Layer . 255 378 C.4. Handling RTP Timestamps after PAUSE . . . . . . . . . . 259 379 C.5. RTSP / RTP Integration . . . . . . . . . . . . . . . . . 261 380 C.6. Scaling with RTP . . . . . . . . . . . . . . . . . . . . 261 381 C.7. Maintaining NPT synchronization with RTP timestamps . . 261 382 C.8. Continuous Audio . . . . . . . . . . . . . . . . . . . . 261 383 C.9. Multiple Sources in an RTP Session . . . . . . . . . . . 261 384 C.10. Usage of SSRCs and the RTCP BYE Message During an 385 RTSP Session . . . . . . . . . . . . . . . . . . . . . . 261 386 C.11. Future Additions . . . . . . . . . . . . . . . . . . . . 262 387 Appendix D. Use of SDP for RTSP Session Descriptions . . . . . . 263 388 D.1. Definitions . . . . . . . . . . . . . . . . . . . . . . 263 389 D.1.1. Control URI . . . . . . . . . . . . . . . . . . . . 263 390 D.1.2. Media Streams . . . . . . . . . . . . . . . . . . . 264 391 D.1.3. Payload Type(s) . . . . . . . . . . . . . . . . . . 265 392 D.1.4. Format-Specific Parameters . . . . . . . . . . . . . 265 393 D.1.5. Directionality of media stream . . . . . . . . . . . 265 394 D.1.6. Range of Presentation . . . . . . . . . . . . . . . 266 395 D.1.7. Time of Availability . . . . . . . . . . . . . . . . 267 396 D.1.8. Connection Information . . . . . . . . . . . . . . . 267 397 D.1.9. Message Body Tag . . . . . . . . . . . . . . . . . . 267 398 D.2. Aggregate Control Not Available . . . . . . . . . . . . 268 399 D.3. Aggregate Control Available . . . . . . . . . . . . . . 268 400 D.4. Grouping of Media Lines in SDP . . . . . . . . . . . . . 269 401 D.5. RTSP external SDP delivery . . . . . . . . . . . . . . . 270 402 Appendix E. RTSP Use Cases . . . . . . . . . . . . . . . . . . . 271 403 E.1. On-demand Playback of Stored Content . . . . . . . . . . 271 404 E.2. Unicast Distribution of Live Content . . . . . . . . . . 272 405 E.3. On-demand Playback using Multicast . . . . . . . . . . . 273 406 E.4. Inviting an RTSP server into a conference . . . . . . . 273 407 E.5. Live Content using Multicast . . . . . . . . . . . . . . 274 408 Appendix F. Text format for Parameters . . . . . . . . . . . . . 276 409 Appendix G. Requirements for Unreliable Transport of RTSP . . . 277 410 Appendix H. Backwards Compatibility Considerations . . . . . . . 279 411 H.1. Play Request in Play State . . . . . . . . . . . . . . . 279 412 H.2. Using Persistent Connections . . . . . . . . . . . . . . 279 413 Appendix I. Open Issues . . . . . . . . . . . . . . . . . . . . 280 414 Appendix J. Changes . . . . . . . . . . . . . . . . . . . . . . 281 415 J.1. Brief Overview . . . . . . . . . . . . . . . . . . . . . 281 416 J.2. Detailed List of Changes . . . . . . . . . . . . . . . . 282 417 Appendix K. Acknowledgements . . . . . . . . . . . . . . . . . . 289 418 K.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 289 419 Appendix L. RFC Editor Consideration . . . . . . . . . . . . . . 291 420 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 292 422 1. Introduction 424 This memo defines version 2.0 of the Real Time Streaming Protocol 425 (RTSP 2.0). RTSP 2.0 is an application-level protocol for setup and 426 control over the delivery of data with real-time properties, 427 typically streaming media. Streaming media is, for instance, video 428 on demand or audio live streaming. Put simply, RTSP acts as a 429 "network remote control" for multimedia servers, similar to the 430 remote control for a DVD player. 432 The protocol operates between RTSP 2.0 clients and servers, but also 433 supports the usage of proxies placed between clients and servers. 434 Clients can request information about streaming media from servers by 435 asking for a description of the media or use media description 436 provided externally. The media delivery protocol is used to 437 establish the media streams described by the media description. 438 Clients can then request to play out the media, pause it, or stop it 439 completely, as known from a regular DVD player remote control. The 440 requested media can consist of multiple audio and video streams that 441 are delivered as a time-synchronized streams from 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 server 486 to the client. 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 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 acknowledgement 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 with an error code indicating 1141 the "rtspu" scheme is not implemented (501) to a request that carries 1142 a "rtspu" URI scheme. The details of the syntax of "rtsp" and 1143 "rtsps" 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) [RFC1305]. 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 suppports 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 exemaples 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 0822 [RFC0822] for transferring bodies (the 1510 payload of the message). Both types of message consist of a start- 1511 line, zero or more header fields (also known as "headers"), an empty 1512 line (i.e., a line with nothing preceding the CRLF) indicating the 1513 end of the header, and possibly the data of the message-body. 1515 generic-message = start-line 1516 *(message-header CRLF) 1517 CRLF 1518 [ message-body-data ] 1519 start-line = Request-Line | Status-Line 1521 In the interest of robustness, servers MUST ignore any empty line(s) 1522 received where a Request-Line is expected. In other words, if the 1523 server is reading the protocol stream at the beginning of a message 1524 and receives a CRLF first, it should ignore the CRLF. 1526 5.2. Message Headers 1528 RTSP header fields (see Section 16) include general-header, request- 1529 header, response-header, and Message-body header fields. 1531 The order in which header fields with differing field names are 1532 received is not significant. However, it is "good practice" to send 1533 general-header fields first, followed by request-header or response- 1534 header fields, and ending with the Message-body header fields. 1536 Multiple message-header fields with the same field-name MAY be 1537 present in a message if and only if the entire field-value for that 1538 header field is defined as a comma-separated list. It MUST be 1539 possible to combine the multiple header fields into one "field-name: 1540 field-value" pair, without changing the semantics of the message, by 1541 appending each subsequent field-value to the first, each separated by 1542 a comma. The order in which header fields with the same field-name 1543 are received is therefore significant to the interpretation of the 1544 combined field value, and thus a proxy MUST NOT change the order of 1545 these field values when a message is forwarded. 1547 Unknown message headers MUST be ignored (skipping over the header to 1548 the next protocol element, and not causing an error) by a RTSP server 1549 or client. An RTSP Proxy MUST forward unknown message headers. 1550 Message headers defined outside of this specification that are 1551 required to be 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 acknowledgement of the message from the underlying 2122 transport protocols to optimize the RTSP behavior. 2124 If both the underlying reliable transport such as TCP and the RTSP 2125 application retransmit requests, each packet loss or message loss 2126 may result in two retransmissions. The receiver typically cannot 2127 take advantage of the application-layer retransmission since the 2128 transport stack will not deliver the application-layer 2129 retransmission before the first attempt has reached the receiver. 2130 If the packet loss is caused by congestion, multiple 2131 retransmissions at different layers will exacerbate the 2132 congestion. 2134 Lack of acknowledgement of an RTSP request should be handled within 2135 the constraints of the connection timeout considerations described 2136 below (Section 10.4). 2138 10.2. Using Connections 2140 A TCP transport can be used for both persistent connections (for 2141 several message exchanges) and transient connections (for a single 2142 message exchange). Implementations of this specification MUST 2143 support RTSP over TCP. The scheme of the RTSP URI (Section 4.2) 2144 indicates the default port that the server will listen on if the port 2145 is not explicitly given. 2147 A server MUST handle both persistent and transient connections. 2149 Transient connections facilitate mechanisms for fault tolerance. 2150 They also allow for application layer mobility. A server and 2151 client pair that support transient connections can survive the 2152 loss of a TCP connection; e.g., due to a NAT timeout. When the 2153 client has discovered that the TCP connection has been lost, it 2154 can set up a new one when there is need to communicate again. 2156 A persistent connection is RECOMMENDED to be used for all 2157 transactions between the server and client, including messages for 2158 multiple RTSP sessions. However, a persistent connection MAY be 2159 closed after a few message exchanges. For example, a client may use 2160 a persistent connection for the initial SETUP and PLAY message 2161 exchanges in a session and then close the connection. Later, when 2162 the client wishes to send a new request, such as a PAUSE for the 2163 session, a new connection would be opened. This connection may 2164 either be transient or persistent. 2166 An RTSP agent SHOULD NOT have more than one connection to the server 2167 at any given point. If a client or proxy handles multiple RTSP 2168 sessions on the same server, it SHOULD use only one connection for 2169 managing those sessions. 2171 This saves connection resources on the server. It also reduces 2172 complexity by 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 1 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). 2274 If a server closes a connection while the client is attempting to 2275 send a new request, the client will have to close its current 2276 connection, establish a new connection and send its request over the 2277 new connection. 2279 An RTSP message should not be terminated by closing the connection. 2280 Such a message MAY be considered to be incomplete by the receiver and 2281 discarded. An RTSP message is properly terminated as defined in 2282 Section 5. 2284 10.4. Timing Out Connections and RTSP Messages 2286 Receivers of a request (responder) SHOULD respond to requests in a 2287 timely manner even when a reliable transport such as TCP is used. 2288 Similarly, the sender of a request (requester) SHOULD wait for a 2289 sufficient time for a response before concluding that the responder 2290 will not be acting upon its request. 2292 A responder SHOULD respond to all requests within 5 seconds. If the 2293 responder recognizes that processing of a request will take longer 2294 than 5 seconds, it SHOULD send a 100 (Continue) response as soon as 2295 possible. It SHOULD continue sending a 100 response every 5 seconds 2296 thereafter until it is ready to send the final response to the 2297 requester. After sending a 100 response, the receiver MUST send a 2298 final response indicating the success or failure of the request. 2300 A requester SHOULD wait at least 10 seconds for a response before 2301 concluding that the responder will not be responding to its request. 2302 After receiving a 100 response, the requester SHOULD continue waiting 2303 for further responses. If more than 10 seconds elapses without 2304 receiving any response, the requester MAY assume that the responder 2305 is unresponsive and abort the connection. 2307 A requester SHOULD wait longer than 10 seconds for a response if it 2308 is experiencing significant transport delays on its connection to the 2309 responder. The requester is capable of determining the RTT of the 2310 request/response cycle using the Timestamp header (Section 16.51) in 2311 any RTSP request. 2313 10 seconds was chosen for the following reasons. It gives TCP 2314 time to perform a couple of retransmissions, even if operating on 2315 default values. It is short enough that users may not abandon the 2316 process themselves. However, it should be noted that 10 seconds 2317 can be aggressive on certain type of networks. The 5 seconds 2318 value for 1xx messages is half the timeout giving a reasonable 2319 change of successful delivery before timeout happens on the 2320 requester side. 2322 10.5. Showing Liveness 2324 The mechanisms for showing liveness of the client is, any RTSP 2325 request with a Session header, if RTP & RTCP is used an RTCP message, 2326 or through any other used media protocol capable of indicating 2327 liveness of the RTSP client. It is RECOMMENDED that a client does 2328 not wait to the last second of the timeout before trying to send a 2329 liveness message. The RTSP message may be lost or when using 2330 reliable protocols, such as TCP, the message may take some time to 2331 arrive safely at the receiver. To show liveness between RTSP request 2332 issued to accomplish other things, the following mechanisms can be 2333 used, in descending order of preference: 2335 RTCP: If RTP is used for media transport RTCP SHOULD be used. If 2336 RTCP is used to report transport statistics, it MUST also work 2337 as keep alive. The server can determine the client by network 2338 address and port together with the fact that the client is 2339 reporting on the servers SSRC(s). A downside of using RTCP is 2340 that it only gives statistical guarantees to reach the server. 2341 However, the probability of a false client timeout is so low 2342 that it can be ignored in most cases. For example, assume a 2343 session with 60 seconds timeout and enough bitrate assigned to 2344 RTCP messages to send a message from client to server on 2345 average every 5 seconds. That client have, for a network with 2346 5 % packet loss, the probability to fail showing liveness sign 2347 in that session within the timeout interval of 2.4*E-16. In 2348 sessions with shorter timeouts, or much higher packet loss, or 2349 small RTCP bandwidths SHOULD also use any of the mechanisms 2350 below. 2352 SET_PARAMETER: When using SET_PARAMETER for keep alive, no body 2353 SHOULD be included. This method is the RECOMMENDED RTSP method 2354 to use for a request intended only to perform keep-alive. 2356 GET_PARAMETER: When using GET_PARAMETER for keep alive, no body 2357 SHOULD be included. 2359 OPTIONS: This method is also usable, but it causes the server to 2360 perform more unnecessary processing and result in bigger 2361 responses than necessary for the task. The reason is that the 2362 server needs to determine the capabilities associated with the 2363 media resource to correctly populate the Public and Allow 2364 headers. 2366 The timeout parameter MAY be included in a SETUP response, and MUST 2367 NOT be included in requests. The server uses it to indicate to the 2368 client how long the server is prepared to wait between RTSP commands 2369 or other signs of life before closing the session due to lack of 2370 activity (see Appendix B). The timeout is measured in seconds, with 2371 a default of 60 seconds. The length of the session timeout MUST NOT 2372 be changed in an established session. 2374 10.6. Use of IPv6 2376 Explicit IPv6 support was not present in RTSP 1.0 (RFC 2326). RTSP 2377 2.0 has been updated for explicit IPv6 support. Implementations of 2378 RTSP 2.0 MUST understand literal IPv6 addresses in URIs and headers. 2380 11. Capability Handling 2382 This section describes the available capability handling mechanism 2383 which allows RTSP to be extended. Extensions to this version of the 2384 protocol are basically done in two ways. First, new headers can be 2385 added. Secondly, new methods can be added. The capability handling 2386 mechanism is designed to handle both cases. 2388 When a method is added, the involved parties can use the OPTIONS 2389 method to discover whether it is supported. This is done by issuing 2390 a OPTIONS request to the other party. Depending on the URI it will 2391 either apply in regards to a certain media resource, the whole server 2392 in general, or simply the next hop. The OPTIONS response MUST 2393 contain a Public header which declares all methods supported for the 2394 indicated resource. 2396 It is not necessary to use OPTIONS to discover support of a method, 2397 as the client could simply try the method. If the receiver of the 2398 request does not support the method it will respond with an error 2399 code indicating the method is either not implemented (501) or does 2400 not apply for the resource (405). The choice between the two 2401 discovery methods depends on the requirements of the service. 2403 Feature-Tags are defined to handle functionality additions that are 2404 not new methods. Each feature-tag represents a certain block of 2405 functionality. The amount of functionality that a feature-tag 2406 represents can vary significantly. A feature-tag can for example 2407 represent the functionality a single RTSP header provides. Another 2408 feature-tag can represent much more functionality, such as the 2409 "play.basic" feature-tag which represents the minimal media delivery 2410 for playback implementation. 2412 Feature-tags are used to determine whether the client, server or 2413 proxy supports the functionality that is necessary to achieve the 2414 desired service. To determine support of a feature-tag, several 2415 different headers can be used, each explained below: 2417 Supported: This header is used to determine the complete set of 2418 functionality that both client and server have. The intended 2419 usage is to determine before one needs to use a functionality 2420 that it is supported. It can be used in any method, but 2421 OPTIONS is the most suitable one as it at the same time 2422 determines all methods that are implemented. When sending a 2423 request the requester declares all its capabilities by 2424 including all supported feature-tags. This results in the 2425 receiver learns the requester's feature support. The receiver 2426 then includes its set of features in the response. 2428 Proxy-Supported: This header is used similarly to the Supported 2429 header, but instead of giving the supported functionality of 2430 the client or server it provides both the requester and the 2431 responder a view of what functionality the proxy chain between 2432 the two supports. Proxies are required to add this header 2433 whenever the Supported header is present, but proxies may also 2434 add it independently of the requester. 2436 Require: This header can be included in any request where the end- 2437 point, i.e. the client or server, is required to understand the 2438 feature to correctly perform the request. This can, for 2439 example, be a SETUP request where the server is required to 2440 understand a certain parameter to be able to set up the media 2441 delivery correctly. Ignoring this parameter would not have the 2442 desired effect and is not acceptable. Therefore the end-point 2443 receiving a request containing a Require MUST negatively 2444 acknowledge any feature that it does not understand and not 2445 perform the request. The response in cases where features are 2446 not supported are 551 (Option Not Supported). Also the 2447 features that are not supported are given in the Unsupported 2448 header in the response. 2450 Proxy-Require: This header has the same purpose and workings as 2451 Require except that it only applies to proxies and not the end- 2452 point. Features that need to be supported by both proxies and 2453 end-points need to be included in both the Require and Proxy- 2454 Require header. 2456 Unsupported: This header is used in a 551 error response, to 2457 indicate which features were not supported. Such a response is 2458 only the result of the usage of the Require and/or Proxy- 2459 Require header where one or more feature where not supported. 2460 This information allows the requester to make the best of 2461 situations as it knows which features are not supported. 2463 12. Pipelining Support 2465 Pipelining is a general method to improve performance of request 2466 response protocols by allowing the requesting agent to have more than 2467 one request outstanding and send them over the same persistent 2468 connection. For RTSP, where the relative order of requests will 2469 matter, it is important to maintain the order of the requests. 2470 Because of this, the responding agent MUST process the incoming 2471 requests in their sending order. The sending order can be determined 2472 by the CSeq header and its sequence number. For TCP the delivery 2473 order will be the same as the sending order. The processing of the 2474 request MUST also have been finished before processing the next 2475 request from the same agent. The responses MUST be sent in the order 2476 the requests were processed. 2478 RTSP 2.0 has extended support for pipelining compared to RTSP 1.0. 2479 The major improvement is to allow all requests to setup and initiate 2480 media delivery to be pipelined after each other. This is 2481 accomplished by the utilization of the Pipelined-Requests header (see 2482 Section 16.32). This header allows a client to request that two or 2483 more requests are processed in the same RTSP session context which 2484 the first request creates. In other words, a client can request that 2485 two or more media streams are set-up and then played without needing 2486 to wait for a single response. This speeds up the initial startup 2487 time for an RTSP session with at least one RTT. 2489 If a pipelined request builds on the successful completion of one or 2490 more prior requests the requester must verify that all requests were 2491 executed as expected. A common example will be two SETUP requests 2492 and a PLAY request. In case one of the SETUP fails unexpectedly, the 2493 PLAY request can still be successfully executed. However, the 2494 resulting presentation will not be as expected by the requesting 2495 client, as only a single media instead of two will be played. In 2496 this case the client can send a PAUSE request, correct the failing 2497 SETUP request and then request it to be played. 2499 13. Method Definitions 2501 The method indicates what is to be performed on the resource 2502 identified by the Request-URI. The method name is case-sensitive. 2503 New methods may be defined in the future. Method names MUST NOT 2504 start with a $ character (decimal 24) and MUST be a token as defined 2505 by the ABNF [RFC5234] in the syntax chapter Section 20. The methods 2506 are summarized in Table 7. 2508 +---------------+-----------+--------+-------------+-------------+ 2509 | method | direction | object | Server req. | Client req. | 2510 +---------------+-----------+--------+-------------+-------------+ 2511 | DESCRIBE | C -> S | P,S | recommended | recommended | 2512 | | | | | | 2513 | GET_PARAMETER | C -> S | P,S | optional | optional | 2514 | | | | | | 2515 | | S -> C | P,S | optional | optional | 2516 | | | | | | 2517 | OPTIONS | C -> S | P,S | required | required | 2518 | | | | | | 2519 | | S -> C | P,S | optional | optional | 2520 | | | | | | 2521 | PAUSE | C -> S | P,S | required | required | 2522 | | | | | | 2523 | PLAY | C -> S | P,S | required | required | 2524 | | | | | | 2525 | PLAY_NOTIFY | S -> C | P,S | required | required | 2526 | | | | | | 2527 | REDIRECT | S -> C | P,S | optional | required | 2528 | | | | | | 2529 | SETUP | C -> S | S | required | required | 2530 | | | | | | 2531 | SET_PARAMETER | C -> S | P,S | required | optional | 2532 | | | | | | 2533 | | S -> C | P,S | optional | optional | 2534 | | | | | | 2535 | TEARDOWN | C -> S | P,S | required | required | 2536 | | | | | | 2537 | | S -> C | P | required | required | 2538 +---------------+-----------+--------+-------------+-------------+ 2540 Table 7: Overview of RTSP methods, their direction, and what objects 2541 (P: presentation, S: stream) they operate on. 2543 Note on Table 7: GET_PARAMETER is recommended, but not required. 2544 For example, a fully functional server can be built to deliver 2545 media without any parameters. SET_PARAMETER is required, however, 2546 due to its usage for keep-alive. PAUSE is now required because it 2547 is the only way of leaving the Play state without terminating the 2548 whole session. 2550 If an RTSP agent does not support a particular method, it MUST return 2551 501 (Not Implemented) and the requesting RTSP agent, in turn, SHOULD 2552 NOT try this method again for the given agent / resource combination. 2553 An RTSP proxy whose main function is to log or audit and not modify 2554 transport or media handling in any way MAY forward RTSP messages with 2555 unknown methods. Note that the proxy still needs to perform the 2556 minimal required processing, like adding the Via header. 2558 13.1. OPTIONS 2560 The semantics of the RTSP OPTIONS method is similar to that of the 2561 HTTP OPTIONS method described in [H9.2]. In RTSP however, OPTIONS is 2562 bi-directional, in that a client can request it to a server and vice 2563 versa. A client MUST implement the capability to send an OPTIONS 2564 request and a server or a proxy MUST implement the capability to 2565 respond to an OPTIONS request. The client, server or proxy MAY also 2566 implement the converse of their required capability. 2568 An OPTIONS request may be issued at any time. Such a request does 2569 not modify the session state. However, it may prolong the session 2570 lifespan (see below). The URI in an OPTIONS request determines the 2571 scope of the request and the corresponding response. If the Request- 2572 URI refers to a specific media resource on a given host, the scope is 2573 limited to the set of methods supported for that media resource by 2574 the indicated RTSP agent. A Request-URI with only the host address 2575 limits the scope to the specified RTSP agent's general capabilities 2576 without regard to any specific media. If the Request-URI is an 2577 asterisk ("*"), the scope is limited to the general capabilities of 2578 the next hop (i.e. the RTSP agent in direct communication with the 2579 request sender). 2581 Regardless of scope of the request, the Public header MUST always be 2582 included in the OPTIONS response listing the methods that are 2583 supported by the responding RTSP agent. In addition, if the scope of 2584 the request is limited to a media resource, the Allow header MUST be 2585 included in the response to enumerate the set of methods that are 2586 allowed for that resource unless the set of methods completely 2587 matches the set in the Public header. If the given resource is not 2588 available, the RTSP agent SHOULD return an appropriate response code 2589 such as 3rr or 4xx. The Supported header MAY be included in the 2590 request to query the set of features that are supported by the 2591 responding RTSP agent. 2593 The OPTIONS method can be used to keep an RTSP session alive. 2594 However, this is not the preferred way of session keep-alive 2595 signaling, see Section 16.47. An OPTIONS request intended for 2596 keeping alive an RTSP session MUST include the Session header with 2597 the associated session ID. Such a request SHOULD also use the media 2598 or the aggregated control URI as the Request-URI. 2600 Example: 2602 C->S: OPTIONS rtsp://server.example.com RTSP/2.0 2603 CSeq: 1 2604 User-Agent: PhonyClient/1.2 2605 Proxy-Require: gzipped-messages 2606 Supported: play.basic 2608 S->C: RTSP/2.0 200 OK 2609 CSeq: 1 2610 Public: DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, OPTIONS 2611 Supported: play.basic, setup.rtp.rtcp.mux, play.scale 2612 Server: PhonyServer/1.1 2614 Note that some of the feature-tags in Supported and Proxy-Require are 2615 fictional features. 2617 13.2. DESCRIBE 2619 The DESCRIBE method is used to retrieve the description of a 2620 presentation or media object from a server. The Request-URI of the 2621 DESCRIBE request identifies the media resource of interest. The 2622 client MAY include the Accept header in the request to list the 2623 description formats that it understands. The server MUST respond 2624 with a description of the requested resource and return the 2625 description in the message body of the response, if the DESCRIBE 2626 method request can be successfully fulfilled. The DESCRIBE reply- 2627 response pair constitutes the media initialization phase of RTSP. 2629 The DESCRIBE response SHOULD contain all media initialization 2630 information for the resource(s) that it describes. Servers SHOULD 2631 NOT use the DESCRIBE response as a means of media indirection by 2632 having the description point at another server; instead, using the 2633 3rr responses is RECOMMENDED. 2635 By forcing a DESCRIBE response to contain all media initialization 2636 for the set of streams that it describes, and discouraging the use 2637 of DESCRIBE for media indirection, any looping problems can be 2638 avoided that might have resulted from other approaches. 2640 Example: 2642 C->S: DESCRIBE rtsp://server.example.com/fizzle/foo RTSP/2.0 2643 CSeq: 312 2644 User-Agent: PhonyClient 1.2 2645 Accept: application/sdp, application/example 2647 S->C: RTSP/2.0 200 OK 2648 CSeq: 312 2649 Date: Thu, 23 Jan 1997 15:35:06 GMT 2650 Server: PhonyServer/1.1 2651 Content-Base: rtsp://server.example.com/fizzle/foo/ 2652 Content-Type: application/sdp 2653 Content-Length: 358 2655 v=0 2656 o=mhandley 2890844526 2890842807 IN IP4 192.0.2.46 2657 s=SDP Seminar 2658 i=A Seminar on the session description protocol 2659 u=http://www.example.com/lectures/sdp.ps 2660 e=seminar@example.com (Seminar Management) 2661 c=IN IP4 0.0.0.0 2662 a=control:* 2663 t=2873397496 2873404696 2664 m=audio 3456 RTP/AVP 0 2665 a=control:audio 2666 m=video 2232 RTP/AVP 31 2667 a=control:video 2669 Media initialization is a requirement for any RTSP-based system, but 2670 the RTSP specification does not dictate that this is required to be 2671 done via the DESCRIBE method. There are three ways that an RTSP 2672 client may receive initialization information: 2674 o via an RTSP DESCRIBE request 2676 o via some other protocol (HTTP, email attachment, etc.) 2678 o via some form of user interface 2680 If a client obtains a valid description from an alternate source, the 2681 client MAY use this description for initialization purposes without 2682 issuing a DESCRIBE request for the same media. The client should use 2683 any MTag to either validate the presentation description or make the 2684 session establishment conditional on being valid. 2686 It is RECOMMENDED that minimal servers support the DESCRIBE method, 2687 and highly recommended that minimal clients support the ability to 2688 act as "helper applications" that accept a media initialization file 2689 from a user interface, and/or other means that are appropriate to the 2690 operating environment of the clients. 2692 13.3. SETUP 2694 The SETUP request for an URI specifies the transport mechanism to be 2695 used for the streamed media. The SETUP method may be used in two 2696 different cases; Create an RTSP session and change the transport 2697 parameters of already set up media stream. SETUP can be used in all 2698 three states; Init, and Ready, for both purposes and in PLAY to 2699 change the transport parameters. There is also a third possible 2700 usage for the SETUP method which is not specified in this memo: 2701 adding a media to a session. Using SETUP to add media to an existing 2702 session, when the session is in Play state, is unspecified. 2704 The Transport header, see Section 16.52, specifies the media 2705 transport parameters acceptable to the client for data transmission; 2706 the response will contain the transport parameters selected by the 2707 server. This allows the client to enumerate in descending order of 2708 preference the transport mechanisms and parameters acceptable to it, 2709 while the server can select the most appropriate. It is expected 2710 that the session description format used will enable the client to 2711 select a limited number possible configurations that are offered to 2712 the server to choose from. All transport related parameters shall be 2713 included in the Transport header; the use of other headers for this 2714 purpose is discouraged due to middleboxes, such as firewalls or NATs. 2716 For the benefit of any intervening firewalls, a client MUST indicate 2717 the known transport parameters, even if it has no influence over 2718 these parameters, for example, where the server advertises a fixed 2719 multicast address as destination. 2721 Since SETUP includes all transport initialization information, 2722 firewalls and other intermediate network devices (which need this 2723 information) are spared the more arduous task of parsing the 2724 DESCRIBE response, which has been reserved for media 2725 initialization. 2727 The client MUST include the Accept-Ranges header in the request 2728 indicating all supported unit formats in the Range header. This 2729 allows the server to know which format it may use in future session 2730 related responses, such as a PLAY response without any range in the 2731 request. If the client does not support a time format necessary for 2732 the presentation the server MUST respond using 456 (Header Field Not 2733 Valid for Resource) and include the Accept-Ranges header with the 2734 range unit formats supported for the resource. 2736 In a SETUP response the server MUST include the Accept-Ranges header 2737 (see Section 16.5) to indicate which time formats are acceptable to 2738 use for this media resource. 2740 The SETUP response 200 OK MUST include the Media-Properties header 2741 (see Section 16.28 ). The combination of the parameters of the 2742 Media-Properties header indicate the nature of the content present in 2743 the session (see also Section 4.9). For example, a live stream with 2744 time shifting is indicated by 2746 o Random Access set to Random-Access, 2748 o Content Modifications set to Time Progressing, 2750 o Retention set to Time-Duration (with specific recording window 2751 time value). 2753 The SETUP response 200 OK MUST include the Media-Range header (see 2754 Section 16.29) if the media is Time-Progressing. 2756 A basic example for SETUP: 2758 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 2759 CSeq: 302 2760 Transport: RTP/AVP;unicast;dest_addr=":4588"/":4589", 2761 RTP/AVP/TCP;unicast;interleaved=0-1 2762 Accept-Ranges: NPT, UTC 2763 User-Agent: PhonyClient/1.2 2765 S->C: RTSP/2.0 200 OK 2766 CSeq: 302 2767 Date: Thu, 23 Jan 1997 15:35:06 GMT 2768 Server: PhonyServer/1.1 2769 Session: 47112344;timeout=60 2770 Transport: RTP/AVP;unicast;dest_addr="192.0.2.53:4588"/ 2771 "192.0.2.53:4589"; src_addr="198.51.100.241:6256"/ 2772 "198.51.100.241:6257"; ssrc=2A3F93ED 2773 Accept-Ranges: NPT 2774 Media-Properties: Random-Access=3.2, Time-Progressing, 2775 Time-Duration=3600.0 2776 Media-Range: npt=0-2893.23 2778 In the above example the client wants to create an RTSP session 2779 containing the media resource "rtsp://example.com/foo/bar/baz.rm". 2780 The transport parameters acceptable to the client is either RTP/AVP/ 2781 UDP (UDP per default) to be received on client port 4588 and 4589 at 2782 the address the RTSP setup connection comes from or RTP/AVP 2783 interleaved on the RTSP control channel. The server selects the RTP/ 2784 AVP/UDP transport and adds the address and ports it will send and 2785 received RTP and RTCP from, and the RTP SSRC that will be used by the 2786 server. 2788 The server MUST generate a session identifier in response to a 2789 successful SETUP request, unless a SETUP request to a server includes 2790 a session identifier or an Pipelined-Requests header referencing an 2791 existing session context, in which case the server MUST bundle this 2792 setup request into the existing session (aggregated session) or 2793 return error 459 (Aggregate Operation Not Allowed) (see 2794 Section 15.4.24). An Aggregate control URI MUST be used to control 2795 an aggregated session. This URI MUST be different from the stream 2796 control URIs of the individual media streams included in the 2797 aggregate. The Aggregate control URI is to be specified by the 2798 session description if the server supports aggregated control and 2799 aggregated control is desired for the session. However, even if 2800 aggregated control is offered the client MAY chose to not set up the 2801 session in aggregated control. If an Aggregate control URI is not 2802 specified in the session description, it is normally an indication 2803 that non-aggregated control should be used. The SETUP of media 2804 streams in an aggregate which has not been given an aggregated 2805 control URI is unspecified. 2807 While the session ID sometimes carries enough information for 2808 aggregate control of a session, the Aggregate control URI is still 2809 important for some methods such as SET_PARAMETER where the control 2810 URI enables the resource in question to be easily identified. The 2811 Aggregate control URI is also useful for proxies, enabling them to 2812 route the request to the appropriate server, and for logging, 2813 where it is useful to note the actual resource that a request was 2814 operating on. 2816 A session will exist until it is either removed by a TEARDOWN request 2817 or is timed-out by the server. The server MAY remove a session that 2818 has not demonstrated liveness signs from the client(s) within a 2819 certain timeout period. The default timeout value is 60 seconds; the 2820 server MAY set this to a different value and indicate so in the 2821 timeout field of the Session header in the SETUP response. For 2822 further discussion see Section 16.47. Signs of liveness for an RTSP 2823 session are: 2825 o Any RTSP request from a client which includes a Session header 2826 with that session's ID. 2828 o If RTP is used as a transport for the underlying media streams, an 2829 RTCP sender or receiver report from the client(s) for any of the 2830 media streams in that RTSP session. RTCP Sender Reports may for 2831 example be received in sessions where the server is invited into a 2832 conference session and is valid for keep-alive. 2834 If a SETUP request on a session fails for any reason, the session 2835 state, as well as transport and other parameters for associated 2836 streams MUST remain unchanged from their values as if the SETUP 2837 request had never been received by the server. 2839 13.3.1. Changing Transport Parameters 2841 A client MAY issue a SETUP request for a stream that is already set 2842 up or playing in the session to change transport parameters, which a 2843 server MAY allow. If it does not allow changing of parameters, it 2844 MUST respond with error 455 (Method Not Valid In This State). The 2845 reasons to support changing transport parameters include allowing 2846 application layer mobility and flexibility to utilize the best 2847 available transport as it becomes available. If a client receives a 2848 455 when trying to change transport parameters while the server is in 2849 Play state, it MAY try to put the server in ready state using PAUSE, 2850 before issuing the SETUP request again. If that also fails the 2851 changing of transport parameters will require that the client 2852 performs a TEARDOWN of the affected media and then to set it up 2853 again. In aggregated session avoiding tearing down all the media at 2854 the same time will avoid the creation of a new session. 2856 All transport parameters MAY be changed. However, the primary usage 2857 expected is to either change the transport protocol completely, like 2858 switching from Interleaved TCP mode to UDP or vice versa, or to 2859 change the delivery address. 2861 In a SETUP response for a request to change the transport parameters 2862 while in Play state, the server MUST include the Range to indicate at 2863 what point the new transport parameters will be used. Further, if 2864 RTP is used for delivery, the server MUST also include the RTP-Info 2865 header to indicate at what timestamp and RTP sequence number the 2866 change will take place. If both RTP-Info and Range are included in 2867 the response the "rtp_time" parameter and start point in the Range 2868 header MUST be for the corresponding time, i.e. be used in the same 2869 way as for PLAY to ensure the correct synchronization information is 2870 available. 2872 If the transport parameters change while in Play state results in a 2873 change of synchronization related information, for example changing 2874 RTP SSRC, the server MUST provide in the SETUP response the necessary 2875 synchronization information. However, the server is RECOMMENDED to 2876 avoid changing the synchronization information if possible. 2878 13.4. PLAY 2880 This section describes the usage of the PLAY method in general, for 2881 aggregated sessions, and in different usage scenarios. 2883 13.4.1. General Usage 2885 The PLAY method tells the server to start sending data via the 2886 mechanism specified in SETUP and which part of the media should be 2887 played out. PLAY requests are valid when the session is in Ready or 2888 Play states. A PLAY request MUST include a Session header to 2889 indicate which session the request applies to. 2891 Upon receipt of the PLAY request, the server MUST position the normal 2892 play time to the beginning of the range specified in the received 2893 Range header and deliver stream data until the end of the range if 2894 given, until a new PLAY request is received, or until the end of the 2895 media is reached. If no Range header is present in the PLAY request 2896 the server SHALL play from current pause point until the end of 2897 media. The pause point defaults at session start to the beginning of 2898 the media. For media that is time-progressing and has no retention, 2899 the pause point will always be set equal to NPT "now", i.e., the 2900 current delivery point. The pause point may also be set to a 2901 particular point in the media by the PAUSE method, see Section 13.6. 2902 The pause point for media that is currently playing is equal to the 2903 current media position. For time-progressing media with time-limited 2904 retention, if the pause point represents a position that is older 2905 than what is retained by the server, the pause point will be moved to 2906 the oldest retained. 2908 What range values are valid depends on the type of content. For 2909 content that isn't time progressing the range value is valid if the 2910 given range is part of any media within the aggregate. In other 2911 words the valid media range for the aggregate is the union of all of 2912 the media components in the aggregate. If a given range value points 2913 outside of the media, the response MUST be the 457 (Invalid Range) 2914 error code and include the Media-Range header (Section 16.29) with 2915 the valid range for the media. Except for time progressing content 2916 where the client requests a start point prior to what is retained, 2917 the start point is adjusted to the oldest retained content. For a 2918 start point that is beyond the media front edge, i.e. beyond the 2919 current value for "now", the server SHALL adjust the start value to 2920 the current front edge. The Range header's stop point value may 2921 point beyond the current media edge. In that case, the server SHALL 2922 deliver media from the requested (and possibly adjusted) start point 2923 until the provided stop point, or the end of the media is reached 2924 prior to the specified stop point. Please note that if one simply 2925 wants to play from a particular start point until the end of media 2926 using an Range header with an implicit stop point is RECOMMENDED. 2928 If a client requests to start playing at the end of media, either 2929 explicitly with a Range header or implicitly with a pause point that 2930 is at the end of media, a 457 (Invalid Range) error MUST be sent and 2931 include the Media-Range header (Section 16.29). Below is specified 2932 that the Range header also must be included, and will in the case of 2933 Ready State carry the pause point. Note that this also applies if 2934 the pause point or requested start point is at the beginning of the 2935 media and a Scale header (Section 16.44) is included with a negative 2936 value (playing backwards). 2938 For media with random access properties a client may express its 2939 preference on which policy for start point selection the server shall 2940 use. This is done by including the Seek-Style header (Section 16.45) 2941 in the PLAY request. The Seek-Style applied will effect the content 2942 of the Range header as it will be adjusted to indicate from what 2943 point the media actually is delivered. 2945 A client desiring to play the media from the beginning MUST send a 2946 PLAY request with a Range header pointing at the beginning, e.g. 2947 npt=0-. If a PLAY request is received without a Range header and 2948 media delivery has stopped at the end, the server SHOULD respond with 2949 a 457 "Invalid Range" error response. In that response, the current 2950 pause point MUST be included in a Range header. 2952 All range specifiers in this specification allow for ranges with an 2953 implicit start point (e.g. "npt=-30"). When used in a PLAY request, 2954 the server treats this as a request to start or resume delivery from 2955 the current pause point, ending at the end time specified in the 2956 Range header. If the pause point is located later than the given end 2957 value, a 457 (Invalid Range) response MUST be given. 2959 The example below will play seconds 10 through 25. It also requests 2960 the server to deliver media from the first Random Access Point prior 2961 to the indicated start point. 2963 C->S: PLAY rtsp://audio.example.com/audio RTSP/2.0 2964 CSeq: 835 2965 Session: 12345678 2966 Range: npt=10-25 2967 Seek-Style: RAP 2968 User-Agent: PhonyClient/1.2 2970 Servers MUST include a "Range" header in any PLAY response, even if 2971 no Range header was present in the request. The response MUST use 2972 the same format as the request's range header contained. If no Range 2973 header was in the request, the format used in any previous PLAY 2974 request within the session SHOULD be used. If no format has been 2975 indicated in a previous request the server MAY use any time format 2976 supported by the media and indicated in the Accept-Ranges header in 2977 the SETUP request. It is RECOMMENDED that NPT is used if supported 2978 by the media. 2980 For any error response to a PLAY request, the server's response 2981 depends on the current session state. If the session is in Ready 2982 state, the current pause-point is returned using Range header with 2983 the pause point as the explicit start-point and an implicit stop- 2984 point. For time-progressing content where the pause-point moves with 2985 real-time due to limited retention, the current pause point is 2986 returned. For sessions in Play state, the current playout point and 2987 the remaining parts of the range request is returned. For any media 2988 with retention longer than 0 seconds the currently valid Media-Range 2989 header SHALL also be included in the response. 2991 A PLAY response MAY include a header carrying synchronization 2992 information. As the information necessary is dependent on the media 2993 transport format, further rules specifying the header and its usage 2994 are needed. For RTP the RTP-Info header is specified, see 2995 Section 16.43, and used in the following example. 2997 Here is a simple example for a single audio stream where the client 2998 requests the media starting from 3.52 seconds and to the end. The 2999 server sends a 200 OK response with the actual play time which is 10 3000 ms prior (3.51) and the RTP-Info header that contains the necessary 3001 parameters for the RTP stack. 3003 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3004 CSeq: 836 3005 Session: 12345678 3006 Range: npt=3.52- 3007 User-Agent: PhonyClient/1.2 3009 S->C: RTSP/2.0 200 OK 3010 CSeq: 836 3011 Date: Thu, 23 Jan 1997 15:35:06 GMT 3012 Server: PhonyServer/1.0 3013 Range: npt=3.51-324.39 3014 Seek-Style: First-Prior 3015 RTP-Info:url="rtsp://example.com/audio" 3016 ssrc=0D12F123:seq=14783;rtptime=2345962545 3018 S->C: RTP Packet TS=2345962545 => NPT=3.51 3019 Media duration=0.16 seconds 3021 The server replies with the actual start point that will be 3022 delivered. This may differ from the requested range if alignment of 3023 the requested range to valid frame boundaries is required for the 3024 media source. Note that some media streams in an aggregate may need 3025 to be delivered from even earlier points. Also, some media formats 3026 have a very long duration per individual data unit, therefore it 3027 might be necessary for the client to parse the data unit, and select 3028 where to start. The server SHALL also indicate which policy it uses 3029 for selecting the actual start point by including a Seek-Style 3030 header. 3032 In the following example the client receives the first media packet 3033 that stretches all the way up and past the requested playtime. Thus, 3034 it is the client's decision whether to render to the user the time 3035 between 3.52 and 7.05, or to skip it. In most cases it is probably 3036 most suitable not to render that time period. 3038 C->S: PLAY rtsp://example.com/audio RTSP/2.0 3039 CSeq: 836 3040 Session: 12345678 3041 Range: npt=7.05- 3042 User-Agent: PhonyClient/1.2 3044 S->C: RTSP/2.0 200 OK 3045 CSeq: 836 3046 Date: Thu, 23 Jan 1997 15:35:06 GMT 3047 Server: PhonyServer/1.0 3048 Range: npt=3.52- 3049 Seek-Style: First-Prior 3050 RTP-Info:url="rtsp://example.com/audio" 3051 ssrc=0D12F123:seq=14783;rtptime=2345962545 3053 S->C: RTP Packet TS=2345962545 => NPT=3.52 3054 Duration=4.15 seconds 3056 After playing the desired range, the presentation does NOT transition 3057 to the Ready state, media delivery simply stops. A PAUSE request 3058 MUST be issued before the stream enters the Ready state. A PLAY 3059 request while the stream is still in the Play state is legal, and can 3060 be issued without an intervening PAUSE request. Such a request MUST 3061 replace the current PLAY action with the new one requested, i.e. 3062 being handle the same as the request was received in Ready state. In 3063 the case the range in Range header has a implicit start time 3064 (-endtime), the server MUST continue to play from where it currently 3065 was until the specified end point. This is useful to change end at 3066 another point than in the previous request. 3068 The following example plays the whole presentation starting at SMPTE 3069 time code 0:10:20 until the end of the clip. Note: The RTP-Info 3070 headers has been broken into several lines, where following lines 3071 start with whitespace as allowed by the syntax. 3073 C->S: PLAY rtsp://audio.example.com/twister.en RTSP/2.0 3074 CSeq: 833 3075 Session: 12345678 3076 Range: smpte=0:10:20- 3077 User-Agent: PhonyClient/1.2 3079 S->C: RTSP/2.0 200 OK 3080 CSeq: 833 3081 Date: Thu, 23 Jan 1997 15:35:06 GMT 3082 Session: 12345678 3083 Server: PhonyServer/1.0 3084 Range: smpte=0:10:22-0:15:45 3085 Seek-Style: Next 3086 RTP-Info:url="rtsp://example.com/twister.en" 3087 ssrc=0D12F123:seq=14783;rtptime=2345962545 3089 For playing back a recording of a live presentation, it may be 3090 desirable to use clock units: 3092 C->S: PLAY rtsp://audio.example.com/meeting.en RTSP/2.0 3093 CSeq: 835 3094 Session: 12345678 3095 Range: clock=19961108T142300Z-19961108T143520Z 3096 User-Agent: PhonyClient/1.2 3098 S->C: RTSP/2.0 200 OK 3099 CSeq: 835 3100 Date: Thu, 23 Jan 1997 15:35:06 GMT 3101 Session: 12345678 3102 Server: PhonyServer/1.0 3103 Range: clock=19961108T142300Z-19961108T143520Z 3104 Seek-Style: Next 3105 RTP-Info:url="rtsp://example.com/meeting.en" 3106 ssrc=0D12F123:seq=53745;rtptime=484589019 3108 13.4.2. Aggregated Sessions 3110 PLAY requests can operate on sessions controlling a single media and 3111 on aggregated sessions controlling multiple media. 3113 In an aggregated session the PLAY request MUST contain an aggregated 3114 control URI. A server MUST respond with error 460 (Only Aggregate 3115 Operation Allowed) if the client PLAY Request-URI is for a single 3116 media. The media in an aggregate MUST be played in sync. If a 3117 client wants individual control of the media, it needs to use 3118 separate RTSP sessions for each media. 3120 For aggregated sessions where the initial SETUP request (creating a 3121 session) is followed by one or more additional SETUP requests, a PLAY 3122 request MAY be pipelined after those additional SETUP requests 3123 without awaiting their responses. This procedure can reduce the 3124 delay from start of session establishment until media play-out has 3125 started with one round trip time. However, a client needs to be 3126 aware that using this procedure will result in the playout of the 3127 server state established at the time of processing the PLAY, i.e., 3128 after the processing of all the requests prior to the PLAY request in 3129 the pipeline. This state may not be the intended one due to failure 3130 of any of the prior requests. A client can easily determine this 3131 based on the responses from those requests. In case of failure, the 3132 client can halt the media playout using PAUSE and try to establish 3133 the intended state again before issuing another PLAY request. 3135 13.4.3. Updating current PLAY Requests 3137 Clients can issue PLAY requests while the stream is in Play state and 3138 thus updating their request. 3140 The important difference compared to a PLAY request in Ready state is 3141 the handling of the current play point and how the Range header in 3142 request is constructed. The session is actively playing media and 3143 the play point will be moving, making the exact time a request will 3144 take action is hard to predict. Depending on how the PLAY header 3145 appears two different cases exist: total replacement or continuation. 3146 A total replacement is signaled by having the first range 3147 specification have an explicit start value, e.g. npt=45- or 3148 npt=45-60, in which case the server stops playout at the current 3149 playout point and then starts delivering media according to the Range 3150 header. This is equivalent to having the client first send a PAUSE 3151 and then a new play request that isn't based on the pause point. In 3152 the case of continuation the first range specifier has an implicit 3153 start point and a explicit stop value (Z), e.g. npt=-60, which 3154 indicate that it MUST convert the range specifier being played prior 3155 to this PLAY request (X to Y) into (X to Z) and continue as this was 3156 the request originally played. If the stop point is beyond the 3157 current delivery point, the server SHALL immediately pause delivery. 3158 As the request has been completed successfully it shall be responded 3159 with 200 OK. A PLAY-NOTIFY with end-of-stream is also sent to 3160 indicate the actual stop point. The pause point is set to the 3161 requested stop point. 3163 Following is an example of this behavior: The server has received 3164 requests to play ranges 10 to 15. If the new PLAY request arrives at 3165 the server 4 seconds after the previous one, it will take effect 3166 while the server still plays the first range (10-15). The server 3167 changes the current play to continue to 25 seconds, i.e. the 3168 equivalent single request would be PLAY with range: npt=10-25. 3170 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3171 CSeq: 834 3172 Session: 12345678 3173 Range: npt=10-15 3174 User-Agent: PhonyClient/1.2 3176 S->C: RTSP/2.0 200 OK 3177 CSeq: 834 3178 Date: Thu, 23 Jan 1997 15:35:06 GMT 3179 Session: 12345678 3180 Server: PhonyServer/1.0 3181 Range: npt=10-15 3182 Seek-Style: Next 3183 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3184 ssrc=0D12F123:seq=5712;rtptime=934207921, 3185 url="rtsp://example.com/fizzle/videotrack" 3186 ssrc=789DAF12:seq=57654;rtptime=2792482193 3187 Session: 12345678 3189 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3190 CSeq: 835 3191 Session: 12345678 3192 Range: npt=-25 3193 User-Agent: PhonyClient/1.2 3195 S->C: RTSP/2.0 200 OK 3196 CSeq: 835 3197 Date: Thu, 23 Jan 1997 15:35:09 GMT 3198 Session: 12345678 3199 Server: PhonyServer/1.0 3200 Range: npt=14-25 3201 Seek-Style: Next 3202 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3203 ssrc=0D12F123:seq=5712;rtptime=934239921, 3204 url="rtsp://example.com/fizzle/videotrack" 3205 ssrc=789DAF12:seq=57654;rtptime=2792842193 3207 A common use of a PLAY request while in Play state is changing the 3208 scale of the media, i.e., entering or leaving from fast forward or 3209 fast rewind. The client can issue an updating PLAY request that is 3210 either a continunation or a complete replacement, as discussed above 3211 this section. We give an example of a client that is requesting a 3212 fast forward without giving a stop point and the change from fast 3213 forward to regular playout (scale = 1). 3215 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3216 CSeq: 2034 3217 Session: 12345678 3218 Range: npt=now- 3219 Scale: 2.0 3220 User-Agent: PhonyClient/1.2 3222 S->C: RTSP/2.0 200 OK 3223 CSeq: 2034 3224 Date: Thu, 23 Jan 1997 15:35:06 GMT 3225 Session: 12345678 3226 Server: PhonyServer/1.0 3227 Range: npt=2:17:21.394- 3228 Seek-Style: Next 3229 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3230 ssrc=0D12F123:seq=5712;rtptime=934207921, 3231 url="rtsp://example.com/fizzle/videotrack" 3232 ssrc=789DAF12:seq=57654;rtptime=2792482193 3233 Session: 12345678 3235 [playing in fast forward and now returing to scale = 1] 3237 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3238 CSeq: 2035 3239 Session: 12345678 3240 Range: npt=now- 3241 Scale: 1.0 3242 User-Agent: PhonyClient/1.2 3244 S->C: RTSP/2.0 200 OK 3245 CSeq: 2035 3246 Date: Thu, 23 Jan 1997 15:35:09 GMT 3247 Session: 12345678 3248 Server: PhonyServer/1.0 3249 Range: npt=2:19:32.144- 3250 Seek-Style: Next 3251 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3252 ssrc=0D12F123:seq=5712;rtptime=934239921, 3253 url="rtsp://example.com/fizzle/videotrack" 3254 ssrc=789DAF12:seq=57654;rtptime=2792842193 3256 13.4.4. Playing On-Demand Media 3258 On-demand media is indicated by the content of the Media-Properties 3259 header in the SETUP response by (see also Section 16.28): 3261 o Random-Access property is set to Random Access; 3263 o Content Modifications set to Immutable; 3265 o Retention set to Unlimited or Time-Limited. 3267 Playing on-demand media follows the general usage as described in 3268 Section 13.4.1. 3270 13.4.5. Playing Dynamic On-Demand Media 3272 Dynamic on-demand media is indicated by the content of the Media- 3273 Properties header in the SETUP response by (see also Section 16.28): 3275 o RandomAccess set to Random-Access; 3277 o Content Modifications set to Dynamic; 3279 o Retention set to Unlimited or Time-Limited. 3281 Playing on-demand media follows the general usage as described in 3282 Section 13.4.1 as long as the media has not been changed. 3284 There are two ways for the client to be informed about changes of 3285 media resources in Play state. The client will receive a PLAY_NOTIFY 3286 request with Notify-Reason header set to media-properties-update (see 3287 Section 13.5.2. The client can use the value of the Media-Range to 3288 decide further actions, if the Media-Range header is present in the 3289 PLAY_NOTIFY request. The second way is that the client issues a 3290 GET_PARAMETER request without a body but including a Media-Range 3291 header. The 200 OK response MUST include the current Media-Range 3292 header (see Section 16.29). 3294 13.4.6. Playing Live Media 3296 Live media is indicated by the content of the Media-Properties header 3297 in the SETUP response by (see also Section 16.28): 3299 o Random-Access set to No-Seeking; 3301 o Content Modifications set to Time-Progressing; 3302 o Retention with Time-Duration set to 0.0. 3304 For live media, the SETUP response 200 OK MUST include the Media- 3305 Range header (see Section 16.29). 3307 A client MAY send PLAY requests without the Range header. If the 3308 request includes the Range header it MUST use a symbolic value 3309 representing "now". For NPT that range specification is "npt=now-". 3310 The server MUST include the Range header in the response and it MUST 3311 indicate an explicit time value and not a symbolic value. In other 3312 words, "npt=now-" is not a valid to use in the response. Instead the 3313 time since session start is recommended expressed as an open 3314 interval, e.g. "npt=96.23-". An absolute time value (clock) for the 3315 corresponding time MAY be given, i.e. "clock=20030213T143205Z-". The 3316 UTC clock format can only be used if client has shown support for it 3317 using the Accept-Ranges header. 3319 13.4.7. Playing Live with Recording 3321 Certain media server may offer recording services of live sessions to 3322 their clients. This recording would normally be from the beginning 3323 of the media session. Clients can randomly access the media between 3324 now and the beginning of the media session. This live media with 3325 recording is indicated by the content of the Media-Properties header 3326 in the SETUP response by (see also Section 16.28): 3328 o Random-Access set to Random-Access; 3330 o Content Modifications set to Time-Progressing; 3332 o Retention set to Time-limited or Unlimited 3334 The SETUP response 200 OK MUST include the Media-Range header (see 3335 Section 16.29) for this type of media. For live media with 3336 recording, the Range header indicates the current delivery point in 3337 the media and the Media-Range header indicates the currently 3338 available media window around the current time. This window can 3339 cover recorded content in the past (seen from current time in the 3340 media) or recorded content in the future (seen from current time in 3341 the media). The server adjusts the delivery point to the requested 3342 border of the window, if the client requests a delivery point that is 3343 located outside the recording windows, e.g., if requested to far in 3344 the past, the server selects the oldest range in the recording. The 3345 considerations in Section 13.5.3 apply, if a client requests delivery 3346 with Scale (Section 16.44) values other than 1.0 (Normal playback 3347 rate) while delivering live media with recording. 3349 13.4.8. Playing Live with Time-Shift 3351 Certain media server may offer time-shift services to their clients. 3352 This time shift records a fixed interval in the past, i.e., a sliding 3353 window recording mechanism, but not past this interval. Clients can 3354 randomly access the media between now and the interval. This live 3355 media with recording is indicated by the content of the Media- 3356 Properties header in the SETUP response by (see also Section 16.28): 3358 o Random-Access set to Random-Access; 3360 o Content Modifications set to Time-Progressing; 3362 o Retention set to Time-Duration and a value indicating the 3363 recording interval (>0). 3365 The SETUP response 200 OK MUST include the Media-Range header (see 3366 Section 16.29) for this type of media. For live media with recording 3367 the Range header indicates the current time in the media and the 3368 Media Range indicates a window around the current time. This window 3369 can cover recorded content in the past (seen from current time in the 3370 media) or recorded content in the future (seen from current time in 3371 the media). The server adjusts the play point to the requested 3372 border of the window, if the client requests a play point that is 3373 located outside the recording windows, e.g., if requested too far in 3374 the past, the server selects the oldest range in the recording. The 3375 considerations in Section 13.5.3 apply, if a client requests delivery 3376 using a Scale (Section 16.44) value other than 1.0 (Normal playback 3377 rate) while delivering live media with time-shift. 3379 13.5. PLAY_NOTIFY 3381 The PLAY_NOTIFY method is issued by a server to inform a client about 3382 an asynchronous event for a session in Play state. The Session 3383 header MUST be presented in a PLAY_NOTIFY request and indicates the 3384 scope of the request. Sending of PLAY_NOTIFY requests requires a 3385 persistent connection between server and client, otherwise there is 3386 no way for the server to send this request method to the client. 3388 PLAY_NOTIFY requests have an end-to-end (i.e. server to client) 3389 scope, as they carry the Session header, and apply only to the given 3390 session. The client SHOULD immediately return a response to the 3391 server. 3393 PLAY_NOTIFY requests MAY be used with a message body, depending on 3394 the value of the Notify-Reason header. It is described in the 3395 particular section for each Notify-Reason if a message body is used. 3396 However, currently there is no Notify-Reason that allows using a 3397 message body. In this case, there is a need to obey some limitations 3398 when adding new Notify-Reasons that intend to use a message body: the 3399 server can send any type of message body, but it is not ensured that 3400 the client can understand the received message body. This is related 3401 to DESCRIBE (see Section 13.2 ), but in this particular case the 3402 client can state its acceptable message bodies by using the Accept 3403 header. In the case of PLAY_NOTIFY, the server does not know which 3404 message bodies are understood by the client. 3406 The Notify-Reason header (see Section 16.31) specifies the reason why 3407 the server sends the PLAY_NOTIFY request. This is extensible and new 3408 reasons MAY be added in the future. In case the client does not 3409 understand the reason for the notification it MUST respond with an 3410 465 (Notification Reason Unknown) (Section 15.4.30) error code. 3411 Servers can send PLAY_NOTIFY with these types: 3413 o end-of-stream (see Section 13.5.1); 3415 o media-properties-update (see Section 13.5.2); 3417 o scale-change (see Section 13.5.3). 3419 13.5.1. End-of-Stream 3421 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3422 indicates the completion or near completion of the PLAY request and 3423 the ending delivery of the media stream(s). The request MUST NOT be 3424 issued unless the server is in the Play state. The end of the media 3425 stream delivery notification may be used to indicate either a 3426 successful completion of the PLAY request currently being served, or 3427 to indicate some error resulting in failure to complete the request. 3428 The Request-Status header (Section 16.40) MUST be included to 3429 indicate which request the notification is for and its completion 3430 status. The message response status codes (Section 8.1.1) are used 3431 to indicate how the PLAY request concluded. The sender of a 3432 PLAY_NOTIFY can issue an updated PLAY_NOTIFY, in the case of a 3433 PLAY_NOTIFY sent with wrong information. For instance, a PLAY_NOTIFY 3434 was issued before reaching the end-of-stream, but some error occurred 3435 resulting in that the previously sent PLAY_NOTIFY contained a wrong 3436 time when the stream will end. In this case a new PLAY_NOTIFY MUST 3437 be sent including the correct status for the completion and all 3438 additional information. 3440 PLAY_NOTIFY requests with Notify-Reason header set to end-of-stream 3441 MUST include a Range header and the Scale header if the scale value 3442 is not 1. The Range header indicates the point in the stream or 3443 streams where delivery is ending with the timescale that was used by 3444 the server in the PLAY response for the request being fulfilled. The 3445 server MUST NOT use the "now" constant in the Range header; it MUST 3446 use the actual numeric end position in the proper timescale. When 3447 end-of-stream notifications are issued prior to having sent the last 3448 media packets, this is evident as the end time in the Range header is 3449 beyond the current time in the media being received by the client, 3450 e.g., npt=-15, if npt is currently at 14.2 seconds. The Scale header 3451 is to be included so that it is evident if the media time scale is 3452 moving backwards and/or have a non-default pace. The end-of-stream 3453 notification does not prevent the client from sending a new PLAY 3454 request. 3456 If RTP is used as media transport, a RTP-Info header MUST be 3457 included, and the RTP-Info header MUST indicate the last sequence 3458 number in the seq parameter. 3460 A PLAY_NOTIFY request with Notify-Reason header set to end-of-stream 3461 MUST NOT carry a message body. 3463 This example request notifies the client about a future end-of-stream 3464 event: 3466 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3467 CSeq: 854 3468 Notify-Reason: end-of-stream 3469 Request-Status: cseq=853 status=200 reason="OK" 3470 Range: npt=-145 3471 RTP-Info:url="rtsp://example.com/audio" 3472 ssrc=0D12F123:seq=14783;rtptime=2345962545 3473 Session: uZ3ci0K+Ld-M 3474 Date: Mon, 08 Mar 2010 13:37:16 GMT 3476 C->S: RTSP/2.0 200 OK 3477 CSeq: 854 3478 User-Agent: PhonyClient/1.2 3479 Session: uZ3ci0K+Ld-M 3481 13.5.2. Media-Properties-Update 3483 A PLAY_NOTIFY request with Notify-Reason header set to media- 3484 properties-update indicates an update of the media properties for the 3485 given session (see Section 16.28) and/or the available media range 3486 that can be played as indicated by Media-Range (Section 16.29). 3487 PLAY_NOTIFY requests with Notify-Reason header set to media- 3488 properties-update MUST include a Media-Properties and Date header and 3489 SHOULD include a Media-Range header. 3491 This notification MUST be sent for media that are time-progressing 3492 every time an event happens that changes the basis for making 3493 estimates on how the media range progress. In addition it is 3494 RECOMMENDED that the server sends these notifications every 5 minutes 3495 for time-progressing content to ensure the long-term stability of the 3496 client estimation and allowing for clock skew detection by the 3497 client. Requests for the just mentioned reasons MUST include Media- 3498 Range header to provide current Media duration and the Range header 3499 to indicate the current playing point and any remaining parts of the 3500 requested range. 3502 The recommendation for sending updates every 5 minutes is due to 3503 any clock skew issues. In 5 minutes the clock skew should not 3504 become too significant as this is not used for media playback and 3505 synchronization, only for determining which content is available 3506 to the user. 3508 A PLAY_NOTIFY request with Notify-Reason header set to media- 3509 properties-update MUST NOT carry a message body. 3511 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3512 Date: Tue, 14 Apr 2008 15:48:06 GMT 3513 CSeq: 854 3514 Notify-Reason: media-properties-update 3515 Session: uZ3ci0K+Ld-M 3516 Media-Properties: Time-Progressing, 3517 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3518 Media-Range: npt=0-1:37:21.394 3519 Range: npt=1:15:49.873- 3521 C->S: RTSP/2.0 200 OK 3522 CSeq: 854 3523 User-Agent: PhonyClient/1.2 3524 Session: uZ3ci0K+Ld-M 3526 13.5.3. Scale-Change 3528 The server may be forced to change the rate, when a client request 3529 delivery using a Scale (Section 16.44) value other than 1.0 (normal 3530 playback rate). For time progressing media with some retention, i.e. 3531 the server stores already sent content, a client requesting to play 3532 with Scale values larger than 1 may catch up with the front end of 3533 the media. The server will then be unable to continue to provide 3534 with content at Scale larger than 1 as content is only made available 3535 by the server at Scale=1. Another case is when Scale < 1 and the 3536 media retention is time-duration limited. In this case the delivery 3537 point can reach the oldest media unit available, and further playback 3538 at this scale becomes impossible as there will be no media available. 3539 To avoid having the client lose any media, the scale will need to be 3540 adjusted to the same rate at which the media is removed from the 3541 storage buffer, commonly Scale = 1.0. 3543 Another case is when the content itself consists of spliced pieces or 3544 is dynamically updated. In these cases the server may be required to 3545 change from one supported scale value (different than Scale=1.0) to 3546 another. In this case the server will pick the closest value and 3547 inform the client of what it has picked. In these case the media 3548 properties will also be sent updating the supported Scale values. 3549 This enables a client to adjust the used Scale value. 3551 To minimize impact on playback in any of the above cases the server 3552 MUST modify the playback properties and set Scale to a supportable 3553 value and continue delivery the media. When doing this modification 3554 it MUST send a PLAY_NOTIFY message with the Notify-Reason header set 3555 to "scale-change". The request MUST contain a Range header with the 3556 media time where the change took effect, a Scale header with the new 3557 value in use, Session header with the ID for the session it applies 3558 to and a Date header with the server wallclock time of the change. 3559 For time progressing content also the Media-Range and the Media- 3560 Properties at this point in time MUST be included. The Media- 3561 Properties header MUST be included if the scale change was due to the 3562 content changing what scale values that is supported. 3564 For media streams being delivered using RTP also a RTP-Info header 3565 MUST be included. It MUST contain the rtptime parameter with a value 3566 corresponding to the point of change in that media and optionally 3567 also the sequence number. 3569 A PLAY_NOTIFY request with Notify-Reason header set to "Scale-Change" 3570 MUST NOT carry a message body. 3572 S->C: PLAY_NOTIFY rtsp://example.com/fizzle/foo RTSP/2.0 3573 Date: Tue, 14 Apr 2008 15:48:06 GMT 3574 CSeq: 854 3575 Notify-Reason: scale-change 3576 Session: uZ3ci0K+Ld-M 3577 Media-Properties: Time-Progressing, 3578 Time-Limited=20080415T153919.36Z, Random-Access=5.0 3579 Media-Range: npt=0-1:37:21.394 3580 Range: npt=1:37:21.394- 3581 Scale: 1 3582 RTP-Info: url="rtsp://example.com/fizzle/foo/audio" 3583 ssrc=0D12F123:rtptime=2345962545 3585 C->S: RTSP/2.0 200 OK 3586 CSeq: 854 3587 User-Agent: PhonyClient/1.2 3588 Session: uZ3ci0K+Ld-M 3590 13.6. PAUSE 3592 The PAUSE request causes the stream delivery to immediately be 3593 interrupted (halted). A PAUSE request MUST be done either with the 3594 aggregated control URI for aggregated sessions, resulting in all 3595 media being halted, or the media URI for non-aggregated sessions. 3596 Any attempt to do muting of a single media with an PAUSE request in 3597 an aggregated session MUST be responded to with error 460 (Only 3598 Aggregate Operation Allowed). After resuming playback, 3599 synchronization of the tracks MUST be maintained. Any server 3600 resources are kept, though servers MAY close the session and free 3601 resources after being paused for the duration specified with the 3602 timeout parameter of the Session header in the SETUP message. 3604 Example: 3606 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3607 CSeq: 834 3608 Session: 12345678 3609 User-Agent: PhonyClient/1.2 3611 S->C: RTSP/2.0 200 OK 3612 CSeq: 834 3613 Date: Thu, 23 Jan 1997 15:35:06 GMT 3614 Range: npt=45.76-75.00 3616 The PAUSE request causes stream delivery to be interrupted 3617 immediately on receipt of the message and the pause point is set to 3618 the current point in the presentation. That pause point in the media 3619 stream needs to be maintained. A subsequent PLAY request without 3620 Range header resume from the pause point and play until media end. 3622 The pause point after any PAUSE request MUST be returned to the 3623 client by adding a Range header with what remains unplayed of the 3624 PLAY request's range. For media with random access properties, if 3625 one desires to resume playing a ranged request, one simply includes 3626 the Range header from the PAUSE response and include the Seek-Style 3627 header with the Next policy in the PLAY request. For media that is 3628 time-progressing and has retention duration=0 the follow-up PLAY 3629 request to start media delivery again, will need to use "npt=now-" 3630 and not the answer given in the response to PAUSE. 3632 C->S: PLAY rtsp://example.com/fizzle/foo RTSP/2.0 3633 CSeq: 834 3634 Session: 12345678 3635 Range: npt=10-30 3636 User-Agent: PhonyClient/1.2 3638 S->C: RTSP/2.0 200 OK 3639 CSeq: 834 3640 Date: Thu, 23 Jan 1997 15:35:06 GMT 3641 Server: PhonyServer/1.0 3642 Range: npt=10-30 3643 Seek-Style: First-Prior 3644 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 3645 ssrc=0D12F123:seq=5712;rtptime=934207921, 3646 url="rtsp://example.com/fizzle/videotrack" 3647 ssrc=4FAD8726:seq=57654;rtptime=2792482193 3648 Session: 12345678 3650 After 11 seconds, i.e. at 21 seconds into the presentation: 3651 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3652 CSeq: 835 3653 Session: 12345678 3654 User-Agent: PhonyClient/1.2 3656 S->C: RTSP/2.0 200 OK 3657 CSeq: 835 3658 Date: 23 Jan 1997 15:35:09 GMT 3659 Server: PhonyServer/1.0 3660 Range: npt=21-30 3661 Session: 12345678 3663 If a client issues a PAUSE request and the server acknowledges and 3664 enters the Ready state, the proper server response, if the player 3665 issues another PAUSE, is still 200 OK. The 200 OK response MUST 3666 include the Range header with the current pause point. See examples 3667 below: 3669 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3670 CSeq: 834 3671 Session: 12345678 3672 User-Agent: PhonyClient/1.2 3674 S->C: RTSP/2.0 200 OK 3675 CSeq: 834 3676 Session: 12345678 3677 Date: Thu, 23 Jan 1997 15:35:06 GMT 3678 Range: npt=45.76-98.36 3680 C->S: PAUSE rtsp://example.com/fizzle/foo RTSP/2.0 3681 CSeq: 835 3682 Session: 12345678 3683 User-Agent: PhonyClient/1.2 3685 S->C: RTSP/2.0 200 OK 3686 CSeq: 835 3687 Session: 12345678 3688 Date: 23 Jan 1997 15:35:07 GMT 3689 Range: npt=45.76-98.36 3691 13.7. TEARDOWN 3693 13.7.1. Client to Server 3695 The TEARDOWN client to server request stops the stream delivery for 3696 the given URI, freeing the resources associated with it. A TEARDOWN 3697 request MAY be performed on either an aggregated or a media control 3698 URI. However, some restrictions apply depending on the current 3699 state. The TEARDOWN request MUST contain a Session header indicating 3700 what session the request applies to. 3702 A TEARDOWN using the aggregated control URI or the media URI in a 3703 session under non-aggregated control (single media session) MAY be 3704 done in any state (Ready and Play). A successful request MUST result 3705 in that media delivery being immediately halted and the session state 3706 being destroyed. This MUST be indicated through the lack of a 3707 Session header in the response. 3709 A TEARDOWN using a media URI in an aggregated session MAY only be 3710 done in Ready state. Such a request only removes the indicated media 3711 stream and associated resources from the session. This may result in 3712 that a session returns to non-aggregated control, due to that it only 3713 contains a single media after the requests completion. A session 3714 that will exist after the processing of the TEARDOWN request MUST in 3715 the response to that TEARDOWN request contain a Session header. Thus 3716 the presence of the Session header indicates to the receiver of the 3717 response if the session is still existing or has been removed. 3719 Example: 3721 C->S: TEARDOWN rtsp://example.com/fizzle/foo RTSP/2.0 3722 CSeq: 892 3723 Session: 12345678 3724 User-Agent: PhonyClient/1.2 3726 S->C: RTSP/2.0 200 OK 3727 CSeq: 892 3728 Server: PhonyServer/1.0 3730 13.7.2. Server to Client 3732 The server can send TEARDOWN requests in the server to client 3733 direction to indicate that the server has been forced to terminate 3734 the ongoing session. This may happen for several reasons, such as 3735 server maintenance without available backup, or that the session has 3736 been inactive for extended periods of time. The reason is provided 3737 in the Terminate-Reason header (Section 16.50). 3739 When a RTSP client has maintained a RTSP session that otherwise is 3740 inactive for an extended period of time the server may reclaim the 3741 resources. That is done by issuing a TEARDOWN request with the 3742 Terminate-Reason set to "Session-Timeout". This MAY be done when the 3743 client has been inactive in the RTSP session for more than one 3744 Session Timeout period (Section 16.47). However, the server is 3745 RECOMMENDED to not perform this operation until an extended period of 3746 inactivity has passed. The time period is considered extended when 3747 it is 10 times the Session Timeout period. Consideration of the 3748 application of the server and its content should be performed when 3749 configuring what is considered as extended periods of time. 3751 In case the server needs to stop providing service to the established 3752 sessions and their is no server to point at in a REDIRECT request 3753 TEARDOWN shall be used to terminate the session. This method can 3754 also be used when non-recoverable internal errors have happened and 3755 the server has no other option then to terminate the sessions. 3757 The TEARDOWN request MUST be only done on the session aggregate 3758 control URI (i.e., it is not allowed to terminate individual media 3759 streams) and MUST include the following headers; Session and 3760 Terminate-Reason headers. The request only applies to the session 3761 identified in the Session header. The server may include a message 3762 to the client's user with the "user-msg" parameter. 3764 The TEARDOWN request may alternatively be done on the wild card URI * 3765 and without any session header. The scope of such a request is 3766 limited to the next-hop (i.e. the RTSP agent in direct communication 3767 with the server) and applies, as well, to the control connection 3768 between the next-hop RTSP agent and the server. This request 3769 indicates that all sessions and pending requests being managed via 3770 the control connection are terminated. Any intervening proxies 3771 SHOULD do all of the following in the order listed: 3773 1. respond to the TEARDOWN request 3775 2. disconnect the control channel from the requesting server 3777 3. pass the TEARDOWN request to each applicable client (typically 3778 those clients with an active session or an unanswered request) 3780 Note: The proxy is responsible for accepting TEARDOWN responses 3781 from its clients; these responses MUST NOT be passed on to either 3782 the original server or the target server in the redirect. 3784 13.8. GET_PARAMETER 3786 The GET_PARAMETER request retrieves the value of any specified 3787 parameter or parameters for a presentation or stream specified in the 3788 URI. If the Session header is present in a request, the value of a 3789 parameter MUST be retrieved in the specified session context. There 3790 are two ways of specifying the parameters to be retrieved. The first 3791 is by including headers which have been defined such that you can use 3792 them for this purpose. Headers for this purpose should allow empty, 3793 or stripped value parts to avoid having to specify bogus data when 3794 indicating the desire to retrieve a value. The successful completion 3795 of the request should also be evident from any filled out values in 3796 the response. The Media-Range header (Section 16.29) is one such 3797 header. The other way is to specify a message body that lists the 3798 parameter(s) that are desired to be retrieved. The Content-Type 3799 header (Section 16.18) is used to specify which format the message 3800 body has. 3802 The headers that MAY be used for retrieving their current value using 3803 GET_PARAMETER are: 3805 o Accept-Ranges 3807 o Media-Range 3809 o Media-Properties 3811 o Range 3812 o RTP-Info 3814 The method MAY also be used without a message body or any header that 3815 request parameters for keep-alive purpose. Any request that is 3816 successful, i.e., a 200 OK response is received, then the keep-alive 3817 timer has been updated. Any non-required header present in such a 3818 request may or may not been processed. Normally the presence of 3819 filled out values in the header will be indication that the header 3820 has been processed. However, for cases when this is difficult to 3821 determine, it is recommended to use a feature-tag and the Require 3822 header. Due to this reason it is usually easier if any parameters to 3823 be retrieved are sent in the body, rather than using any header. 3825 Parameters specified within the body of the message must all be 3826 understood by the request receiving agent. If one or more parameters 3827 are not understood a 451 (Parameter Not Understood) MUST be sent 3828 including a body listing these parameters that weren't understood. 3829 If all parameters are understood their values are filled in and 3830 returned in the response message body. 3832 Example: 3834 S->C: GET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3835 CSeq: 431 3836 User-Agent: PhonyClient/1.2 3837 Session: 12345678 3838 Content-Length: 26 3839 Content-Type: text/parameters 3841 packets_received 3842 jitter 3844 C->S: RTSP/2.0 200 OK 3845 CSeq: 431 3846 Session: 12345678 3847 Server: PhonyServer/1.1 3848 Date: Mon, 08 Mar 2010 13:43:23 GMT 3849 Content-Length: 38 3850 Content-Type: text/parameters 3852 packets_received: 10 3853 jitter: 0.3838 3855 13.9. SET_PARAMETER 3857 This method requests to set the value of a parameter or a set of 3858 parameters for a presentation or stream specified by the URI. The 3859 method MAY also be used without a message body. It is the 3860 RECOMMENDED method to be used in arequest sent for the sole purpose 3861 of updating the keep-alive timer. If this request is successful, 3862 i.e. a 200 OK response is received, then the keep-alive timer has 3863 been updated. Any non-required header present in such a request may 3864 or may not been processed. To allow a client to determine if any 3865 such header has been processed, it is necessary to use a feature tag 3866 and the Require header. Due to this reason it is RECOMMENDED that 3867 any parameters are sent in the body, rather than using any header. 3869 A request is RECOMMENDED to only contain a single parameter to allow 3870 the client to determine why a particular request failed. If the 3871 request contains several parameters, the server MUST only act on the 3872 request if all of the parameters can be set successfully. A server 3873 MUST allow a parameter to be set repeatedly to the same value, but it 3874 MAY disallow changing parameter values. If the receiver of the 3875 request does not understand or cannot locate a parameter, error 451 3876 (Parameter Not Understood) MUST be used. In the case a parameter is 3877 not allowed to change, the error code is 458 (Parameter Is Read- 3878 Only). The response body MUST contain only the parameters that have 3879 errors. Otherwise no body MUST be returned. 3881 Note: transport parameters for the media stream MUST only be set with 3882 the SETUP command. 3884 Restricting setting transport parameters to SETUP is for the 3885 benefit of firewalls. 3887 The parameters are split in a fine-grained fashion so that there 3888 can be more meaningful error indications. However, it may make 3889 sense to allow the setting of several parameters if an atomic 3890 setting is desirable. Imagine device control where the client 3891 does not want the camera to pan unless it can also tilt to the 3892 right angle at the same time. 3894 Example: 3896 C->S: SET_PARAMETER rtsp://example.com/fizzle/foo RTSP/2.0 3897 CSeq: 421 3898 User-Agent: PhonyClient/1.2 3899 Session: iixT43KLc 3900 Date: Mon, 08 Mar 2010 14:45:04 GMT 3901 Content-length: 20 3902 Content-type: text/parameters 3904 barparam: barstuff 3906 S->C: RTSP/2.0 451 Parameter Not Understood 3907 CSeq: 421 3908 Session: iixT43KLc 3909 Server: PhonyServer/1.0 3910 Date: Mon, 08 Mar 2010 14:44:56 GMT 3911 Content-length: 10 3912 Content-type: text/parameters 3914 barparam: barstuff 3916 13.10. REDIRECT 3918 The REDIRECT method is issued by a server to inform a client that the 3919 service provided will be terminated and where a corresponding service 3920 can be provided instead. This may happen for different reasons. One 3921 is that the server is being administrated such that it must stop 3922 providing service. Thus the client is required to connect to another 3923 server location to access the resource indicated by the Request-URI. 3925 The REDIRECT request SHALL contain a Terminate-Reason header 3926 (Section 16.50) to inform the client of the reason for the request. 3927 Additional parameters related to the reason may also be included. 3928 The intention here is to allow a server administrator to do a 3929 controlled shutdown of the RTSP server. That requires sufficient 3930 time to inform all entities having associated state with the server 3931 and for them to perform a controlled migration from this server to a 3932 fall back server. 3934 A REDIRECT request with a Session header has end-to-end (i.e. server 3935 to client) scope and applies only to the given session. Any 3936 intervening proxies SHOULD NOT disconnect the control channel while 3937 there are other remaining end-to-end sessions. The REQUIRED Location 3938 header MUST contain a complete absolute URI pointing to the resource 3939 to which the client SHOULD reconnect. Specifically, the Location 3940 MUST NOT contain just the host and port. A client may receive a 3941 REDIRECT request with a Session header, if and only if, an end-to-end 3942 session has been established. 3944 A client may receive a REDIRECT request without a Session header at 3945 any time when it has communication or a connection established with a 3946 server. The scope of such a request is limited to the next-hop (i.e. 3947 the RTSP agent in direct communication with the server) and applies 3948 to all sessions controlled, as well as the control connection between 3949 the next-hop RTSP agent and the server. A REDIRECT request without a 3950 Session header indicates that all sessions and pending requests being 3951 managed via the control connection MUST be redirected. The REQUIRED 3952 Location header, if included in such a request, SHOULD contain an 3953 absolute URI with only the host address and the OPTIONAL port number 3954 of the server to which the RTSP agent SHOULD reconnect. Any 3955 intervening proxies SHOULD do all of the following in the order 3956 listed: 3958 1. respond to the REDIRECT request 3960 2. disconnect the control channel from the requesting server 3962 3. connect to the server at the given host address 3964 4. pass the REDIRECT request to each applicable client (typically 3965 those clients with an active session or an unanswered request) 3967 Note: The proxy is responsible for accepting REDIRECT responses 3968 from its clients; these responses MUST NOT be passed on to either 3969 the original server or the redirected server. 3971 When the server lacks any alternative server and needs to terminate a 3972 session or all sessions the TEARDOWN request SHALL be used instead. 3974 When no Terminate-Reason "time" parameter are included in a REDIRECT 3975 request, the client SHALL perform the redirection immediately and 3976 return a response to the server. The server shall consider the 3977 session as terminated and can free any associated state after it 3978 receives the successful (2xx) response. The server MAY close the 3979 signaling connection upon receiving the response and the client 3980 SHOULD close the signaling connection after sending the 2xx response. 3981 The exception to this is when the client has several sessions on the 3982 server being managed by the given signaling connection. In this 3983 case, the client SHOULD close the connection when it has received and 3984 responded to REDIRECT requests for all the sessions managed by the 3985 signaling connection. 3987 The Terminate-Reason header "time" parameter MAY be used to indicate 3988 the wallclock time by when the redirection MUST have take place. To 3989 allow a client to determine that redirect time without being time 3990 synchronized with the server, the server MUST include a Date header 3991 in the request. The client should have before the redirection time- 3992 line terminated the session and close the control connection. The 3993 server MAY simple cease to provide service when the deadline time has 3994 been reached, or it may issue TEARDOWN requests to the remaining 3995 sessions. 3997 If the REDIRECT request times out following the rules in Section 10.4 3998 the server MAY terminate the session or transport connection that 3999 would be redirected by the request. This is a safeguard against 4000 misbehaving clients that refuse to respond to a REDIRECT request. 4001 That should not provide any benefit. 4003 After a REDIRECT request has been processed, a client that wants to 4004 continue to send or receive media for the resource identified by the 4005 Request-URI will have to establish a new session with the designated 4006 host. If the URI given in the Location header is a valid resource 4007 URI, a client SHOULD issue a DESCRIBE request for the URI. 4009 Note: The media resource indicated by the Location header can be 4010 identical, slightly different or totally different. This is the 4011 reason why a new DESCRIBE request SHOULD be issued. 4013 If the Location header contains only a host address, the client MAY 4014 assume that the media on the new server is identical to the media on 4015 the old server, i.e. all media configuration information from the old 4016 session is still valid except for the host address. However, the 4017 usage of conditional SETUP using MTag identifiers are RECOMMENDED to 4018 verify the assumption. 4020 This example request redirects traffic for this session to the new 4021 server at the given absolute time: 4023 S->C: REDIRECT rtsp://example.com/fizzle/foo RTSP/2.0 4024 CSeq: 732 4025 Location: rtsp://s2.example.com:8001 4026 Terminate-Reason: Server-Admin ;time=19960213T143205Z 4027 Session: uZ3ci0K+Ld-M 4028 Date: Thu, 13 Feb 1996 14:30:43 GMT 4030 C->S: RTSP/2.0 200 OK 4031 CSeq: 732 4032 User-Agent: PhonyClient/1.2 4033 Session: uZ3ci0K+Ld-M 4035 14. Embedded (Interleaved) Binary Data 4037 In order to fulfill certain requirements on the network side, e.g. in 4038 conjunction with network address translators that block RTP traffic 4039 over UDP, it may be necessary to interleave RTSP messages and media 4040 stream data. This interleaving should generally be avoided unless 4041 necessary since it complicates client and server operation and 4042 imposes additional overhead. Also, head of line blocking may cause 4043 problems. Interleaved binary data SHOULD only be used if RTSP is 4044 carried over TCP. Interleaved data is not allowed inside RTSP 4045 messages. 4047 Stream data such as RTP packets is encapsulated by an ASCII dollar 4048 sign (24 decimal), followed by a one-byte channel identifier, 4049 followed by the length of the encapsulated binary data as a binary, 4050 two-byte integer in network byte order. The stream data follows 4051 immediately afterwards, without a CRLF, but including the upper-layer 4052 protocol headers. Each $ block MUST contain exactly one upper-layer 4053 protocol data unit, e.g., one RTP packet. 4054 0 1 2 3 4055 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 4056 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4057 | "$" = 24 | Channel ID | Length in bytes | 4058 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4059 : Length number of bytes of binary data : 4060 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4062 The channel identifier is defined in the Transport header with the 4063 interleaved parameter (Section 16.52). 4065 When the transport choice is RTP, RTCP messages are also interleaved 4066 by the server over the TCP connection. The usage of RTCP messages is 4067 indicated by including a interval containing a second channel in the 4068 interleaved parameter of the Transport header, see Section 16.52. If 4069 RTCP is used, packets MUST be sent on the first available channel 4070 higher than the RTP channel. The channels are bi-directional, using 4071 the same ChannelD in both directions, and therefore RTCP traffic are 4072 sent on the second channel in both directions. 4074 RTCP is sometime needed for synchronization when two or more 4075 streams are interleaved in such a fashion. Also, this provides a 4076 convenient way to tunnel RTP/RTCP packets through the TCP control 4077 connection when required by the network configuration and transfer 4078 them onto UDP when possible. 4080 C->S: SETUP rtsp://example.com/bar.file RTSP/2.0 4081 CSeq: 2 4082 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4083 Accept-Ranges: NPT, SMPTE, UTC 4084 User-Agent: PhonyClient/1.2 4086 S->C: RTSP/2.0 200 OK 4087 CSeq: 2 4088 Date: Thu, 05 Jun 1997 18:57:18 GMT 4089 Transport: RTP/AVP/TCP;unicast;interleaved=5-6 4090 Session: 12345678 4091 Accept-Ranges: NPT 4092 Media-Properties: Random-Access=0.2, Immutable, Unlimited 4094 C->S: PLAY rtsp://example.com/bar.file RTSP/2.0 4095 CSeq: 3 4096 Session: 12345678 4097 User-Agent: PhonyClient/1.2 4099 S->C: RTSP/2.0 200 OK 4100 CSeq: 3 4101 Session: 12345678 4102 Date: Thu, 05 Jun 1997 18:57:19 GMT 4103 RTP-Info: url="rtsp://example.com/bar.file" 4104 ssrc=0D12F123:seq=232433;rtptime=972948234 4105 Range: npt=0-56.8 4106 Seek-Style: RAP 4108 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4109 S->C: $005{2 byte length}{"length" bytes data, w/RTP header} 4110 S->C: $006{2 byte length}{"length" bytes RTCP packet} 4112 15. Status Code Definitions 4114 Where applicable, HTTP status [H10] codes are reused. Status codes 4115 that have the same meaning are not repeated here. See Table 4 for a 4116 listing of which status codes may be returned by which requests. All 4117 error messages, 4xx and 5xx MAY return a body containing further 4118 information about the error. 4120 15.1. Success 1xx 4122 15.1.1. 100 Continue 4124 The client SHOULD continue with its request. This interim response 4125 is used to inform the client that the initial part of the request has 4126 been received and has not yet been rejected by the server. The 4127 client SHOULD continue by sending the remainder of the request or, if 4128 the request has already been completed, ignore this response. The 4129 server MUST send a final response after the request has been 4130 completed. 4132 15.2. Success 2xx 4134 This class of status code indicates that the client's request was 4135 successfully received, understood, and accepted. 4137 15.2.1. 200 OK 4139 The request has succeeded. The information returned with the 4140 response is dependent on the method used in the request. 4142 15.3. Redirection 3xx 4144 The notation "3rr" indicates response codes from 300 to 399 inclusive 4145 which are meant for redirection. The response code 304 is excluded 4146 from this set, as it is not used for redirection. 4148 Within RTSP, redirection may be used for load balancing or 4149 redirecting stream requests to a server topologically closer to the 4150 client. Mechanisms to determine topological proximity are beyond the 4151 scope of this specification. 4153 A 3rr code MAY be used to respond to any request. It is RECOMMENDED 4154 that they are used if necessary before a session is established, 4155 i.e., in response to DESCRIBE or SETUP. However, in cases where a 4156 server is not able to send a REDIRECT request to the client, the 4157 server MAY need to resort to using 3rr responses to inform a client 4158 with an established session about the need for redirecting the 4159 session. If a 3rr response is received for a request in relation to 4160 an established session, the client SHOULD send a TEARDOWN request for 4161 the session, and MAY reestablish the session using the resource 4162 indicated by the Location. 4164 If the Location header is used in a response it MUST contain an 4165 absolute URI pointing out the media resource the client is redirected 4166 to, the URI MUST NOT only contain the host name. 4168 15.3.1. 301 Moved Permanently 4170 The request resource are moved permanently and resides now at the URI 4171 given by the location header. The user client SHOULD redirect 4172 automatically to the given URI. This response MUST NOT contain a 4173 message-body. The Location header MUST be included in the response. 4175 15.3.2. 302 Found 4177 The requested resource resides temporarily at the URI given by the 4178 Location header. The Location header MUST be included in the 4179 response. This response is intended to be used for many types of 4180 temporary redirects; e.g., load balancing. It is RECOMMENDED that 4181 the server set the reason phrase to something more meaningful than 4182 "Found" in these cases. The user client SHOULD redirect 4183 automatically to the given URI. This response MUST NOT contain a 4184 message-body. 4186 This example shows a client being redirected to a different server: 4188 C->S: SETUP rtsp://example.com/fizzle/foo RTSP/2.0 4189 CSeq: 2 4190 Transport: RTP/AVP/TCP;unicast;interleaved=0-1 4191 Accept-Ranges: NPT, SMPTE, UTC 4192 User-Agent: PhonyClient/1.2 4194 S->C: RTSP/2.0 302 Try Other Server 4195 CSeq: 2 4196 Location: rtsp://s2.example.com:8001/fizzle/foo 4198 15.3.3. 303 See Other 4200 This status code MUST NOT be used in RTSP 2.0. However, it was 4201 allowed to use in RTSP 1.0 (RFC 2326). 4203 15.3.4. 304 Not Modified 4205 If the client has performed a conditional DESCRIBE or SETUP (see 4206 Section 16.24) and the requested resource has not been modified, the 4207 server SHOULD send a 304 response. This response MUST NOT contain a 4208 message-body. 4210 The response MUST include the following header fields: 4212 o Date 4214 o MTag and/or Content-Location, if the header(s) would have been 4215 sent in a 200 response to the same request. 4217 o Expires, Cache-Control, and/or Vary, if the field-value might 4218 differ from that sent in any previous response for the same 4219 variant. 4221 This response is independent for the DESCRIBE and SETUP requests. 4222 That is, a 304 response to DESCRIBE does NOT imply that the resource 4223 content is unchanged (only the session description) and a 304 4224 response to SETUP does NOT imply that the resource description is 4225 unchanged. The MTag and If-Match headers may be used to link the 4226 DESCRIBE and SETUP in this manner. 4228 15.3.5. 305 Use Proxy 4230 The requested resource MUST be accessed through the proxy given by 4231 the Location field. The Location field gives the URI of the proxy. 4232 The recipient is expected to repeat this single request via the 4233 proxy. 305 responses MUST only be generated by origin servers. 4235 15.4. Client Error 4xx 4237 15.4.1. 400 Bad Request 4239 The request could not be understood by the server due to malformed 4240 syntax. The client SHOULD NOT repeat the request without 4241 modifications. If the request does not have a CSeq header, the 4242 server MUST NOT include a CSeq in the response. 4244 15.4.2. 401 Unauthorized 4246 The request requires user authentication. The response MUST include 4247 a WWW-Authenticate header (Section 16.57) field containing a 4248 challenge applicable to the requested resource. The client MAY 4249 repeat the request with a suitable Authorization header field. If 4250 the request already included Authorization credentials, then the 401 4251 response indicates that authorization has been refused for those 4252 credentials. If the 401 response contains the same challenge as the 4253 prior response, and the user agent has already attempted 4254 authentication at least once, then the user SHOULD be presented the 4255 message body that was given in the response, since that message body 4256 might include relevant diagnostic information. HTTP access 4257 authentication is explained in [RFC2617]. 4259 15.4.3. 402 Payment Required 4261 This code is reserved for future use. 4263 15.4.4. 403 Forbidden 4265 The server understood the request, but is refusing to fulfill it. 4266 Authorization will not help and the request SHOULD NOT be repeated. 4267 If the server wishes to make public why the request has not been 4268 fulfilled, it SHOULD describe the reason for the refusal in the 4269 message body. If the server does not wish to make this information 4270 available to the client, the status code 404 (Not Found) can be used 4271 instead. 4273 15.4.5. 404 Not Found 4275 The server has not found anything matching the Request-URI. No 4276 indication is given of whether the condition is temporary or 4277 permanent. The 410 (Gone) status code SHOULD be used if the server 4278 knows, through some internally configurable mechanism, that an old 4279 resource is permanently unavailable and has no forwarding address. 4280 This status code is commonly used when the server does not wish to 4281 reveal exactly why the request has been refused, or when no other 4282 response is applicable. 4284 15.4.6. 405 Method Not Allowed 4286 The method specified in the request is not allowed for the resource 4287 identified by the Request-URI. The response MUST include an Allow 4288 header containing a list of valid methods for the requested resource. 4289 This status code is also to be used if a request attempts to use a 4290 method not indicated during SETUP. 4292 15.4.7. 406 Not Acceptable 4294 The resource identified by the request is only capable of generating 4295 response message bodies which have content characteristics not 4296 acceptable according to the accept headers sent in the request. 4298 The response SHOULD include an message body containing a list of 4299 available message body characteristics and location(s) from which the 4300 user or user agent can choose the one most appropriate. The message 4301 body format is specified by the media type given in the Content-Type 4302 header field. Depending upon the format and the capabilities of the 4303 user agent, selection of the most appropriate choice MAY be performed 4304 automatically. However, this specification does not define any 4305 standard for such automatic selection. 4307 If the response could be unacceptable, a user agent SHOULD 4308 temporarily stop receipt of more data and query the user for a 4309 decision on further actions. 4311 15.4.8. 407 Proxy Authentication Required 4313 This code is similar to 401 (Unauthorized) (Section 15.4.2), but 4314 indicates that the client must first authenticate itself with the 4315 proxy. The proxy MUST return a Proxy-Authenticate header field 4316 (Section 16.33) containing a challenge applicable to the proxy for 4317 the requested resource. 4319 15.4.9. 408 Request Timeout 4321 The client did not produce a request within the time that the server 4322 was prepared to wait. The client MAY repeat the request without 4323 modifications at any later time. 4325 15.4.10. 410 Gone 4327 The requested resource is no longer available at the server and the 4328 forwarding address is not known. This condition is expected to be 4329 considered permanent. If the server does not know, or has no 4330 facility to determine, whether or not the condition is permanent, the 4331 status code 404 (Not Found) SHOULD be used instead. This response is 4332 cacheable unless indicated otherwise. 4334 The 410 response is primarily intended to assist the task of 4335 repository maintenance by notifying the recipient that the resource 4336 is intentionally unavailable and that the server owners desire that 4337 remote links to that resource be removed. Such an event is common 4338 for limited-time, promotional services and for resources belonging to 4339 individuals no longer working at the server's site. It is not 4340 necessary to mark all permanently unavailable resources as "gone" or 4341 to keep the mark for any length of time -- that is left to the 4342 discretion of the owner of the server. 4344 15.4.11. 411 Length Required 4346 The server refuses to accept the request without a defined Content- 4347 Length. The client MAY repeat the request if it adds a valid 4348 Content-Length header field containing the length of the message-body 4349 in the request message. 4351 15.4.12. 412 Precondition Failed 4353 The precondition given in one or more of the request-header fields 4354 evaluated to false when it was tested on the server. This response 4355 code allows the client to place preconditions on the current resource 4356 meta information (header field data) and thus prevent the requested 4357 method from being applied to a resource other than the one intended. 4359 15.4.13. 413 Request Message Body Too Large 4361 The server is refusing to process a request because the request 4362 message body is larger than the server is willing or able to process. 4363 The server MAY close the connection to prevent the client from 4364 continuing the request. 4366 If the condition is temporary, the server SHOULD include a Retry- 4367 After header field to indicate that it is temporary and after what 4368 time the client MAY try again. 4370 15.4.14. 414 Request-URI Too Long 4372 The server is refusing to service the request because the Request-URI 4373 is longer than the server is willing to interpret. This rare 4374 condition is only likely to occur when a client has used a request 4375 with long query information, when the client has descended into a URI 4376 "black hole" of redirection (e.g., a redirected URI prefix that 4377 points to a suffix of itself), or when the server is under attack by 4378 a client attempting to exploit security holes present in some servers 4379 using fixed-length buffers for reading or manipulating the Request- 4380 URI. 4382 15.4.15. 415 Unsupported Media Type 4384 The server is refusing to service the request because the message 4385 body of the request is in a format not supported by the requested 4386 resource for the requested method. 4388 15.4.16. 451 Parameter Not Understood 4390 The recipient of the request does not support one or more parameters 4391 contained in the request. When returning this error message the 4392 sender SHOULD return a message body containing the offending 4393 parameter(s). 4395 15.4.17. 452 reserved 4397 This error code was removed from RFC 2326 [RFC2326] as it is 4398 obsolete. This error code MUST NOT be used anymore. 4400 15.4.18. 453 Not Enough Bandwidth 4402 The request was refused because there was insufficient bandwidth. 4403 This may, for example, be the result of a resource reservation 4404 failure. 4406 15.4.19. 454 Session Not Found 4408 The RTSP session identifier in the Session header is missing, 4409 invalid, or has timed out. 4411 15.4.20. 455 Method Not Valid in This State 4413 The client or server cannot process this request in its current 4414 state. The response MUST contain an Allow header to make error 4415 recovery possible. 4417 15.4.21. 456 Header Field Not Valid for Resource 4419 The server could not act on a required request header. For example, 4420 if PLAY contains the Range header field but the stream does not allow 4421 seeking. This error message may also be used for specifying when the 4422 time format in Range is impossible for the resource. In that case 4423 the Accept-Ranges header MUST be returned to inform the client of 4424 which format(s) that are allowed. 4426 15.4.22. 457 Invalid Range 4428 The Range value given is out of bounds, e.g., beyond the end of the 4429 presentation. 4431 15.4.23. 458 Parameter Is Read-Only 4433 The parameter to be set by SET_PARAMETER can be read but not 4434 modified. When returning this error message the sender SHOULD return 4435 a message body containing the offending parameter(s). 4437 15.4.24. 459 Aggregate Operation Not Allowed 4439 The requested method may not be applied on the URI in question since 4440 it is an aggregate (presentation) URI. The method may be applied on 4441 a media URI. 4443 15.4.25. 460 Only Aggregate Operation Allowed 4445 The requested method may not be applied on the URI in question since 4446 it is not an aggregate control (presentation) URI. The method may be 4447 applied on the aggregate control URI. 4449 15.4.26. 461 Unsupported Transport 4451 The Transport field did not contain a supported transport 4452 specification. 4454 15.4.27. 462 Destination Unreachable 4456 The data transmission channel could not be established because the 4457 client address could not be reached. This error will most likely be 4458 the result of a client attempt to place an invalid dest_addr 4459 parameter in the Transport field. 4461 15.4.28. 463 Destination Prohibited 4463 The data transmission channel was not established because the server 4464 prohibited access to the client address. This error is most likely 4465 the result of a client attempt to redirect media traffic to another 4466 destination with a dest_addr parameter in the Transport header. 4468 15.4.29. 464 Data Transport Not Ready Yet 4470 The data transmission channel to the media destination is not yet 4471 ready for carrying data. However, the responding agent still expects 4472 that the data transmission channel will be established at some point 4473 in time. Note, however, that this may result in a permanent failure 4474 like 462 "Destination Unreachable". 4476 An example when this error may occur is in the case a client sends a 4477 PLAY request to a server prior to ensuring that the TCP connections 4478 negotiated for carrying media data was successful established (In 4479 violation of this specification). The server would use this error 4480 code to indicate that the requested action could not be performed due 4481 to the failure of completing the connection establishment. 4483 15.4.30. 465 Notification Reason Unknown 4485 This indicates that the client has received a PLAY_NOTIFY 4486 (Section 13.5) with a Notify-Reason header (Section 16.31) unknown to 4487 the client. 4489 15.4.31. 470 Connection Authorization Required 4491 The secured connection attempt needs user or client authorization 4492 before proceeding. The next hops certificate is included in this 4493 response in the Accept-Credentials header. 4495 15.4.32. 471 Connection Credentials not accepted 4497 When performing a secure connection over multiple connections, a 4498 intermediary has refused to connect to the next hop and carry out the 4499 request due to unacceptable credentials for the used policy. 4501 15.4.33. 472 Failure to establish secure connection 4503 A proxy fails to establish a secure connection to the next hop RTSP 4504 agent. This is primarily caused by a fatal failure at the TLS 4505 handshake, for example due to server not accepting any cipher suits. 4507 15.5. Server Error 5xx 4509 Response status codes beginning with the digit "5" indicate cases in 4510 which the server is aware that it has erred or is incapable of 4511 performing the request The server SHOULD include an message body 4512 containing an explanation of the error situation, and whether it is a 4513 temporary or permanent condition. User agents SHOULD display any 4514 included message body to the user. These response codes are 4515 applicable to any request method. 4517 15.5.1. 500 Internal Server Error 4519 The server encountered an unexpected condition which prevented it 4520 from fulfilling the request. 4522 15.5.2. 501 Not Implemented 4524 The server does not support the functionality required to fulfill the 4525 request. This is the appropriate response when the server does not 4526 recognize the request method and is not capable of supporting it for 4527 any resource. 4529 15.5.3. 502 Bad Gateway 4531 The server, while acting as a gateway or proxy, received an invalid 4532 response from the upstream server it accessed in attempting to 4533 fulfill the request. 4535 15.5.4. 503 Service Unavailable 4537 The server is currently unable to handle the request due to a 4538 temporary overloading or maintenance of the server. The implication 4539 is that this is a temporary condition which will be alleviated after 4540 some delay. If known, the length of the delay MAY be indicated in a 4541 Retry-After header. If no Retry-After is given, the client SHOULD 4542 handle the response as it would for a 500 response. 4544 Note: The existence of the 503 status code does not imply that 4545 a server must use it when becoming overloaded. Some servers 4546 may wish to simply refuse the connection. 4548 15.5.5. 504 Gateway Timeout 4550 The server, while acting as a proxy, did not receive a timely 4551 response from the upstream server specified by the URI or some other 4552 auxiliary server (e.g. DNS) it needed to access in attempting to 4553 complete the request. 4555 15.5.6. 505 RTSP Version Not Supported 4557 The server does not support, or refuses to support, the RTSP protocol 4558 version that was used in the request message. The server is 4559 indicating that it is unable or unwilling to complete the request 4560 using the same major version as the client other than with this error 4561 message. The response SHOULD contain an message body describing why 4562 that version is not supported and what other protocols are supported 4563 by that server. 4565 15.5.7. 551 Option not supported 4567 A feature-tag given in the Require or the Proxy-Require fields was 4568 not supported. The Unsupported header MUST be returned stating the 4569 feature for which there is no support. 4571 16. Header Field Definitions 4573 +---------------+----------------+--------+---------+------+ 4574 | method | direction | object | acronym | Body | 4575 +---------------+----------------+--------+---------+------+ 4576 | DESCRIBE | C -> S | P,S | DES | r | 4577 | | | | | | 4578 | GET_PARAMETER | C -> S, S -> C | P,S | GPR | R,r | 4579 | | | | | | 4580 | OPTIONS | C -> S, S -> C | P,S | OPT | | 4581 | | | | | | 4582 | PAUSE | C -> S | P,S | PSE | | 4583 | | | | | | 4584 | PLAY | C -> S | P,S | PLY | | 4585 | | | | | | 4586 | PLAY_NOTIFY | S -> C | P,S | PNY | R | 4587 | | | | | | 4588 | REDIRECT | S -> C | P,S | RDR | | 4589 | | | | | | 4590 | SETUP | C -> S | S | STP | | 4591 | | | | | | 4592 | SET_PARAMETER | C -> S, S -> C | P,S | SPR | R,r | 4593 | | | | | | 4594 | TEARDOWN | C -> S | P,S | TRD | | 4595 | | | | | | 4596 | | S -> C | P | TRD | | 4597 +---------------+----------------+--------+---------+------+ 4599 Table 8: Overview of RTSP methods, their direction, and what objects 4600 (P: presentation, S: stream) they operate on. Body notes if a method 4601 is allowed to carry body and in which direction, R = Request, 4602 r=response. Note: It is allowed for all error messages 4xx and 5xx to 4603 have a body 4605 The general syntax for header fields is covered in Section 5.2. This 4606 section lists the full set of header fields along with notes on 4607 meaning, and usage. The syntax definition for header fields are 4608 present in Section 20.2.3. Throughout this section, we use [HX.Y] to 4609 informational refer to Section X.Y of the current HTTP/1.1 4610 specification RFC 2616 [RFC2616]. Examples of each header field are 4611 given. 4613 Information about header fields in relation to methods and proxy 4614 processing is summarized in Table 9, Table 10, Table 11, and 4615 Table 12. 4617 The "where" column describes the request and response types in which 4618 the header field can be used. Values in this column are: 4620 R: header field may only appear in requests; 4622 r: header field may only appear in responses; 4624 2xx, 4xx, etc.: A numerical value or range indicates response codes 4625 with which the header field can be used; 4627 c: header field is copied from the request to the response. 4629 An empty entry in the "where" column indicates that the header field 4630 may be present in both requests and responses. 4632 The "proxy" column describes the operations a proxy may perform on a 4633 header field. An empty proxy column indicates that the proxy MUST 4634 NOT do any changes to that header, all allowed operations are 4635 explicitly stated: 4637 a: A proxy can add or concatenate the header field if not present. 4639 m: A proxy can modify an existing header field value. 4641 d: A proxy can delete a header field value. 4643 r: A proxy needs to be able to read the header field, and thus 4644 this header field cannot be encrypted. 4646 The rest of the columns relate to the presence of a header field in a 4647 method. The method names when abbreviated, are according to Table 8: 4649 c: Conditional; requirements on the header field depend on the 4650 context of the message. 4652 m: The header field is mandatory. 4654 m*: The header field SHOULD be sent, but clients/servers need to be 4655 prepared to receive messages without that header field. 4657 o: The header field is optional. 4659 *: The header field MUST be present if the message body is not 4660 empty. See Section 16.16, Section 16.18 and Section 5.3 for 4661 details. 4663 -: The header field is not applicable. 4665 "Optional" means that a Client/Server MAY include the header field in 4666 a request or response. The Client/Server behavior when receiving 4667 such headers varies, for some it may ignore the header field, in 4668 other case it is request to process the header. This is regulated by 4669 the method and header descriptions. Example of headers that require 4670 processing are the Require and Proxy-Require header fields discussed 4671 in Section 16.41 and Section 16.35. A "mandatory" header field MUST 4672 be present in a request, and MUST be understood by the Client/Server 4673 receiving the request. A mandatory response header field MUST be 4674 present in the response, and the header field MUST be understood by 4675 the Client/Server processing the response. "Not applicable" means 4676 that the header field MUST NOT be present in a request. If one is 4677 placed in a request by mistake, it MUST be ignored by the Client/ 4678 Server receiving the request. Similarly, a header field labeled "not 4679 applicable" for a response means that the Client/Server MUST NOT 4680 place the header field in the response, and the Client/Server MUST 4681 ignore the header field in the response. 4683 An RTSP agent MUST ignore extension headers that are not understood. 4685 The From and Location header fields contain an URI. If the URI 4686 contains a comma, or semicolon, the URI MUST be enclosed in double 4687 quotes ("). Any URI parameters are contained within these quotes. 4688 If the URI is not enclosed in double quotas, any semicolon- delimited 4689 parameters are header-parameters, not URI parameters. 4691 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4692 | Header | Where | Pro | DE | OPT | STP | PLY | PSE | TRD | 4693 | | | xy | S | | | | | | 4694 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4695 | Accept | R | | o | - | - | - | - | - | 4696 | | | | | | | | | | 4697 | Accept-Credentia | R | rm | o | o | o | o | o | o | 4698 | ls | | | | | | | | | 4699 | | | | | | | | | | 4700 | Accept-Encoding | R | r | o | - | - | - | - | - | 4701 | | | | | | | | | | 4702 | Accept-Language | R | r | o | - | - | - | - | - | 4703 | | | | | | | | | | 4704 | Accept-Ranges | R | r | - | - | m | - | - | - | 4705 | | | | | | | | | | 4706 | Accept-Ranges | r | r | - | - | m | - | - | - | 4707 | | | | | | | | | | 4708 | Accept-Ranges | 456 | r | - | - | - | m | - | - | 4709 | | | | | | | | | | 4710 | Allow | r | am | c | c | c | - | - | - | 4711 | | | | | | | | | | 4712 | Allow | 405 | am | m | m | m | m | m | m | 4713 | | | | | | | | | | 4714 | Authorization | R | | o | o | o | o | o | o | 4715 | | | | | | | | | | 4716 | Bandwidth | R | | o | o | o | o | - | - | 4717 | | | | | | | | | | 4718 | Blocksize | R | | o | - | o | o | - | - | 4719 | | | | | | | | | | 4720 | Cache-Control | | r | o | - | o | - | - | - | 4721 | | | | | | | | | | 4722 | Connection | | ad | o | o | o | o | o | o | 4723 | | | | | | | | | | 4724 | Connection-Crede | 470,4 | ar | o | o | o | o | o | o | 4725 | ntials | 07 | | | | | | | | 4726 | | | | | | | | | | 4727 | Content-Base | r | | o | - | - | - | - | - | 4728 | | | | | | | | | | 4729 | Content-Base | 4xx,5 | | o | o | o | o | o | o | 4730 | | xx | | | | | | | | 4731 | | | | | | | | | | 4732 | Content-Encoding | R | r | - | - | - | - | - | - | 4733 | | | | | | | | | | 4734 | Content-Encoding | r | r | o | - | - | - | - | - | 4735 | | | | | | | | | | 4736 | Content-Encoding | 4xx,5 | r | o | o | o | o | o | o | 4737 | | xx | | | | | | | | 4738 | | | | | | | | | | 4739 | Content-Language | R | r | - | - | - | - | - | - | 4740 | | | | | | | | | | 4741 | Content-Language | r | r | o | - | - | - | - | - | 4742 | | | | | | | | | | 4743 | Content-Language | 4xx,5 | r | o | o | o | o | o | o | 4744 | | xx | | | | | | | | 4745 | | | | | | | | | | 4746 | Content-Length | r | r | * | - | - | - | - | - | 4747 | | | | | | | | | | 4748 | Content-Length | 4xx,5 | r | * | * | * | * | * | * | 4749 | | xx | | | | | | | | 4750 | | | | | | | | | | 4751 | Content-Location | r | r | o | - | - | - | - | - | 4752 | | | | | | | | | | 4753 | Content-Location | 4xx,5 | r | o | o | o | o | o | o | 4754 | | xx | | | | | | | | 4755 | | | | | | | | | | 4756 | Content-Type | r | r | * | - | - | - | - | - | 4757 | | | | | | | | | | 4758 | Content-Type | 4xx,5 | ar | * | * | * | * | * | * | 4759 | | xx | | | | | | | | 4760 | | | | | | | | | | 4761 | CSeq | Rc | rm | m | m | m | m | m | m | 4762 | | | | | | | | | | 4763 | Date | | am | o/ | o/* | o/* | o/* | o/* | o/* | 4764 | | | | * | | | | | | 4765 | | | | | | | | | | 4766 | Expires | r | r | o | - | - | - | - | - | 4767 | | | | | | | | | | 4768 | From | R | r | o | o | o | o | o | o | 4769 | | | | | | | | | | 4770 | If-Match | R | r | - | - | o | - | - | - | 4771 | | | | | | | | | | 4772 | If-Modified-Sinc | R | r | o | - | o | - | - | - | 4773 | e | | | | | | | | | 4774 | | | | | | | | | | 4775 | If-None-Match | R | r | o | - | o | - | - | - | 4776 | | | | | | | | | | 4777 | Last-Modified | r | r | o | - | o | - | - | - | 4778 | | | | | | | | | | 4779 | Location | 3rr | | o | o | o | o | o | o | 4780 +------------------+-------+-----+----+-----+-----+-----+-----+-----+ 4782 Table 9: Overview of RTSP header fields (A-L) related to methods 4783 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4785 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4786 | Header | Where | Prox | DES | OPT | STP | PLY | PSE | TRD | 4787 | | | y | | | | | | | 4788 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4789 | Media- | | | - | - | m | m | m | - | 4790 | Properties | | | | | | | | | 4791 | | | | | | | | | | 4792 | Media-Range | | | - | - | m | m | m | - | 4793 | | | | | | | | | | 4794 | MTag | r | r | o | - | o | - | - | - | 4795 | | | | | | | | | | 4796 | Pipelined- | | amdr | - | o | o | o | o | o | 4797 | Requests | | | | | | | | | 4798 | | | | | | | | | | 4799 | Proxy- | 407 | amr | m | m | m | m | m | m | 4800 | Authenticate | | | | | | | | | 4801 | | | | | | | | | | 4802 | Proxy- | R | rd | o | o | o | o | o | o | 4803 | Authorization | | | | | | | | | 4804 | | | | | | | | | | 4805 | Proxy- | R | ar | o | o | o | o | o | o | 4806 | Require | | | | | | | | | 4807 | | | | | | | | | | 4808 | Proxy- | r | r | c | c | c | c | c | c | 4809 | Require | | | | | | | | | 4810 | | | | | | | | | | 4811 | Proxy- | R | amr | c | c | c | c | c | c | 4812 | Supported | | | | | | | | | 4813 | | | | | | | | | | 4814 | Proxy- | r | | c | c | c | c | c | c | 4815 | Supported | | | | | | | | | 4816 | | | | | | | | | | 4817 | Public | r | amr | - | m | - | - | - | - | 4818 | | | | | | | | | | 4819 | Public | 501 | amr | m | m | m | m | m | m | 4820 | | | | | | | | | | 4821 | Range | R | | - | - | - | o | - | - | 4822 | | | | | | | | | | 4823 | Range | r | | - | - | c | m | m | - | 4824 | | | | | | | | | | 4825 | Terminate-Rea | R | r | - | - | - | - | - | - | 4826 | son | | | | | | | | | 4827 | | | | | | | | | | 4828 | Referrer | R | | o | o | o | o | o | o | 4829 | | | | | | | | | | 4830 | Request- | R | | - | - | - | - | - | - | 4831 | Status | | | | | | | | | 4832 | | | | | | | | | | 4833 | Require | R | | o | o | o | o | o | o | 4834 | | | | | | | | | | 4835 | Retry-After | 3rr,50 | | o | o | o | o | o | - | 4836 | | 3 | | | | | | | | 4837 | | | | | | | | | | 4838 | Retry-After | 413 | | o | - | - | - | - | - | 4839 | | | | | | | | | | 4840 | RTP-Info | r | | - | - | c | c | - | - | 4841 | | | | | | | | | | 4842 | Scale | R | r | - | - | - | o | - | - | 4843 | | | | | | | | | | 4844 | Scale | r | amr | - | - | - | c | - | - | 4845 | | | | | | | | | | 4846 | Seek-Style | R | | - | - | - | o | - | - | 4847 | | | | | | | | | | 4848 | Seek-Style | r | | - | - | - | m | - | - | 4849 | | | | | | | | | | 4850 | Server | R | r | - | o | - | - | - | o | 4851 | | | | | | | | | | 4852 | Server | r | r | o | o | o | o | o | o | 4853 | | | | | | | | | | 4854 | Session | R | r | - | o | o | m | m | m | 4855 | | | | | | | | | | 4856 | Session | r | r | - | c | m | m | m | o | 4857 | | | | | | | | | | 4858 | Speed | R | admr | - | - | - | o | - | - | 4859 | Speed | r | admr | - | - | - | c | - | - | 4860 | | | | | | | | | | 4861 | Supported | R | amr | o | o | o | o | o | o | 4862 | | | | | | | | | | 4863 | Supported | r | amr | c | c | c | c | c | c | 4864 | | | | | | | | | | 4865 | Timestamp | R | admr | o | o | o | o | o | o | 4866 | | | | | | | | | | 4867 | Timestamp | c | admr | m | m | m | m | m | m | 4868 | | | | | | | | | | 4869 | Transport | | mr | - | - | m | - | - | - | 4870 | | | | | | | | | | 4871 | Unsupported | r | | c | c | c | c | c | c | 4872 | | | | | | | | | | 4873 | User-Agent | R | | m* | m* | m* | m* | m* | m* | 4874 | | | | | | | | | | 4875 | Vary | r | | c | c | c | c | c | c | 4876 | | | | | | | | | | 4877 | Via | R | amr | o | o | o | o | o | o | 4878 | | | | | | | | | | 4879 | Via | c | dr | m | m | m | m | m | m | 4880 | | | | | | | | | | 4881 | WWW- | 401 | | m | m | m | m | m | m | 4882 | Authenticate | | | | | | | | | 4883 +---------------+--------+------+-----+-----+-----+-----+-----+-----+ 4885 Table 10: Overview of RTSP header fields (P-W) related to methods 4886 DESCRIBE, OPTIONS, SETUP, PLAY, PAUSE, and TEARDOWN. 4888 +------------------------+---------+-------+-----+-----+-----+-----+ 4889 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4890 +------------------------+---------+-------+-----+-----+-----+-----+ 4891 | Accept | R | arm | o | o | - | - | 4892 | | | | | | | | 4893 | Accept-Credentials | R | rm | o | o | o | - | 4894 | | | | | | | | 4895 | Accept-Ranges | | rm | o | - | - | - | 4896 | | | | | | | | 4897 | Allow | 405 | amr | m | m | m | - | 4898 | | | | | | | | 4899 | Authorization | R | | o | o | o | - | 4900 | | | | | | | | 4901 | Bandwidth | R | | - | o | - | - | 4902 | | | | | | | | 4903 | Blocksize | R | | - | o | - | - | 4904 | | | | | | | | 4905 | Connection | | | o | o | o | o | 4906 | | | | | | | | 4907 | Cache-Control | | r | o | o | - | - | 4908 | | | | | | | | 4909 | Connection-Credentials | 470,407 | ar | o | o | o | - | 4910 | | | | | | | | 4911 | Content-Base | R | | o | o | - | - | 4912 | | | | | | | | 4913 | Content-Base | r | | o | o | - | - | 4914 | | | | | | | | 4915 | Content-Base | 4xx,5xx | | o | o | o | o | 4916 | | | | | | | | 4917 | Content-Encoding | R | r | o | o | - | - | 4918 | | | | | | | | 4919 | Content-Encoding | r | r | o | o | - | - | 4920 | | | | | | | | 4921 | Content-Encoding | 4xx,5xx | r | o | o | o | o | 4922 | | | | | | | | 4923 | Content-Language | R | r | o | o | - | - | 4924 | | | | | | | | 4925 | Content-Language | r | r | o | o | - | - | 4926 | | | | | | | | 4927 | Content-Language | 4xx,5xx | r | o | o | o | o | 4928 | | | | | | | | 4929 | Content-Length | R | r | * | * | - | - | 4930 | | | | | | | | 4931 | Content-Length | r | r | * | * | - | - | 4932 | | | | | | | | 4933 | Content-Length | 4xx,5xx | r | * | * | * | * | 4934 | | | | | | | | 4935 | Content-Location | R | | o | o | - | - | 4936 | | | | | | | | 4937 | Content-Location | r | | o | o | - | - | 4938 | | | | | | | | 4939 | Content-Location | 4xx,5xx | | o | o | o | o | 4940 | | | | | | | | 4941 | Content-Type | R | | * | * | - | - | 4942 | | | | | | | | 4943 | Content-Type | r | | * | * | - | - | 4944 | | | | | | | | 4945 | Content-Type | 4xx,5xx | | * | * | * | * | 4946 | | | | | | | | 4947 | CSeq | R,c | mr | m | m | m | m | 4948 | | | | | | | | 4949 | Date | R | a | o | o | m | o | 4950 | | | | | | | | 4951 | Date | r | am | o | o | o | o | 4952 | | | | | | | | 4953 | If-Modified-Since | R | am | o | - | - | - | 4954 | | | | | | | | 4955 | If-None-Match | R | am | o | - | - | - | 4956 | | | | | | | | 4957 | From | R | r | o | o | o | - | 4958 | | | | | | | | 4959 | Last-Modified | R | r | - | - | - | - | 4960 | | | | | | | | 4961 | Last-Modified | r | r | o | - | - | - | 4962 | | | | | | | | 4963 | Location | 3rr | | o | o | o | - | 4964 | | | | | | | | 4965 | Location | R | | - | - | m | - | 4966 | | | | | | | | 4967 | Media-Properties | R | amr | o | - | - | c | 4968 | | | | | | | | 4969 | Media-Properties | r | mr | c | - | - | - | 4970 | | | | | | | | 4971 | Media-Range | R | | o | - | - | c | 4972 | | | | | | | | 4973 | Media-Range | r | | c | - | - | - | 4974 | | | | | | | | 4975 | Notify-Reason | R | | - | - | - | m | 4976 | | | | | | | | 4977 | Pipelined-Requests | R | amdr | o | o | - | - | 4978 | | | | | | | | 4979 | Proxy-Authenticate | 407 | amr | m | m | m | - | 4980 | | | | | | | | 4981 | Proxy-Authorization | R | rd | o | o | o | - | 4982 | | | | | | | | 4983 | Proxy-Require | R | ar | o | o | o | - | 4984 | | | | | | | | 4985 | Proxy-Require | r | r | c | c | c | - | 4986 | | | | | | | | 4987 | Proxy-Supported | R | amr | c | c | c | - | 4988 | | | | | | | | 4989 | Proxy-Supported | r | | c | c | c | - | 4990 | | | | | | | | 4991 | Public | 501 | admr | m | m | m | - | 4992 +------------------------+---------+-------+-----+-----+-----+-----+ 4994 Table 11: Overview of RTSP header fields (A-P) related to methods 4995 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 4997 +------------------+---------+-------+-----+-----+-----+-----+ 4998 | Header | Where | Proxy | GPR | SPR | RDR | PNY | 4999 +------------------+---------+-------+-----+-----+-----+-----+ 5000 | Range | R | | o | - | o | m | 5001 | | | | | | | | 5002 | Referrer | R | | o | o | o | - | 5003 | Request-Status | R | | - | - | - | c | 5004 | | | | | | | | 5005 | Require | R | r | o | o | o | - | 5006 | | | | | | | | 5007 | Retry-After | 3rr,503 | | o | o | - | - | 5008 | | | | | | | | 5009 | Retry-After | 413 | | o | o | - | - | 5010 | | | | | | | | 5011 | RTP-Info | R | r | o | - | - | C | 5012 | | | | | | | | 5013 | RTP-Info | r | r | c | - | - | - | 5014 | | | | | | | | 5015 | Scale | | | - | - | - | c | 5016 | | | | | | | | 5017 | Seek-Style | | | - | - | - | - | 5018 | | | | | | | | 5019 | Session | R | r | o | o | o | m | 5020 | | | | | | | | 5021 | Session | r | r | c | c | o | m | 5022 | | | | | | | | 5023 | Server | R | r | o | o | o | o | 5024 | | | | | | | | 5025 | Server | r | r | o | o | - | - | 5026 | | | | | | | | 5027 | Speed | | | - | - | - | - | 5028 | | | | | | | | 5029 | Supported | R | adrm | o | o | o | - | 5030 | | | | | | | | 5031 | Supported | r | adrm | c | c | c | - | 5032 | | | | | | | | 5033 | Terminate-Reason | R | r | - | - | m | - | 5034 | | | | | | | | 5035 | Timestamp | R | adrm | o | o | o | - | 5036 | | | | | | | | 5037 | Timestamp | c | adrm | m | m | m | - | 5038 | | | | | | | | 5039 | Unsupported | r | arm | c | c | c | - | 5040 | | | | | | | | 5041 | User-Agent | R | r | m* | m* | - | - | 5042 | | | | | | | | 5043 | User-Agent | r | r | m* | m* | m* | m* | 5044 | | | | | | | | 5045 | Vary | r | | c | c | - | - | 5046 | | | | | | | | 5047 | Via | R | amr | o | o | o | - | 5048 | | | | | | | | 5049 | Via | c | dr | m | m | m | - | 5050 | | | | | | | | 5051 | WWW-Authenticate | 401 | | m | m | m | - | 5052 +------------------+---------+-------+-----+-----+-----+-----+ 5054 Table 12: Overview of RTSP header fields (R-W) related to methods 5055 GET_PARAMETER, SET_PARAMETER, REDIRECT, and PLAY_NOTIFY. 5057 16.1. Accept 5059 The Accept request-header field can be used to specify certain 5060 presentation description and parameter media types [RFC4288] which 5061 are acceptable for the response to DESCRIBE and GET_PARAMETER 5062 requests. 5064 See Section 20.2.3 for the syntax. 5066 Example of use: 5067 Accept: application/example ;q=1.0, application/sdp 5069 16.2. Accept-Credentials 5071 The Accept-Credentials header is a request header used to indicate to 5072 any trusted intermediary how to handle further secured connections to 5073 proxies or servers. See Section 19 for the usage of this header. It 5074 MUST NOT be included in server to client requests. 5076 In a request the header MUST contain the method (User, Proxy, or Any) 5077 for approving credentials selected by the requester. The method MUST 5078 NOT be changed by any proxy, unless it is "proxy" when a proxy MAY 5079 change it to "user" to take the role of user approving each further 5080 hop. If the method is "User" the header contains zero or more of 5081 credentials that the client accepts. The header may contain zero 5082 credentials in the first RTSP request to a RTSP server when using the 5083 "User" method. This as the client has not yet received any 5084 credentials to accept. Each credential MUST consist of one URI 5085 identifying the proxy or server, the hash algorithm identifier, and 5086 the hash over that agent's DER encoded certificate [RFC5280] in 5087 Base64 [RFC4648]. All RTSP clients and proxies MUST implement the 5088 SHA-256[FIPS-pub-180-2] algorithm for computation of the hash of the 5089 DER encoded certificate. The SHA-256 algorithm is identified by the 5090 token "sha-256". 5092 The intention with allowing for other hash algorithms is to enable 5093 the future retirement of algorithms that are not implemented 5094 somewhere else than here. Thus the definition of future algorithms 5095 for this purpose is intended to be extremely limited. A feature tag 5096 can be used to ensure that support for the replacement algorithm 5097 exist. 5099 Example: 5100 Accept-Credentials:User 5101 "rtsps://proxy2.example.com/";sha-256;exaIl9VMbQMOFGClx5rXnPJKVNI=, 5102 "rtsps://server.example.com/";sha-256;lurbjj5khhB0NhIuOXtt4bBRH1M= 5104 16.3. Accept-Encoding 5106 The Accept-Encoding request-header field is similar to Accept, but 5107 restricts the content-codings, i.e. transformation codings of the 5108 message body like gzip compression, that are acceptable in the 5109 response. 5111 A server tests whether a content-coding is acceptable, according to 5112 an Accept-Encoding field, using these rules: 5114 1. If the content-coding is one of the content-codings listed in the 5115 Accept-Encoding field, then it is acceptable, unless it is 5116 accompanied by a qvalue of 0. (As defined in section 3.9, a 5117 qvalue of 0 means "not acceptable.") 5119 2. The special "*" symbol in an Accept-Encoding field matches any 5120 available content-coding not explicitly listed in the header 5121 field. 5123 3. If multiple content-codings are acceptable, then the acceptable 5124 content-coding with the highest non-zero qvalue is preferred. 5126 4. The "identity" content-coding is always acceptable, i.e. no 5127 transformation at all, unless specifically refused because the 5128 Accept-Encoding field includes "identity;q=0", or because the 5129 field includes "*;q=0" and does not explicitly include the 5130 "identity" content-coding. If the Accept-Encoding field-value is 5131 empty, then only the "identity" encoding is acceptable. 5133 If an Accept-Encoding field is present in a request, and if the 5134 server cannot send a response which is acceptable according to the 5135 Accept-Encoding header, then the server SHOULD send an error response 5136 with the 406 (Not Acceptable) status code. 5138 If no Accept-Encoding field is present in a request, the server MAY 5139 assume that the client will accept any content coding. In this case, 5140 if "identity" is one of the available content-codings, then the 5141 server SHOULD use the "identity" content-coding, unless it has 5142 additional information that a different content-coding is meaningful 5143 to the client. 5145 16.4. Accept-Language 5147 The Accept-Language request-header field is similar to Accept, but 5148 restricts the set of natural languages that are preferred as a 5149 response to the request. Note that the language specified applies to 5150 the presentation description and any reason phrases, but not the 5151 media content. 5153 A language tag identifies a natural language spoken, written, or 5154 otherwise conveyed by human beings for communication of information 5155 to other human beings. Computer languages are explicitly excluded. 5156 The syntax and registry of RTSP 2.0 language tags is the same as that 5157 defined by [RFC5646]. 5159 Each language-range MAY be given an associated quality value which 5160 represents an estimate of the user's preference for the languages 5161 specified by that range. The quality value defaults to "q=1". For 5162 example: 5164 Accept-Language: da, en-gb;q=0.8, en;q=0.7 5166 would mean: "I prefer Danish, but will accept British English and 5167 other types of English." A language-range matches a language-tag if 5168 it exactly equals the tag, or if it exactly equals a prefix of the 5169 tag such that the first tag character following the prefix is "-". 5170 The special range "*", if present in the Accept-Language field, 5171 matches every tag not matched by any other range present in the 5172 Accept-Language field. 5174 Note: This use of a prefix matching rule does not imply that 5175 language tags are assigned to languages in such a way that it is 5176 always true that if a user understands a language with a certain 5177 tag, then this user will also understand all languages with tags 5178 for which this tag is a prefix. The prefix rule simply allows the 5179 use of prefix tags if this is the case. 5181 The language quality factor assigned to a language-tag by the Accept- 5182 Language field is the quality value of the longest language-range in 5183 the field that matches the language-tag. If no language-range in the 5184 field matches the tag, the language quality factor assigned is 0. If 5185 no Accept-Language header is present in the request, the server 5186 SHOULD assume that all languages are equally acceptable. If an 5187 Accept-Language header is present, then all languages which are 5188 assigned a quality factor greater than 0 are acceptable. 5190 16.5. Accept-Ranges 5192 The Accept-Ranges general-header field allows indication of the 5193 format supported in the Range header. The client MUST include the 5194 header in SETUP requests to indicate which formats it support to 5195 receive in PLAY and PAUSE responses, and REDIRECT requests. The 5196 server MUST include the header in SETUP and 456 error responses to 5197 indicate the formats supported for the resource indicated by the 5198 request URI. The header MAY be included in GET_PARAMETER request and 5199 response pairs. The GET_PARAMETER request MUST contain a Session 5200 header to identify the session context the request are related to. 5201 The requester and responder will indicate their capabilities 5202 regarding Range formats respectively. 5204 Accept-Ranges: NPT, SMPTE 5206 The syntax is defined in Section 20.2.3. 5208 16.6. Allow 5210 The Allow message-header field lists the methods supported by the 5211 resource identified by the Request-URI. The purpose of this field is 5212 to strictly inform the recipient of valid methods associated with the 5213 resource. An Allow header field MUST be present in a 405 (Method Not 5214 Allowed) response. The Allow header MUST also be present in all 5215 OPTIONS responses where the content of the header will not include 5216 exactly the same methods as listed in the Public header. 5218 The Allow MUST also be included in SETUP and DESCRIBE responses, if 5219 the methods allowed for the resource is different than the minimal 5220 implementation set. 5222 Example of use: 5223 Allow: SETUP, PLAY, SET_PARAMETER, DESCRIBE 5225 16.7. Authorization 5227 An RTSP client that wishes to authenticate itself with a server using 5228 authentication mechanism from HTTP [RFC2617] , usually, but not 5229 necessarily, after receiving a 401 response, does so by including an 5230 Authorization request-header field with the request. The 5231 Authorization field value consists of credentials containing the 5232 authentication information of the user agent for the realm of the 5233 resource being requested. 5235 If a request is authenticated and a realm specified, the same 5236 credentials SHOULD be valid for all other requests within this realm 5237 (assuming that the authentication scheme itself does not require 5238 otherwise, such as credentials that vary according to a challenge 5239 value or using synchronized clocks). 5241 When a shared cache (see Section 18) receives a request containing an 5242 Authorization field, it MUST NOT return the corresponding response as 5243 a reply to any other request, unless one of the following specific 5244 exceptions holds: 5246 1. If the response includes the "maxage" cache-control directive, 5247 the cache MAY use that response in replying to a subsequent 5248 request. But (if the specified maximum age has passed) a proxy 5249 cache MUST first revalidate it with the origin server, using the 5250 request-headers from the new request to allow the origin server 5251 to authenticate the new request. (This is the defined behavior 5252 for maxage.) If the response includes "maxage=0", the proxy MUST 5253 always revalidate it before re-using it. 5255 2. If the response includes the "must-revalidate" cache-control 5256 directive, the cache MAY use that response in replying to a 5257 subsequent request. But if the response is stale, all caches 5258 MUST first revalidate it with the origin server, using the 5259 request-headers from the new request to allow the origin server 5260 to authenticate the new request. 5262 3. If the response includes the "public" cache-control directive, it 5263 MAY be returned in reply to any subsequent request. 5265 16.8. Bandwidth 5267 The Bandwidth request-header field describes the estimated bandwidth 5268 available to the client, expressed as a positive integer and measured 5269 in kilobits per second. The bandwidth available to the client may 5270 change during an RTSP session, e.g., due to mobility, congestion, 5271 etc. 5273 Example: 5274 Bandwidth: 62360 5276 16.9. Blocksize 5278 The Blocksize request-header field is sent from the client to the 5279 media server asking the server for a particular media packet size. 5280 This packet size does not include lower-layer headers such as IP, 5281 UDP, or RTP. The server is free to use a blocksize which is lower 5282 than the one requested. The server MAY truncate this packet size to 5283 the closest multiple of the minimum, media-specific block size, or 5284 override it with the media-specific size if necessary. The block 5285 size MUST be a positive decimal number, measured in octets. The 5286 server only returns an error (4xx) if the value is syntactically 5287 invalid. 5289 16.10. Cache-Control 5291 The Cache-Control general-header field is used to specify directives 5292 that MUST be obeyed by all caching mechanisms along the request/ 5293 response chain. 5295 Cache directives MUST be passed through by a proxy or gateway 5296 application, regardless of their significance to that application, 5297 since the directives may be applicable to all recipients along the 5298 request/response chain. It is not possible to specify a cache- 5299 directive for a specific cache. 5301 Cache-Control should only be specified in a DESCRIBE, GET_PARAMETER, 5302 SET_PARAMETER and SETUP request and its response. Note: Cache- 5303 Control does not govern only the caching of responses as for HTTP, 5304 instead it also applies to the media stream identified by the SETUP 5305 request. The RTSP requests are generally not cacheable, for further 5306 information see Section 18. Below is the description of the cache 5307 directives that can be included in the Cache-Control header. 5309 no-cache: Indicates that the media stream MUST NOT be cached 5310 anywhere. This allows an origin server to prevent caching even 5311 by caches that have been configured to return stale responses 5312 to client requests. Note, there is no security function 5313 enforcing that the content can't be cached. 5315 public: Indicates that the media stream is cacheable by any cache. 5317 private: Indicates that the media stream is intended for a single 5318 user and MUST NOT be cached by a shared cache. A private (non- 5319 shared) cache may cache the media streams. 5321 no-transform: An intermediate cache (proxy) may find it useful to 5322 convert the media type of a certain stream. A proxy might, for 5323 example, convert between video formats to save cache space or 5324 to reduce the amount of traffic on a slow link. Serious 5325 operational problems may occur, however, when these 5326 transformations have been applied to streams intended for 5327 certain kinds of applications. For example, applications for 5328 medical imaging, scientific data analysis and those using end- 5329 to-end authentication all depend on receiving a stream that is 5330 bit-for-bit identical to the original media stream. Therefore, 5331 if a response includes the no-transform directive, an 5332 intermediate cache or proxy MUST NOT change the encoding of the 5333 stream. Unlike HTTP, RTSP does not provide for partial 5334 transformation at this point, e.g., allowing translation into a 5335 different language. 5337 only-if-cached: In some cases, such as times of extremely poor 5338 network connectivity, a client may want a cache to return only 5339 those media streams that it currently has stored, and not to 5340 receive these from the origin server. To do this, the client 5341 may include the only-if-cached directive in a request. If it 5342 receives this directive, a cache SHOULD either respond using a 5343 cached media stream that is consistent with the other 5344 constraints of the request, or respond with a 504 (Gateway 5345 Timeout) status. However, if a group of caches is being 5346 operated as a unified system with good internal connectivity, 5347 such a request MAY be forwarded within that group of caches. 5349 max-stale: Indicates that the client is willing to accept a media 5350 stream that has exceeded its expiration time. If max-stale is 5351 assigned a value, then the client is willing to accept a 5352 response that has exceeded its expiration time by no more than 5353 the specified number of seconds. If no value is assigned to 5354 max-stale, then the client is willing to accept a stale 5355 response of any age. 5357 min-fresh: Indicates that the client is willing to accept a media 5358 stream whose freshness lifetime is no less than its current age 5359 plus the specified time in seconds. That is, the client wants 5360 a response that will still be fresh for at least the specified 5361 number of seconds. 5363 must-revalidate: When the must-revalidate directive is present in a 5364 SETUP response received by a cache, that cache MUST NOT use the 5365 entry after it becomes stale to respond to a subsequent request 5366 without first revalidating it with the origin server. That is, 5367 the cache is required to do an end-to-end revalidation every 5368 time, if, based solely on the origin server's Expires, the 5369 cached response is stale.) 5371 proxy-revalidate: The proxy-revalidate directive has the same 5372 meaning as the must-revalidate directive, except that it does 5373 not apply to non-shared user agent caches. It can be used on a 5374 response to an authenticated request to permit the user's cache 5375 to store and later return the response without needing to 5376 revalidate it (since it has already been authenticated once by 5377 that user), while still requiring proxies that service many 5378 users to revalidate each time (in order to make sure that each 5379 user has been authenticated). Note that such authenticated 5380 responses also need the public cache control directive in order 5381 to allow them to be cached at all. 5383 max-age: When an intermediate cache is forced, by means of a max- 5384 age=0 directive, to revalidate its own cache entry, and the 5385 client has supplied its own validator in the request, the 5386 supplied validator might differ from the validator currently 5387 stored with the cache entry. In this case, the cache MAY use 5388 either validator in making its own request without affecting 5389 semantic transparency. 5391 However, the choice of validator might affect performance. The best 5392 approach is for the intermediate cache to use its own validator when 5393 making its request. If the server replies with 304 (Not Modified), 5394 then the cache can return its now validated copy to the client with a 5395 200 (OK) response. If the server replies with a new message body and 5396 cache validator, however, the intermediate cache can compare the 5397 returned validator with the one provided in the client's request, 5398 using the strong comparison function. If the client's validator is 5399 equal to the origin server's, then the intermediate cache simply 5400 returns 304 (Not Modified). Otherwise, it returns the new message 5401 body with a 200 (OK) response. 5403 16.11. Connection 5405 The Connection general-header field allows the sender to specify 5406 options that are desired for that particular connection and MUST NOT 5407 be communicated by proxies over further connections. 5409 RTSP 2.0 proxies MUST parse the Connection header field before a 5410 message is forwarded and, for each connection-token in this field, 5411 remove any header field(s) from the message with the same name as the 5412 connection-token. Connection options are signaled by the presence of 5413 a connection-token in the Connection header field, not by any 5414 corresponding additional header field(s), since the additional header 5415 field may not be sent if there are no parameters associated with that 5416 connection option. 5418 Message headers listed in the Connection header MUST NOT include end- 5419 to-end headers, such as Cache-Control. 5421 RTSP 2.0 defines the "close" connection option for the sender to 5422 signal that the connection will be closed after completion of the 5423 response. For example, Connection: close in either the request or 5424 the response header fields indicates that the connection SHOULD NOT 5425 be considered `persistent' (Section 10.2) after the current request/ 5426 response is complete. 5428 The use of the connection option "close" in RTSP messages SHOULD be 5429 limited to error messages when the server is unable to recover and 5430 therefore see it necessary to close the connection. The reason is 5431 that the client has the choice of continuing using a connection 5432 indefinitely, as long as it sends valid messages. 5434 16.12. Connection-Credentials 5436 The Connection-Credentials response header is used to carry the chain 5437 of credentials of any next hop that need to be approved by the 5438 requester. It MUST only be used in server to client responses. 5440 The Connection-Credentials header in an RTSP response MUST, if 5441 included, contain the credential information (in form of a list of 5442 certificates providing the chain of certification) of the next hop 5443 that an intermediary needs to securely connect to. The header MUST 5444 include the URI of the next hop (proxy or server) and a base64 5445 [RFC4648] encoded binary structure containing a sequence of DER 5446 encoded X.509v3 certificates[RFC5280] . 5448 The binary structure starts with the number of certificates 5449 (NR_CERTS) included as a 16 bit unsigned integer. This is followed 5450 by NR_CERTS number of 16 bit unsigned integers providing the size in 5451 octets of each DER encoded certificate. This is followed by NR_CERTS 5452 number of DER encoded X.509v3 certificates in a sequence (chain). 5453 The proxy or server's certificate must come first in the structure. 5454 Each following certificate must directly certify the one preceding 5455 it. Because certificate validation requires that root keys be 5456 distributed independently, the self-signed certificate which 5457 specifies the root certificate authority may optionally be omitted 5458 from the chain, under the assumption that the remote end must already 5459 possess it in order to validate it in any case. 5461 Example: 5463 Connection-Credentials:"rtsps://proxy2.example.com/";MIIDNTCC... 5465 Where MIIDNTCC... is a BASE64 encoding of the following structure: 5467 0 1 2 3 5468 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 5469 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5470 | Number of certificates | Size of certificate #1 | 5471 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5472 | Size of certificate #2 | Size of certificate #3 | 5473 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5474 : DER Encoding of Certificate #1 : 5475 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5476 : DER Encoding of Certificate #2 : 5477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5478 : DER Encoding of Certificate #3 : 5480 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5482 16.13. Content-Base 5484 The Content-Base message-header field may be used to specify the base 5485 URI for resolving relative URIs within the message body. 5487 Content-Base: rtsp://media.example.com/movie/twister/ 5489 If no Content-Base field is present, the base URI of an message body 5490 is defined either by its Content-Location (if that Content-Location 5491 URI is an absolute URI) or the URI used to initiate the request, in 5492 that order of precedence. Note, however, that the base URI of the 5493 contents within the message-body may be redefined within that 5494 message-body. 5496 16.14. Content-Encoding 5498 The Content-Encoding header field is used as a modifier to the media- 5499 type. When present, its value indicates what additional content 5500 codings have been applied to the message body, and thus what decoding 5501 mechanisms must be applied in order to obtain the media-type 5502 referenced by the Content-Type header field. Content-Encoding is 5503 primarily used to allow a document to be compressed without losing 5504 the identity of its underlying media type. 5506 The content-coding is a characteristic of the message body identified 5507 by the Request-URI. Typically, the message body is stored with this 5508 encoding and is only decoded before rendering or analogous usage. 5509 However, a non-transparent proxy MAY modify the content-coding if the 5510 new coding is known to be acceptable to the recipient, unless the 5511 "no-transform" cache-control directive is present in the message. 5513 If the content-coding of an message body is not "identity", then the 5514 response MUST include a Content-Encoding Message-body header that 5515 lists the non-identity content-coding(s) used. 5517 If the content-coding of an message body in a request message is not 5518 acceptable to the origin server, the server SHOULD respond with a 5519 status code of 415 (Unsupported Media Type). 5521 If multiple encodings have been applied to a message body, the 5522 content codings MUST be listed in the order in which they were 5523 applied, first to last from left to right. Additional information 5524 about the encoding parameters MAY be provided by other header fields 5525 not defined by this specification. 5527 16.15. Content-Language 5529 The Content-Language header field describes the natural language(s) 5530 of the intended audience for the enclosed message body. Note that 5531 this might not be equivalent to all the languages used within the 5532 message body. 5534 Language tags are mentioned in Section 16.4. The primary purpose of 5535 Content-Language is to allow a user to identify and differentiate 5536 entities according to the user's own preferred language. Thus, if 5537 the body content is intended only for a Danish-literate audience, the 5538 appropriate field is 5540 Content-Language: da 5542 If no Content-Language is specified, the default is that the content 5543 is intended for all language audiences. This might mean that the 5544 sender does not consider it to be specific to any natural language, 5545 or that the sender does not know for which language it is intended. 5547 Multiple languages MAY be listed for content that is intended for 5548 multiple audiences. For example, a rendition of the "Treaty of 5549 Waitangi," presented simultaneously in the original Maori and English 5550 versions, would call for 5552 Content-Language: mi, en 5554 However, just because multiple languages are present within an 5555 message body does not mean that it is intended for multiple 5556 linguistic audiences. An example would be a beginner's language 5557 primer, such as "A First Lesson in Latin," which is clearly intended 5558 to be used by an English-literate audience. In this case, the 5559 Content-Language would properly only include "en". 5561 Content-Language MAY be applied to any media type -- it is not 5562 limited to textual documents. 5564 16.16. Content-Length 5566 The Content-Length general-header field contains the length of the 5567 message body of the RTSP message (i.e. after the double CRLF 5568 following the last header). Unlike HTTP, it MUST be included in all 5569 messages that carry a message body beyond the header portion of the 5570 RTSP message. If it is missing, a default value of zero is assumed. 5571 Any Content-Length greater than or equal to zero is a valid value. 5573 16.17. Content-Location 5575 The Content-Location header field MAY be used to supply the resource 5576 location for the message body enclosed in the message when that body 5577 is accessible from a location separate from the requested resource's 5578 URI. A server SHOULD provide a Content-Location for the variant 5579 corresponding to the response message body; especially in the case 5580 where a resource has multiple variants associated with it, and those 5581 entities actually have separate locations by which they might be 5582 individually accessed, the server SHOULD provide a Content-Location 5583 for the particular variant which is returned. 5585 The Content-Location value is not a replacement for the original 5586 requested URI; it is only a statement of the location of the resource 5587 corresponding to this particular variant at the time of the request. 5588 Future requests MAY specify the Content-Location URI as the request 5589 URI if the desire is to identify the source of that particular 5590 variant. 5592 A cache cannot assume that an message body with a Content-Location 5593 different from the URI used to retrieve it can be used to respond to 5594 later requests on that Content-Location URI. However, the Content- 5595 Location can be used to differentiate between multiple variants 5596 retrieved from a single requested resource. 5598 If the Content-Location is a relative URI, the relative URI is 5599 interpreted relative to the Request-URI. 5601 16.18. Content-Type 5603 The Content-Type header indicates the media type of the message body 5604 sent to the recipient. Note that the content types suitable for RTSP 5605 are likely to be restricted in practice to presentation descriptions 5606 and parameter-value types. 5608 16.19. CSeq 5610 The CSeq general-header field specifies the sequence number for an 5611 RTSP request-response pair. This field MUST be present in all 5612 requests and responses. For every RTSP request containing the given 5613 sequence number, the corresponding response will have the same 5614 number. Any retransmitted request MUST contain the same sequence 5615 number as the original (i.e. the sequence number is not incremented 5616 for retransmissions of the same request). For each new RTSP request 5617 the CSeq value MUST be incremented by one. The initial sequence 5618 number MAY be any number, however, it is RECOMMENDED to start at 0. 5619 Each sequence number series is unique between each requester and 5620 responder, i.e. the client has one series for its request to a server 5621 and the server has another when sending request to the client. Each 5622 requester and responder is identified with its network address. 5624 Proxies that aggregate several sessions on the same transport will 5625 have to ensure that the requests sent towards a particular server 5626 have a joint sequence number space, i.e., they will regularly need to 5627 renumber the CSeq header field in requests (from proxy to server) and 5628 responses (from server to proxy) to fulfill the rules for the header. 5629 The proxy MUST increase the CSeq by one for each request it 5630 transmits, without regard of different sessions. 5632 Example: 5633 CSeq: 239 5635 16.20. Date 5637 The Date header field represents the date and time at which the 5638 message was originated. The inclusion of the Date header in RTSP 5639 message follows these rules: 5641 o An RTSP message, sent either by the client or the server, 5642 containing a body MUST include a Date header, if the sending host 5643 has a clock; 5645 o Clients and servers are RECOMMENDED to include a Date header in 5646 all other RTSP messages, if the sending host has a clock; 5648 o If the server does not have a clock that can provide a reasonable 5649 approximation of the current time, its responses MUST NOT include 5650 a Date header field. In this case, this rule MUST be followed: 5651 Some origin server implementations might not have a clock 5652 available. An origin server without a clock MUST NOT assign 5653 Expires or Last- Modified values to a response, unless these 5654 values were associated with the resource by a system or user with 5655 a reliable clock. It MAY assign an Expires value that is known, 5656 at or before server configuration time, to be in the past (this 5657 allows "pre-expiration" of responses without storing separate 5658 Expires values for each resource). 5660 A received message that does not have a Date header field MUST be 5661 assigned one by the recipient if the message will be cached by that 5662 recipient . An RTSP implementation without a clock MUST NOT cache 5663 responses without revalidating them on every use. An RTSP cache, 5664 especially a shared cache, SHOULD use a mechanism, such as NTP, to 5665 synchronize its clock with a reliable external standard. 5667 The RTSP-date sent in a Date header SHOULD NOT represent a date and 5668 time subsequent to the generation of the message. It SHOULD 5669 represent the best available approximation of the date and time of 5670 message generation, unless the implementation has no means of 5671 generating a reasonably accurate date and time. In theory, the date 5672 ought to represent the moment just before the message body is 5673 generated. In practice, the date can be generated at any time during 5674 the message origination without affecting its semantic value. 5676 16.21. Expires 5678 The Expires message-header field gives a date and time after which 5679 the description or media-stream should be considered stale. The 5680 interpretation depends on the method: 5682 DESCRIBE response: The Expires header indicates a date and time 5683 after which the presentation description (body) SHOULD be 5684 considered stale. 5686 SETUP response: The Expires header indicate a date and time after 5687 which the media stream SHOULD be considered stale. 5689 A stale cache entry may not normally be returned by a cache (either a 5690 proxy cache or an user agent cache) unless it is first validated with 5691 the origin server (or with an intermediate cache that has a fresh 5692 copy of the message body). See Section 18 for further discussion of 5693 the expiration model. 5695 The presence of an Expires field does not imply that the original 5696 resource will change or cease to exist at, before, or after that 5697 time. 5699 The format is an absolute date and time as defined by RTSP-date. An 5700 example of its use is 5701 Expires: Thu, 01 Dec 1994 16:00:00 GMT 5703 RTSP/2.0 clients and caches MUST treat other invalid date formats, 5704 especially including the value "0", as having occurred in the past 5705 (i.e., already expired). 5707 To mark a response as "already expired," an origin server should use 5708 an Expires date that is equal to the Date header value. To mark a 5709 response as "never expires," an origin server SHOULD use an Expires 5710 date approximately one year from the time the response is sent. 5711 RTSP/2.0 servers SHOULD NOT send Expires dates more than one year in 5712 the future. 5714 16.22. From 5716 The From request-header field, if given, SHOULD contain an Internet 5717 e-mail address for the human user who controls the requesting user 5718 agent. The address SHOULD be machine-usable, as defined by "mailbox" 5719 in [RFC1123]. 5721 This header field MAY be used for logging purposes and as a means for 5722 identifying the source of invalid or unwanted requests. It SHOULD 5723 NOT be used as an insecure form of access protection. The 5724 interpretation of this field is that the request is being performed 5725 on behalf of the person given, who accepts responsibility for the 5726 method performed. In particular, robot agents SHOULD include this 5727 header so that the person responsible for running the robot can be 5728 contacted if problems occur on the receiving end. 5730 The Internet e-mail address in this field MAY be separate from the 5731 Internet host which issued the request. For example, when a request 5732 is passed through a proxy the original issuer's address SHOULD be 5733 used. 5735 The client SHOULD NOT send the From header field without the user's 5736 approval, as it might conflict with the user's privacy interests or 5737 their site's security policy. It is strongly recommended that the 5738 user be able to disable, enable, and modify the value of this field 5739 at any time prior to a request. 5741 16.23. If-Match 5743 The If-Match request-header field is especially useful for ensuring 5744 the integrity of the presentation description, independent of how the 5745 presentation description was received. The presentation description 5746 can be fetched via means external to RTSP (such as HTTP) or via the 5747 DESCRIBE message and the SETUP message. In the case of retrieving 5748 the presentation description via RTSP, the server implementation is 5749 guaranteeing the integrity of the description between the time of the 5750 DESCRIBE message and the SETUP message. By including the MTag given 5751 in or with the session description in a If-Match header part of the 5752 SETUP request, the client ensures that resources set up are matching 5753 the description. A SETUP request with the If-Match header for which 5754 the MTag validation check fails, MUST response using 412 5755 (Precondition Failed). 5757 This validation check is also very useful if a session has been 5758 redirected from one server to another. 5760 16.24. If-Modified-Since 5762 The If-Modified-Since request-header field is used with the DESCRIBE 5763 and SETUP methods to make them conditional. If the requested variant 5764 has not been modified since the time specified in this field, a 5765 description will not be returned from the server (DESCRIBE) or a 5766 stream will not be set up (SETUP). Instead, a 304 (Not Modified) 5767 response MUST be returned without any message-body. 5769 An example of the field is: 5770 If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT 5772 16.25. If-None-Match 5774 This request header can be used with one or several message body tags 5775 to make DESCRIBE requests conditional. A client that has one or more 5776 message bodies previously obtained from the resource, can verify that 5777 none of those entities is current by including a list of their 5778 associated message body tags in the If-None-Match header field. The 5779 purpose of this feature is to allow efficient updates of cached 5780 information with a minimum amount of transaction overhead. As a 5781 special case, the value "*" matches any current entity of the 5782 resource. 5784 if any of the message body tags match the message body tag of the 5785 message body that would have been returned in the response to a 5786 similar DESCRIBE request (without the If-None-Match header) on that 5787 resource, or if "*" is given and any current entity exists for that 5788 resource, then the server MUST NOT perform the requested method, 5789 unless required to do so because the resource's modification date 5790 fails to match that supplied in an If-Modified-Since header field in 5791 the request. Instead, if the request method was DESCRIBE, the server 5792 SHOULD respond with a 304 (Not Modified) response, including the 5793 cache-related header fields (particularly MTag) of one of the message 5794 bodies that matched. For all other request methods, the server MUST 5795 respond with a status of 412 (Precondition Failed). 5797 See Section 18.1.3 for rules on how to determine if two message body 5798 tags match. 5800 If none of the message body tags match, then the server MAY perform 5801 the requested method as if the If-None-Match header field did not 5802 exist, but MUST also ignore any If-Modified-Since header field(s) in 5803 the request. That is, if no message body tags match, then the server 5804 MUST NOT return a 304 (Not Modified) response. 5806 If the request would, without the If-None-Match header field, result 5807 in anything other than a 2xx or 304 status, then the If-None-Match 5808 header MUST be ignored. (See Section 18.1.4 for a discussion of 5809 server behavior when both If-Modified-Since and If-None-Match appear 5810 in the same request.) 5812 The result of a request having both an If-None-Match header field and 5813 an If-Match header field is unspecified and MUST be considered an 5814 illegal request. 5816 16.26. Last-Modified 5818 The Last-Modified message-header field indicates the date and time at 5819 which the origin server believes the presentation description or 5820 media stream was last modified. For the method DESCRIBE, the header 5821 field indicates the last modification date and time of the 5822 description, for SETUP that of the media stream. 5824 An origin server MUST NOT send a Last-Modified date which is later 5825 than the server's time of message origination. In such cases, where 5826 the resource's last modification would indicate some time in the 5827 future, the server MUST replace that date with the message 5828 origination date. 5830 An origin server SHOULD obtain the Last-Modified value of the message 5831 body as close as possible to the time that it generates the Date 5832 value of its response. This allows a recipient to make an accurate 5833 assessment of the message body's modification time, especially if the 5834 message body changes near the time that the response is generated. 5836 RTSP servers SHOULD send Last-Modified whenever feasible. 5838 16.27. Location 5840 The Location response-header field is used to redirect the recipient 5841 to a location other than the Request-URI for completion of the 5842 request or identification of a new resource. For 3xx responses, the 5843 location SHOULD indicate the server's preferred URI for automatic 5844 redirection to the resource. The field value consists of a single 5845 absolute URI. 5847 Note: The Content-Location header field (Section 16.17) differs from 5848 Location in that the Content-Location identifies the original 5849 location of the message body enclosed in the request. It is 5850 therefore possible for a response to contain header fields for both 5851 Location and Content-Location. Also, see Section 18.2 for cache 5852 requirements of some methods. 5854 16.28. Media-Properties 5856 This general header is used in SETUP response or PLAY_NOTIFY requests 5857 to indicate the media's properties that currently are applicable to 5858 the RTSP session. PLAY_NOTIFY MAY be used to modify these properties 5859 at any point. However, the client SHOULD have received the update 5860 prior to that any action related to the new media properties take 5861 effect. For aggregated sessions, the Media-Properties header will be 5862 returned in each SETUP response. The header received in the latest 5863 response is the one that applies on the whole session from this point 5864 until any future update. The header MAY be included without value in 5865 GET_PARAMETER requests to the server with a Session header included 5866 to query the current Media-Properties for the session. The responder 5867 MUST include the current session's media properties. 5869 The media properties expressed by this header is the one applicable 5870 to all media in the RTSP session. For aggregated sessions, the 5871 header expressed the combined media-properties. As a result 5872 aggregation of media MAY result in a change of the media properties, 5873 and thus the content of the Media-Properties header contained in 5874 subsequent SETUP responses. 5876 The header contains a list of property values that are applicable to 5877 the currently setup media or aggregate of media as indicated by the 5878 RTSP URI in the request. No ordering are enforced within the header. 5879 Property values should be grouped into a single group that handles a 5880 particular orthogonal property. Values or groups that express 5881 multiple properties SHOULD NOT be used. The list of properties that 5882 can be expressed MAY be extended at any time. Unknown property 5883 values MUST be ignored. 5885 This specification defines the following 4 groups and their property 5886 values: 5888 Random Access: 5890 Random-Access: Indicates that random access is possible. May 5891 optionally include a floating point value in seconds indicating 5892 the longest duration between any two random access points in 5893 the media. 5895 Begining-Only: Seeking is limited to the beginning only. 5897 No-Seeking: No seeking is possible. 5899 Content Modifications: 5901 Immutable: The content will not be changed during the life-time 5902 of the RTSP session. 5904 Dynamic: The content may be changed based on external methods or 5905 triggers 5907 Time-Progressing The media accessible progress as wallclock time 5908 progresses. 5910 Retention: 5912 Unlimited: Content will be retained for the duration of the life- 5913 time of the RTSP session. 5915 Time-Limited: Content will be retained at least until the 5916 specified wallclock time. The time must be provided in the 5917 absolute time format specified in Section 4.6. 5919 Time-Duration Each individual media unit is retained for at least 5920 the specified time duration. This definition allows for 5921 retaining data with a time based sliding window. The time 5922 duration is expressed as floating point number in seconds. 0.0 5923 is a valid value as this indicates that no data is retained in 5924 a time-progressing session. 5926 Supported Scale: 5928 Scales: A quoted comma separated list of one or more decimal 5929 values or ranges of scale values supported by the content in 5930 arbitrary order. A range has a start and stop value separated 5931 by a colon. A range indicates that the content supports fine 5932 grained selection of scale values. Fine grained allows for 5933 steps at least as small as one tenth of a scale value. 5934 Negative values are supported. The value 0 have no meaning and 5935 must not be used. 5937 Examples of this header for on-demand content and a live stream 5938 without recording are: 5940 On-demand: 5941 Media-Properties: Random-Access=2.5s, Unlimited, Immutable, 5942 Scales="-20, -10, -4, 0.5:1.5, 4, 8, 10, 15, 20" 5944 Live stream without recording/timeshifting: 5945 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0.0 5947 16.29. Media-Range 5949 The Media-Range general header is used to give the range of the media 5950 at the time of sending the RTSP message. This header MUST be 5951 included in SETUP response, and PLAY and PAUSE response for media 5952 that are Time-Progressing, and PLAY and PAUSE response after any 5953 change for media that are Dynamic, and in PLAY_NOTIFY request that 5954 are sent due to Media-Property-Update. Media-Range header without 5955 any range specifications MAY be included in GET_PARAMETER requests to 5956 the server to request the current range. The server MUST in this 5957 case include the current range at the time of sending the response. 5959 The header MUST include range specifications for all time formats 5960 supported for the media, as indicated in Accept-Ranges header 5961 (Section 16.5) when setting up the media. The server MAY include 5962 more than one range specification of any given time format to 5963 indicate media that has non-continuous range. 5965 For media that has the Time-Progressing property, the Media-Range 5966 values will only be valid for the particular point in time when it 5967 was issued. As wallclock progresses so will also the media range. 5968 However, it shall be assumed that media time progress in direct 5969 relationship to wallclock time (with the exception of clock skew) so 5970 that a reasonably accurate estimation of the media range can be 5971 calculated. 5973 16.30. MTag 5975 The MTag response header MAY be included in DESCRIBE, GET_PARAMETER 5976 or SETUP responses. The message body tags (Section 4.8) returned in 5977 a DESCRIBE response, and the one in SETUP refers to the presentation, 5978 i.e. both the returned session description and the media stream. 5979 This allows for verification that one has the right session 5980 description to a media resource at the time of the SETUP request. 5981 However, it has the disadvantage that a change in any of the parts 5982 results in invalidation of all the parts. 5984 If the MTag is provided both inside the message body, e.g. within the 5985 "a=mtag" attribute in SDP, and in the response message, then both 5986 tags MUST be identical. It is RECOMMENDED that the MTag is primarily 5987 given in the RTSP response message, to ensure that caches can use the 5988 MTag without requiring content inspection. However, for session 5989 descriptions that are distributed outside of RTSP, for example using 5990 HTTP, etc. it will be necessary to include the message body tag in 5991 the session description as specified in Appendix D.1.9. 5993 SETUP and DESCRIBE requests can be made conditional upon the MTag 5994 using the headers If-Match (Section 16.23) and If-None-Match ( 5995 Section 16.25). 5997 16.31. Notify-Reason 5999 The Notify Reason header is solely used in the PLAY_NOTIFY method. 6000 It indicates the reason why the server has sent the asynchronous 6001 PLAY_NOTIFY request (see Section 13.5). 6003 16.32. Pipelined-Requests 6005 The Pipelined-Requests general header is used to indicate that a 6006 request is to be executed in the context created by a previous 6007 request(s). The primary usage of this header is to allow pipelining 6008 of SETUP requests so that any additional SETUP request after the 6009 first one does not need to wait for the session ID to be sent back to 6010 the requesting agent. The header contains a unique identifier that 6011 is scoped by the persistent connection used to send the requests. 6013 Upon receiving a request with the Pipelined-Requests the responding 6014 agent MUST look up if there exists a binding between this Pipelined- 6015 Requests identifier for the current persistent connection and an RTSP 6016 session ID. If that exists then the received request is processed 6017 the same way as if it contained the Session header with the found 6018 session ID. If there does not exist a mapping and no Session header 6019 is included in the request, the responding agent MUST create a 6020 binding upon the successful completion of a session creating request, 6021 i.e. SETUP. A binding MUST NOT be created, if the request failed to 6022 create an RTSP session. In case the request contains both a Session 6023 header and the Pipelined-Requests header the Pipelined-Requests MUST 6024 be ignored. 6026 Note: Based on the above definition at least the first request 6027 containing a new unique Pipelined-Requests will be required to be a 6028 SETUP request (unless the protocol is extended with new methods of 6029 creating a session). After that first one, additional SETUP requests 6030 or request of any type using the RTSP session context may include the 6031 Pipelined-Requests header. 6033 When responding to any request that contained the Pipelined-Requests 6034 header the server MUST also include the Session header when a binding 6035 to a session context exist. A RTSP agent that knows the session ID 6036 SHOULD NOT use the Pipelined-Requests header in any request and only 6037 use the Session header. This as the Session identifier is persistent 6038 across transport contexts, like TCP connections, which the Pipelined- 6039 Requests identifier is not. 6041 The RTSP agent sending the request with a Pipelined-Requests header 6042 has the responsibility for using a unique and previously unused 6043 identifier within the transport context. Currently only a TCP 6044 connection is defined as such transport context. A server MUST 6045 delete the Pipelined-Requests identifier and its binding to a session 6046 upon the termination of that session. Despite the previous mandate, 6047 RTSP agents are RECOMMENDED to not reuse identifiers to allow for 6048 better error handling and logging. 6050 RTSP Proxies may need to translate Pipelined-Requests identifier 6051 values from incoming request to outgoing to allow for aggregation of 6052 requests onto a persistent connection. 6054 16.33. Proxy-Authenticate 6056 The Proxy-Authenticate response-header field MUST be included as part 6057 of a 407 (Proxy Authentication Required) response. The field value 6058 consists of a challenge that indicates the authentication scheme and 6059 parameters applicable to the proxy for this Request-URI. 6061 The HTTP access authentication process is described in [RFC2617]. 6062 Unlike WWW-Authenticate, the Proxy-Authenticate header field applies 6063 only to the current connection and SHOULD NOT be passed on to 6064 downstream agents. However, an intermediate proxy might need to 6065 obtain its own credentials by requesting them from the downstream 6066 agent, which in some circumstances will appear as if the proxy is 6067 forwarding the Proxy-Authenticate header field. 6069 16.34. Proxy-Authorization 6071 The Proxy-Authorization request-header field allows the client to 6072 identify itself (or its user) to a proxy which requires 6073 authentication. The Proxy-Authorization field value consists of 6074 credentials containing the authentication information of the user 6075 agent for the proxy and/or realm of the resource being requested. 6077 The HTTP access authentication process is described in [RFC2617]. 6078 Unlike Authorization, the Proxy-Authorization header field applies 6079 only to the next outbound proxy that demanded authentication using 6080 the Proxy- Authenticate field. When multiple proxies are used in a 6081 chain, the Proxy-Authorization header field is consumed by the first 6082 outbound proxy that was expecting to receive credentials. A proxy 6083 MAY relay the credentials from the client request to the next proxy 6084 if that is the mechanism by which the proxies cooperatively 6085 authenticate a given request. 6087 16.35. Proxy-Require 6089 The Proxy-Require request-header field is used to indicate proxy- 6090 sensitive features that MUST be supported by the proxy. Any Proxy- 6091 Require header features that are not supported by the proxy MUST be 6092 negatively acknowledged by the proxy to the client using the 6093 Unsupported header. The proxy MUST use the 551 (Option Not 6094 Supported) status code in the response. Any feature-tag included in 6095 the Proxy-Require does not apply to the end-point (server or client). 6096 To ensure that a feature is supported by both proxies and servers the 6097 tag needs to be included in also a Require header. 6099 See Section 16.41 for more details on the mechanics of this message 6100 and a usage example. See discussion in the proxies section 6101 (Section 17.1) about when to consider that a feature requires proxy 6102 support. 6104 Example of use: 6105 Proxy-Require: play.basic 6107 16.36. Proxy-Supported 6109 The Proxy-Supported header field enumerates all the extensions 6110 supported by the proxy using feature-tags. The header carries the 6111 intersection of extensions supported by the forwarding proxies. The 6112 Proxy-Supported header MAY be included in any request by a proxy. It 6113 MUST be added by any proxy if the Supported header is present in a 6114 request. When present in a request, the receiver MUST in the 6115 response copy the received Proxy-Supported header. 6117 The Proxy-Supported header field contains a list of feature-tags 6118 applicable to proxies, as described in Section 4.7. The list are the 6119 intersection of all feature-tags understood by the proxies. To 6120 achieve an intersection, the proxy adding the Proxy-Supported header 6121 includes all proxy feature-tags it understands. Any proxy receiving 6122 a request with the header, checks the list and removes any feature- 6123 tag it do not support. A Proxy-Supported header present in the 6124 response MUST NOT be touched by the proxies. 6126 Example: 6128 C->P1: OPTIONS rtsp://example.com/ RTSP/2.0 6129 Supported: foo, bar, blech 6130 User-Agent: PhonyClient/1.2 6132 P1->P2: OPTIONS rtsp://example.com/ RTSP/2.0 6133 Supported: foo, bar, blech 6134 Proxy-Supported: proxy-foo, proxy-bar, proxy-blech 6135 Via: 2.0 pro.example.com 6137 P2->S: OPTIONS rtsp://example.com/ RTSP/2.0 6138 Supported: foo, bar, blech 6139 Proxy-Supported: proxy-foo, proxy-blech 6140 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6142 S->C: RTSP/2.0 200 OK 6143 Supported: foo, bar, baz 6144 Proxy-Supported: proxy-foo, proxy-blech 6145 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6146 Via: 2.0 pro.example.com, 2.0 prox2.example.com 6148 16.37. Public 6150 The Public response header field lists the set of methods supported 6151 by the response sender. This header applies to the general 6152 capabilities of the sender and its only purpose is to indicate the 6153 sender's capabilities to the recipient. The methods listed may or 6154 may not be applicable to the Request-URI; the Allow header field 6155 (Section 16.6) MAY be used to indicate methods allowed for a 6156 particular URI. 6158 Example of use: 6159 Public: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN 6161 In the event that there are proxies between the sender and the 6162 recipient of a response, each intervening proxy MUST modify the 6163 Public header field to remove any methods that are not supported via 6164 that proxy. The resulting Public header field will contain an 6165 intersection of the sender's methods and the methods allowed through 6166 by the intervening proxies. 6168 In general, proxies should allow all methods to transparently pass 6169 through from the sending RTSP agent to the receiving RTSP agent, 6170 but there may be cases where this is not desirable for a given 6171 proxy. Modification of the Public response header field by the 6172 intervening proxies ensures that the request sender gets an 6173 accurate response indicating the methods that can be used on the 6174 target agent via the proxy chain. 6176 16.38. Range 6178 The Range header specifies a time range in PLAY (Section 13.4), PAUSE 6179 (Section 13.6), SETUP (Section 13.3), REDIRECT (Section 13.10), and 6180 PLAY_NOTIFY (Section 13.5) requests and responses. It MAY be 6181 included in GET_PARAMETER requests from the client to the server with 6182 only a Range format and no value to request the current media 6183 position, whether the session is in Play or Ready state in the 6184 included format. The server SHALL, if supporting the range format, 6185 respond with the current playing point or pause point as the start of 6186 the range. If an explicit stop point was used in the previous PLAY 6187 request, then that value shall be included as stop point. Note that 6188 if the server is currently under any type of media playback 6189 manipulation affecting the interpretation of Range, like Scale, that 6190 is also required to be included in any GET_PARAMETER response to 6191 provide complete information. 6193 The range can be specified in a number of units. This specification 6194 defines smpte (Section 4.4), npt (Section 4.5), and clock 6195 (Section 4.6) range units. While byte ranges [H14.35.1] and other 6196 extended units MAY be used, their behavior is unspecified since they 6197 are not normally meaningful in RTSP. Servers supporting the Range 6198 header MUST understand the NPT range format and SHOULD understand the 6199 SMPTE range format. If the Range header is sent in a time format 6200 that is not understood, the recipient SHOULD return 456 (Header Field 6201 Not Valid for Resource) and include an Accept-Ranges header 6202 indicating the supported time formats for the given resource. 6204 Example: 6205 Range: clock=19960213T143205Z- 6207 The Range header contains a range of one single range format. A 6208 range is a half-open interval with a start and an end point, 6209 including the start point, but excluding the end point. A range may 6210 either be fully specified with explicit values for start point and 6211 end point, or have either start or end point be implicit. An 6212 implicit start point indicates the session's pause point, and if no 6213 pause point is set the start of the content. An implicit end point 6214 indicates the end of the content. The usage of both implicit start 6215 and end point is not allowed in the same range header, however, the 6216 exclusion of the range header has that meaning, i.e. from pause point 6217 (or start) until end of content. 6219 Regarding the half-open intervals; a range of A-B starts exactly 6220 at time A, but ends just before B. Only the start time of a media 6221 unit such as a video or audio frame is relevant. For example, 6222 assume that video frames are generated every 40 ms. A range of 6223 10.0-10.1 would include a video frame starting at 10.0 or later 6224 time and would include a video frame starting at 10.08, even 6225 though it lasted beyond the interval. A range of 10.0-10.08, on 6226 the other hand, would exclude the frame at 10.08. 6228 Please note the difference between NPT time scales' "now" and an 6229 implicit start value. Implicit value reference the current pause- 6230 point. While "now" is the currently ongoing time. In a time- 6231 progressing session with recording (retention for some or full 6232 time) the pause point may be 2 min into the session while now 6233 could be 1 hour into the session. 6235 By default, range intervals increase, where the second point is 6236 larger than the first point. 6238 Example: 6239 Range: npt=10-15 6241 However, range intervals can also decrease if the Scale header (see 6242 Section 16.44) indicates a negative scale value. For example, this 6243 would be the case when a playback in reverse is desired. 6245 Example: 6246 Scale: -1 6247 Range: npt=15-10 6249 Decreasing ranges are still half open intervals as described above. 6250 Thus, for range A-B, A is closed and B is open. In the above 6251 example, 15 is closed and 10 is open. An exception to this rule is 6252 the case when B=0 in a decreasing range. In this case, the range is 6253 closed on both ends, as otherwise there would be no way to reach 0 on 6254 a reverse playback for formats that have such a notion, like NPT and 6255 SMPTE. 6257 Example: 6258 Scale: -1 6259 Range: npt=15-0 6261 In this range both 15 and 0 are closed. 6263 A decreasing range interval without a corresponding negative Scale 6264 header is not valid. 6266 16.39. Referrer 6268 The Referrer request-header field allows the client to specify, for 6269 the server's benefit, the address (URI) of the resource from which 6270 the Request-URI was obtained. The URI refers to that of the 6271 presentation description, typically retrieved via HTTP. The Referrer 6272 request-header allows a server to generate lists of back-links to 6273 resources for interest, logging, optimized caching, etc. It also 6274 allows obsolete or mistyped links to be traced for maintenance. The 6275 Referrer field MUST NOT be sent if the Request-URI was obtained from 6276 a source that does not have its own URI, such as input from the user 6277 keyboard. 6279 If the field value is a relative URI, it SHOULD be interpreted 6280 relative to the Request-URI. The URI MUST NOT include a fragment. 6282 Because the source of a link might be private information or might 6283 reveal an otherwise private information source, it is strongly 6284 recommended that the user be able to select whether or not the 6285 Referrer field is sent. For example, a streaming client could have a 6286 toggle switch for openly/anonymously, which would respectively 6287 enable/disable the sending of Referee and From information. 6289 Clients SHOULD NOT include a Referee header field in a (non-secure) 6290 RTSP request if the referring page was transferred with a secure 6291 protocol. 6293 16.40. Request-Status 6295 This request header is used to indicate the end result for requests 6296 that takes time to complete, such a PLAY (Section 13.4). It is sent 6297 in PLAY_NOTIFY (Section 13.5) with the end-of-stream reason to report 6298 how the PLAY request concluded, either in success or in failure. The 6299 header carries a reference to the request it reports on using the 6300 CSeq number for the session indicated by the Session header in the 6301 request. It provides both a numerical status code (according to 6302 Section 8.1.1) and a human readable reason phrase. 6304 Example: 6305 Request-Status: cseq=63 status=500 reason="Media data unavailable" 6307 16.41. Require 6309 The Require request-header field is used by clients or servers to 6310 ensure that the other end-point supports features that are required 6311 in respect to this request. It can also be used to query if the 6312 other end-point supports certain features, however, the use of the 6313 Supported (Section 16.49) is much more effective in this purpose. 6314 The server MUST respond to this header by using the Unsupported 6315 header to negatively acknowledge those feature-tags which are NOT 6316 supported. The response MUST use the error code 551 (Option Not 6317 Supported). This header does not apply to proxies, for the same 6318 functionality in respect to proxies see Proxy-Require header 6319 (Section 16.35) with the exception of media modifying proxies. Media 6320 modifying proxies due to their nature of handling media in a way that 6321 is very similar to what a server, do need to understand also the 6322 server features to correctly serve the client. 6324 This is to make sure that the client-server interaction will 6325 proceed without delay when all features are understood by both 6326 sides, and only slow down if features are not understood (as in 6327 the example below). For a well-matched client-server pair, the 6328 interaction proceeds quickly, saving a round-trip often required 6329 by negotiation mechanisms. In addition, it also removes state 6330 ambiguity when the client requires features that the server does 6331 not understand. 6333 Example (Not complete): 6334 C->S: SETUP rtsp://server.com/foo/bar/baz.rm RTSP/2.0 6335 CSeq: 302 6336 Require: funky-feature 6337 Funky-Parameter: funkystuff 6339 S->C: RTSP/2.0 551 Option not supported 6340 CSeq: 302 6341 Unsupported: funky-feature 6343 In this example, "funky-feature" is the feature-tag which indicates 6344 to the client that the fictional Funky-Parameter field is required. 6345 The relationship between "funky-feature" and Funky-Parameter is not 6346 communicated via the RTSP exchange, since that relationship is an 6347 immutable property of "funky-feature" and thus should not be 6348 transmitted with every exchange. 6350 Proxies and other intermediary devices MUST ignore this header. If a 6351 particular extension requires that intermediate devices support it, 6352 the extension should be tagged in the Proxy-Require field instead 6353 (see Section 16.35). See discussion in the proxies section 6354 (Section 17.1) about when to consider that a feature requires proxy 6355 support. 6357 16.42. Retry-After 6359 The Retry-After response-header field can be used with a 503 (Service 6360 Unavailable) response to indicate how long the service is expected to 6361 be unavailable to the requesting client. This field MAY also be used 6362 with any 3xx (Redirection) response to indicate the minimum time the 6363 user-agent is asked wait before issuing the redirected request. The 6364 value of this field can be either an RTSP-date or an integer number 6365 of seconds (in decimal) after the time of the response. 6367 Example: 6369 Retry-After: Fri, 31 Dec 1999 23:59:59 GMT 6370 Retry-After: 120 6372 In the latter example, the delay is 2 minutes. 6374 16.43. RTP-Info 6376 The RTP-Info general field is used to set RTP-specific parameters in 6377 the PLAY and GET_PARAMETER responses or a PLAY_NOTIFY and 6378 GET_PARAMETER requests. For streams using RTP as transport protocol 6379 the RTP-Info header SHOULD be part of a 200 response to PLAY. 6381 The exclusion of the RTP-Info in a PLAY response for RTP 6382 transported media will result in that a client needs to 6383 synchronize the media streams using RTCP. This may have negative 6384 impact as the RTCP can be lost, and does not need to be 6385 particularly timely in their arrival. Also functionality as 6386 informing the client from which packet a seek has occurred is 6387 affected. 6389 The RTP-Info MAY be included in SETUP responses to provide 6390 synchronization information when changing transport parameters, see 6391 Section 13.3. The RTP-Info header and the Range header MAY be 6392 included in a GET_PARAMETER request from client to server without any 6393 values to request the current playback point and corresponding. RTP 6394 synchronization information. When the RTP-Info header is included in 6395 a Request also the Range header MUST be included (Note, Range header 6396 only MAY be used). The server response SHALL include both the Range 6397 header and the RTP-Info header. If the session is in Play state, 6398 then the value of the Range header SHALL be filled in with the 6399 current playback point and with the corresponding RTP-Info values. 6400 If the server is another state, no values are included in the RTP- 6401 Info header. The header is included in PLAY_NOTIFY requests with the 6402 Notify-Reason of end-of-stream to provide RTP information about the 6403 end of the stream. 6405 The header can carry the following parameters: 6407 url: Indicates the stream URI which for which the following RTP 6408 parameters correspond, this URI MUST be the same used in the 6409 SETUP request for this media stream. Any relative URI MUST use 6410 the Request-URI as base URI. This parameter MUST be present. 6412 ssrc: The Synchronization source (SSRC) that the RTP timestamp and 6413 sequence number provide applies to. This parameter MUST be 6414 present. 6416 seq: Indicates the sequence number of the first packet of the stream 6417 that is direct result of the request. This allows clients to 6418 gracefully deal with packets when seeking. The client uses 6419 this value to differentiate packets that originated before the 6420 seek from packets that originated after the seek. Note that a 6421 client may not receive the packet with the expressed sequence 6422 number, and instead packets with a higher sequence number, due 6423 to packet loss or reordering. This parameter is RECOMMENDED to 6424 be present. 6426 rtptime: MUST indicate the RTP timestamp value corresponding to the 6427 start time value in the Range response header, or if not 6428 explicitly given the implied start point. The client uses this 6429 value to calculate the mapping of RTP time to NPT or other 6430 media timescale. This parameter SHOULD be present to ensure 6431 inter-media synchronization is achieved. There exist no 6432 requirement that any received RTP packet will have the same RTP 6433 timestamp value as the one in the parameter used to establish 6434 synchronization. 6436 A mapping from RTP timestamps to NTP timestamps (wallclock) is 6437 available via RTCP. However, this information is not sufficient 6438 to generate a mapping from RTP timestamps to media clock time 6439 (NPT, etc.). Furthermore, in order to ensure that this 6440 information is available at the necessary time (immediately at 6441 startup or after a seek), and that it is delivered reliably, this 6442 mapping is placed in the RTSP control channel. 6444 In order to compensate for drift for long, uninterrupted 6445 presentations, RTSP clients should additionally map NPT to NTP, 6446 using initial RTCP sender reports to do the mapping, and later 6447 reports to check drift against the mapping. 6449 Example: 6451 Range:npt=3.25-15 6452 RTP-Info:url="rtsp://example.com/foo/audio" ssrc=0A13C760:seq=45102; 6453 rtptime=12345678,url="rtsp://example.com/foo/video" 6454 ssrc=9A9DE123:seq=30211;rtptime=29567112 6456 Lets assume that Audio uses a 16kHz RTP timestamp clock and Video 6457 a 90kHz RTP timestamp clock. Then the media synchronization is 6458 depicted in the following way. 6460 NPT 3.0---3.1---3.2-X-3.3---3.4---3.5---3.6 6461 Audio PA A 6462 Video V PV 6464 X: NPT time value = 3.25, from Range header. 6465 A: RTP timestamp value for Audio from RTP-Info header (12345678). 6466 V: RTP timestamp value for Video from RTP-Info header (29567112). 6467 PA: RTP audio packet carrying an RTP timestamp of 12344878. Which 6468 corresponds to NPT = (12344878 - A) / 16000 + 3.25 = 3.2 6469 PV: RTP video packet carrying an RTP timestamp of 29573412. Which 6470 corresponds to NPT = (29573412 - V) / 90000 + 3.25 = 3.32 6472 16.44. Scale 6474 A scale value of 1 indicates normal play at the normal forward 6475 viewing rate. If not 1, the value corresponds to the rate with 6476 respect to normal viewing rate. For example, a ratio of 2 indicates 6477 twice the normal viewing rate ("fast forward") and a ratio of 0.5 6478 indicates half the normal viewing rate. In other words, a ratio of 2 6479 has content time increase at twice the playback time. For every 6480 second of elapsed (wallclock) time, 2 seconds of content time will be 6481 delivered. A negative value indicates reverse direction. For 6482 certain media transports this may require certain considerations to 6483 work consistent, see Appendix C.1 for description on how RTP handles 6484 this. 6486 The transmitted data rate SHOULD NOT be changed by selection of a 6487 different scale value. The resulting bit-rate should be reasonably 6488 close to the nominal bit-rate of the content for Scale = 1. The 6489 server has to actively manipulate the data when needed to meet the 6490 bitrate constraints. Implementation of scale changes depends on the 6491 server and media type. For video, a server may, for example, deliver 6492 only key frames or selected frames. For audio, it may time-scale the 6493 audio while preserving pitch or, less desirably, deliver fragments of 6494 audio, or completely mute the audio. 6496 The server and content may restrict the range of scale values that it 6497 supports. The supported values are indicated by the Media-Properties 6498 header (Section 16.28). The client SHOULD only indicate values 6499 indicated to be supported. However, as the values may change as the 6500 content progresses a requested value may no longer be valid when the 6501 request arrives. Thus, a non-supported value in a request does not 6502 generate an error, only forces the server to choose the closest 6503 value. The response MUST always contain the actual scale value 6504 chosen by the server. 6506 If the server does not implement the possibility to scale, it will 6507 not return a Scale header. A server supporting Scale operations for 6508 PLAY MUST indicate this with the use of the "play.scale" feature-tag. 6510 When indicating a negative scale for a reverse playback, the Range 6511 header MUST indicate a decreasing range as described in 6512 Section 16.38. 6514 Example of playing in reverse at 3.5 times normal rate: 6515 Scale: -3.5 6516 Range: npt=15-10 6518 16.45. Seek-Style 6520 When a client sends a PLAY request with a Range header to perform a 6521 random access to the media, the client does not know if the server 6522 will pick the first media samples or the first random access point 6523 prior to the request range. Depending on use case, the client may 6524 have a strong preference. To express this preference and provide the 6525 client with information on how the server actually acted on that 6526 preference the Seek-Style header is defined. 6528 Seek-Style is a general header that MAY be included in any PLAY 6529 request to indicate the client's preference for any media stream that 6530 has random access properties. The server MUST always include the 6531 header in any PLAY response for media with random access properties 6532 to indicate what policy was applied. A server that receives a 6533 unknown Seek-Style policy MUST ignore it and select the server 6534 default policy. A client receiving an unknown policy MUST ignore it 6535 and use the Range header and any media synchronization information as 6536 basis to determine what the server did. 6538 This specification defines the following seek policies that may be 6539 requested (see also Section Section 4.9.1): 6541 RAP: Random Access Point (RAP) is the behavior of requesting the 6542 server to locate the closest previous random access point that 6543 exist in the media aggregate and deliver from that. By requesting 6544 a RAP, media quality will be the best possible as all media will 6545 be delivered from a point where full media state can be 6546 established in the media decoder. 6548 CoRAP: Conditional Random Access Point (CoRAP) is a variant of the 6549 above RAP behavior. This policy is primarily intended for cases 6550 where there are larger distance between the random access points 6551 in the media. CoRAP is conditioned on that there is a Random 6552 Access Point closer to the requested start point than to the 6553 current pause point. This policy assumes that the media state 6554 existing prior to the pause is usable if delivery is continued. 6555 If the client or server knows that this is not the fact the RAP 6556 policy should be used. In other words: in most cases when the 6557 client requests a start point prior to the current pause point, a 6558 valid decoding dependency chain from the media delivered prior to 6559 the pause and to the requested media unit will not exist. If the 6560 server searched to a random access point the server MUST return 6561 the CoRAP policy in the Seek-Style header and adjust the Range 6562 header to reflect the position of the picked RAP. In case the 6563 random access point is further away and the server selects to 6564 continue from the current pause point it MUST include the "Next" 6565 policy in the Seek-Style header and adjust the Range header start 6566 point to the current pause point. 6568 First-Prior: The first-prior policy will start delivery with the 6569 media unit that has a playout time first prior to the requested 6570 time. For discrete media that would only include media units that 6571 would still be rendered at the request time. For continuous media 6572 that is media that will be render during the requested start time 6573 of the range. 6575 Next: The next media units after the provided start time of the 6576 range. For continuous framed media that would mean the first next 6577 frame after the provided time. For discrete media the first unit 6578 that is to be rendered after the provided time. The main usage is 6579 for this case is when the client knows it has all media up to a 6580 certain point and would like to continue delivery so that a 6581 complete non-interrupted media playback can be achieved. Example 6582 of such scenarios include switching from a broadcast/multicast 6583 delivery to a unicast based delivery. This policy MUST only be 6584 used on the client's explicit request. 6586 Please note that these expressed preferences exist for optimizing the 6587 startup time or the media quality. The "Next" policy breaks the 6588 normal definition of the Range header to enable a client to request 6589 media with minimal overlap, although some may still occur for 6590 aggregated sessions. RAP and First-Prior both fulfill the 6591 requirement of providing media from the requested range and forward. 6592 However, unless RAP is used, the media quality for many media codecs 6593 using predictive methods can be severely degraded unless additional 6594 data is available as, for example, already buffered, or through other 6595 side channels. 6597 16.46. Server 6599 The Server response-header field contains information about the 6600 software used by the origin server to handle the request. The field 6601 can contain multiple product tokens and comments identifying the 6602 server and any significant subproducts. The product tokens are 6603 listed in order of their significance for identifying the 6604 application. 6606 Example: 6607 Server: PhonyServer/1.0 6609 If the response is being forwarded through a proxy, the proxy 6610 application MUST NOT modify the Server response-header. Instead, it 6611 SHOULD include a Via field (Section 16.56). 6613 16.47. Session 6615 The Session request-header and response-header field identifies an 6616 RTSP session. An RTSP session is created by the server as a result 6617 of a successful SETUP request and in the response the session 6618 identifier is given to the client. The RTSP session exist until 6619 destroyed by a TEARDOWN, REDIRECT or timed out by the server. 6621 The session identifier is chosen by the server (see Section 4.3) and 6622 MUST be returned in the SETUP response. Once a client receives a 6623 session identifier, it MUST be included in any request related to 6624 that session. This means that the Session header MUST be included in 6625 a request using the following methods: PLAY, PAUSE, and TEARDOWN, and 6626 MAY be included in SETUP, OPTIONS, SET_PARAMETER, GET_PARAMETER, and 6627 REDIRECT, and MUST NOT be included in DESCRIBE. In an RTSP response 6628 the session header MUST be included in methods, SETUP, PLAY, and 6629 PAUSE, and MAY be included in methods, TEARDOWN, and REDIRECT, and if 6630 included in the request of the following methods it MUST also be 6631 included in the response, OPTIONS, GET_PARAMETER, and SET_PARAMETER, 6632 and MUST NOT be included in DESCRIBE. 6634 Note that a session identifier identifies an RTSP session across 6635 transport sessions or connections. RTSP requests for a given session 6636 can use different URIs (Presentation and media URIs). Note, that 6637 there are restrictions depending on the session which URIs that are 6638 acceptable for a given method. However, multiple "user" sessions for 6639 the same URI from the same client will require use of different 6640 session identifiers. 6642 The session identifier is needed to distinguish several delivery 6643 requests for the same URI coming from the same client. 6645 The response 454 (Session Not Found) MUST be returned if the session 6646 identifier is invalid. 6648 The header MAY include the session timeout period. If not explicitly 6649 provided this value is set to 60 seconds. As this affects how often 6650 session keep-alives are needed values smaller than 30 seconds are not 6651 recommended. However, larger than default values can be useful in 6652 applications of RTSP that have inactive but established sessions for 6653 longer time periods. 6655 60 seconds was chosen as session timeout value due to: Resulting 6656 in not to frequent keep-alive messages and having low sensitivity 6657 to variations in request response timing. If one reduces the 6658 timeout value to below 30 seconds the corresponding request 6659 response timeout becomes a significant part of the session 6660 timeout. 60 seconds also allows for reasonably rapid recovery of 6661 committed server resources in case of client failure. 6663 16.48. Speed 6665 The Speed request-header field requests the server to deliver 6666 specific amounts of nominal media time per unit of delivery time, 6667 contingent on the server's ability and desire to serve the media 6668 stream at the given speed. The client requests the delivery speed to 6669 be within a given range with an lower and upper bound. The server 6670 SHALL deliver at the highest possible speed within the range, but not 6671 faster than the upper-bound, for which the underlying network path 6672 can support the resulting transport data rates. As long as any speed 6673 value within the given range can be provided the server SHALL NOT 6674 modify the media quality. Only if the server is unable to delivery 6675 media at the speed value provided by the lower bound shall it reduce 6676 the media quality. 6678 Implementation of the Speed functionality by the server is OPTIONAL. 6679 The server can indicate its support through a feature-tag, 6680 play.speed. The lack of a Speed header in the response is an 6681 indication of lack of support of this functionality. 6683 The speed parameter values are expressed as a positive decimal value, 6684 e.g., a value of 2.0 indicates that data is to be delivered twice as 6685 fast as normal. A speed value of zero is invalid. The range is 6686 specified in the form "lower bound - upper bound". The lower bound 6687 value may be smaller or equal to the upper bound. All speeds may not 6688 be possible to support. Therefore the server MAY modify the 6689 requested values to the closest supported. The actual supported 6690 speed MUST be included in the response. Note, however, that the use 6691 cases may vary and that Speed value ranges such as 0.7 - 0.8, 6692 0.3-2.0, 1.0-2.5, 2.5-2.5 all have their usage. 6694 Example: 6696 Speed: 1.0-2.5 6698 Use of this header changes the bandwidth used for data delivery. It 6699 is meant for use in specific circumstances where delivery of the 6700 presentation at a higher or lower rate is desired. The main use 6701 cases are buffer operations or local scale operations. Implementors 6702 should keep in mind that bandwidth for the session may be negotiated 6703 beforehand (by means other than RTSP), and therefore re-negotiation 6704 may be necessary. To perform Speed operations the server needs to 6705 ensure that the network path can support the resulting bit-rate. 6706 Thus the media transport needs to support feedback so that the server 6707 can react and adapt to the available bitrate. 6709 16.49. Supported 6711 The Supported header enumerates all the extensions supported by the 6712 client or server using feature tags. The header carries the 6713 extensions supported by the message sending client or server. The 6714 Supported header MAY be included in any request. When present in a 6715 request, the receiver MUST respond with its corresponding Supported 6716 header. Note that the supported headers is also included in 4xx and 6717 5xx responses. 6719 The Supported header contains a list of feature-tags, described in 6720 Section 4.7, that are understood by the client or server. 6722 Example: 6724 C->S: OPTIONS rtsp://example.com/ RTSP/2.0 6725 Supported: foo, bar, blech 6726 User-Agent: PhonyClient/1.2 6728 S->C: RTSP/2.0 200 OK 6729 Supported: bar, blech, baz 6731 16.50. Terminate-Reason 6733 The Terminate-Reason request header allows the server when sending a 6734 REDIRECT or TEARDOWN request to provide a reason for the session 6735 termination and any additional information. This specification 6736 identifies three reasons for Redirections and may be extended in the 6737 future: 6739 Server-Admin: The server needs to be shutdown for some 6740 administrative reason. 6742 Session-Timeout: A client's session is kept alive for extended 6743 periods of time and the server has determined that it needs to 6744 reclaim the resources associated with this session. 6746 Internal-Error An internal error that is impossible to recover from 6747 has occurred forcing the server to terminate the session. 6749 The Server may provide additional parameters containing information 6750 around the redirect. This specification defines the following ones. 6752 time: Provides a wallclock time when the server will stop provide 6753 any service. 6755 user-msg: An UTF-8 text string with a message from the server to the 6756 user. This message SHOULD be displayed to the user. 6758 16.51. Timestamp 6760 The Timestamp general-header describes when the agent sent the 6761 request. The value of the timestamp is of significance only to the 6762 agent and may use any timescale. The responding agent MUST echo the 6763 exact same value and MAY, if it has accurate information about this, 6764 add a floating point number indicating the number of seconds that has 6765 elapsed since it has received the request. The timestamp can be used 6766 by the agent to compute the round-trip time to the responding agent 6767 so that it can adjust the timeout value for retransmissions when 6768 running over a unreliable protocol. It also resolves retransmission 6769 ambiguities for unreliable transport of RTSP. 6771 Note that the present specification provides only for reliable 6772 transport of RTSP messages. The Timestamp general-header is 6773 specified in case the protocol is extended in the future to use 6774 unreliable transport. 6776 16.52. Transport 6778 The Transport request and response header indicates which transport 6779 protocol is to be used and configures its parameters such as 6780 destination address, compression, multicast time-to-live and 6781 destination port for a single stream. It sets those values not 6782 already determined by a presentation description. 6784 A Transport request header MAY contain a list of transport options 6785 acceptable to the client, in the form of multiple transport 6786 specification entries. Transport specifications are comma separated, 6787 listed in decreasing order of preference. Parameters may be added to 6788 each transport specification, separated by a semicolon. The server 6789 MUST return a Transport response-header in the response to indicate 6790 the values actually chosen if any. If the transport specification is 6791 not supported, no transport header is returned and the request MUST 6792 be responded using the status code 461 (Unsupported Transport) 6793 (Section 15.4.26). In case more than one transport specification was 6794 present in the request, the server MUST return the single (transport- 6795 spec) which was actually chosen, if any. The number of transport- 6796 spec entries is expected to be limited as the client will get 6797 guidance on what configurations that are possible from the 6798 presentation description. 6800 The Transport header MAY also be used in subsequent SETUP requests to 6801 change transport parameters. A server MAY refuse to change 6802 parameters of an existing stream. 6804 A transport specification may only contain one of any given parameter 6805 within it. Parameters MAY be given in any order. Additionally, it 6806 may only contain either of the unicast or the multicast transport 6807 type parameter. All parameters need to be understood in a transport 6808 specification, if not, the transport specification MUST be ignored. 6809 RTSP proxies of any type that uses or modifies the transport 6810 specification, e.g. access proxy or security proxy, MUST remove 6811 specifications with unknown parameters before forwarding the RTSP 6812 message. If that result in no remaining transport specification the 6813 proxy shall send a 461 (Unsupported Transport) (Section 15.4.26) 6814 response without any Transport header. 6816 The Transport header is restricted to describing a single media 6817 stream. (RTSP can also control multiple streams as a single 6818 entity.) Making it part of RTSP rather than relying on a 6819 multitude of session description formats greatly simplifies 6820 designs of firewalls. 6822 The general syntax for the transport specifier is a list of slash 6823 separated tokens: 6824 Value1/Value2/Value3... 6825 Which for RTP transports take the form: 6826 RTP/profile/lower-transport. 6828 The default value for the "lower-transport" parameters is specific to 6829 the profile. For RTP/AVP, the default is UDP. 6831 There are two different methods for how to specify where the media 6832 should be delivered for unicast transport: 6834 dest_addr: The presence of this parameter and its values indicates 6835 the destination address or addresses (host address and port 6836 pairs for IP flows) necessary for the media transport. 6838 No dest_addr: The lack of the dest_addr parameter indicates that the 6839 server MUST send media to same address for which the RTSP 6840 messages originates. 6842 The choice of method for indicating where the media is to be 6843 delivered depends on the use case. In some case the only allowed 6844 method will be to use no explicit address indication and have the 6845 server deliver media to the source of the RTSP messages. 6847 For Multicast there is several methods for specifying addresses but 6848 they are different in how they work compared with unicast: 6850 dest_addr with client picked address: The address and relevant 6851 parameters like TTL (scope) for the actual multicast group to 6852 deliver the media to. There are security implications 6853 (Section 21) with this method that needs to be addressed if 6854 using this method because a RTSP server can be used as a DoS 6855 attacker on a existing multicast group. 6857 dest_addr using Session Description Information: The information 6858 included in the transport header can all be coming from the 6859 session description, e.g. the SDP c= and m= line. This 6860 mitigates some of the security issues of the previous methods 6861 as it is the session provider that picks the multicast group 6862 and scope. The client MUST include the information if it is 6863 available in the session description. 6865 No dest_addr: The behavior when no explicit multicast group is 6866 present in a request is not defined. 6868 An RTSP proxy will need to take care. If the media is not desired to 6869 be routed through the proxy, the proxy will need to introduce the 6870 destination indication. 6872 Below are the configuration parameters associated with transport: 6874 General parameters: 6876 unicast / multicast: This parameter is a mutually exclusive 6877 indication of whether unicast or multicast delivery will be 6878 attempted. One of the two values MUST be specified. Clients 6879 that are capable of handling both unicast and multicast 6880 transmission needs to indicate such capability by including two 6881 full transport-specs with separate parameters for each. 6883 layers: The number of multicast layers to be used for this media 6884 stream. The layers are sent to consecutive addresses starting 6885 at the dest_addr address. If the parameter is not included, it 6886 defaults to a single layer. 6888 dest_addr: A general destination address parameter that can contain 6889 one or more address specifications. Each combination of 6890 protocol/profile/lower transport needs to have the format and 6891 interpretation of its address specification defined. For RTP/ 6892 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 6893 containing a host address and port. Note, only a single 6894 destination parameter per transport spec is intended. The 6895 usage of multiple destination to distribute a single media to 6896 multiple entities is unspecified. 6898 The client originating the RTSP request MAY specify the 6899 destination address of the stream recipient with the host 6900 address part of the tuple. When the destination address is 6901 specified, the recipient may be a different party than the 6902 originator of the request. To avoid becoming the unwitting 6903 perpetrator of a remote-controlled denial-of-service attack, a 6904 server MUST perform security checks (see Section 21.1) and 6905 SHOULD log such attempts before allowing the client to direct a 6906 media stream to a recipient address not chosen by the server. 6907 Implementations cannot rely on TCP as reliable means of client 6908 identification. If the server does not allow the host address 6909 part of the tuple to be set, it MUST return 463 (Destination 6910 Prohibited). 6912 The host address part of the tuple MAY be empty, for example 6913 ":58044", in cases when only destination port is desired to be 6914 specified. Responses to requests including the Transport 6915 header with a dest_addr parameter SHOULD include the full 6916 destination address that is actually used by the server. The 6917 server MUST NOT remove address information present already in 6918 the request when responding unless the protocol requires it. 6920 src_addr: A general source address parameter that can contain one or 6921 more address specifications. Each combination of protocol/ 6922 profile/lower transport needs to have the format and 6923 interpretation of its address specification defined. For RTP/ 6924 AVP/UDP and RTP/AVP/TCP, the address specification is a tuple 6925 containing a host address and port. 6927 This parameter MUST be specified by the server if it transmits 6928 media packets from another address than the one RTSP messages 6929 are sent to. This will allow the client to verify source 6930 address and give it a destination address for its RTCP feedback 6931 packets if RTP is used. The address or addresses indicated in 6932 the src_addr parameter SHOULD be used both for sending and 6933 receiving of the media streams data packets. The main reasons 6934 are threefold: First, indicating the port and source address(s) 6935 lets the receiver know where from the packets is expected to 6936 originate. Secondly, traversal of NATs are greatly simplified 6937 when traffic is flowing symmetrically over a NAT binding. 6938 Thirdly, certain NAT traversal mechanisms, needs to know to 6939 which address and port to send so called "binding packets" from 6940 the receiver to the sender, thus creating a address binding in 6941 the NAT that the sender to receiver packet flow can use. 6943 This information may also be available through SDP. 6944 However, since this is more a feature of transport than 6945 media initialization, the authoritative source for this 6946 information should be in the SETUP response. 6948 mode: The mode parameter indicates the methods to be supported for 6949 this session. Currently defined valid values are "PLAY". If 6950 not provided, the default is "PLAY". The "RECORD" value was 6951 defined in RFC 2326 and is in this specification unspecified 6952 but reserved. RECORD and other values may be specified in the 6953 future. 6955 interleaved: The interleaved parameter implies mixing the media 6956 stream with the control stream in whatever protocol is being 6957 used by the control stream, using the mechanism defined in 6958 Section 14. The argument provides the channel number to be 6959 used in the $ statement and MUST be present. This parameter 6960 MAY be specified as a interval, e.g., interleaved=4-5 in cases 6961 where the transport choice for the media stream requires it, 6962 e.g. for RTP with RTCP. The channel number given in the 6963 request are only a guidance from the client to the server on 6964 what channel number(s) to use. The server MAY set any valid 6965 channel number in the response. The declared channel(s) are 6966 bi-directional, so both end-parties MAY send data on the given 6967 channel. One example of such usage is the second channel used 6968 for RTCP, where both server and client sends RTCP packets on 6969 the same channel. 6971 This allows RTP/RTCP to be handled similarly to the way 6972 that it is done with UDP, i.e., one channel for RTP and 6973 the other for RTCP. 6975 Multicast-specific: 6977 ttl: multicast time-to-live for IPv4. When included in requests the 6978 value indicate the TTL value that the client request the server 6979 to use. In a response, the value actually being used by the 6980 server is returned. A server will need to consider what values 6981 that are reasonable and also the authority of the user to set 6982 this value. Corresponding functions are not needed for IPv6 as 6983 the scoping is part of the address. 6985 RTP-specific: 6987 These parameters are MAY only be used if the media transport protocol 6988 is RTP. 6990 ssrc: The ssrc parameter, if included in a SETUP response, indicates 6991 the RTP SSRC [RFC3550] value(s) that will be used by the media 6992 server for RTP packets within the stream. It is expressed as 6993 an eight digit hexadecimal value. 6995 The ssrc parameter MUST NOT be specified in requests. The 6996 functionality of specifying the ssrc parameter in a SETUP 6997 request is deprecated as it is incompatible with the 6998 specification of RTP in RFC 3550[RFC3550]. If the parameter is 6999 included in the Transport header of a SETUP request, the server 7000 MAY ignore it, and choose appropriate SSRCs for the stream. 7001 The server MAY set the ssrc parameter in the Transport header 7002 of the response. 7004 The parameters setup and connection defined below MAY only be used if 7005 the media transport protocol of the lower-level transport is 7006 connection-oriented (such as TCP). However, these parameters MUST 7007 NOT be used when interleaving data over the RTSP control connection. 7008 The third parameter, RTCP-mux, can be used also in the interleaved 7009 mode. 7011 setup: Clients use the setup parameter on the Transport line in a 7012 SETUP request, to indicate the roles it wishes to play in a TCP 7013 connection. This parameter is adapted from [RFC4145]. We 7014 discuss the use of this parameter in RTP/AVP/TCP non- 7015 interleaved transport in Appendix C.2.2; the discussion below 7016 is limited to syntactic issues. Clients may specify the 7017 following values for the setup parameter: ["active":] The 7018 client will initiate an outgoing connection. ["passive":] The 7019 client will accept an incoming connection. ["actpass":] The 7020 client is willing to accept an incoming connection or to 7021 initiate an outgoing connection. 7023 If a client does not specify a setup value, the "active" value 7024 is assumed. 7026 In response to a client SETUP request where the setup parameter 7027 is set to "active", a server's 2xx reply MUST assign the setup 7028 parameter to "passive" on the Transport header line. 7030 In response to a client SETUP request where the setup parameter 7031 is set to "passive", a server's 2xx reply MUST assign the setup 7032 parameter to "active" on the Transport header line. 7034 In response to a client SETUP request where the setup parameter 7035 is set to "actpass", a server's 2xx reply MUST assign the setup 7036 parameter to "active" or "passive" on the Transport header 7037 line. 7039 Note that the "holdconn" value for setup is not defined for 7040 RTSP use, and MUST NOT appear on a Transport line. 7042 connection: Clients use the setup parameter on the Transport line in 7043 a SETUP request, to indicate the SETUP request prefers the 7044 reuse of an existing connection between client and server (in 7045 which case the client sets the "connection" parameter to 7046 "existing"), or that the client requires the creation of a new 7047 connection between client and server (in which cast the client 7048 sets the "connection" parameter to "new"). Typically, clients 7049 use the "new" value for the first SETUP request for a URL, and 7050 "existing" for subsequent SETUP requests for a URL. 7052 If a client SETUP request assigns the "new" value to 7053 "connection", the server response MUST also assign the "new" 7054 value to "connection" on the Transport line. 7056 If a client SETUP request assigns the "existing" value to 7057 "connection", the server response MUST assign a value of 7058 "existing" or "new" to "connection" on the Transport line, at 7059 its discretion. 7061 The default value of "connection" is "existing", for all SETUP 7062 requests (initial and subsequent). 7064 RTCP-mux: Use to negotiate the usage of RTP and RTCP multiplexing 7065 [I-D.ietf-avt-rtp-and-rtcp-mux] on a single underlying 7066 transport stream. The presence of this parameter in a SETUP 7067 request indicates the clients support and requires the server 7068 to use RTP and RTCP multiplexing. The client SHALL only 7069 include one transport stream in the Transport header 7070 specification. To provide the server with a choice between 7071 using RTP/RTCP multiplexing or not, two different transport 7072 header specifications must be included. 7074 The combination of transport protocol, profile and lower transport 7075 needs to be defined. A number of combinations are defined in the 7076 Appendix C. 7078 Below is a usage example, showing a client advertising the capability 7079 to handle multicast or unicast, preferring multicast. Since this is 7080 a unicast-only stream, the server responds with the proper transport 7081 parameters for unicast. 7083 C->S: SETUP rtsp://example.com/foo/bar/baz.rm RTSP/2.0 7084 CSeq: 302 7085 Transport: RTP/AVP;multicast;mode="PLAY", 7086 RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7087 "192.0.2.5:3457";mode="PLAY" 7088 Accept-Ranges: NPT, SMPTE, UTC 7089 User-Agent: PhonyClient/1.2 7091 S->C: RTSP/2.0 200 OK 7092 CSeq: 302 7093 Date: Thu, 23 Jan 1997 15:35:06 GMT 7094 Session: 47112344 7095 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:3456"/ 7096 "192.0.2.5:3457";src_addr="192.0.2.224:6256"/ 7097 "192.0.2.224:6257";mode="PLAY" 7098 Accept-Ranges: NPT 7099 Media-Properties: Random-Access=0.6, Dynamic, 7100 Time-Limited=20081128T165900 7102 16.53. Unsupported 7104 The Unsupported response-header lists the features not supported by 7105 the responding RTSP agent. In the case where the feature was 7106 specified via the Proxy-Require field (Section 16.35), if there is a 7107 proxy on the path between the client and the server, the proxy MUST 7108 send a response message with a status code of 551 (Option Not 7109 Supported). The request MUST NOT be forwarded. 7111 See Section 16.41 for a usage example. 7113 16.54. User-Agent 7115 The User-Agent general-header field contains information about the 7116 user agent originating the request. This is for statistical 7117 purposes, the tracing of protocol violations, and automated 7118 recognition of user agents for the sake of tailoring responses to 7119 avoid particular user agent limitations. User agents SHOULD include 7120 this field with requests. The field can contain multiple product 7121 tokens and comments identifying the agent and any subproducts which 7122 form a significant part of the user agent. By convention, the 7123 product tokens are listed in order of their significance for 7124 identifying the application. 7126 Example: 7127 User-Agent: PhonyClient/1.2 7129 16.55. Vary 7131 The Vary field value indicates the set of request-header fields that 7132 fully determines, while the response is fresh, whether a cache is 7133 permitted to use the response to reply to a subsequent request 7134 without revalidation. For uncacheable or stale responses, the Vary 7135 field value advises the user agent about the criteria that were used 7136 to select the representation. A Vary field value of "*" implies that 7137 a cache cannot determine from the request headers of a subsequent 7138 request whether this response is the appropriate representation. 7140 An RTSP server SHOULD include a Vary header field with any cacheable 7141 response that is subject to server-driven negotiation. Doing so 7142 allows a cache to properly interpret future requests on that resource 7143 and informs the user agent about the presence of negotiation on that 7144 resource. A server MAY include a Vary header field with a non- 7145 cacheable response that is subject to server-driven negotiation, 7146 since this might provide the user agent with useful information about 7147 the dimensions over which the response varies at the time of the 7148 response. 7150 A Vary field value consisting of a list of field-names signals that 7151 the representation selected for the response is based on a selection 7152 algorithm which considers ONLY the listed request-header field values 7153 in selecting the most appropriate representation. A cache MAY assume 7154 that the same selection will be made for future requests with the 7155 same values for the listed field names, for the duration of time for 7156 which the response is fresh. 7158 The field-names given are not limited to the set of standard request- 7159 header fields defined by this specification. Field names are case- 7160 insensitive. 7162 A Vary field value of "*" signals that unspecified parameters not 7163 limited to the request-headers (e.g., the network address of the 7164 client), play a role in the selection of the response representation. 7165 The "*" value MUST NOT be generated by a proxy server; it may only be 7166 generated by an origin server. 7168 16.56. Via 7170 The Via general-header field MUST be used by proxies to indicate the 7171 intermediate protocols and recipients between the user agent and the 7172 server on requests, and between the origin server and the client on 7173 responses. The field is intended to be used for tracking message 7174 forwards, avoiding request loops, and identifying the protocol 7175 capabilities of all senders along the request/response chain. 7177 Multiple Via field values represents each proxy that has forwarded 7178 the message. Each recipient MUST append its information such that 7179 the end result is ordered according to the sequence of forwarding 7180 applications. 7182 Proxies (e.g., Access Proxy or Translator Proxy) SHOULD NOT, by 7183 default, forward the names and ports of hosts within the private/ 7184 protected region. This information SHOULD only be propagated if 7185 explicitly enabled. If not enabled, the via-received of any host 7186 behind the firewall/NAT SHOULD be replaced by an appropriate 7187 pseudonym for that host. 7189 For organizations that have strong privacy requirements for hiding 7190 internal structures, a proxy MAY combine an ordered subsequence of 7191 Via header field entries with identical sent-protocol values into a 7192 single such entry. Applications MUST NOT combine entries which have 7193 different received-protocol values. 7195 16.57. WWW-Authenticate 7197 The WWW-Authenticate response-header field MUST be included in 401 7198 (Unauthorized) response messages. The field value consists of at 7199 least one challenge that indicates the authentication scheme(s) and 7200 parameters applicable to the Request-URI. 7202 The HTTP access authentication process is described in [RFC2617]. 7203 User agents are advised to take special care in parsing the WWW- 7204 Authenticate field value as it might contain more than one challenge, 7205 or if more than one WWW-Authenticate header field is provided, the 7206 contents of a challenge itself can contain a comma-separated list of 7207 authentication parameters. 7209 17. Proxies 7211 RTSP Proxies are RTSP agents that sit in between a client and a 7212 server. A proxy can take on both the role as a client and as server 7213 depending on what it tries to accomplish. Proxies are also 7214 introduced for several different reasons and the below are often 7215 combined. 7217 Caching Proxy: This type of proxy is used to reduce the workload on 7218 servers and connections. By caching the description and media 7219 streams, i.e., the presentation, the proxy can serve a client 7220 with content, but without requesting it from the server once it 7221 has been cached and has not become stale. See the caching 7222 Section 18. This type of proxy is also expected to understand 7223 RTSP end-point functionality, i.e., functionality identified in 7224 the Require header in addition to what Proxy-Require demands. 7226 Translator Proxy: This type of proxy is used to ensure that an RTSP 7227 client get access to servers and content on an external network 7228 or using content encodings not supported by the client. The 7229 proxy performs the necessary translation of addresses, 7230 protocols or encodings. This type of proxy is expected to also 7231 understand RTSP end-point functionality, i.e. functionality 7232 identified in the Require header in addition to what Proxy- 7233 Require demands. 7235 Access Proxy: This type of proxy is used to ensure that a RTSP 7236 client get access to servers on an external network. Thus this 7237 proxy is placed on the border between two domains, e.g. a 7238 private address space and the public Internet. The proxy 7239 performs the necessary translation, usually addresses. This 7240 type of proxies are required to redirect the media to 7241 themselves or a controlled gateway that perform the translation 7242 before the media can reach the client. 7244 Security Proxy: This type of proxy is used to help facilitate 7245 security functions around RTSP. For example when having a 7246 firewalled network, the security proxy request that the 7247 necessary pinholes in the firewall is opened when a client in 7248 the protected network want to access media streams on the 7249 external side. This proxy can also limit the clients access to 7250 certain type of content. This proxy can perform its function 7251 without redirecting the media between the server and client. 7252 However, in deployments with private address spaces this proxy 7253 is likely to be combined with the access proxy. Anyway, the 7254 functionality of this proxy is usually closely tied into 7255 understand all aspects of the media transport. 7257 Auditing Proxy: RTSP proxies can also provide network owners with a 7258 logging and audit point for RTSP sessions, e.g. for 7259 corporations that tracks their employees usage of the network. 7260 This type of proxy can perform its function without inserting 7261 itself or any other node in the media transport. This proxy 7262 type can also accept unknown methods as it doesn't interfere 7263 with the clients' requests. 7265 All type of proxies can be used also when using secured communication 7266 with TLS as RTSP 2.0 allows the client to approve certificate chains 7267 used for connection establishment from a proxy, see Section 19.3.2. 7268 However, that trust model may not be suitable for all type of 7269 deployment. In those cases, the secured sessions do by-pass of the 7270 proxies. 7272 Access proxies SHOULD NOT be used in equipment like NATs and 7273 firewalls that aren't expected to be regularly maintained, like home 7274 or small office equipment. In these cases it is better to use the 7275 NAT traversal procedures defined for RTSP 2.0 7276 [I-D.ietf-mmusic-rtsp-nat]. The reason for these recommendations is 7277 that any extensions of RTSP resulting in new media transport 7278 protocols or profiles, new parameters etc may fail in a proxy that 7279 isn't maintained. This would impede RTSP's future development and 7280 usage. 7282 17.1. Proxies and Protocol Extensions 7284 The existence of proxies must always be considered when developing 7285 new RTSP extensions. Most types of proxies will need to implement 7286 any new method to operate correctly in the presence of that 7287 extension. New headers can be introduced and will not be blocked by 7288 older proxies. However, it is important to consider if this header 7289 and its function is required to be understood by the proxy or can be 7290 forwarded. If the header needs to be understood a feature-tag 7291 representing the functionality needs to be included in the Proxy- 7292 Require header. Below are guidelines for analysis if the header 7293 needs to be understood. The transport header and its parameters also 7294 shows that headers that are extensible and require correct 7295 interpretation in the proxy also require handling rules. 7297 Whether a proxy needs to understand a header is not easy to 7298 determine, as they serve a broad variety of functions. When 7299 evaluating if a header needs to be understood, one can divide the 7300 functionality into three main categories: 7302 Media modifying: The caching and translator proxies are modifying 7303 the actual media and therefore needs to understand also request 7304 directed to the server that affects how the media is rendered. 7305 Thus, this type of proxies needs to also understand the server 7306 side functionality. 7308 Transport modifying: The access and the security proxy both need to 7309 understand how the transport is performed, either for opening 7310 pinholes or to translate the outer headers, e.g. IP and UDP. 7312 Non-modifying: The audit proxy is special in that it do not modify 7313 the messages in other ways than to insert the Via header. That 7314 makes it possible for this type to forward RTSP message that 7315 contains different type of unknown methods, headers or header 7316 parameters. 7318 Based on the above classification, one should evaluate if the new 7319 functionality requires the Transport modifying type of proxies to 7320 understand it or not. 7322 17.2. Multiplexing and Demultiplexing of Messages 7324 RTSP proxies may have to multiplex multiple RTSP sessions from their 7325 clients towards RTSP servers. This requires that RTSP requests from 7326 multiple clients are multiplexed onto a common connection for 7327 requests outgoing to a RTSP server and on the way back the responses 7328 are demultiplexed from the server to per client responses. On the 7329 protocol level this requires that request and response messages are 7330 handled in both ways, requiring that there is a mechanism to 7331 correlated what request/response pair exchanged between proxy and 7332 server is mapped to what client (or client request). 7334 This multiplexing of requests and demultiplexing of responses is done 7335 by using the CSeq header field (see Section 16.19). The proxy has to 7336 rewrite the CSeq in requests to the server and responses from the 7337 server and remember what CSeq is mapped to what client. 7339 18. Caching 7341 In HTTP, response-request pairs are cached. RTSP differs 7342 significantly in that respect. Responses are not cacheable, with the 7343 exception of the presentation description returned by DESCRIBE. 7344 (Since the responses for anything but DESCRIBE and GET_PARAMETER do 7345 not return any data, caching is not really an issue for these 7346 requests.) However, it is desirable for the continuous media data, 7347 typically delivered out-of-band with respect to RTSP, to be cached, 7348 as well as the session description. 7350 On receiving a SETUP or PLAY request, a proxy ascertains whether it 7351 has an up-to-date copy of the continuous media content and its 7352 description. It can determine whether the copy is up-to-date by 7353 issuing a SETUP or DESCRIBE request, respectively, and comparing the 7354 Last-Modified header with that of the cached copy. If the copy is 7355 not up-to-date, it modifies the SETUP transport parameters as 7356 appropriate and forwards the request to the origin server. 7357 Subsequent control commands such as PLAY or PAUSE then pass the proxy 7358 unmodified. The proxy delivers the continuous media data to the 7359 client, while possibly making a local copy for later reuse. The 7360 exact allowed behavior of the cache is given by the cache-response 7361 directives described in Section 16.10. A cache MUST answer any 7362 DESCRIBE requests if it is currently serving the stream to the 7363 requester, as it is possible that low-level details of the stream 7364 description may have changed on the origin-server. 7366 Note that an RTSP cache, is of the "cut-through" variety. Rather 7367 than retrieving the whole resource from the origin server, the cache 7368 simply copies the streaming data as it passes by on its way to the 7369 client. Thus, it does not introduce additional latency. 7371 To the client, an RTSP proxy cache appears like a regular media 7372 server, to the media origin server like a client. Just as an HTTP 7373 cache has to store the content type, content language, and so on for 7374 the objects it caches, a media cache has to store the presentation 7375 description. Typically, a cache eliminates all transport-references 7376 (that is, e.g. multicast information) from the presentation 7377 description, since these are independent of the data delivery from 7378 the cache to the client. Information on the encodings remains the 7379 same. If the cache is able to translate the cached media data, it 7380 would create a new presentation description with all the encoding 7381 possibilities it can offer. 7383 18.1. Validation Model 7385 When a cache has a stale entry that it would like to use as a 7386 response to a client's request, it first has to check with the origin 7387 server (or possibly an intermediate cache with a fresh response) to 7388 see if its cached entry is still usable. We call this "validating" 7389 the cache entry. Since we do not want to have to pay the overhead of 7390 retransmitting the full response if the cached entry is good, and we 7391 do not want to pay the overhead of an extra round trip if the cached 7392 entry is invalid, the RTSP protocol supports the use of conditional 7393 methods. 7395 The key protocol features for supporting conditional methods are 7396 those concerned with "cache validators." When an origin server 7397 generates a full response, it attaches some sort of validator to it, 7398 which is kept with the cache entry. When a client (user agent or 7399 proxy cache) makes a conditional request for a resource for which it 7400 has a cache entry, it includes the associated validator in the 7401 request. 7403 The server then checks that validator against the current validator 7404 for the requested resource, and, if they match (see Section 18.1.3), 7405 it responds with a special status code (usually, 304 (Not Modified)) 7406 and no message body. Otherwise, it returns a full response 7407 (including message body). Thus, we avoid transmitting the full 7408 response if the validator matches, and we avoid an extra round trip 7409 if it does not match. 7411 In RTSP, a conditional request looks exactly the same as a normal 7412 request for the same resource, except that it carries a special 7413 header (which includes the validator) that implicitly turns the 7414 method (usually DESCRIBE or SETUP) into a conditional. 7416 The protocol includes both positive and negative senses of cache- 7417 validating conditions. That is, it is possible to request either 7418 that a method be performed if and only if a validator matches or if 7419 and only if no validators match. 7421 Note: a response that lacks a validator may still be cached, and 7422 served from cache until it expires, unless this is explicitly 7423 prohibited by a cache-control directive (see Section 16.10). 7424 However, a cache cannot do a conditional retrieval if it does not 7425 have a validator for the resource, which means it will not be 7426 refreshable after it expires. 7428 Media streams that are being adapted based on the transport capacity 7429 between the server and the cache makes caching more difficult. A 7430 server needs to consider how it views caching of media streams that 7431 it adapts and potentially instruct any caches to not cache such 7432 streams. 7434 18.1.1. Last-Modified Dates 7436 The Last-Modified header (Section 16.26) value is often used as a 7437 cache validator. In simple terms, a cache entry is considered to be 7438 valid if the content has not been modified since the Last-Modified 7439 value. 7441 18.1.2. Message Body Tag Cache Validators 7443 The MTag response-header field value, an message body tag, provides 7444 for an "opaque" cache validator. This might allow more reliable 7445 validation in situations where it is inconvenient to store 7446 modification dates, where the one-second resolution of RTSP-date 7447 values is not sufficient, or where the origin server wishes to avoid 7448 certain paradoxes that might arise from the use of modification 7449 dates. 7451 Message body tags are described in Section 5.3 7453 18.1.3. Weak and Strong Validators 7455 Since both origin servers and caches will compare two validators to 7456 decide if they represent the same or different entities, one normally 7457 would expect that if the message body (i.e., the presentation 7458 description) or any associated message body headers changes in any 7459 way, then the associated validator would change as well. If this is 7460 true, then we call this validator a "strong validator." We call 7461 message body (i.e., the presentation description) or any associated 7462 message body headers an entity for a better understanding. 7464 However, there might be cases when a server prefers to change the 7465 validator only on semantically significant changes, and not when 7466 insignificant aspects of the entity change. A validator that does 7467 not always change when the resource changes is a "weak validator." 7469 Message body tags are normally "strong validators," but the protocol 7470 provides a mechanism to tag an message body tag as "weak." One can 7471 think of a strong validator as one that changes whenever the bits of 7472 an entity changes, while a weak value changes whenever the meaning of 7473 an entity changes. Alternatively, one can think of a strong 7474 validator as part of an identifier for a specific entity, while a 7475 weak validator is part of an identifier for a set of semantically 7476 equivalent entities. 7478 Note: One example of a strong validator is an integer that is 7479 incremented in stable storage every time an entity is changed. 7481 An entity's modification time, if represented with one-second 7482 resolution, could be a weak validator, since it is possible that 7483 the resource might be modified twice during a single second. 7485 Support for weak validators is optional. However, weak validators 7486 allow for more efficient caching of equivalent objects. 7488 A "use" of a validator is either when a client generates a request 7489 and includes the validator in a validating header field, or when a 7490 server compares two validators. 7492 Strong validators are usable in any context. Weak validators are 7493 only usable in contexts that do not depend on exact equality of an 7494 entity. For example, either kind is usable for a conditional 7495 DESCRIBE of a full entity. However, only a strong validator is 7496 usable for a sub-range retrieval, since otherwise the client might 7497 end up with an internally inconsistent entity. 7499 Clients MAY issue DESCRIBE requests with either weak validators or 7500 strong validators. Clients MUST NOT use weak validators in other 7501 forms of request. 7503 The only function that the RTSP protocol defines on validators is 7504 comparison. There are two validator comparison functions, depending 7505 on whether the comparison context allows the use of weak validators 7506 or not: 7508 o The strong comparison function: in order to be considered equal, 7509 both validators MUST be identical in every way, and both MUST NOT 7510 be weak. 7512 o The weak comparison function: in order to be considered equal, 7513 both validators MUST be identical in every way, but either or both 7514 of them MAY be tagged as "weak" without affecting the result. 7516 An message body tag is strong unless it is explicitly tagged as weak. 7518 A Last-Modified time, when used as a validator in a request, is 7519 implicitly weak unless it is possible to deduce that it is strong, 7520 using the following rules: 7522 o The validator is being compared by an origin server to the actual 7523 current validator for the entity and, 7525 o That origin server reliably knows that the associated entity did 7526 not change twice during the second covered by the presented 7527 validator. 7529 OR 7531 o The validator is about to be used by a client in an If-Modified- 7532 Since, because the client has a cache entry for the associated 7533 entity, and 7535 o That cache entry includes a Date value, which gives the time when 7536 the origin server sent the original response, and 7538 o The presented Last-Modified time is at least 60 seconds before the 7539 Date value. 7541 OR 7543 o The validator is being compared by an intermediate cache to the 7544 validator stored in its cache entry for the entity, and 7546 o That cache entry includes a Date value, which gives the time when 7547 the origin server sent the original response, and 7549 o The presented Last-Modified time is at least 60 seconds before the 7550 Date value. 7552 This method relies on the fact that if two different responses were 7553 sent by the origin server during the same second, but both had the 7554 same Last-Modified time, then at least one of those responses would 7555 have a Date value equal to its Last-Modified time. The arbitrary 60- 7556 second limit guards against the possibility that the Date and Last- 7557 Modified values are generated from different clocks, or at somewhat 7558 different times during the preparation of the response. An 7559 implementation MAY use a value larger than 60 seconds, if it is 7560 believed that 60 seconds is too short. 7562 If a client wishes to perform a sub-range retrieval on a value for 7563 which it has only a Last-Modified time and no opaque validator, it 7564 MAY do this only if the Last-Modified time is strong in the sense 7565 described here. 7567 18.1.4. Rules for When to Use Message Body Tags and Last-Modified Dates 7569 We adopt a set of rules and recommendations for origin servers, 7570 clients, and caches regarding when various validator types ought to 7571 be used, and for what purposes. 7573 RTSP origin servers: 7575 o SHOULD send an message body tag validator unless it is not 7576 feasible to generate one. 7578 o MAY send a weak message body tag instead of a strong message body 7579 tag, if performance considerations support the use of weak message 7580 body tags, or if it is unfeasible to send a strong message body 7581 tag. 7583 o SHOULD send a Last-Modified value if it is feasible to send one, 7584 unless the risk of a breakdown in semantic transparency that could 7585 result from using this date in an If-Modified-Since header would 7586 lead to serious problems. 7588 In other words, the preferred behavior for an RTSP origin server is 7589 to send both a strong message body tag and a Last-Modified value. 7591 In order to be legal, a strong message body tag MUST change whenever 7592 the associated entity value changes in any way. A weak message body 7593 tag SHOULD change whenever the associated entity changes in a 7594 semantically significant way. 7596 Note: in order to provide semantically transparent caching, an 7597 origin server must avoid reusing a specific strong message body 7598 tag value for two different entities, or reusing a specific weak 7599 message body tag value for two semantically different entities. 7600 Cache entries might persist for arbitrarily long periods, 7601 regardless of expiration times, so it might be inappropriate to 7602 expect that a cache will never again attempt to validate an entry 7603 using a validator that it obtained at some point in the past. 7605 RTSP clients: 7607 o If an message body tag has been provided by the origin server, 7608 MUST use that message body tag in any cache-conditional request 7609 (using If- Match or If-None-Match). 7611 o If only a Last-Modified value has been provided by the origin 7612 server, SHOULD use that value in non-subrange cache-conditional 7613 requests (using If-Modified-Since). 7615 o If both an message body tag and a Last-Modified value have been 7616 provided by the origin server, SHOULD use both validators in 7617 cache-conditional requests. 7619 An RTSP origin server, upon receiving a conditional request that 7620 includes both a Last-Modified date (e.g., in an If-Modified-Since 7621 header) and one or more message body tags (e.g., in an If-Match, If- 7622 None-Match, or If-Range header field) as cache validators, MUST NOT 7623 return a response status of 304 (Not Modified) unless doing so is 7624 consistent with all of the conditional header fields in the request. 7626 Note: The general principle behind these rules is that RTSP 7627 servers and clients should transmit as much non-redundant 7628 information as is available in their responses and requests. RTSP 7629 systems receiving this information will make the most conservative 7630 assumptions about the validators they receive. 7632 18.1.5. Non-validating Conditionals 7634 The principle behind message body tags is that only the service 7635 author knows the semantics of a resource well enough to select an 7636 appropriate cache validation mechanism, and the specification of any 7637 validator comparison function more complex than byte-equality would 7638 open up a can of worms. Thus, comparisons of any other headers are 7639 never used for purposes of validating a cache entry. 7641 18.2. Invalidation After Updates or Deletions 7643 The effect of certain methods performed on a resource at the origin 7644 server might cause one or more existing cache entries to become non- 7645 transparently invalid. That is, although they might continue to be 7646 "fresh," they do not accurately reflect what the origin server would 7647 return for a new request on that resource. 7649 There is no way for the RTSP protocol to guarantee that all such 7650 cache entries are marked invalid. For example, the request that 7651 caused the change at the origin server might not have gone through 7652 the proxy where a cache entry is stored. However, several rules help 7653 reduce the likelihood of erroneous behavior. 7655 In this section, the phrase "invalidate an entity" means that the 7656 cache will either remove all instances of that entity from its 7657 storage, or will mark these as "invalid" and in need of a mandatory 7658 revalidation before they can be returned in response to a subsequent 7659 request. 7661 Some RTSP methods MUST cause a cache to invalidate an entity. This 7662 is either the entity referred to by the Request-URI, or by the 7663 Location or Content-Location headers (if present). These methods 7664 are: 7666 o DESCRIBE 7667 o SETUP 7669 In order to prevent denial of service attacks, an invalidation based 7670 on the URI in a Location or Content-Location header MUST only be 7671 performed if the host part is the same as in the Request-URI. 7673 A cache that passes through requests for methods it does not 7674 understand SHOULD invalidate any entities referred to by the Request- 7675 URI. 7677 19. Security Framework 7679 The RTSP security framework consists of two high level components: 7680 the pure authentication mechanisms based on HTTP authentication, and 7681 the message transport protection based on TLS, which is independent 7682 of RTSP. Because of the similarity in syntax and usage between RTSP 7683 servers and HTTP servers, the security for HTTP is re-used to a large 7684 extent. 7686 19.1. RTSP and HTTP Authentication 7688 RTSP and HTTP share common authentication schemes, and thus follow 7689 the same usage guidelines as specified in[RFC2617] and also in [H15]. 7690 Servers SHOULD implement both basic and digest [RFC2617] 7691 authentication. Client MUST implement both basic and digest 7692 authentication [RFC2617] so that Server who requires the client to 7693 authenticate can trust that the capability is present. 7695 It should be stressed that using the HTTP authentication alone does 7696 not provide full control message security. Therefore, in 7697 environments requiring tighter security for the control messages, TLS 7698 SHOULD be used, see Section 19.2. 7700 19.2. RTSP over TLS 7702 RTSP MUST follow the same guidelines with regards to TLS [RFC5246] 7703 usage as specified for HTTP, see [RFC2818]. RTSP over TLS is 7704 separated from unsecured RTSP both on URI level and port level. 7705 Instead of using the "rtsp" scheme identifier in the URI, the "rtsps" 7706 scheme identifier MUST be used to signal RTSP over TLS. If no port 7707 is given in a URI with the "rtsps" scheme, port 322 MUST be used for 7708 TLS over TCP/IP. 7710 When a client tries to setup an insecure channel to the server (using 7711 the "rtsp" URI), and the policy for the resource requires a secure 7712 channel, the server MUST redirect the client to the secure service by 7713 sending a 301 redirect response code together with the correct 7714 Location URI (using the "rtsps" scheme). A user or client MAY 7715 upgrade a non secured URI to a secured by changing the scheme from 7716 "rtsp" to "rtsps". A server implementing support for "rtsps" MUST 7717 allow this. 7719 It should be noted that TLS allows for mutual authentication (when 7720 using both server and client certificates). Still, one of the more 7721 common ways TLS is used is to only provide server side authentication 7722 (often to avoid client certificates). TLS is then used in addition 7723 to HTTP authentication, providing transport security and server 7724 authentication, while HTTP Authentication is used to authenticate the 7725 client. 7727 RTSP includes the possibility to keep a TCP session up between the 7728 client and server, throughout the RTSP session lifetime. It may be 7729 convenient to keep the TCP session, not only to save the extra setup 7730 time for TCP, but also the extra setup time for TLS (even if TLS uses 7731 the resume function, there will be almost two extra round trips). 7732 Still, when TLS is used, such behavior introduces extra active state 7733 in the server, not only for TCP and RTSP, but also for TLS. This may 7734 increase the vulnerability to DoS attacks. 7736 In addition to these recommendations, Section 19.3 gives further 7737 recommendations of TLS usage with proxies. 7739 19.3. Security and Proxies 7741 The nature of a proxy is often to act as a "man-in-the-middle", while 7742 security is often about preventing the existence of a "man-in-the- 7743 middle". This section provides clients with the possibility to use 7744 proxies even when applying secure transports (TLS) between the RTSP 7745 agents. The TLS proxy mechanism allows for server and proxy 7746 identification using certificates. However, the client can not be 7747 identified based on certificates. The client needs to select between 7748 using the procedure specified below or using a TLS connection 7749 directly (by-passing any proxies) to the server. The choice may be 7750 dependent on policies. 7752 There are basically two categories of proxies, the transparent 7753 proxies (of which the client is not aware) and the non-transparent 7754 proxies (of which the client is aware). An infrastructure based on 7755 proxies requires that the trust model is such that both client and 7756 servers can trust the proxies to handle the RTSP messages correctly. 7757 To be able to trust a proxy, the client and server also needs to be 7758 aware of the proxy. Hence, transparent proxies cannot generally be 7759 seen as trusted and will not work well with security (unless they 7760 work only at transport layer). In the rest of this section any 7761 reference to proxy will be to a non-transparent proxy, which inspects 7762 or manipulate the RTSP messages. 7764 HTTP Authentication is built on the assumption of proxies and can 7765 provide user-proxy authentication and proxy-proxy/server 7766 authentication in addition to the client-server authentication. 7768 When TLS is applied and a proxy is used, the client will connect to 7769 the proxy's address when connecting to any RTSP server. This implies 7770 that for TLS, the client will authenticate the proxy server and not 7771 the end server. Note that when the client checks the server 7772 certificate in TLS, it MUST check the proxy's identity (URI or 7773 possibly other known identity) against the proxy's identity as 7774 presented in the proxy's Certificate message. 7776 The problem is that for a proxy accepted by the client, the proxy 7777 needs to be provided information on which grounds it should accept 7778 the next-hop certificate. Both the proxy and the user may have rules 7779 for this, and the user have the possibility to select the desired 7780 behavior. To handle this case, the Accept-Credentials header (See 7781 Section 16.2) is used, where the client can force the proxy/proxies 7782 to relay back the chain of certificates used to authenticate any 7783 intermediate proxies as well as the server. Given the assumption 7784 that the proxies are viewed as trusted, it gives the user a 7785 possibility to enforce policies to each trusted proxy of whether it 7786 should accept the next agent in the chain. 7788 A proxy MUST use TLS for the next hop if the RTSP request includes a 7789 "rtsps" URI. TLS MAY be applied on intermediate links (e.g. between 7790 client and proxy, or between proxy and proxy), even if the resource 7791 and the end server are not require to use it. The proxy MUST, when 7792 initiating the next hop TLS connection, use the incoming TLS 7793 connections cipher suite list, only modified by removing any cipher 7794 suits that the proxy does not support. In case a proxy fails to 7795 establish a TLS connection due to cipher suite mismatch between proxy 7796 and next hop proxy or server, this is indicated using error code 472 7797 (Failure to establish secure connection). 7799 19.3.1. Accept-Credentials 7801 The Accept-Credentials header can be used by the client to distribute 7802 simple authorization policies to intermediate proxies. The client 7803 includes the Accept-Credentials header to dictate how the proxy 7804 treats the server/next proxy certificate. There are currently three 7805 methods defined: 7807 Any, which means that the proxy (or proxies) MUST accept whatever 7808 certificate presented. This is of course not a recommended 7809 option to use, but may be useful in certain circumstances (such 7810 as testing). 7812 Proxy, which means that the proxy (or proxies) MUST use its own 7813 policies to validate the certificate and decide whether to 7814 accept it or not. This is convenient in cases where the user 7815 has a strong trust relation with the proxy. Reason why a 7816 strong trust relation may exist are; personal/company proxy, 7817 proxy has a out-of-band policy configuration mechanism. 7819 User, which means that the proxy (or proxies) MUST send credential 7820 information about the next hop to the client for authorization. 7821 The client can then decide whether the proxy should accept the 7822 certificate or not. See Section 19.3.2 for further details. 7824 If the Accept-Credentials header is not included in the RTSP request 7825 from the client, then the "Proxy" method MUST be used as default. If 7826 another method than the "Proxy" is to be used, then the Accept- 7827 Credentials header MUST be included in all of the RTSP request from 7828 the client. This is because it cannot be assumed that the proxy 7829 always keeps the TLS state or the users previous preference between 7830 different RTSP messages (in particular if the time interval between 7831 the messages is long). 7833 With the "Any" and "Proxy" methods the proxy will apply the policy as 7834 defined for respectively method. If the policy does not accept the 7835 credentials of the next hop, the proxy MUST respond with a message 7836 using status code 471 (Connection Credentials not accepted). 7838 An RTSP request in the direction server to client MUST NOT include 7839 the Accept-Credential header. As for the non-secured communication, 7840 the possibility for these requests depends on the presence of a 7841 client established connection. However, if the server to client 7842 request is in relation to a session established over a TLS secured 7843 channel, it MUST be sent in a TLS secured connection. That secured 7844 connection MUST also be the one used by the last client to server 7845 request. If no such transport connection exist at the time when the 7846 server desires to send the request, the server discard the message. 7848 Further policies MAY be defined and registered, but should be done so 7849 with caution. 7851 19.3.2. User approved TLS procedure 7853 For the "User" method, each proxy MUST perform the following 7854 procedure for each RTSP request: 7856 o Setup the TLS session to the next hop if not already present (i.e. 7857 run the TLS handshake, but do not send the RTSP request). 7859 o Extract the peer certificate chain for the TLS session. 7861 o Check if a matching identity and hash of the peer certificate is 7862 present in the Accept-Credentials header. If present, send the 7863 message to the next hop, and conclude these procedures. If not, 7864 go to the next step. 7866 o The proxy responds to the RTSP request with a 470 or 407 response 7867 code. The 407 response code MAY be used when the proxy requires 7868 both user and connection authorization from user or client. In 7869 this message the proxy MUST include a Connection-Credentials 7870 header, see Section 16.12 with the next hop's identity and 7871 certificate. 7873 The client MUST upon receiving a 470 or 407 response with Connection- 7874 Credentials header take the decision on whether to accept the 7875 certificate or not (if it cannot do so, the user SHOULD be 7876 consulted). If the certificate is accepted, the client has to again 7877 send the RTSP request. In that request the client has to include the 7878 Accept-Credentials header including the hash over the DER encoded 7879 certificate for all trusted proxies in the chain. 7881 Example: 7883 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7884 CSeq: 2 7885 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7886 "192.0.2.5:4589" 7887 Accept-Ranges: NPT, SMPTE, UTC 7888 Accept-Credentials: User 7890 P->C: RTSP/2.0 470 Connection Authorization Required 7891 CSeq: 2 7892 Connection-Credentials: "rtsps://test.example.org"; 7893 MIIDNTCCAp... 7895 C->P: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7896 CSeq: 3 7897 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7898 "192.0.2.5:4589" 7899 Accept-Credentials: User "rtsps://test.example.org";sha-256; 7900 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 7901 Accept-Ranges: NPT, SMPTE, UTC 7903 P->S: SETUP rtsps://test.example.org/secret/audio RTSP/2.0 7904 CSeq: 3 7905 Transport: RTP/AVP;unicast;dest_addr="192.0.2.5:4588"/ 7906 "192.0.2.5:4589" 7907 Via: RTSP/2.0 proxy.example.org 7908 Accept-Credentials: User "rtsps://test.example.org";sha-256; 7909 dPYD7txpoGTbAqZZQJ+vaeOkyH4= 7910 Accept-Ranges: NPT, SMPTE, UTC 7912 One implication of this process is that the connection for secured 7913 RTSP messages may take significantly more round-trip times for the 7914 first message. A complete extra message exchange between the proxy 7915 connecting to the next hop and the client results because of the 7916 process for approval for each hop. However, if each message contains 7917 the chain of proxies that the requester accepts, the remaining 7918 message exchange should not be delayed. The procedure of including 7919 the credentials in each request rather than building state in each 7920 proxy, avoids the need for revocation procedures. 7922 20. Syntax 7924 The RTSP syntax is described in an Augmented Backus-Naur Form (ABNF) 7925 as defined in RFC 5234 [RFC5234]. It uses the basic definitions 7926 present in RFC 5234. 7928 Please note that ABNF strings, e.g. "Accept", are case insensitive 7929 as specified in section 2.3 of RFC 5234. 7931 20.1. Base Syntax 7933 RTSP header values can be folded onto multiple lines if the 7934 continuation line begins with a space or horizontal tab. All linear 7935 white space, including folding, has the same semantics as SP. A 7936 recipient MAY replace any linear white space with a single SP before 7937 interpreting the field value or forwarding the message downstream. 7938 This is intended to behave exactly as HTTP/1.1 as described in RFC 7939 2616 [RFC2616]. The SWS construct is used when linear white space is 7940 optional, generally between tokens and separators. 7942 To separate the header name from the rest of value, a colon is used, 7943 which, by the above rule, allows whitespace before, but no line 7944 break, and whitespace after, including a line break. The HCOLON 7945 defines this construct. 7947 OCTET = %x00-FF ; any 8-bit sequence of data 7948 CHAR = %x01-7F ; any US-ASCII character (octets 1 - 127) 7949 UPALPHA = %x41-5A ; any US-ASCII uppercase letter "A".."Z" 7950 LOALPHA = %x61-7A ;any US-ASCII lowercase letter "a".."z" 7951 ALPHA = UPALPHA / LOALPHA 7952 DIGIT = %x30-39 ; any US-ASCII digit "0".."9" 7953 CTL = %x00-1F / %x7F ; any US-ASCII control character 7954 ; (octets 0 - 31) and DEL (127) 7955 CR = %x0D ; US-ASCII CR, carriage return (13) 7956 LF = %x0A ; US-ASCII LF, linefeed (10) 7957 SP = %x20 ; US-ASCII SP, space (32) 7958 HT = %x09 ; US-ASCII HT, horizontal-tab (9) 7959 DQ = %x22 ; US-ASCII double-quote mark (34) 7960 BACKSLASH = %x5C ; US-ASCII backslash (92) 7961 CRLF = CR LF 7962 LWS = [CRLF] 1*( SP / HT ) ; Line-breaking White Space 7963 SWS = [LWS] ; Separating White Space 7964 HCOLON = *( SP / HT ) ":" SWS 7965 TEXT = %x20-7E / %x80-FF ; any OCTET except CTLs 7966 tspecials = "(" / ")" / "<" / ">" / "@" 7967 / "," / ";" / ":" / BACKSLASH / DQ 7968 / "/" / "[" / "]" / "?" / "=" 7969 / "{" / "}" / SP / HT 7970 token = 1*(%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 7971 / %x41-5A / %x5E-7A / %x7C / %x7E) 7972 ; 1* 7973 quoted-string = ( DQ *qdtext DQ ) 7974 qdtext = %x20-21 / %x23-7E / %x80-FF / UTF8-NONASCII 7975 ; any UTF-8 TEXT except <"> 7976 quoted-pair = BACKSLASH CHAR 7977 ctext = %x20-27 / %x2A-7E 7978 / %x80-FF ; any OCTET except CTLs, "(" and ")" 7979 generic-param = token [ EQUAL gen-value ] 7980 gen-value = token / host / quoted-string 7982 safe = "$" / "-" / "_" / "." / "+" 7983 extra = "!" / "*" / "'" / "(" / ")" / "," 7984 rtsp-extra = "!" / "*" / "'" / "(" / ")" 7986 HEX = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" 7987 / "a" / "b" / "c" / "d" / "e" / "f" 7988 LHEX = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" 7989 ; lowercase "a-f" Hex 7990 reserved = ";" / "/" / "?" / ":" / "@" / "&" / "=" 7992 unreserved = ALPHA / DIGIT / safe / extra 7993 rtsp-unreserved = ALPHA / DIGIT / safe / rtsp-extra 7995 base64 = *base64-unit [base64-pad] 7996 base64-unit = 4base64-char 7997 base64-pad = (2base64-char "==") / (3base64-char "=") 7998 base64-char = ALPHA / DIGIT / "+" / "/" 7999 SLASH = SWS "/" SWS ; slash 8000 EQUAL = SWS "=" SWS ; equal 8001 LPAREN = SWS "(" SWS ; left parenthesis 8002 RPAREN = SWS ")" SWS ; right parenthesis 8003 COMMA = SWS "," SWS ; comma 8004 SEMI = SWS ";" SWS ; semicolon 8005 COLON = SWS ":" SWS ; colon 8006 MINUS = SWS "-" SWS ; minus/dash 8007 LDQUOT = SWS DQ ; open double quotation mark 8008 RDQUOT = DQ SWS ; close double quotation mark 8009 RAQUOT = ">" SWS ; right angle quote 8010 LAQUOT = SWS "<" ; left angle quote 8012 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 8013 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 8014 / %xE0-EF 2UTF8-CONT 8015 / %xF0-F7 3UTF8-CONT 8016 / %xF8-FB 4UTF8-CONT 8017 / %xFC-FD 5UTF8-CONT 8018 UTF8-CONT = %x80-BF 8020 POS-FLOAT = 1*12DIGIT ["." 1*9DIGIT] 8021 FLOAT = ["-"] POS-FLOAT 8023 20.2. RTSP Protocol Definition 8025 20.2.1. Generic Protocol elements 8026 RTSP-IRI = schemes ":" IRI-rest 8027 IRI-rest = ihier-part [ "?" iquery ] [ "#" ifragment ] 8028 ihier-part = "//" iauthority ipath-abempty 8029 RTSP-IRI-ref = RTSP-IRI / irelative-ref 8030 irelative-ref = irelative-part [ "?" iquery ] [ "#" ifragment ] 8031 irelative-part = "//" iauthority ipath-abempty 8032 / ipath-absolute 8033 / ipath-noscheme 8034 / ipath-empty 8036 iauthority = < As defined in RFC 3987> 8037 ipath = ipath-abempty ; begins with "/" or is empty 8038 / ipath-absolute ; begins with "/" but not "//" 8039 / ipath-noscheme ; begins with a non-colon segment 8040 / ipath-rootless ; begins with a segment 8041 / ipath-empty ; zero characters 8043 ipath-abempty = *( "/" isegment ) 8044 ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] 8045 ipath-noscheme = isegment-nz-nc *( "/" isegment ) 8046 ipath-rootless = isegment-nz *( "/" isegment ) 8047 ipath-empty = 0 8049 isegment = *ipchar [";" *ipchar] 8050 isegment-nz = 1*ipchar [";" *ipchar] 8051 / ";" *ipchar 8052 isegment-nz-nc = (1*ipchar-nc [";" *ipchar-nc]) 8053 / ";" *ipchar-nc 8054 ; non-zero-length segment without any colon ":" 8056 ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" 8057 ipchar-nc = iunreserved / pct-encoded / sub-delims / "@" 8059 iquery = < As defined in RFC 3987> 8060 ifragment = < As defined in RFC 3987> 8061 iunreserved = < As defined in RFC 3987> 8062 pct-encoded = < As defined in RFC 3987> 8063 RTSP-URI = schemes ":" URI-rest 8064 RTSP-REQ-URI = schemes ":" URI-req-rest 8065 RTSP-URI-Ref = RTSP-URI / RTSP-Relative 8066 RTSP-REQ-Ref = RTSP-REQ-URI / RTSP-REQ-Rel 8067 schemes = "rtsp" / "rtsps" / scheme 8068 scheme = < As defined in RFC 3986> 8069 URI-rest = hier-part [ "?" query ] [ "#" fragment ] 8070 URI-req-rest = hier-part [ "?" query ] 8071 ; Note fragment part not allowed in requests 8072 hier-part = "//" authority path-abempty 8074 RTSP-Relative = relative-part [ "?" query ] [ "#" fragment ] 8075 RTSP-REQ-Rel = relative-part [ "?" query ] 8076 relative-part = "//" authority path-abempty 8077 / path-absolute 8078 / path-noscheme 8079 / path-empty 8081 authority = < As defined in RFC 3986> 8082 query = < As defined in RFC 3986> 8083 fragment = < As defined in RFC 3986> 8085 path = path-abempty ; begins with "/" or is empty 8086 / path-absolute ; begins with "/" but not "//" 8087 / path-noscheme ; begins with a non-colon segment 8088 / path-rootless ; begins with a segment 8089 / path-empty ; zero characters 8091 path-abempty = *( "/" segment ) 8092 path-absolute = "/" [ segment-nz *( "/" segment ) ] 8093 path-noscheme = segment-nz-nc *( "/" segment ) 8094 path-rootless = segment-nz *( "/" segment ) 8095 path-empty = 0 8097 segment = *pchar [";" *pchar] 8098 segment-nz = ( 1*pchar [";" *pchar]) / (";" *pchar) 8099 segment-nz-nc = ( 1*pchar-nc [";" *pchar-nc]) / (";" *pchar-nc) 8100 ; non-zero-length segment without any colon ":" 8102 pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 8103 pchar-nc = unreserved / pct-encoded / sub-delims / "@" 8105 sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 8106 / "*" / "+" / "," / "=" 8108 smpte-range = smpte-type ["=" smpte-range-spec] 8109 ; See section 3.4 8110 smpte-range-spec = ( smpte-time "-" [ smpte-time ] ) 8111 / ( "-" smpte-time ) 8112 smpte-type = "smpte" / "smpte-30-drop" 8113 / "smpte-25" / smpte-type-extension 8114 ; other timecodes may be added 8115 smpte-type-extension = "smpte" token 8116 smpte-time = 1*2DIGIT ":" 1*2DIGIT ":" 1*2DIGIT 8117 [ ":" 1*2DIGIT [ "." 1*2DIGIT ] ] 8119 npt-range = "npt" ["=" npt-range-spec] 8120 npt-range-spec = ( npt-time "-" [ npt-time ] ) / ( "-" npt-time ) 8121 npt-time = "now" / npt-sec / npt-hhmmss 8122 npt-sec = 1*19DIGIT [ "." 1*9DIGIT ] 8123 npt-hhmmss = npt-hh ":" npt-mm ":" npt-ss [ "." 1*9DIGIT ] 8124 npt-hh = 1*19DIGIT ; any positive number 8125 npt-mm = 1*2DIGIT ; 0-59 8126 npt-ss = 1*2DIGIT ; 0-59 8128 utc-range = "clock" ["=" utc-range-spec] 8129 utc-range-spec = ( utc-time "-" [ utc-time ] ) / ( "-" utc-time ) 8130 utc-time = utc-date "T" utc-clock "Z" 8131 utc-date = 8DIGIT 8132 utc-clock = 6DIGIT [ "." 1*9DIGIT ] 8134 feature-tag = token 8136 session-id = 1*256( ALPHA / DIGIT / safe ) 8138 extension-header = header-name HCOLON header-value 8139 header-name = token 8140 header-value = *(TEXT-UTF8char / UTF8-CONT / LWS) 8142 20.2.2. Message Syntax 8143 RTSP-message = Request / Response ; RTSP/2.0 messages 8145 Request = Request-Line 8146 *((general-header 8147 / request-header 8148 / message-header) CRLF) 8149 CRLF 8150 [ message-body-data ] 8152 Response = Status-Line 8153 *((general-header 8154 / response-header 8155 / message-header) CRLF) 8156 CRLF 8157 [ message-body-data ] 8159 Request-Line = Method SP Request-URI SP RTSP-Version CRLF 8161 Status-Line = RTSP-Version SP Status-Code SP Reason-Phrase CRLF 8162 Method = "DESCRIBE" 8163 / "GET_PARAMETER" 8164 / "OPTIONS" 8165 / "PAUSE" 8166 / "PLAY" 8167 / "PLAY_NOTIFY" 8168 / "REDIRECT" 8169 / "SETUP" 8170 / "SET_PARAMETER" 8171 / "TEARDOWN" 8172 / extension-method 8174 extension-method = token 8176 Request-URI = "*" / RTSP-REQ-URI 8177 RTSP-Version = "RTSP/" 1*DIGIT "." 1*DIGIT 8179 message-body-data = 1*OCTET 8181 Status-Code = "100" ; Continue 8182 / "200" ; OK 8183 / "301" ; Moved Permanently 8184 / "302" ; Found 8185 / "303" ; See Other 8186 / "304" ; Not Modified 8187 / "305" ; Use Proxy 8188 / "400" ; Bad Request 8189 / "401" ; Unauthorized 8190 / "402" ; Payment Required 8191 / "403" ; Forbidden 8192 / "404" ; Not Found 8193 / "405" ; Method Not Allowed 8194 / "406" ; Not Acceptable 8195 / "407" ; Proxy Authentication Required 8196 / "408" ; Request Time-out 8197 / "410" ; Gone 8198 / "411" ; Length Required 8199 / "412" ; Precondition Failed 8200 / "413" ; Request Message Body Too Large 8201 / "414" ; Request-URI Too Large 8202 / "415" ; Unsupported Media Type 8203 / "451" ; Parameter Not Understood 8204 / "452" ; reserved 8205 / "453" ; Not Enough Bandwidth 8206 / "454" ; Session Not Found 8207 / "455" ; Method Not Valid in This State 8208 / "456" ; Header Field Not Valid for Resource 8209 / "457" ; Invalid Range 8210 / "458" ; Parameter Is Read-Only 8211 / "459" ; Aggregate operation not allowed 8212 / "460" ; Only aggregate operation allowed 8213 / "461" ; Unsupported Transport 8214 / "462" ; Destination Unreachable 8215 / "463" ; Destination Prohibited 8216 / "464" ; Data Transport Not Ready Yet 8217 / "470" ; Connection Authorization Required 8218 / "471" ; Connection Credentials not accepted 8219 / "472" ; Failure to establish secure connection 8220 / "500" ; Internal Server Error 8221 / "501" ; Not Implemented 8222 / "502" ; Bad Gateway 8223 / "503" ; Service Unavailable 8224 / "504" ; Gateway Time-out 8225 / "505" ; RTSP Version not supported 8226 / "551" ; Option not supported 8227 / extension-code 8229 extension-code = 3DIGIT 8231 Reason-Phrase = 1*(TEXT-UTF8char / HT / SP) 8232 general-header = Cache-Control 8233 / Connection 8234 / CSeq 8235 / Date 8236 / Media-Properties 8237 / Media-Range 8238 / Pipelined-Requests 8239 / Proxy-Supported 8240 / Seek-Style 8241 / Server 8242 / Supported 8243 / Timestamp 8244 / User-Agent 8245 / Via 8246 / extension-header 8248 request-header = Accept 8249 / Accept-Credentials 8250 / Accept-Encoding 8251 / Accept-Language 8252 / Authorization 8253 / Bandwidth 8254 / Blocksize 8255 / From 8256 / If-Match 8257 / If-Modified-Since 8258 / If-None-Match 8259 / Notify-Reason 8260 / Proxy-Require 8261 / Range 8262 / Referrer 8263 / Request-Status 8264 / Require 8265 / Scale 8266 / Session 8267 / Speed 8268 / Supported 8269 / Terminate-Reason 8270 / Transport 8271 / extension-header 8273 response-header = Accept-Credentials 8274 / Accept-Ranges 8275 / Connection-Credentials 8276 / MTag 8277 / Location 8278 / Proxy-Authenticate 8279 / Public 8280 / Range 8281 / Retry-After 8282 / RTP-Info 8283 / Scale 8284 / Session 8285 / Speed 8286 / Transport 8287 / Unsupported 8288 / Vary 8289 / WWW-Authenticate 8290 / extension-header 8292 message-header = Allow 8293 / Content-Base 8294 / Content-Encoding 8295 / Content-Language 8296 / Content-Length 8297 / Content-Location 8298 / Content-Type 8299 / Expires 8300 / Last-Modified 8301 / extension-header 8303 20.2.3. Header Syntax 8305 Accept = "Accept" HCOLON 8306 [ accept-range *(COMMA accept-range) ] 8307 accept-range = media-type-range [SEMI accept-params] 8308 media-type-range = ( "*/*" 8309 / ( m-type SLASH "*" ) 8310 / ( m-type SLASH m-subtype ) 8311 ) *( SEMI m-parameter ) 8312 accept-params = "q" EQUAL qvalue *(SEMI generic-param ) 8313 qvalue = ( "0" [ "." *3DIGIT ] ) 8314 / ( "1" [ "." *3("0") ] ) 8315 Accept-Credentials = "Accept-Credentials" HCOLON cred-decision 8316 cred-decision = ("User" [LWS cred-info]) 8317 / "Proxy" 8318 / "Any" 8319 / (token [LWS 1*header-value]) 8320 ; For future extensions 8321 cred-info = cred-info-data *(COMMA cred-info-data) 8323 cred-info-data = DQ RTSP-REQ-URI DQ SEMI hash-alg SEMI base64 8324 hash-alg = "sha-256" / extension-alg 8325 extension-alg = token 8326 Accept-Encoding = "Accept-Encoding" HCOLON 8327 [ encoding *(COMMA encoding) ] 8328 encoding = codings [SEMI accept-params] 8329 codings = content-coding / "*" 8330 content-coding = token 8331 Accept-Language = "Accept-Language" HCOLON 8332 language *(COMMA language) 8333 language = language-range [SEMI accept-params] 8334 language-range = language-tag / "*" 8335 language-tag = primary-tag *( "-" subtag ) 8336 primary-tag = 1*8ALPHA 8337 subtag = 1*8ALPHA 8338 Accept-Ranges = "Accept-Ranges" HCOLON acceptable-ranges 8339 acceptable-ranges = (range-unit *(COMMA range-unit)) 8340 range-unit = "NPT" / "SMPTE" / "UTC" / extension-format 8341 extension-format = token 8342 Allow = "Allow" HCOLON Method *(COMMA Method) 8343 Authorization = "Authorization" HCOLON credentials 8344 credentials = ("Digest" LWS digest-response) 8345 / other-response 8346 digest-response = dig-resp *(COMMA dig-resp) 8347 dig-resp = username / realm / nonce / digest-uri 8348 / dresponse / algorithm / cnonce 8349 / opaque / message-qop 8350 / nonce-count / auth-param 8351 username = "username" EQUAL username-value 8352 username-value = quoted-string 8353 digest-uri = "uri" EQUAL LDQUOT digest-uri-value RDQUOT 8354 digest-uri-value = RTSP-REQ-URI 8355 message-qop = "qop" EQUAL qop-value 8356 cnonce = "cnonce" EQUAL cnonce-value 8357 cnonce-value = nonce-value 8358 nonce-count = "nc" EQUAL nc-value 8359 nc-value = 8LHEX 8360 dresponse = "response" EQUAL request-digest 8361 request-digest = LDQUOT 32LHEX RDQUOT 8362 auth-param = auth-param-name EQUAL 8363 ( token / quoted-string ) 8364 auth-param-name = token 8365 other-response = auth-scheme LWS auth-param 8366 *(COMMA auth-param) 8367 auth-scheme = token 8368 Bandwidth = "Bandwidth" HCOLON 1*19DIGIT 8370 Blocksize = "Blocksize" HCOLON 1*9DIGIT 8372 Cache-Control = "Cache-Control" HCOLON cache-directive 8373 *(COMMA cache-directive) 8374 cache-directive = cache-rqst-directive 8375 / cache-rspns-directive 8377 cache-rqst-directive = "no-cache" 8378 / "max-stale" [EQUAL delta-seconds] 8379 / "min-fresh" EQUAL delta-seconds 8380 / "only-if-cached" 8381 / cache-extension 8383 cache-rspns-directive = "public" 8384 / "private" 8385 / "no-cache" 8386 / "no-transform" 8387 / "must-revalidate" 8388 / "proxy-revalidate" 8389 / "max-age" EQUAL delta-seconds 8390 / cache-extension 8392 cache-extension = token [EQUAL (token / quoted-string)] 8393 delta-seconds = 1*19DIGIT 8395 Connection = "Connection" HCOLON connection-token 8396 *(COMMA connection-token) 8397 connection-token = "close" / token 8399 Connection-Credentials = "Connection-Credentials" HCOLON cred-chain 8400 cred-chain = DQ RTSP-REQ-URI DQ SEMI base64 8402 Content-Base = "Content-Base" HCOLON RTSP-URI 8403 Content-Encoding = "Content-Encoding" HCOLON 8404 content-coding *(COMMA content-coding) 8405 Content-Language = "Content-Language" HCOLON 8406 language-tag *(COMMA language-tag) 8407 Content-Length = "Content-Length" HCOLON 1*19DIGIT 8408 Content-Location = "Content-Location" HCOLON RTSP-REQ-Ref 8409 Content-Type = "Content-Type" HCOLON media-type 8410 media-type = m-type SLASH m-subtype *(SEMI m-parameter) 8411 m-type = discrete-type / composite-type 8412 discrete-type = "text" / "image" / "audio" / "video" 8413 / "application" / extension-token 8414 composite-type = "message" / "multipart" / extension-token 8415 extension-token = ietf-token / x-token 8416 ietf-token = token 8417 x-token = "x-" token 8418 m-subtype = extension-token / iana-token 8419 iana-token = token 8420 m-parameter = m-attribute EQUAL m-value 8421 m-attribute = token 8422 m-value = token / quoted-string 8424 CSeq = "CSeq" HCOLON cseq-nr 8425 cseq-nr = 1*9DIGIT 8426 Date = "Date" HCOLON RTSP-date 8427 RTSP-date = rfc1123-date ; HTTP-date 8428 rfc1123-date = wkday "," SP date1 SP time SP "GMT" 8429 date1 = 2DIGIT SP month SP 4DIGIT 8430 ; day month year (e.g., 02 Jun 1982) 8431 time = 2DIGIT ":" 2DIGIT ":" 2DIGIT 8432 ; 00:00:00 - 23:59:59 8433 wkday = "Mon" / "Tue" / "Wed" 8434 / "Thu" / "Fri" / "Sat" / "Sun" 8435 month = "Jan" / "Feb" / "Mar" / "Apr" 8436 / "May" / "Jun" / "Jul" / "Aug" 8437 / "Sep" / "Oct" / "Nov" / "Dec" 8439 Expires = "Expires" HCOLON RTSP-date 8440 From = "From" HCOLON from-spec 8441 from-spec = ( name-addr / addr-spec ) *( SEMI from-param ) 8442 name-addr = [ display-name ] LAQUOT addr-spec RAQUOT 8443 addr-spec = RTSP-REQ-URI / absolute-URI 8444 absolute-URI = < As defined in RFC 3986> 8445 display-name = *(token LWS) / quoted-string 8446 from-param = tag-param / generic-param 8447 tag-param = "tag" EQUAL token 8448 If-Match = "If-Match" HCOLON ("*" / message-tag-list) 8449 message-tag-list = message-tag *(COMMA message-tag) 8450 message-tag = [ weak ] opaque-tag 8451 weak = "W/" 8452 opaque-tag = quoted-string 8453 If-Modified-Since = "If-Modified-Since" HCOLON RTSP-date 8454 If-None-Match = "If-None-Match" HCOLON ("*" / message-tag-list) 8455 Last-Modified = "Last-Modified" HCOLON RTSP-date 8456 Location = "Location" HCOLON RTSP-REQ-URI 8457 Media-Properties = "Media-Properties" HCOLON [media-prop-list] 8458 media-prop-list = media-prop-value *(COMMA media-prop-value) 8459 media-prop-value = ("Random-Access" [EQUAL POS-FLOAT]) 8460 / "Begining-Only" 8461 / "No-Seeking" 8462 / "Immutable" 8463 / "Dynamic" 8464 / "Time-Progressing" 8465 / "Unlimited" 8466 / ("Time-Limited" EQUAL utc-time) 8467 / ("Time-Duration" EQUAL POS-FLOAT) 8468 / ("Scales" EQUAL scale-value-list) 8469 / media-prop-ext 8470 media-prop-ext = token [EQUAL (1*rtsp-unreserved / quoted-string)] 8471 scale-value-list = DQ scale-entry *(COMMA scale-entry) DQ 8472 scale-entry = scale-value / (scale-value COLON scale-value) 8473 scale-value = FLOAT 8474 Media-Range = "Media-Range" HCOLON [ranges-list] 8475 ranges-list = ranges-spec *(COMMA ranges-spec) 8476 MTag = "MTag" HCOLON message-tag 8477 Notify-Reason = "Notify-Reason" HCOLON Notify-Reas-val 8478 Notify-Reas-val = "end-of-stream" 8479 / "media-properties-update" 8480 / "scale-change" 8481 / Notify-Reason-extension 8482 Notify-Reason-extension = token 8483 Pipelined-Requests = "Pipelined-Requests" HCOLON startup-id 8484 startup-id = 1*8DIGIT 8486 Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge-list 8487 challenge-list = challenge *(COMMA challenge) 8488 challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) 8489 / other-challenge 8490 other-challenge = auth-scheme LWS auth-param 8491 *(COMMA auth-param) 8492 digest-cln = realm / domain / nonce 8493 / opaque / stale / algorithm 8494 / qop-options / auth-param 8495 realm = "realm" EQUAL realm-value 8496 realm-value = quoted-string 8497 domain = "domain" EQUAL LDQUOT RTSP-REQ-Ref 8498 *(1*SP RTSP-REQ-Ref ) RDQUOT 8499 nonce = "nonce" EQUAL nonce-value 8500 nonce-value = quoted-string 8501 opaque = "opaque" EQUAL quoted-string 8502 stale = "stale" EQUAL ( "true" / "false" ) 8503 algorithm = "algorithm" EQUAL ("MD5" / "MD5-sess" / token) 8504 qop-options = "qop" EQUAL LDQUOT qop-value 8505 *("," qop-value) RDQUOT 8506 qop-value = "auth" / "auth-int" / token 8507 Proxy-Require = "Proxy-Require" HCOLON feature-tag-list 8508 feature-tag-list = feature-tag *(COMMA feature-tag) 8509 Proxy-Supported = "Proxy-Supported" HCOLON [feature-tag-list] 8511 Public = "Public" HCOLON Method *(COMMA Method) 8513 Range = "Range" HCOLON ranges-spec 8515 ranges-spec = npt-range / utc-range / smpte-range 8516 / range-ext 8517 range-ext = extension-format ["=" range-value] 8518 range-value = 1*(rtsp-unreserved / quoted-string / ":" ) 8520 Referrer = "Referrer" HCOLON (absolute-URI / RTSP-URI-Ref) 8521 Request-Status = "Request-Status" HCOLON req-status-info 8522 req-status-info = cseq-info LWS status-info LWS reason-info 8523 cseq-info = "cseq" EQUAL cseq-nr 8524 status-info = "status" EQUAL Status-Code 8525 reason-info = "reason" EQUAL DQ Reason-Phrase DQ 8526 Require = "Require" HCOLON feature-tag-list 8527 RTP-Info = "RTP-Info" HCOLON [rtsp-info-spec 8528 *(COMMA rtsp-info-spec)] 8529 rtsp-info-spec = stream-url 1*ssrc-parameter 8530 stream-url = "url" EQUAL DQ RTSP-REQ-Ref DQ 8531 ssrc-parameter = LWS "ssrc" EQUAL ssrc HCOLON 8532 ri-parameter *(SEMI ri-parameter) 8533 ri-parameter = ("seq" EQUAL 1*5DIGIT) 8534 / ("rtptime" EQUAL 1*10DIGIT) 8535 / generic-param 8537 Retry-After = "Retry-After" HCOLON ( RTSP-date / delta-seconds ) 8538 Scale = "Scale" HCOLON scale-value 8539 Seek-Style = "Seek-Style" HCOLON Seek-S-values 8540 Seek-S-values = "RAP" 8541 / "CoRAP" 8542 / "First-Prior" 8543 / "Next" 8544 / Seek-S-value-ext 8545 Seek-S-value-ext = token 8547 Server = "Server" HCOLON ( product / comment ) 8548 *(LWS (product / comment)) 8549 product = token [SLASH product-version] 8550 product-version = token 8551 comment = LPAREN *( ctext / quoted-pair) RPAREN 8553 Session = "Session" HCOLON session-id 8554 [ SEMI "timeout" EQUAL delta-seconds ] 8556 Speed = "Speed" HCOLON lower-bound MINUS upper-bound 8557 lower-bound = POS-FLOAT 8558 upper-bound = POS-FLOAT 8560 Supported = "Supported" HCOLON [feature-tag-list] 8561 Terminate-Reason = "Terminate-Reason" HCOLON TR-Info 8562 TR-Info = TR-Reason *(SEMI TR-Parameter) 8563 TR-Reason = "Session-Timeout" 8564 / "Server-Admin" 8565 / "Internal-Error" 8566 / token 8567 TR-Parameter = TR-time / TR-user-msg / generic-param 8568 TR-time = "time" EQUAL utc-time 8569 TR-user-msg = "user-msg" EQUAL quoted-string 8571 Timestamp = "Timestamp" HCOLON timestamp-value [LWS delay] 8572 timestamp-value = *19DIGIT [ "." *9DIGIT ] 8573 delay = *9DIGIT [ "." *9DIGIT ] 8575 Transport = "Transport" HCOLON transport-spec 8576 *(COMMA transport-spec) 8577 transport-spec = transport-id *trns-parameter 8578 transport-id = trans-id-rtp / other-trans 8579 trans-id-rtp = "RTP/" profile ["/" lower-transport] 8580 ; no LWS is allowed inside transport-id 8581 other-trans = token *("/" token) 8583 profile = "AVP" / "SAVP" / "AVPF" / token 8584 lower-transport = "TCP" / "UDP" / token 8585 trns-parameter = (SEMI ( "unicast" / "multicast" )) 8586 / (SEMI "interleaved" EQUAL channel [ "-" channel ]) 8587 / (SEMI "ttl" EQUAL ttl) 8588 / (SEMI "layers" EQUAL 1*DIGIT) 8589 / (SEMI "ssrc" EQUAL ssrc *(SLASH ssrc)) 8590 / (SEMI "mode" EQUAL mode-spec) 8591 / (SEMI "dest_addr" EQUAL addr-list) 8592 / (SEMI "src_addr" EQUAL addr-list) 8593 / (SEMI "setup" EQUAL contrans-setup) 8594 / (SEMI "connection" EQUAL contrans-con) 8595 / (SEMI "RTCP-mux") 8596 / (SEMI trn-param-ext) 8597 contrans-setup = "active" / "passive" / "actpass" 8598 contrans-con = "new" / "existing" 8599 trn-param-ext = par-name [EQUAL trn-par-value] 8600 par-name = token 8601 trn-par-value = *(rtsp-unreserved / quoted-string) 8602 ttl = 1*3DIGIT ; 0 to 255 8603 ssrc = 8HEX 8604 channel = 1*3DIGIT ; 0 to 255 8605 mode-spec = ( DQ mode *(COMMA mode) DQ ) 8606 mode = "PLAY" / token 8607 addr-list = quoted-addr *(SLASH quoted-addr) 8608 quoted-addr = DQ (host-port / extension-addr) DQ 8609 host-port = ( host [":" port] ) 8610 / ( ":" port ) 8611 extension-addr = 1*qdtext 8612 host = < As defined in RFC 3986> 8613 port = < As defined in RFC 3986> 8614 Unsupported = "Unsupported" HCOLON feature-tag-list 8616 User-Agent = "User-Agent" HCOLON ( product / comment ) 8617 *(LWS (product / comment)) 8619 Vary = "Vary" HCOLON ( "*" / field-name-list) 8620 field-name-list = field-name *(COMMA field-name) 8621 field-name = token 8622 Via = "Via" HCOLON via-parm *(COMMA via-parm) 8623 via-parm = sent-protocol LWS sent-by *( SEMI via-params ) 8624 via-params = via-ttl / via-maddr 8625 / via-received / via-extension 8626 via-ttl = "ttl" EQUAL ttl 8627 via-maddr = "maddr" EQUAL host 8628 via-received = "received" EQUAL (IPv4address / IPv6address) 8629 IPv4address = < As defined in RFC 3986> 8630 IPv6address = < As defined in RFC 3986> 8631 via-extension = generic-param 8632 sent-protocol = protocol-name SLASH protocol-version 8633 SLASH transport-prot 8634 protocol-name = "RTSP" / token 8635 protocol-version = token 8636 transport-prot = "UDP" / "TCP" / "TLS" / other-transport 8637 other-transport = token 8638 sent-by = host [ COLON port ] 8640 WWW-Authenticate = "WWW-Authenticate" HCOLON challenge-list 8642 20.3. SDP extension Syntax 8644 This section defines in ABNF the SDP extensions defined for RTSP. 8645 See Appendix D for the definition of the extensions in text. 8647 control-attribute = "a=control:" *SP RTSP-REQ-Ref CRLF 8649 a-range-def = "a=range:" ranges-spec CRLF 8651 a-mtag-def = "a=mtag:" message-tag CRLF 8653 21. Security Considerations 8655 Because of the similarity in syntax and usage between RTSP servers 8656 and HTTP servers, the security considerations outlined in [H15] apply 8657 also. 8659 Specifically, please note the following: 8661 Abuse of Server Log Information: RTSP and HTTP servers will 8662 presumably have similar logging mechanisms, and thus should be 8663 equally guarded in protecting the contents of those logs, thus 8664 protecting the privacy of the users of the servers. See 8665 [H15.1.1] for HTTP server recommendations regarding server 8666 logs. 8668 Transfer of Sensitive Information: There is no reason to believe 8669 that information transferred or controlled via RTSP may be any 8670 less sensitive than that normally transmitted via HTTP. 8671 Therefore, all of the precautions regarding the protection of 8672 data privacy and user privacy apply to implementors of RTSP 8673 clients, servers, and proxies. See [H15.1.2] for further 8674 details. 8676 Attacks Based On File and Path Names: Though RTSP URIs are opaque 8677 handles that do not necessarily have file system semantics, it 8678 is anticipated that many implementations will translate 8679 portions of the Request-URIs directly to file system calls. In 8680 such cases, file systems SHOULD follow the precautions outlined 8681 in [H15.5], such as checking for ".." in path components. 8683 Personal Information: RTSP clients are often privy to the same 8684 information that HTTP clients are (user name, location, etc.) 8685 and thus should be equally sensitive. See [H15.1] for further 8686 recommendations. 8688 Privacy Issues Connected to Accept Headers: Since may of the same 8689 "Accept" headers exist in RTSP as in HTTP, the same caveats 8690 outlined in [H15.1.4] with regards to their use should be 8691 followed. 8693 DNS Spoofing: Presumably, given the longer connection times 8694 typically associated to RTSP sessions relative to HTTP 8695 sessions, RTSP client DNS optimizations should be less 8696 prevalent. Nonetheless, the recommendations provided in 8697 [H15.3] are still relevant to any implementation which attempts 8698 to rely on a DNS-to-IP mapping to hold beyond a single use of 8699 the mapping. 8701 Location Headers and Spoofing: If a single server supports multiple 8702 organizations that do not trust each another, then it needs to 8703 check the values of Location and Content-Location header fields 8704 in responses that are generated under control of said 8705 organizations to make sure that they do not attempt to 8706 invalidate resources over which they have no authority. 8707 ([H15.4]) 8709 In addition to the recommendations in the current HTTP specification 8710 (RFC 2616 [RFC2616], as of this writing) and also of the previous 8711 RFC2068 [RFC2068], future HTTP specifications may provide additional 8712 guidance on security issues. 8714 The following are added considerations for RTSP implementations. 8716 Concentrated denial-of-service attack: The protocol offers the 8717 opportunity for a remote-controlled denial-of-service attack. 8718 See Section 21.1. 8720 Session hijacking: Since there is no or little relation between a 8721 transport layer connection and an RTSP session, it is possible 8722 for a malicious client to issue requests with random session 8723 identifiers which would affect unsuspecting clients. The 8724 server SHOULD use a large, random and non-sequential session 8725 identifier to minimize the possibility of this kind of attack. 8726 However, unless the RTSP signaling always are confidentiality 8727 protected, e.g. using TLS, an on-path attacker will be able to 8728 hijack a session. For real session security, client 8729 authentication needs to be performed. 8731 Authentication: Servers SHOULD implement both basic and digest 8732 [RFC2617] authentication. In environments requiring tighter 8733 security for the control messages, the transport layer 8734 mechanism TLS [RFC5246] SHOULD be used. 8736 Stream issues: RTSP only provides for stream control. Stream 8737 delivery issues are not covered in this section, nor in the 8738 rest of this draft. RTSP implementations will most likely rely 8739 on other protocols such as RTP, IP multicast, RSVP and IGMP, 8740 and should address security considerations brought up in those 8741 and other applicable specifications. 8743 Persistently suspicious behavior: RTSP servers SHOULD return error 8744 code 403 (Forbidden) upon receiving a single instance of 8745 behavior which is deemed a security risk. RTSP servers SHOULD 8746 also be aware of attempts to probe the server for weaknesses 8747 and entry points and MAY arbitrarily disconnect and ignore 8748 further requests clients which are deemed to be in violation of 8749 local security policy. 8751 Scope of Multicast: If RTSP is used to control the transmission of 8752 media onto a multicast network it is need to consider the scope 8753 that delivery has. RTSP supports the TTL Transport header 8754 parameter to indicate this scope. However, such scope control 8755 is risk as it may be set to large and distribute media beyond 8756 the intended scope. 8758 TLS through proxies: If one uses the possibility to connect TLS in 8759 multiple legs (Section 19.3 one really needs to be aware of the 8760 trust model. That procedure requires full faith and trust in 8761 all proxies that one allows to connect through. They are man 8762 in the middle and has access to all that goes on over the TLS 8763 connection. Thus it is important to consider if that trust 8764 model is acceptable in the actual application. 8766 Resource Exhaustion: As RTSP is a stateful protocol and establish 8767 resource usages on the server there is a clear possibility to 8768 attack the server by trying to overbook these resources to 8769 perform an denial of service attack. This attack can be both 8770 against ongoing sessions and to prevent others from 8771 establishing sessions. RTSP agents will need to have mechanism 8772 to prevent single peers from consuming extensive amounts of 8773 resources. 8775 21.1. Remote denial of Service Attack 8777 The attacker may initiate traffic flows to one or more IP addresses 8778 by specifying them as the destination in SETUP requests. While the 8779 attacker's IP address may be known in this case, this is not always 8780 useful in prevention of more attacks or ascertaining the attackers 8781 identity. Thus, an RTSP server MUST only allow client-specified 8782 destinations for RTSP-initiated traffic flows if the server has 8783 ensured that the specified destination address accepts receiving 8784 media through different security mechanisms. Security mechanisms 8785 that are acceptable in an increased generality are: 8787 o Verification of the client's identity, either against a database 8788 of known users using RTSP authentication mechanisms (preferably 8789 digest authentication or stronger) 8791 o A list of addresses that accept to be media destinations, 8792 especially considering user identity 8794 o Media path based verification 8796 The server SHOULD NOT allow the destination field to be set unless a 8797 mechanism exists in the system to authorize the request originator to 8798 direct streams to the recipient. It is preferred that this 8799 authorization be performed by the media recipient (destination) 8800 itself and the credentials passed along to the server. However, in 8801 certain cases, such as when recipient address is a multicast group, 8802 or when the recipient is unable to communicate with the server in an 8803 out-of-band manner, this may not be possible. In these cases the 8804 server may chose another method such as a server-resident 8805 authorization list to ensure that the request originator has the 8806 proper credentials to request stream delivery to the recipient. 8808 One solution that performs the necessary verification of acceptance 8809 of media suitable for unicast based delivery is the ICE based NAT 8810 traversal method described in [I-D.ietf-mmusic-rtsp-nat]. By using 8811 random passwords and username the probability of unintended 8812 indication as a valid media destination is very low. If the server 8813 include in its STUN requests a cookie (consisting of random material) 8814 that is the destination echo back the solution is also safe against 8815 having a off-path attacker being able to spoof the STUN checks. 8816 Leaving this solution vulnerable only to on-path attackers that can 8817 see the STUN requests go to the target of attack. 8819 For delivery to multicast addresses there is need for another 8820 solution which is not specified here. 8822 22. IANA Considerations 8824 This section sets up a number of registries for RTSP 2.0 that should 8825 be maintained by IANA. These registries are separate from any 8826 registries existing for RTSP 1.0. For each registry there is a 8827 description on what it is required to contain, what specification is 8828 needed when adding a entry with IANA, and finally the entries that 8829 this document needs to register. See also the Section 2.7 "Extending 8830 RTSP". There is also an IANA registration of two SDP attributes. 8832 The sections describing how to register an item uses some of the 8833 requirements level described in RFC 5226 [RFC5226], namely "First 8834 Come, First Served", "Expert Review, "Specification Required", and 8835 "Standards Action". 8837 In case a registry requires a contact person, the authors are the 8838 contact person for any entries created by this document. 8840 A registration request to IANA MUST contain the following 8841 information: 8843 o A name of the item to register according to the rules specified by 8844 the intended registry. 8846 o Indication of who has change control over the feature (for 8847 example, IETF, ISO, ITU-T, other international standardization 8848 bodies, a consortium, a particular company or group of companies, 8849 or an individual); 8851 o A reference to a further description, if available, for example 8852 (in decreasing order of preference) an RFC, a published standard, 8853 a published paper, a patent filing, a technical report, documented 8854 source code or a computer manual; 8856 o For proprietary features, contact information (postal and email 8857 address); 8859 22.1. Feature-tags 8861 22.1.1. Description 8863 When a client and server try to determine what part and functionality 8864 of the RTSP specification and any future extensions that its counter 8865 part implements there is need for a namespace. This registry 8866 contains named entries representing certain functionality. 8868 The usage of feature-tags is explained in Section 11 and 8869 Section 13.1. 8871 22.1.2. Registering New Feature-tags with IANA 8873 The registering of feature-tags is done on a first come, first served 8874 basis. 8876 The name of the feature MUST follow these rules: The name may be of 8877 any length, but SHOULD be no more than twenty characters long. The 8878 name MUST NOT contain any spaces, or control characters. The 8879 registration MUST indicate if the feature-tag applies to clients, 8880 servers, or proxies only or any combinations of these. Any 8881 proprietary feature MUST have as the first part of the name a vendor 8882 tag, which identifies the organization. The registry entries 8883 consists of the tag, a one paragraph description of what it 8884 represents, its applicability (server, client, proxy, any 8885 combination) and a reference to its specification where applicable. 8887 22.1.3. Registered entries 8889 The following feature-tags are in this specification defined and 8890 hereby registered. The change control belongs to the IETF. 8892 play.basic: The minimal implementation for delivery and playback 8893 operations according to this specification. Applies for both 8894 clients, servers and proxies. 8896 play.scale: Support of scale operations for media playback. Applies 8897 only for servers. 8899 play.speed: Support of the speed functionality for media delivery. 8900 Applies only for servers. 8902 setup.rtp.rtcp.mux Support of the RTP and RTCP multiplexing as 8903 discussed in Appendix C.1.6.4. Applies for both client and 8904 servers and any media caching proxy. 8906 This should be represented by IANA as table with the feature tags, 8907 contact person and their references. 8909 22.2. RTSP Methods 8911 22.2.1. Description 8913 What a method is, is described in section Section 13. Extending the 8914 protocol with new methods allow for totally new functionality. 8916 22.2.2. Registering New Methods with IANA 8918 A new method MUST be registered through an IETF Standards Action. 8919 The reason is that new methods may radically change the protocol's 8920 behavior and purpose. 8922 A specification for a new RTSP method MUST consist of the following 8923 items: 8925 o A method name which follows the ABNF rules for methods. 8927 o A clear specification what a request using the method does and 8928 what responses are expected. Which directions the method is used, 8929 C->S or S->C or both. How the use of headers, if any, modifies 8930 the behavior and effect of the method. 8932 o A list or table specifying which of the registered headers that 8933 are allowed to use with the method in request or/and response. 8935 o Describe how the method relates to network proxies. 8937 22.2.3. Registered Entries 8939 This specification, RFCXXXX, registers 10 methods: DESCRIBE, 8940 GET_PARAMETER, OPTIONS, PAUSE, PLAY, PLAY_NOTIFY REDIRECT, SETUP, 8941 SET_PARAMETER, and TEARDOWN. The initial table of the registry is 8942 below provided. 8944 Method Directionality Reference 8945 ----------------------------------------------------- 8946 DESCRIBE C->S [RFCXXXX] 8947 GET_PARAMETER C->S, S->C [RFCXXXX] 8948 OPTIONS C->S, S->C [RFCXXXX] 8949 PAUSE C->S [RFCXXXX] 8950 PLAY C->S [RFCXXXX] 8951 PLAY_NOTIFY S->C [RFCXXXX] 8952 REDIRECT S->C [RFCXXXX] 8953 SETUP C->S [RFCXXXX] 8954 SET_PARAMETER C->S, S->C [RFCXXXX] 8955 TEARDOWN C->S, S->C [RFCXXXX] 8957 22.3. RTSP Status Codes 8959 22.3.1. Description 8961 A status code is the three digit numbers used to convey information 8962 in RTSP response messages, seeSection 8. The number space is limited 8963 and care should be taken not to fill the space. 8965 22.3.2. Registering New Status Codes with IANA 8967 A new status code registrations follows the policy of IETF Review. A 8968 specification for a new status code MUST specify the following: 8970 o The requested number. 8972 o A description what the status code means and the expected behavior 8973 of the sender and receiver of the code. 8975 22.3.3. Registered Entries 8977 RFCXXXX, registers the numbered status code defined in the ABNF entry 8978 "Status-Code" except "extension-code" (that defines the syntax 8979 allowed for future extensions) in Section 20.2.2. 8981 22.4. RTSP Headers 8983 22.4.1. Description 8985 By specifying new headers a method(s) can be enhanced in many 8986 different ways. An unknown header will be ignored by the receiving 8987 agent. If the new header is vital for a certain functionality, a 8988 feature-tag for the functionality can be created and demanded to be 8989 used by the counter-part with the inclusion of a Require header 8990 carrying the feature-tag. 8992 22.4.2. Registering New Headers with IANA 8994 Registrations in the registry can be done following the Expert Review 8995 policy. A specification SHOULD be provided, preferable an IETF RFC 8996 or other Standards Developing Organization specification. The 8997 minimal information in a registration request is the header name and 8998 the contact information. 9000 The specification SHOULD contain the following information: 9002 o The name of the header. 9004 o An ABNF specification of the header syntax. 9006 o A list or table specifying when the header may be used, 9007 encompassing all methods, their request or response, the direction 9008 (C->S or S->C). 9010 o How the header is to be handled by proxies. 9012 o A description of the purpose of the header. 9014 22.4.3. Registered entries 9016 All headers specified in Section 16 in RFCXXXX are to be registered. 9017 The Registry is to include header name, description, and reference. 9019 Furthermore the following RTSP headers defined in other 9020 specifications are registered: 9022 o x-wap-profile defined in [3gpp-26234]. 9024 o x-wap-profile-diff defined in [3gpp-26234]. 9026 o x-wap-profile-warning defined in [3gpp-26234]. 9028 o x-predecbufsize defined in [3gpp-26234]. 9030 o x-initpredecbufperiod defined in [3gpp-26234]. 9032 o x-initpostdecbufperiod defined in [3gpp-26234]. 9034 o 3gpp-videopostdecbufsize defined in [3gpp-26234]. 9036 o 3GPP-Link-Char defined in [3gpp-26234]. 9038 o 3GPP-Adaptation defined in [3gpp-26234]. 9040 o 3GPP-QoE-Metrics defined in [3gpp-26234]. 9042 o 3GPP-QoE-Feedback defined in [3gpp-26234]. 9044 The use of "x-" is NOT RECOMMENDED but the above headers in the 9045 register list was defined prior to the clarification. 9047 22.5. Accept-Credentials 9049 The security framework's TLS connection mechanism has two registrable 9050 entities. 9052 22.5.1. Accept-Credentials policies 9054 In Section 19.3.1 three policies for how to handle certificates are 9055 specified. Further policies may be defined and MUST be registered 9056 with IANA using the following rules: 9058 o Registering requires an IETF Standards Action 9059 o A registration is required to name a contact person. 9061 o Name of the policy. 9063 o A describing text that explains how the policy works for handling 9064 the certificates. 9066 This specification registers the following values: 9068 Any 9070 Proxy 9072 User 9074 22.5.2. Accept-Credentials hash algorithms 9076 The Accept-Credentials header (See Section 16.2) allows for the usage 9077 of other algorithms for hashing the DER records of accepted entities. 9078 The registration of any future algorithm is expected to be extremely 9079 rare and could also cause interoperability problems. Therefore the 9080 bar for registering new algorithms is intentionally placed high. 9082 Any registration of a new hash algorithm MUST fulfill the following 9083 requirement: 9085 o Follow the IETF Standards Action policy. 9087 o A definition of the algorithm and its identifier meeting the 9088 "token" ABNF requirement. 9090 The registered value is: 9091 Hash Alg. Id Reference 9092 ------------------------ 9093 sha-256 [RFCXXXX] 9095 22.6. Cache-Control Cache Directive Extensions 9097 There exist a number of cache directives which can be sent in the 9098 Cache-Control header. A registry for these cache directives MUST be 9099 defined with the following rules: 9101 o Registering requires an IETF Standards Action or IESG Approval. 9103 o A registration is required to contain a contact person. 9105 o Name of the directive and a definition of the value, if any. 9107 o Specification if it is an request or response directive. 9109 o A describing text that explains how the cache directive is used 9110 for RTSP controlled media streams. 9112 This specification registers the following values: 9114 no-cache: 9116 public: 9118 private: 9120 no-transform: 9122 only-if-cached: 9124 max-stale: 9126 min-fresh: 9128 must-revalidate: 9130 proxy-revalidate: 9132 max-age: 9134 The registry should be represented as: Name of the directive, contact 9135 person and reference. 9137 22.7. Media Properties 9139 22.7.1. Description 9141 The media streams being controlled by RTSP can have many different 9142 properties. The media properties required to cover the use cases 9143 that was in mind when writing the specification are defined. 9144 However, it can be expected that further innovation will result in 9145 new use cases or media streams with properties not covered by the 9146 ones specified here. Thus new media properties can be specified. As 9147 new media properties may need a substantial amount of new definitions 9148 to correctly specify behavior for this property the bar is intended 9149 to be high. 9151 22.7.2. Registration Rules 9153 Registering new media property MUST fulfill the following 9154 requirements 9155 o Follow the Specification Required policy and get the approval of 9156 the designated Expert. 9158 o Have an ABNF definition of the media property value name that 9159 meets "media-prop-ext" definition 9161 o A Contact Person for the Registration 9163 o Description of all changes to the behavior of the RTSP protocol as 9164 result of these changes. 9166 22.7.3. Registered Values 9168 This specification registers the 9 values listed in Section 16.28. 9169 The registry should be represented as: Name of the media property, 9170 contact person and reference. 9172 22.8. Notify-Reason header 9174 22.8.1. Description 9176 Notify-Reason values are used for indicating the reason the 9177 notification was sent. Each reason has its associated rules on what 9178 headers and information that may or must be included in the 9179 notification. New notification behaviors need to be specified to 9180 enable interoperable usage, thus a specification of each new value is 9181 required. 9183 22.8.2. Registration Rules 9185 Registrations for new Notify-Reason value MUST fulfill the following 9186 requirements 9188 o Follow the Specification Required policy and get the approval of 9189 the designated Expert. 9191 o Have a ABNF definition of the Notify reason value name that meets 9192 "Notify-Reason-extension" definition 9194 o A Contact Person for the Registration 9196 o Description of which headers shall be included in the request and 9197 response, when it should be sent, and any effect it has on the 9198 server client state. 9200 22.8.3. Registered Values 9202 This specification registers 3 values defined in the Notify-Reas-val 9203 ABNFSection 20.2.3: 9205 o end-of-stream 9207 o media-properties-update 9209 o scale-change 9211 The registry entries should be represented in the registry as: Name, 9212 short description, contact and reference. 9214 22.9. Range header formats 9216 22.9.1. Description 9218 The Range header (Section 16.38) allows for different range formats. 9219 New ones may be registered, but moderation should be applied as it 9220 makes interoperability more difficult. 9222 22.9.2. Registration Rules 9224 A registration MUST fulfill the following requirements: 9226 o Follow the Specification Required policy. 9228 o An ABNF definition of the range format that fulfills the "range- 9229 ext" definition. 9231 o A Contact person for the registration. 9233 o Rules for how one handles the range when using a negative Scale. 9235 22.9.3. Registered Values 9237 The registry should be represented as: Name of the range format, 9238 contact person and reference. This specification registers the 9239 following values. 9241 npt: Normal Play Time 9243 clock: UTC Clock format 9244 smpte: SMPTE Timestamps 9246 22.10. Terminate-Reason Header 9248 The Terminate-Reason header (Section 16.50) has two registries for 9249 extensions. 9251 22.10.1. Redirect Reasons 9253 Registrations are done under the policy of Expert Review. The 9254 registered value needs to follow syntax, i.e. be a token. The 9255 specification needs to provide definition of what the procedures that 9256 is to be followed when a client receives this redirect reason. This 9257 specification registers two values: 9259 o Session-Timeout 9261 o Server-Admin 9263 The registry should be represented as: Name of the Redirect Reason, 9264 contact person and reference. 9266 22.10.2. Terminate-Reason Header Parameters 9268 Registrations are done under the policy of Specification Required. 9269 The registrations must define a syntax for the parameter that also 9270 follows the allowed by the RTSP 2.0 specification. A contact person 9271 is also required. This specification registers: 9273 o time 9275 o user-msg 9277 The registry should be represented as: Name of the Terminate Reason, 9278 contact person and reference. 9280 22.11. RTP-Info header parameters 9282 22.11.1. Description 9284 The RTP-Info header (Section 16.43) carries one or more parameter 9285 value pairs with information about a particular point in the RTP 9286 stream. RTP extensions or new usages may need new types of 9287 information. As RTP information that could be needed is likely to be 9288 generic enough and to maximize the interoperability registration 9289 requires specification required. 9291 22.11.2. Registration Rules 9293 Registrations for new Notify-Reason value MUST fulfill the following 9294 requirements 9296 o Follow the Specification Required policy and get the approval of 9297 the designated Expert. 9299 o Have a ABNF definition that meets the "generic-param" definition 9301 o A Contact Person for the Registration 9303 22.11.3. Registered Values 9305 This specification registers 2 parameter value pairs: 9307 o seq 9309 o rtptime 9311 The registry should be represented as: Name of the parameter, contact 9312 person and reference. 9314 22.12. Seek-Style Policies 9316 22.12.1. Description 9318 New seek policies may be registered, however, a large number of these 9319 will complicate implementation substantially. The impact of unknown 9320 policies is that the server will not honor the unknown and use the 9321 server default policy instead. 9323 22.12.2. Registration Rules 9325 Registrations of new Seek-Style polices MUST fulfill the following 9326 requirements 9328 o Follow the Specification Required policy. 9330 o Have a ABNF definition of the Seek-Style policy name that meets 9331 "Seek-S-value-ext" definition 9333 o A Contact Person for the Registration 9335 o Description of which headers shall be included in the request and 9336 response, when it should be sent, and any affect it has on the 9337 server client state. 9339 22.12.3. Registered Values 9341 This specification registers 4 values: 9343 o RAP 9345 o CoRAP 9347 o First-Prior 9349 o Next 9351 The registry should be represented as: Name of the Seek-Style Policy, 9352 short description, contact person and reference. 9354 22.13. Transport Header Registries 9356 The transport header contains a number of parameters which have 9357 possibilities for future extensions. Therefore registries for these 9358 needs to be defined. 9360 22.13.1. Transport Protocol Specification 9362 A registry for the parameter transport-protocol specification MUST be 9363 defined with the following rules: 9365 o Registering uses the policy of Specification Required. 9367 o A contact person or organization with address and email. 9369 o A value definition that are following the ABNF syntax definition 9370 of "transport-id" Section 20.2.3. 9372 o A describing text that explains how the registered value are used 9373 in RTSP. 9375 The registry should be represented as: The protocol ID string, 9376 contact person and reference. 9378 This specification registers the following values: 9380 RTP/AVP: Use of the RTP[RFC3550] protocol for media transport in 9381 combination with the "RTP profile for audio and video 9382 conferences with minimal control"[RFC3551] over UDP. The usage 9383 is explained in RFC XXXX, Appendix C.1. 9385 RTP/AVP/UDP: the same as RTP/AVP. 9387 RTP/AVPF: Use of the RTP[RFC3550] protocol for media transport in 9388 combination with the "Extended RTP Profile for RTCP-based 9389 Feedback (RTP/AVPF)" [RFC4585] over UDP. The usage is 9390 explained in RFC XXXX, Appendix C.1. 9392 RTP/AVPF/UDP: the same as RTP/AVPF. 9394 RTP/SAVP: Use of the RTP[RFC3550] protocol for media transport in 9395 combination with the "The Secure Real-time Transport Protocol 9396 (SRTP)" [RFC3711] over UDP. The usage is explained in RFC 9397 XXXX, Appendix C.1. 9399 RTP/SAVP/UDP: the same as RTP/SAVP. 9401 RTP/SAVPF: Use of the RTP[RFC3550] protocol for media transport in 9402 combination with the "[RFC5124] over UDP. The usage is 9403 explained in RFC XXXX, Appendix C.1. 9405 RTP/SAVPF/UDP: the same as RTP/SAVPF. 9407 RTP/AVP/TCP: Use of the RTP[RFC3550] protocol for media transport in 9408 combination with the "RTP profile for audio and video 9409 conferences with minimal control"[RFC3551] over TCP. The usage 9410 is explained in RFC XXXX, Appendix C.2.2. 9412 RTP/AVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9413 in combination with the "Extended RTP Profile for RTCP-based 9414 Feedback (RTP/AVPF)"[RFC4585] over TCP. The usage is explained 9415 in RFC XXXX, Appendix C.2.2. 9417 RTP/SAVP/TCP: Use of the RTP[RFC3550] protocol for media transport 9418 in combination with the "The Secure Real-time Transport 9419 Protocol (SRTP)" [RFC3711] over TCP. The usage is explained in 9420 RFC XXXX, Appendix C.2.2. 9422 RTP/SAVPF/TCP: Use of the RTP[RFC3550] protocol for media transport 9423 in combination with the "[RFC5124] over TCP. The usage is 9424 explained in RFC XXXX, Appendix C.2.2. 9426 22.13.2. Transport modes 9428 A registry for the transport parameter mode MUST be defined with the 9429 following rules: 9431 o Registering requires an IETF Standards Action. 9433 o A contact person or organization with address and email. 9435 o A value definition that are following the ABNF "token" definition 9436 Section 20.2.3. 9438 o A describing text that explains how the registered value are used 9439 in RTSP. 9441 This specification registers 1 value: 9443 PLAY: See RFC XXXX. 9445 22.13.3. Transport Parameters 9447 A registry for parameters that may be included in the Transport 9448 header MUST be defined with the following rules: 9450 o Registering uses the Specification Required policy. 9452 o A value definition that are following the ABNF "token" definition 9453 Section 20.2.3. 9455 o A describing text that explains how the registered value are used 9456 in RTSP. 9458 This specification registers all the transport parameters defined in 9459 Section 16.52. 9461 22.14. URI Schemes 9463 This specification defines two URI schemes ("rtsp" and "rtsps") and 9464 reserves a third one ("rtspu"). Registrations are following RFC 9465 4395[RFC4395]. 9467 22.14.1. The rtsp URI Scheme 9469 URI scheme name: rtsp 9471 Status: Permanent 9473 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9475 URI scheme semantics: The rtsp scheme is used to indicate resources 9476 accessible through the usage of the Real-time Streaming 9477 Protocol (RTSP). RTSP allows different operations on the 9478 resource identified by the URI, but the primary purpose is the 9479 streaming delivery of the resource to a client. However, the 9480 operations that are currently defined are: Describing the 9481 resource for the purpose of configuring the receiving agent 9482 (DESCRIBE), configuring the delivery method and its addressing 9483 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9484 setting of resource related parameters (SET_PARAMETER and 9485 GET_PARAMETER, and termination of the session context created 9486 (TEARDOWN). 9488 Encoding considerations: IRIs in this scheme are defined and needs 9489 to be encoded as RTSP URIs when used within the RTSP protocol. 9490 That encoding is done according to RFC 3987. 9492 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9493 2326), RTSP 2.0 (RFC XXXX) 9495 Interoperability considerations: The change in URI syntax performed 9496 between RTSP 1.0 and 2.0 can create interoperability issues. 9498 Security considerations: All the security threats identified in 9499 Section 7 of RFC 3986 applies also to this scheme. They need 9500 to be reviewed and considered in any implementation utilizing 9501 this scheme. 9503 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9505 Author/Change controller: IETF 9507 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9509 22.14.2. The rtsps URI Scheme 9511 URI scheme name: rtsps 9513 Status: Permanent 9515 URI scheme syntax: See Section 20.2.1 of RFC XXXX. 9517 URI scheme semantics: The rtsps scheme is used to indicate resources 9518 accessible through the usage of the Real-time Streaming 9519 Protocol (RTSP) over TLS. RTSP allows different operations on 9520 the resource identified by the URI, but the primary purpose is 9521 the streaming delivery of the resource to a client. However, 9522 the operations that are currently defined are: Describing the 9523 resource for the purpose of configuring the receiving agent 9524 (DESCRIBE), configuring the delivery method and its addressing 9525 (SETUP), controlling the delivery (PLAY and PAUSE), reading or 9526 setting of resource related parameters (SET_PARAMETER and 9527 GET_PARAMETER, and termination of the session context created 9528 (TEARDOWN). 9530 Encoding considerations: IRIs in this scheme are defined and needs 9531 to be encoded as RTSP URIs when used within the RTSP protocol. 9532 That encoding is done according to RFC 3987. 9534 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9535 2326), RTSP 2.0 (RFC XXXX) 9537 Interoperability considerations: The change in URI syntax performed 9538 between RTSP 1.0 and 2.0 can create interoperability issues. 9540 Security considerations: All the security threats identified in 9541 Section 7 of RFC 3986 applies also to this scheme. They need 9542 to be reviewed and considered in any implementation utilizing 9543 this scheme. 9545 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9547 Author/Change controller: IETF 9549 References: RFC 2326, RFC 3986, RFC 3987, RFC XXXX 9551 22.14.3. The rtspu URI Scheme 9553 URI scheme name: rtspu 9555 Status: Permanent 9557 URI scheme syntax: See Section 3.2 of RFC 2326. 9559 URI scheme semantics: The rtspu scheme is used to indicate resources 9560 accessible through the usage of the Real-time Streaming 9561 Protocol (RTSP) over unreliable datagram transport. RTSP 9562 allows different operations on the resource identified by the 9563 URI, but the primary purpose is the streaming delivery of the 9564 resource to a client. However, the operations that are 9565 currently defined are: Describing the resource for the purpose 9566 of configuring the receiving agent (DESCRIBE), configuring the 9567 delivery method and its addressing (SETUP), controlling the 9568 delivery (PLAY and PAUSE), reading or setting of resource 9569 related parameters (SET_PARAMETER and GET_PARAMETER, and 9570 termination of the session context created (TEARDOWN). 9572 Encoding considerations: IRIs in this scheme are not defined. 9574 Applications/protocols that use this URI scheme name: RTSP 1.0 (RFC 9575 2326) 9577 Interoperability considerations: The definition of the transport 9578 mechanism of RTSP over UDP has interoperability issues. That 9579 makes the usage of this scheme problematic. 9581 Security considerations: All the security threats identified in 9582 Section 7 of RFC 3986 applies also to this scheme. They needs 9583 to be reviewed and considered in any implementation utilizing 9584 this scheme. 9586 Contact: Magnus Westerlund, magnus.westerlund@ericsson.com 9588 Author/Change controller: IETF 9590 References: RFC 2326 9592 22.15. SDP attributes 9594 This specification defines three SDP [RFC4566] attributes that it is 9595 requested that IANA register. 9597 SDP Attribute ("att-field"): 9599 Attribute name: range 9600 Long form: Media Range Attribute 9601 Type of name: att-field 9602 Type of attribute: Media and session level 9603 Subject to charset: No 9604 Purpose: RFC XXXX 9605 Reference: RFC XXXX, RFC 2326 9606 Values: See ABNF definition. 9608 Attribute name: control 9609 Long form: RTSP control URI 9610 Type of name: att-field 9611 Type of attribute: Media and session level 9612 Subject to charset: No 9613 Purpose: RFC XXXX 9614 Reference: RFC XXXX, RFC 2326 9615 Values: Absolute or Relative URIs. 9617 Attribute name: mtag 9618 Long form: Message Tag 9619 Type of name: att-field 9620 Type of attribute: Media and session level 9621 Subject to charset: No 9622 Purpose: RFC XXXX 9623 Reference: RFC XXXX 9624 Values: See ABNF definition 9626 22.16. Media Type Registration for text/parameters 9628 Type name: text 9630 Subtype name: parameters 9632 Required parameters: 9634 Optional parameters: 9636 Encoding considerations: 9638 Security considerations: This format may carry any type of 9639 parameters. Some can clear have security requirements, like 9640 privacy, confidentiality or integrity requirements. The format 9641 has no built in security protection. For the usage it was defined 9642 the transport can be protected between server and client using 9643 TLS. However, care must be take to consider if also the proxies 9644 are trusted with the parameters in case hop-by-hop security is 9645 used. If stored as file in file system the necessary precautions 9646 needs to be taken in relation to the parameters requirements 9647 including object security such as S/MIME [RFC3851]. 9649 Interoperability considerations: This media type was mentioned as a 9650 fictional example in RFC 2326 but was not formally specified. 9651 This have resulted in usage of this media type which may not match 9652 its formal definition. 9654 Published specification: RFC XXXX, Appendix F. 9656 Applications that use this media type: Applications that use RTSP 9657 and have additional parameters they like to read and set using the 9658 RTSP GET_PARAMETER and SET_PARAMETER methods. 9660 Additional information: 9662 Magic number(s): 9664 File extension(s): 9666 Macintosh file type code(s): 9668 Person & email address to contact for further information: Magnus 9669 Westerlund (magnus.westerlund@ericsson.com) 9671 Intended usage: Common 9673 Restrictions on usage: None 9675 Author: Magnus Westerlund (magnus.westerlund@ericsson.com) 9677 Change controller: IETF 9679 Addition Notes: 9681 23. References 9683 23.1. Normative References 9685 [3gpp-26234] 9686 Third Generation Partnership Project (3GPP), "Transparent 9687 end-to-end Packet-switched Streaming Service (PSS); 9688 Protocols and codecs; Technical Specification 26.234", 9689 December 2002. 9691 [FIPS-pub-180-2] 9692 National Institute of Standards and Technology (NIST), 9693 "Federal Information Processing Standards Publications 9694 (FIPS PUBS) 180-2: Secure Hash Standard", August 2002. 9696 [I-D.ietf-avt-rtp-and-rtcp-mux] 9697 Perkins, C. and M. Westerlund, "Multiplexing RTP Data and 9698 Control Packets on a Single Port", 9699 draft-ietf-avt-rtp-and-rtcp-mux-07 (work in progress), 9700 August 2007. 9702 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 9703 August 1980. 9705 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 9706 RFC 793, September 1981. 9708 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 9709 Requirement Levels", BCP 14, RFC 2119, March 1997. 9711 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 9712 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 9713 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 9715 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 9716 Leach, P., Luotonen, A., and L. Stewart, "HTTP 9717 Authentication: Basic and Digest Access Authentication", 9718 RFC 2617, June 1999. 9720 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 9722 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 9723 Jacobson, "RTP: A Transport Protocol for Real-Time 9724 Applications", STD 64, RFC 3550, July 2003. 9726 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 9727 Video Conferences with Minimal Control", STD 65, RFC 3551, 9728 July 2003. 9730 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 9731 10646", STD 63, RFC 3629, November 2003. 9733 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 9734 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 9735 RFC 3711, March 2004. 9737 [RFC3830] Arkko, J., Carrara, E., Lindholm, F., Naslund, M., and K. 9738 Norrman, "MIKEY: Multimedia Internet KEYing", RFC 3830, 9739 August 2004. 9741 [RFC3851] Ramsdell, B., "Secure/Multipurpose Internet Mail 9742 Extensions (S/MIME) Version 3.1 Message Specification", 9743 RFC 3851, July 2004. 9745 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 9746 Resource Identifier (URI): Generic Syntax", STD 66, 9747 RFC 3986, January 2005. 9749 [RFC3987] Duerst, M. and M. Suignard, "Internationalized Resource 9750 Identifiers (IRIs)", RFC 3987, January 2005. 9752 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 9753 Requirements for Security", BCP 106, RFC 4086, June 2005. 9755 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 9756 Registration Procedures", BCP 13, RFC 4288, December 2005. 9758 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 9759 Architecture", RFC 4291, February 2006. 9761 [RFC4395] Hansen, T., Hardie, T., and L. Masinter, "Guidelines and 9762 Registration Procedures for New URI Schemes", BCP 35, 9763 RFC 4395, February 2006. 9765 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 9766 Description Protocol", RFC 4566, July 2006. 9768 [RFC4567] Arkko, J., Lindholm, F., Naslund, M., Norrman, K., and E. 9769 Carrara, "Key Management Extensions for Session 9770 Description Protocol (SDP) and Real Time Streaming 9771 Protocol (RTSP)", RFC 4567, July 2006. 9773 [RFC4571] Lazzaro, J., "Framing Real-time Transport Protocol (RTP) 9774 and RTP Control Protocol (RTCP) Packets over Connection- 9775 Oriented Transport", RFC 4571, July 2006. 9777 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 9778 "Extended RTP Profile for Real-time Transport Control 9779 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 9780 July 2006. 9782 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 9783 Encodings", RFC 4648, October 2006. 9785 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 9786 Real-time Transport Control Protocol (RTCP)-Based Feedback 9787 (RTP/SAVPF)", RFC 5124, February 2008. 9789 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 9790 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 9791 May 2008. 9793 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 9794 Specifications: ABNF", STD 68, RFC 5234, January 2008. 9796 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 9797 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 9799 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 9800 Housley, R., and W. Polk, "Internet X.509 Public Key 9801 Infrastructure Certificate and Certificate Revocation List 9802 (CRL) Profile", RFC 5280, May 2008. 9804 [RFC5646] Phillips, A. and M. Davis, "Tags for Identifying 9805 Languages", BCP 47, RFC 5646, September 2009. 9807 23.2. Informative References 9809 [I-D.ietf-mmusic-rtsp-nat] 9810 Goldberg, J., Westerlund, M., and T. Zeng, "A Network 9811 Address Translator (NAT) Traversal mechanism for media 9812 controlled by Real-Time Streaming Protocol (RTSP)", 9813 draft-ietf-mmusic-rtsp-nat-09 (work in progress), 9814 January 2010. 9816 [ISO.13818-6.1995] 9817 International Organization for Standardization, 9818 "Information technology - Generic coding of moving 9819 pictures and associated audio information - part 6: 9820 Extension for digital storage media and control", 9821 ISO Draft Standard 13818-6, November 1995. 9823 [ISO.8601.2000] 9824 International Organization for Standardization, "Data 9825 elements and interchange formats - Information interchange 9826 - Representation of dates and times", ISO/IEC Standard 9827 8601, December 2000. 9829 [RFC0822] Crocker, D., "Standard for the format of ARPA Internet 9830 text messages", STD 11, RFC 822, August 1982. 9832 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 9833 and Support", STD 3, RFC 1123, October 1989. 9835 [RFC1305] Mills, D., "Network Time Protocol (Version 3) 9836 Specification, Implementation", RFC 1305, March 1992. 9838 [RFC1644] Braden, B., "T/TCP -- TCP Extensions for Transactions 9839 Functional Specification", RFC 1644, July 1994. 9841 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 9842 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 9843 RFC 2068, January 1997. 9845 [RFC2326] Schulzrinne, H., Rao, A., and R. Lanphier, "Real Time 9846 Streaming Protocol (RTSP)", RFC 2326, April 1998. 9848 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 9849 Translator (NAT) Terminology and Considerations", 9850 RFC 2663, August 1999. 9852 [RFC2974] Handley, M., Perkins, C., and E. Whelan, "Session 9853 Announcement Protocol", RFC 2974, October 2000. 9855 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 9856 A., Peterson, J., Sparks, R., Handley, M., and E. 9857 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 9858 June 2002. 9860 [RFC3388] Camarillo, G., Eriksson, G., Holler, J., and H. 9861 Schulzrinne, "Grouping of Media Lines in the Session 9862 Description Protocol (SDP)", RFC 3388, December 2002. 9864 [RFC4145] Yon, D. and G. Camarillo, "TCP-Based Media Transport in 9865 the Session Description Protocol (SDP)", RFC 4145, 9866 September 2005. 9868 [RFC5583] Schierl, T. and S. Wenger, "Signaling Media Decoding 9869 Dependency in the Session Description Protocol (SDP)", 9870 RFC 5583, July 2009. 9872 [Stevens98] 9873 Stevens, W., "Unix Networking Programming - Volume 1, 9874 second edition", 1998. 9876 Appendix A. Examples 9878 This section contains several different examples trying to illustrate 9879 possible ways of using RTSP. The examples can also help with the 9880 understanding of how functions of RTSP work. However, remember that 9881 these are examples and the normative and syntax description in the 9882 other sections takes precedence. Please also note that many of the 9883 example contain syntax illegal line breaks to accommodate the 9884 formatting restriction that the RFC series impose. 9886 A.1. Media on Demand (Unicast) 9888 This is an example of media on demand streaming of a media stored in 9889 a container file. For purposes of this example, a container file is 9890 a storage entity in which multiple continuous media types pertaining 9891 to the same end-user presentation are present. In effect, the 9892 container file represents an RTSP presentation, with each of its 9893 components being RTSP controlled media streams. Container files are 9894 a widely used means to store such presentations. While the 9895 components are transported as independent streams, it is desirable to 9896 maintain a common context for those streams at the server end. 9898 This enables the server to keep a single storage handle open 9899 easily. It also allows treating all the streams equally in case 9900 of any priorization of streams by the server. 9902 It is also possible that the presentation author may wish to prevent 9903 selective retrieval of the streams by the client in order to preserve 9904 the artistic effect of the combined media presentation. Similarly, 9905 in such a tightly bound presentation, it is desirable to be able to 9906 control all the streams via a single control message using an 9907 aggregate URI. 9909 The following is an example of using a single RTSP session to control 9910 multiple streams. It also illustrates the use of aggregate URIs. In 9911 a container file it is also desirable to not write any URI parts 9912 which is not kept, when the container is distributed, like the host 9913 and most of the path element. Therefore this example also uses the 9914 "*" and relative URI in the delivered SDP. 9916 Also this presentation description (SDP) is not cachable, as the 9917 Expires header is set to an equal value with date indicating 9918 immediate expiration of its valididty. 9920 Client C requests a presentation from media server M. The movie is 9921 stored in a container file. The client has obtained an RTSP URI to 9922 the container file. 9924 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 9925 CSeq: 1 9926 User-Agent: PhonyClient/1.2 9928 M->C: RTSP/2.0 200 OK 9929 CSeq: 1 9930 Server: PhonyServer/1.0 9931 Date: Thu, 23 Jan 1997 15:35:06 GMT 9932 Content-Type: application/sdp 9933 Content-Length: 271 9934 Content-Base: rtsp://example.com/twister.3gp/ 9935 Expires: 24 Jan 1997 15:35:06 GMT 9937 v=0 9938 o=- 2890844256 2890842807 IN IP4 198.51.100.5 9939 s=RTSP Session 9940 i=An Example of RTSP Session Usage 9941 e=adm@example.com 9942 c=IN IP4 0.0.0.0 9943 a=control: * 9944 a=range: npt=0-0:10:34.10 9945 t=0 0 9946 m=audio 0 RTP/AVP 0 9947 a=control: trackID=1 9948 m=video 0 RTP/AVP 26 9949 a=control: trackID=4 9951 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 9952 CSeq: 2 9953 User-Agent: PhonyClient/1.2 9954 Require: play.basic 9955 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 9956 Accept-Ranges: NPT, SMPTE, UTC 9958 M->C: RTSP/2.0 200 OK 9959 CSeq: 2 9960 Server: PhonyServer/1.0 9961 Transport: RTP/AVP;unicast; ssrc=93CB001E; 9962 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 9963 src_addr="198.51.100.5:9000"/"198.51.100.5:9001" 9964 Session: 12345678 9965 Expires: 24 Jan 1997 15:35:12 GMT 9966 Date: 23 Jan 1997 15:35:12 GMT 9967 Accept-Ranges: NPT 9968 Media-Properties: Random-Access=0.02, Immutable, Unlimited 9970 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 9971 CSeq: 3 9972 User-Agent: PhonyClient/1.2 9973 Require: play.basic 9974 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 9975 Session: 12345678 9976 Accept-Ranges: NPT, SMPTE, UTC 9978 M->C: RTSP/2.0 200 OK 9979 CSeq: 3 9980 Server: PhonyServer/1.0 9981 Transport: RTP/AVP;unicast; ssrc=A813FC13; 9982 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003"; 9983 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 9985 Session: 12345678 9986 Expires: 24 Jan 1997 15:35:13 GMT 9987 Date: 23 Jan 1997 15:35:13 GMT 9988 Accept-Range: NPT 9989 Media-Properties: Random-Access=0.8, Immutable, Unlimited 9991 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 9992 CSeq: 4 9993 User-Agent: PhonyClient/1.2 9994 Range: npt=30- 9995 Seek-Style: RAP 9996 Session: 12345678 9998 M->C: RTSP/2.0 200 OK 9999 CSeq: 4 10000 Server: PhonyServer/1.0 10001 Date: 23 Jan 1997 15:35:14 GMT 10002 Session: 12345678 10003 Range: npt=30-623.10 10004 Seek-Style: RAP 10005 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10006 ssrc=0D12F123:seq=12345;rtptime=3450012, 10007 url="rtsp://example.com/twister.3gp/trackID=1" 10008 ssrc=4F312DD8:seq=54321;rtptime=2876889 10010 C->M: PAUSE rtsp://example.com/twister.3gp/ RTSP/2.0 10011 CSeq: 5 10012 User-Agent: PhonyClient/1.2 10013 Session: 12345678 10015 M->C: RTSP/2.0 200 OK 10016 CSeq: 5 10017 Server: PhonyServer/1.0 10018 Date: 23 Jan 1997 15:36:01 GMT 10019 Session: 12345678 10020 Range: npt=34.57-623.10 10022 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10023 CSeq: 6 10024 User-Agent: PhonyClient/1.2 10025 Range: npt=34.57-623.10 10026 Seek-Style: Next 10027 Session: 12345678 10029 M->C: RTSP/2.0 200 OK 10030 CSeq: 6 10031 Server: PhonyServer/1.0 10032 Date: 23 Jan 1997 15:36:01 GMT 10033 Session: 12345678 10034 Range: npt=34.57-623.10 10035 Seek-Style: Next 10036 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10037 ssrc=0D12F123:seq=12555;rtptime=6330012, 10038 url="rtsp://example.com/twister.3gp/trackID=1" 10039 ssrc=4F312DD8:seq=55021;rtptime=3132889 10041 C->M: TEARDOWN rtsp://example.com/twister.3gp/ RTSP/2.0 10042 CSeq: 7 10043 User-Agent: PhonyClient/1.2 10044 Session: 12345678 10046 M->C: RTSP/2.0 200 OK 10047 CSeq: 7 10048 Server: PhonyServer/1.0 10049 Date: 23 Jan 1997 15:49:34 GMT 10051 A.2. Media on Demand using Pipelining 10053 This example is basically the example above (Appendix A.1), but now 10054 utilizing pipelining to speed up the setup. It requires only two 10055 round trip times until the media starts flowing. First of all, the 10056 session description is retrieved to determine what media resources 10057 need to be setup. In the second step, one sends the necessary SETUP 10058 requests and the PLAY request to initiate media delivery. 10060 Client C requests a presentation from media server M. The movie is 10061 stored in a container file. The client has obtained an RTSP URI to 10062 the container file. 10064 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 10065 CSeq: 1 10066 User-Agent: PhonyClient/1.2 10068 M->C: RTSP/2.0 200 OK 10069 CSeq: 1 10070 Server: PhonyServer/1.0 10071 Date: Thu, 23 Jan 1997 15:35:06 GMT 10072 Content-Type: application/sdp 10073 Content-Length: 271 10074 Content-Base: rtsp://example.com/twister.3gp/ 10075 Expires: 24 Jan 1997 15:35:06 GMT 10077 v=0 10078 o=- 2890844256 2890842807 IN IP4 192.0.2.5 10079 s=RTSP Session 10080 i=An Example of RTSP Session Usage 10081 e=adm@example.com 10082 c=IN IP4 0.0.0.0 10083 a=control: * 10084 a=range: npt=0-0:10:34.10 10085 t=0 0 10086 m=audio 0 RTP/AVP 0 10087 a=control: trackID=1 10088 m=video 0 RTP/AVP 26 10089 a=control: trackID=4 10091 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 10092 CSeq: 2 10093 User-Agent: PhonyClient/1.2 10094 Require: play.basic 10095 Transport: RTP/AVP;unicast;dest_addr=":8000"/":8001" 10096 Accept-Ranges: NPT, SMPTE, UTC 10097 Pipelined-Requests: 7654 10099 C->M: SETUP rtsp://example.com/twister.3gp/trackID=4 RTSP/2.0 10100 CSeq: 3 10101 User-Agent: PhonyClient/1.2 10102 Require: play.basic 10103 Transport: RTP/AVP;unicast;dest_addr=":8002"/":8003" 10104 Accept-Ranges: NPT, SMPTE, UTC 10105 Pipelined-Requests: 7654 10107 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 10108 CSeq: 4 10109 User-Agent: PhonyClient/1.2 10110 Range: npt=0- 10111 Seek-Style: RAP 10112 Session: 12345678 10113 Pipelined-Requests: 7654 10115 M->C: RTSP/2.0 200 OK 10116 CSeq: 2 10117 Server: PhonyServer/1.0 10118 Transport: RTP/AVP;unicast; 10119 dest_addr="192.0.2.53:8000"/"192.0.2.53:8001"; 10120 src_addr="198.51.100.5:9000"/"198.51.100.5:9001"; 10121 ssrc=93CB001E 10122 Session: 12345678 10123 Expires: 24 Jan 1997 15:35:12 GMT 10124 Date: 23 Jan 1997 15:35:12 GMT 10125 Accept-Ranges: NPT 10126 Pipelined-Requests: 7654 10127 Media-Properties: Random-Access=0.2, Immutable, Unlimited 10129 M->C: RTSP/2.0 200 OK 10130 CSeq: 3 10131 Server: PhonyServer/1.0 10132 Transport: RTP/AVP;unicast; 10133 dest_addr="192.0.2.53:8002"/"192.0.2.53:8003; 10134 src_addr="198.51.100.5:9002"/"198.51.100.5:9003"; 10135 ssrc=A813FC13 10136 Session: 12345678 10137 Expires: 24 Jan 1997 15:35:13 GMT 10138 Date: 23 Jan 1997 15:35:13 GMT 10139 Accept-Range: NPT 10140 Pipelined-Requests: 7654 10141 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10143 M->C: RTSP/2.0 200 OK 10144 CSeq: 4 10145 Server: PhonyServer/1.0 10146 Date: 23 Jan 1997 15:35:14 GMT 10147 Session: 12345678 10148 Range: npt=0-623.10 10149 Seek-Style: RAP 10150 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=4" 10151 ssrc=0D12F123:seq=12345;rtptime=3450012, 10152 url="rtsp://example.com/twister.3gp/trackID=1" 10153 ssrc=4F312DD8:seq=54321;rtptime=2876889 10154 Pipelined-Requests: 7654 10156 A.3. Media on Demand (Unicast) 10158 An alternative example of media on demand with a bit more tweaks is 10159 the following. Client C requests a movie distributed from two 10160 different media servers A (audio.example.com) and V ( 10161 video.example.com). The media description is stored on a web server 10162 W. The media description contains descriptions of the presentation 10163 and all its streams, including the codecs that are available, dynamic 10164 RTP payload types, the protocol stack, and content information such 10165 as language or copyright restrictions. It may also give an 10166 indication about the timeline of the movie. 10168 In this example, the client is only interested in the last part of 10169 the movie. 10171 C->W: GET /twister.sdp HTTP/1.1 10172 Host: www.example.com 10173 Accept: application/sdp 10175 W->C: HTTP/1.0 200 OK 10176 Date: Thu, 23 Jan 1997 15:35:06 GMT 10177 Content-Type: application/sdp 10178 Content-Length: 278 10179 Expires: 23 Jan 1998 15:35:06 GMT 10181 v=0 10182 o=- 2890844526 2890842807 IN IP4 198.51.100.5 10183 s=RTSP Session 10184 e=adm@example.com 10185 c=IN IP4 0.0.0.0 10186 a=range:npt=0-1:49:34 10187 t=0 0 10188 m=audio 0 RTP/AVP 0 10189 a=control:rtsp://audio.example.com/twister/audio.en 10190 m=video 0 RTP/AVP 31 10191 a=control:rtsp://video.example.com/twister/video 10193 C->A: SETUP rtsp://audio.example.com/twister/audio.en RTSP/2.0 10194 CSeq: 1 10195 User-Agent: PhonyClient/1.2 10196 Transport: RTP/AVP/UDP;unicast;dest_addr=":3056"/":3057", 10197 RTP/AVP/TCP;unicast;interleaved=0-1 10198 Accept-Ranges: NPT, SMPTE, UTC 10200 A->C: RTSP/2.0 200 OK 10201 CSeq: 1 10202 Session: 12345678 10203 Transport: RTP/AVP/UDP;unicast; 10204 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10205 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10206 Date: 23 Jan 1997 15:35:12 GMT 10207 Server: PhonyServer/1.0 10208 Expires: 24 Jan 1997 15:35:12 GMT 10209 Cache-Control: public 10210 Accept-Ranges: NPT, SMPTE 10211 Media-Properties: Random-Access=0.02, Immutable, Unlimited 10213 C->V: SETUP rtsp://video.example.com/twister/video RTSP/2.0 10214 CSeq: 1 10215 User-Agent: PhonyClient/1.2 10216 Transport: RTP/AVP/UDP;unicast; 10217 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059", 10218 RTP/AVP/TCP;unicast;interleaved=0-1 10219 Accept-Ranges: NPT, SMPTE, UTC 10221 V->C: RTSP/2.0 200 OK 10222 CSeq: 1 10223 Session: 23456789 10224 Transport: RTP/AVP/UDP;unicast; 10225 dest_addr="192.0.2.53:3058"/"192.0.2.53:3059"; 10226 src_addr="198.51.100.5:5002"/"198.51.100.5:5003" 10227 Date: 23 Jan 1997 15:35:12 GMT 10228 Server: PhonyServer/1.0 10229 Cache-Control: public 10230 Expires: 24 Jan 1997 15:35:12 GMT 10231 Accept-Ranges: NPT, SMPTE 10232 Media-Properties: Random-Access=1.2, Immutable, Unlimited 10234 C->V: PLAY rtsp://video.example.com/twister/video RTSP/2.0 10235 CSeq: 2 10236 User-Agent: PhonyClient/1.2 10237 Session: 23456789 10238 Range: smpte=0:10:00- 10240 V->C: RTSP/2.0 200 OK 10241 CSeq: 2 10242 Session: 23456789 10243 Range: smpte=0:10:00-1:49:23 10244 Seek-Style: First-Prior 10245 RTP-Info: url="rtsp://video.example.com/twister/video" 10246 ssrc=A17E189D:seq=12312232;rtptime=78712811 10247 Server: PhonyServer/2.0 10248 Date: 23 Jan 1997 15:35:13 GMT 10250 C->A: PLAY rtsp://audio.example.com/twister/audio.en RTSP/2.0 10251 CSeq: 2 10252 User-Agent: PhonyClient/1.2 10253 Session: 12345678 10254 Range: smpte=0:10:00- 10256 A->C: RTSP/2.0 200 OK 10257 CSeq: 2 10258 Session: 12345678 10259 Range: smpte=0:10:00-1:49:23 10260 Seek-Style: First-Prior 10261 RTP-Info: url="rtsp://audio.example.com/twister/audio.en" 10262 ssrc=3D124F01:seq=876655;rtptime=1032181 10263 Server: PhonyServer/1.0 10264 Date: 23 Jan 1997 15:35:13 GMT 10266 C->A: TEARDOWN rtsp://audio.example.com/twister/audio.en RTSP/2.0 10267 CSeq: 3 10268 User-Agent: PhonyClient/1.2 10269 Session: 12345678 10271 A->C: RTSP/2.0 200 OK 10272 CSeq: 3 10273 Server: PhonyServer/1.0 10274 Date: 23 Jan 1997 15:36:52 GMT 10276 C->V: TEARDOWN rtsp://video.example.com/twister/video RTSP/2.0 10277 CSeq: 3 10278 User-Agent: PhonyClient/1.2 10279 Session: 23456789 10281 V->C: RTSP/2.0 200 OK 10282 CSeq: 3 10283 Server: PhonyServer/2.0 10284 Date: 23 Jan 1997 15:36:52 GMT 10286 Even though the audio and video track are on two different servers 10287 that may start at slightly different times and may drift with respect 10288 to each other over time, the client can perform initial 10289 synchronization of the two media using RTP-Info and Range received in 10290 the PLAY responses. If the two servers are time synchronized the 10291 RTCP packets can also be used to maintain synchronization. 10293 A.4. Single Stream Container Files 10295 Some RTSP servers may treat all files as though they are "container 10296 files", yet other servers may not support such a concept. Because of 10297 this, clients needs to use the rules set forth in the session 10298 description for Request-URIs, rather than assuming that a consistent 10299 URI may always be used throughout. Below are an example of how a 10300 multi-stream server might expect a single-stream file to be served: 10302 C->S: DESCRIBE rtsp://foo.example.com/test.wav RTSP/2.0 10303 Accept: application/x-rtsp-mh, application/sdp 10304 CSeq: 1 10305 User-Agent: PhonyClient/1.2 10307 S->C: RTSP/2.0 200 OK 10308 CSeq: 1 10309 Content-base: rtsp://foo.example.com/test.wav/ 10310 Content-type: application/sdp 10311 Content-length: 163 10312 Server: PhonyServer/1.0 10313 Date: Thu, 23 Jan 1997 15:35:06 GMT 10314 Expires: 23 Jan 1997 17:00:00 GMT 10316 v=0 10317 o=- 872653257 872653257 IN IP4 192.0.2.5 10318 s=mu-law wave file 10319 i=audio test 10320 c=IN IP4 0.0.0.0 10321 t=0 0 10322 a=control: * 10323 m=audio 0 RTP/AVP 0 10324 a=control:streamid=0 10326 C->S: SETUP rtsp://foo.example.com/test.wav/streamid=0 RTSP/2.0 10327 Transport: RTP/AVP/UDP;unicast; 10328 dest_addr=":6970"/":6971";mode="PLAY" 10329 CSeq: 2 10330 User-Agent: PhonyClient/1.2 10331 Accept-Ranges: NPT, SMPTE, UTC 10333 S->C: RTSP/2.0 200 OK 10334 Transport: RTP/AVP/UDP;unicast; 10335 dest_addr="192.0.2.53:6970"/"192.0.2.53:6971"; 10336 src_addr="198.51.100.5:6970"/"198.51.100.5:6971"; 10337 mode="PLAY";ssrc=EAB98712 10338 CSeq: 2 10339 Session: 2034820394 10340 Expires: 23 Jan 1997 16:00:00 GMT 10341 Server: PhonyServer/1.0 10342 Date: 23 Jan 1997 15:35:07 GMT 10343 Accept-Ranges: NPT 10344 Media-Properties: Random-Acces=0.5, Immutable, Unlimited 10346 C->S: PLAY rtsp://foo.example.com/test.wav/ RTSP/2.0 10347 CSeq: 3 10348 User-Agent: PhonyClient/1.2 10349 Session: 2034820394 10351 S->C: RTSP/2.0 200 OK 10352 CSeq: 3 10353 Server: PhonyServer/1.0 10354 Date: 23 Jan 1997 15:35:08 GMT 10355 Session: 2034820394 10356 Range: npt=0-600 10357 Seek-Style: RAP 10358 RTP-Info: url="rtsp://foo.example.com/test.wav/streamid=0" 10359 ssrc=0D12F123:seq=981888;rtptime=3781123 10361 Note the different URI in the SETUP command, and then the switch back 10362 to the aggregate URI in the PLAY command. This makes complete sense 10363 when there are multiple streams with aggregate control, but is less 10364 than intuitive in the special case where the number of streams is 10365 one. However, the server has declared that the aggregated control 10366 URI in the SDP and therefore this is legal. 10368 In this case, it is also required that servers accept implementations 10369 that use the non-aggregated interpretation and use the individual 10370 media URI, like this: 10372 C->S: PLAY rtsp://example.com/test.wav/streamid=0 RTSP/2.0 10373 CSeq: 3 10374 User-Agent: PhonyClient/1.2 10375 Session: 2034820394 10377 A.5. Live Media Presentation Using Multicast 10379 The media server M chooses the multicast address and port. Here, it 10380 is assumed that the web server only contains a pointer to the full 10381 description, while the media server M maintains the full description. 10383 C->W: GET /sessions.html HTTP/1.1 10384 Host: www.example.com 10386 W->C: HTTP/1.1 200 OK 10387 Content-Type: text/html 10389 10390 ... 10391 10392 Streamed Live Music performance 10393 ... 10394 10396 C->M: DESCRIBE rtsp://live.example.com/concert/audio RTSP/2.0 10397 CSeq: 1 10398 Supported: play.basic, play.scale 10399 User-Agent: PhonyClient/1.2 10401 M->C: RTSP/2.0 200 OK 10402 CSeq: 1 10403 Content-Type: application/sdp 10404 Content-Length: 183 10405 Server: PhonyServer/1.0 10406 Date: Thu, 23 Jan 1997 15:35:06 GMT 10407 Supported: play.basic 10409 v=0 10410 o=- 2890844526 2890842807 IN IP4 192.0.2.5 10411 s=RTSP Session 10412 t=0 0 10413 m=audio 3456 RTP/AVP 0 10414 c=IN IP4 233.252.0.54/16 10415 a=control: rtsp://live.example.com/concert/audio 10416 a=range:npt=0- 10418 C->M: SETUP rtsp://live.example.com/concert/audio RTSP/2.0 10419 CSeq: 2 10420 Transport: RTP/AVP;multicast; 10421 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10422 Accept-Ranges: NPT, SMPTE, UTC 10423 User-Agent: PhonyClient/1.2 10425 M->C: RTSP/2.0 200 OK 10426 CSeq: 2 10427 Server: PhonyServer/1.0 10428 Date: Thu, 23 Jan 1997 15:35:06 GMT 10429 Transport: RTP/AVP;multicast; 10430 dest_addr="233.252.0.54:3456"/"233.252.0.54:3457";ttl=16 10431 ;ssrc=4D12AB92/0DF876A3 10432 Session: 0456804596 10433 Accept-Ranges: NPT, UTC 10434 Media-Properties: No-Seeking, Time-Progressing, Time-Duration=0 10436 C->M: PLAY rtsp://live.example.com/concert/audio RTSP/2.0 10437 CSeq: 3 10438 Session: 0456804596 10439 User-Agent: PhonyClient/1.2 10441 M->C: RTSP/2.0 200 OK 10442 CSeq: 3 10443 Server: PhonyServer/1.0 10444 Date: 23 Jan 1997 15:35:07 GMT 10445 Session: 0456804596 10446 Seek-Style: Next 10447 Range:npt=1256- 10448 RTP-Info: url="rtsp://live.example.com/concert/audio" 10449 ssrc=0D12F123:seq=1473; rtptime=80000 10451 A.6. Capability Negotiation 10453 This examples illustrate how the client and server determines their 10454 capability to support a special feature, in this case "play.scale". 10455 The server, through the clients request and the included Supported 10456 header, learns the client supports RTSP 2.0, and also supports the 10457 playback time scaling feature of RTSP. The server's response 10458 contains the following feature related information to the client; it 10459 supports the basic media delivery functions (play.basic), the 10460 extended functionality of time scaling of content (play.scale), and 10461 one "example.com" proprietary feature (com.example.flight). The 10462 client also learns the methods supported (Public header) by the 10463 server for the indicated resource. 10465 C->S: OPTIONS rtsp://media.example.com/movie/twister.3gp RTSP/2.0 10466 CSeq: 1 10467 Supported: play.basic, play.scale 10468 User-Agent: PhonyClient/1.2 10470 S->C: RTSP/2.0 200 OK 10471 CSeq: 1 10472 Public: OPTIONS,SETUP,PLAY,PAUSE,TEARDOWN,DESCRIBE,GET_PARAMETER 10473 Allow: OPTIONS, SETUP, PLAY, PAUSE, TEARDOWN, DESCRIBE 10474 Server: PhonyServer/2.0 10475 Supported: play.basic, play.scale, com.example.flight 10477 When the client sends its SETUP request it tells the server that it 10478 requires support of the play.scale feature for this session by 10479 including the Require header. 10481 C->S: SETUP rtsp://media.example.com/twister.3gp/trackID=1 RTSP/2.0 10482 CSeq: 3 10483 User-Agent: PhonyClient/1.2 10484 Transport: RTP/AVP/UDP;unicast; 10485 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057", 10486 RTP/AVP/TCP;unicast;interleaved=0-1 10487 Require: play.scale 10488 Accept-Ranges: NPT, SMPTE, UTC 10489 User-Agent: PhonyClient/1.2 10491 S->C: RTSP/2.0 200 OK 10492 CSeq: 3 10493 Session: 12345678 10494 Transport: RTP/AVP/UDP;unicast; 10495 dest_addr="192.0.2.53:3056"/"192.0.2.53:3057"; 10496 src_addr="198.51.100.5:5000"/"198.51.100.5:5001" 10497 Server: PhonyServer/2.0 10498 Accept-Ranges: NPT, SMPTE 10499 Media-Properties: Random-Access=0.8, Immutable, Unlimited 10501 Appendix B. RTSP Protocol State Machine 10503 The RTSP session state machine describes the behavior of the protocol 10504 from RTSP session initialization through RTSP session termination. 10506 The State machine is defined on a per session basis which is uniquely 10507 identified by the RTSP session identifier. The session may contain 10508 one or more media streams depending on state. If a single media 10509 stream is part of the session it is in non-aggregated control. If 10510 two or more is part of the session it is in aggregated control. 10512 The below state machine is a informative description of the protocols 10513 behavior. In case of ambiguity with the earlier parts of this 10514 specification, the description in the earlier parts take precedence. 10516 B.1. States 10518 The state machine contains three states, described below. For each 10519 state there exist a table which shows which requests and events are 10520 allowed and whether they will result in a state change. 10522 Init: Initial state no session exists. 10524 Ready: Session is ready to start playing. 10526 Play: Session is playing, i.e. sending media stream data in the 10527 direction S->C. 10529 B.2. State variables 10531 This representation of the state machine needs more than its state to 10532 work. A small number of variables are also needed and is explained 10533 below. 10535 NRM: The number of media streams part of this session. 10537 RP: Resume point, the point in the presentation time line at which 10538 a request to continue playing will resume from. A time format 10539 for the variable is not mandated. 10541 B.3. Abbreviations 10543 To make the state tables more compact a number of abbreviations are 10544 used, which are explained below. 10546 IFI: IF Implemented. 10548 md: Media 10550 PP: Pause Point, the point in the presentation time line at which 10551 the presentation was paused. 10553 Prs: Presentation, the complete multimedia presentation. 10555 RedP: Redirect Point, the point in the presentation time line at 10556 which a REDIRECT was specified to occur. 10558 SES: Session. 10560 B.4. State Tables 10562 This section contains a table for each state. The table contains all 10563 the requests and events that this state is allowed to act on. The 10564 events which is method names are, unless noted, requests with the 10565 given method in the direction client to server (C->S). In some cases 10566 there exist one or more requisite. The response column tells what 10567 type of response actions should be performed. Possible actions that 10568 is requested for an event includes: response codes, e.g. 200, headers 10569 that needs to be included in the response, setting of state 10570 variables, or setting of other session related parameters. The new 10571 state column tells which state the state machine changes to. 10573 The response to a valid request meeting the requisites is normally a 10574 2xx (SUCCESS) unless other noted in the response column. The 10575 exceptions need to be given a response according to the response 10576 column. If the request does not meet the requisite, is erroneous or 10577 some other type of error occur, the appropriate response code is to 10578 be sent. If the response code is a 4xx the session state is 10579 unchanged. A response code of 3rr will result in that the session is 10580 ended and its state is changed to Init. A response code of 304 10581 results in no state change. However, there exist restrictions to 10582 when a 3rr response may be used. A 5xx response does not result in 10583 any change of the session state, except if the error is not possible 10584 to recover from. A unrecoverable error results in the ending of the 10585 session. As it in the general case can't be determined if it was a 10586 unrecoverable error or not the client will be required to test. In 10587 the case that the next request after a 5xx is responded with 454 10588 (Session Not Found) the client knows that the session has ended. For 10589 any request message that cannot be responded to within the time 10590 defined in Section 10.4, a 100 response must be sent. 10592 The server will timeout the session after the period of time 10593 specified in the SETUP response, if no activity from the client is 10594 detected. Therefore there exist a timeout event for all states 10595 except Init. 10597 In the case that NRM = 1 the presentation URI is equal to the media 10598 URI or a specified presentation URI. For NRM > 1 the presentation 10599 URI needs to be other than any of the medias that are part of the 10600 session. This applies to all states. 10602 +---------------+-----------------+---------------------------------+ 10603 | Event | Prerequisite | Response | 10604 +---------------+-----------------+---------------------------------+ 10605 | DESCRIBE | Needs REDIRECT | 3rr, Redirect | 10606 | | | | 10607 | DESCRIBE | | 200, Session description | 10608 | | | | 10609 | OPTIONS | Session ID | 200, Reset session timeout | 10610 | | | timer | 10611 | | | | 10612 | OPTIONS | | 200 | 10613 | | | | 10614 | SET_PARAMETER | Valid parameter | 200, change value of parameter | 10615 | | | | 10616 | GET_PARAMETER | Valid parameter | 200, return value of parameter | 10617 +---------------+-----------------+---------------------------------+ 10619 Table 13: None state-machine changing events 10621 The methods in Table 13 do not have any effect on the state machine 10622 or the state variables. However, some methods do change other 10623 session related parameters, for example SET_PARAMETER which will set 10624 the parameter(s) specified in its body. Also all of these methods 10625 that allows Session header will also update the keep-alive timer for 10626 the session. 10628 +------------------+----------------+-----------+-------------------+ 10629 | Action | Requisite | New State | Response | 10630 +------------------+----------------+-----------+-------------------+ 10631 | SETUP | | Ready | NRM=1, RP=0.0 | 10632 | | | | | 10633 | SETUP | Needs Redirect | Init | 3rr Redirect | 10634 | | | | | 10635 | S -> C: REDIRECT | No Session hdr | Init | Terminate all SES | 10636 +------------------+----------------+-----------+-------------------+ 10638 Table 14: State: Init 10640 The initial state of the state machine, see Table 14 can only be left 10641 by processing a correct SETUP request. As seen in the table the two 10642 state variables are also set by a correct request. This table also 10643 shows that a correct SETUP can in some cases be redirected to another 10644 URI and/or server by a 3rr response. 10646 +-------------+------------------------+---------+------------------+ 10647 | Action | Requisite | New | Response | 10648 | | | State | | 10649 +-------------+------------------------+---------+------------------+ 10650 | SETUP | New URI | Ready | NRM +=1 | 10651 | | | | | 10652 | SETUP | URI Setup prior | Ready | Change transport | 10653 | | | | param | 10654 | | | | | 10655 | TEARDOWN | Prs URI, | Init | No session hdr, | 10656 | | | | NRM = 0 | 10657 | | | | | 10658 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10659 | | | | NRM = 0 | 10660 | | | | | 10661 | TEARDOWN | md URI,NRM>1 | Ready | Session hdr, NRM | 10662 | | | | -= 1 | 10663 | | | | | 10664 | PLAY | Prs URI, No range | Play | Play from RP | 10665 | | | | | 10666 | PLAY | Prs URI, Range | Play | According to | 10667 | | | | range | 10668 | | | | | 10669 | PLAY | md URI, NRM=1, Range | Play | According to | 10670 | | | | range | 10671 | | | | | 10672 | PLAY | md URI, NRM=1 | Play | Play from RP | 10673 | | | | | 10674 | PAUSE | Prs URI | Ready | Return PP | 10675 | | | | | 10676 | SC:REDIRECT | Terminate-Reason | Ready | Set RedP | 10677 | | | | | 10678 | SC:REDIRECT | No Terminate-Reason | Init | Session is | 10679 | | time parameter | | removed | 10680 | | | | | 10681 | Timeout | | Init | | 10682 | | | | | 10683 | RedP | | Init | TEARDOWN of | 10684 | reached | | | session | 10685 +-------------+------------------------+---------+------------------+ 10687 Table 15: State: Ready 10689 In the Ready state, see Table 15, some of the actions are depending 10690 on the number of media streams (NRM) in the session, i.e., aggregated 10691 or non-aggregated control. A SETUP request in the Ready state can 10692 either add one more media stream to the session or, if the media 10693 stream (same URI) already is part of the session, change the 10694 transport parameters. TEARDOWN is depending on both the Request-URI 10695 and the number of media stream within the session. If the Request- 10696 URI is the presentations URI the whole session is torn down. If a 10697 media URI is used in the TEARDOWN request and more than one media 10698 exist in the session, the session will remain and a session header is 10699 returned in the response. If only a single media stream remains in 10700 the session when performing a TEARDOWN with a media URI the session 10701 is removed. The number of media streams remaining after tearing down 10702 a media stream determines the new state. 10704 +----------------+-----------------------+--------+-----------------+ 10705 | Action | Requisite | New | Response | 10706 | | | State | | 10707 +----------------+-----------------------+--------+-----------------+ 10708 | PAUSE | Prs URI | Ready | Set RP to | 10709 | | | | present point | 10710 | | | | | 10711 | End of media | All media | Play | Set RP = End of | 10712 | | | | media | 10713 | | | | | 10714 | End of range | | Play | Set RP = End of | 10715 | | | | range | 10716 | | | | | 10717 | PLAY | Prs URI, No range | Play | Play from | 10718 | | | | present point | 10719 | | | | | 10720 | PLAY | Prs URI, Range | Play | According to | 10721 | | | | range | 10722 | | | | | 10723 | SC:PLAY_NOTIFY | | Play | 200 | 10724 | | | | | 10725 | SETUP | New URI | Play | 455 | 10726 | | | | | 10727 | SETUP | Setuped URI | Play | 455 | 10728 | | | | | 10729 | SETUP | Setuped URI, IFI | Play | Change | 10730 | | | | transport | 10731 | | | | param. | 10732 | | | | | 10733 | TEARDOWN | Prs URI | Init | No session hdr | 10734 | | | | | 10735 | TEARDOWN | md URI,NRM=1 | Init | No Session hdr, | 10736 | | | | NRM=0 | 10737 | | | | | 10738 | TEARDOWN | md URI | Play | 455 | 10739 | | | | | 10740 | SC:REDIRECT | Terminate Reason with | Play | Set RedP | 10741 | | Time parameter | | | 10742 | | | | | 10743 | SC:REDIRECT | | Init | Session is | 10744 | | | | removed | 10745 | | | | | 10746 | RedP reached | | Init | TEARDOWN of | 10747 | | | | session | 10748 | | | | | 10749 | Timeout | | Init | Stop Media | 10750 | | | | playout | 10751 +----------------+-----------------------+--------+-----------------+ 10752 Table 16: State: Play 10754 The Play state table, see Table 16, contains a number of requests 10755 that needs a presentation URI (labeled as Prs URI) to work on (i.e., 10756 the presentation URI has to be used as the Request-URI). This is due 10757 to the exclusion of non-aggregated stream control in sessions with 10758 more than one media stream. 10760 To avoid inconsistencies between the client and server, automatic 10761 state transitions are avoided. This can be seen at for example "End 10762 of media" event when all media has finished playing, the session 10763 still remain in Play state. An explicit PAUSE request needs to be 10764 sent to change the state to Ready. It may appear that there exist 10765 automatic transitions in "RedP reached" and "PP reached". However, 10766 they are requested and acknowledged before they take place. The time 10767 at which the transition will happen is known by looking at the range 10768 header. If the client sends a request close in time to these 10769 transitions it needs to be prepared for receiving error message, as 10770 the state may or may not have changed. 10772 Appendix C. Media Transport Alternatives 10774 This section defines how certain combinations of protocols, profiles 10775 and lower transports are used. This includes the usage of the 10776 Transport header's source and destination address parameters 10777 "src_addr" and "dest_addr". 10779 C.1. RTP 10781 This section defines the interaction of RTSP with respect to the RTP 10782 protocol [RFC3550]. It also defines any necessary media transport 10783 signalling with regards to RTP. 10785 The available RTP profiles and lower layer transports are described 10786 below along with rules on signalling the available combinations. 10788 C.1.1. AVP 10790 The usage of the "RTP Profile for Audio and Video Conferences with 10791 Minimal Control" [RFC3551] when using RTP for media transport over 10792 different lower layer transport protocols is defined below in regards 10793 to RTSP. 10795 One such case is defined within this document, the use of embedded 10796 (interleaved) binary data as defined in Section 14. The usage of 10797 this method is indicated by include the "interleaved" parameter. 10799 When using embedded binary data the "src_addr" and "dest_addr" MUST 10800 NOT be used. This addressing and multiplexing is used as defined 10801 with use of channel numbers and the interleaved parameter. 10803 C.1.2. AVP/UDP 10805 This part describes sending of RTP [RFC3550] over lower transport 10806 layer UDP [RFC0768] according to the profile "RTP Profile for Audio 10807 and Video Conferences with Minimal Control" defined in RFC 3551 10808 [RFC3551]. This profile requires one or two uni- or bi-directional 10809 UDP flows per media stream. The first UDP flow is for RTP and the 10810 second is for RTCP. Embedding of RTP data with the RTSP messages, in 10811 accordance with Section 14, SHOULD NOT be performed when RTSP 10812 messages are transported over unreliable transport protocols, like 10813 UDP [RFC0768]. 10815 The RTP/UDP and RTCP/UDP flows can be established using the Transport 10816 header's "src_addr", and "dest_addr" parameters. 10818 In RTSP PLAY mode, the transmission of RTP packets from client to 10819 server is unspecified. The behavior in regards to such RTP packets 10820 MAY be defined in future. 10822 The "src_addr" and "dest_addr" parameters are used in the following 10823 way for media delivery and playback mode, i.e. Mode=PLAY: 10825 o The "src_addr" and "dest_addr" parameters MUST contain either 1 or 10826 2 address specifications. 10828 o Each address specification for RTP/AVP/UDP or RTP/AVP/TCP MUST 10829 contain either: 10831 * both an address and a port number, or 10833 * a port number without an address. 10835 o The first address and port pair given in either of the parameters 10836 applies to the RTP stream. The second address and port pair if 10837 present applies to the RTCP stream. 10839 o The RTP/UDP packets from the server to the client MUST be sent to 10840 the address and port given by first address and port pair of the 10841 "dest_addr" parameter. 10843 o The RTCP/UDP packets from the server to the client MUST be sent to 10844 the address and port given by the second address and port pair of 10845 the "dest_addr" parameter. If no second pair is specified RTCP 10846 MUST NOT be sent. 10848 o The RTCP/UDP packets from the client to the server MUST be sent to 10849 the address and port given by the second address and port pair of 10850 the "src_addr" parameter. If no second pair is given RTCP MUST 10851 NOT be sent. 10853 o The RTP/UDP packets from the client to the server MUST be sent to 10854 the address and port given by the first address and port pair of 10855 the "src_addr" parameter. 10857 o RTP and RTCP Packets SHOULD be sent from the corresponding 10858 receiver port, i.e. RTCP packets from server should be sent from 10859 the "src_addr" parameters second address port pair. 10861 C.1.3. AVPF/UDP 10863 The RTP profile "Extended RTP Profile for RTCP-based Feedback (RTP/ 10864 AVPF)"[RFC4585] MAY be used as RTP profiles in session using RTP. 10865 All that is defined for AVP MUST also apply for AVPF. 10867 The usage of AVPF is indicated by the media initialization protocol 10868 used. In the case of SDP it is indicated by media lines (m=) 10869 containing the profile RTP/AVPF. That SDP MAY also contain further 10870 AVPF related SDP attributes configuring the AVPF session regarding 10871 reporting interval and feedback messages to be used. This 10872 configuration MUST be followed. 10874 C.1.4. SAVP/UDP 10876 The RTP profile "The Secure Real-time Transport Protocol (SRTP)" 10877 [RFC3711] is an RTP profile (SAVP) that MAY be used in RTSP sessions 10878 using RTP. All that is defined for AVP MUST also apply for SAVP. 10880 The usage of SRTP requires that a security association is 10881 established. The RECOMMENDED mechanism for establishing that 10882 security association is to use MIKEY with RTSP as defined in RFC 4567 10883 [RFC4567]. 10885 C.1.5. SAVPF/UDP 10887 The RTP profile "Extended Secure RTP Profile for RTCP-based Feedback 10888 (RTP/SAVPF)" [RFC5124] is an RTP profile (SAVPF) that MAY be used in 10889 RTSP sessions using RTP. All that is defined for AVP MUST also apply 10890 for SAVPF. 10892 The usage of SRTP requires that a security association is 10893 established. The RECOMMENDED mechanism for establishing that 10894 security association is to use MIKEY[RFC3830] with RTSP as defined in 10895 RFC 4567 [RFC4567]. 10897 C.1.6. RTCP usage with RTSP 10899 RTCP has several usages when RTP is used for media transport as 10900 explained below. Due to that RTCP MUST be supported if an RTSP agent 10901 handles RTP. 10903 C.1.6.1. Media synchronization 10905 RTCP provides media synchronization and clock drift compensation. 10906 The initial media synchronization is available from RTP-Info header. 10907 However, to be able to handle any clock drift between the media 10908 streams, RTCP is needed. 10910 C.1.6.2. RTSP Session keep-alive 10912 RTCP traffic from the RTSP client to the RTSP server MUST function as 10913 keep-alive. Which requires an RTSP server supporting RTP to use the 10914 received RTCP packets as indications that the client desires the 10915 related RTSP session to be kept alive. 10917 C.1.6.3. Bit-rate adaption 10919 RTCP Receiver reports and any additional feedback from the client 10920 MUST be used adapt the bit-rate used over the transport for all cases 10921 when RTP is sent over UDP. An RTP sender without reserved resources 10922 MUST NOT use more than its fair share of the available resources. 10923 This can be determined by comparing on short to medium term (some 10924 seconds) the used bit-rate and adapt it so that the RTP sender sends 10925 at a bit-rate comparable to what a TCP sender would achieve on 10926 average over the same path. 10928 C.1.6.4. RTP and RTCP Multiplexing 10930 RTSP can be used to negotiate the usage of RTP and RTCP multiplexing 10931 as described in [I-D.ietf-avt-rtp-and-rtcp-mux]. This allows servers 10932 and client to reduce the amount of resources required for the session 10933 by only requiring one underlying transport stream per media stream 10934 instead of two when using RTP and RTCP. This lessens the server port 10935 consumption and also the necessary state and keep-alive work when 10936 operating across Network and Address Translators [RFC2663]. 10938 Content must be prepared with some consideration for RTP and RTCP 10939 multiplexing, mainly ensuring that the RTP payload types used does 10940 not collide with the ones used for RTCP packet types this option 10941 likely needs explicit support from the content unless the RTP payload 10942 types can be remapped by the server and that is correctly reflected 10943 in the session description. Beyond that support of this feature 10944 should come at little cost and much gain. 10946 It is recommended that if the content and server supports RTP and 10947 RTCP multiplexing that this is indicated in the session description, 10948 for example using the SDP attribute "a=rtcp-mux". If the SDP message 10949 contains the a=rtcp-mux attribute for a media stream, the server MUST 10950 support RTP and RTCP multiplexing. If indicated or otherwise desired 10951 by the client it can include the Transport parameter "RTCP-mux" in 10952 any transport specification where it desires to use RTCP-mux. The 10953 server will indicate if it supports RTCP-mux. Server and Client 10954 SHOULD support RTP and RTCP multiplexing. 10956 For capability exchange, an RTSP feature tag for RTP and RTCP 10957 multiplexing is defined: "setup.rtp.rtcp.mux". 10959 C.2. RTP over TCP 10961 Transport of RTP over TCP can be done in two ways, over independent 10962 TCP connections using RFC 4571 [RFC4571] or interleaved in the RTSP 10963 control connection. In both cases the protocol MUST be "rtp" and the 10964 lower layer MUST be TCP. The profile may be any of the above 10965 specified ones; AVP, AVPF, SAVP or SAVPF. 10967 C.2.1. Interleaved RTP over TCP 10969 The use of embedded (interleaved) binary data transported on the RTSP 10970 connection is possible as specified in Section 14. When using this 10971 declared combination of interleaved binary data the RTSP messages 10972 MUST be transported over TCP. TLS may or may not be used. 10974 One should, however, consider that this will result that all media 10975 streams go through any proxy. Using independent TCP connections can 10976 avoid that issue. 10978 C.2.2. RTP over independent TCP 10980 In this Appendix, we describe the sending of RTP [RFC3550] over lower 10981 transport layer TCP [RFC0793] according to "Framing Real-time 10982 Transport Protocol (RTP) and RTP Control Protocol (RTCP) Packets over 10983 Connection-Oriented Transport" [RFC4571]. This Appendix adapts the 10984 guidelines for using RTP over TCP within SIP/SDP [RFC4145] to work 10985 with RTSP. 10987 A client codes the support of RTP over independent TCP by specifying 10988 an RTP/AVP/TCP transport option without an interleaved parameter in 10989 the Transport line of a SETUP request. This transport option MUST 10990 include the "unicast" parameter. 10992 If the client wishes to use RTP with RTCP, two ports (or two address/ 10993 port pairs) are specified by the dest_addr parameter. If the client 10994 wishes to use RTP without RTCP, one port (or one address/port pair) 10995 is specified by the dest_addr parameter. Ordering rules of dest_addr 10996 ports follow the rules for RTP/AVP/UDP. 10998 If the client wishes to play the active role in initiating the TCP 10999 connection, it MAY set the "setup" parameter (See Section 16.52) on 11000 the Transport line to be "active", or it MAY omit the setup 11001 parameter, as active is the default. If the client signals the 11002 active role, the ports for all dest_addr values MUST be set to 9 (the 11003 discard port). 11005 If the client wishes to play the passive role in TCP connection 11006 initiation, it MUST set the "setup" parameter on the Transport line 11007 to be "passive". If the client is able to assume the active or the 11008 passive role, it MUST set the "setup" parameter on the Transport line 11009 to be "actpass". In either case, the dest_addr port value for RTP 11010 MUST be set to the TCP port number on which the client is expecting 11011 to receive the RTP stream connection, and the dest_addr port value 11012 for RTCP MUST be set to the TCP port number on which the client is 11013 expecting to receive the RTCP stream connection. 11015 If upon receipt of a non-interleaved RTP/AVP/TCP SETUP request, a 11016 server decides to accept this requested option, the 2xx reply MUST 11017 contain a Transport option that specifies RTP/AVP/TCP (without using 11018 the interleaved parameter, and with using the unicast parameter). 11019 The dest_addr parameter value MUST be echoed from the parameter value 11020 in the client request unless the destination address (only port) was 11021 not provided in which can the server MAY include the source address 11022 of the RTSP TCP connection with the port number unchanged. 11024 In addition, the server reply MUST set the setup parameter on the 11025 Transport line, to indicate the role the server will play in the 11026 connection setup. Permissible values are "active" (if a client set 11027 "setup" to "passive" or "actpass") and "passive" (if a client set 11028 "setup" to "active" or "actpass"). 11030 If a server sets "setup" to "passive", the "src_addr" in the reply 11031 MUST indicate the ports the server is willing to receive an RTP 11032 connection and (if the client requested an RTCP connection by 11033 specifying two dest_addr ports or address/port pairs) and RTCP 11034 connection. If a server sets "setup" to "active", the ports 11035 specified in "src_addr" MUST be set to 9. The server MAY use the 11036 "ssrc" parameter, following the guidance in Section 16.52. Port 11037 ordering for src_addr follows the rules for RTP/AVP/UDP. 11039 Servers MUST support taking the passive role and MAY support taking 11040 the active role. Servers with a public IP address takes the passive 11041 role, thus enabling clients behind NATs and Firewalls to better 11042 chance of succesful connect to the server by actively connecting 11043 outwards. Therefore the clients are RECOMMENDED to take the active 11044 role. 11046 After sending (receiving) a 2xx reply for a SETUP method for a non- 11047 interleaved RTP/AVP/TCP media stream, the active party SHOULD 11048 initiate the TCP connection as soon as possible. The client MUST NOT 11049 send a PLAY request prior to the establishment of all the TCP 11050 connections negotiated using SETUP for the session. In case the 11051 server receives a PLAY request in a session that has not yet 11052 established all the TCP connections, it MUST respond using the 464 11053 "Data Transport Not Ready Yet" (Section 15.4.29) error code. 11055 Once the PLAY request for a media resource transported over non- 11056 interleaved RTP/AVP/TCP occurs, media begins to flow from server to 11057 client over the RTP TCP connection, and RTCP packets flow 11058 bidirectionally over the RTCP TCP connection. As in the RTP/UDP 11059 case, client to server traffic on the TCP port is unspecified by this 11060 memo. The packets that travel on these connections MUST be framed 11061 using the protocol defined in [RFC4571], not by the framing defined 11062 for interleaving RTP over the RTSP control connection defined in 11063 Section 14. 11065 A successful PAUSE request for a media being transported over RTP/ 11066 AVP/TCP pauses the flow of packets over the connections, without 11067 closing the connections. A successful TEARDOWN request signals that 11068 the TCP connections for RTP and RTCP are to be closed as soon as 11069 possible. 11071 Subsequent SETUP requests on an already-SETUP RTP/AVP/TCP URI may be 11072 ambiguous in the following way: does the client wish to open up new 11073 TCP RTP and RTCP connections for the URI, or does the client wish to 11074 continue using the existing TCP RTP and RTCP connections? The client 11075 SHOULD use the "connection" parameter (defined in Section 16.52) on 11076 the Transport line to make its intention clear in the regard (by 11077 setting "connection" to "new" if new connections are needed, and by 11078 setting "connection" to "existing" if the existing connections are to 11079 be used). After a 2xx reply for a SETUP request for a new 11080 connection, parties should close the pre-existing connections, after 11081 waiting a suitable period for any stray RTP or RTCP packets to 11082 arrive. 11084 Below, we rewrite part of the example media on demand example shown 11085 in Appendix A.1 to use RTP/AVP/TCP non-interleaved: 11087 C->M: DESCRIBE rtsp://example.com/twister.3gp RTSP/2.0 11088 CSeq: 1 11089 User-Agent: PhonyClient/1.2 11091 M->C: RTSP/2.0 200 OK 11092 CSeq: 1 11093 Server: PhonyServer/1.0 11094 Date: Thu, 23 Jan 1997 15:35:06 GMT 11095 Content-Type: application/sdp 11096 Content-Length: 227 11097 Content-Base: rtsp://example.com/twister.3gp/ 11098 Expires: 24 Jan 1997 15:35:06 GMT 11100 v=0 11101 o=- 2890844256 2890842807 IN IP4 198.51.100.34 11102 s=RTSP Session 11103 i=An Example of RTSP Session Usage 11104 e=adm@example.com 11105 c=IN IP4 0.0.0.0 11106 a=control: * 11107 a=range: npt=0-0:10:34.10 11108 t=0 0 11109 m=audio 0 RTP/AVP 0 11110 a=control: trackID=1 11112 C->M: SETUP rtsp://example.com/twister.3gp/trackID=1 RTSP/2.0 11113 CSeq: 2 11114 User-Agent: PhonyClient/1.2 11115 Require: play.basic 11116 Transport: RTP/AVP/TCP;unicast;dest_addr=":9"/":9"; 11117 setup=active;connection=new 11118 Accept-Ranges: NPT, SMPTE, UTC 11120 M->C: RTSP/2.0 200 OK 11121 CSeq: 2 11122 Server: PhonyServer/1.0 11123 Transport: RTP/AVP/TCP;unicast; 11124 dest_addr=":9"/":9"; 11125 src_addr="198.51.100.5:53478"/"198.51.100:54091"; 11126 setup=passive;connection=new;ssrc=93CB001E 11127 Session: 12345678 11128 Expires: 24 Jan 1997 15:35:12 GMT 11129 Date: 23 Jan 1997 15:35:12 GMT 11130 Accept-Ranges: NPT 11131 Media-Properties: Random-Access=0.8, Immutable, Unlimited 11133 C->M: TCP Connection Establishment x2 11135 C->M: PLAY rtsp://example.com/twister.3gp/ RTSP/2.0 11136 CSeq: 4 11137 User-Agent: PhonyClient/1.2 11138 Range: npt=30- 11139 Session: 12345678 11141 M->C: RTSP/2.0 200 OK 11142 CSeq: 4 11143 Server: PhonyServer/1.0 11144 Date: 23 Jan 1997 15:35:14 GMT 11145 Session: 12345678 11146 Range: npt=30-623.10 11147 Seek-Style: First-Prior 11148 RTP-Info: url="rtsp://example.com/twister.3gp/trackID=1" 11149 ssrc=4F312DD8:seq=54321;rtptime=2876889 11151 C.3. Handling Media Clock Time Jumps in the RTP Media Layer 11153 RTSP allows media clients to control selected, non-contiguous 11154 sections of media presentations, rendering those streams with an RTP 11155 media layer [RFC3550]. Two cases occur, the first is when a new PLAY 11156 request replaces an old ongoing request and the new request results 11157 in a jump in the media. This should produce in the RTP layer a 11158 continuous media stream. A client may also directly following a 11159 completed PLAY request perform a new PLAY request. This will result 11160 in some gap in the media layer. The below text will look into both 11161 cases. 11163 A PLAY request that replaces a ongoing request allows the media layer 11164 rendering the RTP stream without being affected by jumps in media 11165 clock time. The RTP timestamps for the new media range is set so 11166 that they become continuous with the previous media range in the 11167 previous request. The RTP sequence number for the first packet in 11168 the new range will be the next following the last packet in the 11169 previous range, i.e. monotonically increasing. The goal is to allow 11170 the media rendering layer to work without interruption or 11171 reconfiguration across the jumps in media clock. This should be 11172 possible in all cases of replaced PLAY requests for media that has 11173 random-access properties. In this case care is needed to align 11174 frames or similar media dependent structures. 11176 In cases where jumps in media clock time are a result of RTSP 11177 signalling operations arriving after a completed PLAY operation, the 11178 request timing will result in that media becomes non-continuous. The 11179 server becomes unable to send the media so that it arrive timely and 11180 still carry timestamps to make the media stream continuous. In these 11181 cases the server will produce RTP streams where there are gaps in the 11182 RTP timeline for the media. In such cases, if the media has frame 11183 structure, aligning the timestamp for the next frame with the 11184 previous structure reduces the burden to render this media. The gap 11185 should represent the time the server hasn't been serving media, e.g. 11186 the time between the end of the media stream or a PAUSE request and 11187 the new PLAY request. In these cases the RTP sequence number would 11188 normally be monotonically increasing across the gap. 11190 For RTSP sessions with media that lacks random access properties, 11191 like live streams, any media clock jump is commonly result of 11192 correspondingly long pause of delivery. The RTP timestamp will have 11193 increased in direct proportion to the duration of the paused 11194 delivery. Note also that in this case the RTP sequence number should 11195 be the next packet number. If not, the RTCP packet loss reporting 11196 will indicate as loss all packets not received between the point of 11197 pausing and later resuming. This may trigger congestion avoidance 11198 mechanisms. An allowed exception from the above recommendation on 11199 monotonically increasing RTP sequence number is live media streams, 11200 likely being relayed. In this case, when the client resumes 11201 delivery, it will get the media that is currently being delivered to 11202 the server itself. For this type of basic delivery of live streams 11203 to multiple users over unicast, individual rewriting of RTP sequence 11204 numbers becomes quite a burden. For solutions that anyway caches 11205 media, timeshifts, etc, the rewriting should be a minor issue. 11207 The goal when handling jumps in media clock time is that the provided 11208 stream is continuous without gaps in RTP timestamp or sequence 11209 number. However, when delivery has been halted for some reason the 11210 RTP timestamp when resuming MUST represent the duration the delivery 11211 was halted. RTP sequence number MUST generally be the next number, 11212 i.e. monotonically increasing modulo 65536. For media resources with 11213 the properties Time-Progressing and Time-Duration=0.0 the server MAY 11214 create RTP media streams with RTP sequence number jumps in them due 11215 to client first halting delivery and later resuming it (PAUSE and 11216 then later PLAY). However, servers utilizing this exception must 11217 take into consideration the resulting RTCP receiver reports that 11218 likely contains loss report for all the packets part of the 11219 discontinuity. A client can not rely on that a server will align 11220 when resuming playing even if it is RECOMMENDED. The RTP-Info header 11221 will provide information on how the server acts in each case. 11223 We cannot assume that the RTSP client can communicate with the RTP 11224 media agent, as the two may be independent processes. If the RTP 11225 timestamp shows the same gap as the NPT, the media agent will 11226 assume that there is a pause in the presentation. If the jump in 11227 NPT is large enough, the RTP timestamp may roll over and the media 11228 agent may believe later packets to be duplicates of packets just 11229 played out. Having the RTP timestamp jump will also affect the 11230 RTCP measurements based on this. 11232 As an example, assume a RTP timestamp frequency of 8000 Hz, a 11233 packetization interval of 100 ms and an initial sequence number and 11234 timestamp of zero. 11236 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11237 CSeq: 4 11238 Session: abcdefgh 11239 Range: npt=10-15 11240 User-Agent: PhonyClient/1.2 11242 S->C: RTSP/2.0 200 OK 11243 CSeq: 4 11244 Session: abcdefgh 11245 Range: npt=10-15 11246 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11247 ssrc=0D12F123:seq=0;rtptime=0 11249 The ensuing RTP data stream is depicted below: 11251 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11252 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11253 . . . 11254 S -> C: RTP packet - seq = 49, rtptime = 39200, NPT time = 14.9s 11256 Upon the completion of the requested delivery the server sends a 11257 PLAY_NOTIFY 11258 S->C: PLAY_NOTIFY rtsp://example.com/fizzle RTSP/2.0 11259 CSeq: 5 11260 Notify-Reason: end-of-stream 11261 Request-Status: cseq=4 status=200 reason="OK" 11262 Range: npt=-15 11263 RTP-Info:url="rtsp://example.com/fizzle/audiotrack" 11264 ssrc=0D12F123:seq=49;rtptime=39200 11265 Session: abcdefgh 11267 C->S: RTSP/2.0 200 OK 11268 CSeq: 5 11269 User-Agent: PhonyClient/1.2 11271 Upon the completion of the play range, the client follows up with a 11272 request to PLAY from a new NPT. 11274 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11275 CSeq: 6 11276 Session: abcdefg 11277 Range: npt=18-20 11278 User-Agent: PhonyClient/1.2 11280 S->C: RTSP/2.0 200 OK 11281 CSeq: 6 11282 Session: abcdefg 11283 Range: npt=18-20 11284 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11285 ssrc=0D12F123:seq=50;rtptime=40100 11287 The ensuing RTP data stream is depicted below: 11289 S->C: RTP packet - seq = 50, rtptime = 40100, NPT time = 18s 11290 S->C: RTP packet - seq = 51, rtptime = 40900, NPT time = 18.1s 11291 . . . 11292 S->C: RTP packet - seq = 69, rtptime = 55300, NPT time = 19.9s 11294 In this example, first, NPT 10 through 15 is played, then the client 11295 request the server to skip ahead and play NPT 18 through 20. The 11296 first segment is presented as RTP packets with sequence numbers 0 11297 through 49 and timestamp 0 through 39,200. The second segment 11298 consists of RTP packets with sequence number 50 through 69, with 11299 timestamps 40,100 through 55,200. While there is a gap in the NPT, 11300 there is no gap in the sequence number space of the RTP data stream. 11302 The RTP timestamp gap is present in the above example due to the time 11303 it takes to perform the second play request, in this case 12.5 ms 11304 (100/8000). 11306 C.4. Handling RTP Timestamps after PAUSE 11308 During a PAUSE / PLAY interaction in an RTSP session, the duration of 11309 time for which the RTP transmission was halted MUST be reflected in 11310 the RTP timestamp of each RTP stream. The duration can be calculated 11311 for each RTP stream as the time elapsed from when the last RTP packet 11312 was sent before the PAUSE request was received and when the first RTP 11313 packet was sent after the subsequent PLAY request was received. The 11314 duration includes all latency incurred and processing time required 11315 to complete the request. 11317 The RTP RFC [RFC3550] states that: The RTP timestamp for each unit 11318 [packet] would be related to the wallclock time at which the unit 11319 becomes current on the virtual presentation timeline. 11321 In order to satisfy the requirements of [RFC3550], the RTP 11322 timestamp space needs to increase continuously with real time. 11323 While this is not optimal for stored media, it is required for RTP 11324 and RTCP to function as intended. Using a continuous RTP 11325 timestamp space allows the same timestamp model for both stored 11326 and live media and allows better opportunity to integrate both 11327 types of media under a single control. 11329 As an example, assume a clock frequency of 8000 Hz, a packetization 11330 interval of 100 ms and an initial sequence number and timestamp of 11331 zero. 11333 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11334 CSeq: 4 11335 Session: abcdefg 11336 Range: npt=10-15 11337 User-Agent: PhonyClient/1.2 11339 S->C: RTSP/2.0 200 OK 11340 CSeq: 4 11341 Session: abcdefg 11342 Range: npt=10-15 11343 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11344 ssrc=0D12F123:seq=0;rtptime=0 11346 The ensuing RTP data stream is depicted below: 11348 S -> C: RTP packet - seq = 0, rtptime = 0, NPT time = 10s 11349 S -> C: RTP packet - seq = 1, rtptime = 800, NPT time = 10.1s 11350 S -> C: RTP packet - seq = 2, rtptime = 1600, NPT time = 10.2s 11351 S -> C: RTP packet - seq = 3, rtptime = 2400, NPT time = 10.3s 11353 The client then sends a PAUSE request: 11355 C->S: PAUSE rtsp://example.com/fizzle RTSP/2.0 11356 CSeq: 5 11357 Session: abcdefg 11358 User-Agent: PhonyClient/1.2 11360 S->C: RTSP/2.0 200 OK 11361 CSeq: 5 11362 Session: abcdefg 11363 Range: npt=10.4-15 11365 20 seconds elapse and then the client sends a PLAY request. In 11366 addition the server requires 15 ms to process the request: 11368 C->S: PLAY rtsp://example.com/fizzle RTSP/2.0 11369 CSeq: 6 11370 Session: abcdefg 11371 User-Agent: PhonyClient/1.2 11373 S->C: RTSP/2.0 200 OK 11374 CSeq: 6 11375 Session: abcdefg 11376 Range: npt=10.4-15 11377 RTP-Info: url="rtsp://example.com/fizzle/audiotrack" 11378 ssrc=0D12F123:seq=4;rtptime=164400 11380 The ensuing RTP data stream is depicted below: 11382 S -> C: RTP packet - seq = 4, rtptime = 164400, NPT time = 10.4s 11383 S -> C: RTP packet - seq = 5, rtptime = 165200, NPT time = 10.5s 11384 S -> C: RTP packet - seq = 6, rtptime = 166000, NPT time = 10.6s 11386 First, NPT 10 through 10.3 is played, then a PAUSE is received by the 11387 server. After 20 seconds a PLAY is received by the server which take 11388 15ms to process. The duration of time for which the session was 11389 paused is reflected in the RTP timestamp of the RTP packets sent 11390 after this PLAY request. 11392 A client can use the RTSP range header and RTP-Info header to map NPT 11393 time of a presentation with the RTP timestamp. 11395 Note: In RFC 2326 [RFC2326], this matter was not clearly defined and 11396 was misunderstood commonly. However, for RTSP 2.0 it is expected 11397 that this will be handled correctly and no exception handling will be 11398 required. 11400 Note Further: To ensure correct media decoding and usually jitter- 11401 buffer handling reseting some of the state when issuing a PLAY 11402 request is needed. 11404 C.5. RTSP / RTP Integration 11406 For certain datatypes, tight integration between the RTSP layer and 11407 the RTP layer will be necessary. This by no means precludes the 11408 above restrictions. Combined RTSP/RTP media clients should use the 11409 RTP-Info field to determine whether incoming RTP packets were sent 11410 before or after a seek or before or after a PAUSE. 11412 C.6. Scaling with RTP 11414 For scaling (see Section 16.44), RTP timestamps should correspond to 11415 the rendering timing. For example, when playing video recorded at 30 11416 frames/second at a scale of two and speed (Section 16.48) of one, the 11417 server would drop every second frame to maintain and deliver video 11418 packets with the normal timestamp spacing of 3,000 per frame, but NPT 11419 would increase by 1/15 second for each video frame. 11421 Note: The above scaling puts requirements on the media codec or a 11422 media stream to support it. For example motion JPEG or other non- 11423 predictive video coding can easier handle the above example. 11425 C.7. Maintaining NPT synchronization with RTP timestamps 11427 The client can maintain a correct display of NPT (Normal Play Time) 11428 by noting the RTP timestamp value of the first packet arriving after 11429 repositioning. The sequence parameter of the RTP-Info 11430 (Section 16.43) header provides the first sequence number of the next 11431 segment. 11433 C.8. Continuous Audio 11435 For continuous audio, the server SHOULD set the RTP marker bit at the 11436 beginning of serving a new PLAY request or at jumps in timeline. 11437 This allows the client to perform playout delay adaptation. 11439 C.9. Multiple Sources in an RTP Session 11441 Note that more than one SSRC MAY be sent in the media stream. If it 11442 happens all sources are expected to be rendered simultaneously. 11444 C.10. Usage of SSRCs and the RTCP BYE Message During an RTSP Session 11446 The RTCP BYE message indicates the end of use of a given SSRC. If 11447 all sources leave an RTP session, it can, in most cases, be assumed 11448 to have ended. Therefore, a client or server MUST NOT send a RTCP 11449 BYE message until it has finished using a SSRC. A server SHOULD keep 11450 using a SSRC until the RTP session is terminated. Prolonging the use 11451 of a SSRC allows the established synchronization context associated 11452 with that SSRC to be used to synchronize subsequent PLAY requests 11453 even if the PLAY response is late. 11455 An SSRC collision with the SSRC that transmits media does also have 11456 consequences, as it will normally force the media sender to change 11457 its SSRC in accordance with the RTP specification[RFC3550]. However, 11458 a RTSP server may wait and see if the client changes and thus resolve 11459 the conflict to minimize the impact. As media sender SSRC change 11460 will result in a loss of synchronization context, and require any 11461 receiver to wait for RTCP sender reports for all media requiring 11462 synchronization before being able to play out synchronized. Due to 11463 these reasons a client joining a session should take care to not 11464 select the same SSRC(s) as the server indicates in the ssrc Transport 11465 header parameter. Any SSRC signalled in the Transport header MUST be 11466 avoided. A client detecting a collision prior to sending any RTP or 11467 RTCP messages SHALL also select a new SSRC. 11469 C.11. Future Additions 11471 It is the intention that any future protocol or profile regarding 11472 both for media delivery and lower transport should be easy to add to 11473 RTSP. This section provides the necessary steps that needs to be 11474 meet. 11476 The following things needs to be considered when adding a new 11477 protocol or profile for use with RTSP: 11479 o The protocol or profile needs to define a name tag representing 11480 it. This tag is required to be a ABNF "token" to be possible to 11481 use in the Transport header specification. 11483 o The useful combinations of protocol, profiles and lower layer 11484 transport for this extension needs to be defined. For each 11485 combination declare the necessary parameters to use in the 11486 Transport header. 11488 o For new media protocols the interaction with RTSP needs to be 11489 addressed. One important factor will be the media 11490 synchronization. May need new headers similar to RTP info to 11491 carry information. 11493 o Discuss congestion control for media, especially if transport 11494 without built in congestion control is used. 11496 See the IANA section (Section 22) for information how to register new 11497 attributes. 11499 Appendix D. Use of SDP for RTSP Session Descriptions 11501 The Session Description Protocol (SDP, [RFC4566]) may be used to 11502 describe streams or presentations in RTSP. This description is 11503 typically returned in reply to a DESCRIBE request on an URI from a 11504 server to a client, or received via HTTP from a server to a client. 11506 This appendix describes how an SDP file determines the operation of 11507 an RTSP session. SDP as is provides no mechanism by which a client 11508 can distinguish, without human guidance, between several media 11509 streams to be rendered simultaneously and a set of alternatives 11510 (e.g., two audio streams spoken in different languages). The SDP 11511 extension "Grouping of Media Lines in the Session Description 11512 Protocol (SDP)" [RFC3388] provides such functionality to some degree. 11513 Appendix D.4 describes the usage of SDP media line grouping for RTSP. 11515 D.1. Definitions 11517 The terms "session-level", "media-level" and other key/attribute 11518 names and values used in this appendix are to be used as defined in 11519 SDP[RFC4566]: 11521 D.1.1. Control URI 11523 The "a=control:" attribute is used to convey the control URI. This 11524 attribute is used both for the session and media descriptions. If 11525 used for individual media, it indicates the URI to be used for 11526 controlling that particular media stream. If found at the session 11527 level, the attribute indicates the URI for aggregate control 11528 (presentation URI). The session level URI MUST be different from any 11529 media level URI. The presence of a session level control attribute 11530 MUST be interpreted as support for aggregated control. The control 11531 attribute MUST be present on media level unless the presentation only 11532 contains a single media stream, in which case the attribute MAY only 11533 be present on the session level and then also apply to that single 11534 media level. 11536 ABNF for the attribute is defined in Section 20.3. 11538 Example: 11539 a=control:rtsp://example.com/foo 11541 This attribute MAY contain either relative or absolute URIs, 11542 following the rules and conventions set out in RFC 3986 [RFC3986]. 11543 Implementations MUST look for a base URI in the following order: 11545 1. the RTSP Content-Base field; 11546 2. the RTSP Content-Location field; 11548 3. the RTSP Request-URI. 11550 If this attribute contains only an asterisk (*), then the URI MUST be 11551 treated as if it were an empty embedded URI, and thus inherit the 11552 entire base URI. 11554 Note, RFC 2326 was very unclear on the processing of relative URI 11555 and several RTSP 1.0 implementations at the point of publishing 11556 this document did not perform RFC 3986 processing to determine the 11557 resulting URI, instead simple concatenation is common. To avoid 11558 this issue completely it is recommended to use absolute URI in the 11559 SDP. 11561 The URI handling for SDPs from container files need special 11562 consideration. For example lets assume that a container file has the 11563 URI: "rtsp://example.com/container.mp4". Lets further assume this 11564 URI is the base URI, and that there is a absolute media level URI: 11565 "rtsp://example.com/container.mp4/trackID=2". A relative media level 11566 URI that resolves in accordance with RFC 3986 [RFC3986] to the above 11567 given media URI is: "container.mp4/trackID=2". It is usually not 11568 desirable to need to include in or modify the SDP stored within the 11569 container file with the server local name of the container file. To 11570 avoid this, one can modify the base URI used to include a trailing 11571 slash, e.g. "rtsp://example.com/container.mp4/". In this case the 11572 relative URI for the media will only need to be: "trackID=2". 11573 However, this will also mean that using "*" in the SDP will result in 11574 control URI including the trailing slash, i.e. 11575 "rtsp://example.com/container.mp4/". 11577 Note: The usage of TrackID in the above is not an standardized 11578 form, but one example out of several similar strings such as 11579 TrackID, Track_ID, StreamID that is used by different server 11580 vendors to indicate a particular piece of media inside a container 11581 file. 11583 D.1.2. Media Streams 11585 The "m=" field is used to enumerate the streams. It is expected that 11586 all the specified streams will be rendered with appropriate 11587 synchronization. If the session is over multicast, the port number 11588 indicated SHOULD be used for reception. The client MAY try to 11589 override the destination port, through the Transport header. The 11590 servers MAY allow this, the response will indicate if allowed or not. 11591 If the session is unicast, the port numbers are the ones RECOMMENDED 11592 by the server to the client, about which receiver ports to use; the 11593 client MUST still include its receiver ports in its SETUP request. 11595 The client MAY ignore this recommendation. If the server has no 11596 preference, it SHOULD set the port number value to zero. 11598 The "m=" lines contain information about which transport protocol, 11599 profile, and possibly lower-layer is to be used for the media stream. 11600 The combination of transport, profile and lower layer, like RTP/AVP/ 11601 UDP needs to be defined for how to be used with RTSP. The currently 11602 defined combinations are defined in Appendix C, further combinations 11603 MAY be specified. 11605 Example: 11606 m=audio 0 RTP/AVP 31 11608 D.1.3. Payload Type(s) 11610 The payload type(s) are specified in the "m=" line. In case the 11611 payload type is a static payload type from RFC 3551 [RFC3551], no 11612 other information may be required. In case it is a dynamic payload 11613 type, the media attribute "rtpmap" is used to specify what the media 11614 is. The "encoding name" within the "rtpmap" attribute may be one of 11615 those specified in RFC 3551 (Sections 5 and 6), or an MIME type 11616 registered with IANA, or an experimental encoding as specified in SDP 11617 (RFC 4566 [RFC4566]). Codec-specific parameters are not specified in 11618 this field, but rather in the "fmtp" attribute described below. 11620 The selection of the RTP payload type numbers used may be required to 11621 consider RTP and RTCP Multiplexing [I-D.ietf-avt-rtp-and-rtcp-mux] if 11622 that is to be supported by the server. 11624 D.1.4. Format-Specific Parameters 11626 Format-specific parameters are conveyed using the "fmtp" media 11627 attribute. The syntax of the "fmtp" attribute is specific to the 11628 encoding(s) that the attribute refers to. Note that some of the 11629 format specific parameters may be specified outside of the fmtp 11630 parameters, like for example the "ptime" attribute for most audio 11631 encodings. 11633 D.1.5. Directionality of media stream 11635 The SDP attributes "a=sendrecv", "a=recvonly" and "a=sendonly" 11636 provides instructions on which direction the media streams flow 11637 within a session. When using RTSP the SDP can be delivered to a 11638 client using either RTSP DESCRIBE or a number of RTSP external 11639 methods, like HTTP, FTP, and email. Based on this the SDP applies to 11640 how the RTSP client will see the complete session. Thus for media 11641 streams delivered from the RTSP server to the client would be given 11642 the "a=recvonly" attribute. 11644 The direction attributes are not commonly used in SDPs for RTSP, but 11645 may occur. "a=recvonly" in a SDP provided to the RTSP client MUST 11646 indicate that media delivery will only occur in the direction from 11647 the RTSP server to the client. In SDP provided to the RTSP client 11648 that lacks any of the directionality attributes (a=recvonly, 11649 a=sendonly, a=sendrecv) MUST behave as if the "a=recvonly" attribute 11650 was received. Note that this overrules the normal default rule 11651 defined in SDP[RFC4566]. The usage of "a=sendonly" or "a=sendrecv" 11652 is not defined, nor is the interpretation of SDP by other entities 11653 than the RTSP client. 11655 D.1.6. Range of Presentation 11657 The "a=range" attribute defines the total time range of the stored 11658 session or an individual media. Non-seekable live sessions can be 11659 indicated as specified below, while the length of live sessions can 11660 be deduced from the "t" and "r" SDP parameters. 11662 The attribute is both a session and a media level attribute. For 11663 presentations that contains media streams of the same durations, the 11664 range attribute SHOULD only be used at session-level. In case of 11665 different length the range attribute MUST be given at media level for 11666 all media, and SHOULD NOT be given at session level. If the 11667 attribute is present at both media level and session level the media 11668 level values MUST be used. 11670 Note: Usually one will specify the same length for all media, even if 11671 there isn't media available for the full duration on all media. 11672 However, that requires that the server accepts PLAY requests within 11673 that range. 11675 Servers MUST take care to provide RTSP Range (see Section 16.38) 11676 values that are consistent with what is presented in the SDP for the 11677 content. There is no reason for non dynamic content, like media 11678 clips provided on demand to have inconsistent values. Inconsistent 11679 values between the SDP and the actual values for the content handled 11680 by the server is likely to generate some failure, like 457 "Invalid 11681 Range", in case the client uses PLAY requests with a Range header. 11682 In case the content is dynamic in length and it is infeasible to 11683 provide a correct value in the SDP the server is recommended to 11684 describe this as non-seekable content (see below). The server MAY 11685 override that property in the response to a PLAY request using the 11686 correct values in the Range header. 11688 The unit is specified first, followed by the value range. The units 11689 and their values are as defined in Section 4.4, Section 4.5 and 11690 Section 4.6 and MAY be extended with further formats. Any open ended 11691 range (start-), i.e. without stop range, is of unspecified duration 11692 and MUST be considered as non-seekable content unless this property 11693 is overridden. Multiple instances carrying different clock formats 11694 MAY be included at either session or media level. 11696 ABNF for the attribute is defined in Section 20.3. 11698 Examples: 11699 a=range:npt=0-34.4368 11700 a=range:clock=19971113T211503Z-19971113T220300Z 11701 Non seekable stream of unknown duration: 11702 a=range:npt=0- 11704 D.1.7. Time of Availability 11706 The "t=" field defines when the SDP is valid. For on-demand content 11707 the server SHOULD indicate a stop time value for which it guarantees 11708 the description to be valid, and a start time that is equal to or 11709 before the time at which the DESCRIBE request was received. It MAY 11710 also indicate start and stop times of 0, meaning that the session is 11711 always available. 11713 For sessions that are of live type, i.e. specific start time, unknown 11714 stop time, likely unseekable, the "t=" and "r=" field SHOULD be used 11715 to indicate the start time of the event. The stop time SHOULD be 11716 given so that the live event will have ended at that time, while 11717 still not be unnecessary long into the future. 11719 D.1.8. Connection Information 11721 In SDP, the "c=" field contains the destination address for the media 11722 stream. If a multicast address is specified the client SHOULD use 11723 this address in any SETUP request as destination address, including 11724 any additional parameters, such as TTL. For on-demand unicast 11725 streams and some multicast streams, the destination address MAY be 11726 specified by the client via the SETUP request, thus overriding any 11727 specified address. To identify streams without a fixed destination 11728 address, where the client is required to specify a destination 11729 address, the "c=" field SHOULD be set to a null value. For addresses 11730 of type "IP4", this value MUST be "0.0.0.0", and for type "IP6", this 11731 value MUST be "0:0:0:0:0:0:0:0" (can also be written as "::"), i.e. 11732 the unspecified address according to RFC 4291 [RFC4291]. 11734 D.1.9. Message Body Tag 11736 The optional "a=mtag" attribute identifies a version of the session 11737 description. It is opaque to the client. SETUP requests may include 11738 this identifier in the If-Match field (see Section 16.23) to only 11739 allow session establishment if this attribute value still corresponds 11740 to that of the current description. The attribute value is opaque 11741 and may contain any character allowed within SDP attribute values. 11743 ABNF for the attribute is defined in Section 20.3. 11745 Example: 11746 a=mtag:"158bb3e7c7fd62ce67f12b533f06b83a" 11748 One could argue that the "o=" field provides identical 11749 functionality. However, it does so in a manner that would put 11750 constraints on servers that need to support multiple session 11751 description types other than SDP for the same piece of media 11752 content. 11754 D.2. Aggregate Control Not Available 11756 If a presentation does not support aggregate control no session level 11757 "a=control:" attribute is specified. For a SDP with multiple media 11758 sections specified, each section will have its own control URI 11759 specified via the "a=control:" attribute. 11761 Example: 11762 v=0 11763 o=- 2890844256 2890842807 IN IP4 192.0.2.56 11764 s=I came from a web page 11765 e=adm@example.com 11766 c=IN IP4 0.0.0.0 11767 t=0 0 11768 m=video 8002 RTP/AVP 31 11769 a=control:rtsp://audio.example.com/movie.aud 11770 m=audio 8004 RTP/AVP 3 11771 a=control:rtsp://video.example.com/movie.vid 11773 Note that the position of the control URI in the description implies 11774 that the client establishes separate RTSP control sessions to the 11775 servers audio.example.com and video.example.com. 11777 It is recommended that an SDP file contains the complete media 11778 initialization information even if it is delivered to the media 11779 client through non-RTSP means. This is necessary as there is no 11780 mechanism to indicate that the client should request more detailed 11781 media stream information via DESCRIBE. 11783 D.3. Aggregate Control Available 11785 In this scenario, the server has multiple streams that can be 11786 controlled as a whole. In this case, there are both a media-level 11787 "a=control:" attributes, which are used to specify the stream URIs, 11788 and a session-level "a=control:" attribute which is used as the 11789 Request-URI for aggregate control. If the media-level URI is 11790 relative, it is resolved to absolute URIs according to Appendix D.1.1 11791 above. 11793 Example: 11794 C->M: DESCRIBE rtsp://example.com/movie RTSP/2.0 11795 CSeq: 1 11796 User-Agent: PhonyClient/1.2 11798 M->C: RTSP/2.0 200 OK 11799 CSeq: 1 11800 Date: Thu, 23 Jan 1997 15:35:06 GMT 11801 Expires: Thu, 23 Jan 1997 16:35:06 GMT 11802 Content-Type: application/sdp 11803 Content-Base: rtsp://example.com/movie/ 11804 Content-Length: 227 11806 v=0 11807 o=- 2890844256 2890842807 IN IP4 192.0.2.211 11808 s=I contain 11809 i= 11810 e=adm@example.com 11811 c=IN IP4 0.0.0.0 11812 a=control:* 11813 t=0 0 11814 m=video 8002 RTP/AVP 31 11815 a=control:trackID=1 11816 m=audio 8004 RTP/AVP 3 11817 a=control:trackID=2 11819 In this example, the client is recommended to establish a single RTSP 11820 session to the server, and uses the URIs 11821 rtsp://example.com/movie/trackID=1 and 11822 rtsp://example.com/movie/trackID=2 to set up the video and audio 11823 streams, respectively. The URI rtsp://example.com/movie/, which is 11824 resolved from the "*", controls the whole presentation (movie). 11826 A client is not required to issues SETUP requests for all streams 11827 within an aggregate object. Servers should allow the client to ask 11828 for only a subset of the streams. 11830 D.4. Grouping of Media Lines in SDP 11832 For some types media it is desirable to express a relationship 11833 between various media components, for instance, for lip 11834 synchronization or Scalable Video Codec (SVC) [RFC5583]. This 11835 relationship is expressed on the SDP level by grouping of media 11836 lines, as described in [RFC3388] and can be exposed to RTSP. 11838 For RTSP it is mainly important to know how to handle grouped medias 11839 received by means of SDP, i.e., if the media are under aggregate 11840 control (see Appendix D.3) or if aggregate control is not available 11841 (see Appendix D.2). 11843 It is RECOMMENDED that grouped medias are handled by aggregate 11844 control, to give the client the ability to control either the whole 11845 presentation or single medias. 11847 Editor's note: how should the dependencies in [RFC5583] be handled 11848 in RTSP? 11850 D.5. RTSP external SDP delivery 11852 There are some considerations that need to be made when the session 11853 description is delivered to the client outside of RTSP, for example 11854 via HTTP or email. 11856 First of all, the SDP needs to contain absolute URIs, since relative 11857 will in most cases not work as the delivery will not correctly 11858 forward the base URI. 11860 The writing of the SDP session availability information, i.e. "t=" 11861 and "r=", needs to be carefully considered. When the SDP is fetched 11862 by the DESCRIBE method, the probability that it is valid is very 11863 high. However, the same are much less certain for SDPs distributed 11864 using other methods. Therefore the publisher of the SDP should take 11865 care to follow the recommendations about availability in the SDP 11866 specification [RFC4566]. 11868 Appendix E. RTSP Use Cases 11870 This Appendix describes the most important and considered use cases 11871 for RTSP. They are listed in descending order of importance in 11872 regards to ensuring that all necessary functionality is present. 11873 This specification only fully supports usage of the two first. Also 11874 in these first two cases, there are special cases or exceptions that 11875 are not supported without extensions, e.g. the redirection of media 11876 delivery to another address than the controlling agent's (client's). 11878 E.1. On-demand Playback of Stored Content 11880 An RTSP capable server stores content suitable for being streamed to 11881 a client. A client desiring playback of any of the stored content 11882 uses RTSP to set up the media transport required to deliver the 11883 desired content. RTSP is then used to initiate, halt and manipulate 11884 the actual transmission (playout) of the content. RTSP is also 11885 required to provide necessary description and synchronization 11886 information for the content. 11888 The above high level description can be broken down into a number of 11889 functions that RTSP needs to be capable of. 11891 Presentation Description: Provide initialization information about 11892 the presentation (content); for example, which media codecs are 11893 needed for the content. Other information that is important 11894 includes the number of media stream the presentation contains, 11895 the transport protocols used for the media streams, and 11896 identifiers for these media streams. This information is 11897 required before setup of the content is possible and to 11898 determine if the client is even capable of using the content. 11900 This information need not be sent using RTSP; other external 11901 protocols can be used to transmit the transport presentation 11902 descriptions. Two good examples are the use of HTTP [RFC2616] 11903 or email to fetch or receive presentation descriptions like SDP 11904 [RFC4566] 11906 Setup: Set up some or all of the media streams in a presentation. 11907 The setup itself consist of selecting the protocol for media 11908 transport and the necessary parameters for the protocol, like 11909 addresses and ports. 11911 Control of Transmission: After the necessary media streams have been 11912 established the client can request the server to start 11913 transmitting the content. The client must be allowed to start 11914 or stop the transmission of the content at arbitrary times. 11915 The client must also be able to start the transmission at any 11916 point in the timeline of the presentation. 11918 Synchronization: For media transport protocols like RTP [RFC3550] it 11919 might be beneficial to carry synchronization information within 11920 RTSP. This may be due to either the lack of inter-media 11921 synchronization within the protocol itself, or the potential 11922 delay before the synchronization is established (which is the 11923 case for RTP when using RTCP). 11925 Termination: Terminate the established contexts. 11927 For this use case there are a number of assumptions about how it 11928 works. These are: 11930 On-Demand content: The content is stored at the server and can be 11931 accessed at any time during a time period when it is intended 11932 to be available. 11934 Independent sessions: A server is capable of serving a number of 11935 clients simultaneously, including from the same piece of 11936 content at different points in that presentations time-line. 11938 Unicast Transport: Content for each individual client is transmitted 11939 to them using unicast traffic. 11941 It is also possible to redirect the media traffic to a different 11942 destination than that of the agent controlling the traffic. However, 11943 allowing this without appropriate mechanisms for checking that the 11944 destination approves of this allows for distributed denial of service 11945 attacks (DDoS). 11947 E.2. Unicast Distribution of Live Content 11949 This use case is similar to the above on-demand content case (see 11950 Appendix E.1) the difference is the nature of the content itself. 11951 Live content is continuously distributed as it becomes available from 11952 a source; i.e., the main difference from on-demand is that one starts 11953 distributing content before the end of it has become available to the 11954 server. 11956 In many cases the consumer of live content is only interested in 11957 consuming what is actually happens "now"; i.e., very similar to 11958 broadcast TV. However, in this case it is assumed that there exist 11959 no broadcast or multicast channel to the users, and instead the 11960 server functions as a distribution node, sending the same content to 11961 multiple receivers, using unicast traffic between server and client. 11962 This unicast traffic and the transport parameters are individually 11963 negotiated for each receiving client. 11965 Another aspect of live content is that it often has a very limited 11966 time of availability, as it is only is available for the duration of 11967 the event the content covers. An example of such a live content 11968 could be a music concert which lasts 2 hour and starts at a 11969 predetermined time. Thus there is need to announce when and for how 11970 long the live content is available. 11972 In some cases, the server providing live content may be saving some 11973 or all of the content to allow clients to pause the stream and resume 11974 it from the paused point, or to "rewind" and play continuously from a 11975 point earlier than the live point. Hence, this use case does not 11976 necessarily exclude playing from other than the live point of the 11977 stream, playing with scales other than 1.0, etc. 11979 E.3. On-demand Playback using Multicast 11981 It is possible to use RTSP to request that media be delivered to a 11982 multicast group. The entity setting up the session (the controller) 11983 will then control when and what media is delivered to the group. 11984 This use case has some potential for denial of service attacks by 11985 flooding a multicast group. Therefore, a mechanism is needed to 11986 indicate that the group actually accepts the traffic from the RTSP 11987 server. 11989 An open issue in this use case is how one ensures that all receivers 11990 listening to the multicast or broadcast receives the session 11991 presentation configuring the receivers. This specification has to 11992 rely on a external solution to solve this issue. 11994 E.4. Inviting an RTSP server into a conference 11996 If one has an established conference or group session, it is possible 11997 to have an RTSP server distribute media to the whole group. 11998 Transmission to the group is simplest when controlled by a single 11999 participant or leader of the conference. Shared control might be 12000 possible, but would require further investigation and possibly 12001 extensions. 12003 This use case assumes that there exists either multicast or a 12004 conference focus that redistribute media to all participants. 12006 This use case is intended to be able to handle the following 12007 scenario: A conference leader or participant (hereafter called the 12008 controller) has some pre-stored content on an RTSP server that he 12009 wants to share with the group. The controller sets up an RTSP 12010 session at the streaming server for this content and retrieves the 12011 session description for the content. The destination for the media 12012 content is set to the shared multicast group or conference focus. 12014 When desired by the controller, he/she can start and stop the 12015 transmission of the media to the conference group. 12017 There are several issues with this use case that are not solved by 12018 this core specification for RTSP: 12020 Denial of service: To avoid an RTSP server from being an unknowing 12021 participant in a denial of service attack the server needs to 12022 be able to verify the destination's acceptance of the media. 12023 Such a mechanism to verify the approval of received media does 12024 not yet exist; instead, only policies can be used, which can be 12025 made to work in controlled environments. 12027 Distributing the presentation description to all participants in the 12028 group: To enable a media receiver to correctly decode the content 12029 the media configuration information needs to be distributed 12030 reliably to all participants. This will most likely require 12031 support from an external protocol. 12033 Passing control of the session: If it is desired to pass control of 12034 the RTSP session between the participants, some support will be 12035 required by an external protocol to exchange state information 12036 and possibly floor control of who is controlling the RTSP 12037 session. 12039 If there interest in this use case, further work is required on the 12040 necessary extensions. 12042 E.5. Live Content using Multicast 12044 This use case in its simplest form does not require any use of RTSP 12045 at all; this is what multicast conferences being announced with SAP 12046 [RFC2974] and SDP are intended to handle. However, in use cases 12047 where more advanced features like access control to the multicast 12048 session are desired, RTSP could be used for session establishment. 12050 A client desiring to join a live multicasted media session with 12051 cryptographic (encryption) access control could use RTSP in the 12052 following way. The source of the session announces the session and 12053 gives all interested an RTSP URI. The client connects to the server 12054 and requests the presentation description, allowing configuration for 12055 reception of the media. In this step it is possible for the client 12056 to use secured transport and any desired level of authentication; for 12057 example, for billing or access control. An RTSP link also allows for 12058 load balancing between multiple servers. 12060 If these were the only goals, they could be achieved by simply using 12061 HTTP. However, for cases where the sender likes to keep track of 12062 each individual receiver of a session, and possibly use the session 12063 as a side channel for distributing key-updates or other information 12064 on a per-receiver basis, and the full set of receivers is not know 12065 prior to the session start, the state establishment that RTSP 12066 provides can be beneficial. In this case a client would establish an 12067 RTSP session for this multicast group with the RTSP server. The RTSP 12068 server will not transmit any media, but instead will point to the 12069 multicast group. The client and server will be able to keep the 12070 session alive for as long as the receiver participates in the session 12071 thus enabling, for example, the server to push updates to the client. 12073 This use case will most likely not be able to be implemented without 12074 some extensions to the server-to-client push mechanism. Here the 12075 PLAY_NOTIFY method (see Section 13.5) with a suitable extension could 12076 provide clear benefits. 12078 Appendix F. Text format for Parameters 12080 A resource of type "text/parameters" consists of either 1) a list of 12081 parameters (for a query) or 2) a list of parameters and associated 12082 values (for an response or setting of the parameter). Each entry of 12083 the list is a single line of text. Parameters are separated from 12084 values by a colon. The parameter name MUST only use US-ASCII visible 12085 characters while the values are UTF-8 text strings. The media type 12086 registration form is in Section 22.16. 12088 There exist a potential interoperability issue for this format. It 12089 was named in RFC 2326 but never defined, even if used in examples 12090 that hint at the syntax. This format matches the purpose and its 12091 syntax supports the examples provided. However, it goes further by 12092 allowing UTF-8 in the value part, thus usage of UTF-8 strings may not 12093 be supported. However, as individual parameters are not defined, the 12094 using application anyway needs to have out-of-band agreement or using 12095 feature-tag to determine if the end-point supports the parameters. 12097 The ABNF [RFC5234] grammar for "text/parameters" content is: 12099 file = *((parameter / parameter-value) CRLF) 12100 parameter = 1*visible-except-colon 12101 parameter-value = parameter *WSP ":" value 12102 visible-except-colon = %x21-39 / %x3B-7E ; VCHAR - ":" 12103 value = *(TEXT-UTF8char / WSP) 12104 TEXT-UTF8char = %x21-7E / UTF8-NONASCII 12105 UTF8-NONASCII = %xC0-DF 1UTF8-CONT 12106 / %xE0-EF 2UTF8-CONT 12107 / %xF0-F7 3UTF8-CONT 12108 / %xF8-FB 4UTF8-CONT 12109 / %xFC-FD 5UTF8-CONT 12110 UTF8-CONT = %x80-BF 12111 WSP = ; Space or HTAB 12112 VCHAR = 12113 CRLF = 12115 Appendix G. Requirements for Unreliable Transport of RTSP 12117 This section provides anyone intending to define how to transport of 12118 RTSP messages over a unreliable transport protocol with some 12119 information learned by the attempt in RFC 2326 [RFC2326]. RFC 2326 12120 define both an URI scheme and some basic functionality for transport 12121 of RTSP messages over UDP, however, it was not sufficient for 12122 reliable usage and successful interoperability. 12124 The RTSP scheme defined for unreliable transport of RTSP messages was 12125 "rtspu". It has been reserved by this specification as at least one 12126 commercial implementation exist, thus avoiding any collisions in the 12127 name space. 12129 The following considerations should exist for operation of RTSP over 12130 an unreliable transport protocol: 12132 o Request shall be acknowledged by the receiver. If there is no 12133 acknowledgement, the sender may resend the same message after a 12134 timeout of one round-trip time (RTT). Any retransmissions due to 12135 lack of acknowledgement must carry the same sequence number as the 12136 original request. 12138 o The round-trip time can be estimated as in TCP (RFC 1123) 12139 [RFC1123], with an initial round-trip value of 500 ms. An 12140 implementation may cache the last RTT measurement as the initial 12141 value for future connections. 12143 o If RTSP is used over a small-RTT LAN, standard procedures for 12144 optimizing initial TCP round trip estimates, such as those used in 12145 T/TCP (RFC 1644) [RFC1644], can be beneficial. 12147 o The Timestamp header (Section 16.51) is used to avoid the 12148 retransmission ambiguity problem [Stevens98]. 12150 o The registered default port for RTSP over UDP for the server is 12151 554. 12153 o RTSP messages can be carried over any lower-layer transport 12154 protocol that is 8-bit clean. 12156 o RTSP messages are vulnerable to bit errors and should not be 12157 subjected to them. 12159 o Source authentication, or at least validation that RTSP messages 12160 comes from the same entity becomes extremely important, as session 12161 hijacking may be substantially easier for RTSP message transport 12162 using an unreliable protocol like UDP than for TCP. 12164 There exist two RTSP headers thats primarily are intended for being 12165 used by the unreliable handling of RTSP messages and which will be 12166 maintained: 12168 o [CSeq] See Section 16.19 12170 o [Timestamp] See Section 16.51 12172 Appendix H. Backwards Compatibility Considerations 12174 This section contains notes on issues about backwards compatibility 12175 with clients or servers being implemented according to RFC 2326 12176 [RFC2326]. Note that there exists no requirement to implement RTSP 12177 1.0, in fact we recommend against it as it is difficult to do in an 12178 interoperable way. 12180 A server implementing RTSP/2.0 MUST include a RTSP-Version of 12181 RTSP/2.0 in all responses to requests containing RTSP-Version 12182 RTSP/2.0. If a server receives a RTSP/1.0 request, it MAY respond 12183 with a RTSP/1.0 response if it chooses to support RFC 2326. If the 12184 server chooses not to support RFC 2326, it MUST respond with a 505 12185 (RTSP Version not supported) status code. A server MUST NOT respond 12186 to a RTSP-Version RTSP/1.0 request with a RTSP-Version RTSP/2.0 12187 response. 12189 Clients implementing RTSP/2.0 MAY use an OPTIONS request with a RTSP- 12190 Version of 2.0 to determine whether a server supports RTSP/2.0. If 12191 the server responds with either a RTSP-Version of 1.0 or a status 12192 code of 505 (RTSP Version not supported), the client will have to use 12193 RTSP/1.0 requests if it chooses to support RFC 2326. 12195 H.1. Play Request in Play State 12197 The behavior in the server when a Play is received in Play state has 12198 changed (Section 13.4). In RFC 2326, the new PLAY request would be 12199 queued until the current Play completed. Any new PLAY request now 12200 take effect immediately replacing the previous request. 12202 H.2. Using Persistent Connections 12204 Some server implementations of RFC 2326 maintain a one-to-one 12205 relationship between a connection and an RTSP session. Such 12206 implementations require clients to use a persistent connection to 12207 communicate with the server and when a client closes its connection, 12208 the server may remove the RTSP session. This is worth noting if a 12209 RTSP 2.0 client also supporting 1.0 connects to a 1.0 server. 12211 Appendix I. Open Issues 12213 Open issues are filed and tracked in the bug and feature trackers at 12214 http://rtspspec.sourceforge.net. Open issues are discussed on MMUSIC 12215 list (mmusic@ietf.org). 12217 Note to RFC-editor: Please remove this section before publication of 12218 this document as an RFC. 12220 Appendix J. Changes 12222 This appendix briefly lists the differences between RTSP 1.0 12223 [RFC2326] and RTSP 2.0 for an informational purpose. For 12224 implementers of RTSP 2.0 it is recommended to read carefully through 12225 this memo and not to rely on the list of changes below to adapt from 12226 RTSP 1.0 to RTSP 2.0, as RTSP 2.0 is not intended to be backwards 12227 compatible with RTSP 1.0 [RFC2326] other than the version negotiation 12228 mechanism. 12230 J.1. Brief Overview 12232 The following protocol elements were removed in RTSP 2.0 compared to 12233 RTSP 1.0: 12235 o there is no section on minimal implementation anymore, but more 12236 the definition of RTSP 2.0 core; 12238 o the RECORD and ANNOUNCE methods and all related functionality 12239 (including 201 (Created) and 250 (Low On Storage Space) status 12240 codes); 12242 o the use of UDP for RTSP message transport was removed due to 12243 missing interest and to broken specification; 12245 o the use of PLAY method for keep-alive in Play state. 12247 The following protocol elements were added or changed in RTSP 2.0 12248 compared to RTSP 1.0: 12250 o RTSP session TEARDOWN from the server to the client; 12252 o IPv6 support; 12254 o extended IANA registries (e.g., transport headers parameters, 12255 transport-protocol, profile, lower-transport, and mode); 12257 o request pipelining for quick session start-up; 12259 o fully reworked state-machine; 12261 o RTSP messages now uses URIs rather then URLs; 12263 o incorporated much of related HTTP text ([RFC2616]) in this memo, 12264 compared to just referencing the sections in HTTP, to avoid 12265 ambiguities; 12267 o the REDIRECT method was expanded and diversified for different 12268 situations; 12270 o Includes a new section about how to setup different media 12271 transport alternatives and their profiles, and lower layer 12272 protocols. This resulted that the appendix on RTP interaction was 12273 moved there instead in the part describing RTP. The section also 12274 includes guidelines what to consider when writing usage guidelines 12275 for new protocols and profiles; 12277 o added an asynchronous notification method PLAY_NOTIFY. This 12278 method is used by the RTSP server to asynchronously notify clients 12279 about session changes while in Play state. To a limited extend 12280 this is comparable with some implementations of ANNOUNCE in RTSP 12281 1.0 not intended for Recording. 12283 J.2. Detailed List of Changes 12285 Compared to RTSP 1.0 (RFC 2326), the below changes has been made when 12286 defining RTSP 2.0. Note that this list does not reflect minor 12287 changes in wording or correction of typographical errors. 12289 o The section on minimal implementation was deleted without 12290 substitution. 12292 o The Transport header has been changed in the following way: 12294 * The ABNF has been changed to define that extensions are 12295 possible, and that unknown extension parameters are to be 12296 ignored. 12298 * To prevent backwards compatibility issues, any extension or new 12299 parameter requires the usage of a feature-tag combined with the 12300 Require header. 12302 * Syntax unclarities with the Mode parameter has been resolved. 12304 * Syntax error with ";" for multicast and unicast has been 12305 resolved. 12307 * Two new addressing parameters has been defined, src_addr and 12308 dest_addr. These replaces the parameters "port", 12309 "client_port", "server_port", "destination", "source". 12311 * Support for IPv6 explicit addresses in all address fields has 12312 been included. 12314 * To handle URI definitions that contain ";" or "," a quoted URI 12315 format has been introduced and is required. 12317 * Defined IANA registries for the transport headers parameters, 12318 transport-protocol, profile, lower-transport, and mode. 12320 * The transport headers interleaved parameter's text was made 12321 more strict and use formal requirements levels. It was also 12322 clarified that the interleaved channels are symmetric and that 12323 it is the server that sets the channel numbers. 12325 * It has been clarified that the client can't request of the 12326 server to use a certain RTP SSRC, using a request with the 12327 transport parameter SSRC. 12329 * Syntax definition for SSRC has been clarified to require 8HEX. 12330 It has also been extended to allow multiple values for clients 12331 supporting this version. 12333 * Clarified the text on the transport headers "dest_addr" 12334 parameters regarding what security precautions the server is 12335 required to perform. 12337 o The Range formats has been changed in the following way: 12339 * The NPT format has been given a initial NPT identifier that 12340 must now be used. 12342 * All formats now support initial open ended formats of type 12343 "npt=-10" and also format only "Range: smpte" ranges for usage 12344 with GET_PARAMETER requests. 12346 o RTSP message handling has been changed in the following way: 12348 * RTSP messages now uses URIs rather then URLs. 12350 * It has been clarified that a 4xx message due to missing CSeq 12351 header shall be returned without a CSeq header. 12353 * The 300 (Multiple Choices) response code has been removed. 12355 * Rules for how to handle timing out RTSP messages has been 12356 added. 12358 * Extended Pipelining rules allowing for quick session startup. 12360 o The HTTP references has been updated to RFC 2616 and RFC 2617. 12361 Most of text has been copied and then altered to fit RTSP into 12362 this specification. Public, and the Content-Base header has also 12363 been imported from RFC 2068 so that they are defined in the RTSP 12364 specification. Known effects on RTSP due to HTTP clarifications: 12366 * Content-Encoding header can include encoding of type 12367 "identity". 12369 o The state machine section has completely been rewritten. It 12370 includes now more details and are also more clear about the model 12371 used. 12373 o A IANA section has been included with contains a number of 12374 registries and their rules. This will allow us to use IANA to 12375 keep track of RTSP extensions. 12377 o The transport of RTSP messages has seen the following changes: 12379 * The use of UDP for RTSP message transport has been deprecated 12380 due to missing interest and to broken specification. 12382 * The rules for how TCP connections is to be handled has been 12383 clarified. Now it is made clear that servers should not close 12384 the TCP connection unless they have been unused for significant 12385 time. 12387 * Strong recommendations why server and clients should use 12388 persistent connections has also been added. 12390 * There is now a requirement on the servers to handle non- 12391 persistent connections as this provides fault tolerance. 12393 * Added wording on the usage of Connection:Close for RTSP. 12395 * specified usage of TLS for RTSP messages, including a scheme to 12396 approve a proxies TLS connection to the next hop. 12398 o The following header related changes have been made: 12400 * Accept-Ranges response header is added. This header clarifies 12401 which range formats that can be used for a resource. 12403 * Fixed the missing definitions for the Cache-Control header. 12404 Also added to the syntax definition the missing delta-seconds 12405 for max-stale and min-fresh parameters. 12407 * Put requirement on CSeq header that the value is increased by 12408 one for each new RTSP request. A Recommendation to start at 0 12409 has also been added. 12411 * Added requirement that the Date header must be used for all 12412 messages with message body and the Server should always include 12413 it. 12415 * Removed possibility of using Range header with Scale header to 12416 indicate when it is to be activated, since it can't work as 12417 defined. Also added rule that lack of Scale header in response 12418 indicates lack of support for the header. Feature-tags for 12419 scaled playback has been defined. 12421 * The Speed header must now be responded to indicate support and 12422 the actual speed going to be used. A feature-tag is defined. 12423 Notes on congestion control was also added. 12425 * The Supported header was borrowed from SIP [RFC3261] to help 12426 with the feature negotiation in RTSP. 12428 * Clarified that the Timestamp header can be used to resolve 12429 retransmission ambiguities. 12431 * The Session header text has been expanded with a explanation on 12432 keep alive and which methods to use. SET_PARAMETER is now 12433 recommended to use if only keep-alive within RTSP is desired. 12435 * It has been clarified how the Range header formats is used to 12436 indicate pause points in the PAUSE response. 12438 * Clarified that RTP-Info URIs that are relative, use the 12439 Request-URI as base URI. Also clarified that the used URI must 12440 be the one that was used in the SETUP request. The URIs are 12441 now also required to be quoted. The header also expresses the 12442 SSRC for the provided RTP timestamp and sequence number values. 12444 * Added text that requires the Range to always be present in PLAY 12445 responses. Clarified what should be sent in case of live 12446 streams. 12448 * The headers table has been updated using a structured borrowed 12449 from SIP. Those tables carries much more information and 12450 should provide a good overview of the available headers. 12452 * It has been clarified that any message with a message body is 12453 required to have a Content-Length header. This was the case in 12454 RFC 2326, but could be misinterpreted. 12456 * ETag has changed name to MTag. 12458 * To resolve functionality around MTag. The MTag and If-None- 12459 Match header has been added from HTTP with necessary 12460 clarification in regards to RTSP operation. 12462 * Imported the Public header from HTTP RFC 2068 [RFC2068] since 12463 it has been removed from HTTP due to lack of use. Public is 12464 used quite frequently in RTSP. 12466 * Clarified rules for populating the Public header so that it is 12467 an intersection of the capabilities of all the RTSP agents in a 12468 chain. 12470 * Added the Media-Range header for listing the current 12471 availability of the media range. 12473 * Added the Notify-Reason header for giving the reason when 12474 sending PLAY_NOTIFY requests. 12476 * A new header Seek-Style has been defined to direct and inform 12477 how any seek operation should/have been performed. 12479 o The Protocol Syntax has been changed in the following way: 12481 * All ABNF definitions are updated according to the rules defined 12482 in RFC 5234 [RFC5234] and has been gathered in a separate 12483 Section 20. 12485 * The ABNF for the User-Agent and Server headers has been 12486 corrected. 12488 * Some definitions in the introduction regarding the RTSP session 12489 has been changed. 12491 * The protocol has been made fully IPv6 capable. 12493 * Added a fragment part to the RTSP URI. This seem to be 12494 indicated by the note below the definition, however, it was not 12495 part of the ABNF. 12497 * The CHAR rule has been changed to exclude NULL. 12499 o The Status codes have been changed in the following way: 12501 * The use of status code 303 "See Other" has been deprecated as 12502 it does not make sense to use in RTSP. 12504 * When sending response 451 and 458 the response body should 12505 contain the offending parameters. 12507 * Clarification on when a 3rr redirect status code can be 12508 received has been added. This includes receiving 3rr as a 12509 result of request within a established session. This provides 12510 clarification to a previous unspecified behavior. 12512 * Removed the 201 (Created) and 250 (Low On Storage Space) status 12513 codes as they are only relevant to recording, which is 12514 deprecated. 12516 * Several new Status codes has been defined: 464 "Data Transport 12517 Not Ready Yet", 465 "Notification Reason Unknown", 470 12518 "Connection Authorization Required", 471 "Connection 12519 Credentials not accepted", 472 "Failure to establish secure 12520 connection". 12522 o The following functionality has been deprecated from the protocol: 12524 * The use of Queued Play. 12526 * The use of PLAY method for keep-alive in Play state. 12528 * The RECORD and ANNOUNCE methods and all related functionality. 12529 Some of the syntax has been removed. 12531 * The possibility to use timed execution of methods with the time 12532 parameter in the Range header. 12534 * The description on how rtspu works is not part of the core 12535 specification and will require external description. Only that 12536 it exist is defined here and some requirements for the 12537 transport is provided. 12539 o The following changes has been made in relation to methods: 12541 * The OPTIONS method has been clarified with regards to the use 12542 of the Public and Allow headers. 12544 * Added text clarifying the usage of SET_PARAMETER for keep-alive 12545 and usage without any body. 12547 * PLAY method is now allowed to be pipelined with the pipelining 12548 of one or more SETUP requests following the initial that 12549 generates the session for aggregated control. 12551 * REDIRECT has been expanded and diversified for different 12552 situations. 12554 * Added a new method PLAY_NOTIFY. This method is used by the 12555 RTSP server to asynchronously notify clients about session 12556 changes. 12558 o Wrote a new section about how to setup different media transport 12559 alternatives and their profiles, and lower layer protocols. This 12560 resulted that the appendix on RTP interaction was moved there 12561 instead in the part describing RTP. The section also includes 12562 guidelines what to consider when writing usage guidelines for new 12563 protocols and profiles. 12565 o Setup and usage of independent TCP connections for transport of 12566 RTP has been specified. 12568 o Added a new section describing the available mechanisms to 12569 determine if functionality is supported, called "Capability 12570 Handling". Renamed option-tags to feature-tags. 12572 o Added a contributors section with people who have contributed 12573 actual text to the specification. 12575 o Added a section Use Cases that describes the major use cases for 12576 RTSP. 12578 o Clarified the usage of a=range and how to indicate live content 12579 that are not seekable with this header. 12581 o Text specifying the special behavior of PLAY for live content. 12583 Appendix K. Acknowledgements 12585 This memorandum defines RTSP version 2.0 which is a revision of the 12586 Proposed Standard RTSP version 1.0 which is defined in [RFC2326]. 12587 The authors of RFC 2326 are Henning Schulzrinne, Anup Rao, and Robert 12588 Lanphier. 12590 Both RTSP version 1.0 and RTSP version 2.0 borrow format and 12591 descriptions from HTTP/1.1. 12593 This document has benefited greatly from the comments of all those 12594 participating in the MMUSIC-WG. In addition to those already 12595 mentioned, the following individuals have contributed to this 12596 specification: 12598 Rahul Agarwal, Jeff Ayars, Milko Boic, Torsten Braun, Brent Browning, 12599 Bruce Butterfield, Steve Casner, Francisco Cortes, Kelly Djahandari, 12600 Martin Dunsmuir, Eric Fleischman, Jay Geagan, Andy Grignon, V. 12601 Guruprasad, Peter Haight, Mark Handley, Brad Hefta-Gaub, Volker Hilt, 12602 John K. Ho, Go Hori, Philipp Hoschka, Anne Jones, Ingemar Johansson, 12603 Anders Klemets, Ruth Lang, Stephanie Leif, Jonathan Lennox, Eduardo 12604 F. Llach, Thomas Marshall, Rob McCool, David Oran, Joerg Ott, Maria 12605 Papadopouli, Sujal Patel, Ema Patki, Alagu Periyannan, Colin Perkins, 12606 Igor Plotnikov, Jonathan Sergent, Pinaki Shah, David Singer, Lior 12607 Sion, Jeff Smith, Alexander Sokolsky, Dale Stammen, John Francis 12608 Stracke, Maureen Chesire, David Walker, Geetha Srikantan, Stephan 12609 Wenger, Pekka Pessi, Jae-Hwan Kim, Holger Schmidt, Stephen Farrell, 12610 Xavier Marjou, Joe Pallas, Martti Mela, Byungjo Yoon and Patrick 12611 Hoffman. 12613 K.1. Contributors 12615 The following people have made written contributions that were 12616 included in the specification: 12618 o Tom Marshall contributed text on the usage of 3rr status codes. 12620 o Thomas Zheng contributed text on the usage of the Range in PLAY 12621 responses and proposed an earlier version of the PLAY_NOTIFY 12622 method. 12624 o Sean Sheedy contributed text on the timeout behavior of RTSP 12625 messages and connections, the 463 status code, and proposed an 12626 earlier version of the PLAY_NOTIFY method. 12628 o Greg Sherwood proposed an earlier version of the PLAY_NOTIFY 12629 method. 12631 o Fredrik Lindholm contributed text about the RTSP security 12632 framework. 12634 o John Lazzaro contributed the text for RTP over Independent TCP. 12636 o Aravind Narasimhan contributed by rewriting Media Transport 12637 Alternatives (Appendix C) and editorial improvements on a number 12638 of places in the specification. 12640 o Torbjorn Einarsson has done some editorial approvements of the 12641 text. 12643 Appendix L. RFC Editor Consideration 12645 Please replace RFC XXXX with the RFC number this specification 12646 receives. 12648 Authors' Addresses 12650 Henning Schulzrinne 12651 Columbia University 12652 1214 Amsterdam Avenue 12653 New York, NY 10027 12654 USA 12656 Email: schulzrinne@cs.columbia.edu 12658 Anup Rao 12659 Cisco 12660 USA 12662 Email: anrao@cisco.com 12664 Rob Lanphier 12665 Seattle, WA 12666 USA 12668 Email: robla@robla.net 12670 Magnus Westerlund 12671 Ericsson AB 12672 Faeroegatan 6 12673 STOCKHOLM, SE-164 80 12674 SWEDEN 12676 Email: magnus.westerlund@ericsson.com 12678 Martin Stiemerling 12679 NEC Laboratories Europe, NEC Europe Ltd. 12680 Kurfuersten-Anlage 36 12681 Heidelberg 69115 12682 Germany 12684 Phone: +49 (0) 6221 4342 113 12685 Email: stiemerling@nw.neclab.eu