Creating a policy based on the VLAN-ID

Procedure
  1. Determine the VLAN-ID to which you want to assign a DSCP policy.
  2. Determine the DSCP policy for packets carrying the selected VLAN-ID.
    1. Determine the DSCP you want to assign to the selected packets. (This codepoint will be used to overwrite 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.

    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 (qos dscp-map priority command).

  4. Configure the switch to assign the DSCP policy to packets with the specified VLAN-ID.
    qos dscp-map codepoint priority 0 - 7

    This command is optional if a priority has already been assigned to the codepoint . The command creates a DSCP policy by assigning an 802.1p priority to a specific DSCP.

    When the switch applies this priority 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 codepoint in the packet header is replaced by the codepoint specified in this command.

    Default: For most codepoints, No-override

Example:


vlan vid qos dscp codepoint

Assigns a DSCP policy to IP packets carrying the specified VLAN ID, and overwrites the DSCP in these packets with the assigned codepoint value.

  • 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 policy includes an 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.Default: No-override

Syntax:


no vlan vid qos

Removes a global QoS classifier for the specified VLAN.

Syntax:


show qos vlan-priority

Displays a listing of all QoS VLAN-ID classifiers currently in the running-config file.See: example.

  • Determine if the DSCP codepoints that you want to use to remark packets already have an 802.1p priority assigned, which could indicate use by existing applications (show qos dscp-map command). This is not a problem as long as the configured priorities are acceptable for all applications using the same DSCP.

  • A DSCP codepoint must also have a priority configured before you can use it to mark matching packets.
    Viewing the current DSCP-priority mapping in the DSCP policy table
  • Configure the priorities for the DSCPs.
    Assign priorities to the selected DSCPs
  • Assign the DSCP policies to the selected VLAN IDs and display the result.
    switch(config)# vlan 1 qos dscp 000010
    switch(config)# vlan 20 qos dscp 000010
    switch(config)# vlan 30 qos dscp 000101
    switch(config)# vlan 40 qos dscp 000111
    
    switch(config)# show qos vlan-priority
    
      VLAN priorities
    
      VLAN ID Apply rule  | DSCP   Priority
      ------- ----------- + ------ -----------
      1       DSCP        | 000010 1
      20      DSCP        | 000010 1
      30      DSCP        | 000101 5
      40      DSCP        | 000111 7
    
The switch will now apply the DSCP policies to packets received on the switch with the specified VLAN-IDs. This means the switch will:
  • Overwrite the original DSCPs in the selected packets with the new DSCPs specified in the above policies.

  • Assign the 802.1p priorities in the above policies to the appropriate packets.

Assigning DSCP policies to packets

Assigning DSCP policies (codepoint and associated 802.1p priority) to packets with the specified VLAN IDs:

VLAN-ID

DSCP

Priority

40

000111

7

30

000101

5

20

000010

1

1

000010

1