Hi belliash,
belliash wrote:Hello,
I have been using custom-written script and using HTB to limit incoming and outgoing transfers from/to various IP addesses. i was allowed to assign multiple IP addresses to single class, thus limiting all of them, as in HTB limit was laid on class, not on IP.
Actually I have 100/50mbps and I use both IPv4 and IPv6. However, my ISP does not provide IPv6 addressing, so I'm using SIXXS service. The problem is that when I limit traffic to 100mbps, then I can exhaust only about 65mbps and I cannot use whole of my bandwidth.
Most likely you are running against your router's cpu limits, htb is quite costly and many home routers run out of "steam" around 60 to 70 Mbps; so this might be your primary issue. For testing set the shaping rates such that the sum of ingress and egress does not exceed 60 Mbps (then the shaper at least has a dance of working as expected, albeit slow)
belliash wrote:I heard about qos-scripts and sqm-scripts. Both seem to use Codel instead of HTB.
Codel or fq_codel is not a replacement for a shaper like HTB, but rather a replacement for either pfifo_fast or sfq as leaf qdisc. sqm-scripts uses HTB as shaper and fq_codel as leaf qdiscs by default, qos-scripts uses HFSC as shaper and fq_codel as leaf qdisc; both have similar CPU demands, and both work well within their limits.
belliash wrote:Can you tell me which one should I choose and how to configure it to achieve the following goals:
*) limiting both IPv4 and IPv6 (2 different interfaces)
qos-scripts does not handle IPv6 traffic well at all; sqm-scripts does work for IPv4 as well as IPv6. qos-scripts can only be activated on a single interface, sqm-scripts can be established on multiple interfaces concurrently.
Note that it can get tricky to teach a shaper to shape the cumulative traffic on two unrelated interfaces, but often one can establish the shaper on the physical interface the links to the modem, which in effect will balanced the traffic for all meta-interfaces traveling over that physical interface.
belliash wrote:*) limiting both incoming and outgoing transfers (2 different interfaces)
Both qos-scripts and sqm-scripts do this quite well with the help of IFB devices.
belliash wrote:*) setup 2 classes per user (for download and upload) and assign both IPv4 and IPv6 addresses to it, so that user cannot exhaust more than specified bandwidth simultaneusly for both IPv4 and IPv6
Neither qos-scripts nor sqm-scripts are setup to do this, you will need to code your own scripts to that; but please go ahead and test both qos- and sqm-scripts first as many people report that both work quite well for a number of scenarios where before more elaborate scripts seemed required. In other words only elaborate if you have no other choice
belliash wrote:*) do not limit transfers within LAN (at least for IPv4)
Both qos- and sqm-scripts have you covered here, unless you set up the shaper on the router's lan interface instead of the wan interface.
belliash wrote:*) assign a default class for all not specified IPs when bandtwidth would be limited to 64kbps.
This looks like requiring manila coding again.
belliash wrote:Do you have any examples of such working configuration?
Thanks!
I would humbly recommend to test whether qos- or sqm-scripts do not already work well enough, and if not sqm-scripts allows to easily create your own scripts and hook them into the LUCI Gui, you could even use /usr/lib/sqm/sinple.qos as your starting point
Best Regards
M.