Longest prefix match lookup using hash function
First Claim
1. A computer readable storage medium containing a plurality of data structures for finding a longest prefix match for a variable length search key, when conducting a search through a Virtual Private Network (VPN) routing table for at least one search tree, comprising:
- a pattern or key that is to be searched;
program instructions for hashing N most significant bits of an Internet Protocol (IP) destination address with a virtual private network number and for concatenating the remaining least significant bits of Internet Protocol destination address to the result of the hash operation to form said pattern or key;
a direct table that stores a first address location for a search tree;
program instructions for inputting the hashed portion of the search key into a direct table within the routing table structure wherein the direct table represents a plurality of root nodes of search trees to thereby determine the longest prefix match;
each entry inputted into direct table includes at least one search control block;
a next pattern address that points to a next pattern search control block, a leaf control block address that points to a leaf or result, a next bit or bits to test, and a direct leaf;
a plurality of pattern search control blocks (PSOBs) that each represent a branch in the search tree; and
a plurality of leaves wherein each leaf is an address location for the result of a search.
0 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus are used for finding the longest prefix match in a variable length prefix search when searching a direct table within a routing table structure of a network processor. The search through the routing table structure is expedited by hashing a first segment of an internet protocol address with a virtual private network number followed by concatenating the unhashed bits of the IP address to the result of the hash operation to form an input key. Patterns are compared a bit at a time until an exact match or the best match is found. The search is conducted in a search tree that provides that the matching results will be the best possible match.
73 Citations
18 Claims
-
1. A computer readable storage medium containing a plurality of data structures for finding a longest prefix match for a variable length search key, when conducting a search through a Virtual Private Network (VPN) routing table for at least one search tree, comprising:
-
a pattern or key that is to be searched; program instructions for hashing N most significant bits of an Internet Protocol (IP) destination address with a virtual private network number and for concatenating the remaining least significant bits of Internet Protocol destination address to the result of the hash operation to form said pattern or key; a direct table that stores a first address location for a search tree; program instructions for inputting the hashed portion of the search key into a direct table within the routing table structure wherein the direct table represents a plurality of root nodes of search trees to thereby determine the longest prefix match; each entry inputted into direct table includes at least one search control block;
a next pattern address that points to a next pattern search control block, a leaf control block address that points to a leaf or result, a next bit or bits to test, and a direct leaf;a plurality of pattern search control blocks (PSOBs) that each represent a branch in the search tree; and a plurality of leaves wherein each leaf is an address location for the result of a search. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A computer system comprising an apparatus and including a computer processing device having the capability of conducting a search responsive to a request through a virtual private network routing table, involving the steps of:
-
a) forming a search key by hashing a first segment of an internet protocol (IP) destination address with a virtual private network (VPN) number to form a hashed portion and concatenating the remaining segment of the internet protocol address; b) inputting the hashed portion of the search key into a direct table within a network routing table structure wherein the direct table represents root nodes of search trees, the inputting including determining the direct table entry correlating to a new route;
further providing thatif the direct table entry is empty, the entry is added directly to direct table; if the distinguishing bit position is greater than bit 28, the entry is added normally; if the distinguishing bit position is bit 28 or less; if the first pattern search control block (PSCB) in place is greater than bit 28, the PSCB is added to resolve a new VPN from existing VPN; using bit 28 if distinguishing; otherwise, using first distinguishing bit, then adding PSCB at bit 28 for each VPN; if the first PSCB in place is less than bit 28 (multiple VPNs already in place) using bit 28 if distinguishing; otherwise, using first distinguishing bit and then adding PSCB at bit 28 for new VPN;
thenc) determining the longest prefix match for the search key within the routing table, the imputing comprising the steps of; determining a direct table entry correlating to a new route; if the direct table entry is empty, adding the entry directly to the direct table; if the distinguishing bit position is greater than bit 28, insert normally; if the distinguishing bit position is bit 28 or less; if the first pattern search control block (PSCB) in place is greater than bit 28, add the PSCB to resolve a new VPN from the existing VPN; use bit 28 if distinguishing; otherwise, use first distinguishing bit, then add a PSCB at bit 28 for each VPN; if the first PSCB in place is less than bit 28 (multiple VPNs already in place), use bit 28 if distinguishing. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. A method of executing a program on a computer system for determining a longest prefix match for a variable length search key by conducting a search through a virtual private network (VPN) routing table structure for at least one search tree, comprising:
-
providing a computer system; hashing the N most significant bits of an internet protocol (IP) destination address with a virtual private network number, and concatenating the remaining least significant bits of the IP destination address to the result of the hash operation to form a search key; thereafter deleting a route from the direct table comprising the steps of; determining the direct table entry correlating to the route to be deleted; if the route to be deleted is at the direct table entry, delete the route from the direct table normally; if the distinguishing bit position is greater than bit 28, delete normally; if the distinguishing bit position is bit 28, or if next PSCB is with only one choice at bit 28; if no previous PSCBs in place remove the PSCB, and use direct table entry to point directly; if at least one previous PSCB in place remove the PSCB normally; if the distinguishing bit position has one or more subsequent PSCBs prior to the PSCB at bit 28, remove the PSCB normally.
-
Specification