[P4-dev] search in p4 tables
antonin at barefootnetworks.com
Mon Jul 17 17:16:48 EDT 2017
As Nate wrote, if you only have one or two tables in your P4 program, they
will probably not be the bottleneck.
To answer your question though:
1) exact match tables are implemented using hash tables and the lookup time
doesn't depend on the number of entries N
2) LPM tables are implemented using some kind of trie and lookup time also
should be mostly independent of N
3) ternary and range tables are implemented using a linear search and
lookup time is in O(N). However, I use a hash table cache ahead of the
lookup table, which means that packets belonging to the same "flow" will be
processed in constant time, only the first packet of the flow will incur a
linear search through the table. By "flow" I mean all the packets for which
the header fields used in the table match key have the same value.
On Mon, Jul 17, 2017 at 12:40 PM, Nate Foster <jnfoster at cs.cornell.edu>
> Use the source, Luke :-)
> It's hard to say why without knowing more about the setup used to drive
> your experiments, but it may well be that table lookup time is negligible
> compared to all the other overheads inherent in processing packets using a
> (largely unoptimized) software switch.
> On Mon, Jul 17, 2017 at 12:18 PM, Wallas Fróes <wallasync at gmail.com>
>> Someone know to informe me what is the search algorith used for the
>> I am realizy some tests and when I use few rules the rtt time is equal
>> when I use the table full.
>> Someone know the why of that it?
>> Wallas Fróes
>> Student of master degree in the PGCOMP (UFBA)
>> Information Security in Computer Networks
>> Computer Engineer
>> Cel: (77) 98841-0762
>> P4-dev mailing list
>> P4-dev at lists.p4.org
> P4-dev mailing list
> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev