[Cerowrt-devel] The next slice of cake

Jonathan Morton chromatix99 at gmail.com
Tue Mar 17 17:33:31 EDT 2015

> On 17 Mar, 2015, at 22:34, Carlos R. Pasqualini <pasqualinic at fcal.uner.edu.ar> wrote:
> would you mind to point me to a repository or download area and some
> docs about how to get it working and test it's performance?
> in a (too)fast (and lazy) search at google can't find anything
> Here, i have only 3 DSL links with 3Mbps bandwidth each, for aprox. 300
> student's computers.

That certainly sounds like a situation where cake could help.

Dave Täht made patches a few months ago, based on linux-net-next, which are available here:


Those include *two* versions of cake, one of which is configured to use a different version of the Codel algorithm than the other.  The intent at the time was to compare those two versions against each other, but they also happen to have the most up-to-date version of cake.  It really has been a while since I’ve been able to work on it.

You’ll need to build the kernel with “sch_cake” or “sch_cake2” turned on.  If you copy over your existing kernel config and run “make oldconfig”, you should get asked about them (as well as other things).

You’ll also need a patched version of the iproute2 utilities to configure cake.  Patches here:


Then it’s as simple as running:

# tc qdisc replace dev ethX root cake besteffort bandwidth yyyyKbps atm

That will take care of your outbound traffic, if you replace “ethX” and “yyyy” with whatever is appropriate (and “cake2” if you built that version).  If you have control of both ends of the link, then you can do the same thing to handle inbound traffic.

If you only have control of one end of the link, you’ll need to use ingress shaping to handle inbound traffic.  This is a little bit more complicated to set up (via an Intermediate Functional Block device) than the usual egress shaping, and has a couple of disadvantages, but it does work and does help:

# ifconfig ifb0 up
# tc qdisc replace dev ethX handle ffff: ingress
# tc filter add dev ethX parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0
# tc qdisc replace dev ifb0 root cake besteffort bandwidth zzzzKbps atm

Both yyyy and zzzz should be slightly below your actual link rates, to ensure that cake controls the bottleneck queue.  The “atm” flag is there to take account of ATM framing, which ADSL uses.  You can experiment with the precise rates without disrupting existing traffic flows:

# tc -s qdisc

(the above is to look up the correct handle figures to use below)

# tc qdisc change dev xxxx handle N:M cake bandwidth ...

Have fun!

 - Jonathan Morton

More information about the Cerowrt-devel mailing list