From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Goodman Date: Thu, 26 Jun 2014 14:39:36 +0000 Subject: HFSC not working as expected Message-Id: <53AC30A8.2080403@yescomputersolutions.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi, I currently operate a traffic management / QoS system at my premises=20 with the following setup using htb/sfq. No default handle is selected=20 for various reasons (VPN traffic is tagged and accounted for before=20 flowing out and thus don=92t 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=20 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=20 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=20 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=20 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=20 1:10 tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 11 fw flowid=20 1:11 tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 12 fw flowid=20 1:12 tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 13 fw flowid=20 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=20 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=20 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=20 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=20 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=20 1:10 tc filter add dev eth1 parent 1:0 protocol ip prio 2 handle 11 fw flowid=20 1:11 tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 12 fw flowid=20 1:12 tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 13 fw flowid=20 1:13 The above system coupled with carefully crafted iptables rules set is=20 working quite well however when upload is being actively managed=20 sometimes its taking a while before jitter for time critical flows=20 settles down. I have therefore been investigating hfsc... Hfsc appears=20 to be working for low numbers of flows, however once flows increase and=20 packets backlog in the system overall latency is climbing skywards since=20 the backlog is getting too large before it appears to drop packets. I=20 have attempted to replicate my htb system where non marked traffic flows=20 out without restrictions however hfsc drops unclassified traffic - thus=20 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=20 rate 100mbit tc class add dev ppp0 parent 1:1 classid 1:2 hfsc sc rate 900kbit ul=20 rate 900kbit tc class add dev ppp0 parent 1:2 classid 1:10 hfsc sc rate 85kbit #syn=20 ack rst tc class add dev ppp0 parent 1:2 classid 1:11 hfsc sc umax 1412b dmax=20 20ms rate 410kbit # Time critical tc class add dev ppp0 parent 1:2 classid 1:12 hfsc sc rate 300kbit=20 #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=20 1:10 tc filter add dev ppp0 parent 1:0 protocol ip prio 2 handle 11 fw flowid=20 1:11 tc filter add dev ppp0 parent 1:0 protocol ip prio 3 handle 12 fw flowid=20 1:12 tc filter add dev ppp0 parent 1:0 protocol ip prio 4 handle 13 fw flowid=20 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=20 100mbit tc class add dev eth1 parent 1:1 classid 1:2 hfsc sc rate 18000kbit ul=20 m2 18000kbit tc class add dev eth1 parent 1:2 classid 1:10 hfsc sc rate 85kbit #syn=20 ack rst tc class add dev eth1 parent 1:2 classid 1:11 hfsc sc umax 1412b dmax=20 20ms rate 460kbit #Time critical tc class add dev eth1 parent 1:2 classid 1:12 hfsc sc rate 5955kbit=20 #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=20 1:10 tc filter add dev eth1 parent 1:0 protocol ip prio 2 handle 11 fw flowid=20 1:11 tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 12 fw flowid=20 1:12 tc filter add dev eth1 parent 1:0 protocol ip prio 4 handle 13 fw flowid=20 1:13 Does anybody have any tips regarding getting this working as well or=20 better than my existing htb based system? Alan