Huawei Qos Guide
Huawei Qos Guide
V100R006C01
Issue 01
Date 2011-10-26
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.
Website: http://www.huawei.com
Email: [email protected]
Intended Audience
This document provides the basic concepts, configuration procedures, and configuration
examples in different application scenarios of the QoS supported by the S5700.
Symbol Conventions
The symbols that may be found in this document are defined as follows.
Symbol Description
Command Conventions
The command conventions that may be found in this document are defined as follows.
Convention Description
&<1-n> The parameter before the & sign can be repeated 1 to n times.
Change History
Updates between document issues are cumulative. Therefore, the latest document issue contains
all updates made in previous issues.
Contents
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.
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.
NOTE
The S5700SI does not support simple traffic classification according to the CFI of VLAN packets.
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.
0 BE
1 AF1
2 AF2
3 AF3
4 AF4
5 EF
6 CS6
7 CS7
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.
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
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.
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.
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.
BE 0
AF1 1
AF2 2
AF3 3
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.
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.
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:
Data Preparation
To configure priority mapping based on simple traffic classification, you need the following
data.
No. Data
2 Input DSCP priority, output 802.1p priority, drop precedence, or new DSCP 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
Step 2 Run:
interface interface-type interface-number
Or run the port-group port-group-name command to display the port group view.
NOTE
Step 3 Run:
trust { 8021p | dscp | ip-precedence }
----End
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
----End
Context
The S5700 can map DSCP priorities to 802.1p priorities, drop priorities, or new DSCP priorities.
Procedure
Step 1 Run:
system-view
Step 2 Run:
qos map-table { dscp-dot1p | dscp-dp | dscp-dscp }
Step 3 Run:
input { input-value1 [ to input-value2 ] &<1-10> } output output-value
----End
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
Step 2 Run:
qos map-table { ip-pre-dot1p | ip-pre-ip-pre }
Step 3 Run:
input { input-value1 [ to input-value2 ] output output-value }
----End
Procedure
Step 1 Run:
system-view
Step 2 Run:
qos local-precedence-queue-map local-precedence queue-index
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.
be 0
af1 1
af2 2
af3 3
af4 4
ef 5
cs6 6
cs7 7
----End
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
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
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
NOTE
Step 3 Run:
trust { 8021p { inner | outer } | dscp }
----End
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
Step 2 Run:
interface interface-type interface-number
Step 3 Run:
port priority priority-value
----End
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.
Procedure
Step 1 Run:
system-view
Step 2 Run:
diffserv domain { default | ds-domain-name }
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.
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
NOTE
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
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
NOTE
Step 3 Run:
trust upstream { ds-domain-name | default | none }
----End
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
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.
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
Procedure
Step 1 Run:
system-view
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.
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 ]
NOTE
NOTE
NOTE
----End
Procedure
Step 1 Run:
system-view
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>
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
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.
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 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.
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 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 ]*
4. Run:
quit
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.
1. Run:
system-view
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
(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 ]
NOTE
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.
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.
----End
Procedure
Step 1 Run:
system-view
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
Procedure
Step 1 Run:
system-view
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 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 DSCP value and IP precedence of packets cannot be re-marked at the same time.
----End
Context
NOTE
Procedure
Step 1 Run:
system-view
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 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 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
Procedure
Step 1 Run:
system-view
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 ] } ]
NOTE
----End
Procedure
Step 1 Run:
system-view
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
Procedure
Step 1 Run:
system-view
NOTE
Before collecting the flow-based statistics, enable the traffic statistics function in a traffic behavior.
----End
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
NOTE
----End
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
----End
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
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
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
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
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.
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
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:
Data Preparation
To configure a traffic policy by using simplified QoS commands, you need the following data.
No. Data
1 ACL rule
Procedure
l Configuring traffic policing globally
1. Run:
system-view
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.
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 ] } ]
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
Or, run:
interface eth-trunktrunk-id
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
----End
Procedure
l Configuring traffic policing globally
1. Run:
system-view
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.
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
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
----End
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.
Procedure
l Configuring traffic filtering globally
1. Run:
system-view
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
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
Procedure
l Configuring re-marking globally
1. Run:
system-view
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
Or, run:
interface eth-trunk trunk-id
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
Procedure
l Configure traffic mirroring globally.
1. Run:
system-view
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
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
Procedure
l Configuring traffic statistics globally
1. Run:
system-view
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
Or, run:
interface eth-trunk trunk-id
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.
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
Procedure
l Configuring traffic redirection globally
1. Run:
system-view
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
Or, run:
interface eth-trunktrunk-id
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
Procedure
l Configuring traffic redirection globally
1. Run:
system-view
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
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
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
Context
CAUTION
The flow-based traffic statistics cannot be restored after being cleared. Exercise caution when
you run the command.
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
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
branch 1 of
the enterprise branch 2 of
the enterprise
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 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
#
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
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
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.
----End
Configuration Files
l Configuration file of the Switch
#
sysname Switch
#
vlan batch 100 200 300
#
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
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.
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
Classifier: c1
Operator: AND
Rule(s) : if-match cvlan-id 100
----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
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 300
#
return
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.
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
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
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.
Classifier: c1
Operator: AND
Rule(s) : if-match acl 3001
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
#
return
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.
# 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
NOTE
Assign network segment address 20.20.20.2/24 to the interface connecting the router and Switch. The
details are not mentioned here.
[Switch-GigabitEthernet0/0/1] quit
[Switch] quit
----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
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.
Classification
Token
bucket
Drop
The S5700 supports the single token bucket and dual token buckets.
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.
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.
NOTE
The S5700 does not support traffic shaping according to user-defined policy.
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
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface interface-type interface-number
Or, run:
port-group port-group-name
NOTE
Step 3 Run:
qos lr { inbound | outbound } cir cir-value [ cbs cbs-value ]
----End
Procedure
Step 1 Run:
system-view
Step 2 Run:
interface meth 0/0/1
Step 3 Run:
qos lr pps packets
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
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
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.
No. Data
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
Procedure
Step 1 Run:
system-view
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
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
Step 2 Run:
traffic behavior behavior-name
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 ] } ]
l When the burst size of a packet is smaller than the CBS value, the packet is colored green.
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
NOTE
NOTE
----End
Procedure
Step 1 Run:
system-view
Step 3 Run:
classifier classifier-name behavior behavior-name
----End
Procedure
l Applying a traffic policy to the system or a slot
1. Run:
system-view
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
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
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
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.
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
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
Data Preparation
To configure traffic shaping, you need the following data.
No. Data
2 (Optional) Rate for traffic shaping in an interface queue, including the CIR and PIR
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
Step 2 Run:
interface interface-type interface-number
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 ]
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.
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
Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view
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 ]
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.
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
Step 2 Run:
interface interface-type interface-number
Or, run:
port-group port-group-name
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 ]
By default, the rate for traffic shaping in an interface queue is the maximum bandwidth of the
interface.
----End
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.
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
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
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
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
Context
CAUTION
The traffic statistics cannot be restored after being cleared. Exercise caution when you run the
command.
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
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.
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.
# Create VLANIF 300 and set its network segment address to 192.168.1.1/24.
NOTE
# On the router, set the IP address of the interface connecting the router and Switch to 192.168.1.2/24.
----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
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 100 200 300
#
return
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:
Voice 2 10 46
Video 4 10 30
Data 4 10 14
Figure 2-4 Network diagram for configuring traffic policing based on a traffic classifier
Phone
VLAN 120
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
[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
Classifier: c3
Operator: AND
Rule(s) : if-match vlan-id 100
Classifier: c1
Operator: AND
Rule(s) : if-match vlan-id 120
# 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
+--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
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:
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.
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.
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
# 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
# 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
# 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,
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
# 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
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
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.
Phone
802.1p=6
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
# 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.
# 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
----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 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
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.
Phone
802.1p=6
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
# 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.
# 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
----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
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.
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
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
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.
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.
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.
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.
NOTE
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
Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view
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 ]
----End
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
Step 3 Run:
dei enable
----End
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
NOTE
The S5700SI and the S5700HI do not support the qos sred command.
----End
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
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:
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
Procedure
l Setting the length of the interface queue on the S5700HI and S5706
1. Run:
system-view
----End
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
Step 2 Run:
interface interface-type interface-number
Or run the port-group port-group-name command to enter the port group view.
NOTE
Step 3 Run:
dei enable
By default, the CFI field is not configured as the internal drop priority.
NOTE
----End
Procedure
Step 1 Run:
system-view
----End
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
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
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
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
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.
No. Data
Procedure
l (Optional) Setting the length of the interface queue on the S5700EI
1. Run:
system-view
A global tail drop template is created and the tail drop template view is displayed.
3. Run:
----End
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
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 }
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:
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
A global scheduling template is created and the scheduling template view is displayed.
3. Run:
qos { pq | wrr | drr }
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:
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
Or run:
port-group port-group-name
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
----End
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
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
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
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.
Voice CS7
Video EF
Data AF2
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
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
----End
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
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.
Voice CS7 0
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
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
----End
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
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.
Video Yellow 60 80 20
Data Red 40 60 40
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.
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
# 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
# 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
----End
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