HFSC not working as expected

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I currently operate a traffic management / QoS system at my premises with the following setup using htb/sfq. No default handle is selected for various reasons (VPN traffic is tagged and accounted for before flowing out and thus don’t want to count VPN traffic).

#QoS for Upload

tc qdisc del dev ppp0 root

tc qdisc add dev ppp0 root handle 1:0 htb r2q 1

tc class add dev ppp0 parent 1: classid 1:1 htb rate 900kbit ceil 900kbit

tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 85kbit ceil 900kbit quantum 2824 mtu 1412 prio 1 #syn ack rst tc class add dev ppp0 parent 1:1 classid 1:11 htb rate 410kbit ceil 900kbit quantum 2824 mtu 1412 prio 2 #VoIP/Ping/DNS/Timecritical tc class add dev ppp0 parent 1:1 classid 1:12 htb rate 300kbit ceil 900kbit quantum 2824 mtu 1412 prio 3 #Interactive/Web/etc tc class add dev ppp0 parent 1:1 classid 1:13 htb rate 105kbit ceil 900kbit quantum 2824 mtu 1412 prio 4 #Bulk/Other

tc qdisc add dev ppp0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev ppp0 parent 1:11 handle 11: sfq perturb 10
tc qdisc add dev ppp0 parent 1:12 handle 12: sfq perturb 10 limit 2
tc qdisc add dev ppp0 parent 1:13 handle 13: sfq perturb 10 limit 2

tc filter add dev ppp0 parent 1:0 protocol ip prio 1 handle 10 fw flowid 1:10 tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 11 fw flowid 1:11 tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 12 fw flowid 1:12 tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 13 fw flowid 1:13

#QoS for Download

tc qdisc del dev eth1 root

tc qdisc add dev eth1 root handle 1:0 htb r2q 1

class add dev eth1 parent 1: classid 1:1 htb rate 15000kbit ceil 15000kbit

tc class add dev eth1 parent 1:1 classid 1:10 htb rate 85kbit ceil 15000kbit quantum 2824 mtu 1412 prio 1 #syn ack rst tc class add dev eth1 parent 1:1 classid 1:11 htb rate 460kbit ceil 15000kbit quantum 2824 mtu 1412 prio 2 #VoIP/Ping/DNS/Time critical tc class add dev eth1 parent 1:1 classid 1:12 htb rate 5955kbit ceil 15000kbit quantum 2824 mtu 1412 prio 3 #Interactive/Web/etc tc class add dev eth1 parent 1:1 classid 1:13 htb rate 8500kbit ceil 15000kbit quantum 2824 mtu 1412 prio 4 #Bulk/Other

tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth1 parent 1:11 handle 11: sfq perturb 10
tc qdisc add dev eth1 parent 1:12 handle 12: sfq perturb 10 limit 10
tc qdisc add dev eth1 parent 1:13 handle 13: sfq perturb 10 limit 10

tc filter add dev eth1 parent 1:0 protocol ip prio 1 handle 10 fw flowid 1:10 tc filter add dev eth1 parent 1:0 protocol ip prio 2 handle 11 fw flowid 1:11 tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 12 fw flowid 1:12 tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 13 fw flowid 1:13

The above system coupled with carefully crafted iptables rules set is working quite well however when upload is being actively managed sometimes its taking a while before jitter for time critical flows settles down. I have therefore been investigating hfsc... Hfsc appears to be working for low numbers of flows, however once flows increase and packets backlog in the system overall latency is climbing skywards since the backlog is getting too large before it appears to drop packets. I have attempted to replicate my htb system where non marked traffic flows out without restrictions however hfsc drops unclassified traffic - thus my attempted solution below (class 1:14) which seems to be working properly.

#QoS for Upload

tc qdisc del dev ppp0 root

tc qdisc add dev ppp0 root handle 1:0 hfsc default 14

tc class add dev ppp0 parent 1:0 classid 1:1 hfsc sc rate 100mbit ul rate 100mbit tc class add dev ppp0 parent 1:1 classid 1:2 hfsc sc rate 900kbit ul rate 900kbit

tc class add dev ppp0 parent 1:2 classid 1:10 hfsc sc rate 85kbit #syn ack rst tc class add dev ppp0 parent 1:2 classid 1:11 hfsc sc umax 1412b dmax 20ms rate 410kbit # Time critical tc class add dev ppp0 parent 1:2 classid 1:12 hfsc sc rate 300kbit #Interactive
tc class add dev ppp0 parent 1:2 classid 1:13 hfsc sc rate 105kbit #bulk
tc class add dev ppp0 parent 1:1 classid 1:14 hfsc sc rate 100mbit

tc qdisc add dev ppp0 parent 1:10 handle 1010: sfq
tc qdisc add dev ppp0 parent 1:11 handle 1011: sfq
tc qdisc add dev ppp0 parent 1:12 handle 1012: sfq limit 5
tc qdisc add dev ppp0 parent 1:13 handle 1013: sfq limit 5
tc qdisc add dev ppp0 parent 1:14 handle 1014: pfifo

tc filter add dev ppp0 parent 1:0 protocol ip prio 1 handle 10 fw flowid 1:10 tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 11 fw flowid 1:11 tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 12 fw flowid 1:12 tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 13 fw flowid 1:13

#QoS for Download

tc qdisc del dev eth1 root

tc qdisc add dev eth1 root handle 1:0 hfsc default 14

tc class add dev eth1 parent 1:0 classid 1:1 hfsc sc rate 100mbit ul m2 100mbit tc class add dev eth1 parent 1:1 classid 1:2 hfsc sc rate 18000kbit ul m2 18000kbit

tc class add dev eth1 parent 1:2 classid 1:10 hfsc sc rate 85kbit #syn ack rst tc class add dev eth1 parent 1:2 classid 1:11 hfsc sc umax 1412b dmax 20ms rate 460kbit #Time critical tc class add dev eth1 parent 1:2 classid 1:12 hfsc sc rate 5955kbit #Interactive
tc class add dev eth1 parent 1:2 classid 1:13 hfsc sc rate 11500kbit #Bulk
tc class add dev eth1 parent 1:1 classid 1:14 hfsc sc rate 100mbit

tc filter add dev eth1 parent 1:0 protocol ip prio 1 handle 10 fw flowid 1:10 tc filter add dev eth1 parent 1:0 protocol ip prio 2 handle 11 fw flowid 1:11 tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 12 fw flowid 1:12 tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 13 fw flowid 1:13

Does anybody have any tips regarding getting this working as well or better than my existing htb based system?

Alan
--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux