OpenWrt Forum Archive

Topic: Fair Share of bandwidth/latency for each local IP? (QOS SQM)

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys

First up - I am after low pings and reasonable bandwidth no matter if someone is torrenting.

I've been using the plain (luci) QOS scripts for a while - which is a massive improvement over "nothing" - but with people sometimes torrenting on various ports, or watching netflix - things still got rather wonky sometimes

Just upgraded my TP-Link 842 to a more recent firmware ( OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55) ) so I could try out SQM - but when someone is torrenting - I still get 1000+ ping

It still seems the best option to get fair share of latency/bandwidth is some kind of per-local IP rules - is there a way I can do this? am I barking up the wrong tree?

edit: Should also mention, I am on a ~3.5/0.3 down/up ADSL link

(Last edited by chozabu on 8 Jul 2016, 15:39)

chozabu wrote:

Hi guys

First up - I am after low pings and reasonable bandwidth no matter if someone is torrenting.

I've been using the plain (luci) QOS scripts for a while - which is a massive improvement over "nothing" - but with people sometimes torrenting on various ports, or watching netflix - things still got rather wonky sometimes

Just upgraded my TP-Link 842 to a more recent firmware ( OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55) ) so I could try out SQM - but when someone is torrenting - I still get 1000+ ping

It still seems the best option to get fair share of latency/bandwidth is some kind of per-local IP rules - is there a way I can do this? am I barking up the wrong tree?

edit: Should also mention, I am on a ~3.5/0.3 down/up ADSL link

You could try one of the LEDE builds, as these allow you to select the cake qdisc in sqm-scripts wich promises to solve this problem to some degree. If you want to try this I would recommend a LEDE trunk built with additionally installed luci gui, luci-app-sqm, kmod_cake, and sqm-scripts-extra (alternatively you could follow the instructions on https://github.com/moeller0/temporary_t … qm-scripts to manually install those test scripts, but you need sqm-scripts installed first). The sqm-scripts-extra package contains experimental scripts that expose cake's IP isolation features. But please note that currently this does not work well with NAT so is ready for testing, but not for prime-time use. If you are willing to test this ad help us improve sqm-scripts and cake to solve this problem for good I would be delighted. If you have detail questions do not hesitate to ask.

Best Regards
        M.

chozabu wrote:

Hi guys

First up - I am after low pings and reasonable bandwidth no matter if someone is torrenting.
...
Just upgraded my TP-Link 842 to a more recent firmware ( OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55) ) so I could try out SQM - but when someone is torrenting - I still get 1000+ ping

It still seems the best option to get fair share of latency/bandwidth is some kind of per-local IP rules - is there a way I can do this? am I barking up the wrong tree?

edit: Should also mention, I am on a ~3.5/0.3 down/up ADSL link

@chozabu: moeller0 mentions the LEDE build, but the SQM-QoS of Chaos Calmer should give a better experience than what you describe. Would you answer a few questions about your setup?

