Download as pdf or txt
Download as pdf or txt
You are on page 1of 111

Huawei AR150&200 Series Enterprise Routers

V200R002C00
Configuration Guide - QoS
Issue 02
Date 2012-03-30
HUAWEI TECHNOLOGIES CO., LTD.


Copyright Huawei Technologies Co., Ltd. 2012. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior written
consent of Huawei Technologies Co., Ltd.

Trademarks and Permissions
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective holders.

Notice
The purchased products, services and features are stipulated by the contract made between Huawei and the
customer. All or part of the products, services and features described in this document may not be within the
purchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,
and recommendations in this document are provided "AS IS" without warranties, guarantees or representations
of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute the warranty of any kind, express or implied.






Huawei Technologies Co., Ltd.
Address: Huawei Industrial Base
Bantian, Longgang
Shenzhen 518129
People's Republic of China
Website: http://www.huawei.com
Email: support@huawei.com
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
i
About This Document
Intended Audience
This document describes the concepts and configuration procedures of QoS features on the
AR150/200, and provides the configuration examples.
This document provides guidance for configuring QoS features.
This document is intended for:
l Data configuration engineers
l Commissioning engineers
l Network monitoring engineers
l System maintenance engineers
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
DANGER
Indicates a hazard with a high level of risk, which if not
avoided, will result in death or serious injury.
WARNING
Indicates a hazard with a medium or low level of risk, which
if not avoided, could result in minor or moderate injury.
CAUTION
Indicates a potentially hazardous situation, which if not
avoided, could result in equipment damage, data loss,
performance degradation, or unexpected results.
TIP
Indicates a tip that may help you solve a problem or save
time.
NOTE
Provides additional information to emphasize or supplement
important points of the main text.

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS About This Document
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
ii
Command Conventions
The command conventions that may be found in this document are defined as follows.
Convention Description
Boldface The keywords of a command line are in boldface.
Italic Command arguments are in italics.
[ ] Items (keywords or arguments) in brackets [ ] are optional.
{ x | y | ... } Optional items are grouped in braces and separated by
vertical bars. One item is selected.
[ x | y | ... ] Optional items are grouped in brackets and separated by
vertical bars. One item is selected or no item is selected.
{ x | y | ... }
*
Optional items are grouped in braces and separated by
vertical bars. A minimum of one item or a maximum of all
items can be selected.
[ x | y | ... ]
*
Optional items are grouped in brackets and separated by
vertical bars. Several items or no item can be selected.
&<1-n> The parameter before the & sign can be repeated 1 to n times.
# A line starting with the # sign is comments.

Interface Numbering Conventions
Interface numbers used in this manual are examples. In device configuration, use the existing
interface numbers on devices.
Change History
Changes between document issues are cumulative. Therefore, the latest document version
contains all updates made to previous versions.
Changes in Issue 02 (2012-03-30)
Based on issue 01 (2011-12-30), the document is updated as follows:
The following information is modified:
l 1.5.5 Checking the Configuration
Changes in Issue 01 (2011-12-30)
Initial commercial release.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS About This Document
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
iii
Contents
About This Document.....................................................................................................................ii
1 QoS Configuration........................................................................................................................1
1.1 QoS Overview....................................................................................................................................................3
1.2 QoS Features Supported by the AR150/200.......................................................................................................3
1.3 Configuring Priority Mapping..........................................................................................................................12
1.3.1 Establishing the Configuration Task.......................................................................................................12
1.3.2 Configuring the Packet Priority Trusted by an Interface.........................................................................13
1.3.3 Setting the Default 802.1p Priority of an Interface..................................................................................14
1.3.4 Configuring a Priority Mapping Table....................................................................................................15
1.3.5 Checking the Configuration.....................................................................................................................16
1.4 Configuring Traffic Policing............................................................................................................................16
1.4.1 Establishing the Configuration Task.......................................................................................................16
1.4.2 Configuring Traffic Policing on an Interface..........................................................................................17
1.4.3 Configuring Flow-based Traffic Policing................................................................................................18
1.4.4 Checking the Configuration.....................................................................................................................19
1.5 Configuring Traffic Shaping............................................................................................................................19
1.5.1 Establishing the Configuration Task.......................................................................................................19
1.5.2 Configuring Interface-based Traffic Shaping..........................................................................................21
1.5.3 Configuring Queue-based Traffic Shaping..............................................................................................22
1.5.4 Configuring Flow-based Traffic Shaping................................................................................................23
1.5.5 Checking the Configuration.....................................................................................................................23
1.6 Configuring Congestion Management..............................................................................................................24
1.6.1 Establishing the Configuration Task.......................................................................................................24
1.6.2 Configuring Queue-based Congestion Management...............................................................................25
1.6.3 Configuring Class-based Congestion Management................................................................................27
1.6.4 Checking the Configuration.....................................................................................................................28
1.7 Configuring Congestion Avoidance.................................................................................................................29
1.7.1 Establishing the Configuration Task.......................................................................................................29
1.7.2 Configuring Queue-based WRED...........................................................................................................30
1.7.3 Configuring Flow-based WRED.............................................................................................................32
1.7.4 Checking the Configuration.....................................................................................................................33
1.8 Configuring HQoS............................................................................................................................................34
1.8.1 Establishing the Configuration Task.......................................................................................................34
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS Contents
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
iv
1.8.2 Configuring a Traffic Policy....................................................................................................................36
1.8.2.1 Configuring a Sub Traffic Policy...................................................................................................36
1.8.2.2 Configuring a Traffic Policy...........................................................................................................36
1.8.2.3 Applying the Traffic Policy to an Interface....................................................................................38
1.8.3 (Optional) Configuring Traffic Policing on an Interface.........................................................................38
1.8.4 (Optional) Configuring Traffic Shaping on an Interface.........................................................................38
1.8.5 Checking the Configuration.....................................................................................................................39
1.9 Maintaining QoS...............................................................................................................................................39
1.9.1 Displaying the Queue-based Traffic Statistics........................................................................................40
1.9.2 Clearing the Queue-based Traffic Statistics............................................................................................40
1.10 Configuration Examples.................................................................................................................................40
1.10.1 Example for Configuring Priority Mapping..........................................................................................40
1.10.2 Example for Configuring Traffic Policing............................................................................................44
1.10.3 Example for Configuring Traffic Shaping.............................................................................................49
1.10.4 Example for Configuring Congestion Avoidance and Congestion Management.................................53
1.10.5 Example for Configuring HQoS............................................................................................................59
2 Traffic Policy Configuration.....................................................................................................70
2.1 Traffic Policy Overview...................................................................................................................................71
2.2 Traffic Policy Features Supported by the AR150/200.....................................................................................71
2.3 Configuring a Traffic Classifier.......................................................................................................................74
2.3.1 Establishing the Configuration Task.......................................................................................................74
2.3.2 (Optional) Configuring SAC...................................................................................................................75
2.3.2.1 Configuring a Signature File..........................................................................................................75
2.3.2.2 Configuring an SAC Group............................................................................................................76
2.3.2.3 Configuring the SAC Statistics Function.......................................................................................77
2.3.2.4 Checking the Configuration............................................................................................................78
2.3.3 Configuring a Traffic Classifier..............................................................................................................78
2.3.4 Checking the Configuration.....................................................................................................................80
2.4 Configuring a Traffic Behavior........................................................................................................................80
2.4.1 Establishing the Configuration Task.......................................................................................................81
2.4.2 Configuring a Permit or Deny Action.....................................................................................................82
2.4.3 Configuring Redirection..........................................................................................................................82
2.4.4 Configuring Re-marking..........................................................................................................................83
2.4.5 Configuring Traffic Policing...................................................................................................................84
2.4.6 Configuring Traffic Shaping...................................................................................................................85
2.4.7 Configuring Congestion Management.....................................................................................................85
2.4.8 Configuring Congestion Avoidance........................................................................................................87
2.4.9 Binding a Sub Traffic Policy...................................................................................................................88
2.4.10 Configuring Traffic Statistics................................................................................................................90
2.4.11 Checking the Configuration...................................................................................................................90
2.5 Configuring a Traffic Policy.............................................................................................................................91
2.6 Maintaining a Traffic Policy.............................................................................................................................92
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS Contents
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
v
2.6.1 Displaying the Flow-based Traffic Statistics...........................................................................................92
2.6.2 Clearing the Flow-based Traffic Statistics..............................................................................................92
2.7 Configuration Examples...................................................................................................................................93
2.7.1 Example for Configuring Re-marking.....................................................................................................93
2.7.2 Example for Configuring Traffic Statistics.............................................................................................97
2.7.3 Example for Preventing BT Download.................................................................................................100
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS Contents
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
vi
1 QoS Configuration
About This Chapter
This chapter describes common QoS functions on interfaces of the AR150/200: priority
mapping, traffic policing, traffic shaping, congestion management, congestion avoidance, and
Hierarchical Quality of Service (HQoS). It also provides configuration methods and examples.
1.1 QoS Overview
QoS is designed to provide differentiated services based on networking requirements.
1.2 QoS Features Supported by the AR150/200
This section describes QoS features supported by the AR150/200.
1.3 Configuring Priority Mapping
After priority mapping is configured, the AR150/200 determines the queues and output priorities
of the received packets based on packet priorities or the default 802.1p priority of the interface.
By doing this, the AR150/200 provides differentiated services.
1.4 Configuring Traffic Policing
The AR150/200 supports interface-based traffic policing and flow-based traffic policing.
1.5 Configuring Traffic Shaping
Traffic shaping enables outgoing traffic to be sent out at an even rate and reduces the number
of discarded packets whose rate exceeds the rate limit.
1.6 Configuring Congestion Management
If congestion occurs on a network after congestion management is configured, the AR150/200
determines the sequence at which packets are forwarded according to the defined scheduling
policy.
1.7 Configuring Congestion Avoidance
After congestion avoidance is complete, the AR150/200 discards the packets whose rate exceeds
the rate limit based on the WRED configuration.
1.8 Configuring HQoS
To provide differentiated QoS services, configure HQoS on the AR150/200.
1.9 Maintaining QoS
This section describes how to maintain QoS.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
1
1.10 Configuration Examples
This section provides several configuration examples of traffic policing, traffic shaping,
congestion avoidance, and congestion management.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
2
1.1 QoS Overview
QoS is designed to provide differentiated services based on networking requirements.
QoS evaluates the capabilities of the service supplied to meet customer requirements. On the
Internet, QoS is used to evaluate capabilities of a network to transmit packets. The network
provides various services, and QoS evaluates services from different aspects. Generally, QoS
evaluates core items, including the delay, jitter, and packet loss ratio during packet transmission.
QoS uses the following models:
l Best-Effort (BE) model: The BE model is a service model that handles all packets equally.
In the BE model, a network attempts to send packets, but cannot ensure performance such
as delay and reliability. The BE model can be applied to various network applications, such
as FTP and email. The BE model can be implemented using the First in First out (FIFO)
queue.
l IntServ model: The IntServ model is an integrated service model. A device must submit a
request to a network before sending packets. Combined with multicast, the IntServ model
can be used in real-time multimedia applications that require high bandwidth and low delay,
such as video conference and video on demand (VoD).
l DiffServ model: The DiffServ model is a multi-service model and can meet different QoS
requirements, which ensures that applications are provided with differentiated QoS levels.
QoS can be specified based on various information, such as the IP precedence, source
address, and destination address of packets. Network devices perform traffic classification,
traffic shaping, traffic policing, and queue scheduling based on the information.
1.2 QoS Features Supported by the AR150/200
This section describes QoS features supported by the AR150/200.
The AR150/200 supports the following functions:
l Priority Mapping
l Traffic Policing
l Traffic Shaping
l Congestion Avoidance
l Congestion Management
l HQoS
Table 1-1 Implementation of QoS features
Feature Implementation
Priority Mapping Priority mapping can be applied to inbound
and outbound interfaces.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
3
Feature Implementation
Traffic policing Interface-based traffic policing can be
applied to inbound and outbound WAN-side
interfaces, but can only be applied to inbound
LAN-side interfaces.
Flow-based traffic policing can be applied to
inbound and outbound interfaces.
Traffic shaping Interface-based traffic shaping can only be
applied to outbound interfaces.
Queue-based traffic shaping can only be
applied to outbound interfaces.
Flow-based traffic shaping can only be
applied to outbound WAN-side interfaces.
Congestion avoidance Queue-based congestion avoidance can only
be applied to outbound WAN-side interfaces.
Flow-based congestion avoidance can only
be applied to outbound WAN-side interfaces.
Congestion management Queue-based congestion management can
only be applied to outbound interfaces.
Class-based congestion management can
only be applied to outbound WAN-side
interfaces.
HQoS Flow-based hierarchical QoS (HQoS) can
only be applied to outbound WAN-side
interfaces.

Priority Mapping
Different packets carry different precedence fields. For example, VLAN packets carry the 802.1p
field, IP packets carry the DSCP field. The mappings between priority fields must be configured
on gateways to retain priorities of packets when the packets traverse different networks.
To ensure QoS for different packets, the AR150/200 determines the queues that received packets
enter based on 802.1p priorities or DSCP priorities in packets or the default 802.1p priority of
an interface. The AR150/200 can re-mark packet priorities so that the connected device can
provide differentiated QoS based on precedence fields of the packets.
The AR150/200 sends packets to different interface queues based on the 802.1p priority, and
performs traffic shaping, congestion avoidance, and queue scheduling for the queues. The layer
2 FE interfaces on the AR150/200 support only four queues, whereas other interfaces support
eight queues. The mappings between local priorities and queues on the Layer 2 FE interfaces
on the AR150/200 are different. Table 1-2 lists the mappings between 802.1p priorities and
queues on the layer 2 FE interfaces on the AR150/200. Table 1-3 lists the mappings between
802.1p priorities and queues on other interfaces.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
4
Table 1-2 Mappings between 802.1p priorities and queues
802.1p Priority Queue Index
0 0
1 0
2 1
3 1
4 2
5 2
6 3
7 3

Table 1-3 Mappings between 802.1p priorities and queues
802.1p Priority Queue Index
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7

Traffic Policing
Traffic policing limits the traffic and resource usage by monitoring the rate limit.
Traffic policing discards the excess traffic to limit traffic within a proper range and to protect
network resources.
Traffic policing limits the traffic entering the Internet Service Provider (ISP).
l Token bucket and traffic measurement
The AR150/200 needs to determine whether the traffic rate exceeds the rate limit before
performing traffic policing. Token buckets are usually used to measure traffic.
With a certain capacity, a token bucket stores tokens. The system places tokens into a token
bucket at the configured rate (one token occupies one bit). If the token bucket is full, excess
tokens overflow and no token is added.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
5
When measuring traffic, a token bucket forwards packets based on the number of tokens
in the token bucket. If there are enough tokens in the token bucket for forwarding packets,
the traffic rate is within the rate limit. Otherwise, the traffic rate is not within the rate limit.
Figure 1-1 Measuring traffic using token buckets
Packets sent by the
interface
Continue to send
packets
Token
bucket
Put tokens into the bucket at the
specified rate
Classification
Drop
Packets that
need to be
policed
Packets that do
not need to be
policed

