Abstract Syntax Notation One - Example

Example

Data structures of FooProtocol defined using the ASN.1 notation:

FooProtocol DEFINITIONS ::= BEGIN FooQuestion ::= SEQUENCE { trackingNumber INTEGER, question IA5String } FooAnswer ::= SEQUENCE { questionNumber INTEGER, answer BOOLEAN } END

This could be a specification published by creators of Foo protocol. ASN.1 does not define conversation flows. This is up to the textual description of the protocol.

Assuming a message, which complies with Foo protocol and which will be sent to the receiving party. This particular message (Protocol data unit (PDU)) is:

myQuestion FooQuestion ::= { trackingNumber 5, question "Anybody there?" }

To send the above message through the network one needs to encode it to a string of bits. ASN.1 defines various algorithms to accomplish that task, called Encoding rules. There are plenty of them; one of the simplest is Distinguished Encoding Rules (DER).

The Foo protocol specification should explicitly name one set of encoding rules to use, so that users of the Foo protocol know which one they should use.

Read more about this topic:  Abstract Syntax Notation One

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)