I created 1 parent class with rate = 100 and added 2 subclasses with ceil = 100kbps. I changed the quantum and the rate for the classes to see what happens if you change the quantum parameter.
Used script (download)
tc qdisc del dev eth0 root tc qdisc add dev eth0 root handle 1: htb default 10 tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10kbps ceil 100kbps quantum 2000 tc class add dev eth0 parent 1:1 classid 1:11 htb rate 10kbps ceil 100kbps quantum 20000 tc filter add dev eth0 parent 1: protocol ip handle 0x10 fw classid 1:10 tc filter add dev eth0 parent 1: protocol ip handle 0x11 fw classid 1:11 iptables -F iptables -F -t mangle iptables -X iptables -N acc_0 iptables -N acc_1 iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 0x0010 iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 0x0011 iptables -A OUTPUT -p tcp --dport 2000 -j acc_0 iptables -A OUTPUT -p tcp --dport 2001 -j acc_1 iptables -A OUTPUT -j ACCEPT
rate class 1:10 and 1:11 | Expected 1:10 - 1:11 | Result |
---|---|---|
10kbps | 17.27 - 82.7 | 22 - 78 |
20kbps | 25.45 - 74.5 | 36 - 64 |
30kbps | 33.63 - 66.3 | 50 - 50 |
The influence of the quantum parameter is not so accurate, but without the quantum setting each class gets 50%.