1 / 18

RTP/RTCP 协议介绍

RTP/RTCP 协议介绍. RTP 介绍. Real-Time Transport Protocol (实时传输协议) RTP 的设计主要是为了多媒体多方会议的需要 提供端对端的实时数据传输服务, RTP 使用的传输层协议一般为 UDP 。 不提供机制确保数据的间隔发送 不提供机制保证 QoS. RTCP 介绍. Real-Time Transport Control Protocol (实时传输控制协议) 监控 RTP 的服务质量和网络拥塞程度 收集在一个 RTP 会话中参与者的状态 跟踪 RTP 源(同步音频视频流, SSRC 有可能变化).

Download Presentation

RTP/RTCP 协议介绍

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RTP/RTCP协议介绍

  2. RTP介绍 • Real-Time Transport Protocol(实时传输协议) • RTP的设计主要是为了多媒体多方会议的需要 • 提供端对端的实时数据传输服务,RTP使用的传输层协议一般为UDP。 • 不提供机制确保数据的间隔发送 • 不提供机制保证QoS

  3. RTCP介绍 • Real-Time Transport Control Protocol(实时传输控制协议) • 监控RTP的服务质量和网络拥塞程度 • 收集在一个RTP会话中参与者的状态 • 跟踪RTP源(同步音频视频流,SSRC有可能变化)

  4. RTP/RTCP的应用场景 • 简单的广播音频会议 广播地址 • 音频和视频广播会议 • 混音器(Mixer) 用于多数据源的合成和编解码的转换 • 转换器(Translator) 用于实时数据的防火墙穿透和跨网中继

  5. RTP消息格式 0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P|X| CC |M| PT | sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | synchronization source (SSRC) identifier | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | contributing source (CSRC) identifiers | | .... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ V: Version P: Padding X: Header Extension CC: CSRC count M: Marker PT: Payload Type

  6. 实际的RTP消息

  7. RTP Profile • RTP被设计成通用的实时传输协议,对特定应用的支持需要Profile和Payload RFC来定义,如 RFC 3551: RTP Profile for Audio and Video Conferences RFC 3016: RTP Payload Format for MPEG-4 Audio-Visual Streams

  8. RTP Profile • Profile对RTP包的修改: Marker Payload Type Payload Section Header Extension(与数据编解码无关的应用) Padding(数据加解密)

  9. RTCP消息的种类和组成 • SR(Sender Report) • RR(Receiver Report) • SDES(Source DEScription) • BYE • APP 在没有加密的情况下,每一个RTCP复合消 息至少由一个SR/RR加上一个包含了CNAME的 SDES组成

  10. RTCP SR消息格式 0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ header |V=2|P| RC | PT=SR=200 | length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SSRC of sender | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ sender | NTP timestamp, most significant word | info +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NTP timestamp, least significant word | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RTP timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | sender's packet count | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | sender's octet count | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ report | SSRC_1 (SSRC of first source) | block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1 | fraction lost | cumulative number of packets lost | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | extended highest sequence number received | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | interarrival jitter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | last SR (LSR) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | delay since last SR (DLSR) | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

  11. RTCP SR消息格式 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ report | SSRC_2 (SSRC of second source) | block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2 : ... : +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | profile-specific extensions | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ RC: reception report count

  12. RTCP SDES消息格式 0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ header |V=2|P| SC | PT=SDES=202 | length | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ chunk | SSRC/CSRC_1 | 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SDES items | | ... | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ chunk | SSRC/CSRC_2 | 2 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SDES items | | ... | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ • SDES item的种类 CNAME NAME EMAIL PHONE LOC TOOL NOTE PRIV

  13. 实际的RTCP复合消息

  14. RTCP对会话参与者状态的维护 收到一个RTP包 Invalid Participant Idle 超时 收到多个连续的RTP包 一段时间内没有收到任何RTCP包 收到CNAME RTCP包 Sender 超时 收到BYE RTCP包 收到RTP包 Bye Received Valid Participant 一段时间内没有收到任何RTP包 收到BYE RTCP包

  15. RTCP发送间隔的计算 • 以固定间隔发送RTCP带来的问题 计算RTCP发送间隔的几个要素: • RTP Session带宽 • RTCP所占带宽比重(RFC建议5%) • 预先设定的会话中RTP数据发送者和接收者对RTCP带宽的分享(1:3或S:R) • 当前会话中发送者的数量 • RTCP Flood

  16. Translator • 不修改SSRC • 有可能修改数据格式 • 对RTCP包的处理:简单传递或做修改 • 相当于应用层的网关

  17. Mixer • 把来自多个Source的数据合成为一个 • 有可能修改数据格式 • 以自己的SSRC作为新的RTP包的SSRC,合成前的多个SSRC作为新RTP包的CSRC • 对RTCP包的处理 SR和RR SDES和BYE

  18. 谢 谢 !

More Related