- use "tc" and the QoS-Kernel-Features.

I don't mind recompiling the kernel and would rather use a generic tool useful for system administration later down the road. Looks like tc is the way to go.

It gives you a lot of options. It's in the iproute2-package. It has a little high learning curve, but you can do really interesting things and even simulate higher latencies. For a good introduction see the Linux Advanced Routing and Traffic Control HowTo, http://lartc.org You can use netfilter here, too, to mark the relevant packets.

Eventually I came up with a simple tc config which works for me now but the actual transfer rates are 10 times higher than I would expect:

tc qdisc add dev lo root handle 1: htb r2q 1
tc class add dev lo parent 1: classid 1:10 htb rate 56kbit ceil 56kbit
tc filter add dev lo protocol ip parent 1: prio 1 handle 10 fw flowid 1:10

HTB FAQ: Why HTB sharing setup works with eth0 but on lo (loopback) it exhibits weird rates ? Try to execute ifconfig lo mtu 1500 or use parameter on "tc qdisc add" line. It is because HTB reserves rate table for 1500 bytes long packets and loopback uses 16384 as default.

Except mtu 16400 should be added to the class. Happy now.
Thanks again, Hans. That was quite educational.
Using firewall rules to mark traffic for routing and throttling is cool.
Exactly what I was looking for..
Sasha

--
gentoo-user@gentoo.org mailing list



Reply via email to