0% found this document useful (0 votes)
135 views

Huawei Qos Guide

Uploaded by

shishiohn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
135 views

Huawei Qos Guide

Uploaded by

shishiohn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 146

Quidway S5700 Series Ethernet Switches

V100R006C01

Configuration Guide - QoS

Issue 01
Date 2011-10-26

HUAWEI TECHNOLOGIES CO., LTD.


Copyright © Huawei Technologies Co., Ltd. 2011. 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: [email protected]

Issue 01 (2011-10-26) Huawei Proprietary and Confidential i


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS About This Document

About This Document

Intended Audience
This document provides the basic concepts, configuration procedures, and configuration
examples in different application scenarios of the QoS supported by the S5700.

This document describes how to configure the QoS.

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

Indicates a hazard with a high level of risk, which if not


avoided, will result in death or serious injury.
DANGER

Indicates a hazard with a medium or low level of risk, which


if not avoided, could result in minor or moderate injury.
WARNING

Indicates a potentially hazardous situation, which if not


avoided, could result in equipment damage, data loss,
CAUTION
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.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential ii


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS About This Document

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.

Change History
Updates between document issues are cumulative. Therefore, the latest document issue contains
all updates made in previous issues.

Changes in Issue 01 (2011-10-26)


Initial commercial release.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential iii


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS Contents

Contents

About This Document.....................................................................................................................ii


1 Class-based QoS Configuration.................................................................................................1
1.1 Introduction to Class-based QoS........................................................................................................................3
1.2 Class-based QoS Features Supported by the S5700SI or S5700EI....................................................................3
1.3 Class-based QoS Features Supported by the S5700HI and S5706.....................................................................6
1.4 Configuring Priority Mapping Based on Simple Traffic Classification on the S5700SI or S5700EI................9
1.4.1 Establishing the Configuration Task.........................................................................................................9
1.4.2 Configuring an Interface to Trust the Priority of Packets........................................................................10
1.4.3 (Optional) Setting the Default 802.1p Priority of an Interface................................................................11
1.4.4 Configuring the Mapping Between DSCP Priorities and Other Priorities..............................................11
1.4.5 Configuring IP Precedence Mappings.....................................................................................................12
1.4.6 (Optional) Configuring the Mapping Between Local Precedences and Queues.....................................12
1.4.7 Checking the Configuration.....................................................................................................................13
1.5 Configuring Priority Mapping Based on Simple Traffic Classification on the S5700HI or S5706.................14
1.5.1 Establishing the Configuration Task.......................................................................................................14
1.5.2 Configuring an Interface to Trust the Priority of Packets........................................................................15
1.5.3 (Optional) Setting the Default 802.1p Priority of an Interface................................................................16
1.5.4 Creating a DiffServ Domain and Configuring Priority Mapping............................................................16
1.5.5 Applying a DiffServ Domain..................................................................................................................18
1.5.6 Checking the Configuration.....................................................................................................................19
1.6 Creating a Traffic Policy Based on Complex Traffic Classification................................................................19
1.6.1 Establishing the Configuration Task.......................................................................................................19
1.6.2 Configuring Complex Traffic Classification...........................................................................................20
1.6.3 Configuring a Traffic Behavior...............................................................................................................27
1.6.4 Configuring a Traffic Policy....................................................................................................................33
1.6.5 Applying the Traffic Policy.....................................................................................................................34
1.6.6 Checking the Configuration.....................................................................................................................35
1.7 Configuring a Traffic Policy by Using Simplified QoS Commands................................................................36
1.7.1 Establishing the Configuration Task.......................................................................................................36
1.7.2 Configuring Traffic Policing for the Traffic That Matches an ACL Rule on the S5700SI.....................37
1.7.3 Configuring Traffic Policing for the Traffic That Matches an ACL Rule on the S5700EI, S5700HI or
S5706................................................................................................................................................................40
1.7.4 Filtering the Traffic That Matches an ACL Rule....................................................................................42

Issue 01 (2011-10-26) Huawei Proprietary and Confidential iv


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS Contents

1.7.5 Re-marking the Traffic That Matches an ACL Rule...............................................................................44


1.7.6 Mirroring Traffic That Matches an ACL Rule........................................................................................46
1.7.7 Collecting Statistics on the Traffic That Matches an ACL Rule.............................................................47
1.7.8 Redirecting the Traffic That Matches an ACL Rule on the S5700SI or S5706......................................49
1.7.9 Redirecting the Traffic That Matches an ACL Rule (S5700EI, S5700HI).............................................51
1.8 Maintaining Class-based QoS..........................................................................................................................52
1.8.1 Displaying the Flow-based Traffic Statistics...........................................................................................52
1.8.2 Clearing the Flow-based Traffic Statistics..............................................................................................52
1.9 Configuration Examples...................................................................................................................................53
1.9.1 Example for Configuring Priority Mapping Based on Simple Traffic Classification on the S5700SI or
S5700EI............................................................................................................................................................53
1.9.2 Example for Configuring Priority Mapping Based on Simple Traffic Classification on the S5700HI or
S5706................................................................................................................................................................56
1.9.3 Example for Re-marking the Priorities Based on Complex Traffic Classification.................................59
1.9.4 Example for Configuring Policy-based Routing.....................................................................................63
1.9.5 Example for Configuring Traffic Statistics Based on Complex Traffic Classification...........................67

2 Traffic Policing and Traffic Shaping Configuration............................................................70


2.1 Traffic Policing and Traffic Shaping Overview...............................................................................................71
2.1.1 Traffic Policing........................................................................................................................................71
2.1.2 Traffic Shaping........................................................................................................................................73
2.2 Configuring Traffic Policing Based on an Interface.........................................................................................74
2.2.1 Establishing the Configuration Task.......................................................................................................74
2.2.2 Limiting the Rate of Traffic on the Interface...........................................................................................74
2.2.3 Configuring the Rate Limit on the Management Interface......................................................................75
2.2.4 Checking the Configuration.....................................................................................................................76
2.3 Configuring Traffic Policing Based on a Traffic Classifier.............................................................................76
2.3.1 Establishing the Configuration Task.......................................................................................................76
2.3.2 Configuring Complex Traffic Classification...........................................................................................77
2.3.3 Configuring a Traffic Policing Action on the S5700SI or S5700EI........................................................77
2.3.4 Configuring a Traffic Policing Action on the S5700HI and S5706........................................................78
2.3.5 Creating a Traffic Policy.........................................................................................................................79
2.3.6 Applying the Traffic Policy.....................................................................................................................80
2.3.7 Checking the Configuration.....................................................................................................................81
2.4 Configuring Traffic Shaping............................................................................................................................82
2.4.1 Establishing the Configuration Task.......................................................................................................82
2.4.2 Configuring Traffic Shaping on an Interface...........................................................................................83
2.4.3 (Optional) Setting the Length of the Interface Queue.............................................................................84
2.4.4 Configuring Traffic Shaping in an Interface Queue................................................................................85
2.4.5 Checking the Configuration.....................................................................................................................86
2.5 Maintaining Traffic Policing and Traffic Shaping...........................................................................................87
2.5.1 Displaying the Traffic Statistics..............................................................................................................87
2.5.2 Displaying the Maximum Length of a Queue.........................................................................................88
2.5.3 Checking the Usage of the Queue...........................................................................................................88

Issue 01 (2011-10-26) Huawei Proprietary and Confidential v


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS Contents

2.5.4 Clearing the Traffic Statistics..................................................................................................................88


2.6 Configuration Examples...................................................................................................................................89
2.6.1 Example for Configuring Traffic Policing Based on an Interface...........................................................89
2.6.2 Example for Configuring Traffic Policing Based on a Traffic Classifier...............................................92
2.6.3 Example for Configuring Hierarchical Traffic Policing on the S5700HI or S5706................................96
2.6.4 Example for Configuring Traffic Shaping on the S5700EI...................................................................102
2.6.5 Example for Configuring Traffic Shaping on the S5700SI...................................................................105

3 Congestion Avoidance and Congestion Management Configuration............................109


3.1 Overview of Congestion Avoidance and Congestion Management...............................................................110
3.1.1 Congestion Avoidance...........................................................................................................................110
3.1.2 Congestion Management.......................................................................................................................111
3.2 Configuring Congestion Avoidance on the S5700SI or S5700EI..................................................................112
3.2.1 Establishing the Configuration Task.....................................................................................................112
3.2.2 (Optional) Setting the Length of the Interface Queue...........................................................................113
3.2.3 (Optional) Configuring the CFI Field as the Internal Drop Priority......................................................114
3.2.4 Setting SRED Parameters......................................................................................................................115
3.2.5 Checking the Configuration...................................................................................................................116
3.3 Configuring Congestion Avoidance on the S5700HI and S5706...................................................................116
3.3.1 Establishing the Configuration Task.....................................................................................................116
3.3.2 (Optional) Setting the Length of the Interface Queue...........................................................................117
3.3.3 (Optional) Configuring the CFI Field as the Internal Drop Priority......................................................118
3.3.4 Creating a WRED Drop Profile.............................................................................................................118
3.3.5 Applying the WRED Drop Profile........................................................................................................119
3.3.6 Checking the Configuration...................................................................................................................121
3.4 Configuring Congestion Management............................................................................................................121
3.4.1 Establishing the Configuration Task.....................................................................................................121
3.4.2 (Optional) Setting the Length of the Interface Queue...........................................................................122
3.4.3 Setting the Scheduling Mode for an Interface Queue............................................................................123
3.4.4 Checking the Configuration...................................................................................................................126
3.5 Maintaining Congestion Avoidance and Congestion Management...............................................................127
3.5.1 Displaying the Queue-based Statistics..................................................................................................127
3.5.2 Clearing the Queue-based Statistics......................................................................................................127
3.6 Configuration Examples.................................................................................................................................128
3.6.1 Example for Configuring Congestion Management on the S5700SI....................................................128
3.6.2 Example for Configuring Congestion Avoidance and Congestion Management on the S5700EI........131
3.6.3 Example for Configuring Congestion Avoidance and Congestion Management on the S5700HI or S5706
........................................................................................................................................................................134

Issue 01 (2011-10-26) Huawei Proprietary and Confidential vi


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1 Class-based QoS Configuration

About This Chapter

This chapter describes the basic concepts of the traffic classifier, traffic behavior, traffic policy,
and priority mapping, and configuration methods and configuration examples of the traffic
policy based on complex traffic classification and priority mapping based on simple traffic
classification.

1.1 Introduction to Class-based QoS


Class-based QoS is used to classify packets sharing common features into one class and provide
the same QoS service for traffic of the same type by matching packets with certain rules. In this
manner, differentiated services are provided.
1.2 Class-based QoS Features Supported by the S5700SI or S5700EI
The S5700 supports simple traffic classification, complex traffic classification, and priority
mapping.
1.3 Class-based QoS Features Supported by the S5700HI and S5706
The S5700 supports simple traffic classification, complex traffic classification, and priority
mapping.
1.4 Configuring Priority Mapping Based on Simple Traffic Classification on the S5700SI or
S5700EI
After priority mapping based on simple traffic classification is configured, the S5700 maps
priorities of packets to PHBs and colors to provide differentiated services.
1.5 Configuring Priority Mapping Based on Simple Traffic Classification on the S5700HI or
S5706
Priority mapping based on simple traffic classification maps priorities of packets to PHBs and
colors to provide differentiated services.
1.6 Creating a Traffic Policy Based on Complex Traffic Classification
After the traffic policy based on complex traffic classification is configured, the S5700 classifies
packets according to the priority of packets and quintuple information. Then the S5700 takes
different traffic actions for packets matching classification conditions, such as permit/deny, re-
marking, and redirection.
1.7 Configuring a Traffic Policy by Using Simplified QoS Commands
By using simplified QoS commands, you can configure traffic monitoring, traffic statistics,
traffic redirection, traffic re-marking, and traffic mirroring. Compared with common QoS

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 1


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

commands, simplified QoS commands make the configuration procedures easier because you
do not need to create traffic classifiers, traffic behaviors, and traffic policies independently.
1.8 Maintaining Class-based QoS
If the traffic statistics function is enabled, you can view and clear the flow-based traffic statistics.
1.9 Configuration Examples
This section provides several configuration examples of class-based QoS.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 2


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.1 Introduction to Class-based QoS


Class-based QoS is used to classify packets sharing common features into one class and provide
the same QoS service for traffic of the same type by matching packets with certain rules. In this
manner, differentiated services are provided.

1.2 Class-based QoS Features Supported by the S5700SI or


S5700EI
The S5700 supports simple traffic classification, complex traffic classification, and priority
mapping.

Simple Traffic Classification


On the S5700, you can perform simple traffic classification for packets based on the mappings
between priorities of packets and Per-Hop Behaviors (PHBs). If packets come from an upstream
device, the S5700 maps priorities of the packets to PHBs and colors. On the S5700, congestion
management is performed for packets based on PHBs of packets and congestion avoidance is
performed for packets based on colors of packets. The downstream device provides QoS services
based on priorities of packets.
Simple traffic classification is based on:
l DiffServ Code Point (DSCP) priority in IP packets
l IP precedence in IP packets
l 802.1p priority in VLAN packets
l MPLS EXP priority in VLAN packets

NOTE

The S5700SI does not support simple traffic classification according to the CFI of VLAN packets.

Complex Traffic Classification


You can perform complex traffic classification based on Layer 2 or Layer 3 information in
packets or by using access control lists (ACLs). You can bind a traffic classifier to a traffic
behavior to process packets matching the traffic classifier.
The traffic behavior used is related to the current phase of packets and the current load of a
network. For example, when packets reach the S5700, the S5700 performs traffic policing and
access control for the packets based on the committed information rate (CIR); when packets exit
the S5700, the S5700 shapes the traffic of packets and re-marks the priorities of packets.
Complex traffic classification is based on:
l 802.1p priority in VLAN packets
l VLAN ID in packets
l 802.1p priority in CVLAN packets
l CVLAN ID in CVLAN packets
l Double tags in VLAN packets

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 3


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

l Inbound or outbound interface


l IP precedence in IP packets
l DSCP priority in IP packets
l SYN Flag field in Transmission Control Protocol (TCP) packets
l Source MAC address
l Destination MAC address
l Protocol type field encapsulated in Layer 2 packets
l Layer 3 protocol type
l ACL
l Discarded packets
NOTE

l The S5700SI does not support complex traffic classification based on the inner 802.1p priority in VLAN
packets, double tags, the outbound interface and discarded packets.

Priority Mapping
Different packets carry different precedence fields. For example, VLAN packets carry the 802.1p
field, and IP packets carry the DSCP field or IP precedence. 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, when packets reach the S5700, the S5700 maps packet
priorities to 802.1p priorities. The S5700 then maps 802.1p priorities in packets or the default
802.1p priority of an interface to local priorities, determines the queues that packets enter based
on the mappings between internal priorities and queues, and performs traffic shaping and queue
scheduling. When packets are sent out from the S5700, the S5700 re-marks priorities of packets
so that the downstream device can provide differentiated QoS based on packet priorities.

Table 1-1 and Table 1-2 list the mappings between 802.1p priorities and internal priorities, and
between internal priorities and queues.

Table 1-1 Mappings between 802.1p priorities and internal priorities

802.1p Priority Internal Priority

0 BE

1 AF1

2 AF2

3 AF3

4 AF4

5 EF

6 CS6

7 CS7

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 4


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Table 1-2 Mappings between internal priorities and queues

Internal Priority Queue Index

BE 0

AF1 1

AF2 2

AF3 3

AF4 4

EF 5

CS6 6

CS7 7

NOTE

The color is used to determine whether the packets are discarded, and is independent of the mapping of
internal priorities and queues.

Traffic Behavior
Complex traffic classification is used to provide differentiated services. Traffic classification
takes effect only when it is associated with traffic control or resource allocation actions.

The S5700 supports the combinations of the following traffic actions:

l Deny/Permit
This traffic control action is the simplest. The S5700 controls network traffic by forwarding
or discarding packets.
l Re-marking
This traffic control action is used to set the precedence field in a packet. Packets carry
different precedence fields on various networks. For example, packets carry the 802.1p
field on a VLAN network, and the DSCP field on an IP network. Therefore, the S5700 is
required to re-mark the precedence fields of packets according to the network type.
Generally, a device at the border of a network needs to mark the precedence fields of
incoming packets; the device at the core of a network provides corresponding QoS services
based on the precedence fields marked by the border device, or re-marks the precedence
fields based on its configuration rule.
l Redirection
NOTE

TheS5700SI does not support redirection.


This traffic control action indicates that the S5700 does not forward packets according to
the destination address but redirects them to the CPU, the specified interface, or the
specified next hop address. The S5700 can specify up to four next hops.
By using redirection, you can implement policy-based routing (PBR). The PBR is static.
When no next hop is available, the S5700 forwards the packets to the original destination.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 5


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The S5700 can redirect only incoming packets.


l Traffic policing
It is a traffic control action used to limit traffic and resources by monitoring the rate limit
of the traffic. By using traffic policing, the S5700 can discard, and re-mark the colors and
CoS of packets whose rate exceeds the rate limit.
Here, traffic policing based on a traffic Classification is implemented. For details about
traffic policing, see 2 Traffic Policing and Traffic Shaping Configuration.
l Flow mirroring
Flow mirroring is used to copy the specified data packets to a specified destination to locate
faults on a network.
For details about flow mirroring, see Mirroring in the Quidway S5700 Series Ethernet
Switches Configuration Guide - Device Management.
l Traffic statistics
The traffic statistics action is used to collect data packets of specified service flows, that
is, data packets matching complex traffic classification rules on the S5700.

Traffic Policy
A traffic policy is a QoS policy in which traffic classifiers are bound to traffic behaviors. You
can bind a specified traffic classifier to a traffic behavior through the traffic policy to better
perform QoS.

1.3 Class-based QoS Features Supported by the S5700HI and


S5706
The S5700 supports simple traffic classification, complex traffic classification, and priority
mapping.

Simple Traffic Classification


On the S5700, you can perform simple traffic classification for packets based on the mappings
between priorities of packets and Per-Hop Behaviors (PHBs) defined in a Differentiated Services
(DiffServ) domain. If packets come from an upstream device, the S5700 binds a DiffServ domain
to the inbound interface. In the DiffServ domain, the S5700 maps priorities of packets to PHBs
and colors. On the S5700, congestion management is performed for packets based on PHBs of
packets and congestion avoidance is performed for packets based on colors of packets. If packets
are sent to a downstream device, the S5700 binds a DiffServ domain to the outbound interface.
In the DiffServ domain, the S5700 maps PHBs and colors of packets to priorities so that the
downstream device provides QoS services based on priorities of packets.
Simple traffic classification is based on:
l 802.1p priority in VLAN packets
l DiffServ Code Point (DSCP) priority in IP packets

Complex Traffic Classification


Complex traffic classification is performed based on Layer 2 or Layer 3 information in packets
or by using access control lists (ACLs). You can bind a traffic classifier to a traffic behavior to
process packets matching the traffic classifier.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 6


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

A traffic behavior is related to the current phase of packets and the current load of a network.
For example, when packets enter a node, the S5700 performs traffic policing and access control
for the packets based on the committed information rate (CIR). When packets leave a node, the
S5700 shapes the traffic of packets and re-marks the priorities of packets.

Complex traffic classification is based on:


l 802.1p priority in VLAN packets
l VLAN ID in packets
l 802.1p priority in CVLAN packets
l CVLAN ID in CVLAN packets
l Double tags of VLAN packets
l Inbound or outbound interface
l IP precedence in IP packets
l DSCP priority in IP packets
l SYN Flag field in Transmission Control Protocol (TCP) packets
l Source MAC address
l Destination MAC address
l Protocol type field encapsulated in Layer 2 packets
l Layer 3 protocol type
l ACL
l Discarded packets

Priority Mapping
Different packets carry different precedence fields. For example, VLAN packets carry the 802.1p
field, and IP packets carry the DSCP field or IP precedence. 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, when packets reach the S5700, the S5700 maps priorities
in packets or the default 802.1p priority of an interface to local priorities. The S5700 then
determines the queues that packets enter based on the mappings between internal priorities and
queues and performs traffic shaping, congestion avoidance, and queue scheduling. In addition,
the S5700 can re-mark priorities of outgoing packets so that the downstream device can provide
differentiated QoS based on packet priorities.

Table 1-3 shows the mappings between internal priorities and queues.

Table 1-3 Mappings between internal priorities and queues

Internal Priority Queue Index

BE 0

AF1 1

AF2 2

AF3 3

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 7


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Internal Priority Queue Index

AF4 4

EF 5

CS6 6

CS7 7

NOTE

A color is used to determine whether the packets are discarded, and is independent of the mappings between
internal priorities and queues.

Traffic Behavior
Complex traffic classification is required to provide differentiated services. Complex traffic
classification takes effect only when it is associated with a traffic control action or a resource
allocation action.

The S5700 provides the following traffic behaviors based on complex traffic classification:

l Deny/Permit
The permit/deny action is the simplest traffic control action. The S5700 controls network
traffic by forwarding or discarding packets.
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 and the ToS field on an IP network. Therefore, the S5700 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 the precedence fields of
incoming packets; the device at 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 CPU, the specified interface or the
specified next hop address. The S5700 does not forward packets based on the destination
IP address. The S5700 can specify a maximum of four next hops.
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 S5700 forwards packets based
on the original forwarding path.
The S5700 can redirect only incoming packets.
l Traffic policing
This traffic control action limits the volume of traffic and the resources used by the traffic
to monitor the traffic rate. By using traffic policing, the S5700 can discard, and re-mark
the colors and CoS of packets whose rate exceeds the rate limit.
Here, traffic policing based on traffic classification is implemented. For details about traffic
policing, see 2 Traffic Policing and Traffic Shaping Configuration.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 8


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

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 about flow mirroring, see Mirroring in the Quidway S5700 Series Ethernet
Switches Configuration Guide - Device Management.
l Traffic statistics
This traffic control action collects data packets matching defined complex traffic
classification rules on the S5700.
l Disabling MAC address learning
After MAC address learning is disabled, the S5700 does not learn source MAC addresses
of the packets matching traffic classification rules.
On a stable network where MAC addresses of packets seldom change, disabling MAC
address learning can reduce the size of the MAC address table and improve device
performance. Unauthorized users may change MAC addresses frequently to attack a
network. To prevent MAC address overflow and protect the network from such attacks,
disable MAC address learning.

Traffic Policy
A traffic policy is a QoS policy configured by binding traffic classifiers to traffic behaviors. You
can associate a traffic classifier with a traffic behavior in a traffic policy.

1.4 Configuring Priority Mapping Based on Simple Traffic


Classification on the S5700SI or S5700EI
After priority mapping based on simple traffic classification is configured, the S5700 maps
priorities of packets to PHBs and colors to provide differentiated services.

1.4.1 Establishing the Configuration Task


Before configuring priority mapping based on simple traffic classification, familiarize yourself
with the applicable environment, complete the pre-configuration tasks, and obtain the required
data. This helps you complete the configuration task quickly and accurately.

Applicable Environment
When packets enter the S5700, the S5700 maps DSCP priorities or IP priorities to 802.1p
priorities according to the mapping and determines the queue that packets enter.

Pre-configuration Tasks
Before configuring priority mapping based on simple traffic classification, complete the
following tasks:

l Configuring the physical parameters of interfaces


l Setting link layer attributes of interfaces

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 9


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Data Preparation
To configure priority mapping based on simple traffic classification, you need the following
data.

No. Data

1 Types and numbers of the interface.

2 Input DSCP priority, output 802.1p priority, drop precedence, or new DSCP priority.

3 Input IP priority, output 802.1p priority, or IP priority.

1.4.2 Configuring an Interface to Trust the Priority of Packets


After an interface is configured to trust the priority of packets, the S5700 performs priority
mapping based on the specified priority.

Context
The S5700 provides the following priority trust modes:
l Trusting the 802.1p priority of packets
The inbound interface maps 802.1p priorities of tagged packets to internal priorities based
on the default mapping; the S5700 adds the default 802.1p priority of the interface to
untagged packets and maps the default 802.1p priority of the packets to internal priorities.
l Trusting the DSCP priority of packets
The system searches the DSCP priority mapping table based on DSCP priorities in packets,
re-marks 802.1p priorities or DSCP priorities in packets, or maps DSCP priorities in packets
to drop priorities.
l Trusting the IP priority of packets
The system searches the IP priority mapping table based on IP priorities in packets and re-
marks 802.1p priorities or IP priorities in packets.

If you need to set the same trust priority on multiple interfaces, you can perform the configuration
on a port group to simplify the configuration.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The interface view is displayed.

Or run the port-group port-group-name command to display the port group view.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 10


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

l The interface type can be GE, XGE, or Eth-Trunk.


l You need to create a port group before performing this task. For details on how to create a port group,
see (Optional) Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches
Configuration Guide - Ethernet.

Step 3 Run:
trust { 8021p | dscp | ip-precedence }

The interface is configured to trust the priority of packets.


By default, priorities of packets are not trusted. Packets enter queue 0 and their 802.1p priorities
are set to 0.

----End

1.4.3 (Optional) Setting the Default 802.1p Priority of an Interface


After the default 802.1p priority is set on an interface, if the interface is configured to trust 802.1p
priorities of packets, the S5700 adds the default 802.1p priority to the received untagged packets
and maps the default 802.1p priority to the internal priority.

Context
If an interface receives untagged packets, it needs to add the default VLAN ID and 802.1p priority
to the packets before forwarding them.
If an interface is configured to trust the 802.1p priority of packets, the S5700 uses the default
802.1p priority of the interface when the interface receives untagged packets.

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 default 802.1p priority of the interface is set.


By default, the 802.1p priority of an interface is 0.

----End

1.4.4 Configuring the Mapping Between DSCP Priorities and Other


Priorities
DSCP priorities in IP packets are used as the basis for the S5700 to perform simple traffic
classification. You can flexibly select the required QoS service by configuring the mappings
between DSCP priorities and other priorities.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 11


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Context
The S5700 can map DSCP priorities to 802.1p priorities, drop priorities, or new DSCP priorities.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
qos map-table { dscp-dot1p | dscp-dp | dscp-dscp }

The DSCP mapping table view is displayed.

Step 3 Run:
input { input-value1 [ to input-value2 ] &<1-10> } output output-value

The mapping in the DSCP table is set.

----End

1.4.5 Configuring IP Precedence Mappings

Context
To re-mark IP precedences of received packets with 802.1p priorities or new IP precedences on
the S5700, configure an interface to trust IP precedences and configure mappings between IP
precedences and other priorities.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
qos map-table { ip-pre-dot1p | ip-pre-ip-pre }

The IP precedence mapping table view is displayed.

Step 3 Run:
input { input-value1 [ to input-value2 ] output output-value }

The mapping in the IP precedence table is configured.

----End

1.4.6 (Optional) Configuring the Mapping Between Local


Precedences and Queues
By configuring the mapping between local precedences and queues, the S5700 sends packets to
the specified queue according to the mapping between local precedences and queues.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 12


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
qos local-precedence-queue-map local-precedence queue-index

The mapping between a local precedence and a queue is configured.

The mapping between the local precedence and queues takes effect only on the traffic on the
inbound interface. That is, the S5700 puts traffic into queues based on the mapping.

By default, the mapping between a local precedence and a queue is shown in the following table.

Table 1-4 Mapping between a local precedence and a queue

Local Precedence Queue Index

be 0

af1 1

af2 2

af3 3

af4 4

ef 5

cs6 6

cs7 7

----End

1.4.7 Checking the Configuration


After priority mapping based on simple traffic classification is configured, you can view the
mapping between priorities in the priority mapping table.

Prerequisite
All the configurations of priority mapping based on simple traffic classification are complete.

Procedure
l Run the display qos map-table [ dscp-dot1p | dscp-dp | dscp-dscp | ip-pre-dot1p | ip-
pre-ip-pre ] command to check the mapping between priorities.
l Run the display qos local-precedence-queue-map command to check the mapping
between local precedences and queues.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 13


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.5 Configuring Priority Mapping Based on Simple Traffic


Classification on the S5700HI or S5706
Priority mapping based on simple traffic classification maps priorities of packets to PHBs and
colors to provide differentiated services.

1.5.1 Establishing the Configuration Task


Before configuring priority mapping based on simple traffic classification, 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 packets come from an upstream device, you can classify them according to the precedence
fields in the packets, such as the 802.1p priority or DSCP priority. In a DiffServ domain, you
need to define the mapping from priorities of packets to PHBs and colors to classify packets.
After the DiffServ domain is bound to an inbound interface, the QoS mechanism performs
congestion management and congestion avoidance according to PHBs and colors of packets on
an outbound interface.

When packets are sent to a downstream device, you can classify them based on PHBs and colors
of the packets. In a DiffServ domain, define the mapping from PHBs and colors of packets to
priorities to classify packets. After the DiffServ domain is bound to an outbound interface, a
downstream device provides QoS services based on packet priorities.

Pre-configuration Tasks
Before configuring priority mapping based on simple traffic classification, complete the
following task:
l Adding an interface that packets pass to a specified VLAN

Data Preparation
To configure priority mapping based on simple traffic classification, you need the following
data.

No. Data

1 Name of a DiffServ domain

2 802.1p priorities of incoming or outgoing packets in a VLAN, DSCP priorities, PHBs,


and colors of incoming or outgoing IP packets

3 Type and number of the interface bound to a DiffServ domain

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 14


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.5.2 Configuring an Interface to Trust the Priority of Packets


After an interface is configured to trust the priority of packets, the S5700 performs PHB mapping
according to the specified priority.

Context
The S5700 provides the following priority trust modes:
l Trusting 802.1p priorities
If packets carry a VLAN tag, the S5700 searches for the mapping table of 802.1p priorities
and internal priorities and marks internal priorities for the packets based on the 802.1p
priorities of packets. If packets do not carry a VLAN tag, the S5700 uses the default 802.1p
priority of an interface and searches for the mapping table of 802.1p priorities and internal
priorities based on the default 802.1p priority of an interface.
l Trusting DSCP priorities
The S5700 searches for the mapping table of DSCP priorities and internal priorities and
marks internal priorities for the packets based on DSCP priorities of packets.
To set the same trust priority on multiple interfaces, perform the configuration on the port group.

NOTE

Internal priorities are represented by CoS and colors defined in the DiffServ model.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The interface view is displayed.


Or, run:
port-group port-group-name

The port group view is displayed.

NOTE

l The interface type can be GE, XGE, or Eth-Trunk.


l Create a port group before performing this task. For details on how to create a port group, see (Optional)
Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration Guide
- Ethernet.

Step 3 Run:
trust { 8021p { inner | outer } | dscp }

The interface is configured to trust packet priorities.


By default, an interface trusts 802.1p priorities in outer VLAN tags of packets.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 15


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.5.3 (Optional) Setting the Default 802.1p Priority of an Interface


After the default 802.1p priority of an interface is set, the S5700 performs PHB mapping for the
received untagged packets based on the default 802.1p priority if the interface is configured to
trust 802.1p priorities of packets.

Context
If an interface receives untagged packets, it needs to add the default VLAN ID and 802.1p priority
to the packets before forwarding them.

If an interface is configured to trust 802.1p priorities, the S5700 uses the default 802.1p priority
of the interface when the interface receives untagged packets.

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 default 802.1p priority of the interface is set.

By default, the 802.1p priority of an interface is 0.

----End

1.5.4 Creating a DiffServ Domain and Configuring Priority


Mapping
When the S5700 functions as a border node between a DiffServ domain and other networks,
configure mappings between internal priorities (PHBs and colors) and external priorities (such
as 802.1p priorities, DSCP priorities, and EXP priorities).

Context
A DiffServ domain is composed of a group of interconnected DiffServ nodes that use the same
service policy and PHBs.

In the DiffServ domain, the S5700 maps priorities of incoming packets to PHBs and colors. The
S5700 performs congestion management for packets based on PHBs of packets and congestion
avoidance for packets based on colors of packets. If packets are sent to a downstream device,
the S5700 binds a DiffServ domain to the outbound interface. In the DiffServ domain, the
S5700 maps PHBs and colors of packets to priorities so that the downstream device provides
QoS services based on priorities of packets.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 16


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
diffserv domain { default | ds-domain-name }

A DiffServ domain is created and the DiffServ domain view is displayed.

The default DiffServ domain defines the mappings from priorities of packets to PHBs and colors.
You can change the mappings defined in the default DiffServ domain, but cannot delete the
default DiffServ domain.

In addition to the default DiffServ domain, a maximum of seven domains can be created on an
S5700.

Step 3 Run the following commands as required.


l To map 802.1p priorities of packets in a VLAN to PHBs and colors, run the following
command on the inbound interface:
8021p-inbound 8021p-value phb service-class [ color ]

l To map PHBs and colors of packets to 802.1p priorities of VLAN packets, run the following
command on the outbound interface:
8021p-outbound service-class color map 8021p-value

l To map DSCP priorities of IP packets to PHBs and colors, run the following command on
the inbound interface:
ip-dscp-inbound dscp-value phb service-class [ color ]

l To map PHBs and colors to DSCP priorities of IP packets, run the following command on
the outbound interface:
ip-dscp-outbound service-class color map dscp-value

l To map EXP priorities of MPLS packets to PHBs and colors, run the following command
on the inbound interface:
mpls-exp-inbound exp-value phb service-class [ color ]

NOTE

The mpls-exp-inbound command is only supported by the S5700HI.


l To map PHBs and colors of MPLS packets to EXP priorities, run the following command
on the outbound interface:
mpls-exp-outbound service-class color map exp-value

NOTE

The mpls-exp-outbound command is only supported by the S5700HI.

For details about the mappings from the default 802.1p priorities to PHBs and colors, from PHBs
and colors to 802.1p priorities, from DSCP priorities to PHBs and colors, from PHBs and colors
to DSCP priorities, from EXP priorities to PHBs and colors, and from PHBs and colors to EXP
priorities, see the 8021p-inbound, 8021p-outbound, ip-dscp-inbound, ip-dscp-outbound, mpls-
exp-inbound, and mpls-exp-outbound commands.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 17


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.5.5 Applying a DiffServ Domain


After the DiffServ domain is applied to a specified interface, the S5700 performs PHB mapping
for packets passing through the interface.

Context
To map priorities of packets coming from an upstream device to PHBs and colors based on the
mappings defined in a DiffServ domain, bind the DiffServ domain to the inbound interface. The
system maps priorities of packets to PHBs and colors based on the mappings defined in the
DiffServ domain.
To map PHBs to priorities of packets sent to a downstream device based on the mappings defined
in a DiffServ domain, bind the DiffServ domain to the outbound interface. The system then maps
PHBs and colors to priorities of packets based on the mappings defined in the DiffServ domain.
To bind multiple interfaces to the same DiffServ domain, perform the configuration on the port
group to reduce the workload.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The interface view is displayed.


Or, run:
port-group port-group-name

The port group view is displayed.

NOTE

l The interface type can be GE, XGE, or Eth-Trunk.


l You need to create a port group before performing this task. For details on how to create a port group,
see (Optional) Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches
Configuration Guide - Ethernet.

Step 3 Run:
trust upstream { ds-domain-name | default | none }

The interface is bound to a DiffServ domain.


If the trust upstream none command is run on an interface, the S5700 does not perform priority
mapping for incoming and outgoing packets on the interface.
To delete the DiffServ domain that is bound to an interface, you must first run the undo trust
upstream command to delete the bound DiffServ domain. Then run the trust upstream
command to reconfigure the DiffServ domain.
For details about the mappings from the default 802.1p priorities to PHBs and colors, from PHBs
and colors to 802.1p priorities, from DSCP priorities to PHBs and colors, from PHBs and colors
to DSCP priorities, from EXP priorities to PHBs and colors, and from PHBs and colors to EXP

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 18


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

priorities, see the 8021p-inbound, 8021p-outbound, ip-dscp-inbound, ip-dscp-outbound, mpls-


exp-inbound, and mpls-exp-outbound commands.
Step 4 (Optional) Run:
undo qos phb marking enable

PHB mapping of outgoing packets is disabled.


By default, PHB mapping is enabled on an outbound interface.

----End

1.5.6 Checking the Configuration


After priority mapping based on simple traffic classification is configured, you can view the
mapping between packet priorities and PHBs and the mapping between local precedences and
queues.

Prerequisite
The configurations of priority mapping based on simple traffic classification are complete.

Procedure
l Run the display diffserv domain [ all | name ds-domain-name ] command to check the
configuration of the DiffServ domain.
l Run the display qos local-precedence-queue-map command to check the mapping
between local precedences and queues.
----End

1.6 Creating a Traffic Policy Based on Complex Traffic


Classification
After the traffic policy based on complex traffic classification is configured, the S5700 classifies
packets according to the priority of packets and quintuple information. Then the S5700 takes
different traffic actions for packets matching classification conditions, such as permit/deny, re-
marking, and redirection.

1.6.1 Establishing the Configuration Task


Before configuring the traffic policy based on complex traffic classification, familiarize yourself
with the applicable environment, complete the pre-configuration tasks, and obtain the required
data. This helps you complete the configuration task quickly and accurately.

Applicable Environment
At the ingress of a network, the S5700 functions as a border node. To limit the incoming traffic
on a network, the S5700 can provide differentiated services for various services according to
the DSCP field, protocol type, IP address, port number, fragmentation type, and time range of
packets. In this case, you need to create a traffic policy based on complex traffic classification.
Generally, complex traffic classification is configured on a border node, and simple traffic
classification is configured on a core node.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 19


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Pre-configuration Tasks
Before creating a traffic policy based on complex traffic classification, complete the following
tasks:
l Configuring the physical parameters of interfaces
l Setting link layer attributes of interfaces
l Configuring routing protocols to ensure the connectivity of the network
l Configuring ACLs if ACLs are used as matching rules for traffic classification

Data Preparation
To create a traffic policy based on complex traffic classification, you need the following data.

No. Data

1 Name of the traffic classifier and matching rules of the traffic classifier

2 Name of the traffic behavior and related parameters

3 Name of the traffic policy

4 Interface that the traffic policy is applied to and ID of the VLAN

1.6.2 Configuring Complex Traffic Classification


The S5700 can classify traffic according to the ACL, and the Layer 2 information and Layer 3
information in packets.

Creating a Traffic Classifier Based on Layer 2 Information


After traffic classification based on Layer 2 information is configured, the S5700 classifies
packets based on the Layer 2 information including the 802.1p priority, VLAN ID, source/
destination MAC address, incoming/outgoing interface, and Layer 2 protocol type.

Procedure
Step 1 Run:
system-view

The system view is displayed.


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

A traffic classifier based on Layer 2 information is created and the traffic classifier view is
displayed.
The and parameter indicates that the relationship between rules in a traffic classifier is "AND".
That is, the packets match a traffic classifier only when the packets match all non-ACL rules
and an ACL rule in the traffic classifier. The or parameter indicates that the relationship between
rules in a traffic classifier is "OR". That is, the packets match a traffic classifier when the packets
match a rule in the traffic classifier.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 20


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

By default, the relationship between rules in a traffic classifier is AND.

Step 3 Run the following commands as required.


l To define matching rules based on the 802.1p priority in the inner VLAN tag of QinQ packets,
run:
if-match cvlan-8021p { 8021p-value } &<1-8>

l To define matching rules based on the 802.1p priority of packets in a VLAN, run:
if-match 8021p { 8021p-value } &<1-8>

l To define matching rules based on the VLAN ID in the inner VLAN tag or the VLAN IDs
in inner and outer tags of QinQ packets, run:
l (S5700EI, S5700HI, and S5706)(S5700EI)
To define matching rules based on the outer VLAN ID or VLAN IDs of inner and outer tags
of QinQ packets, run:
if-match vlan-id start-vlan-id [ to end-vlan-id ] [ cvlan-id cvlan-id ]

l (S5700SI)
To define matching rules based on the VLAN ID, run:
if-match vlan-id start-vlan-id [ to end-vlan-id ]

l To define matching rules based on discarded packets, run:


if-match discard

NOTE

The S5700SI does not support the if-match discard command.


l To define matching rules based on double tags of QinQ packets, run:
if-match double-tag

NOTE

The S5700SI does not support the if-match double-tag command.


l To define matching rules based on the destination MAC address, run:
if-match destination-mac mac-address [ mac-address-mask ]

l To define matching rules based on the source MAC address, run:


if-match source-mac mac-address [ mac-address-mask ]

l To define matching rules based on the incoming interface, run:


if-match inbound-interface interface-type interface-number

l To define matching rules based on the outgoing interface, run:


if-match outbound-interface interface-type interface-number

NOTE

The S5700SI does not support the if-match outbound-interface command.


l To define matching rules based on the protocol field in the Ethernet frame header, run:
if-match l2-protocol{ arp | ip | mpls | rarp | protocol-value }

l To define matching rules based on all the packets, run:


if-match any

----End

Creating a Traffic Classifier Based on Layer 3 Information


After traffic classification based on Layer 3 information is configured, the S5700 classifies
packets according to Layer 3 information in packets.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 21


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


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

A traffic classifier based on Layer 3 information is created and the traffic classifier view is
displayed.
The and parameter indicates that the relationship between rules in a traffic classifier is AND.
That is, the packets match a traffic classifier only when the packets match all non-ACL rules
and an ACL rule in the traffic classifier. The or parameter indicates that the relationship between
rules in a traffic classifier is OR. That is, the packets match a traffic classifier when the packets
match a rule in the traffic classifier.
By default, the relationship between rules in a traffic classifier is AND.
Step 3 Run the following commands as required.
l To define matching rules based on the DSCP priority of IP packets, run:
if-match dscp dscp-value &<1-8>

l To define matching rules based on the IP priority of IP packets, run:


if-match ip-precedence ip-precedence-value &<1-8>

NOTE

In a traffic classifier where the relationship between rules is AND, the if-match dscp and if-match ip-
precedence commands cannot be used simultaneously.
l To define matching rules based on the Layer 3 protocol type, run:
if-match protocol { ip | ipv6 }

l To define matching rules based on the SYN Flag field of TCP packets, run:
if-match tcp syn-flag syn-flag { syn-flag-value | ack | fin | psh | rst | syn |
urg }

----End

Creating a Traffic Classifier Based on an ACL


After traffic classification based on an ACL is configured, the S5700 classifies packets based
on the ACL.

Context
The S5700 can use an ACL to classify packets based on the IP quintuple.
The S5700 supports basic ACLs, Layer 2 ACLs, user-defined ACLs and advanced ACLs.
l Basic ACLs are used to classify data packets based on the source IP address, fragmentation
flag, and time segment of packets.
l Advanced ACLs are used to classify and define data packets based on the source IP address,
destination IP address, source port number, destination port number, fragmentation flag,
time segment, and protocol type of packets.
l Layer 2 ACLs are used to classify data packets based on the source MAC address and
destination MAC address of packets.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 22


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

l User-defined ACLs process data packets according to the rules defined by users.

Procedure
l Creating a traffic classifier based on a basic ACL
1. Run:
system-view

The system view is displayed.


2. Run:
acl [ number ] basic-acl-number

A basic ACL is created and the ACL view is displayed.


3. (Optional) Run:
step step-value

The step value between ACL rule IDs is set.


4. Run:
rule [ rule-id ] { deny | permit } [ fragment | logging | source { source-
address source-wildcard | any } | time-range time-name ]*

A basic ACL4 rule is created.


5. Run:
quit

Return to the system view.


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

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

The and parameter indicates that the relationship between rules in a traffic classifier
is AND. That is, packets match a traffic classifier only when the packets match all
non-ACL rules and an ACL rule in the traffic classifier. The or parameter indicates
that the relationship between rules in a traffic classifier is OR. That is, packets match
a traffic classifier when the packets match a rule in the traffic classifier.

By default, the relationship between rules in a traffic classifier is AND.


7. Run:
if-match acl basic-acl-number

A traffic classifier based on a basic ACL is created.


l Creating a traffic classifier based on an advanced ACL
1. Run:
system-view

The system view is displayed.


2. Run:
acl [ number ] advanced-acl-number

An advanced ACL is created and the ACL view is displayed.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 23


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

advanced-acl-number specifies the number of an advanced ACL. The value is an integer that
ranges from 3000 to 3999.
3. Run the following commands as required.
– To define an advanced ACL for Genetic Routing Encapsulation (GRE), Internet
Group Management Protocol (IGMP), IP, IPinIP, or Open Shortest Path First
(OSPF) packets, run:
rule [ rule-id ] { deny | permit } { protocol-number | gre | igmp | ip
| ipinip | ospf } [ tos tos ] [ destination { destination-address
destination-wildcard | any } | dscp dscp | fragment | logging |
precedence precedence | source { source-address source-wildcard | any }
| time-range time-name ]*

– To define an advanced ACL for Transmission Control Protocol (TCP) packets,


run:
rule [ rule-id ] { deny | permit } { protocol-number | tcp } [ tos
tos ] [ destination { destination-address destination-wildcard | any }
| destination-port { eq | gt | lt | range } port | dscp dscp |
fragment | precedence precedence | source { source-address source-
wildcard | any } | source-port { eq | gt | lt | range } port | tcp-
flag { tcp-value | ack | fin | psh | rst | syn | urg } * | time-range
time-name ]*

– To define an advanced ACL for User Datagram Protocol (UDP) packets, run:
rule [ rule-id ] { deny | permit } { protocol-number | udp } [ tos
tos ] [ destination { destination-address destination-wildcard | any }
| destination-port { eq | gt | lt | range } port | dscp dscp |
fragment | logging | precedence precedence | source { source-address
source-wildcard | any } | source-port { eq | gt | lt | range } port |
time-range time-name ]*

– To define an advanced ACL for Internet Control Message Protocol (ICMP)


packets, run:
rule [ rule-id ] { deny | permit } { protocol-number | icmp } [ tos
tos ] [ destination { destination-address destination-wildcard | any }
| dscp dscp | fragment | logging | icmp-type { icmp-name | icmp-type
icmp-code } | precedence precedence | source { source-address source-
wildcard | any } | time-range time-name ]*

4. Run:
quit

Return to the system view.


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

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

The and parameter indicates that the relationship between rules in a traffic classifier
is AND. That is, packets match a traffic classifier only when the packets match all
non-ACL rules and an ACL rule in the traffic classifier. The or parameter indicates
that the relationship between rules in a traffic classifier is OR. That is, packets match
a traffic classifier when the packets match a rule in the traffic classifier.

By default, the relationship between rules in a traffic classifier is AND.


6. Run:
if-match acl advanced-acl-number

A traffic classifier based on an advanced ACL is created.


l Creating a traffic classifier based on a Layer 2 ACL

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 24


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1. Run:
system-view

The system view is displayed.


2. Run:
acl [ number ] mac-acl-number

A Layer 2 ACL is created and the ACL view is displayed.

NOTE

mac-acl-number specifies the number of a Layer 2 ACL. The value is an integer that ranges
from 4000 to 4999.
3. (Optional) Run:
step step-value

The step value between ACL rule IDs is set.


4. Run:
(S5700EI or S5700HI)
rule [ rule-id ] { permit | deny } [ { ether-ii | 802.3 | snap } | l2-
protocol type-value [ type-mask ] | destination-mac dest-mac-address
[ dest-mac-mask ] | source-mac source-mac-address [ source-mac-mask ] |
vlan-id vlan-id [ vlan-id-mask ] | 8021p 802.1p-value | cvlan-id cvlan-id
[ cvlan-id-mask ] | cvlan-8021p 802.1p-value | double-tag ] * [ time-
range time-range-name ]

(S5700SI)
rule [ rule-id ] { permit | deny } [ { ether-ii | 802.3 | snap } | l2-
protocol type-value [ type-mask ] | destination-mac dest-mac-address
[ dest-mac-mask ] | source-mac source-mac-address [ source-mac-mask ] |
vlan-id vlan-id [ vlan-id-mask ] | 8021p 802.1p-value ]* [ time-range time-
range-name ]

A Layer 2 ACL rule is created.


5. Run:
quit

Return to the system view.


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

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


The and parameter indicates that the relationship between rules in a traffic classifier
is AND. That is, packets match a traffic classifier only when the packets match all
non-ACL rules and an ACL rule in the traffic classifier. The or parameter indicates
that the relationship between rules in a traffic classifier is OR. That is, packets match
a traffic classifier when the packets match a rule in the traffic classifier.
By default, the relationship between rules in a traffic classifier is AND.
7. Run:
if-match acl l2-acl-number

A traffic classifier based on a Layer 2 ACL is created.


l Creating a traffic classifier based on a user-defined ACL
1. Run:
system-view

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 25


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The system view is displayed.


2. Run:
acl [ number ] user-defined-acl-number

A user-defined ACL is created and the user-defined ACL view is displayed.

NOTE

user-defined-acl-number specified the number of a user-defined ACL. The value is an integer


that ranges from 5000 to 5999.
3. (Optional) Run:
step step-value

The step value between ACL rule IDs is set.


4. Run the following command on the S5700EI:
rule [ rule-id ] { deny | permit } [ [ l2-head | ipv4-head | ipv6-head |
l4-head ] { rule-string rule-mask offset } ] [ time-range time-range-
name ]

The user-defined ACL is configured.

Run the following command on the S5700SI:


rule [ rule-id ] { deny | permit } [ [ l2-head | ipv4-head | l4-head ]
{ rule-string rule-mask offset } ] [ time-range time-range-name ]

The user-defined ACL is configured.


5. Run:
quit

Return to the system view.


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

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

and indicates the relationship between rules is AND. That is, packets must match all
the non-ACL rules and one of the ACL rules of the traffic classifier. or indicates the
relationship between rules is OR. That is, packets need to match only one rule of the
traffic classifier.

By default, the relationship between rules in a traffic classifier is AND.


7. Run:
if-match acl user-defined-acl-number

A traffic classifier based on a user-defined ACL is configured.

You can use only the if-match acl user-defined-acl-number command in a traffic
classifier where the relationship between rules is AND or configure other matching
rules on the S5700EI. When the if-match acl user-defined-acl-number command is
used and other matching rules are configured, the if-match acl user-defined-acl-
number command can only be used with the commands of if-match vlan-id.

There is no restriction on the S5700SI.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 26


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.6.3 Configuring a Traffic Behavior


The S5700 supports the actions of permit/deny, re-marking, redirection, traffic policing, flow
mirroring, and traffic statistics, which can be configured as required.

Configuring the Deny or Permit Action


By configuring the deny or permit action, the S5700 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 Run:
permit

The permit action is configured.


l Run:
deny

The deny action is configured.


NOTE

l If the deny action is configured, the packets matching a traffic classifier are discarded. The packets are
still discarded even if other actions except for the traffic statistics action are configured.
l If the permit action is configured, the packets matching a traffic classifier are processed in order.

----End

Configuring the Re-marking Action


The re-marking action re-marks priorities of packets matching traffic classification rules, such
as the 802.1p priority in VLAN packets, and the DSCP priority in IP packets.

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.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 27


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Step 3 Run the following commands as required.


l Run:
remark 8021p [ 8021p-value | inner-8021p ]

The 802.1p priority of the packets matching the traffic classification is re-marked.
NOTE

If inner-8021p is specified, the 802.1p priority in the inner tag of packets is re-marked to the outer tag.
l Run:
remark cvlan-id cvlan-id

The VLAN ID in the inner VLAN tag of the QinQ packets matching the traffic classification
is re-marked.
NOTE

The S5700SI does not support the remark cvlan-id command.


l Run:
remark vlan-id vlan-id

The VLAN ID in the outer VLAN tag of the packets in a VLAN matching the traffic
classification is re-marked.
l Run:
remark destination-mac mac-address

The destination MAC address of the packets matching the traffic classification is re-marked.
NOTE

In a traffic behavior, the remark destination-mac command cannot be used with the following commands
simultaneously:
l redirect ip-nexthop
l redirect ip-multihop
The S5706 does not support the redirect ip-nexthop command, and the redirect ip-multihop command.
l Run:
remark dscp { dscp-name | dscp-value }

The DSCP priority of the packets matching the traffic classification is re-marked.
l Run:
remark local-precedence { local-precedence-name | local-precedence-value }
[ color ]

The local priority of the packets matching the traffic classification is re-marked.
NOTE

The S5700SI cannot re-mark the color of packets.


In a traffic behavior, the remark 8021p command and the remark local-precedence
command cannot be used together.
l Run:
remark ip-precedence ip-precedence

The ip priority of the packets matching the traffic classification is re-marked.


NOTE

The DSCP value and IP precedence of packets cannot be re-marked at the same time.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 28


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Configuring the Redirection Action


The redirection action redirects packets matching the traffic classification rule to the CPU, the
specified interface, the specified next hop address.

Context
NOTE

The S5700SI does not support redirection.

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:
redirect cpu

The packets matching the traffic classification are redirected to the CPU.

CAUTION
After the redirect cpu command is used, the packets matching the traffic classification rule
are redirected to the CPU, causing CPU performance to deteriorate. Exercise caution when
you run the redirect cpu command.

l Run:
redirect ip-nexthop ip-address &<1-4>

The packets matching the traffic classification are redirected to the next hop.
If multiple next hop IP addresses are configured, the S5700 redirects packets in active/
standby mode. A maximum of four next hop IP addresses can be configured in a traffic
behavior. The S5700 determines the primary path and backup paths according to the sequence
in which next hop IP addresses were configured. The next hop IP address that was configured
first has the highest priority and this next hop is used as the primary path. Other next hops
are used as backup paths. When the primary path is Down, the backup path with the highest
priority is used as the primary path.
NOTE

The policy-based routing function can be implemented by configuring redirection.


NOTE

The S5706 does not support redirect ip-nexthop command.


l Run:
redirect ip-multihop { nexthop ip-address } &<2-4>

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 29


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The packets matching the traffic classification are redirected to one of the multiple next hops.
If multiple next hops are specified, the S5700 redirects packets through the equal-cost routes
that work in load balancing mode. That is, the S5700 selects a next hop by using the Hash
algorithm based on the source IP addresses of the packets, regardless of the traffic volume.
If the source IP addresses of the packets are the same, the S5700 forwards the packets to the
same next hop regardless of the traffic volume.
When redirecting packets to multiple next hops, the S5700 can quickly switch the link to an
available outbound interface by using the Hash algorithm if the outbound interface
corresponding to the current next hop becomes Down or the route changes suddenly.
If no ARP entry corresponding to the next hop address is matched on the S5700, the redirect
ip-multihop command can be run successfully. The S5700 forwards the packets to the
original destination. The redirection function, however, is invalid until there is the
corresponding ARP entry on the device.
NOTE

The S5706 does not support redirect ip-multihop command.


l Run:
redirect interface interface-type interface-number

The packets matching the traffic classification are redirected to a specified interface.
NOTE

In a traffic behavior, the remark destination-mac command cannot be used with the following commands
simultaneously:
l redirect ip-nexthop
l redirect ip-multihop

----End

Configuring Traffic Policing


Traffic policing discards the packets that exceed the rate limit or re-marks colors or CoS of these
packets.

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 (S5700SI) Run:
car [ aggregation ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green pass ] [ yellow { discard | pass [ remark-dscp dscp-value |
remark-8021p 8021p-precedence ] } ] [ red { discard | pass [ remark-dscp dscp-
value | remark-8021p 8021p-precedence ] } ]

The CAR action is configured.


l (S5700EI) Run:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 30


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

car [ aggregation ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green { discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-
precedence ] } ] [ yellow { discard | pass [ remark-dscp dscp-value |
remark-8021p 8021p-precedence ] } ] [ red { discard | pass [ remark-dscp dscp-
value | remark-8021p 8021p-precedence ] } ]

The CAR action is configured.


l (S5700HI, S5706) Run:
car cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ green
{ discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-precedence ] } ]
[ yellow { discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-
precedence ] } ] [ red { discard | pass [ remark-dscp dscp-value | remark-8021p
8021p-precedence ] } ]

The CAR action is configured.


Step 4 (Optional) Run:
car car-name share

The aggregate CAR action is configured.

NOTE

The S5700SI and S5700EI do not support share CAR.


Before configuring aggregate CAR, run the qos car command to configure a CAR profile.

----End

Configuring Flow Mirroring


The flow mirroring action mirrors all the packets matching traffic classification rules to the
observing interface.

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:
mirroring to observe-port index

All the flows that match a traffic classifier are mirrored to an observing interface.

NOTE

For details about flow mirroring, see Configuring Local Flow Mirroring in the Quidway S5700 Series
Ethernet Switches Configuration Guide - Device Management.

----End

Configuring Traffic Statistics


The traffic statistics action collects traffic statistics on packets matching traffic classification
rules.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 31


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

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.

NOTE

Before collecting the flow-based statistics, enable the traffic statistics function in a traffic behavior.

----End

Disabling MAC Address Learning


After MAC address learning is disabled, MAC addresses of the packets that match traffic
classification rules are not learned. This improves device efficiency and protects device security.

Context
When a network is running stably and the MAC address of packets is fixed, a device does not
need to learn MAC addresses of other packets. You can apply a traffic policy and disable MAC
address learning in all the traffic classifiers bound to the traffic policy. This saves MAC addresses
are saved and improves device performance.
Unauthorized users may change MAC addresses frequently to attack a network. To prevent MAC
address overflow and protect the network from such attacks, apply a traffic policy and disable
MAC address learning in all the traffic classifiers bound to the traffic policy.

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:
mac-address learning disable

MAC address learning is disabled.


After MAC address learning is disabled, MAC addresses of the packets that match the traffic
classifier are not learned. The MAC addresses of the packets that do not match the traffic
classifier are still learned by default.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 32


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

On the S5700SI and S5700EI, MAC address learning cannot be disabled.


Disable MAC address learning in the following situations:
l To disable MAC address learning on an interface, in a port group, or in a VLAN, run the mac-address
learning disable command in the corresponding view.
l To disable MAC address learning for the packets matching a specified traffic classifier, run the mac-
address learning disable command in the traffic behavior view.

----End

1.6.4 Configuring a Traffic Policy


You can associate a traffic classifier with a traffic behavior in a traffic policy.

Context
When creating a traffic policy on the S5700HI and S5706, specify the matching order of traffic
classifiers in the traffic policy. The matching order includes the automatic order and
configuration order:
l If the automatic order is used, traffic classifiers are matched based on their priorities. The
priority order is: Layer 2 and Layer 3 information > Layer 3 information > Layer 2
information. The traffic classifier with the highest priority is matched first.
l If the configuration order is used, traffic classifiers are matched in the sequence in which
they were bound to the traffic policy. The traffic classifier that was bound to the traffic
policy first is matched first.
When you create a traffic policy, the matching order of the traffic classifier bound to the traffic
policy cannot be specified on the S5700SI or S5700EI.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run the following commands as required.
l (S5700SI or S5700EI) Run:
traffic policy traffic-policy-name

A traffic policy is created and the traffic policy view is displayed.


l (S5700HI or S5706) Run:
traffic policy policy-name [ match-order { auto | config } ]

A traffic policy is created and the traffic policy view is displayed.


After a traffic policy is applied, you cannot use the traffic policy command to modify the
matching order of traffic classifiers in the traffic policy. To modify the matching order, delete
the traffic policy, and re-create a traffic policy and specify the matching order.
Step 3 Run:
classifier classifier-name behavior behavior-name

A traffic classifier is bound to a traffic behavior in the traffic policy.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 33


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.6.5 Applying the Traffic Policy


The configured traffic policy takes effect only after being applied to the system, a slot, an
interface, or a VLAN.

Context
NOTE

An card may not support a traffic policy; therefore, applying the traffic policy in the system or in a VLAN
on the card fails. Run the display traffic-policy applied-record [ policy-name ] command to view the
card where the traffic policy takes effect.

Procedure
l Applying a traffic policy to the system or a slot
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-policy policy-name global { inbound | outbound } [ slot slot-id ]

A traffic policy is applied to the system or a slot in the inbound or outbound direction.
Only one traffic policy can be applied to the system in the inbound or outbound
direction.
Only one traffic policy can be applied to a slot in the inbound or outbound direction.
A traffic policy cannot be applied to the system and a slot simultaneously.
– If a stack system is established, a traffic policy that is applied to the system takes
effect on all the interfaces and VLANs of all the member switches in the stack.
The system then performs traffic policing for all the incoming and outgoing packets
that match traffic classification rules on all the member switches. A traffic policy
that is applied to a specified slot takes effect on all the interfaces and VLANs of
the member switch with the specified stack ID. The system then performs traffic
policing for all the incoming and outgoing packets that match traffic classification
rules on this member switch.
– If a stack system is not established, a traffic policy that is applied to the system
takes effect on all the interfaces and VLANs of the local switch. The system then
performs traffic policing for all the incoming and outgoing packets that match
traffic classification rules on the local switch. Traffic policies applied to the slot
and system have the same functions.
l Applying a traffic policy to an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
traffic-policy policy-name { inbound | outbound }

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 34


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

A traffic policy is applied to the interface in the inbound or outbound direction.

Only one traffic policy can be applied to an interface in the inbound or outbound
direction.

After a traffic policy is applied, the system performs traffic policing for the packets
that pass through this interface and match traffic classification rules in the inbound or
outbound direction.

NOTE

It is recommended that you should not use the traffic policy containing the re-marking of the
802.p priority, the inner VLAN tag of QinQ packets, and the VLAN ID of packets in a VLAN
on the untagged interface in the outbound direction; otherwise, the information carried in the
packets may be incorrect.
l Applying a traffic policy to a VLAN
1. Run:
system-view

The system view is displayed.


2. Run:
vlan vlan-id

The VLAN view is displayed.


3. Run:
traffic-policy policy-name { inbound | outbound }

A traffic policy is applied to the VLAN in the inbound or outbound direction.

Only one traffic policy can be applied to a VLAN in the inbound or outbound direction.

After a traffic policy is applied, the system performs traffic policing for the packets
that belong to a VLAN and match traffic classification rules in the inbound or
outbound direction.

----End

1.6.6 Checking the Configuration


After a traffic policy based on complex traffic classification is configured, you can view the
configuration of the traffic classifier, traffic behavior, and traffic policy.

Prerequisite
The configurations of the traffic policy based on complex traffic classification are complete.

Procedure
l Run the display acl { acl-number | all } command to check the ACL rules.
l display traffic-applied [ interface [ interface-type interface-number ] | vlan vlan-id ]
{ inbound | outbound } [ verbose ] command to check information about traffic actions
and ACL rules associated with a device, a VLAN, or an interface.
l Run the display traffic classifier user-defined [ classifier-name ] command to check the
traffic classifier on the S5700.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 35


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

l Run the display traffic behavior user-defined [ behavior-name ] command to check the
traffic behavior configuration.
l Run the display traffic policy user-defined [ policy-name [ classifier classifier-name ] ]
command to check the traffic policy information.
l Run the display traffic policy { interface [ interface-type interface-number ] | vlan [ vlan-
id ] | global } [ inbound | outbound ] command to check the traffic policy information and
flow-based traffic statistics.
l Run the display traffic-policy applied-record [ policy-name ] command to check the
applied traffic policy.

----End

1.7 Configuring a Traffic Policy by Using Simplified QoS


Commands
By using simplified QoS commands, you can configure traffic monitoring, traffic statistics,
traffic redirection, traffic re-marking, and traffic mirroring. Compared with common QoS
commands, simplified QoS commands make the configuration procedures easier because you
do not need to create traffic classifiers, traffic behaviors, and traffic policies independently.

1.7.1 Establishing the Configuration Task


Before configuring a traffic policy by using simplified QoS commands, familiarize yourself with
the applicable environment, complete the pre-configuration tasks, and obtain the required data.
This helps you complete the configuration task quickly and accurately.

Applicable Environment
At the egress of the network, the S5700 functions as the edge node. To limit the traffic entering
the network, you can use simplified QoS commands to configure a traffic policy on the S5700.
Then the S5700 can provide differentiated services for different service flows based on the
parameters of the packets, such as the DSCP value, protocol type, IP address, port number, type
of the fragmented packets, and time range.

By using simplified QoS commands, you can configure traffic monitoring, traffic statistics,
traffic redirection, traffic re-marking, and traffic mirroring. Compared with common QoS
commands, simplified QoS commands make the configuration procedures easier because you
do not need to create traffic classifiers, traffic behaviors, and traffic policies independently.

Pre-configuration Tasks
Before configuring a traffic policy by using simplified QoS commands, complete the following
tasks:

l Setting physical parameters of relevant interfaces


l Configuring link layer attributes of relevant interfaces
l Configuring the routing protocol to implement internetworking
l Configuring an ACL if the ACL needs to be used to classify traffic

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 36


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Data Preparation
To configure a traffic policy by using simplified QoS commands, you need the following data.

No. Data

1 ACL rule

2 (Optional) CIR and CBS

1.7.2 Configuring Traffic Policing for the Traffic That Matches an


ACL Rule on the S5700SI
Context
You can configure traffic policing actions and set CAR parameters such as the CIR and CBS to
limit the traffic of packets, and configure actions taken for packets with different colors.

Procedure
l Configuring traffic policing globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-limit [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl { bas-acl | adv-acl } | user-acl } }
[ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green pass ] [ yellow { drop | pass [ remark-8021p 8021p-value
| remark-dscp dscp-value ] } ] [ red { drop | pass [ remark-8021p 8021p-
value | remark-dscp dscp-value ] } ]

Traffic policing is configured for the incoming packets matching an ACL rule on an
interface.
Or, run:
traffic-limit [ vlan vlan-id ] outbound acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl { bas-acl | adv-acl } | user-acl } [ rule
rule-id ] } cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green pass ] [ yellow pass ] [ red { drop | pass } ]

Traffic policing is configured for the outgoing packets matching an ACL rule on an
interface.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 37


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic policing is
configured. In this case, traffic policing is performed for the traffic matching an ACL rule on
all interfaces in the VLAN.
If the value of vlan vlan-id is not specified, it indicates that the statistics on the traffic matching
an ACL rule are collected on all interfaces of the device.
The colors of packets can be defined in traffic policing:
l When the size of a packet is less than the value of cbs-value, the packet is colored green.
l When the size of a packet is greater than or equal to the value of cbs-value but less than
the value of pbs-value, the packet is colored yellow.
l When the size of a packet is greater than or equal to the value of pbs-value, the packet is
colored red.
By default, green packets and yellow packets are allowed to pass through, and red packets are
discarded.
When the traffic-limit command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-limit command does not take
effect.
l If the permit action is configured in the ACL rule, the traffic-limit command takes effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-limit command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-limit [ vlan vlan-id ] inbound acl { l2-acl { bas-acl | adv-acl } | name acl-name }
[ rule rule-id ] acl { bas-acl | adv-acl | name acl-name } [ rule rule-id ] cir cir-value [ pir pir-
value ] [ cbs cbs-value pbs pbs-value ] [ green pass ] [ yellow { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ]

To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound interface of a


switch, use the following command:

traffic-limit [ vlan vlan-id ] outbound acl { l2-acl { bas-acl | adv-acl } | name acl-
name } [ rule rule-id ] acl { bas-acl | adv-acl | name acl-name } [ rule rule-id ] cir
cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ [ green { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ yellow { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] ] *
l Configuring traffic policing on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The GE or XGE interface view is displayed.

Or, run:
interface eth-trunktrunk-id

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 38


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The Eth-Trunk interface view is displayed.


3. Run:
traffic-limit inbound acl { [ ipv6 ] { bas-acl | adv-acl | name acl-name }
| l2-acl | user-acl } [ rule rule-id ] cir cir-value [ pir pir-value ]
[ cbs cbs-value pbs pbs-value ] [ green pass ] [ yellow { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red { drop |
pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ]

Traffic policing is configured for the incoming packets matching an ACL rule on an
interface.

Or, run:
traffic-limit outbound acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } [ rule rule-id ] } cir cir-value [ pir pir-
value ] [ cbs cbs-value pbs pbs-value ] [ green pass ] [ yellow pass ]
[ red { drop | pass } ]

Traffic policing is configured for the outgoing packets matching an ACL rule on an
interface.

NOTE

The colors of packets can be defined in traffic policing:


l When the size of a packet is less than the value of cbs-value, the packet is colored green.
l When the size of a packet is greater than or equal to the value of cbs-value but less than
the value of pbs-value, the packet is colored yellow.
l When the size of a packet is greater than or equal to the value of pbs-value, the packet is
colored red.
By default, green packets and yellow packets are allowed to pass through, and red packets are
discarded.
When the traffic-limit command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-limit command does not take
effect.
l If the permit action is configured in the ACL rule, the traffic-limit command takes effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-limit command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-limit inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-acl |
name acl-name } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green pass ] [ yellow { drop | pass [ remark-8021p 8021p-value | remark-dscp
dscp-value ] } ] [ red { drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-
value ] } ]
To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound interface of a switch, use
the following command:
traffic-limit outbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-acl
| name acl-name } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ green pass ] [ yellow pass ] [ red { drop | pass } ]

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 39


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.7.3 Configuring Traffic Policing for the Traffic That Matches an


ACL Rule on the S5700EI, S5700HI or S5706
Context
You can configure traffic policing actions and set CAR parameters such as the CIR and CBS to
limit the traffic of packets, and configure actions taken for packets with different colors.

Procedure
l Configuring traffic policing globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-limit [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] cir cir-
value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ [ green { drop
| pass [ remark-dscp dscp-value ] } ] [ yellow { drop | pass [ remark-
dscp dscp-value ] } ] [ red { drop | pass [ remark-dscp dscp-value ] } ] ]

Traffic policing is performed for incoming packets based on the ACL rule.
Or, run:
traffic-limit [ vlan vlan-id ] outbound acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl { bas-acl | adv-acl } } [ rule rule-id ]
cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ [ green
{ drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ]
[ yellow { drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-
value ] } ] [ red { drop | pass [ remark-8021p 8021p-value | remark-dscp
dscp-value ] } ] ]

Traffic policing is performed for outgoing packets based on the ACL rule.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 40


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

If the value of vlan vlan-id is specified, VLAN-based traffic policing is configured. Traffic
policing is performed for the traffic matching an ACL rule on all interfaces in the VLAN.
If the value of vlan vlan-id is not specified, the statistics on the traffic matching an ACL rule
are collected on all interfaces of the device.
The colors of packets can be defined in traffic policing:
l When the size of a packet is less than the value of cbs-value, the packet is colored green.
l When the size of a packet is greater than or equal to the value of cbs-value but less than
the value of pbs-value, the packet is colored yellow.
l When the size of a packet is greater than or equal to the value of pbs-value, the packet is
colored red.
By default, green packets and yellow packets are allowed to pass through, and red packets are
discarded.
When the traffic-limit command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-limit command does not take
effect.
l If the permit action is configured in the ACL rule, the traffic-limit command takes effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-limit command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-limit [ vlan vlan-id ] inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-
acl | adv-acl | name acl-name } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value
pbs pbs-value ] [ [ green { drop | pass [ remark-dscp dscp-value ] } ] [ yellow { drop |
pass [ remark-dscp dscp-value ] } ] [ red { drop | pass [ remark-dscp dscp-value ] } ] ]
To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound of a switch, use the
following command:traffic-limit [ vlan vlan-id ] outbound acl { l2-acl | name acl-name }
[ rule rule-id ] acl { bas-acl | adv-acl | name acl-name } [ rule rule-id ] cir cir-value [ pir pir-
value ] [ cbs cbs-value pbs pbs-value ] [ [ green { drop | pass [ remark-8021p 8021p-value
| remark-dscp dscp-value ] } ] [ yellow { drop | pass [ remark-8021p 8021p-value | remark-
dscp dscp-value ] } ] [ red { drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-
value ] } ] ]
l Configuring traffic policing on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


Or, run:
interface eth-trunktrunk-id

The Eth-Trunk interface view is displayed.


3. Run:
traffic-limit inbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } } [ rule rule-id ] cir cir-value [ pir pir-
value ] [ cbs cbs-value pbs pbs-value ] [ [ green { drop | pass [ remark-
dscp dscp-value ] } ] [ yellow { drop | pass [ remark-dscp dscp-value ] } ]
[ red { drop | pass [ remark-dscp dscp-value ] } ] ]

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 41


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Traffic policing is configured for the incoming packets matching an ACL rule on an
interface.

Or, run:
traffic-limit outbound acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs
cbs-value pbs pbs-value ] [ [ green { drop | pass [ remark-8021p 8021p-
value | remark-dscp dscp-value ] } ] [ yellow { drop | pass
[ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red { drop |
pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] ]

Traffic policing is configured for the outgoing packets matching an ACL rule on an
interface.

NOTE

The colors of packets can be defined in traffic policing:


l When the size of a packet is less than the value of cbs-value, the packet is colored green.
l When the size of a packet is greater than or equal to the value of cbs-value but less than
the value of pbs-value, the packet is colored yellow.
l When the size of a burst packet is greater than or equal to the value of pbs-value, the packet
is colored red.
By default, green packets and yellow packets are allowed to pass through, and red packets are
discarded.
When the traffic-limit command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-limit command does not take
effect.
l If the permit action is configured in the ACL rule, the traffic-limit command takes effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-limit command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-limit inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-acl |
name acl-name } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ [ green { drop | pass [ remark-dscp dscp-value ] } ] [ yellow { drop | pass [ remark-
dscp dscp-value ] } ] [ red { drop | pass [ remark-dscp dscp-value ] } ] ]
To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound interface of a switch, use
the following command:
traffic-limit outbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-acl
| name acl-name } [ rule rule-id ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-
value ] [ [ green { drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ]
[ yellow { drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red
{ drop | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] ]

----End

1.7.4 Filtering the Traffic That Matches an ACL Rule

Context
By filtering the traffic that matches an ACL rule, the S5700 rejects or permits the packets that
match the ACL rule so that the traffic is controlled.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 42


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
l Configuring traffic filtering globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-filter [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } [ rule rule-id ] }

The incoming packets matching an ACL rule are filtered on an interface.


Or, run:
traffic-filter [ vlan vlan-id ] outbound { acl { [ ipv6 ] {bas-acl | adv-
acl | name acl-name } | l2-acl } [ rule rule-id ] }

The outgoing packets matching an ACL rule are filtered on an interface.

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic filtering is
configured and the traffic matching an ACL rule is filtered on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, the statistics on the traffic matching an ACL rule
are collected on all interfaces of the device.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-filter command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on a switch interface, use the following
command:
traffic-filter [ vlan vlan-id ] { inbound | outbound } acl { l2-acl | name acl-name } [ rule
rule-id ] acl { bas-acl | adv-acl | name acl-name } [ rule rule-id ]
l Configuring traffic filtering on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


Or, run:
interface eth-trunk trunk-id

The Eth-Trunk interface view is displayed.


3. Run:
traffic-filter inbound { acl { [ ipv6 ] {bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } } [ rule rule-id ]

The incoming packets matching an ACL rule are filtered on an interface.


Or, run:
traffic-filter outbound { acl { [ ipv6 ] {bas-acl | adv-acl | name acl-
name } | l2-acl } } [ rule rule-id ]

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 43


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The outgoing packets matching an ACL rule are filtered on an interface.

NOTE

A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-filter command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an interface of a switch, use the
following command:
traffic-filter { inbound | outbound } acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-
acl | adv-acl | name acl-name } [ rule rule-id ]

----End

1.7.5 Re-marking the Traffic That Matches an ACL Rule


Context
By configuring the re-marking action, the S5700 re-marks priorities of packets matching traffic
classification rules, such as 802.1p priorities of VLAN packets, DSCP priorities of IP packets,
and EXP priorities of MPLS packets.

Procedure
l Configuring re-marking globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-remark [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] { 8021p
8021p-value | destination-mac mac-address | dscp { dscp-name | dscp-
value } | local-precedence local-precedence-value | ip-precedence ip-
precedence-value | vlan-id vlan-id }

The priorities of incoming packets matching an ACL rule are re-marked.


Or, run:
traffic-remark [ vlan vlan-id ] outbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl } } [ rule rule-id ] { 8021p 8021p-value |
cvlan-id cvlan-id | dscp { dscp-name | dscp-value } | vlan-id vlan-id }

The priorities of outgoing packets matching an ACL rule are re-marked.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 44


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

The S5700SI cannot re-mark the inner VLAN tag of QinQ packets.
The S5700SI cannot re-mark the destination MAC address of packets.
If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic filtering is
configured and the traffic matching an ACL rule is filtered on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, it indicates that the statistics on the traffic matching
an ACL rule are collected on all interfaces of the device.
When the traffic-remark command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-remark command does not
take effect.
l If the permit action is configured in the ACL rule, the traffic-remark command takes
effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-remark command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-remark [ vlan vlan-id ] inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] { 8021p 8021p-value | destination-
mac mac-address | dscp { dscp-name | dscp-value } | local-precedence local-precedence-
value | ip-precedence ip-precedence-value | vlan-id vlan-id }
To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound interface of a switch, use
the following command:
traffic-remark [ vlan vlan-id ] outbound acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] { 8021p 8021p-value | cvlan-id cvlan-
id | dscp { dscp-name | dscp-value } | vlan-id vlan-id }
If you use the traffic-remark vlan vlan-id inbound acl acl-number vlan vlan-id command
to re-mark VLAN IDs on incoming packets, the VLAN IDs must also be re-marked on outgoing
packets, for example:
traffic-remark vlan vlan-id1 inbound acl acl-number vlan vlan-id2
traffic-remark vlan vlan-id2 inbound acl acl-number vlan vlan-id1
l Configuring re-marking on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.

Or, run:
interface eth-trunk trunk-id

The Eth-Trunk interface view is displayed.


3. Run:
traffic-remark inbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } } [ rule rule-id ] { 8021p 8021p-value |
destination-mac mac-address | dscp { dscp-name | dscp-value } | local-
precedence local-precedence-value | ip-precedence ip-precedence-value |
vlan-id vlan-id }

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 45


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

The priorities of incoming packets matching an ACL rule are re-marked.


Or, run:
traffic-remark outbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl } } [ rule rule-id ] { 8021p 8021p-value | cvlan-id cvlan-
id | dscp { dscp-name | dscp-value } | vlan-id vlan-id }

The priorities of outgoing packets matching an ACL rule are re-marked.


NOTE

The S5700SI cannot re-mark the inner VLAN tag of QinQ packets.
The S5700SI cannot re-mark the destination MAC address of packets.
When the traffic-remark command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-remark command does not
take effect.
l If the permit action is configured in the ACL rule, the traffic-remark command takes
effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-remark command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-remark inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-
acl | name acl-name } [ rule rule-id ] { 8021p 8021p-value | destination-mac mac-address |
dscp { dscp-name | dscp-value } | local-precedence local-precedence-value | ip-precedence
ip-precedence-value | vlan-id vlan-id }
To configure both Layer 2 ACLs and Layer 3 ACLs on an outbound interface of a switch, use
the following command:
traffic-remark outbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-
acl | name acl-name } [ rule rule-id ] { 8021p 8021p-value | cvlan-id cvlan-id | dscp { dscp-
name | dscp-value } | vlan-id vlan-id }

----End

1.7.6 Mirroring Traffic That Matches an ACL Rule


Context
By configuring traffic mirroring, you can mirror packets that match an ACL rule to the specified
interface for the ease of packet analysis.

Procedure
l Configure traffic mirroring globally.
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-mirror [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] to observe-
port o-index

The incoming packets matching an ACL rule are mirrored on an interface.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 46


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic mirroring is
configured and traffic that matches an ACL rule is filtered on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, it indicates that the statistics on the traffic that
matches an ACL rule are collected on all interfaces of the device.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-mirror command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 and 3000 to 3999. To configure both Layer 2 ACLs and Layer 3
ACLs on an inbound interface of a switch, run the following command:
traffic-mirror[ vlan vlan-id ] inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] to observe-port o-index
l Configure traffic mirroring on an interface.
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number
or
interface eth-trunk trunk-id

The interface view or the Eth-Trunk interface view is displayed.


3. Run:
traffic-mirror inbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } } [ rule rule-id ] to observe-port o-index

The incoming packets matching an ACL rule are mirrored on an interface.

