From: "Daniel Platts" <daniel@farpoint.gen.nz>
To: lartc@vger.kernel.org
Subject: [LARTC] Shaping multiple subnets that have same traffic types..
Date: Sat, 09 Feb 2002 11:41:54 +0000 [thread overview]
Message-ID: <marc-lartc-101325490811739@msgid-missing> (raw)
Hi All,
I have a box running as a bridge between our local network and the router
which services the connections to our two branch offices. I want to shape
the traffic going to the two branches, so that email and web surfing no
longer hog the connection. I'm not 100% sure about the filter matching to
use for the shaping though because both branches have the same traffic
types, but are on two different subnets..
Branch 1 has a 64kbps link, while Branch 2 has 128kbps. The unusual figures
I've given for the ceilings below are alowing for the compression in the
routers (runs an average of about 1.3:1)
Diagram:
Local Network
(172.16.1.0)
|
eth0
Linux Bridge/Shaper
eth1
|
Router
| |
/ \
64kbps 128kbps
172.16.2.0 172.16.3.0
The traffic classification I want is something like:
| root
(1:)
|
|
(1:1) 10Mbit
/|\
/ | \
/ | \
/(1:50)\
/ \
1:10 / \
1:20
/\
/\
/ \ /
\
2:10 / \ /
\ 3:20
| \
2:20 | | 3:10
And the tc setup script would be something like:
TC=/sbin/tc
$TC qdisc del dev eth1 root 2>/dev/null >/dev/null
$TC qdisc add dev eth1 root handle 1: htb default 50
$TC class add dev eth1 parent 1: classid 1:1 htb rate 10Mbit ceil 10Mbit
burst 8k
$TC class add dev eth1 parent 1:1 classid 1:10 htb rate 64k ceil 88k burst
4k prio 1
$TC class add dev eth1 parent 1:1 classid 1:20 htb rate 128k ceil 168k burst
4k prio 1
$TC class add dev eth1 parent 1:1 classid 1:50 htb rate 32k ceil 48k burst
2k prio 1
$TC class add dev eth1 parent 1:10 classid 2:10 htb rate 48k ceil 72k burst
2k prio 1
$TC class add dev eth1 parent 1:10 classid 2:20 htb rate 16k ceil 36k burst
2k prio 2
$TC class add dev eth1 parent 1:20 classid 3:10 htb rate 96k ceil 144k burst
2k prio 1
$TC class add dev eth1 parent 1:20 classid 3:20 htb rate 32k ceil 56k burst
2k prio 2
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.2.0/24 flowid 1:10
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.3.0/24 flowid 1:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.2.0/24 match ip sport 3389 0xffff flowid 2:10
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.2.0/24 match ip dport 515 0xffff flowid 2:10
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.2.0/24 match ip sport 80 0xffff flowid 2:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.2.0/24 match ip sport 110 0xffff flowid 2:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.2.0/24 match ip sport 3128 0xffff flowid 2:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.3.0/24 match ip sport 3389 0xffff flowid 3:10
$TC filter add dev eth1 parent 1:0 protocol ip prio 1 u32 match ip dst
172.16.3.0/24 match ip dport 515 0xffff flowid 3:10
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.3.0/24 match ip sport 80 0xffff flowid 3:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.3.0/24 match ip sport 110 0xffff flowid 3:20
$TC filter add dev eth1 parent 1:0 protocol ip prio 2 u32 match ip dst
172.16.3.0/24 match ip sport 3128 0xffff flowid 3:20
Does this look right ?? Have I got this completely wrong ??
My only question is about the filters - if I attach them all to the root,
then the first level filters are going to catch everything and I wont be
able to split the traffic types off into the different speed bands.. Is it
now possible to attach my 2nd level filters to the likes of 1:10 and 1:20
instead?? If so, then do I need to match the dst ip again or is that
unneccessary?
Apologies for the long post.
Regards,
Daniel.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
reply other threads:[~2002-02-09 11:41 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-101325490811739@msgid-missing \
--to=daniel@farpoint.gen.nz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox