Automatic QOS speed setting for ADSL modems

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
Jerry_Offsping
Posts: 4
Joined: Fri Apr 20, 2012 1:24 pm

Automatic QOS speed setting for ADSL modems

Post by Jerry_Offsping »

I have tl-wr1043nd running Gargoyle 1.5.4. It is connected to ADSL modem and using PPPoE connection setting. My internet connection speed is not constant, for a nighttime it switches to a higher speed. I am experiencing some problems with QOS, because I must change bandwidth setting manually every time when speed changes. ADSL modem provides it's connection speed through Web UI. So I thought that I can make some script that will get correct settings from ADLS modem UI and automatically set it to QOS every time when connection established. The problem is that I am not very experienced and I don't know where to put such a script. I know that it will use wget and some parsing routine, and then commit

Code: Select all

/etc/init.d/qos_gargoyle stop
uci set qos_gargoyle.@download[0].total_bandwidth='115'
uci set qos_gargoyle.@upload[0].total_bandwidth='115'
uci commit
/etc/init.d/bwmon_gargoyle stop
/etc/init.d/qos_gargoyle start
/etc/init.d/qos_gargoyle enable
/etc/init.d/bwmon_gargoyle start
I want to know if it will be enough or I missed something and where to attach it.
Can anybody direct me, please? Thank you.

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Automatic QOS speed setting for ADSL modems

Post by pbix »

An inexperienced person should be using the active congestion controller in this case. The ACC will automatically detect changes in your link speed.

On the QoS download page enter the speed the corresponds to the highest night time speed (but no more than 6 times the lowest speed you expect) and then enable the ACC at the bottom of the page. On the QoS upload page enter your lowest daytime upload speed.

Report your results.

Please use the QoS section for discussions on QoS.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Jerry_Offsping
Posts: 4
Joined: Fri Apr 20, 2012 1:24 pm

Re: Automatic QOS speed setting for ADSL modems

Post by Jerry_Offsping »

It seems to work, but I have one problem. I'm running a client program of certain service that make a requests every 10 seconds and I want to minimize the ping for it. It has a small bandwidth impact, it must receive very small packet ~200 bytes every 10 seconds. I created a special service class for it in both DL and UL QOS sections with 1% BW and Min RTT flag on. The problem is that the ping is still not perfect. While idle when nothing is downloading the ping is ~500 ms, but when I launch torrent for example the ping grows up to 1500-2000ms.

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Automatic QOS speed setting for ADSL modems

Post by pbix »

Your setup seems appropriate for what you want to do but a 500ms ping on an idle link sure seems long to me. Is this a satellite link? Is this pings to anything or just the ping times to the "certain service"?

What is the ping limit that was automatically calculated? Please post the status section under the ACC while the long pings are occurring so I can see what is happening.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Jerry_Offsping
Posts: 4
Joined: Fri Apr 20, 2012 1:24 pm

Re: Automatic QOS speed setting for ADSL modems

Post by Jerry_Offsping »

Well 500ms is a maximum, usually it is around 200-500 and I think it is normal because server of the "certain service" is pretty far from my location. All other pings seem to be normal.
Now I created a heavy load on my channel by downloading some file in download manager and the service died completely, ping >3000ms. Here is the status:

Code: Select all

State: IDLE
Link limit: 1094 (kbps)
Fair Link limit: 1094 (kbps)
Link load: 287 (kbps)
Ping: off
Filtered ping: 13 (ms)
Ping time limit: 153 (ms)
Classes Active: 1
Total DL bandwidth is set to 1216 (maximum nighttime speed), and UL is 288 as you recommended.

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Automatic QOS speed setting for ADSL modems

Post by pbix »

In your last post you indicated a large download was underway at the time you collected the ACC output you posted. But the data shows that the link load is only 287kbps. This does not bode well since it means even if the load is only 287kbps your ping is out of control. Normal pings for most people on an unload link are well under 100ms. Not sure how well the ACC will work in this situation since I have not had the chance to test such a case, but we can try and see what we can do.

I would start by lowering your download limit from 1200kbps to 850kbps. Then at least the ACC will become active and start to control your normal pings to less than 153ms. We need it to get into one of the active states before it will do anything.

Now as I said 287kbps is evidently too much since your pings get so high at this download rate. The ACC will clamp the speed even further in its attempt to maintain your ping. So something below 200kbps may result. Watch the "Fair Link Limit" to see what the ACC is determining is needed to maintain your ping.

What type of service is this for future reference?
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Jerry_Offsping
Posts: 4
Joined: Fri Apr 20, 2012 1:24 pm

Re: Automatic QOS speed setting for ADSL modems

Post by Jerry_Offsping »

I lowered limit to 850 kbps and ACC became active. At first the ping was very high ~5000ms, but then ACC gradually lowered the link limit and ping normalized to ~1000ms. Here is the status after a minute of constant load on channel:

Code: Select all

State: ACTIVE
Link limit: 174 (kbps)
Fair Link limit: 180 (kbps)
Link load: 177 (kbps)
Ping: 322 (ms)
Filtered ping: 140 (ms)
Ping time limit: 154 (ms)
Classes Active: 2
I think ACC gives not much attention to my service's class. Active classes are "normal" and "fast", I thought that ACC will enter MINRTT mode to provide a better ping to my class with minrtt flag. I think that is happening because my service's requests are too sparse and too small.

Now I have set a min and max bandwidth of my service to 5 kbps (in UL and DL QoS sections) and the total bandwidth to 256. The ping is ~500ms now while running a download manager, I think it is acceptable.
The problem is that if I set total BW to 850 it takes too long for ACC to normalize the speed (and I experience packet loss in process) and I'm afraid that in this setting the nighttime speed will be limited by 850kbps.

It is a cardsharing client that requests keys from some server every 10 seconds to decode a signal from satellite.

pbix
Developer
Posts: 1373
Joined: Fri Aug 21, 2009 5:09 pm

Re: Automatic QOS speed setting for ADSL modems

Post by pbix »

Well now its basically working. Pings are controlled and as I predicted your link limit is seriously clamped.

A class is consider "Active" when its kbps load exceeds 4kbps. This is not adjustable and if your RTT class does not get to this load you will never see the MINRTT state.

But I cannot see it mattering much in this case. The difference between the two modes is the target RTT. In the case of MinRTT this is classically around 75ms but is adjustable and in the case of ACTIVE mode its is around 150ms (not adjustable). There is no way your link can give less than 150ms it appears to me so there is not much reason to use MinRTT mode.

You might be able to increase your download limit to 900kbps but basically you are stuck given that it seems 177kbps is required to maintain the ping at 150ms.

Please study my QoS section in the Wiki. After you read and understand that if you can think of any modification that can improve the situation you can start a new thread.

Please also study the operation of the current design for a little while. I think your concern about the time it takes to move off of 850kbps is probably unfounded. I do not think that you will be on 850kbps except for the first few seconds after initialization. It would be interesting to see the situation at night since higher data rates are promised. I would have to see to believe.

I am interested in satellite links but previously had no chance to test anything on such a link.

In the future please open QoS threads in the forum's QoS section.
Linksys WRT1900ACv2
Netgear WNDR3700v2
TP Link 1043ND v3
TP-Link TL-WDR3600 v1
Buffalo WZR-HP-G300NH2
WRT54G-TM

Post Reply