From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Weighted packet shaping?
Date: Sun, 26 Dec 2004 13:09:42 +0000 [thread overview]
Message-ID: <41CEB816.5030902@dsl.pipex.com> (raw)
In-Reply-To: <20041221034303.GB27656@linux.comp>
Mark Williams (MWP) wrote:
>>
>>Are you sure that FTP is going to class 22 and not default -
>>
>>tc -s qdisc ls dev $INTERFACE or tc -s class ls dev $INTERFACE will show
>>counters.
>
>
> I am.
> I graph using "tc -s qdisc show dev ppp0" with rrdtool.
Ahh, I assume you patched and recompiled your 2.6.8.1.
I just tried the script below on 2.4.24 and 2.6.8.1 and it works as I
expect.
I checked rates with iptraf and tc -s class ls dev ppp0. If you use
htb's rate counter than be aware it uses a long average >60 sec and I
notice that on my 2.6.8.1 setup it says bit where it probably should say
bps (= bytes per sec).
Does it work for you ?
If you want to graph then add some queues.
Andy.
TC=/sbin/tc
IPTABLES=/usr/local/sbin/iptables
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j
MARK --set-mark 21 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j
MARK --set-mark 22 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark
20 &>/dev/null
$IPTABLES -t mangle -D POSTROUTING -o ppp0 -p tcp -m length --length
:128 -j MARK --set-mark 20 &>/dev/null
$TC qdisc del dev ppp0 root &>/dev/null
if ( [ "$1" = "stop" ] )
then
exit
fi
$TC qdisc add dev ppp0 root handle 1: htb default 23
$TC class add dev ppp0 parent 1: classid 1:1 htb rate 220kbit
$TC class add dev ppp0 parent 1:1 classid 1:20 htb rate 120kbit ceil
220kbit prio 1
$TC class add dev ppp0 parent 1:1 classid 1:21 htb rate 50kbit ceil
220kbit prio 2
$TC class add dev ppp0 parent 1:1 classid 1:22 htb rate 25kbit ceil
220kbit prio 3
$TC class add dev ppp0 parent 1:1 classid 1:23 htb rate 25kbit ceil
220kbit prio 4
$TC filter add dev ppp0 parent 1:0 prio 0 protocol ip handle 20 fw
flowid 1:20
$TC filter add dev ppp0 parent 1:0 prio 1 protocol ip handle 21 fw
flowid 1:21
$TC filter add dev ppp0 parent 1:0 prio 2 protocol ip handle 22 fw
flowid 1:22
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.2 -j
MARK --set-mark 21
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp --src 192.168.0.3 -j
MARK --set-mark 22
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p ! tcp -j MARK --set-mark 20
$IPTABLES -t mangle -A POSTROUTING -o ppp0 -p tcp -m length --length
:128 -j MARK --set-mark 20
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next prev parent reply other threads:[~2004-12-26 13:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-21 3:55 [LARTC] Weighted packet shaping? Mark Williams (MWP)
2004-12-22 4:53 ` Mark Williams (MWP)
2004-12-22 9:07 ` Ed Wildgoose
2004-12-22 13:49 ` Andy Furniss
2004-12-22 15:48 ` Mark Williams (MWP)
2004-12-22 22:54 ` Andy Furniss
2004-12-23 10:56 ` Mark Williams (MWP)
2004-12-24 14:08 ` Andy Furniss
2004-12-24 15:19 ` Mark Williams (MWP)
2004-12-24 16:36 ` Andy Furniss
2004-12-26 4:38 ` Mark Williams (MWP)
2004-12-26 13:09 ` Andy Furniss [this message]
2004-12-28 9:35 ` Mark Williams (MWP)
2004-12-29 2:46 ` Andy Furniss
2004-12-29 6:52 ` Mark Williams (MWP)
2004-12-29 13:26 ` Francisco Pereira
2004-12-30 0:05 ` Andy Furniss
2005-01-03 11:22 ` marco ghidinelli
2005-01-04 13:57 ` Andy Furniss
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=41CEB816.5030902@dsl.pipex.com \
--to=andy.furniss@dsl.pipex.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