摘要 |
One embodiment of the present invention provides a router. The router includes a storage, a forwarding table management mechanism, and a longest prefix matching mechanism. The storage stores, in a data structure corresponding to a rich prefix node associated with a trie, a plurality of network address prefixes represented by the trie. The forwarding table management mechanism expresses a respective network address prefix using one or more of: 1) a traversal path on the trie from a root node to a subtrie of the trie; and 2) an encoded representation of a node in the subtrie. The longest prefix matching mechanism matches a network address with a longest prefix from the network address prefixes stored in the data structure corresponding to the prefix node.
|