Assigning a DSCP policy on the basis of the DSCP in IPv4 packets received from upstream devices

The preceding section describes how to forward a policy set by an edge (or upstream) switch. This option changes a DSCP policy in an IPv4 packet by changing its IP ToS codepoint and applying the priority associated with the new codepoint. (A DSCP policy consists of a differentiated services codepoint and an associated 802.1p priority.) You can use this option concurrently with the diffserv 802.1p priority option (above), as long as the DSCPs specified in the two options do not match.

To use this option to configure a change in policy:

Procedure
  1. Identify the DSCP used to set a policy in packets received from an upstream or edge switch.
  2. Create a new policy by using the qos dscp-map <code-point> priority <0-7> command to configure an 802.1p priority for the codepoint you will use to overwrite the DSCP that the packet carries from upstream.
  3. Use the qos type-of-service diff-services < mapped to DSCP > dscp < mapped from DSCP > command to change the policy on packets coming from the edge or upstream switch with the specified incoming DSCP.

Syntax:


qos type-of-service diff-services

Enables ToS Diff-serve QoS so that Diff-serve policy configurations can be applied to incoming packets that have matching codepoints.

Syntax:


qos type-of-service diff-services <current-codepoint> dscp <new-codepoint>

Configures the switch to select an incoming IP packet carrying the <current-codepoint> and then use the <new-codepoint> to assign a new, previously configured DSCP policy to the packet. The policy overwrites the <current-codepoint> with the <new-codepoint> and assigns the 802.1p priority specified by the policy.

Syntax:


no qos type-of-service

Disables all ToS classifier operation. Current ToS DSCP policies and priorities remain in the configuration and will become available if you re-enable ToS Diff-services.

Syntax:


no qos type-of-service [diff-services <codepoint>]

Deletes the DSCP policy assigned to the <codepoint> and returns the <codepoint> to the 802.1p priority setting it had before the DSCP policy was assigned, which is either a value from 0 - 7 or No-override.

Syntax:


show qos type-of-service

Displays a listing of codepoints with any corresponding DSCP policy reassignments for outbound packets. Also displays the 802.1p priority for each codepoint that does not have a DSCP remarking policy assigned to it.

Example

For example, suppose that you want to configure the following two DSCP policies for packets received with the indicated DSCPs.

Received DSCP

Policy DSCP

802.1p Priority

Policy Name (Optional)

001100

17

6

Level 6

001101

16

4

Level 4

  1. Determine whether the DSCPs already have priority assignments, which could indicate use by existing applications. This is not a problem as long as the configured priorities are acceptable for all applications using the same DSCP. (See Note on changing a priority setting. Also, a DSCP must have a priority configured before you can assign any QoS classifiers to use it. See Differentiated Services Codepoint (DSCP) mapping.)

  2. After configuring the DSCP policies for the codepoints you want to use, assign the policies to the codepoints in the selected packet type.

    An example of policy assignment to outbound packets on the basis of the DSCP in the packets received from upstream devices is shown below. The specified DSCP policies overwrite the original DSCPs on the selected packets, and use the 802.1p priorities previously configured.

    switch(config)# qos type-of-service diff-services 001100 dscp 17
    switch(config)# qos type-of-service diff-services 001101 dscp 16
    switch(config)# show qos type-of-service
      Type of Service : Differentiated Services
    
      Codepoint DSCP Policy | Priority
      --------- ----------- + -----------
      000000                | No-override
      000001                | No-override
      000010                | No-override
      000011                | No-override
      000100                | No-override
      000101                | No-override
      000110                | No-override
      000111                | No-override
      001000    001011      | 7
      001001                | No-override
      001010                | 1
      001011                | 7
      001100    010001      | 6
      001101    010000      | 4