In terms of voice, how does one calculate the bandwidth consumed by codec?
By default, after the analog voice is converted to a digital voice, it is cut in 20 ms segments for 20 ms segments, encapsulated with rtp, and then wrapped with udp header, ip header, finally, the packet header of layer 2 is sent out.
Suppose we use g.729 encoding and transmit it over ethernet. Calculate the bandwidth required for a single voice.
G.729 each voice is 8 kbit/s, then the conversion starts> 8 kbps x 1000 = 8000bps
1000 bps/8 = 1000 bytes/s, get g.729 bandwidth bytes per second
By default, No 20 ms of voice is encapsulated into a packet, so you can calculate the number of packages sent within one period.
1 s/20 ms = 50
That is to say, g.729 requires a bandwidth
1000 bytes/s/50 = 20 bytes/s
Next, the Ethernet frame header is 6-byte, the ip packet header is 20-byte, The udp packet header is 8-byte, And the rtp packet header is 12-byte.
In this way, the payload of g.729 is 20 bytes.
That is to say, a 6 + 20 + 8 + 12 + 20 = 66-byte frame is generated every 20 ms.
Then 50 66-byte will be sent in one second, which is equal to 3300-byte and converted to kbit/s.
3300 byte/s * 8/1000 = 26.4 kbit/s
It is concluded that the bandwidth occupied by g.729 voice includes layer2 header) is 26.4 kbps.