2

Recently my ISP changed my DSL-line from fixed rate to SRA. This allows the modem to adapt the speed of the internet to the quality of the line instead of completely breaking down (my ISP is not interested into repairing the line so he introduced this mode because before we had an up-time of only 90%). The speed goes down to and below the half of the top speed. 1MBit/s instead of 2MBit/s is a pain when having multiple people at the same time using the internet but better than no internet.

When configuring QoS (Quality of Service) or SQM (Smart Queue Management I need to set the download speed to about 90% of the internet connection. If I set it above the actual speed, it will not work. If I set it too low, it would be painfully slow while it could be faster.

Since there are multiple people using the connection (also watching low-res youtube and their machines doing auto-updates, especially Windows 10 PCs), using the internet for anything that is influenced by high latency (aka. ping) is really annoying/impossible without QoS.

The modem of the ISP doesn't have any QoS by itself.

What can I do to keep the latency/bufferbloat low while maximizing the internet speed?

(OpenWrt-version is Chaos Calmer 15.05)

H. Idden
  • 141

3 Answers3

2

I hope you already fixed it somehow by now. But if you haven't or someone else needs help with this the solution I came up with is the following : Use your openwrt router with SQM enabled (preferably cake and not openwrt but LEDE) for your lag-sensitive devices . Then connect a cheapo TP-LINK (stock firmware) from it's wan port into the lan port of your openwrt/LEDE router and enable the feature: restrict bandwidth on tplink. Set it at half your total speed and fire up multiple instances of YouTube Netflix torrent etc on your tplink routers network Then open your lag-sensitive programs on your main network (openwrt/LEDE) and measure lag. If too high lower the limit (mainly upload) on your TPLINK if too low push it up until it affects your ping and so on, you need to find the right balance. As a side note you wont be able to access your tplinks router page from openwrt so you may want to go into remote configuration and set it to 255.255 255 255 and set wan address to static so that it can be accessed from your openwrt/LEDE box.

When you want full bandwidth for your guest wifi you disable the bandwidth cap . When you can't stand the lag you turn it on :D

This is not the best solution, maybe your could try Pf-sense /IPFIRE qos /sqm to split the bandwidth and stuff but you need an extra PC for that .

Good luck!!

2

What I ended up doing was:

I wrote a script that runs on the openwrt-router every minute to get the current bandwidth from the modem, substracts some margin and applies this value to the SQM-config

In case anyone else has this issue, here is the script I wrote. I am new to lua and programming on OpenWrt, so expect errors, but maybe it will help others.

http=require'socket.http'
body,c,l,h = http.request('http://modem/page_showing_current_speed')

bandwidth = "%[kbps/kbps%]:</td><td colspan='3'>[%d.]+ / [%d.]+</td></tr>"
bw_s = string.sub(body, string.find(body, bandwidth))
bandwidth = "[%d.]+ / [%d.]+"
bw_s = string.sub(bw_s, string.find(bw_s, bandwidth))
upload_r = "[%d.]+ "
upload = string.sub(bw_s, string.find(bw_s, upload_r))
upload_r = "[%d.]+"
upload = string.sub(upload, string.find(upload, upload_r))
upload = upload:gsub("%.", "")
download_r = " [%d.]+"
download = string.sub(bw_s, string.find(bw_s, download_r))
download_r = "[%d.]+"
download = string.sub(download, string.find(download, download_r))
download = download:gsub("%.", "")
print(upload)
print(download)
f = io.open("/etc/config/sqm", "rw")
content = f:read("*all")
f:close(f)
oldcontent = content
content = content:gsub("option download '%d+", "option download '" .. download)
content = content:gsub("option upload '%d+", "option upload '" .. upload)
if content == oldcontent
    then
    else
        print(content)
        f2 = io.open("/etc/config/sqm", "w")
        f2:write(content)
        f2:flush(f2)
        f2:close(f2)

        os.execute("/etc/init.d/sqm restart")
end

then run:

opkg update
opkg install luasocket
crontab -e
* * * * * lua /adjustsqm.lua
/etc/init.d/cron restart

it gets the current speed from the modem every minute and writes it into the sqm configuration

H. Idden
  • 141
0

Try installing Gargoyle Firmware on your router, it should have adaptive QOS configured so you only need to enable it and use it.

I can't guarantee it works, so please do your own tests and report back.

valentt
  • 332
  • 3
  • 12