- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
03-MPLS QoS configuration | 82.92 KB |
Configuring MPLS QoS
Overview
MPLS uses 3 bits, called EXP bits, to carry class-of-service information to provide support for DiffServ. MPLS QoS identifies different traffic flows with different EXP bits and implements differentiated services. MPLS QoS can guarantee low delay and low packet loss ratio for critical service traffic, such as voice and video traffic. For more information about MPLS, see MPLS Configuration Guide.
MPLS QoS supports CAR and priority marking. MPLS QoS provides the following functions:
· Classify traffic on the PE and apply differentiated QoS strategies for different traffic classes. For example, MPLS QoS can organize packets with EXP value 1 into a class and packets with EXP value 2 into another class. Then it performs traffic policing and priority marking for each class of packets.
· When a PE labels a packet, it maps the IP precedence to the EXP field of the label. In this way, the class information carried in the IP header is carried in the label.
The EXP field in an MPLS label is processed according to the following rules:
· The device re-sets the EXP field of only the topmost label.
· During label encapsulation, the ToS field of the IP packet is directly changed into the EXP field of the MPLS label.
· The EXP field remains unchanged when label swapping is performed.
· During a label push operation, the EXP field of the newly pushed outer label inherits the EXP field of the inner label.
· After a label pop operation for a packet, the following rules apply:
¡ If the packet is still an MPLS packet, the EXP field of the popped label is not copied to the inner label.
¡ If the packet is an IP packet, the EXP field of the popped label is not copied to the ToS field of the IP packet.
Configuration prerequisites
Before configuring MPLS QoS, complete basic MPLS configuration. For more information about basic MPLS configurations, see MPLS Configuration Guide.
Configuring MPLS CAR
A CAR policy for traffic entering an MPLS network performs the following operations:
· Limits the transmission rate to avoid network congestion.
· Marks priority for the traffic.
For more information about traffic policing, see "Configuring traffic policing, GTS, and rate limit."
To configure MPLS CAR:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter interface view. |
interface interface-type interface-number |
N/A |
3. Configure an MPLS CAR policy for the interface. |
qos car { inbound | outbound } { any | acl [ ipv6 ] acl-number | carl carl-index } cir committed-information-rate [ cbs committed-burst-size [ ebs excess-burst-size ] ] [ green action | red action | yellow action ] * qos car { inbound | outbound } { any | acl [ ipv6 ] acl-number | carl carl-index } cir committed-information-rate [ cbs committed-burst-size ] pir peak-information-rate [ ebs excess-burst-size ] [ green action | red action | yellow action ] * |
By default, no CAR policy is configured for an interface. The action argument for MPLS can be either of the following options: · remark-mpls-exp-continue new-exp: Sets the EXP value to new-exp and continues to process the packet using the next CAR policy. The new-exp is in the range of 0 to 7. · remark-mpls-exp-pass new-exp: Sets the EXP value to new-exp and permits the packet to pass through. The new-exp is in the range of 0 to 7. |
Configuring MPLS priority marking
In an MPLS network, you can adjust the priority of an MPLS traffic flow by marking its EXP value. For more information about priority marking, see "Configuring priority marking."
To configure the MPLS priority marking action for an MPLS traffic class:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Create a traffic class and enter traffic class view. |
traffic classifier classifier-name [ operator { and | or } ] |
By default, no traffic classes exist. |
3. Configure match criteria for the traffic class. |
· if-match [ not ] mpls-exp exp-value&<1-8> · if-match [ not ] second-mpls-exp exp-value&<1-8> |
Use at least one command. By default, no match criteria are configured. The match criteria apply only to MPLS packets. |
4. Return to system view. |
quit |
N/A |
5. Create a traffic behavior and enter traffic behavior view. |
traffic behavior behavior-name |
By default, no traffic behaviors exist. |
6. Configure an EXP marking action in the traffic behavior. |
remark mpls-exp exp-value |
By default, no EXP marking action is configured. |
7. Configure an EXP marking action for the second label in the traffic behavior. |
remark second-mpls-exp exp-value |
By default, no EXP marking action is configured. |
8. Return to system view. |
quit |
N/A |
9. Create a QoS policy and enter QoS policy view. |
qos policy policy-name |
By default, no QoS policies exist. |
10. Associate the traffic class with the traffic behavior in the QoS policy. |
classifier classifier-name behavior behavior-name |
By default, no traffic behavior is associated with a traffic class. |
11. Return to system view. |
quit |
N/A |
12. Apply the QoS policy. |
You can apply a QoS policy to an interface or a control plane. For more information, see "Configuring a QoS policy." |
By default, no QoS policy is applied. |
MPLS QoS configuration example
Network requirements
As shown in Figure 1, perform the following tasks to provide differentiated QoS services for flows with different precedence values in VPN 1:
1. Configure MPLS VPN on CE 1, PE 1, P, PE 2, and CE 2 as follows:
¡ Run OSPF between PE 1 and P, and between PE 2 and P.
¡ Establish an MP-EBGP neighborship between PEs and CEs.
¡ Establish an MP-IBGP neighborship between PEs and PEs.
2. Configure MPLS QoS on PE 1 and P as follows:
¡ On PE 1, configure a QoS policy on GigabitEthernet 1/1/2 to set the EXP values for MPLS packets according to their DSCP values.
¡ On the P device, classify traffic on the basis of the EXP field, and configure flow-based CBQ as follows:
- Guarantee 10% of the bandwidth for traffic with an EXP value of 1.
- Guarantee 20% of the bandwidth for traffic with an EXP value of 2.
- Guarantee 30% of the bandwidth for traffic with an EXP value of 3.
- Guarantee a low delay and 40% of the bandwidth for traffic with an EXP value of 4.
For information about the MPLS configuration, see MPLS Configuration Guide. This section introduces only the MPLS QoS configuration.
Table 1 Interfaces and IP address assignment
Device |
Interface |
IP address |
Device |
Interface |
IP address |
CE 1 |
CE 2 |
||||
PE 1 |
PE 2 |
||||
P |
|
|
|
||
|
|
|
Configuration procedure
1. Configure PE 1:
# Configure four classes to match MPLS packets with DSCP values AF11, AF21, AF31, and EF in the same VPN.
[PE1] traffic classifier af11
[PE1-classifier-af11] if-match dscp af11
[PE1-classifier-af11] quit
[PE1] traffic classifier af21
[PE1-classifier-af21] if-match dscp af21
[PE1-classifier-af21] quit
[PE1] traffic classifier af31
[PE1-classifier-af31] if-match dscp af31
[PE1-classifier-af31] quit
[PE1] traffic classifier efclass
[PE1-classifier-efclass] if-match dscp ef
[PE1-classifier-efclass] quit
# Configure four traffic behaviors to set the EXP values to 1, 2, 3, and 4 for MPLS packets.
[PE1-behavior-exp1] remark mpls-exp 1
[PE1-behavior-exp1] quit
[PE1] traffic behavior exp2
[PE1-behavior-exp2] remark mpls-exp 2
[PE1-behavior-exp2] quit
[PE1] traffic behavior exp3
[PE1-behavior-exp3] remark mpls-exp 3
[PE1-behavior-exp3] quit
[PE1] traffic behavior exp4
[PE1-behavior-exp4] remark mpls-exp 4
[PE1-behavior-exp4] quit
# Create QoS policy REMARK, and associate the behaviors with the classes in the QoS policy to mark different classes of packets with different EXP values.
[PE1-qospolicy-REMARK] classifier af11 behavior exp1
[PE1-qospolicy-REMARK] classifier af21 behavior exp2
[PE1-qospolicy-REMARK] classifier af31 behavior exp3
[PE1-qospolicy-REMARK] classifier efclass behavior exp4
[PE1-qospolicy-REMARK] quit
# Apply QoS policy REMARK to the incoming traffic of interface GigabitEthernet 1/1/2 of PE 1 in the MPLS network.
[PE1] interface gigabitethernet 1/1/2
[PE1-GigabitEthernet1/1/2] qos apply policy REMARK inbound
[PE1-GigabitEthernet1/1/2] quit
2. Configure device P:
# Configure four classes to match MPLS packets with EXP values 1, 2, 3 and 4.
[P] traffic classifier EXP1
[P-classifier-EXP1] if-match mpls-exp 1
[P-classifier-EXP1] quit
[P] traffic classifier EXP2
[P-classifier-EXP2] if-match mpls-exp 2
[P-classifier-EXP2] quit
[P] traffic classifier EXP3
[P-classifier-EXP3] if-match mpls-exp 3
[P-classifier-EXP3] quit
[P] traffic classifier EXP4
[P-classifier-EXP4] if-match mpls-exp 4
[P-classifier-EXP4] quit
# Create four traffic behaviors, and configure AF or EF actions for them.
[P-behavior-AF11] queue af bandwidth pct 10
[P-behavior-AF11] quit
[P] traffic behavior AF21
[P-behavior-AF21] queue af bandwidth pct 20
[P-behavior-AF21] quit
[P] traffic behavior AF31
[P-behavior-AF31] queue af bandwidth pct 30
[P-behavior-AF31] quit
[P] traffic behavior EF
[P-behavior-EF] queue ef bandwidth pct 40
[P-behavior-EF] quit
# Create QoS policy QUEUE, and associate the behaviors with the classes.
[P-qospolicy-QUEUE] classifier EXP1 behavior AF11
[P-qospolicy-QUEUE] classifier EXP2 behavior AF21
[P-qospolicy-QUEUE] classifier EXP3 behavior AF31
[P-qospolicy-QUEUE] classifier EXP4 behavior EF
[P-qospolicy-QUEUE] quit
# Apply QoS policy QUEUE to the outgoing traffic of GigabitEthernet 1/1/2.
[P] interface gigabitethernet 1/1/2
[P-GigabitEthernet1/1/2] qos apply policy QUEUE outbound
Verifying the configuration
# When congestion occurs in VPN 1, verify that:
· The bandwidth proportion between flows with the DSCP values af11, af21, af31, and ef is 1:2:3:4.
· The delay for the flow with DSCP value ef is smaller than the other traffic flows.
(Details not shown.)