ITU Home Page International Telecommunication Union Franšais | Espa˝ol 
Print Version 
ITU Home Page
Home : ITU-T Home : Study Groups : Study Group 17
Changing from ASN.1:1988 to ASN.1:2002
 
No Change in the bits on the wire
Differences between ASN.1:1988 and ASN.1:2002
Advantages of changing to ASN.1:2002
How to change to ASN.1:2002
Mixing ASN.1:1988 and ASN.1:2002
Free ASN.1:2002 syntax checkers
Downloadable books on ASN.1
Refer also to the important information on migration


No Change in the bits on the wire

Please note that there is no change in the "bits on the wire" when changing from using ASN.1:1988 as defined in CCITT Rec. X.208 and BER:1988 as defined in CCITT Rec. X.209 to using ASN.1:2002 as defined ITU-T Rec. X.680-X.683|ISO/IEC 8824-1,2,3,4 and BER:2002 as defined in ITU-T Rec. X.690|ISO/IEC8825-1. In fact, it is impossible for a communicating peer to determine whether ASN.1:1988 or ASN.1:2002 is being used by another communicating peer since the bits on the wire do not change.

Back to Top



Differences between ASN.1:1988 and ASN.1:2002


The main difference is that the multitude of defect reports that were issued against CCITT Rec. X.208 have been corrected in ITU-T Rec. X.680 - X.683|ISO/IEC 8824-1,2,3,4. With X.208, there were many ambiguities in the notation that made it possible to write ASN.1 modules which, when implemented, resulted in non-interoperability even though both peers were fully conformant to X.208 and X.209. The most visible manifestations of these bug fixes are the replacement of the macro notation and ANY/ANY DEFINED BY, a change in the CHOICE value notation, and the mandatory presence of identifiers in the definitions of SET, SEQUENCE and CHOICE types.

The ability to smoothly extend types in future versions of a protocol has been added by introducing the extension marker ("..." notation) for indicating where extensions are permitted to occur. Several new character string types were also introduced for better support of international languages or alphabets, including one new type CHARACTER STRING that allows the alphabet to be determined at runtime.

Compared to the 1997 edition, the 2002 edition of ASN.1 provides the following new features:

  • an XML notation that can be used to define abstract values in an ASN.1 module;
  • decimal notation (e.g., 1.5e3) for REAL values;
  • a new RELATIVE-OID type for relative object identifiers;
  • a new subtype constraint (CONTAINING/ENCODED BY) to constrain the content of an octet string or a bit string;
  • a subtype constraint by regular expressions (PATTERN) for character string types;
  • a semantic model which clearly defines the rules for type and values compatibilities;
  • multi-line comments Ó la C or Java (i.e., between /* and */);
  • the new X.692 Recommendation which provides an Encoding Control Notation (ECN) for the definition of proprietary encoding rules.

Back to Top



Advantages of changing from ASN.1:1988 to ASN.1:2002


Advantages of changing from ASN.1:1988 to ASN.1:2002 include better readability, more precision, greater flexibility and much greater ease of implementation. For example, when macros are used in ASN.1:1988 modules, you cannot determine the purpose of a macro without its author describing it to you using textual comments. With ASN.1:2002, the notation is much more precise, making the author’s description unnecessary. Indeed, the ASN.1:2002 replacement for ANY DEFINED BY (now called an open type) and macros such as OPERATION is so much better that applications can be written more quickly, simply and in significantly fewer lines of code than when ASN.1:1988 is used.

With the ASN.1:2002, it is possible for encoders and decoders to fully decode a message, including open types nested in open types nested in open types (i.e., ANY nested in ANY nested in ANY...), via a single call to the encoder or decoder, and without any custom modifications to the ASN.1 to accomplish this. Contrast this to the 1988 approach which either requires the user to repeatedly call the encoder or decoder for each level of ANY that is to be encoded or decoded, or which requires you to make custom modifications to the ASN.1 and utilize special ASN.1 tools that understand such customizations.

Back to Top



How to change ASN.1:1988 to ASN.1:2002


In a nutshell, the main changes you will need to make are:

  • Ensure that the components of SET, SEQUENCE and CHOICE all have identifiers.
  • Include a colon after the identifier in CHOICE values.
  • Change ANY and ANY DEFINED BY to use the more descriptive open type notation.
  • Change the macro notation to the information object class notation (e.g., if macro OPERATION is used) or parameterized types (e.g., if macro SIGNED is used).

      Note: Annex A (Use of ASN.1:1988/1990 notation) and Annex E (Superseded features) of the 1997 edition of X.680 were providing details on changing from ASN.1:1988 to ASN.1:1997/2002. They have not been kept in the 2002 edition, for X.208 (ASN.1:1988) has been withdrawn at the same time when the 2002 edition was published. Those annexes are provided as a separate webpage.

Back to Top



Mixing ASN.1:1988 and ASN.1:2002


Please note that you cannot mix 1988 and post-1988 ASN.1 syntax in the same ASN.1 module. You can import types and values from ASN.1:1988 modules into 1997 and vice versa as long they follow a few guidelines as explained in A.2 (of X.680:1997). For example, an ASN.1:2002 module cannot import macros, and a 1988 ASN.1 module cannot import types or values containing new types such as UTF8String.

Back to Top



Free ASN.1:2002 syntax checkers


There are two free ASN.1 syntax checkers available for your use in checking your ASN.1:2002 specifications. Please see http://www.oss.com/products/checksyntax.html and http://asn1.elibel.tm.fr/tools/asnp/.

Back to Top



Downloadable books on ASN.1


There are also two books on ASN.1 that you can download Please see http://www.oss.com/asn1/booksintro.html (English) and http://asn1.elibel.tm.fr/book/(French and English)

Back to Top


 

Top - Feedback - Contact Us - Copyright ę ITU 2007 All Rights Reserved
Contact for this page : TSB EDH
Updated : 2007-01-09