Need help with qos/sqm-qos

Set the Download and Upload speeds to 80-95%

i guess i could do that but then i will have less upload speeds than what i currently have, also i think your are missing the point here. im just trying to find out a way to prioritize ftp over torrents, i found this https://forum.openwrt.org/viewtopic.php?id=68265 but cant fully understand it, i think i have to prioritize it manually or something to do with iptables, but honestly i dont really know, im asking for your helps guys, now i have done it with ddwrt/pie but now i cant go back to ddwrt which is fine because i really like lede. question? does sqm qos know what to prioritized when it comes to torrents and ftps requests?

So on egress, with proper per-packet-overhead accounting* you can get close to 100% of link rate (that said DOCSIS is notoriously lumpy so you might not be able to reach 100%, so it is recommended to start with with say 80% and iteratively increase the bandwidth until you reach a trade-off point between latency under load increase and bandwidth sacrifice you are happy with). For ingress you really should give the shaper some room between the artificial bottleneck rate and the true bottleneck rate, other wise you will have to deal with the fact that in-rushing packet "floods" will easily "back-spill" into the CMTS's over-sized and under-managed buffers making your ingress shaper incapabale of keeping bufferbloat in check.

BTW, is the torrent client running on a different computer than the ftp? If yes than cakes dual-isolation modes, configured correctly might actually help a bit.

*) see https://lede-project.org/docs/howto/sqm#sqmlink_layer_adaptation_tab:
> "Ethernet with Overhead: SQM can also account for the overhead imposed by VDSL links - add 8 bytes of overhead. Cable Modems (DOCSIS) are known to typically use 28 bytes of overhead in the upstream direction but only 14 bytes in the downstream direction. If your version of SQM only supports to specify one value for the overhead, select 28 Bytes
 UPDATE: while the reported numbers are not wrong per se, it turned out that the user traffic shaper mandated? by DOCSIS systems only account for L2 ethernet frames including the frame check sequence (FCS), so the 2017 recommendations for cable users is to set both up- and downstream overhead to 18 bytes (6 bytes source MAC, 6 bytes destination MAC, 2 bytes ether-type, 4 bytes FCS).

None: Fiber, and direct Ethernet connections generally do not need any kind of link layer adaptation.
The “Advanced Link Layer” choices are relevant if you are sending packets larger than 1500 bytes. This would be unusual for most home setups, since ISPs generally limit traffic to 1500 byte packets. UPDATE 2017, most recent link technologies will transfer complete L2 ethernet frames including the FCS; that in turn means that they will effectively all inherit the ethernet minimal packet size of 64 bytes. It is hence recommended to set tcMPU to 64. Note that most (but not all) ATM based links will exclude the FCS and hence probably do not require that setting. As of March 2017 sqm-scripts does not evaluate tcMPU if cake is selected as “link layer adaptation mechanism”.
Unless you are experimenting, you should use the default choice for the link layer adaptation mechanism. This will select cake if cake is used as qdisc other wise tc_stab."

hello @moeller0 while i really appreciate your answer i have to tell you i understood little about it, right now im confuse, frustrated, etc. right now i would like somebody to provide me with an answer to " does sqm qos know what/when to prioritized when it comes to torrents and ftps requests?" so that i dont have to spend another 30 to 1 hours doing a research, also i will appreciate if you tell what settings need to be change in order to accomplish what im trying to do. i will do a little more experiment with sqm, im gonna lower the upload rate, see if that make a different. thank you im advance

If you set upload/download speed as suggested and choose the right interface for your wan interface (ip4/ip6?) it should work (or not ;- ) . If not, deinstall luci-app-sqm & sqm-scripts and install luci-app-qos & qos-scripts and setup a dd-wrt like qos. If that also doesn't work out you are doomed ;- )

question? do i need to uninstall sqm and qos respectively or can i just disable it ? is no, well i already did my test and same issue, it does not make a difference torrents do not get slow down, i wish there was an option on sqm to prioritized ips, macs, services and ports. note: tried with 25000 for upload.

torrent client is running on same computer.

i have and it does not make a difference, torrents keep eating all the upload bandwidth
well yes and no, i think gaming and latency is good but ftp'ing a movie no because again torrents is using all the bandwidth and it does not slow down to give ftp a change therefore uploads for ftp are terrible

