Skip to Content.
Sympa Menu

wg-voip - Codec packet sizes

List archive

Codec packet sizes


Chronological Thread 
  • From: Andrew Rutherford <>
  • To:
  • Subject: Codec packet sizes
  • Date: Thu, 25 Mar 2004 11:31:00 +1030

I got asked about this line:

Cisco-AVpair = "codec-bytes=240"

Why? Decreased bandwidth and increased jitter buffer.

How?

!
voice class codec 1
codec preference 1 g711alaw bytes 240
codec preference 2 g729r8 bytes 40
codec preference 4 g723r63 bytes 96
codec preference 5 g726r16 bytes 80
codec preference 8 gsmfr bytes 132
codec preference 14 g711ulaw bytes 240
!
dial-peer voice 200 voip
voice-class codec 1
!

(Yes, we're not in North America so u-law is down the list.)

JITTER
------

Most systems calculate the size of their jitter buffer at least partially on the payload size they are receiving. If you have lots of bandwidth but a little niggling jitter because of large bursts of data traffic, increasing the payload size can often make the problem go away.

BANDWIDTH
---------
We're trying to decrement the over head from IP packets when going over the Internet where we don't have (or want) RTP header compression. Eg, G729 is an 8k codec with 10 byte frame size. Default is two frames per packet, so that's 20 byte IP + 8 bytes UDP header + 12 byte RTP header + 20 byte payload = 60 bytes, or a 3x uplift from 8k to 24k.

Now try the same calculation with a 40 byte payload, and you get 16k. 60 byte payload, and you get 13.3k. (Now run two calls over a dialup modem link. :-)

NOTES
-----

Unless you're sure, don't go past four frames (generally 1/25 of a second), and no more than three for G.711. Cisco default to 2 frames.

Cisco 7905/7912 phones and ATA's have a similar tuning variable, NumTxFrames, that's global across codecs.

This will marginally increase latency, but in most cases over shared data networks without QoS it results in better overall voice quality.

G.711 is restricted to 240 bytes as some Cisco platforms, eg, 2600, will reject G.711 packets over that size and it won't be obvious unless you turn RTP debugging on, even though the AS5xxx routers will quite happily go higher.

G.729 can generally go to 60, although we have found one 802.11 phone that can't go past 40.

The router will guide you on appropriate sizes in multiples of frame sizes,
eg:

gw(config-class)#codec preference 4 g723r63 bytes ?
Each codec sample produces 24 bytes of voice payload.
Valid sizes are:
24, 48, 72, 96, 120, 144.
Any other value within the range will be rounded down
to nearest valid size.
<24-149> Choose a voice payload size from the list above

The list above doesn't have G.729b only because it confuses codec negotiation in certain Cisco phones. See my message on 10/10/2003 for details.

--
Andrew Rutherford
sip:
244 Pirie Street
Iagu Networks tel:+61-8-8425-2255 Adelaide SA 5000
http://www.iagu.net/
mailto:
Australia


  • Codec packet sizes, Andrew Rutherford, 03/24/2004

Archive powered by MHonArc 2.6.16.

Top of Page