All of lore.kernel.org
 help / color / mirror / Atom feed
* HFSC not working as expected
@ 2014-06-26 14:39 Alan Goodman
  2014-07-01 12:25 ` Michal Soltys
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: Alan Goodman @ 2014-06-26 14:39 UTC (permalink / raw)
  To: lartc

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-07-07 15:38 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 14:39 HFSC not working as expected Alan Goodman
2014-07-01 12:25 ` Michal Soltys
2014-07-01 13:19 ` Alan Goodman
2014-07-01 13:30 ` Michal Soltys
2014-07-01 14:33 ` Alan Goodman
2014-07-03  0:12 ` Michal Soltys
2014-07-03  0:56 ` Alan Goodman
2014-07-06  1:18 ` Michal Soltys
2014-07-06 15:34 ` Alan Goodman
2014-07-06 16:42 ` Andy Furniss
2014-07-06 16:49 ` Andy Furniss
2014-07-06 16:49 ` Alan Goodman
2014-07-06 16:54 ` Alan Goodman
2014-07-06 20:42 ` Andy Furniss
2014-07-06 22:18 ` Alan Goodman
2014-07-06 22:24 ` Andy Furniss
2014-07-07  0:01 ` Alan Goodman
2014-07-07  9:54 ` Michal Soltys
2014-07-07  9:58 ` Michal Soltys
2014-07-07 10:08 ` Michal Soltys
2014-07-07 10:10 ` Michal Soltys
2014-07-07 10:59 ` Alan Goodman
2014-07-07 15:38 ` Alan Goodman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.