Slide 12 of 41
Notes:
As we saw for the tabular notation from which it was derived, this TLV approach gives many advantages in the design of basic encoding rule.
The presence of a distinct (at least within an enclosing SEQUENCE) “T” part enables a decoder to recognise the presence or absence of OPTIONAL elements.
The presence of a length field allows elements that are arbitrarily many repetitions of a single type (an ASN.1 “SEQUENCE OF” construction).
The presence of a length field makes it easy to make value parts variable length when appropriate, for example character strings. But it also allows integer values to be transmitted with as many octets as are needed, rather than forcing the concept of “short” (two octet) and “long” (four octets) and “super-long” (rather more!) integers into the language. ASN.1 has just one INTEGER type.
Finally, the presence of type and length fields (even when they have values fixed at specification time), means that version 1 systems receiving elements that were only added in version 2 (and who have no knowledge of their specified types or lengths) have a ready means of identifying and skipping version 2 material.
The penalty, however, as noted earlier, is some verbosity.