計算機網路_CH8

26 April 2020

計算機網路 Chapter 9-2

Real-Time protocol

  • standard of real time application,規定封包格式,方便兩個VoIP的application能溝通,跑在UDP或tcp上(application layer)
  • audio chunk -> RTP packet -> UDP/TCP packet

  • 這個protocol沒保證data delivry, QoS, prevent out of order packet(但有RTP裡有sequence number能偵測packet loss)
  • 可以unicast, multicast
  • 不同source可以有不同stream,舉例而言,影片可以有兩個stream分別傳:圖片+聲音,但有些encode方式會將兩者合起來,那就會變成一個stream,不同stream傳輸如圖片+聲音的同步(影片中圖片對應到聲音,可以有多種sync方式,後面詳細敘述)

Packet Header

  • payload type : 規範audio type的encoding
  • sequence number : 用來detect packet loss或
  • timestamp : 用來處理jitter(sampling instance of the audio),也可以用來sync intra-media的播放(如影片的圖片+音樂的播放)
  • SSRC : RTP stream的Identity
  • M bit: 判斷streaming或VoIP的的傳輸的end為何,如果packet的M bit=1,代表傳輸到終點,收完所有的video data可以做decoding

M bit

如上圖,基本上就是表示一個傳輸的event的結束或開始。
如果用於VoIP(雙向傳輸),則m=1則代表一方說話的開始,接著silence時packet的data就很少或沒有,然後下次說話在把m=1,這樣接收方就知道對方說話的packet從哪個開始,方便decode
如果用於streaming(單向較為頻繁),則會先傳遞data,到m=1時的packet代表傳輸結束,此時接收方就知道他收到完整的video data可以做decode了

RTCP(Real-Time control protocol)

  1. 和RTP合作,跑在不同的port
  2. RTP session的participant送資訊給其他participant
  3. 回傳有用的資訊(收到多少packet,多少packet loss)給其他人
  4. sender根據收到的資訊來決定傳送rate調整
  5. 若session人很多會減少RTCP packet傳輸頻率,盡量不讓RTCP佔據太多頻寬
  6. receiver會算一下RTCP允許的頻寬跟RTCP封包大小決定傳送頻率

Packet type

receiver report packet

packet loss, jitter的狀況

sender report packet

number of packet sent, number of byte sent current time, RTP stream ID, timestamp when packet is generated, timestamp of RTP packet(sampling clock)

Source description packet

sender資訊(email…), mapping(SSRC -> user)

Media Synchronization

QoS

針對不同流量、使用者應有不同的priority,像影片、等等傳輸要有較高的priority,不然會產生jitter、delay QoS愈高, jitter, delay狀況越少

https://www.digitimes.com.tw/tech/dt/n/shwnws.asp?cnlid=10&id=0000101264_M1U1RMZ87ZZ8UF33UGK4L