990918-1

Make a comparison between ASN.1/BER, ABNF and DTD/XML as languages for specificaitons of protocol data. What are the main differences, advantages and restrictions of these methods?

Answer

Specification lanugage: ASN.1 and DTD allow the spefication of complex data structures and data types. ASN.1 is more strongly typed than DTD. ABNF is a more low level language for specifying more arbitrary text strings.

The human readability of the specification is a matter of opinion. I personally think that ASN.1 is easy to read and DTD is difficult to read, but other people have other opinions.

Two problems with ABNF is (a) that there are so many different variants of ABNF used in different standards, and (b) that many actual usages of ABNF does not fully specified where, and what kind of "white space" is allowed.

Encoding format: BER allows binary data, while ABNF and XML encodes text strings, binary data can only be included by conversion to text format (base64) or by indirect reference to binary data transported outside the protocol.

Both ABNF and XML have problems with including delimiter characters in the data transported, various kinds of "quoting" is necessary. This is no problem with BER since it uses tag-length-value to encode data sent.

XML data can, combined with style sheets, be displayed by some web browsers. XML can thus be used as a replacement for HTML, while at the same time sending data encoded in an application-specific way.

The human readability of the encoded data is good with XML even without style sheets. With ABNF, it is possible to specify data in more or less human-readable format. Some e-mail header fields, specified with ABNF, like "From:", "Date:" and "Subject:", are quite readable.

Neither BER nor XML does specify one single unique encoding for data, the same data can be encoded in more than one way, which is a disadvantage in some respects. With ABNF, since it is so low-level, data may be uniquely or non-uniquely encoded depending on how it is specified.

Encoded XML data tends to require more octets than BER and ABNF, but on the other hand, XML data is will suited for automatic compression.

List of exam questions