Network Operations and Control Wiki
Register
Advertisement

Background: Know: INTEGER , OCTET STRING Recognize: Prerequisites - programming languages - enumerations

Up
Previous Next
Down

Subtypes[]

Usually the engineers care about only some subset of the values of an ASN.1 type in some situation rather than all the values of the ASN.1 type. For example, when calculating the grades of the students in class, only the numbers in the range 0 to 100 are used. In order to make it easy to define these small ranges, ASN.1 allows subtyping, which make it possible for a user to specify values within the range of values of a type. This makes the ASN.1 high-level of programming languages and widely used by different kinds of machines.

Syntax of the subtypes of ASN.1[]

<subtype name> ::=<type> ( <constraint> );

Syntax of the subtypes of ASN.1 can be done by adding to the notation for the parent type a suitable subtype specification. A subtype specification consists of one or more subtype value sets, separated by "|" (pronounced "or"). The whole list is in round brackets(()). For example:

Summer ::= Months (june | july | august );

The type Summer is defined by appending a subtype specification to a parent type Months. The subtype specification(the expression in round brackets) defines which of the values of Months are also to be Summer.

Forms of notation of subtype[]

ASN.1 defines six forms of notation for value sets, they are SingleValue, ContainedSubtype, ValueRange, PermittedAlphabet, SizeConstraint and InnerType.

SingleValue: If each value of the subtype specification(the expression in round brackets) is the single value of the parent types, then this forms of notation is SingleValue.

ContainedSubtype:The contained subtype notation must contain the word "INCLUDES",followed by other subtypes that must in the same parent type.

ValueRange:If each value of the subtype specification(the expression in round brackets) is the range value of the parent types, which contains the lower and upper bound of the range, then this forms of notation is ValueRange.

PermittedAlphabet:This form can be used only to character string types and only allows the values from some subset of the characters.

SizeConstraint:It can be used in whose values have a defined size.

InnerType:It can be used to define value sets of structured types.

You can find some examples,applicability and detail information about different kinds of forms in this page.

Reference[]

[1].http://www.obj-sys.com/asn1tutorial/node18.html

[2].http://www.bgbm.org/tdwg/acc/Documents/asn1gloss.htm

[3].http://www.strongsec.com/zhw/KSy_ASN1.pdf

Advertisement