Configuring classifier-based QoS

To use the classifier-based model to configure a QoS policy and apply it to a selected class of traffic on a port or VLAN interface, follow these steps:

Procedure
  1. Evaluate the types of traffic in your network and identify the traffic types that you want to prioritize or rate limit.
  2. Create an IPv4 or IPv6 traffic class using the class command to select the packets you want to manage.

    Context: Global configuration

    
    no class {ipv4 | ipv6} classname
    

    Defines the name of a traffic class and specifies whether a policy is to be applied to IPv4 or IPv6 packets, where classname is a text string (64 characters maximum). After you enter the class command, you enter the class configuration context to specify match criteria. A traffic class contains a series of match and ignore commands, which specify the criteria used to classify packets.

    A traffic class consists of match criteria, which consist of match and ignore commands.
    • The match commands define the values that header fields must contain for a packet to belong to the class and be managed by policy actions.

    • The ignore commands define the values which, if contained in header fields, exclude a packet from the policy actions configured for the class.
      NOTE:

      Enter match/ignore statements in the precise order in which you want their criteria to be used to check packets.

    The following match criteria are supported in match/ignore statements for inbound IPv4/IPv6 traffic:
    • IP source address (IPv4 and IPv6)

    • IP destination address (IPv4 and IPv6)

    • Layer 2 802.1Q VLAN ID

    • Layer 3 IP protocol

    • Layer 3 IP precedence bits

    • Layer 3 DSCP codepoint

    • Layer 4 TCP/UDP application port

    • VLAN ID

  3. Enter one or more match or ignore commands from the class configuration context to filter traffic and determine the packets on which policy actions will be performed.

    Context: Class configuration

    
    no [seq-number] [match | ignore] ip-protocol source-address destination-address [dscp codepoint] [precedence precedence-value] [tos tos-value] [vlan vlan-id]
    

  4. Create a QoS policy to perform QoS actions on selected packets by entering the policy qos command from the global configuration context.

    Context: Global configuration

    
    no policy qos policy-name
    

    Defines the name of a QoS policy and enters the policy configuration context.

    A traffic policy consists of one or more classes, and one or more QoS actions configured for each class of traffic. The configured actions are executed on packets that match a match statement in a class. No policy action is performed on packets that match an ignore statement.

    NOTE:

    Be sure to enter each class and its associated QoS actions in the precise order in which you want packets to be checked and processed by QoS actions.

    To configure the QoS actions that you want to execute on packets that match the criteria in a specified class, enter one or more class action commands from the policy configuration context:

    Context: Class configuration

    
    no [seq-number] class [ipv4 | ipv6] classname action qos-action [action qos action ...]
    

    Defines the QoS actions to be applied on a pre-configured IPv4 or IPv6 traffic class when a packet matches the match criteria in the traffic class. You can enter multiple action statements for the same traffic class.

    
    no [seq-number] class [ipv4 | ipv6] classname
    

    seq-number

    (Optional) Sequentially orders the QoS actions that you enter in a policy configuration. Actions are executed on matching packets in numerical order.

    Default: QoS action statements are numbered in increments of 10, starting at 10.

    class [ipv4 | ipv6] classname

    Defines the preconfigured traffic class on which the QoS actions in the policy are executed, and specifies whether the QoS policy is applied to IPv4 or IPv6 traffic in the class. The classname is a text string (64 characters maximum).

    NOTE:

    Multiple class action statements can be configured for different traffic classes in the same policy. The execution of QoS actions is performed in the order in which the actions are numerically listed in the policy.

    action qos-action [action qos-action ...]

    Configures the QoS action specified by the qos-action replaceable. The action is executed on any packet that matches the match criteria in the class. The action is not executed on packets that match ignore criteria.

    The complete no form of the class action command or the no seq-number command removes a QoS action from the policy configuration.

    The following QoS commands are supported by the qos-action replaceable:
    • rate-limit kbps
    • priority priority-value
    • ip-precedence precedence-value
    • dscp dscp-value

    To manage packets that do not match the match or ignore criteria in any class in the policy, and therefore have no QoS actions performed on them, enter an optional default class. The default class is placed at the end of a policy configuration and specifies the QoS actions to perform on packets that are neither matched nor ignored.

  5. (Optional) To configure a default class in a policy, enter the default-class command at the end of a policy configuration and specify one or more QoS actions to be executed on packets that are not matched and not ignored.

    Context: Class configuration

    
    no default-class action qos-action [action qos-action ...]
    

    Configures a default class that allows one or more QoS actions to be executed on packets that are not matched or ignored by any of the class configurations in a QoS policy. The default-class supports the same QoS commands as the class ipv4 |ipv6 action command: rate-limit, priority, ip-precedence, and dscp.

  6. Apply the QoS policy to inbound traffic on a port (interface service-policy in command) or VLAN (vlan service-policy in command) interface.
    The following restrictions apply to a QoS service policy:
    • Only one QoS policy is supported on a port or VLAN interface.

    • If you apply a QoS policy to a port or VLAN interface on which a QoS policy is already configured, the new policy replaces the existing one.

    • A QoS policy is supported only on inbound traffic.

    Because only one QoS policy is supported on a port or VLAN interface, ensure that the policy you want to apply contains all the required classes and actions for your configuration.

    To apply a QoS policy on a port or VLAN interface, enter one of the following commands from the global configuration context.

    Context: Global configuration

    
    interface port-list service-policy policy-name
    

    Configures specified ports with a QoS policy that is applied to inbound traffic on each interface.

    Separate individual port numbers in a series with a comma; for example, a1, b4, d3.

    Enter a range of ports by using a dash; for example, a1-a5.

    The QoS policy name you enter must be the same as the policy name you configured with the policy qos command in Step 2.

    
    vlan vlan-id service-policy policy-name in
    

    Configures a QoS policy on the specified VLAN that is applied to inbound traffic on the VLAN interface.

    Valid VLAN ID numbers range from 1 to 4094.

    The QoS policy name you enter must be the same as the policy name you configured with the policy command in Step 2.

  7. Determine the additional QoS configurations to apply to each QoS-capable device in your network and configure the appropriate policy.

    Optional: For 802.1p (CoS) priority settings to be included in outbound packets, configure tagged VLANs on the appropriate downstream links.