Blame man/man8/tc-cake.8

Packit Service 3880ab
.TH CAKE 8 "19 July 2018" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
CAKE \- Common Applications Kept Enhanced (CAKE)
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.B tc qdisc ... cake
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR bandwidth
Packit Service 3880ab
RATE |
Packit Service 3880ab
.BR unlimited*
Packit Service 3880ab
|
Packit Service 3880ab
.BR autorate-ingress
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR rtt
Packit Service 3880ab
TIME |
Packit Service 3880ab
.BR datacentre
Packit Service 3880ab
|
Packit Service 3880ab
.BR lan
Packit Service 3880ab
|
Packit Service 3880ab
.BR metro
Packit Service 3880ab
|
Packit Service 3880ab
.BR regional
Packit Service 3880ab
|
Packit Service 3880ab
.BR internet*
Packit Service 3880ab
|
Packit Service 3880ab
.BR oceanic
Packit Service 3880ab
|
Packit Service 3880ab
.BR satellite
Packit Service 3880ab
|
Packit Service 3880ab
.BR interplanetary
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR besteffort
Packit Service 3880ab
|
Packit Service 3880ab
.BR diffserv8
Packit Service 3880ab
|
Packit Service 3880ab
.BR diffserv4
Packit Service 3880ab
|
Packit Service 3880ab
.BR diffserv3*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR flowblind
Packit Service 3880ab
|
Packit Service 3880ab
.BR srchost
Packit Service 3880ab
|
Packit Service 3880ab
.BR dsthost
Packit Service 3880ab
|
Packit Service 3880ab
.BR hosts
Packit Service 3880ab
|
Packit Service 3880ab
.BR flows
Packit Service 3880ab
|
Packit Service 3880ab
.BR dual-srchost
Packit Service 3880ab
|
Packit Service 3880ab
.BR dual-dsthost
Packit Service 3880ab
|
Packit Service 3880ab
.BR triple-isolate*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR nat
Packit Service 3880ab
|
Packit Service 3880ab
.BR nonat*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR wash
Packit Service 3880ab
|
Packit Service 3880ab
.BR nowash*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR split-gso*
Packit Service 3880ab
|
Packit Service 3880ab
.BR no-split-gso
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR ack-filter
Packit Service 3880ab
|
Packit Service 3880ab
.BR ack-filter-aggressive
Packit Service 3880ab
|
Packit Service 3880ab
.BR no-ack-filter*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR memlimit
Packit Service 3880ab
LIMIT ]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR fwmark
Packit Service 3880ab
MASK ]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR ptm
Packit Service 3880ab
|
Packit Service 3880ab
.BR atm
Packit Service 3880ab
|
Packit Service 3880ab
.BR noatm*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR overhead
Packit Service 3880ab
N |
Packit Service 3880ab
.BR conservative
Packit Service 3880ab
|
Packit Service 3880ab
.BR raw*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR mpu
Packit Service 3880ab
N ]
Packit Service 3880ab
.br
Packit Service 3880ab
[
Packit Service 3880ab
.BR ingress
Packit Service 3880ab
|
Packit Service 3880ab
.BR egress*
Packit Service 3880ab
]
Packit Service 3880ab
.br
Packit Service 3880ab
(* marks defaults)
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
CAKE (Common Applications Kept Enhanced) is a shaping-capable queue discipline
Packit Service 3880ab
which uses both AQM and FQ.  It combines COBALT, which is an AQM algorithm
Packit Service 3880ab
combining Codel and BLUE, a shaper which operates in deficit mode, and a variant
Packit Service 3880ab
of DRR++ for flow isolation.  8-way set-associative hashing is used to virtually
Packit Service 3880ab
eliminate hash collisions.  Priority queuing is available through a simplified
Packit Service 3880ab
diffserv implementation.  Overhead compensation for various encapsulation
Packit Service 3880ab
schemes is tightly integrated.
Packit Service 3880ab
Packit Service 3880ab
All settings are optional; the default settings are chosen to be sensible in
Packit Service 3880ab
most common deployments.  Most people will only need to set the
Packit Service 3880ab
.B bandwidth
Packit Service 3880ab
parameter to get useful results, but reading the
Packit Service 3880ab
.B Overhead Compensation
Packit Service 3880ab
and
Packit Service 3880ab
.B Round Trip Time
Packit Service 3880ab
sections is strongly encouraged.
Packit Service 3880ab
Packit Service 3880ab
.SH SHAPER PARAMETERS
Packit Service 3880ab
CAKE uses a deficit-mode shaper, which does not exhibit the initial burst
Packit Service 3880ab
typical of token-bucket shapers.  It will automatically burst precisely as much
Packit Service 3880ab
as required to maintain the configured throughput.  As such, it is very
Packit Service 3880ab
straightforward to configure.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B unlimited
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	No limit on the bandwidth.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B bandwidth
Packit Service 3880ab
RATE
Packit Service 3880ab
.br
Packit Service 3880ab
	Set the shaper bandwidth.  See
