Cake is a comprehensive queue management system, implemented as a queue discipline (qdisc) for the Linux kernel. It is designed to replace and improve upon the complex hierarchy of simple qdiscs presently required to effectively tackle the bufferbloat problem at the network edge.
Bufferbloat is the undesirable latency that comes from a router or other network equipment buffering too much data. It is a huge drag on Internet performance created, ironically, by previous attempts to make it work better. The one-sentence summary is “Bloated buffers lead to network-crippling latency spikes.”
Alright, sounds good! But, how do we use cake on the Turris Omnia?
How to install SQM QoS with cake:
opkg update && opkg install sqm-scripts luci-app-sqm kmod-sched-cake
If you do not want to use luci, remove luci-app-sqm from the command above. For configuring SQM QoS manually see below.
Configure using luci (web interface):
Now in the webinterface, under the network tab, a new item, SQM QoS should be there. If not log out, delete browser cache and log in. You could also change browser.
- How to configure SQM QoS to use cake:
Lots of knobs and input fields here but configuring SQM QoS to use cake is actually a piece of cake. SQM QoS has three tabs: Basic Settings, Queue Discipline and Link Layer Adaptation. We need all three of them in order to correctly setup cake.
- Basic Settings settings:
- Tick Enable this SQM instance
- Select eth1 under Interface name
- Set Download speed and Upload speed to 85-95% of your rated line speed. (Note that the speed is in kbit/s, eg. a 150/15 Mbit/s = 150000/15000 kbit/s.)
- Queue Discipline settings:
- Select cake under Queuing disciplines usable on this system. (If there is no cake () among the available options either reboot or run the following command in terminal using ssh: “/usr/lib/sqm/update-available-qdiscs”.)
- Select piece_of_cake.qos under Queue setup script.
- check the box named:
“Show and Use Advanced Configuration. Advanced options will only be used as long as this box is checked.”
- Then check the box named:
“Show and Use Dangerous Configuration. Dangerous options will only be used as long as this box is checked.”
- Now enter the following (without the quotes) into the “Advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully.” field:
- and to to the “Advanced option string to pass to the egress queueing disciplines; no error checking, use very carefully.
” field “nat dual-srchost”
- Link Layer Adaptation settings:
- If you have a cable connection you don’t need to do anything here. However, if you have ADSL you will need to select ATM. If you have VDSL you will need to select Ethernet.
- If you have an ADSL or VDSL line you will need to specify a Per Packet Overhead value. For ADSL, use 44. For VDSL, use 8. (Note, overhead can vary! If you want to measure it you can use this project)
###Configure using an editor:
- Point your editor of choice to /etc/config/sqm
- Edit the file to make it look like this:
config queue 'eth1’
option enabled ‘1’ (0 = disabled; 1 = enabled)
option interface ‘eth1’ (WAN interface, should be eth1)
option download '85-95% of your download speed in kbit/s’
option upload '85-95% of your upload speed in kbit/s’
option debug_logging ‘0’ (disable = 0; enable = 1 debugging)
option verbosity ‘5’ (Verbosity of SQM’s output into the system log. 5 = info)
option qdisc ‘cake’ (since we want cake, this should be cake)
option script ‘piece_of_cake.qos’ (self explanatory)
option qdisc_advanced ‘1’ (disable = 0; enable =1 advanced qdisc configuration)
option squash_dscp ‘1’ (0 = disable; 1 = enable squash DSCP on inbound (ingress) packets)
option squash_ingress ‘1’ (0 = regard; 1 = ignore DSCP on ingress)
option ingress_ecn ‘ECN’ (ECN or NOECN, explicit congestion notification status on inbound packets (ingress))
option egress_ecn ‘NOECN’ (ECN or NOECN, explicit congestion notification status on outbound packets (regress))
option qdisc_really_really_advanced ‘1’ (disable = 0; enable =1 really advanced qdisc configuration)
option iqdisc_opts ‘nat dual-dsthost’ (advanced option string to pass to the ingress queueing disciplines; no error checking, use very carefully. Setting nat dual-dsthost makes cake nat aware. Only set this when the set interface is eth1)
option eqdisc_opts ‘nat dual-srchost’ (advanced option string to pass to the regress queueing disciplines; no error checking, use very carefully. Setting nat dual-srchost makes cake nat aware.Only set this when the set interface is eth1)
option linklayer ‘atm’ (“none” (cable), “ethernet” (vdsl), or “atm” (adsl).
option overhead ‘0/8/44’ (per packet overhead in bytes)
Example sqm conf file:
config queue 'eth1’
option enabled '1’
option interface 'eth0.2’
option download '9000’
option upload '900’
option debug_logging '0’
option verbosity '5’
option qdisc 'cake’
option script 'piece_of_cake.qos’
option qdisc_advanced '1’
option squash_dscp '1’
option squash_dscp '1’
option squash_ingress '1’
option ingress_ecn 'ECN’
option egress_ecn 'NOECN’
option qdisc_really_really_advanced '1’
option iqdisc_opts 'nat dual-dsthost’
option eqdisc_opts 'nat dual-srchost’
option linklayer 'atm’
option overhead ‘44’