Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: SQM Automatically adjusting to line conditions  (Read 387 times)

bndwdthseekr

  • Member
  • **
  • Posts: 23
SQM Automatically adjusting to line conditions
« on: September 30, 2019, 09:29:38 PM »

I recently switched from tomato to openwrt, mainly because of SQM. I'm using the CAKE qdisc with impressive results, However I'm having to manually set the download speeds in the evening. Is there something I haven't come across yet to automatically adjust to an optimal speed based on the line or time of day?

For the moment I'm thinking the best option is to schedule a change around the time everyone gets home and it slows down. Any suggestions would be much appreciated!

The line itself isn't bad during non-peak hours, and the upstream seems consistent, but the downstream can go down to somewhere in the 1.5-2mbit range especially on weekend nights. This has become a problem for VOIP, games, and anything else which requires low latency.


I'm sure Ill figure out something, and if it comes down to it, Ill be happy to figure out a way to make this happen... but if there's already a solution for this, I would much rather spend my time doing other things  ;D

I have heard good things about the 'IQ router', but I'm not gonna pay for that overpriced garbage when openwrt can do the same thing with some scripting  :D



*edit* Should I just use a ping watchdog to ping a reliable server, and adjust the bandwidth for SQM every time the ping hits over a set number? I'm not sure if this is the best way to go about this, but its the only thing I can think of to keep the latency consistent.

It kind of baffles me that this hasn't been done before, but I can't find any info on what I'm trying to do to address this problem. I can think of many friends and neighbors, as well as quite a few people online who could use something that does this. Why did Adtran ever make the TA1248 anyway!? Did someone at Adtran actually think 12mbit would be enough for 48 clients?
« Last Edit: October 01, 2019, 04:30:48 AM by bndwdthseekr »
Logged

ejs

  • Kitizen
  • ****
  • Posts: 1991
Re: SQM Automatically adjusting to line conditions
« Reply #1 on: October 01, 2019, 06:56:18 PM »

I thought the original solution to the bufferbloat problem (codel / fq_codel), didn't need any explicit configuration of the bandwidth. So I think it has been done before.
Logged

bndwdthseekr

  • Member
  • **
  • Posts: 23
Re: SQM Automatically adjusting to line conditions
« Reply #2 on: October 01, 2019, 11:40:03 PM »

It doesn't need an explicit config for each device or service like standard QOS, but it does need the maximum usable bandwidth. If the ISP side of things isn't causing a 'sag' in the throughput then the modem sync speeds are used. If the max throughput on the router WAN interface happens to be less than the maximum bandwidth the DSL link supports,(when its at full load, a speed test would serve the same purpose) then those values should be used instead.

It also figures the ATM overhead (in my case) into the total bandwidth, so I can set my US/DS bandwidth to my modem sync rate in the wee hours of the morning, and no buffer bloat, or latency increase at all, even if we're maxing out the connection both ways!  ;D

Actually, putting in the correct values, is quite important for fq-codel or cake according to what I have read, and experienced recently. If you input values greater than your physical connection, it won't work. This is essentially what happens when I get this 'sag' in the bandwidth during peak use, and setting the DS lower, 4000kbit/s down from 6944kbit/s for example, immediately fixes any game ping, or VoIP issues, as long as its set low enough to compensate for the deficiency at that time.

My problem is, there are probably around 20 customers sharing ~12mbit 8x bonded T1/E1 at the dslam, so things can get crazy, and fluctuate a bit more than most.

Here's the link to the documentation if you're interested, even if you're not on DSL it could do some good, especially if whatever connection you have is frequently running at or near capacity.

https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
« Last Edit: October 02, 2019, 12:27:31 AM by bndwdthseekr »
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 5863
Re: SQM Automatically adjusting to line conditions
« Reply #3 on: October 02, 2019, 10:58:23 AM »

I think the ultimate solution is what aaisp are doing.

