Mapping of Classes to Queues

Traffic flows can be directed to a specific egress queue using the Class to Queue Mapping configuration. For achieving this, the traffic has to be classified using priority-map and L2 / L3 ACL configuration. Then a CLASS is associated with the flow and mapped to a required egress queue.

The configuration sequence for mapping traffic flows to specific egress queue is as follows:
  • Create the L2/L3 ACL for flow identification or create a priority-map entry for priority re-mapping purpose.
  • Identify the class with which the flow has to be associated.
  • Create the class-map entry for the class.
  • Associate the L2/L3 ACL or the priority map entry to the class-map entry.
  • Map a Class to queues.
  • Configure the policy map for the class.

The traffic is redirected to the best queue based on the following rules:

Note:

To assign traffic belonging to a particular class to a specific queue, configure the class to queue-mapping prior to configuring the policy for the Class.

The configuration steps for assigning L2 ACL-based flow to a specific egress queue are listed below.

  1. Enable QoS.

    Type the following:

    • Enter the Global Configuration Mode.
    iS5comm# configure terminal
    • Enable the QoS.
    iS5comm(config)# qos enable
  2. Create an access control list filter for specific VLAN packet on port 1.

    Type the following:

    • Create an access control list.
    iS5comm(config)# mac access-list extended 1007
    • Configure the ACL with the following parameters to permit the following packets.
      • any—for packets from any source IP address
      • any—for packets to any destination IP address
      • priority 2—for packets with priority 2 (this is a mandatory parameter)
    iS5comm(config-ext-nacl)# permit any any vlan 5 priority 2
    • Exit the ACL Configuration Mode
    iS5comm(config-ext-nacl)# exit
    • Enter Interface Configuration Mode.
    iS5comm(config)# interface gigabitethernet 0/1
    • Apply the created ACL to the selected interface, where 1007 is the ACL number and “in” stands for inbound packets related configuration.
    iS5comm(config-if)# mac access-group 1007 in
    • Exit the Interface Configuration Mode
    iS5comm(config-if)# exit
  3. Create a class map, set a class, and configure the match criteria for the class map with the criteria specified by the access list 1007 (already configured earlier as all packets for VLAN 5).

    Type the following:

    • Create a class map.
    iS5comm(config)# class-map 70
    • Configure the match criteria for the class-map.
    iS5comm(config-cls-map)# set class 70
    iS5comm(config-cls-map)# match access-group ip-access-list 1007
    iS5comm(config-cls-cmap)# exit
  4. Create new class maps for new classes for traffic to flow in different queues.

    Type the following:

    iS5comm(config)# queue-map class 70 queue-id 5
    iS5comm(config)# class-map 71
    iS5comm(config-cls-map)# set class 71
    iS5comm(config-cls-cmap)# exit
    iS5comm(config)# class-map 72
    iS5comm(config-cls-map)# set class 72
    iS5comm(config-cls-cmap)# exit
  5. Map the classes to queues.

    Type the following:

    iS5comm(config)# queue-map class 70 queue-id 6
    iS5comm(config)# queue-map class 71 queue-id 7
    iS5comm(config)# queue-map class 72 queue-id 8
  6. Create a meter.

    Type the following:

    The meter created by the command below will have the meter type as trTCM and its traffic components CIR=10000 kbps, CBS=1000, EIR= 100000, and EBS=100000 (corrected based on below)

    Where

    • trTCM—Two rate three color marker metering as defined by RFC 2698
    • color-mode—there are two options: aware for which the meter considers the pre-color of the packet and blind, for which the meter ignores the pre-color of the packet.
    • CIR—Committed Information Rate; this is the Rate at which a Frame Relay network agrees to transfer information under normal conditions, averaged over a minimum increment of time.
    • CBS —Committed Burst Size;
    • EIR—Excess Information Rate; the average rate at which excess traffic is to be policed
    • EBS—Excess Burst Size
    iS5comm(config)#meter 7
    iS5comm(config-meter )# meter-type trTCM color-mode blind cir 10000 cbs 1000 eir 100000 ebs 100000
    iS5comm(config-meter)# exit
  7. Create a policy map to apply on the packet before forwarding it.

    Type the following:

    iS5comm(config)# policy-map 70
    • Enter to set policy parameters such as meter and configure its parameters (actions), where
      • default-priority-type—select none for no PHB type configuration.
    iS5comm(config-ply-map)# set policy class 70 default-priority-type none
  8. Configure the conform / exceed / violate actions for the meter.

    Type the following:

    • Enter to set policy parameters such as meter and configure its parameters (actions), where
      • conform-action—configures action to be performed on the packet, when the packets are found to be In profile (conform
      • set-cos-transmit—sets the VLAN priority of the outgoing packet
      • set-de-transmit—sets the VLAN drop eligible indicator of the outgoing packet as 0
      • exceed-action—configures action to be performed on the packet, when the packets are found to be In profile (exceed) with chosen action “drop” (i.e. the packet to be dropped)
      • violate-action—configures action to be performed on the packet, when the packets are found to be out of profile; “drop” chosen here.
    iS5comm(config-ply-map)# set meter 7 set-conform-newclass 71
    iS5comm(config-ply-map)# set meter 7 conform-action set-cos-transmit 5 set-de-transmit 0
    iS5comm(config-ply-map)# set meter 7 set-exceed-newclass 72
    iS5comm(config-ply-map)# set meter 7 exceed-action set-cos-transmit 4 set-de-transmit 0
    iS5comm(config-ply-map)# set meter 7 violate-action drop
    iS5comm(config-ply-map)#end
  9. View the configuration detail.

    Type the following.

    iS5comm# show queue-map
    QoS Queue Map Entries
    ---------------------
    IfIndex    CLASS      PriorityType    Priority Value  Mapped Queue
    ---------- ---------- --------------- --------------- ---------------
    0          none       VlanPri         0               1
    0          none       VlanPri         1               2
    0          none       VlanPri         2               3
    0          none       VlanPri         3               4
    0          none       VlanPri         4               5
    0          none       VlanPri         5               6
    0          none       VlanPri         6               7
    0          none       VlanPri         7               8
    0          70         none            0               6
    0          71         none            0               7
    0          72         none            0               8
    
    iS5comm#
    show policy-map 70
    QoS Policy Map Entries
    ----------------------
    PolicyMapId  : 70
    IfIndex      : 0
    Class        : 70
    DefaultPHB   : None.
    MeterId      : 7
    ConNClass    : 0
    ExcNClass    : 0
    VioNClass    : 0
    ConfAct      : None.
    ExcAct       : None.
    VioAct       : Drop
    
    iS5comm#
    show meter 7
    QoS Meter Entries
    -----------------
    MeterId                      : 7
    Type                         : TRTCM
    Color Mode                   : Color Blind
    Interval                     : None
    CIR                          : 100
    CBS                          : 1200
    EIR                          : 500
    EBS                          : 1500
    NextMeter                    : None
    Status                       : Active
    iS5comm# show class-map
    ClassMapId                   : 70
    L2FilterId                   : 1007
    L3FilterId                   : None
    PriorityMapId                : None
    VlanMapId                    : None
    CLASS                        : 70
    PolicyMapId                  : 70
    PreColor                     : None
    Status                       : Active
    
    
    ClassMapId                   : 71
    L2FilterId                   : None
    L3FilterId                   : None
    PriorityMapId                : None
    VlanMapId                    : None
    CLASS                        : 71
    PolicyMapId                  : None
    PreColor                     : None
    Status                       : InActive
    
    
    ClassMapId                   : 72
    L2FilterId                   : None
    L3FilterId                   : None
    PriorityMapId                : None
    VlanMapId                    : None
    CLASS                        : 72
    PolicyMapId                  : None
    PreColor                     : None
    Status                       : InActive

Changing the Class to queue-ID mapping

Class to queue-id mapping has to be configured using a queue-map table prior to configuring the policy map for any flow. If the class to queue mapping is changed after the policy-map is configured, the change will not take effect. Hence it must be ensured that policy maps associated with this class are deleted and re-created once the class to queue mapping configuration is changed. Meter entries with conform / exceed / violate action associated with this class need to be re-created.

The configuration steps for modifying egress queue for existing L2 ACL based flow are listed below.

  1. Modify the mapping of the classes to queues by assigning new queue IDs. The previous IDs were 6, 7, and 8 respectively.

    Type the following:

    iS5comm(config)# queue-map class 70 queue-id 1
    iS5comm(config)# queue-map class 71 queue-id 2
    iS5comm(config)# queue-map class 72 queue-id 3
    Note:

    The following message appears: “Delete and re-create the policy-map and meter entries with conform / exceed / violate configuration already created for this CLASS (if already done).If not removed the earlier configured policy and/or meter information will not be updated int he hardware.

    To remedy that the existing policy map has to be deleted and recreated & configured. See below.
  2. Delete the existing policy map.

    Type the following:

    iS5comm(config)# no policy-map 70
  3. Re-create a policy map to be applied on the packet before forwarding it.

    Type the following:

    iS5comm(config)# policy-map 70
    • Enter to set policy parameters such as meter and configure its parameters (actions), where
      • default-priority-type—select none for no PHB type configuration.
    iS5comm(config-ply-map)# set policy class 70 default-priority-type none
  4. Configure the conform / exceed / violate actions for the meter.

    Type the following:

    • Enter to set policy parameters such as meter and its parameters (actions), where
      • conform-action—configures action to be performed on the packet, when the packets are found to be In profile (i.e. conforming).
      • set-cos-transmit—sets the VLAN priority of the outgoing packet.
      • set-de-transmit—sets the VLAN drop eligible indicator of the outgoing packet as 0.
      • exceed-action—configures action to be performed on the packet, when the packets are found to be In profile (exceed) with chosen action “drop” (i.e. the packet to be dropped)
      • violate-action—configures action to be performed on the packet, when the packets are found to be out of profile; “drop” is chosen here.
    iS5comm(config-ply-map)# set meter 7 set-conform-newclass 71
    iS5comm(config-ply-map)# set meter 7 conform-action set-cos-transmit 5 set-de-transmit 0
    iS5comm(config-ply-map)# set meter 7 set-exceed-newclass 72
    iS5comm(config-ply-map)# set meter 7 exceed-action set-cos-transmit 4 set-de-transmit 0
    iS5comm(config-ply-map)# set meter 7 violate-action drop
    iS5comm(config-ply-map)#end
  5. View the configuration detail.

    Type the following.

    iS5comm# show queue-map
    QoS Queue Map Entries
    ---------------------
    IfIndex    CLASS      PriorityType    Priority Value  Mapped Queue
    ---------- ---------- --------------- --------------- ---------------
    0          none       VlanPri         0               1
    0          none       VlanPri         1               2
    0          none       VlanPri         2               3
    0          none       VlanPri         3               4
    0          none       VlanPri         4               5
    0          none       VlanPri         5               6
    0          none       VlanPri         6               7
    0          none       VlanPri         7               8
    0          70         none            0               1
    0          71         none            0               2
    0          72         none            0               3
    
    iS5comm#
    show policy-map 70
    QoS Policy Map Entries
    ----------------------
    PolicyMapId  : 70
    IfIndex      : 0
    Class        : 70
    DefaultPHB   : None.
    MeterId      : 7
    ConNClass    : 0
    ExcNClass    : 0
    VioNClass    : 0
    ConfAct      : None.
    ExcAct       : None.
    VioAct       : Drop