Select the product you need help with
XGEN: A Brief Introduction to ASN.1 and BERArticle ID: 252648 - View products that this article applies to. This article was previously published under Q252648 On This PageSUMMARY This article describes Abstract Syntax Notation One (ASN.1)
and Basic Encoding Rules (BER), and clarifies the differences between the two.
Many information technology workers, including seasoned professionals, are often confused about what ASN.1 and BER are, the differences between the two, or even why the distinction is important. Their confusion is understandable when even those people who know ASN.1 and BER well frequently use the terms incorrectly. Because ASN.1 is the language of standards, it is very common to find standards recommendations written in ASN.1. Support professionals, consultants, and information technology specialists alike benefit from knowing ASN.1 because it allows them to dig deep into the standards and to decode and understand the content of the data that they troubleshoot. The most common standards written in ASN.1 are those produced by the International Telegraph and Telephone Consultative Committee (CCITT) and the International Telecommunications Union (ITU). However, members of the Internet Engineering Task Force (IETF) are increasingly using ASN.1 to succinctly state their recommendations. ASN.1 says in one page what otherwise takes five or six pages to write out in some other format. The following is a list of commonly used standards that are written in ASN.1:
MORE INFORMATIONASN.1Abstract Syntax Notation One (more commonly known as ASN.1) is a language for defining standards without regard to the implementation. It is the language of standards writers. When John Smith at CalTech wants to write a recommendation for standardizing the procedures that one component follows for talking to another component, he writes the recommendation in ASN.1 notation, and submits the recommendation to a standards body such as the ITU. ASN.1 facilitates communication between professionals and committee members by offering a common language for describing a standard. ASN.1 is defined in ITU-T Recommendations X.209 and X.690.For example, ASN.1 defines:
BERBER (pronounced "burr") is the common name for the Basic Encoding Rules of ASN.1. BER is defined in ITU-T Recommendations X.209 and X.690. BER is one set of rules for encoding ASN.1 data to a stream of octets that can be transmitted over a communications link. Other methods of encoding ASN.1 data include Distinguished Encoding Rules (DER), Canonical Encoding Rules (CER), and Packing Encoding Rules (PER). Each encoding method has its application, but BER tends to be the encoding method most commonly used and most commonly talked about.BER defines:
Contrasting ASN.1 and BERASN.1 is like a programming language (such as C), whereas BER is like a compiler for that language. Compilers are platform-specific, whereas many high-level programming languages are not. C defines the rules and language for writing a program. A program is not C; it is written in C. The program is not useful until it is compiled for a specific platform (such as Intel x86). So it is with ASN.1 and BER. ASN.1 is the language for writing a standard. A standard is not ASN.1; it is written in ASN.1. Data which is generated from a program that complies with the standard may loosely be termed "ASN.1 data." ASN.1 data is not useful (that is, it cannot be transmitted across a LAN) until the ASN.1 data is encoded into a stream of octets which can be easily decoded at the destination. To illustrate, the following is an example of these concepts derived from ITU-T Recommendation X.209, Appendix I. This is an informal description of a personnel data record:Name: John P Smith Date of Birth: 17 July 1959 (other data)
PersonnelRecord ::= [APPLICATION 0] IMPLICIT SET {
Name,
title [0] VisibleString,
dateOfBirth [1] Date,
(other types defined) }
Name ::= [APPLICATION 1] IMPLICIT SEQUENCE {
givenName VisibleString,
initial VisibleString,
familyName VisibleString }
Next, the application maps the personnel data into the personnel record structure (ASN.1 data format), and then applies the Basic Encoding Rules (BER) to the ASN.1 data. This is what it might look like (with the exception that the names would be converted to ASCII):
Personnel
Record Length Contents
60 8185
Name Length Contents
61 10
VisibleString Length Contents
1A 04 "John"
VisibleString Length Contents
1A 01 "P"
VisibleString Length Contents
1A 05 "Smith"
DateofBirth Length Contents
A0 0A
Date Length Contents
43 08 "19590717"
60 81 85 61 10 1A 04 .... .... 0A 43 08 19 59 07 17 REFERENCES For more information on ASN.1, consult ITU-T Recommendation X.680 through 683. For more information on BER, consult the recommendation itself (ITU-T Recommendation X.690 or X.691). For more information, read "Changing from ASN.1:1988 to ASN.1:2002" on the ITU-T Study Group 17 Web page: http://www.itu.int/ITU-T/studygroups/com17/changing-ASN/
(http://www.itu.int/ITU-T/studygroups/com17/changing-ASN/)
PropertiesArticle ID: 252648 - Last Review: February 22, 2007 - Revision: 4.4 APPLIES TO
| Article Translations |


Back to the top








