The Encoding Control Notation (ECN) is a standardized formal language that is part of the Abstract Syntax Notation One (ASN.1) family of international standards. ECN is designed to be used along with ASN.1, and each ECN specification (a coherent set of encoding definitions) is explicitly related to a particular ASN.1 specification (a coherent set of type definitions).
The ECN standard is published by both the ITU-T and the ISO, and is officially named ITU-T Recommendation X.692 | ISO/IEC 8825-3, Information technology – ASN.1 encoding rules: Specification of Encoding Control Notation (ECN) .
ECN supports the formal specification of non-standard encoding rules for ASN.1 type definitions, and is intended to be used whenever it is necessary to use encodings that differ from those provided by standardized encoding rules such as BER or PER.
An ASN.1 type has a set of abstract values. Encoding rules specify the representation of these abstract values as a series of bits. There are applications in which special encodings, different from those obtainable through any of the standard sets of ASN.1 encoding rules, are required.
Here are some examples of possible situations that require some smaller or larger deviations from the standard encodings:
In the above cases and in many other similar cases, the combined use of ASN.1 and ECN makes it possible to create a full, formal specification of both abstract syntax (schema) and encodings. Encoders and decoders can then be automatically generated from the combined specifications. This is a significant factor in reducing both the amount of work and the possibility of errors in making interoperable systems. Another significant advantage of ECN is the ability to provide automatic tool support for testing. These advantages are available with ASN.1 alone when standardized encoding rules suffice, but ECN provides these advantages in circumstances where the standardized encoding rules are not sufficient.
To understand how ECN works, it is useful to focus on four kinds of elements of the ASN.1 language: built-in types (e.g., INTEGER
and UTF8String
), built-in constructor keywords (e.g., SEQUENCE
, CHOICE
, SEQUENCE OF
, OPTIONAL
), user-defined simple types (e.g., Age ::= INTEGER(0..200)
, Color ::= ENUMERATED { green, yellow, red }
), and user-defined complex types (e.g., Name ::= SEQUENCE { first UTF8String, middle UTF8String, last UTF8String }
). There are other aspects of ASN.1 that are also reflected in ECN, but we will not discuss them here.