|
Cisco IOS in a Nutshell Authors: Boney J. Published year: 2006 Pages: 90-91/1031 |
Chapter 11. Quality of ServiceQuality of Service, or QoS, enables you to tell the router (or switch) how to handle packets in times of network congestion. With QoS, we can either tell the router how to deal with network congestion when it occurs, how to try to avoid the congestion in the first place, or a combination of both. A typical example of QoS is giving certain important applicationsnamely, voice over IP (VoIP)a much higher priority on your network than other less important traffic (such as the latest peer-to-peer file-sharing program). When do you need QoS? Well, if you are throwing more bandwidth at your network latency problems, you might want to consider developing a QoS policy to improve your network performance. Setting up QoS is far cheaper than upgrading network bandwidth. It may only delay your need for additional bandwidth, but it will also improve performance for your highest priority applications. While a properly configured QoS environment improves the speed of important network applications, it does nothing for a poorly designed network. If your network problems are caused by a poor network design, QoS is nothing more than a bandage and might even compound the problem. Evaluate your network design before implementing QoS. Methods for implementing QoS include congestion management, congestion avoidance , traffic shaping, and traffic policing. Cisco has introduced some advanced tools for QoS management as well: Modular QoS CLI (MQC), Class-Based Weighted Fair Queuing (CBWFQ), and Network-Based Application Recognition (NBAR). These new tools are covered in this chapter. For now, before we start looking at different QoS methods, we need to understand how a router marks a packet, which designates it for QoS services. |
11.1. MarkingMarking allows us to identify a packet so that other routers within our network won't have to repeat the steps of identifying the packet. Preferably, this marking occurs on our edge routers, which do the heavy work of identifying and classifying packets. Once classified , the packets can be marked with an IP precedence value that our downstream routers can use for their QoS features, like WFQ or WRED. Marking occurs in the packet's type of service (ToS) byte, also called the IP Precedence value. 11.1.1. Different Types of ToSAn IPv4 packet header includes one byte of ToS information. The ToS byte is usually set on the edge routers of a network to be used by internal routers on the network. 11.1.1.1. IPv4 ToS ByteInside the ToS byte, bits 0 through 2 are the Precedence values and bits 3 through 5 are the Type of Service values, while bit 7 is always zero. Table 11-1 shows the values of the bits. Table 11-1. ToS Precedence values
11.1.1.2. Differentiated Services Codepoint (DSCP)Differentiated Services Codepoint (DSCP), also known as DiffServ, is a new model of QoS. DSCP redefines the ToS byte to a DSCP field. In IP Precedence, the first three bits of the ToS byte are typically assigned priorities in IP. With DSCP, the first six bits assign the Precedence value. This redefining of the precedence size allows DSCP values to be backward-compatible with IP Precedence values by matching the three most significant bits. For example, IP Precedence value 4 (100) maps to IP DSCP value 100 000. There are 64 standard DSCP values (0-63). The default DSCP value is 000 000. These values can be organized into categories as shown in Table 11-2. Table 11-2. DSCP Precedence categories
11.1.1.3. Assured ForwardingAssured Forwarding service was defined in RFC 2697, which developed the idea of predefined levels and classes of traffic. Although the numbers are confusing, you can see in Table 11-3 that we assign traffic levels (low, medium, and high) for each AF value. For example , AF11 has a low drop precedence and AF12 has a medium drop precedence, which means AF11 is "better" than AF12. All the values for AF define levels of network service above the Best Effort service , which of course is 0. The corresponding DSCP number is in parentheses. Table 11-3. AF values for DSCP with corresponding drop precedences
11.1.1.4. Expedited ForwardingAnother option for marking packets is EF, which stands for Expedited Forwarding (High Priority) and has a DSCP value of 46. This allows service providers to expedite traffic by offering this traffic the highest queue sizes and other settings to guarantee forwarding of this expedited traffic. 11.1.1.5. DSCP exampleYou can see the DSCP values by looking at the possible values for a match:
Router(config)#
class-map match-all classmap1
Router(config-cmap)#
match dscp ?
<0-63> Differentiated services codepoint value
af11 Match packets with AF11 dscp (001010)
af12 Match packets with AF12 dscp (001100)
af13 Match packets with AF13 dscp (001110)
af21 Match packets with AF21 dscp (010010)
af22 Match packets with AF22 dscp (010100)
af23 Match packets with AF23 dscp (010110)
af31 Match packets with AF31 dscp (011010)
af32 Match packets with AF32 dscp (011100)
af33 Match packets with AF33 dscp (011110)
af41 Match packets with AF41 dscp (100010)
af42 Match packets with AF42 dscp (100100)
af43 Match packets with AF43 dscp (100110)
cs1 Match packets with CS1(precedence 1) dscp (001000)
cs2 Match packets with CS2(precedence 2) dscp (010000)
cs3 Match packets with CS3(precedence 3) dscp (011000)
cs4 Match packets with CS4(precedence 4) dscp (100000)
cs5 Match packets with CS5(precedence 5) dscp (101000)
cs6 Match packets with CS6(precedence 6) dscp (110000)
cs7 Match packets with CS7(precedence 7) dscp (111000)
default Match packets with default dscp (000000)
ef Match packets with EF dscp (101110)
By using DSCP, we can assign values to our traffic classes in our policy map. This allows us to mark our traffic for further QoS handling later in our network by other routers. In this example, we assign our class1 traffic a DSCP value of 8 and our class2 traffic a DSCP value of 40. This means that now that the DSCP value has been set on our edge routers, all our intermediate routers can identify packets by simply looking at the DSCP value in order to determine QoS actions such as providing low-latency treatment to voice packets.
! Create our policy map
policy-map policy1
class class1
bandwidth 50
! set this traffic to DSCP 8
set dscp 8
class class2
bandwidth 80
! set this traffic to DSCP 40
set dscp 40
|
|
Cisco IOS in a Nutshell Authors: Boney J. Published year: 2006 Pages: 90-91/1031 |