Details of QoS IP ToS

IP packets include a Type of Service (ToS) byte. The ToS byte includes:
  • A Differentiated Services Codepoint (DSCP): This element is composed of the upper 6 bits of the ToS byte). There are 64 possible codepoints.
    • The default qos configuration includes some codepoints with 802.1p priority settings for Assured- Forwarding (af), Expedited Forwarding (ef, codepoint 101110), and Class Selector (cs). Others are unused (listed with No-override for a Priority).

    See The ToS codepoint and precedence bits for an illustration of the default DSCP policy table.

    Using the qos dscp-map command, you can configure the switch to assign different prioritization policies to IPv4 packets having different codepoints. As an alternative, you can configure the switch to assign a new codepoint to an IPv4 packet, along with a corresponding 802.1p priority (0-7). To use this option in the simplest case, you would:

    1. Configure a specific DSCP with a specific priority in an edge switch.

    2. Configure the switch to mark a specific type of inbound traffic with that DSCP (and thus create a policy for that traffic type).

    3. Configure the internal switches in your LAN to honor the policy.

    (For example, you could configure an edge switch to assign a codepoint of 000001 to all packets received from a specific VLAN, and then handle all traffic with that codepoint at high priority.)For a codepoint listing and the commands for displaying and changing the DSCP Policy table, see Differentiated Services Codepoint (DSCP) mapping.
  • Precedence Bits: This element is a subset of the DSCP and is composed of the upper 3 bits of the ToS byte. When configured to do so, the switch uses the precedence bits to determine a priority for handling the associated packet. (The switch does not change the setting of the precedence bits.) Using the ToS Precedence bits to prioritize IPv4 packets relies on priorities set in upstream devices and applications.

The following figure, shows an example of the ToS byte in the header for an IPv4 packet, and illustrates the diffserv bits and precedence bits in the ToS byte. (Note that the Precedence bits are a subset of the Differentiated Services bits.)

The ToS codepoint and precedence bits
How the switch uses the ToS configuration

Outbound port

ToS option:

802.1p (value = 0 - 7)

Differentiated services

IP packet sent out an untagged port in a VLAN

Depending on the value of the IP Precedence bits in the packet’s ToS field, the packet will go to one of eight outbound port queues in the switch. See the table in Overview of QoS settings.

For a given packet carrying a ToS codepoint that the switch has been configured to detect: Depending on the 802.1p priority used, the packet will leave the switch through a queue as defined in the table in Overview of QoS settings.If No-override (the default) has been configured for a specified codepoint, then the packet is not prioritized by ToS and, by default, is sent to the “normal priority” queue.
IP packet sent out an untagged port in a VLAN

Same as above, plus the IP Precedence value (0 - 7) will be used to set a corresponding 802.1p priority in the VLAN tag carried by the packet to the next downstream device. See the table below.

Same as above, plus the Priority value (0 - 7) will be used to set a corresponding 802.1p priority in the VLAN tag carried by the packet to the next downstream device. Where No-override is the assigned priority, the VLAN tag carries a “0” (normal priority) 802.1p setting if not prioritized by other QoS classifiers.

ToS IP-precedence bit mappings to 802.1p priorities

ToS byte IP precedence bits

Corresponding 802.1p priority

Service priority level

000

1

Lowest

001

2

Low

002

0

Normal

003

3

 

004

4

 

005

5

 

006

6

 

007

7

Highest