Abstract Syntax Notation One
The Abstract Syntax Notation One ( ASN.1 ; German Abstract Syntax Notation One ) is a description language for defining data structures , as well as provisions for the implementation of data structures and elements in a network standard format. It is a common standard of the ITU-T (International Telecommunication Union - Telecommunication Standardization Sector) and the ISO (International Organization for Standardization).
The standard serves the platform-independent description of data types without going into computer-internal character encodings such as UTF-8 or EBCDIC . The notation is defined in the ITU-T standards X.680ff. The associated X.690ff standards define various encoding rules for how the ASN.1 data values are encoded on the bit level. With the help of ASN.1 and a common coding rule, systems with different internal data representations can exchange messages.
ASN.1 is a common way of clearly describing the message elements of protocols of the OSI model and is used by OSI-compliant technologies such as X.500 and X.509 , but also by Internet protocols such as SNMP or LDAP . ASN.1 is also widely used in the telecommunications sector, e.g. B. in the GSM standards for billing roaming calls in TAP3 files and UMTS .
Most of the data specified in ASN.1 are encoded with the easy-to-use Basic Encoding Rules (BER) . Packed Encoding Rules (PER) are preferred in areas where space-saving coding is required (e.g. mobile radio) . There are also the injective Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER) , the latter being more widespread. The Distinguished Encoding Rules are a subset of the BER and are an encoding of ASN.1 data descriptions that is completely unique at the bit level. In the DER, in contrast to the BER, there is only one possible coding for each ASN.1 value. This makes them suitable for cases in which ASN.1 data must be digitally signed or exchanged across platforms, for example in digital certificates (see X.509 ).
Syntax and semantics
ASN.1 is described in a BNF- like representation, e.g. B .:
Record ::= SEQUENCE { kopf Header, daten Data OPTIONAL } Header ::= IA5String Data ::= SET OF INTEGER
In the next example, a module is agreed. It is also possible to find this module using an object identifier . This is done by the module name an object reference ( Object Reference appends) z. B .:
Modul-name {joint-iso-itu-t(2) example(999)} DEFINITIONS ::= BEGIN Daten-struktur ::= SEQUENCE { teil INTEGER, fragment IA5String } END
As can be seen in this example, an object reference, i.e. an ID , is created in front of the term DEFINITIONS using the curly brackets. The object reference refers to the place in a tree of references or agreements where the correct object can be found. The ID from this example refers to the first root in the first level of the reference structure. Modules in the form shown above are necessary in order to make an agreement on how data should be transferred. Data as defined in the example above are as follows transferred: { 2, "Teil2" }
.
ASN.1 knows about a.
- Elementary types, e.g. B.
- BIT STRING (binary string)
- BOOLEAN
- IA5String (character string encoded according to IA5 table, see ISO 646 )
- INTEGER
- Compound types, e.g. B.
- CHOICE ( total type)
- SEQUENCE (ordered sequence of different types)
- SEQUENCE OF <Type> (ordered sequence of the same type)
- SET (disordered sequence of different types)
- SET OF <Typ> (unordered sequence of the same type)
- Special data types, e.g. B.
- OBJECT IDENTIFIER (globally unique identifier)
Norms and standards
ASN.1 has a long history with different precursors and publications in different organizations.
- 1st generation
- X.208: replaced by X.680
- X.209: replaced by X.690
- 2nd generation
Series X.680:
- X.680: Specification of Basic Notation
- X.681: Information Object Specification
- X.682: Constraint Specification
- X.683: Parameterization of ASN.1 Specifications
Series X.690:
- X.690: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)
- X.691: Specification of Packed Encoding Rules (PER)
- X.692: Specification of Encoding Control Notation (ECN)
- X.693: XML Encoding Rules
- X.694: Mapping W3C XML Schema Definitions into ASN.1
- X.696: Specification of Octet Encoding Rules (OER) and Canonical Octet Encoding Rules (COER)
- 3rd generation
ISO 8824 series:
- ISO / IEC 8824-1: Abstract Syntax Notation One (ASN.1): Specification of basic notations.
- ISO / IEC 8824-2: Abstract Syntax Notation One (ASN.1): Specification of information objects.
- ISO / IEC 8824-3: Abstract Syntax Notation One (ASN.1): Specification of restrictions.
- ISO / IEC 8824-4: Abstract Syntax Notation One (ASN.1): Parameterization of ASN.1 specifications.
ISO 8825 series:
- ISO / IEC 8825-1: ASN.1 Encryption Rules: Specification of basic encryption rules (BER), legal encryption rules (CER) and excellent encryption rules.
- ISO / IEC 8825-2: ASN.1 encryption rules: Specification of compressed encryption rules (PER).
- ISO / IEC 8825-3: Coding rules for ASN.1: Specification of encryption control notation (ECN).
- ISO / IEC 8825-4: Coding rules for ASN.1: XML coding rules (XER).
- ISO / IEC 8825-5: ASN.1 coding rules: Mapping of the W3C XML schema definitions to ASN.1.
- ISO / IEC 8825-6: ASN.1 encoding rules: Registration and application of PER encoding instructions.
- ISO / IEC 8825-7: ASN.1 encoding rules - Part 7: Specification of Octet Encoding Rules (OER).
- Others
- RFC 3641 - Generic String Encoding Rules (GSER) for ASN.1 Types, 2003 (obsolete).
- RFC 4792 - Encoding Instructions for the Generic String Encoding Rules (GSER), 2007.
literature
- Walter Gora: ASN.1 - Abstract Syntax Notation One. Reprint of the 3rd edition. Fossil-Verlag, Cologne 1998, ISBN 3-931959-18-X ( Edition Netze ).
Web links
- ASN.1 standard
- ASN.1 Free Reference Book
- ASN.1 Consortium
- ASN 1 tutorial
- jASN1 - Open Source ASN.1 BER / DER Java library from beanit
- openASN.1 - An open source ASN.1 toolkit for Java
- Free, open source ASN.1 compiler