All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] LARTC digest, Vol 1 #689 - 13 msgs (fwd)
@ 2002-07-22 20:54 Jacob Teplitsky
  2002-07-24 14:07 ` Stef Coene
  0 siblings, 1 reply; 2+ messages in thread
From: Jacob Teplitsky @ 2002-07-22 20:54 UTC (permalink / raw)
  To: lartc

> Message: 7
> Date: Mon, 22 Jul 2002 21:13:56 +0300
> From: raptor@unacs.bg
> To: lartc@mailman.ds9a.nl
> Subject: [LARTC] [tcng] htb example and default class
> 
> hi 
> I patched tcng to support htb (it seems to work :") ), now when I try to use it i got this error :
> 
> htb requires one class to be marked as "default"
> 
> If I try to use somewhere "class(default, .....) {}"  i get :
> 
> unrecognized parameter "default"
> 
> I tried also "def", "dfl" nope :"[
> How do u mark some class to be "default" !?! can u give me some example ? (htb preffered).
> 
> 
> Thanx alot in advance
> raptor@unacs.bg
> 
> PS. In fact only gred qdisc has a "default" parameter as I read the docs?!?
> 
> --__--__--
> 
> Message: 9
> From: Stef Coene <stef.coene@docum.org>
> To: raptor@unacs.bg, lartc@mailman.ds9a.nl
> Subject: Re: [LARTC] [tcng] htb example and default class
> Date: Mon, 22 Jul 2002 20:42:01 +0200
> 
> On Monday 22 July 2002 20:13, raptor@unacs.bg wrote:
> > hi
> > I patched tcng to support htb (it seems to work :") ), now when I try t> o
> > use it i got this error :
> >
> > htb requires one class to be marked as "default"
> It's not required if you use the tc command to create a  htb qdisc.  So I>  
> guess it's a small bug in the patch for tcng.
> 
> 
> Stef
> 
> 

===================Here is a sample of  htb tcng script and the output:
> guess it's a small bug in the patch for tcng.
I thought that it is required:
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb default 5 r2q 100
					        ~~~~~~~
- Jacob

dev "eth0" {
egress { 
    $base = 100 * 1kBps;

    class (<$cl1_2>)  if ((raw[6] & 0xfe) = 0);
    class (<$cl1_12>) if (raw[6] = 2);
    class (<$cl1_10>) if (raw[6] = 0);
    class (<$cl1_11>) if (raw[6] = 1);

    
    htb (r2q 100) {
    	class(rate 10 * $base) {
	$cl1_2 =  class (rate  4 * $base, ceil 8 * $base,)  {
		$cl1_10 = class (rate  3 * $base, ceil 10 * $base, prio 1)  { fifo(limit 8p); }
		$cl1_11 = class (rate  1 * $base, ceil 10 * $base, prio 0)  { fifo(limit 8p); }
        	  }
    	}
	$cl1_12 = class (rate  6 * $base, ceil 10 * $base, prio 1, default) { fifo(limit 8p); }
    }
}
}

# ================ Device eth0 ================

tc qdisc add dev eth0 handle 1:0 root dsmark indices 8 default_index 0
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb default 5 r2q 100
tc class add dev eth0 parent 2:0 classid 2:1 htb rate 1000000bps
tc class add dev eth0 parent 2:1 classid 2:2 htb rate 400000bps ceil 800000bps
tc class add dev eth0 parent 2:2 classid 2:3 htb rate 300000bps ceil 1000000bps prio 1
tc qdisc add dev eth0 handle 3:0 parent 2:3 pfifo limit 8
tc class add dev eth0 parent 2:2 classid 2:4 htb rate 100000bps ceil 1000000bps prio 0
tc qdisc add dev eth0 handle 4:0 parent 2:4 pfifo limit 8
tc class add dev eth0 parent 2:0 classid 2:5 htb rate 600000bps ceil 1000000bps prio 1
tc qdisc add dev eth0 handle 5:0 parent 2:5 pfifo limit 8
tc filter add dev eth0 parent 2:0 protocol ip prio 1 tcindex mask 0x7 shift 0
tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 4 tcindex classid 2:4
tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 3 tcindex classid 2:3
tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 2 tcindex classid 2:5
tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 1 tcindex classid 2:2
tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 1:0:0 u32 divisor 1
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x0 0xfe at 6 classid 1:1
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x2 0xff at 6 classid 1:2
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x0 0xff at 6 classid 1:3
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x1 0xff at 6 classid 1:4

_______________________________________________
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] LARTC digest, Vol 1 #689 - 13 msgs (fwd)
  2002-07-22 20:54 [LARTC] LARTC digest, Vol 1 #689 - 13 msgs (fwd) Jacob Teplitsky
@ 2002-07-24 14:07 ` Stef Coene
  0 siblings, 0 replies; 2+ messages in thread
