vortex-5 / ddwrt-bwmon

An Individual Bandwidth Monitor For DD-WRT
171 stars 37 forks source link

Incorrect Stats on v3.0-r36079 std (06/01/18) #60

Closed danmed closed 5 years ago

danmed commented 6 years ago

HI,

Any chance you'd have time to take a look at why the stats are incorrect on the latest version of dd-wrt?

Firmware: DD-WRT v3.0-r36079 std (06/01/18)

vortex-5 commented 6 years ago

Not observing this myself.

danmed commented 6 years ago

For me, it's only reporting between 60 and 140kbps instead of the 440 - 470 i'm actually getting.

I've rolled back to 33492 and it's working fine

danmed commented 6 years ago

Just tried the latest firmware and again, the same problem.

This is on a TPLink WR1043ND V2 running DD-WRT version 36079

DD-WRT overall Bandwidth Usage : https://imgur.com/Kdv9gy0 The Application using the Bandwidth : https://imgur.com/avdVOi3 BWMon's assessment of the server running the App (DAN-SYNC) : https://imgur.com/bGu9MHc

vortex-5 commented 6 years ago

OK a few things the DDWRT router graph is reporting speeds in Mbps 1Mbps = 125KB/s so 4.27 ~ 533.75KB/s I can see that BWMON numbers are still too low however considering this.

I retested on my router DDWRT 36104 on WNDR4300 and the speed test results look ok within 63Mbps-65mbps reported by BWMON of 70mbps reported by speedtest. The error / offset is accounted for because BWMON generally averages out bandwidth numbers and speed test doesn't run long enough for the running average to rise to its reported number.

You may have to tweak around with the tuning numbers since you've reported this before but I can't reproduce it myself.

The UI uses this: https://github.com/vortex-5/ddwrt-bwmon/blob/master/bwmon/www/bwmon.js#L10 to work out how to convert between the routers internal counter over a displayed unit value. This affects all units on display obviously in my case it's 8 which is intuitive since the router reports bytes but in order to not clear the stats as much the code on the router divides the recorded bytes by a factor of 10.

if you execute 'iptables -L BWMON -vnx' you can see the data BWMON tries to read from your router perhaps these numbers have changed between the previous version and the current version.

It has not on the WNDR4300 since I'm seeing correct numbers.

Finally the numbers in BWMON will always lag behind real time speed counters it can take a full 30 seconds for the rate numbers to be accurate. If you want faster numbers running the script in lighttpd mode is generally much faster with rate updating usually numbers will stabilize at around 6-9 seconds. Most of this is done in effort to reduce the load on the router when the script runs super fast it actually will start affecting your routing performance which would be unacceptable.

danmed commented 6 years ago

OK, So on the newer firmware, the iptables commands produces this whilst at full whack :

 783    44275 RETURN     0    --  *      *       192.168.2.152        0.0.0.0/0
1482  2211144 RETURN     0    --  *      *       0.0.0.0/0            192.168.2.152

If i keep running the command, the numbers grow and grow and then start lower and keep growing again

danmed commented 6 years ago

I've disabled Shortcut Forwarding Engine and i've install Yamon3 and the stats are correct in there if that helps?

vortex-5 commented 6 years ago

hmm... not to sure I haven't looked at Yamon since 2 we have different goals. BWMON tries be lightweight but doesn't consider itself a long term reporting tool. YAMON tries to be a long term database reporting tool with fancy graphs.

BWMON is only trying to give you the stats your router isn't providing you and generally tries to do the whole less is more approach a large emphasis is on not reducing routing performance.

Yamon3 isn't listed on github (through a github search) so I can't really investigate what the difference is that you're talking about.

downwith commented 6 years ago

Had similar issue. Disabling the Shortcut Forwarding Engine (as mentioned) seems to give more reasonable numbers. They were really low in iptables -vL before disabling.