Thanks to all of you who tried to give me a hint as to what the solution for my problems might be.
As Mr. Bancroft pointed, the syntax I used to describe the structure was not quite conforming to the ASN.1 notation and I apologize for that. I rather had in my mind the C++ syntax when I thought how to describe the structure. I was asked if I see a big market for OER. I am not an authority in ASN.1 tools and I only came across this notation and all the encoding rules that can be used with it through my recent involvement in the development of some projects. I do know that OER was developed in the Traffic Management and Smart Transportation Systems community and, from what I understand, at least for these kinds of implementation they aim to use it intensively. There is a bunch of emerging standards in North America related to Intelligent Transportation Systems that recommend using OER when it comes to choose a set of encoding rules. In fact, working with one of these projects caused me to bump into all these problems. Just as a detail without much importance, OER will generate binary images for encoded objects almost half the size of those generated using BER. It appears as though Automatic Tagging is the solution to my problem. Since Mr. Bancroft said that I might use Automatic Tags or not I have another question: Who and how will decide whether to use Automatic Tags? Is this something that�s agreed upon before the implementation is started and is like a global environment parameter or is dictated by the context and nature of the information that is supposed to be exchanged? Thank you in advance for your time and availability to answer my questions, Eddie Lascu PS: "Distinguishable" is an English word indeed. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Eduard Lascu Sent: Tuesday, April 02, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: [ASN.1] Encoding of a sequence with optional and default data members in BER Hi everybody, I have two questions regarding the ISO/IEC 8825-1 standard. More precisely, I am interested in finding out how BER (Basic Encoding Rules) treats a sequence (structure) that has optional data members or data members that can have the default value. Paragraph 8.9.3 says that: � 8.9.3 The Encoding of a data value may, but need not, be present for a type which was referenced with the keyword �OPTIONAL� or the keyword �DEFAULT�. If present, it shall appear in the encoding at the point corresponding to the appearance of the type in the ASN.1 definition.� My understanding of this is that a structure that has a couple of data fields that are optional or with the default value can choose to encode them or not. In case it encodes them everything is fine, but how will be signaled in the encoding that the fields were not in fact encoded. Let�s think of a structure: Some_structure SEQUENCE { Field_1 INTEGER (0..255), Field_2 INTEGER (0..255) DEFAULT {0}, Field_3 INTEGER (0..100) OPTIONAL, Field_4 INTEGER (0..100) DEFAULT {1}, Field_5 INTEGER (0..255) OPTIONAL } Now let�s think to an instance of this structure: an_Instance = { 3, 0, N/A, 2, 5 }; This has - its first field set to 3; - the second one is set to 0 which is the default value for that field; - the third field has a value without importance; - the fourth one has a value of 2, which is different than the default value; - and the last field set to 5, which is important for the current context. According to the standard, only fields 1, 4 and 5 should always be encoded, whereas fields 2 and 3 can miss. Now my question is how will I know which fields were encoded and which were skipped when I decode this structure and see that only three integers were encoded. The reason I ask this is because I also work with OER (Octet Encoding Rules) which is an emerging standard and that one attaches to each structure a special field, which is called �Preamble�. This is basically a bit-map that tells you which field was encoded and which was skipped. In the above case, the preamble would have been a 5-bit string equal with 10011 (1 for present field and 0 for skipped field). When the object is decoded, one can see that fields 2 and 3 are missing and knowing the structure can conclude that field 2 had the default value and field 3 was optional. My second question is related to the way BER treats the extension marker fields, if it treats them at all. Extension markers are special fields that allow structures to evolve from one version to another. All the newer fields are enclosed with a pair of extension markers and because of that, every application that only knows the old version of the object will still be able to decode the information. Does BER anything like that? Best regards, Eddie Lascu IBI Group 230 Richmond St. W., 5th Floor Toronto ON M5V 1V6 Tel. (416) 596-1930 x205 Fax. (416) 596-0644 NOTE: This e-mail message and attachments may contain privileged and confidential information. If you have received this message in error, please immediately notify the sender and delete this e-mail message.
