This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.

DirectIPLookup Element Documentation


DirectIPLookup -- Click element; IP routing lookup using direct-indexed tables


DirectIPLookup(ADDR1/MASK1 [GW1] OUT1, ADDR2/MASK2 [GW2] OUT2, ...)

Ports: 1 input, any number of outputs
Processing: push
Drivers: userlevel, bsdmodule
Package: ip (core)


Expects a destination IP address annotation with each packet. Looks up that address in its routing table, using longest-prefix-match, sets the destination annotation to the corresponding GW (if specified), and emits the packet on the indicated OUTput port. Each argument is a route, specifying a destination and mask, an optional gateway IP address, and an output port. No destination-mask pair should occur more than once. DirectIPLookup is optimized for lookup speed at the expense of extensive RAM usage. Each longest-prefix lookup is accomplished in one to maximum two DRAM accesses, regardless on the number of routing table entries. Individual entries can be dynamically added to or removed from the routing table with relatively low CPU overhead, allowing for high update rates. DirectIPLookup implements the DIR-24-8-BASIC lookup scheme described by Gupta, Lin, and McKeown in the paper cited below.


table (read-only)
Outputs a human-readable version of the current routing table.
lookup read-only, requires (parameters)
Reports the OUTput port and GW corresponding to an address.
add (write-only)
Adds a route to the table. Format should be `ADDR/MASK [GW] OUT'. Fails if a route for ADDR/MASK already exists.
set (write-only)
Sets a route, whether or not a route for the same prefix already exists.
remove (write-only)
Removes a route from the table. Format should be `ADDR/MASK'.
ctrl (write-only)
Adds or removes a group of routes. Write `add/set ADDR/MASK [GW] OUT' to add a route, and `remove ADDR/MASK' to remove a route. You can supply multiple commands, one per line; all commands are executed as one atomic operation.
flush (write-only)
Clears the entire routing table in a single atomic operation.


See IPRouteTable for a performance comparison of the various IP routing elements. DirectIPLookup's data structures are inherently limited: at most 2^16 /24 networks can contain routes for /25-or-smaller subnetworks, no matter how much memory you have. If you need more than this, try RangeIPLookup.


IPRouteTable, RangeIPLookup, RadixIPLookup, StaticIPLookup, LinearIPLookup, SortedIPLookup, LinuxIPLookup Pankaj Gupta, Steven Lin, and Nick McKeown. "Routing Lookups in Hardware at Memory Access Speeds". In Proc. IEEE Infocom 1998, Vol. 3, pp. 1240-1247.

Generated by 'click-elem2man' from '../elements/ip/directiplookup.hh' on 7/Mar/2009.


elements/directiplookup.txt · Last modified: 2009/03/07 17:24 (external edit)
Recent changes RSS feed Driven by DokuWiki