DrayTek UK Users' Community Forum

Help, Advice and Solutions from DrayTek Users

[SOLVED] Vigor 2820n TX and RX byte counts?

  • dottedquad
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 May 2016 11:10 #1 by dottedquad
Does anyone know what the Vigor 2820n rx and tx stats of bits (or bytes?) received and sent of the WAN2 interface, actually mean?

Currently, I've got Syslog set up in 'System Maintenance / Syslog/Mail Alert' to output the following message types:

Firewall Log
VPN Log
User Access Log
Call Log
WAN Log
Router/DSL information



I see the following 5-min and 30-min stats in syslog:

2015/03/09 16:23:33.74 M statistic: wan2: tx 0 kbps, rx 1 kbps (5 min average)
2015/03/09 16:23:33.74 M statistic: wan1: tx 0 kbps, rx 0 kbps (30 min average),total ??tx: 0 bytes ,rx: 0 bytes
2015/03/09 16:23:33.74 M statistic: wan2: tx 0 kbps, rx 1 kbps (30 min average),total ??tx: 855 mb ,rx: 3.1 gb



But I can't figure out how the 5-min and 30-min stats are related! For example, how can an average rx rate of 1kbps over 30 mins produce a total rx of anything other than 1.8 mega bits (or bytes), and not the 3.1gb reported above?

Can anyone shed some light? Is it clearly explained anywhere?

My modem/router details:
Model Name : Vigor2820n
Firmware Version : 3.3.7.6_232201

Please Log in or Create an account to join the conversation.

  • dottedquad
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
12 May 2016 07:32 #2 by dottedquad
Replied by dottedquad on topic Re: Vigor 2820n TX and RX byte counts?
I've figured-out an answer to what the 30-min stats are.

In syslog lines like

2015/03/09 16:23:33.74 M statistic: wan2: tx 0 kbps, rx 1 kbps (30 min average),total ??tx: 855 mb ,rx: 3.1 gb


the 30 minute averages

tx: 855 mb ,rx: 3.1 gb


are snapshots, at the end of the current 30-minute interval, of the cumulative packet bytes uploaded to the internet (tx) and downloaded from internet (rx), with units (kb, mb, gb) helpfully added.

So, in order to calculate the incremental bytes sent and received in the current 30-min interval, you just subtract the previous 30-min snapshot stats from the current one's. So simple!

The vigor 2820n doesn't reset the cumulative counts every day: they just keep on increasing as long as the 2820 wan2 link stays up (it seems).

However, there is one gotcha: if the wan2 link goes down (and then comes back up) the cumulative byte counts restart from zero.

So to calculate the data sent/received in a 30-min interval , you need to check if the counts at the end of the interval are greater than, or equal to, those at the start of the interval (in which case I assume the 2820 didn't reset its counts), or less than those at the start (in which case I assume the counts were reset - starting from 0). I am happy to report that this simple heuristic produces very close agreement (to within 0.5%) with my ISP's figures for my wan2 link.

Please Log in or Create an account to join the conversation.

More
16 May 2016 12:02 #3 by admin3
That is a very good summary of how it works. The total value is the cumulative amount since the WAN interface became active when the router was last restarted. The same information can be found under [Diagnostics] > [Traffic Graph] or using the SNMP OIDs for the WAN interface and suitable software to read it (PRTG for instance but there are also free specific utilities for this, look up SNMP traffic graph utilities)

This value:
statistic: wan2: tx 0 kbps, rx 1 kbps (30 min average)
is calculated over a 30 minute period by looking at the kbps over each second, then dividing by the number of seconds (1800 for 30 minutes). If the WAN interface isn't heavily used, it can look quite low and would only be representative of throughput at full utilisation over that time period.

edit: I've also just checked and these stats are used for calculations in the DrayTek Syslog utility for the WAN tab's Show Traffic Graph section



Forum Administrator

Please Log in or Create an account to join the conversation.

  • dottedquad
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
23 May 2016 08:34 #4 by dottedquad
Replied by dottedquad on topic Re: [SOLVED] Vigor 2820n TX and RX byte counts?
One further, related, question.

The following syslog extract shows the cumulative 30-min TX byte count going from 1014 mb to 1.0 gb:

2016/05/22 21:35:55.09 M statistic: wan2: tx 62 kbps, rx 1983 kbps (30 min average),total ??tx: 1000 mb ,rx: 25.9 gb
2016/05/22 22:05:57.09 M statistic: wan2: tx 65 kbps, rx 2079 kbps (30 min average),total ??tx: 1014 mb ,rx: 26.3 gb
2016/05/22 22:35:59.09 M statistic: wan2: tx 66 kbps, rx 2098 kbps (30 min average),total ??tx: 1.0 gb ,rx: 26.7 gb
2016/05/22 23:06:01.09 M statistic: wan2: tx 1 kbps, rx 39 kbps (30 min average),total ??tx: 1.0 gb ,rx: 26.7 gb


Does that mean that 1 gb = 1024 mb in the vigor 2820 syslog files?

In fact, are the syslog file units actually mb = mebibyte (1024^2 bytes) and gb = gibibyte (1024^3 bytes)?

Please Log in or Create an account to join the conversation.