The MQC does not
necessarily require that you associate only one traffic class to one traffic
policy.
In a scenario where
packets satisfy more than one match criterion, the MQC enables you to associate
multiple traffic classes with a single traffic policy (also termed
nested traffic
classes
) using the
match
class-map
command. (We term these
nested class maps or
MQC Hierarchical class maps.)
This command provides
the only method of
combining match-any and match-all characteristics within a single traffic
class.
By doing so, you can
create a traffic class using one match criterion evaluation instruction (either
match-any or match-all) and then use that traffic class as a match criterion in
a traffic class that uses a different match criterion type. For example, a
traffic class created with the match-any instruction must use a class
configured with the match-all instruction as a match criterion, or vice versa.
Consider this likely
scenario: Suppose A, B, C, and D were all separate match criterion, and you
wanted traffic matching A, B, or C and D (i.e., A or B or [C and D]) to be
classified as belonging to a traffic class. Without the nested traffic class,
traffic would either have to match
all four of the
match criterion (A and B and C and D) or match
any of the match
criterion (A or B or C or D) to be considered part of the traffic class. You
would not be able to combine “and” (match-all) and “or” (match-any) statements
within the traffic class; you would be unable to configure the desired
configuration.
The solution: Create
one traffic class using match-all for C and D (which we will call criterion E),
and then create a new match-any traffic class using A, B, and E. The new
traffic class would have the correct evaluation sequence (A or B or E, which is
equivalent to A or B or [C and D]).