A multi-stage (e.g., two-stage) packet-based lookup process using a
Ternary Content Addressable Memory (TCAM) divided into partitions. The
result of a first stage lookup is used to selectively search one of a
plurality of TCAM partitions during the second stage. A subset of
destination address bits may be used in the first stage to hash to a
selected partition for the second stage. Alternatively, a partitioning
algorithm segments a routing trie into partitions, and then, either a
separate, small TCAM or one of the partitions is used in the first stage
to map a prefix of the destination address to one of the TCAM partitions
for use in the second stage. The "trie-based" algorithms may
advantageously partition the trie such that each second stage partition
comprises a substantially contiguous sequence of routing prefixes in a
post-order traversal of the routing trie, together with one or more
covering prefixes thereof.