Ingress shaping I have found out only works as well as egress shaping when its been done pre bottleneck.  Its enough of a problem even without variable line capacity, AAISP offer ingress shaping their side where you can set to % of the line profile speed (they suggest 95%), they track that speed so it would always be up to date with sync speed.  I will be using that feature after I have migrated and plan to report here how effective it is.

All BTw isps ingress shape as they are required to by their t&c's with BTw but they usually do it at 100% of line profile or very close to it.  AAISP allows you to tune it.

https://support.aa.net.uk/Traffic_shaping_options

Now if you dealing with things like isp side congestion then trying to manage QoS is a bit of a no go as you then have a variability thats very inconsistent.
« Last Edit: October 02, 2019, 11:03:34 AM by Chrysalis »
Logged
AAISP - Billion 8800NL bridge & PFSense BOX running PFSense 2.4 - ECI Cab - LINE STATISTICS CLICK HERE

bndwdthseekr

  • Member
  • **
  • Posts: 23
Re: SQM Automatically adjusting to line conditions
« Reply #4 on: October 02, 2019, 11:34:15 AM »

I haven't had time to automate the process yet, but with SQM setting the bandwidth post-bottleneck does make a huge difference, so I think in my case it would be worth doing something to keep the latency down.

The other day, I was in a game when someone started streaming a movie, and my nice low ping of 59 went up to 180-200. Dropping the target download bandwidth by 500kbps dropped my ping back down to what it was, and allowed the other device to continue using a big chunk of the bandwidth. Sometimes on the weekend, I have to drop it by 2.5mbit or more  >:(

If this was a single user connection, and I didn't have to balance a whole household of devices, it really wouldn't be that big of an issue. The quality of the connection as far as ping is generally pretty good.

See, my sync speeds don't ever change, and I have plenty of headroom on the line speed, the problem is the idiots at my ISP using a device from adtran that was never meant to provide 100% of the ports 100% of their sync speed BW 100% of the time :D

I wonder if adtran could release a firmware which would allow the 10/100 ethernet port on the TA1248 to serve as backhaul... I don't see any equipment upgrades coming any time soon. I might end up grabbing one of those units from ebay and doing some research of my own along those lines.
« Last Edit: October 02, 2019, 11:56:48 AM by bndwdthseekr »
Logged

bndwdthseekr

  • Member
  • **
  • Posts: 23
Re: SQM Automatically adjusting to line conditions
« Reply #5 on: October 04, 2019, 07:49:33 AM »

Update:

I wrote a script that pings my first hop gateway 5 times every two minutes, and if the average goes over 45ms my target bandwidth for SQM gets lowered by 500kbps. Then I made another that runs every 15 minutes that raises the target by 500kbps as long as the average ping from 10 requests is under 50ms. Seems to work really well so far, Ill probably have to tweak it a little.

So yes, if you're on a very small bandwidth connection with 5 people trying to use it during peak TOD, and ISP congestion, this does work to improve quality. Now I have zero delay in voice calls, and playable ping in games. :cool:
Logged

bndwdthseekr

  • Member
  • **
  • Posts: 23
Re: SQM Automatically adjusting to line conditions
« Reply #6 on: Today at 03:54:50 AM »

Here's my now somewhat perfected solution. These two scripts are run from the cron tab, the latency_watchdog every minute, and bandwidth_replacer every 10 minutes.

This has solved my problem of high latency, even when the connection is congested the worst, by setting the 'Smart Queue Management' bandwidth target lower when high latency is detected. ;D

Anyway, absolute gold for drastically fluctuating connections... basically active QOS. Gaming with this vs without is night and day, because with these, the latency never spikes too far before the SQM bandwidth target is adjusted again. I have latency_watchdog running every 20 seconds, but that's probably a bit much for most connections... If the reason for high latency is on the ISP's side of things, I couldn't think of any other solution. Any suggestions?

dependencies:

luci-app-sqm
speedtest-netperf
« Last Edit: Today at 04:30:35 AM by bndwdthseekr »
Logged
 

anything