Maintaining Flow Information

Upon initialization, the data component creates and initializes a flow lookup table in the object cache.

For this reason, it is important to configure a value as large as possible for object-cache. The lookup table is a hashtable used to retrieve forwarding information for flows and is essential for monitoring and flow aging. The code that creates the flow lookup table is in the function process_packet(), in the file monitube-data_packet.c.

The size of the table supported is also important for performance and depends on future testing results, but as a preliminary estimate this example sets the size to store half a million flow hashes. A flow hash is the output of some hash function, with the input being a destination address and destination port in this case.

The hash function output can be thought of in terms of number of bits; this measure is commonly called the width. The wider the output of the hash function is, the larger the table must be, since this table will map (index) a hash output to a table entry. In this example, an entry can contain information for multiple existing flows (also called flow entries).

There is a tradeoff between the table size and the speed of a lookup. This is caused by a larger table (and hash output) having fewer collisions, since the hash function input is wider than its output. When a collision occurs, more than one flow's information goes into 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 (assuming the hash function provides an output with uniform distribution over the output range).

Aging Existing Flows

The aging manager in the data component, scheduled on its own thread, performs this task. If possible, it runs attached to a user-type hardware thread so that it has real-time priority. This thread has the shared responsibility of receiving the configuration updates, and it is also the main thread initially bound to a control-type hardware thread. The code for the aging manager is in the function init_packet_loops(), in the file monitube-data_packet.c.

The aging manager is scheduled to run every 15 seconds. It iterates over the lookup table entries (known flows) and removes entries in the table when they are older than 60 seconds. To do this, it compares the current time to the flow expiration time which was last updated when a packet matching the flow passed through the system.

Monitoring and Mirroring Data


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5