A fixed-length-data searching method used by a fixed-length-data searching apparatus for communication, the apparatus comprising:
- a first memory for storing a data table that holds various data regarding a communication packet;
- a second memory for storing a fixed-length-data table, a local table, and a numeric value comparison table;
- a third memory for storing a pointer table and a secondary pointer table;
- and at least one of a data processing unit, the method comprising:
- a step of computing, by the data processing unit, an index with respect to an input of fixed-length-data to be searched for;
- a step of reading an entry indicated by the index from a pointer table stored in the third memory;
- a first pointer processing step of obtaining, by the data processing unit, a table indication, issued based on data in an entry read from the pointer table, which specifies the table to be read next, among a fixed-length-data table, a local table, a numeric value comparison table, and a secondary pointer table;
- a step of repeating the first pointer processing step if the table indication specifies a secondary pointer table, by reading an entry of the secondary pointer table from the third memory based on the memory address of the third memory contained in the entry, and obtaining a memory address indicating an entry of a fixed-length-data table corresponding to the index;
- a reading step, if the table indication specifies any one of a fixed-length-data table, a local table, and a numeric value comparison table, of reading an entry of the specified table from the second memory based on the memory address of the second memory contained in the entry and obtaining the members not more than Q-by-K and first entry control data;
- a first comparison step, in which if first entry control data does not indicate a need for further comparison, the data processing unit compares multiple members of fixed-length-data read from the second memory and the input fixed-length-data to be searched for, whereas if the first entry control data indicates a need for further comparison, the data processing unit compares multiple members of fixed-length-data read from the second memory and an output value from the input fixed-length-data processing unit, and thereby providing, as second entry control data, a result of the comparison and an indication to request further comparison;
- a second pointer processing step, in which the data processing unit uses second entry control data, and if the control data indicates a need for further comparison, any one of the memory addresses of the second and third memories is used to store the control data in the third memory, and to store the control data in a secondary pointer table having the same format as that of the pointer table or in the second memory, so that the data processing unit obtains memory control data for instructing reading the entry from any of the fixed-length-data tables;
- a step of reading an entry from a fixed-length-data table or a secondary pointer table to be read next, based on the second pointer processing step;
- a second comparison step, in which if a fixed-length-data table is selected, the data processing unit repeats the first comparison step in the case of a need for further comparison being indicated, based on the entry read from the fixed-length-data table;
- a step of reading a fixed-length-data table, in which if a secondary pointer table is selected, the data processing unit reads the fixed-length-data table based on the entry read from the secondary pointer table;
- a third comparison step of repeating the first comparison step in the case of a need for further comparison being not indicated, based on the entry read from the fixed-length-data table;
- a reading step in which if the result of the first, second, or third comparison step indicates a match, various data corresponding to the matched fixed-length-data stored in the fixed-length-data table is read from the data table;
- a modifying step of modifying data read by the reading step;
- and
- an outputting step of outputting a search result, a fixed-length-data name, and other data output in the comparing steps and the modifying step.