IEC 61334-6:2000
(Main)Distribution automation using distribution line carrier systems - Part 6: A-XDR encoding rule
Distribution automation using distribution line carrier systems - Part 6: A-XDR encoding rule
Defines a set of encoding rules that may be used to derive the specification of a transfer syntax for values of types defined in the DLMS core standard using the ASN.1 notation (see IEC 61334-4-41).
This publication is of high relevance for Smart Grid.
Automatisation de la distribution à l'aide de systèmes de communication à courants porteurs - Partie 6: Règles d'encodage A-XDR
Définit un ensemble de règles de codage susceptibles d'être utilisées pour obtenir la spécification d'une syntaxe de transfert pour les valeurs de types définis dans la norme principale DLMS à l'aide de la notation ASN.1 (voir la CEI 61334-4-41).
General Information
- Status
- Published
- Publication Date
- 15-Jun-2000
- Technical Committee
- TC 57 - Power systems management and associated information exchange
- Drafting Committee
- WG 9 - TC 57/WG 9
- Current Stage
- PPUB - Publication issued
- Start Date
- 22-Jun-2000
- Completion Date
- 15-Jul-2000
Overview
IEC 61334-6:2000 is an international standard developed by the International Electrotechnical Commission (IEC) focused on distribution automation using distribution line carrier systems. This part 6 of the IEC 61334 series defines the A-XDR encoding rule, an important set of encoding rules used for specifying the transfer syntax of data types defined in the DLMS (Device Language Message Specification) core standard, employing ASN.1 (Abstract Syntax Notation One) notation.
Primarily, IEC 61334-6 addresses the need for efficient and standardized encoding mechanisms in smart grid communication systems. The standard provides detailed rules and procedures that enable interoperable and compact data transfer in automated power distribution networks.
Key Topics
The standard elaborates on several crucial technical areas relating to the A-XDR encoding rule:
General Characteristics of A-XDR
Describes the features and purpose of the A-XDR encoding approach, designed to reduce redundancy compared to traditional Basic Encoding Rules (BER).Encoding Structure
Details the structure of encoding comprising three main fields: Identifier, Length, and Contents, explaining how each contributes to constructing encoded data.Encoding Rules and Procedures
Comprehensive rules for encoding various ASN.1 data types such as INTEGER, BOOLEAN, ENUMERATED, BIT STRING, OCTET STRING, CHOICE, SEQUENCE, SEQUENCE OF, VisibleString, GeneralizedTime, and NULL. This includes handling optional and default components as well as implicit and explicit tagging.Extensibility and Compatibility
Informative annexes provide insights on making A-XDR encoding extensible and adaptable to evolving communication requirements in distribution automation.Examples of Encoding
Practical encoding examples for DLMS protocol data units (PDUs) demonstrate real-world usage of A-XDR.
Applications
IEC 61334-6:2000 has significant practical relevance for modern Smart Grid implementations:
Efficient Data Communication
Facilitates optimized encoding of data types for transmission over power line carrier systems, ensuring minimal bandwidth use with reduced redundancy.Interoperability in Distribution Automation
Supports integration of devices and systems from different vendors by standardizing data transfer syntax, critical in automated power distribution networks.Smart Metering and Remote Device Management
Enables reliable and consistent communication of metering data and control commands, enhancing grid monitoring and management.DLMS/COSEM Protocol Implementation
Defines encoding rules essential for implementing DLMS standards in energy management systems, enabling cross-industry adoption.
Overall, the standard underpins secure and standardized communication infrastructure that is critical for the reliable operation of power systems and smart grid networks.
Related Standards
Professionals engaged with IEC 61334-6 should also consider familiarizing themselves with related documents for comprehensive understanding and implementation:
IEC 61334-4-41
Defines DLMS core standard data types, which IEC 61334-6 builds upon for encoding specification.ITU-T X.208 / ASN.1
The foundational notation and syntax rules defining Abstract Syntax Notation One used for data type specification.ITU-T X.209 / BER (Basic Encoding Rules)
The original encoding rules on which the A-XDR encoding rule is based but optimized for better efficiency in specific use cases.IEC 60050
International Electrotechnical Vocabulary (IEV) for standardized terminology relevant to electrotechnical domains.IEC 60027 / IEC 60417 / IEC 60617
Standardized symbols and graphical representations used throughout electrical and electronic documentation.
These complementary standards ensure consistency, clarity, and mutual compatibility within smart grid communication and distribution automation technologies.
IEC 61334-6:2000 is a foundational standard for developers, engineers, and system integrators seeking robust, interoperable, and efficient communication protocols in power distribution automation and smart grid systems. Adherence to this standard ensures alignment with internationally recognized best practices, promoting sustainable and future-proof grid modernization efforts.
Get Certified
Connect with accredited certification bodies for this standard

Intertek Testing Services NA Inc.
Intertek certification services in North America.
TL 9000 QuEST Forum
Telecommunications quality management system.

