Defining Traffic Classifiers

You need to configure traffic classification before configuring traffic class-based QoS. The traffic classification can be configured based on ACL, IP precedence, protocol type, MAC address, protocol address, and so on.

Procedure

  • Defining traffic classifiers based on Layer 3 or Layer 4 information

    If traffic is classed on the basis of Layer 3 or Layer 4 information, traffic policies can be applied to only Layer 3 interface.

    1. Run system-view

      The system view is displayed.

    2. Run traffic classifier classifier-name [ operator { and | or } ]

      A traffic classifier is defined and the traffic classifier view is displayed.

      If you set more than one matching rule for the same classifier, you can set their logical relations by specifying the parameter operator in this step.

      • and: A packet belongs to the class defined by the classifier only when it matches all the rules.

      • or: A packet belongs to the class defined by the classifier if it matches one of the rules.

    3. Define desired matching rules on the router according to your requirements.

      • To set a matching rule to classify traffic based on the ACL number, run the if-match [ ipv6 ] acl { acl-number | name acl-name } command.
      • To set a matching rule to classify traffic based on the DSCP value, run the if-match dscp dscp-value or if-match ipv6 dscp dscp-value
      • To set a matching rule to classify traffic based on the IPv4 TCP flag, run the if-match tcp syn-flag { tcpflag-value [ mask tcpflag-mask ] | bit-match { established | fin | syn | rst | psh | ack | urg | ece | cwr | ns } } command.
      • To set a matching rule to classify traffic based on the IPv6 TCP flag, run the if-match ipv6 tcp syn-flag { tcpflag-value [ mask tcpflag-mask ] | bit-match { established | fin | syn | rst | psh | ack | urg } } command.
      • To set a matching rule to classify traffic based on the IP precedence, run the if-match [ ipv6 ] ip-precedence ip-precedence command.
      • To define a matching rule to classify traffic based on the MPLS EXP value, run the if-match mpls-exp exp-value command.

      • To match all packets, run the if-match [ ipv6 ] any command.
      • To define a matching rule to classify traffic based on the value of the next IPv6 header, run the if-match ipv6 next-header header-number first-next-header command.

      • To set a matching rule to classify traffic based on the source IPv6 address, run the if-match ipv6 source-address ipv6-address prefix-length command.
      • To set a matching rule to classify traffic based on the destination IPv6 address, run the if-match ipv6 destination-address ipv6-address prefix-length command.

      To match IPv6 packets, you must specify the key word ipv6 when you choose a matching rule in Step 3. A matching rule defined to match packets based on source or destination addresses is valid with IPv6 packets, but not with IPv4 packets.

      If you set more than one matching rule for the same classifier, you can set their logical relations by specifying the parameter operator in Step 2.

      • and: A packet belongs to the class defined by the classifier only when it matches all the rules.

      • or: A packet belongs to the class defined by the classifier if it matches one of the rules.

    4. Run commit

      The configuration is committed.

  • Defining traffic classifiers based on Layer 2 information

    If traffic is classed on the basis of Layer 2 information, the key word link-layer must be specified in the command line when a traffic policy is applied.

    1. Run system-view

      The system view is displayed.

    2. Run traffic classifier classifier-name [ operator { and | or } ]

      A traffic classifier is defined and the traffic classifier view is displayed.

    3. Define desired matching rules on the router according to your requirements.

      • To set a matching rule to classify traffic based on the ACL number, run the if-match [ ipv6 ] acl { acl-number | name acl-name } command.

      • To set a matching rule to classify traffic based on the service class, run the if-match service-class service-class-value command.

      • To set a matching rule to classify traffic based on the source MAC address, run the if-match source-mac mac-address command.

      • To set a matching rule to classify traffic based on the destination MAC address, run the if-match destination-mac mac-address command.

      • To set a matching rule to classify traffic based on the 8021p value of VLAN packets, run the if-match 8021p 8021p-value command.

      If you set more than one matching rule for the same classifier, you can set their logical relations by specifying the parameter operator in Step 2. For detailed instructions, refer to the previous section.

    4. Run commit

      The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >