> On 3 Mar, 2017, at 01:16, John Yates <j...@yates-sheets.org> wrote:
> 
> What are the requirements for this hashing function?
> - How much data is being hashed?  I am guessing a limited number of bytes 
> rather than an entire packet payload.

Generally it’s what we call the “5-tuple”: two addresses (which could be IPv4, 
IPv6, or potentially Ethernet MAC), two port numbers (16 bits each), and a 
transport protocol ID (1 byte).

In Cake, the hash function is by default run three times, in order to get 
separate hashes over just the source address and just the destination address, 
as well as the full 5-tuple.  These are necessary to operate the triple-isolate 
algorithm.  There may be an opportunity for optimisation by producing all three 
hashes in parallel.

> - What is the typical number of hash table buckets?  Is it prime or a power 
> of 2?

It’s a power of two, yes.  The actual number of buckets is 1024, but Cake uses 
the full 32-bit hash as a “tag” for hash collision detection without having to 
store and compare the entire 5-tuple.

 - Jonathan Morton


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to