Menu

First steps in defining a protocol

Help
2010-09-22
2013-03-19
  • Florian Schimmer

    Hello,

    I'm new in defining protocols and i have some problems,and i'm not able to solve without help. I read a lot of documents about asn.1, but they didn't give me an answer….

    Questions:

    1. Streaming: I want to use the protocol to send a lot of data, but the device isn't able to hold the whole informations in ram. it has to works only with parts of the structure. is it possible to parse only parts of a structure like this:
    BigData ::= SEQUENCE
    {
          timstamp UTCTime,
          SEQUENCE OF LittleParts
    }
    LittleParts ::= Data

    But, is it possible to parse, create only parts of a protocol? 

    or should I send only little parts with redundant informations, like this:

    LittleParts ::= SEQUENCE
    {
         timestamp UDCTime,
         data Data
    }
    or is it better to make hard limitations on "sequence of"?

    2. Preallocation of memory: It might be problematic to malloc memory on the fly (memory fragmentation) and i want to allocate some memory on startup and reuse it for the different requests and responses. is it possible to use preallocated memory for the generated encoders and decoders?

    the following questions  are all asn.1 questions, but i didn't find another forum to post it…
    3. extend datatypes:
    is it possible to extend types, f.e. like this:

    BasicRequest ::= SEQUENCE
    {
        requestHeader Header
    }
    ComplexRequest ::= BasicRequest AND
    {
        complex ComplexType
    }

    Or have i to include it in complex types?
    ComplexRequest ::= BasicRequest AND
    {
        basic BasicType,
        complex ComplexType,
    }

    4. Predefined Values
    I want to use Predefined values to identify some data-content

    something like this:

    BasicResponse ::= SEQUENCE
    {
        data-type-id ID,
        ….
    }

    Complex :: CHOICE
    {
      c1 ComplexResponse,
      c2 ComplexResponse-Type2
    }

    ComplexResponse ::= SEQUENCE
    {
         basic BasicResponse,    -> here i want to predefine the dataid f.e. 0x01
         data Data
    }
    ComplexResponse-Type2 ::= SEQUENCE
    {
         basic BasicResponse,    -> also here, but 0x02
         data Data
         arguments
    }
    i have to identify CHOICE'es by my self with a self defined id, right?

    5. ROSE: what the hell is ROSE? I get confused! ;-) it's only a protocol, right? whats the reason that macros are explained with ROSE in the ASN.1 book?

    Thank's a lot
    Flo

     
  • Lev Walkin

    Lev Walkin - 2010-09-22

    0. Next time consider splitting the questions into separate topics. Otherwise it is hard to be comprehensive when so many items are brought up at the same time.

    1. Yes, streaming is supported by asn1c. Base your protocol on the first example.

    2. Yes.

    3. You'll have to include the primitive types into more complex types.

    4. No, the ids are defined for you by the compiler itself. You just use them.

    5. ROSE is a particular protocol, making use of Information Object Classes (not supported by asn1c) and is rather widespread to control the telecom equipment.

    6. If you want to know more, please use a separate a topic per single question.

     
  • Florian Schimmer

    Thanks for the fast reply!

    I separated the still open questions (1, 2) into new topics…

    Flo

     
  • Bruida

    Bruida - 2012-10-24

    Do you have any plan to add supporting of information object class in asn1c?

     

Log in to post a comment.