Filter based longest prefix match algorithm
First Claim
1. A method of performing a longest prefix match comprising the steps of:
- a) filtering a key into a plurality of filter fields, each of which is associated with a respective filter table;
b) performing a longest prefix match (LPM) operation on each of the filter fields in their respective filter tables, wherein each LPM operation yields a result indicating lengths of prefixes potentially matching the key;
c) intersecting the results to obtain a set of potential prefix lengths; and
d) performing a series of hash lookups, based on the previously indicated potential prefix lengths, beginning with the longest potential prefix length and progressing to successively shorter potential prefix lengths until a matching prefix is found, which is the longest prefix matching the key.
4 Assignments
0 Petitions
Accused Products
Abstract
Methods directed to longest prefix matching and systems directed to IP address lookups are presented. The methods and systems relate in particular to IPv6 and comprise finding the longest prefix match (LPM) for an IP address. The method of the invention results in the use of filters to perform LPM. In embodiments of the invention, partial address filtering is used to further reduce filtering requirements. Reducing the number of filtering operations has the advantage of making the LPM algorithm faster and less costly to implement than prior art approaches. Also described is an “ideal offset filter” that extracts a fixed sized sliding window of bits from the IP address being processed.
85 Citations
22 Claims
-
1. A method of performing a longest prefix match comprising the steps of:
-
a) filtering a key into a plurality of filter fields, each of which is associated with a respective filter table;
b) performing a longest prefix match (LPM) operation on each of the filter fields in their respective filter tables, wherein each LPM operation yields a result indicating lengths of prefixes potentially matching the key;
c) intersecting the results to obtain a set of potential prefix lengths; and
d) performing a series of hash lookups, based on the previously indicated potential prefix lengths, beginning with the longest potential prefix length and progressing to successively shorter potential prefix lengths until a matching prefix is found, which is the longest prefix matching the key. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A system for performing a longest prefix match, comprising:
-
a plurality of filter fields each created by filtering a key, each filter field being associated with a respecting filter table;
means to perform a longest prefix match (LPM) operation on each of the filter fields in their respective filter tables, wherein each LPM operation yields a result indicating potential prefix lengths of a longest prefix matching the key;
means to intersect the results to obtain a set of potential prefix lengths; and
means to search multiple logical hash tables, each associated with a specific prefix length, for a longest prefix match, in a linear fashion, wherein the search is performed using the set of potential prefix lengths starting at the longest potential prefix length and progressing to successively shorter potential prefix lengths until a matching prefix is found. - View Dependent Claims (18, 19, 20, 21, 22)
-
Specification