I left out the burst parameter so that HTB would compute it.
The 80k burst parameter was my approach to prioritze somehow page browsing
against heavy downloads. I said that 80 kilos is the average size of a html
page.
Is there any other way to accomplish this task. Is there a way to tell page
browing from downloads?
Attached are my script and the output as they are quite long.
Thank you for your time, Stef.
# TC----------------------------------------------------------------------------------------------------------------------------------------------
TC=/sbin/tc
FILTER_IP="$TC filter add dev $LAN_IFACE parent 1:0 protocol ip prio 1 u32 match ip dst"
$TC qdisc del dev $LAN_IFACE root >/dev/null 2>&1 # Delete previous root qdisc
$TC qdisc del dev $INET_IFACE root >/dev/null 2>&1
$TC qdisc add dev $INET_IFACE root handle 1: htb default 30 # root upload qdisc
$TC class add dev $INET_IFACE parent 1: classid 1:1 htb rate 128kbit ceil 128kbit # root upload class
$TC class add dev $INET_IFACE parent 1:1 classid 1:30 htb rate 1kbit ceil 128kbit # upload default class
$TC qdisc add dev $INET_IFACE parent 1:30 handle 300: sfq perturb 10 # upload dafault class queuing discipline
# +--------------------+
# |1: (root qdisc)|
# +--------------------+
$TC qdisc add dev $LAN_IFACE root handle 1: htb default 30
# +--------------------------+
# |1:1 512/512 (root class)|
# +--------------------------+
$TC class add dev $LAN_IFACE parent 1: classid 1:1 htb rate 128kbit ceil 128kbit
# +---------------------------+
# |1:30 1/512 (default class)|
# +---------------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:30 htb rate 1kbit ceil 128kbit
$TC qdisc add dev $LAN_IFACE parent 1:30 handle 300: sfq perturb 10
# +-------------------------------+
# |--|11:111 2/512 (xp) |
# +------------+ | +-------------------------------+
# |1:11 16/512 |--|
# +------------+ | +-------------------------------+
# |--|11:112 12/512 (xp.tarnita.net)|
# +-------------------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:11 htb rate 7kbit ceil 128kbit
$TC qdisc add dev $LAN_IFACE parent 1:11 handle 110: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:11 classid 1:111 htb rate 4kbit ceil 128kbit
$FILTER_IP 192.168.0.121 flowid 1:111
$TC class add dev $LAN_IFACE parent 1:11 classid 1:112 htb rate 3kbit ceil 128kbit
$FILTER_IP 213.164.252.211 flowid 1:112
# +----------------------+
# |--|12:121 3/96 (horea) |
# +------------+ | +----------------------+
# |1:12 4/96 |--|
# +------------+ | +----------------------+
# |--|12:122 1/96 (_horea)|
# +----------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:12 htb rate 7kbit ceil 96kbit
$TC qdisc add dev $LAN_IFACE parent 1:12 handle 120: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:12 classid 1:121 htb rate 4kbit ceil 96kbit
$FILTER_IP 192.168.0.122 flowid 1:121
$TC class add dev $LAN_IFACE parent 1:12 classid 1:122 htb rate 3kbit ceil 96kbit
$FILTER_IP 192.168.0.127 flowid 1:122
# +--------------------+
# |1:13 8/96 (sergiu)|
# +--------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:13 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.123 flowid 1:13
$TC qdisc add dev $LAN_IFACE parent 1:13 handle 130: sfq perturb 10
# +--------------------+
# |1:14 8/96 (damian)|
# +--------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:14 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.124 flowid 1:14
$TC qdisc add dev $LAN_IFACE parent 1:14 handle 140: sfq perturb 10
# +-------------------+
# |1:15 16/96 (peter)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:15 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.125 flowid 1:15
$TC qdisc add dev $LAN_IFACE parent 1:15 handle 150: sfq perturb 10
# +-------------------------+
# |--|16:161 8/96 (victor) |
# +------------+ | +-------------------------+
# |1:16 16/96 |--|
# +------------+ | +-------------------------+
# |--|16:162 8/96 (victorace)|
# +-------------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:16 htb rate 7kbit ceil 96kbit
$TC qdisc add dev $LAN_IFACE parent 1:16 handle 160: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:16 classid 1:161 htb rate 4kbit ceil 96kbit
$FILTER_IP 192.168.0.141 flowid 1:161
$TC class add dev $LAN_IFACE parent 1:16 classid 1:162 htb rate 3kbit ceil 96kbit
$FILTER_IP 192.168.0.147 flowid 1:162
# +-------------------+
# |1:17 16/96 (liana)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:17 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.144 flowid 1:17
$TC qdisc add dev $LAN_IFACE parent 1:17 handle 170: sfq perturb 10
# +-----------------+
# |1:18 16/96 (adi)|
# +-----------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:18 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.145 flowid 1:18
$TC qdisc add dev $LAN_IFACE parent 1:18 handle 180: sfq perturb 10
# +-------------------+
# |1:19 16/96 (kiowa)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:19 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.161 flowid 1:19
$TC qdisc add dev $LAN_IFACE parent 1:19 handle 190: sfq perturb 10
# +--------------------+
# |--|20:201 2/512 (boby)|
# +------------+ | +--------------------+
# |1:20 16/512 |--|
# +------------+ | +--------------------+
# |--|20:202 2/96 (roxa)|
# +--------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:20 htb rate 7kbit ceil 96kbit
$TC qdisc add dev $LAN_IFACE parent 1:20 handle 200: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:20 classid 1:201 htb rate 4kbit ceil 96kbit
$FILTER_IP 192.168.0.181 flowid 1:201
$TC class add dev $LAN_IFACE parent 1:20 classid 1:202 htb rate 3kbit ceil 96kbit
$FILTER_IP 192.168.0.182 flowid 1:202
# +-------------------+
# |1:21 16/96 (delia)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:21 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.185 flowid 1:21
$TC qdisc add dev $LAN_IFACE parent 1:21 handle 210: sfq perturb 10
# +-----------------------------------+
# |--|22:221 2/120(badboys.tarnita.net) |
# | +-----------------------------------+
# |
# | +-----------------------------------+
# |--|22:222 2/96 (hercules.tarnita.net)|
# +------------+ | +-----------------------------------+
# |1:22 8/120 |--|
# +------------+ | +-----------------------------------+
# |--|22:223 2/96 (hercules.tarnita.net)|
# | +-----------------------------------+
# |
# | +-----------------------------------+
# |--|22:224 1/96 (hercules.tarnita.net)|
# +-----------------------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:22 htb rate 7kbit ceil 96kbit
$TC qdisc add dev $LAN_IFACE parent 1:22 handle 220: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:22 classid 1:221 htb rate 2kbit ceil 96kbit
$FILTER_IP 213.164.252.210 flowid 1:221
$TC class add dev $LAN_IFACE parent 1:22 classid 1:222 htb rate 2kbit ceil 96kbit
$FILTER_IP 213.164.252.212 flowid 1:222
$TC class add dev $LAN_IFACE parent 1:22 classid 1:223 htb rate 1kbit ceil 96kbit
$FILTER_IP 213.164.252.213 flowid 1:223
$TC class add dev $LAN_IFACE parent 1:22 classid 1:224 htb rate 1kbit ceil 96kbit
$FILTER_IP 213.164.252.214 flowid 1:224
$TC class add dev $LAN_IFACE parent 1:22 classid 1:225 htb rate 1kbit ceil 1kbit
$FILTER_IP 213.164.252.215 flowid 1:225
# +-------------------+
# |1:23 16/96 (alina)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:23 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.205 flowid 1:23
$TC qdisc add dev $LAN_IFACE parent 1:23 handle 230: sfq perturb 10
# +--------------------+
# |1:24 8/96 (vasaru)|
# +--------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:24 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.206 flowid 1:24
$TC qdisc add dev $LAN_IFACE parent 1:24 handle 240: sfq perturb 10
# +-------------------------+
# |--|25:251 4/96 (juncu_n) |
# +------------+ | +-------------------------+
# |1:25 8/96 |--|
# +------------+ | +------------------------+
# |--|25:252 4/96 (juncu_d) |
# +------------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:25 htb rate 7kbit ceil 96kbit
$TC qdisc add dev $LAN_IFACE parent 1:25 handle 250: sfq perturb 10
$TC class add dev $LAN_IFACE parent 1:25 classid 1:251 htb rate 4kbit ceil 96kbit
$FILTER_IP 192.168.0.207 flowid 1:251
$TC class add dev $LAN_IFACE parent 1:25 classid 1:252 htb rate 4kbit ceil 96kbit
$FILTER_IP 192.168.0.208 flowid 1:252
# +-----------------+
# |1:26 8/96 (ovi)|
# +-----------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:26 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.209 flowid 1:26
$TC qdisc add dev $LAN_IFACE parent 1:26 handle 260: sfq perturb 10
# +-------------------+
# |1:27 8/96 (gocan)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:27 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.209 flowid 1:27
$TC qdisc add dev $LAN_IFACE parent 1:27 handle 270: sfq perturb 10
# +-------------------+
# |1:28 8/96 (roxana)|
# +-------------------+
$TC class add dev $LAN_IFACE parent 1:1 classid 1:28 htb rate 7kbit ceil 96kbit
$FILTER_IP 192.168.0.146 flowid 1:28
$TC qdisc add dev $LAN_IFACE parent 1:28 handle 280: sfq perturb 10
class htb 1:11 parent 1:1 rate 7Kbit ceil 128Kbit burst 1607b/8 mpu 0b cburst 1762b/8 mpu 0b level 6
Sent 882677 bytes 1089 pkts (dropped 0, overlimits 0)
rate 1113bps 1pps
lended: 28 borrowed: 856 giants: 0
tokens: 1404342 ctokens: 84550
class htb 1:202 parent 1:20 prio 0 quantum 1000 rate 3Kbit ceil 96Kbit burst 1602b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 3419733 ctokens: 114799
class htb 1:22 parent 1:1 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 6
Sent 11999 bytes 96 pkts (dropped 0, overlimits 0)
rate 27bps
lended: 33 borrowed: 0 giants: 0
tokens: 1353144 ctokens: 106267
class htb 1:1 root rate 128Kbit ceil 128Kbit burst 1762b/8 mpu 0b cburst 1762b/8 mpu 0b level 7
Sent 4416367 bytes 4082 pkts (dropped 0, overlimits 0)
rate 12940bps 10pps
lended: 3139 borrowed: 0 giants: 0
tokens: 84550 ctokens: 84550
class htb 1:111 parent 1:11 prio 0 quantum 1000 rate 4Kbit ceil 128Kbit burst 1604b/8 mpu 0b cburst 1762b/8 mpu 0b level 0
Sent 737341 bytes 617 pkts (dropped 0, overlimits 0)
rate 1043bps
lended: 101 borrowed: 516 giants: 0
tokens: 161599 ctokens: 12950
class htb 1:122 parent 1:12 prio 0 quantum 1000 rate 3Kbit ceil 96Kbit burst 1602b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 216949 bytes 263 pkts (dropped 0, overlimits 0)
rate 17bps
lended: 96 borrowed: 167 giants: 0
tokens: 3317333 ctokens: 111600
class htb 1:221 parent 1:22 prio 0 quantum 1000 rate 2Kbit ceil 96Kbit burst 1601b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 372 bytes 6 pkts (dropped 0, overlimits 0)
rate 1bps
lended: 6 borrowed: 0 giants: 0
tokens: 4776191 ctokens: 111066
class htb 1:23 parent 1:1 leaf 230: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:112 parent 1:11 prio 0 quantum 1000 rate 3Kbit ceil 128Kbit burst 1602b/8 mpu 0b cburst 1762b/8 mpu 0b level 0
Sent 145336 bytes 472 pkts (dropped 0, overlimits 0)
rate 28bps
lended: 104 borrowed: 368 giants: 0
tokens: 3266133 ctokens: 84550
class htb 1:121 parent 1:12 prio 0 quantum 1000 rate 4Kbit ceil 96Kbit burst 1604b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 562 bytes 4 pkts (dropped 0, overlimits 0)
lended: 4 borrowed: 0 giants: 0
tokens: 1991999 ctokens: 111600
class htb 1:13 parent 1:1 leaf 130: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:20 parent 1:1 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 6
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:222 parent 1:22 prio 0 quantum 1000 rate 2Kbit ceil 96Kbit burst 1601b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 5126399 ctokens: 114799
class htb 1:30 parent 1:1 leaf 300: prio 0 quantum 1000 rate 1Kbit ceil 128Kbit burst 1600b/8 mpu 0b cburst 1762b/8 mpu 0b level 0
Sent 13539 bytes 33 pkts (dropped 0, overlimits 0)
rate 1bps
lended: 25 borrowed: 8 giants: 0
tokens: 9990399 ctokens: 86150
class htb 1:12 parent 1:1 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 6
Sent 217511 bytes 267 pkts (dropped 0, overlimits 0)
rate 19bps
lended: 35 borrowed: 132 giants: 0
tokens: 1426285 ctokens: 111600
class htb 1:201 parent 1:20 prio 0 quantum 1000 rate 4Kbit ceil 96Kbit burst 1604b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 2567999 ctokens: 114799
class htb 1:21 parent 1:1 leaf 210: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:223 parent 1:22 prio 0 quantum 1000 rate 1Kbit ceil 96Kbit burst 1600b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 10246399 ctokens: 114799
class htb 1:15 parent 1:1 leaf 150: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:224 parent 1:22 prio 0 quantum 1000 rate 1Kbit ceil 96Kbit burst 1600b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 11627 bytes 90 pkts (dropped 0, overlimits 0)
rate 24bps
lended: 57 borrowed: 33 giants: 0
tokens: 7338239 ctokens: 106267
class htb 1:26 parent 1:1 leaf 260: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 15996 bytes 83 pkts (dropped 0, overlimits 0)
rate 1bps
lended: 83 borrowed: 0 giants: 0
tokens: 1426285 ctokens: 111600
class htb 1:14 parent 1:1 leaf 140: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 2906299 bytes 2096 pkts (dropped 0, overlimits 0)
rate 9263bps 6pps
lended: 207 borrowed: 1889 giants: 0
tokens: -862204 ctokens: 14000
class htb 1:162 parent 1:16 prio 0 quantum 1000 rate 3Kbit ceil 96Kbit burst 1602b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 3419733 ctokens: 114799
class htb 1:225 parent 1:22 prio 0 quantum 1000 rate 1Kbit ceil 1Kbit burst 1600b/8 mpu 0b cburst 1600b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 10246399 ctokens: 10246399
class htb 1:252 parent 1:25 prio 0 quantum 1000 rate 4Kbit ceil 96Kbit burst 1604b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 2567999 ctokens: 114799
class htb 1:27 parent 1:1 leaf 270: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:161 parent 1:16 prio 0 quantum 1000 rate 4Kbit ceil 96Kbit burst 1604b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 2567999 ctokens: 114799
class htb 1:17 parent 1:1 leaf 170: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 368346 bytes 418 pkts (dropped 0, overlimits 0)
rate 2701bps 2pps
lended: 164 borrowed: 254 giants: 0
tokens: -73143 ctokens: 82353
class htb 1:24 parent 1:1 leaf 240: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:251 parent 1:25 prio 0 quantum 1000 rate 4Kbit ceil 96Kbit burst 1604b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 2567999 ctokens: 114799
class htb 1:16 parent 1:1 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 6
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:25 parent 1:1 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 6
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:19 parent 1:1 leaf 190: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:18 parent 1:1 leaf 180: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799
class htb 1:28 parent 1:1 leaf 280: prio 0 quantum 1000 rate 7Kbit ceil 96Kbit burst 1607b/8 mpu 0b cburst 1721b/8 mpu 0b level 0
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0
tokens: 1470170 ctokens: 114799