The AR150/200 supports dual token bucket technology:
The dual token bucket technology uses the following parameters:
Committed Burst Size (CBS): capacity of bucket C, that is, the maximum volume of
burst traffic (in bytes) allowed by bucket C each time.
Committed Information Rate (CIR): rate at which tokens are put into bucket C, that is,
the average rate of traffic (in kbit/s) allowed by bucket C.
Peak Burst Size (PBS): capacity of bucket P, that is, the maximum volume of burst
traffic (in bytes) allowed by bucket P each time.
Peak Information Rate (PIR): rate at which tokens are put into bucket P, that is, the
average rate of traffic (in kbit/s) allowed by bucket P.
When dual token buckets are used, the packets whose rate is less than the CIR value are
colored green, the packets whose rate is greater than the PIR value are colored red, and the
packets whose rate is greater than the CIR value, but less than the PIR value are colored
yellow.
Traffic policing actions include permit, deny, and forward after a priority change. By
default, green packets and yellow packets are allowed to pass through, and red packets are
discarded.
l Traffic policing features supported by the AR150/200
The AR150/200 supports the following traffic policing features:
Interface-based traffic policing limits the incoming or outgoing service traffic on an
interface.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
6
NOTE
You can use interface-based traffic policing to:
l Limit all the service traffic on an interface.
l Limit the service traffic matching a specified ACL rule.
l Limit the service traffic whose source and destination IP addresses within a specified range.
Flow-based traffic policing limits incoming or outgoing service traffic matching traffic
classification rules.
Traffic Shaping
Traffic shaping also limits traffic and resource usage by monitoring the rate limit. It also uses
the token bucket technology to measure traffic.
Traffic shaping adjusts the speed of outgoing traffic so that the downstream device has
capabilities to process traffic.
l Differences between traffic shaping and traffic policing
Traffic policing directly discards the excess packets. Traffic shaping buffers the packets
whose rate is greater than the traffic shaping rate in queues; therefore, traffic shaping
reduces the number of discarded packets. As shown in Figure 1-2, when there are sufficient
tokens in the token bucket, the buffered packets are forwarded at an even rate. If the tokens
are insufficient, packets are buffered continuously. If the number of packets to be buffered
is greater than the queue length, excess packets are discarded.
Figure 1-2 Traffic shaping
Packets sent by the
interface
Flows
Token
bucket
Put tokens into
token bucket at
specified rate
Simple traffic
classification
Packets
within the
rate limit
Packets not
within the rate
limit
Token
Buffer
packets in
queues
Discarded
packets when
the token bucket
is full
Packets that do
not need to be
shaped
Packets that
need to be
shaped

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
7
Traffic shaping increases the delay because it buffers packets in queues, whereas traffic
policing does not.
l Traffic shaping features supported by the AR150/200
The AR150/200 supports the following traffic shaping features:
Traffic shaping on an interface or a sub-interface
Shapes all the packets that pass through an interface or a sub-interface.
Queue-based traffic shaping
Shapes packets in a specified queue on an interface so that packets are shaped based on
priorities.
Flow-based traffic shaping
Shapes packets of a specified type that pass through an interface so that packets
matching traffic classification rules can be shaped.
Congestion Avoidance
Congestion avoidance is a flow control mechanism. A system configured with congestion
avoidance monitors network resources such as queues and memory buffers. When congestion
occurs or aggravates, the system discards packets.
Congestion avoidance policies include tail drop, Random Early Detection (RED), and Weighted
Random Early Detection (WRED):
l Tail drop
The traditional packet loss policy uses the tail drop method. This method processes all
packets equally without classifying the packets into different types. When congestion
occurs, packets at the end of a queue are discarded until the congestion problem is solved.
This policy leads to global TCP synchronization. When packets of multiple TCP
connections are discarded simultaneously, these TCP connections enter the congestion
avoidance and slow start state. After a while, the peak of these TCP connections occurs.
The volume of traffic varies greatly, affecting link usage.
l RED
The RED technique randomly discards packets to prevent the transmission speed of
multiple TCP connections from being reduced simultaneously.
As specified by the RED algorithm, the upper drop threshold and lower drop threshold are
set. RED processes packets as follows:
When the queue length is shorter than the lower drop threshold, no packet is discarded.
When the queue length is longer than the upper drop threshold, all packets are discarded.
When the queue length is between the lower drop threshold and the upper drop threshold,
incoming packets are discarded randomly. RED generates a random number for each
incoming packet and compares it with the drop probability of the current queue. If the
random number is greater than the drop probability, the packet is discarded. A longer
queue indicates a higher drop probability.
l WRED
WRED also discards packets randomly to prevent global TCP synchronization. WRED,
however, generates random numbers of packets based on packet priorities. WRED discards
packets based on packet priorities, so the drop probability of packets with higher priorities
is low.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
8
By default, the AR150/200 uses tail drop. The AR150/200 supports queue-based WRED and
flow-based RED.
Congestion Management
If a network transmitting both delay-sensitive and delay-insensitive services is congested
intermittently, congestion management is required. However, if a network is always congested,
bandwidth needs to be increased.
Generally, the AR150/200 uses the following queue scheduling mechanisms:
l PQ scheduling
l WRR scheduling
l DRR scheduling
l WFQ scheduling
l PQ+WRR/PQ+DRR/PQ+WFQ scheduling
l CBQ scheduling
l PQ scheduling
Priority queuing (PQ) schedules packets in descending order of priorities. Queues with
lower priories are processed only after all the queues with higher priorities have been
processed.
By using PQ scheduling, the AR150/200 puts packets of delay-sensitive services into
queues with higher priorities and packets of other services into queues with lower priorities.
In this manner, packets of key services can be transmitted first.
PQ scheduling has a disadvantage. If a lot of packets exist in queues with higher priorities
when congestion occurs, packets in queues with lower priorities cannot be transmitted for
a long time.
l WRR scheduling
Weighted Round Robin (WRR) scheduling ensures that packets in all the queues are
scheduled in turn.
For example, eight queues are configured on an interface. Each queue is configured with
a weight: w7, w6, w5, w4, w3, w2, w1, and w0. The weight value represents the percentage
of obtaining resources. The following scenario assumes that the weights of queues on the
100M interface are 50, 50, 30, 30, 10, 10, 10, and 10, which match w7, w6, w5, w4, w3,
w2, w1, and w0. Therefore, the queue with the lowest priority can obtain at least 5 Mbit/s
bandwidth. This ensures that packets in all the queues can be scheduled.
In addition, WRR can dynamically change the time of scheduling packets in queues. For
example, if a queue is empty, WRR ignores this queue and starts to schedule the next queue.
This ensures efficient use of bandwidth.
WRR scheduling has two disadvantages:
WRR schedules packets based on the number of packets. When the average packet
length in each queue is the same or known, you can obtain the required bandwidth by
setting WRR weight values. When the average packet length in each queue is variable,
you cannot obtain the required bandwidth by setting WRR weight values.
Delay-sensitive services, such as voice services, cannot be scheduled in a timely
manner.
l DRR scheduling
Implementation of Deficit Round Robin (DRR) is similar to that of WRR.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
9
The difference between DRR and WRR is as follows: WRR schedules packets based on
the number of packets, whereas DRR schedules packets based on the packet length. If the
packet length is too long, DRR allows the negative weight value so that long packets can
be scheduled. In the next round, the queue with the negative weight value is not scheduled
until its weight value becomes positive.
DRR offsets the disadvantages of PQ scheduling and WRR scheduling. That is, in PQ
scheduling, packets in queues with lower priorities cannot be scheduled for a long time; in
WRR scheduling, bandwidth is allocated improperly when the packet length of each queue
is different or variable.
DRR cannot schedule delay-sensitive services such as voice services in time.
l WFQ scheduling
Fair Queue (FQ) ensures that network resources are allocated evenly to optimize the delay
and jitter of all flows. Weighted FQ (WFQ) schedules packets based on priorities, and
schedules more packets with higher priorities than packets with lower priorities.
WFQ can automatically classify flows based on the session information, including the
protocol type, source and destination TCP or UDP port numbers, source and destination IP
addresses, and precedence field in the ToS field. In addition, WFQ provides a large number
of queues and evenly puts flows into queues to smooth out the delay. When flows leave
queues, WFQ allocates the bandwidth on the outbound interface for each flow based on
the precedence of each flow. Flows with the lowest priorities obtain the least bandwidth.
l PQ+WRR/PQ+DRR/PQ+WFQ scheduling
PQ, WRR, DRR, and WFQ have their own advantages and disadvantages. If only PQ
scheduling is used, packets in queues with lower priorities cannot obtain bandwidth. If only
WRR, DRR, or WFQ scheduling is used, delay-sensitive services cannot be scheduled in
time. PQ+WRR, PQ+DRR, or PQ+WFQ scheduling integrates the advantages of PQ
scheduling and WRR or DWRR scheduling and offsets their disadvantages.
By using PQ+WRR, PQ+DRR, or PQ+WFQ scheduling, the AR150/200 puts important
packets, such as protocol packets and packets of delay-sensitive services to the PQ queue,
and allocates bandwidth to the PQ queue. Then the AR150/200 can put other packets into
WRR, DRR, or WFQ queues based on the packet priority. Packets in WRR, DRR, or WFQ
queues can be scheduled in turn.
l CBQ scheduling
Class-based queueing (CBQ) is an extension of WFQ and matches packets with traffic
classifiers. CBQ classifies packets based on the IP precedence or DSCP priority, inbound
interface, or 5-tuple (protocol type, source IP address and mask, destination IP address and
mask, source port range, and destination port range). Then CBQ puts packets into different
queues. If packets do not match any configured traffic classifiers, CBQ matches packets
with the default traffic classifier.
CBQ provides the following types of queues:
Expedited Forwarding (EF) queues are applied to short-delay services.
An EF queue has the highest priority. You can put one or more types of packets into EF
queues and set different bandwidth for different types of packets. During scheduling, if
EF queues have packets, packets in EF queues are sent first. Packets in other queues are
sent only after EF queues are empty or the maximum reservable bandwidth of EF queues
is exceeded.
UDP packets of VoIP services often exist in EF queues; therefore, use the tail drop
method but not WRED.
Assured Forwarding (AF) queues are applied to key data services that require assured
bandwidth.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
10
Each AF queue corresponds to one type of packets. You can set bandwidth for each
type of packets. During scheduling, the system sends packets based on the configured
bandwidth. AF implements fair scheduling. If an interface has remaining bandwidth,
packets in AF queues obtain the remaining bandwidth based on weights. When
congestion occurs, each type of packets can obtain the minimum bandwidth.
If the length of an AF queue reaches the maximum value, the tail drop method is used
by default. You can choose to use WRED.
Best-Effort (BE) queues are applied to best-effort services that require no strict QoS
assurance.
If packets do not match any configured traffic classifiers, packets match the default
traffic classifier defined by the system. You are allowed to configure AF queues and
bandwidth for the default traffic classifier, whereas BE queues are configured in most
situations. BE uses WFQ scheduling so that the system schedules packets matching the
default traffic classifier based on flows.
If the length of a BE queue reaches the maximum value, the tail drop method is used
by default. You can choose to use WRED.
HQoS
The traditional QoS technology schedules packets based on interfaces. An interface, however,
can identify only priorities of different services but cannot identify services of different users.
Packets of the same priority are placed into the same queue on an interface, and compete for the
same queue resource. Therefore, the traditional QoS technology is unable to provide
differentiated services based on types of traffic and users.
As the number of users increases continuously and services develop, users require differentiated
services to have better QoS and gain more profits. Hierarchical QoS (HQoS) implements
hierarchical scheduling based on queues and differentiates services and users. It provides QoS
guarantee and saves network operation and maintenance costs.
l Queues supported by HQoS
The AR150/200 supports three levels of queues, that is, level-3 flow queue (FQ), level-2
subscriber queue (SQ), and level-1 port queue (PQ). The HQoS hierarchy is a tree structure.
The flow queue is taken as the leaf node and the port queue is taken as the root node. When
packets pass through an interface using HQoS, the packets are classified so that they
traverse the branches of the tree. Packets arrive at the top of the tree and are classified on
one of the leaves. Packets then traverse down the tree until they are transmitted out the
interface at the root.
l HQoS implementation
HQoS is implemented by traffic policy nesting supported by the AR150/200.
A traffic policy can be nested into another traffic policy. That is, the traffic behavior or
action in a traffic policy is a sub traffic policy. When a sub traffic policy is bound to a traffic
policy, the traffic behavior in the traffic policy is taken for packets matching the traffic
classifier associated with the traffic behavior. Then the packets are classified by the sub
traffic policy and the traffic behavior in the sub traffic policy is taken for the classified
packets.
A traffic classifier in the traffic policy differentiates users. That is, the packets that match
the traffic classifier in the traffic policy enter the same subscriber queue.
The traffic classifier in a sub traffic policy differentiates services. That is, the packets that
match the traffic classifier in the sub traffic policy enter the same flow queue.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
11
l HQoS scheduling
HQoS implements hierarchical scheduling and provides good service support. Scheduler
levels are relevant to the topology.
The AR150/200 provides three levels of schedulers, that is, flow queue scheduler,
subscriber queue scheduler, and port queue scheduler. The flow queue scheduler and
subscriber queue scheduler support PQ scheduling, WFQ scheduling, and PQ+WFQ
scheduling. The port queue scheduler uses RR scheduling.
HQoS deployment for enterprise users is used as an example. Enterprise users have VoIP
services, video conference (VC) services, and data services. Each subscriber queue
corresponds to one enterprise user and each flow queue corresponds to a type of services.
By deploying HQoS, the AR150/200 implements the following functions:
Controlling traffic scheduling among the three types of services of a single enterprise
user
Controlling total bandwidth of the three types of services of a single enterprise user
Controlling bandwidth allocation between multiple enterprise users
Controlling total bandwidth of multiple enterprise users
1.3 Configuring Priority Mapping
After priority mapping is configured, the AR150/200 determines the queues and output priorities
of the received packets based on packet priorities or the default 802.1p priority of the interface.
By doing this, the AR150/200 provides differentiated services.
1.3.1 Establishing the Configuration Task
Before configuring priority mapping, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Applicable Environment
The AR150/200 can determine the queues that packets enter based on packet priorities (802.1p/
DSCP priorities) or the priority of an interface. The AR150/200 can re-mark packet priorities
so that the connected device can provide differentiated QoS based on precedence fields of the
packets.
l When the AR150/200 is configured to trust DSCP priorities of packets, it maps DSCP
priorities to 802.1p priorities based on priority mapping. The AR150/200 also determines
the queues that packets enter, and re-marks packet priorities.
l When the AR150/200 is configured to trust 802.1p priorities of packets or uses the priority
of an interface, it determines the queues that packets enter based on the 802.1p priority and
re-marks packet priorities.
Pre-configuration Tasks
Before configuring priority mapping, complete the following tasks:
l Configuring link layer attributes of interfaces to ensure that these interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
12
Data Preparation
To configure priority mapping, you need the following data.
No. Data
1 Types and numbers of interfaces
2 Priority of an interface
3 Packet priority trusted by an interface
4 Input priority and output priority

1.3.2 Configuring the Packet Priority Trusted by an Interface
After an interface is configured to trust the priority of packets, the AR150/200 performs mapping
based on the specified priority.
Context
The AR150/200 trusts the following priorities:
l 802.1p priority
The AR150/200 determines the queues that tagged packets enter based on 802.1p
priorities in the tagged packets and modifies packet priorities.
The AR150/200 determines the queues that untagged packets enter based on the default
802.1p priority of an interface and modifies packet priorities.
l DSCP priority
The AR150/200 maps DSCP priorities of packets to 802.1p priorities, determines the
queues that packets enter, and modifies packet priorities based on the priority mapping
table.
l Priority of an interface
The AR150/200 determines the queues that packets enter based on the priority of the
interface, and modifies packet priorities based on the priority mapping table.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 3 Run:
trust { 8021p | dscp } [ override ]
The packet priority trusted by the interface is configured.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
13
By default, the priority of an interface is used.
----End
1.3.3 Setting the Default 802.1p Priority of an Interface
The default 802.1p priority of an interface can be set. By default, the default 802.1p priority of
an interface is 0.
Context
The 802.1p priority is determined by the 3-bit priority field contained in a VLAN tag. The 802.1p
priority is used to provide differentiated services.
The default 802.1p priority of an interface is used in the following situations presented in the
following table.
Interface Configuration Whether a Received
Packet Carries a VLAN
Tag
Processing Method
Default configuration (the
priority of an interface is
used)
No The AR150/200 searches for
the mapping table between
802.1p priorities and other
priorities based on the
priority of an interface,
modifies the packet priority,
and send the packet to a
queue based on the modified
802.1p priority.
Default configuration (the
priority of an interface is
used)
Yes The AR150/200 searches for
the mapping table between
802.1p priorities and other
priorities based on the
priority of an interface,
modifies the packet priority,
and sends the packet to a
queue based on the modified
802.1p priority.
trust 8021p override No The AR150/200 searches for
the mapping table between
802.1p priorities and other
priorities based on the
priority of an interface,
modifies the packet priority,
and sends the packet to a
queue based on the 802.1p
priority.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
14
Interface Configuration Whether a Received
Packet Carries a VLAN
Tag
Processing Method
trust 8021p No The AR150/200 searches for
the mapping table between
802.1p priorities and other
priorities based on the
priority of an interface,
modifies the packet priority,
and sends the packet to a
queue based on the 802.1p
priority.

Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
interface interface-type interface-number
The interface view is displayed.
Step 3 Run:
port priority priority-value
The priority of the interface is set.
By default, the priority of an interface is 0.
----End
1.3.4 Configuring a Priority Mapping Table
A priority mapping table includes mappings between 802.1p priorities, DSCP priorities.
Context
The AR150/200 performs priority mapping based on packet priorities or the default priority of
an interface. Mappings between priorities can be configured in the priority mapping table.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
qos map-table { dot1p-dot1p | dot1p-dscp | dscp-dot1p | dscp-dscp }
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
15
The priority mapping table view is displayed.
Step 3 Run:
input { input-value1 [ to input-value2 ] } &<1-10> output output-value
Mappings are configured in the priority mapping table.
----End
1.3.5 Checking the Configuration
After priority mapping is configured, you can view global priority mapping.
Prerequisites
All the priority mapping configurations are complete.
Procedure
l Run the display qos map-table [ dot1p-dot1p | dot1p-dscp | dscp-dot1p | dscp-dscp ]
command to view the priority mapping.
----End
1.4 Configuring Traffic Policing
The AR150/200 supports interface-based traffic policing and flow-based traffic policing.
1.4.1 Establishing the Configuration Task
Before configuring traffic policing, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Applicable Environment
A network is congested if traffic sent by users is not limited. To make use of limited network
resources, limit the user traffic.
l Interface-based traffic policing limits the incoming or outgoing service traffic on an
interface.
NOTE
You can use interface-based traffic policing to:
l Limit all the service traffic on an interface.
l Limit the service traffic matching a specified ACL rule.
l Limit the service traffic whose source and destination IP addresses within a specified range.
l Flow-based traffic policing limits incoming or outgoing service traffic matching traffic
classification rules.
Pre-configuration Tasks
Before configuring traffic policing, complete the following tasks:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
16
l Configuring link layer attributes of interfaces to ensure that these interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
Data Preparation
To configure interface-based traffic policing, you need the following data.
No. Data
1 Interface and direction to which the traffic policy is applied
2 CIR value and optional parameters including the PIR value, CBS value, PBS value,
color, and coloring mode

To configure flow-based traffic policing, you need the following data.
No. Data
1 Traffic classifier name and related parameters
2 Traffic behavior name and committed access rate (CAR) parameters: CIR value and
optional parameters including the PIR value, CBS value, PBS value, color, and
coloring mode
3 Traffic policy name and interface and direction to which the traffic policy is applied

1.4.2 Configuring Traffic Policing on an Interface
You can configure CAR on an interface in the inbound or outbound direction to limit the rate
of incoming or outgoing traffic on the interface.
Context
To limit all the incoming or outgoing traffic on an interface, configure traffic policing on the
interface. If the rate of received or sent packets exceeds the rate limit, packets are discarded.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 3 Run the following commands as required.
l On the WAN side, run:
qos car { inbound | outbound } [ acl acl-number | { destination-ip-address
range| source-ip-address range } start-ip-address to end-ip-address [ per-
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
17
address ] ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ]
[ green { discard | pass [ remark-8021p 8021p-value | remark-dscp dscp-
value ] } ] [ yellow { discard | pass [ remark-8021p 8021p-value | remark-dscp
dscp-value ] } ] [ red { discard | pass [ remark-8021p 8021p-value | remark-
dscp dscp-value ] } ]
Traffic policing is configured on the WAN-side interface.
By default, traffic policing is not performed on an interface.
NOTE
If the CBS and PBS values are not specified, their values are determined as follows:
l If the PIR value is not set or the PIR and CIR values are the same, the CBS value is 188 times the
CIR value and the PBS value is 313 times the CIR value.
l If the PIR value is set and the PIR and CIR values are different, the CBS value is 125 times the
CIR value and the PBS value is 125 times the PIR value.
When the CBS value is less than the number of bytes in a single packet of a service, packets of the
service are discarded.
l On the LAN side, run:
qos car { inbound cir cir-value | { inbound | outbound } { acl acl-number |
{ destination-ip-address range | source-ip-address range } start-ip-address to
end-ip-address [ per-address ] } cir cir-value [ pir pir-value ] [ cbs cbs-
value pbs pbs-value ] [ green { discard | pass [ remark-8021p 8021p-value |
remark-dscp dscp-value ] } ] [ yellow { discard | pass [ remark-8021p 8021p-
value | remark-dscp dscp-value ] } ] [ red { discard | pass [ remark-8021p 8021p-
value | remark-dscp dscp-value ] } ] }
Traffic policing is configured on the LAN-side interface.
By default, traffic policing is not performed on an interface.
NOTE
LAN-side interfaces on the AR150/200 support only traffic policing in the inbound direction.
----End
1.4.3 Configuring Flow-based Traffic Policing
After traffic policing is configured in a traffic policy, the traffic policy can be applied to multiple
interfaces to limit the rate of incoming or outgoing traffic on the interfaces.
Context
To limit the rate of incoming or outgoing traffic matching traffic classification rules, configure
flow-based traffic policing. A traffic policy can be applied to multiple interfaces. When the
traffic rate exceeds the rate limit, traffic is discarded. Flow-based traffic policing can implement
differentiated services using complex traffic classification.
Procedure
Step 1 Configure a traffic classifier.
The AR150/200 can classify traffic according to the ACL, Layer 2 information in packets, and
Layer 3 information in packets. Configure a traffic classifier by selecting appropriate traffic
classification rules. For details, see 2.3 Configuring a Traffic Classifier.
Step 2 Configure a traffic behavior.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
18
Create a traffic behavior and configure the CAR action in the traffic behavior. For details, see
2.4.5 Configuring Traffic Policing.
Step 3 Configure a traffic policy.
Create a traffic policy, associate the traffic classifier and traffic behavior with the traffic policy,
and apply the traffic policy to an interface. For details, see 2.5 Configuring a Traffic Policy.
----End
1.4.4 Checking the Configuration
After traffic policing is configured, you can view the rate limit.
Prerequisites
All the traffic policing configurations are complete.
Procedure
l Checking the interface-based traffic policing configuration
Run the display this command in the interface view to check the traffic policing
configuration on the interface.
l Checking the flow-based traffic policing configuration
Run the display traffic behavior { system-defined | user-defined } [ behavior-
name ] command to check the traffic behavior configuration.
Run the display traffic classifier { system-defined | user-defined } [ classifier-
name ] command to check the traffic classifier configuration.
Run the display traffic policy user-defined [ policy-name [ classifier classifier-
name ] ] command to check the traffic policy configuration.
Run the display traffic-policy policy-name applied-record command to check the
specified traffic policy record.
l Checking the packet statistics on the interface configured with traffic policing
Run the display qos car statistics interface interface-type interface-number
{ inbound | outbound }or display qos car statistics interface { virtual-template vt-
number virtual-access va-number | dialer number } { inbound | outbound } command
to check the statistics on forwarded and discarded packets on the interface.
----End
1.5 Configuring Traffic Shaping
Traffic shaping enables outgoing traffic to be sent out at an even rate and reduces the number
of discarded packets whose rate exceeds the rate limit.
1.5.1 Establishing the Configuration Task
Before configuring traffic shaping, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
19
Applicable Environment
If the bandwidth on the upstream network is different from the bandwidth on the downstream
network, configure traffic shaping on the outbound interface that connects the upstream network
to the downstream network. Traffic shaping ensures that the rate of packets destined for the
downstream network does not exceed the bandwidth of the downstream network, reducing
congestion and packet loss. The AR150/200 supports the following types of traffic shaping:
l Interface-based traffic shaping: shapes all the service traffic on an interface so that the
service traffic can be sent out at an even rate.
l Queue-based traffic shaping: sets different rate limits for queues with different priorities
on an interface.
l Flow-based traffic shaping: sets different rate limits for different types of traffic matching
traffic configuration rules on an interface.
You can configure one or two types of traffic shaping on an interface, but queue-based traffic
shaping and flow-based traffic shaping cannot be configured on the same interface.
NOTE
If both interface-based traffic shaping and queue-based traffic shaping are configured on an interface, the
CIR value of interface-based traffic shaping cannot be less than the sum of CIR values of all the queues
on the interface; otherwise, the traffic shaping result may be incorrect. For example, packets in queues with
higher priorities are not scheduled in a timely manner.
If both interface-based traffic shaping and flow-based traffic shaping are configured on an interface, the
CIR value of interface-based traffic shaping cannot be less than the sum of CIR values of all the flows on
the interface; otherwise, the traffic shaping result may be incorrect. For example, packets in queues with
higher priorities are not scheduled in a timely manner.
Traffic shaping can be configured on a logical interface, including the dialer interface, MP-Group interface,
virtual template interface, virtual Ethernet interface, tunnel interface, or the physical interface
corresponding to the virtual interface. If traffic shaping, congestion management, congestion avoidance,
or a combination of them is configured on the virtual interface, the configuration on the virtual interface
takes effect. The configuration on the physical interface, however, does not take effect.
Pre-configuration Tasks
Before configuring traffic shaping, complete the following tasks:
l Configuring link layer attributes of interfaces to ensure that these interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
Data Preparation
To configure interface-based traffic shaping, you need the following data.
No. Data
1 Interface to which traffic shaping is applied
2 CIR value and (optional) CBS value

To configure queue-based traffic shaping, you need the following data.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
20
No. Data
1 Number of the interface and index of the queue to which traffic shaping is applied
2 Queue profile name
3 CIR value and (optional) CBS value
4 Number of the interface to which a queue profile is applied

To configure flow-based traffic policing, you need the following data.
No. Data
1 Traffic classifier name and related parameters
2 Traffic behavior name, and CIR value and optional parameters including the PIR
value, PBS value, and queue length
3 Traffic policy name and interface to which the traffic policy is applied

