<s>
The	O
generic	B-Algorithm
cell	I-Algorithm
rate	I-Algorithm
algorithm	I-Algorithm
(	O
GCRA	B-Algorithm
)	O
is	O
a	O
leaky	O
bucket-type	O
scheduling	O
algorithm	O
for	O
the	O
network	B-Application
scheduler	I-Application
that	O
is	O
used	O
in	O
Asynchronous	O
Transfer	O
Mode	O
(	O
ATM	O
)	O
networks	O
.	O
</s>
<s>
It	O
is	O
used	O
to	O
measure	O
the	O
timing	O
of	O
cells	O
on	O
virtual	B-Protocol
channels	I-Protocol
(	O
VCs	O
)	O
and	O
or	O
Virtual	O
Paths	O
(	O
VPs	O
)	O
against	O
bandwidth	B-Algorithm
and	O
jitter	O
limits	O
contained	O
in	O
a	O
traffic	O
contract	O
for	O
the	O
VC	O
or	O
VP	O
to	O
which	O
the	O
cells	O
belong	O
.	O
</s>
<s>
The	O
GCRA	B-Algorithm
is	O
given	O
as	O
the	O
reference	O
for	O
checking	O
the	O
traffic	O
on	O
connections	O
in	O
the	O
network	O
,	O
i.e.	O
</s>
<s>
usage/network	B-Protocol
parameter	I-Protocol
control	I-Protocol
(	O
UPC/NPC	O
)	O
at	O
user	O
–	O
network	O
interfaces	O
(	O
UNI	O
)	O
or	O
inter-network	B-Protocol
interfaces	I-Protocol
or	I-Protocol
network-network	I-Protocol
interfaces	I-Protocol
(	O
INI/NNI	O
)	O
.	O
</s>
<s>
It	O
is	O
also	O
given	O
as	O
the	O
reference	O
for	O
the	O
timing	O
of	O
cells	O
transmitted	O
(	O
ATM	O
PDU	O
Data_Requests	O
)	O
onto	O
an	O
ATM	O
network	O
by	O
a	O
network	B-Protocol
interface	I-Protocol
card	I-Protocol
(	O
NIC	O
)	O
in	O
a	O
host	O
,	O
i.e.	O
</s>
<s>
However	O
,	O
as	O
the	O
GCRA	B-Algorithm
is	O
only	O
given	O
as	O
a	O
reference	O
,	O
the	O
network	O
providers	O
and	O
users	O
may	O
use	O
any	O
other	O
algorithm	O
that	O
gives	O
the	O
same	O
result	O
.	O
</s>
<s>
The	O
GCRA	B-Algorithm
is	O
described	O
by	O
the	O
ATM	O
Forum	O
in	O
its	O
User-Network	O
Interface	O
(	O
UNI	O
)	O
and	O
by	O
the	O
ITU-T	O
in	O
recommendation	O
I.371	O
Traffic	O
control	O
and	O
congestion	O
control	O
in	O
B-ISDN	O
.	O
</s>
<s>
Both	O
sources	O
describe	O
the	O
GCRA	B-Algorithm
in	O
two	O
equivalent	O
ways	O
:	O
as	O
a	O
virtual	B-Algorithm
scheduling	I-Algorithm
algorithm	I-Algorithm
and	O
as	O
a	O
continuous	O
state	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
(	O
figure	O
1	O
)	O
.	O
</s>
<s>
The	O
description	O
in	O
terms	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
may	O
be	O
the	O
easier	O
of	O
the	O
two	O
to	O
understand	O
from	O
a	O
conceptual	O
perspective	O
,	O
as	O
it	O
is	O
based	O
on	O
a	O
simple	O
analogy	O
of	O
a	O
bucket	O
with	O
a	O
leak	O
:	O
see	O
figure	O
1	O
on	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
page	O
.	O
</s>
<s>
However	O
,	O
there	O
has	O
been	O
confusion	O
in	O
the	O
literature	O
over	O
the	O
application	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
analogy	O
to	O
produce	O
an	O
algorithm	O
,	O
which	O
has	O
crossed	O
over	O
to	O
the	O
GCRA	B-Algorithm
.	O
</s>
<s>
The	O
GCRA	B-Algorithm
should	O
be	O
considered	O
as	O
a	O
version	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
meter	O
rather	O
than	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
as	O
a	O
queue	O
.	O
</s>
<s>
However	O
,	O
while	O
there	O
are	O
possible	O
advantages	O
in	O
understanding	O
this	O
leaky	B-Algorithm
bucket	I-Algorithm
description	O
,	O
it	O
does	O
not	O
necessarily	O
result	O
in	O
the	O
best	O
(	O
fastest	O
)	O
code	O
if	O
implemented	O
directly	O
.	O
</s>
<s>
The	O
description	O
in	O
terms	O
of	O
the	O
continuous	O
state	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
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	O
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>
Considering	O
the	O
flow	O
diagram	O
of	O
the	O
continuous	O
state	O
leaky	B-Algorithm
bucket	I-Algorithm
algorithm	I-Algorithm
,	O
in	O
which	O
T	O
is	O
the	O
emission	O
interval	O
and	O
τ	O
is	O
the	O
limit	O
value	O
:	O
What	O
happens	O
when	O
a	O
cell	O
arrives	O
is	O
that	O
the	O
state	O
of	O
the	O
bucket	O
is	O
calculated	O
from	O
its	O
state	O
when	O
the	O
last	O
conforming	O
cell	O
arrived	O
,	O
X	O
,	O
and	O
how	O
much	O
has	O
leaked	O
out	O
in	O
the	O
interval	O
,	O
ta	O
–	O
LCT	O
.	O
</s>
<s>
Thus	O
the	O
flow	O
diagram	O
mimics	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
analogy	O
(	O
used	O
as	O
a	O
meter	O
)	O
directly	O
,	O
with	O
X	O
and	O
X	O
 '	O
