login | register
Thu 28 of Aug, 2008 [09:51 UTC]

voip-info.org

History

QoS Linux

Created by: oej,Last modification on Mon 21 of May, 2007 [23:29 UTC] by admin

HTB

HTB is an alternative to CBQ (lower CPU usage & better help)

Here is a script to optimise one end of an IAX over SDSL link:

#!/bin/sh

TCOP="add"
IPTOP="-A"

if [ "$1" == "stop" ]; then
       echo "Stopping..."
       TCOP="del"
       IPTOP="-D"
fi

#          +---------+
#          | root 1: |
#          +---------+
#               |
# +----------------------------+
# |         class 1:1          |
# +----------------------------+
#   |           |           |
# +----+      +----+      +----+
# |1:10|      |1:20|      |1:30|
# +----+      +----+      +----+
#               |
#      +--------+--------+
#      |        |        |
#   +-----+  +-----+  +-----+
#   |1:100|  |1:101|  |1:102|
#   +-----+  +-----+  +-----+

# 1:10 is the class for VOIP traffic, pfifo qdisc
# 1:20 is for bulk traffic (htb, leaves use sfq)
# 1:30 is the class that interactive and TCP SYN/ACK traffic (sfq qdisc)

# 1:20 is further split up into different kinds of bulk traffic: web, mail and
# everything else.  1:100-102 fight amongst themselves for their slice of excess
# bandwidth, and in turn 1:10,20 and 30 then fight for any excess above their
# minimum rates.

# which interface to throw all this on (DSL)
IF=eth2

# ceil is 75% of max rate (768kbps)
# rate is 65% of max rate
# we don't let it go to 100% because we don't want the DSL modem (Pairgain MegaBit Modem 300S)
# to have a ton of packets in their buffers.  *we* want to do the buffering.
RATE=576
CEIL=640
#RATE=450
#CEIL=500

tc qdisc ${TCOP} dev ${IF} root handle 1: htb default 102
tc class ${TCOP} dev ${IF} parent 1:   classid 1:1 htb rate ${RATE}kbit ceil ${CEIL}kbit

tc class ${TCOP} dev ${IF} parent 1:1  classid 1:10 htb rate 64kbit ceil ${RATE}kbit prio 1
tc class ${TCOP} dev ${IF} parent 1:1  classid 1:20 htb rate 64kbit ceil ${RATE}kbit prio 2

tc class ${TCOP} dev ${IF} parent 1:20 classid 1:100 htb rate ${RATE}kbit
tc class ${TCOP} dev ${IF} parent 1:20 classid 1:101 htb rate ${RATE}kbit
tc class ${TCOP} dev ${IF} parent 1:20 classid 1:102 htb rate ${RATE}kbit

tc qdisc ${TCOP} dev ${IF} parent 1:10  handle 10:  pfifo
tc qdisc ${TCOP} dev ${IF} parent 1:100 handle 100: sfq perturb 10
tc qdisc ${TCOP} dev ${IF} parent 1:101 handle 101: sfq perturb 10
tc qdisc ${TCOP} dev ${IF} parent 1:102 handle 102: sfq perturb 10

tc filter ${TCOP} dev ${IF} parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter ${TCOP} dev ${IF} parent 1:0 protocol ip prio 4 handle 4 fw classid 1:100

# IAX2 prio 0.
iptables -t mangle ${IPTOP} PREROUTING -p udp -m udp --dport 4569 -j MARK --set-mark 0x1
iptables -t mangle ${IPTOP} PREROUTING -p udp -m udp --dport 4569 -j RETURN

# everything else goes into lowest priority (best effort).
iptables -t mangle ${IPTOP} PREROUTING -j MARK --set-mark 0x4
iptables -t mangle ${IPTOP} OUTPUT -j MARK --set-mark 0x4

NB The other end of this link is controlled by a Cisco - see QoS Cisco IOS

See Also


Go back to QoS: Quality of Service in VOIP Networks


Comments

Comments Filter
222

333Re: Wonder Shaper

by broadsoft, Thursday 29 of December, 2005 [10:16:43 UTC]
Does anyone know where httpd://lartc.org has gone? I am having no luck with the above QoS script and just need a start or a break - I appreciate the efforts made by these entries but I still cannot seem to get anything to improve my system here. Does anyone have an alternative url to wondershaper please??
222

333Re: Wonder Shaper

by broadsoft, Thursday 29 of December, 2005 [10:16:16 UTC]
Does anyone know where httpd://lartc.org has gone? I am having no luck with the above QoS script and just need a start or a break - I appreciate the efforts made by these entries but I still cannot seem to get anything to improve my system here. Does anyone have an alternative url to wondershaper please??
222

333Re: Wonder Shaper

by broadsoft, Thursday 29 of December, 2005 [10:15:57 UTC]
Does anyone know where httpd://lartc.org has gone? I am having no luck with the above QoS script and just need a start or a break - I appreciate the efforts made by these entries but I still cannot seem to get anything to improve my system here. Does anyone have an alternative url to wondershaper please??
222

333Re: Wonder Shaper

by broadsoft, Thursday 29 of December, 2005 [10:15:30 UTC]
Does anyone know where httpd://lartc.org has gone? I am having no luck with the above QoS script and just need a start or a break - I appreciate the efforts made by these entries but I still cannot seem to get anything to improve my system here. Does anyone have an alternative url to wondershaper please??
222

333Wonder Shaper

by fugalh, Monday 05 of September, 2005 [15:45:55 UTC]
I tried this script with minimal results, then I tried writing my own after studying the lartc, with even worse results. :)

Then I stumbled on the Wonder Shaper http://lartc.org/wondershaper and even though there's nothing voip-specific in it, it works exceptionally well. Of course you'll want to make sure that the TOS bits are being set appropriately.
222

333seems to be your cause in HTB-FAQ

by , Wednesday 16 of February, 2005 [06:39:47 UTC]
please consider http://luxik.cdi.cz/~devik/qos/htb/htbfaq.htm :
Q: - What if sum of child *rates* is greater than parent *rate*?

does it works well for you?
222

333GPL Graphical soft for HTB!

by , Sunday 13 of February, 2005 [05:41:00 UTC]
http://sourceforge.net/projects/rcc/ or http://www.rcc-project.net
222

333Debian testing + Kernel 2.6.8.1

by , Tuesday 09 of November, 2004 [23:56:28 UTC]
Doesn't work (:confused:)

+ tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10 RTNETLINK answers: Invalid argument
+ tc filter add dev eth0 parent 1:0 protocol ip prio 4 handle 4 fw classid 1:100 RTNETLINK answers: Invalid argument

Any ideas? any specific kernel options (selected just about all of them)

-Max.