1.5.2 Configuring Interface-based Traffic Shaping
You can configure traffic shaping on an interface to limit the rate of data sent by the interface.
Context
To limit all the outgoing traffic on an interface, configure traffic shaping on the interface. Traffic
shaping buffers the packets whose rate is greater than the traffic shaping rate. When there are
sufficient tokens in the token bucket, the buffered packets are forwarded at an even rate. If queues
are full, packets are discarded.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 3 Run:
qos gts cir cir-value [ cbs cbs-value ]
Traffic shaping is configured.
By default, traffic shaping is not performed on an interface. When you configure traffic shaping
on an interface without specifying the CBS value, the CBS value is 25 times the CIR value.
----End
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
21
1.5.3 Configuring Queue-based Traffic Shaping
This section describes how to configure a queue profile, set traffic shaping parameters, and apply
a traffic shaping profile to an interface.
Context
To shape packets in each queue on an interface, configure a queue profile and apply it to the
interface. The received packets enter different queues based on priority mapping. Differentiated
services are provided by setting different traffic shaping parameters for queues with different
priorities.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
qos queue-profile queue-profile-name
A queue profile is created and the queue profile view is displayed.
Step 3 Run:
queue { start-queue-index [ to end-queue-index ] } &<1-10> length { bytes bytes-
value | packets packets-value }
*
The length of each queue is set.
By default, the length of a queue using PQ on the WAN side is 40960 bytes; the length of a
queue using WFQ on the WAN side is 131072 bytes; the length of a queue using PQ, DRR, or
WRR on the LAN side is 5120 bytes.
NOTE
The layer 2 FE interface on the AR150/200 does not support the queue length command.
Step 4 Run:
queue { start-queue-index [ to end-queue-index ] } &<1-10> gts cir cir-value [ cbs
cbs-value ]
Queue-based traffic shaping is configured.
By default, traffic shaping is not performed for queues. When you configure traffic shaping on
an interface without specifying the CBS value, the CBS value is 25 times the CIR value.
Step 5 Run:
quit
Exit from the queue profile view.
Step 6 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 7 Run:
qos queue-profile queue-profile-name
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
22
The queue profile is applied to the interface or sub-interface.
----End
1.5.4 Configuring Flow-based Traffic Shaping
After traffic shaping is configured in a traffic policy, the traffic policy can be applied to multiple
interfaces to limit the rate of traffic of a specified type on the interfaces.
Context
To limit all the outgoing traffic of a specified type on an interface, configure flow-based traffic
shaping. A traffic policy can be applied to different interfaces. When the rate of packets matching
the traffic policy exceeds the rate limit, traffic shaping buffers the excess packets. When there
are sufficient tokens in the token bucket, the buffered packets are forwarded at an even rate.
When the token bucket is full, the packets are discarded. Flow-based traffic shaping can
implement differentiated services using complex traffic classification.
Procedure
Step 1 Configure a traffic classifier.
The AR150/200 can classify traffic according to the ACL, Layer 2 information in packets, and
Layer 3 information in packets. Configure a traffic classifier by selecting appropriate traffic
classification rules. For details, see 2.3 Configuring a Traffic Classifier.
Step 2 Configure a traffic behavior.
Create a traffic behavior and configure the GTS action in the traffic behavior. For details, see
2.4.6 Configuring Traffic Shaping.
Step 3 Configure a traffic policy.
Create a traffic policy, associate the traffic classifier and traffic behavior with the traffic policy,
and apply the traffic policy to an interface. For details, see 2.5 Configuring a Traffic Policy.
----End
1.5.5 Checking the Configuration
After traffic shaping is configured, you can view the traffic shaping rate.
Prerequisites
All the traffic shaping configurations are complete.
Procedure
l Check the traffic shaping configuration in the interface view.
Run the display this command in the interface view to check the traffic shaping
configuration on the interface.
l Check the traffic shaping configuration in the queue profile view.
Run the display this command in the interface view to check the queue profile bound
to the interface.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
23
Run the display qos queue-profile [ queue-profile-name ] command to check the queue
profile configuration.
l Check the traffic shaping configuration in the traffic behavior view.
Run the display traffic behavior { system-defined | user-defined } [ behavior-
name ] command to check the traffic behavior configuration.
Run the display traffic classifier { system-defined | user-defined } [ classifier-
name ] command to check the traffic classifier configuration.
Run the display traffic policy user-defined [ policy-name [ classifier classifier-
name ] ] command to check the traffic policy configuration.
Run the display traffic-policy policy-name applied-record command to check the
specified traffic policy record.
----End
1.6 Configuring Congestion Management
If congestion occurs on a network after congestion management is configured, the AR150/200
determines the sequence at which packets are forwarded according to the defined scheduling
policy.
1.6.1 Establishing the Configuration Task
Before configuring congestion management, familiarize yourself with the applicable
environment, complete the pre-configuration tasks, and obtain the data required for the
configuration. This will help you complete the configuration task quickly and accurately.
Applicable Environment
When congestion occurs on a network, configure congestion management to implement the
following functions:
l Smooth out the delay and jitter.
l Preferentially process packets of delay-sensitive services, such as video services and voice
services.
l Process packets with the same priority uniformly and process packets with different
priorities based on packet priorities among delay-insensitive services, for example, email
services.
The AR150/200 supports queue-based congestion management and class-based congestion
management:
l Queue-based congestion management: When packets enter queues on an interface based
on packet priorities, configure different scheduling modes for queues using a queue profile
so that differentiated services are provided.
l Class-based congestion management: The AR150/200 provides EF, AF, and BE queues
and different scheduling modes for packets matching traffic classifiers so that differentiated
services can be provided.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
24
NOTE
Queue-based congestion management and class-based congestion management cannot be configured
simultaneously.
Class-based congestion management can only be configured on the AR150/200 WAN-side interfaces but
not on the LAN-side interfaces.
Congestion management can be configured on the logical interface, including the dialer interface, MP-
Group interface, virtual template interface, virtual Ethernet interface, tunnel interface, or the physical
interface corresponding to the virtual interface. If traffic shaping, congestion management, congestion
avoidance, or a combination of them is configured on the virtual interface, the configuration on the virtual
interface takes effect. The configuration on the physical interface, however, does not take effect.
Pre-configuration Tasks
Before configuring congestion management, complete the following tasks:
l Configuring priority mapping
l Configuring priority re-marking based on traffic classification
Data Preparation
To configure queue-based congestion management, you need the following data.
No. Data
1 Interface and queue to which congestion management is applied
2 Queue profile name
3 Queue scheduling mode
4 (Optional) Queue length
5 (Optional) Queue weight

To configure class-based congestion management, you need the following data.
No. Data
1 Traffic classifier name and related parameters
2 Traffic behavior name and scheduling mode
3 Traffic policy name and interface to which the traffic policy is applied

1.6.2 Configuring Queue-based Congestion Management
The AR150/200 supports the following scheduling modes: PQ, DRR, WFQ, WRR, PQ+DRR,
PQ+WFQ, and PQ+WRR.
Context
After packets enter queues on an interface based on priority mapping, they are scheduled
according to rules. Interfaces on the AR150/200 support different scheduling modes. PQ queues
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
25
are scheduled first, and multiple queues are scheduled in descending order of priorities. After
all the PQ queues are scheduled, the AR150/200 schedules DRR, WFQ, or WRR queues in turn.
Table 1-4 Scheduling mode supported by each interface
Interface Scheduling Mode
LAN-side interface l PQ
l DRR
l WRR
l PQ+DRR
l PQ+WRR
NOTE
Layer 2 FE interfaces on the AR150/200 do not
support DRR scheduling. They support the
following scheduling modes:
l PQ
l WRR
l PQ+WRR
WAN-side interface l PQ
l WFQ
l PQ+WFQ

Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
qos queue-profile queue-profile-name
A queue profile is created and the queue profile view is displayed.
Step 3 Run the following commands as required.
l On the WAN-side interface, run:
schedule { { pq start-queue-index [ to end-queue-index ] } | { wfq start-queue-
index [ to end-queue-index ] } }
*
A scheduling mode is configured for each queue on the WAN-side interface.
l On the LAN-side interface, run:
schedule { { pq start-queue-index [ to end-queue-index ] } | { drr start-queue-
index [ to end-queue-index ] } | { wrr start-queue-index [ to end-queue-
index ] } }
*
A scheduling mode is configured for each queue on the LAN-side interface.
By default, all the queues on the LAN side use WRR and all the queues on the WAN use
WFQ.
Step 4 (Optional) Run:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
26
queue { start-queue-index [ to end-queue-index ] } &<1-10> length { bytes bytes-
value | packets packets-value }
*
The length of each queue is set on the interface.
By default, the length of a queue using PQ, DRR, or WRR on the LAN side is 5120 bytes; the
length of a queue using PQ on the WAN side is 40960 bytes; the length of a queue using WFQ
on the WAN side is 131072 bytes.
NOTE
The Layer 2 FE interface on the AR150/200 does not support the queue length command.
Step 5 (Optional) Run:
queue { start-queue-index [ to end-queue-index ] } &<1-10> weight weight-value
The weight value of each queue is set on the interface.
By default, the weight value of a queue is 10.
NOTE
The Layer 2 FE interface on the AR150/200 does not support the queue weight command.
Step 6 Run:
quit
Exit from the queue profile view.
Step 7 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 8 Run:
qos queue-profile queue-profile-name
The queue profile is applied to the interface or sub-interface.
----End
1.6.3 Configuring Class-based Congestion Management
After a traffic policy is configured, it can be applied to multiple interfaces so that the same
scheduling mode can be applied to traffic of a specified type on multiple interfaces.
Context
The AR150/200 provides the following queues for data packets matching traffic classification
rules:
l AF: ensures low drop probability of packets when the rate of outgoing service traffic does
not exceed the minimum bandwidth. It is applied to services of heavy traffic that need to
be ensured.
l EF: is applied to services requiring a low delay, low drop probability, and assured
bandwidth. EF is also applied to services occupying low bandwidth, for example, voice
packets. After packets matching traffic classification rules enter EF queues, they are
scheduled in Strict Priority (SP) mode. Packets in other queues are scheduled only after all
the packets in EF queues are scheduled.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
27
l BE: is used with the default traffic classifier. The remaining packets that do not enter AF
or EF queues enter BE queues. BE queues use WFQ scheduling. When a greater number
of queues are configured, WFQ allocates bandwidth more evenly but more resources are
occupied. WFQ is applied to the services insensitive to the delay and packet loss, for
example, Internet access services.
Class-based congestion management, also called CBQ, on the main interface or sub-interface is
exclusive with the queue profile or traffic shaping on the same main interface or sub-interface.
CBQ Configuration Whether the Queue
Profile Can Be
Configured (qos queue-
profile (interface view))
Whether Traffic Shaping
Can Be Configured (qos
gts)
Main interface Main interface: No Main interface: Yes
Sub-interface: No Sub-interface: No
Sub-interface Main interface: Yes Main interface: Yes
Sub-interface: No Sub-interface: Yes

Procedure
Step 1 Configure a traffic classifier.
The AR150/200 can classify traffic according to the ACL, Layer 2 information in packets, and
Layer 3 information in packets. Configure a traffic classifier by selecting appropriate traffic
classification rules. For details, see 2.3 Configuring a Traffic Classifier.
Step 2 Configure a traffic behavior.
Create a traffic behavior and configure flow-based queue scheduling in the traffic behavior. For
details, see 2.4.7 Configuring Congestion Management.
Step 3 Configure a traffic policy.
Create a traffic policy, associate the traffic classifier and traffic behavior with the traffic policy,
and apply the traffic policy to an interface. For details, see 2.5 Configuring a Traffic Policy.
----End
1.6.4 Checking the Configuration
After congestion management is configured, you can view scheduling parameters of each queue
on a specified interface.
Prerequisites
All the congestion management configurations are complete.
Procedure
l Checking the queue-based congestion management configuration
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
28
Run the display this command in the interface view to check the queue profile bound
to the interface.
Run the display qos queue-profile [ queue-profile-name ] command to check the queue
profile configuration.
l Checking the class-based congestion management configuration
Run the display traffic behavior { system-defined | user-defined } [ behavior-
name ] command to check the traffic behavior configuration.
Run the display traffic classifier { system-defined | user-defined } [ classifier-
name ] command to check the traffic classifier configuration.
Run the display traffic policy user-defined [ policy-name [ classifier classifier-
name ] ] command to check the traffic policy configuration.
Run the display traffic-policy policy-name applied-record command to check the
specified traffic policy record.
----End
1.7 Configuring Congestion Avoidance
After congestion avoidance is complete, the AR150/200 discards the packets whose rate exceeds
the rate limit based on the WRED configuration.
1.7.1 Establishing the Configuration Task
Before configuring congestion avoidance, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Applicable Environment
By default, the AR150/200 uses the tail drop method and discards data packets at the end of a
queue when congestion occurs. The tail drop method may cause global Transmission Control
Protocol (TCP) synchronization, and it reduces link usage. The Weighted Random Early
Detection (WRED) can solve these problems.
The AR150/200 supports queue-based congestion avoidance and flow-based congestion
avoidance:
l Queue-based congestion avoidance: In a queue profile, different drop profiles are bound
to queues. Different WRED parameters in drop profiles take effect for queues with different
priorities so that differentiated services are provided.
l Flow-based congestion avoidance: The AR150/200 provides EF, AF, and BE queues for
packets matching traffic classification rules. EF queues can use only tail drop, and AF and
BE queues can bind drop profiles to traffic behaviors so that differentiated services are
provided.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
29
NOTE
Queue-based congestion avoidance and flow-based congestion avoidance are exclusive.
Congestion avoidance can only be configured on the AR150/200 WAN-side interfaces but not on the LAN-
side interfaces.
Congestion avoidance can be configured on the logical interface, including the dialer interface, MP-Group
interface, virtual template interface, virtual Ethernet interface, tunnel interface, or the physical interface
corresponding to the virtual interface. If traffic shaping, congestion management, congestion avoidance,
or a combination of them is configured on the virtual interface, the configuration on the virtual interface
takes effect. The configuration on the physical interface, however, does not take effect.
Pre-configuration Tasks
Before configuring congestion avoidance, complete the following tasks:
l Configuring priority mapping
l Configuring priority re-marking based on traffic classification
l Configuring congestion management
Data Preparation
To configure queue-based congestion avoidance, you need the following data.
No. Data
1 Drop profile name and WRED parameters
2 Queue profile name
3 Interface and queue to which congestion avoidance is applied

To configure flow-based congestion avoidance, you need the following data.
No. Data
1 Drop profile name and WRED parameters
2 Traffic classifier name and related parameters
3 Traffic behavior name
4 Traffic policy name and interface to which the traffic policy is applied

1.7.2 Configuring Queue-based WRED
To reduce congestion on a WAN-side interface, apply a drop profile to the interface.
Context
A drop profile defines WRED parameters and is used to implement congestion avoidance for
queues bound to the drop profile.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
30
After a drop profile is bound to a queue profile, bind the queue profile to an interface so that
WRED parameters in the drop profile take effect on the interface.
The AR150/200 supports WRED based on DSCP priorities or IP priorities:
l The value of an IP precedence ranges from 0 to 7.
l The value of a DSCP priority ranges from 0 to 63.
l Eight DSCP priorities correspond to one IP precedence.
WRED based on DSCP priorities differentiates services in a more refined manner.
NOTE
Drop profiles can be bound to only queues using WFQ on the AR150/200 WAN interfaces.
Procedure
Step 1 Configuring a drop profile
1. Run:
system-view
The system view is displayed.
2. Run:
drop-profile drop-profile-name
A drop profile is created and the drop profile view is displayed.
3. (Optional) Run:
wred { dscp | ip-precedence }
A WRED drop profile based on DSCP or IP priorities is configured.
4. Run the following commands as required.
l Run:
dscp { dscp-value1 [ to dscp-value2 ] } &<1-10> low-limit low-limit-
percentage high-limit high-limit-percentage discard-percentage discard-
percentage
WRED parameters based on DSCP priorities are set.
l Run:
ip-precedence { ip-precedence-value1 [ to ip-precedence-value2 ] } &<1-10>
low-limit low-limit-percentage high-limit high-limit-percentage discard-
percentage discard-percentage
WRED parameters based on IP priorities are set.
5. Run:
quit
Exit from the drop profile view.
Step 2 Applying the drop profile
1. Run:
qos queue-profile queue-profile-name
The queue profile view is displayed.
The drop profile can be an existing drop profile or a new drop profile. You can set the
scheduling mode, queue weight, queue length, and queue shaping in the queue profile.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
31
2. Run:
schedule wfq start-queue-index [ to end-queue-index ]
WFQ is specified for the specified queue in the queue profile.
3. Run:
queue { start-queue-index [ to end-queue-index ] } &<1-10> drop-profile drop-
profile-name
A drop profile is bound to a queue in a queue profile.
By default, no queue is bound to a drop profile. All queues use tail drop.
4. Run:
quit
Exit from the queue profile view.
5. Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
6. Run:
qos queue-profile queue-profile-name
The queue profile is applied to the interface or sub-interface.
----End
1.7.3 Configuring Flow-based WRED
To reduce congestion in AF and BE queues, bind a drop profile to a traffic behavior of a traffic
policy.
Prerequisites
Class-based congestion management has been configured.
Context
A drop profile defines WRED parameters and is used to implement congestion avoidance for
queues bound to the drop profile.
After a drop profile is bound to a traffic behavior, bind the traffic behavior and traffic classifier
to a traffic policy and apply the traffic policy to an interface so that WRED parameters in the
drop profile take effect on the interface.
The AR150/200 supports WRED based on DSCP priorities or IP priorities:
l The value of an IP precedence ranges from 0 to 7.
l The value of a DSCP priority ranges from 0 to 63.
l Eight DSCP priorities correspond to one IP precedence.
WRED based on DSCP priorities differentiates services in a more refined manner.
NOTE
Congestion avoidance can only be configured on the AR150/200 WAN-side interfaces but not on the LAN-
side interfaces.
A drop profile takes effect for only AF and BE queues; therefore, class-based congestion management must
have been configured before you configure flow-based congestion avoidance.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
32
Procedure
Step 1 Configuring a drop profile
1. Run:
system-view
The system view is displayed.
2. Run:
drop-profile drop-profile-name
A drop profile is created and the drop profile view is displayed.
3. (Optional) Run:
wred { dscp | ip-precedence }
A WRED drop profile based on DSCP or IP priorities is configured.
4. Run the following commands as required.
l Run:
dscp { dscp-value1 [ to dscp-value2 ] } &<1-10> low-limit low-limit-
percentage high-limit high-limit-percentage discard-percentage discard-
percentage
WRED parameters based on DSCP priorities are set.
l Run:
ip-precedence { ip-precedence-value1 [ to ip-precedence-value2 ] } &<1-10>
low-limit low-limit-percentage high-limit high-limit-percentage discard-
percentage discard-percentage
WRED parameters based on IP priorities are set.
5. Run:
quit
Exit from the drop profile view.
Step 2 Applying the drop profile
1. Configure a traffic classifier.
The AR150/200 can classify traffic according to the ACL, Layer 2 information in packets,
and Layer 3 information in packets. Configure a traffic classifier by selecting appropriate
traffic classification rules. For details, see 2.3 Configuring a Traffic Classifier.
2. Configure a traffic behavior.
Create a traffic behavior and configure flow-based congestion avoidance in the traffic
behavior. For details, see 2.4.8 Configuring Congestion Avoidance.
3. Configure a traffic policy.
Create a traffic policy, associate the traffic classifier and traffic behavior with the traffic
policy, and apply the traffic policy to an interface. For details, see 2.5 Configuring a
Traffic Policy.
----End
1.7.4 Checking the Configuration
After congestion avoidance is configured, you can view WRED parameters in a drop profile.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
33
Prerequisites
All the congestion avoidance configurations are complete.
Procedure
l Checking the queue-based congestion avoidance configuration
Run the display this command in the interface view to check the queue profile bound
to the interface.
Run the display this command in the queue profile view to check the drop profile bound
to the queue profile.
Run the display drop-profile [ drop-profile-name ] command to check the drop profile
configuration.
l Checking the flow-based congestion avoidance configuration
Run the display traffic behavior { system-defined | user-defined } [ behavior-
name ] command to check the traffic behavior configuration.
Run the display traffic classifier { system-defined | user-defined } [ classifier-
name ] command to check the traffic classifier configuration.
Run the display traffic policy user-defined [ policy-name [ classifier classifier-
name ] ] command to check the traffic policy configuration.
Run the display traffic-policy policy-name applied-record command to check the
specified traffic policy record.
----End
1.8 Configuring HQoS
To provide differentiated QoS services, configure HQoS on the AR150/200.
1.8.1 Establishing the Configuration Task
Before configuring Hierarchical QoS (HQoS), familiarize yourself with the applicable
environment, complete the pre-configuration tasks, and obtain the data required for the
configuration. This will help you complete the configuration task quickly and accurately.
Applicable Environment
The traditional QoS technology schedules packets based on interfaces. An interface, however,
can identify only priorities of different services, but cannot identify services of different users.
Packets of the same priority are placed into the same queue on an interface and compete for the
same queue resource. Therefore, the traditional QoS technology is unable to provide
differentiated service based on the type of traffic and the identity of a user.
As the number of users increases continuously and services develop, users require differentiated
services to have better QoS and gain more profits. HQoS implements hierarchical scheduling
based on queues and differentiates services and users. It provides QoS guarantee and saves
network operation and maintenance costs.
The AR150/200 uses traffic policy nesting to implement HQoS. A traffic policy can be nested
into another traffic policy. That is, the traffic behavior or action in a traffic policy is a sub traffic
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
34
policy. Table 1-5 lists the traffic classifiers and traffic behaviors allowed in traffic policies when
traffic policy nesting is used.
Table 1-5 Traffic classifiers and traffic behaviors allowed in traffic policies
Traffic Policy Traffic Classifier Traffic Behavior
Traffic policy All traffic classifiers
supported
(Mandatory) Flow-based
traffic shaping
(Mandatory) Sub traffic
policy binding
(Optional) Traffic statistics
Sub traffic policy All traffic classifiers
supported
The following traffic
behaviors cannot be
configured simultaneously:
l Flow-based traffic
shaping
l Class-based congestion
management and
congestion avoidance
(Mandatory) Class-
based congestion
management
(Optional) Flow-
based congestion
avoidance