acting	O
as	O
the	O
analogue	O
of	O
the	O
bucket	O
.	O
</s>
<s>
The	O
virtual	B-Algorithm
scheduling	I-Algorithm
algorithm	I-Algorithm
,	O
while	O
not	O
so	O
obviously	O
related	O
to	O
such	O
an	O
easily	O
accessible	O
analogy	O
as	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
,	O
gives	O
a	O
clearer	O
understanding	O
of	O
what	O
the	O
GCRA	B-Algorithm
does	O
and	O
how	O
it	O
may	O
be	O
best	O
implemented	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
direct	O
implementation	O
of	O
this	O
version	O
can	O
result	O
in	O
more	O
compact	O
,	O
and	O
thus	O
faster	O
,	O
code	O
than	O
a	O
direct	O
implementation	O
of	O
the	O
leaky	B-Algorithm
bucket	I-Algorithm
description	O
.	O
</s>
<s>
The	O
description	O
in	O
terms	O
of	O
the	O
virtual	B-Algorithm
scheduling	I-Algorithm
algorithm	I-Algorithm
is	O
given	O
by	O
the	O
ITU-T	O
as	O
follows	O
:	O
"	O
The	O
virtual	B-Algorithm
scheduling	I-Algorithm
algorithm	I-Algorithm
updates	O
a	O
Theoretical	O
Arrival	O
Time	O
(	O
TAT	O
)	O
,	O
which	O
is	O
the	O
'	O
nominal	O
 '	O