Okay, this is not going to work well with sqm-scripts out of the box. The one thing cake can offer is to try to distribute the available bandwidth fairly between (internal) host IP-addresses, but if your two critical services live on the same machine than this will not work for you, sorry.
The problem is that by default cake offers per-flow fairness (so all flows are treated equally, and an application will get a share of the available bandwidth that is proportional to its fraction of active flows), and since your torrent client will handle more open connections/transferring flows concurrently than your ftp client (it was ftp, right?) torrent flows will get on aggregate more bandwidth than the fewer other flows.
For most users it seems acceptable to dedicate a machine to torrenting (or ftp for that matter) that is not used for other critical services (like interactive use or data serving), and in that case cake's per-IP-address isolation modes help a lot. But again this is not the setup you seem to use.
For your requirements going for port specific traffic rules seems appropriate, but since I never had that requirement, I never even attempted to implement something like that and hence can offer no explicit advice. (In your shoes, I would probably either try to isolate the torrent host from the ftp host, so that the dual-isolation options might have a chance to work. Or I would try to figure out how to DSCP label the torrent packets*)

*) Unfortunately there seems to be the misunderstanding in the torrent scene that ”TP/LEDBAT is sufficient to make torrents share a link nicely with other data flows, but these rely on the fact that with traditional over-sized and under-managed buffers the RTT increases proportionally to the congestion level, so they try to respond to increasing deay with scaling back their bandwidth. This works reasonably well unless on uses an AQM like cake or HTB+fq_codel that will avoid to have the queueing delay "explode" under saturating loads...

The answer to that is no, sqm does not offer this capability. This level of detailed traffic rules is pretty much what sqm started out to avoid having to fiddle with (think of it as the AQM for the rest of us). That said, since sqm-scripts is in the end a machinery to execute different shell-setup scripts you can of course edit the existing scripts to add solutions to your specific problems, but you are pretty much on your own with that.

1 Like

@moeller0 wou wou, well i can not afford to have different pcs for torrents and ftp server beside my pc is a beast can handle this can of set up, and it is unfortunate that you can not help me, i will tried to take few key words you mention in your reply and work with that to do a little of more research, hopefully will have the knowledge of manually adjusting the peace of cake scrip to be able to prioritize what i need.

guys can you take a look at this reply i got on reddit https://www.reddit.com/r/openwrt/comments/68yslm/need_help_with_qossqmqos/ .thank you

As I said; [quote="Doppel-D, post:25, topic:3424"]
deinstall luci-app-sqm & sqm-scripts and install luci-app-qos & qos-scripts
[/quote]

I should be possible to solve your problem with an appropriate setup

i did and still does not work

what do you mean, can you fix it for me ?

One t is missing; It should be possible :- ) So, you are doomed......

In my case I had torrent and download/upload traffic coming from different internal IPs, which from what I understand is a key. Everything was on a single computer that has two network cards and seven different IPs so SQM seems to be able to do its job properly. If all traffic is coming from the same IP, then as I understand SQM cannot handle that properly.
Just to verify that again, I started torrents, pings, and a download test and my download test immediately got a half of the bandwidth. Once it stops, all bandwitdh goes back to torrents. Again, one computer but the traffic routed through different IPs.

The instructions in the LEDE documentation wiki will tell you how to properly set-up per-internal-host-IP fairness, but it seems this is not what you are after, so I doubt that this will help you very much (unless you manage to get a different IP address for your FTP server...)

sqm-scripts and qos-scripts (and their respective luci apps) can be installed at the same time. You should simply not enable both at the same time (there is no automatic disabling of the other implemented in either of the two, so you need to manually coordinate). That said, most likely you will also be able to run both at the same time as long as you instantiate both on different interfaces...

update: well my friends after trying ddwrt, discovered that the latest beta version for my 3200ACM did not have the pie qos discipline which is strange because latest beta for my asus RT-AC68U does have it, anyways ddwrt devs (dev, brainslayer) i believe is not planning on implementing cake anytime soon (i could be wrong but there is no way of asking him/her), then i thought why not give it a try to oem firmware, wifi seen to working fine (need to test it more) but of course its their router so it better works, then i set up their qos feature called "Media Prioritization" gave port 21 and 80, i discover that it does work way better that ddwrt and lede, sort of, it has some flaws, for example, it only has high and normal priority, and there is no way for me to put port 4999 on normal priority being that said, during my test, i send a request over ftp/21, and all bandwidth is given to that port for a moment then upload speed start decreasing, so at this point for right now im going to stick to oem firmware until i get a answer from this guy https://forum.openwrt.org/profile.php?id=154301, he seen to know how to prioritized ports within sqm qos, among other things, also i had some unreliable wifi performance with latest lede beta and i have a family who relies on wifi, etc, now don’t get me wrong i really like and appreciate free open source projects such as lede, but right now im going to stick to oem firmware, also im thinking on building my own 86/64 router and throw https://www.pfsense.org/ on it and have it manage my network and hopefully, will be able to accomplish what im looking for, anyways guys i look forwards to yours thoughts and comments, thank you have a wonderful day.