<s>
CoDel	B-Algorithm
(	O
Controlled	B-Algorithm
Delay	I-Algorithm
;	O
pronounced	O
"	O
coddle	O
"	O
)	O
is	O
an	O
active	B-Algorithm
queue	I-Algorithm
management	I-Algorithm
(	O
AQM	O
)	O
algorithm	O
in	O
network	B-Protocol
routing	I-Protocol
,	O
developed	O
by	O
Van	O
Jacobson	O
and	O
Kathleen	O
Nichols	O
and	O
published	O
as	O
RFC8289	O
.	O
</s>
<s>
It	O
is	O
designed	O
to	O
overcome	O
bufferbloat	O
in	O
networking	B-Device
hardware	I-Device
,	O
such	O
as	O
routers	B-Protocol
,	O
by	O
setting	O
limits	O
on	O
the	O
delay	O
network	B-Protocol
packets	I-Protocol
experience	O
as	O
they	O
pass	O
through	O
buffers	B-General_Concept
in	O
this	O
equipment	O
.	O
</s>
<s>
CoDel	B-Algorithm
aims	O
to	O
improve	O
on	O
the	O
overall	O
performance	O
of	O
the	O
random	B-Algorithm
early	I-Algorithm
detection	I-Algorithm
(	O
RED	B-Algorithm
)	O
algorithm	O
by	O
addressing	O
some	O
of	O
its	O
fundamental	O
misconceptions	O
,	O
as	O
perceived	O
by	O
Jacobson	O
,	O
and	O
by	O
being	O
easier	O
to	O
manage	O
.	O
</s>
<s>
In	O
2012	O
,	O
an	O
implementation	O
of	O
CoDel	B-Algorithm
was	O
written	O
by	O
Dave	O
Täht	O
and	O
Eric	O
Dumazet	O
for	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
and	O
dual	O
licensed	O
under	O
the	O
GNU	B-License
General	I-License
Public	I-License
License	I-License
and	O
the	O
3-clause	O
BSD	O
license	O
.	O
</s>
<s>
Dumazet	O
's	O
improvement	O
on	O
CoDel	B-Algorithm
is	O
called	O
FQ-CoDel	O
,	O
standing	O
for	O
"	O
Fair/Flow	O
Queue	O
CoDel	B-Algorithm
"	O
;	O
it	O
was	O
first	O
adopted	O
as	O
the	O
standard	O
AQM	O
and	O
packet	B-Protocol
scheduling	O
solution	O
in	O
2014	O
in	O
the	O
OpenWrt	B-Application
14.07	O
release	O
called	O
"	O
Barrier	O
Breaker	O
"	O
.	O
</s>
<s>
From	O
there	O
,	O
CoDel	B-Algorithm
and	O
FQ-CoDel	O
have	O
migrated	O
into	O
various	O
downstream	O
projects	O
such	O
as	O
Tomato	B-Protocol
,	O
dd-wrt	B-Protocol
,	O
OPNsense	B-Protocol
and	O
Ubiquiti	O
's	O
"	O
Smart	O
Queues	O
"	O
feature	O
.	O
</s>
<s>
CoDel	B-Algorithm
is	O
based	O
on	O
observations	O
of	O
packet	B-Protocol
behavior	O
in	O
packet-switched	B-Protocol
networks	I-Protocol
under	O
the	O
influence	O
of	O
data	B-General_Concept
buffers	I-General_Concept
.	O
</s>
<s>
CoDel	B-Algorithm
was	O
developed	O
as	O
an	O
attempt	O
to	O
address	O
the	O
problem	O
of	O
bufferbloat	O
.	O
</s>
<s>
The	O
flow	O
of	O
packets	B-Protocol
slows	O
down	O
while	O
traveling	O
through	O
a	O
network	O
link	O
between	O
a	O
fast	O
and	O
a	O
slow	O
network	O
,	O
especially	O
at	O
the	O
start	O
of	O
a	O
TCP	B-Protocol
session	O
,	O
when	O
there	O
is	O
a	O
sudden	O
burst	O
of	O
packets	B-Protocol
and	O
the	O
slower	O
network	O
may	O
not	O
be	O
able	O
to	O
accept	O
the	O
burst	O
quickly	O
enough	O
.	O
</s>
<s>
Buffers	B-General_Concept
exist	O
to	O
ease	O
this	O
problem	O
by	O
giving	O
the	O
fast	O
network	O
a	O
place	O
to	O
store	O
packets	B-Protocol
to	O
be	O
read	O
by	O
the	O
slower	O
network	O
at	O
its	O
own	O
pace	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
buffers	B-General_Concept
act	O
like	O
shock	O
absorbers	O
to	O
convert	O
bursty	O
arrivals	O
into	O
smooth	O
,	O
steady	O
departures	O
.	O
</s>
<s>
However	O
,	O
a	O
buffer	B-General_Concept
has	O
limited	O
capacity	O
.	O
</s>
<s>
The	O
ideal	O
buffer	B-General_Concept
is	O
sized	O
so	O
it	O
can	O
handle	O
a	O
sudden	O
burst	O
of	O
communication	O
and	O
match	O
the	O
speed	O
of	O
that	O
burst	O
to	O
the	O
speed	O
of	O
the	O
slower	O
network	O
.	O
</s>
<s>
Ideally	O
,	O
the	O
shock-absorbing	O
situation	O
is	O
characterized	O
by	O
a	O
temporary	O
delay	O
for	O
packets	B-Protocol
in	O
the	O
buffer	B-General_Concept
during	O
the	O
transmission	O
burst	O
,	O
after	O
which	O
the	O
delay	O
rapidly	O
disappears	O
and	O
the	O
network	O
reaches	O
a	O
balance	O
in	O
offering	O
and	O
handling	O
packets	B-Protocol
.	O
</s>
<s>
The	O
TCP	B-Protocol
congestion	O
control	O
algorithm	O
relies	O
on	O
packet	B-Protocol
drops	O
to	O
determine	O
the	O
available	O
bandwidth	O
between	O
two	O
communicating	O
devices	O
.	O
</s>
<s>
It	O
speeds	O
up	O
the	O
data	O
transfer	O
until	O
packets	B-Protocol
start	O
to	O
drop	O
,	O
and	O
then	O
slows	O
down	O
the	O
transmission	O
rate	O
.	O
</s>
<s>
For	O
this	O
to	O
work	O
,	O
the	O
packet	B-Protocol
drops	O
must	O
occur	O
in	O
a	O
timely	O
manner	O
so	O
that	O
the	O
algorithm	O
can	O
responsively	O
select	O
a	O
suitable	O
transfer	O
speed	O
.	O
</s>
<s>
With	O
packets	B-Protocol
held	O
in	O
an	O
overly-large	O
buffer	B-General_Concept
,	O
the	O
packets	B-Protocol
will	O
arrive	O
at	O
their	O
destination	O
but	O
with	O
a	O
higher	O
latency	B-Protocol
but	O
no	O
packets	B-Protocol
are	O
dropped	O
so	O
TCP	B-Protocol
does	O
not	O
slow	O
down	O
.	O
</s>
<s>
Under	O
these	O
conditions	O
,	O
TCP	B-Protocol
may	O
even	O
decide	O
that	O
the	O
path	O
of	O
the	O
connection	O
has	O
changed	O
and	O
repeat	O
the	O
search	O
for	O
a	O
new	O
equilibrium	O
.	O
</s>
<s>
Having	O
a	O
big	O
and	O
constantly	O
full	O
buffer	B-General_Concept
that	O
causes	O
increased	O
transmission	O
delays	O
and	O
reduced	O
interactivity	O
,	O
especially	O
when	O
looking	O
at	O
two	O
or	O
more	O
simultaneous	O
transmissions	O
over	O
the	O
same	O
channel	O
,	O
is	O
called	O
bufferbloat	O
.	O
</s>
<s>
Available	O
channel	O
bandwidth	O
can	O
also	O
end	O
up	O
being	O
unused	O
,	O
as	O
some	O
fast	O
destinations	O
may	O
not	O
be	O
reached	O
due	O
to	O
buffers	B-General_Concept
being	O
clogged	O
with	O
data	O
awaiting	O
delivery	O
to	O
slow	O
destinations	O
.	O
</s>
<s>
CoDel	B-Algorithm
distinguishes	O
between	O
two	O
types	O
of	O
queue	O
:	O
A	O
good	O
queue	O
is	O
one	O
that	O
exhibits	O
no	O
bufferbloat	O
.	O
</s>
<s>
Communication	O
bursts	O
cause	O
no	O
more	O
than	O
a	O
temporary	O
increase	O
in	O
queue	B-Protocol
delay	I-Protocol
.	O
</s>
<s>
Communication	O
bursts	O
cause	O
the	O
buffer	B-General_Concept
to	O
fill	O
up	O
and	O
stay	O
filled	O
,	O
resulting	O
in	O
low	O
utilization	O
and	O
a	O
constantly	O
high	O
buffer	B-General_Concept
delay	O
.	O
</s>
<s>
In	O
order	O
to	O
be	O
effective	O
against	O
bufferbloat	O
,	O
a	O
solution	O
in	O
the	O
form	O
of	O
an	O
active	B-Algorithm
queue	I-Algorithm
management	I-Algorithm
(	O
AQM	O
)	O
algorithm	O
must	O
be	O
able	O
to	O
recognize	O
an	O
occurrence	O
of	O
bufferbloat	O
and	O
react	O
by	O
deploying	O
effective	O
countermeasures	O
.	O
</s>
<s>
Algorithms	O
like	O
RED	B-Algorithm
measure	O
the	O
average	O
queue	O
length	O
and	O
consider	O
it	O
a	O
case	O
of	O
bufferbloat	O
if	O
the	O
average	O
grows	O
too	O
large	O
.	O
</s>
<s>
Jacobson	O
suggested	O
that	O
average	O
queue	O
length	O
actually	O
contains	O
no	O
information	O
at	O
all	O
about	O
packet	B-Protocol
demand	O
or	O
network	O
load	O
.	O
</s>
<s>
Based	O
on	O
Jacobson	O
's	O
notion	O
from	O
2006	O
,	O
CoDel	B-Algorithm
was	O
developed	O
to	O
manage	O
queues	O
under	O
control	O
of	O
the	O
minimum	O
delay	O
experienced	O
by	O
packets	B-Protocol
in	O
the	O
running	O
buffer	B-General_Concept
window	O
.	O
</s>
<s>
If	O
the	O
minimum	O
delay	O
rises	O
to	O
too	O
high	O
a	O
value	O
,	O
packets	B-Protocol
are	O
dropped	O
from	O
the	O
queue	O
until	O
the	O
delay	O
drops	O
below	O
the	O
maximum	O
level	O
.	O
</s>
<s>
CoDel	B-Algorithm
is	O
parameterless	O
.	O
</s>
<s>
One	O
of	O
the	O
weaknesses	O
in	O
the	O
RED	B-Algorithm
algorithm	O
(	O
according	O
to	O
Jacobson	O
)	O
is	O
that	O
it	O
is	O
too	O
difficult	O
to	O
configure	O
,	O
especially	O
in	O
an	O
environment	O
with	O
dynamic	O
link	O
rates	O
.	O
</s>
<s>
CoDel	B-Algorithm
treats	O
good	O
queue	O
and	O
bad	O
queue	O
differently	O
.	O
</s>
<s>
A	O
good	O
queue	O
has	O
low	O
delays	O
by	O
nature	O
,	O
so	O
the	O
management	O
algorithm	O
can	O
ignore	O
it	O
,	O
while	O
a	O
bad	O
queue	O
is	O
subject	O
to	O
management	O
intervention	O
in	O
the	O
form	O
of	O
dropping	O
packets	B-Protocol
.	O
</s>
<s>
CoDel	B-Algorithm
works	O
off	O
of	O
a	O
parameter	O
that	O
is	O
determined	O
completely	O
locally	O
;	O
It	O
is	O
independent	O
of	O
round-trip	O
delays	O
,	O
link	O
rates	O
,	O
traffic	O
loads	O
and	O
other	O
factors	O
that	O
cannot	O
be	O
controlled	O
or	O
predicted	O
by	O
the	O
local	O
buffer	B-General_Concept
.	O
</s>
<s>
The	O
local	O
minimum	O
delay	O
can	O
only	O
be	O
determined	O
when	O
a	O
packet	B-Protocol
leaves	O
the	O
buffer	B-General_Concept
,	O
so	O
no	O
extra	O
delay	O
is	O
needed	O
to	O
run	O
the	O
queue	O
to	O
collect	O
statistics	O
to	O
manage	O
the	O
queue	O
.	O
</s>
<s>
CoDel	B-Algorithm
adapts	O
to	O
dynamically	O
changing	O
link	O
rates	O
with	O
no	O
negative	O
impact	O
on	O
utilization	O
.	O
</s>
<s>
The	O
CoDel	B-Algorithm
implementation	O
is	O
relatively	O
simple	O
and	O
therefore	O
can	O
span	O
the	O
spectrum	O
from	O
low-end	O
home	O
routers	B-Protocol
to	O
high-end	O
routing	B-Protocol
solutions	O
.	O
</s>
<s>
CoDel	B-Algorithm
does	O
nothing	O
to	O
manage	O
the	O
buffer	B-General_Concept
if	O
the	O
minimum	O
delay	O
for	O
the	O
buffer	B-General_Concept
window	O
is	O
below	O
the	O
maximum	O
allowed	O
value	O
.	O
</s>
<s>
It	O
also	O
does	O
nothing	O
if	O
the	O
buffer	B-General_Concept
is	O
relatively	O
empty	O
(	O
if	O
there	O
are	O
fewer	O
than	O
one	O
MTU	B-Protocol
's	O
worth	O
of	O
bytes	O
in	O
the	O
buffer	B-General_Concept
)	O
.	O
</s>
<s>
If	O
these	O
conditions	O
do	O
not	O
hold	O
,	O
then	O
CoDel	B-Algorithm
drops	O
packets	B-Protocol
probabilistically	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
independently	O
computed	O
at	O
each	O
network	B-Protocol
hop	I-Protocol
.	O
</s>
<s>
Per-packet	O
queuing	B-Protocol
delay	I-Protocol
is	O
monitored	O
through	O
the	O
hop	B-Protocol
.	O
</s>
<s>
As	O
each	O
packet	B-Protocol
is	O
dequeued	O
for	O
forwarding	B-Protocol
,	O
the	O
queuing	B-Protocol
delay	I-Protocol
(	O
amount	O
of	O
time	O
the	O
packet	B-Protocol
spent	O
waiting	O
in	O
the	O
queue	O
)	O
is	O
calculated	O
.	O
</s>
<s>
The	O
lowest	O
queuing	B-Protocol
delay	I-Protocol
for	O
the	O
interval	O
is	O
stored	O
.	O
</s>
<s>
When	O
the	O
last	O
packet	B-Protocol
of	O
the	O
interval	O
is	O
dequeued	O
,	O
if	O
the	O
lowest	O
queuing	B-Protocol
delay	I-Protocol
for	O
the	O
interval	O
is	O
greater	O
than	O
5	O
milliseconds	O
,	O
this	O
single	O
packet	B-Protocol
is	O
dropped	O
and	O
the	O
interval	O
used	O
for	O
the	O
next	O
group	O
of	O
packets	B-Protocol
is	O
shortened	O
.	O
</s>
<s>
If	O
the	O
lowest	O
queuing	B-Protocol
delay	I-Protocol
for	O
the	O
interval	O
is	O
less	O
than	O
5	O
milliseconds	O
,	O
the	O
packet	B-Protocol
is	O
forwarded	O
and	O
the	O
interval	O
is	O
reset	O
to	O
100	O
milliseconds	O
.	O
</s>
<s>
When	O
the	O
interval	O
is	O
shortened	O
,	O
it	O
is	O
done	O
so	O
in	O
accordance	O
with	O
the	O
inverse	O
square	O
root	O
of	O
the	O
number	O
of	O
successive	O
intervals	O
in	O
which	O
packets	B-Protocol
were	O
dropped	O
due	O
to	O
excessive	O
queuing	B-Protocol
delay	I-Protocol
.	O
</s>
<s>
CoDel	B-Algorithm
has	O
been	O
tested	O
in	O
simulation	O
tests	O
by	O
Nichols	O
and	O
Jacobson	O
,	O
at	O
different	O
MTUs	B-Protocol
and	O
link	O
rates	O
and	O
other	O
variations	O
of	O
conditions	O
.	O
</s>
<s>
In	O
comparison	O
to	O
RED	B-Algorithm
,	O
CoDel	B-Algorithm
keeps	O
the	O
packet	B-Protocol
delay	O
closer	O
to	O
the	O
target	O
value	O
across	O
the	O
full	O
range	O
of	O
bandwidths	O
(	O
from	O
3	O
to	O
100	O
Mbit/s	O
)	O
.	O
</s>
<s>
At	O
lower	O
MTU	B-Protocol
,	O
packet	B-Protocol
delays	O
are	O
lower	O
than	O
at	O
higher	O
MTU	B-Protocol
.	O
</s>
<s>
Higher	O
MTU	B-Protocol
results	O
in	O
good	O
link	O
utilization	O
,	O
lower	O
MTU	B-Protocol
results	O
in	O
good	O
link	O
utilization	O
at	O
lower	O
bandwidth	O
,	O
degrading	O
to	O
fair	O
utilization	O
at	O
high	O
bandwidth	O
.	O
</s>
<s>
A	O
full	O
implementation	O
of	O
CoDel	B-Algorithm
was	O
realized	O
in	O
May	O
2012	O
and	O
made	O
available	O
as	O
open-source	B-Application
software	I-Application
.	O
</s>
<s>
It	O
was	O
implemented	O
within	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
(	O
starting	O
with	O
the	O
3.5	O
mainline	B-General_Concept
)	O
.	O
</s>
<s>
Dave	O
Täht	O
back-ported	O
CoDel	B-Algorithm
to	O
Linux	B-Operating_System
kernel	I-Operating_System
3.3	O
for	O
project	O
CeroWrt	O
,	O
which	O
concerns	O
itself	O
among	O
other	O
things	O
with	O
bufferbloat	O
,	O
where	O
it	O
was	O
exhaustively	O
tested	O
.	O
</s>
<s>
CoDel	B-Algorithm
began	O
to	O
appear	O
as	O
an	O
option	O
in	O
some	O
proprietary/turnkey	O
bandwidth	O
management	O
platforms	O
in	O
2013	O
.	O
</s>
<s>
FreeBSD	O
had	O
CoDel	B-Algorithm
integrated	O
into	O
the	O
11.x	O
and	O
10.x	O
code	B-General_Concept
branches	I-General_Concept
in	O
2016	O
.	O
</s>
<s>
An	O
implementation	O
is	O
distributed	O
with	O
OpenBSD	B-Operating_System
since	O
version	O
6.2	O
.	O
</s>
<s>
Fair/Flow	O
Queue	O
CoDel	B-Algorithm
(	O
FQ-CoDel	O
;	O
fq_codel	O
in	O
Linux	B-Operating_System
code	O
)	O
adds	O
flow	O
queuing	O
to	O
CoDel	B-Algorithm
so	O
that	O
it	O
differentiates	O
between	O
multiple	O
simultaneous	O
connections	O
and	O
works	O
fairly	O
.	O
</s>
<s>
It	O
gives	O
the	O
first	O
packet	B-Protocol
in	O
each	O
stream	O
priority	O
,	O
so	O
that	O
small	O
streams	O
can	O
start	O
and	O
finish	O
quickly	O
for	O
better	O
use	O
of	O
network	O
resources	O
.	O
</s>
<s>
CoDel	B-Algorithm
co-author	O
Van	O
Jacobson	O
recommends	O
the	O
use	O
of	O
fq_codel	O
over	O
codel	B-Algorithm
where	O
it	O
's	O
available	O
.	O
</s>
<s>
FQ-CoDel	O
is	O
published	O
as	O
RFC8290	O
.	O
</s>
<s>
Common	O
Applications	O
Kept	O
Enhanced	O
(	O
CAKE	O
;	O
sch_cake	O
in	O
Linux	B-Operating_System
code	O
)	O
is	O
a	O
combined	O
traffic	O
shaper	O
and	O
AQM	O
algorithm	O
presented	O
by	O
the	O
bufferbloat	O
project	O
in	O
2018	O
.	O
</s>
<s>
It	O
improves	O
over	O
the	O
Linux	B-Operating_System
htb+fq_codel	O
implementation	O
by	O
reducing	O
hash	O
collisions	O
between	O
flows	O
,	O
reducing	O
CPU	O
utilization	O
in	O
traffic	O
shaping	O
,	O
and	O
in	O
a	O
few	O
other	O
ways	O
.	O
</s>
<s>
For	O
example	O
,	O
Apple	O
's	O
implementation	O
of	O
fq_codel	O
(	O
default	O
in	O
iOS	O
)	O
has	O
a	O
very	O
large	O
number	O
of	O
users	O
but	O
no	O
"	O
codel	B-Algorithm
"	O
component	O
.	O
</s>