Packit Service 3880ab
.BR tc(8)
Packit Service 3880ab
or examples below for details of the RATE value.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B autorate-ingress
Packit Service 3880ab
.br
Packit Service 3880ab
	Automatic capacity estimation based on traffic arriving at this qdisc.
Packit Service 3880ab
This is most likely to be useful with cellular links, which tend to change
Packit Service 3880ab
quality randomly.  A
Packit Service 3880ab
.B bandwidth
Packit Service 3880ab
parameter can be used in conjunction to specify an initial estimate.  The shaper
Packit Service 3880ab
will periodically be set to a bandwidth slightly below the estimated rate.  This
Packit Service 3880ab
estimator cannot estimate the bandwidth of links downstream of itself.
Packit Service 3880ab
Packit Service 3880ab
.SH OVERHEAD COMPENSATION PARAMETERS
Packit Service 3880ab
The size of each packet on the wire may differ from that seen by Linux.  The
Packit Service 3880ab
following parameters allow CAKE to compensate for this difference by internally
Packit Service 3880ab
considering each packet to be bigger than Linux informs it.  To assist users who
Packit Service 3880ab
are not expert network engineers, keywords have been provided to represent a
Packit Service 3880ab
number of common link technologies.
Packit Service 3880ab
Packit Service 3880ab
.SS	Manual Overhead Specification
Packit Service 3880ab
.B overhead
Packit Service 3880ab
BYTES
Packit Service 3880ab
.br
Packit Service 3880ab
	Adds BYTES to the size of each packet.  BYTES may be negative; values
Packit Service 3880ab
between -64 and 256 (inclusive) are accepted.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B mpu
Packit Service 3880ab
BYTES
Packit Service 3880ab
.br
Packit Service 3880ab
	Rounds each packet (including overhead) up to a minimum length
Packit Service 3880ab
BYTES. BYTES may not be negative; values between 0 and 256 (inclusive)
Packit Service 3880ab
are accepted.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B atm
Packit Service 3880ab
.br
Packit Service 3880ab
	Compensates for ATM cell framing, which is normally found on ADSL links.
Packit Service 3880ab
This is performed after the
Packit Service 3880ab
.B overhead
Packit Service 3880ab
parameter above.  ATM uses fixed 53-byte cells, each of which can carry 48 bytes
Packit Service 3880ab
payload.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B ptm
Packit Service 3880ab
.br
Packit Service 3880ab
	Compensates for PTM encoding, which is normally found on VDSL2 links and
Packit Service 3880ab
uses a 64b/65b encoding scheme. It is even more efficient to simply
Packit Service 3880ab
derate the specified shaper bandwidth by a factor of 64/65 or 0.984. See
Packit Service 3880ab
ITU G.992.3 Annex N and IEEE 802.3 Section 61.3 for details.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B noatm
Packit Service 3880ab
.br
Packit Service 3880ab
	Disables ATM and PTM compensation.
