Components

General components structure

Each information element (IE) within a component has the same structure. An IE consists of three fields, which always appear in the following order. The Tag distinguishes one type from another and governs the interpretation of the Contents. The Contents is the substance of the element, containing the primary information the element is intended to convey.

                Component               Information element (IE)
          +---------------------+     +---------------------+
          | Information element |     |         Tag         |
          +---------------------+     +---------------------+
          |                     |     |        Length       | of the Contents
          +---------------------+     +---------------------+
          | Information element |     |        Contents     |
          +---------------------+     +---------------------+
          |                     |     |                     |
          +---------------------+     +---------------------+
Each field is coded using one or more octets. Octets and bits are labelled as shown in Figure:
          +---------------------+ octet1
          |                     | first transmitted          LSB
          +---------------------+                            first transmitted
          |                     | octet2       H G F E D C B A
          +---------------------+             +-+-+-+-+-+-+-+-+
          |                     |             | | | | | | | | | octet
          +---------------------+             +-+-+-+-+-+-+-+-+
          |                     | octetn
          +---------------------+
The contents of each element is either one value (Primitive) or one or more information element (Constructor), as shown in Figure:
                 Primitive                  Constructor
          +---------------------+     +---------------------+
          |        Tag          |     |         Tag         |
          +---------------------+     +---------------------+
          |       Length        |     |        Length       |
          +---------------------+     +---------------------+
          |      Contents       |     |        Contents     |
          +---------------------+     +---------------------+
          |                     |     |                     |
          +---------------------+     +---------------------+
                                      |         Tag         |
                                      +---------------------+
                                      |        Length       |
                                      +---------------------+
                                      |       Contents      |
                                      +---------------------+


Tags

An information element is first interpreted according to its position within the syntax of the message. The Tag distinguishes one information element from another and governs the interpretation of the Contents. It is one or more octets in length. The Tag is composed of "Class", "Form" and "Tag code", as shown in the following figure:

            H    G    F    E    D    C    B    A
           +------+------+-----------------------+
           |Class | Form |      Tag code         |
           +------+------+-----------------------+

The tag code may be extended to the following octet(s).
Tag class

HG
00  - Universal
01  - Application-wide
10  - Context-specific
11  - Private use
The universal class is used for Tags that are exclusively standardized in Recommendation X.209 and are application independent types. Universal Tags may be used anywhere a universal information element type is used. The universal class applies across all CCITT Recommendations, i.e. across CCITT Signalling System No. 7 ASEs, X.400 MHS, etc. The Application-wide class is used for IEs that are standardized across all applications (ASEs) using CCITT Signalling System No. 7. The Context-specific class is used for IEs that are specified within the context of the next higher construction and take into account the sequence of other information elements within the same construction. This class may be used for tag s in a construction, and the tags may be re-used in any other construction. The Private Use class is reserved for IEs elements specific to a nation, a network or a private user. Such information elements are beyond the scope of this Recommendation.

Form of the IE

Bit F is used to indicate whether the element is "Primitive" or "Constructor". A primitive element is one whose structure is atomic (i.e. one value only). A constructor element is one whose content is one or more IEs which may themselves be constructor elements.

F
0  - Primitive
1  - Constructor
Tag code

Bits A to E of the first octet of the Tag plus any extension octets represent a Tag code that distinguishes one element type from another of the same class. Tag codes in the range 00000 to 11110 (0 to 30 decimal) are provided in one octet. The extension mechanism is to code bits A to E of the first octet as 11111. Bit H of the following octet serves as an extension indicator. If bit H of the extension octet is set to 0, then no further octets for this tag are used. If bit H is set to 1, the following octet is also used for extension of the Tag code. The resultant Tag consists of bits A to G of each extension octet, with bit G of the first extension octet being most significant and bit A of the last extension octet being least significant. T ag code 31 is encoded as 0011111 in bits G to A of a single extension octet. Higher tag codes continue from this point using the minimum possible number of extension octets.

         One-octet format                               Extended format
 +------+------+-----------------------+     +------+------+-----------------------+
 |Class | Form |Tag code (00000-11110) |     |Class | Form | Tag code  11111       |
 +------+------+-----------------------+     +-----++------+-----------------------+
                                             |ext 1|                   MSB         |
                                             +-----+-------------------------------+
                                             |     |                               |
                                             +-----+-------------------------------+
                                             |ext 0|                           LSB |
                                             +-----+-------------------------------+

Length of the contents

The length of the contents is coded to indicate the number of octets in the contents. The length does not include the Tag nor the length of the contents octets. The length of the contents uses the short, long or indefinite form. If the length is less than 128 octets, the short form is used. In the short form, bit H is coded 0, and the length is encoded as a binary number using bits A to G. If the length is greater than 127 octets, then the long form of the length of the contents is used. The long form length is from 2 to 127 octets long. Bit H of the first octet is coded 1, and bits A to G of the first octet encode a number one less than th e size of the length in octets as an unsigned binary number whose MSB and LSB are bits G and A, respectively. The length itself is encoded as an unsigned binary number whose MSB and LSB are bit H of the second octet and Bit A of the last octet, respective ly. This binary number should be encoded in the fewest possible octets, with no leading octets having the value 0. The indefinite form is one octet long and may (but need not) be used in place of the short or long form, whenever the element is a constructor. It has the value 10000000. When this form is employed, a special End-of-Contents (EOC) indicator terminates the contents. There is no notation for the end-of-contents indicator. Although considered part of the contents syntactically, the end-of-contents indicator has no semantic significance. The representation for the end-of-contents indicator is an element whose class is universal, whose form is primitive, whose ID code has the value 0, and whose contents is unused and absent:

EOC          Length     Contents
00 (hex)     00 (hex)   Absent
The maximum value that may be encoded is constrained by the network message size limitations in the connectionless case.

         Short form                                     Extended format
 +---+---------------------------------+     +---+---------------------------------+
 | 0 |MSB  Length of contents      LSB |     | 1 |MSB  Lenght field size-1      LSB|
 +---+---------------------------------+     +---+---------------------------------+
                                             |    MSB                              |
                                             +-------------------------------------+
                                             |    Length of contents               |
                                             +-------------------------------------+
                                             |                                 LSB |
                                             +-------------------------------------+

            Indefinite form
 +-------------------------------------+
 |       Constructor element tag       |
 +-------------------------------------+
 |       L=10000000                    |
 +-------------------------------------+
 |       Tag                           |
 |    Lenght (short,long or indefinite |
 |       Contents                      |
 +-------------------------------------+

 |               ...                   |

 +-------------------------------------+
 |       Tag                           |
 |    Lenght (short,long or indefinite |
 |       Contents                      |
 +-------------------------------------+
 |       EOC Tag                       |
 |       0000 0000                     |
 +-------------------------------------+
 |       EOC Lenght                    |
 |       0000 0000                     |
 +-------------------------------------+
Contents

The contents is the substance of the element and contains the information the element is intended to convey. Its length is variable, but always an integral number of octets. The contents is interpreted in a type-dependent manner, i.e. according to the tag value.

Encoding of Component(s)

The description is divided in two sub-items: