Method of and apparatus for generating a tree data structure supporting longest match lookup
First Claim
1. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value and associated data, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having a prefix that is identical to said prefix of said new data element; and
replacing associated data stored in said node of said respective one of said plurality of records with said associated data of said new data element.
10 Assignments
0 Petitions
Accused Products
Abstract
A multi-way tree data structure is provided that supports a longest match lookup. Data elements stored therein that have no overlapping prefixes are arranged in a standard B-tree arrangement. Data elements that have overlapping prefixes are arranged within the tree such that a respective one of these prefixes contains the prefixes of all such data elements that succeed it.
81 Citations
137 Claims
-
1. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value and associated data, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having a prefix that is identical to said prefix of said new data element; and
replacing associated data stored in said node of said respective one of said plurality of records with said associated data of said new data element. - View Dependent Claims (2, 3, 4)
(a) defining a current record to be said root record;
(b) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) repeating step (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- said method comprising the steps of;
-
5. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record; and
inserting, when said respective one of said plurality of records is included in a linked structure that is within said data structure and that is external to but linked to said balanced tree, said new data element into said linked structure. - View Dependent Claims (6, 7, 8, 9, 10, 11, 12, 13, 14)
(a) defining a current record to be said root record;
(b) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) repeating step (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- said method comprising the steps of;
-
11. The method of claim 5 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
12. The method of claim 11 wherein a pointer that extends from a record within said balanced tree points to a location in said linked structure that is closest to said root record.
-
13. The method of claim 11 wherein a pointer extending from said location in said linked structure that is closest to said root record and a pointer extending from a location in said linked structure that is further from said root record each point to a further root record of a sub-portion of said balanced tree.
-
14. The method of claim 11 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
15. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record; and
inserting, when said respective one of said plurality of records is included in said balanced tree but is pointed to by a pointer extending from a linked structure that is within said data structure and that is external to said balanced tree, said new data element into said linked structure. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23)
(a) defining a current record to be said root record;
(b) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) repeating step (b) said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- said method comprising the steps of;
-
20. The method of claim 15 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
21. The method of claim 20 wherein a pointer that extends from a record within said balanced tree points to a location in said linked structure that is closest to said root record.
-
22. The method of claim 20 wherein a pointer extending from said location in said linked structure that is closest to said root record and a pointer extending from a location in said linked structure that is further from said root record each point to a further root record of a sub-portion of said balanced tree.
-
23. The method of claim 20 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
24. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record;
inserting, when said respective one of said plurality of records is included in said balanced tree and is not pointed to by a pointer extending from a linked structure that is within said data structure and that is external to said balanced tree, a new linked structure at a location within said data structure that immediately precedes said respective one of said plurality of records;
wherein a pointer previously pointing to said respective one of said plurality of records now points to a first record of said new linked structure, and a pointer extending from a location within said linked structure that is closest to said root record and a pointer extending from a location within said linked structure that is furthest from said root record each point to said respective one of said plurality of records; and
inserting said new data element into a node nearest to said root node within said new linked structure. - View Dependent Claims (25, 26, 27, 28, 29, 30)
(a) defining a current record to be said root record;
(b) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) repeating step (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- said method comprising the steps of;
-
29. The method of claim 24 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
30. The method of claim 29 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
31. A method of inserting a new data element into a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a leaf record of said plurality of records having a prefix that contains said prefix of said new data element and that is closest to said root record;
replacing a data element stored in said node in said leaf record with said new data element; and
inserting said data element previously stored in said node in said leaf record into said data structure. - View Dependent Claims (32, 33, 34, 35, 36, 37, 38)
inserting a new linked structure at a location immediately preceding said leaf record;
wherein a pointer previously pointing to said respective one of said plurality of records now point to a first record of said new linked structure, and a pointer extending from a location within said linked structure is closest to said root record and a pointer extending from a location within said linked structure that is furthest from said root record each point to said leaf record;
moving a data element stored in said node in said leaf record into a node nearest to said root node within said new linked structure; and
inserting said new data element into said node in said leaf record.
- said method comprising the steps of;
-
33. The method of claim 31 wherein at least one of said plurality of data elements and said new data element includes associated data.
-
34. The method of claim 31 wherein each of said plurality of records includes at most three nodes and four pointers.
-
35. The method of claim 31 wherein said address values are IP addresses.
-
36. The method of claim 31 wherein said locating step comprises the steps of:
-
(a) defining a current record to be said root record;
(b) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) repeating step (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
-
-
37. The method of claim 31 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
38. The method of claim 37 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
39. A method of deleting a data element from a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having said data element; and
removing, when said respective one of said plurality of records is included in a linked structure that is within said data structure and that is external to but linked to said balanced tree, said data element from linked structure. - View Dependent Claims (40, 41, 42, 43, 44, 45, 46, 47)
- said method comprising the steps of;
-
48. A method of deleting a data element from a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a node in a respective one of said plurality of records having said data element;
removing, when said respective one of said plurality of records is not included in a linked structure, any linked structure within said data structure having a pointer that points to said respective one of said plurality of records such that a pointer that previously pointed to said linked structure points to said respective one of said plurality of records;
removing said data element from said respective one of said plurality of records and rearranging said balanced tree portion of said data structure; and
reinserting into said data structure, one data element at a time, any data elements previously stored in said linked structure. - View Dependent Claims (49, 50, 51, 52, 53, 54, 55, 56)
- said method comprising the steps of;
-
57. An apparatus for inserting a new data element into a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value and associated data, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having a prefix that is identical to said prefix of said new data element; and
means for replacing associated data stored in said node of said respective one of said plurality of records with said associated data of said new data element. - View Dependent Claims (58, 59, 60)
(a) means for defining a current record to be said root record;
(b) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) means for repeating element (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value and associated data, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
61. An apparatus for inserting a new data element into a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record; and
means for inserting, when said respective one of said plurality of records is included in a linked structure that is within said data structure and that is external to but linked to said balanced tree, said new data element in said new data structure. - View Dependent Claims (62, 63, 64, 65, 66, 67, 68, 69, 70)
(a) means for defining a current record to be said root record;
(b) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) means for repeating element (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
67. The apparatus of claim 61 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
68. The apparatus of claim 67 wherein a pointer that extends from a record within said balanced tree points to a location in said linked structure that is closest to said root record.
-
69. The apparatus of claim 67 wherein a pointer extending from said location in said linked structure that is closest to said root record and a pointer extending from a location in said linked structure that is further from said root record each point to a further root record of a sub-portion of said balanced tree.
-
70. The apparatus of claim 67 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
71. An apparatus for inserting a new data element into a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record; and
means for inserting, when said respective one of said plurality of records is included in said balanced tree but is pointed to by a pointer extending from a linked structure that is within said data structure and that is external to said balanced tree, said new data element into said linked structure. - View Dependent Claims (72, 73, 74, 75, 76, 77, 78, 79)
(a) defining a current record to be said root record;
(b) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) means for repeating element (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
76. The apparatus of claim 71 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
77. The apparatus of claim 76 wherein a pointer that extends from a record within said balanced tree points to a location in said linked structure that is closest to said root record.
-
78. The apparatus of claim 76 wherein a pointer extending from said location in said linked structure that is closest to said root record and a pointer extending from a location in said linked structure that is further from said root record each point to a further root record of a sub-portion of said balanced tree.
-
79. The apparatus of claim 76 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
80. An apparatus for inserting a new data element into a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having a prefix that is contained in said prefix of said new data element and that is closest to said root record;
means for inserting, when said respective one of said plurality of records is included in said balanced tree and is not pointed to by a pointer extending from a linked structure that is within said data structure and that is external to said balanced tree, a new linked structure at a location within said data structure that immediately precedes said respective one of said plurality of records;
wherein a pointer previously pointing to said respective one of said plurality of records now points to a first record of said new linked structure, and a pointer extending from a location within said linked structure that is closest to said root record and a pointer extending from a location within said linked structure that is furthest from said root record each point to said respective one of said plurality of records; and
means for inserting said new data element into a node nearest to said root node within said new linked structure. - View Dependent Claims (81, 82, 83, 84, 85, 86)
(a) defining a current record to be said root record;
(b) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) means for repeating element (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
85. The apparatus of claim 81 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
86. The apparatus of claim 85 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
87. An apparatus for inserting a new data element into a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a leaf record of said plurality of records having a prefix that contains said prefix of said new data element and that is closest to said root record;
means for replacing a data element stored in said node in said leaf record with said new data element; and
means for inserting said data element previously stored in said node in said leaf record into said data structure. - View Dependent Claims (88, 89, 90, 91, 92, 93, 94)
means for inserting a new linked structure at a location immediately preceding said leaf record;
wherein a pointer previously pointing to said respective one of said plurality of records now point to a first record of said new linked structure, and a pointer extending from a location within said linked structure is closest to said root record and a pointer extending from a location within said linked structure that is furthest from said root record each point to said leaf record;
means for moving a data element stored in said node in said leaf record into a node nearest to said root node within said new linked structure; and
means for inserting said new data element into said node in said leaf record.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
89. The apparatus of claim 87 wherein at least one of said plurality of data elements and said new data element includes associated data.
-
90. The apparatus of claim 87 wherein each of said plurality of records includes at most three nodes and four pointers.
-
91. The apparatus of claim 87 wherein said address values are IP addresses.
-
92. The apparatus of claim 87 wherein said means for locating comprises:
-
(a) means for defining a current record to be said root record;
(b) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said new data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said new data element and then defining a record pointed to by a pointer immediately preceding said respective node to be said current record, or until said value of said prefix of said new data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(c) means for repeating element (b) until said current record is a leaf record or until said prefix stored at said respective one of said nodes in said current record is identical with said prefix of said new data element.
-
-
93. The apparatus of claim 87 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
94. The apparatus of claim 87 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
95. An apparatus for deleting a data element from a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having said data element; and
means for removing, when said respective one of said plurality of records is included in a linked structure that is within said data structure and that is external to but linked to said balanced tree, said data element from linked structure. - View Dependent Claims (96, 97, 98, 99, 100, 101, 102, 103)
means and removing said data element said node in said respective one of said plurality of records; and
means for moving at least a data element stored in said linked structure at another node in said linked structure that is one node further from said root record to said node in said respective one of said plurality of records.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
97. The apparatus of claim 95 wherein at least one of said plurality of data elements and said new data element includes associated data.
-
98. The apparatus of claim 95 wherein each of said plurality of records includes at most three nodes and four pointers.
-
99. The apparatus of claim 95 wherein said address values are IP addresses.
-
100. The apparatus of claim 95 wherein said linked structure is comprised of at least one record wherein a prefix stored in a first node in said at least one record contains at least another prefix stored another node in said data structure, and said first node is closer to said root record than said another node.
-
101. The apparatus of claim 100 wherein a pointer that extends from a record within said balanced tree points to a location in said linked structure that is closest to said root record.
-
102. The apparatus of claim 100 wherein a pointer extending from said location in said linked structure that is closest to said root record and a pointer extending from a location in said linked structure that is further from said root record each point to a further root record of a sub-portion of said balanced tree.
-
103. The apparatus of claim 100 wherein, when said linked structure is comprised of at least two records, a pointer extends from a first record that is closer to said root record to a second record that is further from said root record, said pointer extending from a location within said first record that is furthest from said root record to a location within said further record that is nearest to said root record.
-
104. An apparatus for deleting a data element from a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a node in a respective one of said plurality of records having said data element;
means for removing, when said respective one of said plurality of records is not included in a linked structure, any linked structure within said data structure having a pointer that points to said respective one of said plurality of records such that a pointer that previously pointed to said linked structure points to said respective one of said plurality of records;
means for removing said data element from said respective one of said plurality of records and rearranging said balanced tree portion of said data structure; and
means for reinserting into said data structure, one data element at a time, any data elements previously stored in said linked structure. - View Dependent Claims (105, 106, 107, 108, 109, 110, 111, 112)
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements and said new data element including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
113. A method of searching for a data element in a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
locating a respective one of said plurality of nodes that stores a data element having a prefix that is a best match to said prefix of said data element, said best match being a prefix that represents at least an address value that includes said address portion of said data element and having a maximum length among any other prefixes stored in said data structure that represent at least an address value that includes said address portion of said data element. - View Dependent Claims (114, 115, 116, 117, 118)
- said method comprising the steps of;
-
119. A method of searching for a data element in a data structure comprised of a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
- said method comprising the steps of;
(a) forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
(b) defining a current record to be said root record and defining a best match node to be a default node;
(c) starting from a node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element, and when a prefix stored at a respective one of said nodes in said current record contains said prefix of said data element and when a prefix length stored at said respective one of said nodes in said current record is greater than said prefix stored at said best match node, redefining said best match node to be respective one of said nodes in said current record;
(d) starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said data element and then defining a record pointed to by a pointer corresponding to said respective node to be said current record, or until said value of said prefix of said data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(e) repeating steps (c) and (d) until said current record is a leaf record or until said prefix of said data element is identical to said prefix stored at said respective one of said nodes. - View Dependent Claims (120, 121, 122, 123, 124)
- said method comprising the steps of;
-
125. An apparatus for searching for a data element in a data structure comprised of forming the data structure by merging at least one L-structure into a B-tree structure, the L-structure and the B-tree structure being formed independently of each other, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;means for locating a respective one of said plurality of nodes that stores a data element having a prefix that is a best match to said prefix of said data element, said best match being a prefix that represents at least an address value that includes said address portion of said data element and having a maximum length among any other prefixes stored in said data structure that represent at least an address value that includes said address portion of said data element. - View Dependent Claims (126, 127, 128, 129, 130)
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
131. An apparatus for searching for a data element in a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes, a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said-data structure being arranged substantially as a balanced tree;
- said apparatus comprising;
(a) means for defining a current record to be said root record and defining a best match node to be a default node;
(b) means for, starting from a node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element, and when a prefix stored at a respective one of said nodes in said current record contains said prefix of said data element and when a prefix length stored at said respective one of said nodes in said current record is greater than said prefix stored at said best match node, redefining said best match node to be respective one of said nodes in said current record;
(c) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said data element and then defining a record pointed to by a pointer corresponding to said respective node to be said current record, or until said value of said prefix of said data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(d) means for repeating elements (b) and (c) until said current record is a root record or until said prefix of said data element is identical to said prefix stored at said respective one of said plurality of nodes. - View Dependent Claims (132, 133, 134, 135)
- said apparatus comprising;
-
136. An apparatus for searching for a data element in a data structure comprised of at least one L-structure merged into a B-tree structure, the B-tree structure having non-overlapping ones of prefixes, the L-structure having overlapping ones of prefixes, the L-structure having a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes;
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
said apparatus comprising;(a) means for defining a current record to be said root record and defining a best match node to be a default node;
(b) means for, starting from a node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element, and when a prefix stored at a respective one of said nodes in said current record contains said prefix of said data element and when a prefix length stored at said respective one of said nodes in said current record is greater than said prefix stored at said best match node, redefining said best match node to be respective one of said nodes in said current record;
(c) means for, starting from said node in said current record that is closest to said root node, comparing a prefix stored at each node in said current record to said prefix of said data element until a value of said prefix stored at a respective one of said nodes in said current record exceeds or is equal to a value of said prefix of said data element and then defining a record pointed to by a pointer corresponding to said respective node to be said current record, or until said value of said prefix of said data element exceeds a value of a node of said current record that is furthest from said root node and then defining a record pointed to by a pointer from said furthest node as said current record; and
(d) means for repeating elements (b) and (c) until said current record is a root record or until said prefix of said data element is identical to said prefix stored at said respective one of said plurality of nodes.
- a plurality of records that includes at least a root record, each of said plurality of records including at least one node and at least one pointer that points to another of said plurality of records or to a null value, said at least one node being capable of storing a respective one of a plurality of data elements, each of said plurality of data elements including a prefix that represents at least one address value, said prefix being comprised of an address portion and a prefix length portion which defines the number of bits in said prefix, at least a portion of said data structure being arranged substantially as a balanced tree;
-
137. An apparatus that supports a longest match search for a desired address, comprising:
-
a quaternary tree data structure that includes a B-tree structure that is kept balanced and stores data having non-overlapping prefixes, the B-tree structure having sub-trees that contain a plurality of records one of which being a root record, each of the records including at least one node and at least one pointer, the node storing a respective data element that includes one of the mom-overlapping prefixes and associated data, each of the records having a plurality of branches that terminate in a leaf; and
a plurality of L-structures having further records that store data having overlapping prefixes, the plurality of L-structures being inserted into the B-tree structure, each of the L-structures comprising a set in which at least one of the overlapping prefixes contains at least one of a succession of the overlapping prefixes, the L-structure having a further pointer that originates from a final record of the L-structure and points to the root record of the one of the sub-trees of the B-tree structure, the at least one pointer of one of the records of the B-tree structure pointing to a first one of the further records of the L-structure.
-
Specification