Basic Encoding Rules

Basic Encoding Rules

The Basic Encoding Rules (BER) is one of the encoding formats defined as part of the ASN.1 standard specified by the ITU in X.690.

Description

The Basic Encoding Rules were the original rules laid out by the ASN.1 standard for encoding abstract information into a concrete data stream. The rules, collectively referred to as a "transfer syntax" in ASN.1 parlance, specify the exact octet sequences which are used to encode a given data item. The syntax defines such elements as: the representations for basic data types, the structure of length information, and the means for defining complex or compound types based on more primitive types. The BER syntax, along with two subsets of BER (the Canonical Encoding Rules and the Distinguished Encoding Rules), are defined by the ITU-T's X.690 standards document, which is part of the ASN.1 document series.

Encoding

The BER format specifies a self-describing and self-delimiting format for encoding ASN.1 data structures. Each data element is encoded as a type identifier, a length description, the actual data elements, and where necessary, an end-of-content marker. These types of encodings are commonly called type-length-value or TLV encodings. This format allows a receiver to decode the ASN.1 information from an incomplete stream, without requiring any pre-knowledge of the size, content, or semantic meaning of the dataITU-T X.690, ISO 8825-1] .

P/C is the primitive/constructed bit, it specifies if the value is primitive like an INTEGER or constructed which means, it again holds TLV values like a SET. If the bit is "on" (value = 1), it indicates a constructed value.

Number specifies the tag, i.e. of which exact kind the value is.

Comparison to alternative formats

The key difference between the BER format and the CER or DER formats is the flexibility provided by the Basic Encoding Rules. As stated in the X.690 standard, "Alternative encodings are permitted by the basic encoding rules as a sender's option. Receivers who claim conformance to the basic encoding rules shall support all alternatives". For example, when encoding a constructed value (that is, a value that is made up of multiple smaller, already-encoded values), the sender can use one of three different forms to specify the length of the data. A receiver must be prepared to accept all legal encodings in order to legitimately claim BER-compliance. By contrast, both CER and DER restrict the available length specifications to a single option.

There is a common perception of BER as being "inefficient" compared to alternative encoding rules. It has been argued by some that this perception is primarily due to poor implementations, not necessarily any inherent flaw in the encoding rules. [Lin, Huai-An. “Estimation of the Optimal Performance of ASN.1/BER Transfer Syntax”. ACM Computer Communication Review. July 93, 45 - 58.] These implementations rely on the flexibility that BER provides to use encoding logic that is easier to implement, but results in a larger encoded data stream than necessary. Whether this inefficiency is reality or perception, it has led to a number of alternative encoding schemes, such as the Packed Encoding Rules, which attempt to improve on BER performance and size.

Other alternative formatting rules, which still provide the flexibility of BER but use alternative encoding schemes, are also being developed. The most popular of these are XML-based alternatives, such as the XML Encoding Rules and ASN.1 SOAP [ITU-T Rec. X.892, ISO/IEC 24824-2] . In addition, there is a standard mapping to convert an XML Schema to an ASN.1 schema, which can then be encoded using BER [ITU-T X.694, ISO/IEC ISO/IEC 8825-5] .

Usage

Despite its perceived problems, BER is a popular format for transmitting data, particularly in systems with different native data encodings.

