Hi, I have a Linux box which acts as a router (NAT) and has VoIP software. I want the VoIP traffic to have the highest priority. So I used a script like this: #!/bin/sh DEV=ppp0 TC=tc $TC qdisc del dev $DEV root > /dev/null 2>&1 $TC qdisc add dev $DEV root handle 1: htb default 30 $TC class add dev $DEV parent 1: classid 1:1 htb rate 96kbit burst 15k $TC class add dev $DEV parent 1:1 classid 1:10 htb rate 94kbit burst 15k prio 0 $TC class add dev $DEV parent 1:1 classid 1:20 htb rate 1kbit ceil 1kbit burst 1k prio 1 $TC class add dev $DEV parent 1:1 classid 1:30 htb rate 1kbit ceil 90kbit burst 1k prio 7 $TC qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 $TC qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 $TC qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 $TC filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip protocol 17 0xff flowid 1:10 Currently the filter puts all UDP traffic (through which the voice goes) to 1:10. The script works partially: when uploading from the LAN and starting a call, the upload rate decreases exactly as needed by the voice, BUT the voice has LARGE delays - up to 2 secs. Is there an option to put (for instance) all UDP traffic at the beginning of the output queue? Thanks, Alex _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
(Sorry if this appears twice) Hi, I have a Linux box which acts as a router (NAT) and has VoIP software. I want the VoIP traffic to have the highest priority. So I used a script like this: #!/bin/sh DEV=ppp0 TC=tc $TC qdisc del dev $DEV root > /dev/null 2>&1 $TC qdisc add dev $DEV root handle 1: htb default 30 $TC class add dev $DEV parent 1: classid 1:1 htb rate 96kbit burst 15k $TC class add dev $DEV parent 1:1 classid 1:10 htb rate 94kbit burst 15k prio 0 $TC class add dev $DEV parent 1:1 classid 1:20 htb rate 1kbit ceil 1kbit burst 1k prio 1 $TC class add dev $DEV parent 1:1 classid 1:30 htb rate 1kbit ceil 90kbit burst 1k prio 7 $TC qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 $TC qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 $TC qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 $TC filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip protocol 17 0xff flowid 1:10 Currently the filter puts all UDP traffic (through which the voice goes) to 1:10. The script works partially: when uploading from the LAN and starting a call, the upload rate decreases exactly as needed by the voice, BUT the voice has LARGE delays - up to 2 secs. Is there an option to put (for instance) all UDP traffic at the beginning of the output queue? Thanks, Alex _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Alex, : I have a Linux box which acts as a router (NAT) and has VoIP software. : I want the VoIP traffic to have the highest priority. So I used a : script like this: I haven''t yet used Linux TC to deal with VoIP issues. Others on this list have, and I''ll make a suggestion one of them had made, which fits very well with my understandings. Perhaps somebody else who has used VoIP and HTB will also chime in here. : ADD_DEV="tc class add dev $DEV" : $ADD_DEV root handle 1: htb default 30 : $ADD_DEV parent 1: classid 1:1 htb rate 96kbit burst 15k : $ADD_DEV parent 1:1 classid 1:10 htb rate 94kbit burst 15k prio 0 : $ADD_DEV parent 1:1 classid 1:20 htb rate 1kbit ceil 1kbit burst 1k prio 1 : $ADD_DEV parent 1:1 classid 1:30 htb rate 1kbit ceil 90kbit burst 1k prio 7 : $ADD_DEV parent 1:10 handle 10: sfq perturb 10 : $ADD_DEV parent 1:20 handle 20: sfq perturb 10 : $ADD_DEV parent 1:30 handle 30: sfq perturb 10 : : $TC filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip protocol : 17 0xff flowid 1:10 It seems that you only have 96kbit to work with, and you probably know that each VoIP call needs about 64kbit (if I understand correctly). This means that for proper response, you need to reserve 64kbit for the VoIP class, 1:10. That would mean using a ceil of 30kbit on class 1:30, which is probably a bit low. I''d suggest dropping the ceiling on class 1:30 anyway. I noticed also that you dropped the bursts to very small values in your "bulk" classes. This is a good idea--this will keep the queues in the upstream devices from filling up. : Currently the filter puts all UDP traffic (through which the voice : goes) to 1:10. The script works partially: when uploading from the LAN : and starting a call, the upload rate decreases exactly as needed by the : voice, BUT the voice has LARGE delays - up to 2 secs. However, you did include a burst of 15k in the VoIP class. I''d suggest dropping the burst to 2k, and then increasing it until you can sustain a good telephone call even when you have started an agressive download. You may find that it''s best to try to set the optimal rate/ceil for your queues before you try to optimize the burst parameters for minimizing latency. : Is there an option to put (for instance) all UDP traffic at the : beginning of the output queue? That would be functionally the equivalent of a PRIO qdisc. Given how little bandwidth you have, you might find it better to use a shaping qdisc (HTB qdisc with one class) with a very small burst (bucket) with an embedded prio qdisc. I haven''t tried that either, but that''s probably what I''d try next, if I were in your shoes. -Martin -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com