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 06:46] – [PPSK with Bandwidth Limits] system | technical:ppsk-sqm [2024/08/08 10:11] (current) – system | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ----- | ----- | ||
| ====== PPSK with Bandwidth Limits ====== | ====== PPSK with Bandwidth Limits ====== | ||
| - | * All the pages on PPSK up to now did not touch much on one very important topic. | + | * On all previous |
| - | * Once we give a user access to our network, we need a way to **manage the bandwidth** he consumes. | + | * Once we grant a user access to our network, we need a way to manage the bandwidth |
| - | * Both captive portal | + | * Both the Captive Portal |
| - | * Giving someone access to a WiFi network does not automatically | + | * Giving someone access to a WiFi network does not automatically |
| - | * Although we offer advanced features to change a user's assigned VLAN based on their usage during a specified timespan, we still need the ability to limit the speed on a VLAN. | + | * Although we offer advanced features to change a user's assigned VLAN based on their usage during a certain period of time, we still need the ability to limit the speed of a VLAN. |
| - | * This is where Smart Queue Management (SQM) comes in. | + | * This is where Smart Queue Management (SQM) comes into play. |
| - | * SQM not only allow us to limit the bandwidth on an interface to the value we choose, | + | * With SQM, we can not only limit the bandwidth on an interface to the value we choose, |
| ====== Options for a MDU deployment ====== | ====== Options for a MDU deployment ====== | ||
| - | * The philosophy of RADIUSdesk is to provide | + | * The philosophy of RADIUSdesk is to offer a non-disruptive solution that can co-operate with other vendors. |
| - | * The following | + | * The following |
| {{: | {{: | ||
| - | * We also offer the client | + | * We also offer the customer |
| - | * This can then be managed | + | * This can then be managed |
| - | * Since OpenWrt can run on various | + | * As OpenWrt can run on different |
| + | * Lets take a closer look at SQM on OpenWrt | ||
| + | |||
| + | ====== SQM on OpenWrt ====== | ||
| + | The following sections are a brief summary of information from this wiki page (https:// | ||
| + | ===== Required Packages ===== | ||
| + | * To make SQM available in OpenWrt, you need the package **sqm-scripts**. | ||
| + | * If you also have Luci on the OpenWrt device, it is recommended to install the additional package **luci-app-sqm**. | ||
| + | * This will install the Luci SQM package which is well developed and provides you with an intuitive way to apply SQM to selected interfaces via the Luci web interface. | ||
| + | ===== Config File ===== | ||
| + | * Essentially, | ||
| + | * Let's take a look at an excerpt from the sqm configuration file: | ||
| + | |||
| + | <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 ===== | ||
| + | * 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. | ||
| + | |||
| + | |||
| + | |||
| | | ||