netdev
[Top] [All Lists]

Re: [RFC] High Performance Packet Classifiction for tc framework

To: Jamie Lokier <jamie@xxxxxxxxxxxxx>
Subject: Re: [RFC] High Performance Packet Classifiction for tc framework
From: Michael Bellion and Thomas Heinz <nf@xxxxxxxxx>
Date: Tue, 12 Aug 2003 17:39:15 +0200
Cc: "David S. Miller" <davem@xxxxxxxxxx>, hadi@xxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20030812142913.GB18802@mail.jlokier.co.uk>
References: <200307141045.40999.nf@hipac.org> <1058328537.1797.24.camel@jzny.localdomain> <3F16A0E5.1080007@hipac.org> <1059934468.1103.41.camel@jzny.localdomain> <3F2E5CD6.4030500@hipac.org> <1060012260.1103.380.camel@jzny.localdomain> <3F302E04.1090503@hipac.org> <1060286331.1025.73.camel@jzny.localdomain> <3F381B3E.6080807@hipac.org> <20030811224050.59bc36fe.davem@redhat.com> <20030812142913.GB18802@mail.jlokier.co.uk>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.4) Gecko/20030714 Debian/1.4-2
Hi Jamie

You wrote:
You can do it in O(log(n_bits_in_prefix_mask)).

This is achieved using binary search on the prefix lengths which
appear in the table.  (So if only a few prefix lengths are used, the
tree is small).

[example snipped]

That's true for the one dimensional PCP (with prefix rules) if the following condition holds: for all rules r1, r2: (prefix(r1) > prefix(r2)) && (r1 & prefix(r2) == r2 & prefix(r2)) => prio(r1) < prio(r2) [smallest prio wins]

It's quite reasonable to assume that this condition holds
for the one dimensional case since there would be never
matching rules otherwise.

This generalises to multiple dimensions e.g. for doing multiple
prefixes on source+target + different combinations of other bits such
as protocol, TOS etc. - i.e. arbitrary bit-subset classifiers.  The
basic principle and the algorithm are the same.

Hm, how do you want to solve the d-dimensional PCP by doing binary search for each dimension? Remember that PCP is not related to longest prefix matching. Instead priorities are used.

Maybe you should describe in little more detail what you mean
by "This generalises to multiple dimensions ...".


Regards,

+-----------------------+----------------------+
|   Michael Bellion     |     Thomas Heinz     |
| <mbellion@xxxxxxxxx>  |  <creatix@xxxxxxxxx> |
+-----------------------+----------------------+
|    High Performance Packet Classification    |
|       nf-hipac: http://www.hipac.org/        |
+----------------------------------------------+

Attachment: pgpZ4bV2iKDfw.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>