ASN.1以一种高度抽象的形式表示数据结构信息,与具体的平台与编程语言无关,为数据类型(例如:整形,实数,比特,字符串)的定义提供了一种和实现无关的机制。ASN.1使用了对象的概念,对象是定义为具有类型和值的信息实体,可以很容易从一种格式翻译成另一种格式,使用相应得ASN.1工具可以将ASN.1描述的结构化信息映射成某种语言的数据结构表示形式。在数据传输时,ASN.1提供了相应的编码规则,可以利用工具生成的编解码函数将数据结构自动转换为传输所需要的位模式。
ASN.1提供了比普通编程语言更丰富的数据结构,例如子类型(subtype)(如整数类型的范围约束,Integer[0..100]),多种类型的字符串(如PrintableString,IA5String,UTF8String)等。支撑以用以简单成员构建任意复杂结构,支撑嵌套结构以及嵌套结构任意深度从而满足特殊需要。因为ASN.1表示数据的能力比普通编程语言强的多,越复杂的描述信息则越能体现出ASN.1的优越性。
ASN.1 的编码方法比许多与之相竞争的标记系统更先进,它支撑可扩展信息快速可靠的传输 — 在无线宽带中,这是一种优势。
3. 应用状况及前景
l
在GSM系统中,空中接口上传递的补充业务内容采用了ASN.1的BER编码格式,其RRM模块以及其他层3消息均采用CSN.1编码。
l
在3GPP的层3消息体系中,使用ASN.1描述层3消息(包括Uu,Iub,Iur,Iu等接口的层3消息)使用ITU-T建议X.691的各种算法进行编解码,如RRC消息采用UPER编码格式。
l
目前较为成功的ASN.1商用化编译器有OSS企业的“OSS ASN.1 Tools”以及开源的asn1c工具。
l ASN.1在很多涉及信息安全的数据信息系统中均有使用。
BER编码规则:
BER的传输语法格式一直是使用的TLV三元组。
TLV的每个域都是一系列的八位组,对于组合结构,其V还可以是TLV三元组。
TS36.331
当描述一个消息或者一个抽象类型中的信元的出现需求时,例如ASN.1字段中被表述为ASN.1可选项,其被与抽象语法OPTIONAL相连接的多种注释文本标记表述。所有的文字标签只有在下行方向上才可用。每个标签的具体意义如6.1-1。
Abbreviation
Meaning
Cond conditionTag
(Used in downlink only)
Conditionally present
An information element for which the need is specified by means of conditions. For each conditionTag, the need is specified in a tabular form following the ASN.1 segment. In case, according to the conditions, a field is not present, the UE takes no action and where applicable shall continue to use the existing value (and/ or the associated functionality) unless explicitly stated otherwise in the description of the field itself.
Need OP
(Used in downlink only)
Optionally present
An information element that is optional to signal. For downlink messages, the UE is not required to take any special action on absence of the IE beyond what is specified in the procedural text or the field description table following the ASN.1 segment. The UE behaviour on absence should be captured either in the procedural text or in the field description.
Need ON
(Used in downlink only) Optionally present, No action
An information element that is optional to signal. If the message is received by the UE, and in case the information element is absent, the UE takes no action and where applicable shall continue to use the existing value (and/ or the associated functionality).
Need OR
(Used in downlink only)
Optionally present, Release
An information element that is optional to signal. If the message is received by the UE, and in case the information element is absent, the UE shall discontinue/ stop using/ delete any existing value (and/ or the associated functionality).