NOTE

A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-mirror command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 and 3000 to 3999. To configure both Layer 2 ACLs and Layer 3
ACLs on an inbound interface of a switch, run the following command:
traffic-mirror inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-
acl | name acl-name } [ rule rule-id ] to observe-port o-index

----End

1.7.7 Collecting Statistics on the Traffic That Matches an ACL Rule


Context
By configuring the traffic statistics action, the S5700 collects traffic statistics on packets
matching traffic classification rules.

Procedure
l Configuring traffic statistics globally
1. Run:
system-view

The system view is displayed.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 47


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

2. Run:
traffic-statistic [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl |
adv-acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] [ by-
bytes ]

The statistics on the incoming packets matching an ACL rule are collected on an
interface.

Or, run:
traffic-statistic [ vlan vlan-id ] outbound { acl { [ ipv6 ] {bas-acl |
adv-acl | name acl-name } | l2-acl } } [ rule rule-id ]

The statistics on the outgoing packets matching an ACL rule are collected on an
interface.

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic filtering is
configured and the traffic matching an ACL rule is filtered on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, the statistics on the traffic matching an ACL rule
are collected on all interfaces of the device.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-statistic command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an interface of a switch, use the
following command:
traffic-statistic [ vlan vlan-id ] { inbound | outbound } acl { l2-acl | name acl-name }
[ rule rule-id ] acl { bas-acl | adv-acl | name acl-name } [ rule rule-id ]
l Configuring traffic statistics on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.

Or, run:
interface eth-trunk trunk-id

The Eth-Trunk interface view is displayed.


3. Run:
traffic-statistic inbound acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } [ rule rule-id ] [ by-bytes ]

The statistics on the incoming packets matching an ACL rule are collected on an
interface.

Or, run:
traffic-statistic outbound { acl { [ ipv6 ] {bas-acl | adv-acl | name acl-
name } | l2-acl } } [ rule rule-id ]

The statistics on the outgoing packets matching an ACL rule are collected on an
interface.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 48


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-statistic command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an interface of a switch, use the
following command:
traffic-statistic { inbound | outbound } acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] [ by-bytes ]

----End

1.7.8 Redirecting the Traffic That Matches an ACL Rule on the


S5700SI or S5706
Context
By configuring the redirection action, the S5700 redirects the packets matching traffic
classification rules to the CPU, or the specified interface.

Procedure
l Configuring traffic redirection globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-redirect [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] { cpu |
interface interface-type interface-number }

The packets matching an ACL rule are redirected.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 49


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic redirection is
configured and the traffic matching an ACL rule is redirected on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, the statistics on the traffic matching an ACL rule
are collected on all interfaces of the device.
When the traffic-redirect command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-redirect command does not
take effect.
l If the permit action is configured in the ACL rule, the traffic-redirect command takes
effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-redirect command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an interface of a switch, use the
following command:
traffic-redirect [ vlan vlan-id ] inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] { cpu | interface interface-type interface-
number }
l Configuring traffic redirection on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The GE interface view or XGE interface view is displayed.

Or, run:
interface eth-trunktrunk-id

The Eth-Trunk interface view is displayed.


3. Run:
traffic-redirect inbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-
name } | l2-acl | user-acl } } [ rule rule-id ] { cpu | interface interface-
type interface-number }

The packets matching an ACL rule are redirected on an interface.

NOTE

A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-redirect command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 and 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-redirect inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-
acl | name acl-name } [ rule rule-id ] { cpu | interface interface-type interface-number }

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 50


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

1.7.9 Redirecting the Traffic That Matches an ACL Rule (S5700EI,


S5700HI)
Context
By configuring the redirection action, the S5700 redirects the packets matching traffic
classification rules to the CPU, the specified interface, or the specified next hop address.

Procedure
l Configuring traffic redirection globally
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-redirect [ vlan vlan-id ] inbound { acl { [ ipv6 ] { bas-acl | adv-
acl | name acl-name } | l2-acl | user-acl } } [ rule rule-id ] { cpu |
interface interface-type interface-number | ip-nexthop ip-nexthop | ipv6-
nexthop ipv6-nexthop }

The packets matching an ACL rule are redirected.

NOTE

If the value of vlan vlan-id is specified, it indicates that VLAN-based traffic redirection is
configured and the traffic matching an ACL rule is redirected on all interfaces on the VLAN.
If the value of vlan vlan-id is not specified, the statistics on the traffic matching an ACL rule
are collected on all interfaces of the device.
When the traffic-redirect command and the traffic-filter (interface view) or traffic-filter
(system view) command are used simultaneously, and the same ACL rule is associated:
l If the deny action is configured in the ACL rule, the traffic-redirect command does not
take effect.
l If the permit action is configured in the ACL rule, the traffic-redirect command takes
effect.
A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-redirect command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an interface of a switch, use the
following command:
traffic-redirect [ vlan vlan-id ] inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl
{ bas-acl | adv-acl | name acl-name } [ rule rule-id ] { cpu | interface interface-type interface-
number | ip-nexthop ip-nexthop | ipv6-nexthop ipv6-nexthop }
l Configuring traffic redirection on an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 51


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

traffic-redirect inbound { acl { [ ipv6 ] { bas-acl | adv-acl | name acl-


name } | l2-acl | user-acl } } [ rule rule-id ] { cpu | interface interface-
type interface-number | ip-nexthop ip-nexthop | ipv6-nexthop ipv6-
nexthop }

The packets matching an ACL rule are redirected.

NOTE

A Layer 2 ACL and a Layer 3 ACL can be set in the traffic-redirect command simultaneously.
The Layer 3 ACL and its rules can be configured only after the Layer 2 ACL and its rules are
configured. The Layer 2 ACL number ranges from 4000 to 4999 and the Layer 3 ACL number
ranges from 2000 to 2999 or 3000 to 3999.
To configure both Layer 2 ACLs and Layer 3 ACLs on an inbound interface of a switch, use
the following command:
traffic-redirect inbound acl { l2-acl | name acl-name } [ rule rule-id ] acl { bas-acl | adv-
acl | name acl-name } [ rule rule-id ] { cpu | interface interface-type interface-number | ip-
nexthop ip-nexthop | ipv6-nexthop ipv6-nexthop }

----End

1.8 Maintaining Class-based QoS


If the traffic statistics function is enabled, you can view and clear the flow-based traffic statistics.

1.8.1 Displaying the Flow-based Traffic Statistics


You can use the display traffic policy statistics command to view the traffic statistics matching
the specified traffic classification rule.

Context
To view the flow-based traffic statistics, a traffic policy must exist and contain the traffic
statistics action.

Procedure
l Run the display traffic policy statistics { global [ slot slot-id ] | interface interface-type
interface-number | vlan vlan-id } { inbound | outbound } [ verbose { classifier-base |
rule-base } [ class classifier-name ] ] command to check the flow-based traffic statistics.
----End

1.8.2 Clearing the Flow-based Traffic Statistics


You can use the reset command to clear the flow-based traffic statistics.

Context

CAUTION
The flow-based traffic statistics cannot be restored after being cleared. Exercise caution when
you run the command.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 52


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
l Run the reset traffic policy statistics { global [ slot slot-id ] | interface interface-type
interface-number | vlan vlan-id } { inbound | outbound } command in the user view to
clear the flow-based traffic statistics.
----End

1.9 Configuration Examples


This section provides several configuration examples of class-based QoS.

1.9.1 Example for Configuring Priority Mapping Based on Simple


Traffic Classification on the S5700SI or S5700EI
After priority mapping based on simple traffic classification is configured, the S5700 maps
DSCP priorities of different user packets to new DSCP priorities to provide differentiated
services.

Networking Requirements
As shown in Figure 1-1, SwitchA and SwitchB are connected to the router, and branch 1 and
branch 2 of the enterprise can access the network through LSW1 and LSW2. Branch 1 requires
better QoS guarantee; therefore, the DSCP priority of data packets from branch 1 is mapped to
45 and the DSCP priority of data packets from branch 2 is mapped to 30. The router trusts DSCP
priorities of packets. When congestion occurs, the router first processes packets of higher DSCP
priority.

Figure 1-1 Network diagram of priority mapping based on simple traffic classification

Core Network

Router
SwitchA SwitchB
GE0/0/2 GE0/0/2

GE0/0/1 GE0/0/1

LSW1 LSW2

VLAN 100 VLAN 200

branch 1 of
the enterprise branch 2 of
the enterprise

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 53


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure each interface so that branch 1 and branch 2 of the enterprise
can access the network.
2. Configure priority mapping to map the DSCP priority of data packets from branch 1 to 45
and the DSCP priority of data packets from branch 2 to 30.

Data Preparation
To complete the configuration, you need the following data:
l VLANs that interfaces join
l Re-marked DSCP priorities

Procedure
Step 1 Configure SwitchA.
# Create VLAN 100.
<Quidway> system-view
[Quidway] sysname SwitchA
[SwitchA] vlan batch 100

# Configure the link type of GE 0/0/1 and GE 0/0/2 to trunk and add them to VLAN 100.
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/2] quit

# Configure interfaces to trust DSCP priorities of packets.


[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] trust dscp
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] trust dscp
[SwitchA-GigabitEthernet0/0/2] quit

# Configure priority mapping.


[SwitchA] qos map-table dscp-dscp
[SwitchA-dscp-dscp] input 0 to 63 output 45

Step 2 Configure SwitchB.


# Create VLAN 200.
<Quidway> system-view
[Quidway] sysname SwitchB
[SwitchB] vlan batch 200

# Configure the link type of GE 0/0/1 and GE 0/0/2 to trunk and add them to VLAN 200.
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 54


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 200


[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 200
[SwitchB-GigabitEthernet0/0/2] quit

# Configure interfaces to trust DSCP priorities of packets.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] trust dscp
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] trust dscp
[SwitchB-GigabitEthernet0/0/2] quit

# Configure priority mapping.


[SwitchB] qos map-table dscp-dscp
[SwitchB-dscp-dscp] input 0 to 63 output 30

Step 3 Verify the configuration.


# View the priority mapping information on SwitchA.
[SwitchA] display qos map-table dscp-dscp
Input DSCP DSCP
------------------------
0 45
1 45
2 45
3 45
4 45
......
63 45

# View the interface configuration on SwitchA.


[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] display this
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
trust dscp
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] display this
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
trust dscp

# View the priority mapping information on SwitchB.


[SwitchB] display qos map-table dscp-dscp
Input DSCP DSCP
------------------------
0 30
1 30
2 30
3 30
4 30
......
63 30

# View the interface configuration on SwitchB.


[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] display this

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 55


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 200
trust dscp
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] display this
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 200
trust dscp

----End

Configuration Files
l Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 100
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
trust dscp
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100
trust dscp
#
qos map-table dscp-dscp
input 0 to 44 output 45
input 46 to 63 output 45

l Configuration file of SwitchB


#
sysname SwitchB
#
vlan batch 200
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 200
trust dscp
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 200
trust dscp
#
qos map-table dscp-dscp
input 0 to 29 output 30
input 31 to 63 output 30

1.9.2 Example for Configuring Priority Mapping Based on Simple


Traffic Classification on the S5700HI or S5706
After priority mapping based on simple traffic classification is configured, the S5700 maps
802.1p priorities of packets to different CoS to provide differentiated services.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 56


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Networking Requirements
As shown in Figure 1-2, the Switch is connected to the router through GE 0/0/3; branch 1 and
branch 2 of the enterprise access the network through the Switch and router. Branch 1 and branch
2 of the enterprise belong to VLANs 100 and 200. Branch 1 requires better QoS guarantee;
therefore, the priority of data packets from branch 1 is mapped to 4 and the priority of data
packets from branch 2 is mapped to 2. By doing this, Switch provides differentiated services.

Figure 1-2 Networking diagram of priority mapping based on simple traffic classification

Core
Network

Router
VLAN 300
GE0/0/3

GE0/0/1 GE0/0/2
VLAN 100 VLAN 200
Switch

Branch 1 of the
branch 2 of the
enterprise
enterprise

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure interfaces so that branch 1 and branch 2 of the enterprise can
access the network through the Switch.
2. Create DiffServ domains and map 802.1p priorities to PHBs and colors.
3. Bind the DiffServ domain to inbound interfaces GE0/0/1 and GE 0/0/2 on the Switch.

Data Preparation
To complete the configuration, you need the following data:
l Names of DiffServ domains
l 802.1p priorities of packets from branch 1 and branch 2 of the enterprise
l CoS of branch 1 and branch 2 of the enterprise

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 57


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLANs 100, 200, and 300.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 100 200 300

# Configure the type of GE 0/0/1, GE 0/0/2, and GE 0/0/3 as trunk, add GE 0/0/1 to VLAN 100,
add GE 0/0/2 to VLAN 200, and add GE 0/0/3 to VLAN 100, VLAN 200, and VLAN 300.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 200
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 300
[Switch-GigabitEthernet0/0/3] quit

# Create VLANIF 300 and assign interface IP address uo192.168.1.1/24 to VLANIF 300.
[Switch] interface vlanif 300
[Switch-Vlanif300] ip address 192.168.1.1 24

NOTE

Assign IP address 192.168.1.2/24 to the interface connecting the router and the Switch.

Step 2 Create and configure DiffServ domains.


# Create DiffServ domains ds1 and ds2 and map 802.1p priorities of packets from branch 1 and
branch 2 of the enterprise to PHBs and colors.

[Switch] diffserv domain ds1


[Switch-dsdomain-ds1] 8021p-inbound 0 phb af4 green
[Switch-dsdomain-ds1] quit
[Switch] diffserv domain ds2
[Switch-dsdomain-ds2] 8021p-inbound 0 phb af2 green
[Switch-dsdomain-ds2] quit

Step 3 Bind DiffServ domains to interfaces.


# Bind DiffServ domains ds1 and ds2 to GE 0/0/1, and GE 0/0/2 respectively.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] trust upstream ds1
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] trust upstream ds2
[Switch-GigabitEthernet0/0/2] quit

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 200 300

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 58


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

#
diffserv domain ds1
8021p-inbound 0 phb af4 green
#
diffserv domain ds2
8021p-inbound 0 phb af2 green
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
trust upstream ds1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 200
trust upstream ds2
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 100 200 300
#
return

1.9.3 Example for Re-marking the Priorities Based on Complex


Traffic Classification
After priority re-marking based on complex traffic classification is configured, the S5700 adds
the same outer VLAN ID to packets with different VLAN IDs. In addition, the S5700 re-marks
different 802.1p priorities of packets with different VLAN IDs to provide differentiated services.

Networking Requirements
The Switch is connected to the router through GE0/0/3; branch 1 and branch 2 of the enterprise
can access the network through the Switch and router. See Figure 1-3.
Data services of branch 1 and branch 2 of the enterprise come from VLANs 100 and 200. When
the data service packets of branch 1 and branch 2 of the enterprise pass the Switch, the Switch
needs to add the outer VLAN tag with the VLAN 300 to the packets so that these packets are
identified as data services on the core network. In addition, branch 1 requires better QoS
guarantee; therefore, the priority of data packets to branch 1 is mapped to 4 and the priority of
data packets to branch 2 is mapped to 2. By doing this, differentiated services are provided.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 59


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Figure 1-3 Networking diagram of priority re-marking based on complex traffic classification

Core
Network

Router
VLAN 300
GE0/0/3

GE0/0/1 GE0/0/2
VLAN 100 VLAN 200
Switch

Branch 1 of the
branch 2 of the
enterprise
enterprise

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure interfaces so that branch 1 and branch 2 of the enterprise can
access the network through the Switch.
2. Create traffic classifiers based on the VLAN ID in the inner VLAN tag on the Switch.
3. Create traffic behaviors on the Switch and re-mark 802.1p priorities of packets.
4. Create a traffic policy on the Switch, bind traffic behaviors to traffic classifiers in the traffic
policy, and apply the traffic policy to the interface at the inbound direction.

Data Preparation
To complete the configuration, you need the following data:
l Re-marked priorities of packets with different VLAN IDs in the inner VLAN tags
l Type, direction, and number of the interface that a traffic policy needs to be applied to

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLANs 100, 200, and 300 on the Switch and configure the interfaces so that the
Switch adds the outer VLAN tag with the VLAN ID as 300 to the packets sent from GE 0/0/1
and GE 0/0/2 and GE 0/0/3 can forward packets in VLAN 300.
<Quidway> system-view
[Quidway] sysname Switch

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 60


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

[Switch] vlan batch 100 200 300


[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port hybrid pivd vlan 100
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100 300
[Switch-GigabitEthernet0/0/1] qinq vlan-translation enable
[Switch-GigabitEthernet0/0/1] port vlan-stacking vlan 100 stack-vlan 300
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port hybrid pivd vlan 200
[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 200 300
[Switch-GigabitEthernet0/0/2] qinq vlan-translation enable
[Switch-GigabitEthernet0/0/2] port vlan-stacking vlan 200 stack-vlan 300
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 300
[Switch-GigabitEthernet0/0/3] quit

# Create VLANIF 300 and assign IP address 192.168.1.1/24 to VLANIF 300.


[Switch] interface vlanif 300
[Switch-Vlanif300] ip address 192.168.1.1 24
[Switch-Vlanif300] quit

Step 2 Create traffic classifiers.


# Create traffic classifiers c1 to c2 on the Switch to classify incoming packets based on the
VLAN ID in the inner VLAN tag.
[Switch] traffic classifier c1 operator and
[Switch-classifier-c1] if-match cvlan-id 100
[Switch-classifier-c1] quit
[Switch] traffic classifier c2 operator and
[Switch-classifier-c2] if-match cvlan-id 200
[Switch-classifier-c2] quit

Step 3 Create traffic behaviors.


# Create traffic behaviors b1 to b2 on the Switch to re-mark priorities of user packets.
[Switch] traffic behavior b1
[Switch-behavior-b1] remark 8021p 4
[Switch-behavior-b1] quit
[Switch] traffic behavior b2
[Switch-behavior-b2] remark 8021p 2
[Switch-behavior-b2] quit

Step 4 Create a traffic policy and apply it to an interface.


# Create traffic policy p1 on the Switch, bind traffic classifiers to traffic behaviors in the traffic
policy, and apply the traffic policy to GE 0/0/1 andGE 0/0/2 in the inbound direction to re-mark
priorities of packets coming from the user side.
[Switch] traffic policy p1
[Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch-trafficpolicy-p1] classifier c2 behavior b2
[Switch-trafficpolicy-p1] quit
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] traffic-policy p1 inbound
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] traffic-policy p1 inbound
[Switch-GigabitEthernet0/0/2] quit

Step 5 Verify the configuration.


# Check the configuration of traffic classifiers.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 61


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

<Switch> display traffic classifier user-defined


User Defined Classifier Information:
Classifier: c2
Operator: AND
Rule(s) : if-match cvlan-id 200

Classifier: c1
Operator: AND
Rule(s) : if-match cvlan-id 100

# Check the configuration of the traffic policy.


<Switch> display traffic policy user-defined p1
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: AND
Behavior: b1
Marking:
Remark 8021p 4
Classifier: c2
Operator: AND
Behavior: b2
Marking:
Remark 8021p 2

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 200 300
#
traffic classifier c2 operator and
if-match cvlan-id 200
traffic classifier c1 operator and
if-match cvlan-id 100
#
traffic behavior b2
remark 8021p 2
traffic behavior b1
remark 8021p 4
#
traffic policy p1
classifier c1 behavior b1
classifier c2 behavior b2
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
qinq vlan-translation enable
port hybrid pvid vlan
100
port hybrid untagged vlan 100 300
port vlan-stacking vlan 100 stack-vlan 300
traffic-policy p1 inbound
#
interface GigabitEthernet0/0/2
qinq vlan-translation enable
port hybrid pvid vlan
200
port hybrid untagged vlan 200 300
port vlan-stacking vlan 200 stack-vlan 300
traffic-policy p1 inbound
#

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 62


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
return

1.9.4 Example for Configuring Policy-based Routing


After packet redirection based on complex traffic classification is configured, the S5700 redirects
packets with different IP priorities to different interfaces so that the S5700 provides different
bandwidth services.

Networking Requirements
The Layer 2 switch of a company is connected to the ISP device through the Switch; one is a 1-
Gbit/s link with the gateway as 20.20.20.1/24 and the other is a 10-Gbit/s link with the gateway
as 20.20.30.1/24. The company requires that the 10 Gbit/s links send only the packets with
priorities as 4, 5, 6, and 7 and 1 Gbit/s links send packets of lower priorities to the ISP. See
Figure 1-4.

Figure 1-4 Policy-based routing networking


20.20.20.2/24
GE0/0/2 20.20.20.1/24
GE0/0/1 Core
network

L2 Switch GE0/0/3 20.20.30.1/24


Switch Router
20.20.30.2/24

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure interfaces so that the Switch can ping the ISP device.
2. Create ACL rules to match the packets with priorities as 4, 5, 6, and 7 and priorities as 0,
1, 2, and 3.
3. Create traffic classifiers to match the preceding ACL rules.
4. Create traffic behaviors to redirect matching packets to 20.20.20.1/24 and 20.20.30.1/24.
5. Create a traffic policy, bind traffic classifiers to traffic behaviors in the traffic policy, and
apply the traffic policy to an interface.

Data Preparation
To complete the configuration, you need the following data:
l VLAN 20 and VLAN 30 that all of GE0/0/1, GE0/0/2 and GE0/0/3 are added to
l ACL rules 3001 and 3002
l Traffic classifiers c1 and c2
l Traffic behaviors b1 and b2
l Traffic policy p1

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 63


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLANs 20 and 30.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 20 30

# Configure the type of GE 0/0/1, GE 0/0/2 and GE 0/0/3 to trunk, and add all of GE 0/0/1,
GE 0/0/2 and GE 0/0/3 to VLAN 20 and VLAN 30.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 20 30
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 20 30
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 20 30
[Switch-GigabitEthernet0/0/3] quit

# Create VLANIF 20 and VLANIF 30 and assign IP addresses to them.


[Switch] interface vlanif 20
[Switch-Vlanif20] ip address 20.20.20.2 24
[Switch-Vlanif20] quit
[Switch] interface vlanif 30
[Switch-Vlanif30] ip address 20.20.30.2 24
[Switch-Vlanif30] quit

NOTE

Assign network segment addresses 20.20.20.1/24 and 20.20.30.1/24 to the interfaces connecting the router
and Switch. The details are not mentioned here.

Step 2 Create ACL rules.


# Create advanced ACL rules 3001 and 3002 on the Switch to permit the packets with priorities
as 4, 5, 6, and 7 and priorities as 0, 1, 2, and 3 to pass through.
[Switch] acl 3001
[Switch-acl-adv-3001] rule permit ip precedence 0
[Switch-acl-adv-3001] rule permit ip precedence 1
[Switch-acl-adv-3001] rule permit ip precedence 2
[Switch-acl-adv-3001] rule permit ip precedence 3
[Switch-acl-adv-3001] quit
[Switch] acl 3002
[Switch-acl-adv-3002] rule permit ip precedence 4
[Switch-acl-adv-3002] rule permit ip precedence 5
[Switch-acl-adv-3002] rule permit ip precedence 6
[Switch-acl-adv-3002] rule permit ip precedence 7
[Switch-acl-adv-3002] quit

Step 3 Create traffic classifiers.


Create traffic classifiers c1 and c2 on the Switch with matching rules as ACL 3001 and ACL
3002.

[Switch] traffic classifier c1


[Switch-classifier-c1] if-match acl 3001
[Switch-classifier-c1] quit
[Switch] traffic classifier c2

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 64


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

[Switch-classifier-c2] if-match acl 3002


[Switch-classifier-c2] quit

Step 4 Create traffic behaviors.


# Create traffic behaviors b1 and b2 on the Switch to redirect packets to network segments
20.20.20.1/24 and 20.20.30.1/24.
[Switch] traffic behavior b1
[Switch-behavior-b1] redirect ip-nexthop 20.20.20.1
[Switch-behavior-b1] quit
[Switch] traffic behavior b2
[Switch-behavior-b2] redirect ip-nexthop 20.20.30.1
[Switch-behavior-b2] quit

Step 5 Create a traffic policy and apply it to an interface.


# Create traffic policy p1 on the Switch and bind traffic classifiers to traffic behaviors in the
traffic policy.
[Switch] traffic policy p1
[Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch-trafficpolicy-p1] classifier c2 behavior b2
[Switch-trafficpolicy-p1] quit

# Apply traffic policy p1 to GE 0/0/1.


[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] traffic-policy p1 inbound
[Switch-GigabitEthernet0/0/1] quit
[Switch] quit

Step 6 Verify the configuration.


# Check the configuration of ACL rules.
[Switch] display acl 3001
Advanced ACL 3001, 4 rules
Acl's step is 5
rule 5 permit ip precedence routine
rule 10 permit ip precedence priority
rule 15 permit ip precedence immediate
rule 20 permit ip precedence flash
[Switch] display acl 3002
Advanced ACL 3002, 4 rules
Acl's step is 5
rule 5 permit ip precedence flash-override
rule 10 permit ip precedence critical
rule 15 permit ip precedence internet
rule 20 permit ip precedence network

# Check the configuration of traffic classifiers.


[Switch] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c2
Operator: AND
Rule(s) : if-match acl 3002

Classifier: c1
Operator: AND
Rule(s) : if-match acl 3001

Total classifier number is 2

# View the configuration of the traffic policy.


<Switch> display traffic policy user-defined p1
User Defined Traffic Policy Information:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 65


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

Policy: p1
Classifier: c1
Operator: AND
Behavior: b1
Redirect:
Redirect ip-nexthop
20.20.20.1
Classifier: c2
Operator: AND
Behavior: b2
Redirect:
Redirect ip-nexthop
20.20.30.1

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 20 30
#
acl number 3001
rule 5 permit ip precedence routine
rule 10 permit ip precedence priority
rule 15 permit ip precedence immediate
rule 20 permit ip precedence flash
#
acl number 3002
rule 5 permit ip precedence flash-override
rule 10 permit ip precedence critical
rule 15 permit ip precedence internet
rule 20 permit ip precedence network
#
traffic classifier c1 operator and
if-match acl 3001
traffic classifier c2 operator and
if-match acl 3002
#
traffic behavior b1
redirect ip-nexthop 20.20.20.1
traffic behavior b2
redirect ip-nexthop 20.20.30.1
#
traffic policy p1
classifier c1 behavior b1
classifier c2 behavior b2
#
interface Vlanif20
ip address 20.20.20.2 255.255.255.0
#
interface Vlanif30
ip address 20.20.30.2 255.255.255.0
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20 30
traffic-policy p1 inbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20 30
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20 30

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 66


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

#
return

1.9.5 Example for Configuring Traffic Statistics Based on Complex


Traffic Classification
After traffic statistics based on complex traffic classification is configured, the S5700 collect
traffic statistics on packets with the specified source MAC address.