NOTE
HQoS can only be configured for outgoing traffic on AR150/200 WAN-side interfaces.
Pre-configuration Tasks
Before configuring HQoS, complete the following tasks:
l Configuring link layer attributes of interfaces to ensure that these interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
l Configuring priority mapping
l Configuring an ACL if necessary
Data Preparation
To configure HQoS, you need the following data.
No. Data
1 Names of the traffic classifier, traffic behavior, and traffic policy, and related
parameters
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
35
No. Data
2 Names of the traffic classifier, traffic behavior, and sub traffic policy, and related
parameters
3 Interface to which the traffic policy is applied
4 (Optional) Interface-based traffic policing and traffic shaping parameters

1.8.2 Configuring a Traffic Policy
A traffic policy can be nested into another traffic policy to differentiate users and services.
1.8.2.1 Configuring a Sub Traffic Policy
A sub traffic policy differentiates user services.
Context
The following actions cannot be configured simultaneously in a traffic behavior of a sub traffic
policy because they are exclusive:
l Flow-based traffic shaping
l Class-based congestion management and congestion avoidance
Procedure
Step 1 Configure a traffic classifier.
The AR150/200 can classify traffic according to the ACL, Layer 2 information in packets, and
Layer 3 information in packets. Configure a traffic classifier by selecting appropriate traffic
classification rules. For details, see 2.3 Configuring a Traffic Classifier.
Step 2 Configure a traffic behavior.
Create a traffic behavior and configure a proper action in the traffic behavior. For details, see
2.4 Configuring a Traffic Behavior.
Step 3 Associate the traffic classifier and the traffic behavior with the traffic policy.
Create a sub traffic policy, and associate the traffic classifier and traffic behavior with the sub
traffic policy. For details, see 2.5 Configuring a Traffic Policy.
----End
1.8.2.2 Configuring a Traffic Policy
A traffic policy differentiates users and shapes user traffic.
Prerequisites
The task of 1.8.2.1 Configuring a Sub Traffic Policy has been complete.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
36
Context
Traffic shaping (gts (traffic behavior view)) must have been configured in the traffic behavior
of the traffic policy before you configure a sub traffic policy. You can configure traffic statistics
in the traffic behavior of the traffic policy.
Procedure
Step 1 Configure a traffic classifier.
Configure a traffic classifier by selecting appropriate traffic classification rules. For details, see
2.3 Configuring a Traffic Classifier.
Step 2 Configure a traffic behavior.
1. Run:
system-view
The system view is displayed.
2. Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
3. Run:
gts cir cir-value [ cbs cbs-value [ queue-length queue-length ] ]
The GTS action is configured.
4. Run:
traffic-policy policy-name
A sub traffic policy is bound to a traffic behavior.
5. (Optional) Run:
statistic enable
The traffic statistics function is enabled.
6. Run:
quit
Exit from the traffic behavior view.
Step 3 Associate the traffic classifier and the traffic behavior with the traffic policy.
Create a traffic policy, and associate the traffic classifier and traffic behavior with the traffic
policy. For details, see 2.5 Configuring a Traffic Policy.
NOTE
Each traffic policy or sub traffic policy supports a maximum of 1024 pairs of traffic classifiers and traffic
behaviors.
Each traffic behavior in the traffic policy can be bound to only one sub traffic policy, whereas different traffic
behaviors can be bound to different sub traffic policies.
If a traffic policy is bound to multiple pairs of traffic classifiers and traffic behaviors, matching rules in the traffic
classifiers must be different. If matching rules are the same, packets of the same type are processed incorrectly
because different actions are taken for these packets.
----End
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
37
1.8.2.3 Applying the Traffic Policy to an Interface
A traffic policy takes effect only after it is applied to an interface.
Context
NOTE
Traffic policy nesting can only be configured for outgoing traffic on AR150/200 WAN-side interfaces.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 3 Run:
traffic-policy policy-name outbound
A traffic policy is applied to the interface or sub-interface in the outbound direction.
----End
1.8.3 (Optional) Configuring Traffic Policing on an Interface
After CAR is configured on an interface in the outbound direction, the AR150/200 limits the
rate of outgoing packets on the interface. Traffic policing does not increase the delay.
Context
The AR150/200 supports traffic policing for flow queues and interface queues.
l The car (traffic behavior view) command configured in a sub traffic policy limits the
traffic rate of flow queues. That is, different rates are set for different services of a user.
l The qos car command configured on an interface only limits the rate of total traffic on the
interface, but does not distinguish users or services.
Procedure
Step 1 Set traffic policing parameters based on site requirements. For details, see 1.4.2 Configuring
Traffic Policing on an Interface.
----End
1.8.4 (Optional) Configuring Traffic Shaping on an Interface
After GTS is configured on an interface, the AR150/200 limits the rate of outgoing data on the
interface. Traffic shaping may increase the delay.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
38
Context
The AR150/200 supports three levels of shapers, that is, flow queue shaper, subscriber queue
shaper, and port queue shaper.
l The gts (traffic behavior view) command configured in a sub traffic policy limits the rate
of traffic of flow queues. That is, different rates are set for different services of a user.
l The gts (traffic behavior view) command configured in a traffic policy limits the rate of
traffic of subscriber queues. That is, different rates are set for different services of different
users.
l The qos gts command configured on an interface only limits the rate of total traffic on the
interface, but does not distinguish users or services.
NOTE
If three levels of traffic shaping are configured on an interface, the CIR value of traffic shaping on the
interface must be greater than or equal to the CIR values of all traffic behaviors in the traffic policy on the
interface and its sub-interfaces, and the CIR value of each traffic policy must be greater than or equal to
the CIR values of all traffic behaviors in the sub traffic policy.
Procedure
Step 1 Set the traffic shaping rate based on site requirements. For details, see 1.5.2 Configuring
Interface-based Traffic Shaping.
----End
1.8.5 Checking the Configuration
After HQoS is configured, you can view queue scheduling modes.
Prerequisites
All the HQoS configurations are complete.
Procedure
l Run the display traffic behavior { system-defined | user-defined } [ behavior-name ]
command to check the traffic behavior configuration.
l Run the display traffic classifier { system-defined | user-defined } [ classifier-name ]
command to check the traffic classifier configuration.
l Run the display traffic policy user-defined [ policy-name [ classifier classifier-name ] ]
command to check the traffic policy configuration.
l Run the display traffic-policy policy-name applied-record command to check the
specified traffic policy record.
l Run the display this command in the interface view to check the configuration of traffic
policing and traffic shaping on the interface.
----End
1.9 Maintaining QoS
This section describes how to maintain QoS.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
39
1.9.1 Displaying the Queue-based Traffic Statistics
The queue-based traffic statistics include the numbers of forwarded and discarded packets.
Context
To check whether packets in each queue on an interface are forwarded or discarded because of
congestion, view the statistics on each queue on the interface.
Procedure
l Run the display qos queue statistics interface interface-type interface-number [ queue
queue-index ] or display qos queue statistics interface { virtual-template vt-number
virtual-access va-number | dialer number } [ queue queue-index ] command to view the
queue-based traffic statistics on the interface.
----End
1.9.2 Clearing the Queue-based Traffic Statistics
You can use the reset command to clear the queue-based traffic statistics.
Context
Before recollecting the queue-based traffic statistics on an interface, run the following command
in the user view to clear the existing statistics.
CAUTION
The cleared queue-based traffic statistics cannot be restored. Exercise caution when you run the
command.
Procedure
l Run the reset qos queue statistics interface interface-type interface-number [ queue
queue-index ] or reset qos queue statistics interface { virtual-template vt-number
virtual-access va-number | dialer number } [ queue queue-index ] command to clear the
queue-based traffic statistics on the interface.
----End
1.10 Configuration Examples
This section provides several configuration examples of traffic policing, traffic shaping,
congestion avoidance, and congestion management.
1.10.1 Example for Configuring Priority Mapping
After the packet priority trusted by an interface is set and the priority mapping table is configured,
the AR150/200 determines the queues that packets enter based on the specified priory and can
modify packet priorities to provide differentiated services.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
40
Networking Requirements
As shown in Figure 1-3, voice, video, and data services on the LAN side of the enterprise are
connected to Eth0/0/0 and Eth0/0/1 of RouterA through SwitchA and SwitchB, and are sent to
the WAN-side network through Eth0/0/8 of RouterA.
RouterA identifies and processes service packets on the LAN side based on 802.1p priorities in
packets. When packets reach the WAN- side network from Eth0/0/8, RouterA needs to provide
differentiated services based on DSCP priorities in the packets. A priority mapping table is
configured so that RouterA can re-marks 802.1p priorities with DSCP priorities.
Figure 1-3 Networking diagram of priority mapping configurations
LAN
Video
802.1p=6
Video
802.1p=5
Data
802.1p=2
Video
802.1p=6
Video
802.1p=5
Data
802.1p=2
RouterA
SwitchB
SwitchA
Eth0/0/0
Eth0/0/1
Eth0/0/8
WAN
RouterB

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and VLANIF interfaces and configure interfaces so that enterprise users
can access the WAN-side network through RouterA.
2. Configure interfaces to trust 802.1p priorities in packets on RouterA.
3. Configure a priority mapping table on RouterA and modify the mappings between 802.1p
priorities and DSCP priorities so that RouterA can re-mark 802.1p priorities with DSCP
priorities.
Data Preparation
To complete the configuration, you need the following data:
l VLAN 20 that the interface of RouterA connected to SwitchA belongs to, IP address
192.168.2.1/24 of VLANIF 20, and 802.1p priority trusted by interfaces
l VLAN 30 that the interface of RouterA connected to SwitchB belongs to, IP address
192.168.3.1/24 of VLANIF 30, and 802.1p priorities trusted by interfaces
l IP address 192.168.4.1/24 of the interface of RouterA connected to the WAN-side interface
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
41
l 802.1p priorities 2, 5, and 6 mapped to DSCP priorities 14, 40, and 46 on RouterA
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 20 and VLAN 30 on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan batch 20 30
# Configure Eth0/0/0 and Eth0/0/1 as trunk interfaces, and add Eth0/0/0 to VLAN 20 and
Eth0/0/1 to VLAN 30.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 20
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernet0/0/1] port link-type trunk
[RouterA-Ethernet0/0/1] port trunk allow-pass vlan 30
[RouterA-Ethernet0/0/1] quit
NOTE
Configure the interface of SwitchA connected to RouterA as a trunk interface and add it to VLAN 20.
Configure the interface of SwitchB connected to RouterA as a trunk interface and add it to VLAN 30.
# Create VLANIF 20 and VLANIF 30, assign IP address 192.168.2.1/24 to VLANIF 20, and
assign IP address 192.168.3.1/24 to VLANIF 30.
[RouterA] interface vlanif 20
[RouterA-Vlanif20] ip address 192.168.2.1 24
[RouterA-Vlanif20] quit
[RouterA] interface vlanif 30
[RouterA-Vlanif30] ip address 192.168.3.1 24
[RouterA-Vlanif30] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
NOTE
Configure RouterB to ensure that there is a reachable route betweenRouterB and RouterA. The
configuration details are not mentioned here.
Step 2 Configure priority mapping.
# Configure Eth0/0/0 and Eth0/0/1 to trust 802.1p priorities in packets.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] trust 8021p
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernet0/0/1] trust 8021p
[RouterA-Ethernet0/0/1] quit
# Configure priority mapping.
[RouterA] qos map-table dot1p-dscp
[RouterA-maptbl-dot1p-dscp] input 2 output 14
[RouterA-maptbl-dot1p-dscp] input 5 output 40
[RouterA-maptbl-dot1p-dscp] input 6 output 46
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
42
Step 3 Verify the configuration.
# View the priority mapping information on RouterA.
<RouterA> display qos map-table dot1p-dscp
Input Dot1p DSCP
-------------------
0 0
1 8
2 14
3 24
4 32
5 40
6 46
7 56
# View the interface configuration on RouterA.
<RouterA> system-view
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] display this
#
interface Ethernet0/0/0
port link-type trunk
port trunk allow-pass vlan 20
trust 8021p
#
return
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernet0/0/1] display this
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30
trust 8021p
#
return
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
vlan batch 20 30
#
qos map-table dot1p-
dscp
input 2 output
14
input 6 output 46
#
interface
Vlanif20
ip address 192.168.2.1
255.255.255.0
#
interface
Vlanif30
ip address 192.168.3.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
43
20
trust 8021p
#
interface Ethernet0/0/1
port link-type
trunk
port trunk allow-pass vlan
30
trust 8021p
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
#
return
1.10.2 Example for Configuring Traffic Policing
Interface-based traffic policing provides different bandwidths for different users, and flow-based
traffic policing provides different bandwidths for different services of a user.
Networking Requirements
As shown in Figure 1-4, voice, video, and data services on the LAN side of the enterprise belong
to VLAN 10, VLAN 20, and VLAN 30. The services are transmitted to Eth0/0/0 on RouterA,
and are transmitted to the WAN-side network through Eth0/0/8 on RouterA.
Flow-based traffic policing needs to be performed for different service packets on RouterA so
that the service traffic is limited within a proper range and bandwidth is ensured. Interface-based
traffic policing needs to be performed for all incoming traffic on Eth0/0/0 so that the total traffic
of a single enterprise user is limited within a proper range.
Figure 1-4 Networking diagram for configuring traffic policing
WAN
RouterA Switch
VLAN 10
Data
VLAN 30
VLAN 20
Voice
Video
Eth0/0/0
LAN
Eth0/0/8
RouterB

Configuration Roadmap
The configuration roadmap is as follows:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
44
1. Create VLANs and VLANIF interfaces and configure interfaces so that enterprise users
can access the WAN-side network through RouterA.
2. Configure traffic classifiers on RouterA to classify packets based on the VLAN ID.
3. Configure traffic behaviors on RouterA to perform traffic policing for different service
packets from the enterprise.
4. Configure a traffic policy on RouterA, bind the traffic policy to traffic behaviors and traffic
classifiers, and apply the traffic policy to the inbound direction of the interface on
RouterA connected to Switch.
5. Configure interface-based traffic policing to the inbound direction of the interface on
RouterA connected to Switch to limit the rate of all the packets.
Data Preparation
To complete the configuration, you need the following data:
l VLANs allowed by the interface of RouterA connected to the Switch: VLAN 10, VLAN
20, VLAN 30
l IP addresses of VLANIF 10, VLANIF 20, and VLANIF 30: 192.168.1.1/24,
192.168.2.1/24, and 192.168.3.1/24
l IP address 192.168.4.1/24 of the interface of RouterA connected to the WAN-side interface
l Names of traffic classifiers matching service flows
l Traffic policing parameters of different service flows:
Voice service: CIR value 256 kbit/s, CBS value 48128 bytes, and PBS value 80128
bytes
Video service: CIR value 4000 kbit/s, CBS value 752000 bytes, and PBS value 1252000
bytes
Data service: CIR value 2000 kbit/s, CBS value 376000 bytes, and PBS value 626000
bytes
l CIR value of enterprise users: 10000 kbit/s
l Type and number of the interface and the direction to which a traffic policy is applied:
inbound direction of Eth0/0/0 on RouterA
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10, VLAN 20, and VLAN 30 on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan batch 10 20 30
# Configure Eth0/0/0 as a trunk interface and allow packets from VLAN 10, VLAN 20, and
VLAN 30 to pass through.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 10 20 30
[RouterA-Ethernet0/0/0] quit
NOTE
# Configure the interface of Switch connected to RouterA as a trunk interface and allow packets from
VLAN 10, VLAN 20, and VLAN 30 to pass through.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
45
# Create VLANIF 10, VLANIF 20, and VLANIF 30, and assign IP addresses 192.168.1.1/24,
192.168.2.1/24, and 192.168.3.1/24 to VLANIF 10, VLANIF 20, and VLANIF 30.
[RouterA] interface vlanif 10
[RouterA-Vlanif10] ip address 192.168.1.1 24
[RouterA-Vlanif10] quit
[RouterA] interface vlanif 20
[RouterA-Vlanif20] ip address 192.168.2.1 24
[RouterA-Vlanif20] quit
[RouterA] interface vlanif 30
[RouterA-Vlanif30] ip address 192.168.3.1 24
[RouterA-Vlanif30] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
NOTE
Configure RouterB to ensure that there is a reachable route betweenRouterB and RouterA. The
configuration details are not mentioned here.
Step 2 Configure traffic classifiers.
# Configure traffic classifiers c1, c2, and c3 on RouterA to classify different service flows from
the enterprise based on the VLAN ID.
[RouterA] traffic classifier c1
[RouterA-classifier-c1] if-match vlan-id 10
[RouterA-classifier-c1] quit
[RouterA] traffic classifier c2
[RouterA-classifier-c2] if-match vlan-id 20
[RouterA-classifier-c2] quit
[RouterA] traffic classifier c3
[RouterA-classifier-c3] if-match vlan-id 30
[RouterA-classifier-c3] quit
Step 3 Configure traffic behaviors.
# Create traffic behaviors b1, b2, and b3 on RouterA to perform traffic policing for different
service flows from the enterprise, and enable traffic statistics.
[RouterA] traffic behavior b1
[RouterA-behavior-b1] car cir 256 cbs 48128 pbs 80128
[RouterA-behavior-b1] statistic enable
[RouterA-behavior-b1] quit
[RouterA] traffic behavior b2
[RouterA-behavior-b2] car cir 4000 cbs 752000 pbs 1252000
[RouterA-behavior-b2] statistic enable
[RouterA-behavior-b2] quit
[RouterA] traffic behavior b3
[RouterA-behavior-b3] car cir 2000 cbs 376000 pbs 626000
[RouterA-behavior-b3] statistic enable
[RouterA-behavior-b3] quit
Step 4 Configure a traffic policy and apply the traffic policy to an interface.
# Create a traffic policy p1 on RouterA, bind the traffic policy to the traffic classifiers and the
traffic behaviors, and apply the traffic policy to the inbound direction of Eth0/0/0.
[RouterA] traffic policy p1
[RouterA-trafficpolicy-p1] classifier c1 behavior b1
[RouterA-trafficpolicy-p1] classifier c2 behavior b2
[RouterA-trafficpolicy-p1] classifier c3 behavior b3
[RouterA-trafficpolicy-p1] quit
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
46
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] traffic-policy p1 inbound
Step 5 Configure interface-based traffic policing.
# Configure interface-based traffic policing in the inbound direction of Eth0/0/0 on RouterA in
the inbound direction to limit traffic of a single enterprise user within the proper range.
[RouterA-Ethernet0/0/0] qos car inbound cir 10000
[RouterA-Ethernet0/0/0] quit
Step 6 Verify the configuration.
# View the traffic classifier configuration.
[RouterA] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c2
Operator: OR
Rule(s) : if-match vlan-id 20

Classifier: c3
Operator: OR
Rule(s) : if-match vlan-id 30

Classifier: c1
Operator: OR
Rule(s) : if-match vlan-id 10

# View the traffic policy configuration.
[RouterA] display traffic policy user-defined
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: OR
Behavior: b1
Committed Access Rate:
CIR 256 (Kbps), PIR 0 (Kbps), CBS 48128 (byte), PBS 80128 (byte)
Color Mode: color Blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
statistic: enable

Classifier: c2
Operator: OR
Behavior: b2
Committed Access Rate:
CIR 4000 (Kbps), PIR 0 (Kbps), CBS 752000 (byte), PBS 1252000 (byte)
Color Mode: color Blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
statistic: enable

Classifier: c3
Operator: OR
Behavior: b3
Committed Access Rate:
CIR 2000 (Kbps), PIR 0 (Kbps), CBS 376000 (byte), PBS 626000 (byte)
Color Mode: color Blind
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
statistic: enable

# View the traffic policy configuration.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
47
[RouterA] display traffic policy statistics interface ethernet 0/0/0 inbound

