From: Jacob Teplitsky <jacobt@bivio.net>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Tcng and wondershaper
Date: Fri, 25 Apr 2003 06:36:52 +0000 [thread overview]
Message-ID: <marc-lartc-105125266013462@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105083050401958@msgid-missing>
> Wouter,
>
> : Has anybody converted the wondershaper to tcng? I'm very interessed in
> : it and would like to see how it's done.
>
> I would love to do this--I simply haven't made the time to do so yet. I
> would imagine somebody will beat me to it, but if not, I'll have my
> variant available at some point in the future, and I'll remember to post a
> note here to let people know it's available.
>
Here is a first untested draft of wshaper_tcng.htb:
- Jacob
#!/bin/bash
# Wonder Shaper
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed.
#Set the device that is to be shaped.
DEV=ppp0
# Set uplink, downlink and worse fate claasifier. Search for downlink, uplink and worse_fate.
#Now remove the following two lines :-)
echo Please read the documentation in 'README' first
exit
if [ "$1" = "status" ]
then
tc -s qdisc ls dev $DEV
tc -s class ls dev $DEV
exit
fi
# clean existing down- and uplink qdiscs, hide errors
tc qdisc del dev $DEV root 2> /dev/null > /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
if [ "$1" = "stop" ]
then
exit
fi
tcc -Xp,-DDEVICE=$DEV <<EOF | /bin/bash -v
// Set the following values to somewhat less than your actual download and uplink speed.
\$downlink = 800 kbps;
\$uplink = 220 kbps;
// some traffic however suffers a worse fate
\$worse_fate = 1;
/*
\$worse_fate (ip_src != 1.1.1.1 && ip_src:24 = 1.1.1.0 && ip_dst:24 = 2.2.2.0 &&
tcp_sport = PORT_SSH) ||
ip_tos != 0x10 || tcp_dport >= 2000;
!!!!!!! Do NOT use ip_src = 1.1.1.0/24 or ip_src:24 = 1.1.1.1 !!!!!!!
*/
#define xstr(s) str(s)
#define str(s) #s
dev xstr(DEVICE) {
ingress {
\$all_pol = SLB(cir \$downlink, cbs 10 kB);
class (<>) if SLB_ok(\$all_pol);
drop if 1;
}
egress {
class (<\$interactive>) if
// ICMP (ip protocol 1) in the interactive so we
// can do measurements & impress our friends:
ip_proto = IPPROTO_ICMP ||
// TOS Minimum Delay (ssh, NOT scp) :
ip_tos = 0x10 ||
// To speed up downloads while an upload is going on, put ACK packets in
// the interactive class:
(tcp_ACK && ip_len < 64);
// some traffic however suffers a worse fate
class (<\$worse_fate_class>) if \$worse_fate;
// bulk & default class
class (<\$bulk>) if 1;
htb () {
class (rate \$uplink, burst 6kB) {
\$interactive = class (prio 1 ,rate \$uplink) {sfq (perturb 10 sec);};
\$bulk = class (prio 2, rate 0.9 *\$uplink) {sfq(perturb 10 sec);};
\$worse_fate_class = class (prio 3, rate 0.8 *\$uplink) {sfq(perturb 10 sec);};
}
}
}
}
EOF
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
prev parent reply other threads:[~2003-04-25 6:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-20 9:20 [LARTC] Tcng and wondershaper Wouter Coppens
2003-04-20 11:50 ` Martin A. Brown
2003-04-25 6:36 ` Jacob Teplitsky [this message]
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-105125266013462@msgid-missing \
--to=jacobt@bivio.net \
--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.