Wednesday, July 25, 2012

Understanding Packet Counters in show policy-map interface Output


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:
  • The interface transmits packets in accordance with the interface rate or a shaped rate.
  • The interface maintains a hardware queue or transmit ring, where it stores the packets that wait for transmission onto the physical wire.
  • 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.
  • 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.
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.

What Is the Difference Between "Packets" and "Packets Matched"?

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.
This table 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.


Packet Type
Congestion
Non-Congestion
Locally-generated packets, which includes Telnet packets and pings
Yes
Yes
Other packets that are process-switched
Yes
Yes
Packets that are CEF- or fast-switched
Yes
No



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: "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."
Normally, the "packets" counter is much larger than the "pkts matched" 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.


Understanding Packet Counters in show policy-map interface Output

No comments:

Post a Comment