arrival	O
time	O
of	O
the	O
cell	O
assuming	O
cells	O
are	O
sent	O
equally	O
spaced	O
at	O
an	O
emission	O
interval	O
of	O
T	O
corresponding	O
to	O
the	O
cell	O
rate	O
Λ	O
[=	O
1/T	O
]	O
when	O
the	O
source	O
is	O
active	O
.	O
</s>
<s>
This	O
version	O
of	O
the	O
algorithm	O
works	O
because	O
τ	O
defines	O
how	O
much	O
earlier	O
a	O
cell	O
can	O
arrive	O
than	O
it	O
would	O
if	O
there	O
were	O
no	O
jitter	O
:	O
see	O
leaky	B-Algorithm
bucket	I-Algorithm
:	O
delay	O
variation	O
tolerance	O
.	O
</s>
<s>
The	O
GCRA	B-Algorithm
,	O
unlike	O
implementations	O
of	O
the	O
token	B-Algorithm
bucket	I-Algorithm
algorithm	O
,	O
does	O
not	O
simulate	O
the	O
process	O
of	O
updating	O
the	O
bucket	O
(	O
the	O
leak	O
or	O
adding	O
tokens	O
regularly	O
)	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
calculation	O
can	O
be	O
done	O
quickly	O
in	O
software	O
,	O
and	O
while	O
more	O
actions	O
are	O
taken	O
when	O
a	O
cell	O
arrives	O
than	O
are	O
taken	O
by	O
the	O
token	B-Algorithm
bucket	I-Algorithm
,	O
in	O
terms	O
of	O
the	O
load	O
on	O
a	O
processor	O
performing	O
the	O
task	O
,	O
the	O
lack	O
of	O
a	O
separate	O
update	O
process	O
more	O
than	O
compensates	O
for	O
this	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
GCRA	B-Algorithm
were	O
to	O
be	O
used	O
to	O
limit	O
to	O
a	O
bandwidth	B-Algorithm
,	O
rather	O
than	O
a	O
packet/frame	O
rate	O
,	O
in	O
a	O
protocol	O
with	O
variable	O
length	O
packets	O
(	O
Link	O
Layer	O
PDUs	O
)	O
,	O
it	O
would	O
involve	O
multiplication	O
:	O
basically	O
the	O
value	O
added	O
to	O
the	O
bucket	O
(	O
or	O
to	O
TAT	O
)	O
for	O
each	O
conforming	O
packet	O
would	O
have	O
to	O
be	O
proportionate	O
to	O
the	O
packet	O
length	O
:	O
whereas	O
,	O
with	O
the	O
GCRA	B-Algorithm
as	O
described	O
,	O
the	O
water	O
in	O
the	O
bucket	O
has	O
units	O
of	O
time	O
,	O
for	O
variable	O
length	O
packets	O
it	O
would	O
have	O
to	O
have	O
units	O
that	O
are	O
the	O
product	O
of	O
packet	O
length	O
and	O
time	O
.	O
</s>
<s>
Hence	O
,	O
applying	O
the	O
GCRA	B-Algorithm
to	O
limit	O
the	O
bandwidth	B-Algorithm
of	O
variable	O
length	O
packets	O
without	O
access	O
to	O
a	O
fast	O
,	O
hardware	O
multiplier	O
(	O
as	O
in	O
an	O
FPGA	B-Architecture
)	O
may	O
not	O
be	O
practical	O
.	O
</s>
<s>
Multiple	O
implementations	O
of	O
the	O
GCRA	B-Algorithm
can	O
be	O
applied	O
concurrently	O
to	O
a	O
VC	O
or	O
a	O
VP	O
,	O
in	O
a	O
dual	O
leaky	B-Algorithm
bucket	I-Algorithm
traffic	O
policing	O
or	O
traffic	O
shaping	O
function	O
,	O
e.g.	O
</s>
<s>
At	O
the	O
same	O
time	O
,	O
the	O
dual	O
leaky	B-Algorithm
bucket	I-Algorithm
traffic	O
policing	O
function	O
can	O
limit	O
the	O
rate	O
of	O
cells	O
in	O
the	O
bursts	O
to	O
a	O
Peak	O
Cell	O
Rate	O
(	O
PCR	O
)	O
and	O
a	O
maximum	O
Cell	O
Delay	O
Variation	O
tolerance	O
(	O
CDVt	O
)	O
:	O
see	O
Traffic	O
Contract	O
#Traffic	O
Parameters	O
.	O
</s>
<s>
This	O
may	O
be	O
best	O
understood	O
where	O
the	O
transmission	O
on	O
an	O
VBR	O
VC	O
is	O
in	O
the	O
form	O
of	O
fixed	O
length	O
messages	O
(	O
CPCS-PDUs	O
)	O
,	O
which	O
are	O
transmitted	O
with	O
some	O
fixed	O
interval	O
or	O
the	O
Inter	O
Message	O
Time	O
(	O
IMT	O
)	O
and	O
take	O
a	O
number	O
of	O
cells	O
,	O
MBS	O
,	O
to	O
carry	O
them	O
;	O
however	O
,	O
the	O
description	O
of	O
VBR	O
traffic	O
and	O
the	O
use	O
of	O
the	O
dual	O
leaky	B-Algorithm
bucket	I-Algorithm
are	O
not	O
restricted	O
to	O
such	O
situations	O
.	O
</s>
<s>
The	O
individual	O
messages	O
can	O
be	O
transmitted	O
at	O
a	O
PCR	O
,	O
which	O
can	O
be	O
any	O
value	O
between	O
the	O
bandwidth	B-Algorithm
for	O
the	O
physical	O
link	O
(	O
1/δ	O
)	O
and	O
the	O
SCR	O
.	O
</s>
<s>
In	O
the	O
dual	O
leaky	B-Algorithm
bucket	I-Algorithm
,	O
one	O
bucket	O
is	O
applied	O
to	O
the	O
traffic	O
with	O
an	O
emission	O
interval	O
of	O
1/SCR	O
and	O
a	O
limit	O
value	O
τSCR	O
that	O
gives	O
an	O
MBS	O
that	O
is	O
the	O
number	O
of	O
cells	O
in	O
the	O
message	O
:	O
see	O
leaky	B-Algorithm
bucket	I-Algorithm
#Maximum	O
burst	O
size	O
.	O
</s>
<s>
The	O
second	O
bucket	O
has	O
an	O
emission	O
interval	O
of	O
1/PCR	O
and	O
a	O
limit	O
value	O
τPCR	O
that	O
allows	O
for	O
the	O
CDV	O
up	O
to	O
that	O
point	O
in	O
the	O
path	O
of	O
the	O
connection	O
:	O
see	O
leaky	B-Algorithm
bucket	I-Algorithm
#Delay	O
Variation	O
Tolerance	O
.	O
</s>
<s>
If	O
the	O
cells	O
arrive	O
in	O
a	O
burst	O
at	O
a	O
rate	O
higher	O
than	O
1/PCR	O
(	O
MBS	O
cells	O
arrive	O
in	O
less	O
than	O
(	O
MBS	O
-	O
1	O
)	O
/PCR	O
-	O
τPCR	O
)	O
,	O
or	O
more	O
than	O
MBS	O
cells	O
arrive	O
at	O
the	O
PCR	O
,	O
or	O
bursts	O
of	O
MBS	O
cells	O
arrive	O
closer	O
than	O
IMT	O
apart	O
,	O
the	O
dual	O
leaky	B-Algorithm
bucket	I-Algorithm
will	O
detect	O
this	O
and	O
delay	O
(	O
shaping	O
)	O
or	O
drop	O
or	O
de-prioritize	O
(	O
policing	O
)	O
enough	O
cells	O
to	O
make	O
the	O
connection	O
conform	O
.	O
</s>
