Method and apparatus for determining a longest matching prefix from a dictionary of prefixes
First Claim
1. Method for determining a longest matching prefix from a dictionary of prefixes compared with an input string, the method comprising the steps of:
- providing a set of registers for executing a search engine configured to search the prefixes of the dictionary, each register of the set containing a value specified by a number of bits;
comparing, in parallel, the values of the registers with a corresponding number of bits of the input string beginning with a first bit of the input string;
specifying a number of matching bits as an output of each register whose value equals the corresponding number of bits of the input string; and
selecting the register having a largest number of matching bits as the longest match.
3 Assignments
0 Petitions
Accused Products
Abstract
An arrangement efficiently renders forwarding decisions for a packet using a forwarding database dictionary of an intermediate node configured to optimize space consumed by addresses stored therein as well as to reduce time required to search those addresses. The arrangement generally includes a lookup mechanism comprising a search engine coupled to a set of registers and to the dictionary. The register set, in turn, comprises a number of registers operating in parallel to compare values specified by a number of bits with a predetermined starting point of an input string. The specified values are preferably representative of address prefixes stored in the dictionary and the input string is a destination address of the packet.
-
Citations
17 Claims
-
1. Method for determining a longest matching prefix from a dictionary of prefixes compared with an input string, the method comprising the steps of:
-
providing a set of registers for executing a search engine configured to search the prefixes of the dictionary, each register of the set containing a value specified by a number of bits; comparing, in parallel, the values of the registers with a corresponding number of bits of the input string beginning with a first bit of the input string; specifying a number of matching bits as an output of each register whose value equals the corresponding number of bits of the input string; and selecting the register having a largest number of matching bits as the longest match. - View Dependent Claims (2, 3)
-
-
4. A computer readable medium containing executable program instructions for creating a search engine configured to determine a longest matching prefix from a dictionary of prefixes compared with an input string, the executable program instructions comprising program instructions for:
-
allocating a fixed number of registers within a register set as hash buckets with predetermined designations; assigning each prefix to one of the hash buckets having a matching designation; expanding the predetermined designation of each hash bucket if there is a common substring of values among the prefixes assigned to each hash bucket; determining if there are any remaining registers of the register set; determining if there are any registers with more than one assigned prefix; and if not, providing an optimized search engine. - View Dependent Claims (5, 6, 7, 8)
-
-
9. A computer readable medium containing executable program instructions for executing a search engine configured to determine a longest matching prefix from a dictionary of prefixes compared with an input string, the executable program instructions comprising program instructions for:
-
initializing k=1, wherein k is a variable that specifies a starting bit position of the input string; initializing a longest match prefix variable to a false value; loading each register of a register set with a common substring of prefix values, a number of matching bits and a pointer referencing a data structure containing values for loading the registers; comparing contents of each register with the input string beginning with a k bit of the input string; providing the number of matching bits as an output of each register; comparing the outputs of all matching registers; determining whether there is a match between the contents of any register and the input string; and if not, specifying a longest match equal to the contents of the longest match prefix variable. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. Apparatus for determining a longest matching prefix from a dictionary of prefixes compared with an input string, the apparatus comprising:
-
a set of registers for searching the prefixes of the dictionary, each register of the set containing a value specified by a number of bits; a search engine for comparing, in parallel, the values of the registers with a corresponding number of bits of the input string beginning with a first bit of the input string; means for specifying a number of matching bits as an output of each register whose value equals the corresponding number of bits of the input string; and means for selecting the register having a largest number of matching bits as the longest match. - View Dependent Claims (16, 17)
-
Specification