Packit Service 3880ab
Packit Service 3880ab
.SS	Failsafe Overhead Keywords
Packit Service 3880ab
These two keywords are provided for quick-and-dirty setup.  Use them if you
Packit Service 3880ab
can't be bothered to read the rest of this section.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B raw
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	Turns off all overhead compensation in CAKE.  The packet size reported
Packit Service 3880ab
by Linux will be used directly.
Packit Service 3880ab
.PP
Packit Service 3880ab
	Other overhead keywords may be added after "raw".  The effect of this is
Packit Service 3880ab
to make the overhead compensation operate relative to the reported packet size,
Packit Service 3880ab
not the underlying IP packet size.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B conservative
Packit Service 3880ab
.br
Packit Service 3880ab
	Compensates for more overhead than is likely to occur on any
Packit Service 3880ab
widely-deployed link technology.
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 48 atm.
Packit Service 3880ab
Packit Service 3880ab
.SS ADSL Overhead Keywords
Packit Service 3880ab
Most ADSL modems have a way to check which framing scheme is in use.  Often this
Packit Service 3880ab
is also specified in the settings document provided by the ISP.  The keywords in
Packit Service 3880ab
this section are intended to correspond with these sources of information.  All
Packit Service 3880ab
of them implicitly set the
Packit Service 3880ab
.B atm
Packit Service 3880ab
flag.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B pppoa-vcmux
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 10 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B pppoa-llc
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 14 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B pppoe-vcmux
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 32 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B pppoe-llcsnap
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 40 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B bridged-vcmux
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 24 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B bridged-llcsnap
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 32 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B ipoa-vcmux
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 8 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B ipoa-llcsnap
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 16 atm
Packit Service 3880ab
.PP
Packit Service 3880ab
See also the Ethernet Correction Factors section below.
Packit Service 3880ab
Packit Service 3880ab
.SS VDSL2 Overhead Keywords
Packit Service 3880ab
ATM was dropped from VDSL2 in favour of PTM, which is a much more
Packit Service 3880ab
straightforward framing scheme.  Some ISPs retained PPPoE for compatibility with
Packit Service 3880ab
their existing back-end systems.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B pppoe-ptm
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 30 ptm
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
	PPPoE: 2B PPP + 6B PPPoE +
Packit Service 3880ab
.br
Packit Service 3880ab
	ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence +
Packit Service 3880ab
.br
Packit Service 3880ab
	PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS)
Packit Service 3880ab
.br
Packit Service 3880ab
.PP
Packit Service 3880ab
.B bridged-ptm
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 22 ptm
Packit Service 3880ab
.br
Packit Service 3880ab
	ETHERNET: 6B dest MAC + 6B src MAC + 2B ethertype + 4B Frame Check Sequence +
Packit Service 3880ab
.br
Packit Service 3880ab
	PTM: 1B Start of Frame (S) + 1B End of Frame (Ck) + 2B TC-CRC (PTM-FCS)
Packit Service 3880ab
.br
Packit Service 3880ab
.PP
Packit Service 3880ab
See also the Ethernet Correction Factors section below.
Packit Service 3880ab
Packit Service 3880ab
.SS DOCSIS Cable Overhead Keyword
Packit Service 3880ab
DOCSIS is the universal standard for providing Internet service over cable-TV
Packit Service 3880ab
infrastructure.
Packit Service 3880ab
Packit Service 3880ab
In this case, the actual on-wire overhead is less important than the packet size
Packit Service 3880ab
the head-end equipment uses for shaping and metering.  This is specified to be
Packit Service 3880ab
an Ethernet frame including the CRC (aka FCS).
Packit Service 3880ab
.PP
Packit Service 3880ab
.B docsis
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 18 mpu 64 noatm
Packit Service 3880ab
Packit Service 3880ab
.SS Ethernet Overhead Keywords
Packit Service 3880ab
.PP
Packit Service 3880ab
.B ethernet
Packit Service 3880ab
.br
Packit Service 3880ab
	Accounts for Ethernet's preamble, inter-frame gap, and Frame Check
Packit Service 3880ab
Sequence.  Use this keyword when the bottleneck being shaped for is an
Packit Service 3880ab
actual Ethernet cable.
Packit Service 3880ab
.br
Packit Service 3880ab
	Equivalent to
Packit Service 3880ab
.B overhead 38 mpu 84 noatm
Packit Service 3880ab
.PP
Packit Service 3880ab
.B ether-vlan
Packit Service 3880ab
.br
Packit Service 3880ab
	Adds 4 bytes to the overhead compensation, accounting for an IEEE 802.1Q
Packit Service 3880ab
VLAN header appended to the Ethernet frame header.  NB: Some ISPs use one or
Packit Service 3880ab
even two of these within PPPoE; this keyword may be repeated as necessary to
Packit Service 3880ab
express this.
Packit Service 3880ab
Packit Service 3880ab
.SH ROUND TRIP TIME PARAMETERS
Packit Service 3880ab
Active Queue Management (AQM) consists of embedding congestion signals in the
Packit Service 3880ab
packet flow, which receivers use to instruct senders to slow down when the queue
Packit Service 3880ab
is persistently occupied.  CAKE uses ECN signalling when available, and packet
Packit Service 3880ab
drops otherwise, according to a combination of the Codel and BLUE AQM algorithms
Packit Service 3880ab
called COBALT.
Packit Service 3880ab
Packit Service 3880ab
Very short latencies require a very rapid AQM response to adequately control
Packit Service 3880ab
latency.  However, such a rapid response tends to impair throughput when the
Packit Service 3880ab
actual RTT is relatively long.  CAKE allows specifying the RTT it assumes for
Packit Service 3880ab
tuning various parameters.  Actual RTTs within an order of magnitude of this
Packit Service 3880ab
will generally work well for both throughput and latency management.
Packit Service 3880ab
Packit Service 3880ab
At the 'lan' setting and below, the time constants are similar in magnitude to
Packit Service 3880ab
the jitter in the Linux kernel itself, so congestion might be signalled
Packit Service 3880ab
prematurely. The flows will then become sparse and total throughput reduced,
Packit Service 3880ab
leaving little or no back-pressure for the fairness logic to work against. Use
Packit Service 3880ab
the "metro" setting for local lans unless you have a custom kernel.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B rtt
Packit Service 3880ab
TIME
Packit Service 3880ab
.br
Packit Service 3880ab
	Manually specify an RTT.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B datacentre
Packit Service 3880ab
.br
Packit Service 3880ab
	For extremely high-performance 10GigE+ networks only.  Equivalent to
Packit Service 3880ab
.B rtt 100us.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B lan
Packit Service 3880ab
.br
Packit Service 3880ab
	For pure Ethernet (not Wi-Fi) networks, at home or in the office.  Don't
Packit Service 3880ab
use this when shaping for an Internet access link.  Equivalent to
Packit Service 3880ab
.B rtt 1ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B metro
Packit Service 3880ab
.br
Packit Service 3880ab
	For traffic mostly within a single city.  Equivalent to
Packit Service 3880ab
.B rtt 10ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B regional
Packit Service 3880ab
.br
Packit Service 3880ab
	For traffic mostly within a European-sized country.  Equivalent to
Packit Service 3880ab
.B rtt 30ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B internet
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	This is suitable for most Internet traffic.  Equivalent to
Packit Service 3880ab
.B rtt 100ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B oceanic
Packit Service 3880ab
.br
Packit Service 3880ab
	For Internet traffic with generally above-average latency, such as that
Packit Service 3880ab
suffered by Australasian residents.  Equivalent to
Packit Service 3880ab
.B rtt 300ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B satellite
Packit Service 3880ab
.br
Packit Service 3880ab
	For traffic via geostationary satellites.  Equivalent to
Packit Service 3880ab
.B rtt 1000ms.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B interplanetary
Packit Service 3880ab
.br
Packit Service 3880ab
	So named because Jupiter is about 1 light-hour from Earth.  Use this to
