Error occured when configuring QoS limiter

Hi I am on

The WAN interface has IPv4 and IPv6 connectivity. I configured a limiter policy on a WAN interface, tried committing and I get this error.

Policy

+ qos {
+     interface eth1 {
+         ingress "20MB_DOWNLOAD_LIMIT"
+     }
+     policy {
+         limiter 20MB_DOWNLOAD_LIMIT {
+             class 1 {
+                 bandwidth "20mbit"
+                 burst "1mb"
+                 match ALL_TRAFFIC {
+                     ip
+                 }
+             }
+             default {
+                 bandwidth "20mbit"
+                 burst "1mb"
+             }
+             description "20Mbps download limit"
+         }
+     }
+ }
[ qos ]
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
VyOS had an issue completing a command.

We are sorry that you encountered a problem while using VyOS.
There are a few things you can do to help us (and yourself):
- Contact us using the online help desk if you have a subscription:
  https://support.vyos.io/
- Make sure you are running the latest version of VyOS available at:
  https://vyos.net/get/
- Consult the community forum to see how to handle this issue:
  https://forum.vyos.io
- Join us on Slack where our users exchange help and advice:
  https://vyos.slack.com

When reporting problems, please include as much information as possible:
- do not obfuscate any data (feel free to contact us privately if your
  business policy requires it)
- and include all the information presented below

Report time:      2023-10-10 16:20:05
Image version:    VyOS 1.5-rolling-202310090023
Release train:    current

Built by:         autobuild@vyos.net
Built on:         Mon 09 Oct 2023 01:50 UTC
Build UUID:       d785f5d2-bfb9-4d23-a47e-0fadcf055853
Build commit ID:  168a86e1dba06d

Architecture:     x86_64
Boot via:         installed image
System type:      bare metal

Hardware vendor:  CWWK
Hardware model:   CW-ADLN-6L
Hardware S/N:     Default string
Hardware UUID:    03000200-0400-0500-0006-000700080009

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/qos.py", line 240, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/qos.py", line 231, in apply
    tmp.update(shaper_config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/limiter.py", line 27, in update
    super().update(config, direction)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 299, in update
    self._cmd(filter_cmd)
  File "/usr/lib/python3/dist-packages/vyos/qos/base.py", line 74, in _cmd
    return cmd(command)
           ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/process.py", line 155, in cmd
    raise OSError(code, feedback)
FileNotFoundError: [Errno 2] failed to run command: tc filter add dev eth1 parent ffff: prio 20 protocol all u32 flowid ffff:1
returned:
exit code: 2

noteworthy:
cmd 'tc filter add dev eth1 parent ffff: prio 20 protocol all u32 flowid ffff:1'
returned (out):

returned (err):
Error: cls_u32: Selector not specified.
We have an error talking to the kernel

[[qos]] failed
Commit failed
[edit]

I guess this is happening because there is no policy for ipv6 or maybe I didn’t specify destination for IPv4. It commits without any errors with this policy.

+ qos {
+     interface eth1 {
+         ingress "20MB_DOWNLOAD_LIMIT"
+     }
+     policy {
+         limiter 20MB_DOWNLOAD_LIMIT {
+             class 1 {
+                 bandwidth "20mbit"
+                 burst "1mb"
+                 match ALL_TRAFFIC {
+                     ip {
+                         destination {
+                             address "0.0.0.0/0"
+                         }
+                     }
+                 }
+                 match ALL_TRAFFIC_V6 {
+                     ipv6 {
+                         destination {
+                             address "2000::/3"
+                         }
+                     }
+                 }
+             }
+             default {
+                 bandwidth "20mbit"
+                 burst "1mb"
+             }
+             description "20Mbps download limit"
+         }
+     }
+ }

But I can still reach download speeds over 20mbps so there is still a issue some where.

The documentation on this page helped. Traffic Policy — VyOS 1.4.x (sagitta) documentation

Full config looks like,

qos {
    interface eth1 {
        egress "20MB_DOWNLOAD_RATE_CONTROL"
    }
    interface ifb0 {
        egress "20MB_DL_LIMIT"
    }
    policy {
        rate-control 20MB_DOWNLOAD_RATE_CONTROL {
            bandwidth "20mbit"
            burst "15k"
        }
        shaper 20MB_DL_LIMIT {
            bandwidth "20mbit"
            default {
                bandwidth "20mbit"
                burst "15k"
            }
        }
    }
}

But when I load/commit config, I get this in the terminal.

vyos@router# load;commit;save;
Loading configuration from 'config.boot'
Load complete. Use 'commit' to make changes effective.
[ qos ]
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.
Error: Cannot delete qdisc with handle of zero.
Error: Cannot find specified qdisc on specified device.

What is it you want to achieve?

Just limit downloads to 20Mbps?

As the manual states you normally do that by apply a shaper on the opposite direction.

That is if you want to limit ingress bandwidth on WAN what you normally should do is to apply a shaper for egress bandwidth on LAN.

The shaper have better options to priotize which traffic should remain (to be sent to LAN aka what the host on LAN is downloading) incl to let ACK’s remain to not get bad performance of TCP flows.

Where a limiter/rate-control just dont give a ■■■■ and will throw away any packet over a certain threshold.

There are also other options you can experiment with such as “rate-control”:

vyos@vyos# set qos policy 
Possible completions:
   cake                 Common Applications Kept Enhanced (CAKE)
   drop-tail            Packet limited First In, First Out queue
   fair-queue           Stochastic Fairness Queueing
   fq-codel             Fair Queuing (FQ) with Controlled Delay (CoDel)
   limiter              Traffic input limiting policy
   network-emulator     Network emulator policy
   priority-queue       Priority queuing based policy
   random-detect        Weighted Random Early Detect policy
   rate-control         Rate limiting policy (Token Bucket Filter)
   round-robin          Deficit Round Robin Scheduler
   shaper               Traffic shaping based policy (Hierarchy Token Bucket)
   shaper-hfsc          Hierarchical Fair Service Curve's policy

You can also test to specify the queue-type you wish to use:

vyos@vyos# set qos policy shaper TEST default queue-type 
Possible completions:
   drop-tail            First-In-First-Out (FIFO)
   fair-queue           Stochastic Fair Queue (SFQ)
   fq-codel             Fair Queue Codel (default)
   priority             Priority queuing
   random-detect        Random Early Detection (RED)

Also note that when it comes to bandwidth limiting its rarely a fixed point such as 20Mbps specially if the physical link is 100Mbps or 1Gbps.

It will allow for a burst (normally recommended to be 10% of the bandwidth you want to shape to) which gives that the 20Mbps limit is what it can achieve after lets say 3 seconds or so of downloads while a 1 second download very well will be able to get higher download than that.

If you would plot it in a graph it would look like a huge S-curve who get smaller and smaller over time to close in to the limit such as 20Mbps (like a pendelum).

What is the output of these commands without any QoS configured and right after your failed commit (open another console/ssh towards the VyOS and run the commands)?

tc class show
tc qdisc show