{"id":1073,"date":"2010-11-19T11:29:21","date_gmt":"2010-11-19T11:29:21","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1073"},"modified":"2015-02-21T09:19:51","modified_gmt":"2015-02-21T09:19:51","slug":"understanding-packet-counters-in-show-policy-map-interface-output","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1073","title":{"rendered":"Understanding Packet Counters in show policy-map interface Output"},"content":{"rendered":"<p>To understand how to interpret the <strong>show policy-map interface<\/strong> command, you first need to understand the concept of congestion.<span><em>Conceptually<\/em>, congestion is defined by the Cisco IOS software  configuration guide as: &#8220;During periods of transmit congestion at the  outgoing interface, packets arrive faster than the interface can send  them.&#8221;<!--more--><\/span><\/p>\n<p>In other words, congestion typically occurs when a fast ingress  interface feeds a relatively slow egress interface. A common congestion  point is a branch-office router with an Ethernet port facing the LAN and  a serial port facing the WAN. Users on the LAN segment generate 10 Mbps  of traffic, which is fed into a T1 with 1.5 Mbps of bandwidth.<\/p>\n<p><em>Functionally<\/em>, congestion is defined as filling the transmit ring on the interface. A <em>ring<\/em> is a special buffer control structure. Every interface supports a pair  of rings: a receive ring for receiving packets and a transmit ring for  transmitting packets. The size of the rings varies with the interface  controller and with the bandwidth of the interface or virtual circuit  (VC). For example, use the <strong>show atm vc {vcd}<\/strong> command to display the value of the transmit ring on a PA-A3 ATM port adapter. Refer to <a href=\"http:\/\/www.cisco.com\/en\/US\/tech\/tk39\/tk824\/technologies_tech_note09186a00800fbafc.shtml\">Understanding and Tuning the tx-ring-limit Value<\/a> for more information.<\/p>\n<blockquote>\n<pre>7200-1# <strong>show atm vc 3<\/strong>\r\nATM5\/0.2: VCD: 3, VPI: 2, VCI: 2\r\nVBR-NRT, PeakRate: 30000, Average Rate: 20000, Burst Cells: 94\r\nAAL5-LLC\/SNAP, etype:0x0, Flags: 0x20, VCmode: 0x0\r\nOAM frequency: 0 second(s)\r\n<strong>PA TxRingLimit: 10<\/strong>\r\nInARP frequency: 15 minutes(s)\r\nTransmit priority 2\r\nInPkts: 0, OutPkts: 0, InBytes: 0, OutBytes: 0\r\nInPRoc: 0, OutPRoc: 0\r\nInFast: 0, OutFast: 0, InAS: 0, OutAS: 0\r\nInPktDrops: 0, OutPktDrops: 0\r\nCrcErrors: 0, SarTimeOuts: 0, OverSizedSDUs: 0\r\nOAM cells received: 0\r\nOAM cells sent: 0\r\nStatus: UP<\/pre>\n<\/blockquote>\n<p>Cisco IOS, also referred to as the Layer 3 (L3) processor, and the  interface driver use the transmit ring when moving packets to the  physical media. The two processors collaborate in this way:<\/p>\n<ul>\n<li>The interface transmits packets in accordance with the interface rate or a shaped rate.<\/li>\n<li>The interface maintains a hardware queue or transmit ring, where it  stores the packets that wait for transmission onto the physical wire.<\/li>\n<li>When the hardware queue or transmit ring fills, the interface  provides explicit back pressure to the L3 processor system. The  interface notifies the L3 processor to stop dequeuing packets to the  interface transmit ring because the transmit ring is full. The L3  processor now stores the excess packets in the L3 queues.<\/li>\n<li>When the interface sends the packets on the transmit ring and empties  the ring, it once again has sufficient buffers available to store the  packets. It releases the back pressure, and the L3 processor dequeues  new packets to the interface.<\/li>\n<\/ul>\n<p>The most important aspect of this communication system is that the  interface recognizes that its transmit ring is full and throttles the  receipt of new packets from the L3 processor system. Thus, when the  interface is congested, the drop decision is moved from a random,  last-in\/first-dropped decision in the transmit ring first in, first out  (FIFO) queue to a differentiated decision based on IP-level service  policies implemented by the L3 processor.<\/p>\n<h2><a name=\"packets\">What Is the Difference Between &#8220;Packets&#8221; and &#8220;Packets Matched&#8221;?<\/a><\/h2>\n<p>Next, you need to understand when your router uses the L3 queues,  since service policies apply only to packets stored in the layer-3  queues.<\/p>\n<p><a href=\"http:\/\/www.cisco.com\/en\/US\/tech\/tk543\/tk760\/technologies_tech_note09186a0080108e2d.shtml#tableone\">This table<\/a> illustrates when packets sit in the L3 queue. Locally generated packets  are always process-switched and are delivered first to the L3 queue  before they are passed on to the interface driver. Fast-switched and  Cisco Express Forwarding (CEF)-switched packets are delivered directly  to the transmit ring and sit in the L3 queue only when the transmit ring  is full.<\/p>\n<p><a name=\"tableone\"> <\/a><\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" width=\"60%\" bgcolor=\"#ffffff\">\n<tbody>\n<tr>\n<th>Packet Type<\/th>\n<th>Congestion<\/th>\n<th>Non-Congestion<\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">Locally-generated packets, which includes Telnet packets and pings<\/td>\n<td bgcolor=\"#ffffff\">Yes<\/td>\n<td bgcolor=\"#ffffff\">Yes<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">Other packets that are process-switched<\/td>\n<td bgcolor=\"#ffffff\">Yes<\/td>\n<td bgcolor=\"#ffffff\">Yes<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">Packets that are CEF- or fast-switched<\/td>\n<td bgcolor=\"#ffffff\">Yes<\/td>\n<td bgcolor=\"#ffffff\">No<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span> <\/span><\/p>\n<p><a name=\"tableone\">This example shows these guidelines applied to the <strong>show policy-map interface<\/strong> output (the four key counters are in bold):<\/a><\/p>\n<blockquote>\n<pre><a name=\"tableone\">7206# <strong>show policy-map interface atm 1\/0.1<\/strong>\r\n ATM1\/0.1: VC 0\/100 -\r\n  Service-policy output: cbwfq (1283)\r\n    Class-map: A (match-all) (1285\/2)\r\n      <strong>28621 packets, 7098008 bytes<\/strong>\r\n      5 minute offered rate 10000 bps, drop rate 0 bps\r\n      Match: access-group 101 (1289)\r\n      Weighted Fair Queueing\r\n        Output Queue: Conversation 73\r\n        Bandwidth 500 (kbps) Max Threshold 64 (packets)\r\n        <strong>(pkts matched\/bytes matched) 28621\/7098008<\/strong>\r\n        (depth\/total drops\/no-buffer drops) 0\/0\/0\r\n    Class-map: B (match-all) (1301\/4)\r\n      2058 packets, 148176 bytes\r\n      <strong>5 minute offered rate 0 bps, drop rate 0 bps<\/strong>\r\n      Match: access-group 103 (1305)\r\n      Weighted Fair Queueing\r\n        Output Queue: Conversation 75\r\n        Bandwidth 50 (kbps) Max Threshold 64 (packets)\r\n        (pkts matched\/bytes matched) 0\/0\r\n        (depth\/total drops\/no-buffer drops) 0\/0\/0\r\n    Class-map: class-default (match-any) (1309\/0)\r\n      19 packets, 968 bytes\r\n      <strong>5 minute offered rate 0 bps, drop rate 0 bps<\/strong>\r\n      Match: any  (1313)<\/a><\/pre>\n<\/blockquote>\n<p><a name=\"tableone\">This table defines the bolded counters:<\/a><\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" width=\"60%\" bgcolor=\"#ffffff\">\n<tbody>\n<tr>\n<th>Counter<\/th>\n<th>Explanation<\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><strong>28621 packets, 7098008 bytes<\/strong><\/td>\n<td bgcolor=\"#ffffff\">The number of packets which match the criteria of the class. This counter increments whether or not the interface is congested.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><strong>(pkts matched\/bytes matched) 28621\/7098008<\/strong><\/td>\n<td bgcolor=\"#ffffff\">The number of packets which match the criteria of the class when the  interface was congested. In other words, the interface transmit ring was  full, and the driver and the L3 processor system worked together to  queue the excess packets in the L3 queues, where the service policy  applies. Packets that are process-switched always go through the L3  queuing system and thus increment the &#8220;packets matched&#8221; counter.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\"><strong>Class-map: B (match-all) (1301\/4)<\/strong><\/td>\n<td bgcolor=\"#ffffff\">These numbers define an internal ID used with the  CISCO-CLASS-BASED-QOS-MIB Management Information Base (MIB). They no  longer appear in the <strong>show policy-map<\/strong> output in current releases of Cisco IOS.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">5 minute offered rate 0 bps, drop rate 0 bps<\/td>\n<td bgcolor=\"#ffffff\">Use the <strong>load-interval<\/strong> command to change this value and make it  a more instantaneous value. The lowest value is 30 seconds; however,  statistics displayed in the <strong>show policy-map interface<\/strong> output are  updated every 10 seconds. Since the command effectively provides a  snapshot at a specific moment, the statistics may not reflect a  temporary increase in queue size.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span> <\/span><\/p>\n<p><a name=\"tableone\">Without congestion, there is no need to queue  any excess packets. With congestion, packets, which includes CEF- and  fast-switched packets, may go into the L3 queue. Refer back to how the  Cisco IOS configuration guide defines congestion: &#8220;If you use congestion  management features, packets accumulating at an interface are queued  until the interface is free to send them; they are then scheduled  according to their assigned priority and the queuing mechanism  configured for the interface.&#8221;<\/a><\/p>\n<p><a name=\"tableone\">Normally, the &#8220;packets&#8221; counter is much larger  than the &#8220;pkts matched&#8221; counter. If the values of the two counters are  nearly equal, then the interface currently receives a large number of  process-switched packets or is heavily congested. Both of these  conditions should be investigated to ensure optimal packet forwarding.<\/a><\/p>\n<h2><a name=\"numberallocation\">How Are Conversation Numbers Allocated?<\/a><\/h2>\n<p>This section explains how your router allocates conversation numbers for the queues created when the service policy is applied.<\/p>\n<blockquote>\n<pre>Router# <strong>show policy-map interface s1\/0.1 dlci 100<\/strong>\r\n Serial1\/0.1: DLCI 100 -\r\n output : mypolicy\r\n  Class voice\r\n   Weighted Fair Queueing\r\n       <strong>Strict Priority<\/strong>\r\n       Output Queue: <strong>Conversation 72<\/strong>\r\n         Bandwidth 16 (kbps) Packets Matched 0\r\n        (pkts discards\/bytes discards) 0\/0\r\n  Class immediate-data\r\n   Weighted Fair Queueing\r\n       Output Queue: <strong>Conversation 73<\/strong>\r\n         Bandwidth 60 (%) Packets Matched 0\r\n         (pkts discards\/bytes discards\/tail drops) 0\/0\/0\r\n         mean queue depth: 0\r\n         drops: class  random   tail     min-th   max-th   mark-prob\r\n                0      0        0        64       128      1\/10\r\n                1      0        0        71       128      1\/10\r\n                2      0        0        78       128      1\/10\r\n                3      0        0        85       128      1\/10\r\n                4      0        0        92       128      1\/10\r\n                5      0        0        99       128      1\/10\r\n                6      0        0        106      128      1\/10\r\n                7      0        0        113      128      1\/10\r\n                rsvp   0        0        120      128      1\/10\r\n  Class priority-data\r\n   Weighted Fair Queueing\r\n       Output Queue: <strong>Conversation 74<\/strong>\r\n         Bandwidth 40 (%) Packets Matched 0 Max Threshold 64 (packets)\r\n         (pkts discards\/bytes discards\/tail drops) 0\/0\/0\r\n  Class class-default\r\n   Weighted Fair Queueing\r\n       Flow Based Fair Queueing\r\n       <strong>Maximum Number of Hashed Queues 64<\/strong>  Max Threshold 20 (packets)<\/pre>\n<\/blockquote>\n<p>The class-default class is the default class to which traffic is  directed, if that traffic does not satisfy the match criteria of other  classes whose policy is defined in the policy map. The <strong>fair-queue<\/strong> command allows you to specify the number of dynamic queues into which  your IP flows are sorted and classified. Alternately, your router  allocates a default number of queues derived from the bandwidth on the  interface or VC. Supported values in either case are a power of two, in a  range from 16 to 4096.<\/p>\n<p>This table lists the default values for interfaces and for ATM permanent virtual circuits (PVCs):<\/p>\n<p>Default Number of Dynamic Queues as a Function of Interface Bandwidth<\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<th>Bandwidth Range<\/th>\n<th width=\"251\">Number of Dynamic Queues<\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">Less than or equal to 64 kbps<\/td>\n<td width=\"251\" bgcolor=\"#ffffff\">16<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 64 kbps and less than or equal to 128 kbps<\/td>\n<td width=\"251\" bgcolor=\"#ffffff\">32<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 128 kbps and less than or equal to 256 kbps<\/td>\n<td width=\"251\" bgcolor=\"#ffffff\">64<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 256 kbps and less than or equal to 512 kbps<\/td>\n<td width=\"251\" bgcolor=\"#ffffff\">128<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 512 kbps<\/td>\n<td width=\"251\" bgcolor=\"#ffffff\">256<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span>Default Number of Dynamic Queues as a Function of ATM PVC Bandwidth<\/span><\/p>\n<table border=\"0\">\n<tbody>\n<tr>\n<th>Bandwidth Range<\/th>\n<th>Number of Dynamic Queues<\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">Less than or equal to 128 kbps<\/td>\n<td bgcolor=\"#ffffff\">16<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 128 kbps and less than or equal to 512 kbps<\/td>\n<td bgcolor=\"#ffffff\">32<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 512 kbps and less than or equal to 2000 kbps<\/td>\n<td bgcolor=\"#ffffff\">64<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 2000 kbps and less than or equal to 8000 kbps<\/td>\n<td bgcolor=\"#ffffff\">128<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">More than 8000 kbps<\/td>\n<td bgcolor=\"#ffffff\">256<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span> <\/span><\/p>\n<p>Based on the number of reserved queues for weighted fair queuing,  Cisco IOS assigns a conversation or queue number as shown in this  table:<\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"3\" width=\"60%\" bgcolor=\"#ffffff\">\n<tbody>\n<tr>\n<th>Conversation \/ Queue Number<\/th>\n<th>Type of Traffic<\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">1 &#8211; 256<\/td>\n<td bgcolor=\"#ffffff\">General flow-based traffic queues. Traffic that does not match to a  user-created class will match to class-default and one of the flow-based  queues.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">257 &#8211; 263<\/td>\n<td bgcolor=\"#ffffff\">Reserved for Cisco Discovery Protocol (CDP) and for packets marked with an internal high-priority flag.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">264<\/td>\n<td bgcolor=\"#ffffff\">Reserved queue for the priority class (classes configured with the <strong>priority<\/strong> command). Look for the &#8220;Strict Priority&#8221; value for the class in the <strong>show policy-map interface<\/strong> output. The priority queue uses a conversation ID equal to the number of dynamic queues plus eight.<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">265 and higher<\/td>\n<td bgcolor=\"#ffffff\">Queues for user-created classes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span> <\/span><\/p>\n<h2><a name=\"confirmpol\">Confirming Your Service Policy<\/a><\/h2>\n<p>Complete these steps if you need to test the &#8220;pkts matched&#8221; counter and your service policy:<\/p>\n<ol type=\"1\">\n<li>Simulate congestion with an extended ping using a large ping size and  a large number of pings. Also, try to download a large file from a File  Transfer Protocol (FTP) server. The file constitutes &#8220;disturbing&#8221; data  and fills the interface bandwidth.<\/li>\n<li>Reduce the size of the interface transmit ring with the <strong>tx-ring-limit<\/strong> command. A reduction of this value accelerates the use of the QoS in the Cisco IOS software.<br \/>\n<blockquote>\n<pre>interface ATMx\/y.z point-to-point\r\nip address a.b.c.d M.M.M.M\r\nPVC A\/B\r\n<strong>tx-ring-limit &lt;size&gt;<\/strong>\r\nservice-policy output test<\/pre>\n<\/blockquote>\n<\/li>\n<li>Specify size as the number of packets for 2600 and 3600 series  routers, or as the number of memory particles for 7200 and 7500 series  routers.<\/li>\n<li>Ensure that your traffic flow matches the input or output parameter  of your policy. For example, to download a file from an FTP server  generates congestion in the receive direction because the server sends  large MTU-sized frames, and the client PC returns small acknowledgments  (ACKs).<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.cisco.com\/en\/US\/tech\/tk543\/tk760\/technologies_tech_note09186a0080108e2d.shtml\">source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To understand how to interpret the show policy-map interface command, you first need to understand the concept of congestion.Conceptually, congestion is defined by the Cisco IOS software configuration guide as: &#8220;During periods of transmit congestion at the outgoing interface, packets arrive faster than the interface can send them.&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83,76],"tags":[21],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1073"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1073"}],"version-history":[{"count":4,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1073\/revisions"}],"predecessor-version":[{"id":2127,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1073\/revisions\/2127"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}