Method and data structure for a low memory overhead database
First Claim
1. A device comprising:
- a key generation unit, the key generation unit to access data in a received packet and generate a key containing at least a portion of the data;
a hashing unit, the hashing unit to receive a key from the key generation unit and apply a hashing function to the received key to create an n-bit hash value;
a first memory to store a key database, the key database including a number of sizes of sections, each of the sections to store at least one data entry, wherein each of the data entries within a section includes a key having the same hash value;
a number of head pointer registers, the number of head pointer registers equal to the number of sizes, each of the number of head pointer registers to identify a first free section of one of the sizes of sections; and
a second memory coupled with the first memory and the hashing unit, the second memory to store an index table, the index table including a number of entries, each of the entries corresponding to one n-bit hash value, said each entry including a number of valid bits to indicate allocation of one of the sections of the key database and a section pointer to identify a location in the first memory of the allocated section.
1 Assignment
0 Petitions
Accused Products
Abstract
Method and data structure for a low memory overhead database and apparatus for implementing the same. Under one embodiment, the data structure includes an index table for storing a plurality of entries, each of the entries corresponding to one of a plurality of hash values, with each entry including a section pointer to identify a memory address of one of a plurality of sections of a key database and including valid bits to indicate a size of the respective section of the key database. The key database is stores a plurality of data entries, with each data entry including a search key having one of the plurality of hash values, and wherein the data entries are grouped into the plurality of sections, with each section storing data entries with search keys having the same hash value.
58 Citations
50 Claims
-
1. A device comprising:
-
a key generation unit, the key generation unit to access data in a received packet and generate a key containing at least a portion of the data; a hashing unit, the hashing unit to receive a key from the key generation unit and apply a hashing function to the received key to create an n-bit hash value; a first memory to store a key database, the key database including a number of sizes of sections, each of the sections to store at least one data entry, wherein each of the data entries within a section includes a key having the same hash value; a number of head pointer registers, the number of head pointer registers equal to the number of sizes, each of the number of head pointer registers to identify a first free section of one of the sizes of sections; and a second memory coupled with the first memory and the hashing unit, the second memory to store an index table, the index table including a number of entries, each of the entries corresponding to one n-bit hash value, said each entry including a number of valid bits to indicate allocation of one of the sections of the key database and a section pointer to identify a location in the first memory of the allocated section. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A method comprising:
-
storing a number of data entries in a first section of a key database, the first section allocated to one of a plurality of entries of an index table responsive to a hash function applied to a key, a size of the first section corresponding to the number of data entries, each of the data entries of the first section including a key having a same hash value; receiving a data entry including a key; generating the hash value by applying a hash function to the received key; allocating a second section of the key database to the one entry of the index table responsive to the hash value, a size of the second section greater than the size of the first section. - View Dependent Claims (16, 17, 18)
-
-
19. A method comprising:
-
accessing an entry of an index table, the accessed entry corresponding to a hash value; reading a valid bit in the corresponding entry of the index table; and if the valid bit is set low, finding a first free section of a smallest available size in a key data base having a number of sizes of sections, allocating the first free section of the smallest available size to the corresponding entry of the index table, and inserting a data entry into the allocated first free section of the smallest available size, wherein the data entry includes a key having the hash value. - View Dependent Claims (20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
-
-
31. A method comprising:
-
accessing an entry in an index table, the accessed entry corresponding to a hash value; reading a plurality of valid bits from the corresponding entry of the index table; determining a number of the plurality of valid bits set high; finding in a key database a first free section of a size equal to one more than the number of high valid bits, the key database having sections of a number of sizes, each section for storing data entries, wherein each data entry within a section includes a key having the same hash value; allocating the first free section of a size one more than the number of high valid bits to the corresponding entry of the index table; and inserting a data entry into the allocated section of the key database. - View Dependent Claims (32, 33, 34, 35, 36, 37)
-
-
38. A data structure comprising:
-
an index table for storing a plurality of entries, each of the entries corresponding to one of a plurality of hash values, each entry including a section pointer to identify a memory address of one of a plurality of sections of a key database and each entry including valid bits to indicate a size of the respective section of the key database, wherein the key database is for storing a plurality of data entries, each data entry including a search key having one of the plurality of hash values, the data entries grouped into the plurality of sections, each section for storing data entries with search keys having the same hash value. - View Dependent Claims (39, 40, 41, 42, 43, 44, 45, 46)
-
-
47. A method comprising:
-
receiving a data packet; generating a search key based on the received data packet; generating a hash value by applying a hash function to the generated search key; accessing an entry in an index table, the entry corresponding to the generated hash value, wherein the entry includes a valid bit and a section pointer, the valid bit for indicating a size of a first section of a key database, the section pointer for identifying the location of the first section; searching the first section of the key database identified by the section pointer for a search key corresponding to the generated search key; if the first section of the key database identified by the section pointer does not contain a search key that corresponds to the generated search key, allocating a second section of the key database, wherein the second section has a size greater than the size of the first section; inserting the generated search key in the second section of the key database; moving each search key of the first section to the second section of the key database. - View Dependent Claims (48, 49, 50)
-
Specification