Networking Requirements
As shown in Figure 1-5, PC1 with the MAC address of 0000-0000-0003 is connected to other
devices through GE0/0/1 on the Switch. The Switch is required to collect the statistics on the
packets with the source MAC address of 0000-0000-0003.

Figure 1-5 Networking diagram for configuring traffic statistics based on complex traffic
classification

MAC:0000-0000-0003 VLANIF 20
20.20.20.1/24
Core
GE0/0/1 GE0/0/2
Network
20.20.20.2/24
PC1 Switch Router

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interfaces so that the Switch is connected to PC1 and the router.
2. Create an ACL to match the packets with the source MAC address as 0000-0000-0003.
3. Create a traffic classifier to match the ACL.
4. Create a traffic behavior to take the statistics on the matching packets.
5. Create a traffic policy, bind the traffic classifier to the traffic behavior in the traffic policy,
and apply the traffic policy to GE0/0/1 in the inbound direction.

Data Preparation
To complete the configuration, you need the following data:
l VLAN 20
l ACL 4000
l Traffic classifier c1
l Traffic behavior b1
l Traffic policy p1

Procedure
Step 1 Create a VLAN and configure interfaces.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 67


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

# Create VLAN 20.


<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan 20
[Switch-vlan20] quit

# Configure the type of GE0/0/1 as access and GE0/0/2 as trunk, and add GE0/0/1 and
GE0/0/2 to VLAN 20.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type access
[Switch-GigabitEthernet0/0/1] port default vlan 20
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 20
[Switch-GigabitEthernet0/0/2] quit

# Create VLANIF 20 and assign IP address 20.20.20.1/24 to it.


[Switch] interface vlanif 20
[Switch-Vlanif20] ip address 20.20.20.1 24
[Switch-Vlanif20] quit

NOTE

Assign network segment address 20.20.20.2/24 to the interface connecting the router and Switch. The
details are not mentioned here.

Step 2 Create an ACL.


# Create Layer 2 ACL 4000 on the Switch to match the packets with the source MAC address
as 0000-0000-0003.
[Switch] acl 4000
[Switch-acl-L2-4000] rule permit source-mac 0000-0000-0003 ffff-ffff-ffff
[Switch-acl-L2-4000] quit

Step 3 Create a traffic classifier.


Create traffic classifier c1 on the Switch with ACL 4000 as the matching rule.
[Switch] traffic classifier c1
[Switch-classifier-c1] if-match acl 4000
[Switch-classifier-c1] quit

Step 4 Create a traffic behavior.


# Create traffic behavior b1 on the Switch and configure the traffic statistics action.
[Switch] traffic behavior b1
[Switch-behavior-b1] statistic enable
[Switch-behavior-b1] quit

Step 5 Create a traffic policy and apply it to an interface.


# Create traffic policy p1 on the Switch and bind the traffic classifier to the traffic behavior in
the traffic policy.
[Switch] traffic policy p1
[Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch-trafficpolicy-p1] quit

Apply traffic policy p1 to GE0/0/1.


[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] traffic-policy p1 inbound

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 68


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 1 Class-based QoS Configuration

[Switch-GigabitEthernet0/0/1] quit
[Switch] quit

Step 6 Verify the configuration.

# Check the configuration of the ACL.


<Switch> display acl 4000
L2 ACL 4000, 1 rule
Acl's step is 5
rule 5 permit source-mac 0000-0000-0003

# Check the configuration of the traffic classifier.


<Switch> display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c1
Operator: AND
Rule(s) : if-match acl 4000
Total classifier number is 1

# View the configuration of the traffic policy.


<Switch> display traffic policy user-defined p1
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: AND
Behavior: b1
statistic: enable

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 20
#
acl number 4000
rule 5 permit source-mac 0000-0000-0003
#
traffic classifier c1 operator and
if-match acl 4000
#
traffic behavior b1
statistic enable
#
traffic policy p1
classifier c1 behavior b1
#
interface Vlanif20
ip address 20.20.20.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
traffic-policy p1 inbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
return

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 69


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

2 Traffic Policing and Traffic Shaping


Configuration

About This Chapter

This document describes basic concepts of traffic policing and traffic shaping, and introduces
the configuration method of traffic policing based on a traffic classifier, and traffic shaping, and
provides configuration examples.

2.1 Traffic Policing and Traffic Shaping Overview


This section describes the basic concepts of traffic policing and traffic shaping and the
differences between traffic policing and traffic shaping.
2.2 Configuring Traffic Policing Based on an Interface
After traffic policing based on an interface is configured, the S5700 policies the traffic on the
interface.
2.3 Configuring Traffic Policing Based on a Traffic Classifier
After traffic policing based on a traffic classifier is configured, the S5700 policies the traffic
matching traffic classification rules.
2.4 Configuring Traffic Shaping
After traffic shaping is configured, the S5700 shapes packets matching traffic classification rules
so that packets are sent out at an even rate.
2.5 Maintaining Traffic Policing and Traffic Shaping
This section describes how to maintain traffic policing and traffic shaping.
2.6 Configuration Examples
This section provides several configuration examples of traffic policing and traffic shaping.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 70


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

2.1 Traffic Policing and Traffic Shaping Overview


This section describes the basic concepts of traffic policing and traffic shaping and the
differences between traffic policing and traffic shaping.

2.1.1 Traffic Policing


To make full use of limited network resources, perform traffic policing for special service flows
to adapt to the allocated network resources.
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.

Token Bucket and Traffic Measurement


When the traffic exceeds the rate limit, the S5700 uses traffic control policies. Generally, the
S5700 uses a token bucket to measure the volume of traffic.
A token bucket is considered as a container that stores a certain number of tokens. The S5700
puts tokens at the configured rate (one token bucket can forward one bit of data) in a token
bucket. When the token bucket is full, the excess tokens overflow and the number of tokens no
longer increases.
When measuring the traffic in a token bucket, the S5700 forwards packets based on the number
of tokens in the token bucket. If there are sufficient tokens in the token bucket to forward packets,
the traffic rate is within the rate limit. Otherwise, the traffic rate exceeds the rate limit.

Figure 2-1 Using a token bucket to measure the traffic


Put tokens into the bucket at
the set rate
Packets that need to be
sent from this interface
Continue to send

Classification

Token
bucket

Drop

The S5700 supports the single token bucket and dual token buckets.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 71


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l Single token bucket


The single token bucket technology uses the following parameters:
– Committed burst size (CBS): indicates the maximum volume of traffic that bursts in
bucket C, in bytes.
– Committed information rate (CIR): indicates the rate of tokens that are put into bucket
C, that is, the average traffic rate allowed by bucket C, in kbit/s.
If there are sufficient tokens in the bucket, packets are forwarded. At the same time, the
number of tokens in the bucket decreases based on the length of the packets. If there are
no tokens in the bucket, packets are discarded.
l Dual token buckets
The dual token bucket technology uses the following parameters in addition to the CIR and
CBS:
– Peak burst size (PBS): indicates the maximum volume of traffic that bursts and exceeds
the CBS in bucket P, in bytes.
– Peak information rate (PIR): indicates the rate of tokens that are put into bucket P, that
is, the average traffic rate allowed by bucket P, in kbit/s.
For the dual token buckets:
– The service traffic that less than the CIR value is colored green and is allowed to pass
through.
– The service traffic that exceeds the PIR value is colored red and is discarded.
– The service traffic that ranges from the CIR value to the PIR value is colored yellow
and is discarded when congestion occurs.

Traffic Policing Features Supported by the S5700


The S5700 supports the following traffic policing features:

l Interface-based traffic policing.


Interface-based traffic policing controls all incoming traffic on an interface regardless of
packet types and discards the excess traffic, limiting traffic within a proper range and
protecting network resources and carriers' interests.
l Traffic policing based on a traffic classifier
Traffic policing based on a traffic classifier limits the rate of the traffic matching a traffic
classifier. The S5700 limits the rate of incoming traffic and discards the traffic that exceeds
the rate limit, limiting traffic within an appropriate range and protecting network resources
and carriers' interests. Traffic policing based on a traffic classifier uses dual token buckets.
After traffic policing based on a traffic classifier is configured on an S5700HI or S5706,
CAR can be performed twice for upstream flows. The S5700HI or S5706 first applies CAR
to the upstream flows that matches a traffic classifier, and then aggregates all the upstream
flows and applies CAR to limit the aggregated flows. The upstream flows refer to the
incoming service flows matching a traffic classifier that is bound to a traffic behavior
containing aggregate CAR.
NOTE

l Aggregate CAR supports only the single token bucket.


l Traffic policing based on a traffic classifier on the S5700HI and S5706 implements interface-
based and flow-based rate limiting in both directions. The matching rule is set to if-match any.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 72


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

2.1.2 Traffic Shaping


Traffic shaping controls the rate of packets so that packets are sent at an even rate. Traffic shaping
adapts the transmission rate of packets to the downstream devices to prevent unnecessary packet
loss and congestion.

Traffic shaping also limits traffic and resources by monitoring the traffic rate. In traffic shaping,
the S5700 also uses token buckets to measure the traffic.

Difference Between Traffic Shaping and Traffic Policing


The main difference between traffic shaping and traffic policing is that the S5700 caches the
packets discarded in traffic policing. These packets are stored in a buffer or a queue, as shown
in Figure 2-2. When there are sufficient tokens in a token bucket, those cached packets are sent
out at an average rate.

Figure 2-2 Networking diagram of traffic shaping


Put tokens into the bucket at
the set rate
Packets that need to be
sent from this interface
Continue to send

Classification

Token
bucket
Queue
Drop

The delay may be increased just because the traffic shaping technology puts the packets into a
buffer or a queue. The traffic policing technology, however, does not cause a delay.

Traffic Shaping Features Supported by the S5700


The S5700 supports the following traffic shaping features:
l Traffic shaping on an interface
The S5700 performs traffic shaping for all the packets that pass through an interface.
l Traffic shaping in an interface queue
The S5700 performs traffic shaping for the packets of a certain type that pass through an
interface based on simple traffic classification. In this manner, traffic shaping based on
voice, data, and video services is implemented.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 73


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

NOTE

The S5700 does not support traffic shaping according to user-defined policy.

2.2 Configuring Traffic Policing Based on an Interface


After traffic policing based on an interface is configured, the S5700 policies the traffic on the
interface.

2.2.1 Establishing the Configuration Task


Before configuring traffic policing based on an interface, familiarize yourself with the applicable
environment, complete the pre-configuration tasks, and obtain the required data. This helps you
complete the configuration task quickly and accurately.

Applicable Environment
If the service traffic sent by users is not limited, a large amount of increasing burst service data
makes a network more congested. To make full use of network resources and provide better
services for more users, you must limit user service traffic. After interface-based traffic policing
is applied to the interface, the rate of all the user service traffic entering the interface is limited.

Pre-configuration Tasks
Before configuring a limit rate on the interface, complete the following tasks:
l Setting physical parameters of interfaces
l Setting link layer attributes of interfaces to ensure normal operation of these interfaces
l Assigning IP addresses to the interfaces and configuring routing protocols to ensure that
routes are reachable

Data Preparation
To configure interface-based traffic policing, you need the following data.

No. Data

1 CIR and CBS

2 Interface where traffic policing is configured or queue index

2.2.2 Limiting the Rate of Traffic on the Interface


To limit the rate of traffic entering the S5700, configure traffic policing on the inbound interface.

Procedure
Step 1 Run:
system-view

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 74


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The interface view is displayed.

Or, run:
port-group port-group-name

The port group view is displayed.

NOTE

You can configure interface-based traffic policing on GE and XGE interfaces.


To set the same QoS CAR parameters on multiple interfaces, perform the configuration on the port group
to reduce the workload.
You need to create a port group before performing this task. For details on how to create a port group, see
(Optional) Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration
Guide - Ethernet.

Step 3 Run:
qos lr { inbound | outbound } cir cir-value [ cbs cbs-value ]

Traffic policing is configured on the interface.

----End

2.2.3 Configuring the Rate Limit on the Management Interface


Traffic policing on the management interface limits the traffic received from the management
interface to improve system performance.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface meth 0/0/1

The MEth interface view is displayed.

Step 3 Run:
qos lr pps packets

The rate limit is set.

NOTE

The rate limit of traffic on the management interface cannot be smaller than 100; otherwise, FTP and Telnet
functions may fail to work.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 75


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

2.2.4 Checking the Configuration


After interface-based rate limit is configured, you can view rate limit information on the
interface.

Prerequisite
The configurations of interface-based rate limit are complete.

Procedure
l Run the display qos lr { inbound | outbound } interface interface-type interface-
number command to view rate limit information on the interface.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configuration on the interface.
----End

2.3 Configuring Traffic Policing Based on a Traffic


Classifier
After traffic policing based on a traffic classifier is configured, the S5700 policies the traffic
matching traffic classification rules.

2.3.1 Establishing the Configuration Task


Before configuring traffic policing based on 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
If the service traffic sent by users is not limited, a network is congested because a large number
of users send bursts of data in the same period. To make full use of limited network resources
and provide better services for more users, limit user service traffic.
Traffic policing based on a traffic classifier can be used to control the service traffic of a certain
type.

Pre-configuration Tasks
Before configuring traffic policing based on a traffic classifier, complete the following tasks:
l Setting physical parameters of interfaces
l Setting link layer attributes of interfaces to ensure that these interfaces work properly
l Assigning IP addresses to the interfaces and configuring routing protocols to ensure that
routes are reachable

Data Preparation
To configure traffic policing based on a traffic classifier, you need the following data.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 76


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

No. Data

1 Name of the traffic classifier and related parameters

2 Name of the traffic behavior and CAR parameters: CIR, (optional) CBS, (optional)
PIR, (optional) PBS, (optional) color

3 Name of the traffic policy, and object and inbound or outbound direction to which
traffic policing based on a traffic classifier is applied

2.3.2 Configuring Complex Traffic Classification


The S5700 can classify traffic according to the ACL, Layer 2 information in packets, and Layer
3 information in packets.
Select proper traffic classification rules and configure complex traffic classification as required.
For details, see 1.6.2 Configuring Complex Traffic Classification.

2.3.3 Configuring a Traffic Policing Action on the S5700SI or


S5700EI
You can configure traffic policing actions, set CAR parameters of the CIR, CBS, PIR, and PBS
values, and set actions for packets with different PHBs and colors.

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 command on the S5700EI:
car [ aggregation ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ]
[ green { discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-
precedence ] } ] [ yellow { discard | pass [ remark-dscp dscp-value | remark-8021p
8021p-precedence ] } ] [ red { discard | pass [ remark-dscp dscp-value |
remark-8021p 8021p-precedence ] } ]

The CAR is configured.


Run the following command on the S5700SI:
car [ aggregation ] cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ]
[ green pass ] [ yellow { discard | pass [ remark-dscp dscp-value | remark-8021p
8021p-precedence ] } ] [ red { discard | pass [ remark-dscp dscp-value |
remark-8021p 8021p-precedence ] } ]

The CAR is configured.


You can define the color of packets in traffic policing:
l When the burst size of a packet is smaller than the CBS value, the packet is colored green.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 77


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l When the burst size of a packet is equal to or larger than the CBS value but smaller than the
PBS value, the packet is colored yellow.
l When the burst size of a packet is equal to or larger than the PBS value, the packet is colored
red.
NOTE

If you configure the CAR action multiple times in the same traffic behavior view, only the latest
configuration takes effect.
If aggregation is specified, when a traffic policy bound to the traffic behavior containing aggregate CAR
is applied to multiple interfaces, the system aggregates all the flows on the interfaces and applies the CAR
to the flows.

----End

2.3.4 Configuring a Traffic Policing Action on the S5700HI and


S5706
You can configure traffic policing actions, set the CIR, PIR, CBS, and PBS values, and configure
actions for packets with different PHBs and colors.

Context
Level-2 CAR is supported by the S5700HI and S5706. After the system applies the CAR to the
service flows matching a traffic classifier in a traffic policy, it aggregates all the service flows
matching the traffic classifier bound to the aggregate CAR action in the same traffic policy and
applies the CAR to the flows. This is also called hierarchical traffic policing.

Hierarchical traffic policing implements traffic statistics multiplexing and service control. For
example, hierarchical traffic policing limits the traffic of services of level-1 and level-2 users or
traffic of level-1 user groups and level-2 users.

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 [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ green
{ discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-precedence ] } ]
[ yellow { discard | pass [ remark-dscp dscp-value | remark-8021p 8021p-
precedence ] } ] [ red { discard | pass [ remark-dscp dscp-value | remark-8021p
8021p-precedence ] } ]

A CAR action is configured.

You can define the color of packets in the CAR action:

l When the burst size of a packet is smaller than the CBS value, the packet is colored green.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 78


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l When the burst size of a packet is equal to or larger than the CBS value but smaller than the
PBS value, the packet is colored yellow.
l When the burst size of a packet is equal to or larger than the PBS value, the packet is colored
red.
Step 4 Run:
quit

Exit from the traffic behavior view.


Step 5 (Optional) Conduct the following steps to configure aggregate CAR.
1. Run:
system-view

The system view is displayed.


2. Run:
qos car car-name cir cir-value [ cbs cbs-value [ pbs pbs-value ] | pir pir-
value [ cbs cbs-value pbs pbs-value ] ]

A CAR profile is created.

NOTE

Aggregate CAR supports only the single token bucket.


3. Run:
traffic behavior behavior-name

A traffic behavior is created and the traffic behavior view is displayed.


4. Run:
car car-name share

An aggregate CAR action is configured.

NOTE

Aggregate CAR is valid for only incoming packets.


After aggregate CAR is configured, the rules in a traffic classifier bound to a traffic behavior share
a CAR index. The system aggregates the traffic and implements the CAR for the traffic. If the traffic
classifier contains both Layer 2 information-based rules and Layer 3 information-based rules, the
car share command does not take effect.

----End

2.3.5 Creating a Traffic Policy


You can associate a traffic classifier with a traffic behavior in a traffic policy.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run the following commands as required.
l On the S5700SI orS5700EI, run:
traffic policy traffic-policy-name

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 79


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

A traffic policy is created and the traffic policy view is displayed.


l On the S5700HI and S5706, run:
traffic policy policy-name [ match-order { auto | config } ]

A traffic policy is created and the traffic policy view is displayed.


After a traffic policy is applied, you cannot use the traffic policy command to modify the
matching order of traffic classifiers in the traffic policy. To modify the matching order,
unbind the traffic policy from the system, an interface, or a VLAN where it is applied, and
re-create a traffic policy and specify the matching order.

Step 3 Run:
classifier classifier-name behavior behavior-name

A traffic classifier is bound to a traffic behavior in the traffic policy.

----End

2.3.6 Applying the Traffic Policy


The configured traffic policy takes effect only after being applied to the system or a slot, an
interface, or a VLAN.

Procedure
l Applying a traffic policy to the system or a slot
1. Run:
system-view

The system view is displayed.


2. Run:
traffic-policy policy-name global { inbound | outbound } [ slot slot-id ]

A traffic policy is applied to the system or a slot in the inbound or outbound direction.

Only one traffic policy can be applied to the system in the inbound or outbound
direction.

Only one traffic policy can be applied to a slot in the inbound or outbound direction.
A traffic policy cannot be applied to the system and a slot simultaneously.

– If a stack system is established, a traffic policy that is applied to the system takes
effect on all the interfaces and VLANs of all the member switches in the stack.
The system then performs traffic policing for all the incoming and outgoing packets
that match traffic classification rules on all the member switches. A traffic policy
that is applied to a specified slot takes effect on all the interfaces and VLANs of
the member switch with the specified stack ID. The system then performs traffic
policing for all the incoming and outgoing packets that match traffic classification
rules on this member switch.
– If a stack system is not established, a traffic policy that is applied to the system
takes effect on all the interfaces and VLANs of the local switch. The system then
performs traffic policing for all the incoming and outgoing packets that match
traffic classification rules on the local switch. Traffic policies applied to the slot
and system have the same functions.
l Applying a traffic policy to an interface

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 80


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
traffic-policy policy-name { inbound | outbound }

A traffic policy is applied to the interface in the inbound or outbound direction.

Only one traffic policy can be applied to an interface in the inbound or outbound
direction.

After a traffic policy is applied, the system performs traffic policing for the packets
that pass through this interface and match a traffic classifier in the inbound or outbound
direction.
l Applying a traffic policy to a VLAN
1. Run:
system-view

The system view is displayed.


2. Run:
vlan vlan-id

The VLAN view is displayed.


3. Run:
traffic-policy policy-name { inbound | outbound }

A traffic policy is applied to the VLAN in the inbound or outbound direction.

Only one traffic policy can be applied to a VLAN in the inbound or outbound direction.

After a traffic policy is applied, the system performs traffic policing for the packets
that belong to a VLAN and match a traffic classifier in the inbound or outbound
direction.

----End

2.3.7 Checking the Configuration


After traffic policing based on a traffic classifier is configured, you can view the traffic statistics
or CAR statistics.

Context
The configurations of traffic policing based on a traffic classifier are complete.

Procedure
l Run the display traffic behavior user-defined [ behavior-name ] command to check the
traffic behavior configuration.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 81


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l Run the display traffic classifier 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 { interface [ interface-type interface-number ] | vlan [ vlan-
id ] | global } [ inbound | outbound ] command to check the traffic policy information and
flow-based traffic statistics.
l Run the display qos car { all | car-name } command to check the CAR profile
configuration.
NOTE

S5700SI and S5700EI do not support the display qos car command.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configurations on the interface.

----End

2.4 Configuring Traffic Shaping


After traffic shaping is configured, the S5700 shapes packets matching traffic classification rules
so that packets are sent out at an even rate.

2.4.1 Establishing the Configuration Task


Before configuring traffic shaping, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the required data. This helps you complete the
configuration task quickly and accurately.

Applicable Environment
If the bandwidth of upstream and downstream networks is different, you can configure traffic
shaping on the outgoing interface connecting the upstream network and downstream network.
In this manner, the rate of packets sent to the downstream network meets the requirements of
the bandwidth of the downstream network. This can prevent congestion and packet loss on the
network to a certain degree.

The S5700 supports traffic shaping on an interface and in an interface queue. You can configure
traffic shaping as required. If traffic shaping of these two types is configured, ensure that the
CIR for traffic shaping on an interface must be greater than or equal to the sum of CIRs for traffic
shaping in an interface queue. Otherwise, traffic shaping fails. For example, traffic of lower
priorities preempts the bandwidth of traffic of higher priorities.

Pre-configuration Tasks
Before configuring traffic shaping, complete the following tasks:

l Setting link layer attributes of interfaces to ensure normal operation of the interfaces
l Assigning IP addresses to the interfaces and configuring routing protocols to ensure that
routes are reachable

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 82


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Data Preparation
To configure traffic shaping, you need the following data.

No. Data

1 Rate for traffic shaping on an interface

2 (Optional) Rate for traffic shaping in an interface queue, including the CIR and PIR

3 Interface on which traffic shaping is applied or index of the queue

2.4.2 Configuring Traffic Shaping on an Interface


You can configure traffic shaping on an interface to limit the rate of data sent by the interface.

Context
To perform traffic shaping for all the downstream packets on an interface, perform this
procedure.

If you need to set the same traffic shaping rate on multiple interfaces, you can perform the
configuration on the port group to reduce the workload.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The interface view is displayed.

Or run the port-group port-group-name command to display the port group view.

NOTE

Create a port group before performing this task. For details on how to create a port group, see Configuring
the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration Guide - Ethernet.

Step 3 Run:
qos lr { inbound | outbound } cir cir-value [ cbs cbs-value ]

The rate for traffic shaping on an interface is set.

By default, the CIR for traffic shaping on an interface is the maximum bandwidth of the interface.
For example, the CIR for traffic shaping on a GE interface is 1000000 kbit/s ; the CIR for traffic
shaping on a 10GE interface is 10000000 kbit/s.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 83


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

NOTE

l If this command is run repeatedly on the same interface, the latest configuration overrides the previous
configuration.
l If traffic shaping in an interface queue is configured on the same interface, the CIR for traffic shaping
on an interface must be greater than or equal to the sum of CIRs for traffic shaping in an interface
queue. Otherwise, traffic shaping fails. For example, traffic of lower priorities preempts the bandwidth
of traffic of higher priorities.

----End

2.4.3 (Optional) Setting the Length of the Interface Queue


You can set the maximum number of packets that can be buffered in the specified interface queue
by setting the length of the interface queue.

Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index max-length packet-number

The length of the interface priority queue is set.


5. Run:
undo shutdown

The interface is restarted.


l (Optional) Setting the length of the interface queue on the S5700SI
1. Run:
system-view

The system view is displayed.


2. Run:
qos tail-drop-profile profile-name

A global tail drop template is created and the tail drop template view is displayed.
3. Run:
qos queue queue-index max-length packet-number [ green max-length packet-
number ]

The length of the interface queue is set.


4. Run:
quit

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 84


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Return to the system view.


5. Run:
interface interface-type interface-number

The interface view is displayed.


6. Run:
shutdown

The interface is shut down.


7. Run:
qos tail-drop-profile profile-name

The tail drop template is applied to the interface.


8. Run:
undo shutdown

The interface is restarted.


l Setting the length of the interface queue on the S5700HI and S5706
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index length length-value

The length of the interface priority queue is set.


5. Run:
undo shutdown

The interface is restarted.


----End

2.4.4 Configuring Traffic Shaping in an Interface Queue


This section describes how to configure traffic shaping, enable traffic shaping in an interface
queue, and set traffic shaping parameters.

Context
To perform traffic shaping for packets of a certain type of services on an interface, perform this
procedure.
Before configuring traffic shaping in an interface queue, you need to map priorities of packets
to PHBs based on simple traffic classification or re-mark the internal priorities based on complex
traffic classification. Different services can enter different interface queues.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 85


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

To set the same queue shaping rate on multiple interfaces, perform the configuration on the port
group to reduce the workload.

NOTE

For details about priority mapping based on simple traffic classification, see Configuring Priority
Mapping Based on Simple Traffic ClassificationandConfiguring Priority Mapping Based on Simple
Traffic Classification
For details about internal priority re-marking based on complex traffic classification, see Creating a
Traffic Policy Based on Complex Traffic Classification.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The interface view is displayed.

Or, run:
port-group port-group-name

The port group view is displayed.

NOTE

Create a port group before performing this task. For details on how to create a port group, see Configuring
the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration Guide - Ethernet.

Step 3 Run:
qos queue queue-index shaping cir cir-value pir pir-value [ cbs cbs-value pbs pbs-
value ]

The rate for traffic shaping in an interface queue is set.

By default, the rate for traffic shaping in an interface queue is the maximum bandwidth of the
interface.

----End

2.4.5 Checking the Configuration


After traffic shaping is configured, you can view the rate limit on an interface or in an interface
queue.

