All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] HTB and filters
@ 2003-03-17 21:01 Stephane Ouellette
  2003-03-17 21:12 ` Stef Coene
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stephane Ouellette @ 2003-03-17 21:01 UTC (permalink / raw)
  To: lartc

Folks,

    after spending a lot of time experimenting with HTB, I found that 
filters cannot be attached to HTB  classes...

The class hierarchy I use is the following (for my upstream internet link):


               PRIO (with priomap that sends everything by default to 
class 1:3)
             /   |   \
            /    |    \
           /     |     \
        1:1     1:2     1:3
      PFIFO    PFIFO    HTB qdisc (default to 4:100)
                         |
                         |
                        4:1
                      HTB class (100% bandwidth)
                      /       \
                     /         \
                 4:100          4:200
          (50% bandwidth)     (50% bandwidth)
          ---- HTB class      HTB class--------\
         /     /   |   \        |   \     \     \
        /     /    |    \       |    \     \     \
   4:110  4:120 4:130 4:140   4:210  4:220 4:230 4:240
    HTB     HTB   HTB   HTB    HTB    HTB   HTB   HTB
     |       |     |     |      |      |     |     |
     |       |     |     |      |      |     |     |
    SFQ     SFQ   SFQ   SFQ    SFQ    SFQ   SFQ   SFQ


NOTES:

Class 1:1 is used for NTP
Class 1:2 is used for DNS and ICMP

Classes 4:100 and 4:200 are used to divide bandwidth between two hosts

Classes 4:110 and 4:210 are used for audio and video traffic
Classes 4:120 and 4:220 are used for interactive traffic  (such as HTTP)
Classes 4:130 and 4:230 are used for bulk traffic  (such as FTP downloads)
Classes 4:140 and 4:240 are used for idle traffic  (such as POP3 and SMTP)


Related tc commands:

# Traffic from $HOST_B must be sent to 4:200
tc filter add dev eth1 parent 4: u32 match ip src $HOST_B flowid 4:200
# Everything else comes from $HOST_A and is sent to 4:100


# For each host, divide the traffic according to its nature
tc filter add dev eth1 parent 4:100 protocol ip prio 10 handle 
$MARK_REALTIME fw flowid 4:110
tc filter add dev eth1 parent 4:100 protocol ip prio 20 handle 
$MARK_INTERACTIVE fw flowid 4:120
tc filter add dev eth1 parent 4:100 protocol ip prio 30 handle 
$MARK_BULK fw flowid 4:130
tc filter add dev eth1 parent 4:100 protocol ip prio 40 handle 
$MARK_IDLE fw flowid 4:140

tc filter add dev eth1 parent 4:200 protocol ip prio 10 handle 
$MARK_REALTIME fw flowid 4:210
tc filter add dev eth1 parent 4:200 protocol ip prio 20 handle 
$MARK_INTERACTIVE fw flowid 4:220
tc filter add dev eth1 parent 4:200 protocol ip prio 30 handle 
$MARK_REALTIME fw flowid 4:230
tc filter add dev eth1 parent 4:200 protocol ip prio 40 handle 
$MARK_REALTIME fw flowid 4:240


If I print statistics, the filters attached to HTB classes never 
match...  :-(

Does anyone know what's going wrong ???

Stephane



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

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

* Re: [LARTC] HTB and filters
  2003-03-17 21:01 [LARTC] HTB and filters Stephane Ouellette
@ 2003-03-17 21:12 ` Stef Coene
  2003-03-17 21:35 ` Stephane Ouellette
  2003-03-17 22:44 ` Stef Coene
  2 siblings, 0 replies; 4+ messages in thread
From: Stef Coene @ 2003-03-17 21:12 UTC (permalink / raw)
  To: lartc

On Monday 17 March 2003 22:01, Stephane Ouellette wrote:
> Folks,
>
>     after spending a lot of time experimenting with HTB, I found that
> filters cannot be attached to HTB  classes...
>
> The class hierarchy I use is the following (for my upstream internet link):
>
>
>                PRIO (with priomap that sends everything by default to
> class 1:3)
>              /   |   \
>             /    |    \
>            /     |     \
>         1:1     1:2     1:3
>       PFIFO    PFIFO    HTB qdisc (default to 4:100)
The default class MUST be a leaf class.  A leaf class is a class with no child 
classes.  If no filter is matched, the packet is dequeued in the default 
class.  This means that no filter is tested so your packets ends in 4:100.  
The filters attached to 4:100 are never checked.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

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

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

