All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] [tcng] exceeding child bandwith only in special cases ?
@ 2002-10-16 11:39 raptor
  2002-10-16 14:42 ` Werner Almesberger
  0 siblings, 1 reply; 2+ messages in thread
From: raptor @ 2002-10-16 11:39 UTC (permalink / raw)
  To: lartc

I was rereading tcng docs... and think i found a possible solution to a scenario i want to implement...i.e.

I want to create channel with rate 64kb/s but be able to jump to 128kb/s if the traffic is destinated to the proxy server... (all other traffic must not exceed 64kb/s)... pseudo-code :


{...
	if src = 192.168.0.1  {  
	  if dst = 192.168.0.15 and class1 has-no-bandwith-available 
		{  class1(rate 64kbps)   }
         else{ class2(rate 64kbps)  }
      } else class1(rate 64kbps)
...
}


i.e only when class1 bandwith is exausted and the traffic is destinated to proxy give another 64kb/s. (if not exhausted use it, if exausted but not destinated to proxy then sorry)
I know that it can possibly be achieved with the Metering primitives, but can figure it out yet.. could u help me..

One other question in this case should classes be parent and child i.e.:

class2(rate 128) {
  class1(rate 64)
}

or siblings :

class1(rate 64) {}
class2(rate 64) {}

which seems more apropriate for the case...

Thanx alot

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

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

* Re: [LARTC] [tcng] exceeding child bandwith only in special cases ?
  2002-10-16 11:39 [LARTC] [tcng] exceeding child bandwith only in special cases ? raptor
@ 2002-10-16 14:42 ` Werner Almesberger
  0 siblings, 0 replies; 2+ messages in thread
From: Werner Almesberger @ 2002-10-16 14:42 UTC (permalink / raw)
  To: lartc

raptor wrote:
> i.e only when class1 bandwith is exausted and the traffic is destinated
> to proxy give another 64kb/s. (if not exhausted use it, if exausted but
> not destinated to proxy then sorry)

First of all, this has not all that much to do with classes,
because metering receives no feedback from queuing. But you
can of course try to build a system without feedback.

> I know that it can possibly be achieved with the Metering
> primitives, but can figure it out yet.. could u help me..

For tcc, that's pretty straightforward, e.g. something like
this:

$low = bucket(rate 64kbps,burst 30kB);
$high = bucket(rate 128kbps,burst 30kB);

$cond = ip_src = 192.168.0.1;
$is_proxy = ip_dst = 192.168.0.15;

egress {
    class (<$good>)
        if $cond && $is_proxy && 
          conform $high && count $low && count $high;
    class (<$bad>)
        if $cond && $is_proxy;

    class (<$good>)
        if $cond &&
          conform $low && count $low && count $high;
    class (<$bad>)
        if $cond;

    class (<$bad>) if 1;

    prio {
        $good = class;
        $bad = class;
    }
}

(For real-life use, you'd probably want to put these meters
in macros, like trTCM and friends.)

Now, this is a metering configuration tcc doesn't understand
yet, so you need to add the following rules to if_u32.c:map:

    /* raptor's VIP band */
    { "n0t0t1c2c3",             "p0uc3 p1uc2 c2" },
    { "n0t1t0c2c3",             "p0uc3 p1uc2 c2" },
    { "n0t0t1c2d",              "p0ud p1uc2 c2" },
    { "n0t1t0c2d",              "p0ud p1uc2 c2" },

(You need the last two if you want to drop instead of using
a "bad" class. And, BTW, why "... p1c2c2" instead of
"... p1uc2 c2" wouldn't work is left as an exercise to the
reader :-)

All this is, of course, completely untested.

> One other question in this case should classes be parent and child i.e.:

There's only one class for both types of traffic :-)

- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, Buenos Aires, Argentina         wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

end of thread, other threads:[~2002-10-16 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-16 11:39 [LARTC] [tcng] exceeding child bandwith only in special cases ? raptor
2002-10-16 14:42 ` Werner Almesberger

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.