QoS Marking

Marking is used to indicate the priority in traffic. The packets are marked to indicate higher priority traffic over lower priority traffic.

This chapter provides conceptual and configuration details for the QoS marking.

Marking Overview

Marking is a process, which helps to modify the quality of service for incoming and outgoing packets. You can use marking commands in traffic classes, which are referenced in the policy map.

Ingress marking techniques:

  • set cos

  • set dei

  • set precedence

  • set dscp

  • set exponential

  • set traffic-class

  • set qos-group

  • set discard-class

  • unconditional marking

Egress marking techniques:

  • set cos

  • set dei

  • conditional marking

Default Marking Behavior

When an ingress or egress interface adds VLAN tags or MPLS labels, it requires a default value for the CoS and EXP values that go into those tags and labels. The default value can be then overridden based on the policy map. The default value for CoS and EXP is based on a trusted field in the packet upon ingress to the system. The router implements an implicit trust of certain fields based on the packet type and ingress interface forwarding type (Layer 2 or Layer 3).

By default, the router does not modify the IP precedence or DSCP without a policy-map being configured. The default behavior is described below.

On an ingress or egress Layer 2 interface, such as xconnect, the outermost CoS value is used for any field that gets added in the ingress interface. If there is a VLAN tag that gets added due to a Layer 2 rewrite, the incoming outermost CoS value is used for the new VLAN tag. If an MPLS label is added, the CoS value would be used for the EXP bits in the MPLS tag.

On an ingress or egress Layer 3 interface (routed or label weighted for IPv4 packets), the three DSCP and precedence bits are identified in the incoming packet. For MPLS packets, the outermost label’s EXP bit is identified, and this value is used for any new field that gets added at the ingress interface. If an MPLS label is added, then the identified precedence, DSCP, or MPLS EXP value is used for the EXP bits in the newly added MPLS tag.

IP Precedence Value Settings

By default, Cisco IOS XR software leaves the IP precedence value untouched. This preserves the precedence value set in the header and allows all internal network devices to provide service based on the IP precedence setting. This policy follows the standard approach stipulating that network traffic should be sorted into various types of service at the edge of the network and that those types of service should be implemented in the core of the network. Routers in the core of the network can then use the precedence bits to determine the order of transmission, the likelihood of packet drop, and so on.

Because traffic coming into your network can have the precedence set by outside devices, we recommend that you reset the precedence for all traffic entering your network. By controlling IP precedence settings, you prohibit users that have already set the IP precedence from acquiring better service for their traffic simply by setting a high precedence for all of their packets.

TCP Establishment DSCP marking / Set IP Precedence

The Differentiated Services Code Point (DSCP) field in an IP packet which helps enables different levels of service to be assigned to network traffic. Marking is a process, which helps to modify QOS fields incoming and outgoing packets. You can use marking commands in traffic classes, which are referenced in the policy map.

IP Precedence compared to IP DSCP marking

If you need to mark packets in your network and all your devices support IP DSCP marking, use the IP DSCP marking to mark your packets because the IP DSCP markings provide more unconditional packet marking options. If marking by IP DSCP is undesirable, however, or if you are unsure if the devices in your network support IP DSCP values, use the IP precedence value to mark your packets. The IP precedence value is likely to be supported by all devices in the network.

You can set up to 8 different IP precedence markings and 64 different IP DSCP markings.

Conditional and Unconditional Marking

The class-based, Unconditional Packet Marking feature provides users with a means for efficient packet marking by which the users can differentiate packets based on the designated markings. The unconditional marking feature allows users to:
  • Mark packets by setting the layer-2 Class-Of-Service (COS) value.

  • Mark packets by setting the Drop Eligible Indicator (DEI) value based on the policy map.

  • Mark packets by setting the IP precedence bits or the IP differentiated services code point (DSCP) in the IP ToS or DSCP field.

  • Mark Multiprotocol Label Switching (MPLS) packets by setting the EXP bits within the imposed or topmost label.

Use QoS unconditional packet marking to assign packets to a QoS group. To set the QoS group identifier on MPLS packets, use the set qos-group command in policy map.

Packet marking as a policer action is conditional marking.

Understanding Unconditional Marking

Unconditional marking on Xconnect

Support Matrix for L2 Xconnect

QoS on Xconnect

COS

DEI

COS

Supported

Supported

DEI

Supported

Supported

Provided below, is the work flow to configure Unconditional Marking on Xconnect. A simple topology consisting of a router (NCS 4000) is considered, with ingress traffic.
  1. Configure LANPHY mode

    
    controller Optics0/5/0/6
     Port-mode ethernet framing packet rate 10GIG
    controller Optics0/3/0/3
     Port-mode ethernet framing packet rate 10GIG
    
  2. Configure L2VPN Xconnect

    
    interface TenGigE0/5/0/6
    no shutdown
     l2transport
    interface TenGigE0/3/0/3
     no shutdown
     l2transport
    l2vpn
     xconnect group test
      p2p test
       interface TenGigE0/5/0/6
       interface TenGigE0/3/0/3
  3. Configure Class Map

    
    class-map match-any COS7
    match cos 7
    end-class-map
    
  4. Configure Policy Map

    
    policy-map ingress_marking
    class COS7
    police rate 2 gbps
    !
    set cos 2
    set dei 1
    !
    class class-default
    !
    end-policy-map
    !
    
  5. Apply policy-map on an interface

    
    interface TenGigE0/5/0/6
    l2transport
    service-policy input ingress_marking
    

