A method of segmenting Layer 4 packet routing lookups into multiple levels
for sequential search in multiple tables provided in a specially organized
memory device, such as a content addressable memory (CAM). Using a
sequence of limited-width keys, a single CAM (or length-cascaded bank of
CAMs) can be tuned to provided faster and more efficient use of limited
CAM space. Lookups used to process continuous streams of packets (such as
those in the Internet Protocol [IP] format) can be performed with the
present invention in either one-packet-at-a-time sequential order or in a
pipelined fashion. Packet streams arriving on multiple ports of the switch
device can also take advantage of time division multiplexing to employ a
single search engine embodying the present invention.