Interface: Ethernet0/0/0
Traffic policy inbound: p1
Rule number: 3
Current status: OK!
Item Sum(Packets/Bytes) Rate(pps/bps)
-------------------------------------------------------------------------------
Matched 0/ 0/
0 0
+--Passed 0/ 0/
0 0
+--Dropped 0/ 0/
0 0
+--Filter 0/ 0/
0 0
+--CAR 0/ 0/
0 0
+--Queue Matched 0/ 0/
0 0
+--Enqueued 0/ 0/
0 0
+--Discarded 0/ 0/
0 0
+--Car 0/ 0/
0 0
+--Green packets 0/ 0/
0 0
+--Yellow packets 0/ 0/
0 0
+--Red packets 0/ 0/
0 0
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
vlan batch 10 20
30
#
traffic classifier c1 operator
or
if-match vlan-id
10
traffic classifier c2 operator
or
if-match vlan-id
20
traffic classifier c3 operator
or
if-match vlan-id
30
#
traffic behavior
b1
car cir 256 cbs 48128 pbs 80128 green pass yellow pass red
discard
statistic
enable
traffic behavior
b2
car cir 4000 cbs 752000 pbs 1252000 green pass yellow pass red
discard
statistic
enable
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
48
traffic behavior
b3
car cir 2000 cbs 376000 pbs 626000 green pass yellow pass red
discard
statistic
enable
#
traffic policy
p1
classifier c1 behavior
b1
classifier c2 behavior
b2
classifier c3 behavior
b3
#
interface
Vlanif10
ip address 192.168.1.1
255.255.255.0
#
interface
Vlanif20
ip address 192.168.2.1 255.255.255.0
#
interface
Vlanif30
ip address 192.168.3.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan 10 20
30
qos car inbound cir
10000
traffic-policy p1
inbound
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
#
return
1.10.3 Example for Configuring Traffic Shaping
Interface-based traffic shaping shapes all the service traffic of a user so that the traffic is sent at
an even rate, and queue-based traffic shaping sets different GTS parameters for different user
services.
Networking Requirements
As shown in Figure 1-5, voice, video, and data services on the LAN side of the enterprise are
connected to Eth0/0/0 of RouterA through Switch, and are sent to the WAN-side network through
Eth0/0/8 of RouterA.
Different service packets are identified based on 802.1p priorities on the LAN side. RouterA
sends the packets to queues based on 802.1p priorities. When packets reach the WAN-side
network through Eth0/0/8, jitter may occur. To prevent jitter and ensure bandwidth of services,
perform the following operations:
l Set the CIR value of the interface to 8000 kbit/s.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
49
l Set the CIR value of voice services to 256 kbit/s and the CBS value to 6400 bytes.
l Set the CIR value of video services to 4000 kbit/s and the CBS value to 100000 bytes.
l Set the CIR value of data services to 2000 kbit/s and the CBS value to 50000 bytes.
Figure 1-5 Networking diagram of traffic shaping configurations
Switch
802.1p=6
Data
802.1p=5
802.1p=2
Voice
Video
LAN
WAN
RouterA
Eth0/0/0
Eth0/0/8
RouterB

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and VLANIF interfaces on RouterA and configure interfaces so that
enterprise users can access the WAN-side network through RouterA.
2. Configure interfaces to trust 802.1p priorities in packets on RouterA.
3. Configure interface-based traffic shaping on RouterA to limit the interface bandwidth.
4. Configure queue-based traffic shaping on RouterA to limit the bandwidth of voice, video,
and data services.
Data Preparation
To complete the configuration, you need the following data:
l VLAN 10 that the interface of RouterA connected to Switch belongs to, IP address
192.168.1.1/24 of VLANIF 10, and 802.1p priorities trusted by interfaces
l IP address 192.168.4.1/24 of the interface of RouterA connected to the WAN-side interface
l Interface-based traffic shaping rate
l Queue-based traffic shaping rate
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10 on RouterA.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
50
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan 10
# Configure Eth0/0/0 as a trunk interface and add Eth0/0/0 to VLAN 10.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 10
[RouterA-Ethernet0/0/0] quit
NOTE
Configure the interface of the Switch connected to RouterA as a trunk interface and add it to VLAN 10.
# Create VLANIF 10 and assign IP address 192.168.1.1/24 to VLANIF 10.
[RouterA] interface vlanif 10
[RouterA-Vlanif10] ip address 192.168.1.1 24
[RouterA-Vlanif10] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
NOTE
Configure RouterB to ensure that there is a reachable route betweenRouterB and RouterA. The
configuration details are not mentioned here.
Step 2 Configure the packet priority trusted by an interface.
# Configure Eth0/0/0 to trust 802.1p priorities of packets.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] trust 8021p
[RouterA-Ethernet0/0/0] quit
Step 3 Configure interface-based traffic shaping.
# Configure interface-based traffic shaping on RouterA and set the CIR value to 8000 kbit/s.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] qos gts cir 8000
[RouterA-Ethernet0/0/8] quit
Step 4 Configure queue-based traffic shaping.
# Create a queue profile qp1 on RouterA, set the scheduling mode to WFQ for queues 0 to 5
and to PQ for queue 6 and queue 7, set CIR values of queue 6, queue 5, and queue 2 to 256 kbit/
s, 4000 kbit/s, and 2000 kbit/s, and set CBS values of queue 6, queue 5, and queue 2 to 6400
bytes, 100000 bytes, and 50000 bytes.
[RouterA] qos queue-profile qp1
[RouterA-qos-queue-profile-qp1] schedule pq 6 to 7 wfq 0 to 5
[RouterA-qos-queue-profile-qp1] queue 6 gts cir 256 cbs 6400
[RouterA-qos-queue-profile-qp1] queue 5 gts cir 4000 cbs 100000
[RouterA-qos-queue-profile-qp1] queue 2 gts cir 2000 cbs 50000
[RouterA-qos-queue-profile-qp1] quit
# Apply the queue profile qp1 to Eth0/0/8 on RouterA.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] qos queue-profile qp1
Step 5 Verify the configuration.
# View the interface configuration on RouterA.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
51
[RouterA-Ethernet0/0/8] display this
#
interface Ethernet0/0/8
ip address 192.168.4.1 255.255.255.0
qos queue-profile qp1
qos gts cir 8000 cbs 200000
#
return
# View the drop profile configuration.
[RouterA-Ethernet0/0/8] quit
[RouterA] display qos queue-profile qp1
Queue-profile: qp1
Queue Schedule Weight Length(Bytes/Packets) GTS(CIR/CBS)
-----------------------------------------------------------------
0 WFQ 10 -/- -/-
1 WFQ 10 -/- -/-
2 WFQ 10 -/- 2000/50000
3 WFQ 10 -/- -/-
4 WFQ 10 -/- -/-
5 WFQ 10 -/- 4000/100000
6 PQ - -/- 256/6400
7 PQ - -/- -/-
----End
Configuration Files
l Configuration file of RouterA
sysname RouterA
#
vlan 10
#
qos queue-profile
qp1
queue 2 gts cir 2000 cbs
50000
queue 5 gts cir 4000 cbs
100000
queue 6 gts cir 256 cbs
6400
schedule wfq 0 to 5 pq 6 to
7
#
interface
Vlanif10
ip address 192.168.1.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
10
trust
8021p
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
qos queue-profile
qp1
qos gts cir 8000 cbs
200000
#
return
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
52
1.10.4 Example for Configuring Congestion Avoidance and
Congestion Management
By configuring congestion avoidance and congestion management, the AR150/200 provides
different services for packets of different priorities and ensures high-priority and low-delay
services.
Networking Requirements
As shown in Figure 1-6, voice, video, and data services on the LAN side of the enterprise are
connected to Eth0/0/0 and Eth0/0/1 of RouterA through SwitchA and SwitchB, and are sent to
the WAN-side network through Eth0/0/8 of RouterA.
Packets are marked with different DSCP priorities by SwitchA and SwitchB, and the priorities
of voice, video, and data services are ef, cs5, and af32 and af31. RouterA sends packets to queues
based on DSCP priorities. The rates of Eth0/0/0 and Eth0/0/1 on RouterA are greater than those
of Eth0/0/8, congestion may occur on Eth0/0/8 in the outbound direction. To reduce the impact
of network congestion and ensure bandwidth for high-priority and low-delay services, set the
related parameters according to the following table.
Table 1-6 Congestion avoidance parameters
Service
Type
DSCP
Priority
Queue
Index
Scheduli
ng Mode
Drop Method
Voice 46 5 PQ Tail drop
Video 38 4 WFQ WRED:
l Lower drop threshold (%): 60
l Upper drop threshold (%): 80
l Drop probability (%): 20
Data 28
26
3 WFQ WRED:
l DSCP=28
Lower drop threshold (%): 50
Upper drop threshold (%): 70
Drop probability (%): 30
l DSCP=26
Lower drop threshold (%): 40
Upper drop threshold (%): 60
Drop probability (%): 40

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
53
Figure 1-6 Networking diagram of congestion avoidance and congestion management
configurations
LAN
Voice
DSCP=46
Video
DSCP=38
Data
DSCP=26
DSCP=28
RouterA
SwitchB
SwitchA
Eth0/0/0
Eth0/0/1
Video
DSCP=40
Data
DSCP=26
DSCP=28
Voice
DSCP=46
Eth0/0/8
WAN
RouterB

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and VLANIF interfaces on RouterA and configure interfaces so that
enterprise users can access the WAN-side network through RouterA.
2. Configure interfaces to trust DSCP priorities in packets on RouterA.
3. Create drop profiles and set WRED parameters based on the DSCP priority.
4. Create a queue profile and set the scheduling mode and drop mode for each queue.
5. Apply the queue profile to the outbound direction of the interface on RouterA connected
to the WAN-side network to implement congestion avoidance and congestion management.
Data Preparation
To complete the configuration, you need the following data:
l VLAN 20 that the interface of RouterA connected to SwitchA belongs to, IP address
192.168.2.1/24 of VLANIF 20, and DSCP priority trusted by interfaces
l VLAN 30 that the interface of RouterA connected to SwitchB belongs to, IP address
192.168.3.1/24 of VLANIF 30, and DSCP priorities trusted by interfaces
l IP address 192.168.4.1/24 of the interface of RouterA connected to the WAN-side interface
l Names of the drop profiles and WRED parameters
l Name of the queue profile and scheduling mode
l Number of the interface to which the queue profile is applied
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
54
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 20 and VLAN 30 on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan batch 20 30
# Configure Eth0/0/0 and Eth0/0/1 to trust DSCP priorities, configure them as trunk interfaces,
and add Eth0/0/0 to VLAN 20 and Eth0/0/1 to VLAN 30.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] trust dscp
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 20
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernet0/0/1] trust dscp
[RouterA-Ethernet0/0/1] port link-type trunk
[RouterA-Ethernet0/0/1] port trunk allow-pass vlan 30
[RouterA-Ethernet0/0/1] quit
NOTE
Configure the interface of SwitchA connected to RouterA as a trunk interface and add it to VLAN 20.
Configure the interface of SwitchB connected to RouterA as a trunk interface and add it to VLAN 30.
# Create VLANIF 20 and VLANIF 30, assign IP address 192.168.2.1/24 to VLANIF 20, and
assign IP address 192.168.3.1/24 to VLANIF 30.
[RouterA] interface vlanif 20
[RouterA-Vlanif20] ip address 192.168.2.1 24
[RouterA-Vlanif20] quit
[RouterA] interface vlanif 30
[RouterA-Vlanif30] ip address 192.168.3.1 24
[RouterA-Vlanif30] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
NOTE
Configure RouterB to ensure that there is a reachable route betweenRouterB and RouterA. The
configuration details are not mentioned here.
Step 2 Create drop profiles.
# Create drop profiles data and video on RouterA.
[RouterA] drop-profile data
[RouterA-drop-profile-data] wred dscp
Info: Weight type has changed to DSCP.
[RouterA-drop-profile-data] dscp 28 low-limit 50 high-limit 70 discard-percentage
30
[RouterA-drop-profile-data] dscp 26 low-limit 40 high-limit 60 discard-percentage
40
[RouterA-drop-profile-data] quit
[RouterA] drop-profile video
[RouterA-drop-profile-video] wred dscp
Info: Weight type has changed to DSCP.
[RouterA-drop-profile-video] dscp 38 low-limit 60 high-limit 80 discard-percentage
20
[RouterA-drop-profile-video] quit
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
55
Step 3 Create a queue profile.
# Create a queue profile queue-profile1 on RouterA and set the scheduling mode and drop mode
for each queue.
[RouterA] qos queue-profile queue-profile1
[RouterA-qos-queue-profile-queue-profile1] schedule pq 5 wfq 4 to 3
[RouterA-qos-queue-profile-queue-profile1] queue 4 drop-profile video
[RouterA-qos-queue-profile-queue-profile1] queue 3 drop-profile data
[RouterA-qos-queue-profile-queue-profile1] quit
Step 4 Apply the queue profile.
# Apply the queue profile to Eth0/0/8 of RouterA.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] qos queue-profile queue-profile1
Step 5 Verify the configuration.
# View the interface configuration on RouterA.
[RouterA-Ethernet0/0/8] display this
#
interface Ethernet0/0/8
ip address 192.168.4.1 255.255.255.0
qos queue-profile queue-profile1
#
return
# View the drop profile configuration.
[RouterA-Ethernet0/0/8] quit
[RouterA] display qos queue-profile queue-profile1
Queue-profile: queue-profile1
Queue Schedule Weight Length(Bytes/Packets) GTS(CIR/CBS)
-----------------------------------------------------------------
3 WFQ 10 -/- -/-
4 WFQ 10 -/- -/-
5 PQ - -/- -/-
# View the drop profile bound to the queue profile.
[RouterA] qos queue-profile queue-profile1
[RouterA-qos-queue-profile-queue-profile1] display this
#
qos queue-profile queue-profile1
queue 3 drop-profile data
queue 4 drop-profile video
schedule wfq 3 to 4 pq 5
#
return
# View the configuration of drop profiles.
[RouterA-qos-queue-profile-queue-profile1] quit
[RouterA] display drop-profile video
Drop-profile[2]: video
DSCP Low-limit High-limit Discard-percentage
-----------------------------------------------------------------
0(default) 30 100 10
1 30 100 10
2 30 100 10
3 30 100 10
4 30 100 10
5 30 100 10
6 30 100 10
7 30 100 10
8(cs1) 30 100 10
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
56
9 30 100 10
10(af11) 30 100 10
11 30 100 10
12(af12) 30 100 10
13 30 100 10
14(af13) 30 100 10
15 30 100 10
16(cs2) 30 100 10
17 30 100 10
18(af21) 30 100 10
19 30 100 10
20(af22) 30 100 10
21 30 100 10
22(af23) 30 100 10
23 30 100 10
24(cs3) 30 100 10
25 30 100 10
26(af31) 30 100 10
27 30 100 10
28(af32) 30 100 10
29 30 100 10
30(af33) 30 100 10
31 30 100 10
32(cs4) 30 100 10
33 30 100 10
34(af41) 30 100 10
35 30 100 10
36(af42) 30 100 10
37 30 100 10
38(af43) 60 80 20
39 30 100 10
40(cs5) 30 100 10
41 30 100 10
42 30 100 10
43 30 100 10
44 30 100 10
45 30 100 10
46(ef) 30 100 10
47 30 100 10
48(cs6) 30 100 10
49 30 100 10
50 30 100 10
51 30 100 10
52 30 100 10
53 30 100 10
54 30 100 10
55 30 100 10
56(cs7) 30 100 10
57 30 100 10
58 30 100 10
59 30 100 10
60 30 100 10
61 30 100 10
62 30 100 10
63 30 100 10
-----------------------------------------------------------------
[RouterA] display drop-profile data
Drop-profile[1]: data
DSCP Low-limit High-limit Discard-percentage
-----------------------------------------------------------------
0(default) 30 100 10
1 30 100 10
2 30 100 10
3 30 100 10
4 30 100 10
5 30 100 10
6 30 100 10
7 30 100 10
8(cs1) 30 100 10
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
57
9 30 100 10
10(af11) 30 100 10
11 30 100 10
12(af12) 30 100 10
13 30 100 10
14(af13) 30 100 10
15 30 100 10
16(cs2) 30 100 10
17 30 100 10
18(af21) 30 100 10
19 30 100 10
20(af22) 30 100 10
21 30 100 10
22(af23) 30 100 10
23 30 100 10
24(cs3) 30 100 10
25 30 100 10
26(af31) 40 60 40
27 30 100 10
28(af32) 50 70 30
29 30 100 10
30(af33) 30 100 10
31 30 100 10
32(cs4) 30 100 10
33 30 100 10
34(af41) 30 100 10
35 30 100 10
36(af42) 30 100 10
37 30 100 10
38(af43) 60 80 20
39 30 100 10
40(cs5) 30 100 10
41 30 100 10
42 30 100 10
43 30 100 10
44 30 100 10
45 30 100 10
46(ef) 30 100 10
47 30 100 10
48(cs6) 30 100 10
49 30 100 10
50 30 100 10
51 30 100 10
52 30 100 10
53 30 100 10
54 30 100 10
55 30 100 10
56(cs7) 30 100 10
57 30 100 10
58 30 100 10
59 30 100 10
60 30 100 10
61 30 100 10
62 30 100 10
63 30 100 10
-----------------------------------------------------------------
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
vlan batch 20 30
#
drop-profile
data
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
58
wred dscp
dscp af31 low-limit 40 high-limit 60 discard-percentage
40
dscp af32 low-limit 50 high-limit 70 discard-percentage
30
#
drop-profile
video
wred dscp
dscp af43 low-limit 60 high-limit 80 discard-percentage
20
#
qos queue-profile queue-
profile1
queue 3 drop-profile
data
queue 4 drop-profile
video
schedule wfq 3 to 4 pq
5
#
interface
Vlanif20
ip address 192.168.2.1
255.255.255.0
#
interface
Vlanif30
ip address 192.168.3.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
20
trust dscp
#
interface Ethernet0/0/1
port link-type
trunk
port trunk allow-pass vlan
30
trust dscp
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
qos queue-profile queue-profile1
#
return
1.10.5 Example for Configuring HQoS
By configuring HQoS, the AR150/200 provides differentiated services for service packets with
different priorities and users with different priorities, and ensures bandwidth for high-priority
and low-delay services.
Networking Requirements
As shown in Figure 1-7, two departments in VPNA and VPNB are connected to the Router
through Switch and are connected to the headquarters through two sub-interfaces of Eth0/0/8.
Each department has voice, video, and data service flows.
Packets are marked with different DSCP priorities by Switch, and the priorities of voice, video,
and data services are ef, af21, and af11. Each department needs to set the individual CIR value
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
59
and share the maximum bandwidth of the interface. Voice packets need to be processed first,
and bandwidth of video and data packets needs to be ensured.
Figure 1-7 Networking diagram of HQoS configurations
LAN
Voice
Video
Data
Voice
Video
Data
Router
LSWA
Switch
Eth0/0/0
Eth0/0/8.1
WAN
VPNA
VLAN 10
VPNB
VLAN 20
Eth0/0/8.2
LSWB
Eth0/0/1

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and VLANIF interfaces and configure interfaces so that enterprise users
can access the WAN-side network through the Router.
2. Configure interfaces to trust DSCP priorities in packets on the Router.
3. Configure sub traffic policies for VPNA and VPNB on the Router, configure traffic
classifiers based on DSCP priorities to send voice packets to EF queues and video and data
packets to AF queues, and bind drop profiles.
4. Configure a traffic policy on the Router, configure traffic classifiers based on VLAN IDs
to shape packets from different VLANs, and bind the traffic policy to the sub traffic policies.
5. Apply the traffic policy to the interface of the Router connected to the WAN-side network
to provide differentiated QoS services.
Data Preparation
To complete the configuration, you need the following data:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
60
l VLAN 10 that Eth0/0/0 of the Router connected to Switch, IP address 192.168.1.1/24 of
VLANIF 10, and DSCP priorities trusted by interfaces
l VLAN 20 that Eth0/0/1 of the Router connected to Switch, IP address 192.168.1.1/24 of
VLNAIF 20, and DSCP priorities trusted by interfaces
l IP address 192.168.3.1/24 of Eth0/0/8 on the Router connected to the WAN-side interface,
control VLAN 10 of Eth0/0/8.1, its encapsulation mode dot1q, and its IP address
192.168.4.1/24; and control VLAN 20 of Eth0/0/8.2, its encapsulation mode dot1q, and its
IP address 192.168.5.1/24
l Names of the drop profiles and WRED parameters
Drop Profile
Name
DSCP Lower Drop
Threshold
Upper Drop
Threshold
Maximum
Drop
Probability
video 18 80% 95% 60%
data 10 70% 85% 60%