From: Stef Coene @ 2002-07-24 14:07 UTC (permalink / raw)
  To: lartc

> > guess it's a small bug in the patch for tcng.
>
> I thought that it is required:
> tc qdisc add dev eth0 handle 2:0 parent 1:0 htb default 5 r2q 100
> 					        ~~~~~~~
The default parameter is not required for htb.  I have only experience in 
creating htb scripts and I don't know if the tcng generated syntax is bug 
free.

The tcng config you include seems OK to me.  But don't trust me on that :)

Stef

>
> dev "eth0" {
> egress {
>     $base = 100 * 1kBps;
>
>     class (<$cl1_2>)  if ((raw[6] & 0xfe) == 0);
>     class (<$cl1_12>) if (raw[6] == 2);
>     class (<$cl1_10>) if (raw[6] == 0);
>     class (<$cl1_11>) if (raw[6] == 1);
>
>
>     htb (r2q 100) {
>     	class(rate 10 * $base) {
> 	$cl1_2 =  class (rate  4 * $base, ceil 8 * $base,)  {
> 		$cl1_10 = class (rate  3 * $base, ceil 10 * $base, prio 1)  { fifo(limit
> 8p); } $cl1_11 = class (rate  1 * $base, ceil 10 * $base, prio 0)  {
> fifo(limit 8p); } }
>     	}
> 	$cl1_12 = class (rate  6 * $base, ceil 10 * $base, prio 1, default) {
> fifo(limit 8p); } }
> }
> }
>
> # ================================ Device eth0
> ================================
>
> tc qdisc add dev eth0 handle 1:0 root dsmark indices 8 default_index 0
> tc qdisc add dev eth0 handle 2:0 parent 1:0 htb default 5 r2q 100
> tc class add dev eth0 parent 2:0 classid 2:1 htb rate 1000000bps
> tc class add dev eth0 parent 2:1 classid 2:2 htb rate 400000bps ceil
> 800000bps tc class add dev eth0 parent 2:2 classid 2:3 htb rate 300000bps
> ceil 1000000bps prio 1 tc qdisc add dev eth0 handle 3:0 parent 2:3 pfifo
> limit 8
> tc class add dev eth0 parent 2:2 classid 2:4 htb rate 100000bps ceil
> 1000000bps prio 0 
tc qdisc add dev eth0 handle 4:0 parent 2:4 pfifo limit 8
> tc class add dev eth0 parent 2:0 classid 2:5 htb rate 600000bps ceil
> 1000000bps prio 1 
tc qdisc add dev eth0 handle 5:0 parent 2:5 pfifo limit 8
> tc filter add dev eth0 parent 2:0 protocol ip prio 1 tcindex mask 0x7 shift
> 0 
tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 4 tcindex
> classid 2:4 tc filter add dev eth0 parent 2:0 protocol ip prio 1 handle 3
> tcindex classid 2:3 tc filter add dev eth0 parent 2:0 protocol ip prio 1
> handle 2 tcindex classid 2:5 tc filter add dev eth0 parent 2:0 protocol ip
> prio 1 handle 1 tcindex classid 2:2 tc filter add dev eth0 parent 1:0
> protocol ip prio 1 handle 1:0:0 u32 divisor 1 tc filter add dev eth0 parent
> 1:0 protocol ip prio 1 u32 match u8 0x0 0xfe at 6 classid 1:1 tc filter add
> dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x2 0xff at 6 classid
> 1:2 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match u8 0x0
> 0xff at 6 classid 1:3 tc filter add dev eth0 parent 1:0 protocol ip prio 1
> u32 match u8 0x1 0xff at 6 classid 1:4
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.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-07-24 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-22 20:54 [LARTC] LARTC digest, Vol 1 #689 - 13 msgs (fwd) Jacob Teplitsky
2002-07-24 14:07 ` Stef Coene

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.