# info > CAKE

---
type: CommandReference
command: cake
mode: man
section: 8
source: man-pages
---

## Quick Reference
- `tc qdisc add dev eth0 root cake bandwidth 1gbit` — Shaping to 1 Gbit/s with defaults
- `tc qdisc add dev eth0 root cake bandwidth 100mbit ethernet` — Shaping with Ethernet overhead compensation
- `tc qdisc add dev eth0 root cake bandwidth 20mbit pppoe-vcmux` — ADSL PPPoE VCMux overhead
- `tc qdisc add dev eth0 root cake bandwidth 50mbit diffserv4` — Shaping with 4‑tin DiffServ
- `tc qdisc add dev eth0 root cake bandwidth 10mbit nat dual-srchost` — Fairness for a LAN behind NAT (egress)
- `tc qdisc add dev eth0 root cake bandwidth 0 autorate-ingress` — Auto‑rate on variable‑capacity links (e.g., cellular)
- `tc qdisc add dev eth0 root cake bandwidth 100mbit rtt 20ms` — Custom round‑trip time 20 ms
- `tc -s qdisc show dev eth0` — Show statistics and per‑tin counters

## Name
CAKE — Common Applications Kept Enhanced, a shaping‑capable queue discipline with AQM and FQ.

## Synopsis
shell
tc qdisc ... cake
 [ bandwidth RATE | unlimited* | autorate-ingress ]
 [ rtt TIME | datacentre | lan | metro | regional | internet* | oceanic | satellite | interplanetary ]
 [ besteffort | diffserv8 | diffserv4 | diffserv3* ]
 [ flowblind | srchost | dsthost | hosts | flows | dual-srchost | dual-dsthost | triple-isolate* ]
 [ nat | nonat* ]
 [ wash | nowash* ]
 [ split-gso* | no-split-gso ]
 [ ack-filter | ack-filter-aggressive | no-ack-filter* ]
 [ memlimit LIMIT ]
 [ fwmark MASK ]
 [ ptm | atm | noatm* ]
 [ overhead N | conservative | raw* ]
 [ mpu N ]
 [ ingress | egress* ]
(`*` marks defaults)

## Options

### Shaper Parameters
- `bandwidth RATE` — Set shaper throughput limit (e.g., `100Mbit`). Use `unlimited` (default) to disable, or `autorate-ingress` for automatic estimation on variable links.

### Round Trip Time Parameters
- `rtt TIME` — Explicit RTT assumption for AQM tuning (e.g., `20ms`).
- Presets: `datacentre` (100 μs), `lan` (1 ms), `metro` (10 ms), `regional` (30 ms), `internet` (100 ms, default), `oceanic` (300 ms), `satellite` (1 s), `interplanetary` (1 h, disables AQM).

### Overhead Compensation
- `overhead N` — Add `N` bytes to each packet (range -64 to 256).
- `mpu N` — Round each packet up to at least `N` bytes (0–256).
- `atm` — Compensate for ATM 53‑byte cell framing (48‑byte payload).
- `ptm` — Compensate for PTM 64b/65b encoding (VDSL2).
- `noatm` — Disable ATM/PTM compensation (default).

Shortcut presets:
- `raw` (default) — No overhead compensation.
- `conservative` — Same as `overhead 48 atm`.

Common ADSL/ATM presets (implicitly set `atm`):
- `pppoa‑vcmux` (`overhead 10 atm`), `pppoa‑llc` (`14`), `pppoe‑vcmux` (`32`), `pppoe‑llcsnap` (`40`), `bridged‑vcmux` (`24`), `bridged‑llcsnap` (`32`), `ipoa‑vcmux` (`8`), `ipoa‑llcsnap` (`16`).

Common VDSL2/PTM presets (implicitly set `ptm`):
- `pppoe‑ptm` (`overhead 30 ptm`), `bridged‑ptm` (`overhead 22 ptm`).

DOCSIS preset:
- `docsis` (`overhead 18 mpu 64 noatm`).

Ethernet presets:
- `ethernet` (`overhead 38 mpu 84 noatm`).
- `ether‑vlan` — Like `ethernet` but adds 4 bytes per VLAN tag.

### Flow Isolation
- `flowblind` — Single queue per tin (no isolation).
- `srchost` — Isolate by source IP only.
- `dsthost` — Isolate by destination IP only.
- `hosts` — Isolate by source‑destination IP pairs.
- `flows` — Isolate by full 5‑tuple.
- `dual‑srchost` — Fairness first over source IP, then per‑flow. Ideal for LAN egress.
- `dual‑dsthost` — Fairness first over destination IP, then per‑flow. Ideal for LAN ingress.
- `triple‑isolate` (default) — Fairness over source **and** destination IPs and per‑flow. Works for both directions.
- `nat` — Perform NAT lookup for fairness (affects hosts mode and dual‑* modes).
- `nonat` (default) — No NAT lookup.

### Priority Queue (DiffServ)
- `besteffort` — Single tin, no prioritisation.
- `diffserv3` (default) — Three tins: Bulk (CS1, LE), Best Effort, Voice (CS7/6, EF, VA, TOS4).
- `diffserv4` — Four tins: Bulk, Best Effort, Video (AF4x, AF3x, CS3, AF2x, CS2, TOS4, TOS1), Voice.
- `diffserv8` — Eight‑tin mode.
- `precedence` — Legacy TOS precedence (not recommended).
- `fwmark MASK` — Override tin selection by masking the firewall mark; the masked value selects the tin number.

### Miscellaneous
- `wash` — Clear all DiffServ marks except ECN after classification. `nowash` (default) keeps marks.
- `split‑gso` (default) — Split GSO super‑packets for lower latency. `no‑split‑gso` keeps them intact.
- `ack‑filter` / `ack‑filter‑aggressive` — Filter redundant ACKs. `no‑ack‑filter` (default) disables.
- `memlimit LIMIT` — Maximum memory for packet queues in bytes (default computed from bandwidth and RTT).
- `ingress` — Apply to ingress traffic (default `egress`).

## Examples
Basic shaping with Ethernet overhead:
shell
# tc qdisc add dev eth0 root cake bandwidth 100mbit ethernet diffserv3
# tc -s qdisc show dev eth0
---
qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple‑isolate rtt 100.0ms noatm overhead 38 mpu 84
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
…
 memory used: 0b of 5000000b
 capacity estimate: 100Mbit
…
                          Bulk  Best Effort        Voice
         thresh       6250Kbit      100Mbit       25Mbit
(Output truncated; full statistics show per‑tin packet counts, delays, and flows.)

## See Also
- [`tc(8)`](http://localhost/phpMan.php/man/tc/8/markdown)
- [`tc-codel(8)`](http://localhost/phpMan.php/man/tc-codel/8/markdown)
- [`tc-fq_codel(8)`](http://localhost/phpMan.php/man/tc-fqcodel/8/markdown)
- [`tc-htb(8)`](http://localhost/phpMan.php/man/tc-htb/8/markdown)