Traffic stats collection via telnet

Discussions for BiPAC 7700 series: 7700N
Post Reply
ian__b
Posts: 10
Joined: Thu Jul 21, 2011 6:01 pm

Traffic stats collection via telnet

Post by ian__b »

Two questions related to stats collection.

I have written my own simple stats collector which, every 5 minutes, accesses the 7700N via the telnet interface, collects some stats text, parses the required fields and then dumps them to a text file.

Q1) The only way I have found of getting the required traffic information (tx/rx bytes to/from the internet via pppoa0) is via the ifconfig command. Is there an alternative command I could use?

Q2) Has anyone else done something similar to the above and, if so, are they occasionally seeing incorrect data returned from the ifconfig command. For instance, a recent sequence of collected readings for pppoa0 rx and tx values were ...

Code: Select all

rx           tx
157961834    4755515
159939038    5219063
159753663    5543749
161500259    6400264
162839494    7571036
The tx values (and all other values collected at the same time) show expected, increasing, sequences; the rx value shows a decrease then an increase in the values collected. On average I see something similar, for either rx or tx values, every couple of days; I've never seen any discrepancies in the other stats I collect from the router.

Comments/suggestions welcome

Ian
nicotine
Posts: 8
Joined: Wed Jul 20, 2011 12:10 pm

Re: Traffic stats collection via telnet

Post by nicotine »

Not familar with telent commands but have you compare your traffic stats with what you would get from SNMP?
Image

BiPAC-7800N ADSL24 40Mbps FTTC
ian__b
Posts: 10
Joined: Thu Jul 21, 2011 6:01 pm

Re: Traffic stats collection via telnet

Post by ian__b »

No, I haven't tried using SNMP. I tried setting it up on previous routers, without much success; the "S"imple at the start of the name never seemed particularly accurate to me :D

It's a good idea though, thanks for the suggestion. Any recommendations for a good (free) client with a simple set up procedure.

Ian
ian__b
Posts: 10
Joined: Thu Jul 21, 2011 6:01 pm

Re: Traffic stats collection via telnet

Post by ian__b »

Don't worry about the recommendations. I've just installed PRTG and, without completely understanding what I was doing (understatement), I now appear to be recording pppoa0 traffic.

I shall see what happens.

Thanks again for the SNMP suggestion.

Ian
ian__b
Posts: 10
Joined: Thu Jul 21, 2011 6:01 pm

Re: Traffic stats collection via telnet

Post by ian__b »

ian__b wrote: I now appear to be recording pppoa0 traffic.
I shall see what happens
Looking back over my previous results it appeared that I was seeing the problems during periods of high traffic. I therefore started up a number of video streams that, more or less, saturated my broadband connection and looked at the subsequent results from both my scanner and PRTG.

My scanner, that takes a sample via telnet every 5 minutes, saw a couple of large anomalies reported by the router; 700MB of download traffic in 5 minutes for example against the "normal" rate of around 32MB.

PRTG, getting data via SNMP every minute, seemed to get very confused; a number of readings of 4GB in a minute and 1 of 8GB. However, both of these were around significant binary numbers (0x400000 and 0x800000) so that might just be down to PRTG mishandling the values?.

Short extract of download traffic in KB (time period, my scanner, PRTG)

Code: Select all

15:00-15:05  38,373  38,458
15:05-15:10  32,336  31,989
15:10-15:15  32,243  32,522
15:15-15:20  32,271  32,640
15:20-15:25  32,557  4,226,601 *
15:25-15:30  32,772  4,226,793 *
15:30-15:35  36,309  35,758
15:35-15:40  34,534  35,175
15:40-15:45  31,325  4,225,768 *
15:45-15:50  45,399  45,545
15:50-15:55  33,396  1,235,109 *
15:55:16:00  39,925  3,032,363 *
16:00-16:05  33,050  33,342
16:05-16:10  725,641  725,494
16:10-16:15  33,174  33,153
16:15-16:20  213,071  212,299
16:20-16:25  35  8,388,631 *
Other than the starred readings, where PRTG seems to be getting confused at binary boundaries, the readings are in reasonable agreement (taking into account the slightly different time scan periods). I would guess that this means that both my telnet scan and the SNMP clients are getting the same values from the router software, and that it is the router that is generating incorrect readings.

But I could be wrong :D

Ian
nicotine
Posts: 8
Joined: Wed Jul 20, 2011 12:10 pm

Re: Traffic stats collection via telnet

Post by nicotine »

Have you tried collecting stats from ATM0 rather than pppoa0?

Try this command, ifconfig ATM0
Image

BiPAC-7800N ADSL24 40Mbps FTTC
ian__b
Posts: 10
Joined: Thu Jul 21, 2011 6:01 pm

Re: Traffic stats collection via telnet

Post by ian__b »

nicotine wrote:Have you tried collecting stats from ATM0 rather than pppoa0?

Try this command, ifconfig ATM0
Thanks for the suggestion.

I tried logging ATM0, in addition to PPPoA0, for a couple of days and it didn't show any of the fluctuations that I am seeing on PPPoA0. However it also counts some extra traffic in its calculations, packet wrappers I suppose?, and it made it a bit difficult to use for my main purpose; a reasonable accurate check on my ISPs traffic stats for my connection. I tried logging the packet counts as well, and tried to use that to give an "adjustment factor" for the ATM0 counts, but it didn't really work.

I've decided that PPPoA0, even with its little foibles, is usable (see below); I just remove the incorrect readings from the log sequence :D

Thanks
Ian

[Addendum]
I don't think I fully explained that overall the PPPoA0 readings were correct, it was just the individual log entries that sometimes are wrong. For example, say I am listening to a steady 10MB/Min radio stream I might see readings from the router (1 scan per minute) like.

1000
1010
1020
1020
1040
900
1060
1070
etc

i.e. the overall total, last - first, will be accurate but the individual increments may be rubbish
Post Reply