Context
Before viewing the traffic shaping parameters of an interface queue, run the qos queue statistics
enable command to enable the traffic statistics function for the interface queue.

Procedure
l Run the display qos lr { inbound | outbound } interface interface-type interface-
number command to check the rate limit on the specified interface.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 86


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l (S5700SI) Run the display qos queue statistics [ queue queue-index outbound
interface interface-type interface-number ] command to check the rate limit in an interface
queue.
l (S5700EI) Run the display qos queue statistics [ queue queue-index { inbound
interface interface-type interface-number | outbound interface interface-type interface-
number [ form interface { interface-type interface-number | all } ] } ] command to check
the rate limit of the interface queue.
l (S5700HI and S5706) Run the display qos queue statistics interface interface-type
interface-number command to check the rate limit of the interface queue.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configurations on the interface.

----End

2.5 Maintaining Traffic Policing and Traffic Shaping


This section describes how to maintain traffic policing and traffic shaping.

2.5.1 Displaying the Traffic Statistics


If the traffic statistics action is configured, you can run display commands to view the traffic
statistics.

Context
To view the flow-based traffic statistics, a traffic policy must exist and contain the traffic
statistics action.

Before viewing the queue-based traffic statistics on the S5700SI and S5700EI, run the qos queue
statistics enable command to enable the queue-based traffic statistics function on the specified
outbound interface.

Procedure
l Run the display traffic policy statistics { global [ slot slot-id ] | interface interface-type
interface-number | vlan vlan-id } { inbound | outbound } [ verbose { classifier-base |
rule-base } [ class classifier-name ] ] command to check the flow-based traffic statistics.
l (S5700SI) Run the display qos queue statistics [ queue queue-index outbound
interface interface-type interface-number ] command to check the queue-based traffic
statistics on the interface.
l (S5700EI) Run the display qos queue statistics [ queue queue-index { inbound
interface interface-type interface-number | outbound interface interface-type interface-
number [ form interface { interface-type interface-number | all } ] } ] command to check
the queue-based traffic statistics on the interface.
l (S5700HI or S5706) Run the display qos queue statistics interface interface-type
interface-number command to check the queue-based traffic statistics on the interface.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 87


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

2.5.2 Displaying the Maximum Length of a Queue


You can use the display command to view the maximum number of packets that can be buffered
in an interface queue.

Context
NOTE

The S5700SI, S5700HI and S5706 do not support the display qos max-length command.

To view the maximum length of a queue, you can run the following command in any view.

Procedure
l Run the display qos max-length [ interface interface-type interface-number { queue
queue-index | all } ] command to check the maximum number of packets that can be
buffered in an interface queue.

----End

2.5.3 Checking the Usage of the Queue


You can use display commands to view the Usage of the Queue.

Context
To obtain the usage of queues, you can run the following command in any view.

Procedure
l Run the display qos queue length interface interface-type interface-number command to
view the usage of priority queues on the interface.
NOTE

S5700SI and S5700EI do not support the display qos queue length command.

----End

2.5.4 Clearing the Traffic Statistics


You can use the reset commands to clear the traffic statistics.

Context

CAUTION
The traffic statistics cannot be restored after being cleared. Exercise caution when you run the
command.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 88


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Procedure
l Run the reset traffic policy statistics { global [ slot slot-id ] | interface interface-type
interface-number | vlan vlan-id } { inbound | outbound } command to clear the flow-
based traffic statistics.
l (S5700SI) Run the reset qos queue statistics [ queue queue-index outbound interface
interface-type interface-number ] command to clear the queue-based traffic statistics on
the interface.
(S5700EI) Run the reset qos queue statistics [ queue queue-index { inbound interface
interface-type interface-number | outbound interface interface-type interface-number
[ form interface { interface-type interface-number | all } ] } ] command to clear the queue-
based traffic statistics on the interface.
(S5700HI or S5706) Run the reset qos queue statistics interface interface-type interface-
number command to clear the queue-based traffic statistics on the interface.
----End

2.6 Configuration Examples


This section provides several configuration examples of traffic policing and traffic shaping.

2.6.1 Example for Configuring Traffic Policing Based on an


Interface
You can configure interface-based traffic policing so that the Switch can provide different
bandwidth services for users.

Networking Requirements
As shown in Figure 2-3, the Switch is connected to GE 0/0/3 through the router; branch 1 and
branch 2 of the enterprise are connected to the Switch through GE 0/0/1 and GE 0/0/2 and access
the network through the Switch and router. Branch 1 and branch 2 of the enterprise require 8
Mbit/s and 5 Mbit/s bandwidth.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 89


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Figure 2-3 Networking diagram of traffic policing

Core network

Router
GE0/0/3

GE0/0/1 GE0/0/2
Switch

LSW1 LSW2

branch 1 of
branch 2 of the
the enterprise
enterprise

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure interfaces of the Switch so that users can access the network.
2. Configure traffic policing on GE 0/0/1 and GE 0/0/2 of the Switch in the inbound direction.

Data Preparation
To complete the configuration, you need the following data:
l Uplink interface address of the Switch: 192.168.1.1/24
l VLAN IDs of branch 1 and branch 2 of the enterprise: VLAN 100 and VLAN 200
l CIR of branch 1: 8192 kbit/s; CIR of branch 2: 5120 kbit/s

Procedure
Step 1 Create VLANs and configure interfaces of the Switch.
# Create VLANs 100, 200, and 300, and then add GE 0/0/1, GE 0/0/2, and GE 0/0/3 to VLANs
100, 200, and 300.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 100 200 300

# Set the type of GE 0/0/1, GE 0/0/2, and GE 0/0/3 to trunk and configure GE 0/0/1, GE 0/0/2,
and GE 0/0/3 to allow packets from VLANs 100, 200, and 300 to pass through.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 90


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

[Switch] interface gigabitethernet0/0/1


[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 100
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 200
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 300
[Switch-GigabitEthernet0/0/3] quit

# Create VLANIF 300 and set its network segment address to 192.168.1.1/24.

[Switch] interface vlanif 300


[Switch-Vlanif300] ip address 192.168.1.1 24
[Switch-Vlanif300] quit

NOTE

# On the router, set the IP address of the interface connecting the router and Switch to 192.168.1.2/24.

Step 2 Configure interface-based traffic policing.


# Configure traffic policing on GE 0/0/1 and GE 0/0/2 of the Switch.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] qos lr inbound cir 8192
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] qos lr inbound cir 5120
[Switch-GigabitEthernet0/0/2] quit
[Switch] quit

Step 3 Verify the configuration.


# View the traffic policing configuration.
[Switch] display qos lr inbound interface gigabitethernet0/0/1
GigabitEthernet0/0/1 lr inbound:
cir: 8192 Kbps, cbs: 1024000 Byte
[Switch] display qos lr inbound interface gigabitethernet0/0/2
GigabitEthernet0/0/2 lr inbound:
cir: 5120 Kbps, cbs: 640000 Byte

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 200 300
#
interface Vlanif300
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100
qos lr inbound cir 8192 cbs 1024000
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 200
qos lr inbound cir 5120 cbs 640000

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 91


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 100 200 300
#

return

2.6.2 Example for Configuring Traffic Policing Based on a Traffic


Classifier
The Switch provides different bandwidth by configuring traffic policing based on a traffic
classifier and setting different CAR parameters.

Networking Requirements
The Switch is connected to the router by using GE 0/0/2; enterprise users can access the network
by using the Switch and the router. See Table 2-1.
l Voice services of the enterprise belong to VLAN 120.
l Video services of the enterprise belong to VLAN 110.
l Data services of the enterprise belong to VLAN 100.
On the Switch, traffic policing needs to be performed on packets of different services to limit
traffic within a proper range and ensure bandwidth of each service.
DSCP priorities carried in service packets sent from the user side cannot be trusted and services
require different QoS in practice. Therefore, you need to re-mark DSCP priorities of different
service packets on the Switch so that the downstream router can process packets based on
priorities.
The requirements are as follows:

Table 2-1 QoS provided by the Switch for upstream traffic


Traffic Type CIR (Mbit/s) PIR (Mbit/s) DSCP Priority

Voice 2 10 46

Video 4 10 30

Data 4 10 14

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 92


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Figure 2-4 Network diagram for configuring traffic policing based on a traffic classifier

Phone
VLAN 120

VLAN 100 GE0/0/1 GE0/0/2 Core


Enterprise
network
LSW Switch Router
PC
VLAN 110

TV

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure interfaces so that enterprise can access the network by using
the Switch.
2. Create traffic classifiers based on the VLAN ID on the Switch.
3. Create traffic behaviors on the Switch to limit the traffic received from the enterprise and
re-mark DSCP priorities of packets.
4. Create a traffic policy on the Switch, bind traffic behaviors to traffic classifiers in the traffic
policy, and apply the traffic policy to the interface between the enterprise and the Switch.

Data Preparation
To complete the configuration, you need the following data:
l Names of traffic classifiers matching service flows
l Re-marked priorities of packets with different VLAN IDs
l Parameters for packets with different VLAN IDs: CIR and PIR values
l Type and number of the interface to which a traffic policy needs to be applied

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 100, VLAN 110, and VLAN 120 on the Switch.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 100 110 120

# Configure the access types of GE 0/0/1 and GE0/0/2 to trunk, add GE 0/0/1 and GE0/0/2 to
VLAN 100, VLAN 110, and VLAN 120.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 110 120

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 93


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 100 110 120
[Switch-GigabitEthernet0/0/2] quit

Step 2 Create traffic classifiers.


# Create traffic classifiers c1 to c3 on the Switch to match different service flows from the
enterprise based on VLAN IDs.
[Switch] traffic classifier c1 operator and
[Switch-classifier-c1] if-match vlan-id 120
[Switch-classifier-c1] quit
[Switch] traffic classifier c2 operator and
[Switch-classifier-c2] if-match vlan-id 110
[Switch-classifier-c2] quit
[Switch] traffic classifier c3 operator and
[Switch-classifier-c3] if-match vlan-id 100
[Switch-classifier-c3] quit

Step 3 Create traffic behaviors.


# Create traffic behaviors b1 to b3 on the Switch to limit different service flows and re-mark
priorities.
[Switch] traffic behavior b1
[Switch-behavior-b1] car cir 2000 pir 10000 green pass
[Switch-behavior-b1] remark dscp 46
[Switch-behavior-b1] statistic enable
[Switch-behavior-b1] quit
[Switch] traffic behavior b2
[Switch-behavior-b2] car cir 4000 pir 10000 green pass
[Switch-behavior-b2] remark dscp 30
[Switch-behavior-b2] statistic enable
[Switch-behavior-b2] quit
[Switch] traffic behavior b3
[Switch-behavior-b3] car cir 4000 pir 10000 green pass
[Switch-behavior-b3] remark dscp 14
[Switch-behavior-b3] statistic enable
[Switch-behavior-b3] quit

Step 4 Create a traffic policy and apply it on the interface.


# Create traffic policy p1 on the Switch, bind traffic classifiers to traffic behaviors in the traffic
policy, and apply the traffic policy to GE0/0/1 in the inbound direction to limit the packets
received from the user side and re-mark priorities of these packets.
[Switch] traffic policy p1
[Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch-trafficpolicy-p1] classifier c2 behavior b2
[Switch-trafficpolicy-p1] classifier c3 behavior b3
[Switch-trafficpolicy-p1] quit
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] traffic-policy p1 inbound
[Switch-GigabitEthernet0/0/1] quit

Step 5 Verify the configuration.


# Check the configuration of the traffic classifier.
[Switch] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: c2
Operator: AND
Rule(s) : if-match vlan-id 110

Classifier: c3

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 94


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Operator: AND
Rule(s) : if-match vlan-id 100

Classifier: c1
Operator: AND
Rule(s) : if-match vlan-id 120

Total classifier number is 3

# Check the configuration of the traffic policy. Here, the configuration of the traffic policy p1
is displayed.
[Switch] display traffic policy user-defined p1
User Defined Traffic Policy Information:
Policy: p1
Classifier: c1
Operator: AND
Behavior: b1
Committed Access Rate:
CIR 2000 (Kbps), CBS 250000 (Byte)
PIR 10000 (Kbps), PBS 1250000 (Byte)
Green Action : pass
Yellow Action : pass
Red Action : discard
Marking:
Remark DSCP ef
statistic: enable
Classifier: c2
Operator: AND
Behavior: b2
Committed Access Rate:
CIR 4000 (Kbps), CBS 500000 (Byte)
PIR 10000 (Kbps), PBS 1250000 (Byte)
Green Action : pass
Yellow Action : pass
Red Action : discard
Marking:
Remark DSCP af33
statistic: enable
Classifier: c3
Operator: AND
Behavior: b3
Committed Access Rate:
CIR 4000 (Kbps), CBS 500000 (Byte)
PIR 10000 (Kbps), PBS 1250000 (Byte)
Green Action : pass
Yellow Action : pass
Red Action : discard
Marking:
Remark DSCP af13
statistic: enable

# Check the configuration of the traffic policy applied on an interface. Here, the configuration
of the traffic policy applied to GE0/0/1 is displayed.
[Switch] display traffic policy statistics interface gigabitethernet 0/0/1 inbound

Interface: GigabitEthernet0/0/1
Traffic policy inbound: p1
Rule number: 3
Current status: OK!
---------------------------------------------------------------------
Board : 0
Item Packets Bytes
---------------------------------------------------------------------
Matched 10 10000
+--Passed 8 8000
+--Dropped 2 2000
+--Filter 2 2000

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 95


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

+--URPF 0 0
+--CAR 2 2000

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 110 120
#
traffic classifier c1 operator and
if-match vlan-id 120
traffic classifier c2 operator and
if-match vlan-id 110
traffic classifier c3 operator and
if-match vlan-id 100
#
traffic behavior b1
car cir 2000 pir 10000 cbs 250000 pbs 1250000 green pass yellow pass red
discard
remark dscp ef
statistic enable
traffic behavior b2
car cir 4000 pir 10000 cbs 500000 pbs 1250000 green pass yellow pass red
discard
remark dscp af33
statistic enable
traffic behavior b3
car cir 4000 pir 10000 cbs 500000 pbs 1250000 green pass yellow pass red
discard
remark dscp af13
statistic enable
#
traffic policy p1
classifier c1 behavior b1
classifier c2 behavior b2
classifier c3 behavior b3
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 110 120
traffic-policy p1 inbound
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100 110 120
#
return

2.6.3 Example for Configuring Hierarchical Traffic Policing on the


S5700HI or S5706
Hierarchical traffic policing sets different CAR parameters for different users and services to
provide differentiated broadband services.

Networking Requirements
As shown in Figure 2-5, data exchange between the provincial center and city A, and between
the provincial center and city B is implemented by leasing the carrier network. The carrier
allocates 2 Mbit/s bandwidth for each city. The provincial center is connected to the carrier
network through the Switch and traffic needs to be controlled on the Switch to ensure that:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 96


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

l The rate limit of the traffic sent from the provincial center to each city is 2 Mbit/s.
l The Switch processes voice, video, and data services based on priorities. It sends traffic
with higher priorities first and allocates certain bandwidth to traffic with lower priorities.
l With bandwidth guarantee, bandwidth is allocated randomly.

Table 2-2 Downstream traffic control on the Switch

City EF Traffic AF31 Traffic AF11 Traffic BE Traffic

City A 700 kbit/s 400 kbit/s 500 kbit/s 200 kbit/s

City B 800 kbit/s 500 kbit/s 300 kbit/s 100 kbit/s

Figure 2-5 Hierarchical traffic policing


Provincial
center server
GE0/0/2 Switch

GE0/0/1

ISP network

GE0/0/1 GE0/0/1
VLAN 100 VLAN 200

SwitchA SwitchB

City A City B
10.1.0.0/16 10.2.0.0/16

PC PC

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure CAR profiles to limit the traffic sent to city A and city B within 2 Mbit/s.
2. Configure ACLs to permit the traffic sent to city A and city B to pass through.
3. Configure traffic classifiers to match traffic priorities and the ACLs.
4. Configure traffic behaviors to allocate ensured bandwidth to each type of traffic and limit
the total traffic.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 97


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

5. Configure a traffic policy, bind the configured traffic behaviors and traffic classifiers to the
traffic policy, and apply the traffic policy to the interface connecting the provincial center
server and the Switch.

Data Preparation
To complete the configuration, you need the following data:
l Total bandwidth of the traffic sent to city A and city B and CAR profile names
l Numbers of ACLs matching the traffic sent to city A and city B and network segment IP
addresses
l Priorities of traffic
l CIR values
l Traffic policy name and type and number of the interface to which the traffic policy is
applied

Procedure
Step 1 Configure CAR profiles.
# Create and configure a CAR profile to limit the traffic sent to city A within 2 Mbit/s.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] qos car city_a cir 2000

# Create and configure a CAR profile to limit the traffic sent to city B within 2 Mbit/s.
[Switch] qos car city_b cir 2000

Step 2 Configure ACLs.


# Configure ACL 3000 to permit the TCP packets destined for city A on the network segment
10.1.0.0/16 to pass through.
[Switch] acl 3000
[Switch-acl-adv-3000] rule 5 permit tcp destination 10.1.0.0 0.0.255.255

# Configure ACL 3001 to permit the TCP packets destined for city B on the network segment
10.2.0.0/16 to pass through.
[Switch] acl 3001
[Switch-acl-adv-3001] rule 5 permit tcp destination 10.2.0.0 0.0.255.255

Step 3 Configure traffic classifiers.


# Create traffic classifiers city_a_ef, city_a_af31, city_a_af11, and city_a_be for traffic sent
to city A. These traffic classifiers match traffic with DSCP priorities EF, AF31, AF11, and 0
and ACL 3000. Create a traffic classifier city_a_default for other traffic to match ACL 3000.
[Switch] traffic classifier city_a_ef operator and
[Switch-classifier-city_a_ef] if-match dscp ef
[Switch-classifier-city_a_ef] if-match acl 3000
[Switch-classifier-city_a_ef] quit
[Switch] traffic classifier city_a_af31 operator and
[Switch-classifier-city_a_af31] if-match dscp af31
[Switch-classifier-city_a_af31] if-match acl 3000
[Switch-classifier-city_a_af31] quit
[Switch] traffic classifier city_a_af11 operator and
[Switch-classifier-city_a_af11] if-match dscp af11
[Switch-classifier-city_a_af11] if-match acl 3000
[Switch-classifier-city_a_af11] quit

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 98


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

[Switch] traffic classifier city_a_be operator and


[Switch-classifier-city_a_be] if-match dscp 0
[Switch-classifier-city_a_be] if-match acl 3000
[Switch-classifier-city_a_be] quit
[Switch] traffic classifier city_a_default operator and
[Switch-classifier-city_a_default] if-match acl 3000
[Switch-classifier-city_a_default] quit

# Create traffic classifiers city_b_ef, city_b_af31, city_b_af11, and city_b_be for traffic sent
to city B. These traffic classifiers match traffic with DSCP priorities EF, AF31, AF11, and 0
and ACL 3001. Create a traffic classifier city_b_default for other traffic to match ACL 3001.
[Switch] traffic classifier city_b_ef operator and
[Switch-classifier-city_b_ef] if-match dscp ef
[Switch-classifier-city_b_ef] if-match acl 3001
[Switch-classifier-city_b_ef] quit
[Switch] traffic classifier city_b_af31 operator and
[Switch-classifier-city_b_af31] if-match dscp af31
[Switch-classifier-city_b_af31] if-match acl 3001
[Switch-classifier-city_b_af31] quit
[Switch] traffic classifier city_b_af11 operator and
[Switch-classifier-city_b_af11] if-match dscp af11
[Switch-classifier-city_b_af11] if-match acl 3001
[Switch-classifier-city_b_af11] quit
[Switch] traffic classifier city_b_be operator and
[Switch-classifier-city_b_be] if-match dscp 0
[Switch-classifier-city_b_be] if-match acl 3001
[Switch-classifier-city_b_be] quit
[Switch] traffic classifier city_b_default operator and
[Switch-classifier-city_b_default] if-match acl 3001
[Switch-classifier-city_b_default] quit

Step 4 Configure traffic behaviors.

# Create traffic behaviors city_a_ef, city_a_af31, city_a_af11, and city_a_be to allocate CIR
values 700 kbit/s, 400 kbit/s, 500 kbit/s, and 200 kbit/s to traffic with DSCP priorities EF, AF31,
AF11, and 0. Create a traffic behavior city_a_default to allocate certain bandwidth to other
traffic.
[Switch] traffic behavior city_a_ef
[Switch-behavior-city_a_ef] car cir 700 pir 2000
[Switch-behavior-city_a_ef] car city_a share
[Switch-behavior-city_a_ef] statistic enable
[Switch-behavior-city_a_ef] quit
[Switch] traffic behavior city_a_af31
[Switch-behavior-city_a_af31] car cir 400 pir 2000
[Switch-behavior-city_a_af31] car city_a share
[Switch-behavior-city_a_af31] statistic enable
[Switch-behavior-city_a_af31] quit
[Switch] traffic behavior city_a_af11
[Switch-behavior-city_a_af11] car cir 500 pir 2000
[Switch-behavior-city_a_af11] car city_a share
[Switch-behavior-city_a_af11] statistic enable
[Switch-behavior-city_a_af11] quit
[Switch] traffic behavior city_a_be
[Switch-behavior-city_a_be] car cir 200 pir 2000
[Switch-behavior-city_a_be] car city_a share
[Switch-behavior-city_a_be] statistic enable
[Switch-behavior-city_a_be] quit
[Switch] traffic behavior city_a_default
[Switch-behavior-city_a_default] car cir 64 pir 2000
[Switch-behavior-city_a_default] car city_a share
[Switch-behavior-city_a_default] statistic enable
[Switch-behavior-city_a_default] quit

# Create traffic behaviors city_b_ef, city_b_af31, city_b_af11, and city_b_be to allocate CIR
values 800 kbit/s, 500 kbit/s, 300 kbit/s, and 100 kbit/s to traffic with DSCP priorities EF, AF31,

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 99


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

AF11, and 0. Create a traffic behavior city_b_default to allocate certain bandwidth to other
traffic.
[Switch] traffic behavior city_b_ef
[Switch-behavior-city_b_ef] car cir 800 pir 2000
[Switch-behavior-city_b_ef] car city_b share
[Switch-behavior-city_b_ef] statistic enable
[Switch-behavior-city_b_ef] quit
[Switch] traffic behavior city_b_af31
[Switch-behavior-city_b_af31] car cir 500 pir 2000
[Switch-behavior-city_b_af31] car city_b share
[Switch-behavior-city_b_af31] statistic enable
[Switch-behavior-city_b_af31] quit
[Switch] traffic behavior city_b_af11
[Switch-behavior-city_b_af11] car cir 300 pir 2000
[Switch-behavior-city_b_af11] car city_b share
[Switch-behavior-city_b_af11] statistic enable
[Switch-behavior-city_b_af11] quit
[Switch] traffic behavior city_b_be
[Switch-behavior-city_b_be] car cir 100 pir 2000
[Switch-behavior-city_b_be] car city_b share
[Switch-behavior-city_b_be] statistic enable
[Switch-behavior-city_b_be] quit
[Switch] traffic behavior city_b_default
[Switch-behavior-city_b_default] car cir 64 pir 2000
[Switch-behavior-city_b_default] car city_b share
[Switch-behavior-city_b_default] statistic enable
[Switch-behavior-city_b_default] quit

Step 5 Configure a traffic policy.

# Create and configure a traffic policy city_control, bind configured traffic classifiers and traffic
behaviors to the traffic policy, and apply the traffic policy to the interface connecting the
provincial center server and the Switch.
[Switch] traffic policy city_control
[Switch-trafficpolicy-city_control] classifier city_a_ef behavior city_a_ef
[Switch-trafficpolicy-city_control] classifier city_a_af31 behavior city_a_af31
[Switch-trafficpolicy-city_control] classifier city_a_af11 behavior city_a_af11
[Switch-trafficpolicy-city_control] classifier city_a_be behavior city_a_be
[Switch-trafficpolicy-city_control] classifier city_a_default behavior
city_a_default
[Switch-trafficpolicy-city_control] classifier city_b_ef behavior city_b_ef
[Switch-trafficpolicy-city_control] classifier city_b_af31 behavior city_b_af31
[Switch-trafficpolicy-city_control] classifier city_b_af11 behavior city_b_af11
[Switch-trafficpolicy-city_control] classifier city_b_be behavior city_b_be
[Switch-trafficpolicy-city_control] classifier city_b_default behavior
city_b_default
[Switch-trafficpolicy-city_control] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] traffic-policy city_control inbound
[Switch-GigabitEthernet0/0/2] quit

Step 6 Verify the configuration.


l Verify that the traffic sent from the Switch to each city is within 2 Mbit/s.
Use a tester to simulate traffic with priorities EF, AF31, AF11, and BE and traffic with other
priorities. Send each type of traffic from GE 0/0/2 of the Switch to city A and city B at a rate
of 100 Mbit/s. Observe the received traffic on GE0/0/1 of SwitchA and SwitchB. You can
see that the traffic rate is 2 Mbit/s.
l Verify that the traffic with other priorities has certain bandwidth.
Use a tester to simulate traffic with DSCP priorities EF and AF21. Send each type of traffic
from GE 0/0/2 of the Switch to city A at a rate of 100 Mbit/s. Observe the received traffic
on GE0/0/1 of SwitchA. You can see: The bandwidth of traffic with DSCP priority EF is

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 100


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

higher than 700 kbit/s, the bandwidth of traffic with DSCP priority AF21 is higher than 64
kbit/s, and the bandwidth sum of the two types of traffic is 2 Mbit/s.

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
qos car city_a cir 2000 cbs 376000
qos car city_b cir 2000 cbs 376000
#
acl number 3000
rule 5 permit tcp destination 10.1.0.0 0.0.255.255
acl number 3001
rule 5 permit tcp destination 10.2.0.0 0.0.255.255
#
traffic classifier city_a_af11 operator and
if-match acl 3000
if-match dscp af11
traffic classifier city_a_af31 operator and
if-match dscp af31
if-match acl 3000
traffic classifier city_a_be operator and
if-match dscp default
if-match acl 3000
traffic classifier city_a_default operator and
if-match acl 3000
traffic classifier city_a_ef operator and
if-match dscp ef
if-match acl 3000
traffic classifier city_b_af11 operator and
if-match dscp af11
if-match acl 3001
traffic classifier city_b_af31 operator and
if-match dscp af31
if-match acl 3001
traffic classifier city_b_be operator and
if-match dscp default
if-match acl 3001
traffic classifier city_b_default operator and
if-match acl 3001
traffic classifier city_b_ef operator and
if-match dscp ef
if-match acl 3001
#
traffic behavior city_a_af11
car cir 500 pir 2000 cbs 62500 pbs 250000 green pass yellow pass red discard
car city_a share
traffic behavior city_a_af31
car cir 400 pir 2000 cbs 50000 pbs 250000 green pass yellow pass red discard
car city_a share
traffic behavior city_a_be
car cir 200 pir 2000 cbs 25000 pbs 250000 green pass yellow pass red discard
car city_a share
traffic behavior city_a_default
car cir 64 pir 2000 cbs 8000 pbs 250000 green pass yellow pass red discard
traffic behavior city_a_ef
car cir 700 pir 2000 cbs 87500 pbs 250000 green pass yellow pass red discard
car city_a share
traffic behavior city_b_af11
car cir 300 pir 2000 cbs 37500 pbs 250000 green pass yellow pass red discard
car city_b share
traffic behavior city_b_af31
car cir 500 pir 2000 cbs 62500 pbs 250000 green pass yellow pass red discard
car city_b share

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 101


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

