QoS class-map match-any

Answered Question
Feb 16th, 2010

When you create a class map using the match any functionality, does it read the class map from the top down and then stop on the first match it sees or does it look at all the match statements?

For ex

class-map match-any XXX

  match protocol rtp
  match ip dscp ef
  match protocol citrix
!
!
policy-map XXY
  class XXX
   priority percent 75
   set dscp default
  class class-default
   fair-queue
   set dscp default

If it finds a match for rtp will it stop looking or if there is traffic for rtp and citrix and the router sees it will it match/tag on both to apply QoS to that traffic?

Thank you

Lynne

I have this problem too.
0 votes
Correct Answer by Giuseppe Larosa about 6 years 9 months ago

Hello Lynn/Jon

to be noted that the same packet cannot be classified (= be a match) for RTP and for citrix at the same time, just for correctness

match -all = logical AND of all conditions   all conditions must be true for a match

match -any = logical OR of all conditions  if at least one condition is true there is a match

Hope to help

Giuseppe

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)
Loading.
Jon Marshall Tue, 02/16/2010 - 11:52

lkadlik wrote:

When you create a class map using the match any functionality, does it read the class map from the top down and then stop on the first match it sees or does it look at all the match statements?

For ex

class-map match-any XXX

  match protocol rtp
  match ip dscp ef
  match protocol citrix
!
!

If it finds a match for rtp will it stop looking or if there is traffic for rtp and citrix and the router sees it will it match/tag on both to apply QoS to that traffic?

Thank you

Lynne

Lynne

With match-any it reads them in order and stops once/if it finds a match.

With match-all it has to match against all the match statements so it needs to read them all as long as it keeps matching ie. it it doesn't match in one of the match statements there is no need to keep trying to match in the following match statements.

In the above example if there is match for rtp it will stop trying to match against anything else and will not check your other match conditions. So obviously with match-any the order of the match conditions is all important.

Jon

lkadlik Tue, 02/16/2010 - 11:57

Thank you Jon.  That is very helpful.

Two more questions,  if i want to make sure that all of the items in my class-map are matched on when the appropriate traffic is generated.  Will it work if i create a separate class map for each item I want QoS on and apply each class-map to the policy-map applied?

Also, my understanding of the match-all functionality is that all the items you set to match in a class-map need to be present ( ie traffic) for the policy to be applied.  Is this correct?

Thank you.

Jon Marshall Tue, 02/16/2010 - 12:15

lkadlik wrote:

Thank you Jon.  That is very helpful.

Two more questions,  if i want to make sure that all of the items in my class-map are matched on when the appropriate traffic is generated.  Will it work if i create a separate class map for each item I want QoS on and apply each class-map to the policy-map applied?

Also, my understanding of the match-all functionality is that all the items you set to match in a class-map need to be present ( ie traffic) for the policy to be applied.  Is this correct?

Thank you.

Lynne

If you want all of your items in your class-map to be matched then you should use the match-all as you say. Only traffic that then matches all the items within your class-map will pass the test.

Jon

lkadlik Tue, 02/16/2010 - 12:27

If I did a match-all list and only 2 out of the three items were present (say rtp and citrix) would qos still be applied to the rtp and citrix traffic if nothing is getting tagged for in regards to dscp ef?

Jon Marshall Tue, 02/16/2010 - 12:32

lkadlik wrote:

If I did a match-all list and only 2 out of the three items were present (say rtp and citrix) would qos still be applied to the rtp and citrix traffic if nothing is getting tagged for in regards to dscp ef?


Lynne

No it wouldn't. Match-all means just what it says ie. all items must be matched for the relevant policy map entry to be applied.

Jon

Correct Answer
Giuseppe Larosa Tue, 02/16/2010 - 14:59

Hello Lynn/Jon

to be noted that the same packet cannot be classified (= be a match) for RTP and for citrix at the same time, just for correctness

match -all = logical AND of all conditions   all conditions must be true for a match

match -any = logical OR of all conditions  if at least one condition is true there is a match

Hope to help

Giuseppe

Actions

This Discussion