<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SGT CCIE &#187; QoS</title>
	<atom:link href="http://www.sgtccie.com/blog/category/ccie/qos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtccie.com/blog</link>
	<description>A man on a mission</description>
	<lastBuildDate>Sun, 02 Oct 2011 14:22:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>QoS: Essentials, Part III</title>
		<link>http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/</link>
		<comments>http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/#comments</comments>
		<pubDate>Sun, 24 May 2009 06:41:09 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[CCIE]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[QoS]]></category>
		<category><![CDATA[ccip]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[ccnp]]></category>
		<category><![CDATA[congestion]]></category>
		<category><![CDATA[farva]]></category>
		<category><![CDATA[fragmentation]]></category>
		<category><![CDATA[FRF.12]]></category>
		<category><![CDATA[interleaving]]></category>
		<category><![CDATA[link efficiency]]></category>
		<category><![CDATA[multilink ppp]]></category>
		<category><![CDATA[nbar]]></category>
		<category><![CDATA[policing]]></category>
		<category><![CDATA[quality of service]]></category>
		<category><![CDATA[RED]]></category>
		<category><![CDATA[RTP]]></category>
		<category><![CDATA[super troopers]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[traffic-shaping]]></category>
		<category><![CDATA[WRED]]></category>

		<guid isPermaLink="false">http://www.sgtccie.com/blog/?p=328</guid>
		<description><![CDATA[<a href="http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/" title="QoS: Essentials, Part III"></a>In the previous installment of this series (QoS: Essentials, Part II), we discussed types of marking, NBAR,  and Congestion management/queuing techniques. With part III, I intend on discussing Traffic shaping /policing, Congestion avoidance, and link efficiency mechanisms. Because of the sheer amount of information &#8230;<p class="read-more"><a href="http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/" title="QoS: Essentials, Part III"></a><p>In the previous installment of this series (<a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/">QoS: Essentials, Part II</a>), we discussed types of marking, NBAR,  and Congestion management/queuing techniques. With part III, I intend on discussing Traffic shaping /policing, Congestion avoidance, and link efficiency mechanisms. Because of the sheer amount of information in QoS, I cannot cover all of the QoS spectrum, but I hope to instill the foundational information that QoS is built upon. As usual, without further ado, let&#8217;s get to it!</p>
<p><br class="spacer_" /></p>
<h3><span style="font-size: small;">Traffic Shaping</span></h3>
<p>Let me paint a picture for you. Here in Florida, we have a lot of toll plaza&#8217;s. You know, you drive up, pay some absurd amount, then continue on your journey. Now let&#8217;s picture that there is a toll plaza, and 2 miles down the road there has been an accident. Thankfully, the accident did not block all 4 lanes of traffic, but instead only 3. Traffic is moving along but very slowly. As a result, there is heavy congestion at the scene of the accident. The city, having some foresight, doesn&#8217;t want the congestion at the scene to get any worse&#8230;and decides to only send one car through the toll plaza every 30 seconds. Since they are putting slowing the rate of traffic at the booth, it allows things to clear up a bit at the end, and traffic to flow smoothly again- although at a slower rate.</p>
<p>So how does that apply to shaping in a network? Well, in a nutshell, shaping will enqueue excess packets (above the configured rate), and &#8216;release&#8217; them onto the wire at the configured shaping rate. As a result, you can slow your transmit rate without just cutting off any traffic above a certain rate. Let&#8217;s say you administer a spoke that heads into a frame relay cloud- Your negogiate a CIR (committed information rate- the rate you wish to send under stable conditions) of 64k. Let&#8217;s assume your access rate, or AR, is 192k. You want to configure shaping at 64k, so that you don&#8217;t send more data then the distant end can handle..which may result in delay, jitter, or even loss of packets due to policing. Speaking of policing&#8230;</p>
<h3><span style="font-size: small;">Policing (&#8220;Oh S!)%!! Not another ticket..&#8221;</span></h3>
<p><span style="font-size: small;">How many of you reading this have seen speed traps setup by the local law enforcement officers? I&#8217;m sure anyone who has driven a car once or twice in their lifetime has. Let&#8217;s imagine we have a rookie right out of the academy, a little bit hot headed and power hungry. For the sake of this article (and to plug a hilarious movie), we&#8217;ll call the rookie &#8220;Farva&#8221;. Farva decides he wants to hit the roads and setup a speed trap. Since the speed limit is 55 Mph, he decides to not only ticket, but arrest <strong><em>anybody</em></strong> going over 55 Mph<em>. <strong>This means 56 Mph gets you a cell next to a fellow named &#8220;Tiny&#8221; with a propensity for middle-aged caucasian males.</strong></em></span></p>
<p><span style="font-size: small;">Once again, how does this apply to our network? Well, remember how we shaped the traffic leaving the spoke towards the frame relay network to 64k? Let&#8217;s imagine that we hadn&#8217;t shaped it at all. The service provider said &#8220;you get 64k to us, that&#8217;s it&#8221;. Well, in the event we start sending what our actual AR (access rate, remember? the line rate..) is, 192k in this case&#8230;then the service provider is going to implement policing and drop any traffic above the configured CIR. Obviously they could drop traffic at whatever rate they chose to, but in our example, it&#8217;s anything above the agreed upon CIR. In summation, policing enforces the CIR, making sure that nothing extra gets sent through. It is worth a brief mention that policing can be configured to mark down a packets IP Precedence or DSCP value so that it will get through, but later stands a better chance at being dropped then other packets. In times of network congestion, this will ensure the marked down packets are dropped first, but still allow them through if traffic is not heavy.</span></p>
<h3><span style="font-size: x-small;"><span style="font-size: small;">Bc&#8230;just a little info..</span></span></h3>
<p><span style="font-size: x-small;"><strong></strong></span></p>
<p><span style="font-size: small;">This is generally the place where I would discuss different shaping terminology, but I already described some of them here: </span><a href="http://www.sgtccie.com/blog/2009/05/frame-relay-traffic-shaping-frts/"><span style="font-size: small;">FRTS</span></a><span style="font-size: small;">, so check that out if you feel the need. I will, however give you this:</span></p>
<p><span style="font-size: small;">To calculate Bc, there&#8217;s a couple of ways to do it. For the sake of the following conversation, lets say our CIR is 64Kbps, and we are using the default Tc values of 125ms (over 8 intervals). What&#8217;s our Bc? There&#8217;s a few ways to do it:</span></p>
<p><span style="font-size: small;">Bc = Tc (125ms) x CIR (64) = 8000 bits per interval</span></p>
<p><span style="font-size: small;">OR</span></p>
<p><span style="font-size: small;">Bc = CIR (64000) / 8 (amount of intervals) = 8000 bits per interval</span></p>
<p><span style="font-size: small;">As you can see, both are correct. Whichever one you use is really up to you. Either way, our Bc will be the amount of data sent per time interval in order to conform to our shaping rate.</span></p>
<p><br class="spacer_" /></p>
<h3><span style="font-size: medium;"><strong><span style="font-family: mceinline;">Congestion Avoidance</span></strong></span></h3>
<p><span style="font-size: small;">When the queues on an interface fill, by default, the next packets that try to be added to that queue will be tail dropped. In order to solve the problem of tail drop, you can either configure the queues to be larger, or use congestion avoidance. Here&#8217;s the idea: When tail drop is employed, all packets are treated as equals..not good! This means that delay-sensitive traffic such as VoIP/Video is no different then say Limewire, or HTTP traffic.  This means that several TCP segments can be dropped at once, causing those hosts to reduce their send window, then raise each of their transmit rates at the same time..resulting in bandwidth utilization that looks like a very sharp wave of high utilization and very low utilization. Congestion avoidance techniques such as WRED will help us avoid these issues. We&#8217;ll discuss those later, but first, let&#8217;s go over exactly why the default behavior of tail drop is bad.<br />
</span></p>
<p><span style="font-size: small;"><br />
</span></p>
<h3><strong><span style="font-size: small;">Tail drop, and why it&#8217;s bad</span><br />
</strong></h3>
<p>Tail drop has several downfalls. The first one that comes to mind is that tail drop treats all packets as equals (as mentioned above). The second, is that with tail drop you are open to TCP synchronization and not efficiently using your links. TCP Synchronization, is cause by the natural behavior of TCP segments. A TCP segment will begin opening it&#8217;s window, gradually increasing it&#8217;s transmit rate, until it drops segments, then reduce the window by 50%.  The TCP hosts will build their transmit rate (open their window) slowly again, and upon reaching the maximum utilization, it will repeat this process. Now once you throw in multiple TCP sessions, you encounter <strong>TCP synchronization. </strong>The downfall to this is that when all of the sessions cut their window by 50%, you have a period of relative quiet in the network where very little traffic is being sent, followed by bursts of TCP traffic. The final issue with tail drop is that the more aggressive traffic (say, HTTP or limewire traffic, as mentioned above) will fill the queues quickly, leaving the less aggressive flows to be tail dropped.</p>
<p><br class="spacer_" /></p>
<h3><span style="font-size: small;"><strong>Weighted Random Early Detection (RED/WRED)</strong></span></h3>
<p>WRED is based on RED. The basic idea behind RED is this- as the router&#8217;s queue&#8217;s fill, RED randomly selects TCP packets to be dropped, thus preventing synchronization as described above, and preventing congestion and eventually tail drop. What WRED does differently then RED, however, is allow you to be a more precise when dropping traffic. WRED joins with the powers of IP Precedence/DSCP to allow you to drop the lower precedence packets first, while allowing the higher precedence traffic to pass. In essence, WRED &#8216;predicts&#8217; congestion, and gives you some decision on what can be dropped if the network is experiencing congestion. Based on statistics, WRED will drop traffic more often from a high volume sender then a low. What this means is, the more &#8216;offending&#8217; TCP hosts will have their traffic lost as they cross the threshold (more on that in a minute), as opposed to the low volume sender. Now, it is important to remember that we are dealing with TCP packets here. If the bulk of the traffic is UDP, WRED will not be effective.</p>
<p>Now, it&#8217;s important to note that the &#8216;core&#8217; of WRED is no different then RED. The only difference is that WRED is more selective about <strong>what</strong> is dropped, not <strong>how</strong>. Here&#8217;s a rough framework of how these techniques operate:</p>
<ul>
<li>Packet is received, and the average queue depth is checked. If it&#8217;s below the minimum threshold, it is queued and sent out the proper interface. If it&#8217;s above the minimum threshold, it is either queued or dropped on a percentage based on the MPD (Mark probablity denominator). The MPD simply put, is the maximum percentage of packets that WRED will discard. If MPD is 16, using the forumlua of 1/MPD (1/16 in our example), the max discard rate would be 6%. If we made the MPD 10, it would be 10% (1 divided by 10). </li>
</ul>
<p>Here is a collection of random notes I have thrown together as it relates to RED/WRED:</p>
<ul>
<li>RED/WRED use an exponential weighting constant to determine the average queue depth. The lower this is, the more quickly the average queue depth will change, and by raising it it will react slower. By default it is 9, and can be changed with the <strong>random-detect exponential-weighting-constant X</strong> command</li>
<li>RED differs from tail drop in the sense that tail drop occurs when the queue is full- RED may begin dropping all incoming packets even if the queue is not full&#8230;if you set the max threshold low, it will discard them even if the queue isn&#8217;t full.</li>
<li>RED drops above the min threshold at a linear rate, based on the MPD (1/MPD is the formula, so default MPD of 10 means 1/10, or 10% max discard rate)</li>
<li>WRED cannot operate with other queuing techniques at the physical interface. If you configure CBWFQ/LLQ, you must configure WRED within each individual class. When WRED is enabled on the physical interface, only FIFO queuing is used. This can be seen with a <strong>show queueing interface s1/0</strong></li>
<li>WRED weights packets on the following: Average queue depth (found using the exponential weighting constant, default of 9), Min &amp; Max threshold (dependent upon the DSCP/Precedence value), MPD (see two bullets above)</li>
<li>Enabling WRED (random-detect) disables WFQ</li>
<li>WRED defaults to being IP Precedence based, but you can specify it to work on DSCP instead with <strong>random-detect dscp-based</strong></li>
<li>If using DSCP based WRED, you use the following command to alter the thresholds per DSCP value: <strong>random-detect dscp af21 40 50. </strong>This command would make the DSCP value AF21&#8242;s minimum threshold at 40, and maximum at 50. You can see the effect of this command by doing a <strong>show queueing interface s1/0</strong> again.</li>
</ul>
<p>Below you&#8217;ll find a graph that I created to demonstrate RED&#8217;s behavior. You can see that when traffic crosses the minimum threshold, RED begins dropping traffic at a linear rate, up to the maximum discard rate, or MPD, which is by default, 10%. After that, it will cross the max threshold, and drop all traffic. <br class="spacer_" /></p>
<p><img class="aligncenter size-full wp-image-371" title="wred" src="http://www.sgtccie.com/blog/wp-content/uploads/2009/05/wred.jpg" alt="wred" width="728" height="359" /><br class="spacer_" /></p>
<p><br class="clear" /></p>
<p><br class="spacer_" /></p>
<h3><strong>Link Efficiency Mechanisms</strong></h3>
<ul>
<li><strong>Multilink PPP (MLP)</strong></li>
<li><strong>Frame Relay Fragmentation (End to End FRF.12)</strong></li>
<li><strong>Header Compression (RTP Header compression, TCP header compression)</strong></li>
</ul>
<p><br class="spacer_" /></p>
<h3><strong>Link Efficiency</strong></h3>
<p>Link efficiency may not strike you as an important feature of QoS, however it is when you are the one paying for the bandwidth! In these days of the rough economy and financial uncertainty- getting the most out of our money is key..especially when it comes to business. Bandwidth costs money, after all. Link efficiency can be broken down into a couple of categories, Compression, and link fragmentation/interleaving tools. Compression is the act of compressing the packet (or the number of bytes in the packet), so there is fewer bytes to transmit across the link. Fragmentation is essentially chopping up the larger packets into smaller ones. To understand interleaving, let&#8217;s say we have a large packet waiting to transmit, with a small packet that is delay-sensitive (such as voice) waiting behind it. If the small packet waits for the large packet to serialize (be put onto the wire), it may wait too long and exceed the acceptable delay/jitter. By fragmentation and interleaving, we are chopping the large packets into smaller pieces, and inserting parts of the voice packet in between the large one. Let&#8217;s first discuss compression..</p>
<p><strong>C</strong>ompression is not difficult to understand..well, the concept at least- agreed? There are a couple types of compression I&#8217;d like to discuss, Payload compression, and Header compression. Here&#8217;s a quick rundown:</p>
<p><strong>Payload compression: </strong><em>Compresses the headers and user data. Uses more CPU cycles.  Here I am mostly referring to Layer 2 compression such as &#8216;Stacker&#8217; or &#8216;Predictor&#8217;. Stacker is more CPU intensive but uses less memory. Use &#8220;compress stac&#8221; at the interface to use stacker. Predictor is more memory intensive. Use &#8220;compress predictor&#8221; to use Predictor. It is worth mentioning that predictor only supports PPP and LAPB, whereas Stacker supports most Point-to-point layer 2 protocols.</em></p>
<p><strong>Header Compression: </strong>If you were to examine packets, you&#8217;d see that the headers are very similar..header compression is based on this..and as a result uses very little CPU. The two common types of header compression are <em>TCP and RTP header compression</em>. TCP is best used with relatively small TCP packets, since it reduces the header from 40 bytes to anywhere from 3 to 5 bytes. The best way to see why TCP header compression is not so great with larger packets, is to consider that we saved about 35 bytes in our header compression of say a 56 byte packet (40 bytes being in the header)..but what if our packet was 1300 byes? We&#8217;d compress about the same amount of bytes, and it would be a relatively small savings byte-wise..almost not worth it. RTP header compression is best with voice traffic, and will generally compress the headers a little bit more then TCP (2-4 bytes down from 40). An interesting note, if fast switching or CEF is not enabled on an interface, and then you enable RTP header compression, the interface will process-switch the traffic. NOT good!</p>
<p><strong>Multilink PPP</strong></p>
<p>Out of the few link efficiency mechanisms listed above, this is the one many people have heard of- usually before the others. Let&#8217;s say you have two slow serial links, both running PPP to the same location..Multilink PPP allows you to bundle them and treats them as one link. This provides layer 2 redundancy as one of those links can drop and traffic will still flow- although at the much slower speed of the single link. There&#8217;s several other benefits that multilink provides which we&#8217;ll go over..</p>
<p><span style="color: #0000ff;">Multilink interleaving-</span> Interleaving simply takes two separate streams of data, and &#8216;interleaves&#8217; them, sending (in our case) delay-sensitive traffic in between the large datagrams. As you may have guessed, this is especially helpful with delay sensitive applications.</p>
<p><span style="color: #0000ff;">Multilink fragmentation-</span> Multilink <span style="color: #000000;">Fragmentation is &#8216;chopping up&#8217; large datagrams into several smaller ones, but using multilink headers on each of the smaller datagrams. </span></p>
<p><span style="color: #000000;">As a side note, me being a frame relay nut, love things like MLP over Frame relay (MLPoFR). If you&#8217;re interested in that stuff too, check out what cisco.com has to say. I could probably dedicate a whole article to MLP, so I would look for that in the future..<br />
</span></p>
<p><span style="color: #000000;"><a href="http://www.cisco.com/en/US/tech/tk1077/technologies_tech_note09186a00800b6098.shtml#topic6">Designing and Deploying Multilink PPP over Frame Relay and ATM</a></span></p>
<p><span style="color: #000000;">That is all for now, folks. I was going to go into FRF.12 and MLP LFI into detail, but I ran out of steam to be quite honest. More to come at another time most likely! Enjoy&#8230;</span></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtccie.com/blog/2009/05/qos-essentials-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QoS: Essentials, Part II</title>
		<link>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/</link>
		<comments>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 20:56:09 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[QoS]]></category>
		<category><![CDATA[atm]]></category>
		<category><![CDATA[CCIE]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[ccnp]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[classification]]></category>
		<category><![CDATA[congestion]]></category>
		<category><![CDATA[DSCP]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[frame relay]]></category>
		<category><![CDATA[marking]]></category>
		<category><![CDATA[mpls]]></category>
		<category><![CDATA[nbar]]></category>
		<category><![CDATA[quality of service]]></category>

		<guid isPermaLink="false">http://www.sgtccie.com/blog/?p=47</guid>
		<description><![CDATA[<a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/" title="QoS: Essentials, Part II"></a>In QoS: Essentials, Part I, we discussed what QoS is, classifying/marking traffic, and trust boundaries. In Part II, we will get into the actual types of marking, do an overview of NBAR, and finally get into Congestion management/Queuing. Ready? Types &#8230;<p class="read-more"><a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/" title="QoS: Essentials, Part II"></a><p>In QoS: Essentials, Part I, we discussed what QoS is, classifying/marking traffic, and trust boundaries. In Part II, we will get into the actual types of marking, do an overview of NBAR, and finally get into Congestion management/Queuing. Ready?</p>
<p><strong>Types of Marking</strong>:</p>
<p>There are several different ways to mark, and each one is suited for a special situation. For example, if you&#8217;re running QoS over frame relay, you&#8217;d use the Frame Relay DE (discard elgibility) bit, whereas if you&#8217;re using ATM, you&#8217;d opt for the CLP (Cell loss priority) bit, etc. For now, we are going to simply discuss the different types. First, it is important to note ahead of time that we are going to be discussing markings that are used on layer 2, and some that are used on layer 3. Here are the breakdowns:</p>
<p><br class="spacer_" /></p>
<div><img class="aligncenter size-full wp-image-50" title="markings" src="http://www.sgtccie.com/blog/wp-content/uploads/2009/03/markings.jpg" alt="markings" width="325" height="148" /></div>
<p><br class="spacer_" /></p>
<div style="text-align: left;">
<ul style="text-align: left;">
<li>CoS (Class of Service): CoS is very common in a LAN environment, as it is marked at Layer 2. In the graphic below, we have an 802.1Q frame, with the PRI field (used for CoS) inside a 4 byte tag, where you find the Type ID (TPID), will always be <span class="content">0&#215;8100 in order to identify the frame as an IEEE 802.1Q frame. Next we have the PRI field, which is 3 bits long (8 total values, 0-7), then the CFI, and VLAN ID. The key part here is to remember the PRI field is 3 bits, and can have 8 possible values. Thus our CoS values can be anywhere from zero up to seven. To give you some perspective on this, most Cisco IP phones will tag their traffic with a CoS of 5 by default, putting it into the critical category. This makes sense, since VoIP traffic is very sensitive to delay/jitter. </span></li>
</ul>
<p><img class="aligncenter size-full wp-image-52" title="8021q_p_frame_cos" src="http://www.sgtccie.com/blog/wp-content/uploads/2009/03/8021q_p_frame_cos.jpg" alt="8021q_p_frame_cos" width="690" height="218" /></p>
<p><br class="space_" /><br class="space_" /><br class="space_" /><br class="space_" /><br class="space_" /><br />
 <br class="space_" /><br class="space_" /><br class="space_" /><br class="space_" /></p>
<ul style="text-align: left;">
<p><br class="space_" /></p>
<li><strong>DE bit:</strong> The Discard Elgibility bit is used in Frame relay environments. Here&#8217;s the concept. The USPS mail guy does his usual mail run, and heads back to the office to pick up more mail. Upon arriving, he realizes he has entirely too much to take, so he takes only the unmarked pieces of mail, and leaves the ones with a red marking behind..or drops them. Essentially all that happens with the DE bit is that you are telling nodes along the path that this packet *can* be dropped before others do <em>in times of network congestion- </em>or when the router cannot handle all of the traffic. The other end does not have to act on this bit at all, however. If it does choose to, however, the packets with the DE bit set will be dropped before those with no bit set. </li>
<p><br class="spacer_" /></p>
<li><strong>CLP (Cell Loss Priority):</strong> The CLP bit works the same as the DE bit in concept, except will be used in ATM cells.</li>
<p><br class="spacer_" /></p>
</ul>
</div>
<div style="text-align: left;">
<ul>
<li><strong>IP Precedence:</strong> Now we&#8217;re talking about Layer 3. In 1981, the ToS byte was used to set a certain level of service for that packet. Inside the byte was IP precedence (3 bits, the same as CoS), a ToS field (yes, a ToS field within a ToS byte, which was 4 bits), then the remaining 7 bits were unused. IP Precedence is fine, but DiffServ is quickly becoming standard, with engineers opting for DSCP marking, as it can be more grainular. Instead of 0-5 IP Precedence levels, you have from 0-63 with DSCP. That being said, DSCP is backward compatible with IP Precedence..there are 8 DSCP values that map to IP Precedence values. If a network running IP Precedence receives a packet marked with DSCP, it will simply read the first 3 bits of the DSCP, which it thinks is just a regular IP Precedence mark. That&#8217;s another time and place, however! </li>
<p><br class="spacer_" /></p>
<li><strong>DSCP (Differentiated Services Code Point):</strong> The ToS byte has been redefined as the DSCP field, with the 6 most signifigant bytes making up the DSCP value, and the last two bits being the ECN, or Explicit Congestion Notification bits. As I said, DSCP is backward compatible with IP Precedence, so if a system receives an IP packet with a DSCP value, remember that it will only read the most signifigant 3 bits, and treat it as IP Precedence. With DSCP, you set the DSCP value, which in turn causes a DiffServ node to act in a certain way towards that packet..this is called <em>Per-Hop Behavior</em>. In a nutshell, the node reads the DSCP, and realizes it is part of a group (or behavior aggregate..BA for short), and treats it the same way for the rest of the packets belonging to that BA.</li>
<p><br class="spacer_" /></p>
<li><strong>MPLS EXP:</strong> Ok, this one is kind of odd. Without diving into MPLS too deep, here is a breakdown. MPLS packets can be thought of as a regular IP packet with a 4 byte (or more) MPLS header inside it. The IP packet (with MPLS header inside..) is then encapsulated in a Layer 2 protocol, such as ethernet. It is then sent. Because of the fact that it is technically in a layer 3 packet, but encapsulated by layer 2, the MPLS header can almost be considered Layer 2 1/2. The MPLS header consists of only 4 fields, the label (which is basically like a color that is marked on the packet), the EXP bits (3 bits to be exact), BS bit (bottom-of-stack), and TTL. Inside the EXP bits, you have the same values as you do for CoS, or IP Precedence.</li>
<p><br class="spacer_" /></p>
</ul>
</div>
<p><strong>NBAR: Digging deep&#8230;</strong></p>
<p>Prepare to be amazed! NBAR, also known as Network Based Application Recognition..is incredible. NBAR is a feature found in Cisco IOS, which can allow you to check traffic statistics, protocol discovery, and classify your traffic&#8230;for you! Let&#8217;s say you decide you want to implement QoS on your network. The first step is to identify traffic and requirements, right? Well, with NBAR, you can simply issue the following on the interface you wish to monitor:</p>
<p><code>SGTccie(config-if)#ip nbar protocol-discovery</code></p>
<p>In order to actually see the traffic statistics, we&#8217;d then issue the following command from enable mode:</p>
<p><br class="spacer_" /></p>
<div><code>SGTccie#show ip nbar protocol-discovery</code></div>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>It is worth mentioning CEF is required to run NBAR. Also, when using the &#8220;<em>show ip nbar protocol-discovery</em>&#8221; command, it will show you all interfaces unless you add &#8220;interface X&#8221; after it. NBAR can also save you a lot of time. Once we get to QoS configuration, you will see. The old way of doing things was to configure extended ACL&#8217;s listing port numbers and IP&#8217;s, and etc. Instead of &#8220;access-list 101 permit ip any host 192.168.1.1 eq www&#8221;, we now use &#8220;match protocol http&#8221;. Nice!</p>
<p><br class="spacer_" /></p>
<p><strong>Congestion Management/Queuing&#8230;waiting in line&#8230;</strong></p>
<p>Ahh, congestion management. Running fiber everywhere along with 1GB ethernet everywhere is great..but congestion still happens. Why? Many reasons, really..poor QoS implementation (or none!), poorly designed networks, outdated equipment, etc..the list goes on and on. Generally, however, the point of congestion is almost always where traffic from multiple sources aggregate onto a single link. Picture 10 access-layer switches connecting to one distribution-layer switch, which only has a 100MB link to the core. You could easily have 400 users&#8217; traffic flowing to the core on that one link. Another scenario would be where you have a slow WAN link (pretty common!). Another way you could think of it is: Congestion occurs when the rate of input for incoming traffic exceeds the rate of output. In english? When going from high speed interfaces down to low speed interfaces you are prone to congestion. It&#8217;s no different then a theatre filled with people trying to get out of two doors at once..they can only move so fast!</p>
<p>Queuing is a temporary form of congestion management. It will ease some issues with congestion, but the long-term fix is fairly obvious- getting more capacity. This is not always feasible, unfortunately. So what can we do? We can alter the order that traffic leaves the node, so the low-priority traffic will be dropped first, and not the high priority (VoIP, critical applications, etc) traffic. By default, however, you will experience FIFO (First In, First Out) on interfaces that are faster then 2.048Mbps. Weighted Fair Queuing is used on interfaces slower then 2.048Mbps by default..but we&#8217;ll get into that in a bit. Depicted below is the way FIFO software queuing works. It is key to mention that there is only one hardware queue..and it uses FIFO. When we discuss creating new queues, and assigning traffic to certain queues, we are discussing the software queue only. As you can see below, FIFO treats all traffic equally, meaning the sensitive VoIP traffic will have to wait in line behind the web traffic. Not ideal!</p>
<p><br class="spacer_" /></p>
<div><img class="aligncenter size-full wp-image-348" title="fifo_queue2" src="http://www.sgtccie.com/blog/wp-content/uploads/2009/03/fifo_queue2.jpg" alt="fifo_queue2" width="558" height="108" />
</div>
<p><br class="spacer_" /></p>
<p><strong>Priority Queuing </strong></p>
<p>Priority Queuing, or PQ, consists of four queues: high, medium, normal, and low. By default, all packets will be assigned to the normal queue when using PQ. PQ is a pretty harsh Queuing method, which generally leaves lower-priority queues starved. PQ works by always giving the high priority queue the right of way, so to speak. If there is something in the high queue, it is sent before any other traffic. If the high queue is empty, it will check the medium queue..send one packet from there, then move down to the low, and start the cycle over. What you get is the possibility of the queues below high not getting enough bandwidth, since the high queue is taking it all. The idea is almost right (treating the high priority traffic as such), but the implementation is a little off. Let&#8217;s look at some better options.</p>
<p><strong>Round Robin (RR)</strong></p>
<p>Round robin contrasts heavily in comparison to Priority Queuing. The Round Robin process passes one packet from one queue at a time, effectively (almost) dividing the bandwidth almost equally. This is assuming the packet sizes are almost the same size, however. If one queue consistently has packet sizes much larger then the rest, it will take more bandwidth then the rest. RR does a good job of dealing with queue starvation, but does not prioritize at all. It can also be somewhat unpredictable as to actual queue usage.</p>
<p><strong>Weighted Round Robin (WRR)</strong></p>
<p>WRR is a modification of RR, where each queue receives a weight, and as a result of the weight, receives that portion of the bandwidth. WRR allows you to prioritize to some degree, but can also be somewhat unpredictable as some queues may use more bandwidth then planned.</p>
<p><strong>Weighted Fair Queuing (WFQ)</strong></p>
<p>As I mentioned before, WFQ is the default queuing method used on interfaces that are slower then 2.048Mbps. WFQ is important to know because as we&#8217;ll find later, it is implemented in both LLQ and CBWFQ..which are popular methods of queuing these days. WFQ is flow-based, meaning that once it receives a flow, it is assigned to a FIFO queue. A flow consists of packets that have the same source IP, destination IP, Layer 4 protocol (TCP/UDP), IP Precedence, TCP/UDP source and destination ports. WFQ creates queues on the fly for each flow, so the number of queues can vary greatly.</p>
<p><strong>Class-Based Weighted Fair Queueing (CBWFQ)</strong></p>
<p>CBWFQ divides traffic into classes (that are configured by the user), which are assigned their own respective queue. Although each queue can use more bandwidth then configured for, they can have a minimum bandwidth guarantee, so that even in times of congestion, they will get that amount of bandwidth. CBWFQ can create up to 64 queues, with each one being a FIFO queue. It is worth noting that you can configure the class-default queue to be a WFQ. The class-default queue is used for all undefined traffic. Bear in mind that while the CBWFQ functions with WFQ as a whole, once the traffic has been divided up into it&#8217;s respective queue, they are FIFO. Think of it like this, you are sending traffic into separate lines based on preference, but once in that line, they are considered equal. CBWFQ is a big improvement over previous queuing methods, however it still falls short as it relates to voice or video applications. You&#8217;ll note that CBWFQ provides no method of identifying a priority queue..this can hurt applications sensitive to delay. To solve these issues we move on to LLQ!</p>
<p><strong>Low Latency Queuing (LLQ)</strong></p>
<p>At this point we can agree what we need is a queuing method that will give priority to delay-sensitive traffic, but at the same time not leave all other queues starved for bandwidth. Do you remember the issue with priority queuing? PQ gives priority to one queue- which is great, but leaves the other queues starved in times of congestion. WFQ is good, as it doesn&#8217;t leave flows starved, but it also provides no guarantee to any particular queues. LLQ solves these issues. LLQ is essentially a CBWFQ with at least one strict-priority queue. What does this mean? It means one queue receives priority, however that queue is <em>policed</em>, meaning in times of congestion it cannot use more bandwidth than is configured.</p>
<p><br class="spacer_" /></p>
<p><strong>Ahhh..sigh of relief!</strong></p>
<p>Here we are, at the end of Part II! As you have noticed by now, QoS can definitely be daunting, but if you take the time to tackle the theory behind it, it really isn&#8217;t that difficult. The difficulty (for me at least), has always been in the theory as opposed to the implementation! In Part III we will discuss Traffic shaping/policing, link efficiency, and congestion avoidance. Look forward to seeing you!</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>QoS: Essentials, Part I</title>
		<link>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/</link>
		<comments>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 01:51:11 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[QoS]]></category>
		<category><![CDATA[CCIE]]></category>
		<category><![CDATA[ccip]]></category>
		<category><![CDATA[ccna]]></category>
		<category><![CDATA[ccnp]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[CLP]]></category>
		<category><![CDATA[DE]]></category>
		<category><![CDATA[DSCP]]></category>
		<category><![CDATA[frame relay]]></category>
		<category><![CDATA[marking]]></category>
		<category><![CDATA[MPLS EXP]]></category>
		<category><![CDATA[quality of service]]></category>

		<guid isPermaLink="false">http://www.sgtccie.com/blog/?p=14</guid>
		<description><![CDATA[<a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/" title="QoS: Essentials, Part I"></a>Many of you reading this have been mystifyed by terms like WFQ, WRED, Jitter, or DiffServ. My aim in Part I of QoS: Essentials, is to take some of the mystique surrounding Quality of Service away. Let&#8217;s get to it! &#8230;<p class="read-more"><a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/" title="QoS: Essentials, Part I"></a><p style="text-align: left;">Many of you reading this have been mystifyed by terms like WFQ, WRED, Jitter, or DiffServ. My aim in Part I of QoS: Essentials, is to take some of the mystique surrounding Quality of Service away. Let&#8217;s get to it!</p>
<p style="text-align: left;"><strong>What is QoS?</strong><br />
While in Iraq, we stayed in tiny trailers with 2 soldiers sharing a room. It wasn&#8217;t horrible, but let&#8217;s just say you got to know your roommate a little bit more then you wanted to due to the close proximity. Two people was OK, compared to what some people had to do! Our commander was given his own trailer, because well, he was more important then the &#8220;foot soldiers&#8221; or &#8220;average joes&#8221;. If something happened to most people in my unit, the position can be filled. If something happens to the commander, it&#8217;s not quite as easy. Moving on, the commander receives his own room, thus putting a soldier out, and forcing him to move in with two guys already occupying a trailer. Their beds were nearly touching&#8230;for 15 months. What happened? QoS&#8230;sort of. Here&#8217;s what cisco has to say about QoS:</p>
<p style="text-align: left;"><em>&#8220;QoS is the ability of the network to provide better or special service to a set of users or applications or both <strong>to the detriment of other users or applications or both</strong>.</em>&#8220;</p>
<p style="text-align: left;">Based on that statement, we can agree that Quality of Service is essentially improving service for one service, while limiting the service of other users/applications. Think about it, you run a network with 1,000+ systems, and run a special application we&#8217;ll call AppX that the companies employee&#8217;s practically live on. You also have employee&#8217;s who are running P2P file transfer programs such as Gnutella, Kazaa, or Limewire. Without a QoS policy in place, heavy P2P use will prove to be detrimental to AppX, and thus decrease company productivity, resulting in less earnings, and ultimately hurt everyone! In the above scenario, using QoS, it would be completely possible to limit the P2P users to only using a percentage of the available bandwidth, and simultaneously guarantee a percentage of bandwidth to AppX..even in times of network congestion. Pretty outstanding!</p>
<p style="text-align: left;">Before we get into the options QoS provides you with, we must first understand the basic QoS models available to you as the network engineer.</p>
<ul style="text-align: left;">
<li>Best Effort: No QoS policy is implemented. All packets receive the same level of service.</li>
</ul>
<ul style="text-align: left;">
<li>Integrated Services Model (IntServ): the first real end-to-end QoS solution. IntServ is based on a per-flow basis, where a &#8220;flow&#8221; is defined as a stream of packets with a common source, destination, and port number. Does not scale well, as each router using IntServ is required to maintain per flow state information.</li>
</ul>
<ul style="text-align: left;">
<li>Differentiated Services (DiffServ): Not a guaranteed service model. Flows are combined into &#8220;classes&#8221;, and are treated on a per class basis. DiffServ is very scalable, and flexible. Packet classification, marking, and conditioning is done at the edge, where the core handles QoS on a Per-Hop Behavior (PHB) based on the packet&#8217;s class. DiffServ is highly scalable</li>
</ul>
<p style="text-align: left;"><strong>QoS: Steps to implementation</strong></p>
<p style="text-align: left;">There are three broad steps required to implement QoS. While the methods of implementation vary, the idea behind each is the same. They are as follows:</p>
<ol style="text-align: left;">
<li><strong>Identify traffic types and requirements</strong></li>
</ol>
<p style="text-align: left;">The first step consists of evaluating business requirements, and the applications/services currently in use on the network- then determining the requirements of each one. The idea behind this step is to later place apps/services with similar requirements into the same class, and then apply policies to each class. For example, if you have VoIP traffic, and have several other important, but not critical applications, you would give priority to the VoIP traffic (therefore getting it&#8217;s own class), and give the lower-priority traffic it&#8217;s own class.</p>
<p style="text-align: left;"><strong></strong>2.<strong> Classifying traffic based on the requirements</strong></p>
<p style="text-align: left;">Classifying traffic is essentially taking a group of applications and placing them into several classes. Marking is also usually done after classifying. Why should you mark? If you don&#8217;t, each device in your network that handles QoS will have to perform a deep-packet inspection along each hop. If you mark at the edge, each device that sees that marking (or &#8220;color&#8221;) after that will know what treatment it should receive already. Classification can be based on the incoming interface, Class of Service (CoS, Layer 2 marking) value, source or destination IP address, IP Precedence/DSCP value, MPLS EXP, or by the application type.</p>
<p style="text-align: left;">3. <strong>Define Policies for each class</strong></p>
<p style="text-align: left;">Now that you&#8217;ve identified business/network requirements, we&#8217;ve classified and marked (you did mark your traffic, didn&#8217;t you?) our traffic..we must do something with all of it! This is where the action happens. This is where you can set a maximum/minimum bandwidth for a class to use, define a priority, or apply congestion management/avoidance (in other words, how to act when there is congestion present..which traffic should be dropped first, etc).</p>
<p style="text-align: left;"><strong>Trust Boundaries</strong></p>
<p style="text-align: left;">So you know the steps to implementing QoS, and classifying/marking..but where do we start? The point at which traffic is marked in our network is defined as the &#8220;trust boundary&#8221;, or where the QoS markings are &#8220;trusted&#8221;. You should always try to mark closest to the source if possible. A common scenario I hear is network admins installing Cisco VoIP phones, with a PC connected to the 3-port switch on the phone. Most Cisco phones will provide a CoS (Layer 2 marking)/IP Precedence (Layer 3 marking) of 5 by default. If you &#8220;trust&#8221; the incoming values at the access switch, your trust boundary is at the IP phone/access switch.  This is ideal. This type of configuration ensures that all of your core/distribution nodes do nothing more then quickly read the markings, and act on the necessary policy for that class instead of deep packet inspection. In the diagram below, we see three different possibilities for trust boundaries:</p>
<p style="text-align: left;"><img class="size-full wp-image-18 alignnone" title="trustboundary" src="http://www.sgtccie.com/blog/wp-content/uploads/2009/03/trustboundary.jpg" alt="trustboundary" width="732" height="111" /></p>
<p style="text-align: left;">A) In this scenario, the IP phone marks it&#8217;s own traffic. This is ideal, however not all IP phones can mark.</p>
<p style="text-align: left;">B) This option is still good, and is a pretty common place to mark- at the access layer. This is generally where you would mark if you just had a regular PC attached, or a phone not capable of marking it&#8217;s own traffic.</p>
<p style="text-align: left;">C) This one is OK. Generally the congestion in networks occur at the WAN links, so as long as you mark before it hits the WAN link, you should still be OK. This is why you generally want to mark as close to the source as possible.</p>
<p style="text-align: left;">
<p style="text-align: left;">Although this has not been a complete overview of QoS, I hope it&#8217;s cleared some things up for those new to QoS. In Part II we&#8217;ll discuss QoS policy, Congestion avoidance/management, and Queueing.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtccie.com/blog/2009/03/qos-essentials-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

