<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
is	O
an	O
algorithm	O
based	O
on	O
an	O
analogy	O
of	O
how	O
a	O
bucket	B-Device
with	O
a	O
constant	O
leak	O
will	O
overflow	O
if	O
either	O
the	O
average	O
rate	O
at	O
which	O
water	O
is	O
poured	O
in	O
exceeds	O
the	O
rate	O
at	O
which	O
the	O
bucket	B-Device
leaks	O
or	O
if	O
more	O
water	O
than	O
the	O
capacity	O
of	O
the	O
bucket	B-Device
is	O
poured	O
in	O
all	O
at	O
once	O
.	O
</s>
<s>
It	O
is	O
used	O
in	O
packet-switched	B-Protocol
computer	I-Protocol
networks	I-Protocol
and	O
telecommunications	O
networks	O
in	O
both	O
the	O
traffic	B-Protocol
policing	O
,	O
traffic	B-Protocol
shaping	O
and	O
scheduling	B-Application
of	O
data	O
transmissions	O
,	O
in	O
the	O
form	O
of	O
packets	B-Protocol
,	O
to	O
defined	O
limits	O
on	O
bandwidth	O
and	O
burstiness	O
(	O
a	O
measure	O
of	O
the	O
variations	O
in	O
the	O
traffic	B-Protocol
flow	O
)	O
.	O
</s>
<s>
A	O
version	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
,	O
the	O
generic	B-Algorithm
cell	I-Algorithm
rate	I-Algorithm
algorithm	I-Algorithm
,	O
is	O
recommended	O
for	O
Asynchronous	O
Transfer	O
Mode	O
(	O
ATM	O
)	O
networks	O
in	O
Usage/Network	B-Protocol
Parameter	I-Protocol
Control	I-Protocol
at	O
user	O
–	O
network	O
interfaces	O
or	O
inter-network	O
interfaces	O
or	O
network-to-network	O
interfaces	O
to	O
protect	O
a	O
network	O
from	O
excessive	O
traffic	B-Protocol
levels	O
on	O
connections	O
routed	O
through	O
it	O
.	O
</s>
<s>
The	O
generic	B-Algorithm
cell	I-Algorithm
rate	I-Algorithm
algorithm	I-Algorithm
,	O
or	O
an	O
equivalent	O
,	O
may	O
also	O
be	O
used	O
to	O
shape	O
transmissions	O
by	O
a	O
network	B-Protocol
interface	I-Protocol
card	I-Protocol
onto	O
an	O
ATM	O
network	O
.	O
</s>
<s>
At	O
least	O
some	O
implementations	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
are	O
a	O
mirror	O
image	O
of	O
the	O
token	B-Algorithm
bucket	I-Algorithm
algorithm	O
and	O
will	O
,	O
given	O
equivalent	O
parameters	O
,	O
determine	O
exactly	O
the	O
same	O
sequence	O
of	O
events	O
to	O
conform	O
or	O
not	O
conform	O
to	O
the	O
same	O
limits	O
.	O
</s>
<s>
Two	O
different	O
methods	O
of	O
applying	O
this	O
leaky	B-Algorithm
bucket	I-Algorithm
analogy	O
are	O
described	O
in	O
the	O
literature	O
.	O
</s>
<s>
These	O
give	O
what	O
appear	O
to	O
be	O
two	O
different	O
algorithms	O
,	O
both	O
of	O
which	O
are	O
referred	O
to	O
as	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
and	O
generally	O
without	O
reference	O
to	O
the	O
other	O
method	O
.	O
</s>
<s>
This	O
has	O
resulted	O
in	O
confusion	O
about	O
what	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
is	O
and	O
what	O
its	O
properties	O
are	O
.	O
</s>
<s>
In	O
one	O
version	O
the	O
bucket	B-Device
is	O
a	O
counter	O
or	O
variable	O
separate	O
from	O
the	O
flow	O
of	O
traffic	B-Protocol
or	O
schedule	O
of	O
events	O
.	O
</s>
<s>
This	O
counter	O
is	O
used	O
only	O
to	O
check	O
that	O
the	O
traffic	B-Protocol
or	O
events	O
conform	O
to	O
the	O
limits	O
:	O
The	O
counter	O
is	O
incremented	O
as	O
each	O
packet	B-Protocol
arrives	O
at	O
the	O
point	O
where	O
the	O
check	O
is	O
being	O
made	O
or	O
an	O
event	O
occurs	O
,	O
which	O
is	O
equivalent	O
to	O
the	O
way	O
water	O
is	O
added	O
intermittently	O
to	O
the	O
bucket	B-Device
.	O
</s>
<s>
The	O
counter	O
is	O
also	O
decremented	O
at	O
a	O
fixed	O
rate	O
,	O
equivalent	O
to	O
the	O
way	O
the	O
water	O
leaks	O
out	O
of	O
the	O
bucket	B-Device
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
value	O
in	O
the	O
counter	O
represents	O
the	O
level	O
of	O
the	O
water	O
in	O
the	O
bucket	B-Device
.	O
</s>
<s>
If	O
the	O
counter	O
remains	O
below	O
a	O
specified	O
limit	O
value	O
when	O
a	O
packet	B-Protocol
arrives	O
or	O
an	O
event	O
occurs	O
,	O
i.e.	O
</s>
<s>
the	O
bucket	B-Device
does	O
not	O
overflow	O
,	O
that	O
indicates	O
its	O
conformance	O
to	O
the	O
bandwidth	O
and	O
burstiness	O
limits	O
or	O
the	O
average	O
and	O
peak	O
rate	O
event	O
limits	O
.	O
</s>
<s>
This	O
version	O
is	O
referred	O
to	O
here	O
as	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
.	O
</s>
<s>
In	O
the	O
second	O
version	O
,	O
the	O
bucket	B-Device
is	O
a	O
queue	O
in	O
the	O
flow	O
of	O
traffic	B-Protocol
.	O
</s>
<s>
This	O
queue	O
is	O
used	O
to	O
directly	O
control	O
that	O
flow	O
:	O
Packets	B-Protocol
are	O
entered	O
into	O
the	O
queue	O
as	O
they	O
arrive	O
,	O
equivalent	O
to	O
the	O
water	O
being	O
added	O
to	O
the	O
bucket	B-Device
.	O
</s>
<s>
These	O
packets	B-Protocol
are	O
then	O
removed	O
from	O
the	O
queue	O
(	O
first	B-Operating_System
come	I-Operating_System
,	I-Operating_System
first	I-Operating_System
served	I-Operating_System
)	O
,	O
usually	O
at	O
a	O
fixed	O
rate	O
,	O
e.g.	O
</s>
<s>
for	O
onward	O
transmission	O
,	O
equivalent	O
to	O
water	O
leaking	O
from	O
the	O
bucket	B-Device
.	O
</s>
<s>
This	O
configuration	O
imposes	O
conformance	O
rather	O
than	O
checking	O
it	O
,	O
and	O
where	O
the	O
output	O
is	O
serviced	O
at	O
a	O
fixed	O
rate	O
(	O
and	O
where	O
the	O
packets	B-Protocol
are	O
all	O
the	O
same	O
length	O
)	O
,	O
the	O
resulting	O
traffic	B-Protocol
stream	O
is	O
necessarily	O
devoid	O
of	O
burstiness	O
or	O
jitter	O
.	O
</s>
<s>
So	O
in	O
this	O
version	O
,	O
the	O
traffic	B-Protocol
itself	O
is	O
the	O
analogue	O
of	O
the	O
water	O
passing	O
through	O
the	O
bucket	B-Device
.	O
</s>
<s>
This	O
version	O
is	O
referred	O
to	O
here	O
as	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
is	O
exactly	O
equivalent	O
to	O
(	O
a	O
mirror	O
image	O
of	O
)	O
the	O
token	B-Algorithm
bucket	I-Algorithm
algorithm	O
,	O
i.e.	O
</s>
<s>
the	O
process	O
of	O
adding	O
water	O
to	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
exactly	O
mirrors	O
that	O
of	O
removing	O
tokens	O
from	O
the	O
token	B-Algorithm
bucket	I-Algorithm
when	O
a	O
conforming	O
packet	B-Protocol
arrives	O
,	O
the	O
process	O
of	O
leaking	O
of	O
water	O
from	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
exactly	O
mirrors	O
that	O
of	O
regularly	O
adding	O
tokens	O
to	O
the	O
token	B-Algorithm
bucket	I-Algorithm
,	O
and	O
the	O
test	O
that	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
will	O
not	O
overflow	O
is	O
a	O
mirror	O
of	O
the	O
test	O
that	O
the	O
token	B-Algorithm
bucket	I-Algorithm
contains	O
enough	O
tokens	O
and	O
will	O
not	O
underflow	O
.	O
</s>
<s>
Thus	O
,	O
given	O
equivalent	O
parameters	O
,	O
the	O
two	O
algorithms	O
will	O
see	O
the	O
same	O
traffic	B-Protocol
as	O
conforming	O
or	O
nonconforming	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
can	O
be	O
seen	O
as	O
a	O
special	O
case	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
.	O
</s>
<s>
Jonathan	O
S	O
.	O
Turner	O
is	O
credited	O
with	O
the	O
original	O
description	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
and	O
describes	O
it	O
as	O
follows	O
:	O
"	O
A	O
counter	O
associated	O
with	O
each	O
user	O
transmitting	O
on	O
a	O
connection	O
is	O
incremented	O
whenever	O
the	O
user	O
sends	O
a	O
packet	B-Protocol
and	O
is	O
decremented	O
periodically	O
.	O
</s>
<s>
If	O
the	O
counter	O
exceeds	O
a	O
threshold	O
upon	O
being	O
incremented	O
,	O
the	O
network	O
discards	O
the	O
packet	B-Protocol
.	O
</s>
<s>
The	O
bucket	B-Device
(	O
analogous	O
to	O
the	O
counter	O
)	O
is	O
,	O
in	O
this	O
case	O
,	O
used	O
as	O
a	O
meter	O
to	O
test	O
the	O
conformance	O
of	O
packets	B-Protocol
,	O
rather	O
than	O
as	O
a	O
queue	O
to	O
directly	O
control	O
them	O
.	O
</s>
<s>
Another	O
description	O
of	O
what	O
is	O
essentially	O
the	O
same	O
meter	O
version	O
of	O
the	O
algorithm	O
,	O
the	O
generic	B-Algorithm
cell	I-Algorithm
rate	I-Algorithm
algorithm	I-Algorithm
,	O
is	O
given	O
by	O
the	O
ITU-T	O
in	O
recommendation	O
I.371	O
and	O
in	O
the	O
ATM	O
Forum	O
's	O
UNI	O
Specification	O
.	O
</s>
<s>
The	O
description	O
,	O
in	O
which	O
the	O
term	O
cell	O
is	O
equivalent	O
to	O
packet	B-Protocol
in	O
Turner	O
's	O
description	O
is	O
given	O
by	O
the	O
ITU-T	O
as	O
follows	O
:	O
"	O
The	O
continuous-state	O
leaky	B-Algorithm
bucket	I-Algorithm
can	O
be	O
viewed	O
as	O
a	O
finite	O
capacity	O
bucket	B-Device
whose	O
real-valued	O
content	O
drains	O
out	O
at	O
a	O
continuous	O
rate	O
of	O
1	O
unit	O
of	O
content	O
per	O
time	O
unit	O
and	O
whose	O
content	O
is	O
increased	O
by	O
the	O
increment	O
T	O
for	O
each	O
conforming	O
cell	O
...	O
</s>
<s>
If	O
at	O
a	O
cell	O
arrival	O
the	O
content	O
of	O
the	O
bucket	B-Device
is	O
less	O
than	O
or	O
equal	O
to	O
the	O
limit	O
value	O
τ	O
,	O
then	O
the	O
cell	O
is	O
conforming	O
;	O
otherwise	O
,	O
the	O
cell	O
is	O
non-conforming	O
.	O
</s>
<s>
The	O
capacity	O
of	O
the	O
bucket	B-Device
(	O
the	O
upper	O
bound	O
of	O
the	O
counter	O
)	O
is	O
(	O
T	O
+	O
τ	O
)	O
"	O
.	O
</s>
<s>
These	O
specifications	O
also	O
state	O
that	O
,	O
due	O
to	O
its	O
finite	O
capacity	O
,	O
if	O
the	O
contents	O
of	O
the	O
bucket	B-Device
at	O
the	O
time	O
the	O
conformance	O
is	O
tested	O
is	O
greater	O
than	O
the	O
limit	O
value	O
,	O
and	O
hence	O
the	O
cell	O
is	O
non-conforming	O
,	O
then	O
the	O
bucket	B-Device
is	O
left	O
unchanged	O
;	O
that	O
is	O
,	O
the	O
water	O
is	O
simply	O
not	O
added	O
if	O
it	O
would	O
make	O
the	O
bucket	B-Device
overflow	O
.	O
</s>
<s>
In	O
this	O
,	O
they	O
state	O
"	O
In	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
analogy	O
,	O
the	O
 [ ATM ] 	O
cells	O
do	O
not	O
actually	O
flow	O
through	O
the	O
bucket	B-Device
;	O
only	O
the	O
check	O
for	O
conforming	O
admission	O
does	O
"	O
.	O
</s>
<s>
However	O
,	O
uncommonly	O
in	O
the	O
descriptions	O
in	O
the	O
literature	O
,	O
McDysan	O
and	O
Spohn	O
also	O
refer	O
to	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
queue	O
,	O
going	O
on	O
"	O
Note	O
that	O
one	O
implementation	O
of	O
traffic	B-Protocol
shaping	O
is	O
to	O
actually	O
have	O
the	O
cells	O
flow	O
through	O
the	O
bucket	B-Device
"	O
.	O
</s>
<s>
This	O
gremlin	O
inspects	O
the	O
level	O
in	O
the	O
bucket	B-Device
and	O
takes	O
action	O
if	O
the	O
level	O
is	O
above	O
the	O
limit	O
value	O
τ	O
:	O
in	O
policing	O
(	O
figure	O
2	O
)	O
,	O
it	O
pulls	O
open	O
a	O
trap	O
door	O
,	O
which	O
causes	O
the	O
arriving	O
packet	B-Protocol
to	O
be	O
dropped	O
and	O
stops	O
its	O
water	O
from	O
entering	O
the	O
bucket	B-Device
;	O
in	O
shaping	O
(	O
figure	O
3	O
)	O
,	O
it	O
pushes	O
up	O
a	O
flap	O
,	O
which	O
delays	O
the	O
arriving	O
packet	B-Protocol
and	O
prevents	O
it	O
from	O
delivering	O
its	O
water	O
,	O
until	O
the	O
water	O
level	O
in	O
the	O
bucket	B-Device
falls	O
below	O
τ	O
.	O
</s>
<s>
The	O
difference	O
between	O
the	O
descriptions	O
given	O
by	O
Turner	O
and	O
the	O
ITU-T/ATM	O
Forum	O
is	O
that	O
Turner	O
's	O
is	O
specific	O
to	O
traffic	B-Protocol
policing	O
,	O
whereas	O
the	O
ITU-T/ATM	O
Forum	O
is	O
applicable	O
to	O
both	O
traffic	B-Protocol
policing	O
and	O
traffic	B-Protocol
shaping	O
.	O
</s>
<s>
Also	O
,	O
Turner	O
does	O
not	O
state	O
that	O
the	O
contents	O
of	O
the	O
counter	O
should	O
only	O
be	O
affected	O
by	O
conforming	O
packets	B-Protocol
,	O
and	O
should	O
only	O
be	O
incremented	O
when	O
this	O
would	O
not	O
cause	O
it	O
to	O
exceed	O
a	O
limit	O
,	O
i.e.	O
</s>
<s>
Turner	O
does	O
not	O
explicitly	O
state	O
that	O
the	O
bucket	B-Device
's	O
capacity	O
or	O
counter	O
's	O
maximum	O
value	O
is	O
finite	O
.	O
</s>
<s>
To	O
make	O
Turner	O
's	O
description	O
clearly	O
aligned	O
with	O
ITU-T	O
,	O
the	O
statement	O
"	O
If	O
the	O
counter	O
exceeds	O
a	O
threshold	O
upon	O
being	O
incremented	O
,	O
the	O
network	O
discards	O
the	O
packet	B-Protocol
"	O
would	O
have	O
to	O
be	O
changed	O
to	O
something	O
like	O
"	O
If	O
the	O
counter	O
would	O
exceed	O
a	O
threshold	O
[	O
equivalent	O
to	O
the	O
bucket	B-Device
depth	O
,	O
T	O
+	O
τ	O
,	O
in	O
the	O
ITU-T	O
description ]	O
upon	O
being	O
incremented	O
,	O
the	O
network	O
discards	O
the	O
packet	B-Protocol
and	O
the	O
counter	O
is	O
not	O
incremented	O
"	O
,	O
i.e.	O
</s>
<s>
it	O
is	O
only	O
incremented	O
when	O
it	O
is	O
less	O
than	O
or	O
equal	O
to	O
the	O
limit	O
value	O
,	O
τ	O
,	O
or	O
at	O
least	O
T	O
less	O
than	O
the	O
bucket	B-Device
depth	O
in	O
the	O
ITU-T	O
description	O
.	O
</s>
<s>
While	O
the	O
description	O
given	O
by	O
Turner	O
does	O
not	O
state	O
that	O
the	O
counter	O
should	O
only	O
be	O
affected	O
by	O
conforming	O
packets	B-Protocol
,	O
it	O
is	O
given	O
in	O
terms	O
of	O
a	O
traffic	B-Protocol
policing	O
function	O
,	O
where	O
overzealousness	O
in	O
limiting	O
a	O
connection	O
containing	O
nonconforming	O
packets	B-Protocol
may	O
not	O
be	O
an	O
issue	O
.	O
</s>
<s>
Indeed	O
,	O
in	O
some	O
contexts	O
,	O
such	O
as	O
variable	B-General_Concept
bitrate	I-General_Concept
(	O
VBR	O
)	O
transmissions	O
,	O
the	O
loss	O
of	O
any	O
one	O
packet	B-Protocol
may	O
corrupt	O
the	O
entirety	O
of	O
a	O
higher	O
layer	O
message	O
,	O
e.g.	O
</s>
<s>
an	O
OSI	O
Network	B-Application
Layer	I-Application
PDU	B-Protocol
.	O
</s>
<s>
In	O
which	O
case	O
,	O
discarding	O
all	O
the	O
following	O
packets	B-Protocol
of	O
that	O
corrupted	O
PDU	B-Protocol
sheds	O
an	O
unnecessary	O
network	O
load	O
.	O
</s>
<s>
However	O
,	O
it	O
would	O
be	O
entirely	O
unacceptable	O
in	O
traffic	B-Protocol
shaping	O
for	O
a	O
packet	B-Protocol
that	O
fails	O
the	O
conformance	O
test	O
to	O
affect	O
how	O
long	O
before	O
conformance	O
can	O
next	O
occur	O
,	O
i.e.	O
</s>
<s>
if	O
the	O
act	O
of	O
testing	O
a	O
subsequent	O
packet	B-Protocol
for	O
conformance	O
would	O
change	O
how	O
long	O
a	O
packet	B-Protocol
currently	O
waiting	O
to	O
conform	O
has	O
to	O
wait	O
.	O
</s>
<s>
This	O
is	O
exactly	O
what	O
would	O
happen	O
if	O
the	O
water	O
from	O
nonconforming	O
packets	B-Protocol
were	O
to	O
be	O
added	O
to	O
the	O
bucket	B-Device
,	O
as	O
any	O
subsequent	O
nonconforming	O
packets	B-Protocol
would	O
raise	O
the	O
water	O
level	O
,	O
and	O
thus	O
make	O
a	O
packet	B-Protocol
waiting	O
to	O
conform	O
wait	O
longer	O
.	O
</s>
<s>
Neither	O
Turner	O
nor	O
the	O
ITU-T	O
addresses	O
the	O
issue	O
of	O
variable-length	O
packets	B-Protocol
.	O
</s>
<s>
However	O
,	O
the	O
description	O
according	O
to	O
the	O
ITU-T	O
is	O
for	O
ATM	O
cells	O
,	O
which	O
are	O
fixed-length	O
packets	B-Protocol
,	O
and	O
Turner	O
does	O
not	O
specifically	O
exclude	O
variable-length	O
packets	B-Protocol
.	O
</s>
<s>
Hence	O
,	O
in	O
both	O
cases	O
,	O
if	O
the	O
amount	O
by	O
which	O
the	O
bucket	B-Device
content	O
or	O
counter	O
is	O
incremented	O
for	O
a	O
conforming	O
packet	B-Protocol
is	O
proportional	O
to	O
the	O
packet	B-Protocol
length	O
,	O
they	O
will	O
both	O
account	O
for	O
the	O
length	O
and	O
allow	O
the	O
algorithm	O
to	O
limit	O
the	O
bandwidth	O
of	O
the	O
traffic	B-Protocol
explicitly	O
rather	O
than	O
limiting	O
the	O
packet	B-Protocol
rate	O
.	O
</s>
<s>
For	O
example	O
,	O
shorter	O
packets	B-Protocol
would	O
add	O
less	O
to	O
the	O
bucket	B-Device
,	O
and	O
could	O
thus	O
arrive	O
at	O
smaller	O
intervals	O
;	O
whereas	O
,	O
longer	O
packets	B-Protocol
would	O
add	O
more	O
and	O
thus	O
have	O
to	O
be	O
separated	O
by	O
proportionally	O
larger	O
intervals	O
to	O
conform	O
.	O
</s>
<s>
A	O
description	O
of	O
the	O
concept	O
of	O
operation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
meter	O
that	O
can	O
be	O
used	O
in	O
either	O
traffic	B-Protocol
policing	O
or	O
traffic	B-Protocol
shaping	O
may	O
be	O
stated	O
as	O
follows	O
:	O
</s>
<s>
A	O
fixed	O
capacity	O
bucket	B-Device
,	O
associated	O
with	O
each	O
virtual	O
connection	O
or	O
user	O
,	O
leaks	O
at	O
a	O
fixed	O
rate	O
.	O
</s>
<s>
If	O
the	O
bucket	B-Device
is	O
empty	O
,	O
it	O
stops	O
leaking	O
.	O
</s>
<s>
For	O
a	O
packet	B-Protocol
to	O
conform	O
,	O
it	O
has	O
to	O
be	O
possible	O
to	O
add	O
a	O
specific	O
amount	O
of	O
water	O
to	O
the	O
bucket	B-Device
:	O
The	O
specific	O
amount	O
added	O
by	O
a	O
conforming	O
packet	B-Protocol
can	O
be	O
the	O
same	O
for	O
all	O
packets	B-Protocol
or	O
can	O
be	O
proportional	O
to	O
the	O
length	O
of	O
the	O
packet	B-Protocol
.	O
</s>
<s>
If	O
this	O
amount	O
of	O
water	O
would	O
cause	O
the	O
bucket	B-Device
to	O
exceed	O
its	O
capacity	O
then	O
the	O
packet	B-Protocol
does	O
not	O
conform	O
and	O
the	O
water	O
in	O
the	O
bucket	B-Device
is	O
left	O
unchanged	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
can	O
be	O
used	O
in	O
either	O
traffic	B-Protocol
shaping	O
or	O
traffic	B-Protocol
policing	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
ATM	O
networks	O
,	O
in	O
the	O
form	O
of	O
the	O
generic	B-Algorithm
cell	I-Algorithm
rate	I-Algorithm
algorithm	I-Algorithm
,	O
it	O
is	O
used	O
to	O
compare	O
the	O
bandwidth	O
and	O
burstiness	O
of	O
traffic	B-Protocol
on	O
a	O
Virtual	O
Channel	O
(	O
VC	O
)	O
or	O
Virtual	O
Path	O
(	O
VP	O
)	O
against	O
the	O
specified	O
limits	O
on	O
the	O
rate	O
at	O
which	O
cells	O
may	O
arrive	O
and	O
the	O
maximum	O
jitter	O
,	O
or	O
variation	O
in	O
inter-arrival	O
intervals	O
,	O
for	O
the	O
VC	O
or	O
VP	O
.	O
</s>
<s>
In	O
traffic	B-Protocol
policing	O
,	O
cells	O
that	O
do	O
not	O
conform	O
to	O
these	O
limits	O
(	O
nonconforming	O
cells	O
)	O
may	O
be	O
discarded	O
(	O
dropped	O
)	O
or	O
may	O
be	O
reduced	O
in	O
priority	O
(	O
for	O
downstream	O
traffic	B-Protocol
management	O
functions	O
to	O
drop	O
if	O
there	O
is	O
congestion	O
)	O
.	O
</s>
<s>
In	O
traffic	B-Protocol
shaping	O
,	O
cells	O
are	O
delayed	O
until	O
they	O
conform	O
.	O
</s>
<s>
Traffic	B-Protocol
policing	O
and	O
traffic	B-Protocol
shaping	O
are	O
commonly	O
used	O
in	O
UPC/NPC	O
to	O
protect	O
the	O
network	O
against	O
excess	O
or	O
excessively	O
bursty	O
traffic	B-Protocol
,	O
see	O
bandwidth	O
management	O
and	O
congestion	O
avoidance	O
.	O
</s>
<s>
Traffic	B-Protocol
shaping	O
is	O
commonly	O
used	O
in	O
the	O
network	O
interfaces	O
in	O
hosts	B-Device
to	O
prevent	O
transmissions	O
from	O
exceeding	O
the	O
bandwidth	O
or	O
jitter	O
limits	O
and	O
being	O
discarded	O
by	O
traffic	B-Protocol
management	O
functions	O
in	O
the	O
network	O
.	O
</s>
<s>
(	O
See	O
scheduling	B-Application
(	O
computing	O
)	O
and	O
network	B-Application
scheduler	I-Application
.	O
)	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
meter	O
can	O
also	O
be	O
used	O
in	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
counter	I-Algorithm
to	O
measure	O
the	O
rate	O
of	O
random	O
or	O
stochastic	O
processes	O
.	O
</s>
<s>
A	O
Leaky	B-Algorithm
bucket	I-Algorithm
counter	I-Algorithm
can	O
be	O
used	O
to	O
detect	O
when	O
the	O
average	O
or	O
peak	O
rate	O
of	O
events	O
increases	O
above	O
some	O
,	O
acceptable	O
,	O
background	O
level	O
,	O
i.e.	O
</s>
<s>
when	O
the	O
bucket	B-Device
overflows	O
.	O
</s>
<s>
For	O
example	O
,	O
such	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
counter	I-Algorithm
can	O
be	O
used	O
to	O
detect	O
when	O
there	O
is	O
a	O
sudden	O
burst	O
of	O
correctable	O
memory	O
errors	O
or	O
when	O
there	O
has	O
been	O
a	O
gradual	O
,	O
but	O
significant	O
,	O
increase	O
in	O
the	O
average	O
rate	O
,	O
which	O
may	O
indicate	O
an	O
impending	O
failure	O
,	O
etc	O
.	O
</s>
<s>
The	O
use	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
in	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
counter	I-Algorithm
is	O
similar	O
to	O
that	O
in	O
traffic	B-Protocol
management	O
,	O
in	O
that	O
it	O
is	O
used	O
as	O
a	O
meter	O
.	O
</s>
<s>
Essentially	O
,	O
the	O
events	O
replace	O
the	O
packets	B-Protocol
in	O
the	O
description	O
,	O
with	O
each	O
event	O
causing	O
a	O
quantity	O
of	O
water	O
to	O
be	O
added	O
to	O
the	O
bucket	B-Device
.	O
</s>
<s>
If	O
the	O
bucket	B-Device
would	O
overflow	O
,	O
as	O
a	O
result	O
of	O
the	O
event	O
,	O
then	O
the	O
event	O
should	O
trigger	O
the	O
action	O
associated	O
with	O
an	O
out-of-limits	O
event	O
.	O
</s>
<s>
In	O
the	O
case	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
meter	O
,	O
the	O
limits	O
on	O
the	O
traffic	B-Protocol
can	O
be	O
bandwidth	O
and	O
a	O
burstiness	O
of	O
the	O
output	O
.	O
</s>
<s>
The	O
bandwidth	O
limit	O
and	O
burstiness	O
limit	O
for	O
the	O
connection	O
may	O
be	O
specified	O
in	O
a	O
traffic	B-Protocol
contract	O
.	O
</s>
<s>
A	O
bandwidth	O
limit	O
may	O
be	O
specified	O
as	O
a	O
packet	B-Protocol
or	O
frame	O
rate	O
,	O
a	O
byte	O
or	O
bit	O
rate	O
,	O
or	O
as	O
an	O
emission	O
interval	O
between	O
the	O
packets	B-Protocol
.	O
</s>
<s>
Multiple	O
sets	O
of	O
contract	O
parameters	O
can	O
be	O
applied	O
concurrently	O
to	O
a	O
connection	O
using	O
multiple	O
instances	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
,	O
each	O
of	O
which	O
may	O
take	O
a	O
bandwidth	O
and	O
a	O
burstiness	O
limit	O
:	O
see	O
.	O
</s>
<s>
The	O
rate	O
at	O
which	O
the	O
bucket	B-Device
leaks	O
will	O
determine	O
the	O
bandwidth	O
limit	O
,	O
which	O
is	O
referred	O
to	O
as	O
the	O
average	O
rate	O
by	O
Turner	O
and	O
the	O
inverse	O
of	O
which	O
is	O
referred	O
to	O
as	O
the	O
emission	O
interval	O
by	O
the	O
ITU-T	O
.	O
</s>
<s>
It	O
is	O
easiest	O
to	O
explain	O
what	O
this	O
interval	O
is	O
where	O
packets	B-Protocol
have	O
a	O
fixed	O
length	O
.	O
</s>
<s>
Hence	O
,	O
the	O
first	O
part	O
of	O
this	O
description	O
assumes	O
this	O
,	O
and	O
the	O
implications	O
of	O
variable	O
packet	B-Protocol
lengths	O
are	O
considered	O
separately	O
.	O
</s>
<s>
Consider	O
a	O
bucket	B-Device
that	O
is	O
exactly	O
filled	O
to	O
the	O
top	O
by	O
preceding	O
traffic	B-Protocol
,	O
i.e.	O
</s>
<s>
the	O
maximum	O
number	O
of	O
packets	B-Protocol
or	O
cells	O
have	O
just	O
arrived	O
in	O
the	O
minimum	O
amount	O
of	O
time	O
for	O
them	O
to	O
still	O
conform	O
to	O
the	O
bandwidth	O
and	O
jitter	O
limits	O
.	O
</s>
<s>
The	O
minimum	O
interval	O
before	O
the	O
next	O
packet	B-Protocol
can	O
conform	O
is	O
then	O
the	O
time	O
it	O
takes	O
for	O
the	O
bucket	B-Device
to	O
leak	O
exactly	O
the	O
amount	O
of	O
water	O
delivered	O
by	O
a	O
packet	B-Protocol
,	O
and	O
if	O
a	O
packet	B-Protocol
is	O
tested	O
and	O
conforms	O
at	O
that	O
time	O
,	O
this	O
will	O
exactly	O
fill	O
the	O
bucket	B-Device
once	O
more	O
.	O
</s>
<s>
Thus	O
,	O
once	O
the	O
bucket	B-Device
is	O
filled	O
,	O
the	O
maximum	O
rate	O
that	O
packets	B-Protocol
can	O
conform	O
is	O
with	O
this	O
interval	O
between	O
each	O
packet	B-Protocol
.	O
</s>
<s>
Since	O
packets	B-Protocol
can	O
arrive	O
at	O
any	O
lower	O
rate	O
,	O
this	O
is	O
an	O
upper	O
bound	O
,	O
rather	O
than	O
a	O
fixed	O
value	O
,	O
so	O
it	O
could	O
at	O
best	O
be	O
called	O
the	O
maximum	O
for	O
the	O
average	O
rate	O
.	O
</s>
<s>
Also	O
,	O
during	O
the	O
time	O
the	O
maximum	O
burstiness	O
occurs	O
,	O
packets	B-Protocol
can	O
arrive	O
at	O
smaller	O
intervals	O
and	O
thus	O
at	O
a	O
higher	O
rate	O
than	O
this	O
.	O
</s>
<s>
For	O
variable-length	O
packets	B-Protocol
,	O
where	O
the	O
amount	O
added	O
to	O
the	O
bucket	B-Device
is	O
proportional	O
to	O
the	O
packet	B-Protocol
length	O
,	O
the	O
maximum	O
rate	O
at	O
which	O
they	O
can	O
conform	O
varies	O
according	O
to	O
their	O
length	O
:	O
the	O
amount	O
that	O
the	O
bucket	B-Device
must	O
have	O
leaked	O
from	O
full	O
for	O
a	O
packet	B-Protocol
to	O
conform	O
is	O
the	O
amount	O
the	O
packet	B-Protocol
will	O
add	O
,	O
and	O
if	O
this	O
is	O
proportional	O
to	O
the	O
packet	B-Protocol
length	O
,	O
so	O
is	O
the	O
interval	O
between	O
it	O
and	O
the	O
preceding	O
packet	B-Protocol
that	O
filled	O
the	O
bucket	B-Device
.	O
</s>
<s>
Hence	O
,	O
it	O
is	O
not	O
possible	O
to	O
specify	O
a	O
specific	O
emission	O
interval	O
for	O
variable-length	O
packets	B-Protocol
,	O
and	O
the	O
bandwidth	O
limit	O
has	O
to	O
be	O
specified	O
explicitly	O
,	O
in	O
bits	O
or	O
bytes	O
per	O
second	O
.	O
</s>
<s>
It	O
is	O
easiest	O
to	O
explain	O
what	O
this	O
tolerance	O
is	O
where	O
packets	B-Protocol
have	O
a	O
fixed	O
length	O
.	O
</s>
<s>
Hence	O
,	O
the	O
first	O
part	O
of	O
this	O
description	O
assumes	O
this	O
,	O
and	O
the	O
implications	O
of	O
variable	O
packet	B-Protocol
lengths	O
are	O
considered	O
separately	O
.	O
</s>
<s>
The	O
ITU-T	O
defines	O
a	O
limit	O
value	O
,	O
τ	O
,	O
that	O
is	O
less	O
than	O
the	O
capacity	O
of	O
the	O
bucket	B-Device
by	O
T	O
(	O
the	O
amount	O
by	O
which	O
the	O
bucket	B-Device
contents	O
is	O
incremented	O
for	O
each	O
conforming	O
cell	O
)	O
,	O
so	O
that	O
the	O
capacity	O
of	O
the	O
bucket	B-Device
is	O
T	O
+	O
τ	O
.	O
</s>
<s>
This	O
limit	O
value	O
specifies	O
how	O
much	O
earlier	O
a	O
packet	B-Protocol
can	O
arrive	O
than	O
it	O
would	O
normally	O
be	O
expected	O
if	O
the	O
packets	B-Protocol
were	O
arriving	O
with	O
exactly	O
the	O
emission	O
interval	O
between	O
them	O
.	O
</s>
<s>
Imagine	O
the	O
following	O
situation	O
:	O
A	O
bucket	B-Device
leaks	O
at	O
1	O
unit	O
of	O
water	O
per	O
second	O
,	O
so	O
the	O
limit	O
value	O
,	O
τ	O
and	O
the	O
amount	O
of	O
water	O
added	O
by	O
a	O
packet	B-Protocol
,	O
T	O
,	O
are	O
effectively	O
in	O
units	O
of	O
seconds	O
.	O
</s>
<s>
This	O
bucket	B-Device
starts	O
off	O
empty	O
,	O
so	O
when	O
a	O
packet	B-Protocol
arrives	O
at	O
the	O
bucket	B-Device
,	O
it	O
does	O
not	O
quite	O
fill	O
the	O
bucket	B-Device
by	O
adding	O
its	O
water	O
T	O
,	O
and	O
the	O
bucket	B-Device
is	O
now	O
τ	O
below	O
its	O
capacity	O
.	O
</s>
<s>
So	O
when	O
the	O
next	O
packet	B-Protocol
arrives	O
the	O
bucket	B-Device
only	O
has	O
to	O
have	O
drained	O
by	O
T	O
–	O
τ	O
for	O
this	O
to	O
conform	O
.	O
</s>
<s>
So	O
the	O
interval	O
between	O
these	O
two	O
packets	B-Protocol
can	O
be	O
as	O
much	O
as	O
τ	O
less	O
than	O
T	O
.	O
</s>
<s>
This	O
extends	O
to	O
multiple	O
packets	B-Protocol
in	O
a	O
sequence	O
:	O
Imagine	O
the	O
following	O
:	O
The	O
bucket	B-Device
again	O
starts	O
off	O
empty	O
,	O
so	O
the	O
first	O
packet	B-Protocol
to	O
arrive	O
must	O
conform	O
.	O
</s>
<s>
The	O
bucket	B-Device
then	O
becomes	O
exactly	O
full	O
after	O
a	O
number	O
of	O
conforming	O
packets	B-Protocol
,	O
N	O
,	O
have	O
arrived	O
in	O
the	O
minimum	O
possible	O
time	O
for	O
them	O
to	O
conform	O
.	O
</s>
<s>
For	O
the	O
last	O
(	O
the	O
Nth	O
)	O
packet	B-Protocol
to	O
conform	O
,	O
the	O
bucket	B-Device
must	O
have	O
leaked	O
enough	O
of	O
the	O
water	O
from	O
the	O
preceding	O
N	O
–	O
1	O
packets	B-Protocol
( ( 	O
N	O
–	O
1	O
)	O
*	O
T	O
seconds	O
 '	O
worth	O
)	O
for	O
it	O
to	O
be	O
exactly	O
at	O
the	O
limit	O
value	O
τ	O
at	O
this	O
time	O
.	O
</s>
<s>
Thus	O
the	O
shortest	O
time	O
in	O
which	O
all	O
N	O
packets	B-Protocol
can	O
arrive	O
and	O
conform	O
is	O
(	O
N	O
–	O
1	O
)	O
T	O
–	O
τ	O
seconds	O
,	O
which	O
is	O
exactly	O
τ	O
less	O
than	O
the	O
time	O
it	O
would	O
have	O
taken	O
if	O
the	O
packets	B-Protocol
had	O
been	O
arriving	O
at	O
exactly	O
the	O
emission	O
interval	O
.	O
</s>
<s>
However	O
,	O
packets	B-Protocol
can	O
only	O
arrive	O
with	O
intervals	O
less	O
than	O
T	O
where	O
the	O
bucket	B-Device
is	O
not	O
filled	O
by	O
the	O
previous	O
packet	B-Protocol
.	O
</s>
<s>
If	O
it	O
is	O
,	O
then	O
the	O
bucket	B-Device
must	O
have	O
drained	O
by	O
the	O
full	O
amount	O
T	O
before	O
the	O
next	O
packet	B-Protocol
conforms	O
.	O
</s>
<s>
So	O
once	O
this	O
tolerance	O
has	O
been	O
used	O
up	O
by	O
packets	B-Protocol
arriving	O
at	O
less	O
than	O
T	O
,	O
subsequent	O
frames	O
must	O
arrive	O
at	O
intervals	O
no	O
less	O
than	O
T	O
.	O
They	O
may	O
,	O
however	O
,	O
arrive	O
at	O
greater	O
intervals	O
,	O
when	O
the	O
bucket	B-Device
will	O
not	O
be	O
filled	O
by	O
them	O
.	O
</s>
<s>
When	O
this	O
has	O
happened	O
,	O
packets	B-Protocol
may	O
,	O
again	O
,	O
arrive	O
with	O
intervals	O
less	O
than	O
T	O
until	O
the	O
tolerance	O
is	O
again	O
used	O
up	O
.	O
</s>
<s>
However	O
,	O
since	O
the	O
bucket	B-Device
stops	O
leaking	O
when	O
it	O
is	O
empty	O
,	O
there	O
is	O
always	O
a	O
limit	O
( τ	O
)	O
to	O
how	O
much	O
tolerance	O
can	O
be	O
accrued	O
by	O
these	O
intervals	O
greater	O
than	O
T	O
,	O
however	O
,	O
much	O
greater	O
than	O
T	O
they	O
may	O
be	O
or	O
,	O
however	O
,	O
many	O
of	O
them	O
there	O
are	O
.	O
</s>
<s>
Since	O
the	O
limit	O
value	O
τ	O
defines	O
how	O
much	O
earlier	O
a	O
packet	B-Protocol
can	O
arrive	O
than	O
would	O
be	O
expected	O
,	O
it	O
is	O
the	O
limit	O
on	O
the	O
difference	O
between	O
the	O
maximum	O
and	O
minimum	O
delays	O
from	O
the	O
source	O
to	O
the	O
point	O
where	O
the	O
conformance	O
test	O
is	O
being	O
made	O
(	O
assuming	O
the	O
packets	B-Protocol
are	O
generated	O
with	O
no	O
jitter	O
)	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
a	O
possible	O
source	O
of	O
delay	O
variation	O
is	O
where	O
a	O
number	O
of	O
connections	O
(	O
streams	O
of	O
packets	B-Protocol
)	O
are	O
multiplexed	O
together	O
at	O
the	O
output	O
of	O
a	O
switch	O
.	O
</s>
<s>
Assuming	O
that	O
the	O
sum	O
of	O
the	O
bandwidths	O
of	O
these	O
connections	O
is	O
less	O
than	O
that	O
of	O
the	O
output	O
,	O
all	O
of	O
the	O
packets	B-Protocol
that	O
arrive	O
can	O
be	O
transmitted	O
,	O
eventually	O
.	O
</s>
<s>
Since	O
the	O
output	O
can	O
only	O
transmit	O
one	O
packet	B-Protocol
at	O
a	O
time	O
,	O
the	O
others	O
must	O
be	O
queued	O
in	O
a	O
buffer	O
until	O
it	O
is	O
their	O
turn	O
to	O
be	O
transmitted	O
.	O
</s>
<s>
This	O
buffer	O
then	O
introduces	O
an	O
additional	O
delay	O
between	O
a	O
packet	B-Protocol
arriving	O
at	O
an	O
input	O
and	O
being	O
transmitted	O
by	O
the	O
output	O
,	O
and	O
this	O
delay	O
varies	O
,	O
depending	O
on	O
how	O
many	O
other	O
packets	B-Protocol
are	O
already	O
queued	O
in	O
the	O
buffer	O
.	O
</s>
<s>
A	O
similar	O
situation	O
can	O
occur	O
at	O
the	O
output	O
of	O
a	O
host	O
(	O
in	O
the	O
NIC	O
)	O
when	O
multiple	O
packets	B-Protocol
have	O
the	O
same	O
or	O
similar	O
release	O
times	O
,	O
and	O
this	O
delay	O
can	O
usually	O
be	O
modelled	O
as	O
a	O
delay	O
in	O
a	O
virtual	O
output	O
buffer	O
.	O
</s>
<s>
For	O
variable	O
length	O
packets	B-Protocol
,	O
where	O
the	O
amount	O
of	O
water	O
added	O
by	O
a	O
given	O
packet	B-Protocol
is	O
proportional	O
to	O
its	O
length	O
,	O
τ	O
ca	O
n't	O
be	O
seen	O
as	O
a	O
limit	O
on	O
how	O
full	O
the	O
bucket	B-Device
can	O
be	O
when	O
a	O
packet	B-Protocol
arrives	O
,	O
as	O
this	O
varies	O
depending	O
on	O
the	O
packet	B-Protocol
size	O
.	O
</s>
<s>
However	O
,	O
the	O
time	O
it	O
takes	O
to	O
drain	O
from	O
this	O
level	O
to	O
empty	O
is	O
still	O
how	O
much	O
earlier	O
a	O
packet	B-Protocol
can	O
arrive	O
than	O
is	O
expected	O
,	O
when	O
packets	B-Protocol
are	O
transmitted	O
at	O
the	O
bandwidth	O
limit	O
.	O
</s>
<s>
The	O
limit	O
value	O
or	O
delay	O
variation	O
tolerance	O
also	O
controls	O
how	O
many	O
packets	B-Protocol
can	O
arrive	O
in	O
a	O
burst	O
,	O
determined	O
by	O
the	O
excess	O
depth	O
of	O
the	O
bucket	B-Device
over	O
the	O
capacity	O
required	O
for	O
a	O
single	O
packet	B-Protocol
.	O
</s>
<s>
A	O
burst	O
or	O
clump	O
of	O
packets	B-Protocol
can	O
arrive	O
at	O
a	O
higher	O
rate	O
than	O
determined	O
by	O
the	O
emission	O
interval	O
T	O
.	O
This	O
may	O
be	O
the	O
line	O
rate	O
of	O
the	O
physical	O
layer	O
connection	O
when	O
the	O
packets	B-Protocol
in	O
the	O
burst	O
will	O
arrive	O
back-to-back	O
.	O
</s>
<s>
However	O
,	O
as	O
in	O
ATM	O
,	O
the	O
tolerance	O
may	O
be	O
applied	O
to	O
a	O
lower	O
rate	O
,	O
in	O
that	O
case	O
the	O
Sustainable	O
Cell	O
Rate	O
(	O
SCR	O
)	O
,	O
and	O
the	O
burst	O
of	O
packets	B-Protocol
(	O
cells	O
)	O
can	O
arrive	O
at	O
a	O
higher	O
rate	O
,	O
but	O
less	O
than	O
the	O
line	O
rate	O
of	O
the	O
physical	O
layer	O
,	O
in	O
that	O
case	O
,	O
the	O
Peak	O
Cell	O
Rate	O
(	O
PCR	O
)	O
.	O
</s>
<s>
The	O
MBS	O
may	O
then	O
be	O
the	O
number	O
of	O
cells	O
needed	O
to	O
transport	O
a	O
higher	O
layer	O
packet	B-Protocol
(	O
see	O
segmentation	B-Protocol
and	I-Protocol
reassembly	I-Protocol
)	O
,	O
where	O
the	O
packets	B-Protocol
are	O
transmitted	O
with	O
a	O
maximum	O
bandwidth	O
determined	O
by	O
the	O
SCR	O
and	O
cells	O
within	O
the	O
packets	B-Protocol
are	O
transmitted	O
at	O
the	O
PCR	O
;	O
thus	O
allowing	O
the	O
last	O
cell	O
of	O
the	O
packet	B-Protocol
,	O
and	O
the	O
packet	B-Protocol
itself	O
,	O
to	O
arrive	O
significantly	O
earlier	O
than	O
it	O
would	O
if	O
the	O
cells	O
were	O
sent	O
at	O
the	O
SCR	O
:	O
transmission	O
duration	O
=	O
(	O
MBS-1	O
)	O
/PCR	O
rather	O
than	O
(	O
MBS-1	O
)	O
/SCR	O
.	O
</s>
<s>
If	O
the	O
limit	O
value	O
is	O
large	O
enough	O
,	O
then	O
several	O
packets	B-Protocol
can	O
arrive	O
in	O
a	O
burst	O
and	O
still	O
conform	O
:	O
if	O
the	O
bucket	B-Device
starts	O
from	O
empty	O
,	O
the	O
first	O
packet	B-Protocol
to	O
arrive	O
will	O
add	O
T	O
,	O
but	O
if	O
,	O
by	O
the	O
time	O
the	O
next	O
packet	B-Protocol
arrives	O
,	O
the	O
contents	O
is	O
below	O
τ	O
,	O
this	O
will	O
also	O
conform	O
.	O
</s>
<s>
Assuming	O
that	O
each	O
packet	B-Protocol
takes	O
δ	O
to	O
arrive	O
,	O
then	O
if	O
τ	O
(	O
expressed	O
as	O
the	O
time	O
it	O
takes	O
the	O
bucket	B-Device
to	O
empty	O
from	O
the	O
limit	O
value	O
)	O
is	O
equal	O
to	O
or	O
greater	O
than	O
the	O
emission	O
interval	O
less	O
the	O
minimum	O
interarrival	O
time	O
,	O
T	O
–	O
δ	O
,	O
the	O
second	O
packet	B-Protocol
will	O
conform	O
even	O
if	O
it	O
arrives	O
as	O
a	O
burst	O
with	O
the	O
first	O
.	O
</s>
<s>
Similarly	O
,	O
if	O
τ	O
is	O
equal	O
to	O
or	O
greater	O
than	O
(	O
T	O
–	O
δ	O
)	O
×	O
2	O
,	O
then	O
3	O
packets	B-Protocol
can	O
arrive	O
in	O
a	O
burst	O
,	O
etc	O
.	O
</s>
<s>
The	O
maximum	O
size	O
of	O
this	O
burst	O
,	O
M	O
,	O
can	O
be	O
calculated	O
from	O
the	O
emission	O
interval	O
,	O
T	O
;	O
the	O
maximum	O
jitter	O
tolerance	O
,	O
τ	O
;	O
and	O
the	O
time	O
taken	O
to	O
transmit/receive	O
a	O
packet	B-Protocol
,	O
δ	O
,	O
as	O
follows	O
:	O
</s>
<s>
In	O
the	O
case	O
of	O
ATM	O
,	O
where	O
technically	O
MBS	O
only	O
relates	O
to	O
the	O
SCR	O
tolerance	O
,	O
in	O
the	O
above	O
equation	O
the	O
time	O
it	O
takes	O
each	O
packet	B-Protocol
to	O
arrive	O
,	O
δ	O
,	O
is	O
the	O
emission	O
interval	O
for	O
cells	O
at	O
the	O
PCR	O
TPCR	O
,	O
and	O
the	O
emission	O
interval	O
,	O
T	O
,	O
is	O
the	O
emission	O
interval	O
for	O
the	O
SCR	O
TSCR	O
.	O
</s>
<s>
Where	O
MBS	O
is	O
to	O
be	O
the	O
number	O
of	O
cells	O
required	O
to	O
transport	O
a	O
segmented	O
packet	B-Protocol
,	O
the	O
limit	O
value	O
in	O
the	O
above	O
,	O
τ	O
,	O
should	O
be	O
that	O
for	O
the	O
SCR	O
τSCR	O
.	O
</s>
<s>
For	O
variable	O
length	O
packets	B-Protocol
,	O
the	O
maximum	O
burst	O
size	O
will	O
depend	O
on	O
the	O
lengths	O
of	O
the	O
packets	B-Protocol
in	O
the	O
burst	O
and	O
there	O
is	O
no	O
single	O
value	O
for	O
the	O
maximum	O
burst	O
size	O
.	O
</s>
<s>
However	O
,	O
it	O
is	O
possible	O
to	O
specify	O
the	O
total	O
burst	O
length	O
in	O
bytes	O
,	O
from	O
the	O
byte	O
rate	O
of	O
the	O
input	O
stream	O
,	O
the	O
equivalent	O
byte	O
rate	O
of	O
the	O
leak	O
,	O
and	O
the	O
bucket	B-Device
depth	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
is	O
sometimes	O
contrasted	O
with	O
the	O
token	B-Algorithm
bucket	I-Algorithm
algorithm	O
.	O
</s>
<s>
However	O
,	O
the	O
above	O
concept	O
of	O
operation	O
for	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
may	O
be	O
directly	O
compared	O
with	O
the	O
token	B-Algorithm
bucket	I-Algorithm
algorithm	O
,	O
the	O
description	O
of	O
which	O
is	O
given	O
in	O
that	O
article	O
as	O
the	O
following	O
:	O
</s>
<s>
A	O
token	O
is	O
added	O
to	O
the	O
bucket	B-Device
every	O
1/r	O
seconds	O
.	O
</s>
<s>
The	O
bucket	B-Device
can	O
hold	O
at	O
the	O
most	O
b	O
tokens	O
.	O
</s>
<s>
If	O
a	O
token	O
arrives	O
when	O
the	O
bucket	B-Device
is	O
full	O
,	O
it	O
is	O
discarded	O
.	O
</s>
<s>
When	O
a	O
packet	B-Protocol
(	O
network	B-Application
layer	I-Application
PDU	B-Protocol
)	O
of	O
"	O
n	O
"	O
bytes	O
arrives	O
,	O
n	O
tokens	O
are	O
removed	O
from	O
the	O
bucket	B-Device
,	O
and	O
the	O
packet	B-Protocol
is	O
sent	O
to	O
the	O
network	O
.	O
</s>
<s>
If	O
fewer	O
than	O
n	O
tokens	O
are	O
available	O
,	O
no	O
tokens	O
are	O
removed	O
from	O
the	O
bucket	B-Device
,	O
and	O
the	O
packet	B-Protocol
is	O
considered	O
to	O
be	O
non-conformant	O
.	O
</s>
<s>
A	O
fixed	O
capacity	O
bucket	B-Device
,	O
associated	O
with	O
each	O
virtual	O
connection	O
or	O
user	O
,	O
leaks	O
at	O
a	O
fixed	O
rate	O
.	O
</s>
<s>
If	O
the	O
bucket	B-Device
is	O
empty	O
,	O
it	O
stops	O
leaking	O
.	O
</s>
<s>
For	O
a	O
packet	B-Protocol
to	O
conform	O
,	O
it	O
has	O
to	O
be	O
possible	O
to	O
add	O
a	O
specific	O
amount	O
of	O
water	O
to	O
the	O
bucket	B-Device
:	O
The	O
specific	O
amount	O
added	O
by	O
a	O
conforming	O
packet	B-Protocol
can	O
be	O
the	O
same	O
for	O
all	O
packets	B-Protocol
,	O
or	O
can	O
be	O
proportional	O
to	O
the	O
length	O
of	O
the	O
packet	B-Protocol
.	O
</s>
<s>
If	O
this	O
amount	O
of	O
water	O
would	O
cause	O
the	O
bucket	B-Device
to	O
exceed	O
its	O
capacity	O
then	O
the	O
packet	B-Protocol
does	O
not	O
conform	O
and	O
the	O
water	O
in	O
the	O
bucket	B-Device
is	O
left	O
unchanged	O
.	O
</s>
<s>
As	O
can	O
be	O
seen	O
,	O
these	O
two	O
descriptions	O
are	O
essentially	O
mirror	O
images	O
of	O
one	O
another	O
:	O
one	O
adds	O
something	O
to	O
the	O
bucket	B-Device
on	O
a	O
regular	O
basis	O
and	O
takes	O
something	O
away	O
for	O
conforming	O
packets	B-Protocol
down	O
to	O
a	O
limit	O
of	O
zero	O
;	O
the	O
other	O
takes	O
away	O
regularly	O
and	O
adds	O
for	O
conforming	O
packets	B-Protocol
up	O
to	O
a	O
limit	O
of	O
the	O
bucket	B-Device
's	O
capacity	O
.	O
</s>
<s>
So	O
,	O
is	O
an	O
implementation	O
that	O
adds	O
tokens	O
for	O
a	O
conforming	O
packet	B-Protocol
and	O
removes	O
them	O
at	O
a	O
fixed	O
rate	O
an	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
or	O
of	O
the	O
token	B-Algorithm
bucket	I-Algorithm
?	O
</s>
<s>
Similarly	O
,	O
which	O
algorithm	O
is	O
used	O
in	O
an	O
implementation	O
that	O
removes	O
water	O
for	O
a	O
conforming	O
packet	B-Protocol
and	O
adds	O
water	O
at	O
a	O
fixed	O
rate	O
?	O
</s>
<s>
implementations	O
of	O
both	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
and	O
token	B-Algorithm
bucket	I-Algorithm
,	O
as	O
these	O
are	O
the	O
same	O
basic	O
algorithm	O
described	O
differently	O
.	O
</s>
<s>
This	O
explains	O
why	O
,	O
given	O
equivalent	O
parameters	O
,	O
the	O
two	O
algorithms	O
will	O
see	O
exactly	O
the	O
same	O
packets	B-Protocol
as	O
conforming	O
or	O
nonconforming	O
.	O
</s>
<s>
The	O
differences	O
in	O
the	O
properties	O
and	O
performance	O
of	O
implementations	O
of	O
the	O
leaky	O
and	O
token	B-Algorithm
bucket	I-Algorithm
algorithms	O
thus	O
result	O
entirely	O
from	O
the	O
differences	O
in	O
the	O
implementations	O
,	O
i.e.	O
</s>
<s>
The	O
points	O
to	O
note	O
are	O
that	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
,	O
when	O
used	O
as	O
a	O
meter	O
,	O
can	O
allow	O
a	O
conforming	O
output	O
packet	B-Protocol
stream	O
with	O
jitter	O
or	O
burstiness	O
,	O
can	O
be	O
used	O
in	O
traffic	B-Protocol
policing	O
as	O
well	O
as	O
shaping	O
,	O
and	O
can	O
be	O
implemented	O
for	O
variable-length	O
packets	B-Protocol
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
is	O
essentially	O
a	O
way	O
of	O
describing	O
a	O
simple	O
FIFO	B-Operating_System
buffer	O
or	O
queue	O
that	O
is	O
serviced	O
at	O
a	O
fixed	O
rate	O
to	O
remove	O
burstiness	O
or	O
jitter	O
.	O
</s>
<s>
A	O
description	O
of	O
it	O
is	O
given	O
by	O
Andrew	O
S	O
.	O
Tanenbaum	O
,	O
in	O
(	O
an	O
older	O
version	O
of	O
)	O
his	O
book	O
Computer	O
Networks	O
as	O
"	O
The	O
leaky	B-Algorithm
bucket	I-Algorithm
consists	O
of	O
a	O
finite	O
queue	O
.	O
</s>
<s>
When	O
a	O
packet	B-Protocol
arrives	O
,	O
if	O
there	O
is	O
room	O
on	O
the	O
queue	O
it	O
is	O
appended	O
to	O
the	O
queue	O
;	O
otherwise	O
it	O
is	O
discarded	O
.	O
</s>
<s>
At	O
every	O
clock	O
tick	O
one	O
packet	B-Protocol
is	O
transmitted	O
(	O
unless	O
the	O
queue	O
is	O
empty	O
)	O
"	O
.	O
</s>
<s>
An	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
is	O
therefore	O
always	O
a	O
form	O
of	O
traffic	B-Protocol
shaping	O
function	O
.	O
</s>
<s>
As	O
can	O
be	O
seen	O
this	O
implementation	O
is	O
restricted	O
in	O
that	O
the	O
packets	B-Protocol
are	O
only	O
ever	O
transmitted	O
at	O
a	O
fixed	O
rate	O
.	O
</s>
<s>
To	O
underline	O
this	O
,	O
Tanenbaum	O
also	O
states	O
that	O
"	O
The	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
enforces	O
a	O
rigid	O
output	O
pattern	O
at	O
the	O
average	O
rate	O
,	O
no	O
matter	O
how	O
bursty	O
the	O
 [ input ] 	O