traffic behavior city_b_be


car cir 100 pir 2000 cbs 12500 pbs 250000 green pass yellow pass red discard
car city_b share
traffic behavior city_b_default
car cir 64 pir 2000 cbs 8000 pbs 250000 green pass yellow pass red discard
traffic behavior city_b_ef
car cir 800 pir 2000 cbs 100000 pbs 250000 green pass yellow pass red discard
car city_b share
#
traffic policy city_control
classifier city_a_ef behavior city_a_ef
classifier city_a_af31 behavior city_a_af31
classifier city_a_af11 behavior city_a_af11
classifier city_a_be behavior city_a_be
classifier city_a_default behavior city_a_default
classifier city_b_ef behavior city_b_ef
classifier city_b_af31 behavior city_b_af31
classifier city_b_af11 behavior city_b_af11
classifier city_b_be behavior city_b_be
classifier city_b_default behavior city_b_default
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 100 200
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 100 200
traffic-policy city_control inbound
#
return

2.6.4 Example for Configuring Traffic Shaping on the S5700EI


You can configure traffic shaping and set different traffic shaping rates for different types of
packets to reduce the jitter and ensure bandwidth of various services.

Networking Requirements
The Switch is connected to GE 0/0/2 and the router; the 802.1p priorities of voice, video, and
data services from the Internet are 6, 5, and 2 respectively, and these services can reach users
through the router and Switch, as shown in Figure 2-6. The rate of the traffic from the network
side is greater than the rate of the LSW interface; therefore, a jitter may occur in the outbound
direction of GE 0/0/1. To reduce the jitter and ensure the bandwidth of various services, the
requirements are as follows:
l The CIR on the interface is 20000 kbit/s.
l The CIR and PIR for the voice service are 3000 kbit/s and 5000 kbit/s respectively.
l The CIR and PIR for the video service are 5000 kbit/s and 8000 kbit/s respectively.
l The CIR and PIR for the data service are 2000 kbit/s and 3000 kbit/s respectively.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 102


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Figure 2-6 Networking diagram for configuring traffic shaping

Phone

802.1p=6

GE0/0/1 GE0/0/2 Core


802.1p=2 Residence
Network
PC LSW Switch Router
802.1p=5

TV

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure each interface so that the residential user can access the
network through the Switch.
2. Configure interfaces to trust 802.1p priorities of packets.
3. Configure traffic shaping on an interface to limit the bandwidth of the interface.
4. Configure traffic shaping in an interface queue to limit the CIRs of voice, video, and data
services.

Data Preparation
To complete the configuration, you need the following data:
l 802.1p priorities
l Rate for traffic shaping on an interface
l Rate for traffic shaping in each interface queue

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 10

# Set the type of GE 0/0/1 and GE 0/0/2 to trunk, and then add GE 0/0/1 and GE 0/0/2 to VLAN
10.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 103


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

[Switch-GigabitEthernet0/0/2] port link-type trunk


[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/2] quit

# Create VLANIF 10 and assign network segment address 10.10.10.1/24 to VLANIF 10.
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 10.10.10.1 255.255.255.0
[Switch-Vlanif10] quit

NOTE

Assign IP address 10.10.10.2/24 to the interface connecting the router and Switch.

Step 2 Configure the interface to trust packets.


# Configure the interface to trust 802.1p priorities of packets.
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] trust 8021p
[Switch-GigabitEthernet0/0/2] quit

Step 3 Configure traffic shaping on an interface.


# Configure traffic shaping on an interface of the Switch and set the CIR to 20000 kbit/s.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos lr outbound cir 20000 cbs 2500000

Step 4 Configure traffic shaping in an interface queue.


# Set the scheduling mode of each queue to WRR. Set the WRR weight of queue 6 to 60, WRR
weight of queue 5 to 40, and WRR weight of queue 2 to 20. The other queues retain the default
weight.
[Switch-GigabitEthernet0/0/1] qos wrr
[Switch-GigabitEthernet0/0/1] qos queue 6 wrr weight 60
[Switch-GigabitEthernet0/0/1] qos queue 5 wrr weight 40
[Switch-GigabitEthernet0/0/1] qos queue 2 wrr weight 20

# Configure traffic shaping in the interface queues on the Switch, and then set the CIR and PIR
of the voice service to 3000 kbit/s and 5000kbit/s, the CIR and PIR of the video service to 5000
kbit/s and 8000 kbit/s, and the CIR and PIR of the data service to 2000 kbit/s and 3000 kbit/s.
[Switch-GigabitEthernet0/0/1] qos queue 6 shaping cir 3000 pir 5000
[Switch-GigabitEthernet0/0/1] qos queue 5 shaping cir 5000 pir 8000
[Switch-GigabitEthernet0/0/1] qos queue 2 shaping cir 2000 pir 3000
[Switch-GigabitEthernet0/0/1] quit
[Switch] quit

Step 5 Verify the configuration.


# If the configuration succeeds, the committed bandwidth for the packets transmitted by GE0/0/1
is 20000 kbit/s; the transmission rate of the voice service ranges from 3000 kbit/s to 5000 kbit/
s; the transmission rate of the video service ranges from 5000 kbit/s to 8000 kbit/s; the
transmission rate of the data service ranges from 2000 kbit/s to 3000 kbit/s.

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 10

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 104


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
qos lr outbound cir 20000 cbs 2500000
qos wrr
qos queue 2 wrr weight 20
qos queue 5 wrr weight 40
qos queue 6 wrr weight 60
qos queue 2 shaping cir 2000 pir 3000
qos queue 5 shaping cir 5000 pir 8000
qos queue 6 shaping cir 3000 pir 5000
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10
trust 8021p
#
return

2.6.5 Example for Configuring Traffic Shaping on the S5700SI


You can configure traffic shaping and set different traffic shaping rates for different types of
packets to reduce the jitter and ensure bandwidth of various services.

Networking Requirements
The Switch is connected to GE 0/0/2 and the router; the 802.1p priorities of voice, video, and
data services from the Internet are 6, 5, and 2 respectively, and these services can reach users
through the router and Switch, as shown in Figure 2-7. The rate of the traffic from the network
side is greater than the rate of the LSW interface; therefore, a jitter may occur in the outbound
direction of GE 0/0/1. To reduce the jitter and ensure the bandwidth of various services, the
requirements are as follows:
l The CIR on the interface is 20000 kbit/s.
l The CIR and PIR for the voice service are 3000 kbit/s and 5000 kbit/s respectively.
l The CIR and PIR for the video service are 5000 kbit/s and 8000 kbit/s respectively.
l The CIR and PIR for the data service are 2000 kbit/s and 3000 kbit/s respectively.

Figure 2-7 Networking diagram for configuring traffic shaping

Phone

802.1p=6

GE0/0/1 GE0/0/2 Core


802.1p=2 Residence
Network
PC LSW Switch Router
802.1p=5

TV

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 105


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Configuration Roadmap
The configuration roadmap is as follows:
1. Create VLANs and configure each interface so that the residential user can access the
network through the Switch.
2. Configure interfaces to trust 802.1p priorities of packets.
3. Configure traffic shaping on an interface to limit the bandwidth of the interface.
4. Configure traffic shaping in an interface queue to limit the CIRs of voice, video, and data
services.

Data Preparation
To complete the configuration, you need the following data:
l 802.1p priorities
l Rate for traffic shaping on an interface
l Rate for traffic shaping in each interface queue

Procedure
Step 1 Create VLANs and configure interfaces.
# Create VLAN 10.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 10

# Configure the type of GE 0/0/1 and GE 0/0/2 as trunk, and then add GE 0/0/1 and GE 0/0/2
to VLAN 10.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10
[Switch-GigabitEthernet0/0/2] quit

# Create VLANIF 10 and assign network segment address 10.10.10.1/24 to VLANIF 10.
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 10.10.10.1 255.255.255.0
[Switch-Vlanif10] quit

NOTE

Assign IP address 10.10.10.2/24 to the interface connecting the router and Switch.

Step 2 Configure the interface to trust packets.


# Configure the interface to trust 802.1p priorities of packets.

[Switch] interface gigabitethernet 0/0/2


[Switch-GigabitEthernet0/0/2] trust 8021p
[Switch-GigabitEthernet0/0/2] quit

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 106


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

Step 3 Configure traffic shaping on an interface.


# Configure traffic shaping on an interface of the Switch and set the CIR to 20000 kbit/s.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos lr outbound cir 20000 cbs 2500000
[Switch-GigabitEthernet0/0/1] quit

Step 4 Configure traffic shaping in an interface queue.


# Create the scheduling template s1; set the scheduling mode of each queue to WRR; set the
WRR weight of queue 6 to 60, WRR weight of queue 5 to 40, and WRR weight of queue 2 to
20; retain the default weight of other queues.
[Switch] qos schedule-profile s1
[Switch-qos-schedule-profile-s1] qos wrr
[Switch-qos-schedule-profile-s1] qos queue 6 wrr weight 60
[Switch-qos-schedule-profile-s1] qos queue 5 wrr weight 40
[Switch-qos-schedule-profile-s1] qos queue 2 wrr weight 20
[Switch-qos-schedule-profile-s1] quit

# Apply the scheduling template s1 to GE 0/0/1.


[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos schedule-profile s1

# Configure traffic shaping in the interface queues on the Switch, and then set the CIR and PIR
of the voice service to 3000 kbit/s and 5000 kbit/s, the CIR and PIR of the video service to 5000
kbit/s and 8000 kbit/s, and the CIR and PIR of the data service to 2000 kbit/s and 3000 kbit/s.
[Switch-GigabitEthernet0/0/1] qos queue 6 shaping cir 3000 pir 5000
[Switch-GigabitEthernet0/0/1] qos queue 5 shaping cir 5000 pir 8000
[Switch-GigabitEthernet0/0/1] qos queue 2 shaping cir 2000 pir 3000
[Switch-GigabitEthernet0/0/1] quit
[Switch] quit

Step 5 Verify the configuration.


# If the configuration succeeds, the committed bandwidth for the packets transmitted by GE0/0/1
is 20000 kbit/s; the transmission rate of the voice service ranges from 3000 kbit/s to 5000 kbit/
s; the transmission rate of the video service ranges from 5000 kbit/s to 8000 kbit/s; the
transmission rate of the data service ranges from 2000 kbit/s to 3000 kbit/s.

----End

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 10
#
interface Vlanif10
ip address 10.10.10.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10
qos qos schedule-profile s1
qos lr outbound cir 20000 cbs 2500000
qos queue 2 shaping cir 2000 pir 3000
qos queue 5 shaping cir 5000 pir 8000
qos queue 6 shaping cir 3000 pir 5000
#
interface GigabitEthernet0/0/2

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 107


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches
Configuration Guide - QoS 2 Traffic Policing and Traffic Shaping Configuration

port link-type trunk


port trunk allow-pass vlan 10
trust 8021p
#
qos schedule-profile s1
qos queue 2 wrr weight 20
qos queue 5 wrr weight 40
qos queue 6 wrr weight 60
#
return

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 108


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

3 Congestion Avoidance and Congestion


Management Configuration

About This Chapter

This chapter describes the basic concepts of congestion avoidance and congestion management,
and provides configuration methods and configuration examples of congestion avoidance and
congestion management.

3.1 Overview of Congestion Avoidance and Congestion Management


This section describes the basic concepts of congestion avoidance and congestion management.
3.2 Configuring Congestion Avoidance on the S5700SI or S5700EI
After congestion avoidance is configured, the S5700 processes packets of different colors
according to the SRED configuration.
3.3 Configuring Congestion Avoidance on the S5700HI and S5706
After congestion avoidance is configured, the S5700 processes packets of different colors based
on the WRED configuration.
3.4 Configuring Congestion Management
After congestion management is configured, if congestion occurs on a network, the S5700
determines the sequence of forwarding packets according to the defined scheduling policy.
3.5 Maintaining Congestion Avoidance and Congestion Management
This section describes how to maintain traffic avoidance and congestion management.
3.6 Configuration Examples
This section provides several configuration examples of congestion avoidance and congestion
management.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 109


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

3.1 Overview of Congestion Avoidance and Congestion


Management
This section describes the basic concepts of congestion avoidance and congestion management.

3.1.1 Congestion Avoidance


Congestion avoidance is a flow control mechanism. A system configured with congestion
avoidance monitors network resource usage such as queues and memory buffers. When
congestion occurs or aggravates, the system discards packets.
Congestion avoidance mechanisms include tail drop, Random Early Detection (RED), and
Weighted Random Early Detection (WRED). The S5700EI performs congestion avoidance
based on SRED, and the S5700HI performs congestion avoidance based on WRED.

Tail Drop
The traditional packet drop policy uses tail drop. The tail drop policy processes all the packets
uniformly, regardless of their class of service (CoS). When congestion occurs, packets at the
end of a queue are discarded until the congestion problem is solved.
The tail drop policy causes global TCP synchronization. When packets from multiple TCP
connections are discarded in a queue, these TCP connections enter the congestion avoidance
and slow start state simultaneously, which is called global TCP synchronization. This causes
traffic reduction and will lead to traffic peak. Such a process repeats, which causes the volume
of network traffic to change from heavy to light and affects the link usage.

RED
The RED mechanism randomly discards packets so that the S5700 reduces the transmission
speeds of multiple TCP connections at different periods of time. This prevents global TCP
synchronization.
RED sets the upper threshold and lower threshold for the length of each queue and processes
packets as follows:
l When the queue length is shorter than the lower threshold, no packet is discarded.
l When the queue length exceeds the upper threshold, all the received packets are discarded.
l When the queue length ranges from the lower threshold to the upper threshold, incoming
packets are dropped randomly. The system sets a random number for each incoming packet,
and compares it with the packet drop probability of the current queue. If the random number
is larger than the drop probability, the packet is dropped. The longer the queue, the higher
the drop probability.
NOTE

The S5700SI does not support RED.

WRED
The WRED mechanism also prevents global TCP synchronization by randomly discarding
packets. The random number generated by WRED is based on the priority. WRED distinguishes

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 110


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

the drop policy based on colors of packets, so the drop probability of packets with higher
priorities is low.

SRED
The S5700 implements the Simple Random Early Detection (SRED) technology based on the
RED technology. In a queue on an outbound interface, the S5700 colors the packets red or yellow
according to the priorities of packets; the S5700 sets a threshold for discarding red packets, a
threshold for discarding yellow packets, and the drop probability.
Based on SRED, the S5700 actively discards packets in the queue based on the drop probability
to adjust the rate of outgoing traffic at the interface.

3.1.2 Congestion Management


When intermittent congestion occurs on the network, delay-sensitive services require higher
QoS than others. In this case, congestion management is required. The bandwidth needs to be
increased if a network is always congested.
Congestion management uses the queue scheduling technologies. Currently, the S5700 adopts
the following queue scheduling modes:
l PQ Scheduling
l WRR Scheduling
l DRR Scheduling
l PQ+WRR/PQ+DRR Scheduling

PQ Scheduling
Priority Queuing (PQ) scheduling is a queuing technology by which packets are scheduled based
on the priorities of queues in a strict manner. The packets of lower priorities can be scheduled
only after packets of higher priorities are scheduled.
In PQ scheduling mode, packets of delay-sensitive core services are put into a high priority queue
and packets of other non-core services are put into a low priority queue. This ensures that core
services are sent first.
The disadvantage of PQ scheduling is that the packets of lower priorities are not processed if
there are a large number of packets of higher priorities, when congestion occurs.

WRR Scheduling
WRR refers to Weighted Round Robin. WRR schedules packets of queues in a polling manner,
ensuring that packets in each queue are sent at a certain time.
Assume that there are eight output queues on an interface. WRR sets weights for the eight queues,
that is, w7, w6, w5, w4, w3, w2, w1, and w0. The weight indicates a percentage of obtaining
resources. For example, the weights of queues on a 100-Mbit/s interface are set to 50, 50, 30,
30, 10, 10, 10, and 10, corresponding to w7, w6, w5, w4, w3, w2, w1, and w0. In this case, the
lowest priority queue can obtain bandwidth of at least 5 Mbit/s. This avoids the disadvantage of
PQ scheduling.
The advantage of WRR is as follows: Although packets in multiple queues are processed in a
polling manner, the time allocated to each queue is not fixed. If a queue is null, packets of the
next queue are scheduled. This ensures better usage of bandwidth.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 111


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

The disadvantages of WRR are as follows:


l WRR allocates bandwidth according to the number of packets. When the average length
of packets in each queue is the same or known, you can obtain the required bandwidth by
setting the weight of WRR. You, however, cannot obtain the required bandwidth by setting
the weight of WRR when the average length of packets in each queue changes.
l The packets of short-delay services such as voice services cannot be scheduled in time.

DRR Scheduling
The principle of Deficit Round Robin (DRR) is similar to the principle of WRR.
Their difference is that WRR schedules packets according to the number of packets, but DRR
schedules packets according to the length of packets. If the packet length exceeds the scheduling
capability of a queue, DRR allows the deficit weight to ensure that packets of a long length are
scheduled. When packets are scheduled in a polling manner again, this queue is not scheduled
until the weight becomes positive. Then, this queue participates in DRR scheduling.
DRR scheduling offsets the disadvantage of PQ scheduling and one disadvantage of WRR
scheduling (that is, bandwidth cannot be obtained according to the proportion).
The packets of short-delay services such as voice services cannot be scheduled in time in DRR
mode.

PQ+WRR/PQ+DRR Scheduling
PQ scheduling, WRR scheduling, and DRR scheduling have their own advantages and
disadvantages. If only PQ scheduling is used, packets of lower priorities cannot obtain the
bandwidth for a long time. If only WRR or DRR scheduling is used, delay-sensitive services
such as voice service cannot be scheduled first. PQ+WRR or PQ+DRR scheduling can use the
advantages of both PQ and WRR or DRR scheduling and offset their disadvantages.
Through PQ+WRR or PQ+DRR scheduling, important protocol packets and delay-sensitive
service packets are put in a PQ queue and specified bandwidth is allocated to this queue; other
packets are put into a WRR or DRR queue according to their priorities and scheduled in a polling
manner according to the weight of the queue.

3.2 Configuring Congestion Avoidance on the S5700SI or


S5700EI
After congestion avoidance is configured, the S5700 processes packets of different colors
according to the SRED configuration.

3.2.1 Establishing the Configuration Task


Before configuring congestion avoidance, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the required data. This will help you complete
the configuration task quickly and accurately.

Applicable Environment
To prevent congestion and solve the problem of global TCP synchronization, you can configure
RED to adjust the traffic on a network and remove the overload of the traffic on a network.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 112


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

NOTE

The S5700SI does not support RED.

Pre-configuration Tasks
Before configuring congestion avoidance, complete the following tasks on the incoming
interface:
l Configuring priority mapping based on simple traffic classification to map priorities of
packets to PHBs and colors
l Configuring traffic policing based on complex traffic classification and the remarking
action
NOTE

Before configuring congestion avoidance, you need to perform either of the preceding tasks to color packets
as the basis of congestion avoidance.

Data Preparation
To configure congestion avoidance, you need the following data.

No. Data

1 Upper threshold, lower threshold, and maximum drop percent of RED

3.2.2 (Optional) Setting the Length of the Interface Queue


You can set the maximum number of packets that can be buffered in the specified interface queue
by setting the length of the interface queue.

Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index max-length packet-number

The length of the interface priority queue is set.


5. Run:
undo shutdown

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 113


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

The interface is restarted.


l (Optional) Setting the length of the interface queue on the S5700SI
1. Run:
system-view

The system view is displayed.


2. Run:
qos tail-drop-profile profile-name

A global tail drop template is created and the tail drop template view is displayed.
3. Run:
qos queue queue-index max-length packet-number [ green max-length packet-
number ]

The length of the interface queue is set.


4. Run:
quit

Return to the system view.


5. Run:
interface interface-type interface-number

The interface view is displayed.


6. Run:
shutdown

The interface is shut down.


7. Run:
qos tail-drop-profile profile-name

The tail drop template is applied to the interface.


8. Run:
undo shutdown

The interface is restarted.

----End

3.2.3 (Optional) Configuring the CFI Field as the Internal Drop


Priority
After the CFI field is configured as the internal drop priority, if the rate of packets exceeds the
CIR, the S5700 sets the value of the CFI field in packets to 1. When congestion occurs, the
S5700 first discards the packets with the CFI field being 1.

Context
The Canonical Format Indicator (CFI) field in a VLAN tag is also called the Drop Eligible
Indicator (DEI), and is used to mark the drop priority of packets in certain situations. When the
rate of packets exceeds the CIR, the S5700 sets the DEI field of the packets to 1. That is, these
packets have a high drop priority. If congestion occurs, subsequent devices first discard packets
with the DEI field being 1.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 114


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

If you need to set the CFI field as the internal drop priority on multiple interfaces, you can
perform the configuration on the port group.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
interface interface-type interface-number

The interface view is displayed.


Or run the port-group port-group-name command to enter the port group view.
NOTE

l The interface type can be GE, XGE, or Eth-Trunk.


l You need to create a port group before performing this task. For details about creating a port group,
see Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration
Guide - Ethernet.

Step 3 Run:
dei enable

The CFI field is configured as the internal drop priority.


By default, the CFI field is not configured as the internal drop priority.
NOTE

The S5700SI does not support the dei enable command.

----End

3.2.4 Setting SRED Parameters


You can set SERD parameters, that is, the drop threshold and drop probability for packets of
different colors, to implement congestion avoidance.

Context
NOTE
When SRED-based congestion avoidance is configured:
The drop threshold and drop probability set for queues 0 to 4 take effect for red packets, but do not take
effect for yellow packets. The drop threshold and drop probability set for queues 5 to 7 take effect for
yellow packets, but do not take effect for red packets.

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
qos sred queue queue-index red start-discard-point discard-probability discard-
probability yellow start-discard-point discard-probability discard-probability

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 115


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

The drop threshold and drop probability of queues are set.


Each queue has its own SRED parameters to prevent congestion. Therefore, repeat this step for
each queue.

NOTE

The S5700SI and the S5700HI do not support the qos sred command.

----End

3.2.5 Checking the Configuration


After congestion avoidance is configured, you can view the drop threshold and drop probability
for red and yellow packets in queues.

Prerequisite
The configurations of SRED parameters are complete.

Procedure
l Run the display qos sred command to check the drop threshold and drop probability for
red and yellow packets in queues.
NOTE

The S5700SI does not support the display qos sred command.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configuration on the interface.
----End

3.3 Configuring Congestion Avoidance on the S5700HI and


S5706
After congestion avoidance is configured, the S5700 processes packets of different colors based
on the WRED configuration.

3.3.1 Establishing the Configuration Task


Before configuring congestion avoidance, familiarize yourself with the applicable environment,
complete the pre-configuration tasks, and obtain the required data. This will help you complete
the configuration task quickly and accurately.

Applicable Environment
To prevent congestion and solve the problem of global TCP synchronization, you can configure
WRED to adjust the traffic on a network and remove the overload of the traffic on a network.

Pre-configuration Tasks
Before configuring congestion avoidance, complete the following tasks on the incoming
interface:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 116


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

l Configuring priority mapping based on simple traffic classification to map priorities of


packets to PHBs and colors
l Configuring traffic policing based on complex traffic classification and the remarking
action
NOTE

Before configuring congestion avoidance, you need to perform either of the preceding tasks to color packets
as the basis of congestion avoidance.

Data Preparation
To configure congestion avoidance, you need the following data.

No. Data

1 Upper threshold, lower threshold, and maximum drop percent of WRED

3.3.2 (Optional) Setting the Length of the Interface Queue


You can set the maximum number of packets that can be buffered in the specified interface queue
by setting the length of the interface queue.

Procedure
l Setting the length of the interface queue on the S5700HI and S5706
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index length length-value

The length of the interface priority queue is set.


5. Run:
undo shutdown

The interface is restarted.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 117


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

3.3.3 (Optional) Configuring the CFI Field as the Internal Drop


Priority
After the CFI field is configured as the internal drop priority, if the rate of packets exceeds the
CIR, the S5700 sets the value of the CFI field in packets to 1. When congestion occurs, the
S5700 first discards the packets with the CFI field being 1.

Context
The Canonical Format Indicator (CFI) field in a VLAN tag is also called the Drop Eligible
Indicator (DEI), and is used to mark the drop priority of packets in certain situations. When the
rate of packets exceeds the CIR, the S5700 sets the DEI field of the packets to 1. That is, these
packets have a high drop priority. If congestion occurs, subsequent devices first discard packets
with the DEI field being 1.

If you need to set the CFI field as the internal drop priority on multiple interfaces, you can
perform the configuration on the port group.

Procedure
Step 1 Run:
system-view

The system view is displayed.

Step 2 Run:
interface interface-type interface-number

The interface view is displayed.

Or run the port-group port-group-name command to enter the port group view.

NOTE

l The interface type can be GE, XGE, or Eth-Trunk.


l You need to create a port group before performing this task. For details about creating a port group,
see Configuring the Interface Group in the Quidway S5700 Series Ethernet Switches Configuration
Guide - Ethernet.

Step 3 Run:
dei enable

The CFI field is configured as the internal drop priority.

By default, the CFI field is not configured as the internal drop priority.

NOTE

The S5700SI does not support the dei enable command.

----End

3.3.4 Creating a WRED Drop Profile


This section describes how to create a WRED drop profile, and set the upper threshold, lower
threshold, and maximum drop percent of the WRED drop profile for packets of different colors.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 118


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Procedure
Step 1 Run:
system-view

The system view is displayed.


Step 2 Run:
drop-profile drop-profile-name

A drop profile is created and the drop profile view is displayed.


There is a default WRED drop profile. You cannot delete the default WRED drop profile, but
can modify the values of the parameters.
Step 3 Run:
color { green | non-tcp | red | yellow } low-limit low-limit-percentage high-limit
high-limit-percentage discard-percentage discard-percentage

WRED parameters are set.


By default, the upper threshold, lower threshold, and maximum drop percent of a WRED drop
profile are 100.

----End

3.3.5 Applying the WRED Drop Profile


The configured WRED drop profile takes effect only after being applied. You can apply the
WRED drop profile to the system, an interface or a queue.

Context
You can apply a WRED drop profile on an interface or in an interface queue or on the system,
an interface and an interface queue on the S5700 as required.
l If a WRED drop profile is applied to the system and an interface simultaneously, the WRED
drop profile applied to the interface takes effect. After a WRED drop profile is applied to
the system, it takes effect on all the interfaces.
l If WRED drop profiles are applied to an interface and an interface queue on the S5700, the
S5700 matches packets with WRED drop profiles in the interface queue and the interface
in sequence. Then the S5700 performs congestion avoidance for the matched packets.
To set the same WRED drop profile on multiple interfaces, perform the configuration on the
port group to reduce the workload.
Before applying a WRED drop profile, run the drop-profile command to create a WRED drop
profile.

Procedure
l Applying a WRED drop profile to the system
1. Run:
system-view

The system view is displayed.


2. Run:
qos queue queue-index wred drop-profile-name

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 119


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

A WRED drop profile is applied to the system.


l Applying a WRED drop profile to an interface
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
qos wred drop-profile-name

A WRED drop profile is applied to the interface.


l Applying a WRED drop profile to a port group
1. Run:
system-view

The system view is displayed.


2. Run:
port-group port-group-name

The port group view is displayed.

NOTE

You need to create a port group before performing this task. For details on how to create a port
group, see (Optional) Configuring the Interface Group in the Quidway S5700 Series Ethernet
Switches Configuration Guide - Ethernet.
3. Run:
qos wred drop-profile-name

The WRED drop profile is applied to a port group.


l Applying a WRED drop profile to an interface queue
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
qos queue queue-index wred drop-profile-name

The WRED drop profile is applied to an interface queue.

drop-profile-name specifies the name of a WRED drop profile and must be the same as the
name of a WRED drop profile in 3.3.4 Creating a WRED Drop Profile.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 120


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

3.3.6 Checking the Configuration


After congestion avoidance is configured, you can view the name, index, and parameters of the
WRED drop profile.

Prerequisite
The configurations of the WRED drop profile are complete.

Procedure
l Run the display drop-profile [ all | name drop-profile-name ] command to check the
configuration of the WRED drop profile.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configurations on the interface.

----End

3.4 Configuring Congestion Management


After congestion management is configured, if congestion occurs on a network, the S5700
determines the sequence of forwarding packets according to the defined scheduling policy.

3.4.1 Establishing the Configuration Task


Before configuring congestion management, familiarize yourself with the applicable
environment, complete the pre-configuration tasks, and obtain the required data. This will help
you complete the configuration task quickly and accurately.

Applicable Environment
When congestion occurs, you can configure congestion management in the following situations:
l The same delay and jitter are set for various types of packets, and packets of core services
such as video and voice services need to be processed first.
l Packets of non-core services of the same priority, such as email, are processed in a fair
manner, and services of different priorities are processed according to the weights.

Pre-configuration Tasks
Before configuring congestion management, complete the following tasks:
l Configuring priority mapping based on simple traffic classification
l Configuring the remarking action of inner priorities based on complex traffic classification
NOTE

Before configuring congestion management, you need to perform either of the preceding tasks to map
packets to different queues for scheduling.

Data Preparation
To configure congestion management, you need the following data.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 121


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

No. Data

1 Mapping between the local precedence and queues.

2 Mode of queue scheduling.

3 Weight of queues in deficit round robin (DRR) scheduling mode.

4 Weight of queues in weighted round robin (WRR) scheduling mode.

5 (Optional) Minimum size of the static buffer for a queue.

6 (Optional) Maximum number of packets for a queue

3.4.2 (Optional) Setting the Length of the Interface Queue


You can set the maximum number of packets that can be buffered in the specified interface queue
by setting the length of the interface queue.

Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index max-length packet-number

The length of the interface priority queue is set.


5. Run:
undo shutdown

The interface is restarted.


l (Optional) Setting the length of the interface queue on the S5700SI
1. Run:
system-view

The system view is displayed.


2. Run:
qos tail-drop-profile profile-name

A global tail drop template is created and the tail drop template view is displayed.
3. Run:

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 122


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

qos queue queue-index max-length packet-number [ green max-length packet-


number ]

The length of the interface queue is set.


4. Run:
quit

Return to the system view.


5. Run:
interface interface-type interface-number

The interface view is displayed.


6. Run:
shutdown

The interface is shut down.


7. Run:
qos tail-drop-profile profile-name

The tail drop template is applied to the interface.


8. Run:
undo shutdown

The interface is restarted.


l Setting the length of the interface queue on the S5700HI and S5706
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


3. Run:
shutdown

The interface is shut down.


4. Run:
qos queue queue-index length length-value

The length of the interface priority queue is set.


5. Run:
undo shutdown

The interface is restarted.

----End

3.4.3 Setting the Scheduling Mode for an Interface Queue


The S5700 supports the following scheduling modes: PQ, DRR, WRR, PQ+DRR, and PQ
+WRR.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 123


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Context
The S5700 supports eight interface queues that can use different scheduling algorithms. During
queue scheduling, packets in a PQ queue are first scheduled. If there are multiple PQ queues,
the packets are scheduled in descending order of priorities of these PQ queues. After packets in
PQ queues are scheduled, packets in WRR or DRR queues are scheduled in a polling manner.
By default, the scheduling mode for queues on an interface is WRR.

Procedure
l Setting the scheduling mode for an interface queue on the S5700EI, S5700HI or S5706
1. Run:
system-view

The system view is displayed.


2. Run:
interface interface-type interface-number

The interface view is displayed.


Or run:
port-group port-group-name

The port group view is displayed.

NOTE

If you need to set the same scheduling parameters on multiple interfaces, you can perform the
configuration on the interface group to reduce the workload. You need to create a port group
before performing this task. For details about creating a port group, see Configuring the
Interface Group in the Configuration Guide - Ethernet.
3. Run:
qos { pq | wrr | drr }

The scheduling mode of an interface queue is set to PQ, WRR, or DRR.


By default, WRR scheduling is used.
4. (Optional) Run:
qos queue queue-index wrr weight weight

The weight of an interface queue in WRR mode is set.


By default, the weight in WRR mode is 1.

NOTE

You need to perform this step only when the scheduling mode of an interface queue is set to
PQ+WRR or WRR.
When WRR scheduling is applied and the weight of a queue is set to 0, the queue applies PQ
scheduling and other queues apply WRR scheduling. That is, the overall scheduling mode is
PQ+WRR.
5. (Optional) Run:

qos queue queue-index drr weight weight

The weight of an interface queue in DRR mode is set.


By default, the weight in DRR mode is 1.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 124


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

NOTE

You need to perform this step only when the scheduling mode of an interface queue is set to
DRR or PQ+DRR.
When DRR scheduling is applied and the weight of a queue is set to 0, the queue applies PQ
scheduling and other queues apply DRR scheduling. That is, the overall scheduling mode is
PQ+DRR.
l Setting the scheduling mode for an interface queue on the S5700SI
1. Run:
system-view

The system view is displayed.


2. Run:
qos schedule-profile profile-name

A global scheduling template is created and the scheduling template view is displayed.
3. Run:
qos { pq | wrr | drr }

The scheduling mode of an interface queue is set to PQ, WRR, or DRR.


By default, WRR scheduling is used.
4. (Optional) Run:
qos queue queue-index wrr weight weight

The weight of an interface queue in WRR mode is set.


By default, the weight in WRR mode is 1.

NOTE

You need to perform this step only when the scheduling mode of an interface queue is set to
PQ+WRR or WRR.
When WRR scheduling is applied and the weight of a queue is set to 0, the queue applies PQ
scheduling and other queues apply WRR scheduling. That is, the overall scheduling mode is
PQ+WRR.
5. (Optional) Run:

qos queue queue-index drr weight weight

The weight of an interface queue in DRR mode is set.


By default, the weight in DRR mode is 1.

NOTE

You need to perform this step only when the scheduling mode of an interface queue is set to
DRR or PQ+DRR.
When DRR scheduling is applied and the weight of a queue is set to 0, the queue applies PQ
scheduling and other queues apply DRR scheduling. That is, the overall scheduling mode is
PQ+DRR.
6. Run:
quit

Return to the system view.


7. Run:
interface interface-type interface-number

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 125


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

The interface view is displayed.

Or run:
port-group port-group-name

The port group view is displayed.

NOTE

If you need to set the same scheduling parameters on multiple interfaces, you can perform the
configuration on the interface group to reduce the workload. You need to create a port group
before performing this task. For details about creating a port group, see Configuring the
Interface Group in the Configuration Guide - Ethernet.
8. Run:
qos schedule-profile profile-name

The scheduling template is applied.

----End

3.4.4 Checking the Configuration


After congestion management is configured, you can view the queue-based traffic statistics and
the scheduling parameters of the queues on a specified interface.

Prerequisite
The congestion management configurations are complete.

Procedure
l Run the display qos local-precedence-queue-map command to check the mappings
between local precedences and queues.
l Run the display qos static-cell [ interface interface-type interface-number { queue queue-
index | all } ] command to check the static buffer size of the interface queue.
NOTE

The display qos static-cell command cannot be used on the S5700SI, S5706, or S5700HI.
l Run the display qos max-length [ interface interface-type interface-number { queue
queue-index | all} ] command to check the maximum number of packets that can be buffered
in an interface queue.
NOTE

The display qos max-length command cannot be used on the S5700SI, S5706, or S5700HI.
l Run the display qos queue length interface interface-type interface-number command
to check the usage of the priority queue on a specified interface.
NOTE

The display qos queue length command cannot be used on the S5700SI or S5700EI.
l Run the display qos configuration interface [ interface-type interface-number ] command
to check all the QoS configurations on the interface.

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 126


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

3.5 Maintaining Congestion Avoidance and Congestion


Management
This section describes how to maintain traffic avoidance and congestion management.

3.5.1 Displaying the Queue-based Statistics


You can use display commands to view the queue-based traffic statistics such as the number of
forwarded and discarded packets.

Context
To view the queue-based traffic statistics, run the following command in any view.

Procedure
l Run the following commands to view the queue-based traffic statistics based on device
model.
– Run the display qos queue statistics [ queue queue-index outbound interface
interface-type interface-number ] command on the S5700SI to view the queue-based
traffic statistics.
NOTE

Before viewing the queue statistics on an interface, run the qos queue statistics enable command
to enable the queue-based traffic statistics function on the specified outbound interface.
– Run the display qos queue statistics [ queue queue-index { inbound interface
interface-type interface-number | outbound interface interface-type interface-
number [ form interface { interface-type interface-number | all } ] } ] command on the
S5700EI to view the queue-based traffic statistics.
NOTE

Before viewing the queue-based traffic statistics on an interface of S5700EI, run the qos queue
statistics enable command to enable the queue-based traffic statistics function on the specified
outbound interface.
– Run the display qos queue statistics interface interface-type interface-number
command on the S5700HI and S5706 to view the queue-based traffic statistics.
l Run the display qos port statistics interface interface-type interface-number command
to view the queue-based statistics.
NOTE

Before viewing the queue statistics on an interface, run the qos port statistics enable command to
enable the queue statistics function on the specified outbound interface.
The display qos port statistics command cannot be used on the S5700HI and S5706.

----End

3.5.2 Clearing the Queue-based Statistics


You can use the reset command to clear the queue-based traffic statistics.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 127


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Context
To re-collect the queue-based statistics on an interface, you can use the following command in
the user view to clear the previous statistics.

CAUTION
The queue-based statistics cannot be restored after you clear them. So, confirm the action before
you use the command.

Procedure
l Clear the queue-based traffic statistics on the S5700SI.
Run the reset qos queue statistics [ queue queue-index outbound interface interface-type
interface-number ] command to clear the queue-based traffic statistics on the interface.
l Clear the queue-based traffic statistics on the S5700EI.
– Run the reset qos queue statistics [ queue queue-index { inbound interface interface-
type interface-number | outbound interface interface-type interface-number [ form
interface { interface-type interface-number | all } ] } ] command to clear the queue-
based traffic statistics on the interface.
– Run the reset qos port statistics command to clear the queue-based traffic statistics on
the interface.
l Clear the queue-based traffic statistics on the S5700HI or S5706.
Run the reset qos queue statistics interface interface-type interface-number command to
clear the queue-based traffic statistics on the interface.
----End

3.6 Configuration Examples


This section provides several configuration examples of congestion avoidance and congestion
management.

3.6.1 Example for Configuring Congestion Management on the


S5700SI
By configuring congestion avoidance and congestion management, the S5700 provides different
services for packets of different priorities and preferentially guarantees bandwidth for high-
priority and low-delay services.

Networking Requirements
The Switch is connected to the router through GE 0/0/3. The 802.1p priorities of voice, video,
and data services from the Internet are 7, 5, and 2, and these services can reach users through
the router and Switch, as shown in Figure 3-1. To reduce the impact of network congestion and
ensure bandwidth for high-priority and low-delay services, you need to set the related parameters
according to the following table.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 128


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Table 3-1 Congestion management parameters

Service Type CoS

Voice CS7

Video EF

Data AF2

Figure 3-1 Networking diagram for configuring congestion management

Core Network

Router

GE0/0/3

GE0/0/1 GE0/0/2
Switch

PC TV
802.1p=2 LSW LSW 802.1p=5

Residential Residential
user 1 user N
802.1p=5 802.1p=2
802.1p=7 802.1p=7

TV Phone PC Phone

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the VLAN for each interface so that devices can communicate with each other
at the link layer.
2. Configure interfaces to trust 802.1p priorities of packets.
3. Configure the scheduling template and apply the scheduling template to the interface.

Data Preparation
To complete the configuration, you need the following data:
l VLAN IDs of data packets, video packets, and voice packets: VLANs 10, 20, and 30

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 129


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

l 802.1p priorities of data packets, video packets, and voice packets: 2, 5, and 7
l Scheduling parameters of each queue

Procedure
Step 1 Configure the VLAN for each interface so that devices can communicate with each other at the
link layer.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 10 20 30
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/3] quit

