From: "Nigel Jones" <jonesn@hursley.ibm.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] shaping from ethernets to adsl
Date: Mon, 11 Feb 2002 22:22:45 +0000 [thread overview]
Message-ID: <marc-lartc-101346620500958@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101327339318927@msgid-missing>
"Martin Devera" <devik@cdi.cz> wrote in message
news:Pine.LNX.4.10.10202092343330.15162-100000@luxik.cdi.cz...
> > I've just realised something though.... How do I allow the total
download
> > bandwidth hitting eth0+eth1 from the net connection (ppp0) to be limited
at
> > 512, but "pooled" it I don't want to divide 256/256 per ethernet
segment.
> > All these restrictions are device specific?
>
> Unfortunately yes. If you want to limit sum of two-interface output
> then you can use my IMQ patch. Vanilla kernel can't do it.
Martin,
Many thanks. I've download the patch (with htb2), and can see that if I run
ifconfig imq up
then the packets appear to get enqueued/dequeued via this new virtual
device imq
So I could create filters on the imq device
So what rate do I specify to htb? 10Mbs?
Do I create a 10Mbs class & try to use this for eth0-eth1 comms? via
iptables --set-mark?
And a 512Mbs class as a wrapper for all ppp->eth0,1 traffic (adsl download)
And a 256Mbs class for all eth0,1->ppp (adsl upload)
Then within each class subdivide as per my requirements.
Is this the approach to take?
This is my attempt so far - does this make sense?
(It doesn't seem to work....)
PATH=/usr/local/bin:$PATH
ifconfig imq up
tc qdisc del root dev imq 2>/dev/null
tc class del root dev imq 2>/dev/null
# INBOUND - 1x OUTBOUND - 2x LOCAL - 3x
# small packets - mark with 3
# These rules don't seem to work. I want the -s & -m ANDED
iptables -t mangle -A OUTPUT -s 192.168.0.1/16 -m length --length 0:500 -j
MARK --set-mark 11
iptables -t mangle -A OUTPUT -s 192.168.0.1/16 -m length --length
500:15000 -j MARK --set-mark 14
iptables -t mangle -A OUTPUT -d 192.168.0.1/16 -m length --length 0:500 -j
MARK --set-mark 21
iptables -t mangle -A OUTPUT -d 192.168.0.1/16 -m length --length
500:15000 -j MARK --set-mark 24
iptables -t mangle -A OUTPUT -s 192.168.0.1/16 -d 192.168.0.1/16 -j
MARK --set-mark 31
#
# root queueing discipline
tc qdisc add dev imq root handle 10: htb default 10
# Base classes for ethernet (10Mbs), adsl up (256), adsl down (512). No
borrowing
tc class add dev imq parent 10: classid 10:10 htb rate 10Mbps ceil 10Mbps
burst 2k prio 3
tc class add dev imq parent 10: classid 10:20 htb rate 512kbps ceil 512kbps
burst 2k prio 3
tc class add dev imq parent 10: classid 10:30 htb rate 256kbps ceil 256kbps
burst 2k prio 3
#
tc class add dev imq parent 10:20 classid 10:21 htb rate 400kbps ceil
500kbps burst 2k prio 4
tc class add dev imq parent 10:20 classid 10:22 htb rate 112kbps ceil
512kbps burst 2k prio 1
tc class add dev imq parent 10:30 classid 10:31 htb rate 200kbps ceil
250kbps burst 2k prio 4
tc class add dev imq parent 10:30 classid 10:32 htb rate 50kbps ceil 250kbps
burst 2k prio 1
tc qdisc add dev imq parent 10:10 sfq quantum 1514b perturb 15
tc qdisc add dev imq parent 10:21 sfq quantum 1514b perturb 15
tc qdisc add dev imq parent 10:22 sfq quantum 1514b perturb 15
tc qdisc add dev imq parent 10:31 sfq quantum 1514b perturb 15
tc qdisc add dev imq parent 10:32 sfq quantum 1514b perturb 15
tc filter add dev imq parent 10: protocol ip handle 31 fw flowid 10:10
tc filter add dev imq parent 10: protocol ip handle 11 fw flowid 10:32
tc filter add dev imq parent 10: protocol ip handle 14 fw flowid 10:31
tc filter add dev imq parent 10: protocol ip handle 21 fw flowid 10:22
tc filter add dev imq parent 10: protocol ip handle 24 fw flowid 10:21
Also a "tc -s class ls dev imq" shows rates that don't match these rules ie:
class htb 10:22 parent 10:20 leaf 803a: prio 1 rate 896Kbit ceil 4Mbit burst
2Kb cburst 6841b
Sent 152 bytes 2 pkts (dropped 0, overlimits 0)
lended: 2 borrowed: 0 giants: 0 injects: 0
tokens: 14115 ctokens: 10578
class htb 10:10 root leaf 8038: prio 3 rate 80Mbit ceil 80Mbit burst 2Kb
cburst 106440b
Sent 56598 bytes 583 pkts (dropped 0, overlimits 0)
rate 719bps 5pps
lended: 583 borrowed: 0 giants: 0 injects: 0
tokens: 153 ctokens: 8310
class htb 10:32 parent 10:30 leaf 803c: prio 1 rate 400Kbit ceil 2000Kbit
burst 2Kb cburst 4159b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 32768 ctokens: 13311
class htb 10:20 root prio 3 rate 4Mbit ceil 4Mbit burst 2Kb cburst 6841b
Sent 152 bytes 2 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 3087 ctokens: 10578
class htb 10:31 parent 10:30 leaf 803b: prio 3 rate 1600Kbit ceil 2000Kbit
burst 2Kb cburst 4159b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 8192 ctokens: 13311
class htb 10:30 root prio 3 rate 2Mbit ceil 2Mbit burst 2Kb cburst 4220b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 6399 ctokens: 13189
class htb 10:21 parent 10:20 leaf 8039: prio 3 rate 3200Kbit ceil 4000Kbit
burst 2Kb cburst 6719b
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
lended: 0 borrowed: 0 giants: 0 injects: 0
tokens: 4096 ctokens: 10752
--
--
jonesn@hursley.ibm.com
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
next prev parent reply other threads:[~2002-02-11 22:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-09 16:49 [LARTC] shaping from ethernets to adsl Nigel Jones
2002-02-09 22:45 ` Martin Devera
2002-02-10 2:25 ` Ross Skaliotis
2002-02-10 10:40 ` Martin Devera
2002-02-11 22:22 ` Nigel Jones [this message]
2002-02-12 10:40 ` Martin Devera
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-101346620500958@msgid-missing \
--to=jonesn@hursley.ibm.com \
--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