Assigning a DSCP policy based on VLAN-ID

This option assigns a previously configured DSCP policy (codepoint and 802.1p priority) to outbound IP packets having the specified VLAN-ID (VID). The switch performs the following:

Procedure
  1. Selects an incoming IP packet on the basis of the VLAN-ID it carries.
  2. Overwrites the packet’s DSCP with the DSCP configured in the switch for such packets.
  3. Assigns 802.1p priority configured in the switch for the new DSCP (see Differentiated Services Codepoint (DSCP) mapping).
  4. Forwards the packet through the appropriate outbound port queue.

Steps for creating a policy based on VLAN-ID classifier:

  1. Determine the VLAN-ID classifier 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 through the source-port from upstream devices.)

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

  3. Configure the DSCP policy by using qos dscp-map to configure the priority for each codepoint (see Differentiated Services Codepoint (DSCP) mapping for more information).

  4. Configure the switch to assign the DSCP policy to packets with the specified VLAN-ID.

Syntax:


vlan <vid> qos dscp <codepoint>

Assigns a DSCP policy to packets carrying the specified VLAN-ID, and overwrites the DSCP in these packets with the assigned <codepoint> value. This 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 downstream device.

(Default: No-override)

Syntax:


no vlan <vid> qos

Removes QoS classifier for the specified VLAN.

Syntax:


show qos vlan-priority

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

For example, suppose that you wanted to assign this set of priorities:

VLAN-ID

DSCP

Priority

40

15

7

30

16

5

20

17

1

1

17

1

Assign the DSCP policies to the selected VIDs and display the result.
An example of the completed VID-DSCP priority configuration is shown below.
switch(config)# vlan 1 qos dscp 17
switch(config)# vlan 20 qos dscp 17
switch(config)# vlan 30 qos dscp 16
switch(config)# vlan 40 qos dscp 15

switch(config)# show qos vlan-priority

 VLAN priorities

  VLAN ID Apply rule  | DSCP   Priority
  ------- ----------- + ------ -----------
  1       DSCP        | 010001 1
  20      DSCP        | 010001 1
  30      DSCP        | 010000 5
  40      DSCP        | 001111 7

In the example above, 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.