SQM - layer_cake or piece_of_cake. What's the real difference?

I use SQM on my home router. I know that cake supports layer_cake and piece_of_cake scripts. My question is what are the practical differences between those two? I've seen that most people here is using piece_of_cake with cake instead of layer_cake. Why is that? Is the performance that huge between those two? I tried to test this but I didn't see any real difference.

I thought that layer_cake is better because it's recognizes different categories of traffic instead putting everything in one category like piece_of_cake is doing. Can someone help me out understand this, maybe with some basic examples in which case use one of those algorithms is better then the other?

Best Regards.

1 Like

I found this link helpful: https://burntchrome.blogspot.ca/2016/12/cake-latest-in-sqm-qos-schedulers.html

I already saw this by I'm worried that this test might have provided invalid results since there is a hardware limitation. I wonder if the results would be different if a more powerful unit was used. This test is providing some look into performance difference between layer_cake and piece_of_cake but it doesn't answers the question which one of them is better in various use cases and what are the practical differences between them.

I haven't noticed a difference either, so i just use layer_cake for the reasons you mentioned.

1 Like

So layer_cake will sort packets into three different priority tins based on the DSCP markings. If you do not use DSCP markings in your network or your testing application you will not notice (except priority sorting is more expensive than not doing it, so piece_of_cake will cause less CPU load, with a reasonably fast router that will not matter much). Now, some applications, especially VoIP and some WebRTC ones actually use markings that will make layer_cake (well "cake diffserv3") treat their latency critical packets with priority and help VoIP to work on a loaded line.
Please note that ISPs often manipulate the DSCPs (as they are allowed to, DSCPs are not guaranteed to be stable end to end), so on ingress the sender would need to use a DSCP marking that cake interprets correctly and the ISP would have to leave the DSCP bits alone. Marking incoming packets localy before feeding them into cake is possible but quite fiddly and not user friendly. Hope that helps...


Thank you. This is really helpful.
I will stick to layer_cake.

Orange Pi R1 results with Apr.27 snapshot:
SQM pppoe-wan 14000/10800 pieceofcake 8 bytes VDSL
13.19/7.28Mbps d/u

A+/B/C Bufferbloat/Quality/Speed
11/16/13 msec idle/dl/ul avg
13/18/15 msec idle/dl/ul max
5% CPU max htop
opir1 hung today, after setup, and previously. still unstable