The invention provides a method and system for lookup of message header information
that has the advantages of low-power, speed, and flexibility. The invention uses
a sequence of pipelined on-chip memories, each having only a portion of the header
information intended for lookup. Each one of the on-chip memories simultaneously
performs a lookup on a portion of the header information, allowing embodiments
of the invention to operate on multiple messages worth of header information substantially
simultaneously. The invention uses a novel data structure for recording destination
addresses in the sequence of on-chip memories, having the property that moving
information about destination addresses, or otherwise responding to changes in
network topology is flexible, while at the same time maintaining relatively dense
usage of the on-chip memories. The novel data structure allows embodiments of the
invention to find the longest match destination address with no substantial additional
processing over random-access memory lookup.