What Is the Abstract Syntax?

Abstract Syntax Notation (ASN.1) is a formal language that provides a unified representation of network data and is usually used to define the abstract syntax of application data and the structure of application protocol data units. In network management, both the management information structure of the OSI and the SNMP management information base are defined by ASN.1.

The abstract syntax indicates that ASN.1 defines a set of rules for describing the structure of data transmitted on the OSI network. ASN.1 is a formal language that provides a unified representation of network data and is usually used to define the abstract syntax of application data and the structure of application protocol data units. In network management, both the management information structure of the OSI and the SNMP management information base are defined by ASN.1.
In ASN.1, each data type has a tag, which has a type and a value. The data type is uniquely determined by the type and value of the tag. There are four types of tags: the universal tag UNIVERSAL, the application tag APPLICATION, the context-specific tag Context-Specific, and the private tag PRIVATE. There are more than 20 data types defined by ANSI.1, and the label type is UNIVERSAL. Application data defined with ASN.1 must be converted into bit strings according to certain rules during transmission. This rule is the Basic Encoding Rule.
ASN.1 is a standard language jointly developed by the original CCITT and ISO. It is used together with the application layer to transfer data between systems. Define all data structure types required in each application in ASN.1 and group them into libraries. When an application wants to send a data structure, the data structure can be passed to the presentation layer along with its corresponding ASN.1 identity. With the ASN.1 definition as the index, the presentation layer knows the type and size of the domains of the data structure, and encodes them for transmission. At the other end, the receiving presentation layer looks at the ASN.1 identifier of the data structure to understand the domain of the data structure Type and size. In this way, the presentation layer can realize the conversion from the external data format used on the communication line to the internal data format used by the receiving computer.
The combination of the abstract syntax in each application layer protocol and a transmission syntax that can encode it constitutes a Presentation Context. Representation context can be negotiated when the connection is established, or it can be redefined during communication. The presentation layer provides the functionality to define the presentation context.
As a formal language, ASN.1 has strict
Variables represented by ASN.1 must be converted into a serial byte stream in order to be transmitted on the network. The algorithm for converting text ASN.1 syntax to machine-readable code is called Basic Encoding Rules (BER). ASN.1 uses BER to describe the content during transmission. BER is defined in the ISO 8825 / X standard.
The format of the BER transmission syntax is a TLV triplet, that is, <Tag Tag, Length Length, Value>. The Tag field is information about the type of tag and the encoding format; the Length field contains the actual data; the Value field contains the actual data. Each field of the TLV is a series of octets. For the structure, V can also be a TLV triplet.
The BER transmission syntax is based on octets (octets are composed of eight bits, which is the basic unit of encoding). Self-delimited encoding, because L clearly defines the length of the octets. BER is big-endian encoded, and its binary number in the octet ranges from 8 to 1. It is agreed that the 8th bit is the most significant bit, and the 1st bit is the least significant bit.
ASN.1 macros provide the ability to create "templates", which is why ASN.1 macros were introduced. The ASN.1 macro makes the ASN.1 language extensible.

Abstract syntax module definition

The basic unit of ASN.1 is a module, which is used to define an abstract data type. ASN.1 module is actually composed of a set of type definitions and value definitions. A type definition is a format that describes the type's name and type, and a value definition specifies what specific value is assigned to a type. The basic form of a module definition is
<Module Identifier> DEFINITIONS :: =
BEGIN
EXPORTS
Assignment List
END
Where Module Identifier is the module name, and the first letter of the module name must be capitalized. The EXPORTS structure is used to define the types or values that other modules can shift, while the IMPORTS structure specifies that certain definitions in a module are ported from other modules.
The Assignment List section contains all type, value, and macro definitions defined by the module.

Abstract syntax macro representation

ASN.1 macros provide a method for creating "templates" to define macros. MIB objects are defined using macro definition templates. Here's how to define a macro, for which you need to distinguish between 3 different concepts.
Macro representation: A representation mechanism provided by ASN.1 for defining macros.
Macro definition: A macro defined with a macro representation, representing a collection of macro instances.
Macro instance: An instance generated by replacing a variable in a macro definition with a specific value, representing a specific type.
The template form of the macro definition is
<macroname> MACRO :: =
BEGIN
TYPE NOTATION: == <user defined type notation>
VALUE NOTATION: == <user defined value notation>
<supporting syntax>
END
Among them, macroname is the name of the macro and must be all uppercase. The macro definition consists of 3 types: TYPE NOTATION, VALUE NOTATION, and supporting syntax. The last part is optional. It is a detailed syntax description of the types in the macro definition body. All three parts are specified by the Backus-Naur specification. When a specific value is used to replace a variable or parameter in a macro definition, a macro instance is generated, which represents an actual ASN.1 type (called the return type) and specifies the set of values that the type can take (called Is the value returned). Visible macro definitions can be seen as types of types, or supertypes. On the other hand, macro definitions can also be regarded as templates of types, and this template can be used to create many similar and semantically related data types. This is the main use of macro definitions. [3]

IN OTHER LANGUAGES

Was this article helpful? Thanks for the feedback Thanks for the feedback

How can we help? How can we help?