5

I want to implement some protocol using asn.1 so what i have to do declare structures and tag there name in some header file and implement asn.1's encoding rule as a function. Can you suggest me some tutorial or book to refer. I don't know how to write a code for it.

tod
  • 81
  • 1
  • 6

3 Answers3

5

If you are new to ASN.1, take a look at "ASN.1 Made Simple" - http://www.oss.com/asn1/resources/asn1-made-simple/introduction.html - which gives you a simple introduction to ASN.1. There are also a couple of good books available as a free download at http://www.oss.com/asn1/resources/books-whitepapers-pubs/asn1-books.html which give you a much more comprehensive view.

This site won't let me post more than two links per message, so more info will follow in a separate post.

Paul Thorpe
  • 1,930
  • 17
  • 23
5

Part 2

If you have an ASN.1 specification, your best bet is to get an ASN.1 compiler which reads the ASN.1 specification and generates code in either C, C++, C#, or Java that corresponds to the ASN.1 structures. There are many commercial and free ASN.1 tools available, and many of the comercial ASN.1 tools offer free trials. You can see a good list of ASN.1 Tools at http://www.itu.int/ITU-T/asn1/links/index.htm, where you can also find additional useful ASN.1 information.

Using a good ASN.1 tool makes your development task very simple since you don't have to worry about all of the details of getting the precise bits on the line correct. The tool handles this for you. You concentrate on the C data structure or C++, C# or Java object while the ASN.1 tool handles converting that to and from the strings of bits that get sent across the line.

If you don't have an ASN.1 specification, it is still best to use a good ASN.1 tool to guide you in creating your ASN.1 specification. The books and tutorials whose links are in my first message are a good place to start if you need to create your own specification.

Paul

Paul Thorpe
  • 1,930
  • 17
  • 23
3

So ASN.1 isn't really something you write code for it's just the name of a standard for defining various communications protocols (generally encoding, transmission etc.)

I'm surprised that you obviously haven't had a gander at
http://en.wikipedia.org/wiki/Asn.1

As this goes over basic definitons as well as providing multiple resources on the topic including some books and examples of various common encoding standards defined in ASN.1 (eg DER, BER etc.)

That should get you started as you haven't really indicated if there's some specific implementation you're working on or really anything else about the problem you're having.

  • 1
    I am trying to implement mms(manufacturing message specification)protocol by using asn.1 notations so i need a guide line that how to define structures for my protocol .For example in wiki they given an example of a structure FOOQuestion by SEQUENCE but its not a way to define structures in c. – tod Jan 12 '12 at 08:02
  • that data structure file is some asn.1 specific file?? – tod Jan 12 '12 at 08:06
  • @tod You should have an existing ASN.1 document for MMS. From that, you may use a code generator to produce C. The code generator will take the ASN.1 document as input, and generate corresponding C structures with accompanying encode and decode methods. Otherwise, you will have to do what the code generator does by hand - figure out sensible mappings from the ASN.1 structures to C structures, and then write encode/decode logic. You may want to check out our [website](http://www.obj-sys.com) - we sell just such a code generator. Of course, there are others out there. – Kevin Jan 12 '12 at 17:00
  • ok man thnks for that compiler i got it and understand how to work. – tod Jan 13 '12 at 11:08