traffic	B-Protocol
is	O
"	O
.	O
</s>
<s>
A	O
further	O
restriction	O
is	O
that	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
traffic	B-Protocol
shaping	O
function	O
only	O
transmits	O
packets	B-Protocol
on	O
the	O
ticks	O
;	O
hence	O
,	O
if	O
it	O
is	O
used	O
within	O
a	O
network	O
,	O
equivalent	O
to	O
UPC	B-Protocol
and	I-Protocol
NPC	I-Protocol
,	O
it	O
also	O
imposes	O
a	O
fixed	O
phase	O
on	O
the	O
onward	O
transmission	O
of	O
packets	B-Protocol
.	O
</s>
<s>
Whereas	O
,	O
when	O
using	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
meter	O
to	O
control	O
onward	O
transmission	O
,	O
a	O
packet	B-Protocol
is	O
transmitted	O
as	O
soon	O
as	O
it	O
conforms	O
,	O
i.e.	O
</s>
<s>
Perversely	O
,	O
in	O
the	O
context	O
of	O
the	O
transfer	O
delay	O
,	O
this	O
imposition	O
of	O
a	O
fixed	O
phase	O
that	O
may	O
,	O
over	O
time	O
,	O
differ	O
from	O
that	O
of	O
an	O
otherwise	O
conforming	O
input	O
packet	B-Protocol
stream	O
,	O
constitutes	O
a	O
delay	O
variation	O
and	O
hence	O
a	O
jitter	O
.	O
</s>
<s>
Jitter	O
caused	O
in	O
this	O
particular	O
way	O
could	O
only	O
be	O
observed	O
where	O
the	O
delay	O
is	O
measured	O
as	O
the	O
transit	O
time	O
between	O
two	O
separate	O
measurement	O
points	O
,	O
one	O
either	O
side	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
shaping	O
function	O
.	O
</s>
<s>
Hence	O
,	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
is	O
unsuitable	O
for	O
traffic	B-Protocol
shaping	O
real-time	O
transmissions	O
.	O
</s>
<s>
Limiting	O
variable	O
length	O
packets	B-Protocol
using	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
queue	O
is	O
significantly	O
more	O
complicated	O
than	O
it	O
is	O
for	O
fixed-length	O
packets	B-Protocol
.	O
</s>
<s>
Tanenbaum	O
gives	O
a	O
description	O
of	O
a	O
"	O
byte-counting	O
"	O
leaky	B-Algorithm
bucket	I-Algorithm
for	O
variable	O
length	O
packets	B-Protocol
as	O
follows	O
:	O
"	O
At	O
each	O
tick	O
,	O
a	O
counter	O
is	O
initialized	O
to	O
n	O
.	O
If	O
the	O
first	O
packet	B-Protocol
on	O
the	O
queue	O
has	O
fewer	O
bytes	O
than	O
the	O
current	O
value	O
of	O
the	O
counter	O
,	O
it	O
is	O
transmitted	O
,	O
and	O
the	O
counter	O
is	O
decremented	O
by	O
that	O
number	O
of	O
bytes	O
.	O
</s>
<s>
Additional	O
packets	B-Protocol
may	O
also	O
be	O
sent	O
,	O
as	O
long	O
as	O
the	O
counter	O
is	O
high	O
enough	O
.	O
</s>
<s>
When	O
the	O
counter	O
drops	O
below	O
the	O
length	O
of	O
the	O
next	O
packet	B-Protocol
on	O
the	O
queue	O
,	O
transmission	O
stops	O
until	O
the	O
next	O
tick	O
,	O
at	O
which	O
time	O
the	O
residual	O
byte	O
count	O
is	O
reset	O
[	O
to	O
n ]	O
and	O
the	O
flow	O
can	O
continue	O
"	O
.	O
</s>
<s>
As	O
with	O
the	O
version	O
for	O
fixed	O
length	O
packets	B-Protocol
,	O
this	O
implementation	O
has	O
a	O
strong	O
effect	O
on	O
the	O
phase	O
of	O
transmissions	O
,	O
resulting	O
in	O
variable	O
end-to-end	O
delays	O
,	O
and	O
unsuitability	O
for	O
real-time	O
traffic	B-Protocol
shaping	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
can	O
only	O
be	O
used	O
in	O
shaping	O
traffic	B-Protocol
to	O
a	O
specified	O
bandwidth	O
with	O
no	O
jitter	O
in	O
the	O
output	O
.	O
</s>
<s>
as	O
part	O
of	O
bandwidth	O
management	O
,	O
but	O
is	O
more	O
appropriate	O
to	O
traffic	B-Protocol
shaping	O
in	O
the	O
network	O
interfaces	O
of	O
hosts	B-Device
.	O
</s>
<s>
Leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
is	O
used	O
in	O
Nginx	B-Operating_System
's	I-Operating_System
ngx_http_limit_conn_module	O
module	O
for	O
limiting	O
the	O
number	O
of	O
concurrent	O
connections	O
originating	O
from	O
a	O
single	O
IP	B-Protocol
address	I-Protocol
.	O
</s>
<s>
In	O
the	O
case	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
as	O
a	O
queue	O
,	O
the	O
only	O
defined	O
limit	O
for	O
this	O
algorithm	O
is	O
the	O
bandwidth	O
of	O
its	O
output	O
.	O
</s>
<s>
The	O
bandwidth	O
limit	O
for	O
the	O
connection	O
may	O
be	O
specified	O
in	O
a	O
traffic	B-Protocol
contract	O
.	O
</s>
<s>
A	O
bandwidth	O
limit	O
may	O
be	O
specified	O
as	O
a	O
packet	B-Protocol
or	O
frame	O
rate	O
,	O
a	O
byte	O
or	O
bit	O
rate	O
,	O
or	O
as	O
an	O
emission	O
interval	O
between	O
the	O
packets	B-Protocol
.	O
</s>
<s>
The	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
does	O
not	O
use	O
available	O
network	O
resources	O
efficiently	O
.	O
</s>
<s>
Because	O
it	O
transmits	O
packets	B-Protocol
only	O
at	O
fixed	O
intervals	O
,	O
there	O
will	O
be	O
many	O
instances	O
when	O
the	O
traffic	B-Protocol
volume	O
is	O
very	O
low	O
and	O
large	O
portions	O
of	O
network	O
resources	O
(	O
bandwidth	O
in	O
particular	O
)	O
are	O
not	O
being	O
used	O
.	O
</s>
<s>
Therefore	O
no	O
mechanism	O
exists	O
in	O
the	O
leaky-bucket	O
implementation	O
as	O
a	O
queue	O
to	O
allow	O
individual	O
flows	O
to	O
burst	O
up	O
to	O
port	O
speed	O
,	O
effectively	O
consuming	O
network	O
resources	O
at	O
times	O
when	O
there	O
would	O
not	O
be	O
resource	O
contention	O
in	O
the	O
network	O
.	O
</s>
<s>
Implementations	O
of	O
the	O
token	B-Algorithm
bucket	I-Algorithm
and	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
do	O
,	O
however	O
,	O
allow	O
output	O
traffic	B-Protocol
flows	O
to	O
have	O
bursty	O
characteristics	O
.	O
</s>
<s>
Analysis	O
of	O
the	O
two	O
versions	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
shows	O
that	O
the	O
version	O
as	O
a	O
queue	O
is	O
a	O
special	O
case	O
of	O
the	O
version	O
as	O
a	O
meter	O
.	O
</s>
<s>
Imagine	O
a	O
traffic	B-Protocol
shaping	O
function	O
for	O
fixed-length	O
packets	B-Protocol
that	O
is	O
implemented	O
using	O
a	O
fixed-length	O
queue	O
,	O
forming	O
a	O
delay	O
element	O
,	O
which	O
is	O
serviced	O
using	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
.	O
</s>
<s>
Imagine	O
also	O
that	O
the	O
bucket	B-Device
in	O
this	O
meter	O
has	O
a	O
depth	O
equal	O
to	O
the	O
amount	O
added	O
by	O
a	O
packet	B-Protocol
,	O
i.e.	O
</s>
<s>
However	O
,	O
the	O
conformance	O
test	O
is	O
only	O
performed	O
at	O
intervals	O
of	O
the	O
emission	O
interval	O
,	O
when	O
the	O
packet	B-Protocol
at	O
the	O
head	O
of	O
the	O
queue	O
is	O
transmitted	O
and	O
its	O
water	O
is	O
added	O
.	O
</s>
<s>
This	O
water	O
then	O
leaks	O
away	O
during	O
the	O
next	O
emission	O
interval	O
(	O
or	O
is	O
removed	O
just	O
prior	O
to	O
performing	O
the	O
next	O
conformance	O
test	O
)	O
,	O
allowing	O
the	O
next	O
packet	B-Protocol
to	O
conform	O
then	O
or	O
at	O
some	O
subsequent	O
emission	O
interval	O
.	O
</s>
<s>
The	O
service	O
function	O
can	O
also	O
be	O
viewed	O
in	O
terms	O
of	O
a	O
token	B-Algorithm
bucket	I-Algorithm
with	O
the	O
same	O
depth	O
,	O
where	O
enough	O
tokens	O
for	O
one	O
packet	B-Protocol
are	O
added	O
(	O
if	O
the	O
bucket	B-Device
is	O
not	O
full	O
)	O
at	O
the	O
emission	O
intervals	O
.	O
</s>
<s>
This	O
implementation	O
will	O
then	O
receive	O
packets	B-Protocol
with	O
a	O
bursty	O
arrival	O
pattern	O
(	O
limited	O
by	O
the	O
queue	O
depth	O
)	O
and	O
transmit	O
them	O
on	O
at	O
intervals	O
that	O
are	O
always	O
exact	O
(	O
integral	O
)	O
multiples	O
of	O
the	O
emission	O
interval	O
.	O
</s>
<s>
However	O
,	O
the	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
(	O
or	O
token	B-Algorithm
bucket	I-Algorithm
)	O
in	O
a	O
traffic	B-Protocol
shaping	O
function	O
described	O
above	O
is	O
an	O
exact	O
equivalent	O
to	O
the	O
description	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
:	O
the	O
delay	O
element	O
of	O
the	O
meter	O
version	O
is	O
the	O
bucket	B-Device
of	O
the	O
queue	O
version	O
;	O
the	O
bucket	B-Device
of	O
the	O
meter	O
version	O
is	O
the	O
process	O
that	O
services	O
the	O
queue	O
,	O
and	O
the	O
leak	O
is	O
such	O
that	O
the	O
emission	O
interval	O
is	O
the	O
same	O
as	O
the	O
tick	O
interval	O
.	O
</s>
<s>
Therefore	O
for	O
fixed	O
length	O
packets	B-Protocol
,	O
the	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
is	O
of	O
a	O
special	O
case	O
of	O
a	O
traffic	B-Protocol
shaping	O
function	O
using	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
(	O
or	O
token	B-Algorithm
bucket	I-Algorithm
)	O
as	O
a	O
meter	O
in	O
which	O
the	O
limit	O
value	O
,	O
τ	O
,	O
is	O
zero	O
and	O
the	O
process	O
of	O
testing	O
conformance	O
is	O
performed	O
at	O
the	O
lowest	O
possible	O
rate	O
.	O
</s>
<s>
The	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
for	O
variable	O
packet	B-Protocol
lengths	O
can	O
also	O
be	O
described	O
as	O
equivalent	O
to	O
a	O
special	O
case	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
.	O
</s>
<s>
The	O
suggested	O
implementation	O
can	O
,	O
like	O
the	O
fixed	O
length	O
implementation	O
,	O
be	O
seen	O
as	O
traffic	B-Protocol
shaping	O
function	O
in	O
which	O
the	O
queue	O
is	O
a	O
delay	O
element	O
,	O
rather	O
than	O
the	O
bucket	B-Device
,	O
and	O
the	O
function	O
that	O
services	O
the	O
queue	O
is	O
,	O
in	O
this	O
case	O
,	O
explicitly	O
given	O
as	O
a	O
token	B-Algorithm
bucket	I-Algorithm
:	O
it	O
is	O
decremented	O
for	O
conforming	O
packets	B-Protocol
and	O
incremented	O
at	O
a	O
fixed	O
rate	O
.	O
</s>
<s>
Hence	O
,	O
as	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
and	O
token	B-Algorithm
bucket	I-Algorithm
are	O
equivalent	O
,	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
for	O
variable	O
packet	B-Protocol
lengths	O
is	O
also	O
a	O
special	O
case	O
of	O
a	O
traffic	B-Protocol
shaping	O
function	O
using	O
a	O
leaky	B-Algorithm
bucket	I-Algorithm
(	O
or	O
token	B-Algorithm
bucket	I-Algorithm
)	O
as	O
a	O
meter	O
.	O
</s>
<s>
There	O
is	O
an	O
interesting	O
consequence	O
of	O
seeing	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
for	O
variable	O
packet	B-Protocol
lengths	O
as	O
a	O
specific	O
implementation	O
of	O
the	O
token	B-Algorithm
bucket	I-Algorithm
or	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
in	O
traffic	B-Protocol
shaping	O
.	O
</s>
<s>
This	O
is	O
that	O
the	O
bucket	B-Device
of	O
the	O
meter	O
has	O
a	O
depth	O
,	O
n	O
,	O
and	O
,	O
as	O
is	O
always	O
the	O
case	O
with	O
the	O
token	B-Algorithm
bucket	I-Algorithm
,	O
this	O
depth	O
determines	O
the	O
burstiness	O
of	O
the	O
output	O
traffic	B-Protocol
(	O
perhaps	O
in	O
relation	O
to	O
the	O
average	O
or	O
minimum	O
number	O
of	O
tokens	O
required	O
by	O
the	O
packets	B-Protocol
)	O
.	O
</s>
<s>
Hence	O
,	O
it	O
is	O
possible	O
to	O
quantify	O
the	O
burstiness	O
of	O
the	O
output	O
of	O
this	O
"	O
byte	O
counting	O
"	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
,	O
unless	O
all	O
packets	B-Protocol
are	O
of	O
the	O
maximum	O
length	O
when	O
it	O
becomes	O
pointless	O
.	O
</s>
<s>
However	O
,	O
this	O
ability	O
to	O
define	O
a	O
burstiness	O
for	O
the	O
output	O
is	O
in	O
direct	O
contradiction	O
to	O
the	O
statement	O
that	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
(	O
as	O
a	O
queue	O
)	O
necessarily	O
gives	O
an	O
output	O
with	O
a	O
rigid	O
rate	O
,	O
no	O
matter	O
how	O
bursty	O
the	O
input	O
.	O
</s>
