Hi,
Having switched the last of my Cisco routers out for an ERL, I am in the process of moving my geeky custom Raspberry Pi based live traffic speed LED monitor over. (video of it in action here if you care: RasPi SNMP/LED Bandwidth Utilisation Monitor - I think it is pretty cool and handy)
So let me first start by saying:
Yes; I am using SNMP for near real time bandwidth utilisation graphing. On my Cisco 877W, I was polling ifInOctets/ifOutOctets at 1sec intervals and determining interface throughput just fine.
Now the 877W wasn't beefy enough to drive my new FTTP 100Mb/40Mb connection, so it was replaced with a new ERL running EdgeRouter Litev1.8.5.
So now, I have been seeing some inconvienient SNMP behaviour that I am looking for inputs from UBNT folks on:
1) I am not able to get reliable data when polling at 1sec intervals.
1 second polling intervals are mostly ok until the router gets close to 100Mb/s at which point it takes 2-4 polls for counters to update, which results in 0% utilitsation for a few cycles, then 200-400% utilisation math.
Debug: ('1817703995',) Debug: ('1817703995',) Debug: ifInOctets Value 1 is: 1817703995 and ifInOctets Value 2 is: 1817703995 Debug: Delta in ifInOctets is: 0 Debug: Inbound Usage Percentage is: 0.0 Debug: ---- Debug: ('1817703995',) Debug: ('1817703995',) Debug: ifInOctets Value 1 is: 1817703995 and ifInOctets Value 2 is: 1817703995 Debug: Delta in ifInOctets is: 0 Debug: Inbound Usage Percentage is: 0.0 Debug: ---- Debug: ('1817703995',) Debug: ('1849527266',) Debug: ifInOctets Value 1 is: 1817703995 and ifInOctets Value 2 is: 1849527266 Debug: Delta in ifInOctets is: 31823271 Debug: Inbound Usage Percentage is: 199.0 Debug: ---- Debug: ('1849527266',) Debug: ('1849527266',) Debug: ifInOctets Value 1 is: 1849527266 and ifInOctets Value 2 is: 1849527266 Debug: Delta in ifInOctets is: 0 Debug: Inbound Usage Percentage is: 0.0 Debug: ---- Debug: ('1849527266',) Debug: ('1849527266',) Debug: ifInOctets Value 1 is: 1849527266 and ifInOctets Value 2 is: 1849527266 Debug: Delta in ifInOctets is: 0 Debug: Inbound Usage Percentage is: 0.0 Debug: ---- Debug: ('1849527266',) Debug: ('1885882379',) Debug: ifInOctets Value 1 is: 1849527266 and ifInOctets Value 2 is: 1885882379 Debug: Delta in ifInOctets is: 36355113 Debug: Inbound Usage Percentage is: 229.0 Debug: ----
My question for item 1 is: What is the frequency with which counter updates are guaranteed with EdgeRouter Lite v1.85?
To work around the counters not being reliable at 1sec polling intervals, I dropped them back to 5sec intervals which seems to be mostly reliable. Then I hit problem #2:
2) I have noticed the counters rolling over resulting in ~(-5000%) utilisation values:
So some back of the envellope math shows me that the counter values roll over at an interger value that roughly correlates to 0xFFFFFFFF, leading me to assume that the ifInOctets and ifOutOctets values are 32bit positive integers.
Debug: ---- Debug: ('4248283006',) Debug: ('4281967926',) Debug: ifInOctets Value 1 is: 4248283006 and ifInOctets Value 2 is: 4281967926 Debug: Delta in ifInOctets is: 33684920 Debug: Inbound Usage Percentage is: 43.0 Debug: ---- Debug: ('4281967926',) Debug: ('5532949',) Debug: ifInOctets Value 1 is: 4281967926 and ifInOctets Value 2 is: 5532949 Debug: Delta in ifInOctets is: -4276434977 Debug: Inbound Usage Percentage is: -5447.0 Debug: ---- Debug: ('5532949',) Debug: ('56471149',) Debug: ifInOctets Value 1 is: 5532949 and ifInOctets Value 2 is: 56471149 Debug: Delta in ifInOctets is: 50938200 Debug: Inbound Usage Percentage is: 65.0 Debug: ----
My question for item 2 is: If my math is correct and these are 32bit values, given the speeds of modern internet connections, isn't it time to increase these to 64bit values? By my calculations, with a 32bit value, this will roll over at around 5Gb of throughput, which can happen quite often on a 100Mb connection.
As a last point, if there is a better API to be using to grap these kinds of stats, I'm more than happy to use it. Initial google searches didn't show up any hints that there is a REST API that I can be polling this from..
Anyway thanks in advance for any UBNT (or knowledgable community folks) who can chime in with some details. I am a massive fan of UBNT products and will continue to buy and deploy them.