Voip codecs and bandwidth calculation.

So today I have spent some time reading up on voip codecs, and how to calculate bandwidth requirements for a single call with a certain codec.

Take for example. G.711 (PCM), which is uncompressed voice data. Its specification says 64kbps raw data output from the codec. We want to use a packetization period of 20ms. That means two digital voice samples pr. voip packet.

Calculation: ( 64000 * ( 20/1000 ) )/8 = 160 bytes in our voip packet.

To that we need to add extra header (40 byte for IP/UDP/RTP). = 200 bytes in our voip packet.

And to that, we need to add datalink headers (18 for Ethernet, 22 for Dot1Q, 6 for Frame Relay and PPP ). If any security protocols are used, we need to add their header into it as well.

So, for ethernet, thats 218 bytes pr. voip packet. We need to multiple that by the pps (which is 1/packetization period), so 1/0.020 = 50 pps.

Total bandwidth used: 50 * ( 218*8 ) = 87200 bits/pr. second = 87.2 kbps.

Quite confusing, but with more examples, hopefully it will stick. I have also been getting a better grip on some of the terms used in the voice world, but I am by no means there yet. More on this later.

For now, I will take care of my sprained ancle. Stupid running 🙂