ASN.1 data types, they nonetheless exist in highly useful, well deployed systems. An example of such a system is the Network File System (NFS) which is implemented on a wide range of platforms. To encode messages among different machines, the NFS uses the External Data Representation (XDR). Unlike the BER, the XDR is optimised for the most common existing machine architectures which makes it more than adequate for many of today's existing applications.
Variable-length encodings are inefficient. First, use of the indefinite length form is inherently problematic for the receiving process - it cannot allocate a fixed-size buffer for incoming data. Furthermore, it forces the receiving process to use a recursive algorithm that implements the BER. Secondly, variable length encodings have a profound influence when the value portion is encoded. Why? Becsue most machine architectures require that common data types obey alignment rules , eg. it might be required that all integer quantities begin on even-numbered addresses. As a result, when decoding a quantity using the BER, all values must be handled an octet at a time - it is usually not possible to take advantage of more efficient word or long-word instructions. The XDR avoids all of this by using fixed-length, word-aligned blocks where all quantities are encoded in blocks that are multiples of 4 octets.
Supporters of the BER may argue that fixed-length encodings as used in XDR are short-sighted. In response one can say that many implementations of the BER are incapable of handling integer quantities larger than the hardware representation on which they are realised.
Values: The encodings of the most commonly used data types, eg INTEGERs, are inefficient. Although it is good to be able to encode values of arbitrary precision, it is not clear if the real applications found in useful systems will need such generality.
XDR encodes an integer quantity using a fixed-length field and uses a simple twos-complement encoding. The BER has excellent generality but is naturally recursive and makes the individual encodings less than optimal.
To wrap up. Because of the great disparity between the encodings used by the BER and the actual hardware representations used today, people wonder if the generalities of ASN.1 and the BER simply cost too much to be used in real systems that make efficient use of the network and offer reasonable response time.
David Smith / dpsmith@tcd.ie