Creating a DSCP policy based on TCP/UDP port number classifiers

The following procedure creates a DSCP policy for IP packets carrying the selected TCP or UDP port-number classifier.

Procedure
  1. Identify the TCP or UDP port-number classifier you want to use for assigning a DSCP policy.
  2. Determine the DSCP policy for packets carrying the selected TCP or UDP port number or range of port numbers.
    1. Determine the DSCP you want to assign to the selected packets. (This codepoint will be used to overwrite (re-mark) the DSCP carried in packets received from upstream devices.)

    2. Determine the 802.1p priority you want to assign to the DSCP.

  3. If necessary, use the qos dscp-map codepoint priority 0 - 7 command to configure the DSCP policy (codepoint and associated 802.1p priority) that you want to use to mark matching packets.
    NOTE:

    Prerequisite: A DSCP codepoint must have a preconfigured 802.1p priority (0 - 7) before you can use the codepoint to mark matching packets. If a codepoint you want to use shows No-override in the Priority column of the DSCP Policy table ( show qos dscp-map command), you must first configure a priority for the codepoint before proceeding (using the qos dscp-map priority command).

    
    qos dscp-map codepoint priority 0 - 7
    

    This command is required only if an 802.1p priority is not already assigned to the specified codepoint in the DSCP Policy table.

    Valid values for a DSCP codepoint are as follows:

    • A binary value for the six-bit codepoint from 000000 to 111111.

    • A decimal value from 0 (low priority) to 63 (high priority) that corresponds to a binary DSCP bit set

    • An ASCII standard (hexadecimal) name for a binary DSCP bit set
      af11

      (001010)

      af42

      (100100)

      af12

      (001100)

      af43

      (100110)

      af13

      (001110)

      ef

      (101110)

      af21

      (010010)

      cs1

      (001000) = precedence 1

      af22

      (010100)

      cs2

      (010000) = precedence 2

      af23

      (010110)

      cs3

      (011000) = precedence 3

      af31

      (011010)

      cs4

      (100000) = precedence 4

      af32

      (011100)

      cs5

      (101000) = precedence 5

      af33

      (011110)

      cs6

      (110000) = precedence 6

      af41

      (100010)

      cs7

      (111000) = precedence 7

      default

      (000000)

       
      Enter ? to display the list of valid codepoint entries.

      When the switch applies the specified DSCP policy to a packet, the priority determines the packet's queue in the outbound port to which it is sent. If the packet leaves the switch on a tagged port, it carries the 802.1p priority with it to the next downstream device. For IP packets, the DSCP will be replaced by the codepoint specified in this command.

      Default: No-override for most codepoints.

  4. Configure the switch to assign the DSCP policy to packets with the specified TCP or UDP port number or range of port numbers.
    
    qos [udp-port | tcp-port] [ipv4 | ipv6 | ip-all] 
     [port-number | range start end] dscp codepoint
    

    Assigns a DSCP policy to outbound packets having the specified TCP or UDP application-port number or port range, and overwrites the DSCP in these packets with the assigned codepoint value, where:

    • ipv4

      marks only IPv4 packets (default).

    • ipv6

      marks only IPv6 packets.

    • ip-all

      marks all IP traffic (both IPv4 and IPv6 packets).

    • port-number

      specifies a TCP/UDP port-number from 1 to 65535.

    • range start end

      specifies a range of TCP/UDP ports. If you specify a range, the minimum port number must precede the maximum port number in the range.

    • dscp codepoint
      overwrites the DSCP codepoint in the IPv4 ToS byte or IPv6 Traffic Class byte of matching packets with the specified value.Valid values for the DSCP codepoint are as follows:
      • A binary value for the six-bit codepoint from 000000 to 111111.

      • A decimal value from 0 (low priority) to 63 (high priority) that corresponds to a binary DSCP bit set

      • An ASCII standard name for a binary DSCP bit set Enter ? to display the list of valid codepoint entries.The DSCP value you enter must be currently associated with an 802.1p priority in the DSCP Policy table. The 802.1p priority and determines the packet's queue in the outbound port to which it is sent. If the packet leaves the switch on a tagged port, it carries the 802.1p priority with it to the next downstream device.The default DSCP codepoint is No-override. The DSCP codepoint is not overwritten in matching packets.The no form of the command deletes the specified UDP or TCP port number or range of port numbers as a QoS classifier. If you configured a range of port numbers as the QoS classifier, you must enter the entire range in the no command; you cannot remove part of a range.

    
    show qos tcp-udp-port-priority
    

    Displays a listing of all TCP and UDP QoS classifiers currently in the running-config file