QoS over MPLS

QoS over MPLS

Problem

You want to use the Quality of Service (QoS) features of MPLS.

Solution

For this example, we will take a relatively simple view that the PE router will trust the CE router's DSCP/IP Precedence settings and map them to the MPLS EXP traffic priority field in a simple way. So we will focus on the configuration required on the PE and P routers to make use of this information.

First, the PE routers have the dual function of converting DSCP or IP Precedence values to MPLS EXP values and then using this information appropriately when forwarding the packets into the MPLS cloud. In this example, we will do both of these functions in a single policy map.

This MPLS network supports four categories of user traffic: low, medium, and high priority plus a real-time queue, which is indicated with the Expedited Forwarding (EF) DSCP value:

Router-PE1#configure terminal
Router-PE1(config)#class-map match-any med-priority
Router-PE1(config-cmap)#match precedence 1
Router-PE1(config-cmap)#match precedence 2
Router-PE1(config-cmap)#exit
Router-PE1(config)#class-map match-any high-priority
Router-PE1(config-cmap)#match precedence 3
Router-PE1(config-cmap)#match precedence 4
Router-PE1(config-cmap)#match precedence 5
Router-PE1(config-cmap)#exit
Router-PE1(config)#class-map match-any realtime-priority
Router-PE1(config-cmap)#match precedence 6
Router-PE1(config-cmap)#match dscp ef
Router-PE1(config-cmap)#exit
Router-PE1(config)#policy-map MPLS-priority
Router-PE1(config-pmap)#class realtime-priority
Router-PE1(config-pmap-c)#priority percent 10
Router-PE1(config-pmap-c)#set mpls experimental topmost 3
Router-PE1(config-pmap-c)#exit
Router-PE1(config-pmap)#class high-priority
Router-PE1(config-pmap-c)#bandwidth percent 10
Router-PE1(config-pmap-c)#queue-limit 20
Router-PE1(config-pmap-c)#set mpls experimental topmost 2
Router-PE1(config-pmap-c)#exit
Router-PE1(config-pmap)#class med-priority
Router-PE1(config-pmap-c)#bandwidth percent 15
Router-PE1(config-pmap-c)#queue-limit 50
Router-PE1(config-pmap-c)#set mpls experimental topmost 1
Router-PE1(config-pmap-c)#exit
Router-PE1(config-pmap)#class class-default
Router-PE1(config-pmap-c)#bandwidth percent 40
Router-PE1(config-pmap-c)#random-detect
Router-PE1(config-pmap-c)#set mpls experimental topmost 0
Router-PE1(config-pmap-c)#exit
Router-PE1(config-pmap)#exit
Router-PE1(config)#interface Serial0/0
Router-PE1(config-if)#service-policy output MPLS-priority
Router-PE1(config-if)#exit
Router-PE1(config)#end
Router-PE1#

Then the P routers must carry out the appropriate forwarding policy based on the values found in the MPLS EXP field:

Router-P1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router-P1(config)#class-map match-any med-priority
Router-P1(config-cmap)#match mpls experimental topmost 1
Router-P1(config-cmap)#exit
Router-P1(config)#class-map match-any high-priority
Router-P1(config-cmap)#match mpls experimental topmost 2
Router-P1(config-cmap)#exit
Router-P1(config)#class-map match-any realtime-priority
Router-P1(config-cmap)#match mpls experimental topmost 3
Router-P1(config-cmap)#exit
Router-P1(config)#policy-map MPLS-priority
Router-P1(config-pmap)#class realtime-priority
Router-P1(config-pmap-c)#priority percent 10
Router-P1(config-pmap-c)#exit
Router-P1(config-pmap)#class high-priority
Router-P1(config-pmap-c)#bandwidth percent 10
Router-P1(config-pmap-c)#queue-limit 20
Router-P1(config-pmap-c)#exit
Router-P1(config-pmap)#class med-priority
Router-P1(config-pmap-c)#bandwidth percent 15
Router-P1(config-pmap-c)#queue-limit 50
Router-P1(config-pmap-c)#exit
Router-P1(config-pmap)#class class-default
Router-P1(config-pmap-c)#bandwidth percent 40
Router-P1(config-pmap-c)#random-detect
Router-P1(config-pmap-c)#exit
Router-P1(config-pmap)#exit
Router-P1(config)#interface FastEthernet0/0
Router-P1(config-if)#service-policy output MPLS-priority
Router-P1(config-if)#exit
Router-P1(config)#end
Router-P1#

Note that in both of these configurations we have applied the service-policy command to a single interface. We have done this simply to demonstrate the principles. In a real network, you would want to apply a similar policy to every MPLS-enabled interface.

Discussion