Unconditional Marking on VPWS

Support Matrix for VPWS

QoS on VPWS

COS

DEI

EXP

PRECEDENCE

DSCP

COS

Not supported

Not supported

Supported

Not supported

Not supported

DEI

Not supported

Not supported

Supported

Not supported

Not supported

EXP

Not supported

Not supported

Not supported

Not supported

Not supported

PRECEDENCE

Not supported

Not supported

Not supported

Not supported

Not supported

DSCP

Not supported

Not supported

Not supported

Not supported

Not supported

Provided below is the workflow to configure unconditional marking on VPWS. The topology consists of two NCS 4000 series routers (R1 and R2), with standard ingress and egress traffic, connected to each other by a Flex LSP tunnel. From R1 to R2, COS-1 is marked to MPLS EXP 7. From R2 to R1, MPLS EXP 7 is marked to COS-5.

  • Configuration on R1

    
    class-map match-any COS1
    match cos 1
    end-class-map
    !
     
    policy-map POLICY1
    class COS1
      set traffic-class 1
      set mpls experimental imposition 7
      police rate 10 mbps peak-rate 20 mbps
     
     
    interface HundredGigE0/6/0/5.100 l2transport
    encapsulation dot1q 100
    service-policy input POLICY1
  • Configuration on R2

    
    class-map match-any mpls_experimental_topmost_7
    match mpls experimental topmost 7
     
    policy-map POLICY2
    class mpls_experimental_topmost_7
      set traffic-class 7
      set cos 5
     
     
    interface HundredGigE0/2/0/1
    service-policy input POLICY2
    ipv4 address 1.76.1.2 255.255.255.0

Understanding Conditional Marking

Conditional Marking on VPWS

Support Matrix for VPWS

QoS on VPWS

COS

DEI

EXP

PRECEDENCE

DSCP

COS

Not supported

Not supported

Supported

Not supported

Not supported

DEI

Not supported

Not supported

Supported

Not supported

Not supported

EXP

Not supported

Not supported

Not supported

Not supported

Not supported

PRECEDENCE

Not supported

Not supported

Supported

Not supported

Not supported

DSCP

Not supported

Not supported

Supported

Not supported

Not supported

Provided below is the workflow to configure conditional marking on VPWS. The topology consists of two NCS 4000 series routers (R1 and R2), with standard ingress and egress traffic, connected to each other by a Flex LSP tunnel. From R1 to R2, COS 1 is marked to EXP 7 for CIR and EXP 1 for PIR. From R2 to R1, EXP 7 is marked to COS 7.

  • Configuration on R1

    
    class-map match-any COS1
    match cos 1
    end-class-map
    
    
    policy-map POLICY1
    class COS1
      set qos-group 1
      police rate 10 mbps peak-rate 20 mbps
    
    
    interface HundredGigE0/6/0/5.100 l2transport
    encapsulation dot1q 100
    service-policy input POLICY1
    
    
    class-map match-all qos-group-1-discard-class-0
    match qos-group 1
    match discard-class 0
    end-class-map
    !
    class-map match-all qos-group-1-discard-class-1
    match qos-group 1
    match discard-class 2
    end-class-map
    !
    
    policy-map POLICY-CONDITIONAL-EGRESS-1
    class qos-group-1-discard-class-0
      set mpls experimental imposition 7
    
    class qos-group-1-discard-class-1
      set mpls experimental imposition 1
    !
    
    interface HundredGigE0/3/0/0
    service-policy output POLICY-CONDITIONAL-EGRESS-1
    ipv4 address 1.76.1.1 255.255.255.0
    !
    
  • Configuration on R2

    
    class-map match-any mpls_experimental_topmost_7
    match mpls experimental topmost 7
    end-class-map
    !
    
    policy-map POLICY2
    class mpls_experimental_topmost_7
      set qos-group 7
      set discard-class 0
    !
    
    interface HundredGigE0/2/0/1
    service-policy input POLICY2
    ipv4 address 1.76.1.2 255.255.255.0
    !
    
    class-map match-all qos-group-1-discard-class-1
    match qos-group 1
    match discard-class 1
    end-class-map
    !
    
    policy-map POLICY-CONDITIONAL-EGRESS-2
    class qos-group-1-discard-class-1
      set cos 5
    !
    
    interface TenGigE0/2/0/7/1.100 l2transport
    encapsulation dot1q 100
    service-policy output POLICY-CONDITIONAL-EGRESS-2
    !