From CCIE Study Wiki
Cisco QoS tools use several different methods to mark packets for future QoS manipulations.
Theory
Packet fields that QoS can mark: IP header, LAN trunking headers, frame relay header, and the ATM cell header.
The IP header has a 1-byte ToS field (Type of Service). Initially, for QoS purposes this field was further divided int a 3 bit IP Precedence (IPP) field. The complete list of values from this field are (listed in name - decimal value - binary value format):
- routine - precedence 0 - 000
- priority - precedence 1 - 001
- immediate - precedence 2 - 010
- flash - precedence 3 - 011
- flash override - precedence 4 - 100
- critic/critical - precedence 5 - 101
- internetwork control - precedence 6 - 110
- network control - precedence 7 - 111
The rest of the ToS field (5 bits) was used to indicate a particular type of QoS service.
The Differentiated Services (DiffServ) concept came along later, and required a redefinition of the TOS byte. DiffServ now breaks the ToS field into one 6-bit subfield called the Differentiated Services Code Point (DSCP) and a 2-bit Explicit Congestion Notification feature. The first three bits of the DiffServ field are the older IPP field.
There have been a couple of different ways the DSCP field has been proposed to be used.
- RFC 2475 - Defines 8 different class selector levels that are backward compatible with IPP values. The class levels range from the default of (CS0) and CS7 - the values for these fields match up with the IPP values for the first three bits followed by three 0's for the last three bits. Example level CS2 has a value of 010000, which matches up the the IPP precedence 2 value of 010 on the first three bits. Packets with higher CS value should be give better queuing preference then packets with lower CS value.
- RFC 2597 - Assured Forwarding Per-Hop-Behavior (PHB) - uses the DSCP packet to define 4 classes for queuing, along with three levels of drop probability within each queue. This gives a total of 12 DSCP possible values. The names of these DSCPs are in the format of AFxy", where x is one of four queues, and y is one of three drop priority values. The higher of value of "x", the better queuing treatment the packet should get. The higher the value of "y", the worse the drop treatment gets. List of AF DSCP Values (using same name-decimal value-binary value format):
- AF11 - 10 - 001010
- AF12 - 12 - 001100
- AF13 - 14 - 001110
- AF21 - 18 - 010010
- AF22 - 20 - 010100
- AF23 - 22 - 010110
- AF31 - 26 - 011010
- AF32 - 28 - 011100
- AF33 - 30 - 011110
- AF41 - 34 - 100010
- AF42 - 36 - 100100
- AF43 - 38 - 100110
- RFC 2598 - Defines a specific DSCP field with a decimal value of 46 called Expedited Forwarding (EF). Packets having a DSCP field with this value should be given queuing preference so they experience minimal latency but still be policed to prevent them from taking over a link. Has a binary value of 101110.
Both the DSCP and IPP fields are good fields for marking because the IP header stays intact throughout the IP network, unlike layer 2 fields.
When the Ethernet header includes a trunking header, Ethernet can support a 3-bit marking field.
- 802.1Q - QoS field is the 3 most-significant bits of the 2-byte Tag Control field. These three bits are called the user-priority bits.
- ISL - Has the Class of Service (CoS) field, which is the three least-significant bits from the 1-byte user field.
- Both Frame Relay and ATM have a single QoS bit that is used to indicate drop probability. Named the DE (discard eligibility) bit in Frame and Cell Loss probability bit in ATM.
- MPLS also has a 3-bit field called the MPLS Experimental bit used for QoS marking.
Classification is done generally on the ingress of a packet only, and only if the particular interface supports that field. Marking is done on egress only, and again only if that interface supports that field.
When performing class-based marking with the MQC, you will be using verious set subcommands under the policy-map command to mark the various fields in your packets.
Commands
- set precedence ip-precedence-value - marks the IP precedence value for IPv4 packets only
- set ip precedence ip-precedence-value - marks the IP precedence value for IPv4 AND IPv6 packets
- set dscp dscp-value - marks the DSCP value for IPv4 packets only
- set ip dscp dscp-value - marks the DSCP value for IPv4 AND IPv6
- set cos cos-value
- set fr-de
- set qos-group group-id
- show policy-map {policy-map-name interface-spec-class}
Default Settings
Verification
Troubleshooting, Tips, and Tricks
- Note that just because a certain AFxy value has a higher binary value, it is not necessarily a "better" value to have it terms of QoS purposes.
- CB marking requires CEF to be enabled!
- Route-maps can also call set commands to mark packets.
- Cisco IOS assigns an IP precedence of 6 to routing protocol packets on the control plane. Specifically, Cisco IOS marks these IP-based control packets: Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Enhanced Interior Gateway Routing Protocol (EIGRP) hellos, and keepalives. Telnet packets to and from the router also receive an IP precedence value of 6. The assigned value remains with the packets when transmitted into the network.
Online Resources
Have something to contribute? See a mistake on this page? Have a hint or a link to share?
The CCIE Study Wiki is open to everyone to edit! All you need to do is to create an account to start contributing.
Please be sure to follow our posting guidelines when editing the wiki.
Maybe you have just have some thoughts or suggestions for this entry?
Use the Discussion link on the top or bottom menu to create or join the CCIE forum post on this topic.
You can also go straight to the CCIE Forums and start a new discussion in the forum of your choice.
If you'd rather just contact us with your thoughts, we'd love to hear what you have to say.