Packit Service 3880ab
(almost) completely disable AQM actions.  Equivalent to
Packit Service 3880ab
.B rtt 3600s.
Packit Service 3880ab
Packit Service 3880ab
.SH FLOW ISOLATION PARAMETERS
Packit Service 3880ab
With flow isolation enabled, CAKE places packets from different flows into
Packit Service 3880ab
different queues, each of which carries its own AQM state.  Packets from each
Packit Service 3880ab
queue are then delivered fairly, according to a DRR++ algorithm which minimises
Packit Service 3880ab
latency for "sparse" flows.  CAKE uses a set-associative hashing algorithm to
Packit Service 3880ab
minimise flow collisions.
Packit Service 3880ab
Packit Service 3880ab
These keywords specify whether fairness based on source address, destination
Packit Service 3880ab
address, individual flows, or any combination of those is desired.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B flowblind
Packit Service 3880ab
.br
Packit Service 3880ab
	Disables flow isolation; all traffic passes through a single queue for
Packit Service 3880ab
each tin.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B srchost
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined only by source address.  Could be useful on the egress
Packit Service 3880ab
path of an ISP backhaul.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B dsthost
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined only by destination address.  Could be useful on the
Packit Service 3880ab
ingress path of an ISP backhaul.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B hosts
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined by source-destination host pairs.  This is host
Packit Service 3880ab
isolation, rather than flow isolation.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B flows
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined by the entire 5-tuple of source address, destination
Packit Service 3880ab
address, transport protocol, source port and destination port.  This is the type
Packit Service 3880ab
of flow isolation performed by SFQ and fq_codel.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B dual-srchost
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined by the 5-tuple, and fairness is applied first over
Packit Service 3880ab
source addresses, then over individual flows.  Good for use on egress traffic
Packit Service 3880ab
from a LAN to the internet, where it'll prevent any one LAN host from
Packit Service 3880ab
monopolising the uplink, regardless of the number of flows they use.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B dual-dsthost
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined by the 5-tuple, and fairness is applied first over
Packit Service 3880ab
destination addresses, then over individual flows.  Good for use on ingress
Packit Service 3880ab
traffic to a LAN from the internet, where it'll prevent any one LAN host from
Packit Service 3880ab
monopolising the downlink, regardless of the number of flows they use.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B triple-isolate
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	Flows are defined by the 5-tuple, and fairness is applied over source
Packit Service 3880ab
*and* destination addresses intelligently (ie. not merely by host-pairs), and
Packit Service 3880ab
also over individual flows.  Use this if you're not certain whether to use
Packit Service 3880ab
dual-srchost or dual-dsthost; it'll do both jobs at once, preventing any one
Packit Service 3880ab
host on *either* side of the link from monopolising it with a large number of
Packit Service 3880ab
flows.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B nat
Packit Service 3880ab
.br
Packit Service 3880ab
	Instructs Cake to perform a NAT lookup before applying flow-isolation
Packit Service 3880ab
rules, to determine the true addresses and port numbers of the packet, to
Packit Service 3880ab
improve fairness between hosts "inside" the NAT.  This has no practical effect
Packit Service 3880ab
in "flowblind" or "flows" modes, or if NAT is performed on a different host.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B nonat
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	Cake will not perform a NAT lookup.  Flow isolation will be performed
Packit Service 3880ab
using the addresses and port numbers directly visible to the interface Cake is
Packit Service 3880ab
attached to.
Packit Service 3880ab
Packit Service 3880ab
.SH PRIORITY QUEUE PARAMETERS
Packit Service 3880ab
CAKE can divide traffic into "tins" based on the Diffserv field.  Each tin has
Packit Service 3880ab
its own independent set of flow-isolation queues, and is serviced based on a WRR
Packit Service 3880ab
algorithm.  To avoid perverse Diffserv marking incentives, tin weights have a
Packit Service 3880ab
"priority sharing" value when bandwidth used by that tin is below a threshold,
Packit Service 3880ab
and a lower "bandwidth sharing" value when above.  Bandwidth is compared against
Packit Service 3880ab
the threshold using the same algorithm as the deficit-mode shaper.
Packit Service 3880ab
Packit Service 3880ab
Detailed customisation of tin parameters is not provided.  The following presets
Packit Service 3880ab
perform all necessary tuning, relative to the current shaper bandwidth and RTT
Packit Service 3880ab
settings.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B besteffort
Packit Service 3880ab
.br
Packit Service 3880ab
	Disables priority queuing by placing all traffic in one tin.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B precedence
