3.7. Data Elements
The data elements defined here are similar to the data structure and encoding used in NSW [30].
Each of the diagrams which follow represent a sequence of octets. Field boundaries are denoted by the "|" character, octet boundaries by the "+" character. Each element begins with a one-octet code. The order of the information in each element is left-to-right. In fields with numeric values the high-order (or most significant) bit is the left-most bit. For transmission purposes, the leftmost octet is transmitted first. Cohen has described some of the difficulties in mapping memory order to transmission order [31].
Code Type Representation
---- ---- --------------
+------+
0 No Operation | 0 |
+------+
+------+------+------+------+------
1 Padding | 1 | octet count | Data ...
+------+------+------+------+------
+------+------+
2 Boolean | 2 | 1/0 |
+------+------+
+------+------+------+
3 Index | 3 | Data |
+------+------+------+
+------+------+------+------+------+
4 Integer | 4 | Data |
+------+------+------+------+------+
Extended +------+------+------+------+------
5 Precision | 5 | octet count | Data ...
Integer +------+------+------+------+------
+------+------+------+------+------
6 Bit String | 6 | bit count | Data ...
+------+------+------+------+------
+------+------+------
7 Name String | 7 | count| Data ...
+------+------+------
+------+------+------+------+------
8 Text String | 8 | octet count | Data ...
+------+------+------+------+------
+------+------+------+------+-----
9 List | 9 | octet count | Data ...
+------+------+------+------+-----
+------+------+------+------+------
10 Proplist | 10 | octet count | Data ...
+------+------+------+------+------
+------+
11 End of List | 11 |
+------+
Element code 0 (NOP) is an empty data element used for padding when it is necessary. It is ignored.
Element code 1 (PAD) is used to transmit large amounts of data with a message for test or padding purposes. The type-octet is followed by a three-octet count of the number of octets to follow. No action is taken with this data but the count of dummy octets must be correct to indicate the next element code.
Element code 2 (BOOLEAN) is a boolean data element. The octet following the type-octet has the value 1 for True and 0 for False.
Element code 3 (INDEX) is a 16-bit unsigned integer datum. Element code 3 occupies only 3 octets.
Element code 4 (INTEGER) is a signed 32-bit integer datum. This will always occupy five octets. Representation is two's complement.
Element code 5 (EPI) is an extended precision integer. The type octet is followed by a three-octet count of the number of data octets to follow. Representation is two's complement.
Element code 6 (BITSTR) is a bit string element for binary data. The bit string is padded on the right with zeros to fill out the last octet if the bit string does not end on an octet boundary. This data type must have the bit-count in the three-octet count field instead of the number of octets.
Element code 7 (NAME) is used for the representation of character string names (or other short strings). The type octet is followed by a one-octet count of the number of characters (one per octet) to follow. Seven bit ASCII characters are used, right justified in the octet. The high order bit in the octet is zero.
Element code 8 (TEXT) is used for the representation of text. The type octet is followed by a three-octet count of the number of characters (one per octet) to follow. Seven bit ASCII characters are used, right justified in the octet. The high order bit in the octet is zero.
Element code 9 (LIST) can be used to create structures composed of other elements. The three-octet octet count specifies the number of octets in the whole list (i.e., the number of octets following this count field to the end of the list, not including the ENDLIST octet). The two-octet item count contains the number of elements which follow. Any element may be used including list itself.
+------+------+------+------+------+------+
| 9 | octet count | item count |
+------+------+------+------+------+------+
+------+------/---+
repeated | element |
+------+------/---+
+-------+
|ENDLIST|
+-------+
In some situations it may not be possible to know the length of a list until the head of it has been transmitted. To allow for this a special ENDLIST element is defined. A list of undetermined length is transmitted with the octet count cleared to zero, and the item count cleared to zero. A null or empty List, one with no elements, has an octet count of two (2) and an item count of zero (0). The ENDLIST element always follows a LIST, even when the length is determined.
Element code 10 (PROPLIST) is the Property List element. It is a special case of the list element, in which the elements are in pairs and the first element of each pair is a name. It has the following form:
+------+------+------+------+------+
| 10 | octet count | pair |
+------+------+------+------+------+
+------+------/---+------+------/---+
repeated | name element | value element |
+------+------/---+------+------/---+
+-------+
|ENDLIST|
+-------+
The Property List structure consists of a set of unordered <name,value> pairs. The pairs are composed of a name which must be a NAME element and a value which may be any kind of element. Following the type code is a three-octet octet count of the following octets. Following the octet count is a one-octet pair count of the number of <name,value> pairs in the property list.
The name of a <name,value> pair is to be unique within the property list, that is, there shall be at most one occurrence of any particular name in one property list.
In some situations it may not be possible to know the length of a property list until the head of it has been transmitted. To allow for this the special ENDLIST element is defined. A property list of undetermined length is transmitted with the octet count cleared to zero, and the pair count cleared to zero. A null or empty property list, one with no elements, has an octet count of one (1) and an pair count of zero (0). The ENDLIST element always follows a property list, even when the length is determined.
Element code 11 (ENDLIST) is the end of list element. It marks the end of the corresponding list or property list.
Structure Sharing
When messages are batched in message-bags for transmission, it may often be the case that the same document will be sent to more than one recipient. Since the document portion can usually be expected to be the major part of the message, much repeated data would be sent if a copy of the document for each recipient were to be shipped in the message-bag.
To avoid this redundancy, messages may be assembled in the message-bag so that actual data appears on its first occurrence and only references to it appear in later occurrences. When data is shared, the first occurrence of the data will be tagged, and later locations where the data should appear will only reference the earlier tagged location. All references to copied data point to earlier locations in the message-bag. The data to be retrieved is indicated by the tag.
This is a very general sharing mechanism. PLEASE NOTE THAT THE MPM WILL NOT SUPPORT THE FULL USE OF THIS MECHANISM. THE MPM WILL ONLY SUPPORT SHARING OF WHOLE DOCUMENTS. No other level of sharing will be supported by the MPMs.
This sharing mechanism may be used within a document as long as all references refer to tags within the same document.
Sharing is implemented by placing a share-tag on the first occurrence of the data to be shared, and placing a share-reference at the locations where copies of that data should occur.
+------+------+------+
12 Share Tag | 12 | share-index |
+------+------+------+
+------+------+------+
13 Share Reference | 13 | share-index |
+------+------+------+
Element code 12 (S-TAG) is a share tag element. The two octets following the type-octet specify the shared data identification code for the following data element. Note that s-tag is not a DATA element, in the sense that data elements encode higher level objects.
Element code 13 (S-REF) is a share reference element. The two octets following the type-octet specify the referenced shared data identification code.
An example of using this mechanism is
( ( <a>, <b> ) ( <c>, <b> ) )
could be coded as follows to share <b>
( ( <a>, <s-tag-1><b> ) ( <c>, <s-ref-1> ) )
To facilitate working with structures which may contain shared data, the two high-order bits of the list and property list element codes are reserved for indicating if the structure contains data to be shared or contains a reference to shared data. That is, if the high-order bit of the list or property list element code octet is set to one then the property list contains a share-reference to shared data. Or, if the second high-order bit is set to one the structure contains a share-tag for data to be shared.
The example above is now repeated in detail showing the use of the high-order bits.
+------+------+------+------+------+------+------+------+
|11 - 9|01 - 9| <a> | 12 | 0 | 1 | <b> | 11 |
+------+------+------+------+------+------+------+------+
+------+------+------+------+------+------+------+
|10 - 9| <c> | 13 | 0 | 1 | 11 | 11 |
+------+------+------+------+------+------+------+
It is not considered an error for an element to be tagged but not referenced.
A substructure with internal sharing may be created. If such a substructure is closed with respect to sharing -- that is, all references to its tagged elements are within the substructure -- then there is no need for the knowledge of the sharing to propagate up the hierarchy of lists. For example, if the substructure is:
00-LIST ( a b c b )
which with sharing is:
11-LIST ( a T1:b c R1 )
When this substructure is included in a large structure the high order bits can be reset since the substructure is closed with respect to sharing. For example:
00-LIST ( x 11-LIST ( a T1:b c R1 ) y )
Note: While sharing adds transmission and memory efficiency, it is costly in processing to separate shared elements. This is the main reason for restricting the sharing supported by the MPM. At some later time these restrictions may be eased.
It is possible to create loops, "strange loops" and "tangled hierarchies" using this mechanism [32]. The MPM will not check for such improper structures within documents, and will not deliver messages involved in such structures between documents.
If an encryption scheme is used to ensure the privacy of communication it is unlikely that any parts of the message can be shared. This is due to the fact that in most case the encryption keys will be specific between two individuals. There may be a few cases where encrypted data may be shared. For example, all the members of a committee may use a common key when acting on committee business, or in a public key scheme a document may be "signed" using the private key of the sender and inspected by anyone using the public key of the sender.