Configuring MQC to Implement Adaptive Traffic Shaping
When the outgoing traffic rate needs to be limited on an upstream device but the inbound interface rate on the downstream device is variable, configure MQC to implement adaptive traffic shaping on the outbound interface of the upstream device. When the rate of packets matching the specified traffic classifier exceeds the rate limit, the upstream device buffers excess packets. When there are sufficient tokens in the token bucket, the device forwards the buffered packets at an even rate. When the buffer queue is full, the device discards the buffered packets. MQC-based adaptive traffic shaping enables the device to identify different service flows using traffic classifiers and provide differentiated services on a per flow basis.
- Reduces the traffic shaping rate when the NQA test instance detects that the packet loss ratio is larger than the upper threshold in the adaptive traffic profile.
- Increases the traffic shaping rate when all the following conditions
are met:
- The NQA test instance detects that the packet loss ratio is lower than the lower threshold in the adaptive traffic profile.
- Congestion occurs on the outbound interface of the upstream device.
- The interval for increasing the traffic shaping rate is reached.
- Retains the traffic shaping rate in one of the following scenarios:
- The NQA test instance detects that the packet loss ratio is smaller than the lower threshold in the adaptive traffic profile and no congestion occurs on the outbound interface of the upstream device.
- The detected packet loss ratio is within the packet loss ratio range in the adaptive traffic profile.
- Uses the upper threshold for the traffic shaping rate in the adaptive traffic profile when the NQA test fails.
- Uses the upper threshold for the traffic shaping rate in the adaptive traffic profile when the adaptive traffic profile is not bound to any NQA test instance.
After an adaptive traffic profile is bound to a traffic behavior, associate the traffic behavior with a traffic classifier in a traffic policy and apply the traffic policy to an interface. Then parameters in the adaptive traffic profile take effect on the interface.
A traffic policy containing an adaptive traffic shaping behavior can be applied to the outbound direction on a WAN interface or layer 2 VE interfaces.
Procedure
- Configure an adaptive traffic profile.
Run system-view
The system view is displayed.
Run qos adaptation-profile adaptation-profile-name
An adaptive traffic profile is created and its view is displayed.
Run rate-range low-threshold low-threshold-value high-threshold high-threshold-value
The traffic shaping rate range is set.
(Optional) Run rate-adjust step step
The traffic shaping rate adaptation step is set.
(Optional) Run rate-adjust increase interval interval-value
The interval for increasing the traffic shaping rate is set.
(Optional) Run rate-adjust loss low-threshold low-threshold-percentage high-threshold high-threshold-percentage
The packet loss ratio range is set.
Run track nqa admin-name test-name
An NQA test instance is bound to the adaptive traffic profile.
When configuring an NQA test instance, ensure that NQA packets can enter high-priority queues so that they are not discarded in the case of heavy traffic.
Run quit
Exit from the adaptive traffic profile.
Run quit
Exit from the system view.
- Configure a traffic classifier.
Run system-view
The system view is displayed.
Run traffic classifier classifier-name [ operator { and | or } ]
A traffic classifier is created and the traffic classifier view is displayed.
and indicates that rules are ANDed with each other.If a traffic classifier contains ACL rules, packets match the traffic classifier only when they match one ACL rule and all the non-ACL rules.
If a traffic classifier does not contain ACL rules, packets match the traffic classifier only when the packets match all the non-ACL rules.
By default, the relationship between rules in a traffic classifier is OR.
- Run the following commands as required.
Matching Rule
Command
Outer VLAN ID
if-match vlan-id start-vlan-id [ to end-vlan-id ] Inner VLAN IDs in QinQ packets
if-match cvlan-id start-vlan-id [ to end-vlan-id ] 802.1p priority in VLAN packets
if-match 8021p 8021p-value &<1-8> Inner 802.1p priority in QinQ packets
if-match cvlan-8021p 8021p-value &<1-8> EXP priority in MPLS packets (AR1200&AR2200&AR3200&AR3600 series)
if-match mpls-exp exp-value &<1-8> Destination MAC address
if-match destination-mac mac-address [ mac-address-mask mac-address-mask ] Source MAC address
if-match source-mac mac-address [ mac-address-mask mac-address-mask ] DLCI value in FR packets
if-match dlci start-dlci-number [ to end-dlci-number ] DE value in FR packets
if-match fr-de Protocol type field encapsulated in the Ethernet frame header
if-match l2-protocol { arp | ip | mpls | rarp | protocol-value } All packets
if-match any DSCP priority in IP packets
if-match [ ipv6 ] dscp dscp-value &<1-8> NOTE:If DSCP priority matching is configured in a traffic policy, the SAE220 (WSIC) and SAE550 (XSIC) cards do not support redirect ip-nexthop ip-address post-nat.
IP precedence in IP packets
if-match ip-precedence ip-precedence-value &<1-8> NOTE:if-match [ ipv6 ] dscp and if-match ip-precedence cannot be configured simultaneously in a traffic classifier where the relationship between rules is AND.
Layer 3 protocol type
if-match protocol { ip | ipv6 } QoS group index of packets
if-match qos-group qos-group-value IPv4 packet length
if-match packet-length min-length [ to max-length ] PVC information in ATM packets
if-match pvc vpi-number/vci-number RTP port number
if-match rtp start-port start-port-number end-port end-port-number SYN Flag in the TCP packet header
if-match tcp syn-flag { ack | fin | psh | rst | syn | urg } *
Inbound interface
if-match inbound-interface interface-type interface-number Outbound interface
if-match outbound-interface Cellular interface-number:channel ACL rule
if-match acl { acl-number | acl-name } NOTE:Before defining a matching rule for traffic classification based on an ACL, create the ACL.
To use an ACL in a traffic classifier to match the source IP address, run the qos pre-nat command on an interface to configure NAT pre-classification. NAT pre-classification enables the NAT-enabled device to carry the private IP address before translation on the outbound interface so that the NAT-enabled device can classify IP packets based on private IP addresses and provide differentiated services.
ACL6 rule
if-match ipv6 acl { acl-number | acl-name } NOTE:Before defining a matching rule for traffic classification based on an ACL, create the ACL.
To use an ACL in a traffic classifier to match the source IP address, run the qos pre-nat command on an interface to configure NAT pre-classification. NAT pre-classification enables the NAT-enabled device to carry the private IP address before translation on the outbound interface so that the NAT-enabled device can classify IP packets based on private IP addresses and provide differentiated services.
Application protocol
if-match application application-name [ user-set user-set-name ] [ time-range time-name ]
NOTE:Before defining a matching rule based on an application protocol, enable Smart Application Control (SA) and load the signature file.
SA group
if-match category category-name [ user-set user-set-name ] [ time-range time-name ]
NOTE:- Before defining a matching rule based on an application protocol, enable Smart Application Control (SA) and load the signature file.
User group
if-match user-set user-set-name [ time-range time-range-name ]
Run quit
Exit from the traffic classifier view.
- Configure a traffic behavior.
Run traffic behavior behavior-name
A traffic behavior is created and its view is displayed.
Run gts adaptation-profile adaptation-profile-name
An adaptive traffic profile is bound to the traffic behavior.
The adaptive traffic profile must have been created and configured.
(Optional) Run statistic enable
Traffic statistics collection is enabled.
Run quit
Exit from the traffic behavior view.
(Optional) Run qos overhead layer { link | physics }
A mode is specified for calculating packet lengths during traffic policing or traffic shaping.
By default, the system counts the physical-layer and link-layer compensation information in packet lengths during traffic policing or traffic shaping.
Run quit
Exit from the system view.
- Configure a traffic policy.
Run system-view
The system view is displayed.
Run traffic policy policy-name
A traffic policy is created and the traffic policy view is displayed, or the view of an existing traffic policy is displayed.
By default, no traffic policy is created in the system.
Run classifier classifier-name behavior behavior-name [ precedence precedence-value ]
A traffic behavior is bound to a traffic classifier in a traffic policy.
By default, no traffic classifier or traffic behavior is bound to a traffic policy.
Run quit
Exit from the traffic policy view.
Run quit
Exit from the system view.
- Apply the traffic policy.
Apply the traffic policy to an interface.
Run system-view
The system view is displayed.
Run interface interface-type interface-number[.subinterface-number ]
The interface view is displayed.
Run traffic-policy policy-name { inbound | outbound }
The traffic policy is applied to the inbound or outbound direction on the interface.
By default, no traffic policy is applied to an interface.
- Apply the traffic policy to an interzone.
Run system-view
The system view is displayed.
Run firewall interzone zone-name1 zone-name2
An interzone is created and the interzone view is displayed.
By default, no interzone is created.
You must specify two existing zones for the interzone.
Run traffic-policy policy-name
The traffic policy is bound to the interzone.
By default, no traffic policy is bound to an interzone.
- Apply the traffic policy to a
BD.
Only the AR100&AR120&AR150&AR160&AR200&AR1200 series routers and the AR2220E support this configuration.
Run system-view
The system view is displayed.
Run bridge-domain bd-id
A BD is created and the BD view is displayed.
By default, no BD is created.
Run traffic-policy policy-name { inbound | outbound }
The traffic policy is applied to the BD.
By default, no traffic policy is applied to a BD.
Apply the traffic policy in the system view.
Run system-view
The system view is displayed.
Run traffic-policy policy-name global bind interface { interface-type interface-number }&<1-16>
The traffic policy is applied to the system and bound to the interface.
By default, no traffic policy is applied to the system or bound to any interface of an AR.
Classifiers in a global traffic policy cannot be used to match the EXP field of MPLS packets or applied to IPv6 packets. The remark mpls-exp action cannot be configured in a global traffic policy.
If an interface-based traffic policy is applied to the interface where a global traffic policy is applied, the traffic policies take effect according to the following rules:- If the redirecting action is configured in both traffic policies, only the redirecting behavior in the interface-based traffic policy is valid.
- In other cases, the device executes the traffic behavior in the interface-based traffic policy and then the traffic behavior in the global traffic policy.