All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Tcng and wondershaper
@ 2003-04-20  9:20 Wouter Coppens
  2003-04-20 11:50 ` Martin A. Brown
  2003-04-25  6:36 ` Jacob Teplitsky
  0 siblings, 2 replies; 3+ messages in thread
From: Wouter Coppens @ 2003-04-20  9:20 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

Hey,

 

Has anybody converted the wondershaper to tcng? I'm very interessed in
it and would like to see how it's done.

 

Thanks,

 

Wouter


[-- Attachment #2: Type: text/html, Size: 1765 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LARTC] Tcng and wondershaper
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Martin A. Brown @ 2003-04-20 11:50 UTC (permalink / raw)
  To: lartc

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.

Have you thought of trying to make it yourself?

If you want a few basic examples of tcng, there are a dozen or so simple
examples in the ./examples-ng directory from the tcng distribution, and
there are many syntactic elements in the ./tests directory.  You can look
at my commented examples in my tcng/htb HOWTO [1], and the tcng manual
[2].

Since the wondershaper is so well-documented (rationale and approach), you
should be able to create something similar with tcng.

Ciao for now,

-Martin

 [1]  http://tldp.org/HOWTO/Traffic-Control-tcng-HTB-HOWTO/
 [2]  http://linux-ip.net/gl/tcng/

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LARTC] Tcng and wondershaper
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Teplitsky @ 2003-04-25  6:36 UTC (permalink / raw)
  To: lartc

> 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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-25  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.