BSDIP6LOOKUP

NAME
SYNOPSIS
DESCRIPTION
ELEMENT HANDLERS
EXAMPLES
SEE ALSO

NAME

BSDIP6Lookup − Click element; IPv6 routing lookup using a variant of PATRICIA trie

SYNOPSIS

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

Ports: any number of inputs, any number of outputs
Processing
: push
Package
: ip6 (core)

DESCRIPTION

Expects a destination IPv6 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 may occur more than once.

BSDIP6Lookup is optimized for fast database updates, while longest-prefix lookups are accomplished in at most O(W) time, where W is the width of the search key. The implementation is based on the historic PATRICIA trie lookup scheme borrowed from FreeBSD, described by Keith Sklower in the paper cited below.

ELEMENT HANDLERS

table (read-only)

Outputs a human-readable version of the current routing table.

lookup (read-only)

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.

remove (write-only)

Removes a route from the table. Format should be ‘ADDR/MASK’.

flush (write-only)

Clears the entire routing table in a single atomic operation.

status (read-only)

Outputs human-readable report on current database state.

EXAMPLES

rt :: BSDIP6Lookup(
10::/128 ::0 0,
10:20::/128 ::0 0,
10::/30 ::0 1,
10:20::/30 ::0 2,
0::ff:0:0/96 ::0 3,
::0/0 10::2 1

);

... -> GetIP6Address(24) -> rt;

rt[0] -> ... rt[1] -> ...

SEE ALSO

BSDIPLookup(7), LookupIP6Route(7)

Keith Sklower. "A tree-based packet routing table for Berkeley UNIX". In Proc. USENIX Winter 1991 Technical Conference, pp. 93-104.