What's new

WAN speed monitoring

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

marcosscriven

New Around Here
Wondering if there's a way to do WAN speed monitoring on the router itself, in such a way that it would take account of current traffic?

E.g. Each 5 minutes or so I'd like the router to download something, and check how fast it did - but, and this is the bit I'm not sure about, take into account if the router is already downloading something?

Another way of putting it is: every 5 minutes, make sure the router is downloading at maximum capacity, and measure that capacity, whilst prioritising normal traffic, so that the normal traffic is not impacted AND the speed test is accurate (and not reduced by normal traffic)
 
One idea I had was to have a raspberry pi on a particular IP download something periodically, and set that up with lowest prio in QoS. Then use the WAN bandwidth monitor on Merlin - that way the download would push WAN download if and only if nothing else is.
 
I have made a script for this using a simple program called speedtest-cli which is python based.

you can simply install it by using this line:

pip install speedtest-cli


when installed you can create a script called speedtest.sh and insert this:

#!/bin/sh

echo " " >> /mnt/sda1/speedtests/speedtests.log
date +"%d-%m-%Y %H:%M" >> /mnt/sda1/speedtests/speedtests.log
speedtest-cli --simple >> /mnt/sda1/speedtests/speedtests.log

you probaly want to modify the outpout path "/mnt/sda1/speedtests/speedtests.log" to whatever suits your system

you wanna call this script using cron, which is done by editing your services-start script and insert these parameters

cru a SpeedTest "05 * * * * /jffs/scripts/speedtest.sh"

this calls your speedtest script every 5 minutes

All the statistics will end up in the speedtest.log with information about ping, download speed, upload speed and a date tag :)

I have furthermore made a script to send the statistics to my own mail once every week ;)
 
Hi @smadremanden

The utility you're referring to is here: https://github.com/sivel/speedtest-cli

Unfortunately, that doesn't cover my use case - what if, when your script run, you're *also* downloading something? The speedtest will show lower that your actual capacity right?

My requirement/suggestion is to monitor the actual WAN traffic on the router - and periodically run a download to ensure the connection is maxed out - BUT, also ensure that download is lowest priority, so anything else you actually want to download for real doesn't get slowed down. Does that make sense?
 
It makes perfect sense.

But in my mind the complexity of what you want is so major, compared to what you get from it.
Why not just schedule traffic and cut all traffic on the LAN side of your router in 5 minutes or so everyday at 3 or 4 am, and let the speedtest run at this point?
 
Because I'm having issues with my broadband, and I'd like to get an accurate idea of the speed all through the day, while I'm using it.
 
I see.

The only thing, which i can think of that would meet your requirements fully would be something like the samknows whitebox, which sits in front of your router and monitors when there isn't activity from it, and only then conducts various tests.

I'm not sure you would ever get a perfect reading from any of the other options which you have considered (the pi idea you had).

My best guess if you want a close to perfect reading everytime is to have something in front of your router to either monitor the traffic from the router or to simply just totally downprioritize the traffic from the router, whenever it's conducting tests.
 
Interesting - I'd not heard of that, so I went looking... https://gist.github.com/Mag81/44097d9a54574a5b2ed8

Apparently it's just a router, with software right? :) Which is what we already have

I don't see why my idea wouldn't work? The WAN traffic monitoring is already there on the ASUS:

Code:
curl 'http://192.168.0.1/update.cgi' -H 'Referer: http://192.168.0.1/Main_TrafficMonitor_realtime.asp' -H "Cookie: asus_token=$ASUS_TOKEN;" --data-binary 'output=netdev'

All you need to do is ensure a download is happening when you hit that endpoint right? The only issue is ensuring the test download is lower prio than real traffic. All you're doing then with the test traffic is bumping up the download bandwidth if your normal use doesn't happen to be doing so.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top