何謂 SDP ( Session Description Protocol )?

  • 簡單的來說, SDP[1] 就是用來定義 internet 上, 如何描述一個 session 的 protocol. 它可以被用來通知一個 session 的存在, 讓使用者能 join 一個 session, 或是讓使用者得知某個即將開啟的 session 的相關資訊.

    首先, 我們先說明什麼叫 session. 一個存在於 internet 上的 session, 包含了所有往來於 sender 和 receiver 端的 data stream, 無論是單純的資料, 或是控制資訊. 為了描述網路上的 session, 所以定出了一個 protocol, 就是 SDP.

    在哪些地方可能會使用到 SDP 這種 protocol 呢? 我們可以這麼說, 凡是跟 session 有關係的用途, 都可以利用 SDP. 好比說, video conference, 這篇論文所要實作的 RTSP service, real audio, etc.

    至於, SDP 又要如何使用呢? 因為 SDP 是一種單純只有文字內容的 protocol, 所以我們可以利用 email 通知想加入的使用者, 使用者只要在 MIME type 裡加入 "application-sdp" 後, 讓它跟能處理 SDP 內容的程式發生關聯, 那一旦使用者讀到這個包含有 SDP 資訊的 email, 就會自動啟動程式, join 指定的 session. 而在 Web 上, 我們只需在 server 端放一個 *.sdp 的 file, 同樣的, 使用者必需先將 *.sdp 的 MIME type 設定好, 如此一來, 就能透過外部程式, 對 SDP file 中指定的 session 做處理.


  • SDP 包含的資訊有很多種, 列舉如下:

    首先是和 session 相關的:

  1. Session name and purpose -- session 的名稱及目的
  2. Times the session is active -- session 開始的時間 (for conference)
  3. The media comprising the session
  4. Information to receive those media -- 跟 session 相關的資料, 比如 address, ports, formats 等等.
  5. Information about the bandwidth to be used by the conference -- 可用以限制 session 耗用的流量
  6. Contact information for the person responsible for the session -- 跟 session 的負責人聯絡的資訊
    和 media 相關的:
  1. The type of media -- video, audio, 或是 white board
  2. The transport protocol -- RTP/UDP/IP, H.320, etc.
  3. The format of the media -- H.261 video, MPEG video, etc.
    和 IP multicast 以及 unicast 有關的:
  1. Multicast address and transport port for media
  2. Contact address and transport port for media
    除了上述這些 information 之外, SDP 還可根據需求, 定義所謂的 private session. private session 要有 encryption keys 才能 join, 而 SDP 可以直接將這些 keys 包含在裡面, 由 email 的方式, 送到想加入的 client 端.

    另外, session 除了有開始時間之外, 也許是在某段時間之內才 active. SDP 的時間表示法也能夠表示此種特定時間. 它可以指定開始以及結束時間, 甚至還能指定這個 session 會在某個時段內 repeat, 好比說 "每個星期二的早上10:00".


  •     SDP 是一種純文字的 protocol, 它的好處是可以很方便的用一些 shell script language 來做處理, 無論是要產生或是解譯它, 並且只需要文書處理軟體就能夠修改它的內容, 而且, 也方便用 email 的方式傳遞它.

SDP參數的含義說明:

 

(其中加“*”的爲可選項,不加的爲必選項)

 

Session description(會話描述)

        v=  (protocol version)(協議版本)

        o=  (owner/creator and session identifier)(發起者和會話ID)

        s=  (session name)(會話名)

        i=* (sessioninformation)(會話信息)

        u=* (URI ofdescription)(會話URI)

        e=* (email address)(Email地址)

        p=* (phone number)(電話號碼)

        c=* (connectioninformation - not required if included in all media)(連接狀態;不要求在每個媒體行裏都出現)

        b=* (bandwidthinformation)(帶寬信息)

        z=* (time zoneadjustments)(時區校正)

        k=* (encryption key)(加密密鑰)

        a=* (zero or moresession attribute lines)(屬性行)

 

Time description(時間描述)

        t=  (time the session is active)(會話保持激活狀態的時間)

        r=* (zero or morerepeat times)(重複次數)

 

Media description(媒體描述)

        m=  (media name and transport address)(媒體和傳輸)

        i=* (media title)(媒體標題)

        c=* (connectioninformation - optional if included at session-level)(連接信息)

        b=* (bandwidthinformation)(帶寬信息)

        k=* (encryption key)(加密密鑰)

        a=* (zero or more media attributelines)(媒體屬性)
轉自:http://dslab.ee.ncku.edu.tw/~lily/learning/learning_ch2-2.html

發佈了29 篇原創文章 · 獲贊 5 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章