VoIP常见编码的带宽计算

voip带宽计算VOIP计算方法与所选用的编码方法有关,而与哪个厂家的没有什么关系,公式如下:

带宽=包长度×每秒包数
=包长度×(1/打包周期)
=(Ethernet头+IP头+UDP头+RTP头+有效载荷)×(1/打包周期)
=(208bit +160bit+64bit+96bit +有效载荷)×(1/打包周期)
=(528bit+(打包周期(秒)×每秒的比特数))×(1/打包周期)
=( 528 / 打包周期 ) + 每秒比特数

根据各种编码方式,得出:

G711:20ms打包,带宽为 ( 528/20 + 64) Kbit/s=90.4 Kbit/s
G729:20ms打包,带宽为 ( 528/20 + 8 ) Kbit/s= 34.4 Kbit/s
G723:5.3k,30ms打包,带宽为 ( 528/30 + 5.3 ) Kbit/s=22.9 Kbit/s
业界一般按照下表提供的IP网带宽系数和以太网带宽系数来设计网络带宽:
编解码技术        压缩速率(Kbps)        打包周期(ms)        IP网带宽系数        以太网带宽系数
G.711 a/u           64                     20                  1.25                      1.41
G.729 a/b           8                      20                  0.38                      0.54
G.723.1(5.3kbit/s)  5.3                    30                  0.27                      0.37
G.723.1(6.3Kbit/s)  6.3                    30                  0.25                      0.36
H.263(384Kbit/s)    ≈384                  10                   6                         6.2
    备注:采用某种编码方式时,用64K乘以相应的带宽系数就可以得出其实际占用的带宽。当然如果是中继接口,还需要考虑信令占据一定的带宽,一般按照2.5%来计算。

举例:

    PBX--E1--Router---IP----Router---E1---PBX

    这里的带宽占用分为2个部分,1是与PBX连接的POTS部分,1是路由器之间的VOIP部分。一般来说,每路模拟线路的带宽占用是64Kbps,而IP语音的占用会因不同的编码标准有所不同,从8K到80K可供选择。QoS的保证有个要求,就是延迟<=150ms,抖动<=30ms,丢包率<=1%

 

SPEEX 带宽

We have finally almost finished Speex coding on AR1688 DSP. This open source voice codec turned out to be much more complicated than we expected. There are 8 different bitrate with 8k sampling from 2.15kpbs to 24.6kpbs. I am writing this article to answer a question of how much bandwidth this codec actually use during a call.

Let us calculate based on 802.3 ethernet using SIP protocol:

Ethernet CRC: 4 bytes
MAC header: 14 bytes
IP header: 20 bytes
UDP header: 8 bytes
RTP header: 12 bytes


Speex data: x bytes x depends on bitrate used and number of frames packed in an ethernet packet ("Voice frames per TX" option in AR1688)

Total: (58 + x) bytes

Speex uses 20ms as a frame the size of compressed data in a frame with different bitrate are:

2.15kbps: 6 bytes
3.95kbps: 10 bytes
5.95kbps: 15 bytes
8kbps: 20 bytes
11kbps: 28 bytes
15kbps: 38 bytes
18.2kbps: 46 bytes
24.6kbps: 62 bytes

When only 1 frame is included in an ethernet frame the actually used bandwidth are: 

2.15k: 25.6k
3.95k: 27.2k
5.95k: 29.2k
8k: 31.2k
11k: 34.4k
15k: 38.4k
18.2k: 41.6k
24.6k: 48k

When 2 frames are included in an ethernet frame the actually used bandwidth are:

2.15k: 14k
3.95k: 15.6k
5.95k: 17.6k
8k: 19.6k
11k: 22.8k
15k: 26.8k
18.2k: 30k
24.6k: 36.4k

When 3 frames are included in an ethernet frame the actually used bandwidth are:

2.15k: 10.1k
3.95k: 11.7k
5.95k: 13.7k
8k: 15.7k
11k: 18.9k
15k: 22.9k
18.2k: 26.1k
24.6k: 32.5k

When 4 frames are included in an ethernet frame the actually used bandwidth are:

2.15k: 8.2k
3.95k: 9.8k
5.95k: 11.8k
8k: 13.8k
11k: 17k
15k: 21k
18.2k: 24.2k
24.6k: 30.6k

 

Speex 带宽计算方法

计算公式:(  网络包数据  +  数据包数据  )  /  采样时间 

网络包数据 :  58 bytes

 由以下五个部分组成

网络 CRC: 4 bytes
2mac 地址: 14 bytes
3IP 头: 20 bytes
4UDP 头: 8 bytes
5RTP 头: 12 bytes

数据包数据: 20bytes  

采样时间:20ms 

如果每个rtp包只传输1个数据包:

58 +20*8 /20*1000 = 31.2kb/s

如果每个rtp包只传输2个数据包:

58 +40*8 /40*1000 = 19.6 kb/s

如果每个rtp包只传输3个数据包:

58 +60*8 /60*1000 = 15.7 kb/s

如果每个rtp包只传输4个数据包:

58 +80*8 /80*1000 = 13.8 kb/s

你可能感兴趣的