Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an ASN file and how do I use it?

I am trying to work with a communication protocol (S1AP to be specific) and I am trying to define messages to test.

The LTE 36.413 specification details this protocol and also give an ASN.1 file definition at the bottom of the pdf. I have seen ASN files being used in the dissector for WireShark, and I am guessing that I might be able to use it to generate messages in accordance with the specification.

I was wondering how you use ASN.1 files. I have been researching and have found information on ASN.1 compilers and other information related to it, but all the information has left me very confused as nobody has explained clearly how to use it. Could someone please help me understand how to use it?

like image 413
Edwin Avatar asked Aug 16 '13 19:08

Edwin


People also ask

What are ASN files used for?

ASN. 1, or Abstract Syntax Notation One, is an International Standards Organization (ISO) data representation format used to achieve interoperability between platforms. NCBI uses ASN. 1 for the storage and retrieval of data such as nucleotide and protein sequences, structures, genomes, PubMed records, and more.

How do I open an ASN file?

You need a suitable software like Atlantis Word Processor to open an ASN file. Without proper software you will receive a Windows message "How do you want to open this file?" or "Windows cannot open this file" or a similar Mac/iPhone/Android alert.

What is the purpose of the ASN 1 object identifier tree?

The ASN. 1 OBJECT IDENTIFIER type is used when you need to provide a unique identifier (for example, for a module).

What is ASN 1 sequence?

​ASN. 1 is a formal notation used for describing data transmitted by telecommunications protocols, regardless of language implementation and physical representation of these data, whatever the application, whether complex or very simple.

What is ASN LTE?

Abstract Syntax Notation One (ASN. 1) is a standardized notation used for describing the structure of data carried by messages exchanged between communicating entities. The notation is developed and maintained by ITU-T as ITU-T X. 680 to X. 683 (ISO/IEC 8824-1 to 4).


2 Answers

After much hunting I have found out what ASN.1 files are.

These ASN.1 files essentially contains protocol description and packet description. Using these ASN.1 files, you can generate .c and .h files to be used in some application you wish to use these for. This is really handy because you don't have to create your own message database. You just need to compile the ASN.1 files and you C files will be compiled for your use.

Now, you must be wondering, how do I compile this? Well, you generally need some sort of an ASN.1 compiler. You have to pay for some, but I was able to find an open source one that works with Linux and Windows. There is potential that it may work on MAC as well since that is UNIX based as long as you have the necessary dependencies. In any case here is the link to this web page. I will not explain how to use it because I think this web page does a lovely job at documenting usage. Hope this helps someone as much as it helped me.

Check out the compiler here http://lionet.info/asn1c/blog/

If that link does not work for you, you may need to try a commercial one such as OSS Nocklava ASN1.C compiler or if money is of concern, then it might be worth making your own database despite the amount of time this will take.

All the best.

like image 199
Edwin Avatar answered Oct 09 '22 07:10

Edwin


  1. ASN is a data description language. Like you said, the ASN file definition found specifies the representation of your message data to comply with the encoding and decoding under the S1AP protocol.

  2. An ASN file needs to be compiled. The output from the compilation will give you some code specification and body (in most cases a .h and .c code file) to automatically serialize/deserialize any message data to the S1AP data model regardless of the platform encoded from and send to.

  3. To rapidly test and learn how to use your ASN.1 schema you can use this service: http://asn1-playground.oss.com/

  4. Also, For a more in depth and concise explanation of what makes ASN.1 powerful please read this: https://www.thanassis.space/asn1.html. The author also shares an open source ASN.1 compiler developed under the supervision of the European Space Agency.

  5. As a side note, it might worth investigating the use of Protocol Buffers as it represents a very similar technology augmented with, arguably, more modern features such as backward/forward data description compatibility and reflection: https://developers.google.com/protocol-buffers/docs/cpptutorial

like image 41
douche_satan Avatar answered Oct 09 '22 08:10

douche_satan