All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Devera <devik@cdi.cz>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] exploring HTB
Date: Sat, 16 Feb 2002 21:42:06 +0000	[thread overview]
Message-ID: <marc-lartc-101389575930043@msgid-missing> (raw)
In-Reply-To: <marc-lartc-101361106601378@msgid-missing>

> What do you do if you have 100 rules of form:
>  if source ip = ip1 then class1
>  if source ip = ip2 then class2
>  if source ip = ip3 then class3
>  ...
> I assume you have to try them until one matches or you run out.

If these are different filters then yes. But you can use u32's hash
to match them all in one step.
 
> However, I believe that you now support filters at interior classes.
> This means that at the top you could do something like
>  if source ip in 10.0.0.0 - 10.0.0.50 then class1
>  if source ip in 10.0.0.51 - 10.0.0.99 then class2
> and then in class1 put filters:
>  if source ip in 10.0.0.0 - 10.0.0.25 then class3
>  if source ip in 10.0.0.26 - 10.0.0.50 then class3
> etc.  Then you'd only have to match o(log(n)) filters.

Oh yes. But the you can't use classes for balancing rates - because
you will need balanced binary tree ..
But if you use inner classes then you are right it will be always
better (faster). But for large ip count I'd use u32 hash table.

devik

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

      parent reply	other threads:[~2002-02-16 21:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-13 14:54 [LARTC] exploring HTB Sumit Pandya
2002-02-13 15:05 ` Stef Coene
2002-02-14 10:59 ` Martin Devera
2002-02-15  9:22 ` Sumit Pandya
2002-02-15 12:01 ` Martin Devera
2002-02-16 20:22 ` Don Cohen
2002-02-16 21:19 ` Martin Devera
2002-02-16 21:33 ` Don Cohen
2002-02-16 21:42 ` Martin Devera [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-101389575930043@msgid-missing \
    --to=devik@cdi.cz \
    --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.