* The SNMP protocol specifies ASN.1 with BER as its required encoding scheme.
* The digital signature standard PKCS #7 also specifies ASN.1 with BER to encode encrypted messages and their digital signature or digital envelope.
* Many telecommunication systems, such as ISDN, toll-free call routing, and most cellular phone services use ASN.1 with BER to some degree for transmitting control messages over the network [http://asn1.elibel.tm.fr/en/uses/index.htm ASN.1 Uses] ] .
* LDAP messages are encoded using BER.
* GSM TAP (Transferred Account Procedures) files are encoded using BER. [http://www.gsmworld.com/using/billing/potential.shtml]

ee also

* Canonical Encoding Rules
* Distinguished Encoding Rules
* Packed Encoding Rules
* SNMP
* Kerberos
* Peter Gutmann's 'X.509 Style Guide' [http://www.cs.auckland.ac.nz/~pgut001/pubs/x509guide.txt]
* RSA's 'A Layman's Guide to a Subset of ASN.1, BER, and DER ' [ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc]

Footnotes

External links

* [http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf ITU-T X.690, ISO/IEC 8825-1]
* [http://www.itu.int/ITU-T/asn1/database/itu-t/x/x892/2005/index.html ITU-T X.892, ISO/IEC 24824-2]
* [http://www.itu.int/ITU-T/studygroups/com17/languages/X694.pdf ITU-T X.694, ISO/IEC ISO/IEC 8825-5]
* [http://www.rsasecurity.com/rsalabs/node.asp?id=2129 PKCS #7]
* [http://www.vijaymukhi.com/vmis/ber.htm simple BER tutorial]

References


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Basic encoding rules — Le codage Basic Encoding Rules (règles d encodage basiques) ou son acronyme BER est un des format d encodage définie par le standard ASN.1. Sommaire 1 Description 2 Comparaison par rapport à des formats alternatifs 3 Utilisation …   Wikipédia en Français

  • Basic Encoding Rules — Le codage Basic Encoding Rules (règles d encodage basique), dont l acronyme est BER, est un des formats d encodage définie par le standard ASN.1. Sommaire 1 Description 2 Comparaison par rapport à des formats alternatifs 3 Utilisation …   Wikipédia en Français

  • Distinguished Encoding Rules — Die Abstract Syntax Notation One (ASN.1) ist eine Beschreibungssprache zur Definition von Datenstrukturen sowie Festlegungen zur Umsetzung von Datenstrukturen und Elementen in ein netzeinheitliches Format. Sie ist gemeinsamer Standard der ITU T… …   Deutsch Wikipedia

  • Distinguished Encoding Rules — (DER), is a message transfer syntax specified by the ITU in X.690. The Distinguished Encoding Rules of ASN.1 is an International Standard drawn from the constraints placed on basic encoding rules (BER) encodings by X.509. DER encodings are valid… …   Wikipedia

  • Canonical Encoding Rules — (CER) is a message transfer syntax specified by the ITU in X.690. It is a restricted variant of Basic Encoding Rules for producing unequivocal transfer syntax for data structures described by ASN.1. Whereas BER gives choices as to how data values …   Wikipedia

  • BER — • Basic Encoding Rules • Bit Error Rate • Berliner homogener Siedewasser Forschungsreaktor im Hahn Meitner Institut mit 50kW theoretischer Leistung (nach > IEEE Standard Dictionary ) • Berlin Metropolitan, Germany internationale Flughafen… …   Acronyms

  • X.690 — – один из стандартов ASN.1, разработанных совместно организациями ISO, IEC и ITU T для удобства представления данных при их передаче в телекоммуникационных сетях. Правила кодирования, описанные в X.690, служат для представления структур данных,… …   Википедия

  • ASN.1 — Die Abstract Syntax Notation One (ASN.1) ist eine Beschreibungssprache zur Definition von Datenstrukturen sowie Festlegungen zur Umsetzung von Datenstrukturen und Elementen in ein netzeinheitliches Format. Sie ist gemeinsamer Standard der ITU T… …   Deutsch Wikipedia

  • ASN1 — Die Abstract Syntax Notation One (ASN.1) ist eine Beschreibungssprache zur Definition von Datenstrukturen sowie Festlegungen zur Umsetzung von Datenstrukturen und Elementen in ein netzeinheitliches Format. Sie ist gemeinsamer Standard der ITU T… …   Deutsch Wikipedia

  • Abstract Syntax Notation One — Die Abstract Syntax Notation One (ASN.1) ist eine Beschreibungssprache zur Definition von Datenstrukturen sowie Festlegungen zur Umsetzung von Datenstrukturen und Elementen in ein netzeinheitliches Format. Sie ist gemeinsamer Standard der ITU T… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”