<s>
The	O
Encoding	B-Protocol
Control	I-Protocol
Notation	I-Protocol
(	O
ECN	O
)	O
is	O
a	O
standardized	O
formal	O
language	O
that	O
is	O
part	O
of	O
the	O
Abstract	B-Protocol
Syntax	I-Protocol
Notation	I-Protocol
One	I-Protocol
(	O
ASN.1	B-Protocol
)	O
family	O
of	O
international	O
standards	O
.	O
</s>
<s>
ECN	O
is	O
designed	O
to	O
be	O
used	O
along	O
with	O
ASN.1	B-Protocol
,	O
and	O
each	O
ECN	O
specification	O
(	O
a	O
coherent	O
set	O
of	O
encoding	O
definitions	O
)	O
is	O
explicitly	O
related	O
to	O
a	O
particular	O
ASN.1	B-Protocol
specification	O
(	O
a	O
coherent	O
set	O
of	O
type	O
definitions	O
)	O
.	O
</s>
<s>
The	O
ECN	O
standard	O
is	O
published	O
by	O
both	O
the	O
ITU-T	O
and	O
the	O
ISO	O
,	O
and	O
is	O
officially	O
named	O
ITU-T	O
Recommendation	O
X.692	O
|	O
ISO/IEC	O
8825-3	O
,	O
Information	O
technology	O
–	O
ASN.1	B-Protocol
encoding	O
rules	O
:	O
Specification	O
of	O
Encoding	B-Protocol
Control	I-Protocol
Notation	I-Protocol
(	O
ECN	O
)	O
.	O
</s>
<s>
ECN	O
supports	O
the	O
formal	O
specification	O
of	O
non-standard	O
encoding	O
rules	O
for	O
ASN.1	B-Protocol
type	O
definitions	O
,	O
and	O
is	O
intended	O
to	O
be	O
used	O
whenever	O
it	O
is	O
necessary	O
to	O
use	O
encodings	O
that	O
differ	O
from	O
those	O
provided	O
by	O
standardized	O
encoding	O
rules	O
such	O
as	O
BER	O
or	O
PER	O
.	O
</s>
<s>
An	O
ASN.1	B-Protocol
type	O
has	O
a	O
set	O
of	O
abstract	O
values	O
.	O
</s>
<s>
There	O
are	O
applications	O
in	O
which	O
special	O
encodings	O
,	O
different	O
from	O
those	O
obtainable	O
through	O
any	O
of	O
the	O
standard	O
sets	O
of	O
ASN.1	B-Protocol
encoding	O
rules	O
,	O
are	O
required	O
.	O
</s>
<s>
there	O
are	O
some	O
standard	O
protocols	O
that	O
encode	O
their	O
data	O
in	O
a	O
tag-length-value	O
(	O
TLV	O
)	O
format	O
similar	O
to	O
BER	O
;	O
one	O
might	O
want	O
to	O
create	O
a	O
formal	O
ASN.1	B-Protocol
specification	O
for	O
one	O
of	O
those	O
protocols	O
and	O
specify	O
a	O
modified	O
version	O
of	O
BER	O
that	O
matches	O
the	O
ad	O
hoc	O
TLV	O
format	O
;	O
</s>
<s>
there	O
are	O
many	O
standard	O
protocols	O
that	O
encode	O
their	O
data	O
in	O
an	O
ad	O
hoc	O
binary	O
format	O
(	O
usually	O
specified	O
with	O
tables	O
)	O
,	O
which	O
may	O
differ	O
significantly	O
from	O
PER	O
or	O
any	O
other	O
set	O
of	O
ASN.1	B-Protocol
encoding	O
rules	O
;	O
one	O
might	O
want	O
to	O
create	O
a	O
formal	O
ASN.1	B-Protocol
specification	O
for	O
one	O
of	O
those	O
protocols	O
and	O
specify	O
a	O
binary	O
encoding	O
that	O
matches	O
the	O
ad	O
hoc	O
format	O
.	O
</s>
<s>
In	O
the	O
above	O
cases	O
and	O
in	O
many	O
other	O
similar	O
cases	O
,	O
the	O
combined	O
use	O
of	O
ASN.1	B-Protocol
and	O
ECN	O
makes	O
it	O
possible	O
to	O
create	O
a	O
full	O
,	O
formal	O
specification	O
of	O
both	O
abstract	O
syntax	O
(	O
schema	O
)	O
and	O
encodings	O
.	O
</s>
<s>
These	O
advantages	O
are	O
available	O
with	O
ASN.1	B-Protocol
alone	O
when	O
standardized	O
encoding	O
rules	O
suffice	O
,	O
but	O
ECN	O
provides	O
these	O
advantages	O
in	O
circumstances	O
where	O
the	O
standardized	O
encoding	O
rules	O
are	O
not	O
sufficient	O
.	O
</s>
<s>
To	O
understand	O
how	O
ECN	O
works	O
,	O
it	O
is	O
useful	O
to	O
focus	O
on	O
four	O
kinds	O
of	O
elements	O
of	O
the	O
ASN.1	B-Protocol
language	O
:	O
built-in	O
types	O
(	O
e.g.	O
,	O
INTEGER	O
and	O
UTF8String	O
)	O
,	O
built-in	O
constructor	O
keywords	O
(	O
e.g.	O
,	O
SEQUENCE	O
,	O
CHOICE	O
,	O
SEQUENCE	O
OF	O
,	O
OPTIONAL	O
)	O
,	O
user-defined	O
simple	O
types	O
(	O
e.g.	O
,	O
Age	O
::	O
=	O
INTEGER( 	O
0	O
..	O
200	O
)	O
,	O
Color	O
::	O
=	O
ENUMERATED	O
{	O
green	O
,	O
yellow	O
,	O
red	O
}	O
)	O
,	O
and	O
user-defined	O
complex	O
types	O
(	O
e.g.	O
,	O
Name	O
::	O
=	O
SEQUENCE	O
{	O
first	O
UTF8String	O
,	O
middle	O
UTF8String	O
,	O
last	O
UTF8String	O
}	O
)	O
.	O
</s>
<s>
There	O
are	O
other	O
aspects	O
of	O
ASN.1	B-Protocol
that	O
are	O
also	O
reflected	O
in	O
ECN	O
,	O
but	O
we	O
will	O
not	O
discuss	O
them	O
here	O
.	O
</s>
<s>
These	O
elements	O
of	O
the	O
ECN	O
language	O
are	O
similar	O
to	O
those	O
of	O
ASN.1	B-Protocol
,	O
but	O
their	O
names	O
always	O
begin	O
with	O
a	O
#	O
.	O
</s>
<s>
Unlike	O
ASN.1	B-Protocol
,	O
ECN	O
allows	O
the	O
user	O
of	O
the	O
language	O
to	O
define	O
synonyms	O
of	O
ECN	O
constructor	O
keywords	O
(	O
e.g.	O
,	O
#InterleavedSequence	O
::	O
=	O
#SEQUENCE	O
)	O
.	O
</s>
<s>
From	O
the	O
ECN	O
viewpoint	O
,	O
every	O
user-defined	O
ASN.1	B-Protocol
type	O
occurring	O
in	O
an	O
ASN.1	B-Protocol
specification	O
has	O
a	O
hidden	O
ECN	O
type	O
implicitly	O
associated	O
with	O
it	O
.	O
</s>
<s>
Officially	O
this	O
hidden	O
ECN	O
type	O
is	O
called	O
an	O
implicitly	O
generated	O
encoding	O
structure	O
but	O
here	O
we	O
will	O
simply	O
call	O
it	O
the	O
hidden	O
ECN	O
type	O
of	O
the	O
ASN.1	B-Protocol
type	O
.	O
</s>
<s>
Hidden	O
ECN	O
types	O
are	O
a	O
special	O
kind	O
of	O
user-defined	O
ECN	O
types	O
(	O
their	O
ECN	O
definition	O
is	O
automatically	O
generated	O
from	O
a	O
user-defined	O
ASN.1	B-Protocol
type	O
rather	O
than	O
being	O
provided	O
by	O
the	O
user	O
)	O
,	O
but	O
they	O
behave	O
like	O
other	O
user-defined	O
ECN	O
types	O
.	O
</s>
<s>
The	O
hidden	O
ECN	O
type	O
of	O
an	O
ASN.1	B-Protocol
type	O
is	O
almost	O
identical	O
to	O
the	O
original	O
ASN.1	B-Protocol
type	O
(	O
but	O
slightly	O
simplified	O
)	O
and	O
is	O
the	O
starting	O
point	O
for	O
an	O
encoding	O
process	O
,	O
specified	O
in	O
ECN	O
,	O
which	O
ultimately	O
generates	O
the	O
series	O
of	O
bits	O
representing	O
any	O
given	O
value	O
of	O
the	O
original	O
ASN.1	B-Protocol
type	O
.	O
</s>
<s>
An	O
ASN.1	B-Protocol
type	O
(	O
or	O
any	O
of	O
its	O
parts	O
)	O
is	O
not	O
directly	O
referenceable	O
for	O
the	O
purpose	O
of	O
specifying	O
an	O
encoding	O
in	O
ECN	O
,	O
but	O
its	O
hidden	O
ECN	O
type	O
is	O
.	O
</s>
<s>
This	O
process	O
can	O
go	O
on	O
through	O
any	O
number	O
of	O
cycles	O
,	O
until	O
the	O
final	O
ECN	O
type	O
has	O
been	O
completely	O
encoded	O
,	O
that	O
is	O
,	O
all	O
the	O
bits	O
representing	O
the	O
value	O
of	O
the	O
original	O
ASN.1	B-Protocol
type	O
have	O
been	O
generated	O
.	O
</s>
<s>
The	O
first	O
step	O
of	O
the	O
encoding	O
process	O
is	O
the	O
automatic	O
generation	O
of	O
hidden	O
ECN	O
types	O
from	O
all	O
ASN.1	B-Protocol
types	O
present	O
in	O
the	O
ASN.1	B-Protocol
specification	O
.	O
</s>
<s>
The	O
hidden	O
ECN	O
types	O
corresponding	O
to	O
complex	O
user-defined	O
ASN.1	B-Protocol
types	O
can	O
be	O
modified	O
by	O
a	O
mechanism	O
called	O
coloring	O
,	O
which	O
consists	O
in	O
replacing	O
the	O
names	O
of	O
the	O
types	O
of	O
some	O
of	O
their	O
components	O
with	O
synonyms	O
.	O
</s>
<s>
The	O
value	O
to	O
be	O
encoded	O
will	O
be	O
one	O
of	O
the	O
possible	O
values	O
of	O
an	O
ASN.1	B-Protocol
type	O
defined	O
in	O
the	O
ASN.1	B-Protocol
specification	O
,	O
and	O
the	O
encoding	O
process	O
will	O
select	O
the	O
hidden	O
ECN	O
type	O
of	O
that	O
ASN.1	B-Protocol
type	O
and	O
will	O
apply	O
the	O
appropriate	O
encoding	O
object	O
to	O
it	O
.	O
</s>
<s>
The	O
replacement	O
type	O
must	O
be	O
specified	O
in	O
the	O
ECN	O
specification	O
,	O
not	O
in	O
the	O
ASN.1	B-Protocol
specification	O
.	O
</s>
<s>
The	O
replacement	O
type	O
must	O
be	O
specified	O
in	O
the	O
ECN	O
specification	O
,	O
not	O
in	O
the	O
ASN.1	B-Protocol
specification	O
.	O
</s>
