Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Assistant
The error "Error: Parent Qdisc doesn't exists. We have an error talking to the kernel" typically occurs when attempting to configure traffic control (tc) or network shaping tools like wondershaper, and the required Qdisc (Queueing Discipline) is missing or unsupported in the kernel. Here’s a breakdown of causes and solutions:
User
how limit inter net speed in linux
Assistant
To limit internet speed in Linux, use these methods:
1. Using tc (Traffic Control)
The tc command manipulates kernel traffic control settings.
Basic bandwidth limiting with TBF (Token Bucket Filter):
when ru wondersharper i get Error: Specified qdisc kind is unknown.
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
Error: Failed to find specified qdisc.
Error: Failed to find specified qdisc.
Error: Failed to find specified qdisc.
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Error: Parent Qdisc doesn't exists.
We have an error talking to the kernel
Assistant
The error "Error: Specified qdisc kind is unknown" and "Parent Qdisc doesn't exists" when using wondershaper occurs because newer Linux kernels (≥6.3) removed the CBQ scheduler, which the tool relies on[1][6][9]. Here’s how to resolve it:
Root Cause
CBQ Removal: The CBQ scheduler was deprecated and removed in Linux 6.3-rc1 (March 2023)[1][6].
User
Warning: sch_htb: quantum of class 10001 is big. Consider r2q change.
Assistant
The warning "sch_htb: quantum of class 10001 is big. Consider r2q change" occurs when the calculated quantum for an HTB class is too large, typically due to a low r2q value. Here’s how to resolve it:
Root Cause
Quantum Calculation: The quantum is computed as rate / r2q. The default r2q=10 may produce a quantum larger than optimal for low-rate classes[6][8][11].
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Missing Kernel Modules
The required Qdisc modules (e.g., sch_cbq, sch_sfq, sch_ingress) may not be loaded. For example, newer Linux kernels (≥6.3) removed the CBQ scheduler[6], causing tools like wondershaper to fail[4][6].
Kernel Configuration Issues
The kernel may lack support for specific Qdiscs due to incorrect configuration during compilation. For instance, VyOS users encountered this error when using tc actions without the necessary modules[10].
Outdated or Incompatible Tools
Tools like wondershaper rely on deprecated Qdiscs (e.g., CBQ), which are no longer available in modern kernels[6]. This leads to errors when attempting to apply traffic shaping rules[4][6].
Solutions
Verify Loaded Modules
Check if required modules are loaded:
bash
lsmod | grep sch_
If modules like sch_cbq or sch_sfq are missing, recompile the kernel with these modules enabled[4][10].
Switch to Supported Qdiscs
Replace deprecated Qdiscs (e.g., CBQ) with alternatives like HTB (Hierarchical Token Bucket) or FQ (Fair Queueing). For example:
bash
tc qdisc add dev eth0 root handle 1: htb
Update or Modify Tools
For tools like wondershaper, consider patching the script to use supported Qdiscs or switch to alternatives like tc directly[4][6].
Check Kernel Version Compatibility
Ensure your kernel supports the Qdiscs required by your tools. For example, CBQ was removed in Linux 6.3-rc1[6], so avoid using it on newer kernels.
Example Workflow
If using wondershaper and encountering the error:
Check kernel modules:
bash
lsmod | grep sch_
If sch_cbq is missing, recompile the kernel with it enabled.
Modify wondershaper script:
Replace CBQ references with HTB in the script or use tc commands directly:
bash
tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 20000kbit
This error highlights the importance of kernel configuration and tool compatibility. Always verify module availability and use supported Qdiscs for your kernel version.
Replace eth0 with your interface name. Adjust rate (e.g., 500kbit for 500 kbps) and burst (buffer size)[1][9].
Advanced shaping with HTB (Hierarchical Token Bucket):
bash
sudo tc qdisc add dev eth0 root handle 1: htb
sudo tc class add dev eth0 parent 1: classid 1:1 htb rate 20000kbit
This creates a parent HTB qdisc for finer-grained control[8][11].
2. Using wondershaper
A simplified script for system-wide limits:
bash
sudo wondershaper -a eth0 -d 2048 -u 512
-a eth0: Interface name
-d 2048: Download limit (kbps)
-u 512: Upload limit (kbps)[3][5].
Clear limits:
bash
sudo wondershaper -c -a eth0
3. Using trickle for Application-Specific Limits
Limit bandwidth per application without root:
bash
trickle -d 6144 -u 1024 firefox
-d 6144: Download limit (KB/s)
-u 1024: Upload limit (KB/s)[5][7].
Persistent limits for all apps:
bash
trickled -d 6144 -u 1024 -s
Troubleshooting
If you encounter "Parent Qdisc doesn't exist", check for missing kernel modules (e.g., sch_cbq, sch_htb):
bash
lsmod | grep sch_
Recompile the kernel with required modules if missing[4][6].
Key Tools Comparison
Tool
Scope
Requires Root
Use Case
tc
System-wide
Yes
Advanced shaping, QoS
wondershaper
System-wide
Yes
Simple interface-wide limits
trickle
Per-application
No
Application-specific throttling
For modern kernels, prefer HTB or CAKE over deprecated qdiscs like CBQ[6][8].
Outdated Tools: wondershaper versions ≤1.1a still use CBQ, leading to compatibility issues[1][6][9].
Solutions
1. Switch to HTB (Hierarchical Token Bucket)
Replace CBQ with HTB, a modern alternative supported in all recent kernels. Example tc commands:
bash
sudo tc qdisc add dev eth0 root handle 1: htb
sudo tc class add dev eth0 parent 1: classid 1:1 htb rate 20000kbit
sudo tc filter add dev eth0 parent 1: protocol ip handle 1 fw flowid 1:1
This creates a parent HTB qdisc for traffic shaping[8][11].
2. Update wondershaper
Patch the Script: Modify wondershaper to use HTB instead of CBQ. For example, replace cbq with htb in the script[6][9].
Use a Forked Version: The latest wondershaper (v1.4.1) supports HTB. Install it via GitHub or update your package manager[6].
3. Verify Kernel Modules
Ensure HTB modules are loaded:
bash
lsmod | grep sch_htb
If missing, load them:
bash
sudo modprobe sch_htb
Workaround for wondershaper
If updating the tool isn’t feasible, use tc directly:
bash
sudo tc qdisc add dev eth0 root handle 1: htb
sudo tc class add dev eth0 parent 1: classid 1:1 htb rate 20000kbit
sudo tc filter add dev eth0 parent 1: protocol ip handle 1 fw flowid 1:1
Key Takeaways
Avoid CBQ: Use HTB or FQ (Fair Queueing) for modern kernels[6][8].
Check Kernel Compatibility: Ensure your kernel supports the qdisc you’re using[1][6].
Alternative Tools: Consider trickle for per-application limits or tc for granular control[5][7].
For persistent issues, recompile the kernel with HTB support or use a distro with updated wondershaper packages[6][9].
Kernel Warning: If the quantum exceeds the kernel’s threshold (e.g., >1000 bytes), it triggers a warning to adjust r2q[11][13].
Solutions
1. Adjust r2q in HTB Configuration
Increase the r2q value when creating the HTB qdisc to reduce the quantum size. For example:
bash
tc qdisc add dev eth0 root handle 1: htb r2q 100
This sets r2q=100, making the quantum smaller (e.g., rate=100kbps → quantum=1000 bytes)[6][8][12].
2. Manually Set Quantum
Override the default quantum calculation by specifying it explicitly:
bash
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps quantum 1500
This bypasses r2q for that class[6][8].
3. Verify MTU Compatibility
Ensure the quantum is ≥ MTU (typically 1500 bytes). If r2q is too low, the quantum may fall below this threshold, causing warnings[6][11].