RTSP 協議分析

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
Field1:value CR LF
Field2:value CR LF
......
Fieldn:value CR LF
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

轉自:http://www.cnblogs.com/qingquan/archive/2011/07/14/2106834.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章