Longest Prefix Search Using Compressed Trees

A router uses the destination address of every incoming packet to decide the proper next-hop information of t he packet. High-speed routers are required to make these decis ions at the speed of several million packets per second. Each sear ch finds the longest prefix match of the destination address amon g all stored prefixes in the router. We proposed the use of prefix trees to represent the set of prefixes to be searched. An effici ent data structure is introduced to compress any prefix tree stru cture such that the number of memory access to find the longest prefix for any address is independent of the stored prefixes, b ut the length of the address. The memory requirement of the compressed trees is shown to be almost optimal. Further reducti on on the memory access and the search time can be achieved by increasing the memory requirement of the tree structure. In particular, we proposed a novel algorithm that requires only fo ur 64-bit memory accesses to find the longest prefix match for eac h IPv4 address in the worst case, while only 3 Mbytes are requir d to store a 128K-entry routing table.