l Names of traffic classifiers, traffic behaviors, and traffic policies
l Queue types, and bandwidth allocation modes and drop methods:
Voice service: EF queue, maximum bandwidth at 5% bandwidth of the interface, and
tail drop
Video service: AF queue, assured bandwidth at 60% bandwidth of the interface, drop
profile
Data service: AF queue, assured bandwidth at 30% bandwidth of the interface, drop
profile
l Assured bandwidth of departments:
VPNA: 30 Mbit/s
VPNB:20 Mbit/s
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10 and VLAN 20 on the Router.
<Huawei> system-view
[Huawei] sysname Router
[Router] vlan batch 10 20
# Configure Eth0/0/0 as a trunk interface and add Eth0/0/0 to VLAN 10.
[Router] interface ethernet 0/0/0
[Router-Ethernet0/0/0] port link-type trunk
[Router-Ethernet0/0/0] port trunk allow-pass vlan 10
[Router-Ethernet0/0/0] quit
# Configure Eth0/0/1 as a trunk interface and add Eth0/0/1 to VLAN 20.
[Router] interface ethernet 0/0/1
[Router-Ethernet0/0/1] port link-type trunk
[Router-Ethernet0/0/1] port trunk allow-pass vlan 20
[Router-Ethernet0/0/1] quit
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
61
NOTE
Configure the interface of Switch connected to the Router as a trunk interface and add it to VLAN 10 and
VLAN 20.
# Create VLANIF 10 and VLANIF 20, and assign IP addresses 192.168.1.1/24 and
192.168.2.1/24 to VLANIF 10 and VLANIF 20.
[Router] interface vlanif 10
[Router-Vlanif10] ip address 192.168.1.1 24
[Router-Vlanif10] quit
[Router] interface vlanif 20
[Router-Vlanif20] ip address 192.168.2.1 24
[Router-Vlanif20] quit
# Assign IP address 192.168.3.1/24 to Eth0/0/8.
[Router] interface ethernet 0/0/8
[Router-Ethernet0/0/8] ip address 192.168.3.1 24
[Router-Ethernet0/0/8] quit
# Configure the control VLAN of Eth0/0/8.1 as VLAN 10, set the encapsulation mode to dot1q,
and assign 192.168.4.1/24 to it. Configure the control VLAN of Eth0/0/8.2 as VLAN 20, set the
encapsulation mode to dot1q, and assign 192.168.5.1/24 to it.
[Router] interface ethernet 0/0/8.1
[Router-Ethernet0/0/8.1] ip address 192.168.4.1 24
[Router-Ethernet0/0/8.1] control-vid 1 dot1q-termination
[Router-Ethernet0/0/8.1] dot1q termination vid 10
[Router-Ethernet0/0/8.1] quit
[Router] interface Ethernet0/0/8.2
[Router-Ethernet0/0/8.2] ip address 192.168.5.1 24
[Router-Ethernet0/0/8.2] control-vid 2 dot1q-termination
[Router-Ethernet0/0/8.2] dot1q termination vid 20
[Router-Ethernet0/0/8.2] quit
Step 2 Configure the packet priority trusted by an interface.
# Configure Eth0/0/0 and Eth0/0/1 to trust DSCP priorities in packets.
[Router] interface ethernet 0/0/0
[Router-Ethernet0/0/0] trust dscp
[Router-Ethernet0/0/0] quit
[Router] interface ethernet 0/0/1
[Router-Ethernet0/0/1] trust dscp
[Router-Ethernet0/0/1] quit
Step 3 Configure traffic policies for VPNA and VPNB.
# Create traffic classifiers data, video, and voice on the Router to classify different service flows
from the enterprise based on DSCP priorities.
[Router] traffic classifier data
[Router-classifier-data] if-match dscp af11
[Router-classifier-data] quit
[Router] traffic classifier video
[Router-classifier-video] if-match dscp af21
[Router-classifier-video] quit
[Router] traffic classifier voice
[Router-classifier-voice] if-match dscp ef
[Router-classifier-voice] quit
# Create drop profiles data and video on the Router.
[Router] drop-profile data
[Router-drop-profile-data] wred dscp
[Router-drop-profile-data] dscp 10 low-limit 70 high-limit 85 discard-percentage
60
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
62
[Router-drop-profile-data] quit
[Router] drop-profile video
[Router-drop-profile-video] wred dscp
[Router-drop-profile-video] dscp 18 low-limit 80 high-limit 95 discard-percentage
60
[Router-drop-profile-video] quit
# Create traffic behaviors data, video, and voice on the Router to configure congestion
management and congestion avoidance for different service flows of the enterprise.
[Router] traffic behavior data
[Router-behavior-data] queue af bandwidth pct 30
[Router-behavior-data] drop-profile data
[Router-behavior-data] quit
[Router] traffic behavior video
[Router-behavior-video] queue af bandwidth pct 60
[Router-behavior-video] drop-profile video
[Router-behavior-video] quit
[Router] traffic behavior voice
[Router-behavior-voice] queue ef bandwidth pct 5
[Router-behavior-voice] quit
# Define sub traffic policies for VPNA and VPNB on the Router.
[Router] traffic policy vpna-sub
[Router-trafficpolicy-vpna-sub] classifier voice behavior voice
[Router-trafficpolicy-vpna-sub] classifier video behavior video
[Router-trafficpolicy-vpna-sub] classifier data behavior data
[Router-trafficpolicy-vpna-sub] quit
[Router] traffic policy vpnb-sub
[Router-trafficpolicy-vpnb-sub] classifier voice behavior voice
[Router-trafficpolicy-vpnb-sub] classifier video behavior video
[Router-trafficpolicy-vpnb-sub] classifier data behavior data
[Router-trafficpolicy-vpnb-sub] quit
Step 4 Configure a traffic policy.
# Configure traffic classifiers vpna and vpnb on the Router to classify different service flows
from the enterprise based on the VLAN ID.
[Router] traffic classifier vpna
[Router-classifier-vpna] if-match vlan-id 10
[Router-classifier-vpna] quit
[Router] traffic classifier vpnb
[Router-classifier-vpnb] if-match vlan-id 20
[Router-classifier-vpnb] quit
# Create traffic behaviors vpna and vpnb on the Router to shape packets from different VLANs
and bind them to sub traffic policies.
[Router] traffic behavior vpna
[Router-behavior-vpna] gts cir 20000 cbs 500000 queue-length 50
[Router-behavior-vpna] traffic-policy vpna-sub
[Router-behavior-vpna] quit
[Router] traffic behavior vpnb
[Router-behavior-vpnb] gts cir 30000 cbs 750000 queue-length 50
[Router-behavior-vpnb] traffic-policy vpnb-sub
[Router-behavior-vpnb] quit
Configure a traffic policy on the Router.
[Router] traffic policy enterprise
[Router-trafficpolicy-enterprise] classifier vpna behavior vpna
[Router-trafficpolicy-enterprise] classifier vpnb behavior vpnb
[Router-trafficpolicy-enterprise] quit
Step 5 Apply the traffic policy.
# Apply the traffic policy on Eth0/0/8 of the Router in the outbound direction.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
63
[Router] interface ethernet 0/0/8
[Router-Ethernet0/0/8] traffic-policy enterprise outbound
Step 6 Verify the configuration.
# View the interface configuration on the Router.
[Router-Ethernet0/0/8] display this
#
interface Ethernet0/0/8
ip address 192.168.3.1 255.255.255.0
traffic-policy enterprise outbound
#
return
# View the traffic policy configuration.
[Router-Ethernet0/0/8] quit
[Router] display traffic policy user-defined
User Defined Traffic Policy Information:
Policy: enterprise
Classifier: vpna
Operator: OR
Behavior: vpna
General Traffic Shape:
CIR 20000 (Kbps), CBS 500000 (byte)
Queue length 50 (Packets)
Traffic-policy:
Traffic-policy vpna-sub

Classifier: vpnb
Operator: OR
Behavior: vpnb
General Traffic Shape:
CIR 30000 (Kbps), CBS 750000 (byte)
Queue length 50 (Packets)
Traffic-policy:
Traffic-policy vpnb-sub

Policy: vpna-sub
Classifier: voice
Operator: OR
Behavior: voice
Expedited Forwarding:
Bandwidth 5 (%)
Queue Length: 64 (Packets) 131072 (Bytes)

Classifier: video
Operator: OR
Behavior: video
Assured Forwarding:
Bandwidth 60 (%)
Drop Method: WRED
Drop-profile: video

Classifier: data
Operator: OR
Behavior: data
Assured Forwarding:
Bandwidth 30 (%)
Drop Method: WRED
Drop-profile: data

Policy: vpnb-sub
Classifier: voice
Operator: OR
Behavior: voice
Expedited Forwarding:
Bandwidth 5 (%)
Queue Length: 64 (Packets) 131072 (Bytes)
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
64
Classifier: video
Operator: OR
Behavior: video
Assured Forwarding:
Bandwidth 60 (%)
Drop Method: WRED
Drop-profile: video

Classifier: data
Operator: OR
Behavior: data
Assured Forwarding:
Bandwidth 30 (%)
Drop Method: WRED
Drop-profile: data

# View the configuration of drop profiles.
[Router] display drop-profile video
Drop-profile[1]: video
DSCP Low-limit High-limit Discard-percentage
-----------------------------------------------------------------
0(default) 30 100 10
1 30 100 10
2 30 100 10
3 30 100 10
4 30 100 10
5 30 100 10
6 30 100 10
7 30 100 10
8(cs1) 30 100 10
9 30 100 10
10(af11) 30 100 10
11 30 100 10
12(af12) 30 100 10
13 30 100 10
14(af13) 30 100 10
15 30 100 10
16(cs2) 30 100 10
17 30 100 10
18(af21) 80 95 60
19 30 100 10
20(af22) 30 100 10
21 30 100 10
22(af23) 30 100 10
23 30 100 10
24(cs3) 30 100 10
25 30 100 10
26(af31) 30 100 10
27 30 100 10
28(af32) 30 100 10
29 30 100 10
30(af33) 30 100 10
31 30 100 10
32(cs4) 30 100 10
33 30 100 10
34(af41) 30 100 10
35 30 100 10
36(af42) 30 100 10
37 30 100 10
38(af43) 30 100 10
39 30 100 10
40(cs5) 30 100 10
41 30 100 10
42 30 100 10
43 30 100 10
44 30 100 10
45 30 100 10
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
65
46(ef) 30 100 10
47 30 100 10
48(cs6) 30 100 10
49 30 100 10
50 30 100 10
51 30 100 10
52 30 100 10
53 30 100 10
54 30 100 10
55 30 100 10
56(cs7) 30 100 10
57 30 100 10
58 30 100 10
59 30 100 10
60 30 100 10
61 30 100 10
62 30 100 10
63 30 100 10
-----------------------------------------------------------------
[Router] display drop-profile data
Drop-profile[2]: data
DSCP Low-limit High-limit Discard-percentage
-----------------------------------------------------------------
0(default) 30 100 10
1 30 100 10
2 30 100 10
3 30 100 10
4 30 100 10
5 30 100 10
6 30 100 10
7 30 100 10
8(cs1) 30 100 10
9 30 100 10
10(af11) 70 85 60
11 30 100 10
12(af12) 30 100 10
13 30 100 10
14(af13) 30 100 10
15 30 100 10
16(cs2) 30 100 10
17 30 100 10
18(af21) 30 100 10
19 30 100 10
20(af22) 30 100 10
21 30 100 10
22(af23) 30 100 10
23 30 100 10
24(cs3) 30 100 10
25 30 100 10
26(af31) 30 100 10
27 30 100 10
28(af32) 30 100 10
29 30 100 10
30(af33) 30 100 10
31 30 100 10
32(cs4) 30 100 10
33 30 100 10
34(af41) 30 100 10
35 30 100 10
36(af42) 30 100 10
37 30 100 10
38(af43) 30 100 10
39 30 100 10
40(cs5) 30 100 10
41 30 100 10
42 30 100 10
43 30 100 10
44 30 100 10
45 30 100 10
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
66
46(ef) 30 100 10
47 30 100 10
48(cs6) 30 100 10
49 30 100 10
50 30 100 10
51 30 100 10
52 30 100 10
53 30 100 10
54 30 100 10
55 30 100 10
56(cs7) 30 100 10
57 30 100 10
58 30 100 10
59 30 100 10
60 30 100 10
61 30 100 10
62 30 100 10
63 30 100 10
-----------------------------------------------------------------
----End
Configuration Files
l Configuration file of the Router
sysname
#
vlan batch 10
20
#
drop-profile
data
wred dscp
dscp af11 low-limit 70 high-limit 85 discard-percentage
60
#
drop-profile
video
wred dscp
dscp af21 low-limit 80 high-limit 95 discard-percentage
60
#
traffic classifier vpna operator
or
if-match vlan-id
10
traffic classifier video operator
or
if-match dscp
af21
traffic classifier vpnb operator
or
if-match vlan-id
20
traffic classifier data operator
or
if-match dscp
af11
traffic classifier voice operator
or
if-match dscp
ef
#
traffic behavior
vpna
gts cir 20000 cbs 500000 queue-length 50
traffic-policy vpna-
sub
traffic behavior
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
67
video
queue af bandwidth pct
60
drop-profile
video
traffic behavior
vpnb
gts cir 30000 cbs 750000 queue-length 50
traffic-policy vpnb-
sub
traffic behavior
data
queue af bandwidth pct
30
drop-profile
data
traffic behavior
voice
queue ef bandwidth pct
5
#
traffic policy
enterprise
classifier vpna behavior
vpna
classifier vpnb behavior
vpnb
traffic policy vpna-
sub
classifier voice behavior
voice
classifier video behavior
video
classifier data behavior
data
traffic policy vpnb-
sub
classifier voice behavior
voice
classifier video behavior
video
classifier data behavior
data
#
interface
Vlanif10
ip address 192.168.1.1
255.255.255.0
#
interface
Vlanif20
ip address 192.168.2.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
10
trust
dscp
#
interface Ethernet0/0/1
port link-type
trunk
port trunk allow-pass vlan
20
trust
dscp
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
68
#
interface Ethernet0/0/8
ip address 192.168.3.1
255.255.255.0
traffic-policy enterprise
outbound
#
interface Ethernet0/0/8.1
control-vid 1 dot1q-
termination
dot1q termination vid
10
ip address 192.168.4.1
255.255.255.0
#
interface Ethernet0/0/8.2
control-vid 2 dot1q-
termination
dot1q termination vid
20
ip address 192.168.5.1
255.255.255.0
#
return
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 1 QoS Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
69
2 Traffic Policy Configuration
About This Chapter
This chapter describes the configuration of a traffic policy and the configurations of the traffic
behavior and traffic classifier in the traffic policy. It also provides configuration examples.
2.1 Traffic Policy Overview
A traffic policy classifies user traffic and specifies a traffic behavior for each type of traffic. The
traffic policy supported by the AR150/200 provides modular configurations. Traffic classifiers
and traffic behaviors are defined using templates, which simplify the configuration.
2.2 Traffic Policy Features Supported by the AR150/200
A traffic policy supports multiple matching rules in traffic classifiers and multiple actions in
traffic behaviors.
2.3 Configuring a Traffic Classifier
A traffic classifier identifies user traffic and is the prerequisite to configuring a traffic policy.
2.4 Configuring a Traffic Behavior
A traffic behavior is the action to be performed for packets matching the traffic classifier and is
the prerequisite to configuring a traffic policy. The AR150/200 provides the following traffic
actions: permit/deny, re-marking, redirection, traffic policing, traffic shaping, traffic statistics,
and queue scheduling.
2.5 Configuring a Traffic Policy
After a traffic classifier and a traffic behavior are configured, bind the traffic classifier and the
traffic behavior to a traffic policy and apply the traffic policy to an interface.
2.6 Maintaining a Traffic Policy
If the traffic statistics function is enabled, you can view and clear the flow-based traffic statistics.
2.7 Configuration Examples
This section provides several configuration examples of a traffic policy.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
70
2.1 Traffic Policy Overview
A traffic policy classifies user traffic and specifies a traffic behavior for each type of traffic. The
traffic policy supported by the AR150/200 provides modular configurations. Traffic classifiers
and traffic behaviors are defined using templates, which simplify the configuration.
A traffic policy provides modular configurations to integrate ACL-based QoS configuration
commands. It contains the following modules:
l Traffic classifier
l Traffic behavior
l Traffic policy
Traffic Classifier
A traffic classifier defines a group of matching rules to classify traffic.
The relationship between rules in a traffic classifier can be AND or OR (the default value is
OR):
l AND: Packets match a traffic classifier only when the packets match all the rules.
l OR: Packets match a traffic classifier as long as the packets match a rule.
Traffic Behavior
A traffic behavior is the action to be performed for packets. Performing complex traffic
classification is to provide differentiated services. Complex traffic classification takes effect
only when it is associated with a traffic control action or a resource allocation action.
Traffic Policy
A traffic policy is a QoS policy configured by binding traffic classifiers to traffic behaviors.
2.2 Traffic Policy Features Supported by the AR150/200
A traffic policy supports multiple matching rules in traffic classifiers and multiple actions in
traffic behaviors.
Traffic Classifier
l Traditional traffic classifier
Traditional traffic classifier and an Access Control List (ACL) can classify and match
traffic, but they are different. The difference between the traffic classifier and the ACL is
that the traffic classifier only classifies packets matching rules, but does not take actions
on packets. An ACL defines the deny or permit action to implement access control. In
addition, a traffic classifier contains more matching rules than an ACL. For example, a
traffic classifier can match packets based on the inbound interface, whereas an ACL cannot
match packets based on the inbound interface.
Table 2-1 lists traffic classification rules.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
71
Table 2-1 Complex traffic classification rules
Layer Traffic Classification Rule
Layer 2 l VLAN ID in the outer tag of a VLAN
packet
l VLAN ID in the inner tag of a VLAN
packet
l 802.1p priority in the outer tag of a
VLAN packet
l 802.1p priority in the inner tag of a
VLAN packet
l Source MAC address
l Destination MAC address
l Protocol field encapsulated based on
Layer 2 information
l FR DE
l FR DLCI
l ATM PVC
l ACL 4000 to 4999
Layer 3 l DSCP priority in IP packets
l IP precedence in IP packets
l IP protocol type (IPv4)
l ACL 2000 to 3999
Layer 4 l RTP port number
l TCP SYN flag in TCP packets
Others l Inbound interface

l SAC-based traffic classifier
SAC uses the deep packet inspection (DPI) technology to identify packets of dynamic
protocols such as HTTP, FTP, and RTP by checking Layer 4 to Layer 7 information in the
packets and to implement refined QoS management.
NOTE
The SAC function is used with a license. To use the SAC function, apply for and purchase the following
license from the Huawei local office:
l AR150&200 Value-Added Security Package
Traffic Behavior
The AR150/200 provides the following traffic actions:
l Permit/Deny
The permit/deny action is the simplest traffic control action. The AR150/200 controls
network traffic by forwarding or discarding packets.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
72
l Re-marking
This traffic control action sets the precedence field in a packet. Packets carry different
precedence fields on various networks. For example, packets carry the 802.1p field in a
VLAN, the ToS field on an IP network. Therefore, the AR150/200 is required to mark
precedence fields of packets based on the network type.
Generally, a device at the border of a network needs to re-mark precedence fields of
incoming packets; the device in the core of a network provides corresponding QoS services
based on precedence fields marked by the border device, or re-marks the precedence fields
based on its configuration rule.
l Redirection
This traffic control action redirects packets to the specified next hop address. The
AR150/200 does not forward packets based on the destination IP address.
By using redirection, you can implement policy-based routing (PBR). The policy-based
route is a static route. When the next hop is unavailable, the AR150/200 forwards packets
based on the original forwarding path.
l Traffic policing
This traffic control action limits the volume of traffic and the resources used by the traffic
by monitoring the rate of the traffic. By using traffic policing, the AR150/200 can discard
the packets, re-mark the color or precedence of, or implement other QoS measures over the
packets that exceed the rate limit.
l Traffic shaping
This traffic control action also limits the volume of traffic and the resources used by the
traffic by monitoring the rate of the traffic. Traffic shaping adjusts the speed of outgoing
traffic so that the downstream device has sufficient capabilities to process traffic. This
prevents packet loss and congestion. Traffic shaping controls the volume of outgoing traffic
over a network connection on a network so that the outgoing traffic can be sent out at an
even rate.
l Flow mirroring
This traffic control action copies the specified data packets to a specified destination to
detect and troubleshoot faults on a network. For details, see Configuring Local Flow
Mirroring in the Huawei AR150&200 Series Enterprise Routers Configuration Guide -
Device Management.
l Traffic statistics
This traffic control action collects data packets matching defined complex traffic
classification rules.
The traffic statistics action is not a QoS control measure but can be used with other actions
to improve security of networks and packets.
l Queue scheduling
Queue scheduling involves configurations relevant to queues, including scheduling modes
of Expedited Forwarding (EF), Assured Forwarding (AF), and Weighted Fair Queuing
(WFQ) queues, traffic shaping, and Weighted Random Early Detection (WRED). For
details, see CBQ in 1.2 QoS Features Supported by the AR150/200.
Traffic Policy
You can bind a traffic classifier to a traffic behavior in a traffic policy and apply the traffic policy
to an interface to implement QoS.A traffic policy can be applied to LAN-side interfaces, WAN-
side interfaces, or WAN-side sub-interfaces.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
73
Traffic Policy Nesting
A traffic policy can be nested into another traffic policy, as shown in Figure 2-1. That is, the
traffic behavior or action in a traffic policy is a sub traffic policy. When a sub traffic policy is
bound to a traffic policy, the traffic behavior in the traffic policy is taken for packets matching
the traffic classifier associated with the traffic behavior. Then the packets are classified by the
sub traffic policy and the traffic behavior in the sub traffic policy is taken for the classified
packets.
Figure 2-1 Networking diagram of traffic policy nesting
Traffic
classifier
Traffic
behavior
Traffic
classifier
Traffic
behavior
Traffic
classifier
Traffic
behavior
Traffic
classifier
Traffic
behavior
Traffic
classifier
Traffic
behavior
Traffic
classifier
Traffic
behavior
......
......
......
Traffic policy Sub traffic policy
Sub traffic policy

The AR150/200 supports two layers of traffic policies. A sub traffic policy cannot be nested by
another traffic policy.
The AR150/200 uses traffic policy nesting to implement HQoS. Traffic policy nesting can only
be configured on outbound WAN-side interfaces.
2.3 Configuring a Traffic Classifier
A traffic classifier identifies user traffic and is the prerequisite to configuring a traffic policy.
2.3.1 Establishing the Configuration Task
Before configuring a traffic classifier, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Applicable Environment
The AR150/200 classifies received traffic to provide differentiated services. The AR150/200
supports the following types of traffic classifiers:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
74
l Traditional traffic classifier
A traditional traffic classifier identifies packets based on the following information:
Layer 2 information such as the VLAN ID in packets, 802.1p priority in packets, source
MAC address, destination MAC address, Layer 2 protocol field, DE field in FR packets,
DLCI in FR packets, PVC information in ATM packets, and ACL 4000 to 4999
Layer 3 information such as DSCP priority in IP packets, IP precedence in IP packets,
protocol type, and ACL 2000 to 3999
Layer 4 information such as the RTP port number and SYN Flag in the TCP packet
header
Inbound interface of packets
l SAC-based traffic classifier
SAC uses the deep packet inspection (DPI) technology to identify packets of dynamic
protocols such as HTTP, FTP, and RTP by checking Layer 4 to Layer 7 information in the
packets. SAC helps implement refined QoS management.
A traffic classifier must be bound to a traffic behavior, and then be associated with a traffic
policy so that it can take effect.
Pre-configuration Tasks
Before configuring a traffic classifier, complete the following tasks:
l Configuring link layer attributes of interfaces to ensure that the interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
l Configuring an ACL if the ACL needs to be used to classify traffic
l Uploading a signature file to the AR150/200 and storing it into the storage media
Data Preparation
To configure a traffic classifier, you need the following data.
No. Data
1 Traffic classifier name and related parameters
2 Signature file name and storage path

