QOS Calculator

Discussion in 'Tomato Firmware' started by NyNe, May 17, 2017.

  1. NyNe

    NyNe Networkin' Nut Member

    Hey everyone,

    For those who use QOS, I've created a QOS Calculator to hopefully help make sure we get the numbers right in our router settings.
    Sorry in advance for the lack of documentation, but here's the basic details:

    I designed the page to allow you to enter results generated from the Speedtest.net mobile app.
    1. Make sure you're connected to your router's wifi
    2. Get the Speedtest.net app on your mobile device
    3. Go to the Results tab in the app and clear all results (little tools icon at the top right)
    4. Go to the Settings tab in the app and select a server
    5. Perform a speed test
    6. Repeat steps 4 and 5 selecting a different server for each test until you have at least 5 results (I like to do 2 tests per server on 5 servers)
    7. Go to the Results tab in the app and Export your results (little tools icon at the top right) and email them to yourself.
    8. In the email, select your results (they should look like this):
      "2017-05-16 21:52","Wifi","12.34567","-12.34567",33.87,6.52,64,"Paducah, KY","",""
      "2017-05-16 21:52","Wifi","12.34567","-12.34567",45.35,7.21,65,"Paducah, KY","",""
      "2017-05-16 21:51","Wifi","12.34567","-12.34567",23.54,6.40,71,"Paducah, KY","",""
      "2017-05-16 21:50","Wifi","12.34567","-12.34567",21.86,6.23,70,"Paducah, KY","",""
      "2017-05-16 21:49","Wifi","12.34567","-12.34567",52.04,6.56,73,"Union City, TN","",""
      "2017-05-16 21:49","Wifi","12.34567","-12.34567",49.54,6.69,73,"Union City, TN","",""
      "2017-05-16 21:48","Wifi","12.34567","-12.34567",8.55,6.65,98,"Equality, IL","",""
      "2017-05-16 21:45","Wifi","12.34567","-12.34567",9.60,6.66,96,"Equality, IL","",""
      "2017-05-16 21:44","Wifi","12.34567","-12.34567",65.13,5.98,63,"Jackson, TN","",""
      "2017-05-16 21:44","Wifi","12.34567","-12.34567",69.64,6.29,64,"Jackson, TN","",""
      *Modified to remove personal info

    9. Copy your results into the HTML form and hit Calculate
    10. Tomato firmwares expects a kB/s result to be entered, so use the kB/s results for your QOS settings
    Behind the scenes:
    The HTML form takes your results, removes the highest and the lowest result for Download and then averages the remaining results and multiplies by 85% to give you a QOS recommendation.
    It does the same for Upload but instead multiplies by 70% for the QOS recommendation.
    [edit]I based these ideas off of Toastman's QOS Tutorial, and of course ignored his plain English recommendation! http://www.linksysinfo.org/index.php?threads/qos-tutorial.68795/#post-231128 I'm hoping to improve on how this is built and the recommended instructions for gathering results so that this tool can be better in the future, but I feel that this is a decent start.[/edit]
    These values are now adjustable with a slider.

    The Download and Upload results are evaluated independently, so let's say you have results that look something like this:
    Download: 99, Upload: 22
    Download: 88, Upload: 22
    Download: 88, Upload: 10
    Download: 88, Upload: 22
    Download: 50, Upload: 30
    The calculator will remove 99 and 50 from download, and then average 88 for download.
    The calculator will remove 10 and 30 from upload, and then average 22 for upload.

    Future to-do list:
    Put documentation (similar to this, but better) on GitHub
    Allow the % multiplier to be adjusted on the fly for both Download and Upload
    Possibly add some logic to determine if the results came from a PC using Speedtest.net (for some reason they format these results differently)

    I would love feedback on this idea, and contributions on GitHub are welcome!
    Last edited: May 18, 2017
    Fedex03 and AndreDVJ like this.
  2. cloneman

    cloneman Addicted to LI Member

    I can't say I agree with using WiFi/Mobile speed tests to determine true bandwidth and QoS parameters. Too many variables will probably lead to numbers that are too low for most people. Perhaps you can call it "QoS calculator for millennials" :D
  3. NyNe

    NyNe Networkin' Nut Member

    This tool won't be a perfect fit for everyone, even if I improve it to handle results from a wired computer. Speedtest.net is not perfect, there are some servers on there that only have X amount of bandwidth, and if your connection is faster than they support testing then your results will be inaccurate at best.

    The average internet consumer is likely to have their ISP connection as the bottleneck between their wifi connected mobile device and the rest of the internet. We're mostly past the age of the WRT54G, so this tool was build on a few assumptions, such as:
    • Most wifi routers are capable of speeds faster than the user's ISP connection (ex: I have 60Mbps down, 6Mbps up, and my wireless router is an Asus RT-AC66u, so my wireless speeds exceed my ISP bottleneck)
    • If you use this tool and follow the provided instructions to perform the tests via a mobile device and your wireless connection from your phone to your router is not very good, then you are more likely to end up with results closer to Toastman's recommendations (lower QOS settings are better)
    • The majority of users I expect to even see this post are users here on this forum who have likely taken the leap to installing a custom firmware on their router, and hopefully have SOME kind of common sense (but who am I to judge that?)
    Another factor I had not mentioned in the post (but you can see it in the code) is that only Wifi tests are used in the calculation, so if you run the test 20 times, but 5 of them were on your mobile device's cellular connection for some reason, the cellular results are not used to calculate the results. I put SOME safeguards in there, and again I'm open to suggestions and ideas!
  4. Monk E. Boy

    Monk E. Boy Network Guru Member

    If they have a 2.4-only router and are in a normal subdivision or, god forbid, apartments/condos, depending on wireless for a speed test is going to be a complete waste of time. Even 5Ghz gets congested when you're in an apartment/condo, its even worse if multiple people close by are trying (and usually failing miserably) to do 160Mhz 802.11ac.

    That being said, I don't see why Download,Upload,Latency,ServerName would be different when running over a wired connection, although the export from speedtest may be formatted differently (though it'll probably be similar), so the input data may need some massaging, but your calculation/formula should still be sound even with wired transfer rates.

    Really don't mean this to sound critical, the only thing I'm leery of is WiFi simply because interference will affect transfer rates, and interference can be intermittent (which isn't all bad for this test) but it can also be constant (which would be bad).
  5. NyNe

    NyNe Networkin' Nut Member

    The columns you get when exporting results from the website via browser are
    The columns you get when exporting results from the app on a mobile phone are
    So I could do something in the javascript like
    to determine if the results came from desktop or mobile app.
    This also would not stop someone from using a laptop to access the website and perform speed tests on wifi from the laptop, but at least if I used the hasOwnProperty idea there would be the ability to handle results from the website which would open the gate for wired connections. I'm not opposed to doing this, I just focused on the mobile app at first because until today I didn't even know the website would let you export results (i have known the mobile app could do it for a while).

    I'd also like to get GitHub pages setup so that you don't have to download the HTML file, but rather you could just open the demo page and use it.
  6. NyNe

    NyNe Networkin' Nut Member

    By the way I appreciate the feedback thus far, critical feedback is a part of making anything worth using :)
    gffmac likes this.
  7. NyNe

    NyNe Networkin' Nut Member

    I have updated the tool to allow results from either Mobile or Desktop. I will have to write up some instructions on how to get the desktop results but I'll probably try and get that and other documentation put together on GitHub.
    gffmac likes this.
  8. NyNe

    NyNe Networkin' Nut Member

    I've updated the URL to https://nemchik.github.io/qos-calc/ and started using GitHub Pages, so you can now use the calculator right on GitHub rather than having to download it and open it locally (which you are still welcome to do).
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice