Use of Abstract Syntax Notation (ASN.1)

asn.1jsonserializationxml

The problem of Electronic Data Interchange over networks is well known and understood. Today, the most common formats for data interchange are things like XML and JSON. There are various pros and cons of using one format over the other, and certain formats lend themselves better to certain data-sets.

I've been programming for quite some time now, and I've only just NOW come across the ASN.1 (Abstact Syntax Notation) format, which is apparently used in certain Internet protocols such as LDAP, and is actually quite old (in Internet years). I read a bit about the format. Like JSON, it provides primitive data types (boolean, integer, etc.) and also sequence and set types.

It's a bit different from JSON or XML in the sense that, while the notation itself is human readable, the encoding is usually not human readable (it is usually encoded in a binary format.)

Is there some reason why this format is so rarely used? (Or am I totally wrong, and it is actually used often?) I've only just now heard of it for the first time, and I've never heard it come up in any of the various discussions I've read about the merits of JSON, YAML, XML or whatever interchange format. Is there some major drawback to ASN.1 that prevented it from being more widely used?

Best Answer

ASN.1 is actually very widely used. Every cell phone made today uses ASN.1 Unaligned Packed Encoding Rules as part of its low level protocol. ASN.1 is used in Aviation protocols for communications between ground and airplanes. ASN.1 is used in communications with Satellites (as in GPS systems). ASN.1 is used in communications between banks and in credit card transactions. Every time you connect to a secure website using https, you are using ASN.1. ASN.1 is used for electronic toll systems so that you don't have to stop at toll booths to pay your toll on freeways or highways. ASN.1 is used by some shipping companies to keep track of their packages. These some of the areas where ASN.1 is used.

It is unfortunate that it has not gotten publicity as a robust way of disparate machines with disparate operating systems and even disparate programming languages all being able to communicate with each other.

It even supports communication with XML Schema engines via the XML Encoding Rules. The latest generation of cell phones using LTE (Long Term Evolution) heavily relies on ASN.1, so it is not going away any time soon. It is a mature technology with a proven track record, and continues to be widely used.

Related Topic