2.3.2 (Optional) Configuring SAC
SAC controls enterprise network traffic precisely to ensure bandwidth of key services and
prevent bandwidth from being occupied by non-key services.
2.3.2.1 Configuring a Signature File
To use the SAC feature, enable SAC and load the signature file. A signature file contains all
application protocols supported by SAC.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
75
Prerequisites
A signature file has been loaded to the AR150/200 and stored into the storage media.
Context
There must be an interval of at least 20s between running the sac enable signature command
and the sac update signature or undo sac enable command.
There must be an interval of at least 20s between running the sac update signature command
and the undo sac enable or sac update signature command.
There must be an interval of at least 20s between running the undo sac enable and sac enable
signature commands.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
sac enable signature signature-name
SAC is enabled and a signature file is loaded.
By default, SAC is disabled.
NOTE
If you do not specify the complete path in the signature file name, the current path is used by default. Even
if the signature file is loaded successfully, an error may occur during configuration restoration. Therefore,
you must enter the complete path and name.
Step 3 (Optional) Run:
sac update signature signature-name
A signature file is updated.
----End
2.3.2.2 Configuring an SAC Group
An SAC group enables the AR150/200 to classify and manage application protocols.
Prerequisites
An SAC signature file has been loaded.
Context
A maximum of 32 SAC groups can be configured on the AR150/200 and each SAC group
contains a maximum of 32 application protocols.
By default, no SAC group is created.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
76
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
sac protocol-group protocol-group
An SAC group is created and the SAC group view is displayed.
Step 3 Run:
app-protocol protocol-name
A specified application protocol is added to the SAC group.
----End
2.3.2.3 Configuring the SAC Statistics Function
The SAC statistics function enables an AR150/200 interface or sub-interface to discover traffic
recognized by the DPI engine and collect statistics on the traffic.
Prerequisites
An SAC signature file has been loaded.
Context
The AR150/200 identifies, classifies, and collects statistics on received traffic, and then reports
the statistics to the NMS. The NMS records the reported statistics and generates a report about
service applications and bandwidth usage. Based on the traffic statistics, you can take measures
to ensure bandwidth for key services and limit unnecessary traffic.
The display sac protocol-statistic command displays all the previous packet statistics based on
the SAC application protocol on an interface. To collect new statistics, run the reset sac
protocol-statistic command to delete the previous statistics.
By default, the SAC statistics function is disabled on an interface.
Procedure
l Enable the SAC statistics function on an interface.
1. Run:
system-view
The system view is displayed.
2. Run:
interface interface-type interface-number[.subinterface-number]
The interface or sub-interface view is displayed.
3. Run:
sac protocol-statistic enable
The SAC statistics function is enabled on the interface.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
77
l Delete the statistics on SAC application protocol packets on an interface.
1. Run:
reset sac protocol-statistic { protocol protocol-name | all } interface
interface-type interface-number or reset sac protocol-statistic
{ protocol protocol-name | all } interface virtual-template vt-number
virtual-access va-number
The statistics on SAC application protocol packets are deleted.
----End
2.3.2.4 Checking the Configuration
After SAC is configured, you can view the SAC configuration and statistics.
Prerequisites
The SAC configuration is complete.
Procedure
l Run the display sac information command to check the SAC configuration on the
AR150/200.
l Run the display sac protocol-group [ protocol-group ] command to check the configured
SAC group on the AR150/200.
l Run the display sac protocol-list command to check the SAC protocol list on the
AR150/200.
l Run the display sac protocol-statistic { protocol protocol-name | top-n number | all }
interface interface-type interface-number [ inbound | outbound ] or display sac protocol-
statistic { protocol protocol-name | top-n number | all } interface virtual-template vt-
number virtual-access va-number [ inbound | outbound ] command to view the statistics
on packets of SAC application protocols on the interface.
----End
2.3.3 Configuring a Traffic Classifier
The AR150/200 processes packets matching the same traffic classifier in the same manner.
Prerequisites
To define a matching rule based on the application protocol, ensure that SAC has been enabled
and the signature file has been loaded.
To define a matching rule based on the SAC group, ensure that SAC has been enabled, the
signature file has been loaded, and an SAC group has been created.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
78
Step 2 Run:
traffic classifier classifier-name [ operator { and | or } ]
A traffic classifier is created and the traffic classifier view is displayed.
l and: If rules are ANDed with each other, the packets must match all the non-ACL rules and
one of the ACL rules of the traffic classifier.
l or: Packets need to match only one rule of the traffic classifier.
By default, the relationship between rules in a traffic classifier is OR.
Step 3 Run the following commands as required.
l To define a matching rule for traffic classification based on the 802.1p priority in VLAN
packets, run the if-match 8021p 8021p-value &<1-8> command.
l To define a matching rule for traffic classification based on the inner 802.1p priority in QinQ
packets, run the if-match cvlan-8021p 8021p-value &<1-8> command.
l To define a matching rule for traffic classification based on an ACL, run the if-match acl
{ acl-number | acl-name } command.
NOTE
To define a matching rule for traffic classification based on an ACL, create the ACL first. The
AR150/200 supports the following types of ACLs:
l Basic ACLs. For details on how to create a basic ACL, see Configuring a Basic ACL.
l Advanced ACLs. For details on how to create an advanced ACL, see Configuring an Advanced
ACL.
l Layer 2 ACLs. For details on how to create a Layer 2 ACL, see Configuring a Layer 2 ACL.
l To define a matching rule for classifying all data packets, run the if-match any command.
NOTE
If if-match any and other rules are configured in a traffic classifier simultaneously, packets match only
if-match any.
l To define a matching rule for traffic classification based on the destination MAC address,
run the if-match destination-mac mac-address [ mac-address-mask mac-address-mask ]
command.
l To define a matching rule for traffic classification based on the source MAC address, run the
if-match source-mac mac-address [ mac-address-mask mac-address-mask ] command.
l To define a matching rule for traffic classification based on the DLCI in FR packets, run the
if-match dlci start-dlci-number [ to end-dlci-number ] command.
l To define a matching rule for traffic classification based on the Discard Eligibility (DE) in
FR packets, run the if-match fr-de command.
l To define a matching rule for traffic classification based on the DSCP priority in IP packets,
run the if-match dscp dscp-value &<1-8> command.
l To define a matching rule for traffic classification based on the IP precedence in IP packets,
run the if-match ip-precedence ip-precedence-value &<1-8> command.
NOTE
If the relationship between rules is AND in a traffic classifier, the if-match dscp and if-match ip-
precedence commands cannot be used in the traffic classifier simultaneously.
l To define a matching rule for traffic classification based on the inbound interface, run the
if-match inbound-interface interface-type interface-number command.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
79
l To define a matching rule for traffic classification based on the protocol field in the Ethernet
frame, run the if-match l2-protocol { arp | ip | rarp | protocol-value } command.
l To define a matching rule to classify traffic based on the Layer 3 protocol type in packets,
run the if-match protocol ip command.
l To define a matching rule for traffic classification based on the Permanent Virtual Circuit
(PVC) information in ATM packets, run the if-match pvc vpi-number/vci-number command.
l To define a matching rule for traffic classification based on the RTP port number, run the
if-match rtp start-port start-port-number end-port end-port-number command.
l To define a matching rule for traffic classification based on the SYN Flag in the TCP packet
header, run the if-match tcp syn-flag syn-flag &<1-6> command.
l To define a matching rule for traffic classification based on the VLAN ID, run the if-match
vlan-id start-vlan-id [ to end-vlan-id ] command.
l To define a matching rule for traffic classification based on the inner VLAN ID in QinQ
packets, run the if-match cvlan-id start-cvlan-id [ to end-cvlan-id ] command.
l To define a matching rule for traffic classification based on the application protocol, run the
if-match app-protocol protocol-name [ time-range time-name ] command.
NOTE
When a traffic classifier contains if-match app-protocol, the relationship between rules in the traffic
classifier must be or.
l To define a matching rule for traffic classification based on the SAC group, run the if-match
protocol-group protocol-group [ time-range time-name ] command.
NOTE
When a traffic classifier contains if-match protocol-group, the relationship between rules in the traffic
classifier must be or.
----End
2.3.4 Checking the Configuration
You can view the traffic classifier configuration after a traffic classifier is configured.
Prerequisites
The traffic classifier configurations are complete.
Procedure
Step 1 Run the display traffic classifier { system-defined | user-defined } [ classifier-name ]
command to check the traffic classifier configuration.
----End
2.4 Configuring a Traffic Behavior
A traffic behavior is the action to be performed for packets matching the traffic classifier and is
the prerequisite to configuring a traffic policy. The AR150/200 provides the following traffic
actions: permit/deny, re-marking, redirection, traffic policing, traffic shaping, traffic statistics,
and queue scheduling.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
80
2.4.1 Establishing the Configuration Task
Before configuring a traffic behavior, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the data required for the configuration. This
will help you complete the configuration task quickly and accurately.
Applicable Environment
A traffic behavior is the action to be performed for packets. Performing complex traffic
classification is to provide differentiated services. Complex traffic classification takes effect
only when it is associated with a traffic control action or a resource allocation action.
A traffic classifier must be bound to a traffic behavior and associated with a traffic policy so
that it can take effect.
A traffic policy containing different traffic behaviors are applied to different types of interfaces
and directions on the AR150/200. See Table 2-2.
Table 2-2 Limitation on applying a traffic policy containing different traffic behaviors
Traffic Behavior Application Limitation
Permit/Deny
Re-marking
Traffic policing
Traffic statistics
There are no limitations.
Redirection This action cannot be applied to LAN-side
or WAN-side interfaces in the inbound
direction.
Traffic shaping
Congestion management
Congestion avoidance
Sub traffic policy binding
These actions cannot be applied to WAN-
side interfaces in the outbound direction.

Pre-configuration Tasks
Before configuring a traffic behavior, complete the following tasks:
l Configuring link layer attributes of interfaces to ensure that these interfaces work properly
l Configuring IP addresses and routing protocols for interfaces to ensure connectivity
Data Preparation
To configure a traffic behavior, you need the following data.
No. Data
1 Traffic behavior name and related parameters

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
81
2.4.2 Configuring a Permit or Deny Action
The AR150/200 implements access control using a traffic policy. You can use the deny |
permit command to define a traffic policy. By using this traffic policy, you can implement the
firewall function to filter out packets.
Context
By configuring a deny or permit action, the AR150/200 rejects or permits packets matching
traffic classification rules to control the network traffic.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run the following commands as required.
l To configure a permit action, run the permit command.
l To configure a deny action, run the deny command.
NOTE
l If the action is set to deny, the packets matching traffic classification rules are discarded. Therefore,
other actions except for the traffic statistics action cannot be configured.
l If the action is set to permit, the permit action is taken for the packets matching traffic classification
rules, and other actions defined in the traffic behavior are taken for these packets.
----End
2.4.3 Configuring Redirection
By configuring the redirection action, the AR150/200 redirects the packets matching traffic
classification rules to a specified next hop address.
Context
You can configure redirection in a traffic behavior to implement PBR.
A traffic policy containing the redirection action can be applied to only the inbound direction
of an interface.
If the AR150/200 does not have the ARP entry corresponding to the next hop IP address, it
triggers ARP learning. If no ARP entry is learned, packets are forwarded along the original path.
If the AR150/200 has the ARP entry or learns the ARP entry, packets are forwarded based on
the specified IP address.
NQA diagnoses and locates network faults. Association between NQA and redirection
implements rapid route switchover and ensure correct data traffic forwarding when network
faults occur.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
82
l If the NQA test instance detects a reachable destination IP address, packets are forwarded
based on the specified IP address and redirection takes effect.
l If the NQA test instance detects an unreachable destination IP address, packets are
forwarded along the original path and redirection does not take effect.
NOTE
The NQA test instance must be an ICMP type. For details, see Configuring the ICMP Test and Configuring
Universal Parameters for the NQA Test Instance in NQA Configuration of the Huawei AR150&200
Series Enterprise Routers Configuration Guide - Network Management.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run:
redirect ip-nexthop ip-address [ track nqa admin-name test-name ]
The packets matching traffic classification rules are redirected to the specified next hop
address and association between redirection and the NQA test instance is configured.
----End
2.4.4 Configuring Re-marking
By configuring the re-marking action, the AR150/200 re-marks priorities of packets matching
traffic classification rules, such as 802.1p priorities in VLAN packets, DSCP priorities in IP
packets, DE values in FR packets, or internal priorities.
Context
After the re-marking action is configured, the router still processes outgoing packets based on
the original priority but the downstream device processes the packets based on the re-marked
priority.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run the following commands as required.
l Run:
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
83
remark 8021p 8021p-value
The 802.1p priority of the packets matching traffic classification rules is re-marked.
l Run:
remark cvlan-8021p 8021p-value
The inner 802.1p priority in QinQ packets matching the traffic classification rules is re-
marked.
l Run:
remark dscp { dscp-name | dscp-value }
The DSCP priority of the packets matching traffic classification rules is re-marked.
l Run:
remark fr-de fr-de-value
The DE value of the FR packets matching traffic classification rules is re-marked.
l Run:
remark local-precedence local-precedence-value
The local priority of the packets matching traffic classification rules is re-marked.
NOTE
If the traffic behavior is configured with remark 8021p, remark mpls-exp, or remark dscp, but not
remark local-precedence, the AR150/200 marks the local priority of packets as 0.
----End
2.4.5 Configuring Traffic Policing
Traffic policing limits the volume of traffic and the resources used by the traffic by monitoring
the traffic rate.
Context
The AR150/200 performs traffic policing for packets matching traffic classification rules, and
discards the excess packets or re-marks the colors or CoS of the excess packets.
NOTE
When the CBS value is less than the number of bytes in a single packet of a service, packets of the service
are discarded.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run:
car cir { cir-value | pct cir-percentage } [ pir { pir-value | pct pir-
percentage } ] [ cbs cbs-value pbs pbs-value ] [ share ] [ green { discard | pass
[ remark-8021p 8021p-precedence | remark-dscp dscp-value ] } ] [ yellow { discard
| pass [ remark-8021p 8021p-precedence | remark-dscp dscp-value ] } ] [ red
{ discard | pass [ remark-8021p 8021p-precedence | remark-dscp dscp-value ] } ]
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
84
The CAR action is configured.
After share is specified, all the rules in a traffic classifier bound to a traffic behavior share CAR
parameters. The system aggregates all the flows and uses the CAR to limit the flows.
----End
2.4.6 Configuring Traffic Shaping
Traffic shaping also limits the volume of traffic and the resources used by the traffic by
monitoring the traffic rate.
Context
Traffic shaping adjusts the rate of outgoing traffic so that the downstream device has capabilities
to process traffic. This prevents packet loss and congestion. Traffic shaping controls the volume
of outgoing traffic over a network connection so that the outgoing traffic can be sent out at an
even rate.
NOTE
A traffic policy containing the traffic shaping action can only be applied to outbound AR150/200 WAN-
side interfaces.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run:
gts cir cir-value [ cbs cbs-value [ queue-length queue-length ] ]
Traffic shaping is configured.
----End
2.4.7 Configuring Congestion Management
The AR150/200 provides Assured Forwarding (AF), Expedited Forwarding (EF), and Best-
Effort (BE) queues for data packets matching traffic classification rules.
Context
The AR150/200 provides the following queues for data packets matching traffic classification
rules:
l AF: ensures low drop probability of packets when the rate of outgoing service traffic does
not exceed the minimum bandwidth. It is applied to services of heavy traffic that need to
be ensured.
l EF: is applied to services requiring a low delay, low drop probability, and assured
bandwidth. It is also applied to services occupying low bandwidth, for example, voice
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
85
packets. After packets matching traffic classification rules enter EF queues, they are
scheduled in Strict Priority (SP) mode. Packets in other queues are scheduled only after all
the packets in EF queues are scheduled.
l BE: is used with the default traffic classifier. The remaining packets that do not enter AF
or EF queues enter BE queues. BE queues use Weighted Fair Queuing (WFQ) scheduling.
When a greater number of queues are configured, WFQ allocates bandwidth more evenly
but more resources are occupied. WFQ is applied to the services insensitive to the delay
and packet loss, for example, Internet access services.
NOTE
A traffic policy containing AF, EF, or BE can only be applied to outbound AR150/200 WAN-side
interfaces.
Although you are allowed to configure AF queues and bandwidth for the default traffic classifier,
BE queues are configured in most situations.
l When the default traffic classifier is associated with AF queues:
The total bandwidth used by AF queues and EF queues cannot exceed the interface
bandwidth.
EF queues are provided with bandwidth preferentially. AF queues share the remaining
bandwidth based on their weights.
l When the default traffic classifier is associated with BE queues:
The system allocates 10% of the interface's available bandwidth to BE queues.
The bandwidth used by AF queues and EF queues cannot exceed 99% of the interface
bandwidth.
EF queues are provided with bandwidth preferentially. AF and BE queues share the
remaining bandwidth based on their weights.
The system allocates bandwidth to queues based on their weights.
Table 2-3 provides an example of bandwidth allocation.
Table 2-3 Example of congestion management parameter settings
Interface Bandwidth User Configuration
100M EF queues: a maximum of 50% of the
interface bandwidth
AF queues: a minimum bandwidth of 30
Mbit/s
BE queues: The default traffic classifier is
associated with BE queues. By default, the
system allocates 10% of the interface's
available bandwidth.

The system first allocates bandwidth to EF queues. AF queues and BE queues share the
remaining bandwidth based on weights:
l Bandwidth of EF queues: 100 Mbit/s x 50% = 50 Mbit/s
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
86
l AF queues: BE queues = 30 Mbit/s:(100 Mbit/s x 10%) = 3:1
l Remaining bandwidth: 100 Mbit/s - 50 Mbit/s = 50 Mbit/s
l AF queues and BE queues share the remaining bandwidth in the proportion of 3:1.
Bandwidth of AF queues: 50 Mbit/s x [3/(3+1)]= 37.5 Mbit/s
Bandwidth of BE queues: 50 Mbit/s x [1/(3+1)]= 12.5 Mbit/s
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run the following commands as required.
l Run:
queue af bandwidth { bandwidth | pct percentage }
AF is configured for packets of a certain type and the minimum bandwidth is set.
l Run:
queue ef bandwidth { bandwidth [ cbs cbs-value ] | pct percentage [ cbs cbs-
value ] }
EF is configured for packets of a certain type and the maximum bandwidth is set.
l Run:
queue wfq [ queue-number total-queue-number ]
The AR150/200 is configured to send packets matching the default traffic classifier to BE
queues in WFQ mode and the number of queues is set.
Step 4 (Optional) Run:
queue-length { bytes bytes-value | packets packets-value }
*
The maximum length of a queue is set.
----End
2.4.8 Configuring Congestion Avoidance
This section describes how to configure flow-based congestion avoidance, and set the upper
drop threshold, lower drop threshold, and maximum drop probability of the WRED drop profile
for packets of different priorities.
Context
A drop profile defines WRED parameters and is used to implement congestion avoidance for
queues bound to the drop profile.
After a drop profile is bound to a traffic behavior, bind the traffic behavior and traffic classifier
to a traffic policy and apply the traffic policy to an interface so that WRED parameters in the
drop profile take effect on the interface.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
87
NOTE
A traffic policy containing AF, EF, or BE can only be applied to outbound AR150/200 WAN-side
interfaces.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
The traffic behavior view is displayed.
NOTE
queue af or queue wfq must have been configured in the traffic behavior.
Step 3 Run:
drop-profile drop-profile-name
A drop profile is bound to the traffic behavior.
NOTE
The drop profile has been created and WRED parameters have been set in the drop profile.
----End
2.4.9 Binding a Sub Traffic Policy
A sub traffic policy can be bound to a traffic behavior on the AR150/200 so that the
AR150/200 can provide differentiated services.
Context
A traffic policy can be nested into another traffic policy. That is, the traffic behavior or action
in a traffic policy is a sub traffic policy. When a sub traffic policy is bound to a traffic policy,
the traffic behavior in the traffic policy is taken for packets matching the traffic classifier
associated with the traffic behavior. Then the packets are classified by the sub traffic policy and
the traffic behavior in the sub traffic policy is taken for the classified packets.
The AR150/200 supports two layers of traffic policies. A sub traffic policy cannot be nested by
another traffic policy.
Table 2-4 lists traffic classifiers and traffic behaviors allowed in traffic policies when traffic
policy nesting is used.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
88
Table 2-4 Traffic classifiers and traffic behaviors allowed in traffic policies
Traffic Policy Traffic Classifier Traffic Behavior
Traffic policy All traffic classifiers
supported
(Mandatory) Flow-based
traffic shaping
(Mandatory) Sub traffic
policy binding
(Optional) Traffic statistics
Sub traffic policy All traffic classifiers
supported
The following traffic
behaviors cannot be
configured simultaneously:
l Flow-based traffic
shaping
l Class-based congestion
management and
congestion avoidance
(Mandatory) Class-
based congestion
management
(Optional) Flow-
based congestion
avoidance

