The table is defined in the file
hashtable_t * sessions_table. It is initialized in the function
init_packet_loops(), which is called at the end of the function
The hashtable is used for load balancing and session aging (flow aging since the last-observed traffic.) Aging, which is done in the
aging_cleanup() function, removes entries from the table, whereas the function
process_packet() adds entries. The application also looks up forwarding information for flows in the table.
It is important to configure the largest possible size for
object-cache to handle this table. For more information on configuring the application, see Configuring the Application.
The size of the table supported is also important for performance, and the recommended size will depend on future testing results; this example sets the size to store half a million flow hashes.
For this application, a flow hash is the output of a hash function whose input is the source and destination addresses. The hash function output can be thought of as a number of bits, commonly measured in the width. The wider the output of the hash function is, the larger the table must be, since the table will map (index) a hash output to a table entry. In this table, an entry can contain information for multiple existing flows or session entries.
There is a tradeoff between the table size and the speed of a lookup. A larger table (and hash output) has fewer collisions because the hash function has a wider input than output. When a collision happens, more than one flow's information is in a list attached to each table entry. Searching this list for an exact match takes extra time, and the lists can be expected to be shorter when the size of the lookup table is larger.