- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
02-QoS configuration | 843.15 KB |
Contents
QoS processing flow in a device
Restrictions and guidelines for applying a QoS policy
Applying the QoS policy to an interface
Applying the QoS policy globally
Applying the QoS policy to a control plane
Applying the QoS policy to a user profile
Verifying and maintaining QoS policies
Verifying QoS policy configuration
Verifying QoS policy running status
Clearing QoS policy statistics
Configuring interface channelization
About interface channelization
Restrictions and guidelines: Interface channelization configuration
Configuring the channelized bandwidth for a subinterface
Display and maintenance commands for interface channelization
Priority mapping configuration methods
Priority mapping tasks at a glance
Configuring a port to trust packet priority for priority mapping
Changing the port priority of an interface
Verifying and maintaining commands for priority mapping
Priority mapping configuration examples
Example: Configuring a priority trust mode
Example: Configuring priority mapping tables and priority marking
Configuring traffic policing, GTS, and rate limit
About traffic policing, GTS, and rate limit
Traffic evaluation and token buckets
Traffic policing configuration approaches
Configuring traffic policing by using the MQC approach
Configuring CAR-list-based traffic policing
Configuring ACL-based traffic policing
Configuring traffic policing for all traffic
Configuring GTS by using the MQC approach
Configuring GTS for all traffic
Configuring the rate limit for an interface
Including the physical layer header in calculating the packet length for rate limiting
Verifying and maintaining traffic policing, GTS, and rate limit
Verifying MQC-based traffic policing and GTS configurations
Verifying non-MQC traffic policing, GTS, and rate limit configurations and statistics
Traffic policing, GTS, and rate limit configuration examples
Example: Configuring traffic policing
Configuring congestion management
Cause, negative results, and countermeasure of congestion
Congestion management technique comparison
Setting the FIFO queue size for an interface
Configuring PQ for an interface
Configuring CQ for an interface
Configuring WFQ for an interface
Restrictions and guidelines for CBQ configuration
Configure AF and the minimum guaranteed bandwidth
Configuring EF and the maximum bandwidth
Setting the maximum available interface bandwidth
Setting the maximum reserved bandwidth as a percentage of available bandwidth for an interface
Configuring RTPQ on an interface
Verifying and maintaining congestion management
Verifying non-MQC congestion management configuration and running status
Verifying MQC-based congestion management configuration and running status
Configuring congestion avoidance
Relationship between WRED and queuing mechanisms
Configuring WRED parameters on an interface
Example: Configuring WRED on an interface
Verifying and maintaining WRED
Restrictions and guidelines: Traffic filtering configuration
Verifying and maintaining traffic filtering
Traffic filtering configuration examples
Example: Configuring traffic filtering
Configuring protocol packet rate limiting
About protocol packet rate limiting
Protocol packet rate limiting configuration examples
Example: Configuring protocol packet rate limiting
Configuring priority marking by using the MQC approach
Configuring global priority marking
Priority marking configuration examples
Example: Configuring priority marking
Configuring traffic redirecting
Restrictions and guidelines: Traffic redirecting configuration
Verifying and maintaining traffic redirecting
Traffic redirecting configuration examples
Example: Configuring traffic redirecting
Configuring basic BGP functions
Configuring the route receiver
Configuring basic BGP functions
Enabling QPPB on the route receiving interface
Example: Configuring QPPB in an IPv4 network
Example: Configuring QPPB in an MPLS L3VPN
Example: Configuring QPPB in an IPv6 network
Appendix B Default priority maps
Appendix C Introduction to packet precedence
QoS overview
In data communications, Quality of Service (QoS) provides differentiated service guarantees for diversified traffic in terms of bandwidth, delay, jitter, and drop rate, all of which can affect QoS.
QoS manages network resources and prioritizes traffic to balance system resources.
The following section describes typical QoS service models and widely used QoS techniques.
QoS service models
This section describes several typical QoS service models.
Best-effort service model
The best-effort model is a single-service model. The best-effort model is not as reliable as other models and does not guarantee delay-free delivery.
The best-effort service model is the default model for the Internet and applies to most network applications. It uses the First In First Out (FIFO) queuing mechanism.
IntServ model
The integrated service (IntServ) model is a multiple-service model that can accommodate diverse QoS requirements. This service model provides the most granularly differentiated QoS by identifying and guaranteeing definite QoS for each data flow.
In the IntServ model, an application must request service from the network before it sends data. IntServ signals the service request with the RSVP. All nodes receiving the request reserve resources as requested and maintain state information for the application flow.
The IntServ model demands high storage and processing capabilities because it requires all nodes along the transmission path to maintain resource state information for each flow. This model is suitable for small-sized or edge networks. However, it is not suitable for large-sized networks, for example, the core layer of the Internet, where billions of flows are present.
DiffServ model
The differentiated service (DiffServ) model is a multiple-service model that can meet diverse QoS requirements. It is easy to implement and extend. DiffServ does not signal the network to reserve resources before sending data, as IntServ does.
QoS techniques in a network
The QoS techniques include the following features:
· Traffic classification.
· Traffic policing.
· Traffic shaping.
· Rate limit.
· Congestion management.
· Congestion avoidance.
The following section briefly introduces these QoS techniques.
All QoS techniques in this document are based on the DiffServ model.
Figure 1 Position of the QoS techniques in a network
As shown in Figure 1, traffic classification, traffic shaping, traffic policing, congestion management, and congestion avoidance mainly implement the following functions:
· Traffic classification—Uses match criteria to assign packets with the same characteristics to a traffic class. Based on traffic classes, you can provide differentiated services.
· Traffic policing—Polices flows and imposes penalties to prevent aggressive use of network resources. You can apply traffic policing to both incoming and outgoing traffic of a port.
· Traffic shaping—Adapts the output rate of traffic to the network resources available on the downstream device to eliminate packet drops. Traffic shaping usually applies to the outgoing traffic of a port.
· Congestion management—Provides a resource scheduling policy to determine the packet forwarding sequence when congestion occurs. Congestion management usually applies to the outgoing traffic of a port.
· Congestion avoidance—Monitors the network resource usage. It is usually applied to the outgoing traffic of a port. When congestion worsens, congestion avoidance reduces the queue length by dropping packets.
QoS processing flow in a device
Figure 2 briefly describes how the QoS module processes traffic.
1. Traffic classifier identifies and classifies traffic for subsequent QoS actions.
2. The QoS module takes various QoS actions on classified traffic as configured, depending on the traffic processing phase and network status. For example, you can configure the QoS module to perform the following operations:
¡ Traffic policing for incoming traffic.
¡ Traffic shaping for outgoing traffic.
¡ Congestion avoidance before congestion occurs.
¡ Congestion management when congestion occurs.
QoS configuration approaches
You can configure QoS by using the MQC approach or non-MQC approach.
In the modular QoS configuration (MQC) approach, you configure QoS service parameters by using QoS policies. A QoS policy defines QoS actions to take on different classes of traffic and can be applied to an object (such as an interface) to control traffic.
In the non-MQC approach, you configure QoS service parameters without using a QoS policy. For example, you can use the rate limit feature to set a rate limit on an interface without using a QoS policy.
Some features support both approaches, but some support only one.
Configuring a QoS policy
About QoS policies
A QoS policy has the following components:
· Traffic class—Defines criteria to match packets.
· Traffic behavior—Defines QoS actions to take on matching packets.
By associating a traffic class with a traffic behavior, a QoS policy can perform the QoS actions on matching packets.
A QoS policy can have multiple class-behavior associations.
QoS policy tasks at a glance
To configure a QoS policy, perform the following tasks:
2. Defining a traffic behavior
4. (Optional.) Configuring policy nesting
¡ Applying the QoS policy to an interface
¡ Applying the QoS policy globally
¡ Applying the QoS policy to a user profile
Defining a traffic class
1. Enter system view.
system-view
2. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
3. (Optional.) Configure a description for the traffic class.
description text
By default, no description is configured for a traffic class.
4. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information, see the if-match command in ACL and QoS Command Reference.
Defining a traffic behavior
1. Enter system view.
system-view
2. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
3. Configure an action in the traffic behavior.
By default, no action is configured for a traffic behavior.
For more information about configuring an action, see the subsequent chapters for traffic policing, traffic filtering, priority marking, class-based accounting, and so on.
Defining a QoS policy
1. Enter system view.
system-view
2. Create a QoS policy and enter QoS policy view.
qos policy policy-name
3. Associate a traffic class with a traffic behavior to create a class-behavior association in the QoS policy.
classifier classifier-name behavior behavior-name [ insert-before before-classifier-name ]
By default, a traffic class is not associated with a traffic behavior.
Repeat this step to create more class-behavior associations.
Configuring policy nesting
About this task
A QoS policy configuration can contain a parent policy and a child policy.
Policy nesting allows you to create a child policy in the view of a traffic behavior of the parent policy.
You can nest a QoS policy in a traffic behavior to reclassify the traffic class associated with the behavior. Then the system performs the actions defined in the QoS policy on the reclassified traffic. The QoS policy nested in the traffic behavior is called the child policy. The QoS policy that nests the behavior is called the parent policy.
Restrictions and guidelines
When you configure policy nesting, follow these restrictions and guidelines:
· If class-based queuing (CBQ) is configured in a child policy, make sure the following requirements are met:
¡ GTS is configured in the parent policy.
¡ The CIR specified in GTS is greater than or equal to CBQ bandwidth.
· If the CIR in GTS is specified as a percentage for a parent policy, configure the CBQ bandwidth as a percentage for the child policy.
· If the CIR in GTS is specified in kbps for a parent policy, configure the CBQ bandwidth as a percentage or in kbps for the child policy.
· GTS cannot be configured in the child policy.
Prerequisites
Before configuring policy nesting, define a child policy (see "Defining a QoS policy").
Procedure
1. Enter system view.
system-view
2. Define a traffic class for the parent policy.
a. Create a traffic class for the parent policy and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
3. Nest the child QoS policy in the traffic behavior of the parent policy.
a. Create a traffic behavior for the parent policy and enter traffic behavior view.
traffic behavior behavior-name
b. Nest the child QoS policy.
traffic-policy policy-name
By default, policy nesting is not configured.
c. Return to system view.
quit
4. Create the parent policy and enter parent policy view.
qos policy policy-name
5. Associate the class with the behavior in the parent policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with a behavior.
Applying the QoS policy
Application destinations
You can apply a QoS policy to the following destinations:
· Interface—The QoS policy can be applied to the traffic sent or received on the interface.
· Globally—The QoS policy can be applied to the traffic sent or received on all ports.
· Control plane—The QoS policy can be applied to the traffic received on the control plane.
· User profile—The QoS policy can be applied to the traffic sent or received by the online users of the user profile.
Restrictions and guidelines for applying a QoS policy
You can modify traffic classes, traffic behaviors, and class-behavior associations in a QoS policy even after it is applied (except that it is applied to a user profile). If a traffic class uses an ACL for traffic classification, you can delete or modify the ACL.
If an action in a traffic behavior cannot take effect, all other actions in the traffic behavior do not take effect.
Applying the QoS policy to an interface
Restrictions and guidelines
A QoS policy can be applied to multiple interfaces. However, only one QoS policy can be applied to one direction (inbound or outbound) of an interface.
The QoS policy applied to the outgoing traffic on an interface does not regulate local packets. Local packets refer to critical protocol packets sent by the local system for operation maintenance. The most common local packets include link maintenance, RIP, LDP, and SSH packets.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Apply the QoS policy to the interface.
qos apply policy policy-name { inbound | outbound }
By default, no QoS policy is applied to an interface.
Applying the QoS policy globally
About this task
You can apply a QoS policy globally to the inbound or outbound direction of all ports.
Restrictions and guidelines
If the hardware resources of an interface card are insufficient, applying a QoS policy globally might fail on the interface card. The system does not automatically roll back the QoS policy configuration already applied to the main processing unit or other interface cards. To ensure consistency, you must use the undo qos apply policy global command to manually remove the QoS policy configuration applied to them.
Procedure
1. Enter system view.
system-view
2. Apply the QoS policy globally.
qos apply policy policy-name global { inbound | outbound }
By default, no QoS policy is applied globally.
Applying the QoS policy to a control plane
About this task
A device provides the user plane and the control plane.
· User plane—The units at the user plane are responsible for receiving, transmitting, and switching (forwarding) packets, such as various dedicated forwarding chips. They deliver super processing speeds and throughput.
· Control plane—The units at the control plane are processing units running most routing and switching protocols. They are responsible for protocol packet resolution and calculation, such as CPUs. Compared with user plane units, the control plane units allow for great packet processing flexibility but have lower throughput.
When the user plane receives packets that it cannot recognize or process, it transmits them to the control plane. If the transmission rate exceeds the processing capability of the control plane, the control plane will be busy handling undesired packets. As a result, the control plane will fail to handle legitimate packets correctly or timely. As a result, protocol performance is affected.
To address this problem, apply a QoS policy to the control plane to take QoS actions, such as traffic filtering or traffic policing, on inbound traffic. This ensures that the control plane can correctly receive, transmit, and process packets.
A predefined control plane QoS policy uses the protocol type or protocol group type to identify the type of packets sent to the control plane. You can use protocol types or protocol group types in if-match control-plane commands in traffic class view for traffic classification. Then you can reconfigure traffic behaviors for these traffic classes as required. You can use the display qos policy control-plane pre-defined command to display predefined control plane QoS policies.
Procedure
1. Enter system view.
system-view
2. Enter control plane view.
control-plane slot slot-number
3. Apply the QoS policy to the control plane.
qos apply policy policy-name inbound
By default, no QoS policy is applied to a control plane.
Applying the QoS policy to a user profile
About this task
When a user profile is configured, you can perform traffic policing based on users. After a user passes authentication, the authentication server sends the name of the user profile associated with the user to the device. The QoS policy configured in user profile view takes effect only when users come online.
Restrictions and guidelines
You can apply a QoS policy to multiple user profiles. In one direction of each user profile, only one policy can be applied. To modify a QoS policy already applied to a direction, first remove the applied QoS policy.
Procedure
1. Enter system view.
system-view
2. Enter user profile view.
user-profile profile-name
3. Apply the QoS policy to the user profile.
qos apply policy policy-name { inbound | outbound }
By default, no QoS policy is applied to a user profile.
Parameter |
Description |
inbound |
Applies a QoS policy to the traffic incoming traffic (traffic received by the device from online users). |
outbound |
Applies a QoS policy to the outgoing traffic (traffic sent by the device to online users). |
Verifying and maintaining QoS policies
Verifying QoS policy configuration
Perform display tasks in any view.
· Display traffic class configuration.
display traffic classifier { system-defined | user-defined } [ classifier-name ] [ slot slot-number ]
· Display traffic behavior configuration.
display traffic behavior { system-defined | user-defined } [ behavior-name ] [ slot slot-number ]
· Display QoS policy configuration.
display qos policy{ system-defined | user-defined } [ policy-name [ classifier classifier-name ] ] [ slot slot-number ]
· Display information about the predefined QoS policy applied to the control plane.
display qos policy control-plane pre-defined [ slot slot-number ]
Verifying QoS policy running status
Perform display tasks in any view.
· Display information about QoS policies applied to interfaces.
display qos policy interface [ interface-type interface-number ] [ slot slot-number ] [ inbound | outbound ]
· Display information about QoS policies applied globally.
display qos policy global [ slot slot-number ] [ inbound | outbound ]
· Display information about QoS policies applied to user profiles.
display qos policy user-profile [ name profile-name ] [ user-id user-id ] [ slot slot-number ] [ inbound | outbound ]
Clearing QoS policy statistics
Perform all clear tasks in user view.
· Clear the statistics for QoS policies applied globally.
reset qos policy global [ inbound | outbound ]
Configuring interface channelization
About interface channelization
By default, all subinterfaces of a main interface share and contend for the bandwidth of the main interface. Subinterfaces that carry key services cannot be guaranteed enough bandwidth. This feature allows subinterfaces of a physical interface or aggregate interface to exclusively use the specified amount of bandwidth.
Restrictions and guidelines: Interface channelization configuration
Before configuring the channelized bandwidth for an aggregate subinterface, you must execute the bandwidth command on the aggregate interface.
The total channelized bandwidth of subinterfaces cannot exceed the actual bandwidth of the main interface plus 1 Mbps. The channelized bandwidth takes effect only in the outbound direction.
Configuring the channelized bandwidth for a subinterface
4. Enter system view.
system-view
5. Enter subinterface view.
interface interface-type interface-number.subnumber
6. Set the channelized bandwidth for the subinterface.
mode channel-bandwidth bandwidth-value
By default, the channelized bandwidth is not set for a subinterface.
Display and maintenance commands for interface channelization
Execute display commands in any view.
Task |
Command |
Display interface channelization configuration and statistics. |
display mode channel-bandwidth interface [ interface-type { interface-number | interface-number.subnumber } ] [ slot slot-number ] |
Configuring priority mapping
About priority mapping
When a packet arrives, a device assigns a set of QoS priority parameters to the packet based on either of the following:
· A priority field carried in the packet.
· The port priority of the incoming port.
This process is called priority mapping. During this process, the device can modify the priority of the packet according to the priority mapping rules. The set of QoS priority parameters decides the scheduling priority and forwarding priority of the packet.
Priority mapping is implemented with priority maps and involves the following priorities:
· 802.11e priority.
· 802.1p priority.
· DSCP.
· EXP.
· IP precedence.
· Local precedence.
· Drop priority.
About priorities
Priorities include the following types: priorities carried in packets, and priorities locally assigned for scheduling only.
Packet-carried priorities include 802.1p priority, DSCP precedence, IP precedence, and EXP. These priorities have global significance and affect the forwarding priority of packets across the network. For more information about these priorities, see "Appendix C Introduction to packet precedence."
Locally assigned priorities only have local significance. They are assigned by the device only for scheduling. These priorities include the local precedence, drop priority, and user priority, as follows:
· Local precedence—Used for queuing. A local precedence value corresponds to an output queue. A packet with higher local precedence is assigned to a higher priority output queue to be preferentially scheduled.
· Drop priority—Used for making packet drop decisions. Packets with the highest drop priority are dropped preferentially.
· User priority—Precedence that the device automatically extracts from a priority field of the packet according to its forwarding path. It is a parameter for determining the scheduling priority and forwarding priority of the packet. The user priority represents the following items:
¡ The 802.1p priority for Layer 2 packets.
¡ The IP precedence for Layer 3 packets.
¡ The EXP for MPLS packets.
Priority maps
The device provides various types of priority maps. By looking through a priority map, the device decides which priority value to assign to a packet for subsequent packet processing.
The default priority maps (as shown in Appendix B Default priority maps) are available for priority mapping. They are adequate in most cases. If a default priority map cannot meet your requirements, you can modify the priority map as required.
Priority mapping configuration methods
You can configure priority mapping by using any of the following methods:
· Configuring priority trust mode—In this method, you can configure a port to look up a trusted priority type (802.1p, for example) in incoming packets in the priority maps. Then, the system maps the trusted priority to the target priority types and values.
· Changing port priority—If no packet priority is trusted, the port priority of the incoming port is used. By changing the port priority of a port, you change the priority of the incoming packets on the port.
· Configuring a QoS policy containing the priority mapping (called primap) action with the primap command.
Priority mapping process
On receiving an Ethernet packet on a port, the switch marks the scheduling priorities (local precedence and drop precedence) for the Ethernet packet. This procedure is done according to the priority trust mode of the receiving port and the 802.1Q tagging status of the packet, as shown in Figure 3.
Figure 3 Priority mapping process for an Ethernet packet
For information about priority marking, see "Configuring priority marking."
Priority mapping tasks at a glance
To configure priority mapping, perform the following tasks:
1. (Optional.) Configuring a priority map
2. Configure a priority mapping method:
¡ Configuring a port to trust packet priority for priority mapping
¡ Changing the port priority of an interface
Configuring a priority map
1. Enter system view.
system-view
2. Enter priority map view.
qos map-table{ dot11e-lp | dot1p-lp | dscp-lp | lp-dot11e | lp-dot1p | lp-dscp }
3. Configure mappings for the priority map.
import import-value-list export export-value
By default, the default priority maps are used. For more information, see "Appendix B Default priority maps."
If you execute this command multiple times, the most recent configuration takes effect.
Configuring a port to trust packet priority for priority mapping
About this task
You can configure the device to trust a particular priority field carried in packets for priority mapping on ports or globally. When you configure the trusted packet priority type on an interface, use the following available keywords:
· dot1p—Uses the 802.1p priority of received packets for mapping.
· dscp—Uses the DSCP precedence of received IP packets for mapping.
Restrictions and guidelines
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure the trusted packet priority type.
qos trust { dot1p | dscp }
By default, an interface does not trust any packet priority and uses the port priority as the 802.1p priority for mapping.
Changing the port priority of an interface
About this task
If an interface does not trust any packet priority, the device uses its port priority to look for priority parameters for the incoming packets. By changing port priority, you can prioritize traffic received on different interfaces.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Set the port priority of the interface.
qos priority priority-value
The default setting is 0.
Verifying and maintaining commands for priority mapping
Perform display tasks in any view.
· Display priority map configuration.
display qos map-table { dot11e-lp | dot1p-lp | dscp-lp | lp-dot11e | lp-dot1p | lp-dscp }
· Display the trusted packet priority type on a port.
display qos trust interface [ interface-type interface-number ]
Priority mapping configuration examples
Example: Configuring a priority trust mode
Network configuration
As shown in Figure 4:
· The 802.1p priority of traffic from Device A to Device C is 3.
· The 802.1p priority of traffic from Device B to Device C is 1.
Procedure
(Method 1) Configure Device C to trust packet priority
# Configure GigabitEthernet 0/0/1 and GigabitEthernet 0/0/2 to trust the 802.1p priority for priority mapping.
<DeviceC> system-view
[DeviceC] interface gigabitethernet 0/0/1
[DeviceC-GigabitEthernet0/0/1] qos trust dot1p
[DeviceC-GigabitEthernet0/0/1] quit
[DeviceC] interface gigabitethernet 0/0/2
[DeviceC-GigabitEthernet0/0/2] qos trust dot1p
[DeviceC-GigabitEthernet0/0/2] quit
(Method 2) Configure Device C to trust port priority
# Assign port priority to GigabitEthernet 0/0/1 and GigabitEthernet 0/0/2. Make sure the following requirements are met:
· The priority of GigabitEthernet 0/0/1 is higher than that of GigabitEthernet 0/0/2.
· No trusted packet priority type is configured on GigabitEthernet 0/0/1 or GigabitEthernet 0/0/2.
<DeviceC> system-view
[DeviceC] interface gigabitethernet 0/0/1
[DeviceC-GigabitEthernet0/0/1] qos priority 3
[DeviceC-GigabitEthernet0/0/1] quit
[DeviceC] interface gigabitethernet 0/0/2
[DeviceC-GigabitEthernet0/0/2] qos priority 1
[DeviceC-GigabitEthernet0/0/2] quit
Example: Configuring priority mapping tables and priority marking
Network configuration
As shown in Figure 5:
· The Marketing department connects to GigabitEthernet 0/0/1 of Device, which sets the 802.1p priority of traffic from the Marketing department to 3.
· The R&D department connects to GigabitEthernet 0/0/2 of Device, which sets the 802.1p priority of traffic from the R&D department to 4.
· The Management department connects to GigabitEthernet 0/0/3 of Device, which sets the 802.1p priority of traffic from the Management department to 5.
Configure port priority, 802.1p-to-local mapping table, and priority marking to implement the plan as described in Table 1.
Traffic destination |
Traffic priority order |
Queuing plan |
||
Traffic source |
Output queue |
Queue priority |
||
Public servers |
R&D department > Management department > Marketing department |
R&D department |
6 |
High |
Management department |
4 |
Medium |
||
Marketing department |
2 |
Low |
||
Internet |
Management department > Marketing department > R&D department |
R&D department |
2 |
Low |
Management department |
6 |
High |
||
Marketing department |
4 |
Medium |
Procedure
1. Configure trusting port priority:
# Set the port priority of GigabitEthernet 0/0/1 to 3.
<Device> system-view
[Device] interface gigabitethernet 0/0/1
[Device-GigabitEthernet0/0/1] qos priority 3
[Device-GigabitEthernet0/0/1] quit
# Set the port priority of GigabitEthernet 0/0/2 to 4.
[Device] interface gigabitethernet 0/0/2
[Device-GigabitEthernet0/0/2] qos priority 4
[Device-GigabitEthernet0/0/2] quit
# Set the port priority of GigabitEthernet 0/0/3 to 5.
[Device] interface gigabitethernet 0/0/3
[Device-GigabitEthernet0/0/3] qos priority 5
[Device-GigabitEthernet0/0/3] quit
2. Configure the 802.1p-to-local mapping table to map 802.1p priority values 3, 4, and 5 to local precedence values 2, 6, and 4.
This guarantees the R&D department, Management department, and Marketing department decreased priorities to access the public servers.
[Device] qos map-table dot1p-lp
[Device-maptbl-dot1p-lp] import 3 export 2
[Device-maptbl-dot1p-lp] import 4 export 6
[Device-maptbl-dot1p-lp] import 5 export 4
[Device-maptbl-dot1p-lp] quit
3. Configure priority marking to mark the packets from Management department, Marketing department, and R&D department to the Internet with 802.1p priority values 4, 5, and 3.
This guarantees the Management department, Marketing department, and R&D department decreased priorities to access the Internet.
# Create ACL 3000, and configure a rule to match HTTP packets.
[Device] acl advanced 3000
[Device-acl-adv-3000] rule permit tcp destination-port eq 80
[Device-acl-adv-3000] quit
# Create a traffic class named http, and use ACL 3000 as a match criterion.
[Device] traffic classifier http
[Device-classifier-http] if-match acl 3000
[Device-classifier-http] quit
# Create a traffic behavior named admin, and configure a marking action for the Management department.
[Device] traffic behavior admin
[Device-behavior-admin] remark dot1p 4
[Device-behavior-admin] quit
# Create a QoS policy named admin, and associate traffic class http with traffic behavior admin in QoS policy admin.
[Device] qos policy admin
[Device-qospolicy-admin] classifier http behavior admin
[Device-qospolicy-admin] quit
# Apply QoS policy admin to the inbound direction of GigabitEthernet 0/0/3.
[Device] interface gigabitethernet 0/0/3
[Device-GigabitEthernet0/0/3] qos apply policy admin inbound
# Create a traffic behavior named market, and configure a marking action for the Marketing department.
[Device] traffic behavior market
[Device-behavior-market] remark dot1p 5
[Device-behavior-market] quit
# Create a QoS policy named market, and associate traffic class http with traffic behavior market in QoS policy market.
[Device] qos policy market
[Device-qospolicy-market] classifier http behavior market
[Device-qospolicy-market] quit
# Apply QoS policy market to the inbound direction of GigabitEthernet 0/0/1.
[Device] interface gigabitethernet 0/0/1
[Device-GigabitEthernet0/0/1] qos apply policy market inbound
# Create a traffic behavior named rd, and configure a marking action for the R&D department.
[Device] traffic behavior rd
[Device-behavior-rd] remark dot1p 3
[Device-behavior-rd] quit
# Create a QoS policy named rd, and associate traffic class http with traffic behavior rd in QoS policy rd.
[Device] qos policy rd
[Device-qospolicy-rd] classifier http behavior rd
[Device-qospolicy-rd] quit
# Apply QoS policy rd to the inbound direction of GigabitEthernet 0/0/2.
[Device] interface gigabitethernet 0/0/2
[Device-GigabitEthernet0/0/2] qos apply policy rd inbound
Configuring traffic policing, GTS, and rate limit
About traffic policing, GTS, and rate limit
Traffic limit helps assign network resources (including bandwidth) and increase network performance. For example, you can configure a flow to use only the resources committed to it in a certain time range. This avoids network congestion caused by burst traffic.
Traffic policing, Generic Traffic Shaping (GTS), and rate limit control the traffic rate and resource usage according to traffic specifications. You can use token buckets for evaluating traffic specifications.
Traffic evaluation and token buckets
Token bucket features
A token bucket is analogous to a container that holds a certain number of tokens. Each token represents a certain forwarding capacity. The system puts tokens into the bucket at a constant rate. When the token bucket is full, the extra tokens cause the token bucket to overflow.
Evaluating traffic with the token bucket
A token bucket mechanism evaluates traffic by looking at the number of tokens in the bucket. If the number of tokens in the bucket is enough for forwarding the packets:
· The traffic conforms to the specification (called conforming traffic).
· The corresponding tokens are taken away from the bucket.
Otherwise, the traffic does not conform to the specification (called excess traffic).
A token bucket has the following configurable parameters:
· Mean rate at which tokens are put into the bucket, which is the permitted average rate of traffic. It is usually set to the committed information rate (CIR).
· Burst size or the capacity of the token bucket. It is the maximum traffic size permitted in each burst. It is usually set to the committed burst size (CBS). The set burst size must be greater than the maximum packet size.
Each arriving packet is evaluated.
Complicated evaluation
You can set two token buckets, bucket C and bucket E, to evaluate traffic in a more complicated environment and achieve more policing flexibility. The following are main mechanisms used for complicated evaluation:
· Single rate two color—Uses one token bucket and the following parameters:
¡ CIR—Rate at which tokens are put into bucket C. It sets the average packet transmission or forwarding rate allowed by bucket C.
¡ CBS—Size of bucket C, which specifies the transient burst of traffic that bucket C can forward.
When a packet arrives, the following rules apply:
¡ If bucket C has enough tokens to forward the packet, the packet is colored green.
¡ Otherwise, the packet is colored red.
· Single rate three color—Uses two token buckets and the following parameters:
¡ CIR—Rate at which tokens are put into bucket C. It sets the average packet transmission or forwarding rate allowed by bucket C.
¡ CBS—Size of bucket C, which specifies the transient burst of traffic that bucket C can forward.
¡ EBS—Size of bucket E minus size of bucket C, which specifies the transient burst of traffic that bucket E can forward. The EBS cannot be 0. The size of E bucket is the sum of the CBS and EBS.
When a packet arrives, the following rules apply:
¡ If bucket C has enough tokens, the packet is colored green.
¡ If bucket C does not have enough tokens but bucket E has enough tokens, the packet is colored yellow.
¡ If neither bucket C nor bucket E has sufficient tokens, the packet is colored red.
· Two rate three color—Uses two token buckets and the following parameters:
¡ CIR—Rate at which tokens are put into bucket C. It sets the average packet transmission or forwarding rate allowed by bucket C.
¡ CBS—Size of bucket C, which specifies the transient burst of traffic that bucket C can forward.
¡ PIR—Rate at which tokens are put into bucket E, which specifies the average packet transmission or forwarding rate allowed by bucket E.
¡ EBS—Size of bucket E, which specifies the transient burst of traffic that bucket E can forward.
When a packet arrives, the following rules apply:
¡ If bucket C has enough tokens, the packet is colored green.
¡ If bucket C does not have enough tokens but bucket E has enough tokens, the packet is colored yellow.
¡ If neither bucket C nor bucket E has sufficient tokens, the packet is colored red.
Traffic policing
A typical application of traffic policing is to supervise the specification of traffic entering a network and limit it within a reasonable range. Another application is to "discipline" the extra traffic to prevent aggressive use of network resources by an application. For example, you can limit bandwidth for HTTP packets to less than 50% of the total. If the traffic of a session exceeds the limit, traffic policing can drop the packets or reset the IP precedence of the packets. Figure 6 shows an example of policing outbound traffic on an interface.
Traffic policing can classify the policed traffic and take predefined policing actions on each packet depending on the evaluation result:
· Forwarding the packet.
· Dropping the packet.
· Forwarding the packet with its precedence re-marked.
· Delivering the packet to next-level traffic policing with its precedence re-marked.
GTS
GTS limits the traffic rate by buffering exceeding traffic. You can use GTS to adapt the traffic output rate on a device to the input traffic rate of its connected device to avoid packet loss.
The differences between traffic policing and GTS are as follows:
· Packets to be dropped with traffic policing are retained in a buffer or queue with GTS, as shown in Figure 7. When enough tokens are in the token bucket, the buffered packets are sent at an even rate.
· GTS can result in additional delay and traffic policing does not.
For example, in Figure 8, Device B performs traffic policing on packets from Device A and drops packets exceeding the limit. To avoid packet loss, you can perform GTS on the outgoing interface of Device A so that packets exceeding the limit are cached in Device A. Once resources are released, GTS takes out the cached packets and sends them out.
Rate limit
The rate limit of an interface specifies the maximum rate for forwarding packets (excluding critical packets).
Rate limit also uses token buckets for traffic control. When rate limit is configured on an interface, a token bucket handles all packets to be sent through the interface for rate limiting. If enough tokens are in the token bucket, packets can be forwarded. Otherwise, packets are put into QoS queues for congestion management. In this way, the traffic passing the interface is controlled.
Figure 9 Rate limit implementation
The token bucket mechanism limits traffic rate when accommodating bursts. It allows bursty traffic to be transmitted if enough tokens are available. If tokens are scarce, packets cannot be transmitted until efficient tokens are generated in the token bucket. It restricts the traffic rate to the rate for generating tokens.
Rate limit controls the total rate of all packets on an interface. It is easier to use than traffic policing in controlling the total traffic rate.
Configuring traffic policing
Traffic policing configuration approaches
You can configure traffic policing by using the MQC approach or the non-MQC approach.
You can configure the following types of traffic policing by using the non-MQC approach:
· ACL-based traffic policing.
· Traffic policing for all traffic.
If traffic policing is configured by using both the MQC approach and non-MQC approach, the configuration in MQC approach takes effect.
Configuring traffic policing by using the MQC approach
Restrictions and guidelines
The device supports the following application destinations for traffic policing:
· Interface.
· Globally.
· Control plane.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about the if-match command, see ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure a traffic policing action.
¡ In absolute value:
car cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] *
car cir committed-information-rate [ cbs committed-burst-size ] pir [ pps ] peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] *
¡ In percentage:
car cir percent cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ green action | red action | yellow action ] *
car cir percent cir-percent [ cbs cbs-time ] pir percent pir-percent [ ebs ebs-time ] [ green action | red action | yellow action ] *
By default, no traffic policing action is configured.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate the traffic class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a traffic class is not associated with a traffic behavior.
c. Return to system view.
quit
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Configuring CAR-list-based traffic policing
1. Enter system view.
system-view
2. Configure a CAR list.
qos carl carl-index { dscp dscp-list | mac mac-address | mpls-exp mpls-exp-value | precedence precedence-value | { destination-ip-address | source-ip-address } { range start-ip-address to end-ip-address | subnet ip-address mask-length } [ per-address [ shared-bandwidth ] ] }
3. Enter interface view.
interface interface-type interface-number
4. Apply a CAR-list-based CAR policy to the interface.
¡ In absolute value:
qos car { inbound | outbound } carl carl-index cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } carl carl-index cir committed-information-rate [ cbs committed-burst-size ] pir peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] *
¡ In percentage:
qos car { inbound | outbound } carl carl-index percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } carl carl-index percent cir cir-percent [ cbs cbs-time ] pir pir-percent [ ebs ebs-time ] [ green action | red action | yellow action ] *
By default, no CAR policy is applied to an interface.
Configuring ACL-based traffic policing
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure an ACL-based CAR policy on the interface.
¡ In absolute value:
qos car { inbound | outbound } acl [ ipv6 ] acl-number cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } acl [ ipv6 ] acl-number cir committed-information-rate [ cbs committed-burst-size ] pir peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] *
¡ In percentage:
qos car { inbound | outbound } acl [ ipv6 ] acl-number percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } acl [ ipv6 ] acl-number percent cir cir-percent [ cbs cbs-time ] pir pir-percent [ ebs ebs-time ] [ green action | red action | yellow action ] *
By default, no CAR policy is configured on an interface.
Configuring traffic policing for all traffic
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure a CAR policy for all traffic on the interface.
¡ In absolute value:
qos car { inbound | outbound } any cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } any cir committed-information-rate [ cbs committed-burst-size ] pir peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] *
¡ In percentage:
qos car { inbound | outbound } any percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ green action | red action | yellow action ] *
qos car { inbound | outbound } any percent cir cir-percent [ cbs cbs-time ] pir pir-percent [ ebs ebs-time ] [ green action | red action | yellow action ] *
By default, no CAR policy is configured on an interface.
Configuring GTS
GTS configuration approaches
You can configure GTS by using either the MQC approach or non-MQC approach.
You can configure the following types of GTS by using the non-MQC approach:
· ACL-based GTS.
· GTS for all traffic.
If GTS is configured by using both the MQC approach and non-MQC approach, the configuration in MQC approach takes effect.
Configuring GTS by using the MQC approach
Restrictions and guidelines
A GTS action takes effect only when a QoS policy is applied to the following application destinations:
· Interface.
· VLANs.
· Globally.
· Control plane.
· User profile.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For configurable match criteria, see the if-match command in ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure a GTS action.
- In absolute value:
gts cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ queue-length queue-length ]
- In percentage:
gts percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ queue-length queue-length ]
By default, no GTS action is configured.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate the class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a traffic class is not associated with a traffic behavior.
c. Return to system view.
quit
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Configuring ACL-based GTS
Restrictions and guidelines
An ACL-based GTS action takes effect only on outgoing traffic matching the specified ACL.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure ACL-based GTS on the interface.
¡ In absolute value:
qos gts acl [ ipv6 ] acl-number cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ queue-length queue-length ]
¡ In percentage:
qos gts acl [ ipv6 ] acl-number percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ queue-length queue-length ]
By default, GTS is not configured on an interface.
Configuring GTS for all traffic
Restrictions and guidelines
A GTS action for all traffic takes effect only on the outgoing traffic.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure GTS on the interface.
¡ In absolute value:
qos gts any cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ queue-length queue-length ]
¡ In percentage:
qos gts any percent cir cir-percent [ cbs cbs-time [ ebs ebs-time ] ] [ queue-length queue-length ]
By default, GTS is not configured on an interface.
Configuring the rate limit
Configuring the rate limit for an interface
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure the rate limit for the interface.
¡ In absolute value:
qos lr { inbound | outbound } cir committed-information-rate [ ebs excess-burst-size ]
By default, no rate limit is configured on an interface.
Including the physical layer header in calculating the packet length for rate limiting
About this task
By default, the device calculates the packet length for rate limiting based on the data link layer frame. This feature allows the device to include a 24-byte physical layer header in calculating the packet length for rate limiting.
Hardware and feature compatibility
Hardware |
Feature compatibility |
MSR810, MSR810-W, MSR810-W-DB, MSR810-LM, MSR810-W-LM, MSR810-10-PoE, MSR810-LM-HK, MSR810-W-LM-HK, MSR810-LM-CNDE-SJK, MSR810-CNDE-SJK |
No |
MSR810-LMS, MSR810-LUS |
No |
MSR810-LMS-EA, MSR810-LME |
No |
MSR2600-6-X1, MSR2600-10-X1 |
No |
MSR 2630 |
No |
MSR3600-28, MSR3600-51 |
No |
MSR3600-28-SI, MSR3600-51-SI |
No |
MSR3600-28-X1, MSR3600-28-X1-DP, MSR3600-51-X1, MSR3600-51-X1-DP |
No |
MSR3610-I-DP, MSR3610-IE-DP, MSR3610-IE-ES, MSR3610-IE-EAD, MSR-EAD-AK770, MSR3610-I-IG, MSR3610-IE-IG |
No |
MSR3610-X1, MSR3610-X1-DP, MSR3610-X1-DC, MSR3610-X1-DP-DC |
Yes |
MSR 3610, MSR 3620, MSR 3620-DP, MSR 3640, MSR 3660 |
Yes |
MSR3610-G, MSR3620-G |
No |
Hardware |
Feature compatibility |
MSR810-W-WiNet, MSR810-LM-WiNet |
No |
MSR830-4LM-WiNet |
No |
MSR830-5BEI-WiNet, MSR830-6EI-WiNet, MSR830-10BEI-WiNet |
No |
MSR830-6BHI-WiNet, MSR830-10BHI-WiNet |
No |
MSR2600-6-WiNet, MSR2600-10-X1-WiNet |
No |
MSR2630-WiNet |
No |
MSR3600-28-WiNet |
No |
MSR3610-X1-WiNet |
Yes |
MSR3610-WiNet, MSR3620-10-WiNet, MSR3620-DP-WiNet, MSR3620-WiNet, MSR3660-WiNet |
Yes |
Hardware |
Feature compatibility |
MSR2630-XS |
No |
MSR3600-28-XS |
No |
MSR3610-XS |
Yes |
MSR3620-XS |
Yes |
MSR3610-I-XS |
No |
MSR3610-IE-XS |
No |
Hardware |
Feature compatibility |
MSR810-LM-GL |
No |
MSR810-W-LM-GL |
No |
MSR830-6EI-GL |
No |
MSR830-10EI-GL |
No |
MSR830-6HI-GL |
No |
MSR830-10HI-GL |
No |
MSR2600-6-X1-GL |
No |
MSR3600-28-SI-GL |
No |
Restrictions and guidelines
This feature takes effect only on Layer 3 Ethernet interfaces and Layer 3 aggregate interfaces.
Procedure
1. Enter system view.
system-view
2. Include the physical layer header in calculating the packet length for rate limiting.
qos overhead layer physical
By default, the device calculates the packet length for rate limiting based on the data link layer frame.
Verifying and maintaining traffic policing, GTS, and rate limit
Verifying MQC-based traffic policing and GTS configurations
To verify MQC-based traffic policing and GTS configurations, execute the following command in any view:
display traffic behavior user-defined [ behavior-name ]
Verifying non-MQC traffic policing, GTS, and rate limit configurations and statistics
Perform display tasks in any view.
· Display CAR configuration and statistics on an interface.
display qos car interface [ interface-type interface-number ]
· Display CAR list information.
display qos carl [ carl-index ] [ slot slot-number ]
· Display GTS configuration and statistics for interfaces.
display qos gts interface [ interface-type interface-number ]
· Display rate limit configuration and statistics.
display qos lr interface [ interface-type interface-number ]
Traffic policing, GTS, and rate limit configuration examples
Example: Configuring traffic policing
Network requirements
As shown in Figure 10:
· The server, Host A, and Host B can access the Internet through Device A and Device B.
· The server, Host A, and GigabitEthernet 0/0/1 of Device A are in the same network segment.
· Host B and GigabitEthernet 0/0/2 of Device A are in the same network segment.
Perform traffic control for the packets that GigabitEthernet 0/0/1 of Device A receives from the server and Host A using the following guidelines:
· Limit the rate of packets from the server to 10240 kbps. When the traffic rate is below 10240 kbps, the traffic is forwarded. When the traffic rate exceeds 10240 kbps, the excess packets are marked with DSCP value 0 and then forwarded.
· Limit the rate of packets from Host A to 2560 kbps. When the traffic rate is below 2560 kbps, the traffic is forwarded. When the traffic rate exceeds 2560 kbps, the excess packets are dropped.
Perform traffic control on GigabitEthernet 0/0/1 and GigabitEthernet 0/0/2 of Device B using the following guidelines:
· Limit the incoming traffic rate on GigabitEthernet 0/0/1 to 20480 kbps, and the excess packets are dropped.
· Limit the outgoing traffic rate on GigabitEthernet 0/0/2 to 10240 kbps, and the excess packets are dropped.
Configuration procedure
1. Configure Device A:
# Configure ACL 2001 and ACL 2002 to permit the packets from the server and Host A, respectively.
<DeviceA> system-view
[DeviceA] acl basic 2001
[DeviceA-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0
[DeviceA-acl-ipv4-basic-2001] quit
[DeviceA] acl basic 2002
[DeviceA-acl-ipv4-basic-2002] rule permit source 1.1.1.2 0
[DeviceA-acl-ipv4-basic-2002] quit
# Create a traffic class named server, and use ACL 2001 as the match criterion.
[DeviceA] traffic classifier server
[DeviceA-classifier-server] if-match acl 2001
[DeviceA-classifier-server] quit
# Create a traffic class named host, and use ACL 2002 as the match criterion.
[DeviceA] traffic classifier host
[DeviceA-classifier-host] if-match acl 2002
[DeviceA-classifier-host] quit
# Create a traffic behavior named server, and configure a traffic policing action (CIR 10240 kbps).
[DeviceA] traffic behavior server
[DeviceA-behavior-server] car cir 10240 red remark-dscp-pass 0
[DeviceA-behavior-server] quit
# Create a traffic behavior named host, and configure a traffic policing action (CIR 2560 kbps).
[DeviceA] traffic behavior host
[DeviceA-behavior-host] car cir 2560
[DeviceA-behavior-host] quit
# Create a QoS policy named car, and associate traffic classes server and host with traffic behaviors server and host in QoS policy car, respectively.
[DeviceA] qos policy car
[DeviceA-qospolicy-car] classifier server behavior server
[DeviceA-qospolicy-car] classifier host behavior host
[DeviceA-qospolicy-car] quit
# Apply QoS policy car to the inbound direction of GigabitEthernet 0/0/1.
[DeviceA] interface gigabitethernet 0/0/1
[DeviceA-GigabitEthernet0/0/1] qos apply policy car inbound
2. Configure Device B:
# Create ACL 3001, and configure a rule to match HTTP packets.
<DeviceB> system-view
[DeviceB] acl advanced 3001
[DeviceB-acl-adv-3001] rule permit tcp destination-port eq 80
[DeviceB-acl-adv-3001] quit
# Create a traffic class named http, and use ACL 3001 as a match criterion.
[DeviceB] traffic classifier http
[DeviceB-classifier-http] if-match acl 3001
[DeviceB-classifier-http] quit
# Create a traffic class named class, and configure the traffic class to match all packets.
[DeviceB] traffic classifier class
[DeviceB-classifier-class] if-match any
[DeviceB-classifier-class] quit
# Create a traffic behavior named car_inbound, and configure a traffic policing action (CIR 20480 kbps).
[DeviceB] traffic behavior car_inbound
[DeviceB-behavior-car_inbound] car cir 20480
[DeviceB-behavior-car_inbound] quit
# Create a traffic behavior named car_outbound, and configure a traffic policing action (CIR 10240 kbps).
[DeviceB] traffic behavior car_outbound
[DeviceB-behavior-car_outbound] car cir 10240
[DeviceB-behavior-car_outbound] quit
# Create a QoS policy named car_inbound, and associate traffic class class with traffic behavior car_inbound in QoS policy car_inbound.
[DeviceB] qos policy car_inbound
[DeviceB-qospolicy-car_inbound] classifier class behavior car_inbound
[DeviceB-qospolicy-car_inbound] quit
# Create a QoS policy named car_outbound, and associate traffic class http with traffic behavior car_outbound in QoS policy car_outbound.
[DeviceB] qos policy car_outbound
[DeviceB-qospolicy-car_outbound] classifier http behavior car_outbound
[DeviceB-qospolicy-car_outbound] quit
# Apply QoS policy car_inbound to the inbound direction of GigabitEthernet 0/0/1.
[DeviceB] interface gigabitethernet 0/0/1
[DeviceB-GigabitEthernet0/0/1] qos apply policy car_inbound inbound
# Apply QoS policy car_outbound to the outbound direction of GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] qos apply policy car_outbound outbound
Configuring congestion management
About congestion management
Cause, negative results, and countermeasure of congestion
Congestion occurs on a link or node when traffic size exceeds the processing capability of the link or node. It is typical of a statistical multiplexing network and can be caused by link failures, insufficient resources, and various other causes. Figure 11 shows common congestion scenarios.
Figure 11 Traffic congestion causes
Congestion can introduce the following negative results:
· Increased delay and jitter during packet transmission.
· Decreased network throughput and resource use efficiency.
· Network resource (memory, in particular) exhaustion and system breakdown.
Congestion is unavoidable in switched networks or multiuser application environments. To improve the service performance of your network, implement congestion management policies.
For example, congestion management defines a resource dispatching policy to prioritize packets for forwarding when congestion occurs.
Congestion management methods
Congestion management involves queue creating, traffic classification, packet enqueuing, and queue scheduling.
Queuing is a common congestion management technique. It classifies traffic into queues and picks out packets from each queue by using an algorithm. Various queuing algorithms are available, and each addresses a particular network traffic problem. Your choice of algorithm significantly affects bandwidth assignment, delay, and jitter.
The device supports the following queuing mechanisms:
· FIFO.
· PQ.
· CQ.
· WFQ.
· CBQ.
· RTPQ.
FIFO
As shown in Figure 12, the first in first out (FIFO) uses a single queue and does not classify traffic or schedule queues. FIFO delivers packets in their arrival order. The packet that arrives earlier is scheduled first. The only concern of FIFO is queue length, which affects delay and packet loss rate. On a device, resources are assigned to packets depending on their arrival order and load status of the device. The best-effort service model uses FIFO queuing.
FIFO does not address congestion problems. If only one FIFO output/input queue exists on a port, you cannot ensure timely delivery of mission-critical or delay-sensitive traffic or smooth traffic jitter. If malicious traffic occupies bandwidth aggressively, the problems increase. To control congestion and prioritize forwarding of critical traffic, use other queue scheduling mechanisms, where multiple queues can be configured. Within each queue, FIFO is still used.
PQ
Figure 13 Priority queuing (PQ)
PQ is designed for mission-critical applications. Mission-critical applications require preferential treatment to reduce the response delay when congestion occurs. PQ can flexibly determine the order of forwarding packets by network protocol (for example, IP and IPX), incoming interface, packet length, source/destination address, and so on. Priority queuing classifies packets into four queues (top, middle, normal, and bottom queues, in descending priority order). By default, packets are assigned to the normal queue. Each of the four queues is a FIFO queue.
PQ schedules the four queues in descending order of priority. It sends packets in the queue with the highest priority first. When the queue with the highest priority is empty, it sends packets in the queue with the second highest priority. To make sure mission-critical packets are always served first, assign the mission-critical packets to the highest-priority queue. The common service packets that are assigned to the low-priority queues are transmitted when the high-priority queues are empty.
However, packets in the lower-priority queues cannot be transmitted when congestion occurs if packets exist in the higher-priority queues for a long time.
CQ
CQ provides 16 queues, numbered from 1 to 16, as shown in Figure 14. You can define traffic classification rules and divide bandwidth across queues by specifying the byte count for each queue. By default, packets are assigned to queue 1.
During a cycle of queue scheduling, CQ schedules the 16 queues in a round robin way. It sends a certain number of bytes out of each queue in the ascending order of queue 1 to queue 16. CQ guarantees a certain amount of bandwidth to common packets, and ensures that mission-critical packets are assigned more bandwidth. The bandwidth ratio for each queue is the byte count configured for that queue divided by the total byte count configured for all queues.
CQ can assign free bandwidth of idle queues to busy queues. Even though it performs round robin queue scheduling, CQ does not assign fixed time slots to the queues. If a queue is empty, CQ immediately moves to the next queue. When a class does not have packets, the bandwidth for other classes increases.
WFQ
Figure 15 Weighted fair queuing (WFQ)
FQ is designed to equally allocate network resources to reduce the delay and jitter of each traffic flow as much as possible. FQ follows these principles:
· Different queues have fair dispatching opportunities for delay balancing among flows.
· Short packets and long packets are equally scheduled. If long packets and short packets exist in queues, statistically the short packets are scheduled preferentially to reduce the jitter between packets.
WFQ considers weights when determining the queue scheduling order. Statistically, WFQ gives high-priority traffic more scheduling opportunities than low-priority traffic. To balance the delay of every traffic flow, WFQ performs the following operations:
· Automatically classifies traffic according to the "session" information of traffic.
· Attempts to provide as many queues as possible for traffic flows.
The session information of traffic includes the following information:
· Protocol type.
· TCP or UDP source/destination port numbers.
· Source/destination IP addresses.
· IP precedence bits in the ToS field.
When dequeuing packets, WFQ assigns the outgoing interface bandwidth to each traffic flow by precedence. The higher precedence value a traffic flow has, the more bandwidth it gets.
For example, five flows exist in the current interface with precedence 0, 1, 2, 3, and 4, respectively. The total bandwidth quota is the sum of all the (precedence value + 1)s, 1 + 2 + 3 + 4 + 5 = 15.
The bandwidth percentage assigned to each flow is (precedence value of the flow + 1)/total bandwidth quota. The bandwidth percentages for flows are 1/15, 2/15, 3/15, 4/15, and 5/15, respectively.
Because WFQ can balance the delay and jitter of each flow when congestion occurs, it is suitable for handling special situations. For example, WFQ is used in the assured forwarding (AF) services of the RSVP, and WFQ is used to schedule buffered packets in GTS.
CBQ
Figure 16 CBQ
Class-based queuing (CBQ) extends WFQ by supporting user-defined classes. When network congestion occurs, CBQ uses user-defined traffic match criteria to enqueue packets. Before packets are enqueued, congestion avoidance actions, such as tail drop or WRED and bandwidth restriction check, are performed. When being dequeued, packets are scheduled by WFQ.
CBQ provides the following queues:
· Emergency queue—Enqueues emergent packets. The emergency queue is a FIFO queue without bandwidth restriction.
· Strict priority (SP) queuing—SP queuing is designed for mission-critical applications. Mission-critical applications require preferential treatment to reduce the response delay when congestion occurs. With SP queuing, CBQ can provide strict priority service. A maximum of 64 SP queues are supported.
· Low Latency Queuing (LLQ)—An EF queue. Because packets are fairly treated in CBQ, delay-sensitive flows like video and voice packets might not be transmitted timely. To solve this problem, LLQ combines PQ and CBQ to preferentially transmit delay-sensitive flows like voice packets. When defining traffic classes for LLQ, you can configure a class of packets to be preferentially transmitted. The packets of all priority classes are assigned to the same priority queue. Bandwidth restriction on each class of packets is checked before the packets are enqueued. During the dequeuing operation, packets in the priority queue are transmitted first. To reduce the delay of the other queues except the priority queue, LLQ assigns the maximum available bandwidth to each priority class. The bandwidth value polices traffic during congestion. When no congestion is present, a priority class can use more than the bandwidth assigned to it. During congestion, the packets of each priority class exceeding the assigned bandwidth are discarded.
· Bandwidth queuing (BQ)—An AF queue. The BQ provides guaranteed bandwidth for AF traffic, and schedules the AF classes proportionally. The system supports up to 64 AF queues.
· Default queue—A WFQ queue. The default queue transmits the BE traffic by using the remaining interface bandwidth.
The system matches packets with classification rules in the following order:
· Match packets with priority classes and then the other classes.
· Match packets with priority classes in the configuration order.
· Match packets with other classes in the configuration order.
· Match packets with classification rules in a class in the configuration order.
RTPQ
RTP queuing (RTPQ) is designed for delay-sensitive, real-time traffic (such as voice and video). You can assign voice or video packets to a high-priority queue by specifying a UDP port range as the match criterion. These packets are given strict priority service and are sent before packets in other queues are sent.
Figure 17 RTPQ
Congestion management technique comparison
Congestion management techniques offer different QoS capabilities to meet different application requirements, as explained in Table 2.
Table 2 Congestion management technique comparison
Type |
Number of queues |
Advantages |
Disadvantages |
FIFO |
1 |
· No need to configure, easy to use. · Easy to operate, low delay. |
· All packets are treated equally. The available bandwidth, delay and drop probability are determined by the arrival order of packets. · No restriction on traffic from connectionless protocols (protocols without any flow control mechanism, UDP, for example). This problem results in bandwidth loss for traffic of connection-oriented protocols (TCP, for example). · No delay guarantee for time-sensitive real-time applications, such as VoIP. |
PQ |
4 |
Provides strict priority service for mission-critical applications and guarantees low delay for real-time traffic, such as voice traffic. |
· Need to configure, low processing speed. · If packets always exist in high-priority queues, packets in low-priority queues cannot be sent. |
CQ |
16 |
· Bandwidth assignment in percentages for different applications. · Bandwidth reassignment to increase bandwidth for each class when packets of certain classes are not present. |
Need to configure, low processing speed. |
WFQ |
Configurable |
· Easy to configure. · Bandwidth guarantee for packets from cooperative (interactive) sources (such as TCP packets). · Reduces jitter. · Reduces the delay for interactive applications with a small amount of data. · Bandwidth assignment based on traffic priority. · Automatic bandwidth reassignment to increase bandwidth for each class when the number of traffic classes decreases. |
The processing speed is slower than FIFO. |
CBQ |
Configurable (0 to 64) |
· Flexible traffic classification based on rules and differentiated queue scheduling mechanisms for EF, AF and BE services. · Highly precise bandwidth guarantee and queue scheduling on the basis of AF service weights for various AF services. · Absolute preferential queue scheduling for the EF service to meet the delay requirement of real-time data. · Overcomes the PQ disadvantage where some low-priority queues are not serviced by restricting the high-priority traffic. · WFQ scheduling for best-effort traffic (the default class). |
The system overheads are large. |
RTPQ |
1 |
· Provides preferential treatment for real-time applications. · Performs traffic policing before enqueuing packets to prevent other queues from being starved. |
Applicable only to delay-sensitive applications, such as voice and video. |
Setting the FIFO queue size
Setting the FIFO queue size for an interface
Restrictions and guidelines
For the FIFO queuing feature to take effect on a subinterface, you must configure the rate limit on the subinterface.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Set the FIFO queue size for the interface.
qos fifo queue-length queue-length
The default setting is 75.
If the burst traffic is too heavy, increase the queue length to make queue scheduling more accurate.
Configuring PQ
About configuring PQ
You can define a set of assignment rules in a PQ list and then apply the PQ list to an interface. An assignment rule assigns a packet that meets a specific match criterion to a queue.
When a packet arrives, it is examined against match criteria in their configuration order.
· When a match is found, the packet is assigned to the corresponding queue, and the matching process ends.
· If no match is found, the packet is assigned to the default queue.
Restrictions and guidelines
· If you apply multiple PQ lists to an interface, the PQ list last applied takes effect.
· You must configure the rate limit for the PQ feature to take effect on the following interfaces:
¡ Tunnel interfaces.
¡ Subinterfaces.
¡ Layer 3 aggregate interfaces.
¡ HDLC link bundle interfaces.
¡ VT and dialer interfaces configured with PPPoE.
For information about the rate limit function, see "Configuring the rate limit."
Configuring PQ for an interface
1. Enter system view.
system-view
2. Configure a PQ list.
¡ Configure a protocol-based PQ list.
qos pql pql-index protocol { ip | ipv6 } [ queue-key key-value ] queue { bottom | middle | normal | top }
¡ Configure an interface-based PQ list.
qos pql pql-index inbound-interface interface-type interface-number queue { bottom | middle | normal | top }
¡ Configure a local-precedence-based PQ list.
qos pql pql-index local-precedence local-precedence-list queue { bottom | middle | normal | top }
¡ Configure an MPLS-EXP-based PQ list.
qos pql pql-index protocol mpls exp exp-list queue { bottom | middle | normal | top }
3. (Optional.) Configure a queue as the default queue for the PQ list.
qos pql pql-index default-queue { bottom | middle | normal | top }
By default, the normal queue is the default queue.
The default queue enqueues packets that do not match any criteria in a PQ list.
4. (Optional.) Set the maximum queue length for a queue in the PQ list.
qos pql pql-index queue { bottom | middle | normal | top } queue-length queue-length
By default:
¡ The maximum top queue length is 20.
¡ The maximum middle queue length is 40.
¡ The maximum normal queue length is 60.
¡ The maximum bottom queue length is 80.
5. Enter interface view.
interface interface-type interface-number
6. Apply the PQ list to the interface.
qos pq pql pql-index
By default, FIFO is used.
Example: Configuring PQ
Network configuration
As shown in Figure 18, both the server and Host A send data to Host B through Device A. The server sends critical packets, and Host A sends non-critical packets.
Configure PQ on GigabitEthernet 0/0/2 of Device A, so that the critical packets from the server are transmitted preferentially when congestion occurs.
Procedure
# Configure two ACLs to match packets from the server and Host A.
[DeviceA] acl basic 2001
[DeviceA-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0
[DeviceA] acl basic 2002
[DeviceA-acl-ipv4-basic-2002] rule permit source 1.1.1.2 0
# Configure a PQ list to assign the packets from the server to the top queue when congestion occurs.
[DeviceA] qos pql 1 protocol ip acl 2001 queue top
# Configure a PQ list to assign the packets from Host A to the bottom queue when congestion occurs.
[DeviceA] qos pql 1 protocol ip acl 2002 queue bottom
# Set the maximum queue size of the top queue to 50 and that of the bottom queue to 100 in the PQ list.
[DeviceA] qos pql 1 queue top queue-length 50
[DeviceA] qos pql 1 queue bottom queue-length 100
# Apply PQ list 1 to GigabitEthernet 0/0/2.
[DeviceA] interface gigabitethernet 0/0/2
[DeviceA-GigabitEthernet0/0/2] qos pq pql 1
Configuring CQ
About configuring CQ
You can configure a CQ list that contains up to 16 queues. The CQ list specifies the following information:
· The queue where a packet is placed in.
· The maximum length of each queue.
· The number of bytes sent from the queue during a cycle of round robin scheduling.
Restrictions and guidelines
· If you apply multiple CQ lists to an interface, the CQ list last applied takes effect.
· You must configure the rate limit for the CQ feature to take effect on the following interfaces:
¡ Tunnel interfaces.
¡ Subinterfaces.
¡ Layer 3 aggregate interfaces.
¡ HDLC link bundle interfaces.
¡ VT and dialer interfaces configured with PPPoE.
For information about the rate limit function, see "Configuring the rate limit."
Configuring CQ for an interface
7. Enter system view.
system-view
8. Configure a CQ list.
¡ Configure a protocol-based CQ list.
qos cql cql-index protocol { ip | ipv6 } [ queue-key key-value ] queue queue-id
¡ Configure an interface-based PQ list.
qos cql cql-index inbound-interface interface-type interface-number queue queue-id
¡ Configure a local-precedence-based CQ list.
qos cql cql-index local-precedence local-precedence-list queue queue-id
¡ Configure an MPLS-EXP-based CQ list.
qos cql cql-index protocol mpls exp exp-list queue queue-id
9. (Optional.) Configure a queue as the default queue for the CQ list.
qos cql cql-index default-queue queue-id
By default, queue 1 is the default queue.
The default queue enqueues packets that do not match any criteria in a CQ list.
10. (Optional.) Set the maximum length of a queue in the CQ list.
qos cql cql-index queue queue-id queue-length queue-length
The default setting is 20.
11. (Optional.) Configure the number of bytes sent from a queue during a cycle of round robin scheduling in the CQ list.
qos cql cql-index queue queue-id serving byte-count
The default setting is 1500 bytes.
12. Enter interface view.
interface interface-type interface-number
13. Apply the CQ list to the interface.
qos cq cql cql-index
By default, FIFO is used.
Configuring WFQ
Restrictions and guidelines
· You must configure the rate limit for the WFQ feature to take effect on the following interfaces:
¡ Tunnel interfaces.
¡ Subinterfaces.
¡ Layer 3 aggregate interfaces.
¡ HDLC link bundle interfaces.
¡ VT and dialer interfaces configured with PPPoE.
For information about the rate limit function, see "Configuring the rate limit."
· On an interface that is not enabled with WFQ, the qos wfq command can enable WFQ and configure WFQ-related parameters. If WFQ has been enabled for the interface, the qos wfq command can modify the WFQ-related parameters.
Configuring WFQ for an interface
14. Enter system view.
system-view
15. Enter interface view.
interface interface-type interface-number
16. Configure WFQ for the interface.
qos wfq [ dscp | precedence ] [ queue-length max-queue-length | queue-number total-queue-number ] *
By default, WFQ is not configured for an interface.
Configuring WFQ for a PW
17. Enter system view.
system-view
18. Enter PW view.
¡ Execute the following commands in sequence to enter cross-connect PW view:
xconnect-group group-name
connection connection-name
peer ip-address pw-id pw-id [ in-label label-value out-label label-value ] [ pw-class class-name | tunnel-policy tunnel-policy-name ] *
¡ Execute the following commands in sequence to enter VSI LDP PW view:
vsi vsi-name [ hub-spoke ]
pwsignaling ldp
peer ip-address [ pw-id pw-id ] [ hub | no-split-horizon ] [ pw-class class-name | tunnel-policy tunnel-policy-name ] *
¡ Execute the following commands in sequence to enter VSI static PW view:
vsi vsi-name [ hub-spoke ]
pwsignaling static
peer ip-address [ pw-id pw-id ] [ in-label label-value out-label label-value [ hub | no-split-horizon | pw-class class-name | tunnel-policy tunnel-policy-name ] * ]
19. Configure WFQ for the PW.
qos wfq [ dscp | precedence ] [ queue-length max-queue-length | queue-number total-queue-number ] *
By default, WFQ is not configured for a PW.
Configuring CBQ
About CBQ
The system predefines the following classes, traffic behaviors, and policies:
Predefined classes
The system predefines some classes and defines general rules for the classes. You can use the following predefined classes when defining a policy:
· default-class—Matches the default traffic.
· ef, af1, af2, af3, af4—Matches IP DSCP value ef, af1, af2, af3, af4, respectively.
· ip-prec0, ip-prec1, …ip-prec7—Matches IP precedence value 0, 1, …7, respectively.
· mpls-exp0, mpls-exp1, …mpls-exp7—Matches MPLS EXP value 0, 1, …7, respectively.
Predefined traffic behaviors
The system predefines some traffic behaviors and defines QoS features for the behaviors.
· ef—Assigns a class of packets to the EF queue and assigns 20% of the available interface bandwidth to the class of packets.
· af—Assigns a class of packets to the AF queue and assigns 20% of the available interface bandwidth to the class of packets.
· be—Defines no features.
· be-flow-based—Assigns a class of packets to a WFQ queue and specifies the drop policy as WRED. By default, 256 WFQ queues exist, and WRED is an IP precedence-based drop policy.
Predefined QoS policy
The system predefines a QoS policy, specifies a predefined class for the policy and associates a predefined behavior with the class. The policy is named default, with the default CBQ action.
The policy default is defined as follows:
· Associates the predefined class ef with the predefined traffic behavior ef.
· Associates predefined classes af1 through af4 with the predefined traffic behavior af.
· Associates the predefined class default-class with the predefined traffic behavior be.
Restrictions and guidelines for CBQ configuration
When you configure CBQ, follow these restrictions and guidelines:
· Only one of the following queuing actions can be configured in the same behavior:
¡ AF.
¡ EF.
¡ SP.
¡ WFQ.
· To configure queue af for multiple classes of a policy, you must configure them in one of the following units:
¡ Bandwidth in kbps.
¡ Percentage of the available bandwidth.
¡ Percentage of the remaining bandwidth.
· In a QoS policy, if AF is configured in percentage of the remaining bandwidth, EF can be configured in absolute value or in percentage.
· In a QoS policy, if AF is configured in absolute value or in percentage, EF can be configured in absolute value or in percentage.
· You must configure the rate limit on the main interface for the CBQ feature to take effect on a subinterface.
· The default class cannot be associated with a traffic behavior including EF or SP.
· You can associate the traffic behavior that contains a WFQ action only with the default class.
· RTPQ and CBQ are mutually exclusive. CBQ can use LLQ to provide priority service for real-time traffic.
Configure AF and the minimum guaranteed bandwidth
Restrictions and guidelines
· The undo queue af command also cancels the queue-length command configuration and all WRED-related settings.
· The wred and queue-length commands are mutually exclusive in a traffic behavior.
· The undo wred [ dscp | ip-precedence ] command also cancels all other WRED-related settings.
· A QoS policy that contains an AF action can be applied to the outbound direction of an interface or the inbound direction for a user profile. To modify a QoS policy applied to a user profile, follow these steps:
a. Remove the QoS policy from the user profile.
b. Configure a new QoS policy.
c. Apply the new QoS policy to the user profile.
Procedure
20. Enter system view.
system-view
21. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
22. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure AF and the minimum guaranteed bandwidth.
queue af bandwidth { bandwidth | pct percentage | remaining-pct remaining-percentage }
By default, AF is not configured.
c. (Optional.) Set the maximum queue size.
queue-length queue-length
The default settting is 50 packets.
If the burst traffic is too heavy, increase the queue length to make queue scheduling more accurate.
d. Enable WRED.
wred [ dscp | ip-precedence ]
By default, WRED is not enabled.
e. Set the exponent for WRED to calculate the average queue size.
wred weighting-constant exponent
The default setting is 9.
f. Set the lower limit, upper limit, and drop probability denominator for a DSCP value in WRED
wred dscp dscp-value low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, the lower limit is 10, the upper limit is 30, and the drop probability denominator is 10.
You must enable DSCP-based WRED by using the wred dscp command before you configure this command.
g. Set the lower limit, upper limit, and drop probability denominator for an IP precedence in WRED.
wred ip-precedence precedence low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, the lower limit is 10, the upper limit is 30, and the drop probability denominator is 10.
h. Return to system view.
quit
23. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate a traffic behavior with a class in the policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with a behavior.
c. Return to system view.
quit
24. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Configuring EF and the maximum bandwidth
Restrictions and guidelines
· The undo queue ef command also cancels the queue-length command configuration.
· A QoS policy that contains an EF action can be applied to the outbound direction of an interface or the inbound direction for a user profile. To modify a QoS policy applied to a user profile, follow these steps:
a. Remove the QoS policy from the user profile.
b. Configure a new QoS policy.
c. Apply the new QoS policy to the user profile.
Procedure
25. Enter system view.
system-view
26. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
27. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure EF and the maximum bandwidth.
queue ef bandwidth { bandwidth [ cbs burst ] | pct percentage [ cbs-ratio ratio] }
By default, EF is not configured.
c. (Optional.) Set the maximum queue size.
queue-length queue-length
The default settting is 50 packets.
If the burst traffic is too heavy, increase the queue length to make queue scheduling more accurate.
d. Return to system view.
quit
28. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate a traffic behavior with a class in the policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with a behavior.
c. Return to system view.
quit
29. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Configuring SP
Restrictions and guidelines
A QoS policy that contains an SP action can be applied to the outbound direction of an interface or the inbound direction for a user profile. To modify a QoS policy applied to a user profile, follow these steps:
30. Remove the QoS policy from the user profile.
31. Configure a new QoS policy.
32. Apply the new QoS policy to the user profile.
Procedure
33. Enter system view.
system-view
34. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
35. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure SP.
queue sp
By default, SP is not configured.
c. Return to system view.
quit
36. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate a traffic behavior with a class in the policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with a behavior.
c. Return to system view.
quit
37. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Configuring WFQ
Restrictions and guidelines
· The undo queue wfq command also cancels the queue-length command configuration and all WRED-related settings.
· The wred and queue-length commands are mutually exclusive in a traffic behavior.
· The undo wred [ dscp | ip-precedence ] command also cancels all other WRED-related settings.
· A QoS policy that contains a WFQ action can be applied to the outbound direction of an interface or the inbound direction for a user profile. To modify a QoS policy applied to a user profile, follow these steps:
a. Remove the QoS policy from the user profile.
b. Configure a new QoS policy.
c. Apply the new QoS policy to the user profile.
Procedure
38. Enter system view.
system-view
39. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
40. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure WFQ.
queue wfq [ queue-number total-queue-number ]
By default, WFQ is not configured.
c. Set the maximum queue size.
queue-length queue-length
The default settting is 50 packets.
If the burst traffic is too heavy, increase the queue length to make queue scheduling more accurate.
d. Enable WRED.
wred [ dscp | ip-precedence ]
By default, WRED is not enabled.
e. Set the exponent for WRED to calculate the average queue size
wred weighting-constant exponent
The default setting is 9.
f. Set the lower limit, upper limit, and drop probability denominator for a DSCP value in WRED
wred dscp dscp-value low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, the lower limit is 10, the upper limit is 30, and the drop probability denominator is 10.
g. Set the lower limit, upper limit, and drop probability denominator for an IP precedence in WRED.
wred ip-precedence precedence low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, the lower limit is 10, the upper limit is 30, and the drop probability denominator is 10.
h. Return to system view.
quit
41. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate a traffic behavior with a class in the policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with a behavior.
c. Return to system view.
quit
42. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Setting the maximum available interface bandwidth
Restrictions and guidelines
· The maximum available interface bandwidth refers to the maximum interface bandwidth used for bandwidth check when CBQ enqueues packets. It is not the actual bandwidth of the physical interface.
· As a best practice, set the maximum available interface bandwidth to be smaller than the actual available bandwidth of the physical interface or logical link.
· On subinterfaces, you must configure the bandwidth command to provide base bandwidth for CBQ calculation.
¡ If no maximum available bandwidth is set for an interface, the following bandwidth is used for CBQ calculation:
¡ The actual baud rate or rate if the interface is a physical one.
¡ 0 kbps if the interface is a virtual interface, for example, tunnel interface, Layer 3 aggregate interface, or HDLC link bundle interface.
Procedure
43. Enter system view.
system-view
44. Enter interface view.
interface interface-type interface-number
45. Set the maximum available bandwidth of the interface.
bandwidth bandwidth-value
For more information about this command, see Interface Command Reference.
Setting the maximum reserved bandwidth as a percentage of available bandwidth for an interface
46. Enter system view.
system-view
47. Enter interface view.
interface interface-type interface-number
48. Set the maximum reserved bandwidth as a percentage of available bandwidth.
qos reserved-bandwidth pct percent
The default setting is 80.
Typically, the maximum reserved bandwidth should not be greater than 80% of available bandwidth. As a best practice, use the default setting.
Example: Configuring CBQ
Network configuration
As shown in Figure 19, configure a QoS policy on Device A to meet the following requirements:
· Traffic from Device C is classified into three classes based on DSCP values. Perform AF for traffic with DSCP values of AF11 and AF21, and set a minimum guaranteed bandwidth percentage of 5% for the traffic.
· Perform EF for traffic with a DSCP value of EF and set the maximum bandwidth percentage for the traffic to 30%.
Before configuring the QoS policy, make sure the following requirements are met:
· The route from Device C to Device D through Device A and Device B is reachable.
· The DSCP fields have been set for the traffic before the traffic enters Device A.
Procedure
# Define three classes to match the IP packets with the DSCP values AF11, AF21, and EF, respectively.
<DeviceA> system-view
[DeviceA] traffic classifier af11_class
[DeviceA-classifier-af11_class] if-match dscp af11
[DeviceA-classifier-af11_class] quit
[DeviceA]traffic classifier af21_class
[DeviceA-classifier-af21_class] if-match dscp af21
[DeviceA-classifier-af21_class] quit
[DeviceA] traffic classifier ef_class
[DeviceA-classifier-ef_class] if-match dscp ef
[DeviceA-classifier-ef_class] quit
# Define two traffic behaviors, and enable AF and set a minimum guaranteed bandwidth percentage of 5% in each traffic behavior.
[DeviceA] traffic behavior af11_behav
[DeviceA-behavior-af11_behav] queue af bandwidth pct 5
[DeviceA-behavior-af11_behav] quit
[DeviceA] traffic behavior af21_behav
[DeviceA-behavior-af21_behav] queue af bandwidth pct 5
[DeviceA-behavior-af21_behav] quit
# Define a traffic behavior, and enable EF and set a maximum bandwidth percentage of 30% in the traffic behavior. Both bandwidth and delay are guaranteed for EF traffic.
[DeviceA] traffic behavior ef_behav
[DeviceA-behavior-ef_behav] queue ef bandwidth pct 30
[DeviceA-behavior-ef_behav] quit
# Define a QoS policy and associate the configured traffic behaviors with classes in the QoS policy.
[DeviceA] qos policy dscp
[DeviceA-qospolicy-dscp] classifier af11_class behavior af11_behav
[DeviceA-qospolicy-dscp] classifier af21_class behavior af21_behav
[DeviceA-qospolicy-dscp] classifier ef_class behavior ef_behav
[DeviceA-qospolicy-dscp] quit
# Apply the QoS policy to the outgoing traffic of GigabitEthernet 0/0/1.
[DeviceA] interface gigabitethernet 0/0/1
[DeviceA-GigabitEthernet0/0/1] ip address 1.1.1.1 255.255.255.0
[DeviceA-GigabitEthernet0/0/1] qos apply policy dscp outbound
The configuration enables EF traffic to be forwarded preferentially when congestion occurs.
Configuring QoS tokens
About this task
This feature is a lower-layer flow control mechanism that controls the length of the lower-layer queue on an interface. The length of the lower-layer queue determines the dequeuing delay of packets.
A packet arrives at the lower-layer queue of an interface before it is sent out of the interface. Packets are sent out of an interface in the order that they arrive at the low-layer queue. When a packet arrives at the low-layer queue of an interface, the packet is assigned a token. After the packet is sent out of the interface, the token is reclaimed for reassignment.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Set the number of QoS tokens.
qos qmtoken token-number
By default, the number of QoS tokens is not set.
Configuring RTPQ
Restrictions and guidelines
· RTPQ and CBQ are mutually exclusive.
· You must configure the rate limit for the RTPQ feature to take effect on the following interfaces:
¡ Tunnel interfaces.
¡ Subinterfaces.
¡ Layer 3 aggregate interfaces.
¡ HDLC link bundle interfaces.
¡ VT and dialer interfaces configured with PPPoE.
For information about the rate limit function, see "Configuring the rate limit."
Configuring RTPQ on an interface
4. Enter system view.
system-view
5. Enter interface view.
interface interface-type interface-number
6. Configure RTPQ.
qos rtpq start-port first-rtp-port-number end-port last-rtp-port-number bandwidth bandwidth [ cbs cbs ]
By default, RTPQ is not configured.
Verifying and maintaining congestion management
Verifying non-MQC congestion management configuration and running status
Perform display tasks in any view.
· Display the configuration of CQ lists.
display qos cql [ cql-index ]
· Display the configuration of PQ lists.
display qos pql [ pql-index]
· Display queuing configuration and statistics for interfaces.
display qos queue interface [ interface-type interface-number ]
· Display the CQ configuration and statistics for interfaces.
display qos queue cq interface [ interface-type interface-number ]
· Display the FIFO configuration and statistics for interfaces or PWs.
display qos queue fifointerface [ interface-type interface-number ]
· Display the PQ configuration and statistics for interfaces.
display qos queue pq interface [ interface-type interface-number ]
· Display RTPQ configuration for interfaces.
display qos queue rtpq interface [ interface-type interface-number ]
· Display the WFQ configuration and statistics for interfaces or PWs.
display qos queue wfq { interface [ interface-type interface-number ] | l2vpn-pw [ peer ip-address pw-id pw-id ] }
Verifying MQC-based congestion management configuration and running status
Perform display tasks in any view.
· Display class configuration.
display traffic classifier { system-defined | user-defined } [ classifier-name ]
· Display traffic behavior configuration.
display traffic behavior { system-defined | user-defined } [ behavior-name ]
· Display QoS policy configuration.
display qos policy { system-defined | user-defined } [ policy-name [ classifier classifier-name ] ]
· Display information about QoS policies applied to interfaces.
display qos policy interface [ interface-type interface-number ] [ slot slot-number ] [ inbound | outbound ]
· Display the CBQ configuration and statistics for interfaces or PWs.
display qos queue cbq { interface [ interface-type interface-number ] | l2vpn-pw [ peer ip-address pw-id pw-id ] }
Configuring congestion avoidance
About congestion avoidance
Avoiding congestion before it occurs is a proactive approach to improving network performance. As a flow control mechanism, congestion avoidance:
· Actively monitors network resources (such as queues and memory buffers).
· Drops packets when congestion is expected to occur or deteriorate.
When dropping packets from a source end, congestion avoidance cooperates with the flow control mechanism at the source end to regulate the network traffic size. The combination of the local packet drop policy and the source-end flow control mechanism implements the following functions:
· Maximizes throughput and network use efficiency.
· Minimizes packet loss and delay.
Tail drop
Congestion management techniques drop all packets that are arriving at a full queue. This tail drop mechanism results in global TCP synchronization. If packets from multiple TCP connections are dropped, these TCP connections go into the state of congestion avoidance and slow start to reduce traffic. However, traffic peak occurs later. Consequently, the network traffic jitters all the time.
RED and WRED
You can use Random Early Detection (RED) or Weighted Random Early Detection (WRED) to avoid global TCP synchronization.
Both RED and WRED avoid global TCP synchronization by randomly dropping packets. When the sending rates of some TCP sessions slow down after their packets are dropped, other TCP sessions remain at high sending rates. Link bandwidth is efficiently used, because TCP sessions at high sending rates always exist.
The RED or WRED algorithm sets an upper threshold and lower threshold for each queue, and processes the packets in a queue as follows:
· When the queue size is shorter than the lower threshold, no packet is dropped.
· When the queue size reaches the upper threshold, all subsequent packets are dropped.
· When the queue size is between the lower threshold and the upper threshold, the received packets are dropped at random. The drop probability in a queue increases along with the queue size under the maximum drop probability.
If the current queue size is compared with the upper threshold and lower threshold to determine the drop policy, burst traffic is not fairly treated. To solve this problem, WRED compares the average queue size with the upper threshold and lower threshold to determine the drop probability.
The average queue size reflects the queue size change trend but is not sensitive to burst queue size changes, and burst traffic can be fairly treated.
When WFQ queuing is used, you can set the following parameters for packets with different precedence values to provide differentiated drop policies:
· Exponent for average queue size calculation.
· Upper threshold.
· Lower threshold.
· Drop probability.
When FIFO, PQ, or CQ is used, you can set the following parameters for each queue to provide differentiated drop policies:
· Exponent for average queue size calculation.
· Upper threshold.
· Lower threshold.
· Drop probability.
Relationship between WRED and queuing mechanisms
Figure 20 Relationship between WRED and queuing mechanisms
· A flow with a smaller queue size has a lower packet drop probability.
· A flow with a larger queue size has a higher packet drop probability.
In this way, the benefits of the flow with a smaller queue size are protected.
WRED parameters
Determine the following parameters before configuring WRED:
· Drop precedence—A parameter used for packet drop. The value 0 corresponds to green packets, the value 1 corresponds to yellow packets, and the value 2 corresponds to red packets. Red packets are dropped preferentially.
· Exponent for average queue size calculation—The greater the exponent, the less sensitive the average queue size is to real-time queue size changes. The formula for calculating the average queue size is:
Average queue size = ( previous average queue size x (1 – 2–n) ) + (current queue size x 2–n), where n is the exponent.
· Denominator for drop probability calculation—The greater the denominator, the smaller the calculated drop probability. (Applicable when you configure WRED parameters on an interface.)
· Drop probability—Drop probability in percentage. The greater the value, the higher the drop probability
Configuring WRED parameters on an interface
Restrictions and guidelines
To enable WRED on an interface, you must first enable WFQ on the interface.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable WRED.
qos wred [ dscp | ip-precedence ] enable
By default, tail drop is adopted.
4. (Optional.) Set the WRED exponent for average queue size calculation.
qos wred weighting-constant exponent
The default setting is 9.
5. (Optional.) Set the drop-related parameters for a precedence value.
qos wred { ip-precedence ip-precedence | dscp dscp-value } low-limit low-limit high-limit high-limit discard-probability discard-prob
By default, the lower limit is 10, the upper limit is 30, and the drop probability denominator is 10.
Repeat this command to configure more precedence values.
Example: Configuring WRED on an interface
Network configuration
· Enable IP precedence-based WRED on GigabitEthernet 0/0/1.
· Set the following parameters for packets with IP precedence 3: lower threshold 20, upper threshold 40, and drop probability denominator 15.
· Set the exponent for average queue size calculation to 6.
Procedure
# Enter system view.
<Sysname> system-view
# Enter interface view.
[Sysname] interface gigabitethernet 0/0/1
# Enable IP precedence-based WRED.
[Sysname-GigabitEthernet0/0/1] qos wred ip-precedence enable
# Set the following parameters for packets with IP precedence value 3: lower threshold 20, upper threshold 40, and drop probability 1/15.
[Sysname-GigabitEthernet0/0/1] qos wred ip-precedence 3 low-limit 20 high-limit 40 discard-probability 15
# Set the exponent for average queue size calculation to 6.
[Sysname-GigabitEthernet0/0/1] qos wred weighting-constant 6
Verifying and maintaining WRED
Perform display tasks in any view.
· Display WRED configuration and statistics for an interface.
display qos wred interface [ interface-type interface-number]
Configuring traffic filtering
About traffic filtering
You can filter in or filter out traffic of a class by associating the class with a traffic filtering action. For example, you can filter packets sourced from an IP address according to network status.
Restrictions and guidelines: Traffic filtering configuration
The device supports the following application destinations for traffic filtering:
· Interface.
· Globally.
· Control plane.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about configuring match criteria, see ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure the traffic filtering action.
filter { deny | permit }
By default, no traffic filtering action is configured.
If a traffic behavior has the filter deny action, all other actions in the traffic behavior except class-based accounting do not take effect.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate the traffic class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a traffic class is not associated with a traffic behavior.
c. Return to system view.
quit
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Verifying and maintaining traffic filtering
To verify traffic filtering configuration, execute the following command in any view:
display traffic behavior user-defined [ behavior-name ]
Traffic filtering configuration examples
Example: Configuring traffic filtering
Network configuration
As shown in Figure 21, configure traffic filtering on GigabitEthernet 0/0/1 to deny the incoming packets with destination port number 21.
Procedure
# Create advanced ACL 3000, and configure a rule to match packets with destination port number 21.
<Device> system-view
[Device] acl advanced 3000
[Device-acl-ipv4-adv-3000] rule 0 permit tcp destination-port eq 21
[Device-acl-ipv4-adv-3000] quit
# Create a traffic class named classifier_1, and use ACL 3000 as the match criterion in the traffic class.
[Device] traffic classifier classifier_1
[Device-classifier-classifier_1] if-match acl 3000
[Device-classifier-classifier_1] quit
# Create a traffic behavior named behavior_1, and configure the traffic filtering action to drop packets.
[Device] traffic behavior behavior_1
[Device-behavior-behavior_1] filter deny
[Device-behavior-behavior_1] quit
# Create a QoS policy named policy, and associate traffic class classifier_1 with traffic behavior behavior_1 in the QoS policy.
[Device] qos policy policy
[Device-qospolicy-policy] classifier classifier_1 behavior behavior_1
[Device-qospolicy-policy] quit
# Apply QoS policy policy to the incoming traffic of GigabitEthernet 0/0/1.
[Device] interface gigabitethernet 0/0/1
[Device-GigabitEthernet0/0/1] qos apply policy policy inbound
Configuring protocol packet rate limiting
About protocol packet rate limiting
The protocol packet processing rate of a CPU is limited. When a large number of protocol packets are sent to the CPU, the CPU might be occupied by the protocol packets and cannot process other tasks. The protocol packet rate limiting feature limits the rate of protocol packets sent to the CPU, and it guarantees the normal operation of the CPU.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criteria are configured.
For more information, see the if-match command in ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure protocol packet rate limiting.
packet-rate value
By default, protocol packet rate limiting is not configured.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate the class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a class is not associated with any behavior.
c. Return to system view.
quit
5. Apply the QoS policy to a control plane.
For more information, see "Applying the QoS policy to a control plane"
By default, no QoS policy is applied to a control plane.
6. (Optional.) Display the protocol packet rate limiting configuration.
display traffic behavior user-defined [ behavior-name ]
This command is available in any view.
Protocol packet rate limiting configuration examples
Example: Configuring protocol packet rate limiting
Network configuration
As shown in Figure 22, limit the rate of DHCP protocol packets sent to the CPU of the device to 500 pps.
Procedure
# Create a traffic class named classifier_1 and configure the class to match DHCP protocol packets.
<Device> system-view
[Device] traffic classifier classifier_1
[Device-classifier-classifier_1] if-match control-plane protocol dhcp
[Device-classifier-classifier_1] quit
# Create a traffic behavior named behavior_1 and configure the behavior to limit the packet rate to 500 pps.
[Device] traffic behavior behavior_1
[Device-behavior-behavior_1] packet-rate 500
[Device-behavior-behavior_1] quit
# Create a QoS policy named and associate class classifier_1 with behavior behavior_1 in the policy.
[Device] qos policy policy
[Device-qospolicy-policy] classifier classifier_1 behavior behavior_1
[Device-qospolicy-policy] quit
# Apply QoS policy policy to the control plane.
[Device] control-plane slot 1
[Device-cp] qos apply policy policy inbound
Configuring priority marking
About priority marking
Priority marking sets the priority fields or flag bits of packets to modify the priority of packets. For example, you can use priority marking to set IP precedence or DSCP for a class of IP packets to control the forwarding of these packets.
1. Configure a traffic behavior with a priority marking action.
2. Associate the traffic class with the traffic behavior.
Priority marking can be used together with priority mapping. For more information, see "Configuring priority mapping." You can configure priority marking by using the MQC approach or by configuring global priority marking.
Configuring priority marking by using the MQC approach
Restrictions and guidelines
The device supports the following application destinations for priority marking:
· Interface.
· Globally.
· Control plane.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured.
For more information about the if-match command, see ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure a priority marking action.
For configurable priority marking actions, see the remark commands in ACL and QoS Command Reference.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy [ remarking ] policy-name
b. Associate the traffic class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a traffic class is not associated with a traffic behavior.
c. Return to system view.
quit
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Verifying and maintaining priority marking
To verify priority marking configuration, execute the following command in any view:
display traffic behavior user-defined [ behavior-name ]
Configuring global priority marking
About this task
This feature enables the device to mark a new priority value for incoming packets that meet a specific match criterion. If an incoming packet meets multiple match criteria, the packet is marked according to the global priority marking configuration for the highest-priority match criterion. The following match criteria are in descending order of priority:
1. TCP/UDP port number.
2. IP address.
3. Layer 3 protocol.
4. VLAN ID.
Procedure
1. Enter system view.
system-view
2. Configure global priority marking.
¡ Configure global priority marking based on the TCP or UDP port.
qos remark { tcp-port | udp-port } [ ipv4 | ipv6 ] start-value [ to end-value ] { dot1p dot1p-value | dscp dscp-value }
By default, global priority marking is not configured.
¡ Configure global priority marking based on the IP address.
qos remark ip-address { ipv4-address [ mask-length | mask ] | ipv6-address [ prefix-length ] } { dot1p dot1p-value | dscp dscp-value }
By default, global priority marking is not configured.
¡ Configure global priority marking based on the Layer 3 protocol.
qos remark protocol protocol-name dot1p dot1p-value
By default, global priority marking is not configured.
¡ Configure global priority marking based on the VLAN ID.
qos remark vlan start-vlan-id [ to end-vlan-id ] { dot1p dot1p-value | dscp dscp-value }
By default, global priority marking is not configured.
Verifying and maintaining global priority marking
Perform display tasks in any view.
· Display the global priority marking configuration based on TCP or UDP port numbers.
display qos remark { tcp-port | udp-port }
· Display the global priority marking configuration based on IP addresses.
display qos remark ip-address
· Display the global priority marking configuration based on Layer 3 protocols.
display qos remark protocol
· Display the global priority marking configuration based on VLAN IDs.
display qos remark vlan
Priority marking configuration examples
Example: Configuring priority marking
Network configuration
As shown in Figure 23, configure priority marking on the device to meet the following requirements:
Traffic source |
Destination |
Processing priority |
Host A, B |
Data server |
High |
Host A, B |
Mail server |
Medium |
Host A, B |
File server |
Low |
Procedure
# Create advanced ACL 3000, and configure a rule to match packets with destination IP address 192.168.0.1.
<Device> system-view
[Device] acl advanced 3000
[Device-acl-ipv4-adv-3000] rule permit ip destination 192.168.0.1 0
[Device-acl-ipv4-adv-3000] quit
# Create advanced ACL 3001, and configure a rule to match packets with destination IP address 192.168.0.2.
[Device] acl advanced 3001
[Device-acl-ipv4-adv-3001] rule permit ip destination 192.168.0.2 0
[Device-acl-ipv4-adv-3001] quit
# Create advanced ACL 3002, and configure a rule to match packets with destination IP address 192.168.0.3.
[Device] acl advanced 3002
[Device-acl-ipv4-adv-3002] rule permit ip destination 192.168.0.3 0
[Device-acl-ipv4-adv-3002] quit
# Create a traffic class named classifier_dbserver, and use ACL 3000 as the match criterion in the traffic class.
[Device] traffic classifier classifier_dbserver
[Device-classifier-classifier_dbserver] if-match acl 3000
[Device-classifier-classifier_dbserver] quit
# Create a traffic class named classifier_mserver, and use ACL 3001 as the match criterion in the traffic class.
[Device] traffic classifier classifier_mserver
[Device-classifier-classifier_mserver] if-match acl 3001
[Device-classifier-classifier_mserver] quit
# Create a traffic class named classifier_fserver, and use ACL 3002 as the match criterion in the traffic class.
[Device] traffic classifier classifier_fserver
[Device-classifier-classifier_fserver] if-match acl 3002
[Device-classifier-classifier_fserver] quit
# Create a traffic behavior named behavior_dbserver, and configure the action of setting the local precedence value to 4.
[Device] traffic behavior behavior_dbserver
[Device-behavior-behavior_dbserver] remark local-precedence 4
[Device-behavior-behavior_dbserver] quit
# Create a traffic behavior named behavior_mserver, and configure the action of setting the local precedence value to 3.
[Device] traffic behavior behavior_mserver
[Device-behavior-behavior_mserver] remark local-precedence 3
[Device-behavior-behavior_mserver] quit
# Create a traffic behavior named behavior_fserver, and configure the action of setting the local precedence value to 2.
[Device] traffic behavior behavior_fserver
[Device-behavior-behavior_fserver] remark local-precedence 2
[Device-behavior-behavior_fserver] quit
# Create a QoS policy named policy_server, and associate traffic classes with traffic behaviors in the QoS policy.
[Device] qos policy policy_server
[Device-qospolicy-policy_server] classifier classifier_dbserver behavior behavior_dbserver
[Device-qospolicy-policy_server] classifier classifier_mserver behavior behavior_mserver
[Device-qospolicy-policy_server] classifier classifier_fserver behavior behavior_fserver
[Device-qospolicy-policy_server] quit
# Apply QoS policy policy_server to the incoming traffic of GigabitEthernet 0/0/1.
[Device] interface gigabitethernet 0/0/1
[Device-GigabitEthernet0/0/1] qos apply policy policy_server inbound
[Device-GigabitEthernet0/0/1] quit
Configuring traffic redirecting
About traffic redirecting
Traffic redirecting redirects packets matching the specified match criteria to a location for processing.
You can redirect packets to the following destinations:
· Interface.
· SR-MPLS TE policy or SRv6 TE policy.
The redirected packets will be forwarded through the SR-MPLS TE policy or SRv6 TE policy. For more information about SRv6 TE policies, see Segment Routing Configuration Guide.
The device does not support redirecting packets to an SR-MPLS TE policy in the current software version.
Restrictions and guidelines: Traffic redirecting configuration
· The device supports the following application destinations for traffic redirecting:
· Interface.
· Globally.
· Control plane.
· If you execute the redirect command multiple times, the most recent configuration takes effect.
· For traffic redirecting to an Ethernet interface, the switch does not display the redirecting action after the interface module or interface expansion card that hosts the interface is removed. After the interface module or interface expansion card is reinserted, the switch can display the redirecting action.
Procedure
1. Enter system view.
system-view
2. Define a traffic class.
a. Create a traffic class and enter traffic class view.
traffic classifier classifier-name [ operator { and | or } ]
b. Configure a match criterion.
if-match [ not ] match-criteria
By default, no match criterion is configured for a traffic class.
For more information about the match criteria, see the if-match command in ACL and QoS Command Reference.
c. Return to system view.
quit
3. Define a traffic behavior.
a. Create a traffic behavior and enter traffic behavior view.
traffic behavior behavior-name
b. Configure a traffic redirecting action.
redirect { cpu | interface interface-type interface-number [ track-oap ] [ vlan vlan-id ] | next-hop { ipv4-add1 [ track track-entry-number ] [ ipv4-add2 [ track track-entry-number ] ] | ipv6-add1 [ track track-entry-number ] [ ipv6-add2 [ track track-entry-number ] ] } | vsi vsi-name | slot slot-number }
redirect { sr-policy endpoint color | srv6-policy endpoint color [ { sid | vpnsid } sid ] }
By default, no traffic redirecting action is configured for a traffic behavior.
c. Return to system view.
quit
4. Define a QoS policy.
a. Create a QoS policy and enter QoS policy view.
qos policy policy-name
b. Associate the traffic class with the traffic behavior in the QoS policy.
classifier classifier-name behavior behavior-name
By default, a traffic class is not associated with a traffic behavior.
c. Return to system view.
quit
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Verifying and maintaining traffic redirecting
To verify traffic redirecting configuration, execute the following command in any view:
display traffic behavior user-defined [ behavior-name ]
Traffic redirecting configuration examples
Example: Configuring traffic redirecting
Network configuration
As shown in Figure 24:
· Device A is connected to Device B through two links. Device A and Device B are each connected to other devices.
· GigabitEthernet 0/0/2 of Device A and GigabitEthernet 0/0/2 of Device B belong to VLAN 200.
· GigabitEthernet 0/0/3 of Device A and GigabitEthernet 0/0/3 of Device B belong to VLAN 201.
· On Device A, the IP address of VLAN-interface 200 is 200.1.1.1/24, and that of VLAN-interface 201 is 201.1.1.1/24.
· On Device B, the IP address of VLAN-interface 200 is 200.1.1.2/24, and that of VLAN-interface 201 is 201.1.1.2/24.
Configure the actions of redirecting traffic to an interface to meet the following requirements:
· Packets with source IP address 2.1.1.1 received on GigabitEthernet 0/0/1 of Device A are forwarded to GigabitEthernet 0/0/2.
· Packets with source IP address 2.1.1.2 received on GigabitEthernet 0/0/1 of Device A are forwarded to GigabitEthernet 0/0/3.
· Other packets received on GigabitEthernet 0/0/1 of Device A are forwarded according to the routing table.
Procedure
# Create basic ACL 2000, and configure a rule to match packets with source IP address 2.1.1.1.
<DeviceA> system-view
[DeviceA] acl basic 2000
[DeviceA-acl-ipv4-basic-2000] rule permit source 2.1.1.1 0
[DeviceA-acl-ipv4-basic-2000] quit
# Create basic ACL 2001, and configure a rule to match packets with source IP address 2.1.1.2.
[DeviceA] acl basic 2001
[DeviceA-acl-ipv4-basic-2001] rule permit source 2.1.1.2 0
[DeviceA-acl-ipv4-basic-2001] quit
# Create a traffic class named classifier_1, and use ACL 2000 as the match criterion in the traffic class.
[DeviceA] traffic classifier classifier_1
[DeviceA-classifier-classifier_1] if-match acl 2000
[DeviceA-classifier-classifier_1] quit
# Create a traffic class named classifier_2, and use ACL 2001 as the match criterion in the traffic class.
[DeviceA] traffic classifier classifier_2
[DeviceA-classifier-classifier_2] if-match acl 2001
[DeviceA-classifier-classifier_2] quit
# Create a traffic behavior named behavior_1, and configure the action of redirecting traffic to GigabitEthernet 0/0/2.
[DeviceA] traffic behavior behavior_1
[DeviceA-behavior-behavior_1] redirect interface gigabitethernet 0/0/2
[DeviceA-behavior-behavior_1] quit
# Create a traffic behavior named behavior_2, and configure the action of redirecting traffic to GigabitEthernet 0/0/3.
[DeviceA] traffic behavior behavior_2
[DeviceA-behavior-behavior_2] redirect interface gigabitethernet 0/0/3
[DeviceA-behavior-behavior_2] quit
# Create a QoS policy named policy.
[DeviceA] qos policy policy
# Associate traffic class classifier_1 with traffic behavior behavior_1 in the QoS policy.
[DeviceA-qospolicy-policy] classifier classifier_1 behavior behavior_1
# Associate traffic class classifier_2 with traffic behavior behavior_2 in the QoS policy.
[DeviceA-qospolicy-policy] classifier classifier_2 behavior behavior_2
[DeviceA-qospolicy-policy] quit
# Apply QoS policy policy to the incoming traffic of GigabitEthernet 0/0/1.
[DeviceA] interface gigabitethernet 0/0/1
[DeviceA-GigabitEthernet0/0/1] qos apply policy policy inbound
Configuring QPPB
About QPPB
The QoS Policy Propagation Through the Border Gateway Protocol (QPPB) feature enables you to classify IP packets based on the following attributes:
· BGP community lists.
· Prefix lists.
· BGP AS paths.
Application scenarios
QPPB minimizes the QoS policy configuration and management efforts on the BGP route receiver when the network topology changes. It is suitable for a large-scaled complex network.
The QPPB feature is implemented as follows:
· The BGP route sender preclassifies routes before advertising them.
· The BGP route receiver performs the following operations:
¡ Sets the IP precedence and local QoS ID for the routes.
¡ Takes appropriate QoS actions on the packets that match the routes.
QPPB is used in the following scenarios:
· Traffic classification based on source or destination IP addresses.
· Traffic classification based on IBGP and EBGP within an autonomous system or across multiple autonomous systems.
QPPB fundamentals
QPPB works on the BGP receiver by applying a QoS policy to BGP routes with the same IP precedence or local QoS ID. It depends on the BGP route sender to preclassify routes.
The BGP route sender uses a routing policy to set route attributes for BGP routes before advertising them.
The BGP receiver performs the following operations:
· Uses a routing policy to match routes based on these route attributes.
· Sets the IP precedence and local QoS ID for the matching routes.
The BGP receiver performs the following operations:
1. Compares the routes with the incoming route policy based on their BGP AS path, prefix, or community attributes.
2. Applies the IP precedence and local QoS ID to the matching routes.
3. Adds the BGP routes and their associated IP precedence and local QoS ID to the routing table.
4. Applies the IP precedence and local QoS ID to the packets sourced from or destined to the IP address in the route.
5. Takes QoS actions on the packets according to the QoS priority settings.
QPPB tasks at a glance
To configure QPPB, perform the following tasks:
1. Configuring the route sender
a. Configuring basic BGP functions
b. (Optional.) Creating a routing policy
2. Configuring the route receiver
a. Configuring basic BGP functions
b. Configuring a routing policy
c. Enabling QPPB on the route receiving interface
Configuring the route sender
Configure the BGP route sender to set route attributes for routes before advertising them.
Configuring basic BGP functions
For more information, see Layer 3—IP Routing Configuration Guide.
Creating a routing policy
Configuring the route receiver
Configuring basic BGP functions
For more information, see Layer 3—IP Routing Configuration Guide.
Configuring a routing policy
Configure a routing policy to perform the following operations:
· Match the route attributes set by the route sender.
· Set the IP precedence or local QoS ID for the matching routes.
For more information, see Layer 3—IP Routing Configuration Guide.
Enabling QPPB on the route receiving interface
Restrictions and guidelines
For QPPB to work correctly, you must configure the QoS policy as follows:
· Use the IP precedence or local QoS ID set in the routing policy to match packets.
· Specify the mode qppb-manipulation keyword when associating a traffic behavior with a traffic class.
For more information about QoS policies, see "Configuring a QoS policy."
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable QPPB on the interface.
On 8048 routers:
bgp-policy { destination | source } { ip-prec-map | ip-qos-map } *
On CR16000 routers:
bgp-policy { destination | source } ip-prec-map ip-qos-map
By default, QPPB is disabled.
This command applies only to incoming traffic.
4. Apply a QoS policy to the interface.
qos apply policy policy-name { inbound | outbound }
By default, no QoS policy is applied to an interface.
QPPB configuration examples
Example: Configuring QPPB in an IPv4 network
Network configuration
As shown in Figure 25, all devices run BGP.
Configure QPPB so that Device B can perform the following operations:
· Receive routes.
· Set IP precedence values and local QoS IDs according to the routing policy.
· Use the QoS policy to limit the traffic rate to 512000 kbps.
Procedure
1. Configure IP addresses for each interface. (Details not shown.)
2. Configure a BGP connection to Device B, and add the network 1.1.1.0/8 to the BGP routing table on Device A.
<DeviceA> system-view
[DeviceA] bgp 1000
[DeviceA-bgp] peer 168.1.1.2 as-number 2000
[DeviceA-bgp] peer 168.1.1.2 connect-interface gigabitethernet 0/0/2
[DeviceA-bgp] address-family ipv4
[DeviceA-bgp-ipv4] import-route direct
[DeviceA-bgp-ipv4] peer 168.1.1.2 enable
[DeviceA-bgp-ipv4] quit
[DeviceA-bgp] quit
3. Configure Device B:
# Configure a BGP connection to Device A.
<DeviceB> system-view
[DeviceB] bgp 2000
[DeviceB-bgp] peer 168.1.1.1 as-number 1000
[DeviceB-bgp] peer 168.1.1.1 connect-interface gigabitethernet 0/0/2
[DeviceB-bgp] address-family ipv4
[DeviceB-bgp-ipv4] peer 168.1.1.1 enable
[DeviceB-bgp-ipv4] peer 168.1.1.1 route-policy qppb import
[DeviceB-bgp-ipv4] quit
[DeviceB-bgp] quit
# Configure the routing policy qppb.
[DeviceB] route-policy qppb permit node 0
[DeviceB-route-policy-qppb-0] apply ip-precedence 1
[DeviceB-route-policy-qppb-0] apply qos-local-id 3
[DeviceB-route-policy-qppb-0] quit
# Enable QPPB on GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] bgp-policy source ip-prec-map ip-qos-map
[DeviceB-GigabitEthernet0/0/2] quit
# Configure a QoS policy.
[DeviceB] traffic classifier qppb
[DeviceB-classifier-qppb] if-match ip-precedence 1
[DeviceB-classifier-qppb] if-match qos-local-id 3
[DeviceB-classifier-qppb] quit
[DeviceB] traffic behavior qppb
[DeviceB-behavior-qppb] car cir 512000 green pass red discard
[DeviceB-behavior-qppb] quit
[DeviceB] qos policy qppb
[DeviceB-qospolicy-qppb] classifier qppb behavior qppb mode qppb-manipulation
[DeviceB-qospolicy-qppb] quit
# Apply the QoS policy to incoming traffic on GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] qos apply policy qppb inbound
[DeviceB-GigabitEthernet0/0/2] quit
Verifying the configuration
# Verify that the related route on Device B takes effect.
[DeviceB] display bgp routing-table ipv4 1.1.1.0
BGP local router ID: 168.1.1.2
Local AS number: 2000
Paths: 1 available, 1 best
BGP routing table information of 168.1.1.0/24:
From : 168.1.1.1 (168.1.1.1)
Rely nexthop : 168.1.1.1
Original nexthop: 168.1.1.1
Out interface : GigabitEthernet0/0/2
Route age : 00h30m12s
OutLabel : NULL
RxPathID : 0x0
TxPathID : 0x0
AS-path : 1000
Origin : incomplete
Attribute value : MED 0, pref-val 0
State : valid, external, best
IP precedence : 1
QoS local ID : 3
Traffic index : N/A
Tunnel policy : NULL
Rely tunnel IDs : N/A
# Display the configuration and statistics for the QoS policy applied to GigabitEthernet 0/0/2 of Device B.
[DeviceB] display qos policy interface gigabitethernet 0/0/2
Interface: GigabitEthernet0/0/2
Direction: Inbound
Policy: qppb
Classifier: default-class
Mode: qppb-manipulation
Matched : 51 (Packets) 4022 (Bytes)
5-minute statistics:
Forwarded: 0/28 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match any
Behavior: be
-none-
Classifier: qppb
Mode: qppb-manipulation
Matched : 0 (Packets) 0 (Bytes)
5-minute statistics:
Forwarded: 0/0 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match ip-precedence 1
If-match qos-local-id 3
Behavior: qppb
Committed Access Rate:
CIR 512000 (kbps), CBS 32000000 (Bytes), EBS 0 (Bytes)
Green action : pass
Yellow action : pass
Red action : discard
Green packets : 0 (Packets) 0 (Bytes)
Yellow packets: 0 (Packets) 0 (Bytes)
Red packets : 0 (Packets) 0 (Bytes)
Example: Configuring QPPB in an MPLS L3VPN
Network configuration
As shown in Figure 26, all devices run BGP.
Configure QPPB so that Device C can perform the following operations:
· Receive routes.
· Set the QPPB local QoS IDs.
· Use the QoS policy to limit the traffic rate to 200000 kbps in each direction.
Table 3 Interfaces and IP address assignment
Device |
Interface |
IP address |
Device |
Interface |
IP address |
Device A |
GE0/0/1 |
192.168.1.2/24 |
Device B |
GE0/0/1 |
167.1.1.2/24 |
GE0/0/2 |
167.1.1.1/24 |
GE0/0/2 |
168.1.1.2/24 |
||
Device C |
GE0/0/1 |
169.1.1.2/24 |
Device D |
GE0/0/2 |
169.1.1.1/24 |
GE0/0/2 |
168.1.1.1/24 |
GE0/0/1 |
192.168.3.2/24 |
Procedure
1. Configure IP addresses for each interface. (Details not shown.)
2. Configure a BGP connection on Device A.
<DeviceA> system-view
[DeviceA] bgp 100
[DeviceA-bgp] peer 167.1.1.2 as-number 200
[DeviceA-bgp] peer 167.1.1.2 connect-interface gigabitethernet 0/0/2
[DeviceA-bgp] address-family ipv4
[DeviceA-bgp-ipv4] import-route direct
[DeviceA-bgp-ipv4] peer 167.1.1.2 enable
[DeviceA-bgp-ipv4] quit
[DeviceA-bgp] quit
3. Configure Device B:
# Configure a VPN instance.
<DeviceB> system-view
[DeviceB] ip vpn-instance vpn1
[DeviceB-vpn-instance-vpn1] route-distinguisher 200:1
[DeviceB-vpn-instance-vpn1] vpn-target 200:1 export-extcommunity
[DeviceB-vpn-instance-vpn1] vpn-target 200:1 import-extcommunity
[DeviceB-vpn-instance-vpn1] quit
# Configure a BGP connection.
[DeviceB] router id 1.1.1.1
[DeviceB] bgp 200
[DeviceB-bgp] peer 2.2.2.2 as-number 200
[DeviceB-bgp] peer 2.2.2.2 connect-interface loopback 0
[DeviceB-bgp] ip vpn-instance vpn1
[DeviceB-bgp-vpn1] peer 167.1.1.1 as-number 100
[DeviceB-bgp-vpn1] address-family ipv4
[DeviceB-bgp-ipv4-vpn1] peer 167.1.1.1 enable
[DeviceB-bgp-ipv4-vpn1] quit
[DeviceB-bgp] address-family vpnv4
[DeviceB-bgp-vpnv4] peer 2.2.2.2 enable
[DeviceB-bgp-vpnv4] quit
[DeviceB-bgp] quit
# Configure MPLS.
[DeviceB] mpls lsr-id 1.1.1.1
[DeviceB] mpls ldp
[DeviceB-mpls-ldp] quit
# Configure OSPF.
[DeviceB] ospf
[DeviceB-ospf-1] area 0
[DeviceB-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[DeviceB-ospf-1-area-0.0.0.0] network 168.1.1.0 0.0.0.255
[DeviceB-ospf-1-area-0.0.0.0] quit
[DeviceB-ospf-1] quit
# Bind GigabitEthernet 0/0/1 to VPN instance vpn1.
[DeviceB] interface gigabitethernet 0/0/1
[DeviceB-GigabitEthernet0/0/1] ip binding vpn-instance vpn1
[DeviceB-GigabitEthernet0/0/1] ip address 167.1.1.2 24
[DeviceB-GigabitEthernet0/0/1] quit
# Enable MPLS on GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] mpls enable
[DeviceB-GigabitEthernet0/0/2] mpls ldp enable
[DeviceB-GigabitEthernet0/0/2] quit
4. Configure Device C:
# Configure a VPN instance.
<DeviceC> system-view
[DeviceC] ip vpn-instance vpn1
[DeviceC-vpn-instance-vpn1] route-distinguisher 200:1
[DeviceC-vpn-instance-vpn1] vpn-target 200:1 export-extcommunity
[DeviceC-vpn-instance-vpn1] vpn-target 200:1 import-extcommunity
[DeviceC-vpn-instance-vpn1] quit
# Configure a BGP connection.
[DeviceC] router id 2.2.2.2
[DeviceC] bgp 200
[DeviceC-bgp] peer 1.1.1.1 as-number 200
[DeviceC-bgp] peer 1.1.1.1 connect-interface loopback 0
[DeviceC-bgp] ip vpn-instance vpn1
[DeviceC-bgp-vpn1] peer 169.1.1.1 as-number 300
[DeviceC-bgp-vpn1] address-family ipv4
[DeviceC-bgp-ipv4-vpn1] peer 169.1.1.1 enable
[DeviceC-bgp-ipv4-vpn1] peer 169.1.1.1 route-policy qppb import
[DeviceC-bgp-ipv4-vpn1] quit
[DeviceC-bgp-vpn1] quit
[DeviceC-bgp] address-family vpnv4
[DeviceC-bgp-vpnv4] peer 1.1.1.1 enable
[DeviceC-bgp-vpnv4] peer 1.1.1.1 route-policy qppb import
[DeviceC-bgp-vpnv4] quit
[DeviceC-bgp] quit
# Configure a routing policy.
[DeviceC] route-policy qppb permit node 0
[DeviceC-route-policy-qppb-0] apply ip-precedence 1
[DeviceC-route-policy-qppb-0] apply qos-local-id 3
[DeviceC-route-policy-qppb-0] quit
# Configure MPLS.
[DeviceC] mpls lsr-id 2.2.2.2
[DeviceC] mpls ldp
[DeviceC-mpls-ldp] quit
# Configure OSPF.
[DeviceC] ospf
[DeviceC-ospf-1] area 0
[DeviceC-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[DeviceC-ospf-1-area-0.0.0.0] network 168.1.1.0 0.0.0.255
[DeviceC-ospf-1-area-0.0.0.0] quit
[DeviceC-ospf-1] quit
# Configure a QoS policy.
[DeviceC] traffic classifier qppb
[DeviceC-classifier-qppb] if-match ip-precedence 1
[DeviceC-classifier-qppb] if-match qos-local-id 3
[DeviceC-classifier-qppb] quit
[DeviceC] traffic behavior qppb
[DeviceC-behavior-qppb] car cir 200000 green pass red discard
[DeviceC-behavior-qppb] quit
[DeviceC] qos policy qppb
[DeviceC-qospolicy-qppb] classifier qppb behavior qppb mode qppb-manipulation
[DeviceC-qospolicy-qppb] quit
# Enable MPLS on GigabitEthernet 0/0/2.
[DeviceC] interface gigabitethernet 0/0/2
[DeviceC-GigabitEthernet0/0/2] mpls enable
[DeviceC-GigabitEthernet0/0/2] mpls ldp enable
# Enable QPPB on GigabitEthernet 0/0/1 and GigabitEthernet 0/0/2.
[DeviceC-GigabitEthernet0/0/2] bgp-policy source ip-prec-map ip-qos-map
[DeviceC-GigabitEthernet0/0/2] quit
[DeviceC] interface gigabitethernet 0/0/1
[DeviceC-GigabitEthernet0/0/1] bgp-policy source ip-prec-map ip-qos-map
[DeviceC-GigabitEthernet0/0/1] quit
# Bind GigabitEthernet 0/0/1 to VPN instance vpn1.
[DeviceC] interface gigabitethernet 0/0/1
[DeviceC-GigabitEthernet0/0/1] ip binding vpn-instance vpn1
[DeviceC-GigabitEthernet0/0/1] ip address 169.1.1.2 24
# Apply QoS policy qppb to the incoming traffic of GigabitEthernet 0/0/1.
[DeviceC-GigabitEthernet0/0/1] qos apply policy qppb inbound
[DeviceC-GigabitEthernet0/0/1] quit
# Apply QoS policy qppb to the incoming traffic of GigabitEthernet 0/0/2.
[DeviceC] interface gigabitethernet 0/0/2
[DeviceC-GigabitEthernet0/0/2] qos apply policy qppb inbound
5. Configure a BGP connection on Device D.
<DeviceD> system-view
[DeviceD] bgp 300
[DeviceD-bgp] peer 169.1.1.2 as-number 200
[DeviceD-bgp] peer 169.1.1.2 connect-interface gigabitethernet 0/0/2
[DeviceD-bgp] address-family ipv4
[DeviceD-bgp-ipv4] peer 169.1.1.2 enable
[DeviceD-bgp-ipv4] import-route direct
[DeviceD-bgp-ipv4] quit
Verifying the configuration
# Verify that the related routes on Device A take effect.
[DeviceA] display ip routing-table
Destinations : 18 Routes : 18
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.0/24 Direct 0 0 167.1.1.1 GE0/0/2
167.1.1.0/32 Direct 0 0 167.1.1.1 GE0/0/2
167.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.255/32 Direct 0 0 167.1.1.1 GE0/0/2
169.1.1.0/24 BGP 255 0 167.1.1.2 GE0/0/2
192.168.1.0/24 Direct 0 0 192.168.1.2 GE0/0/1
192.168.1.0/32 Direct 0 0 192.168.1.2 GE0/0/1
192.168.1.2/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.2 GE0/0/1
192.168.3.0/24 BGP 255 0 167.1.1.2 GE0/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Verify that the related routes on Device B take effect.
[DeviceB] display ip routing-table
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
2.2.2.2/32 OSPF 10 1 168.1.1.1 GE0/0/2
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
168.1.1.0/24 Direct 0 0 168.1.1.2 GE0/0/2
168.1.1.0/32 Direct 0 0 168.1.1.2 GE0/0/2
168.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
168.1.1.255/32 Direct 0 0 168.1.1.2 GE0/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[DeviceB] display ip routing-table vpn-instance vpn1
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.0/24 Direct 0 0 167.1.1.2 GE0/0/1
167.1.1.0/32 Direct 0 0 167.1.1.2 GE0/0/1
167.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.255/32 Direct 0 0 167.1.1.2 GE0/0/1
169.1.1.0/24 BGP 255 0 2.2.2.2 GE0/0/2
192.168.1.0/24 BGP 255 0 167.1.1.1 GE0/0/1
192.168.2.0/24 BGP 255 0 167.1.1.1 GE0/0/1
192.168.3.0/24 BGP 255 0 2.2.2.2 GE0/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Verify that the related routes on Device C take effect.
[DeviceC] display ip routing-table
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.1/32 OSPF 10 1 168.1.1.2 GE0/0/2
2.2.2.2/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
168.1.1.0/24 Direct 0 0 168.1.1.1 GE0/0/2
168.1.1.0/32 Direct 0 0 168.1.1.1 GE0/0/2
168.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
168.1.1.255/32 Direct 0 0 168.1.1.1 GE0/0/2
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
[DeviceC] display ip routing-table vpn-instance vpn1
Destinations : 16 Routes : 16
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.0/24 BGP 255 0 1.1.1.1 GE0/0/2
169.1.1.0/24 Direct 0 0 169.1.1.2 GE0/0/1
169.1.1.0/32 Direct 0 0 169.1.1.2 GE0/0/1
169.1.1.2/32 Direct 0 0 127.0.0.1 InLoop0
169.1.1.255/32 Direct 0 0 169.1.1.2 GE0/0/1
192.168.1.0/24 BGP 255 0 1.1.1.1 GE0/0/2
192.168.2.0/24 BGP 255 0 169.1.1.1 GE0/0/1
192.168.3.0/24 BGP 255 0 169.1.1.1 GE0/0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Verify that the related routes on Device D take effect.
[DeviceD] display ip routing-table
Destinations : 18 Routes : 18
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
167.1.1.0/24 BGP 255 0 169.1.1.2 GE0/0/2
169.1.1.0/24 Direct 0 0 169.1.1.1 GE0/0/2
169.1.1.0/32 Direct 0 0 169.1.1.1 GE0/0/2
169.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0
169.1.1.255/32 Direct 0 0 169.1.1.1 GE0/0/2
192.168.1.0/24 BGP 255 0 169.1.1.2 GE0/0/2
192.168.3.0/24 Direct 0 0 192.168.3.2 GE0/0/1
192.168.3.0/32 Direct 0 0 192.168.3.2 GE0/0/1
192.168.3.2/32 Direct 0 0 127.0.0.1 InLoop0
192.168.3.255/32 Direct 0 0 192.168.3.2 GE0/0/1
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Display the QoS policy configuration in the inbound direction on Device C.
[DeviceC] display qos policy interface inbound
Interface: GigabitEthernet0/0/1
Direction: Inbound
Policy: qppb
Classifier: default-class
Mode: qppb-manipulation
Matched : 312 (Packets) 18916 (Bytes)
5-minute statistics:
Forwarded: 0/24 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match any
Behavior: be
-none-
Classifier: qppb
Mode: qppb-manipulation
Matched : 0 (Packets) 0 (Bytes)
5-minute statistics:
Forwarded: 0/0 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match ip-precedence 1
If-match qos-local-id 3
Behavior: qppb
Committed Access Rate:
CIR 200000 (kbps), CBS 1250000 (Bytes), EBS 0 (Bytes)
Green action : pass
Yellow action : pass
Red action : discard
Green packets : 0 (Packets) 0 (Bytes)
Yellow packets: 0 (Packets) 0 (Bytes)
Red packets : 0 (Packets) 0 (Bytes)
Interface: GigabitEthernet0/0/2
Direction: Inbound
Policy: qppb
Classifier: default-class
Mode: qppb-manipulation
Matched : 311 (Packets) 23243 (Bytes)
5-minute statistics:
Forwarded: 0/24 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match any
Behavior: be
-none-
Classifier: qppb
Mode: qppb-manipulation
Matched : 0 (Packets) 0 (Bytes)
5-minute statistics:
Forwarded: 0/0 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match ip-precedence 1
If-match qos-local-id 3
Behavior: qppb
Committed Access Rate:
CIR 200000 (kbps), CBS 12500480 (Bytes), EBS 0 (Bytes)
Green action : pass
Yellow action : pass
Red action : discard
Green packets : 0 (Packets) 0 (Bytes)
Yellow packets: 0 (Packets) 0 (Bytes)
Red packets : 0 (Packets) 0 (Bytes)
Example: Configuring QPPB in an IPv6 network
Network configuration
As shown in Figure 27, all devices run BGP.
Configure QPPB so that Device B can perform the following operations:
· Receive routes.
· Set the IP precedence value.
· Use the QoS policy to limit the rate of matching traffic to 512000 kbps.
Procedure
1. Configure IPv6 addresses for each interface. (Details not shown.)
2. Configure BGP on Device A.
<DeviceA> system-view
[DeviceA] bgp 1000
[DeviceA] peer 168::2 as-number 2000
[DeviceA] peer 168::2 connect-interface gigabitethernet 0/0/2
[DeviceA-bgp] address-family ipv6
[DeviceA-bgp-ipv6] peer 168::2 enable
[DeviceA-bgp-ipv6] import-route direct
[DeviceA-bgp-ipv6] quit
[DeviceA-bgp] quit
3. Configure Device B:
# Configure BGP.
<DeviceB> system-view
[DeviceB] bgp 2000
[DeviceB] peer 168::1 as-number 1000
[DeviceB] peer 168::1 connect-interface gigabitethernet 0/0/2
[DeviceB-bgp] address-family ipv6
[DeviceB-bgp-ipv6] peer 168::1 enable
[DeviceB-bgp-ipv6] peer 168::1 route-policy qppb import
[DeviceB-bgp-ipv6] quit
[DeviceB-bgp] quit
# Configure a routing policy.
[DeviceB] route-policy qppb permit node 0
[DeviceB-route-policy-qppb-0] apply ip-precedence 4
[DeviceB-route-policy-qppb-0] apply qos-local-id 3
[DeviceB-route-policy-qppb-0] quit
# Enable QPPB on GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] bgp-policy source ip-prec-map ip-qos-map
# Configure a QoS policy.
[DeviceB] traffic classifier qppb
[DeviceB-classifier-qppb] if-match ip-precedence 4
[DeviceB-classifier-qppb] if-match qos-local-id 3
[DeviceB-classifier-qppb] quit
[DeviceB] traffic behavior qppb
[DeviceB-behavior-qppb] car cir 512000 red discard
[DeviceB-behavior-qppb] quit
[DeviceB] qos policy qppb
[DeviceB-qospolicy-qppb] classifier qppb behavior qppb mode qppb-manipulation
[DeviceB-qospolicy-qppb] quit
# Apply the QoS policy to the incoming traffic of GigabitEthernet 0/0/2.
[DeviceB] interface gigabitethernet 0/0/2
[DeviceB-GigabitEthernet0/0/2] qos apply policy qppb inbound
[DeviceB-GigabitEthernet0/0/2] quit
Verifying the configuration
# Verify that the related routes on Device A take effect.
[DeviceA] display bgp routing-table ipv6 2:: 64
BGP local router ID: 0.0.0.0
Local AS number: 1000
Paths: 1 available, 1 best
BGP routing table information of 168::/64:
Imported route.
Original nexthop: ::
Out interface : GigabitEthernet0/0/2
Route age : 00h17m18s
OutLabel : NULL
RxPathID : 0x0
TxPathID : 0x0
AS-path : (null)
Origin : incomplete
Attribute value : MED 0, pref-val 32768
State : valid, local, best
IP precedence : N/A
QoS local ID : N/A
Traffic index : N/A
Tunnel policy : NULL
Rely tunnel IDs : N/A
# Verify that the related routes on Device B take effect.
[DeviceB] display bgp routing-table ipv6 1:: 64
BGP local router ID: 0.0.0.0
Local AS number: 2000
Paths: 1 available, 1 best
BGP routing table information of 168::/64:
Imported route.
Original nexthop: ::
Out interface : GigabitEthernet0/0/2
Route age : 00h05m17s
OutLabel : NULL
RxPathID : 0x0
TxPathID : 0x0
AS-path : (null)
Origin : incomplete
Attribute value : MED 0, pref-val 32768
State : valid, local, best
IP precedence : 4
QoS local ID : 3
Traffic index : N/A
Tunnel policy : NULL
Rely tunnel IDs : N/A
# Display the configuration and statistics for the QoS policy applied to GigabitEthernet 0/0/2 on Device C
[DeviceC] display qos policy interface gigabitethernet 0/0/2
Interface: GigabitEthernet0/0/2
Direction: Inbound
Policy: qppb
Classifier: default-class
Mode: qppb-manipulation
Matched : 0 (Packets) 0 (Bytes)
5-minute statistics:
Forwarded: 0/0 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match any
Behavior: be
-none-
Classifier: qppb
Mode: qppb-manipulation
Matched : 0 (Packets) 0 (Bytes)
5-minute statistics:
Forwarded: 0/0 (pps/bps)
Dropped : 0/0 (pps/bps)
Operator: AND
Rule(s) :
If-match ip-precedence 4
If-match qos-local-id 3
Behavior: qppb
Committed Access Rate:
CIR 512000 (kbps), CBS 32000000 (Bytes), EBS 0 (Bytes)
Green action : pass
Yellow action : pass
Red action : discard
Green packets : 0 (Packets) 0 (Bytes)
Yellow packets: 0 (Packets) 0 (Bytes)
Red packets : 0 (Packets) 0 (Bytes)
Appendixes
Appendix A Acronyms
Table 4 Appendix A Acronyms
Acronym |
Full spelling |
AF |
Assured Forwarding |
BE |
Best Effort |
BQ |
Bandwidth Queuing |
CAR |
Committed Access Rate |
CBS |
Committed Burst Size |
CBQ |
Class Based Queuing |
CE |
Congestion Experienced |
CIR |
Committed Information Rate |
CQ |
Custom Queuing |
DCBX |
Data Center Bridging Exchange Protocol |
DiffServ |
Differentiated Service |
DSCP |
Differentiated Services Code Point |
EBS |
Excess Burst Size |
ECN |
Explicit Congestion Notification |
EF |
Expedited Forwarding |
FIFO |
First in First out |
FQ |
Fair Queuing |
GMB |
Guaranteed Minimum Bandwidth |
GTS |
Generic Traffic Shaping |
IntServ |
Integrated Service |
ISP |
Internet Service Provider |
LLQ |
Low Latency Queuing |
LSP |
Label Switched Path |
MPLS |
Multiprotocol Label Switching |
PE |
Provider Edge |
PIR |
Peak Information Rate |
PQ |
Priority Queuing |
PW |
Pseudowire |
QoS |
Quality of Service |
QPPB |
QoS Policy Propagation Through the Border Gateway Protocol |
RED |
Random Early Detection |
RSVP |
Resource Reservation Protocol |
RTP |
Real-Time Transport Protocol |
SP |
Strict Priority |
ToS |
Type of Service |
VoIP |
Voice over IP |
VPN |
Virtual Private Network |
WFQ |
Weighted Fair Queuing |
WRED |
Weighted Random Early Detection |
WRR |
Weighted Round Robin |
Appendix B Default priority maps
Uncolored priority maps
For the default dot1p-dot1p priority map, an input value yields a target value equal to it.
Table 5 Default dot1p-lp, dot1p-dp, dot1p-dscp, and dot1p-rpr priority maps
Input priority value |
dot1p-lp map |
dot1p-dp map |
dot1p-dscp map |
dot1p-rpr map |
dot1p |
lp |
dp |
dscp |
rpr |
0 |
2 |
0 |
0 |
0 |
1 |
0 |
0 |
8 |
0 |
2 |
1 |
0 |
16 |
1 |
3 |
3 |
0 |
24 |
1 |
4 |
4 |
0 |
32 |
2 |
5 |
5 |
0 |
40 |
2 |
6 |
6 |
0 |
48 |
2 |
7 |
7 |
0 |
56 |
2 |
Table 6 Default dot11e-lp priority map
dot11e |
lp |
0 |
2 |
1 |
0 |
2 |
1 |
3 |
3 |
4 |
4 |
5 |
5 |
6 |
6 |
7 |
7 |
Table 7 Default dscp-lp, dscp-dp, dscp-dot1p, and dscp-exp priority maps
Input priority value |
dscp-lp map |
dscp-dp map |
dscp-dot1p map |
dscp-exp map |
dscp |
lp |
dp |
dot1p |
exp |
0 to 7 |
0 |
0 |
0 |
0 |
8 to 15 |
1 |
0 |
1 |
1 |
16 to 23 |
2 |
0 |
2 |
2 |
24 to 31 |
3 |
0 |
3 |
3 |
32 to 39 |
4 |
0 |
4 |
4 |
40 to 47 |
5 |
0 |
5 |
5 |
48 to 55 |
6 |
0 |
6 |
6 |
56 to 63 |
7 |
0 |
7 |
7 |
Table 8 Default dscp-rpr priority map
DSCP |
RPR precedence |
0 to 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41 to 45, 47, 49 to 63 |
0 |
10, 12, 14, 16, 18, 20, 22, 26, 28, 30 |
1 |
24, 32, 34, 36, 38, 40, 46, 48 |
2 |
Table 9 Default exp-dscp, exp-dp, and exp-rpr priority maps
Input priority value |
exp-dscp map |
exp-dp map |
exp-rpr map |
EXP value |
dscp |
dp |
rpr |
0 |
0 |
0 |
0 |
1 |
8 |
0 |
0 |
2 |
16 |
0 |
1 |
3 |
24 |
0 |
1 |
4 |
32 |
0 |
2 |
5 |
40 |
0 |
2 |
6 |
48 |
0 |
2 |
7 |
56 |
0 |
2 |
Table 10 Default lp-dot1p, lp-dot11e, and lp-dscp priority maps
Input priority value |
lp-dot1p map |
lp-dot11e map |
lp-dscp map |
lp |
dot1p |
dot11e |
DSCP |
0 |
1 |
1 |
0 |
1 |
2 |
2 |
8 |
2 |
0 |
0 |
16 |
3 |
3 |
3 |
24 |
4 |
4 |
4 |
32 |
5 |
5 |
5 |
40 |
6 |
6 |
6 |
48 |
7 |
7 |
7 |
56 |
Table 11 Default ippre-rpr priority maps
IP precedence |
RPR precedence |
0 |
0 |
1 |
0 |
2 |
1 |
3 |
1 |
4 |
2 |
5 |
2 |
6 |
2 |
7 |
2 |
Table 12 Default port priority-local priority map
Port priority |
Local precedence |
0 |
0 |
1 |
1 |
2 |
2 |
3 |
3 |
4 |
4 |
5 |
5 |
6 |
6 |
7 |
7 |
Table 13 Default up-dot1p, up-dscp, up-exp, up-dp, up-lp, up-rpr, and up-fc priority maps
Input priority value |
up-dot1p map |
up-dscp map |
up-exp map |
up-dp map |
up-lp map |
up-rpr map |
up-fc(4)map |
up-fc(8)map |
up |
dot1p |
dscp |
exp |
dp |
lp |
rpr |
fc(4) |
fc(8) |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
8 |
1 |
0 |
1 |
0 |
0 |
1 |
2 |
2 |
16 |
2 |
0 |
2 |
1 |
1 |
2 |
3 |
3 |
24 |
3 |
0 |
3 |
1 |
1 |
3 |
4 |
4 |
32 |
4 |
0 |
4 |
2 |
2 |
4 |
5 |
5 |
40 |
5 |
0 |
5 |
2 |
2 |
5 |
6 |
6 |
48 |
6 |
0 |
6 |
2 |
3 |
6 |
7 |
7 |
56 |
7 |
0 |
7 |
2 |
3 |
7 |
Colored priority maps
An input value yields a target value equal to it for the following default colored priority maps for green/yellow/red packets:
· dot1p-dot1p.
· dot1p-exp.
· dscp-dscp.
· exp-lp.
· exp-dot1p.
· exp-exp.
· lp-lp.
· lp-exp.
· up-dot1p.
· up-up.
Table 14 Default dscp-dot1p, dscp-dp, dscp-exp, and dscp-lp priority maps for green packets
Input priority value |
dscp-dot1p map |
dscp-dp map |
dscp-exp map |
dscp-lp map |
DSCP of green packets |
dot1p |
dp |
exp |
lp |
0 to 7 |
0 |
0 |
0 |
0 |
8 to 15 |
1 |
0 |
1 |
1 |
16 to 23 |
2 |
0 |
2 |
2 |
24 to 31 |
3 |
0 |
3 |
3 |
32 to 39 |
4 |
0 |
4 |
4 |
40 to 47 |
5 |
0 |
5 |
5 |
48 to 55 |
6 |
0 |
6 |
6 |
56 to 63 |
7 |
0 |
7 |
7 |
Table 15 Default dscp-dot1p, dscp-dp, dscp-exp, and dscp-lp priority maps for yellow packets
Input priority value |
dscp-dot1p map |
dscp-dp map |
dscp-exp map |
dscp-lp map |
DSCP of yellow packets |
dot1p |
dp |
exp |
lp |
0 to 7 |
0 |
1 |
0 |
0 |
8 to 15 |
1 |
1 |
1 |
1 |
16 to 23 |
2 |
1 |
2 |
2 |
24 to 31 |
3 |
1 |
3 |
3 |
32 to 39 |
4 |
1 |
4 |
4 |
40 to 47 |
5 |
1 |
5 |
5 |
48 to 55 |
6 |
1 |
6 |
6 |
56 to 63 |
7 |
1 |
7 |
7 |
Table 16 Default dscp-dot1p, dscp-dp, dscp-exp, and dscp-lp priority maps for red packets
Input priority value |
dscp-dot1p map |
dscp-dp map |
dscp-exp map |
dscp-lp map |
DSCP of red packets |
dot1p |
dp |
exp |
lp |
0 to 7 |
0 |
2 |
0 |
0 |
8 to 15 |
1 |
2 |
1 |
1 |
16 to 23 |
2 |
2 |
2 |
2 |
24 to 31 |
3 |
2 |
3 |
3 |
32 to 39 |
4 |
2 |
4 |
4 |
40 to 47 |
5 |
2 |
5 |
5 |
48 to 55 |
6 |
2 |
6 |
6 |
56 to 63 |
7 |
2 |
7 |
7 |
Table 17 Default exp-dp and exp-dscp priority maps for green packets
Input priority value |
exp-dp map |
exp-dscp map |
EXP of green packets |
dp |
DSCP |
0 |
0 |
0 |
1 |
0 |
8 |
2 |
0 |
16 |
3 |
0 |
24 |
4 |
0 |
32 |
5 |
0 |
40 |
6 |
0 |
48 |
7 |
0 |
56 |
Table 18 Default exp-dp and exp-dscp priority maps for yellow packets
Input priority value |
exp-dp map |
exp-dscp map |
EXP of yellow packets |
dp |
DSCP |
0 |
1 |
0 |
1 |
1 |
8 |
2 |
1 |
16 |
3 |
1 |
24 |
4 |
1 |
32 |
5 |
1 |
40 |
6 |
1 |
48 |
7 |
1 |
56 |
Table 19 Default exp-dp and exp-dscp priority maps for red packets
Input priority value |
exp-dp map |
exp-dscp map |
EXP of red packets |
dp |
DSCP |
0 |
2 |
0 |
1 |
2 |
8 |
2 |
2 |
16 |
3 |
2 |
24 |
4 |
2 |
32 |
5 |
2 |
40 |
6 |
2 |
48 |
7 |
2 |
56 |
Table 20 Default lp-dp, lp-dot1p, and lp-dscp priority maps for green packets
Input priority value |
lp-dp map |
lp-dot1p map |
lp-dscp map |
Local precedence of green packets |
dp |
dot1p |
DSCP |
0 |
0 |
1 |
0 |
1 |
0 |
2 |
8 |
2 |
0 |
0 |
16 |
3 |
0 |
3 |
24 |
4 |
0 |
4 |
32 |
5 |
0 |
5 |
40 |
6 |
0 |
6 |
48 |
7 |
0 |
7 |
56 |
Table 21 Default lp-dp, lp-dot1p, and lp-dscp priority maps for yellow packets
Input priority value |
lp-dp map |
lp-dot1p map |
lp-dscp map |
Local precedence of yellow packets |
dp |
dot1p |
dscp |
0 |
1 |
1 |
0 |
1 |
1 |
2 |
8 |
2 |
1 |
0 |
16 |
3 |
1 |
3 |
24 |
4 |
1 |
4 |
32 |
5 |
1 |
5 |
40 |
6 |
1 |
6 |
48 |
7 |
1 |
7 |
56 |
Table 22 Default lp-dp, lp-dot1p, and lp-dscp priority maps for red packets
Input priority value |
lp-dp map |
lp-dot1p map |
lp-dscp map |
Local precedence of red packets |
dp |
dot1p |
dscp |
0 |
2 |
1 |
0 |
1 |
2 |
2 |
8 |
2 |
2 |
0 |
16 |
3 |
2 |
3 |
24 |
4 |
2 |
4 |
32 |
5 |
2 |
5 |
40 |
6 |
2 |
6 |
48 |
7 |
2 |
7 |
56 |
Table 23 Default up-dscp/up-exp/up-lp priority maps for green/yellow/red packets
up of green/yellow/red packets |
dscp |
exp |
lp |
0 |
0 |
0 |
0 |
1 |
8 |
1 |
1 |
2 |
16 |
2 |
2 |
3 |
24 |
3 |
3 |
4 |
32 |
4 |
4 |
5 |
40 |
5 |
5 |
6 |
48 |
6 |
6 |
7 |
56 |
7 |
7 |
Appendix C Introduction to packet precedence
IP precedence and DSCP values
As shown in Figure 28, the ToS field in the IP header contains 8 bits. The first 3 bits (0 to 2) represent IP precedence from 0 to 7. According to RFC 2474, the ToS field is redefined as the differentiated services (DS) field. A DSCP value is represented by the first 6 bits (0 to 5) of the DS field and is in the range 0 to 63. The remaining 2 bits (6 and 7) are reserved.
Table 24 IP precedence
IP precedence (decimal) |
IP precedence (binary) |
Description |
0 |
000 |
Routine |
1 |
001 |
priority |
2 |
010 |
immediate |
3 |
011 |
flash |
4 |
100 |
flash-override |
5 |
101 |
critical |
6 |
110 |
internet |
7 |
111 |
network |
Table 25 DSCP values
DSCP value (decimal) |
DSCP value (binary) |
Description |
46 |
101110 |
ef |
10 |
001010 |
af11 |
12 |
001100 |
af12 |
14 |
001110 |
af13 |
18 |
010010 |
af21 |
20 |
010100 |
af22 |
22 |
010110 |
af23 |
26 |
011010 |
af31 |
28 |
011100 |
af32 |
30 |
011110 |
af33 |
34 |
100010 |
af41 |
36 |
100100 |
af42 |
38 |
100110 |
af43 |
8 |
001000 |
cs1 |
16 |
010000 |
cs2 |
24 |
011000 |
cs3 |
32 |
100000 |
cs4 |
40 |
101000 |
cs5 |
48 |
110000 |
cs6 |
56 |
111000 |
cs7 |
0 |
000000 |
be (default) |
802.1p priority
802.1p priority lies in the Layer 2 header. It applies to occasions where Layer 3 header analysis is not needed and QoS must be assured at Layer 2.
Figure 29 An Ethernet frame with an 802.1Q tag header
As shown in Figure 29, the 4-byte 802.1Q tag header contains the 2-byte tag protocol identifier (TPID) and the 2-byte tag control information (TCI). The value of the TPID is 0x8100. Figure 30 shows the format of the 802.1Q tag header. The Priority field in the 802.1Q tag header is called 802.1p priority, because its use is defined in IEEE 802.1p. Table 26 shows the values for 802.1p priority.
Table 26 Description on 802.1p priority
802.1p priority (decimal) |
802.1p priority (binary) |
Description |
0 |
000 |
best-effort |
1 |
001 |
background |
2 |
010 |
spare |
3 |
011 |
excellent-effort |
4 |
100 |
controlled-load |
5 |
101 |
video |
6 |
110 |
voice |
7 |
111 |
network-management |
802.11e priority
To provide QoS services on WLAN, the 802.11e standard was developed. IEEE 802.11e is a MAC-layer enhancement to IEEE 802.11. IEEE 802.11e adds a 2-byte QoS control field to the 802.11e MAC frame header. The 3-bit QoS control field represents the 802.11e priority in the range of 0 to 7.
Figure 31 802.11e frame structure
EXP values
The EXP field is in MPLS labels for MPLS QoS purposes. As shown in Figure 32, the EXP field is 3-bit long and is in the range of 0 to 7.
Figure 32 MPLS label structure