UL Solutions
Global safety science company with testing, inspection and certification.
Sponsored listings
Frequently Asked Questions
IEC 61334-6:2000 is a standard published by the International Electrotechnical Commission (IEC). Its full title is "Distribution automation using distribution line carrier systems - Part 6: A-XDR encoding rule". This standard covers: Defines a set of encoding rules that may be used to derive the specification of a transfer syntax for values of types defined in the DLMS core standard using the ASN.1 notation (see IEC 61334-4-41). This publication is of high relevance for Smart Grid.
Defines a set of encoding rules that may be used to derive the specification of a transfer syntax for values of types defined in the DLMS core standard using the ASN.1 notation (see IEC 61334-4-41). This publication is of high relevance for Smart Grid.
IEC 61334-6:2000 is classified under the following ICS (International Classification for Standards) categories: 29.240.20 - Power transmission and distribution lines; 33.200 - Telecontrol. Telemetering. The ICS classification helps identify the subject area and facilitates finding related standards.
IEC 61334-6:2000 is available in PDF format for immediate download after purchase. The document can be added to your cart and obtained through the secure checkout process. Digital delivery ensures instant access to the complete standard document.
Standards Content (Sample)
NORME CEI
INTERNATIONALE IEC
61334-6
INTERNATIONAL
Première édition
STANDARD
First edition
2000-06
Automatisation de la distribution à l'aide
de systèmes de communication
à courants porteurs –
Partie 6:
Règles d'encodage A-XDR
Distribution automation using distribution
line carrier systems –
Part 6:
A-XDR encoding rule
Numéro de référence
Reference number
CEI/IEC 61334-6:2000
Numéros des publications Numbering
Depuis le 1er janvier 1997, les publications de la CEI As from 1 January 1997 all IEC publications are
sont numérotées à partir de 60000. issued with a designation in the 60000 series.
Publications consolidées Consolidated publications
Les versions consolidées de certaines publications de Consolidated versions of some IEC publications
la CEI incorporant les amendements sont disponibles. including amendments are available. For example,
Par exemple, les numéros d’édition 1.0, 1.1 et 1.2 edition numbers 1.0, 1.1 and 1.2 refer, respectively, to
indiquent respectivement la publication de base, la the base publication, the base publication incor-
publication de base incorporant l’amendement 1, et la porating amendment 1 and the base publication
publication de base incorporant les amendements 1 incorporating amendments 1 and 2.
et 2.
Validité de la présente publication Validity of this publication
Le contenu technique des publications de la CEI est The technical content of IEC publications is kept
constamment revu par la CEI afin qu'il reflète l'état under constant review by the IEC, thus ensuring that
actuel de la technique. the content reflects current technology.
Des renseignements relatifs à la date de reconfir- Information relating to the date of the reconfirmation
mation de la publication sont disponibles dans le of the publication is available in the IEC catalogue.
Catalogue de la CEI.
Les renseignements relatifs à des questions à l’étude et Information on the subjects under consideration and
des travaux en cours entrepris par le comité technique work in progress undertaken by the technical
qui a établi cette publication, ainsi que la liste des committee which has prepared this publication, as well
publications établies, se trouvent dans les documents ci- as the list of publications issued, is to be found at the
dessous: following IEC sources:
• «Site web» de la CEI* • IEC web site*
• Catalogue des publications de la CEI • Catalogue of IEC publications
Publié annuellement et mis à jour Published yearly with regular updates
régulièrement
(Catalogue en ligne)* (On-line catalogue)*
• Bulletin de la CEI • IEC Bulletin
Disponible à la fois au «site web» de la CEI* Available both at the IEC web site* and
et comme périodique imprimé as a printed periodical
Terminologie, symboles graphiques Terminology, graphical and letter
et littéraux symbols
En ce qui concerne la terminologie générale, le lecteur For general terminology, readers are referred to
se reportera à la CEI 60050: Vocabulaire Electro- IEC 60050: International Electrotechnical Vocabulary
technique International (VEI). (IEV).
Pour les symboles graphiques, les symboles littéraux For graphical symbols, and letter symbols and signs
et les signes d'usage général approuvés par la CEI, le approved by the IEC for general use, readers are
lecteur consultera la CEI 60027: Symboles littéraux à referred to publications IEC 60027: Letter symbols to
utiliser en électrotechnique, la CEI 60417: Symboles be used in electrical technology, IEC 60417: Graphical
graphiques utilisables sur le matériel. Index, relevé et symbols for use on equipment. Index, survey and
compilation des feuilles individuelles, et la CEI 60617: compilation of the single sheets and IEC 60617:
Symboles graphiques pour schémas. Graphical symbols for diagrams.
* Voir adresse «site web» sur la page de titre. * See web site address on title page.
NORME CEI
INTERNATIONALE IEC
61334-6
INTERNATIONAL
Première édition
STANDARD
First edition
2000-06
Automatisation de la distribution à l'aide
de systèmes de communication
à courants porteurs –
Partie 6:
Règles d'encodage A-XDR
Distribution automation using distribution
line carrier systems –
Part 6:
A-XDR encoding rule
IEC 2000 Droits de reproduction réservés Copyright - all rights reserved
Aucune partie de cette publication ne peut être reproduite ni No part of this publication may be reproduced or utilized in
utilisée sous quelque forme que ce soit et par aucun procédé, any form or by any means, electronic or mechanical,
électronique ou mécanique, y compris la photocopie et les including photocopying and microfilm, without permission in
microfilms, sans l'accord écrit de l'éditeur. writing from the publisher.
International Electrotechnical Commission 3, rue de Varembé Geneva, Switzerland
Telefax: +41 22 919 0300 e-mail: inmail@iec.ch IEC web site http://www.iec.ch
CODE PRIX
Commission Electrotechnique Internationale
W
PRICE CODE
International Electrotechnical Commission
Pour prix, voir catalogue en vigueur
For price, see current catalogue
– 2 – 61334-6 © CEI:2000
SOMMAIRE
Pages
AVANT-PROPOS . 4
INTRODUCTION .6
Articles
1 Domaine d'application et objet. 8
2 Références normatives. 8
3 Caractéristiques générales d’A-XDR. 10
4 Structure d'un codage . 10
5 Règles pour le codage. 16
5.1 Le champ Identificateur . 16
5.2 Le champ Longueur . 18
5.3 Le champ Contenu . 18
6 Procédures de codage . 20
6.1 Codage d'une valeur INTEGER . 20
6.2 Codage de la valeur BOOLEAN . 26
6.3 Codage d'une valeur ENUMERATED. 28
6.4 Codage d'une valeur BIT STRING . 28
6.5 Codage d'une valeur OCTET STRING . 30
6.6 Codage de la valeur CHOICE . 34
6.7 Types étiquetés (étiquetage implicite, explicite et explicite ASN.1) . 36
6.8 Composants OPTIONAL et DEFAULT . 40
6.9 Codage d'une valeur SEQUENCE. 42
6.10 Codage d'une valeur SEQUENCE OF. 44
6.11 Codage du type VisibleString. 48
6.12 Codage du type de GeneralizedTime . 50
6.13 Codage de la valeur/du type NULL ASN.1. 50
Annexe A (informative) Extensibilité. 52
Annexe B (informative) Types et mots-clefs de l'ASN.1 utilisés en DLMS . 54
Annexe C (informative) Exemples de codage A-XDR pour les PDU DLMS. 56
Figure 1 – Structure de base de l’encodage BER . 10
Figure 2 – Structure d'un codage BER construit . 12
Figure 3 – Structure d'un codage A-XDR construit. 12
Figure 4 – Structure du codage d'un nombre entier de longueur variable . 24
61334-6 © IEC:2000 – 3 –
CONTENTS
Page
FOREWORD . 5
INTRODUCTION .7
Clause
1 Scope and object . 9
2 Normative references . 9
3 General characteristics of A-XDR . 11
4 Structure of an encoding . 11
5 Rules for encoding . 17
5.1 The Identifier field . 17
5.2 The Length field . 19
5.3 The Contents field. 19
6 Encoding procedures. 21
6.1 Encoding of an INTEGER value. 21
6.2 Encoding of a BOOLEAN value . 27
6.3 Encoding of an ENUMERATED value . 29
6.4 Encoding of a BIT STRING value . 29
6.5 Encoding of an BYTE STRING value . 31
6.6 Encoding of a CHOICE value. 35
6.7 Tagged types (implicit, explicit and ASN.1 explicit tagging) . 37
6.8 OPTIONAL and DEFAULT components . 41
6.9 Encoding of a SEQUENCE value. 43
6.10 Encoding of a SEQUENCE OF value . 45
6.11 Encoding of the VisibleString type . 49
6.12 Encoding of the GeneralizedTime type . 51
6.13 Encoding of the ASN.1 NULL type/value . 51
Annex A (informative) Extensibility. 53
Annex B (informative) ASN.1 types and keywords used in DLMS. 55
Annex C (informative) Examples of A-XDR encoding for DLMS PDUs . 57
Figure 1 – The basic BER structure . 11
Figure 2 – The structure of a constructed BER encoding . 13
Figure 3 – The structure of a constructed A-XDR encoding . 13
Figure 4 – Structure of the variable-length integer encoding . 25
– 4 – 61334-6 © CEI:2000
COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE
____________
AUTOMATISATION DE LA DISTRIBUTION À L'AIDE DE SYSTÈMES
DE COMMUNICATION À COURANTS PORTEURS –
Partie 6: Règles d'encodage A-XDR
AVANT-PROPOS
1) La CEI (Commission Électrotechnique Internationale) est une organisation mondiale de normalisation composée
de l'ensemble des comités électrotechniques nationaux (Comités nationaux de la CEI). La CEI a pour objet de
favoriser la coopération internationale pour toutes les questions de normalisation dans les domaines de
l'électricité et de l'électronique. A cet effet, la CEI, entre autres activités, publie des Normes internationales.
Leur élaboration est confiée à des comités d'études, aux travaux desquels tout Comité national intéressé par le
sujet traité peut participer. Les organisations internationales, gouvernementales et non gouvernementales, en
liaison avec la CEI, participent également aux travaux. La CEI collabore étroitement avec l'Organisation
Internationale de Normalisation (ISO), selon des conditions fixées par accord entre les deux organisations.
2) Les décisions ou accords officiels de la CEI concernant les questions techniques représentent, dans la mesure
du possible, un accord international sur les sujets étudiés, étant donné que les Comités nationaux intéressés
sont représentés dans chaque comité d’études.
3) Les documents produits se présentent sous la forme de recommandations internationales. Ils sont publiés
comme normes, spécifications techniques, rapports techniques ou guides et agréés comme tels par les Comités
nationaux.
4) Dans le but d'encourager l'unification internationale, les Comités nationaux de la CEI s'engagent à appliquer de
façon transparente, dans toute la mesure possible, les Normes internationales de la CEI dans leurs normes
nationales et régionales. Toute divergence entre la norme de la CEI et la norme nationale ou régionale
correspondante doit être indiquée en termes clairs dans cette dernière.
5) La CEI n’a fixé aucune procédure concernant le marquage comme indication d’approbation et sa responsabilité
n’est pas engagée quand un matériel est déclaré conforme à l’une de ses normes.
6) L’attention est attirée sur le fait que certains des éléments de la présente Norme internationale peuvent faire
l’objet de droits de propriété intellectuelle ou de droits analogues. La CEI ne saurait être tenue pour
responsable de ne pas avoir identifié de tels droits de propriété et de ne pas avoir signalé leur existence.
La norme internationale CEI 61334-6 a été préparé par le comité technique 57 de la CEI:
Conduite des systèmes de puissance et communications associées.
Le texte de cette norme est issu des documents suivants:
FDIS Rapport de vote
57/451/FDIS 57/474/RVD
Le rapport de vote indiqué dans le tableau ci-dessus donne toute information sur le vote ayant
abouti à l'approbation de cette norme.
Cette publication a été rédigée selon les Directives ISO/CEI, Partie 3.
Les annexes A, B et C sont données uniquement à titre d'information.
Le comité a décidé que le contenu de cette publication ne sera pas modifié avant 2003.
A cette date, la publication sera
reconduite;
supprimée;
remplacée par une édition révisée, ou
amendée.
61334-6 © IEC:2000 – 5 –
INTERNATIONAL ELECTROTECHNICAL COMMISSION
____________
DISTRIBUTION AUTOMATION
USING DISTRIBUTION LINE CARRIER SYSTEMS –
Part 6: A-XDR encoding rule
FOREWORD
1) The IEC (International Electrotechnical Commission) is a worldwide organization for standardization comprising
all national electrotechnical committees (IEC National Committees). The object of the IEC is to promote
international co-operation on all questions concerning standardization in the electrical and electronic fields. To
this end and in addition to other activities, the IEC publishes International Standards. Their preparation is
entrusted to technical committees; any IEC National Committee interested in the subject dealt with may
participate in this preparatory work. International, governmental and non-governmental organizations liaising
with the IEC also participate in this preparation. The IEC collaborates closely with the International Organization
for Standardization (ISO) in accordance with conditions determined by agreement between the two
organizations.
2) The formal decisions or agreements of the IEC on technical matters express, as nearly as possible, an
international consensus of opinion on the relevant subjects since each technical committee has representation
from all interested National Committees.
3) The documents produced have the form of recommendations for international use and are published in the form
of standards, technical specifications, technical reports or guides and they are accepted by the National
Committees in that sense.
4) In order to promote international unification, IEC National Committees undertake to apply IEC International
Standards transparently to the maximum extent possible in their national and regional standards. Any
divergence between the IEC Standard and the corresponding national or regional standard shall be clearly
indicated in the latter.
5) The IEC provides no marking procedure to indicate its approval and cannot be rendered responsible for any
equipment declared to be in conformity with one of its standards.
6) Attention is drawn to the possibility that some of the elements of this International Standard may be the subject
of patent rights. The IEC shall not be held responsible for identifying any or all such patent rights.
International Standard IEC 61334-6 has been prepared by IEC technical committee 57: Power
system control and associated communications.
The text of this standard is based on the following documents:
FDIS Report on voting
57/451/FDIS 57/474/RVD
Full information on the voting for the approval of this standard can be found in the report on
voting indicated in the above table.
This publication has been drafted in accordance with the ISO/IEC Directives, Part 3.
Annexes A, B and C are for information only.
The committee has decided that the contents of this publication will remain unchanged until
2003. At this date, the publication will be
reconfirmed;
withdrawn;
replaced by a revised edition, or
amended.
– 6 – 61334-6 © CEI:2000
INTRODUCTION
La Recommandation UIT-T X.208 spécifie un langage formel (ASN.1 = notation de syntaxe
abstraite numéro Un) permettant aux spécifications de la couche d'application de définir les
1)
types d'information qu'elles souhaitent échanger. Une représentation de cette information
peut être obtenue en appliquant un ensemble de règles de codage aux valeurs des types
définis à l'aide de la notation ASN.1. L'application de ces règles de codage donne une syntaxe
de transfert pour ces valeurs.
Bien qu'un grand nombre d’ensembles de règles de codage puissent être imaginés, pendant
longtemps, seul un ensemble – l’encodage BER = Basic Encoding Rules (règles de codage de
base) – a été normalisé (voir la Recommandation UIT-T X.209). C’est surtout dû au fait qu’il
est relativement bien adapté à une large gamme d'applications. Cependant, dans certains cas
particuliers, l’encodage BER peut présenter clairement certaines redondances. Eviter ces
redondances en fournissant des règles de codage alternatives pour ce type de cas est le but
de nouvelles normes de syntaxes de transfert récemment développées (DER, CER, PER). En
fait, le but n'est pas de fournir des alternatives générales à l’encodage BER mais plutôt des
alternatives spécialisées, qui soient plus appropriées que l’encodage BER dans des cas
particuliers.
Contrairement à ces règles de codage pour une utilisation générale, la présente norme spécifie
un nouvel ensemble de règles de codage pour une utilisation spécifique – A-XDR – qui
s'adapte le mieux au contexte DLMS (voir CEI 61334-4-41). L'objectif principal est de coder les
PDU (unités de données du protocole) DLMS de telle sorte que le nombre des octets et la
complexité de codage/décodage – longueur du code nécessaire, performance et temps de
2)
traitement – des PDU soient optimisés . Cet objectif est atteint par deux principes de base:
a) A-XDR spécifie des règles de codage seulement pour une sous-ensemble de types ASN.1:
il s'agit du sous-ensemble utilisé pour la spécification DLMS (c'est la raison pour laquelle
A-XDR est prévue pour des utilisations spécifiques).
b) A-XDR spécifie des règles de codage orientées octets.
–––––––––
1)
L'ASN.1 spécifie également une notation pour la spécification de la valeur d'un type défini.
2)
Lorsque l'on considère seulement la taille des PDU, le PER est plus performant qu'A-XDR. Cependant, cette
meilleure performance de compactage – objectif principal de PER – est obtenue par une utilisation beaucoup
plus importante de champs de bits au lieu de champs d'octets pour coder des valeurs différentes. Pour réduire
encore la taille des codes, la variante la plus complexe des PER (le PER non aligné) bénéficie également de la
limitation de valeurs de types contraints. On gagne ainsi en compacité au détriment du temps de calcul. De
plus, les deux variantes de PER (alignée et non alignée) sont incompatibles, et il est recommandé que les
applications supportent les deux variantes. Cette complexité signifie que PER n‘est pas optimal pour le contexte
DLMS. Les règles de codage «plus légères» d'A-XDR sont plus adaptées à cet environnement simple, qui est
dans certains cas très pauvre en ressources.
61334-6 © IEC:2000 – 7 –
INTRODUCTION
ITU-T Recommendation X.208 specifies a formal language (ASN.1 = Abstract Syntax Notation
1)
One) which enables application layer specifications to define the types of information they
need to exchange. A representation of this information can be derived by applying a set of
encoding rules to values of types defined using the ASN.1 notation. Application of these
encoding rules produces a transfer syntax for such values.
Although many such sets of encoding rules could be imagined, for a long time only one single
set – the BER = Basic Encoding Rules – has been standardized (see ITU-T Recommendation
X.209). This is mainly because BER is quite adequate for a wide range of applications. On the
other hand, in some particular cases, BER can obviously be redundant. Avoiding this
redundancy by providing alternative encoding rules for those particular cases is the scope of
some recently developed new transfer syntax standards (DER, CER, PER). Clearly, the aim is
not to provide general-purpose, but rather specialized, alternatives to the BER, which are more
suitable than the BER in some respects.
Contrary to these general-purpose encoding rules, this standard specifies a new, special-
purpose set of encoding rules – A-XDR – which fits in best with the DLMS context (see
IEC 61334-4-41). The principal objective is to encode DLMS PDUs in such a way that the
PDUs byte count and encoding/decoding complexity – the length of the required code, its
2)
processing performance and time – are optimized . This objective is fulfilled by two basic
principles.
a) A-XDR specifies encoding rules only for a subset of ASN.1 types: for the subset which is
used for the DLMS specification. (That is why A-XDR is special-purpose.)
b) A-XDR specifies byte-oriented encoding rules.
——————
1)
ASN.1 also specifies a notation for the specification of the value of a defined type.
2)
With respect to the PDU size only, PER over-performs A-XDR. However, this better compacting performance –
the principal objective of PER – is achieved by a much more extensive use of bit fields instead of byte fields to
encode different values. To reduce encoding sizes further, the more complex PER variant (the Unaligned PER)
also benefits from the limitation of values of constrained types. Gain on compactness is thus obtained at the
expense of computational overhead. Furthermore, PER comes with two, incompatible variants (Aligned and
Unaligned), and it is recommended that implementations should support both of them. This complexity means
that PER is not optimal for the DLMS context. The 'lighter-weight' A-XDR encoding rules are more suitable to
that simple environment, which is in some cases very poor in resources.
– 8 – 61334-6 © CEI:2000
AUTOMATISATION DE LA DISTRIBUTION À L'AIDE DE SYSTÈMES
DE COMMUNICATION À COURANTS PORTEURS –
Partie 6: Règles d'encodage A-XDR
1 Domaine d'application et objet
La présente partie de la CEI 61334 définit un ensemble de règles de codage – les règles de
3)
codages A-XDR – susceptibles d'être utilisées pour obtenir la spécification d'une syntaxe de
transfert pour les valeurs de types définis dans la norme principale DLMS à l'aide de la
notation ASN.1 (voir la CEI 61334-4-41). Ces règles de codage A-XDR doivent également être
appliquées pour le décodage de cette syntaxe de transfert afin d'identifier les valeurs de
données transférées.
Les règles de codage A-XDR:
• sont utilisées au moment de la communication;
4)
• fournissent un codage optimal pour les PDU DLMS.
NOTE Si A-XDR réussit à assurer un codage optimal pour les PDU DLMS, il sera utilisé comme règle de codage
par défaut pour les protocoles de communication basés DLMS. Néanmoins, les règles de codage par défaut – ainsi
que les règles optionnelles pouvant finalement être utilisées – seront spécifiées dans le document Couche
d'Application du protocole donné (par exemple la CEI 61334-4-42), comme une partie du contexte d'Application.
2 Références normatives
Les documents normatifs suivants contiennent des dispositions qui, par suite de la référence
qui y est faite, constituent des dispositions valables pour la présente partie de la CEI 61334.
Pour les références datées, les amendements ultérieurs ou les révisions de ces publications ne
s’appliquent pas. Toutefois, les parties prenantes aux accords fondés sur la présente partie de
la CEI 61334 sont invitées à rechercher la possibilité d'appliquer les éditions les plus récentes
des documents normatifs indiqués ci-après. Pour les références non datées, la dernière édition
du document normatif en référence s’applique. Les membres de l'ISO et de la CEI possèdent
le registre des Normes internationales en vigueur.
CEI 61334-4-41:1996, Automatisation de la distribution à l'aide de systèmes de communication
à courants porteurs – Partie 4: Protocoles de communication de données – Section 41:
Protocoles d'application – Spécification des messages de ligne de distribution
CEI 61334-4-42:1996, Automatisation de la distribution à l'aide de systèmes de communication
à courants porteurs – Partie 4: Protocoles de communication de données – Section 42:
Protocoles d'application – Couche application
ISO/CEI 8825-2:1997, Technologie de l’information – Règles d’encodage ASN.1: Spécification
des règles de codage condensées (PER)
Recommandation UIT-T X.208:1988, Spécification de la syntaxe abstraite numéro UN (ASN.1)
Recommandation UIT-T X.209:1988, Spécification des règles de codage de base pour la
notation de syntaxe abstraite numéro un (ASN.1)
–––––––––
3)
A-XDR signifie Adapted XDR (XDR adapté) – en fait, ces règles de codage sont déduites d'une norme confirmée
et existante Unix, nommée XDR (eXternal Data Representation = représentation externe des données, rfc 1014).
4)
Voir note de bas de page 2 dans l'introduction.
61334-6 © IEC:2000 – 9 –
DISTRIBUTION AUTOMATION
USING DISTRIBUTION LINE CARRIER SYSTEMS –
Part 6: A-XDR encoding rule
1 Scope and object
3)
This part of IEC 61334 defines a set of encoding rules – the A-XDR encoding rules – that
may be used to derive the specification of a transfer syntax for values of types defined in the
DLMS core standard using the ASN.1 notation (see IEC 61334-4-41). These A-XDR encoding
rules are also to be applied for decoding such a transfer syntax in order to identify the data
values being transferred.
The A-XDR encoding rules
• are used at the time of communication;
4)
• provide optimal encoding for DLMS PDUs.
NOTE Provided that A-XDR ensures optimal encoding for DLMS PDUs, it is intended to be the default encoding
rule for DLMS-based communication protocols. Nevertheless, the default – and also the possibly usable optional –
encoding rules will be specified in the Application Layer document of the given protocol (for example,
IEC 61334-4-42), as part of the Application context.
2 Normative references
The following normative documents contain provisions which, through reference in this text,
constitute provisions of this part of IEC 61334. For dated references, subsequent amendments
to, or revisions of, any of these publications do not apply. However, parties to agreements
based on this part of IEC 61334 are encouraged to investigate the possibility of applying the
most recent editions of the normative documents indicated below. For undated references, the
latest edition of the normative document referred to applies. Members of ISO and IEC maintain
registers of currently valid International Standards.
IEC 61334-4-41:1996, Distribution automation using distribution line carrier systems – Part 4:
Data communication protocols – Section 41: Application protocols – Distribution line message
specification
IEC 61334-4-42:1996, Distribution automation using distribution line carrier systems – Part 4:
Data communication protocols – Section 42: Application protocols – Application layer
ISO/IEC 8825-2:1997, Information technology – ASN.1 Encoding rules: Specification of packed
encoding rules (PER)
ITU-T Recommendation X.208:1988, Specification of Abstract Syntax Notation One (ASN.1)
ITU-T Recommendation X.209:1988, Specification of basic encoding rules for Abstract Syntax
Notation One (ASN.1)
——————
3)
A-XDR stands for Adapted XDR. In fact, these encoding rules are derived from a proven and de facto standard
of the Unix world, called XDR (eXternal Data Representation, rfc1014).
4)
See footnote 2 of the introduction.
– 10 – 61334-6 © CEI:2000
3 Caractéristiques générales d’A-XDR
A-XDR spécifie des règles de codage pouvant être utilisées pour coder et décoder les valeurs
d'une syntaxe abstraite définie comme les valeurs d'un seul type ASN.1 (le type principal). Ce
type ASN.1 est soit un type simple soit un type composé. Un élément d’un type composé peut
être un type simple ou un type composé lui-même.
Les règles de codage A-XDR exploitent le fait que l'émetteur et le récepteur d'une PDU DLMS
utilisent exactement la même spécification de syntaxe abstraite. Alors qu'avec l’encodage
BER, le codage de chaque valeur de tout type d'une syntaxe abstraite est réalisé en style type-
longueur-valeur (TLV), A-XDR code le type et la longueur de la valeur seulement lorsque cette
information est nécessaire. Ceci implique que, sans connaître ce type de valeur codée, il n'est
pas possible de déterminer la structure du codage.
NOTE Cette méthode de codage a pour effet que les règles de codage A-XDR ne sont pas extensibles (voir
annexe A).
Afin qu'A-XDR reste aussi simple que possible, certaines restrictions s'appliquent selon la
syntaxe abstraite à coder, comme suit:
5)
• aucun support de codage n'est fourni pour les types ASN.1 non utilisés en DLMS ;
• il convient que le type CHOICE ASN.1 contienne seulement des composants explicite-
6)
ment étiquetés.
A-XDR spécifie des règles de codage orientées octets. Ceci signifie que chaque partie du
codage – et donc également le codage dans son ensemble – est un nombre entier d'octets.
4 Structure d'un codage
La base du codage BER (voir la Recommandation UIT-T X.209) est une structure composée de
trois parties: type, longueur et valeur comme indiqué à la figure 1. Pour le BER, ces trois
parties sont désignées par identificateur (I), longueur (L) et contenu (C). La partie identificateur
7)
identifie le type, la partie longueur permet de repérer la fin du contenu et la partie contenu
véhicule l'une des valeurs possibles de ce type.
Identificateur Longueur Contenu
IEC 730/2000
Figure 1 – Structure de base de l’encodage BER
8)
Le champ du contenu peut être simplement une série d'octets – codage primitif – ou une
série de codages emboîtés – codage construit – comme indiqué à la figure 2.
–––––––––
5)
L'annexe B énumère les types et les mots-clefs ASN.1 utilisés dans la spécification DLMS.
6)
Les termes «étiquetage explicite» et «étiquetage implicite» ont une signification légèrement différente pour
l'A-XDR que celle spécifiée pour l'ASN.1 et les BER. Le paragraphe 6.7 traite de ces notions et introduit
également le nouveau terme «explicitement étiqueté ASN.1».
7)
En fait, pour les BER, le champ de longueur ne représente pas toujours littéralement la longueur du contenu.
Les BER spécifient deux formes – définie et indéfinie – du champ de longueur. Même si le champ de longueur
représente effectivement le nombre d'octets dans le champ de contenu lorsque la forme définie est utilisée,
pour la forme indéfinie, le champ de longueur indique que le contenu est terminé par des octets fin-de-contenu.
8)
Zéro ou plus.
61334-6 © IEC:2000 – 11 –
3 General characteristics of A-XDR
A-XDR specifies encoding rules which can be used to encode and decode the values of an
abstract syntax defined as the values of a single ASN.1 type (the outermost type). This single
ASN.1 type is either a simple type or a composite type. A component of a composite type may
be a simple type or a composite type itself.
The A-XDR encoding rules exploit the fact that the sender and the receiver of a DLMS PDU are
operating exactly the same specification of the abstract syntax. While with BER the encoding of
every value of any type of abstract syntax is constructed in type-length-value (TLV) style,
A-XDR encodes the type and the length of the value only when this information is necessary.
This implies that without knowledge of the type of value encoded it is not possible to determine
the structure of the encoding.
NOTE This encoding method gives the result that A-XDR encoding rules are not extensible (see annex A).
In order to keep A-XDR as simple as possible, some restrictions apply with respect to the
abstract syntax to be encoded as follows:
5)
• no encoding support is provided for ASN.1 types which are not used in DLMS ;
6)
• the CHOICE ASN.1 type should contain only explicitly tagged components.
A-XDR specifies byte-oriented encoding rules. This means that each part of the encoding – and
therefore also the encoding of the whole – is an integral number of bytes.
4 Structure of an encoding
The basis of BER encoding (see ITU-T Recommendation X.209) is a structure, made up of
three parts: type, length and value, as shown in figure 1. In BER, these three parts are termed
identifier (I), length (L) and contents (C). The identifier part identifies the type, the length part
7)
allows the end of the contents to be found, and the contents part conveys one of the possible
values of that type.
Identifier Length Contents
IEC 730/2000
Figure 1 – The basic BER structure
8)
The contents field can be simply a series of bytes (primitive encoding) or a series of nested
encoding (constructed encoding), as shown in figure 2.
——————
5)
Annex B enumerates the ASN.1 types and keywords which are used in the DLMS specification.
6)
The terms "explicit tagging" and "implicit tagging" have a slightly different meaning in A-XDR than that specified
for ASN.1 and BER. Subclause 6.7 deals with these notions and also introduces the new "ASN.1 explicit
tagging" term.
7)
In fact, for BER, the length field does not always literally represent the length of the contents. BER specifies two
forms (definite and indefinite) of the length field. Although, when the definite form is used, the length field
effectively represents the number of bytes in the contents field, for the indefinite form the length field indicates
that the contents are terminated by end-of-contents bytes.
8)
Zero or more.
– 12 – 61334-6 © CEI:2000
I1 L1 I2 L2 I3 L3 C3 I4 L4 C4 I5 L5 C5 I6 L6 C6
C2
C1
IEC 731/2000
Figure 2 – Structure d'un codage BER construit
Cet emboîtement peut être aussi profond que nécessaire et s'arrête avec un codage primitif ou
avec un codage construit ayant un contenu vide.
A-XDR est basée sur la même structure de codage, mais pour bénéficier du fait que l'émetteur
et le récepteur d'une PDU DLMS utilisent exactement la même spécification de syntaxe
abstraite, A-XDR ne code pas les champs Identificateur (I) et/ou Longueur (L) lorsque ces
champs véhiculent une information redondante (le fait de ne pas coder l'un ou les deux de ces
champs rend le codage ambigu). Un codage A-XDR construit peut donc être de structure
similaire à celle illustrée à la figure 3.
I1 L1 L2 C3 I4 L4 C4 L5 C5 C6 L7 C7 C8 I9 L9 C9
C2
C1
IEC 732/2000
Figure 3 – Structure d'un codage A-XDR construit
61334-6 © IEC:2000 – 13 –
I1 L1 I2 L2 I3 L3 C3 I4 L4 C4 I5 L5 C5 I6 L6 C6
C2
C1
IEC 731/2000
Figure 2 – The structure of a constructed BER encoding
The nesting can be as deep as needed and stops either with a primitive encoding or with a
constructed encoding with empty contents.
A-XDR is based upon the same encoding structure, but in order to benefit from the fact that the
sender and the receiver of a DLMS PDU are operating exactly the same specification of the
abstract syntax, A-XDR does not encode the Identifier (I) and/or the Length (L) fields when
those fields convey redundant information (when not to encode one or both of these fields does
not result in uninterpretable, ambiguous encoding). A constructed A-XDR encoding therefore
results in a structure as shown in figure 3.
I1 L1 L2 C3 I4 L4 C4 L5 C5 C6 L7 C7 C8 I9 L9 C9
C2
C1
IEC 732/2000
Figure 3 – The structure of a constructed A-XDR encoding
– 14 – 61334-6 © CEI:2000
Les règles de codage A-XDR spécifient:
• des règles de codage pour les champs de contenu;
• les conditions pour lesquelles il convient que le champ L soit présent, et le codage de ce
champ;
•
les conditions pour lesquelles il convient que le champ I soit présent, et le codage de ce
champ.
Exemple
En considérant le type composé ASN.1 suivant:
valeur ::= SEQUENCE {
A Integer16,
B Unsigned16
}
Integer16 ::= INTEGER(–32768.32767)
Unsigned16 ::= INTEGER(0.32767)
9)
et en supposant que les valeurs à coder pour A et B soient 0x1234 et 0x5678
respectivement, le codage BER de cette séquence peut donner les séries d'octets suivantes:
30 08 02 02 12 34 02 02 56 78
Identificateur de la SEQUENCE….
Longueur de la SEQUENCE………
Identificateur de A (INTEGER)……
Longueur de A………………………
Valeur de A………………………….
Identificateur de B (INTEGER)……
Longueur de B………………………
………………………….
Valeur de B
Le codage A-XDR de la même séquence est le suivant:
12 34 56 78
I
10)
Identificateur de la SEQUENCE
Valeur de A………………………….
Valeur de B
–––––––––
9)
Le terme 0x… indique que les chiffres suivants sont des chiffres hexadécimaux.
10)
L'A-XDR requiert un identificateur de codage dans des cas particuliers seulement (par exemple, lorsque la
SEQUENCE de cet exemple est l'un des choix d'un type CHOICE).
61334-6 © IEC:2000 – 15 –
A-XDR encoding rules specify
• encoding rules for the contents fields;
• the conditions when the L field should be present, and the encoding of that field;
• the conditions when the I field should be present, and the encoding of that field.
Example
Taking the following ASN.1 composite type:
value ::= SEQUENCE {
A Integer16,
B Unsigned16
}
Integer16 ::= INTEGER(–32768.32767)
Unsigned16 ::= INTEGER(0.32767)
9)
and supposing that the values to be encoded for A and for B are 0x1234 and 0x5678
respectively, the BER encoding of that sequence may result in the following series of bytes:
30 08 02 02 12 34 02 02 56 78
Identifier of the SEQUENCE
Length of the SEQUENCE
Identifier of A (INTEGER)
Length of A
Value of A
Identifier of B (INTEGER)
Length of B
Value of B
A-XDR encoding of the same sequence is as follows:
I 123456 78
10)
Identifier of the SEQUENCE
Value of A
Value of B
——————
9)
The term 0x… indicates that the following digits represent hexadecimal digits.
10)
A-XDR requires encoding identifier only in special cases (for example, when the SEQUENCE of this example is
one of the choices of a CHOICE type).
– 16 – 61334-6 © CEI:2000
5 Règles pour le codage
Le codage A-XDR de tout type ASN.1 donne un nombre entier d'octets contenant chacun huit
bits. Cette série d'octets commence avec le premier octet du codage du champ Identificateur
du type principal ASN.1 – ainsi, cet octet peut être considéré comme l'octet le plus significatif.
Pour les besoins de la présente norme, le schéma d'identification suivant s'applique:
• les octets du codage A-XDR ne sont pas systématiquement numérotés mais parfois –
lorsque ceci facilite la compréhension – des commentaires sont ajoutés (par exemple:
1er octet de la valeur, etc.);
• les bits de chaque octet sont numérotés de 1 à 8, le bit 8 étant le bit de poids fort.
5.1 Le champ Identificateur
L'objectif du champ Identificateur est d'indiquer le type de la valeur codée. Puisque l'émetteur
et le récepteur utilisent exactement la même spécification de syntaxe abstraite, le champ
Identificateur ne véhicule des informations que lorsque:
a) il convient de sélectionner un type de donnée parmi plusieurs alternatives – CHOICE;
b) il convient que la présence d'un composant OPTIONAL dans un type SEQUENCE soit
indiquée;
c) il convient que la présence d'un composant DEFAULT dans un type SEQUENCE soit
indiquée.
Le codage A-XDR ne contient un champ Identificateur que dans ces cas et lorsque la
spécification ASN.1 l'exige (pour l'étiquetage explicite de l'ASN.1, voir 6.7).
Dans le cas a), A-XDR implique que toutes les alternatives du CHOICE soient spécifiées au
niveau ASN.1 comme des types étiquetés explicitement (voir 6.7). Dans ces cas, l'étiquette
codée constitue le champ Identificateur.
Dans les cas b) et c), la présence ou l'absence du composant OPTIONAL ou DEFAULT est
indiquée par un «délimiteur de présence BOOLEAN». Le champ Identificateur pour ces valeurs
de composant est le codage A-XDR de la valeur du délimiteur de présence (voir 6.9).
D'autre part, A-XDR peut être obligé de coder le champ Identificateur lorsque la définition
ASN.1 contient des étiquettes explicites ASN.1 (voir 6.7). Le codage A-XDR de tels types est
défini de façon à être identique à leur codage BER. Ce support a pour objectif de forcer le
codage de la longueur, afin de permettre, par exemple, de contourner facilement certaines
structures. Le champ Identificateur de ces types est la valeur de codage de l'étiquette ASN.1 et
occupe un nombre entier d'octets, au minimum un octet, comme spécifié dans la
Recommandation UIT-T X.209.
61334-6 © IEC:2000 – 17 –
5 Rules for encoding
A-XDR encoding of any ASN.1 type results in an integral number of bytes, each containing
eight bits. This series of bytes begins with the first byte of the encoding of the Identifier field of
the outermost ASN.1 type – in these terms, this byte can be considered as the most significant
byte. For the purpose of this standard, the following identification schema applies:
• the bytes of the A-XDR encoding are not systematically numbered, but sometimes, when it
helps for clear understanding, comments apply (for example, 1 byte of the value, etc.);
• bits of any byte are numbered from 1 to 8, where bit 8 is the most significant.
5.1 The Identifier field
The purpose of the Identifier field is to indicate the type of the encoded value. Provided that the
sender and the receiver are operating exactly the same specification of the abstract syntax, the
Identifier field conveys information only in cases when
a) one type of data should
...




Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...