From: Jonathan Naylor <jonathan.naylor@w3z.co.uk>
To: lartc@vger.kernel.org
Subject: [LARTC] Sharing of qdiscs
Date: Thu, 20 Nov 2003 09:16:52 +0000 [thread overview]
Message-ID: <marc-lartc-106932127720314@msgid-missing> (raw)
If this question is answered in the FAQ, then I apologise.
I am using the HTB qdisc (with SFQ underneath it) to shape traffic for an ISP.
It works extremely well, certainly much better than the Linux Bandwidth
Arbitrator I was using before. However I have a question about setting it up.
At present I have a set of filters that allocate one IP address per HTB
shaping rule underneath it in the tree structure. There is a HTB at the top
of the tree capping the whole lot to the bandwidth of the leased line to the
Internet.
My current system is similar to this:
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 2048kbit burst 10kbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 10.0.0.1
flowid 1:2
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 512kbit burst 10kbit
tc qdisc add dev eth0 parent 1:2 handle 2: sfq perturb 10
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 10.0.0.2
flowid 1:3
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 512kbit burst 10kbit
tc qdisc add dev eth0 parent 1:3 handle 3: sfq perturb 10
.
.
.
My question is, can I share leaf HTBs with the same characteristics between
multiple filters and get the same effect as having one HTB per IP address. To
create something like this:
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 2048kbit burst 10kbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 10.0.0.1
flowid 1:2
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 10.0.0.2
flowid 1:2
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 512kbit burst 10kbit
tc qdisc add dev eth0 parent 1:2 handle 2: sfq perturb 10
The important point that I want to ensure is that *each* address gets a 512kb
bandwidth, and not a single 512kb bandwidth shared between the two (or more)
of them.
Finally if the above is acceptable, would the following work also. Our
addresses are very logical, each class B subnet of the 10.x.y.z address space
represents a different speed class, thefore could I do something like:
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 2048kbit burst 10kbit
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src
10.0.0.0/16 flowid 1:2
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 512kbit burst 10kbit
tc qdisc add dev eth0 parent 1:2 handle 2: sfq perturb 10
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src
10.1.0.0/16 flowid 1:3
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 256kbit burst 10kbit
tc qdisc add dev eth0 parent 1:3 handle 3: sfq perturb 10
.
.
.
I have been reading the section on using hashing tables to manage large
tables, but we are well short of needing it so far, and the above if it were
to work is a much cleaner configuration AFAICS.
Jonathan
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
reply other threads:[~2003-11-20 9:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-lartc-106932127720314@msgid-missing \
--to=jonathan.naylor@w3z.co.uk \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.