Subject: RE: [Megaco] Urgent - ASN BER encoding/decoding of OPTIONAL field s!

From: [email-masked]
Date: Thu, 16 Aug 2001 15:22:14 +0100

Dear Atanum,

If you have an OPTIONAL element in a SEQUENCE followed by another element of
the same data type, then you *MUST* put a numbered tag on the OPTIONAL
element, because the only way to tell whether the first element you receive
is the first (OPTIONAL) element of the SEQUENCE or the second element is by
the tag value. In theory you could trawl through the whole sequence to build
up a hypothesis about whether (in your example) the first instance of
StreamMode you receive is streamMode or reserveValue, but I would recommend
strongly that you don't do it! The disadvantage of using numeric tags when
you don't need them is minuscule, and the advantage of easier decoding is
substantial!

Best regards

Ian Park

________________________________________________
Ian Park
Chief Engineer, Core Network Signalling Standards
Vodafone Limited
*T: +44 1635 673 527
*F: +44 1635 233 562
*E: [email-masked]
________________________________________________

-----Original Message-----
From: Atanum [mailto:[email-masked]]
Sent: 16 August 2001 15:07
To: megaco
Subject: [Megaco] Urgent - ASN BER encoding/decoding of OPTIONAL fields!

> HI List,
> 
> I would like to know how exactly the OPTIONAL fields are handled
> during BER encode/decode.
> I understand that the TLV  for an OPT field if present,  shall appear in
> the encoding at the point corresponding to the appearance of the type in
> the ASN.1 definition.
> What is the way to decode such an incoming ASN stream, which contains an
> OPT field?
> 
> eg. : in the definition below, how will we know that streamMode is
> PRESENT or NOT in the incoming ASN BER stream? The situation sure looks
> more complicated if we have more than one OPT field.
> 
>    LocalControlDescriptor ::= SEQUENCE
>    {
>         streamMode      StreamMode OPTIONAL,
>         reserveValue    BOOLEAN,
>         reserveGroup    BOOLEAN,
>         propertyParms   SEQUENCE OF PropertyParm,
>         ...
>    }
> 
> In the above case, we may be able to find out by looking at the TAG
> octets. This is possible since TAGs of streamMode and reserveValue are
> different.
> But how will we decode if, say reserve value is also of type StreamMode
> (see below)
> 
>    LocalControlDescriptor ::= SEQUENCE
>    {
>         streamMode      StreamMode OPTIONAL,
>         reserveValue    StreamMode,
>         reserveGroup    BOOLEAN,
>         propertyParms   SEQUENCE OF PropertyParm,
>         ...
>    }
> 
> 
> Thanks in Advance
> Regards
> 
> 

_______________________________________________
Megaco mailing list
[email-masked]
http://www1.ietf.org/mailman/listinfo/megaco

_______________________________________________
Megaco mailing list
[email-masked]
http://www1.ietf.org/mailman/listinfo/megaco

---

From: Troy Cauble <[email-masked]>
Date: Thu, 16 Aug 2001 11:25:48 -0400

> you don't need them is minuscule, and the advantage of easier decoding is

You are describing a choice for the person designing the 
ASN.1 spec for H.248, not implementing it.

The location of numbered tags is fully specified by the
AUTOMATIC TAGS declaration.

-troy