[lug] VoIP quality issues and MTU

Daniel Webb lists at danielwebb.us
Fri Sep 23 01:30:10 MDT 2005


I've been having minor problems with VoIP sound quality and dropouts whenever
my internet connection is saturated ever since I started using it.  I have my
own QoS stuff running using iptables classification and tc, and I think I have
everything set right (outgoing queue is a small pfifo for the VoIP stuff,
txqueue is small on the ethernet device), and it improved a lot but there was
still a jittery sound whenever the connection was saturated, especially with
the outgoing side saturated.  Today I tried setting the MTU very small (200)
in desperation, and now the problems have gone.  I have read plenty of stuff
on QoS and VoIP, and never saw anything about changing the MTU.  Did I just
miss something?  I know what MTU is and how it works, I'm just surprised that
if it makes that much difference on a standard DSL connection why I've never
read about changing it for this purpose.

The actual numbers are:
   - txqueuelen = 2 for eth0 on router, 0 on vlan0 and vlan1
     (set with "ip link set eth0 qlen 2")
   - mtu = 200 on the asterisk server and the router
     (set with "ip link set <whatever> mtu 200")
For the outgoing qdisc queue for VoIP packets:
   - "tc qdisc add dev $EXT_IF parent 1:$CLASS_PRIO pfifo limit 10"

My router is a Linksys WRT54G v.2.0, and my internet connection is 1.5M/384k
DSL.  I'm not very experienced with the hardcore networking aspects of this,
so I'm a little confused where the bottleneck is and where I want it to be.

If I understand right, I want to use a tc qdisc/class to throttle slightly
below my DSL modem's speed so that a queue doesn't build up on the DSL modem.  
There should be a queue for each priority class, and then the qdisc gets to
pick which of the class queues it will send to the network device.

Thinking of the worst case scenario with an MTU of 1500, I imagine the qdisc
sending out a 1500 byte packet from a file upload, and instantly after that
asterisk sends out a packet.  I'm assuming the VOIP packet is going to have to
wait for that file packet to clear the device, so for my connection that will
take about 50ms if I assume 300kbps:
   1500 bytes / 30000 kBps = 50 ms
which means this would cause 50 ms of jitter, which doesn't seem that bad.  So
why does decreasing MTU help when nothing else seems to?




More information about the LUG mailing list