中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

ASN.1: Abstract Syntax Notation One

Abstract Syntax Notation One (ASN.1), an ISO/ITU-T standard, describes data structures for representing, encoding, transmitting, and decoding data. It provides a set of formal rules for describing the structure of objects regardless of language implementation and physical representation of these data, whatever the application, whether complex or very simple.

ASN.1 sends information in any form (audio, video, data, etc.) anywhere it needs to be communicated digitally. ASN.1 only covers the structural aspects of information. ASN.1 together with specific ASN.1 encoding rules facilitates the exchange of structured data especially between application programs over networks by describing data structures in a way that is independent of machine architecture and implementation language.

Application layer protocols in ISO protocol suite such as X.400 for electronic mail, X.500 for directory services, H.323 (VoIP) and SNMP use ASN.1 to describe the PDUs they exchange. It is also extensively used in the Access and Non-Access Strata of UMTS.

One of the main reasons for the success of ASN.1 is that it is associated with several standardized encoding rules such as the Basic Encoding Rules (BER) - X.209, Canonical Encoding Rules (CER), Distinguished Encoding Rules (DER), Packed Encoding Rules (PER), and XER Encoding Rules (XER). These encoding rules describe how the values defined in ASN.1 should be encoded for transmission, regardless of machine, programming language, or how it is represented in an application program. ASN.1's encodings are more streamlined than many competing notations, enabling rapid and reliable transmission of extensible messages - an advantage for wireless broadband. Because ASN.1 has been an international standard since 1984, its encoding rules are mature and have a long track record of reliability and interoperability.

The compact binary encoding rules (BER, CER, DER, PER, but not XER) are considered alternatives to the more modern XML. However, the ASN.1 allows to describe the data semantics, not only the transfer encoding syntax, so it is a higher level language than XML.

An ASN.1 definition can be readily mapped into a C or C++ or Java data-structure that can be used by application code, and supported by run-time libraries providing encoding and decoding of representations in either an XML or a TLV format, or a very compact packed encoding format.

Protocol Structure

ASN.1 provides a certain number of pre-defined basic types

  • UNIVERSAL 0 Reserved for use by the encoding rules
  • UNIVERSAL 1 Boolean type
  • UNIVERSAL 2 Integer type
  • UNIVERSAL 3 Bitstring type
  • UNIVERSAL 4 Octetstring type
  • UNIVERSAL 5 Null type
  • UNIVERSAL 6 Object identifier type
  • UNIVERSAL 7 Object descriptor type
  • UNIVERSAL 8 External type and Instance-of type
  • UNIVERSAL 9 Real type
  • UNIVERSAL 10 Enumerated type
  • UNIVERSAL 11 Embedded-pdv type
  • UNIVERSAL 12 UTF8String type
  • UNIVERSAL 13 Relative object identifier type
  • UNIVERSAL 14-15 Reserved for future editions of this Recommendation | International Standard
  • UNIVERSAL 16 Sequence and Sequence-of types
  • UNIVERSAL 17 Set and Set-of types
  • UNIVERSAL 18-22, 25-30 Character string types
  • UNIVERSAL 23-24 Time types
  • UNIVERSAL 31-... Reserved for addenda to this Recommendation | International Standard

ASN.1 also makes it possible to define constructed types such as: 

  • structures (SEQUENCE),
  • lists (SEQUENCE OF),
  • choice between types (CHOICE),
  • etc.

Related protocols: XML, X.400, X.500, H.323

Sponsor Source: ASN.1 is defined by ITU/ISO in ITU X.680 or ISO/IEC 8824

Reference: http://www.javvin.com/protocol/ASN1X680.pdf: OSI networking and system aspects €“ Abstract SyntaxNotation One (ASN.1)