* Re: [LARTC] HTB and filters
  2003-03-17 21:01 [LARTC] HTB and filters Stephane Ouellette
  2003-03-17 21:12 ` Stef Coene
@ 2003-03-17 21:35 ` Stephane Ouellette
  2003-03-17 22:44 ` Stef Coene
  2 siblings, 0 replies; 4+ messages in thread
From: Stephane Ouellette @ 2003-03-17 21:35 UTC (permalink / raw)
  To: lartc

Stef Coene wrote:

>On Monday 17 March 2003 22:01, Stephane Ouellette wrote:
>  
>
>>Folks,
>>
>>    after spending a lot of time experimenting with HTB, I found that
>>filters cannot be attached to HTB  classes...
>>
>>The class hierarchy I use is the following (for my upstream internet link):
>>
>>
>>               PRIO (with priomap that sends everything by default to
>>class 1:3)
>>             /   |   \
>>            /    |    \
>>           /     |     \
>>        1:1     1:2     1:3
>>      PFIFO    PFIFO    HTB qdisc (default to 4:100)
>>    
>>
>The default class MUST be a leaf class.  A leaf class is a class with no child 
>classes.  If no filter is matched, the packet is dequeued in the default 
>class.  This means that no filter is tested so your packets ends in 4:100.  
>The filters attached to 4:100 are never checked.
>
>Stef
>
>  
>
Stef,

   If I understand correctly, all filters related to the HTB leaf 
classes should be attached to the HTB qdisc.

   It would have been nice to attach filters to parent HTB classes...

Stephane.



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

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

* Re: [LARTC] HTB and filters
  2003-03-17 21:01 [LARTC] HTB and filters Stephane Ouellette
  2003-03-17 21:12 ` Stef Coene
  2003-03-17 21:35 ` Stephane Ouellette
@ 2003-03-17 22:44 ` Stef Coene
  2 siblings, 0 replies; 4+ messages in thread
From: Stef Coene @ 2003-03-17 22:44 UTC (permalink / raw)
  To: lartc

On Monday 17 March 2003 22:35, Stephane Ouellette wrote:
> Stef Coene wrote:
> >On Monday 17 March 2003 22:01, Stephane Ouellette wrote:
> >>Folks,
> >>
> >>    after spending a lot of time experimenting with HTB, I found that
> >>filters cannot be attached to HTB  classes...
> >>
> >>The class hierarchy I use is the following (for my upstream internet
> >> link):
> >>
> >>
> >>               PRIO (with priomap that sends everything by default to
> >>class 1:3)
> >>             /   |   \
> >>            /    |    \
> >>           /     |     \
> >>        1:1     1:2     1:3
> >>      PFIFO    PFIFO    HTB qdisc (default to 4:100)
> >
> >The default class MUST be a leaf class.  A leaf class is a class with no
> > child classes.  If no filter is matched, the packet is dequeued in the
> > default class.  This means that no filter is tested so your packets ends
> > in 4:100. The filters attached to 4:100 are never checked.
> >
> >Stef
>
> Stef,
>
>    If I understand correctly, all filters related to the HTB leaf
> classes should be attached to the HTB qdisc.
No, I was only speaking about the default class.  You have a filter that put 
some packets in 4:200.  The rest of the traffic goes to the default class 
4:100.  But the packets are immediatly dequeued in class 4:100 so the filters 
attached to 4:100 are never checked.  You can simulate a default class if you 
add a u32 filter with src 0/0.
The default class is for unclassified packets.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

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

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

end of thread, other threads:[~2003-03-17 22:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-17 21:01 [LARTC] HTB and filters Stephane Ouellette
2003-03-17 21:12 ` Stef Coene
2003-03-17 21:35 ` Stephane Ouellette
2003-03-17 22:44 ` 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.