There is a lot of literature about ASN.1, books, white papers, online tools, etc. so I'm not duplicating here what already exists "out there" but I just sum up few things I think are interesting.
To start to use ASN.1 is a good thing to read the ITU standards, especially the X.680 (basic notation) and X.690 (basic coding/decoding)
ASN.1 takes some time to be understood, is not extremely intuitive, but it has some big advantages, reason why it exists.
- it allows to exchange data between different machines
Or, better put, allows the sender to don't have to know information about the receiver.
The typical case is when you have two machines with different endian coding (Little Endian vs. Big Endian).
The Endian coding determine how a machine store datas in the memory.
Without a standard way to exchange data, who sends data needs to know how the receiver store them and thus format them accordingly.
Without this information the data will be stored in the wrong way, nullifying the purpose of exchanging data CORRECTLY and thus enhancing the possibility to introduce errors during the data transfer.
- it allows to better document the data sent/received
ASN.1 is a notation human-readable.
It is easy to build up data structures that can be understood by a human, becoming part of the documentation of the project.
- The standards has some default/documented datatype, but is easy to build datatypes related to the specific application.
- It has ready made encoding/decoding libraries
Especially for big projects, there are ready-made encoders/decoders capable to take the human-readable notation and create the byte-sequence to be sent or decode the byte-sequence received.
- It is an international standard
Very important. Like the point n. 1, using the standard allows easily to send data between machines used in different countries, with different regulations, etc.
Not only, it is a vendor-independent, platform-independent and language-independent protocol !
I used ASN.1 for many years while developing for ISDN and when possible I still using it when I need to exchange data between different systems.