A technique classifies packets in a manner that enables the number of
lookup operations performed when classifying a data packet to be reduced.
A lookup operation is performed to identify a set of rules and a set of
actions associated with the data packet. If the action is the same for
all the rules represented in the set of rules, the data packet is
classified in accordance with the action and further lookup operations
are not performed. Otherwise, a next-level lookup operation is performed
and the process is repeated. This process continues for successive levels
until either a level is reached where the packet is classified or a final
level is reached. If a final level is reached, an action is performed
based on the results of the lookup operation at the final level.