- You say it's 3.5/0.3 mbps ADSL. True?
- What is the WAN interface in the Network->Interfaces page? (It's in the red box below "WAN")
- What parameters do you see in the Network->SQM-QoS values? The most important are:
   - Enable this SQM instance (should be checked)
   - Interface name (should be the same as the "WAN interface" named above)
   - Download Speed (default should be about 2975 -  85% of your 3500 kbps download)
   - Upload Speed (default should be 255 - 85% of your 300 kbps upload)
   - Queue discipline (in the Queue Discipline tab - use the default of "fq_codel")
   - Which Link Layer to account for: (in the Link Layer Adaptation tab - use ATM)
   - Per-Packet Overhead (Link Adaptation tab - use 44)

Then try www.dslreports.com/speedtest and look at the "Results and Share" to see the latency values. I would like to hear what happens.

"SQM-QoS of Chaos Calmer should give a better experience" why?

im on CC with sqm qos and literally every downloader (steam, torrent, battle.net etc.) does not care about qos and fill the whole line.

i tested moellers scripts aswell, but he mentioned, that it does not work well for NAT, so i assume thats why i have the same problems there.

@mezo SQM-QoS is designed to work better, since it separates out the flows - big and small - and sends them out in a fair way. (It explicitly slows the downloaders as needed to give the small connections low latency access to the network.)

I would like to let the Bufferbloat team know about your experience to get their thoughts. Would you answer the questions above so I can pass it along? Thanks.

(Last edited by richbhanover on 11 Jul 2016, 11:55)

- You say it's 3.5/0.3 mbps ADSL. True? - ADSL 16000/2500kbit
- What is the WAN interface in the Network->Interfaces page? (It's in the red box below "WAN") - pppoe-wan

- What parameters do you see in the Network->SQM-QoS values? The most important are:
   - Enable this SQM instance (should be checked) - is enabled wink
   - Interface name (should be the same as the "WAN interface" named above) - pppoe-wan
   - Download Speed (default should be about 2975 -  85% of your 3500 kbps download) - dl: 15000
   - Upload Speed (default should be 255 - 85% of your 300 kbps upload) - ul: 2000
   - Queue discipline (in the Queue Discipline tab - use the default of "fq_codel") - fq_codel
   - Which Link Layer to account for: (in the Link Layer Adaptation tab - use ATM) - ATM
   - Per-Packet Overhead (Link Adaptation tab - use 44) - 44

the bold text are my answers. sqm-qos works fine for http downloads, but all downloader i mentioned fill the line till the limit is reached i set for qos. so if i set 15000, steam use the whole 15000kbit and everything else starts to lag/ping goes up.

(Last edited by mezo on 11 Jul 2016, 12:20)

If you're willing to experiment with the configuration, I have a few more questions.

- 16000/2500kbit sounds more like cable modem speeds. Is that true?
- What happens if you set the download speed to 13600 (that's 85% of the 16,000kbps)
- What are the results of the www.dslreports.com/speedtest? Click "Results+Share" and send the URL of that page so I can see all the details.

Thanks!

Update: I see you did say it's ADSL. Cool speeds! :-)

(Last edited by richbhanover on 11 Jul 2016, 12:29)

i experimented alot - rly alot - and there is no way to get this problem away. i even tried to set the dl limit to 8000 and upload to 1000.

its a adsl connection btw.

http://www.dslreports.com/speedtest/4402698.png

mezo wrote:

"SQM-QoS of Chaos Calmer should give a better experience" why?

im on CC with sqm qos and literally every downloader (steam, torrent, battle.net etc.) does not care about qos and fill the whole line.

i tested moellers scripts aswell, but he mentioned, that it does not work well for NAT, so i assume thats why i have the same problems there.

Hi Mezo,

so steam and torrents are currently known to be in sqm-scripts' blind-spot so to say, we are working on this though wink Could you please remind? me which of the extra test scripts you tried and how you set them up? I especially created the _LAN_ variants of these scripts to avoid the NAT issue (for testing only, as this then requires all computers to be connected via cables as sqm on LAN typically will not shape WLAN traffic to/from the internet, but only WLAN traffic to/from LAN ports). Maybe we can test things further?

Best Regards
        M.

hey,
i have tested the "TEMPORARY_WAN_triple-isolate__piece_of_cake.qos" script over wifi (so i did everything wrong smile ).

can i use a second router as client wifi brdige where i connected via lan, together with _LAN_ variant? its hard to test LAN otherwise for me.

(Last edited by mezo on 11 Jul 2016, 12:56)

mezo wrote:

hey,
i have tested the "TEMPORARY_WAN_triple-isolate__piece_of_cake.qos" script over wifi (so i did everything wrong smile ).

can i use a second router as client wifi brdige where i connected via lan, together with _LAN_ variant? its hard to test LAN otherwise for me.

Hi mezo,

you did nothing wrong, the WAN variants will work with WLAN traffic just as they should. Only due to NAT the information about the internal IP addresses is hidden so that the IP isolation options will regress into pure flow isolation...

But your idea about hooking up a second (non-NAT/dumb-AP) router to one of the sqm'd router's LAN ports is actually a very good idea to still allow wifi clients into the testing mix.

Please note that you should test both the triple-isolate as well as the dual isolation scripts (triple-isolate might have a bug).  And these scripts will isolate by internal IP address, so on the computer that uses the steam client latency for browsing will in all likelihood still suffer, but other computers should work fine/be less affected than currently.

Please report back any success or failures so we have a chance of getting this fixed...

Best Regards
        M.

my idea was more to setup a second router in my flat (the main router is in another flat smile ) and connect it over wifi as client to the main router and myself via lan. i still can connect the second router via lan, but it would be easier the wifi way for me.

so what i want to do:
- connect my second router as wifi client to the main router.
- disable sqm qos on the main router.
- enable sqm qos with lan variant on my second router.
- connect myself via lan to this router.

(Last edited by mezo on 11 Jul 2016, 13:12)

mezo wrote:

my idea was more to setup a second router in my flat (the main router is in another flat smile ) and connect it over wifi as client to the main router and myself via lan. i still can connect the second router via lan, but it would be easier the wifi way for me.

so what i want to do:
- connect my second router as wifi client to the main router.

        in that situation you should be able to instantiate SQM on the WIFI interface of the main router. But shaping on wifi has its own issues and will at least drag in more variability than if you could hook up the secondary router via a cable to the main router. This has the additional advantage that truly internal traffic on the secondary router is not throttled at all... Note that you would still use the LAN variant of the test script as WIFI is not WAN wink I believe that the current LEDE test built offers a slightly more recent cake module, so it might be a good idea to test this on LEDE instead of openwrt.

mezo wrote:

- disable sqm qos on the main router.
- enable sqm qos with lan variant on my second router.
- connect myself via lan to this router.

So your proposed scheme might work, but I believe keeping SQM on the main router would be much nicer. As that is a viable way to set things up as long as one is willing to invest in one non-wifi router (the router can have wifi, but it should just not be used) to avoid the usual NAT issues...


Best Regards
        M.

queuing discipline should be cake, right?

it seems like on your script up and download is reversed?!?, atleast it works if i reverse them.

what i noticed so far on my test:
it seems to work, steam does no longer eat the whole connection, but i have to set the downloadlimit in sqm much lower than usual. also compared to http downloads, twitch still starts to lag while downloading on steam.

so when i watch twitch and downloading on steam, steam gets slowed down, but not enough as it seems. atleast the ping is stable while doing both, even if have to set my downloadlimit much lower.

a http download stays at ~440kb/s when i set 10000 on sqm, while twitch and everything works fine.
steam stays at ~670kb/s when i set 10000 on sqm.

(Last edited by mezo on 11 Jul 2016, 15:27)

@mezo - I'm going to step back here. When moeller0 offers advice, I listen very carefully. Best regards...

Hi mezo,

first thank you for testing. Could I convince you to reoprt a bit more detail about what you set-up and what you observed? Maybe you could post the result from "cat /etc/config/sqm" and "tc -d qdisc" from the machine you enabled sqm-scripts on as well as add a quick descruiption whivch of the discussed topologies you ended up implementing?



mezo wrote:

queuing discipline should be cake, right?

it seems like on your script up and download is reversed?!?, atleast it works if i reverse them.

        The LAN scripts internally flip ingress and egress bandwidth, so that the monikers download and upload stay correct, but a) that relies on your real local topology and b) I might have screwed that up wink

mezo wrote:

what i noticed so far on my test:
it seems to work, steam does no longer eat the whole connection, but i have to set the downloadlimit in sqm much lower than usual. also compared to http downloads, twitch still starts to lag while downloading on steam.

        Steam and twitch this on the same machine or on different ones?

mezo wrote:

so when i watch twitch and downloading on steam, steam gets slowed down, but not enough as it seems. atleast the ping is stable while doing both, even if have to set my downloadlimit much lower.

a http download stays at ~440kb/s when i set 10000 on sqm, while twitch and everything works fine.
steam stays at ~670kb/s when i set 10000 on sqm.

A look at your /etc/config/sqm and the output of "tc -d qdisc" might help to elucidate things a bit for me wink


Which of the test scripts are you using? The triple or the dual-isolate one?


Best Regards
        M.

root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth1'
        option qdisc_advanced '0'
        option interface 'wlan0'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option overhead '44'
        option enabled '1'
        option qdisc 'cake'
        option script 'TEMPORARY_LAN_dual-isolate__piece_of_cake.qos'
        option download '2000'
        option upload '10000'
root@OpenWrt:~# tc -d qdisc
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 1024p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 1024p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc cake 800d: dev wlan0 root refcnt 5 bandwidth 2Mbit besteffort dual-dsthost rtt 100.0ms raw
 linklayer atm overhead 44 mtu 2047 tsize 512
qdisc ingress ffff: dev wlan0 parent ffff:fff1 ----------------
qdisc cake 800e: dev ifb4wlan0 root refcnt 2 bandwidth 10Mbit besteffort dual-srchost rtt 100.0ms raw
 linklayer atm overhead 44 mtu 2047 tsize 512

Steam and twitch this on the same machine or on different ones?

same machine

Which of the test scripts are you using? The triple or the dual-isolate one?

i tried both

Could I convince you to reoprt a bit more detail about what you set-up and what you observed?

i connected my second router as a wifi client to my main router. i disabled qos on main router and enabled it on the second router with settings you can see above. i conntected myself to lan of the second router!

it just looks for me, that downloader like steam and bnet still not get slowed down enough.

i just made a second test while watching twitch

this are the results:
steam: 800kb/s, ping is fine, twitch buffers
bnet: same as steam, but i dont give to much about the speed bnet shows, because it is alwas wrong. ping still fine, twitch buffers.
http debian download: 500-600 kb/s, twitch runs fine, ping is fine.

(Last edited by mezo on 11 Jul 2016, 17:56)

Hi mezo,

mezo wrote:
root@OpenWrt:~# cat /etc/config/sqm

config queue 'eth1'
        option qdisc_advanced '0'
        option interface 'wlan0'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'atm'
        option overhead '44'
        option enabled '1'
        option qdisc 'cake'
        option script 'TEMPORARY_LAN_dual-isolate__piece_of_cake.qos'
        option download '2000'
        option upload '10000'
root@OpenWrt:~# tc -d qdisc
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 1024p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc fq_codel 0: dev eth1 root refcnt 2 limit 1024p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
qdisc cake 800d: dev wlan0 root refcnt 5 bandwidth 2Mbit besteffort dual-dsthost rtt 100.0ms raw
 linklayer atm overhead 44 mtu 2047 tsize 512
qdisc ingress ffff: dev wlan0 parent ffff:fff1 ----------------
qdisc cake 800e: dev ifb4wlan0 root refcnt 2 bandwidth 10Mbit besteffort dual-srchost rtt 100.0ms raw
 linklayer atm overhead 44 mtu 2047 tsize 512

        Thanks, I see why you need to flip download and upload directions now.

mezo wrote:


Steam and twitch this on the same machine or on different ones?

same machine

        That unfortunately is not something we can easily fix since then the offending traffic and the relevant traffic share the internal IP address so by-internal IP fairness does not help much. Could you please try twitching from a different machine than the steaming (at least for testing?). At the same machine you really need to look into steams bandwidth control (https://support.steampowered.com/kb_art … -TYSC-9690) and battle.net's and your torrent client's, or resort to DSCP markings (if all of these clients should use stable port numbers, which I doubt). The hope is currently that at least machines that are not producing problematic torrent-like traffic will remain useable even with timing critical stuff like twitch. That said, how much bandwidth does twitch at your quality settings actually does require, do you happen to know?

mezo wrote:

Which of the test scripts are you using? The triple or the dual-isolate one?

i tried both

        Thanks, could you observe any differences for your test load, between dual and triple?

mezo wrote:

Could I convince you to reoprt a bit more detail about what you set-up and what you observed?

i connected my second router as a wifi client to my main router. i disabled qos on main router and enabled it on the second router with settings you can see above. i conntected myself to lan of the second router!

        So from the secondary routers perspective internet download and interface-ingress direction are aligned again, same for upload-egress. The LAN scripts really assume you instantiate them on the main router that directly faces the internet. But have you tried setting this up on the main router instead?

mezo wrote:

it just looks for me, that downloader like steam and bnet still not get slowed down enough.

i just made a second test while watching twitch

this are the results:
steam: 800kb/s, ping is fine, twitch buffers
bnet: same as steam, but i dont give to much about the speed bnet shows, because it is alwas wrong. ping still fine, twitch buffers.
http debian download: 500-600 kb/s, twitch runs fine, ping is fine.


Mmh, so this is better, but not good enough yet. Which openwrt/LEDE version are you using?

Best Regards
        M.

That said, how much bandwidth does twitch at your quality settings actually does require, do you happen to know?

this is how twitch traffic usually looks like
http://i.imgur.com/dTLERWL.jpg

Thanks, could you observe any differences for your test load, between dual and triple?

not really tbh.

But have you tried setting this up on the main router instead?

the problem is, that my network is wifi only and this wouldnt help. sad

Could you please try twitching from a different machine

i will try, but same problem as above. my network is wifi only.

Mmh, so this is better, but not good enough yet. Which openwrt/LEDE version are you using?

OpenWrt Designated Driver r49395

(Last edited by mezo on 11 Jul 2016, 19:18)

Hi mezo,

mezo wrote:

That said, how much bandwidth does twitch at your quality settings actually does require, do you happen to know?

this is how twitch traffic usually looks like
http://i.imgur.com/dTLERWL.jpg

        So this is just twitch? This looks like it eats a considerable amount of your bandwidth, with its bursts close to 60 percent of your shaped bandwidth (or rather since you are on ATM you only get around 9Mbps form your configured 10Mbps due to ATM's 48/53 encoding) I am not amazed that this is not going smoothly...

mezo wrote:

Thanks, could you observe any differences for your test load, between dual and triple?

not really tbh.

        I just realized that in your setup with sqm on wlan0 of the second router you need to use the WAN vartiants of the scripts as the LAN variants will in your case try to be fair to the external IP addresses. Could you please test again with the WAN dual-isolate script?

mezo wrote:

But have you tried setting this up on the main router instead?

the problem is, that my network is wifi only and this wouldnt help. sad

        Why, all I propose is to instantiate sqm on the WLAN interface of your main router, the one you use to connect the secondary router. BTW, if there are computers directly connected to the main router in addition to the secondary router, shaping will occasionally fail as the shaper does not see some of the traffic that actually crosses the atm link, but I goes you are aware of that.

mezo wrote:

Could you please try twitching from a different machine

i will try, but same problem as above. my network is wifi only.

        This is somewhat important to test, as this is the only situation where cake's isolation modes can actually work for you.

mezo wrote:

Mmh, so this is better, but not good enough yet. Which openwrt/LEDE version are you using?

OpenWrt Designated Driver r49395

Ah, okay, that should be recent enough.

Best Regards
        M.

So this is just twitch?

yes

This looks like it eats a considerable amount of your bandwidth, with its bursts close to 60 percent of your shaped bandwidth

yes, but http traffic gets shaped down nicely, also when i go to 15mbit dl i have still the same problems.

Could you please test again with the WAN dual-isolate script?

doesnt seems to work. feels like there is no qos enabled, while downloaing on steam.

Why, all I propose is to instantiate sqm on the WLAN interface of your main router, the one you use to connect the secondary router.

what is the advantage over my way if i going this way? im the only "pc" except smartphones, raspberries who is causing traffic on wlan. the second pc is connected via lan to the main router. so all i would do is replace my second router with myself? i can try this, no problem.

do u have irc or something?

(Last edited by mezo on 12 Jul 2016, 11:35)

mezo wrote:

So this is just twitch?

yes

This looks like it eats a considerable amount of your bandwidth, with its bursts close to 60 percent of your shaped bandwidth

yes, but http traffic gets shaped down nicely, also when i go to 15mbit dl i have still the same problems.

        I believe it is twitch that does not like its packages dropped, if you have a long data transfer via http the traffic pattern most likely looks differently, much smoother and with less differences than the twitch traffic shows, that basically switches between full throttle and 0 bps.

mezo wrote:

Could you please test again with the WAN dual-isolate script?

doesnt seems to work. feels like there is no qos enabled, while downloaing on steam.

        That sounds like something is wrong, you did re-flip the ingress and egress bandwidths in the GUI?

mezo wrote:

Why, all I propose is to instantiate sqm on the WLAN interface of your main router, the one you use to connect the secondary router.

what is the advantage over my way if i going this way? im the only "pc" except smartphones, raspberries who is causing traffic on wlan. the second pc is connected via lan to the main router. so all i would do is replace my second router with myself? i can try this, no problem.

        Well, the shaper should be instantiated as close to the real bottleneck link as possible, but due to the NAT issue setting it up on the WAN interface will not work well with, per IP isolation. Especially there should be no internet traffic sources and sinks between the shaper and the bottleneck link. If the WAN interface is not useable then the next interface in the chain should have the lowest side effects, this is why I recommend shaping on the main router.
        Setting up sqm on the main router's wlan interface is not going to change much in your network's performance, if the only traffic over both involved wlan interfaces is the traffic between both routers.
        The smartphones and the raspberries all connect to the secondary router via wlan1 I assume? The fact that the seconf PC is between sqm and the internet really makes it hard/impossible to guarantee decent SQM performance. I believe that twitch and steam on that PC should have massive impact on the usability of machines connected via the secondary router (which I assume is configured as dumb AP and not as NAT device).

mezo wrote:

do u have irc or something?

Sorry, I am pretty oldschool, so mostly email and the forum (and snce I am a slow typer, IRC would be painful for the other side anyways...)

Best Regards
        M.

i just tested everything on main router and set interface to wlan. i tested both _WAN_ and _LAN_ and steam goes always full speed.

The discussion might have continued from here.