Packit Service 3880ab
.br
Packit Service 3880ab
	Enables legacy interpretation of TOS "Precedence" field.  Use of this
Packit Service 3880ab
preset on the modern Internet is firmly discouraged.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B diffserv4
Packit Service 3880ab
.br
Packit Service 3880ab
	Provides a general-purpose Diffserv implementation with four tins:
Packit Service 3880ab
.br
Packit Service 3880ab
		Bulk (CS1), 6.25% threshold, generally low priority.
Packit Service 3880ab
.br
Packit Service 3880ab
		Best Effort (general), 100% threshold.
Packit Service 3880ab
.br
Packit Service 3880ab
		Video (AF4x, AF3x, CS3, AF2x, CS2, TOS4, TOS1), 50% threshold.
Packit Service 3880ab
.br
Packit Service 3880ab
		Voice (CS7, CS6, EF, VA, CS5, CS4), 25% threshold.
Packit Service 3880ab
.PP
Packit Service 3880ab
.B diffserv3
Packit Service 3880ab
(default)
Packit Service 3880ab
.br
Packit Service 3880ab
	Provides a simple, general-purpose Diffserv implementation with three tins:
Packit Service 3880ab
.br
Packit Service 3880ab
		Bulk (CS1), 6.25% threshold, generally low priority.
Packit Service 3880ab
.br
Packit Service 3880ab
		Best Effort (general), 100% threshold.
Packit Service 3880ab
.br
Packit Service 3880ab
		Voice (CS7, CS6, EF, VA, TOS4), 25% threshold, reduced Codel interval.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B fwmark
Packit Service 3880ab
MASK
Packit Service 3880ab
.br
Packit Service 3880ab
	This options turns on fwmark-based overriding of CAKE's tin selection.
Packit Service 3880ab
If set, the option specifies a bitmask that will be applied to the fwmark
Packit Service 3880ab
associated with each packet. If the result of this masking is non-zero, the
Packit Service 3880ab
result will be right-shifted by the number of least-significant unset bits in
Packit Service 3880ab
the mask value, and the result will be used as a the tin number for that packet.
Packit Service 3880ab
This can be used to set policies in a firewall script that will override CAKE's
Packit Service 3880ab
built-in tin selection.
Packit Service 3880ab
Packit Service 3880ab
.SH OTHER PARAMETERS
Packit Service 3880ab
.B memlimit
Packit Service 3880ab
LIMIT
Packit Service 3880ab
.br
Packit Service 3880ab
	Limit the memory consumed by Cake to LIMIT bytes. Note that this does
Packit Service 3880ab
not translate directly to queue size (so do not size this based on bandwidth
Packit Service 3880ab
delay product considerations, but rather on worst case acceptable memory
Packit Service 3880ab
consumption), as there is some overhead in the data structures containing the
Packit Service 3880ab
packets, especially for small packets.
Packit Service 3880ab
Packit Service 3880ab
	By default, the limit is calculated based on the bandwidth and RTT
Packit Service 3880ab
settings.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B wash
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
	Traffic entering your diffserv domain is frequently mis-marked in
Packit Service 3880ab
transit from the perspective of your network, and traffic exiting yours may be
Packit Service 3880ab
mis-marked from the perspective of the transiting provider.
Packit Service 3880ab
Packit Service 3880ab
Apply the wash option to clear all extra diffserv (but not ECN bits), after
Packit Service 3880ab
priority queuing has taken place.
Packit Service 3880ab
Packit Service 3880ab
If you are shaping inbound, and cannot trust the diffserv markings (as is the
Packit Service 3880ab
case for Comcast Cable, among others), it is best to use a single queue
Packit Service 3880ab
"besteffort" mode with wash.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B split-gso
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
	This option controls whether CAKE will split General Segmentation
Packit Service 3880ab
Offload (GSO) super-packets into their on-the-wire components and
Packit Service 3880ab
dequeue them individually.
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
Super-packets are created by the networking stack to improve efficiency.
Packit Service 3880ab
However, because they are larger they take longer to dequeue, which
Packit Service 3880ab
translates to higher latency for competing flows, especially at lower
Packit Service 3880ab
bandwidths. CAKE defaults to splitting GSO packets to achieve the lowest
Packit Service 3880ab
possible latency. At link speeds higher than 10 Gbps, setting the
Packit Service 3880ab
no-split-gso parameter can increase the maximum achievable throughput by
Packit Service 3880ab
retaining the full GSO packets.
Packit Service 3880ab
Packit Service 3880ab
.SH OVERRIDING CLASSIFICATION WITH TC FILTERS
Packit Service 3880ab
Packit Service 3880ab
CAKE supports overriding of its internal classification of packets through the
Packit Service 3880ab
tc filter mechanism. Packets can be assigned to different priority tins by
Packit Service 3880ab
setting the
Packit Service 3880ab
.B priority
Packit Service 3880ab
field on the skb, and the flow hashing can be overridden by setting the
Packit Service 3880ab
.B classid
Packit Service 3880ab
parameter.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B Tin override
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
        To assign a priority tin, the major number of the priority field needs
Packit Service 3880ab
to match the qdisc handle of the cake instance; if it does, the minor number
Packit Service 3880ab
will be interpreted as the tin index. For example, to classify all ICMP packets
Packit Service 3880ab
as 'bulk', the following filter can be used:
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
        # tc qdisc replace dev eth0 handle 1: root cake diffserv3
Packit Service 3880ab
        # tc filter add dev eth0 parent 1: protocol ip prio 1 \\
Packit Service 3880ab
          u32 match icmp type 0 0 action skbedit priority 1:1
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
.B Flow hash override
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
        To override flow hashing, the classid can be set. CAKE will interpret
Packit Service 3880ab
the major number of the classid as the host hash used in host isolation mode,
Packit Service 3880ab
and the minor number as the flow hash used for flow-based queueing. One or both
Packit Service 3880ab
of those can be set, and will be used if the relevant flow isolation parameter
Packit Service 3880ab
is set (i.e., the major number will be ignored if CAKE is not configured in
Packit Service 3880ab
hosts mode, and the minor number will be ignored if CAKE is not configured in
Packit Service 3880ab
flows mode).
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
This example will assign all ICMP packets to the first queue:
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
        # tc qdisc replace dev eth0 handle 1: root cake
Packit Service 3880ab
        # tc filter add dev eth0 parent 1: protocol ip prio 1 \\
Packit Service 3880ab
          u32 match icmp type 0 0 classid 0:1
Packit Service 3880ab
Packit Service 3880ab
.br
Packit Service 3880ab
If only one of the host and flow overrides is set, CAKE will compute the other
Packit Service 3880ab
hash from the packet as normal. Note, however, that the host isolation mode
Packit Service 3880ab
works by assigning a host ID to the flow queue; so if overriding both host and
Packit Service 3880ab
flow, the same flow cannot have more than one host assigned. In addition, it is
Packit Service 3880ab
not possible to assign different source and destination host IDs through the
Packit Service 3880ab
override mechanism; if a host ID is assigned, it will be used as both source and
Packit Service 3880ab
destination host.
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
# tc qdisc delete root dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc add root dev eth0 cake bandwidth 100Mbit ethernet
Packit Service 3880ab
.br
Packit Service 3880ab
# tc -s qdisc show dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84
Packit Service 3880ab
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
Packit Service 3880ab
 backlog 0b 0p requeues 0
Packit Service 3880ab
 memory used: 0b of 5000000b
Packit Service 3880ab
 capacity estimate: 100Mbit
Packit Service 3880ab
 min/max network layer size:        65535 /       0
Packit Service 3880ab
 min/max overhead-adjusted size:    65535 /       0
Packit Service 3880ab
 average network hdr offset:            0
Packit Service 3880ab
Packit Service 3880ab
                   Bulk  Best Effort        Voice
Packit Service 3880ab
  thresh       6250Kbit      100Mbit       25Mbit
Packit Service 3880ab
  target          5.0ms        5.0ms        5.0ms
