shaping: balancing hosts, then connections

green <[email protected]>
Newsgroups gmane.linux.debian.devel.firewall
Message-ID <20100312180935.GS10417@swansys>
I have HTB shaping set up on internet interface eth0 with rate limiting.
# tc qdisc add dev eth0 root handle 1: htb default 13
# tc class add dev eth0 parent 1:0 classid 1:1 htb rate ${UP}bps ceil ${UP}bps

Then split into 3 groups by MARKs:
# tc filter add dev eth0 parent 1: handle 21 protocol ip \
  u32 match mark 0x00001 0x0000F flowid 1:11
# tc filter add dev eth0 parent 1: handle 22 protocol ip \
  u32 match mark 0x00002 0x0000F flowid 1:12
# tc filter add dev eth0 parent 1: handle 23 protocol ip \
  u32 match mark 0x00003 0x0000F flowid 1:13

One of those groups:
# ttc class add dev eth0 parent 1:1 classid 1:11 \
  htb rate $( echo "$UP * 0.8" | bc )bps ceil ${UP}bps prio 1

Now this would logically follow:
# tc qdisc add dev eth0 parent 1:11 handle 11: sfq perturb 10

But I want to balance hosts, not flows/connections, so I include:
# tc filter add dev eth0 parent 11: handle 1 protocol ip \
  flow hash keys nfct-src divisor 1024

Which I think works.  But then multiple connections on a single host are not 
fairly balanced.  How can I do that?

More specifically: I would like, for each group like 1:11, to shape traffic in 
this order:
- source host balance (like SFQ and nfct-src)
- PRIO qdisc (for TOS especially) for each
- SFQ (for flows/connections) for each PRIO qdisc

I do not have a static set of source hosts.

Alternative methods are welcome, especially if they accomplish the same thing.

Thanks.
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuag18ACgkQ682C+dBP+oRq3wCdGcTta6U5Puhx8vaL0l5DJkY9
dNoAn36qGWGgt3eWjX9VaYOZqypBhDED
=xHQZ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.