01-05 Class-Based QoS Configuration
01-05 Class-Based QoS Configuration
This chapter describes the configuration of traffic policy based on complex traffic
classification as well as the priority mapping in simple traffic classification. In
addition, this chapter also provides configuration examples.
to enter the specified internal priority queue and obtain corresponding colors
based on the DSCP values.
5.11 Maintaining Class-based QoS Configuration
This section describes how to clear statistics of traffic policies.
5.12 Configuration Examples for Class-based QoS
This section provides typical examples for configuring class-based QoS.
After packets are classified at the DiffServ domain edge, internal nodes provide
differentiated services for classified packets. A downstream node can accept and
continue the upstream classification or classify packets based on its own criteria.
Traffic Behaviors
A traffic classifier is configured to provide differentiated services and must be
associated with a certain traffic control or resource allocation behavior, which is
called a traffic behavior.
Traffic policing Restricts the traffic rate to a specific value. When traffic
exceeds the specified rate, excess traffic is dropped.
Modifying the TTL Modifies the Time To Live (TTL) value of IP packet
value headers.
What Is BA Classification
Behavior Aggregate (BA) classification allows the device to classify packets based
on related values as follows:
● DSCP value of IPv4 packets
● TC value of IPv6 packets
● EXP value of MPLS packets
● 802.1p value of VLAN packets
It is used to simply identify the traffic that has the specific priority or class of
service (CoS) for mapping between external and internal priorities.
BA classification confirms that the priority of incoming packets on a device is
trusted and mapped to the service-class and color based on a priority mapping
table. The service-class and color of outgoing packets are then mapped back to
the priority. For details about priority mapping, see section QoS Priority Mapping.
To configure BA classification on a NE40E, configure a DiffServ (DS) domain,
define a priority mapping table for the DS domain, and bind the DS domain to a
trusted interface.
BA classification applies to the DS internal nodes.
Multi-Field Classification
As networks rapidly develop, services on the Internet become increasingly
diversified. Various services share limited network resources, especially when
multiple services use port number 80. Because of this increasing demand, network
devices are required to possess a high degree of sensitivity for services, including
an in-depth parsing of packets and a comprehensive understanding of any packet
field at any layer. This level of sensitivity rises far beyond what behavior aggregate
(BA) classification can offer. Multi-field (MF) classification can be deployed to
help address this sensitivity deficit.
MF classification allows a device to elaborately classify packets based on certain
conditions, such as 5-tuple (source IP address, source port number, protocol
number, destination address, and destination port number). To simplify
configurations and facilitate batch modification, MF classification commands are
designed based on a template. For details, see section QoS Policies Based on MF
Classification.
Configuration Precautions--M2H
Restrictions Guidelines Impact
When rate limiting based Do not configure CAR When rate limiting based
on Layer 3 packets is based on the packet rate on Layer 3 packets is
configured in a traffic or CAR based on packet configured in a traffic
policy, CAR based on the length compensation in policy, CAR based on the
packet rate or CAR based a traffic policy when rate packet rate or CAR based
on packet length limiting based on Layer 3 on packet length
compensation cannot be packets is required. compensation cannot be
configured. Otherwise, configured. Otherwise,
rate limiting based on rate limiting based on
Layer 3 packets does not Layer 3 packets does not
take effect. take effect.
For a Layer 3 private line To apply a traffic policy The traffic policy
user, if a UCL rule for that contains an ACL becomes invalid.
matching the source and rule for matching the
destination IP addresses source and destination IP
is configured in the addresses to the Layer 3
traffic policy applied in private line user's
the system view, the UCL network-to-network
rule becomes invalid traffic, configure the
when an EDSG service traffic policy in the
policy is applied to the interface view.
user.
Configuration Precautions--M2K
Restrictions Guidelines Impact
When rate limiting based Do not configure CAR When rate limiting based
on Layer 3 packets is based on the packet rate on Layer 3 packets is
configured in a traffic or CAR based on packet configured in a traffic
policy, CAR based on the length compensation in policy, CAR based on the
packet rate or CAR based a traffic policy when rate packet rate or CAR based
on packet length limiting based on Layer 3 on packet length
compensation cannot be packets is required. compensation cannot be
configured. Otherwise, configured. Otherwise,
rate limiting based on rate limiting based on
Layer 3 packets does not Layer 3 packets does not
take effect. take effect.
For a Layer 3 private line To apply a traffic policy The traffic policy
user, if a UCL rule for that contains an ACL becomes invalid.
matching the source and rule for matching the
destination IP addresses source and destination IP
is configured in the addresses to the Layer 3
traffic policy applied in private line user's
the system view, the UCL network-to-network
rule becomes invalid traffic, configure the
when an EDSG service traffic policy in the
policy is applied to the interface view.
user.
Configuration Precautions--M2K-B
Restrictions Guidelines Impact
When rate limiting based Do not configure CAR When rate limiting based
on Layer 3 packets is based on the packet rate on Layer 3 packets is
configured in a traffic or CAR based on packet configured in a traffic
policy, CAR based on the length compensation in policy, CAR based on the
packet rate or CAR based a traffic policy when rate packet rate or CAR based
on packet length limiting based on Layer 3 on packet length
compensation cannot be packets is required. compensation cannot be
configured. Otherwise, configured. Otherwise,
rate limiting based on rate limiting based on
Layer 3 packets does not Layer 3 packets does not
take effect. take effect.
For a Layer 3 private line To apply a traffic policy The traffic policy
user, if a UCL rule for that contains an ACL becomes invalid.
matching the source and rule for matching the
destination IP addresses source and destination IP
is configured in the addresses to the Layer 3
traffic policy applied in private line user's
the system view, the UCL network-to-network
rule becomes invalid traffic, configure the
when an EDSG service traffic policy in the
policy is applied to the interface view.
user.
Context
As networks rapidly develop and services become increasingly diversified, multiple
service flows share the same network resource. In some scenarios, incoming or
ongoing traffic on a network needs to be classified. For example, voice, video, and
data services must be allocated different bandwidths because they have different
requirements on delay. Traffic from different users must be distinguished and
allocated different bandwidths and priorities. BA classification-based traffic
policies fail to meet such requirements.
MF classification-based traffic policies for IP packets provide differentiated services
according to parameters such as the DSCP value, protocol type, IP address, and
port number in packets, which can meet the requirements of different services on
bandwidth and delay.
Typically, MF classification-based traffic policies are configured on routers at the
network edge, and BA classification-based traffic policies are configured on core
routers.
Pre-configuration Tasks
Before configuring MF classification-based traffic policies for IP packets, you need
to complete the following tasks:
Procedure
● Define a traffic classifier based on Layer 3 or Layer 4 information
a. Run system-view
For IPv6 packets, you need to specify the keyword ipv6 when defining a
matching rule in Step 3. A matching rule defined to match packets based on the
source or destination addresses applies to IPv6 packets, but not IPv4 packets.
You can define different ACL rules as required, including the protocol type, source
address, destination address, and ToS in packets. The if-match acl command
filters packets according to the ACL rules defined in the rule command. The
system then performs the corresponding traffic behavior for the matching
packets.
If multiple matching rules are defined in a traffic classifier, you can set
the logical relationship between the matching rules by specifying the
parameter operator in Step 2.
▪ and: A packet belongs to the classifier only when it matches all the
rules.
▪ or: A packet belongs to the classifier when it matches any one of the
rules.
d. Run commit
If multiple matching rules are defined for the same traffic classifier, you
can set their logical relationships by specifying the parameter operator in
Step 2. For details, see the previous section.
If multiple traffic classifiers are configured in one traffic policy, the traffic
behaviors corresponding to these traffic classifiers are implemented in
different orders.
Traffic Traffic
Classifier Matching Rule Behavior Traffic Action
Traffic Traffic
Classifier Matching Rule Behavior Traffic Action
d. Run commit
----End
Context
The NE40E supports various types of traffic behaviors. You can choose one or
more traffic behaviors as required.
Procedure
● Configure packet filtering actions.
a. Run system-view
a. Run system-view
If this command is run more than once, the last configuration overrides
the previous one.
If the CoS of a packet is re-marked as EF, BE, CS6, or CS7, the packet can be re-
marked only green.
d. Run user-queue cir cir-value [ [ pir pir-value ] | [ flow-queue flow-
queue-name ] | [ flow-mapping mapping-name ] | [ user-group-queue
group-name ] | [ service-template service-template-name ] ]*
The outgoing traffic supports class-based HQoS scheduling only when the
traffic policy works in unshared mode and is applied to an ETM subcard.
The user-queue and car commands are mutually exclusive in the same traffic
behavior.
e. (Optional) Run flow-car cir cir-value [ pir pir-value ] [ cbs cbs-value
[ pbs pbs-value ] ] identifier { source-ip | destination-ip }
Flow CAR is implemented for flows with the source or destination IP
addresses residing on the specified network segment.
f. Run commit
The configuration is committed.
● Configure suppression for broadcast, multicast, and unknown unicast packets.
Perform the following steps on the Router:
a. Run system-view
The system view is displayed.
b. Run traffic behavior behavior–name
A traffic behavior is configured, and the traffic behavior view is displayed.
c. Run broadcast-suppression cir cir-value [ cbs cbs-value ] [ green
{ discard | pass [ service-class class color { green | yellow | red } ] } |
red { discard | pass [ service-class class color { green | yellow |
red } ] } ] *
The rate at which broadcast packets are transmitted is restricted.
d. Run multicast-suppression cir cir-value [ cbs cbs-value ] [ green
{ discard | pass [ service-class class color { green | yellow | red } ] } |
red { discard | pass [ service-class class color { green | yellow |
red } ] } ] *
The rate at which multicast packets are transmitted is restricted.
e. Run unknown-unicast-suppression cir cir-value [ cbs cbs-value ] [ green
{ discard | pass [ service-class class color { green | yellow | red } ] } |
red { discard | pass [ service-class class color { green | yellow |
red } ] } ] *
The rate at which unknown unicast packets are transmitted is restricted.
The configured traffic behavior can be applied to the incoming or outgoing
traffic on an interface.
After traffic suppression is applied to an interface, the packets matching the
rules are processed based on the traffic behavior, and the packets not
matching the rules are forwarded.
● Configure forced traffic classification.
Perform the following steps on the Router:
a. Run system-view
The system view is displayed.
b. Run traffic behavior behavior–name
▪ To re-mark the TTL value of IP packets, run the remark ttl ttl-value
command.
To re-mark the DSCP value of IPv6 packets, run the remark ipv6 dscp dscp-value
command.
d. Run commit
The configuration is committed.
● Set packet forwarding actions.
NOTICE
● Redirecting of packets to the public network LSP applies only to the ingress
node of an MPLS network, instead of other nodes such as transit and
egress nodes.
● Redirecting of packets to the public network LSP can be configured only
for single-tagged MPLS packets.
a. Run system-view
▪ To redirect IP packets to the public network LSP, run the redirect lsp
public [ dest-ipv4-address | interface interface-type interface-
number [.subinterface-number] | secondary ] command.
When the redirection policy in the traffic behavior is a discard PBR policy, the IP
address and outbound interface of the next hop must be specified. When the
redirection policy in the traffic behavior is a forward PBR policy, the IP address of
the next hop must be specified.
In IPv6 application, the IP address of the next hop specified for a discard PBR
policy must be an IPv6 link-local address or an IPv6 unicast address; the IP
address of the next hop specified for a forward PBR policy can be only an IPv6
unicast address.
d. Run commit
The configuration is committed.
● Configure a load balancing mode for packets.
Perform the following steps on the Router:
a. Run system-view
The system view is displayed.
b. Run traffic behavior behavior-name
a. Run system-view
a. Run system-view
----End
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 Run system-view
----End
Procedure
Step 1 Run system-view
Step 2 Perform the following operations based on the interfaces on which a traffic policy
is used:
● Apply an MF classification-based traffic policy to a Layer 3 interface.
a. To enter the Layer 3 interface view, run the interface interface-type
interface-number command.
b. (Optional) To apply an MF classification-based traffic policy to incoming
traffic based on the source and destination QoS policy IDs, run the qppb-
policy qos-local-id both inbound command.
a. To enter the EVC Layer 2 sub-interface view, run the interface interface-
type interface-number.subnum mode l2 command.
b. To apply a traffic policy to the EVC Layer 2 sub-interface, run the traffic-
policy policy-name { inbound | outbound } identifier { none | vid | ce-
vid | vid-ce-vid } [ all-layer | link-layer | mpls-layer ] command.
The bandwidth allocation mode specified using the identifier parameter must be
the same as the one configured on the EVC Layer 2 sub-interface.
● Apply an MF classification-based traffic policy to a QinQ VLAN tag
termination sub-interface, with the PVLAN ID and CVLAN ID ranges specified.
a. To enter the sub-interface view, run the interface interface-type
interface-number.subinterface-number command.
b. To set a VLAN ID range for the sub-interface and configure the sub-
interface to remove the tags from double-tagged packets, run the
encapsulation qinq-termination [ local-switch | rt-protocol ]
command.
c. To configure the sub-interface as a QinQ VLAN tag termination sub-
interface, run the qinq termination pe-vid pe-vid [ to high-pe-vid ] ce-
vid ce-vid [ to high-ce-vid ] [ vlan-group group-id ] command.
d. To apply a traffic policy to the QinQ VLAN tag termination sub-interface,
run the traffic-policy policy-name { inbound | outbound } pe-vid pe-vid
ce-vid ce-vid1 [ to ce-vid2 ] [ all-layer | link-layer | mpls-layer ]
command.
● Apply an MF traffic classification-based traffic policy to a VBDIF interface.
a. To create a bridge domain (BD), run the bridge-domain bd-id command.
b. To create a VBDIF interface and enter the VBDIF interface view, run the
interface vbdif bd-id command.
c. To apply a traffic policy to the VBDIF interface, run the traffic-policy
policy-name { inbound | outbound } command.
If traffic received by a VBDIF interface or VLANIF interface view comes from multiple
interfaces that reside on different forwarding modules and the policy CAR is applied,
the limited bandwidth of each forwarding module is the configured limited bandwidth,
and the actual valid limited bandwidth of the VBDIF interface or VLANIF interface
view is the sum of the bandwidth of each forwarding module.
● (Optional) Apply an MF classification-based traffic policy to a VPN instance.
a. To enter the VPN instance view, run the ip vpn-instance vpn-instance-
name command.
b. To apply a traffic policy to the VPN instance, run the traffic-policy policy-
name network inbound command.
● (Optional) Apply an MF classification-based traffic policy to a VSI.
a. To enter the VSI view, run the vsi vsi-name command.
b. Perform either of the following operations as required:
----End
Context
Do as follows on the Router:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run traffic policy policy-name
A traffic policy is configured, and th traffic policy view is displayed.
Step 3 Run statistics enable
The function to collect statistics of the traffic policy is enabled.
Step 4 Run share-mode
The shared mode is specified for the traffic policy.
Step 3 is optional. To save memory resources, the function to collect statistics of a traffic
policy is disabled by default. When users need to view statistics about a traffic policy, run
the statistics enable command to enable this function.
Step 4 is optional. The default attribute of a traffic policy is shared.
● After a traffic policy is applied to an interface, you cannot change the mode of the
traffic policy, regardless of the shared or unshared mode. Before changing the mode of
a traffic policy, you must disable the traffic policy on the interface.
● If a shared traffic policy is applied to different interfaces, this shared traffic policy
collects statistics on the traffic of all the interfaces as a whole. That is, the shared
traffic policy does not collect statistics on the traffic of interfaces individually.
● If an unshared traffic policy is applied to different interfaces, this unshared traffic
policy collects statistics on the traffic of the interfaces individually.
● A traffic policy collects statistics on incoming traffic and outgoing traffic individually,
whether its attribute is shared or unshared.
----End
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run traffic behavior behavior–name
A traffic behavior is configured and the traffic behavior view is displayed.
Step 3 Run log first-packet
The function to log the first packet that matches an ACL rule is enabled.
● The log first-packet command supports logging only for IP packets. MPLS/L2/UCL rules
are not supported.
● If queue congestion occurs, the first packet recording time is inaccurate.
● The shared traffic policy does not support the log first-packet command.
● If a traffic policy is applied to Layer 2 interfaces ,EVC, VE or global VE, the traffic
behavior in the traffic policy cannot be set to log first-packet.
● If the global ACL, global UCL, VPN ACL, or VXLAN multi-field classification has been
configured on the device, log first-packet cannot be configured.
● If a traffic policy has been applied to a vBDIF or GRE tunnel interface, log first-packet
cannot be configured.
● In the same traffic behavior, the log first-packet command is mutually exclusive with
the ip netstream sampler command.
----End
Procedure
● Run the display interface [ interface-type [ interface-number ] ] command to
check information about the traffic on the interface.
● Run the display traffic behavior { system-defined | user-defined }
[ behavior-name ] command to check information about the configured
traffic behaviors.
● Run the display traffic classifier { system-defined | user-defined }
[ classifier-name ] command to check information about the configured
traffic classifiers.
● Run the display traffic policy { system-defined | user-defined } [ policy-
name [ classifier classifier-name ] ] command to check information about
the association between all or the specified traffic classifiers and traffic
behaviors in traffic policies.
----End
Context
Traffic policy based on BA classification is used to map the precedence of traffic
on one type of network to another type. That is, to transmit the traffic in the
other network according to the original precedence.
When the NE40E serves as the border router for different networks, the original
external priorities (DSCP values) in the IP packets that go into the NE40E are all
mapped to the internal priorities of the router represented by service classes of
DiffServ and colors. When the NE40E sends out the packet, the internal priority is
mapped back to the external priority.
A Diff-Serv (DS) domain is a group of Diff-Serv nodes that adopt the same service
policies and implement the same PHB aggregate.
The BA classification can map the internal precedence to the external precedence,
and the external precedence to the internal precedence. However, mapping
between traffic of the same type, for example, IP traffic or MPLS traffic, is not
supported.
Using the qos default-service-class command, you can configure the upstream traffic on
the interface to enter the specific queues and provide service. After this command is run,
other packets cannot be enabled to enter the queues, and BA classification cannot be
enabled.
Pre-configuration Tasks
Before configuring traffic shaping, complete the following tasks:
Procedure
● Configure the mappings between DSCP values of IP packets, service classes,
and colors.
a. Run system-view
The system predefines a domain named default for IP packets. You are
not allowed to delete the default domain.
If the priority mapping in Step 3 is not set in the DiffServ domain, the
system uses the default mapping. The default domain describes the
default mappings between the DSCP values, QoS service classes, and
colors for IP packets. You can change the mappings in as required. In the
default domain, the DSCP values of the packets from an upstream device
are mapped to QoS service classes and colors. Their mappings are shown
in Table 5-3. The QoS service classes and colors of the packets entering a
downstream device are mapped to DSCP values. Their mappings are
shown in Table 5-4.
Table 5-3 Default mappings between DSCP values and service classes in
the default domain
01 BE Green 33 BE Green
03 BE Green 35 BE Green
05 BE Green 37 BE Green
07 BE Green 39 BE Green
09 BE Green 41 BE Green
11 BE Green 43 BE Green
13 BE Green 45 BE Green
15 BE Green 47 BE Green
17 BE Green 49 BE Green
19 BE Green 51 BE Green
21 BE Green 53 BE Green
23 BE Green 55 BE Green
25 BE Green 57 BE Green
27 BE Green 59 BE Green
29 BE Green 61 BE Green
31 BE Green 63 BE Green
Table 5-4 shows the default mappings between internal service classes,
colors, and DSCP values for IP packets.
Table 5-4 Default mappings between service classes and DSCP values
BE Green 0
AF1 Green 10
AF1 Yellow 12
AF1 Red 14
AF2 Green 18
AF2 Yellow 20
AF2 Red 22
AF3 Green 26
AF3 Yellow 28
AF3 Red 30
AF4 Green 34
AF4 Yellow 36
AF4 Red 38
EF Green 46
CS6 Green 48
CS7 Green 56
d. Run commit
----End
Usage Scenario
To manage or limit the traffic that goes into or flows in a network according to
the class of service, you need to configure QoS traffic policies based on the
complex traffic classification. That is, you need to provide differentiated services
according to the VLAN attributes of packets. In this way, traffic from different
users, such as voice services, video services, and data services can be served
differently in terms of bandwidth, delay, and precedence. After VLAN QoS is used
for the traffic entering the VLAN network, the traffic can either retain its QoS
attributes of the previous network, or has its QoS attributes modified according to
the configurations of the VLAN. In this manner, the traffic continues to be
transmitted in the VLAN network.
CTC-based traffic policies are usually configured on the Router located at the edge
of the network, whereas traffic policies that are based on simple traffic
classification are configured on the Router located near the core of a network.
Pre-configuration Tasks
Before configuring CTC-based traffic policies for VLAN packets, you need to
complete the following tasks:
Context
Do as follows on the Router:
Procedure
Step 1 Run system-view
----End
Context
Do as follows on the Router:
Procedure
Step 1 Run system-view
----End
Context
Do as follows on the Router:
Procedure
Step 1 Run system-view
----End
Context
Perform the following steps on the Router:
Procedure
Step 1 Run system-view
Step 2 Perform the following operations based on the interfaces on which a traffic policy
is used:
If you specify link-layer, the Router matches Layer 2 information about packets with
the traffic policy and performs a corresponding action.
If you specify mpls-layer, the Router performs complex traffic classification based on
MPLS packet header information.
If you specify all-layer, the device first performs rule-matching according to Layer 2
information and implements a corresponding traffic action. If Layer 2 information of a
packet does not match the traffic rule, the system performs rule-matching according
to Layer 3 information and implements a corresponding traffic action.
● Apply a traffic policy on a Layer 2 interface. You can specify a VLAN ID range
to apply the traffic policy on the Layer 2 interface.
a. To enter the Layer 3 interface view, run the interface interface-type
interface-number command.
b. To change the interface mode from Layer 3 to Layer 2, run the
portswitch command.
c. To add the Layer 2 interface to specific VLANs in tagged mode, run the
port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }
command.
d. To apply a traffic policy on the Layer 2 interface, run the traffic-policy
policy-name { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all }
[ all-layer | link-layer | mpls-layer ] command.
● Apply a traffic policy on an EVC Layer 2 sub-interface. You can specify a
bandwidth allocation type to apply the traffic policy on the EVC Layer 2 sub-
interface.
a. To enter the EVC Layer 2 sub-interface view, run the interface interface-
type interface-number.subnum mode l2 command.
b. To apply a traffic policy on the EVC Layer 2 sub-interface, run the traffic-
policy policy-name { inbound | outbound } identifier { none | vid | ce-
vid | vid-ce-vid } [ all-layer | link-layer | mpls-layer ] command.
The parameter identifier specified bandwidth allocation type must be the same
as the one configured on the EVC Layer 2 sub-interface.
● Apply a traffic policy on a QinQ VLAN tag termination sub-interface. You can
specify a PVLAN ID and CVLAN ID range to apply the traffic policy on the
QinQ VLAN tag termination sub-interface.
a. To enter the sub-interface view, run the interface interface-type
interface-number.subinterface-number command.
b. To set a VLAN ID range for the sub-interface and configure the sub-
interface to remove the tags from double-tagged packets, run the
encapsulation qinq-termination [ local-switch | rt-protocol ]
command.
To apply a traffic policy to a QinQ VLAN tag termination sub-interface, you can
also directly run the traffic-policy policy-name { inbound | outbound } [ all-
layer | link-layer | mpls-layer ] command without specifying a PVLAN ID or
CVLAN ID range.
----End
Context
Do as follows on the Router:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run traffic policy policy-name
A traffic policy is configured, and th traffic policy view is displayed.
Step 3 Run statistics enable
The function to collect statistics of the traffic policy is enabled.
Step 4 Run share-mode
The shared mode is specified for the traffic policy.
Step 3 is optional. To save memory resources, the function to collect statistics of a traffic
policy is disabled by default. When users need to view statistics about a traffic policy, run
the statistics enable command to enable this function.
Step 4 is optional. The default attribute of a traffic policy is shared.
● After a traffic policy is applied to an interface, you cannot change the mode of the
traffic policy, regardless of the shared or unshared mode. Before changing the mode of
a traffic policy, you must disable the traffic policy on the interface.
● If a shared traffic policy is applied to different interfaces, this shared traffic policy
collects statistics on the traffic of all the interfaces as a whole. That is, the shared
traffic policy does not collect statistics on the traffic of interfaces individually.
● If an unshared traffic policy is applied to different interfaces, this unshared traffic
policy collects statistics on the traffic of the interfaces individually.
● A traffic policy collects statistics on incoming traffic and outgoing traffic individually,
whether its attribute is shared or unshared.
----End
Procedure
● Run the display interface [ interface-type [ interface-number ] ] [ | { begin |
exclude | include } regular-expression ] command to view the information
about the traffic on the interface.
● Run the display traffic behavior { system-defined | user-defined }
[ behavior-name ] command to view information about the configured traffic
behaviors.
● Run the display traffic classifier { system-defined | user-defined }
[ classifier-name ] command to view information about the configured traffic
classifiers.
● Run the display traffic policy { system-defined | user-defined } [ policy-
name [ classifier classifier-name ] ] command to view information about the
association between all or the specified traffic classifiers and traffic behaviors
in traffic policies.
● Run the display traffic policy statistics interface interface-type interface-
number [ vlan vlan-id | pe-vid pe-vid ce-vid ce-vid ] { inbound | outbound }
[ verbose { classifier-based [ class class-name ] | rule-based [ class class-
name ] [ filter ] } ] command to view traffic statistics of traffic policies that
are configured on the interface.
----End
Context
Traffic policy based on BA classification is used to map the precedence of traffic
on one type of network to another type. That is, to transmit the traffic in the
other network according to the original precedence.
When the NE40E serves as the border router for different networks, the original
external priorities (802.1p values) in the VLAN packets that go into the NE40E are
all mapped to the internal priorities of the router represented by service classes of
DiffServ and colors. When the NE40E sends out the packet, the internal priority is
mapped back to the external priority.
If unified scheduling is required for all upstream traffic on an interface, you can run the qos
default-service-class command to configure the upstream traffic on the interface to enter
the specific queues and provide corresponding services.
After this command is run, other packets cannot be enabled to enter the queues, and BA
classification cannot be enabled.
Pre-configuration Tasks
Before configuring traffic shaping, complete the following tasks:
Procedure
Step 1 Run system-view
Step 3 Define traffic policies on the Router based on the actual situation.
● To define a traffic policy for incoming VLAN traffic, run the 8021p-inbound
8021p-value phb service-class [ color ] command.
● To define a traffic policy for outgoing VLAN traffic, run the 8021p-outbound
service-class color map 8021p-value command.
Following DS domain templates are pre-defined by the system for VLAN packets:
the 5p3d domain template, and the default domain template.
● The 5p3d domain template describes mapping relations from the 802.1
priorities of VLAN packets to the QoS CoSs and colors, or from the QoS CoSs
and colors to the 802.1 priorities. You can change the mapping relations in
the 5p3d domain template. The 802.1p priorities of the packets from an
upstream device are mapped to the QoS CoSs and colors. Their mapping
relations are shown in Table 5-5. The QoS CoSs and colors of the packets
going to a downstream device are mapped to the 802.1p priorities. Their
mapping relations are shown in Table 5-6.
Table 5-5 Mapping from the 802.1p value to the service-class and color
0 BE Yellow
1 BE Green
2 AF2 Yellow
3 AF2 Green
4 AF4 Yellow
5 AF4 Green
6 CS6 Green
7 CS7 Green
Table 5-6 Mapping from the service-class and color to the 802.1p value
BE Green 1
BE Yellow 0
BE Red 0
AF1 Green 1
AF1 Yellow 0
AF1 Red 0
AF2 Green 3
AF2 Yellow 2
AF2 Red 2
AF3 Green 3
AF3 Yellow 2
AF3 Red 2
AF4 Green 5
AF4 Yellow 4
AF4 Red 4
EF Green 5
EF Yellow 4
EF Red 4
● The default domain template describes the default mapping relations from
the 802.1p priorities of VLAN packets to the QoS services classes and colors,
or from the QoS services classes and colors to the 802.1p priorities. You can
change the mapping relations in the default domain template. The 802.1p
priorities of the packets from an upstream device are mapped to the QoS
CoSs and colors. Their mapping relations are shown in Table 5-7. The QoS
CoSs and colors of the packets going to a downstream device are mapped to
the 802.1p priorities. Their mapping relations are shown in Table 5-8.
0 BE Green
1 AF1 Green
2 AF2 Green
3 AF3 Green
4 AF4 Green
5 EF Green
6 CS6 Green
7 CS7 Green
Table 5-8 Default mapping from the service-class and color to IP Precedence/
MPLS EXP/802.1p
Service Color IP Precedence/MPLS EXP/802.1p
BE Green, 0
Yellow, Red
AF1 Green, 1
Yellow, Red
AF2 Green, 2
Yellow, Red
AF3 Green, 3
Yellow, Red
AF4 Green, 4
Yellow, Red
EF Green, 5
Yellow, Red
CS6 Green, 6
Yellow, Red
CS7 Green, 7
Yellow, Red
Step 4 Run field dei enable vlan { { vlan-id1 [ to vlan-id2 ] }&<1-10> | all }
The DEI capability for a range of VLANs on an interface is specified. After you
enable DEI for a VLAN and configure simple traffic classification, packets enter
queues based on CoSs and are marked with different colors based on the values of
their CFI fields.
The DEI function takes effect only after simple traffic classification is configured and trust
priority of 802.1p.
Step 7 Perform the following operations based on the interfaces on which a traffic policy
will be used:
● Apply a traffic policy to VLAN packets on a Layer 3 sub-interface.
a. To enter the sub-interface view, run the interface gigabitethernet
interface-number.subnumber command.
b. Bind the sub-interface to a DS domain.
You can use either the qos phb enable command or trust upstream command
to bind a Layer 3 sub-interface to a DS domain and map priorities for packets.
The qos phb enable command, however, maps priorities only for downstream
traffic. To map priorities for both upstream and downstream traffic, run the trust
upstream command.
If the trust upstream command is not run on the Layer 3 sub-interface, run
the undo qos phb disable command on the Layer 3 sub-interface to map
priorities only for downstream packets.
The undo qos phb disable command is mutually exclusive to the trust
upstream.
c. To enable 802.1 priority-based BA classification, run the trust { 8021p |
inner-8021p | outer-8021p } [ inbound | outbound ] command.
Before running the trust 8021p command on a sub-interface, use the trust
upstream command to bind the sub-interface to a DS domain. Otherwise, the
trust 8021p configuration does not take effect.
After you add an interface to a DiffServ domain, the traffic policy configured for
the domain automatically takes effect for the incoming and outgoing traffic on
the interface.
● Apply a traffic policy to VLAN packets on a Layer 2 interface.
a. To enter the view of a Layer 3 interface, run the interface
gigabitethernet interface-number command.
b. To change the interface mode from Layer 3 to Layer 2, run the
portswitch command.
c. To add the Layer 2 interface to specific VLANs in tagged mode, run the
port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all }
command.
d. Bind the Layer 2 interface to a DS domain.
You can use either the qos phb enable vlan command or trust upstream vlan
command to bind a Layer 2 interface to a DS domain and map priorities for
packets. The qos phb enable vlan command, however, maps priorities only for
downstream traffic. To map priorities for both upstream and downstream traffic,
run the trust upstream vlan command.
----End
Context
Traffic policy based on BA classification is used to map the precedence of traffic
on one type of network to another type. That is, to transmit the traffic in the
other network according to the original precedence.
When the NE40E serves as the border router for different networks, the original
external priorities (EXP values) in the MPLS packets that go into the NE40E are all
mapped to the internal priorities of the router represented by service classes of
DiffServ and colors. When the NE40E sends out the packet, the internal priority is
mapped back to the external priority.
Generally, the priority mappings of MPLS packets are configured on the core
device of the network.
Pre-configuration Tasks
Before configuring traffic shaping, complete the following tasks:
● Configuring the physical parameters of interfaces
● Configuring the link layer attributes of interfaces to ensure their normal
operation
● Configuring IP addresses for interfaces
● Enabling the routing protocol for communication between devices
This configuration is supported only on the Admin VS.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run diffserv domain ds-domain-name [ domain-id domain-id ]
A DS domain is defined and the DS domain view is displayed.
Step 3 Define traffic policies on the Router based on the actual situation.
● To define a traffic policy for incoming MPLS traffic, run the mpls-exp-
inbound exp phb service-class [ color ] command.
● To define a traffic policy for outgoing MPLS traffic, run the mpls-exp-
outbound service-class color map exp-value command.
The system predefines a default domain. If you do not configure priority mappings
in Step 3 for the DS domain, the system uses the default mappings. The default
domain describes the default mappings from the EXP values of MPLS packets to
QoS service classes and colors, or from QoS service classes and colors to the EXP
values of MPLS packets. You can change the mappings in the default domain. The
EXP values of the packets from an upstream device are mapped to QoS service
classes and colors. Their mappings are shown in Table 5-9. The QoS service
classes and colors of the packets entering a downstream device are mapped to
EXP values. Their mappings are shown in Table 5-10.
The default mappings between the EXP values of MPLS packets and QoS service
classes are shown in Table 5-9.
Table 5-9 Default mappings between the EXP values the QoS service classes
The default mappings between the EXP values of MPLS packets and QoS service
classes are shown in Table 5-10.
Table 5-10 The default mappings between the EXP values and QoS service classes
BE Green 0
EF Green 5
CS6 Green 6
CS7 Green 7
Step 8 (Optional) Run mpls l2vc diffserv domain { 5p3d | domain-name | default }
----End
Context
You can configure the desired priorities for online users. To perform traffic
scheduling according to the user priority, you can configure user priority mapping
in a domain. After a user in this domain goes online, the priority of the user is
mapped to the internal CoS of the device according to the configured mapping
relationship.
Perform the following steps on the Router:
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run aaa
The AAA view is displayed.
Step 3 Run domain domain-name
The AAA domain view is displayed.
Step 4 Run user-priority { upstream | downstream } { priority | trust-8021p-inner |
trust-8021p-outer | trust-dscp-outer | trust-dscp-inner | trust-exp-inner | trust-
exp-outer | unchangeable }
0 BE Green
1 AF1 Green
2 AF2 Green
3 AF3 Green
4 AF4 Green
5 EF Green
6 CS6 Green
7 CS7 Green
Step 10 To configure priority mapping for IP packets, MPLS packets, and multicast packets
of a domain, run the trust upstream ds-domain-name command to enable simple
traffic classification in the domain.
Step 11 (Optional) Run qos phb { dscp | inner-8021p | outer-8021p | mpls-exp } disable
PHB for specific priorities of downstream packets in an AAA domain is disabled.
Step 12 (Optional) Configure the function to redirect enterprise users to a specified BA
classification domain.
1. Run quit
Return to the system view.
2. Run dhcp option option-code include option-include redirect ds-domain
enable
The function to redirect enterprise users to a specified BA classification
domain is enabled.
3. Run aaa
The AAA view is displayed.
4. Run domain domain-name
The AAA domain view is displayed.
5. Run redirect ds-domain ds-domain-name
The function to redirect enterprise users in a DS domain to a specified BA
classification domain is enabled.
Step 13 Run commit
The configuration is committed.
----End
Usage Scenario
MF classification can be configured to provide differentiated services for VXLAN
packets based on parameters of the packets, such as the DSCP value, protocol
type, IP address, or port number, to meet services' requirements on bandwidth and
delay.
Pre-configuration Tasks
Before configuring traffic policies for VXLAN packets, complete the following tasks:
Procedure
Step 1 Run system-view
If the rule [ rule-id ] { deny | permit } { protocol | udp } vxlan vni vni and rule [ rule-
id ] { deny | permit } protocol [ packet-length length-operation length-value ]
commands are configured for an advanced ACL, the rules that can be configured will
be reduced.
● To define a matching rule based on the DSCP value, run the if-match dscp
dscp-value command.
● To define a matching rule based on the IP precedence, run the if-match
[ ipv6 ] ip-precedence ip-precedence command.
● To define a matching rule to match all packets, run the if-match any
command.
ACL rules can be defined based on different parameters, such as the protocol type, source
address, destination address, and the precedence field in packets. Packets are matched
against rules configured using the rule command in the if-match acl configuration, and
traffic behaviors are performed for the matching packets.
If you define multiple matching rules in one traffic classifier, you can set the
logical relationship between the matching rules by specifying the parameter
operator in Step 2.
● and: A packet belongs to the classifier only when it matches all the rules.
● or: A packet belongs to the classifier if it matches any one of the rules.
----End
Context
The NE40E supports various types of traffic behaviors. You can choose one or
more behaviors to meet your requirements.
Procedure
● Configure traffic policing actions.
a. Run system-view
If the CoS of a packet is re-marked as EF, BE, CS6, or CS7, the packet can be re-
marked green only.
d. Run user-queue cir cir-value [ [ pir pir-value ] | [ flow-queue flow-
queue-name ] | [ flow-mapping mapping-name ] | [ user-group-queue
group-name ] | [ service-template service-template-name ] ]*
The class-based HQOS parameters for the specified traffic behavior is
configured.
The outgoing traffic supports class-based HQoS scheduling only when the
traffic policy works in unshared mode and is applied to an ETM subcard.
The user-queue and car commands cannot be both configured in the same
traffic behavior.
a. Run system-view
The function of marking matching packets' CoS and color based on the
status of the specified BFD session is configured.
e. Run commit
a. Run system-view
To re-mark the DSCP value of VXLAN packets, run the remark dscp dscp-
value command.
d. Run commit
The ACL rules are generally used for redirection in the traffic behavior.
However, the specification of ACL rules is limited. When ACL rules defined for
MF classification do not meet the live network requirements, you can redirect
the traffic behavior to a configured traffic policy to implement cascaded MF
classification.
a. Run system-view
▪ Cascading a traffic policy over another will cause the the device
forwarding performance to deteriorate.
----End
Context
Do as follows on the Router.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run traffic policy policy-name
A traffic policy is configured, and the traffic policy view is displayed.
Step 3 Run classifier classifier-name behavior behavior-name [ precedence precedence-
value ]
A traffic classifier is associated with a traffic behavior, and a matching priority is
configured.
Step 4 (Optional) Run step step-value
The step between policies is configured.
Step 5 Run commit
The configuration is committed.
----End
Context
Do as follows on the Router.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Perform one of the following commands as required.
● To enter a BD view, run the bridge-domain bd-id command.
● To enter a VPN view, run the ip [ dcn ] vpn-instance vpn-instance-name
command.
Step 3 Perform the following operations based on the type of the instance to which a
traffic policy applies.
● To apply a traffic policy to a BD, perform the following operations:
a. Run the bridge-domain bd-id command to enter the BD view.
b. Run the traffic-policy policy-name { inbound [ link-layer ] | outbound }
vxlan-mode command to apply the traffic policy to the BD.
● To apply a traffic policy to a VPN, perform the following operations:
a. Run the ip [ dcn ] vpn-instance vpn-instance-name command to enter
the VPN view.
b. Run the traffic-policy policy-name { inbound [ link-layer ] | outbound }
vxlan-mode command to apply the traffic policy to the VPN.
----End
Context
Perform the following operations on the Router to which a traffic policy has been
applied.
Procedure
Step 1 Run system-view
----End
Procedure
● Run the display traffic behavior { system-defined | user-defined }
[ behavior-name ] command to view information about the configured traffic
behaviors.
● Run the display traffic classifier { system-defined | user-defined }
[ classifier-name ] command to view information about the configured traffic
classifiers.
● Run the display traffic policy { system-defined | user-defined } [ policy-
name [ classifier classifier-name ] ] command to view information about the
association between all or the specified traffic classifiers and traffic behaviors
in traffic policies.
● Run the display traffic policy statistics { bridge-domain bdid vxlan-mode |
vpn-instance vpn-name vxlan-mode } { inbound | outbound } [ verbose
{ classifier-based [ class class-name ] | rule-based [ class class-name ]
[ filter ] } ] command to check statistics about a traffic policy on an interface.
----End
Context
Currently, when the NE40E performs internal scheduling on protocol packets, by
default, the NE40E places protocol packets to the CS6 queue without the color,
and the priority of the packets remains unchanged. If you use the CS6 queue for
another purpose or not for service forwarding, services are affected. In addition,
on the downstream device, scheduling requirements of specified protocol packets
may fail to be met because these packets may enter the low-priority QoS queue.
Therefore, to allow for flexible packet scheduling, allow these packets to enter
other queues.
Procedure
Step 1 Run system-view
Generally, each protocol has a default DSCP value, and the DSCP values of some protocols
can be configured using the host-packet type command or the corresponding commands
for changing the DSCP values of the protocols. In this case, the rules for the DSCP values to
take effect as follows:
● If a protocol has its own command for changing the DSCP value, the DSCP value
configured using its own command takes effect regardless of whether the DSCP value is
controlled by the host-packet type command.
● If a protocol does not have its own command for changing the DSCP value and the
DSCP value is controlled by the host-packet type command, the DSCP value configured
using the command takes effect.
● If a protocol does not have its own command for changing the DSCP value and the
DSCP value is not controlled by the host-packet type command, the default DSCP value
takes effect.
Table 5-12 and Table 5-13 describe how to change the ToS/DSCP value of the
IPv4 protocol and the traffic class/DSCP value of the IPv6 protocol, respectively.
Table 5-12 ToS/DSCP value of the protocol and its modification method
Protocols Default ToS/ Whether it is Each protocol's own
DSCP value controlled by the modification
host-packet type command
command?
ICMP_ECHO 0 No NA
_REPLY
ICMP Error 6 No NA
DNS 0 No NA
Radius 6 No NA
IGMP 6 No NA
PIM 6 No NA
DHCP 0 No NA
Snooping
IKE 6 No NA
RSVP-TE 6 No NA
MSDP 6 No NA
Table 5-13 Traffic Class/DSCP value of the protocol and its modification method
Protocols Traffic Class/ Whether it is Each protocol's
DSCP value controlled by the own
host-packet type modification
command? command
ND(NS/NA/RS/RA 6 No NA
)
TNL6(IPv6 over 0 No NA
IPv4)
SYSLOG(UDP) 0 No info-center
syslog packet-
priority priority-
level
SYSLOG(TCP) 0 No info-center
syslog packet-
priority priority-
level
HWTACACS 6 Yes, host-packet NA
type
management-
protocol
Radius 6 No NA
tos-exp tos-value
{ dynamic |
static } (BFD
view)
MLD 6 No NA
PIMv6 6 No NA
DHCPv6 6 No NA
Step 3 Run host-packet dscp dscp-value map local-service cos-value [ color color ]
Mappings between DSCP values of protocol packets and internal priorities and
between DSCP values and colors are configured.
The DSCP value in the host-packet type command only indicates the priority of protocol
packets. 802.1p priorities of Layer 2 protocol packets are mapped from the DSCP value
based on the DS domain configured on the outbound interface. EXP priorities of MPLS
packets are the leftmost 3 bits of DSCP value. If this command is not used, sent protocol
packets carry the preconfigured priority.
----End
Context
NOTICE
Once deleted, statistics cannot be restored. Therefore, use caution when deleting
statistics.
Procedure
● To clear the statistics of a traffic policy on an interface, run the reset traffic
policy [ [ name ] policy-name ] statistics interface { interface-name |
interface-type interface-number } [ vlan vlan-id | pe-vid pe-vid ce-vid ce-vid |
vid vid | ce-vid ce-vid | vid vid ce-vid ce-vid ] { inbound | outbound }
command in the user view.
● To clear the statistics of a traffic policy on an bridge-domain, run the reset
traffic policy statistics bridge-domain bdid { inbound | outbound }
command in the user view.
● To clear statistics about an AC-side traffic policy applied to a VPN instance,
run the reset traffic policy [ name policy-name ] statistics { vsi vsi-instance-
name [ ac-mode ] | vpn-instance vpn-instance-name } [ slot slot-id ]
{ inbound | outbound } command.
● To clear flow CAR entries on a specific board or the device, run thereset flow-
car [ { source-ip | destination-ip } ip-address ] slot slot-id or reset flow-car
all command.
● To clear flow CAR statistics about specific-direction traffic in a specific slot
based on the source or destination IP address, run the reset flow-car
----End
Networking Requirements
As shown in Figure 5-1, MF classification is configured on Device C to implement
access control between Device A and Device B. In addition, traffic statistics can be
collected to verify packet sending and receiving.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● ACL number
● Names of the traffic classifier, traffic behavior, and traffic policy, and number
of the interface to which the traffic policy is applied
Procedure
Step 1 Configure an ACL rule.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] acl number 3333
[*DeviceC-acl-adv-3333]rule 5 permit ip source 1.1.1.1 0 destination 2.2.2.2 0
[*DeviceC-acl-adv-3333]rule 10 permit ip source 2.2.2.2 0 destination 1.1.1.1 0
[*DeviceC-acl-adv-3333] commit
[~DeviceC-acl-adv-3333] quit
Matched 5 500
+--Passed 4 400
+--Dropped 1 100
----End
Networking Requirements
As shown in Figure 5-2, PE1, P, and PE2 are routers on an MPLS backbone
network. CE1, CE2, CE3, and CE4 are access routers on the edge of the backbone
network. Use PE1 as an example. You can configure IP-based MF classification on
the public network interface (interface 3) of PE1 to implement traffic control on
the public network side and verify the packet sending and receiving through traffic
statistics.
Interfaces 1 through 3 in this example are GE 0/1/0, GE 0/2/0, and GE 0/3/0, respectively.
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
● ACL number
● Names of the traffic classifier, traffic behavior, and traffic policy, and number
of the interface to which the traffic policy is applied
Procedure
Step 1 Configure basic MPLS functions.
For details about how to configure basic MPLS functions, see Example for
Configuring BGP/MPLS IP VPN in HUAWEI NE40E-M2 Series Configuration Guide -
VPN - BGP/MPLS IP VPN Configuration.
Step 2 Configure IP-based MF classification for outgoing or incoming packets on the
public network interface.
<HUAWEI> system-view
[~HUAWEI] sysname PE1
[*HUAWEI] commit
[~PE1] slot 1
[~PE1-slot-1] traffic-policy match-ip-layer mpls-pop
[*PE1-slot-1] traffic-policy match-ip-layer mpls-push
[*PE1-slot-1] commit
[~PE1-slot-1] quit
----End
Networking Requirements
As shown in Figure 5-3, Device A connects to the intranet through interface 1 and
connects to the public network through interface 2 and interface 3. By default,
traffic from the intranet is transmitted to the public network through interface 3.
To enable traffic from the server to be transmitted to the public network through
interface 2 and other traffic to the public network through interface 3, configure a
traffic policy on Device A.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a default route.
2. Configure an ACL rule.
3. Configure traffic classifiers.
4. Configure traffic behaviors.
5. Configure a traffic policy.
6. Apply the traffic policy.
Data Preparation
To complete the configuration, you need the following data:
● ACL number
● Names of the traffic classifier, traffic behavior, and traffic policy, and number
of the interface to which the traffic policy is applied
Procedure
Step 1 Configure the default route so that intranet traffic is transmitted to the public
network through interface 3 by default and interface 2 is used as the backup
outbound interface.
<HUAWEI> system-view
[~HUAWEI] ip route-static 0.0.0.0 0.0.0.0 10.1.99.1
[*HUAWEI] ip route-static 0.0.0.0 0.0.0.0 10.1.99.5 preference 70
[*HUAWEI] commit
[~HUAWEI-acl-adv-3001]quit
# Configure rule 3002 to match the traffic with the source address being the IP
address of the server.
[~HUAWEI] acl 3002
[*HUAWEI-acl-adv-3002] rule permit ip source 10.1.40.0 0.0.0.255
[*HUAWEI-acl-adv-3002] commit
[~HUAWEI-acl-adv-3001]commit
Classifier: c1 Precedence: 1
Behavior: b1
-none-
Classifier: c2 Precedence: 2
Behavior: b2
Redirecting:
redirect ip-nexthop 10.1.99.5
----End
Configuration Files
#
ip route-static 0.0.0.0 0.0.0.0 10.1.99.1
ip route-static 0.0.0.0 0.0.0.0 10.1.99.5 preference 70
#
acl 3001
rule permit ip source 10.1.40.0 0.0.0.255 destination 10.1.40.0 0.0.0.255
rule permit ip source 10.1.40.0 0.0.0.255 destination 10.1.41.0 0.0.0.255
rule permit ip source 10.1.40.0 0.0.0.255 destination 10.1.42.0 0.0.0.255
acl 3002
rule permit ip source 10.1.40.0 0.0.0.255
#
traffic classifier c1
if-match acl 3001
traffic classifier c2
if-match acl 3002
#
traffic behavior b1
permit
traffic behavior b2
redirect ip-nexthop 10.1.99.5
#
traffic policy p1
classifier c1 behavior b1
classifier c2 behavior b2
#
interface gigabitethernet0/1/0
traffic-policy p1 inbound
#
return
Networking Requirements
On the network shown in Figure 5-4, SwitchA is connected to the operator
network through Device A. SwitchB is connected to the operator network through
Device B. Complex traffic classification is configured on GE 0/2/0.1 (a QinQ
termination sub-interface) of Device A to limit the rate of traffic sent by users
attached to SwitchA to 10 Mbit/s and limit the CBS to 150000 bytes.
For details on how to configure QinQ termination sub-interfaces, see the chapter "QinQ
Configuration" in the HUAWEI NE40E-M2 Series Universal Service Router Configuration
Guide - LAN Access and MAN Access.
Figure 5-4 Network diagram for configuring complex traffic classification on QinQ
termination sub-interfaces
Table 5-14
Device name Interface IP address
GE0/2/0 10.1.1.1/24
GE0/2/0 10.2.1.1/24
Precautions
N/A
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the GE0/2/0.1 interfaces on DeviceA and DeviceB as QinQ
termination sub-interfaces.
2. Configure complex traffic classification-based traffic policing on the QinQ
termination sub-interfaces.
Data Preparation
To complete the configuration, you need the following data:
● IP address of each interface
● Ranges of VLAN IDs in packet tags to be removed by QinQ termination sub-
interfaces
● Rate (10 Mbit/s) of traffic sent from users attached to SwitchA and CBS
(150000 bytes)
● Traffic classifier name, traffic behavior name, and traffic policy name, and
interface to which the traffic policy is applied
Procedure
Step 1 Configure an IGP on the backbone network. This example uses OSPF as an IGP.
For details on how to configure OSPF, see the chapter "OSPF Configuration" in the
HUAWEI NE40E-M2 Series Universal Service Router Configuration Guide- IP
Routing.
# Configure Device A.
<*HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 10.10.1.1 24
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
[~DeviceA] ospf
[*DeviceA-ospf-1] area 0
[*DeviceA-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] commit
[~DeviceA-ospf-1-area-0.0.0.0] quit
[~DeviceA-ospf-1] quit
# Configure Device B.
<*HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 10.10.1.2 24
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
[~DeviceB] ospf
[*DeviceB-ospf-1] area 0
[*DeviceB-ospf-1-area-0.0.0.0] network 10.10.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] network 10.2.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] commit
[~DeviceB-ospf-1-area-0.0.0.0] quit
[~DeviceB-ospf-1] quit
[*DeviceA-GigabitEthernet0/2/0.1] commit
[~DeviceA-GigabitEthernet0/2/0.1] quit
# Define a traffic policy to associate the traffic classifier with the traffic behavior.
[~DeviceA] traffic policy p1
[*DeviceA-trafficpolicy-p1] classifier c1 behavior b1
[*DeviceA-trafficpolicy-p1] commit
[~DeviceA-trafficpolicy-p1] quit
# After you complete the preceding configurations, run the display traffic policy
command to check the configurations of the traffic policy, traffic classifier, and
traffic behavior.
[~Device] display traffic policy user-defined
User Defined Traffic Policy Information:
Policy: p1
Classifier: default-class
Behavior: be
-none-
Classifier: c1
Behavior: b1
Committed Access Rate:
CIR 10000 (Kbps), PIR 0 (Kbps), CBS 150000 (byte), PBS 0 (byte)
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
After you apply the traffic policy to GE 0/2/0.1 of Device A, the sub-interface
accepts only 10 Mbit/s traffic and discards nonconforming traffic.
----End
Configuration Files
● Configuration file of Device A
#
sysname DeviceA
#
traffic classifier c1 operator or
if-match any
#
traffic behavior b1
car cir 10000 cbs 150000 pbs 0 green pass yellow pass red discard
#
traffic policy p1
classifier c1 behavior b1
#
interface GigabitEthernet0/2/0.1
control-vid 1 qinq-termination
qinq termination pe-vid 100 ce-vid 10 to 20
ip address 10.1.1.1 255.255.255.0
traffic-policy p1 inbound
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 10.10.1.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 5-5, PE1, P, and PE2 are routers on an MPLS backbone
network. CE1 and CE2 are access routers on the edge of the backbone network.
Three users from the local network access the Internet through CE1.
● On CE1, the CIR of the traffic of the user from the network segment 1.1.1.0 is
limited to 10 Mbit/s and the CBS is limited to 150000 bytes.
● On CE1, the CIR of the traffic of the user from the network segment 2.1.1.0 is
limited to 5 Mbit/s and the CBS is limited to 100000 bytes.
● On CE1, the CIR of the traffic of the user from the network segment 3.1.1.0 is
limited to 2 Mbit/s and the CBS is limited to 100000 bytes.
● On CE1, the DSCP values of the service packets from the three network
segments are re-marked to 40, 26, and 0.
● PE1 accesses the MPLS backbone network at the CIR of 15 Mbit/s, the CBS of
300000 bytes, the PIR of 20 Mbit/s, and the PBS of 500000 bytes.
● On CE1, the CIR, CBS, PIR and PBS of the UDP protocol packets (except DNS,
SNMP, SNMP Trap, and Syslog packets) are respectively limited to 5 Mbit/s,
100000 bytes,
15 Mbit/s and 200000 bytes
.
Figure 5-5 Diagram for configuring a traffic policy based on complex traffic
classification
Configuration Notes
When configuring traffic policies based on complex traffic classification, pay
attention to the following:
● If both the if-match any and deny parameters are configured in the complex
traffic classification rules on an interface, all packets, including protocol
packets, are discarded by the interface. Therefore, use caution when
configuring both the if-match any and deny parameters in a traffic
classification rule.
● If the permit or deny parameter is configured in both the rule command and
the traffic behavior view, only packets that are permitted are further
processed according to the configured traffic behavior. If the deny action is
configured in either the rule command or the traffic behavior view, all
matched packets are discarded.
Configuration Roadmap
The configuration roadmap is as follows:
1. Define ACL rules.
2. Configure traffic classifiers.
3. Configure traffic behaviors.
4. Configure traffic policies.
5. Apply the traffic policies to interfaces.
Data Preparation
To complete the configuration, you need the following data:
● ACL numbers 2001, 2002, 2003, 3001, and 3002
● Re-marked DSCP values 40, 26, and 0 for the packets from the three network
segments
● CIRs of the traffic from users belonging to the three network segments, which
are respectively 10 Mbit/s, 5 Mbit/s, and 2 Mbit/s, with their respective CBSs
being 150000 bytes, 100000 bytes, and 100000 bytes
● CIR of the UDP protocol packets (except DNS, SNMP, SNMP Trap, and Syslog
packets) on CE1, which is 5 Mbit/s, the CBS, which is 100000 bytes, and the
PIR, which is 15 Mbit/s
● CIR of PE1, which is 15 Mbit/s; the CBS, which is 300000 bytes; the PIR, which
is 20 Mbit/s; and the PBS, which is 500000 bytes.
● Traffic classifier name, traffic behavior name, traffic policy name, and the
interface number where the traffic policy is applied
Procedure
Step 1 Configure the IP addresses for the interfaces, routes, and basic MPLS functions
(detail omitted here).
Step 2 Configure complex traffic classification on CE1 to control the traffic that accesses
CE1 from the three local networks.
# Define ACL rules.
<CE1> system-view
[~CE1] acl number 2001
[*CE1-acl-basic-2001] rule permit source 1.1.1.0 0.0.0.255
[*CE1-acl-basic-2001] commit
[~CE1-acl-basic-2001] quit
[~CE1] acl number 2002
[*CE1-acl-basic-2002] rule permit source 2.1.1.0 0.0.0.255
[*CE1-acl-basic-2002] commit
[~CE1-acl-basic-2002] quit
[~CE1] acl number 2003
[*CE1-acl-basic-2003] rule permit source 3.1.1.0 0.0.0.255
[*CE1-acl-basic-2003] commit
[~CE1-acl-basic-2003] quit
[~CE1] acl number 3001
[*CE1-acl-basic-3001] rule 0 permit udp destination-port eq dns
[*CE1-acl-basic-3001] rule 1 permit udp destination-port eq snmp
[*CE1-acl-basic-3001] rule 2 permit udp destination-port eq snmptrap
[*CE1-acl-basic-3001] rule 3 permit udp destination-port eq syslog
[*CE1-acl-basic-3001] commit
[~CE1-acl-basic-3001] quit
[~CE1] acl number 3002
[*CE1-acl-basic-3002] rule 4 permit udp
[*CE1-acl-basic-3002] commit
[~CE1-acl-basic-3002] quit
After the configuration is complete, run the display traffic classifier command to
view the configuration of the traffic classifiers.
[~CE1] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: a
Description:
Operator: or
Rule(s):
if-match acl 2001
Classifier: b
Description:
Operator: or
Rule(s):
if-match acl 2002
Classifier: c
Description:
Operator: or
Rule(s):
if-match acl 2003
Classifier: udplimit
Description:
Operator: or
Rule(s) :
if-match acl 3001
Classifier: udplimit1
Description:
Operator: or
Rule(s) :
if-match acl 3002
# Define traffic behaviors, and configure traffic policing and DSCP values to be re-
marked.
[~CE1] traffic behavior e
[*CE1-behavior-e] car cir 10000 cbs 150000 pbs 0
[*CE1-behavior-e] remark dscp 40
[*CE1-behavior-e] commit
[~CE1-behavior-e] quit
[~CE1] traffic behavior f
[*CE1-behavior-f] car cir 5000 cbs 100000 pbs 0
[*CE1-behavior-f] remark dscp 26
[*CE1-behavior-f] commit
[~CE1-behavior-f] quit
[~CE1] traffic behavior g
[*CE1-behavior-g] car cir 2000 cbs 100000 pbs 0
[*CE1-behavior-g] remark dscp 0
[*CE1-behavior-g] commit
[~CE1-behavior-g] quit
[~CE1] traffic behavior udplimit
[*CE1-behavior-udplimit] permit
[*CE1-behavior-udplimit] commit
[~CE1-behavior-udplimit] quit
[~CE1] traffic behavior udplimit1
[*CE1-behavior-udplimit1] car cir 5000 pir 15000 cbs 100000 pbs 200000 green pass yellow discard red
discard
[*CE1-behavior-udplimit1] commit
[~CE1-behavior-udplimit1] quit
# Define traffic policies and associate traffic classifiers and traffic behaviors.
[~CE1] traffic policy 1
[*CE1-trafficpolicy-1] classifier a behavior e
[*CE1-trafficpolicy-1] commit
[~CE1-trafficpolicy-1] quit
[~CE1] traffic policy 2
[*CE1-trafficpolicy-2] classifier b behavior f
[*CE1-trafficpolicy-2] commit
[~CE1-trafficpolicy-2] quit
[~CE1] traffic policy 3
[*CE1-trafficpolicy-3] classifier c behavior g
[*CE1-trafficpolicy-3] commit
[~CE1-trafficpolicy-3] quit
[~CE1] traffic policy udplimit
[*CE1-trafficpolicy-udplimit] classifier udplimit behavior udplimit
[*CE1-trafficpolicy-udplimit] classifier udplimit1 behavior udplimit1
[*CE1-trafficpolicy-3] commit
[~CE1-trafficpolicy-3] quit
After the preceding configuration, run the display traffic policy command to view
the configuration of the traffic policies, traffic classifiers defined in the traffic
policies, and the traffic behaviors associated with traffic classifiers.
[~CE1] display traffic policy user-defined
User Defined Traffic Policy Information:
Total: 4095 Used: 3 Free: 4092
Policy: 1
Total: 256 Used: 2 Free: 254
Description:
Step: 5
Share-mode
Classifier: a Precedence: 5
Behavior: e
Committed Access Rate:
CIR 10000 (Kbps), PIR 0 (Kbps), CBS 15000 (byte), PBS 0 (byte)
Step 3 Configure complex traffic classification on PE1 to control the traffic that goes to
the MPLS backbone network.
# Configure a traffic classifier and define the matching rule.
<PE1> system-view
[~PE1] traffic classifier pe
[*PE1-classifier-pe] if-match any
[*PE1-classifier-pe] commit
[~PE1-classifier-pe] quit
After the preceding configuration, you can run the display traffic classifier
command to view the configuration of the traffic classifier.
[~PE1] display traffic classifier user-defined
User Defined Classifier Information:
Classifier: pe
Description:
Operator: OR
Rule(s):
if-match any
# Define a traffic policy to associate the traffic classifier with the traffic behavior.
[~PE1] traffic policy pe
[*PE1-trafficpolicy-pe] classifier pe behavior pe
[*PE1-trafficpolicy-pe] commit
[~PE1-trafficpolicy-pe] quit
After the preceding configuration, run the display traffic policy command to view
the configuration of the traffic policies, traffic classifiers defined in the traffic
policies, and the traffic behaviors associated with traffic classifiers.
[~PE1] display traffic policy user-defined
User Defined Traffic Policy Information:
Total: 4095 Used: 3 Free: 4092
Policy: 1
Description:
Step: 5
Share-mode
Classifier: a Precedence: 5
Behavior: e
Committed Access Rate:
CIR 10000 (Kbps), PIR 0 (Kbps), CBS 15000 (byte), PBS 0 (byte)
Conform Action: pass
Yellow Action: pass
Exceed Action: discard
Marking:
----End
Configuration Files
● Configuration file of CE1
#
sysname CE1
#
acl number 2001
rule 5 permit source 1.1.1.0 0.0.0.255
acl number 2002
rule 5 permit source 2.1.1.0 0.0.0.255
acl number 2003
rule 5 permit source 3.1.1.0 0.0.0.255
acl number 3001
rule 0 permit udp destination-port eq dns
rule 1 permit udp destination-port eq snmp
rule 2 dpermit udp destination-port eq snmptrap
rule 3 permit udp destination-port eq syslog
acl number 3302
rule 4 permit udp
#
traffic classifier a operator or
if-match acl 2001
traffic classifier c operator or
if-match acl 2003
traffic classifier b operator or
if-match acl 2002
traffic classifier udplimit operator or
if-match acl 3001
traffic classifier udplimit1 operator or
if-match acl 3002
#
traffic behavior e
car cir 10000 cbs 150000 pbs 0 green pass red discard
remark dscp cs5
traffic behavior g
car cir 2000 cbs 100000 pbs 0 green pass red discard
remark dscp default
traffic behavior f
car cir 5000 cbs 100000 pbs 0 green pass red discard
remark dscp af31
traffic behavior udplimit
traffic behavior udplimit1
car cir 5000 pir 15000 cbs 100000 pbs 200000 green pass yellow discard red discard
#
traffic policy 3
classifier c behavior g precedence 5
traffic policy 2
classifier b behavior f precedence 5
traffic policy 1
classifier a behavior e precedence 5
traffic policy udplimit
classifier udplimit behavior udplimit precedence 5
classifier udplimit1 behavior udplimit1 precedence 10
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 1.1.1.1 255.255.255.0
traffic-policy 1 inbound
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 10.1.1.1 255.255.255.0
traffic-policy udplimit outbound
#
interface GigabitEthernet0/3/0
undo shutdown
ip address 2.1.1.1 255.255.255.0
traffic-policy 2 inbound
#
interface GigabitEthernet0/1/8
undo shutdown
ip address 3.1.1.1 255.255.255.0
traffic-policy 3 inbound
#
ospf 1
area 0.0.0.0
network 1.1.1.0 0.0.0.255
network 2.1.1.0 0.0.0.255
network 3.1.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
#
return
● Configuration file of PE1
#
sysname PE1
#
mpls lsr-id 11.11.11.11
mpls
#
mpls ldp
#
traffic classifier pe operator or
if-match any
#
traffic behavior pe
car cir 15000 pir 20000 cbs 300000 pbs 500000 green pass yellow pass red discard
#
traffic policy pe
classifier pe behavior pe
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 10.1.1.2 255.255.255.0
traffic-policy pe inbound
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 10.10.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 11.11.11.11 255.255.255.255
#
ospf 1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
undo shutdown
ip address 10.12.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 10.12.1.0 0.0.0.255
#
return
Networking Requirements
As shown in Figure 5-6, DeviceA and DeviceB connect to each other through a
VLAN. When IP packets sent by DeviceA enter the VLAN, by default, the
precedence of these IP packets is mapped to the 802.1p value. When these IP
packets (carrying VLAN frame priority) leave the VLAN and arrive at DeviceB, the
VLAN frame priority is mapped to the IP precedence according to the
configuration on DeviceB. Then, these packets are forwarded according to their IP
preference.
Configuration Notes
When configuring VLAN QoS, pay attention to the following:
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
Procedure
Step 1 Define a classifier to match packets whose 802.1p value is 2.
<HUAWEI> system-view
[~HUAWEI] sysname RouterB
[*HUAWEI] commit
[~RouterB] traffic classifier test
[*RouterB-classifier-test] if-match 8021p 2
[*RouterB-classifier-test] commit
[~RouterB-classifier-test] quit
Step 3 Define a QoS policy to associate a configured traffic behavior with a specified
traffic classifier.
[~RouterB] traffic policy test
[*RouterB-trafficpolicy-test] classifier test behavior test
[*RouterB-trafficpolicy-test] commit
[~RouterB-trafficpolicy-test] quit
Step 4 Apply the QoS policy to the incoming traffic of GE 0/2/0.1 on DeviceB.
[~RouterB] interface Gigabitethernet 0/2/0.1
[*RouterB-Gigabitethernet0/2/0.1] traffic-policy test inbound link-layer
[*RouterB-Gigabitethernet0/2/0.1] commit
[~RouterB-Gigabitethernet0/2/0.1] quit
----End
Configuration File
● Configuration file of DeviceB
#
sysname RouterB
#
traffic classifier test operator or
if-match 8021p 2
#
traffic behavior test
remark ip-precedence 4
#
traffic policy test
classifier test behavior test precedence 5
#
interface GigabitEthernet0/2/0.1
undo shutdown
vlan-type dot1q 10
traffic-policy test inbound link-layer
Networking Requirements
On the network shown in Figure 5-7, Switch A forwards frames from VLAN 10 to
Device A. Device A maps the priorities of the VLAN frames to the priorities of IP
packets based on the configured priority mappings in the DS domain set on
Device A. Device A then forwards the packets to the IP network.
Figure 5-7 Networking diagram for configuring priority mappings for VLAN
packets based on simple traffic classification on Layer 2 interfaces
Precautions
When configuring priority mappings for VLAN packets based on simple traffic
classification on Layer 2 interfaces, note the following point:
● Before running the trust 8021p vlan command on an interface, use the trust
upstream vlan command to bind a DS domain to the interface. Otherwise,
the trust 8021p vlan configuration does not take effect.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a VLAN on Device A.
2. Configure the inbound interface of Device A to trust the priorities of packets
from an upstream device.
3. Configure priority mappings based on simple traffic classification on the
inbound interface of Device A.
4. Configure priority mappings for packets on the outbound interface of Device
A.
Data Preparation
To complete the configuration, you need the following data:
● VLAN ID
● 802.1p priorities, service classes and colors of the packets on the Router, and
DSCP values of IP packets
Procedure
Step 1 Create a VLAN on Device A.
# Create a VLAN.
<DeviceA> system-view
[~DeviceA] vlan 10
[*DeviceA] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] portswitch
[*DeviceA-GigabitEthernet0/1/0] port trunk allow-pass vlan 10
[*DeviceA-GigabitEthernet0/1/0] commit
Step 2 Enable simple traffic classification on GE 0/1/0 of Device A to map the priorities of
IP packets to the priorities of VLAN frames based on the default mappings.
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] trust upstream default vlan 10
[*DeviceA-GigabitEthernet0/1/0] trust 8021p vlan 10
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA] quit
Step 3 On GE 0/2/0 of Device A, configure the mapping from 802.1p priorities to IP DSCP
values.
<DeviceA> system-view
[~DeviceA] diffserv domain default
[*DeviceA-dsdomain-default] 8021p-inbound 2 phb ef green
[*DeviceA-dsdomain-default] ip-dscp-outbound ef green map 34
[*DeviceA-dsdomain-default] commit
[~DeviceA-dsdomain-default] quit
[~DeviceA] interface gigabitethernet 0/2/0
[*DeviceA-GigabitEthernet0/2/0] portswitch
[*DeviceA-GigabitEthernet0/2/0] port trunk allow-pass vlan 10
[*DeviceA-GigabitEthernet0/2/0] trust upstream default vlan 10
[*DeviceA-GigabitEthernet0/2/0] trust 8021p vlan 10
[*DeviceA-GigabitEthernet0/2/0] commit
[~DeviceA-GigabitEthernet0/2/0] return
After you complete these configurations, Device A maps the VLAN frames with the
802.1p priority of 2 from an upstream device to IP packets with the service classes
of EF, and the packet colors of green. Device A maps the other 802.1p priorities of
VLAN frames to the corresponding DSCP values of IP packets based on the default
mappings.
Step 4 Verify the configuration.
Run the display port-queue statistics interface gigabitethernet 0/2/0
outbound command on Device A. The statistics about AF2 packets are not
displayed because the mapping from the 802.1p priority of 2 to the IP service
priority of EF is configured on the inbound interface.
<DeviceA> display port-queue statistics interface gigabitethernet 0/2/0 outbound
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[af4]
Current usage percentage of queue: 0
Total pass:
0 packets, 0 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[ef]
Current usage percentage of queue: 0
Total pass:
27,167,382 packets, 3,477,424,896 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
844,397 pps, 864,661,792 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[cs6]
Current usage percentage of queue: 0
Total pass:
335 packets, 25,502 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[cs7]
Current usage percentage of queue: 0
Total pass:
0 packets, 0 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
----End
Configuration Files
● Configuration file of Device A
#
sysname DeviceA
#
diffserv domain default
8021p-inbound 2 phb ef green
ip-dscp-outbound ef green map 34
#
vlan batch 10
#
interface GigabitEthernet 0/1/0
portswitch
undo shutdown
port trunk allow-pass vlan 10
trust upstream default vlan 10
trust 8021p vlan 10
#
interface GigabitEthernet0/2/0
portswitch
undo shutdown
port trunk allow-pass vlan 10
trust upstream default vlan 10
trust 8021p vlan 10
#
return
Networking Requirements
MPLS neighbor relationships are established between DeviceA, DeviceB, and
DeviceC. When IP packets reach DeviceA, DeviceA adds MPLS header to these IP
packets before transmitting them to DeviceC. When these MPLS packets reach
DeviceC, DeviceC removes their MPLS headers and forwards them as IP packets.
In this manner, the DSCP value of the IP traffic can be changed to the EXP value of
MPLS traffic on DeviceA, and the EXP value of MPLS traffic can be changed to the
DSCP value of the IP traffic on DeviceC.
● In this configuration example, it is assumed that the three Routers have been configured
so that DeviceA forwards IP traffic as MPLS traffic to DeviceC, and Deviceforwards MPLS
traffic as IP traffic.
● This example lists only the commands related to QoS.
Configuration Notes
During the configuration, pay attention to the following:
None
Configuration Roadmap
The configuration roadmap is as follows:
Data Preparation
To complete the configuration, you need the following data:
MPLS EXP values, the internal service classes and colors of the packets on the
Router, and the DSCP values of IP packets to be mapped
Procedure
Step 1 Configure basic MPLS functions and routes (detail omitted here).
For detailed configuration, refer to the Chapter "Basic MPLS Configuration" in the
HUAWEI NE40E-M2 SeriesUniversal Service Router Configuration Guide - MPLS.
Step 2 Configure the mapping between DSCP field and EXP field at GigabitEthernet0/1/0
on DeviceA.
<RouterA> system-view
[~RouterA] diffserv domain default
[*RouterA-dsdomain-default] ip-dscp-inbound 18 phb af4 green
[*RouterA-dsdomain-default] mpls-exp-outbound af4 green map 5
[*RouterA-dsdomain-default] commit
[~RouterA-dsdomain-default] quit
[~RouterA] interface GigabitEthernet 0/1/0
[~RouterA-GigabitEthernet0/1/0] undo shutdown
[*RouterA-GigabitEthernet0/1/0] trust upstream default
[*RouterA-GigabitEthernet0/1/0] commit
[~RouterA-GigabitEthernet0/1/0] quit
[~RouterA] interface GigabitEthernet 0/2/0
[~RouterA-GigabitEthernet0/2/0] undo shutdown
[*RouterA-GigabitEthernet0/2/0] trust upstream default
[*RouterA-GigabitEthernet0/2/0] commit
[~RouterA-GigabitEthernet0/2/0] quit
In the preceding configuration, AF2 green packets (DSCP value being 18) are
mapped to the internal service level of AF4 of the Router on the inbound interface
of DeviceA. On the outbound interface, the internal service level of AF4 of the
Router is mapped to the EF service level (MPLS priority 5) of the MPLS service. In
this manner, the traffic that enters DeviceA leaves as EF traffic.
Step 3 Configure the mapping from the MPLS EXP field to the IP DSCP field on
GigabitEthernet 0/1/0 of DeviceC.
<RouterC> system-view
[~RouterC] diffserv domain default
[*RouterC-dsdomain-default] mpls-exp-inbound 5 phb af3 green
[*RouterC-dsdomain-default] ip-dscp-outbound af3 green map 32
[*RouterC-dsdomain-default] commit
[~RouterC-dsdomain-default] quit
[~RouterC] interface GigabitEthernet 0/1/0
[~RouterC-GigabitEthernet0/1/0] undo shutdown
[*RouterC-GigabitEthernet0/1/0] trust upstream default
[*RouterC-GigabitEthernet0/1/0] commit
[~RouterC-GigabitEthernet0/1/0] quit
[~RouterC] interface GigabitEthernet 0/2/0
[~RouterC-GigabitEthernet0/2/0] undo shutdown
[*RouterC-GigabitEthernet0/2/0] trust upstream default
[*RouterC-GigabitEthernet0/2/0] commit
[~RouterC-GigabitEthernet0/2/0] quit
----End
Configuration Files
● Configuration file of DeviceA
#
sysname RouterA
#
diffserv domain default
ip-dscp-inbound 18 phb af4 green
mpls-exp-outbound af4 green map 5
#
interface GigabitEthernet0/1/0
undo shutdown
ip address 2.2.2.1 255.255.255.0
trust upstream default
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 3.3.3.1 255.255.255.0
trust upstream default
#
return
Networking Requirements
Different communities require the same services, such as Internet, IPTV, and VoIP
services. To facilitate management, network administrators of different
communities add services into the same VLAN. In addition, they configure BA
classification on PE1 and PE2 to provide differentiated services.
As shown in Figure 5-9, communities 1 and 2 have the same services, which
belong to the same VLAN. It is required that communities 1 and 2
intercommunicate with each other at low costs. In addition, priority mapping is
configured for DS domains on PE1 and PE2. It is required that the outer 802.1p
and DSCP values of downstream traffic on the EVC sub-interface GE 0/1/1.1 of
PE1 and the outer 802.1p and EXP values of downstream traffic on the EVC sub-
interface GE 0/1/1.1 of PE2 remain unchanged.
Precautions
All services in the VLAN are located on the same network segment.
Configuration Roadmap
Create an EVC model.
Data Preparation
To complete the configuration, you need the following data:
● Number of interfaces from which users access devices
● Number of interfaces connecting devices
● ID of the VLAN to which services belong
● BD ID
● 802.1p priority, CoS, and color to be mapped
Procedure
Step 1 Add downstream interfaces of the CEs to a specific VLAN.
# Configure CE1.
<HUAWEI> system-view
[~HUAWEI] sysname CE1
[*HUAWEI] commit
[~CE1] vlan 10
[*CE1-vlan10] quit
[*CE1] interface gigabitethernet 0/1/1
[*CE1-GigabitEthernet0/1/1] undo shutdown
[*CE1-GigabitEthernet0/1/1] portswitch
[*CE1-GigabitEthernet0/1/1] port link-type access
[*CE1-GigabitEthernet0/1/1] port default vlan 10
[*CE1-GigabitEthernet0/1/1] quit
[*CE1] interface gigabitethernet 0/1/2
[*CE1-GigabitEthernet0/1/2] undo shutdown
[*CE1-GigabitEthernet0/1/2] portswitch
[*CE1-GigabitEthernet0/1/2] port link-type trunk
[*CE1-GigabitEthernet0/1/2] port trunk allow-pass vlan 10
[*CE1-GigabitEthernet0/1/2] quit
[*CE1] commit
# Configure CE2.
<HUAWEI> system-view
[~HUAWEI] sysname CE2
[*HUAWEI] commit
[~CE2] vlan 10
[*CE2] interface gigabitethernet 0/1/1
[*CE2-GigabitEthernet0/1/1] undo shutdown
[*CE2-GigabitEthernet0/1/1] portswitch
[*CE2-GigabitEthernet0/1/1] port link-type access
# Configure PE2.
<HUAWEI> system-view
[~HUAWEI] sysname PE2
[*HUAWEI] commit
[~PE2] bridge-domain 10
[*PE2-bd10] quit
2. Create Layer 2 sub-interfaces, add them to the BD, and configure traffic
encapsulation and traffic behaviors.
# Configure PE1.
[~PE1] interface gigabitethernet 0/1/1
[*PE1-GigabitEthernet0/1/1] undo shutdown
[*PE1-GigabitEthernet0/1/1] quit
[*PE1] interface gigabitethernet 0/1/1.1 mode l2
[*PE1-GigabitEthernet0/1/1.1] encapsulation dot1q vid 10
[*PE1-GigabitEthernet0/1/1.1] bridge-domain 10
[*PE1-GigabitEthernet0/1/1.1]commit
[*PE1-GigabitEthernet0/1/1.1] quit
# Configure PE2.
[*PE2] interface gigabitethernet 0/1/1
[*PE2-GigabitEthernet0/1/1] undo shutdown
[*PE2-GigabitEthernet0/1/1] quit
[*PE2] interface gigabitethernet 0/1/1.1 mode l2
[*PE2-GigabitEthernet0/1/1.1] encapsulation dot1q vid 10
[*PE2-GigabitEthernet0/1/1.1] bridge-domain 10
[*PE1-GigabitEthernet0/1/1.1]commit
[*PE2-GigabitEthernet0/1/1.1] quit
# Configure PE2.
[*PE2] diffserv domain gina
[*PE2-dsdomain-gina] 8021p-inbound 2 phb af1 green
[*PE2-dsdomain-gina] quit
[*PE2] interface gigabitethernet 0/1/1.1 mode l2
[*PE2-GigabitEthernet0/1/1.1] trust upstream gina
[*PE2-GigabitEthernet0/1/1.1] qos phb outer-8021p disable
[*PE2-GigabitEthernet0/1/1.1] qos phb mpls-exp disable
[*PE1-GigabitEthernet0/1/1.1]commit
[*PE2-GigabitEthernet0/1/1] quit
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
diffserv domain gina
8021p-outbound cs6 red map 5
#
bridge-domain 10
#
interface GigabitEthernet0/1/1
undo shutdown
#
interface GigabitEthernet 0/1/1.1 mode l2
encapsulation dot1q vid 10
bridge-domain 10
trust upstream gina
qos phb outer-8021p disable
qos phb dscp disable
#
return
Networking Requirements
As shown in Figure 5-10, Subscriber1 accesses the Internet through PPPoEoVLAN.
The network is deployed as follows:
● Subscriber1 belongs to the domain isp1 and accesses the Internet through GE
2/0/0.1 on the Device through PPPoEoVLAN. The device connected to the
Device supports the dialup function.
● RADIUS authentication and RADIUS accounting are used.
● The IP address of the RADIUS server is 192.168.7.249. The authentication port
number is 1645 and the accounting port number is 1646. The RADIUS+1.1
protocol is adopted, with the shared key being itellin.
● The IP address of the DNS server is 192.168.7.252.
● Subscriber1 in the domain isp1 accesses the Internet with the priority being 3.
Then, user priority mapping is required on the Device to change the 802.1p values
when the Device forwards out the VLAN packets received from Subscriber1.
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure the BRAS service on the Device so that Subscriber1 can successfully
access the Internet.
Data Preparation
To complete the configuration, you need the following data:
● Name of the domain to which a user belongs
● User priority to be mapped
● Internal CoS and color of the packet
Procedure
Step 1 Configure the BRAS service on the Device so that Subscriber1 can successfully
access the Internet.
For detailed configuration, refer to the HUAWEI NE40E-M2 SeriesUniversal Service
RouterConfiguration Guide - User Access.
Step 2 Configure user priority mapping in the domain.
# Configure the priority for Subscriber1 to access the Internet.
<HUAWEI> system-view
[~Device] aaa
[*Device-aaa] domain isp1
[*Device-aaa-domain-isp1] user-priority upstream 3
[*Device-aaa-domain-isp1] commit
[*Device-aaa-domain-isp1] quit
After the preceding configurations, the priorities of the packets sent from
Subscriber1 in the domain isp1 are all 3. The priorities are mapped to the internal
CoS AF4 and the color yellow on the Device.
Step 3 Verify the configuration.
Run the display port-queue statistics interface gigabitethernet 0/1/0
outbound command on the Device. Because simple traffic classification is enabled
for the users with the priority being 3 in the domain isp1, traffic of Subscriber1
enters the AF4 queue and the 802.1p values carried in the packets are marked as
4 on the outbound interface.
<HUAWEI> display port-queue statistics gigabitethernet 0/1/0 outbound
GigabitEthernet0/1/0 outbound traffic statistics:
[be]
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[af4]
Current usage percentage of queue: 0
Total pass:
1,748,941 packets, 157,404,690 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
26,117 pps, 18,804,240 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[ef]
Current usage percentage of queue: 0
Total pass:
0 packets, 0 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[cs6]
Current usage percentage of queue: 0
Total pass:
335 packets, 25,502 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
[cs7]
Current usage percentage of queue: 0
Total pass:
0 packets, 0 bytes
Total discard:
0 packets, 0 bytes
Drop tail discard:
0 packets, 0 bytes
Wred discard:
0 packets, 0 bytes
Last 30 seconds pass rate:
0 pps, 0 bps
Last 30 seconds discard rate:
0 pps, 0 bps
Drop tail discard rate:
0 pps, 0 bps
Wred discard rate:
0 pps, 0 bps
buffer size: 10 kbytes
used buffer size: 0 kbytes
Peak rate:
0000-00-00 00:00:00 0 bps
----End
Configuration Files
● Configuration file of the Router
#
sysname HUAWEI
#
radius-server group rd1
radius-server authentication 192.168.7.249 1645 weight 0
radius-server accounting 192.168.7.249 1646 weight 0
radius-server shared-key-cipher %^%#clY:%[]x='-RMNJus[s/VJ:3YBq3<..|.{'xgbp+%^%
radius-server type plus11
radius-server traffic-unit kbyte
#
interface Virtual-Template1
#
interface GigabitEthernet0/2/0
undo shutdown
#
interface GigabitEthernet0/2/0.1
pppoe-server bind Virtual-Template 1
user-vlan 1
bas
access-type layer2-subscriber default-domain authentication isp1
authentication-method ppp
#
interface GigabitEthernet0/1/0
ip address 192.168.7.1 255.255.255.0
#