Packit Service 3880ab
  interval      100.0ms      100.0ms      100.0ms
Packit Service 3880ab
  pk_delay          0us          0us          0us
Packit Service 3880ab
  av_delay          0us          0us          0us
Packit Service 3880ab
  sp_delay          0us          0us          0us
Packit Service 3880ab
  pkts                0            0            0
Packit Service 3880ab
  bytes               0            0            0
Packit Service 3880ab
  way_inds            0            0            0
Packit Service 3880ab
  way_miss            0            0            0
Packit Service 3880ab
  way_cols            0            0            0
Packit Service 3880ab
  drops               0            0            0
Packit Service 3880ab
  marks               0            0            0
Packit Service 3880ab
  ack_drop            0            0            0
Packit Service 3880ab
  sp_flows            0            0            0
Packit Service 3880ab
  bk_flows            0            0            0
Packit Service 3880ab
  un_flows            0            0            0
Packit Service 3880ab
  max_len             0            0            0
Packit Service 3880ab
  quantum           300         1514          762
Packit Service 3880ab
Packit Service 3880ab
After some use:
Packit Service 3880ab
.br
Packit Service 3880ab
# tc -s qdisc show dev eth0
Packit Service 3880ab
Packit Service 3880ab
qdisc cake 1: root refcnt 2 bandwidth 100Mbit diffserv3 triple-isolate rtt 100.0ms noatm overhead 38 mpu 84
Packit Service 3880ab
 Sent 44709231 bytes 31931 pkt (dropped 45, overlimits 93782 requeues 0)
Packit Service 3880ab
 backlog 33308b 22p requeues 0
Packit Service 3880ab
 memory used: 292352b of 5000000b
Packit Service 3880ab
 capacity estimate: 100Mbit
Packit Service 3880ab
 min/max network layer size:           28 /    1500
Packit Service 3880ab
 min/max overhead-adjusted size:       84 /    1538
Packit Service 3880ab
 average network hdr offset:           14
Packit Service 3880ab
Packit Service 3880ab
                   Bulk  Best Effort        Voice
Packit Service 3880ab
  thresh       6250Kbit      100Mbit       25Mbit
Packit Service 3880ab
  target          5.0ms        5.0ms        5.0ms
Packit Service 3880ab
  interval      100.0ms      100.0ms      100.0ms
Packit Service 3880ab
  pk_delay        8.7ms        6.9ms        5.0ms
Packit Service 3880ab
  av_delay        4.9ms        5.3ms        3.8ms
Packit Service 3880ab
  sp_delay        727us        1.4ms        511us
Packit Service 3880ab
  pkts             2590        21271         8137
Packit Service 3880ab
  bytes         3081804     30302659     11426206
Packit Service 3880ab
  way_inds            0           46            0
Packit Service 3880ab
  way_miss            3           17            4
Packit Service 3880ab
  way_cols            0            0            0
Packit Service 3880ab
  drops              20           15           10
Packit Service 3880ab
  marks               0            0            0
Packit Service 3880ab
  ack_drop            0            0            0
Packit Service 3880ab
  sp_flows            2            4            1
Packit Service 3880ab
  bk_flows            1            2            1
Packit Service 3880ab
  un_flows            0            0            0
Packit Service 3880ab
  max_len          1514         1514         1514
Packit Service 3880ab
  quantum           300         1514          762
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR tc-codel (8),
Packit Service 3880ab
.BR tc-fq_codel (8),
Packit Service 3880ab
.BR tc-htb (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHORS
Packit Service 3880ab
Cake's principal author is Jonathan Morton, with contributions from
Packit Service 3880ab
Tony Ambardar, Kevin Darbyshire-Bryant, Toke Høiland-Jørgensen,
Packit Service 3880ab
Sebastian Moeller, Ryan Mounce, Dean Scarff, Nils Andreas Svee, and Dave Täht.
Packit Service 3880ab
Packit Service 3880ab
This manual page was written by Loganaden Velvindron. Please report corrections
Packit Service 3880ab
to the Linux Networking mailing list <netdev@vger.kernel.org>.