Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:ppsk-sqm [2024/08/08 08:02] – system | technical:ppsk-sqm [2024/08/08 10:11] (current) – system | ||
---|---|---|---|
Line 24: | Line 24: | ||
====== SQM on OpenWrt ====== | ====== SQM on OpenWrt ====== | ||
- | The following sections are a short summary of information from this Wiki page (https:// | + | The following sections are a brief summary of information from this wiki page (https:// |
===== Required Packages ===== | ===== Required Packages ===== | ||
- | * For SQM to be available in OpenWrt, you need the **sqm-scripts** | + | * To make SQM available in OpenWrt, you need the package |
- | * If you also have Luci on the OpenWrt device, it is recommended to install the additional **luci-app-sqm** | + | * If you also have Luci on the OpenWrt device, it is recommended to install the additional |
- | * This will install the Luci SQM package which is well developed and offer you an intuitive way to apply SQM on selected interfaces | + | * This will install the Luci SQM package which is well developed and provides |
===== Config File ===== | ===== Config File ===== | ||
- | * Essentially the SQM application in Luci manipulates the **/ | + | * Essentially, the SQM application in Luci manipulates the UCI-based configuration file **/ |
- | * Lets look at a snippet of the sqm config | + | * Let's take a look at an excerpt from the sqm configuration |
+ | <code bash> | ||
+ | config queue ' | ||
+ | option interface ' | ||
+ | option enabled ' | ||
+ | option script ' | ||
+ | option linklayer ' | ||
+ | option verbosity ' | ||
+ | option upload ' | ||
+ | option download ' | ||
+ | option debug_logging ' | ||
+ | option qdisc ' | ||
+ | </ | ||
+ | |||
+ | * Some notes on this snippet: | ||
+ | * The queue discipline is CAKE. There are also other options like fq_codel that you can use if performance is an issue. | ||
+ | * The upload and download values are in kbps, so this snippet limits the value to 4Mbps (4*1024) | ||
+ | * The script to set up the SQM (based on the settings in the / | ||
+ | * The SQM section is applied to the **br-ex_v104** interface, which is actually a bridge. | ||
+ | * Let us take a look at the / | ||
+ | |||
+ | < | ||
+ | config device | ||
+ | option type ' | ||
+ | option name ' | ||
+ | option stp ' | ||
+ | list ports ' | ||
+ | | ||
+ | config interface ' | ||
+ | option device ' | ||
+ | option proto ' | ||
+ | option ipaddr ' | ||
+ | option netmask ' | ||
+ | </ | ||
+ | * Although the word // | ||
+ | * In our case, the br-ex_104 bridge has one port, eth1.104. This port receives traffic from VLAN 104 on eth1 (e.g. when a user connects to a private PSK and the dynamic VLAN assigned to it is 104) | ||
+ | * The data traffic that runs via this bridge is therefore throttled and managed with SQM. | ||
+ | |||
+ | Now that we have covered the configuration of SQM, we can take a look at some practical commands under the heading | ||
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
+ | * To start and stop SQM: | ||
+ | < | ||
+ | #You might first need to stop it before starting it: | ||
+ | / | ||
+ | SQM: Stopping SQM on br-ex_v104 | ||
+ | |||
+ | #Start it | ||
+ | / | ||
+ | SQM: Starting SQM script: piece_of_cake.qos on br-ex_v104, in: 4096 Kbps, out: 4096 Kbps | ||
+ | SQM: piece_of_cake.qos was started on br-ex_v104 successfully | ||
+ | </ | ||
+ | |||
+ | * SQM creates a matching IFB interface with the convention // | ||
+ | |||
+ | <code bash> | ||
+ | #Real interface | ||
+ | ifconfig br-ex_v104 | ||
+ | br-ex_v104 Link encap: | ||
+ | inet addr: | ||
+ | inet6 addr: fe80:: | ||
+ | UP BROADCAST RUNNING MULTICAST | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:0 (0.0 B) TX bytes:1088 (1.0 KiB) | ||
+ | #Matching IFB | ||
+ | ifconfig ifb4br-ex_v104 | ||
+ | ifb4br-ex_v104 Link encap: | ||
+ | inet6 addr: fe80:: | ||
+ | UP BROADCAST RUNNING NOARP MTU: | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B | ||
+ | </ | ||
+ | * To get stats on SQM, you can use the tc command: | ||
+ | <code bash> | ||
+ | tc -s qdisc show dev br-ex_v104 | ||
+ | </ | ||
+ | |||
+ | * This brings us to the end of SQM's section in OpenWrt. | ||
+ | * In RADIUSdesk we have taken this knowledge and created the SQM Profiles applet, which makes managing SQM in MESHdesk and APdesk a breeze. | ||
+ | * There is a special page for SQM Profiles that allows you to apply limits in no time at all. | ||