Step 2 Configure interfaces to trust 802.1p priorities of packets.


[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] trust 8021p
[Switch-GigabitEthernet0/0/3] quit

Step 3 Configure congestion management.

# Create a scheduling template and set queue scheduling parameters.


[Switch] qos schedule-profile p1
[Switch-qos-schedule-profile-p1] qos wrr
[Switch-qos-schedule-profile-p1] qos queue 7 wrr weight 0
[Switch-qos-schedule-profile-p1] qos queue 5 wrr weight 20
[Switch-qos-schedule-profile-p1] qos queue 2 wrr weight 10
[Switch-qos-schedule-profile-p1] quit

# Apply the scheduling template to GE 0/0/1 and GE 0/0/2 of the Switch.


[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos schedule-profile p1
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] qos schedule-profile p1
[Switch-GigabitEthernet0/0/2] quit

Step 4 Verify the configuration.

# View the scheduling template and queue scheduling parameters.


<Switch> system-view
[Switch] qos schedule-profile p1
[Switch-qos-schedule-profile-p1] display this
#
qos schedule-profile p1
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 130


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 10 20 30
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos schedule-profile p1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos schedule-profile p1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
trust 8021p
#
qos schedule-profile p1
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0
#
return

3.6.2 Example for Configuring Congestion Avoidance and


Congestion Management on the S5700EI
By configuring congestion avoidance and congestion management, the S5700 provides different
services for packets of different priorities and ensures high-priority and low-delay services.

Networking Requirements
The Switch is connected to the router through GE 0/0/3 and the 802.1p priorities of voice, video,
and data services from the Internet are 7, 5, and 2, and these services can reach users through
the router and Switch, as shown in Figure 3-2. To reduce the impact of network congestion and
ensure bandwidth for high-priority and low-delay services, you need to set the related parameters
according to the following table.

Table 3-2 Congestion avoidance parameters

Service Type Color Lower Threshold Drop Probability

Video Yellow 1000 0.78125%

Data Red 500 6.25%

Table 3-3 Congestion management parameters

Service Type CoS wrr

Voice CS7 0

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 131


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Service Type CoS wrr

Video EF 20

Data AF2 10

Figure 3-2 Networking diagram for configuring congestion avoidance and congestion
management

Core Network

Router

GE0/0/3

GE0/0/1 GE0/0/2
Switch

PC TV
802.1p=2 802.1p=5
LSW LSW

Residential Residential
user 1 user N
802.1p=5 802.1p=2
802.1p=7 802.1p=7

TV Phone PC Phone

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the VLAN for each interface so that devices can communicate with each other.
2. Configure interfaces to trust 802.1p priorities of packets.
3. Set scheduling parameters of queues.
4. Set the drop threshold and drop probability of queues.

Data Preparation
To complete the configuration, you need the following data:
l VLAN IDs of data packets, video packets, and voice packets: VLANs 10, 20, and 30
l 802.1p priorities of data packets, video packets, and voice packets: 2, 5, and 7
l Drop threshold and drop probability of queues

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 132


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

l Schedule parameters of each queue

Procedure
Step 1 Configure the VLAN for each interface so that devices can communicate with each other.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 10 20 30
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 10 20 30
[Switch-GigabitEthernet0/0/3] quit

Step 2 Configure interfaces to trust 802.1p priorities of packets.


[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] trust 8021p
[Switch-GigabitEthernet0/0/3] quit

Step 3 Configure congestion avoidance.


# Set the drop threshold and drop probability of queues.
[Switch] qos sred queue 2 red 500 discard-probability 1 yellow 1000 discard-
probability 4
[Switch] qos sred queue 5 red 500 discard-probability 1 yellow 1000 discard-
probability 4
[Switch] qos sred queue 7 red 500 discard-probability 1 yellow 1000 discard-
probability 4

Step 4 Configure congestion management.


# Set the scheduling mode of each queue on GE 0/0/1 and GE 0/0/2 on the Switch.
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] qos wrr
[Switch-GigabitEthernet0/0/1] qos queue 7 wrr weight 0
[Switch-GigabitEthernet0/0/1] qos queue 5 wrr weight 20
[Switch-GigabitEthernet0/0/1] qos queue 2 wrr weight 10
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] qos wrr
[Switch-GigabitEthernet0/0/2] qos queue 7 wrr weight 0
[Switch-GigabitEthernet0/0/2] qos queue 5 wrr weight 20
[Switch-GigabitEthernet0/0/2] qos queue 2 wrr weight 10
[Switch-GigabitEthernet0/0/2] quit

Step 5 Verify the configuration.


# View the global SRED configuration of the interface queue in the outbound direction.
<Switch> display qos sred
Current sred configuration:
qos sred queue-index 2 red 500 discard-probability 1 yellow 1000 discard-
probability 4
qos sred queue-index 5 red 500 discard-probability 1 yellow 1000 discard-
probability 4
qos sred queue-index 7 red 500 discard-probability 1 yellow 1000 discard-
probability 4

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 133


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 10 20 30
#
qos sred queue 2 red 500 discard-probability 1 yellow 1000 discard-probability
4
qos sred queue 5 red 500 discard-probability 1 yellow 1000 discard-probability
4
qos sred queue 7 red 500 discard-probability 1 yellow 1000 discard-probability
4

interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30
qos queue 2 wrr weight 10
qos queue 5 wrr weight 20
qos queue 7 wrr weight 0
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20 30
trust 8021p
#
return

3.6.3 Example for Configuring Congestion Avoidance and


Congestion Management on the S5700HI or S5706
After congestion avoidance and congestion management are configured, the S5700 provides
different services for packets of different priorities and ensures high-priority and low-delay
services.

Networking Requirements
The Switch is connected to the router through GE 0/0/3; the 802.1p priorities of voice, video,
and data services on the Internet are 6, 5, and 2 respectively, and these services can reach users
through the router and Switch, as shown in Figure 3-3. The rate of incoming interface GE
0/0/3 on the Switch is greater than the rates of outgoing interfaces GE 0/0/1 and GE 0/0/2;
therefore, congestion may occur on these two outgoing interfaces. To reduce the effect caused
by congestion and ensure that high-priority and short-delay services are processed first, the
requirements are as follows.

Table 3-4 Congestion avoidance parameters

Types of Color Lower Upper Drop Percent


Services Threshold (%) Threshold (%)

Voice Green 80 100 10

Video Yellow 60 80 20

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 134


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Types of Color Lower Upper Drop Percent


Services Threshold (%) Threshold (%)

Data Red 40 60 40

Table 3-5 Congestion management parameters

Type of Services CoS

Voice EF

Video AF3

Data AF1

Figure 3-3 Networking diagram for configuring congestion avoidance and congestion
management

Internet

Router
GE0/0/3

GE0/0/1 GE0/0/2
Switch
PC TV
802.1p 802.1p
=5 =2
Individual
Individual
user n
user 1
802.1p 802.1p
=2 802.1p =5 802.1p
=6 =6

TV Phone PC Phone

Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the VLAN for each interface so that the devices can communicate with each
other.

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 135


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

2. Create and configure a DiffServ domain on the Switch, map packets of 802.1p priorities to
PHBs and colors of packets, and bind the DiffServ domain to an incoming interface on the
Switch.
3. Create a WRED drop profile on the Switch and apply the WRED drop profile on an outgoing
interface.
4. Set scheduling parameters of queues of different CoS on outgoing interfaces of the
Switch.

Data Preparation
To complete the configuration, you need the following data:
l VLAN IDs of data packets, video packets, and voice packets, namely, 2, 5, and 6
l PHBs mapped to 802.1p priorities being 6, 5, and 2 and colors
l Name of the WRED drop profile and WRED parameters
l Scheduling parameters of queues of different CoS

Procedure
Step 1 Configure the VLAN for each interface so that the devices can communicate with each other.
<Quidway> system-view
[Quidway] sysname Switch
[Switch] vlan batch 2 5 6
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] port link-type trunk
[Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 5 6
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] port link-type trunk
[Switch-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 5 6
[Switch-GigabitEthernet0/0/2] quit
[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] port link-type trunk
[Switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 5 6
[Switch-GigabitEthernet0/0/3] quit

Step 2 Configure priority mapping based on simple traffic classification.


# Create DiffServ domain ds1, map packets of 802.1p priorities being 6, 5, and 2 to PHBs CS6,
EF, and AF2, and color packets as green, yellow, and red.
[Quidway] sysname Switch
[Switch] diffserv domain ds1
[Switch-dsdomain-ds1] 8021p-inbound 6 phb ef green
[Switch-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
[Switch-dsdomain-ds1] 8021p-inbound 2 phb af1 red
[Switch-dsdomain-ds1] quit

# Bind incoming interface GE 0/0/3 on the Switch to DiffServ domain ds1.


[Switch] interface gigabitethernet0/0/3
[Switch-GigabitEthernet0/0/3] trust upstream ds1
[Switch-GigabitEthernet0/0/3] trust 8021p inner
[Switch-GigabitEthernet0/0/3] quit

Step 3 Configure congestion avoidance.


# Create drop profile wred1 on the Switch and set parameters of packets of three colors.
[Switch] drop-profile wred1
[Switch-drop-wred1] color green low-limit 80 high-limit 100 discard-percentage 10

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 136


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

[Switch-drop-wred1] color yellow low-limit 60 high-limit 80 discard-percentage 20


[Switch-drop-wred1] color red low-limit 40 high-limit 60 discard-percentage 40
[Switch-drop-wred1] quit

# Apply drop profile wred1 on outgoing interfaces GE 0/0/1 and GE 0/0/2 of the Switch.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] qos wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 5 wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 3 wred wred1
[Switch-GigabitEthernet0/0/1] qos queue 1 wred wred1
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] qos wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 5 wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 3 wred wred1
[Switch-GigabitEthernet0/0/2] qos queue 1 wred wred1
[Switch-GigabitEthernet0/0/2] quit

Step 4 Configure congestion management.

# Set scheduling parameters of queues of different CoS on outgoing interfaces GE 0/0/1 and
GE 0/0/2 of the Switch.
[Switch] interface gigabitethernet0/0/1
[Switch-GigabitEthernet0/0/1] qos drr
[Switch-GigabitEthernet0/0/1] qos queue 5 drr weight 0
[Switch-GigabitEthernet0/0/1] qos queue 3 drr weight 100
[Switch-GigabitEthernet0/0/1] qos queue 1 drr weight 50
[Switch-GigabitEthernet0/0/1] quit
[Switch] interface gigabitethernet0/0/2
[Switch-GigabitEthernet0/0/2] qos drr
[Switch-GigabitEthernet0/0/2] qos queue 5 drr weight 0
[Switch-GigabitEthernet0/0/2] qos queue 3 drr weight 100
[Switch-GigabitEthernet0/0/2] qos queue 1 drr weight 50
[Switch-GigabitEthernet0/0/2] quit
[Switch] quit

Step 5 Verify the configuration.

# Check the configuration of DiffServ domain ds1.


<Switch> display diffserv domain name ds1
Diffserv domain name:ds1
8021p-inbound 0 phb be green
8021p-inbound 1 phb af1 red
8021p-inbound 2 phb af2 green
8021p-inbound 3 phb af3 yellow
8021p-inbound 4 phb af4 green
8021p-inbound 5 phb ef green
8021p-inbound 6 phb cs7 green
8021p-inbound 7 phb cs7 green
8021p-outbound be green map 0
......

# Check the configuration of drop profile wred1.


<Switch> display drop-profile name wred1
Drop-profile[3]: wred1
Color Low-limit High-limit Discard-percentage
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Green 80 100 10
Yellow 60 80 20
Red 40 60 40
Non-tcp 100 100 100
-----------------------------------------------------------------

----End

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 137


Copyright © Huawei Technologies Co., Ltd.
Quidway S5700 Series Ethernet Switches 3 Congestion Avoidance and Congestion Management
Configuration Guide - QoS Configuration

Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 2 5 6
#
diffserv domain ds1
8021p-inbound 2 phb af1 red
8021p-inbound 5 phb af3 yellow
8021p-inbound 6 phb ef green
#
drop-profile wred1
color green low-limit 80 high-limit 100 discard-percentage 10
color yellow low-limit 60 high-limit 80 discard-percentage 20
color red low-limit 40 high-limit 60 discard-percentage 40
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 5 6
qos drr
qos queue 1 drr weight 50
qos queue 3 drr weight 100
qos queue 5 drr weight 0
qos wred wred1
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 5 6
qos drr
qos queue 1 drr weight 50
qos queue 3 drr weight 100
qos queue 5 drr weight 0
qos wred wred1
qos queue 1 wred wred1
qos queue 3 wred wred1
qos queue 5 wred wred1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 5 6
trust upstream ds1
trust 8021p inner

#
return

Issue 01 (2011-10-26) Huawei Proprietary and Confidential 138


Copyright © Huawei Technologies Co., Ltd.

You might also like