As we discuss in Chapter 11, there are two steps to any QoS deployment, whether over MPLS or traditional networks. The first step is to mark the packets with some sort of priority designation. This is best done at the edges of the network, the PE routers in an MPLS network. This is because the core of the network typically aggregates a large number of access points, so it has higher traffic loads to deal with than the edges.

The second step is then to use this priority marking on each packet to decide how to forward the packet during periods of congestion. If the network is congested, packets will be buffered, with higher priority packets having precedence in the queues. If the congestion is serious enough, some packets will need to be dropped. The priority designations on the packets can be used to help decide which packets to drop first.

Chapter 11 and Appendix B describe the standard IP priority designation using the Differentiated Services Code Point (DSCP) field in the IP packet header. This is a 6-bit field that requests a particular Per-Hop Behavior (PHB) that the network should use when forwarding the packet. The actual PHB is implemented by the network engineer who may decide on a relatively free interpretation.

MPLS has its own QoS marking field contained in the 3-bit Experimental (EXP) field of the MPLS tag. In this recipe we have opted to let the customer decide how they want their network to be prioritized. They are given Table 26.1, showing the correspondence between DSCP/IP Precedence values and the four queues implemented in the MPLS cloud. The MPLS network provider can then set up IP accounting on these four queues and bill a higher per-packet amount for the higher priority queues.

Table 26-1. Example DSCP/IP precedence and MPLS queues
Queue name DSCP/IP Precedence values MPLS EXP value Queueing parameters
Default All other values 0 55% of bandwidth with WRED
Medium Precedence: 1, 2 1 15% of bandwidth
High Precedence: 3, 4, 5 2 10% of bandwidth
Real-time Precedence: 6DSCP: AF 3 10% of bandwidth, priority queue


For more complex QoS marking schemes, please refer to Chapter 11. You could, for example, mark packets based on the receiving interface, source, or destination IP addresses, protocol or port numbers, or even using some higher layer application information, if necessary. However, the simple method chosen for this recipe is more in keeping with how MPLS QoS is commonly implemented in practice.

The most convenient way to look at the results of your QoS configuration is with the show policy interface command:

Router-P1#show policy interface FastEthernet0/0
FastEthernet0/0

Service-policy output: MPLS-priority

Class-map: realtime-priority (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: mpls experimental topmost 3
0 packets, 0 bytes
5 minute rate 0 bps
Queueing
Strict Priority
Output Queue: Conversation 264
Bandwidth 10 (%)
Bandwidth 10000 (kbps) Burst 250000 (Bytes)
(pkts matched/bytes matched) 0/0
(total drops/bytes drops) 0/0

Class-map: high-priority (match-any)
70 packets, 4277 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: mpls experimental topmost 2
70 packets, 4277 bytes
5 minute rate 0 bps
Queueing
Output Queue: Conversation 265
Bandwidth 10 (%)
Bandwidth 10000 (kbps) Max Threshold 20 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0

Class-map: med-priority (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: mpls experimental topmost 1
0 packets, 0 bytes
5 minute rate 0 bps
Queueing
Output Queue: Conversation 266
Bandwidth 15 (%)
Bandwidth 15000 (kbps) Max Threshold 50 (packets)
(pkts matched/bytes matched) 0/0
(depth/total drops/no-buffer drops) 0/0/0

Class-map: class-default (match-any)
2134 packets, 166141 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Queueing
Output Queue: Conversation 267
Bandwidth 40 (%)
Bandwidth 40000 (kbps)
(pkts matched/bytes matched) 159/11082
(depth/total drops/no-buffer drops) 0/0/0
exponential weight: 9
mean queue depth: 0

class Transmitted Random drop Tail drop Minimum Maximum Mark
pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
0 460/48177 0/0 0/0 20 40 1/10
1 0/0 0/0 0/0 22 40 1/10
2 0/0 0/0 0/0 24 40 1/10
3 0/0 0/0 0/0 26 40 1/10
4 0/0 0/0 0/0 28 40 1/10
5 0/0 0/0 0/0 30 40 1/10
6 1676/118118 0/0 0/0 32 40 1/10
7 0/0 0/0 0/0 34 40 1/10
rsvp 0/0 0/0 0/0 36 40 1/10

Router-P1#

In this output, you can see that we have run some test traffic through these queues. Each of the 70 packets seen in the high priority queue was seen with an MPLS Experimental value of 3.

You should also notice that the default queue's WRED output shows that, in addition to the 460 packets with an IP Precedence value of 0, there were 1676 packets with IP Precedence values of 6. How is this possible, if all of the incoming traffic from the PE router with this IP Precedence value is marked for the real-time queue? These are actually OSPF packets generated internally within the MPLS part of the network. Since they haven't been marked with an MPLS experimental value, they are forwarded in the default queue.

See Also