Patent ID: 7251651

Claim:
A method for classifying data packets in a data processing device according to a plurality of context-specific sets of processing rules based on context identifiers associated with respective data packets, each context identifier corresponding to said context-specific rule set to be used for classification of the associated packet, wherein, for each of a predetermined group of data items in each packet, each rule defines a rule range indicating a range of possible values of the corresponding data item for which that rule applies, the method comprising: (a) for each data item in a subset of said group, providing a global search structure which is associated with all of said context identifiers, the global search structure comprising a set of range identifiers indicating, for all possible values of the data item, which of the rule ranges corresponding to that data item in said rule sets a value intersects; (b) for each remaining data item in said group, providing a plurality of local search structures, the local search structures for said data item being associated with respective sets of the context identifiers such that the context identifier corresponding to each of said rule sets is associated with said local search structure, wherein each local search structure for a data item comprises a set of range identifiers indicating, for all possible values of the data item, which of the rule ranges corresponding to that data item, in the rule set corresponding to each associated context identifier, a value intersects; (c) for each data packet, performing an item search for each data item in said group using the search structure for that data item which is associated with the context identifier for the data packet, the item search for said data item comprising selecting the range identifier corresponding to the value of the data item from the set of range identifiers in said search structure; and (d) for each data packet, identifying, based on the selected range identifiers for all data items in the group, at least one rule of any rules applicable to the data packet in the rule set corresponding to the context identifier for the data packet.