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

Re: TBF queuing and tc question



Alohá!

LeVA wrote:

[...]

Thanks Martin, changed this but the 128kbit restriction still don't apply.

So here is again, what I'm doing:



iptables -t mangle -A PREROUTING -d ! 192.168.0.0/24 -j MARK --set-mark 1

tc qdisc add dev eth0 root handle 1:0 htb default 10

tc class add dev eth0 parent 1:0 classid 1:1 htb rate 128kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 100mbit

tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 1 fw classid 1:1


[...]

IIRC You need to create a class inside the root disc from which the subclasses fork in order to shift bandwidth between them. In Your case the 128KBit would have to be borrowed from the 100MBit class. On first sight it also looks kinda impossible that Your 100MBit 1:10 class has the 128kbit 1:1 class as the parent class but that's only a shot in the dark.

Unfortunately I don't have much time right now, but have a look at my router setup in the meantime. This one's directly connected to the modem (ppp0) on eth0 and shapes and prioritizes my ADSL upstream so that interactive traffic (0-500byte) has the highest prio, next is bulk traffic from LAN (eth1), then bulk from the machine itself (one machine in the LAN (192.168.0.1) is in that category as well).

Also I can really recommend http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm - it isn't really step by step but it explains the concept thoroughly. More detailed even: http://www.tldp.org/HOWTO/Traffic-Control-HOWTO/

I'll try to look into Your setup again but I won't have time before next Monday.

Good luck!

Martin

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

iptables -t mangle -A OUTPUT -m length --length 0:500 -j MARK --set-mark 3
iptables -t mangle -A OUTPUT -m length --length 500:1500 -j MARK --set-mark 5

iptables -t mangle -A PREROUTING -i eth1 -m length --length 0:500 -j MARK --set-mark 3 iptables -t mangle -A PREROUTING -i eth1 -m length --length 500:1500 -j MARK --set-mark 4 iptables -t mangle -A PREROUTING -i eth1 -s 192.168.0.1 -m length --length 500:1500 -j MARK --set-mark 5

tc qdisc add dev ppp0 root handle 1: htb default 20

tc class add dev ppp0 parent 1: classid 1:1 htb rate 192Kbit burst 15kb

tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 100Kbit ceil 192Kbit burst 15kb prio 0 tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 100Kbit ceil 180Kbit burst 1kb prio 1 tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 64Kbit ceil 100Kbit burst 1kb prio 2

tc qdisc add dev ppp0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev ppp0 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev ppp0 parent 1:30 handle 30: sfq perturb 10

tc filter add dev ppp0 parent 1:0 protocol ip handle 3 fw flowid 1:10
tc filter add dev ppp0 parent 1:0 protocol ip handle 4 fw flowid 1:20
tc filter add dev ppp0 parent 1:0 protocol ip handle 5 fw flowid 1:30



Reply to: