This example shows
how packets are evaluated when multiple match criteria exist. It illustrates
the difference between the
class-map
match-any and
class-map
match-all commands. Packets must meet either
all of the
match criteria (match-all) or
one of the
match criteria (match-any) to
be considered a member of the traffic class.
The following
examples show a traffic class configured with the
class-map match-all
command:
class-map match-all cisco1
match protocol ip
match qos-group 4
match access-group 101
If a packet arrives
on a router with traffic class
cisco1
configured on the interface, we assess whether it matches the IP protocol, QoS
group 4, and access group 101. If all of these match criteria are met, the
packet is classified as a member of the traffic class
cisco1 (a
logical AND operator; Protocol IP AND QoS group 4 AND access group 101).
class-map match-all vlan
match vlan 1
match vlan inner 1
The following
example illustrates use of the
class-map match-any
command. Only one match criterion must be met for us to
classify the packet as a member of the traffic class (i.e., a logical OR
operator; protocol IP OR QoS group 4 OR access group 101):
class-map match-any cisco2
match protocol ip
match qos-group 4
match access-group 101
In the traffic
class
cisco2, the
match criterion are evaluated consecutively until a successful match is
located. The packet is first evaluated to determine whether the IP protocol can
be used as a match criterion. If so, the packet is matched to traffic class
cisco2. If not, then QoS group 4 is evaluated as a match criterion and so on.
If the packet matches none of the specified criteria, the packet is classified
as a member of the default traffic class (class default-class).