RTP/RTCP协议的补充(RTCP发送时间间隔)

RTP/RTCP协议相对来说是一个比较简单的协议,这里补充一点关于RTP/RTCP协议的知识。说是RTP/RTCP的知 识,其实这里只补充了RTCP发送时间间隔的一些要点,建议不懂的看RFC的文档,里面有非常清楚系统的描述。我在这里只不过是当个翻译而已。
TAG:  RTCP  
 

关于RTP/RTCP协议的介绍,还是在早前的基于sip协议的Push To Talk项目中写到了少许。RTP/RTCP协议相对来说是一个比较简单的协议,这里补充一点关于RTP/RTCP协议的知识。说是RTP/RTCP的知 识,其实这里只补充了RTCP发送时间间隔的一些要点,建议不懂的看RFC的文档,里面有非常清楚系统的描述。我在这里只不过是当个翻译而已。

1.Timing Rules(即RTCP包的发送时间间隔) 
总的目标是限制RTCP占RTP会话量的一小部分,通常是5%。如果要保持这个占用数值,参与者送出RTCP packet的速率是就会随着参与会话的参与者的数量而是变化了。
计算方法是根据以下的部分:
   1).The bandwidth allocated to RTCP:(分配给RTCP包的带宽,5%通常 * Session带宽)。
   2).The average size of RTCP packets sent and received:(接受和发送的RTCP包的平均size,包括UDP,IP的头部)。 
   3).The total number of participants and the fraction of those participants who are senders :(参与会话终端的总数及这么参与者中作为发送者发送的分组数)。
   下面贴出计算演示代码,就会比较清楚了:
if (senders > 0 && senders <= (25% of total number of participants) 

     if (we are sending) 
    { 
          Interval = average RTCP size * senders / (25% of RTCP bandwidth) 
    } 
    else 
    { 
         Interval = average RTCP size * receivers / (75% of RTCP bandwidth) 
    } 

else if ((senders = 0) or (senders > (25% of total number of participants)) 
   { 
        Interval = average RTCP size * total number of members / RTCP bandwidth 

   这样可以确保Sender即使很少的情况下也可以确保25%的带宽,能够送出足够的lip synchronization信息 

   If (Interval < minimum interval) 
   { 
        Interval = minimum interval 
   } 
    当会话中的参与者的数目或者sender所占比例发生变化时,报告间隔应当重新计算. 

2.Basic Transmission Rules (基本的传输规则就是) 
    I = (Interval * random[0.5, 1.5]) 
    if (this is the first RTCP packet we are sending) { 
       I *= 0.5 
    } 
    next_rtcp_send_time = current_time + I ;
 
3.Forward Reconsideration 
当会话中同时到来大量的Participant时,造成网络拥塞(Called as "step join"),为此使用Forward Reconsideration 
方法:
在每次发送前,根据当前的会话信息重新计算发送时间, 
if (current_time >= next_rtcp_check_time) {//1.21828是一个补偿因子 
new_rtcp_send_time = (rtcp_interval() / 1.21828) + last_rtcp_send_time 
if (current_time >= new_rtcp_send_time) { 
send RTCP packet 
next_rtcp_check_time = (rtcp_interval() /1.21828) + current_time 
} else { 
next_rtcp_check_time = new_send_time 
}
}
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值