You need to configure a traffic classifier before configuring class-based QoS. The traffic classifier can be configured based on the ACL rule, IP precedence, MAC address, protocol address, and so on.
The system view is displayed.
A traffic classifier is defined, and the traffic classifier view is displayed.
If multiple matching rules are defined in a traffic classifier, you can set the logical relationship between the matching rules by specifying the parameter operator.
To define a matching rule to classify traffic based on the ACL number, run the if-match [ ipv6 ] acl { acl-number | name acl-name } [ precedence precedence-value ] command.
To define a matching rule to classify traffic based on the DSCP value, run the if-match [ ipv6 ] dscp dscp-value command.
To define a matching rule to classify traffic based on the IPv4 TCP flag value, 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 define a matching rule to classify traffic based on the precedence of an IP packet, 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 define a matching rule 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 define 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 define a matching rule to classify traffic based on a destination IPv6 address, run the if-match ipv6 destination-address ipv6-address prefix-length command.
For IPv6 packets, you need to specify the keyword ipv6 when defining a matching rule in Step 3. A matching rule defined to match packets based on the source or destination addresses applies to IPv6 packets, but not IPv4 packets.
You can define different ACL rules as required, including the protocol type, source address, destination address, and ToS in packets. The if-match acl command filters packets according to the ACL rules defined in the rule command. The system then performs the corresponding traffic behavior for the matching packets.
The configuration is committed.
The system view is displayed.
A traffic classifier is configured, and the traffic classifier view is displayed.
If multiple matching rules are defined for the same traffic classifier, you can set their logical relationships by specifying the parameter operator. For details, see the previous section.
To define a matching rule to classify traffic based on the ACL number, run the if-match [ ipv6 ] acl { acl-number | name acl-name } [ precedence precedence-value ] command.
To define a matching rule to classify traffic based on the 802.1p priority of VLAN packets, run the if-match 8021p 8021p-value command.
To define a matching rule to classify traffic based on the COS , run the if-match service-class service-class-value command.
To define a matching rule to classify traffic based on the source MAC address, run the if-match source-mac mac-address command.
To define a matching rule to classify traffic based on the destination MAC address, run the if-match destination-mac mac-address command.
For example, as shown in Table 1, Policy 1 defines two traffic classifiers and their corresponding traffic behaviors in sequence. If a packet matches both of the traffic classifiers, behavior 1 is performed on the packet, and the 802.1p value of the packet is re-marked as 1.
Traffic Classifier |
Matching Rule |
Traffic Behavior |
Traffic Action |
---|---|---|---|
Classifier 1 |
Matching the destination MAC address |
Behavior 1 |
Re-marking the 802.1p value as 1 |
Classifier 3 |
Matching the source MAC address |
Behavior 3 |
Re-marking the 802.1p value as 3 |
For example, as shown in Table 2, three traffic classifiers and their corresponding traffic behaviors are associated with Policy 2 in sequence. If the destination MAC address of a packet is 2-2-2, behavior 2 is performed on the packet, and the 802.1p value of the packet is re-marked as 2.
Traffic Classifier |
Matching Rule |
Traffic Behavior |
Traffic Action |
---|---|---|---|
Classifier 1 |
Matching the destination MAC address 1-1-1 |
Behavior 1 |
Re-marking the 802.1p value as 1 |
Classifier 2 |
Matching the destination MAC address 2-2-2 |
Behavior 2 |
Re-marking the 802.1p value as 2 |
Classifier 3 |
Matching the destination MAC address 3-3-3 |
Behavior 3 |
Re-marking the 802.1p value as 3 |
The configuration is committed.