Information AboutAsn.1 |
| CATEGORIES ABOUT ABSTRACT SYNTAX NOTATION ONE | |
| itu-t recommendations | |
| data modeling languages | |
| data serialization formats | |
|
ASN.1 is a joint . ASN.1 moved to its own standard, X.208, in 1988 due to wide applicability. The substantially revised 1995 version is covered by the '''X.680''' series. ASN.1 IN TRANSFER ASN.1 defines the Abstract Syntax of information but does not restrict the way the information is encoded. Various ASN.1 encoding rules provide the transfer syntax (a concrete representation) of the data values whose abstract syntax is described in ASN.1. The standard ASN.1 encoding rules include:
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 such as X.400 Electronic Mail , X.500 and LDAP Directory Service s, H.323 ( VoIP ) and SNMP use ASN.1 to describe the Protocol Data Units (PDUs) they exchange. It is also extensively used in the Access and Non-Access Strata of UMTS . There are many other application domains of ASN.1 {Link without Title} . EXAMPLE Data structures of FooProtocol defined using the ASN.1 notation: FooProtocol DEFINITIONS ::= BEGIN This could be a specification published by creators of Foo protocol. ASN.1 does not define conversation flows, this is up to the textual description of the protocol. Let's assume you have a message, which complies with Foo protocol and which you would like to send to the receiving party. This particular message ( PDU ) is: myQuestion FooQuestion ::= {To actually send the above message through the network we need to encode it to a string of bits. ASN.1 defines various algorithms to accomplish that task, called ''Encoding rules''. There are plenty of them; one of the simplest is '' Distinguished Encoding Rules (DER) ''. The Foo protocol specification should explicitly name one set of encoding rules to use, so that users of the Foo protocol know they should use DER. Example encoded in DER Here's the data structure shown before encoded in the DER format:
(Note DER uses a pattern of Tag-length-value triplets) So what you actually get is the string of 21 octets: 30 13 02 01 05 1a 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f The scope of ASN.1 and DER ends here. You may transmit the encoded message to your party by any means (it is out of concern if you use TCP or other protocol for data transfer). Your party should be able to decode the octets back using DER. Example encoded in XER Alternatively, you may encode the same ASN.1 data structure with XER (''XML Encoding Rules'') to achieve greater human readability "over the wire". It would then look like those 108 octets:
Example encoded in PER (unaligned) Alternatively, if Packed Encoding Rules are employed, the following 122 bits (less than 16 octets) will be produced: 01 05 0e 83 bb ce 2d f9 3c a0 e9 a3 2f 2c af c0 ASN.1 VERSUS OTHER DATA STRUCTURE DEFINITION SCHEMES As commonly used for defining messages for Communication Protocol s, ASN.1, with its associated encoding rules, results in a binary encoding. Other communication protocols, such as Internet protocols HTTP and SMTP , define messages using text tags and values, sometimes based on the Augmented Backus-Naur Form (ABNF) notation. The definition also defines the encoding, which is in text. There has been much debate over the two approaches, and both have their merits; the ASN.1 approach is believed to be more efficient, and with Packed Encoding Rules , certainly provides a more compact encoding. The textual approach is claimed to be easier to implement (through creation and parsing of text strings) and easier to debug, as one can simply read an encoded message. In the case of the Megaco protocol, consensus between the two points of view was not reached and so two encodings, one based on ASN.1 and one on ABNF, were defined. The ASN.1 XML Encoding Rules (XER) attempts to bridge the gap by providing a textual encoding of data structures defined using ASN.1 notation. Generic String Encoding Rules were also defined for the sole purpose of presenting and inputting data to/from a user. USING ASN.1 IN PRACTICE One may use an ASN compiler which takes as input an ASN.1 specification and generates computer code (for example in the C programming language) for an equivalent representation of the data structures. This computer code, together with supplied run-time libraries, can then convert encoded data structures to and from the computer language representation. Alternatively, one can manually write encoding and decoding routines. STANDARDS Standards describing the ASN.1 notation ( free download from the ITU-T website ): |
|
|