RTSP 協定分析
1.概述:
RTSP(Real Time Streaming Protocol),實時流傳輸協定,是TCP/IP協定體系中的一個應用層協定,由哥倫比亞大學、網景和RealNetworks公司送出的IETF RFC标準。該協定定義了一對多應用程式如何有效地通過IP網絡傳送多媒體資料。類似HTTP協定的流控制協定。它們都使用純文字來發送資訊,而且rtsp協定的文法也和HTTP類似,和HTTP協定相比RTSP協定所不同的地方是,RTSP協定是有狀态的協定,而HTTP是無狀态的協定。RTSP通過維護一個session來維護其狀态的轉換。RTSP協定的預設端口是554,預設的承載協定為TCP。
2.RTSP的特性:
(1).流控分離:從控制邏輯上來說RTSP和FTP相似,控制流和資料流是分開的。
(2).可擴充性:因為RTSP協定是基于文本的協定是以其具有較強的可擴充性。
(3).安全:RTSP 使用網頁安全機制。
3.RTSP 協定格式:
請求指令的格式為:
METHOD URL CR LF
Field1:value CR LF
Field2:value CR LF
......
Fieldn:value CR LF
CR LF
應答的格式為:
RTSP/major_version.minor_version status CR LF
4.RTSP的主要指令:

5.RTSP指令的狀态轉換表
6.RTSP狀态碼
Status-Code = "100" ; Continue
| "200" ; OK
| "201" ; Created
| "250" ; Low on Storage Space
| "300" ; Multiple Choices
| "301" ; Moved Permanently
| "302" ; Moved Temporarily
| "303" ; See Other
| "304" ; Not Modified
| "305" ; Use Proxy
| "400" ; Bad Request
| "401" ; Unauthorized
| "402" ; Payment Required
| "403" ; Forbidden
| "404" ; Not Found
| "405" ; Method Not Allowed
| "406" ; Not Acceptable
| "407" ; Proxy Authentication Required
| "408" ; Request Time-out
| "410" ; Gone
| "411" ; Length Required
| "412" ; Precondition Failed
| "413" ; Request Entity Too Large
| "414" ; Request-URI Too Large
| "415" ; Unsupported Media Type
| "451" ; Parameter Not Understood
| "452" ; Conference Not Found
| "453" ; Not Enough Bandwidth
| "454" ; Session Not Found
| "455" ; Method Not Valid in This State
| "456" ; Header Field Not Valid for Resource
| "457" ; Invalid Range
| "458" ; Parameter Is Read-Only
| "459" ; Aggregate operation not allowed
| "460" ; Only aggregate operation allowed
| "461" ; Unsupported transport
| "462" ; Destination unreachable
| "500" ; Internal Server Error
| "501" ; Not Implemented
| "502" ; Bad Gateway
| "503" ; Service Unavailable
| "504" ; Gateway Time-out
| "505" ; RTSP Version not supported
| "551" ; Option not supported
| extension-code
extension-code = 3DIGIT
Reason-Phrase = *<TEXT, excluding CR, LF
<下一篇将給出RTSP協定的執行個體分析>