The default behaviour for MPLS routers is Penultimate Hop Popping. The last hop router generates the implicit null to indicate that the penultimate router should pop the label. However, if the network is configured for QoS based on MPLS EXP bits, then QoS is lost between penultimate router and last hop router.
Therefore, in this scenario (for example, the Pipe model with QoS) where the last router requires the QoS info in the Transport label, it uses the Explicit null to indicate the penultimate hop router should not pop the label. It sends with label value of 0 but with other fields including EXP bits intact. This way QoS treatment is preserved between penultimate router and last hop router. Explicit null should be configured manually in last hop router. These are reserved labels.
By default, Cisco IOS routers advertise implicit NULL with LDP. To change this, use:
router (config) # mpls ldp explicit-null
Then to carry over the QoS markings in the MPLS Packet, it is necessary to apply a qos-group on the ingress interface of the last hop router using the Modular QoS CLI. This is done by creating: a class-map which matches the topmost EXP bits in the MPLS label; a policy-map which applies the class-map to set the QOS group, and then apply the policy map to the ingress interface (from the Penultimate Provider Router). The QoS group value is a number between 0 and 99 that is set using the set qos-group command.
class-map MPLS-EXP1
match mpls experimental topmost 1
!
class-map MPLS-EXP2
match mpls experimental topmost 2
!
class-map MPLS-EXP2
match mpls experimental topmost 3
!
policy-map set-MPLS-PHB
class MPLS-EXP1
set qos-group 1class MPLS-EXP2
set qos-group 2
class MPLS-EXP3
set qos-group 3
!
interface ethernet 1/0
service-policy input set-MPLS-PHB
You can use a table map with a qos-group, or take it from the 802.1P of the original frame (“set qos-group cos”).
Then, on the egress interface to the Customer Edge router, it is important to translate the qos-group into the appropriate Per Hop Behaviour (PHB). This done by creating: a class map to match the QOS group; a policy map to provide the appropriate behaviour for the class, and then applying to the outbound interface to the Customer.
class-map IP-AF1
match qos-group 1
!
class-map IP-AF2
match qos-group 2!
policy-map PHB_on_Out
class IP-AF1
bandwidth percent 20
random-detect discard-class-basedclass IP-AF2
bandwidth percent 10
random-detect discard-class-based!
interface ethernet 1/0
service-policy output PHB_on_Out