cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1563
Views
20
Helpful
5
Replies

getting average traffic speed for lan clients

olmomezger
Level 1
Level 1

Hi, 

 

I'm trying to get the average rx and tx speed from the LAN-connected clients to a catalyst switch. I'm using this YANG model:

 

https://github.com/YangModels/yang/blob/master/vendor/cisco/xe/1731/Cisco-IOS-XE-interfaces-oper.yang

 

It contains some interesting labes under statistics:

 

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get>
<filter>
<interfaces xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-interfaces-oper">
<interface>
<statistics>
<rx-pps/>
<rx-kbps/>
<tx-pps/>
<tx-kbps/>
</statistics>
</interface>
</interfaces>
</filter>
</get>
</rpc>

 

However, I'm not sure if this contains the immediate snapshot rx and tx speeds, or is it an incremental value, or is it the average over a certain period of time (e.g. average tx-kbps over the past 5 min). 

 

What I need is the average speed (rx,tx) over a certain period of time (1-10 min), so that I can identify if the lan client is active. Is this the correct approach? 

 

THANKS

 

1 Accepted Solution

Accepted Solutions

vc193
Level 1
Level 1

The statistics in the interfaces YANG model:

 

<rx-pps/>
<rx-kbps/>
<tx-pps/>
<tx-kbps/>

correspond to the following numbers in the "show interface" output:

 

  5 minute input rate 487000 bits/sec, 535 packets/sec
  5 minute output rate 487000 bits/sec, 535 packets/sec

As you can see these statistics are averaged over a 5-minute interval.

 

View solution in original post

5 Replies 5

balaji.bandi
Hall of Fame
Hall of Fame

I generally do average of 5-10min some time Lower but this lead to laod of the device you keep polling. most i see solarwinds / prtg poll every 120-180 seconds and calculate. is this acceptable in your case ?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hi, I'm not sure if I can follow your answer. You mean that there is a way to calculate (average?) without constantly polling, is that correct? Can you pls elaborate more on this possibility? it sounds promising. 

 

THANKS

Polling on Cisco routers does not necessarily skew the statistics because the packet run-time path is either hardware switching, or, always takes precedence over any management function, however, if the router is really busy forwarding packets, your statistics query will be late, but, still give a somewhat accurate average.  If you are looking for a readout over 10 minutes and then stopping, polling every 10 or 20 seconds is not a big deal.  If you are going for constant polling, then yes, stretch it out to once a minute.

 

One important thing.  You don't want your polling to skew the numbers so target the management interface to ask about statistics on other interfaces.

miott
Cisco Employee
Cisco Employee

Hello,

 

The short answer is that this is a snapshot in time, however, the task you are outlining is exactly what programmability interfaces are made for.  As a human looking at a router console, you can figure out the average by typing in "show interface xxx" or on the YANG Suite NETCONF page, clicking on "Run RPC"several times in the period you wish and manually figuring out the averages.  The solution using a programmatic interface like NETCONF is to create a script that sends this "get" at intervals over a period of time, storing the values, and when the time expires, calculate the average and report it.

 

Using the YANG Suite NETCONF page, you can "Build RPC "shown above and click on "Replays-->Generate Python script".  This will produce a python script that sends the message one time, but, you now have a script that you can modify to perform the solution you mention, for example,

```

for n in range(10):

    # send the get

    # collect the rx, tx time

    sleep(1)

print("RX average {0} TX average {1}".format(rx / 10, tx / 10))

```

 

vc193
Level 1
Level 1

The statistics in the interfaces YANG model:

 

<rx-pps/>
<rx-kbps/>
<tx-pps/>
<tx-kbps/>

correspond to the following numbers in the "show interface" output:

 

  5 minute input rate 487000 bits/sec, 535 packets/sec
  5 minute output rate 487000 bits/sec, 535 packets/sec

As you can see these statistics are averaged over a 5-minute interval.