[asterisk-users] G729 License to Bridge calls through VOIP provider?

Erik erik at infopact.nl
Tue Jul 25 23:19:11 MST 2006


Marco Mouta wrote:

> By the way could any one tell me wich is the Bandwith with IP over
> head for this codec. about 8kb/s?
> 
Let's do some calculations on that:

g729a 20ms results in 20 bytes RTP payload in each packet, in order to traverse the OSI model there's some headers that need to be added,
as RTP gets an RTP header, the RTP packet gets an UDP header and the UDP datagram gets an IP header:
So add a 12 byte RTP header, 8 byte UDP header and a 20 Byte IP header

This results in:
20 byte RTP payload + 12 byte RTP header + 8 byte UDP header + 20 byte IP header=60 byte on the ip layer.
Thats a 40 byte overhead (so 2/3 of the packet is just headers :) and were still only on the IP layer now)

So to transmit just 1 RTP packet you are actualy transmitting 60 bytes on the IP layer, so in order to get the real used bandwidth we
need to knowhow many packets we are sending and on which medium (DSL/ethernet/slip/smokesignals):

20 ms results in 50 packets/s so: 50 packet/s *60 bytes/packet=3000 bytes/s
that's 300*8=24000 bit/s total bandwidth on the IP layer so the overhead is 24000-8000=16000 bit/s.

The fun starts if you are going to send this over DSL, let's continue the calculation:

50 packets of 60 byte IP, add the 2 byte PPPoA header for DSL= 62 bytes per packet.
However, DSL operates with 53 bytes ATM cells, in which you can fit 48 bytes payload (and a 5 byte header) so in order to transmit the 62 bytes of 
data you need: 62/48=2 ATM cells.

Why 2 cells you say? Because ATM can't utilize the unused part of cells, so to transmit 62 bytes you use the same amount of bandwith (on dsl) as you
would use to transmit 96 (48*2) bytes.

So 1 RTP packet uses 96 bytes on the DSL line, as you already know we have 50 packets/s so that's 50 packets/s*2 cells=100 Cells/s
100 cells/s * 53 byte = 53000 bytes/s on the DSL line thats 424000 bits/s to transmit a 8 kbit/s stream :)

So the total overhead is 424000-8000=416000 bit/s overhead.


If you would use G723 with a 10 ms frequency it gets even worse :)
G723 on 10 ms produces 8 byte RTP payload per packet, so with headers that's 48 bytes on the IP layer, but now were sending 100 packets/s
so: 48*100=4800 bytes/s --> 38400 bit/s on the ip layer
On DSL this would result in 50 byte packets (pppoa header) with won't fit in 1 cell, so you would use 2 cells for each IP packet.
100 packets/s * 2 cells = 200 cells/s
that's 200 cells * 53 bytes/cell = 10600 bytes/s on the DSL line
10600*8=84800 bit/s to transmit a 6400 bit/s stream --> 78400 bit/s overhead

If you would use G723 with 20 ms (16 byte RTP payload) you only have 42400 at the DSL layer, so by adjusting the sample frequency you could cut the
overhead in half :)


Erik Versaevel



More information about the asterisk-users mailing list