- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
02-QoS configuration | 800.85 KB |
Contents
QoS processing flow in a device
Restrictions and guidelines for applying a QoS policy
Applying the QoS policy to an Ethernet service instance
Applying the QoS policy to an interface
Applying the QoS policy to VLANs
Applying the QoS policy globally
Applying the QoS policy to a control plane
Applying the QoS policy in control-plane management view
Enabling SNMP notifications for QoS
Display and maintenance commands for QoS policies
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
Display and maintenance 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
Restrictions and guidelines: Traffic policing, GTS, and rate limit configuration
Configuring traffic policing by using the MQC approach
Configuring the rate limit for an interface
Display and maintenance commands for traffic policing, GTS, and rate limit
Configuring congestion management
Cause, negative results, and countermeasure of congestion
Congestion management tasks at a glance
Configuring queuing on an interface
Restrictions and guidelines for queuing configuration
Configuring a queue scheduling profile
About queue scheduling profiles
Restrictions and guidelines for queue scheduling profile configuration
Configuring a queue scheduling profile
Applying a queue scheduling profile
Example: Configuring a queue scheduling profile
Display and maintenance commands for congestion management
Configuring congestion avoidance
Relationship between WRED and queuing mechanisms
Restrictions and guidelines: WRED configuration
Configuring WRED parameters for a queue
Configuring and applying a queue-based WRED table to an interface
Example: Configuring and applying a queue-based WRED table
Display and maintenance commands for WRED
Traffic filtering configuration examples
Example: Configuring traffic filtering
Restrictions and guidelines: Nesting configuration
Nesting configuration examples
Configuring traffic redirecting
Restrictions and guidelines: Traffic redirecting configuration
Traffic redirecting configuration examples
Example: Configuring traffic redirecting
Restrictions and guidelines: Global CAR configuration
Display and maintenance commands for global CAR
Global CAR configuration examples
Example: Configuring MQC aggregate CAR
Configuring class-based accounting
Class-based accounting configuration examples
Example: Configuring class-based accounting
Configuring interface packet accounting
About interface packet accounting
Display and maintenance commands for interface packet accounting
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.
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
¡ Applying the QoS policy to an interface
¡ Applying the QoS policy to VLANs
¡ Applying the QoS policy globally
¡ Applying the QoS policy to a control plane
¡ Applying the QoS policy in control-plane management view
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 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 [ ipv6-matching | { accounting | mirroring | remarking } ] policy policy-name
Parameter |
Description |
ipv6-matching |
Represents an IPv6-matching QoS policy. |
accounting |
Represents an accounting-type QoS policy. |
mirroring |
Represents a mirroring-type QoS policy. |
remarking |
Represents a marking-type QoS policy. |
tcp-erspan |
Represents a TCP ERSPAN-type QoS policy. |
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.
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.
· VLAN—The QoS policy can be applied to the traffic sent or received on all ports in the VLAN.
· 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.
· Management interface control plane—The QoS policy can be applied to the traffic sent from the management interface to the control plane.
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 a traffic behavior is configured with multiple actions and one of these actions does not take effect, the whole class-behavior association does not take effect.
When a QoS policy containing a CAR action is applied on an IRF fabric, the traffic matching the QoS policy might enter the IRF fabric through interfaces on different IRF member devices. In this case, the actual rate limit that takes effect is the sum of the CIR and PIR in the CAR action multiplied by the number of involved IRF member devices by default.
When a QoS policy containing a DSCP marking action is applied to the outbound direction, the local QoS ID match criterion is not supported in the traffic class.
Applying the QoS policy to an Ethernet service instance
Restrictions and guidelines
For configuration commands for Ethernet service instances, see MPLS L2VPN or VPLS in MPLS Command Reference or see VXLAN Command Reference.
A maximum of five QoS policies (one for each type) can be applied to an Ethernet service instance. Different actions can be taken on the same traffic class if QoS policies of different types are applied to an Ethernet service instance. This rule applies to the devices that support the five QoS policy types: IPv6-matching, accounting, marking, mirroring, and generic.
If you specify the longest-match keyword, the system first matches the traffic class with a source or destination address with the longest mask and takes the actions in the associated traffic behavior. Suppose three class-behavior associations are configured in a QoS policy. ACL 3001 in the traffic class of the first class-behavior association is not configured with a source or destination address. ACL 3002 in the traffic class of the second class-behavior association is configured with destination address 10.10.10.0/24. ACL 3003 in the traffic class of the third class-behavior association is configured with destination address 10.10.10.10/32. The match order of the three class-behavior associations is the third class-behavior association, the second class-behavior association, the first class-behavior association. If both source and destination addresses exist in ACLs of different traffic classes, the system matches destination addresses before matching source addresses.
Procedure
1. Enter system view.
system-view
2. Enter Layer 2 Ethernet interface view or Layer 2 aggregate interface view.
¡ Enter Layer 2 Ethernet interface view:
interface interface-type interface-number
¡ Enter Layer 2 aggregate interface view:
interface bridge-aggregation interface-number
3. Create an Ethernet service instance and enter Ethernet service instance view.
service-instance instance-id
4. Apply the QoS policy to the Ethernet service instance.
qos apply [ ipv6-matching | accounting | mirroring | remarking ] policy policy-name { inbound } [ longest-match ]
By default, no QoS policy is applied to an Ethernet service instance.
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.
A maximum of six QoS policies (one for each type) can be applied to one direction of an interface. Different actions can be taken on the same traffic class if QoS policies of different types are applied to an interface. This rule applies to the devices that support the six QoS policy types: IPv6-matching, accounting, marking, mirroring, TCP ERSPAN, and generic.
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, and SSH packets.
If you specify the longest-match keyword, the system first matches the traffic class with a source or destination address with the longest mask and takes the actions in the associated traffic behavior. Suppose three class-behavior associations are configured in a QoS policy. ACL 3001 in the traffic class of the first class-behavior association is not configured with a source or destination address. ACL 3002 in the traffic class of the second class-behavior association is configured with destination address 10.10.10.0/24. ACL 3003 in the traffic class of the third class-behavior association is configured with destination address 10.10.10.10/32. The match order of the three class-behavior associations is the third class-behavior association, the second class-behavior association, the first class-behavior association. If both source and destination addresses exist in ACLs of different traffic classes, the system matches destination addresses before matching source addresses.
When a QoS policy is applied to the inbound direction of an interface, it cannot match the source MAC address or customer VLAN field of VXLAN 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 [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] policy policy-name { inbound | outbound } [ longest-match ]
By default, no QoS policy is applied to an interface.
Applying the QoS policy to VLANs
About this task
You can apply a QoS policy to VLANs to regulate the traffic on all ports of the VLANs.
Restrictions and guidelines
QoS policies cannot be applied to dynamic VLANs, including VLANs created by GVRP.
If you specify the longest-match keyword, the system first matches the traffic class with a source or destination address with the longest mask and takes the actions in the associated traffic behavior. Suppose three class-behavior associations are configured in a QoS policy. ACL 3001 in the traffic class of the first class-behavior association is not configured with a source or destination address. ACL 3002 in the traffic class of the second class-behavior association is configured with destination address 10.10.10.0/24. ACL 3003 in the traffic class of the third class-behavior association is configured with destination address 10.10.10.10/32. The match order of the three class-behavior associations is the third class-behavior association, the second class-behavior association, the first class-behavior association. If both source and destination addresses exist in ACLs of different traffic classes, the system matches destination addresses before matching source addresses.
When you apply a QoS policy to VLANs, the QoS policy is applied to the specified VLANs on all IRF member devices. If the hardware resources of an IRF member device are insufficient, applying a QoS policy to VLANs might fail on the IRF member device. The system does not automatically roll back the QoS policy configuration already applied to other IRF member devices. To ensure consistency, use the undo qos vlan-policy vlan command to manually remove the QoS policy configuration applied to them.
Procedure
1. Enter system view.
system-view
2. Apply the QoS policy to VLANs.
qos vlan-policy policy-name vlan vlan-id-list { inbound | outbound } [ longest-match ]
By default, no QoS policy is applied to a VLAN.
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 you do not specify the longest-match keyword, the system matches traffic against traffic classes in the order class-behavior associations are configured. When the traffic matches a traffic class, the matching process stops, and the actions in the associated traffic behavior are taken on the matching traffic.
If you specify the longest-match keyword, the system first matches the traffic class with a source or destination address with the longest mask and takes the actions in the associated traffic behavior. Suppose three class-behavior associations are configured in a QoS policy. ACL 3001 in the traffic class of the first class-behavior association is not configured with a source or destination address. ACL 3002 in the traffic class of the second class-behavior association is configured with destination address 10.10.10.0/24. ACL 3003 in the traffic class of the third class-behavior association is configured with destination address 10.10.10.10/32. The match order of the three class-behavior associations is the third class-behavior association, the second class-behavior association, the first class-behavior association. If both source and destination addresses exist in ACLs of different traffic classes, the system matches destination addresses before matching source addresses.
If the hardware resources of an IRF member device are insufficient, applying a QoS policy globally might fail on the IRF member device. The system does not automatically roll back the QoS policy configuration already applied to other IRF member devices. 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 [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] policy policy-name global { inbound| outbound } [ longest-match ]
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 [ longest-match ]
By default, no QoS policy is applied to a control plane.
Applying the QoS policy in control-plane management view
About this task
If the rate of packets from the management interface to the control plane exceeds the processing capability, the control plane will fail to handle the packets correctly or timely. As a result, protocol performance is affected.
This feature allows you to rate limit the packets sent from the management interface to the control plane. This ensures that the control plane can correctly receive, transmit, and process packets from the management interface.
By default, a predefined QoS policy is applied in control-plane management view. To display the predefined QoS policy, use the display qos policy control-plane management pre-defined command. The predefined QoS policy uses the protocol type or protocol group type to identify the type of packets sent from the management interface to the control plane. You can use protocol types or protocol group types in if-match commands in traffic class view for traffic classification. Then, you can reconfigure traffic behaviors for these traffic classes as required.
Procedure
1. Enter system view.
system-view
2. Enter control-plane management view.
control-plane management
3. Apply the QoS policy.
qos apply policy policy-name inbound
By default, no QoS policy is applied in control-plane management view.
Enabling SNMP notifications for QoS
Restrictions and guidelines
Perform this task to report critical QoS events by sending SNMP notifications.
For QoS notifications to be sent correctly, you must also configure SNMP on the device. For more information about SNMP configuration, see the network management and monitoring configuration guide for the device.
Procedure
1. Enter system view.
system-view
2. Enable SNMP notifications for QoS.
snmp-agent trap enable qos
By default, SNMP notifications are disabled for QoS.
Display and maintenance commands for QoS policies
Execute display commands in any view and reset commands in user view.
Task |
Command |
Display QoS policy configuration. |
display qos policy user-defined [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] [ policy-name [ classifier classifier-name ] ] [ slot slot-number ] |
Display information about QoS policies applied to the control plane. |
display qos policy control-plane slot slot-number |
Display information about QoS policies applied in control-plane management view. |
display qos policy control-plane management |
Display information about the predefined QoS policy applied in control-plane management view. |
display qos policy control-plane management pre-defined |
Display information about the predefined QoS policy applied to the control plane. |
display qos policy control-plane pre-defined [ slot slot-number ] |
Display information about QoS policies applied globally. |
display qos [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] policy global [ slot slot-number ] [ inbound | outbound ] |
Display information about QoS policies applied to interfaces. |
display qos [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] policy interface [ interface-type interface-number ] [ inbound | outbound ] |
Display diagnostic information about QoS policies applied to Ethernet service instances. |
display qos [ ipv6-matching | accounting | mirroring | remarking ] policy l2vpn-ac [ interface interface-type interface-number [ service-instance instance-id ] [ slot slot-number ] ] [ inbound ] |
Display information about QoS policies applied to VLANs. |
display qos vlan-policy { name policy-name | vlan [ vlan-id ] } [ slot slot-number ] [ inbound | outbound ] |
Display QoS and ACL resource usage. |
display qos-acl resource [ slot slot-number ] |
Display traffic behavior configuration. |
display traffic behavior user-defined [ behavior-name ] [ slot slot-number ] |
Display traffic class configuration. |
display traffic classifier user-defined [ classifier-name ] [ slot slot-number ] |
Clear the statistics for a QoS policy applied globally. |
reset qos [ ipv6-matching | accounting | mirroring | remarking | tcp-erspan ] policy global [ inbound | outbound ] |
Clear the statistics for the QoS policy applied to the control plane. |
reset qos policy control-plane slot slot-number |
Clear the statistics for the QoS policy applied in control-plane management view. |
reset qos policy control-plane management |
Clear the statistics about QoS policies applied to Ethernet service instances. |
reset qos [ ipv6-matching | accounting | mirroring | remarking ] policy l2vpn-ac [ interface interface-type interface-number [ service-instance instance-id ] ] [ inbound ] |
Clear the statistics of the QoS policy applied in a certain direction of a VLAN. |
reset qos vlan-policy [ vlan vlan-id ] [ inbound | outbound ] |
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 and DSCP precedence. These priorities have global significance and affect the forwarding priority of packets across the network. For more information about these priorities, see "Appendixes."
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.
The device supports only local precedence and drop priority for scheduling.
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.
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
system-view
2. Enter priority map view.
qos map-table { dot1p-dp | dscp-dp | dot1p-lp | dscp-lp | 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
The global priority trust mode takes effect only on VXLAN packets.
For a VXLAN tunnel interface to trust the DSCP priority in the outer IP header of VXLAN packets, you must execute both of the following commands:
· qos trust tunnel-dscp (in system view).
· qos trust dscp (in interface view for the physical interface of the VXLAN tunnel interface).
The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Interface Configuration Guide).
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.
4. Return to system view.
quit
5. (Optional.) Configure the global priority trust mode for VXLAN packets.
qos trust tunnel-dscp
By default, the global priority trust mode for VXLAN packets is not configured.
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.
Display and maintenance commands for priority mapping
Execute display commands in any view.
Task |
Command |
Display priority map configuration. |
display qos map-table [ dot1p-dp | dscp-dp | dot1p-lp | dscp-lp | 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.
Configure Device C to preferentially process packets from Device A to the server when Ten-GigabitEthernet 1/0/3 of Device C is congested.
Procedure
(Method 1) Configure Device C to trust packet priority
# Configure Ten-GigabitEthernet 1/0/1 and Ten-GigabitEthernet 1/0/2 to trust the 802.1p priority for priority mapping.
<DeviceC> system-view
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] qos trust dot1p
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] qos trust dot1p
[DeviceC-Ten-GigabitEthernet1/0/2] quit
(Method 2) Configure Device C to trust port priority
# Assign port priority to Ten-GigabitEthernet 1/0/1 and Ten-GigabitEthernet 1/0/2. Make sure the following requirements are met:
· The priority of Ten-GigabitEthernet 1/0/1 is higher than that of Ten-GigabitEthernet 1/0/2.
· No trusted packet priority type is configured on Ten-GigabitEthernet 1/0/1 or Ten-GigabitEthernet 1/0/2.
<DeviceC> system-view
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] qos priority 3
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] qos priority 1
[DeviceC-Ten-GigabitEthernet1/0/2] quit
Example: Configuring priority mapping tables and priority marking
Network configuration
As shown in Figure 5:
· The Marketing department connects to Ten-GigabitEthernet 1/0/1 of Device, which sets the 802.1p priority of traffic from the Marketing department to 3.
· The R&D department connects to Ten-GigabitEthernet 1/0/2 of Device, which sets the 802.1p priority of traffic from the R&D department to 4.
· The Management department connects to Ten-GigabitEthernet 1/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 Ten-GigabitEthernet 1/0/1 to 3.
<Device> system-view
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] qos priority 3
[Device-Ten-GigabitEthernet1/0/1] quit
# Set the port priority of Ten-GigabitEthernet 1/0/2 to 4.
[Device] interface ten-gigabitethernet 1/0/2
[Device-Ten-GigabitEthernet1/0/2] qos priority 4
[Device-Ten-GigabitEthernet1/0/2] quit
# Set the port priority of Ten-GigabitEthernet 1/0/3 to 5.
[Device] interface ten-gigabitethernet 1/0/3
[Device-Ten-GigabitEthernet1/0/3] qos priority 5
[Device-Ten-GigabitEthernet1/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 Ten-GigabitEthernet 1/0/3.
[Device] interface ten-gigabitethernet 1/0/3
[Device-Ten-GigabitEthernet1/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 Ten-GigabitEthernet 1/0/1.
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/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 Ten-GigabitEthernet 1/0/2.
[Device] interface ten-gigabitethernet 1/0/2
[Device-Ten-GigabitEthernet1/0/2] qos apply policy rd inbound
[Device-Ten-GigabitEthernet1/0/2] quit
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 or PW 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.
Restrictions and guidelines: Traffic policing, GTS, and rate limit configuration
The specified CIR does not take traffic transmitted in interframe gaps into account, and the actually allowed rate on an interface is greater than the specified CIR.
An interframe gap is a time interval for transmitting 12 bits between frames. This gap serves the following roles:
· Allows the device to differentiate one frame from another.
· Allows for time for the device to process the current frame and to prepare for receiving the next frame.
Configuring traffic policing
Configuring traffic policing by using the MQC approach
Restrictions and guidelines
A traffic policing action takes effect only when a QoS policy is applied to the following application destinations:
· Interface.
· VLANs.
· Globally.
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 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.
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 peak-information-rate [ ebs excess-burst-size ] [ 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 GTS
Restrictions and guidelines
A queue-based GTS action takes effect only on outgoing traffic in the specified queue.
The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Interface Configuration Guide).
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure GTS for a queue.
qos gts queue queue-id cir committed-information-rate [ cbs committed-burst-size ]
By default, GTS is not configured on an interface queue.
Configuring the rate limit
Configuring the rate limit for an interface
Restrictions and guidelines
The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Interface Configuration Guide).
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure the rate limit for the interface.
qos lr { inbound | outbound } cir committed-information-rate [ cbs committed-burst-size ]
By default, no rate limit is configured on an interface.
Display and maintenance commands for traffic policing, GTS, and rate limit
Execute display commands in any view.
Task |
Command |
Display ACL rules in the ACL whitelist. |
display acl whitelist [ ipv6 ] 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 ] |
Display QoS and ACL resource usage. |
display qos-acl resource [ slot slot-number ] |
Display traffic behavior configuration. |
display traffic behavior user-defined [ behavior-name ] |
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 10 shows two typical congestion scenarios.
Figure 10 Traffic congestion scenarios
Congestion produces 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 even system breakdown.
Congestion is unavoidable in switched networks and multiuser application environments. To improve the service performance of your network, take measures to manage and control it.
The key to congestion management is defining a resource dispatching policy to prioritize packets for forwarding when congestion occurs.
Congestion management methods
Congestion management uses queuing and scheduling algorithms to classify and sort traffic leaving a port.
The device supports the following queuing mechanisms:
· SP.
· WRR.
· WFQ.
SP queuing
SP queuing is designed for mission-critical applications that require preferential service to reduce the response delay when congestion occurs.
In Figure 11, SP queuing classifies eight queues on a port into eight classes, numbered 7 to 0 in descending priority order.
SP queuing schedules the eight queues in the descending order of priority. SP queuing 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, and so on. You can assign mission-critical packets to a high priority queue to make sure they are always served first. Common service packets can be assigned to low priority queues to be transmitted when high priority queues are empty.
The disadvantage of SP queuing is that packets in the lower priority queues cannot be transmitted if packets exist in the higher priority queues. In the worst case, lower priority traffic might never get serviced.
WRR queuing
WRR queuing schedules all the queues in turn to ensure that every queue is served for a certain time, as shown in Figure 12.
Assume a port provides eight output queues. WRR assigns each queue a weight value (represented by w7, w6, w5, w4, w3, w2, w1, or w0). The weight value of a queue decides the proportion of resources assigned to the queue. On a 100 Mbps port, you can set the weight values to 50, 30, 10, 10, 50, 30, 10, and 10 for w7 through w0. In this way, the queue with the lowest priority can get a minimum of 5 Mbps of bandwidth. WRR solves the problem that SP queuing might fail to serve packets in low-priority queues for a long time.
Another advantage of WRR queuing is that when the queues are scheduled in turn, the service time for each queue is not fixed. If a queue is empty, the next queue will be scheduled immediately. This improves bandwidth resource use efficiency.
WRR queuing includes the following types:
· Basic WRR queuing—Contains multiple queues. You can set the weight for each queue, and WRR schedules these queues based on the user-defined parameters in a round robin manner.
· Group-based WRR queuing—All the queues are scheduled by WRR. You can divide output queues to WRR priority queue group 1 and WRR priority queue group 2. Round robin queue scheduling is performed for group 1 first. If group 1 is empty, round robin queue scheduling is performed for group 2.
On an interface enabled with group-based WRR queuing, you can assign queues to the SP group. Queues in the SP group are scheduled with SP. The SP group has higher scheduling priority than the WRR groups.
WFQ queuing
Figure 13 WFQ queuing
WFQ is similar to WRR. WFQ queuing includes basic WFQ queuing and group-based WFQ queuing.
On an interface with group-based WFQ queuing enabled, you can also assign queues to the SP group. The difference is that WFQ enables you to set guaranteed bandwidth that a WFQ queue can get during congestion.
SP+WFQ queuing schedules traffic in the following order:
1. Schedules the traffic conforming to the minimum guaranteed bandwidth of each queue in the WFQ group.
2. Schedules the queues in the SP group based on their priorities.
3. Schedules the traffic in each queue in the WFQ group according to the configured weights when all queues in the SP group are empty.
Congestion management tasks at a glance
To configure congestion management, perform the following tasks:
1. Configuring queuing on an interface
¡ Configuring SP queuing
¡ Configuring WRR queuing
¡ Configuring WFQ queuing
2. Configuring a queue scheduling profile
Configuring queuing on an interface
Restrictions and guidelines for queuing configuration
The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Interface Configuration Guide).
Configuring SP queuing
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure SP queuing.
qos sp
By default, an interface uses SP queuing.
Configuring WRR queuing
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable WRR queuing.
qos wrr { byte-count | weight }
By default, an interface uses SP queuing.
4. Assign a queue to a WRR group, and configure scheduling parameters for the queue.
qos wrr queue-id group { 1 | 2 } { byte-count | weight } schedule-value
By default, all queues on a WRR-enabled interface are in WRR group 1, and queues 0 through 7 have a weight of 1, 2, 3, 4, 5, 9, 13, and 15, respectively.
Configuring WFQ queuing
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable WFQ queuing.
qos wfq { byte-count | weight }
By default, an interface uses SP queuing.
4. Assign a queue to a WFQ group, and configure scheduling parameters for the queue.
qos wfq queue-id group { 1 | 2 } { byte-count | weight } schedule-value
By default, all queues on a WFQ-enabled interface are in WFQ group 1 and have a weight of 1.
Configuring SP+WRR queuing
Restrictions and guidelines
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable byte-count or packet-count WRR queuing.
qos wrr { byte-count | weight }
By default, an interface uses SP queuing.
4. Assign a queue to the SP group.
qos wrr queue-id group sp
By default, all queues on a WRR-enabled interface are in WRR group 1.
5. Assign a queue to a WRR group, and configure a scheduling weight for the queue.
qos wrr queue-id group { 1 | 2 } { byte-count | weight } schedule-value
By default, all queues on a WRR-enabled interface are in WRR group 1, and queues 0 through 7 have a weight of 1, 2, 3, 4, 5, 9, 13, and 15, respectively.
Configuring SP+WFQ queuing
Restrictions and guidelines
To configure the scheduling weight, you must specify the same scheduling unit as specified when enabling WFQ queuing.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Enable byte-count or packet-count WFQ queuing.
qos wfq { byte-count | weight }
By default, an interface uses SP queuing.
4. Assign a queue to the SP group.
qos wfq queue-id group sp
By default, all queues on a WFQ-enabled interface are in WFQ group 1.
5. Assign a queue to a WFQ queue scheduling group, and configure a scheduling weight for the queue.
qos wfq queue-id group { 1 | 2 } { byte-count | weight } schedule-value
By default, all queues on a WFQ-enabled interface are in WFQ group 1 and have a weight of 1.
6. (Optional.) Set the minimum guaranteed bandwidth for a queue.
qos bandwidth queue queue-id min bandwidth-value
By default, the minimum guaranteed bandwidth for a WFQ queue in an WFQ group is not set.
Configuring a queue scheduling profile
About queue scheduling profiles
In a queue scheduling profile, you can configure scheduling parameters for each queue. By applying the queue scheduling profile to an interface or session group profile, you can implement congestion management on the interface or session group profile.
Queue scheduling profiles support three queue scheduling algorithms: SP, WRR, and WFQ. In a queue scheduling profile, you can configure SP + WRR or SP + WFQ. For information about each scheduling algorithm, see "About congestion management." When SP and WRR groups are configured in a queue scheduling profile, Figure 14 shows the scheduling order.
Figure 14 Queue scheduling profile configured with both SP and WRR
· Queue 7 has the highest priority in the SP group. Its packets are sent preferentially.
· Queue 5 has the second highest priority in the SP group. Packets in queue 5 are sent when queue 7 is empty.
· All queues in WRR group 1 are scheduled according to their weights. When queue 7 and queue 5 are empty, WRR group 1 is scheduled.
Restrictions and guidelines for queue scheduling profile configuration
When you configure a queue scheduling profile, follow these restrictions and guidelines:
· The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Layer 2—LAN Switching Configuration Guide).
· Only one queue scheduling profile can be applied to an interface or session group profile.
· You can modify the scheduling parameters in a queue scheduling profile already applied to an interface, the switching fabric module, or a session group profile.
Configuring a queue scheduling profile
1. Enter system view.
system-view
2. Create a queue scheduling profile and enter queue scheduling profile view.
qos qmprofile profile-name
3. (Optional.) Configure queue scheduling parameters.
¡ Configure a queue to use SP.
queue queue-id sp
¡ Configure a queue to use WRR.
queue queue-id wrr group group-id { weight | byte-count } schedule-value
¡ Configure a queue to use WFQ.
queue queue-id wfq group group-id { weight | byte-count } schedule-value
By default, all queues in a queue scheduling profile are SP queues.
4. (Optional.) Set the minimum guaranteed bandwidth for a WFQ queue.
bandwidth queue queue-id min bandwidth-value
By default, the minimum guaranteed bandwidth is not set for a WFQ queue.
Applying a queue scheduling profile
1. Enter system view.
system-view
1. Execute the following commands in sequence to apply the queue scheduling profile to the outbound direction of an interface:
interface interface-type interface-number
qos apply qmprofile profile-name
By default, no queue scheduling profile is applied to an interface.
Example: Configuring a queue scheduling profile
Network configuration
Configure a queue scheduling profile to meet the following requirements on Ten-GigabitEthernet 1/0/1:
· Queue 7 has the highest priority, and its packets are sent preferentially.
· Queue 0 through queue 6 are in the WRR group and are scheduled according to their packet-count weights, which are 2, 1, 2, 4, 6, 8, and 10, respectively. When queue 7 is empty, the WRR group is scheduled.
Procedure
# Enter system view.
<Sysname> system-view
# Create a queue scheduling profile named qm1.
[Sysname] qos qmprofile qm1
[Sysname-qmprofile-qm1]
# Configure queue 7 to use SP queuing.
[Sysname-qmprofile-qm1] queue 7 sp
# Assign queue 0 through queue 6 to WRR group 1, with their packet-count weights as 2, 1, 2, 4, 6, 8, and 10, respectively.
[Sysname-qmprofile-qm1] queue 0 wrr group 1 weight 2
[Sysname-qmprofile-qm1] queue 1 wrr group 1 weight 1
[Sysname-qmprofile-qm1] queue 2 wrr group 1 weight 2
[Sysname-qmprofile-qm1] queue 3 wrr group 1 weight 4
[Sysname-qmprofile-qm1] queue 4 wrr group 1 weight 6
[Sysname-qmprofile-qm1] queue 5 wrr group 1 weight 8
[Sysname-qmprofile-qm1] queue 6 wrr group 1 weight 10
[Sysname-qmprofile-qm1] quit
# Apply queue scheduling profile qm1 to Ten-GigabitEthernet 1/0/1.
[Sysname] interface ten-gigabitethernet 1/0/1
[Sysname-Ten-GigabitEthernet1/0/1] qos apply qmprofile qm1
After the configuration is completed, Ten-GigabitEthernet 1/0/1 performs queue scheduling as specified in queue scheduling profile qm1.
Display and maintenance commands for congestion management
Execute display commands in any view.
Task |
Command |
Display the configuration of queue scheduling profiles. |
display qos qmprofile configuration [ profile-name ] [ slot slot-number ] |
Display the queue scheduling profiles applied to interfaces. |
display qos qmprofile interface [ interface-type interface-number ] |
Display outbound queue-based traffic statistics for interfaces. |
display qos queue-statistics interface outbound |
Display SP queuing configuration. |
display qos queue sp interface [ interface-type interface-number ] |
Display WFQ queuing configuration. |
display qos queue wfq interface [ interface-type interface-number ] |
Display WRR queuing configuration. |
display qos queue wrr interface [ interface-type interface-number ] |
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.
Relationship between WRED and queuing mechanisms
Figure 15 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.
ECN
By dropping packets, WRED alleviates the influence of congestion on the network. However, the network resources for transmitting packets from the sender to the device which drops the packets are wasted. When congestion occurs, it is a better idea to perform the following actions:
· Inform the sender of the congestion status.
· Have the sender proactively slow down the packet sending rate or decrease the window size of packets.
This better utilizes the network resources.
RFC 2481 defined an end-to-end congestion notification mechanism named Explicit Congestion Notification (ECN). ECN uses the DS field in the IP header to mark the congestion status along the packet transmission path. An ECN-capable endpoint can determine whether congestion occurs on the transmission path according to the packet contents. Then, it adjusts the packet sending speed to avoid deteriorating congestion. ECN defines the last two bits (ECN field) in the DS field of the IP header as follows:
· Bit 6 indicates whether the sending endpoint device supports ECN, and is called the ECN-Capable Transport (ECT) bit.
· Bit 7 indicates whether the packet has experienced congestion along the transmission path, and is called the Congestion Experienced (CE) bit.
For more information about the DS field, see "Appendixes."
In actual applications, the following packets are considered as packets that an ECN-capable endpoint transmits:
· Packets with ECT set to 1 and CE set to 0.
· Packets with ECT set to 0 and CE set to 1.
To enable ECN, do not specify ToS field bit 6 or 7 as the flag bit in iNQA, and vice versa. For more information about iNQA, see Network Management and Monitoring Configuration Guide.
As shown in Figure 16, the WRED algorithm sets an upper threshold and lower threshold for each queue, and processes the packets in a queue as follows if ECN is not enabled:
· 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.
Figure 16 Drop probability and queue length
As shown in Figure 17, the network is deployed with ECN and has the following device roles:
· Congestion point—It forwards packets from the packet sender to the packet receiver. It supports ECN and can identify the ECN field. Congestion might occur on the congestion point. ECN must be configured on the congestion point.
· Notification point—It is an endpoint that receives packets. Its NIC supports ECN and can identify the ECN values 01, 10, and 11. After receiving a packet with the ECN field as 11, the notification point will notify the reaction point to slow down transmission by sending CE packets at the interval T1.
· Reaction point—It is an endpoint that sends packets. Its NIC supports ECN, and the ECN field of packets sent by it can be 01 or 10. After receiving a CE packet, the reaction point slows down transmission and starts a timer (T2, (T2>T1)). If the reaction point does not receive another CE packet when the timer expires, it considers that there is no congestion in the network and restores the previous transmission rate. If the reaction point receives another CE packet before the timer expires, it further reduces the transmission rate.
Figure 17 Network diagram with ECN enabled
After you enable ECN on the congestion point, it processes an incoming packet that enters an output queue as follows:
· When the average queue size is below the lower threshold, the congestion point forwards the packet without modifying the ECN field.
· When the average queue size is between the lower threshold and the upper threshold:
¡ If the ECN field is 00, the packet comes from an ECN-incapable endpoint, and the congestion point determines whether to drop the packet according to the drop probability.
¡ If the ECN field is 01 or 10, the packet comes from an ECN-capable endpoint, and the congestion point determines whether to modify the ECN field according to the drop probability and then forwards the packet. All packets will not be dropped.
¡ If the ECN field is 11, the packet has experienced congestion along the transmission path, and the congestion point forwards the packet without modifying the ECN field.
· When the average queue size is above the upper threshold:
¡ If the ECN field is 00, the packet comes from an ECN-incapable endpoint, and the congestion point drops the packet.
¡ If the ECN field is 01 or 10, the packet comes from an ECN-capable endpoint, and the congestion point determines whether to modify the ECN field according to the drop probability and then forwards the packet. All packets will not be dropped.
¡ If the ECN field is 11, the packet has experienced congestion along the transmission path, and the congestion point forwards the packet without modifying the ECN field.
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.
· Drop probability—Drop probability in percentage. The greater the value, the higher the drop probability. (Applicable when you configure a WRED table on an interface.)
Restrictions and guidelines: WRED configuration
On an interface, Configuring WRED parameters for a queue and Configuring and applying a queue-based WRED table to an interface are mutually exclusive. Please configure one of the two tasks.
Configuring WRED parameters for a queue
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configuring WRED parameters for a queue.
qos wred queue queue-id low-limit low-limit high-limit high-limit [ discard-probability discard-prob ] [ weighting-constant exponent ]
qos wred queue queue-id [ drop-level drop-level ] low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, no WRED parameters are configured for a queue.
4. Set the WRED exponent for average queue size calculation.
qos wred weighting-constant exponent
The default setting is 9.
Configuring and applying a queue-based WRED table to an interface
Restrictions and guidelines
By using a WRED table, WRED randomly drops packets during congestion based on the queues that hold packets.
One WRED table can be applied to multiple interfaces. You can modify the parameters of a WRED table applied to an interface, but you cannot delete the WRED table.
The term "interface" in this section collectively refers to Layer 2 and Layer 3 Ethernet interfaces. You can use the port link-mode command to configure an Ethernet port as a Layer 2 or Layer 3 interface (see Interface Configuration Guide).
Procedure
1. Enter system view.
system-view
2. Create a WRED table and enter its view.
qos wred queue table table-name
3. (Optional.) Set the WRED exponent for average queue size calculation.
queue queue-id weighting-constant exponent
The default setting is 9.
4. (Optional.) Configure the other WRED parameters.
queue queue-id [ drop-level drop-level ] low-limit low-limit high-limit high-limit [ discard-probability discard-prob ]
By default, the lower limit is 100, the higher limit is 1000, and the drop probability is 10%.
5. Return to system view.
quit
6. Enter interface view.
interface interface-type interface-number
7. Apply the WRED table to the interface.
qos wred apply [ table-name ]
By default, no WRED table is applied to an interface, and tail drop is used on an interface.
Example: Configuring and applying a queue-based WRED table
Network configuration
Apply a WRED table to Ten-GigabitEthernet 1/0/2, so that the packets are dropped as follows when congestion occurs:
· For the interface to preferentially forward higher-priority traffic, set a lower drop probability for a queue with a greater queue number. Set different drop parameters for queue 0, queue 3, and queue 7.
· Drop packets according to their colors.
¡ In queue 0, set the drop probability to 25%, 50%, and 75% for green, yellow, and red packets, respectively.
¡ In queue 3, set the drop probability to 5%, 10%, and 25% for green, yellow, and red packets, respectively.
¡ In queue 7, set the drop probability to 1%, 5%, and 10% for green, yellow, and red packets, respectively.
Procedure
# Configure a queue-based WRED table, and set different drop parameters for packets with different drop levels in different queues.
<Sysname> system-view
[Sysname] qos wred queue table queue-table1
[Sysname-wred-table-queue-table1] queue 0 drop-level 0 low-limit 128 high-limit 512 discard-probability 25
[Sysname-wred-table-queue-table1] queue 0 drop-level 1 low-limit 128 high-limit 512 discard-probability 50
[Sysname-wred-table-queue-table1] queue 0 drop-level 2 low-limit 128 high-limit 512 discard-probability 75
[Sysname-wred-table-queue-table1] queue 3 drop-level 0 low-limit 256 high-limit 640 discard-probability 5
[Sysname-wred-table-queue-table1] queue 3 drop-level 1 low-limit 256 high-limit 640 discard-probability 10
[Sysname-wred-table-queue-table1] queue 3 drop-level 2 low-limit 256 high-limit 640 discard-probability 25
[Sysname-wred-table-queue-table1] queue 7 drop-level 0 low-limit 512 high-limit 1024 discard-probability 1
[Sysname-wred-table-queue-table1] queue 7 drop-level 1 low-limit 512 high-limit 1024 discard-probability 5
[Sysname-wred-table-queue-table1] queue 7 drop-level 2 low-limit 512 high-limit 1024 discard-probability 10
[Sysname-wred-table-queue-table1] quit
# Apply the queue-based WRED table to Ten-GigabitEthernet 1/0/2.
[Sysname] interface ten-gigabitethernet 1/0/2
[Sysname-Ten-GigabitEthernet1/0/2] qos wred apply queue-table1
[Sysname-Ten-GigabitEthernet1/0/2] quit
Enabling ECN globally
About this task
This feature enables ECN on all queues configured with WRED parameters. The queues can be queues configured with the qos wred queue commands in interface view and queues configured in a WRED table.
Restrictions and guidelines
This feature takes effect only on packets with TCP or UDP headers.
Procedure
1. Enter system view.
system-view
2. Enable ECN globally.
qos wred ecn enable
By default, ECN is disabled globally.
Display and maintenance commands for WRED
Execute display commands in any view.
Task |
Command |
Display WRED configuration and statistics for an interface. |
display qos wred interface [ interface-type interface-number ] |
Display the configuration of a WRED table or all WRED tables. |
display qos wred table [ name table-name ] [ slot slot-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.
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 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.
If the filter permit command is configured in a traffic behavior, the permitted packets can be processed by other class-behavior associations in the same QoS policy.
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.
6. (Optional.) Display the traffic filtering configuration.
display traffic behavior user-defined [ behavior-name ]
This command is available in any view.
Traffic filtering configuration examples
Example: Configuring traffic filtering
Network configuration
As shown in Figure 18, configure traffic filtering on Ten-GigabitEthernet 1/0/1 to deny the incoming packets with destination port number 21.
Procedure
# Create advanced ACL 3000, and configure a rule to match packets whose destination port number is 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 Ten-GigabitEthernet 1/0/1.
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] qos apply policy policy inbound
[Device-Ten-GigabitEthernet1/0/1] quit
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."
Configuring priority marking
Restrictions and guidelines
The device supports the following application destinations for priority marking in the inbound direction:
· Interface.
· VLANs.
· Globally.
DSCP marking is supported in the inbound direction and outbound direction.
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 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 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.
6. (Optional.) Display the priority marking configuration.
display traffic behavior user-defined [ behavior-name ]
This command is available in any view.
Configuring nesting
About nesting
Nesting adds a VLAN tag to the matching packets to allow the VLAN-tagged packets to pass through the corresponding VLAN. For example, you can add an outer VLAN tag to packets from a customer network to a service provider network. This allows the packets to pass through the service provider network by carrying a VLAN tag assigned by the service provider.
Restrictions and guidelines: Nesting configuration
The device supports the following application destinations for nesting in the inbound direction:
· Interface.
· VLANs.
· Globally.
A VLAN tag adding action takes effect only when a QoS policy is applied to the inbound direction of an interface.
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 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 an outer VLAN tag adding action.
nest top-most vlan vlan-id
By default, no outer VLAN tag adding 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.
6. (Optional.) Display the nesting configuration.
display traffic behavior user-defined [ behavior-name ]
This command is available in any view.
Nesting configuration examples
Example: Configuring nesting
Network configuration
As shown in Figure 19:
· Site 1 and Site 2 in VPN A are two branches of a company. They use VLAN 5 to transmit traffic.
· Because Site 1 and Site 2 are located in different areas, the two sites use the VPN access service of a service provider. The service provider assigns VLAN 100 to the two sites.
Configure nesting, so that the two branches can communicate through the service provider network.
Procedure
1. Configuring PE 1:
# Create a traffic class named test to match traffic with VLAN ID 5.
<PE1> system-view
[PE1] traffic classifier test
[PE1-classifier-test] if-match service-vlan-id 5
[PE1-classifier-test] quit
# Configure an action to add outer VLAN tag 100 in traffic behavior test.
[PE1] traffic behavior test
[PE1-behavior-test] nest top-most vlan 100
[PE1-behavior-test] quit
# Create a QoS policy named test, and associate class test with behavior test in the QoS policy.
[PE1] qos policy test
[PE1-qospolicy-test] classifier test behavior test
[PE1-qospolicy-test] quit
# Configure the downlink port (Ten-GigabitEthernet 1/0/1) as a hybrid port, and assign the port to VLAN 100 as an untagged member.
[PE1] interface ten-gigabitethernet 1/0/1
[PE1-Ten-GigabitEthernet1/0/1] port link-type hybrid
[PE1-Ten-GigabitEthernet1/0/1] port hybrid vlan 100 untagged
# Apply QoS policy test to the incoming traffic of Ten-GigabitEthernet 1/0/1.
[PE1-Ten-GigabitEthernet1/0/1] qos apply policy test inbound
[PE1-Ten-GigabitEthernet1/0/1] quit
# Configure the uplink port (Ten-GigabitEthernet 1/0/2) as a trunk port, and assign it to VLAN 100.
[PE1] interface ten-gigabitethernet 1/0/2
[PE1-Ten-GigabitEthernet1/0/2] port link-type trunk
[PE1-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[PE1-Ten-GigabitEthernet1/0/2] quit
2. Configuring PE 2:
Configure PE 2 in the same way PE 1 is configured.
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:
· CPU.
· Interface.
· Next hop.
Restrictions and guidelines: Traffic redirecting configuration
· A traffic redirecting action takes effect only when a QoS policy is applied to the following application destinations in the inbound direction:
¡ Interface.
¡ VLANs.
¡ Globally.
· If you execute the redirect command multiple times, the most recent configuration takes effect.
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 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 | next-hop { ipv4-add1 [ ipv4-add2 ] | ipv6-add1 [ ipv6-add2 ] }
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.
6. (Optional.) Display traffic redirecting configuration.
display traffic behavior user-defined [ behavior-name ]
This command is available in any view.
Traffic redirecting configuration examples
Example: Configuring traffic redirecting
Network configuration
As shown in Figure 20:
· Device A is connected to Device B through two links. Device A and Device B are each connected to other devices.
· Ten-GigabitEthernet 1/0/1 of Device A is a trunk port and belongs to VLAN 200 and VLAN 201.
· Ten-GigabitEthernet 1/0/2 of Device A and Ten-GigabitEthernet 1/0/2 of Device B belong to VLAN 200.
· Ten-GigabitEthernet 1/0/3 of Device A and Ten-GigabitEthernet 1/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 Ten-GigabitEthernet 1/0/1 of Device A are forwarded to Ten-GigabitEthernet 1/0/2.
· Packets with source IP address 2.1.1.2 received on Ten-GigabitEthernet 1/0/1 of Device A are forwarded to Ten-GigabitEthernet 1/0/3.
· Other packets received on Ten-GigabitEthernet 1/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 Ten-GigabitEthernet 1/0/2.
[DeviceA] traffic behavior behavior_1
[DeviceA-behavior-behavior_1] redirect interface ten-gigabitethernet 1/0/2
[DeviceA-behavior-behavior_1] quit
# Create a traffic behavior named behavior_2, and configure the action of redirecting traffic to Ten-GigabitEthernet 1/0/3.
[DeviceA] traffic behavior behavior_2
[DeviceA-behavior-behavior_2] redirect interface ten-gigabitethernet 1/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 Ten-GigabitEthernet 1/0/1.
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] qos apply policy policy inbound
[DeviceA-Ten-GigabitEthernet1/0/1] quit
Configuring global CAR
About global CAR
Global committed access rate (CAR) is an approach to policing traffic flows globally. It adds flexibility to common CAR where traffic policing is performed only on a per-traffic class or per-interface basis. In this approach, CAR actions are created in system view and each can be used to police multiple traffic flows as a whole.
Global CAR provides the following CAR actions: aggregate CAR and hierarchical CAR.
Aggregate CAR
An aggregate CAR action is created globally. It can be directly applied to interfaces or used in the traffic behaviors associated with different traffic classes to police multiple traffic flows as a whole. The total rate of the traffic flows must conform to the traffic policing specifications set in the aggregate CAR action.
Hierarchical CAR
A hierarchical CAR action is created globally. It must be used in conjunction with a common CAR or aggregate CAR action. With a hierarchical CAR action, you can limit the total traffic of multiple traffic classes.
A hierarchical CAR action can be used in the common or aggregate CAR action for a traffic class in either AND mode or OR mode.
· In AND mode, the rate of the traffic class is strictly limited under the common or aggregate CAR. This mode applies to flows that must be strictly rate limited.
· In OR mode, the traffic class can use idle bandwidth of other traffic classes associated with the hierarchical CAR. This mode applies to high priority, bursty traffic like video.
By using the two modes appropriately, you can improve bandwidth efficiency.
For example, suppose two flows exist: a low priority data flow and a high priority, bursty video flow. Their total traffic rate cannot exceed 4096 kbps and the video flow must be assured of at least 2048 kbps bandwidth. You can perform the following tasks:
· Configure common CAR actions to set the traffic rate to 2048 kbps for the two flows.
· Configure a hierarchical CAR action to limit their total traffic rate to 4096 kbps.
· Use the action in AND mode in the common CAR action for the data flow.
· Use the action in OR mode in the common CAR action for the video flow.
The video flow is assured of 2048 kbps bandwidth and can use idle bandwidth of the data flow.
In a bandwidth oversubscription scenario, the uplink port bandwidth is lower than the total downlink port traffic rate. You can use hierarchical CAR to meet the following requirements:
· Limit the total rate of downlink port traffic.
· Allow each downlink port to forward traffic at the maximum rate when the other ports are idle.
For example, you can perform the following tasks:
· Use common CAR actions to limit the rates of Internet access flow 1 and flow 2 to both 128 kbps.
· Use a hierarchical CAR action to limit their total traffic rate to 192 kbps.
· Use the hierarchical CAR action for both flow 1 and flow 2 in AND mode.
When flow 1 is not present, flow 2 is transmitted at the maximum rate, 128 kbps. When both flows are present, the total rate of the two flows cannot exceed 192 kbps. As a result, the traffic rate of flow 2 might drop below 128 kbps.
Restrictions and guidelines: Global CAR configuration
The device supports only aggregate CAR in the current software version, and an aggregate CAR action cannot be applied in both the inbound direction and outbound direction.
When a QoS policy containing an aggregate CAR action is applied on an IRF fabric, the traffic matching the QoS policy might enter the IRF fabric through interfaces on different IRF member devices. In this case, the actual rate limit that takes effect is the sum of the CIR and PIR in the aggregate CAR action multiplied by the number of involved IRF member devices by default.
Configuring aggregate CAR
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 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. Configure an aggregate CAR action.
qos car car-name aggregative cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] *
qos car car-name aggregative cir committed-information-rate [ cbs committed-burst-size ] pir peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] *
By default, no aggregate CAR action is configured.
4. Define a traffic behavior.
a. Enter traffic behavior view.
traffic behavior behavior-name
b. Use the aggregate CAR in the traffic behavior.
car name car-name
By default, no aggregate CAR action is used in a traffic behavior.
5. Apply the QoS policy.
For more information, see "Applying the QoS policy."
By default, no QoS policy is applied.
Display and maintenance commands for global CAR
Execute display commands in any view and reset commands in user view.
Task |
Command |
Display statistics for global CAR actions. |
display qos car name [ car-name ] |
Clear statistics for global CAR actions. |
reset qos car name [ car-name ] |
Global CAR configuration examples
Example: Configuring MQC aggregate CAR
Network configuration
As shown in Figure 21, configure MQC aggregate CAR to limit the total rate of traffic in VLAN 10 and VLAN 100 to CIR 2560 kbps and CBS 20480 bytes and drop the exceeding packets.
Procedure
# Configure an aggregate CAR action according to the rate limit requirements.
<Device> system-view
[Device] qos car aggcar-1 aggregative cir 2560 cbs 20480 red discard
# Create traffic class 1, and use VLAN ID 10 as the match criterion in the traffic class.
[Device] traffic classifier 1
[Device-classifier-1] if-match service-vlan-id 10
[Device-classifier-1] quit
# Create traffic behavior 1, and use the aggregate CAR action in the traffic behavior.
[Device] traffic behavior 1
[Device-behavior-1] car name aggcar-1
[Device-behavior-1] quit
# Create traffic class 2, and use VLAN ID 100 as the match criterion in the traffic class.
[Device] traffic classifier 2
[Device-classifier-2] if-match service-vlan-id 100
[Device-classifier-2] quit
# Create traffic behavior 2, and use the aggregate CAR action in the traffic behavior.
[Device] traffic behavior 2
[Device-behavior-2] car name aggcar-1
[Device-behavior-2] quit
# Create a QoS policy named car, and associate traffic classes 1 and 2 with traffic behaviors 1 and 2 in the QoS policy, respectively.
[Device] qos policy car
[Device-qospolicy-car] classifier 1 behavior 1
[Device-qospolicy-car] classifier 2 behavior 2
[Device-qospolicy-car] quit
# Apply QoS policy car to the incoming traffic of Ten-GigabitEthernet 1/0/1.
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] qos apply policy car inbound
[Device-Ten-GigabitEthernet1/0/1] quit
Configuring class-based accounting
About class-based accounting
Class-based accounting collects statistics on a per-traffic class basis. For example, you can define the action to collect statistics for traffic sourced from a certain IP address. By analyzing the statistics, you can determine whether anomalies have occurred and what action to take.
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 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 an accounting action.
accounting [ byte | packet ] *
By default, no traffic accounting 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.
6. (Optional.) Display the class-based accounting configuration.
display traffic behavior user-defined [ behavior-name ]
Class-based accounting configuration examples
Example: Configuring class-based accounting
Network configuration
As shown in Figure 22, configure class-based accounting on Ten-GigabitEthernet 1/0/1 to collect statistics for incoming traffic from 1.1.1.1/24.
Procedure
# Create basic ACL 2000, and configure a rule to match packets with source IP address 1.1.1.1.
<Device> system-view
[Device] acl basic 2000
[Device-acl-ipv4-basic-2000] rule permit source 1.1.1.1 0
[Device-acl-ipv4-basic-2000] quit
# Create a traffic class named classifier_1, and use ACL 2000 as the match criterion in the traffic class.
[Device] traffic classifier classifier_1
[Device-classifier-classifier_1] if-match acl 2000
[Device-classifier-classifier_1] quit
# Create a traffic behavior named behavior_1, and configure the class-based accounting action.
[Device] traffic behavior behavior_1
[Device-behavior-behavior_1] accounting packet
[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 Ten-GigabitEthernet 1/0/1.
[Device] interface ten-gigabitethernet 1/0/1
[Device-Ten-GigabitEthernet1/0/1] qos apply policy policy inbound
[Device-Ten-GigabitEthernet1/0/1] quit
# Display traffic statistics to verify the configuration.
[Device] display qos policy interface ten-gigabitethernet 1/0/1
Interface: Ten-GigabitEthernet1/0/1
Direction: Inbound
Policy: policy
Classifier: classifier_1
Operator: AND
Rule(s) :
If-match acl 2000
Behavior: behavior_1
Accounting enable:
28529 (Packets)
10000 (pps)
Configuring interface packet accounting
About interface packet accounting
This feature can collect packet statistics on an interface by ECN attribute.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Configure packet accounting on the interface.
qos packet-statistics { inbound | outbound } ecn
By default, packet accounting is disabled on an interface.
Display and maintenance commands for interface packet accounting
Execute display commands in any view and reset commands in user view.
Task |
Command |
Display interface packet statistics. |
display qos packet-statistics interface interface-type interface-number { inbound | outbound } |
Clear interface packet statistics. |
reset qos packet-statistics interface [ interface-type interface-number ] [ inbound | outbound ] |
Appendixes
Appendix A Acronyms
Table 2 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 |
INT |
Inband Network Telemetry |
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
Table 3 Default dot1p-lp and dot1p-dp priority maps
Input priority value |
dot1p-lp map |
dot1p-dp map |
dot1p |
lp |
dp |
0 |
2 |
0 |
1 |
0 |
0 |
2 |
1 |
0 |
3 |
3 |
0 |
4 |
4 |
0 |
5 |
5 |
0 |
6 |
6 |
0 |
7 |
7 |
0 |
Table 4 Default dscp-lp and dscp-dp priority maps
Input priority value |
dscp-lp map |
dscp-dp map |
dscp |
lp |
dp |
0 to 7 |
0 |
0 |
8 to 15 |
1 |
0 |
16 to 23 |
2 |
0 |
24 to 31 |
3 |
0 |
32 to 39 |
4 |
0 |
40 to 47 |
5 |
0 |
48 to 55 |
6 |
0 |
56 to 63 |
7 |
0 |
Table 5 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 |
Appendix C Introduction to packet precedence
IP precedence and DSCP values
As shown in Figure 23, 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 6 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 7 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 24 An Ethernet frame with an 802.1Q tag header
As shown in Figure 24, 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 25 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 8 shows the values for 802.1p priority.
Table 8 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 |