Patent ID: 7386525

Claim:
A method for finding, in a rule base, a rule matching a data packet, a data packet comprising parameter fields for identifying the data packet, the rule base comprising a plurality of sequentially labeled rules, each rule comprising one or more parameter fields, and a rule matching a data packet being a rule, whose parameter field values correspond to the parameter field values of said data packet, and the method comprising: determining rule sets for the data packet, one rule set comprising the rules to which one parameter field value of the data packet can match, finding the rule with the smallest label that is present in all said rule sets of the data packet, said rule with the smallest label indicating the rule matching the data packet, said finding further comprising: computing a table for the combination of the rule sets of the data packet, the rows of the table corresponding to the labels of the rules in the rule base, and the columns of the table corresponding to the different rule sets, and the cells of the table being filled so that each cell contains an element, which is the smallest possible label of a rule of the respective rule set and equal to or larger than the label of the respective row, observing a first element in a first row of a first column and comparing the first element to the respective row label, if the element is equal to the row label, jumping to another column in the same row and observing a second element found therein, or otherwise jumping to the row indicated by the first element and observing a second element found in a column therein, and proceeding on the basis of the second element and the respective row label in the same way as with the first element, and repeating the steps of observing, comparing and jumping until a row containing equal elements in all columns or the last row of the table is found, the label of said row or said equal element indicating the rule matching the data packet; and passing the data packet forward or dropping the data packet based on an action defined in the matching rule.