The following configuration is an example of how to implement the MPLS DiffServ Short Pipe model in Cisco IOS. Only the egress PE is shown, because this LSR has a different configuration from the previous example. Namely, the egress LSR forwards the packet based on the precedence or DSCP bits of the IP packet after removing the labels. The egress LSR does not copy the EXP bits to the precedence bits of the outgoing IP packet.
Example 12-7 shows the configuration of the egress PE for the MPLS DiffServ Short Pipe model.
Example 12-7 Egress PE: MPLS DiffServ Short Pipe Model
!Egress Interface: class-map IP-AF1 match ip precedence 2 4 ! policy-map output-qos class IP-AF1 bandwidth percent 40 random-detect precedence-based ! interface ethernet 3/0 service-policy output output-qos
Example 12-8 shows another configuration you can use for the egress PE in the Pipe model. In this configuration, the experimental bits 0 and 1 are mapped into qos-group 1, but with a different discard-class, discard-class 1 and 2, respectively. The different discard-class provides a different drop precedence. The experimental bits 2 and 3 are mapped to qos-group 2, with discard-class 1 and 2, respectively. On the egress interface, the packets from one qos-group go into one queue, but in that queue are packets that have two different drop precedence levels.
Example 12-8 Egress PE: MPLS DiffServ Pipe Model
!Ingress interface: class-map MPLS-AF11 match mpls experimental topmost 0 ! class-map MPLS-AF12 match mpls experimental topmost 1 ! class-map MPLS-AF21 match mpls experimental topmost 2 ! class-map MPLS-AF22 match mpls experimental topmost 3 ! policy-map set-MPLS-PHB class MPLS-AF11 set qos-group 1 set discard-class 1 class MPLS-AF12 set qos-group 1 set discard-class 2 class MPLS-AF21 set qos-group 2 set discard-class 1 class MPLS-AF22 set qos-group 2 set discard-class 2 ! interface ethernet 3/0 service-policy input set-MPLS-PHB !Egress interface: class-map IP-AF1 match qos-group 1 ! class-map IP-AF2 match qos-group 2 ! policy-map output-qos class IP-AF1 bandwidth percent 20 random-detect discard-class-based class IP-AF2 bandwidth percent 30 random-detect discard-class-based ! interface ethernet 3/1 service-policy output output-qos
The Table-Map Feature
The table-map is a conversion table between the different types of QoS that a packet can have. It allows you to map IP precedence, DSCP, MPLS EXP bits, qos-group, and Layer 2 cos information (the 802.1Q priority bits) via an MQC command. For example, you can map the IP precedence in the incoming IP packet to the EXP bits value of the outgoing labeled packet by using this table instead of specifying an MQC command for each value to be mapped. Table 12-5 shows the categories of QoS information that you can map and their values.
Table 12-5 Categories of QoS Information for Table-Map
Packet Marking Category | Value Range |
Cos | 0 to 7 |
IP precedence | 0 to 7 |
DSCP | 0 to 63 |
Qos-group | 0 to 99 |
MPLS EXP imposition | 0 to 7 |
MPLS EXP topmost | 0 to 7 |
Table 12-6 shows the To and From types that you can use in a table-map.
Table 12-6 To and From Packet-Marking Types
To Packet-Marking Type | From Packet-Marking Type |
Precedence | CoS QoS group |
DSCP | CoS QoS group |
CoS | Precedence DSCP |
QoS group | Precedence DSCP MPLS EXP topmost |
MPLS EXP topmost | QoS group |
MPLS EXP imposition | Precedence DSCP |
The commands in Example 12-9 show the set commands that you can use to apply a table-map. The first argument is the To type, and the second is the From type. You can also apply the set commands without a table-map. The command set mpls experimental topmost qos-group, for example, means that the qos-group packet-marking category is used to set the MPLS EXP value in the top label.
Example 12-9 set Commands to Apply a Table-Map
set precedence cos table table-map-name set dscp cos table table-map-name set cos precedence table table-map-name set cos dscp table table-map-name set qos-group precedence table table-map-name set qos-group dscp table table-map-name set mpls experimental topmost qos-group table table-map-name set mpls experimental imposition precedence table table-map-name set mpls experimental imposition dscp table table-map-name set qos-group mpls exp topmost table table-map-name set precedence qos-group table table-map-name set dscp qos-group table table-map-name
The global command to configure the table-map in Cisco IOS is table-map table-map-name map from from-value to to-value [default default-action-or-value]. The default keyword and default-action-or-value argument sets the default value (or action) to be used if a value is not explicitly designated.
Example 12-10 shows an example of a table-map. The qos-group is set via an input policy on the incoming interface according to the precedence value. The EXP bits are set on the outgoing topmost label—derived from the qos-group—via the table-map command that specifies that the values 0 and 3 are swapped and sets all other values to 7. So, for example, precedence 0 is copied to qos-group 0, and qos-group 0 is copied to MPLS EXP bits 3 through the table map-out.
Example 12-10Å@Example of a Table-Map
table-map map-out map from 0 to 3 map from 3 to 0 default 7 ! class-map match-all class-in match any class-map match-all class-out match any policy-map in class class-in set qos-group precedence policy-map policy-out class class-out set mpls experimental topmost qos-group table map-out ! interface Ethernet1/0 ip address 10.1.1.1 255.255.255.252 service-policy output policy-out mpls ip ! interface Ethernet1/1 ip vrf forwarding one ip address 192.168.1.2 255.255.255.252 service-policy input in
The Use of MPLS QoS for Ethernet over MPLS
So far in this chapter, the packet for which the QoS was set was an IP packet or a labeled packet. However, in the case of Ethernet over MPLS (EoMPLS), the forwarded packet is actually an Ethernet frame. If the frame is a non-VLAN Ethernet frame, it does not have QoS information embedded. If the frame is an 802.1Q frame, though, the Priority bits (P bits) in the 802.1Q header designate a QoS value. If a service provider carries the 802.1Q Ethernet frames over an MPLS network as in the case of point-to-point EoMPLS or VPLS, it would be nice if he could police the traffic and recolor it, if needed. You can do this in Cisco IOS. You can match the 802.1Q Priority bits in MQC by matching cos values in the class map. In Example 12-11, the EXP bits are set to 1 on the tunnel and VC label on the ingress PE, if the 802.1Q P bits are 1, 2, or 3.
Example 12-11 MPLS QoS for EoMPLS
interface Vlan50 no ip address ! mpls l2transport route 1.1.1.1 100 service-policy input foo ! class-map match-all foo-class match cos 1 2 3 ! policy-map foo class foo-class set mpls experimental 1 class class-default shape average 2000000 8000 8000
As you can see, the service provider can use traffic shaping to limit the rate of transmitted data to an average rate or committed information rate (CIR). This is useful in the EoMPLS application where the service provider limits the amount of traffic that a customer can send over the Ethernet interface toward the MPLS network.
Summary
Today the usage of quality of service (QoS) has become widespread. Most networks use some kind of QoS at some routers. MPLS networks could not stay behind for long. Most MPLS networks already have QoS, or the network administrators have started to implement QoS. The propagation of QoS in MPLS networks is done through the usage of the experimental bits in the labels.
The Experimental (EXP) bits in the top label in the label stack determine the QoS of the packet and how it will be treated when a label switching router (LSR) forwards it. This chapter explained how the propagation of the QoS information works for labeled packets. It also explained what happens to the EXP bits value when a label is popped, swapped, or pushed. This chapter continued by describing how this QoS behavior by LSRs can be used to implement one of the three MPLS DiffServ Tunneling models in Cisco IOS.
You saw how to make your MPLS network more scalable by moving the MPLS QoS from the PE to the CE router. You also saw how to use MQC to change the MPLS QoS information on an LSR and how this affects the propagation of the MPLS QoS information on the LSRs that are downstream of this router.
Chapter Review Questions
How many bits in the IP header can be used for QoS?
How many AF classes exist?
Name the three MPLS DiffServ models.
What is the difference between the Pipe and Short Pipe models?
What is the interface command to encapsulate all IP packets with an explicit NULL label?
What is TOS reflection?
What feature is used in Cisco IOS to alter the EXP bits?
What is the problem with PHP and QoS?
What is the solution to the problem in question 8?
On which labels can you change the EXP bits value?
Copyright © 2007 Pearson Education. All rights reserved.