NOTE
A traffic policy containing the preceding traffic behaviors can only be applied to outbound AR150/200
WAN-side interfaces.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
The traffic behavior view is displayed.
NOTE
The traffic shaping action (gts (traffic behavior view) must have been configured in the traffic behavior.
Step 3 Run:
traffic-policy policy-name
A sub traffic policy is bound to a traffic behavior.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
89
NOTE
The bound sub traffic policy must have been configured.
----End
2.4.10 Configuring Traffic Statistics
By configuring the traffic statistics action, the AR150/200 collects traffic statistics on the packets
matching traffic classification rules.
Context
The display traffic policy statistics command shows the statistics on forwarded packets and
discarded packets on an interface to which a traffic policy has been applied. You can locate faults
according to the command output.
By default, the traffic statistics function is disabled. Before running the display traffic policy
statistics command, ensure that the traffic statistics function has been enabled.
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic behavior behavior-name
A traffic behavior is created and the traffic behavior view is displayed.
Step 3 Run:
statistic enable
The traffic statistics function is enabled.
----End
2.4.11 Checking the Configuration
You can view the traffic behavior configuration after a traffic behavior is configured.
Prerequisites
All the traffic behavior configurations are complete.
Procedure
l Run the display traffic behavior { system-defined | user-defined } [ behavior-name ]
command to check the traffic behavior configuration.
----End
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
90
2.5 Configuring a Traffic Policy
After a traffic classifier and a traffic behavior are configured, bind the traffic classifier and the
traffic behavior to a traffic policy and apply the traffic policy to an interface.
Applicable Environment
A traffic classifier classifies user packets and a traffic behavior defines actions taken for the
packets matching the traffic classifier. A traffic policy is configured by binding traffic classifiers
to traffic behaviors. A traffic policy can be applied to AR150/200 LAN-side interfaces, WAN-
side interfaces, or WAN-side sub-interfaces.
Only one traffic policy can be applied to one direction on an interface, but a traffic policy can
be applied to different directions on different interfaces.
Pre-configuration Tasks
Before configuring a traffic policy, complete the following tasks:
l 2.3 Configuring a Traffic Classifier
l 2.4 Configuring a Traffic Behavior
Procedure
Step 1 Run:
system-view
The system view is displayed.
Step 2 Run:
traffic policy policy-name
A traffic policy is created and the traffic policy view is displayed.
Step 3 Run:
classifier classifier-name behavior behavior-name
A traffic classifier and a traffic behavior are associated with the traffic policy.
Step 4 Run:
quit
Exit from the traffic policy view.
Step 5 Run:
interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Step 6 Run:
traffic-policy policy-name { inbound | outbound }
A traffic policy is applied to the interface or sub-interface in the inbound or outbound direction.
----End
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
91
Checking the Configuration
Run the display traffic policy user-defined [ policy-name [ classifier classifier-name ] ]
command to check the traffic policy configuration.
Run the display traffic-policy policy-name applied-record command to check the specified
traffic policy record.
2.6 Maintaining a Traffic Policy
If the traffic statistics function is enabled, you can view and clear the flow-based traffic statistics.
2.6.1 Displaying the Flow-based Traffic Statistics
The flow-based traffic statistics include the numbers of forwarded and discarded packets.
Context
To check forwarded and discarded packets on an interface to which a traffic policy has been
applied, view the flow-based traffic statistics on the interface.
To view the flow-based traffic statistics, ensure that a traffic policy has been created and the
traffic statistics action has been configured in the traffic policy.
Procedure
Step 1 Run the display traffic policy statistics interface interface-type interface-number [ pvc vpi-
number/vci-number | dlci dlic-number ] { inbound | outbound } [ verbose { classifier-base |
rule-base } [ class classifier-name ] ] or display traffic policy statistics interface { virtual-
template vt-number virtual-access va-number | dialer number } { inbound | outbound }
[ verbose { classifier-base | rule-base } [ class classifier-name ] ] command to view the traffic
statistics on an interface to which a traffic policy has been applied.
----End
2.6.2 Clearing the Flow-based Traffic Statistics
You can use the reset command to clear the flow-based traffic statistics.
Context
Before recollecting the flow-based traffic statistics on an interface, run the following command
in the user view to clear the existing statistics.
To clear the flow-based traffic statistics, ensure that a traffic policy has been created and the
traffic statistics action has been configured in the traffic policy.
CAUTION
The cleared flow-based traffic statistics cannot be restored. Exercise caution when you run the
command.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
92
Procedure
Step 1 Run the reset traffic policy statisticsreset traffic policy statistics interface interface-type
interface-number { inbound | outbound } or reset traffic policy statistics interface { virtual-
template vt-number virtual-access va-number | dialer number } { inbound | outbound }
command to clear the flow-based traffic statistics on an interface.
----End
2.7 Configuration Examples
This section provides several configuration examples of a traffic policy.
2.7.1 Example for Configuring Re-marking
By configuring re-marking, the Router re-marks 802.1p priorities in packets with DSCP
priorities to provide differentiated services.
Networking Requirements
As shown in Figure 2-2, voice, video, and data services on the LAN side of the enterprise are
connected to Eth0/0/0 and Eth0/0/1 of RouterA through SwitchA and SwitchB, and are sent to
the WAN-side network through Eth0/0/8 of RouterA.
Different service packets are identified on the LAN side based on 802.1p priorities in packets.
When packets reach the WAN- side network from Eth0/0/8, RouterA needs to provide
differentiated services based on DSCP priorities in the packets. The re-marking action is
configured to re-mark 802.1p priorities with DSCP priorities.
Figure 2-2 Networking diagram of re-marking configurations
LAN
Voice
802.1p=6
Video
802.1p=5
Data
802.1p=2
Voice
802.1p=6
Video
802.1p=5
Data
802.1p=2
RouterA
SwitchB
SwitchA
Eth0/0/0
Eth0/0/1
Eth0/0/8
WAN
RouterB

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
93
Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and VLANIF interfaces and configure interfaces so that enterprise users
can access the WAN-side network through RouterA.
2. Configure traffic classifiers on RouterA to match packets based on 802.1p priorities.
3. Configure traffic behaviors on RouterA to re-mark 802.1p priorities of packets.
4. Configure a traffic policy on RouterA, bind the configured traffic behaviors and traffic
classifiers to the traffic policy, and apply the traffic policy to Eth0/0/0 and Eth0/0/1 in the
inbound direction.
Data Preparation
To complete the configuration, you need the following data:
l The interface connecting RouterA and SwitchA belongs to VLAN 20 and the IP address
of VLANIF 20 is 192.168.2.1/24.
l The interface connecting RouterA and SwitchB belongs to VLAN 30 and the IP address
of VLANIF 30 is 192.168.3.1/24.
l The IP address of the interface connecting RouterA and the WAN-side interface is
192.168.4.1/24.
l The 802.1p priorities of data, video, and voice packets are 2, 5, and 6, and are re-marked
with DSCP priorities 15, 40, and 50.
l The traffic policy is applied to Eth0/0/0 and Eth0/0/1 in the inbound direction.
Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 20 and VLAN 30 on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan batch 20 30
# Configure Eth0/0/0 and Eth0/0/1 as trunk interfaces, and add Eth0/0/0 to VLAN 20 and
Eth0/0/1 to VLAN 30.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 20
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernetinterface ethernet 0/0/1] port link-type trunk
[RouterA-Ethernetinterface ethernet 0/0/1] port trunk allow-pass vlan 30
[RouterA-Ethernetinterface ethernet 0/0/1] quit
NOTE
Configure the interface connecting SwitchA and RouterA as a trunk interface and add it to VLAN 20.
Configure the interface connecting SwitchB and RouterA as a trunk interface and add it to VLAN 30.
# Create VLANIF 20 and VLANIF 30, assign IP address 192.168.2.1/24 to VLANIF 20, and
assign IP address 192.168.3.1/24 to VLANIF 30.
[RouterA] interface vlanif 20
[RouterA-Vlanif20] ip address 192.168.2.1 24
[RouterA-Vlanif20] quit
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
94
[RouterA] interface vlanif 30
[RouterA-Vlanif30] ip address 192.168.3.1 24
[RouterA-Vlanif30] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
NOTE
Configure RouterB to ensure that there is a reachable route between RouterB and RouterA. The
configuration details are not mentioned here.
Step 2 Configure traffic classifiers.
# Create and configure traffic classifiers c1, c2, and c3 on RouterA to classify packets based on
802.1p priorities.
[RouterA] traffic classifier c1
[RouterA-classifier-c1] if-match 8021p 2
[RouterA-classifier-c1] quit
[RouterA] traffic classifier c2
[RouterA-classifier-c2] if-match 8021p 5
[RouterA-classifier-c2] quit
[RouterA] traffic classifier c3
[RouterA-classifier-c3] if-match 8021p 6
[RouterA-classifier-c3] quit
Step 3 Create and configure traffic behaviors b1, b2, and b3 on RouterA, and re-mark 802.1p priorities
of packets.
[RouterA] traffic behavior b1
[RouterA-behavior-b1] remark dscp 15
[RouterA-behavior-b1] quit
[RouterA] traffic behavior b2
[RouterA-behavior-b2] remark dscp 40
[RouterA-behavior-b2] quit
[RouterA] traffic behavior b3
[RouterA-behavior-b3] remark dscp 50
[RouterA-behavior-b3] quit
Step 4 # Create a traffic policy p1 on RouterA, bind the configured traffic behaviors and traffic
classifiers to the traffic policy, and apply the traffic policy to Eth0/0/0 and Eth0/0/1 in the
inbound direction.
[RouterA] traffic policy p1
[RouterA-trafficpolicy-p1] classifier c1 behavior b1
[RouterA-trafficpolicy-p1] classifier c2 behavior b2
[RouterA-trafficpolicy-p1] classifier c3 behavior b3
[RouterA-trafficpolicy-p1] quit
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] traffic-policy p1 inbound
[RouterA-Ethernet0/0/0] quit
[RouterA] interface ethernet 0/0/1
[RouterA-Ethernet0/0/1] traffic-policy p1 inbound
[RouterA-Ethernet0/0/1] quit
[RouterA] quit
Step 5 Verify the configuration.
# View the configuration of traffic classifiers.
<RouterA> display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c2
Operator: OR
Rule(s) : if-match 8021p 5

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
95
Classifier: c3
Operator: OR
Rule(s) : if-match 8021p 6

Classifier: c1
Operator: OR
Rule(s) : if-match 8021p 2

# View the traffic policy configuration.
<RouterA> display traffic policy user-defined p1
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: OR
Behavior: b1
Marking:
Remark DSCP 15

Classifier: c2
Operator: OR
Behavior: b2
Marking:
Remark DSCP cs5

Classifier: c3
Operator: OR
Behavior: b3
Marking:
Remark DSCP 50

----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
vlan batch 20 30
#
traffic classifier c3 operator or
if-match 8021p 6
traffic classifier c2 operator or
if-match 8021p 5
traffic classifier c1 operator or
if-match 8021p 2
#
traffic behavior b3
remark dscp 50
traffic behavior b2
remark dscp cs5
traffic behavior b1
remark dscp 15
#
traffic policy
p1
classifier c1 behavior
b1
classifier c2 behavior
b2
classifier c3 behavior b3
#
interface
Vlanif20
ip address 192.168.2.1
255.255.255.0
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
96
#
interface
Vlanif30
ip address 192.168.3.1
255.255.255.0
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
20
traffic-policy p1
inbound
#
interface Ethernet0/0/1
port link-type
trunk
port trunk allow-pass vlan
30
traffic-policy p1
inbound
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
#
return
2.7.2 Example for Configuring Traffic Statistics
After the traffic statistics action is configured, the Router collects statistics on packets with the
specified source MAC address.
Networking Requirements
As shown in Figure 2-3, the MAC address of PC1 is 0000-0000-0003 and PC1 is connected to
Eth0/0/0 of the Router through the switch. The Router is required to collect statistics on packets
with the source MAC address 0000-0000-0003.
Figure 2-3 Networking diagram of traffic statistics based on complex traffic classification
Switch PC1 Router
MAC:0000-0000-0003
Eth0/0/0
VLAN 20
WAN

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interfaces so that the Router can be connected to the switch and PC1.
2. Configure an ACL to match packets with the source MAC address 0000-0000-0003.
3. Configure a traffic classifier and bind the traffic classifier to the ACL.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
97
4. Configure a traffic behavior to allow the packets matching rules.
5. Configure a traffic policy, bind the traffic policy to the traffic classifier and traffic behavior,
and apply the traffic policy to Eth0/0/0 in the inbound direction so that the Router collects
statistics on packets with the source MAC address 0000-0000-0003.
Data Preparation
To complete the configuration, you need the following data:
l VLAN 20 that the interface connecting the Router and the switch belong to
l ACL 4000
l Traffic classifier c1
l Traffic behavior b1
l Traffic policy p1
Procedure
Step 1 Create a VLAN and configure each interface.
# Create VLAN 20.
<Huawei> system-view
[Huawei] sysname Router
[Router] vlan 20
[Router-vlan20] quit
# Configure Eth0/0/0 as a trunk interface and add Eth0/0/0 to VLAN 20.
[Router] interface ethernet 0/0/0
[Router-Ethernet0/0/0] port link-type trunk
[Router-Ethernet0/0/0] port trunk allow-pass vlan 20
[Router-Ethernet0/0/0] quit
NOTE
Configure the interface connecting the switch and the Router as a trunk interface and add it to VLAN 20.
Configure the interface connecting the switch and PC1 as an access interface and add it to VLAN 20.
Step 2 Create ACL 4000 (a Layer 2 ACL) on the Router to match packets with the source MAC address
0000-0000-0003.
[Router] acl 4000
[Router-acl-L2-4000] rule permit source-mac 0000-0000-0003 ffff-ffff-ffff
[Router-acl-L2-4000] quit
Step 3 Create a traffic classifier c1 on the Router to match ACL 4000.
[Router] traffic classifier c1
[Router-classifier-c1] if-match acl 4000
[Router-classifier-c1] quit
Step 4 Create a traffic behavior b1 on the Router and configure the traffic statistics action in the traffic
behavior.
[Router] traffic behavior b1
[Router-behavior-b1] statistic enable
[Router-behavior-b1] quit
Step 5 Configure a traffic policy and apply the traffic policy to an interface.
# Create a traffic policy p1 on the Router and bind the traffic policy to the traffic classifier and
traffic behavior.
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
98
[Router] traffic policy p1
[Router-trafficpolicy-p1] classifier c1 behavior b1
[Router-trafficpolicy-p1] quit
# Apply the traffic policy p1 to Eth0/0/0.
[Router] interface ethernet 0/0/0
[Router-Ethernet0/0/0] traffic-policy p1 inbound
[Router-Ethernet0/0/0] quit
[Router] quit
Step 6 Verify the configuration.
# View the ACL configuration.
<Router> display acl 4000
L2 ACL 4000, 1 rule
Acl's step is 5
rule 5 permit source-mac 0000-0000-0003
# View the traffic classifier configuration.
<Router> display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c1
Operator: OR
Rule(s) : if-match acl 4000
# View the traffic policy configuration.
<Router> display traffic policy user-defined p1
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: OR
Behavior: b1
statistic: enable
# View the traffic statistics.
<Router> display traffic policy statistics interface Ethernet 0/0/0 inbound

Interface: Ethernet0/0/0 Traffic policy inbound:
p1
Rule number: 1
Current status: OK!
Item Sum(Packets/Bytes) Rate(pps/bps)
-------------------------------------------------------------------------------
Matched 0/ 0/
- -
+--Passed 0/ 0/
- -
+--Dropped 0/ 0/
- -
+--Filter 0/ 0/
- -
+--CAR 0/ 0/
- -
+--Queue Matched 0/ 0/
0 0
+--Enqueued 0/ 0/
0 0
+--Discarded 0/ 0/
0 0
+--Car 0/ 0/
- -
+--Green packets 0/ 0/
- -
+--Yellow packets 0/ 0/
- -
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
99
+--Red packets 0/ 0/
- -
----End
Configuration Files
l Configuration file of the Router
#
sysname Router
#
vlan batch 20
#
acl number 4000
rule 5 permit source-mac 0000-0000-0003
#
traffic classifier c1 operator or
if-match acl 4000
#
traffic behavior b1
statistic enable
#
traffic policy p1
classifier c1 behavior b1
#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
20
traffic-policy p1
inbound
#
return
2.7.3 Example for Preventing BT Download
This section provides an example for configuring an SAC-based traffic classifier to prevent BT
download, precisely control enterprise network traffic, and prevent bandwidth from being
occupied by non-key services.
Networking Requirements
As shown in Figure 2-4, enterprise users connect to Eth0/0/0 on RouterA through the switch
and connect to the WAN through Eth0/0/8 on RouterA.
An SAC-based traffic classifier needs to be configured on RouterA to prevent BT download.
Figure 2-4 Networking diagram for preventing BT download
Switch RouterB
Eth0/0/8
WAN
RouterA
Eth0/0/0
Enterprise
users
BT Server

Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
100
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interfaces so that enterprise users can access the WAN through RouterA.
2. Configure SAC on RouterA.
3. Configure a traffic classifier to match the BT protocol.
4. Configure a traffic behavior to deny packets matching the traffic classifier.
5. Configure a traffic policy, bind the traffic classifier and traffic behavior to the traffic policy,
and apply the traffic policy to an interface.
Data Preparation
To complete the configuration, you need the following data:
l VLAN that Eth0/0/0 connecting RouterA and the switch belongs to: VLAN 20
l IP address of VLANIF 20: 192.168.2.1/24
l IP address of WAN-side interface Eth0/0/8 of RouterA: 192.168.4.1/24
l Signature file name and storage path: flash:/sacrule.dat
l Traffic classifier name: c1
l Traffic behavior name and action: b1 and deny
l Name of the traffic policy: p1
l Interfaces and directions to which the traffic policy is applied: Eth0/0/8 and VLANIF 20,
and inbound direction
Procedure
Step 1 Create a VLAN and configure interfaces.
# Create VLAN 20 on RouterA.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] vlan 20
# Configure Eth0/0/0 as a trunk interface, and add it to VLAN 20.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] port link-type trunk
[RouterA-Ethernet0/0/0] port trunk allow-pass vlan 20
[RouterA-Ethernet0/0/0] quit
NOTE
Configure the interface of the switch connected to RouterA as a trunk interface and add it to VLAN 20.
# Create VLANIF 20 and assign IP address 192.168.2.1/24 to VLANIF 20.
[RouterA] interface vlanif 20
[RouterA-Vlanif20] ip address 192.168.2.1 24
[RouterA-Vlanif20] quit
# Assign IP address 192.168.4.1/24 to Eth0/0/8.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] ip address 192.168.4.1 24
[RouterA-Ethernet0/0/8] quit
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
101
NOTE
Configure RouterB and ensure that there are reachable routes between RouterB and RouterA.
Step 2 Configure SAC.
# Enable SAC on RouterA and load the signature file.
[RouterA] sac enable signature flash:/sacrule.dat
Info: SAC enable successful.
NOTE
Ensure that the signature file has been loaded to the flash memory of RouterA.
# Enable the SAC statistics function on Eth0/0/8 and VLANIF 20.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] sac protocol-statistic enable
[RouterA-Ethernet0/0/8] quit
[RouterA] interface vlanif 20
[RouterA-Vlanif20] sac protocol-statistic enable
[RouterA-Vlanif20] quit
Step 3 Configure a traffic classifier.
# Configure a traffic classifier c1 on RouterA to match the BT protocol.
[RouterA] traffic classifier c1
[RouterA-classifier-c1] if-match app-protocol bittorrent
[RouterA-classifier-c1] quit
Step 4 Configure a traffic behavior.
# Configure a traffic behavior b1 on RouterA to deny packets matching the traffic classifier.
[RouterA] traffic behavior b1
[RouterA-behavior-b1] deny
[RouterA-behavior-b1] quit
Step 5 Configure a traffic policy and apply the traffic policy to Eth0/0/8 and VLANIF 20.
# Create a traffic policy p1 on RouterA and bind the traffic classifier and traffic behavior to the
traffic policy.
[RouterA] traffic policy p1
[RouterA-trafficpolicy-p1] classifier c1 behavior b1
[RouterA-trafficpolicy-p1] quit
# Apply the traffic policy p1 to the inbound direction of Eth0/0/8 and VLANIF 20.
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] traffic-policy p1 inbound
[RouterA-Ethernet0/0/8] quit
[RouterA] interface vlanif 20
[RouterA-Vlanif20] traffic-policy p1 inbound
[RouterA-Vlanif20] quit
Step 6 Verify the configuration.
# View the interface configuration on RouterA.
[RouterA] interface ethernet 0/0/0
[RouterA-Ethernet0/0/0] display this
#
interface Ethernet0/0/0
port link-type trunk
port trunk allow-pass vlan 20
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
102
#
return
[RouterA-Ethernet0/0/0] quit
[RouterA] interface vlanif 20
[RouterA-Vlanif20] display this
#

interface
Vlanif20

ip address 192.168.2.1
255.255.255.0

sac protocol-statistic
enable

traffic-policy p1
inbound

#

return
[RouterA-Vlanif20] quit
[RouterA] interface ethernet 0/0/8
[RouterA-Ethernet0/0/8] display this
#
interfaceEthernet0/0/8
ip address 192.168.4.1
255.255.255.0
sac protocol-statistic enable
traffic-policy p1 inbound
#
return
[RouterA-Ethernet0/0/8] quit
# View the traffic policy configuration.
[RouterA] display traffic policy user-defined
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: OR
Behavior: b1
Deny
# View the configuration of the traffic classifier c1.
[RouterA] display traffic classifier user-defined c1
User Defined Classifier Information:
Classifier: c1
Operator: OR
Rule(s) : if-match app-protocol name bittorrent
----End
Configuration Files
l Configuration file of RouterA
#
sysname RouterA
#
vlan batch
20
#
sac enable signature flash:/
sacrule.dat
#
traffic classifier c1 operator
or
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
103
if-match app-protocol
bittorrent
#
traffic behavior
b1

deny
#

traffic policy
p1
classifier c1 behavior
b1
#
interface
Vlanif20
ip address 192.168.2.1
255.255.255.0
sac protocol-statistic
enable

traffic-policy p1
inbound

#
interface Ethernet0/0/0
port link-type
trunk
port trunk allow-pass vlan
20
#
interface Ethernet0/0/8
ip address 192.168.4.1
255.255.255.0
sac protocol-statistic
enable
traffic-policy p1
inbound
#
return
Huawei AR150&200 Series Enterprise Routers
Configuration Guide - QoS 2 Traffic Policy Configuration
Issue 02 (2012-03-30) Huawei Proprietary and Confidential
Copyright Huawei Technologies Co., Ltd.
104

You might also like