capthookb |
05-16-2008 02:48 PM |
Traffic shapping question(s)
I have a linksys wag354g adsl modem router, and when i enable qos things get worse, instead of better. After a few minutes i cannot browse the net at all, and all http requests are timing out because of saturation of the router, from p2p traffic.
This is the script of the router for qos with web (port 80) at the hightest of the three levels, and all other traffic at the lowest.
Do you see anything wrong with the script? I noticed that the ceil value is lower than the rate value. Is this correct;
Code:
#!/bin/sh
###### Upstream side #########
/usr/sbin/tc qdisc del dev ppp0 root 2> /dev/null > /dev/null
echo "root PQ"
/usr/sbin/tc qdisc add dev ppp0 root handle 1: prio
echo "PQ 1:1"
/usr/sbin/tc qdisc add dev ppp0 parent 1:1 handle 110:0 dsmark indices 8
/usr/sbin/tc class change dev ppp0 classid 110:1 dsmark mask 0x3 value 0x80
echo "change tos of EF"
/usr/sbin/tc qdisc add dev ppp0 parent 1:2 handle 2:0 htb default 50
echo "HTB for non-EF"
/usr/sbin/tc class add dev ppp0 parent 2:0 classid 2:1 htb ceil 256kbit rate 256kbit
echo "HTB parent class"
/usr/sbin/tc class add dev ppp0 parent 2:1 classid 2:10 htb rate 256kbit ceil 204kbit prio 1 quantum 1 burst 6k
echo "HTB AF1"
/usr/sbin/tc qdisc add dev ppp0 parent 2:10 handle 210:0 dsmark indices 8
/usr/sbin/tc class change dev ppp0 classid 210:1 dsmark mask 0x3 value 0x60
echo "change tos of AF1"
/usr/sbin/tc class add dev ppp0 parent 2:1 classid 2:20 htb rate 256kbit ceil 25kbit prio 2 quantum 2 burst 6k
echo "HTB AF2"
/usr/sbin/tc qdisc add dev ppp0 parent 2:20 handle 220:0 dsmark indices 8
/usr/sbin/tc class change dev ppp0 classid 220:1 dsmark mask 0x3 value 0x40
echo "change tos of AF2"
/usr/sbin/tc class add dev ppp0 parent 2:1 classid 2:30 htb rate 256kbit ceil 12kbit prio 3 quantum 3 burst 6k
echo "HTB AF3"
/usr/sbin/tc qdisc add dev ppp0 parent 2:30 handle 230:0 dsmark indices 8
/usr/sbin/tc class change dev ppp0 classid 230:1 dsmark mask 0x3 value 0x20
echo "change tos of AF3"
/usr/sbin/tc class add dev ppp0 parent 2:1 classid 2:40 htb rate 256kbit ceil 10kbit prio 4 quantum 4 burst 6k
echo "HTB AF4"
/usr/sbin/tc qdisc add dev ppp0 parent 2:40 handle 240:0 dsmark indices 8
/usr/sbin/tc class change dev ppp0 classid 240:1 dsmark mask 0x3 value 0xa0
echo "change tos of AF4"
/usr/sbin/tc class add dev ppp0 parent 2:1 classid 2:50 htb rate 256kbit ceil 5kbit prio 5 quantum 5 burst 6k
echo "HTB BE!"
######Filters#########
/usr/sbin/tc filter add dev ppp0 parent 110:0 protocol ip u32 match ip src 0.0.0.0/0 flowid 110:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip sport 20 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip sport 20 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip dport 20 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip dport 20 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip sport 80 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip sport 80 0xffff flowid 2:10
/usr/sbin/tc filter add dev ppp0 parent 210:0 protocol ip prio 1 u32 match ip sport 80 0xffff flowid 210:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip dport 80 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip dport 80 0xffff flowid 2:10
/usr/sbin/tc filter add dev ppp0 parent 210:0 protocol ip prio 1 u32 match ip dport 80 0xffff flowid 210:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip sport 53 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip sport 53 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip dport 53 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip dport 53 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip sport 23 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip sport 23 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip dport 23 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip dport 23 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip sport 25 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip sport 25 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip dport 25 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip dport 25 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip sport 110 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip sport 110 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip dport 110 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip dport 110 0xffff flowid 2:50
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip sport 123 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip sport 123 0xffff flowid 2:10
/usr/sbin/tc filter add dev ppp0 parent 210:0 protocol ip prio 1 u32 match ip sport 123 0xffff flowid 210:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip dport 123 0xffff flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip dport 123 0xffff flowid 2:10
/usr/sbin/tc filter add dev ppp0 parent 210:0 protocol ip prio 1 u32 match ip dport 123 0xffff flowid 210:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 0 u32 match ip tos 0x80 0xe0 flowid 1:1
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 1 u32 match ip tos 0x60 0xe0 flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip tos 0x60 0xe0 flowid 2:10
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 2 u32 match ip tos 0x40 0xe0 flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 2 u32 match ip tos 0x40 0xe0 flowid 2:20
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 3 u32 match ip tos 0x20 0xe0 flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 3 u32 match ip tos 0x20 0xe0 flowid 2:30
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 4 u32 match ip tos 0xa0 0xe0 flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 4 u32 match ip tos 0xa0 0xe0 flowid 2:40
/usr/sbin/tc filter add dev ppp0 parent 1:0 protocol ip prio 5 u32 match ip tos 0x0 0xe0 flowid 1:2
/usr/sbin/tc filter add dev ppp0 parent 2:0 protocol ip prio 5 u32 match ip tos 0x0 0xe0 flowid 2:50
The scematic of current traffic shapping settings is this:
http://img381.imageshack.us/img381/6...raphcj7.th.gif
and the settings on the configuration page of the router is this:
http://img396.imageshack.us/img396/5636/wagfb6.th.jpg
|