The ONL NPR Tutorial

NPR Tutorial >> Filters, Queues and Bandwidth TOC

New Window?

Monitoring With Stats Counters

We've seen that the NPR keeps track of a large number of counts that allow you to monitor bandwidth and packet rates coming into and out of ports. The RLI makes these counters visible to the user through RLI menu items. For example, we have already used port menu items such as Monitoring => TXPKT to monitor the number of packets transmitted from a port. But the NPR can actually have up to 256K counters that can be updated as packets progress through the router.

This page describes the concept behind monitoring with stats counters and shows you how to monitor using counters that are accessed through stats indices. The sections in this page are:


Stats Counters And Indices

[[ stats-counters.png Figure ]]

There is a 1 MB region of SRAM that is used to store 4-byte counters for monitoring. These counters fall into two groups:

The register counters are listed in the Summary Information => Counters page. Some documents refer to these counters as global register counters. All of the RX and TX Monitoring menu items are based on some of these counters. The 64 register counters keep track of such things as: Look closely at these counters and you will see that many of them come in byte-packet pairs. For example, the menu item Monitoring => TXBYTE at port 2 refers to register counter 14, and Monitoring => TXPKT at port 2 refers to register counter 15 (ONL_ROUTER_TX_PORT2_PKT_CNTR).

Some of these counters do not have a special menu item. But you can still access these anonymous counters through the Monitoring => ReadRegisterByte and Monitoring => ReadRegisterPacket menu items in the NPR icon menu. For example, the number of packets dropped by the Queue Manager is stored in register counter 31.
[[ stats-route-table-1.3-resize.png Figure ]]

The remaining counters are stats counters that are accessed through stats indices. The NPR can potentially have up to 64K (65,536) indices. For example, in the route table (right), the stats column contains the stats indices 19-24 which can be used to access the counters. Each index value refers to a group of four 4-byte counters:

The pre-queue counters are updated before a packet is processed by the Queue Manager, and the post-queue counters are updated after a packet is processed by the Queue Manager. For example, if a packet is forwarded based on the the last entry (192.168.2.0/24), the four counters associated with stats index 24 will get updated as it progresses through the Queue Manager. Thus, we could see which route table entries are being selected by displaying the post-queue packet counts.
 

A Route Table Example

[[ stats-filter-1.3-resize.png Figure ]]

We will give a simple demonstration of how to use stats counters. Suppose that we have the dumbbell network shown to the right. We will send ping packets from n1p3 to n2p2 through the 1.4-2.1 link between NPR 1 (on the left) and NPR 2 (on the right). The route tables at each port contain default route entries. The route table directs packets from n1p3 to a datagram queue at port 1.4. We have also installed a filter (right) at port 1.3 that has a higher priority (50) than the route table (60). The filter will send any packets from n1p3 to queue 64 at port 1.4. This filter has been assigned stats index 31.

We demonstrate how to use stats counters by monitoring the two packet counters indexed by stats indices 24 and 31 and turning the filter on and off. These two indices correspond to the 192.168.2.0/24 route entry and the filter respectively. [[ stats-monitoring-PostQPkt.png Figure ]]

The following is a recipe for monitoring the two counters:

[[ stats-counts-resize.png Figure ]]

To get a display like the one shown to the right, we sent a continuous stream of ping packets by doing the following:

 

Recap


 Revised:  Tue, Aug 26, 2008 

  
  

NPR Tutorial >> Filters, Queues and Bandwidth TOC