Patent ID: 7492763

Claim:
A method of processing data from a network, the method comprising: identifying, from a value at a fixed location in a frame, a type of encapsulation of data in the frame; extracting, in one of a plurality of parsers, a plurality of attributes of the frame from a corresponding plurality of locations in the frame based on the type of encapsulation; wherein at least one attribute being extracted is a Layer-2 attribute which is at different locations in frames of different types of encapsulation parsable by the plurality of parsers; generating a key by use of a group of attributes that are pre-selected by a user, from among the plurality of attributes; wherein each attribute in the group is pre-selected by the user symbolically, without specifying a corresponding location in the frame for each type of encapsulation; reading memory, using at least the key, to identify a plurality of instructions; and executing at least one instruction, identified by use of the key, to process data in the frame; wherein: the plurality of parsers comprises Layer-2 parsers; the plurality of attributes comprises Layer-2 attributes extracted by the Layer-2 parsers; at least one Layer-2 attribute called “VLAN tag” is pre-selected by the user symbolically; a value for the VLAN tag is held in a register, regardless of whether (a) the frame contains the VLAN tag or (b) the frame is untagged; and the value for the VLAN tag in the register is used during said generating of said key.