Per-Subscriber QoS with CAKE
The gold standard in broadband traffic shaping — applied per subscriber, with accurate overhead compensation.
Why CAKE?
CAKE (Common Applications Kept Enhanced) is a modern queuing discipline built specifically for broadband. Compared to traditional tc-based shaping (HTB + fq_codel), CAKE provides:
- Per-flow fairness — A single subscriber's torrent can't starve their VoIP or video
- Accurate overhead compensation — Correctly accounts for PPPoE, VLAN, and Ethernet framing at the bottleneck link
- Active Queue Management — Keeps latency low even at full line rate (bufferbloat elimination)
- Diffserv awareness — Automatically prioritises voice (EF), video (AF41), and interactive traffic
- Simplicity — One qdisc does the job of HTB + fq_codel + police + classify
No other BNG ships with CAKE-based QoS out of the box.
How It Works
AthenaBNG's abng-qos daemon manages per-subscriber QoS:
Egress (Download)
CAKE qdisc applied directly to the subscriber's PPP or VLAN interface:
subscriber traffic → CAKE qdisc → subscriber interface → wire
Ingress (Upload)
CAKE applied via an IFB (Intermediate Functional Block) device:
wire → subscriber interface → redirect to IFB → CAKE qdisc → forwarding
One IFB device is created per subscriber interface, named ifb-{interface}.
Overhead Compensation
CAKE's killer feature for ISPs is accurate link-layer overhead compensation. AthenaBNG automatically calculates the correct overhead based on the subscriber's encapsulation:
| Encapsulation | Overhead | MPU |
|---|---|---|
| PPPoE over Ethernet | 34 bytes | 64 |
| IPoE over Ethernet | 22 bytes | 64 |
| PPPoE + 1 VLAN tag | 38 bytes | 64 |
| IPoE + QinQ (2 tags) | 30 bytes | 64 |
This means when you shape a subscriber to 50 Mbps, they actually get 50 Mbps of usable throughput — not 50 Mbps minus overhead.
RADIUS-Driven Rates
Subscriber rates come from RADIUS:
Athena-Rate-Down = 50000000 # 50 Mbps download
Athena-Rate-Up = 20000000 # 20 Mbps upload
Mid-Session Rate Changes (CoA)
When RADIUS sends a Change of Authorization with new rates, abng-qos updates the CAKE qdisc in place — no packet loss, no session interruption:
tc qdisc change dev ppp0 root cake bandwidth 100mbit ...
The subscriber's speed changes in milliseconds.
Configuration
qos:
enabled: true
default_down: "50mbit"
default_up: "20mbit"
cake_options:
rtt: "20ms"
ack_filter: true
split_gst: true
diffserv4: true
nat: true
Real-World Impact
With CAKE QoS, your subscribers experience:
- Lower latency — Bufferbloat eliminated, gaming and VoIP work great even under load
- Fair sharing — One device's download doesn't ruin the experience for others on the same connection
- Accurate speeds — What you sell is what they get, regardless of encapsulation overhead
- Priority traffic — Voice and video automatically get preferential treatment