IEC 62056-4-7:2015
(Main)Electricity metering data exchange - The DLMS/COSEM suite - Part 4-7: DLMS/COSEM transport layer for IP networks
Electricity metering data exchange - The DLMS/COSEM suite - Part 4-7: DLMS/COSEM transport layer for IP networks
IEC 62056-4-7:2015 specifies a connection-less and a connection oriented transport layer (TL) for DLMS/COSEM communication profiles used on IP networks. These TLs provide OSI-style services to the service user DLMS/COSEM AL. The connection-less TL is based on the Internet Standard User Datagram Protocol (UDP). The connection-oriented TL is based on the Internet Standard Transmission Control Protocol (TCP). This first edition cancels and replaces the IEC 62056-47 published in 2006 and constitutes a technical revision. It includes the following changes:
- This standard is applicable now both for IP4 and IPv6 networks;
- Latest editions of the IEC 62056 suite are referenced. DLMS/COSEM IANA-registered port numbers added.
Echange des données de comptage de l'électricité - La suite DLMS/COSEM - Partie 4-7: Couche transport DLMS/COSEM pour réseaux IP
L'IEC 62056-4-7:2015 spécifie une couche transport sans connexion et une couche transport orientée connexion pour les profils de communication DLMS/COSEM utilisés sur les réseaux IP. Ces couches transport (TL - Transport Layer) offrent des services du modèle OSI à la couche application (AL - Application Layer) DLMS/COSEM utilisateur de service. La couche transport sans connexion est basée sur la norme Internet User Datagram Protocol (UDP, protocole de datagramme utilisateur). La couche transport orientée connexion est basée sur la norme Internet Transmission Control Protocol (TCP, protocole de contrôle de transmission). Cette première édition annule et remplace l'IEC 62056-47 parue en 2006. Elle constitue une révision technique. Elle inclut les modifications suivantes:
- La présente norme s'applique désormais aux deux réseaux IP4 et IPv6;
- Les dernières éditions de la série IEC 62056 sont référencées;
- Ajout des numéros de port assignés par l'IANA pour le DLMS/COSEM.
General Information
Relations
Standards Content (Sample)
IEC 62056-4-7 ®
Edition 1.0 2015-05
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
colour
inside
Electricity metering data exchange – The DLMS/COSEM suite –
Part 4-7: DLMS/COSEM transport layer for IP networks
Échange des données de comptage de l'électricité – La suite DLMS/COSEM –
Partie 4-7: Couche transport DLMS/COSEM pour réseaux IP
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form
or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from
either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
your local IEC member National Committee for further information.
Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
et les microfilms, sans l'accord écrit de l'IEC ou du Comité national de l'IEC du pays du demandeur. Si vous avez des
questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.
IEC Central Office Tel.: +41 22 919 02 11
3, rue de Varembé Fax: +41 22 919 03 00
CH-1211 Geneva 20 info@iec.ch
Switzerland www.iec.ch
About the IEC
The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
International Standards for all electrical, electronic and related technologies.
About IEC publications
The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the
latest edition, a corrigenda or an amendment might have been published.
IEC Catalogue - webstore.iec.ch/catalogue Electropedia - www.electropedia.org
The stand-alone application for consulting the entire The world's leading online dictionary of electronic and
bibliographical information on IEC International Standards, electrical terms containing more than 30 000 terms and
Technical Specifications, Technical Reports and other definitions in English and French, with equivalent terms in 15
documents. Available for PC, Mac OS, Android Tablets and additional languages. Also known as the International
iPad. Electrotechnical Vocabulary (IEV) online.
IEC publications search - www.iec.ch/searchpub IEC Glossary - std.iec.ch/glossary
The advanced search enables to find IEC publications by a More than 60 000 electrotechnical terminology entries in
variety of criteria (reference number, text, technical English and French extracted from the Terms and Definitions
committee,…). It also gives information on projects, replaced clause of IEC publications issued since 2002. Some entries
and withdrawn publications. have been collected from earlier publications of IEC TC 37,
77, 86 and CISPR.
IEC Just Published - webstore.iec.ch/justpublished
Stay up to date on all new IEC publications. Just Published IEC Customer Service Centre - webstore.iec.ch/csc
details all new publications released. Available online and If you wish to give us your feedback on this publication or
also once a month by email. need further assistance, please contact the Customer Service
Centre: csc@iec.ch.
A propos de l'IEC
La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.
A propos des publications IEC
Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
plus récente, un corrigendum ou amendement peut avoir été publié.
Catalogue IEC - webstore.iec.ch/catalogue Electropedia - www.electropedia.org
Application autonome pour consulter tous les renseignements
Le premier dictionnaire en ligne de termes électroniques et
bibliographiques sur les Normes internationales,
électriques. Il contient plus de 30 000 termes et définitions en
Spécifications techniques, Rapports techniques et autres
anglais et en français, ainsi que les termes équivalents dans
documents de l'IEC. Disponible pour PC, Mac OS, tablettes
15 langues additionnelles. Egalement appelé Vocabulaire
Android et iPad.
Electrotechnique International (IEV) en ligne.
Recherche de publications IEC - www.iec.ch/searchpub
Glossaire IEC - std.iec.ch/glossary
Plus de 60 000 entrées terminologiques électrotechniques, en
La recherche avancée permet de trouver des publications IEC
en utilisant différents critères (numéro de référence, texte, anglais et en français, extraites des articles Termes et
comité d’études,…). Elle donne aussi des informations sur les Définitions des publications IEC parues depuis 2002. Plus
projets et les publications remplacées ou retirées. certaines entrées antérieures extraites des publications des
CE 37, 77, 86 et CISPR de l'IEC.
IEC Just Published - webstore.iec.ch/justpublished
Service Clients - webstore.iec.ch/csc
Restez informé sur les nouvelles publications IEC. Just
Published détaille les nouvelles publications parues. Si vous désirez nous donner des commentaires sur cette
Disponible en ligne et aussi une fois par mois par email. publication ou si vous avez des questions contactez-nous:
csc@iec.ch.
IEC 62056-4-7 ®
Edition 1.0 2015-05
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
colour
inside
Electricity metering data exchange – The DLMS/COSEM suite –
Part 4-7: DLMS/COSEM transport layer for IP networks
Échange des données de comptage de l'électricité – La suite DLMS/COSEM –
Partie 4-7: Couche transport DLMS/COSEM pour réseaux IP
INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
COMMISSION
ELECTROTECHNIQUE
INTERNATIONALE
ICS 17.220; 35.110; 91.140.50 ISBN 978-2-8322-2609-4
– 2 – IEC 62056-4-7:2015 IEC 2015
CONTENTS
FOREWORD . 4
INTRODUCTION . 6
1 Scope . 7
2 Normative references . 7
3 Terms, definitions and abbreviations . 8
3.1 Terms and definitions . 8
3.2 Abbreviations . 8
4 Overview . 9
5 The DLMS/COSEM connection-less, UDP-based transport layer . 10
5.1 General . 10
5.2 Service specification for the DLMS/COSEM UDP-based transport layer . 11
5.2.1 General . 11
5.2.2 The UDP-DATA service . 12
5.3 Protocol specification for the DLMS/COSEM UDP-based transport layer . 14
5.3.1 General . 14
5.3.2 The wrapper protocol data unit (WPDU) . 14
5.3.3 The DLMS/COSEM UDP-based transport layer protocol data unit . 15
5.3.4 Reserved wrapper port numbers (wPorts) . 16
5.3.5 Protocol state machine . 16
6 The DLMS/COSEM connection-oriented, TCP-based transport layer . 16
6.1 General . 16
6.2 Service specification for the DLMS/COSEM TCP-based transport layer . 17
6.2.1 General . 17
6.2.2 The TCP-CONNECT service . 18
6.2.3 The TCP-DISCONNECT service . 21
6.2.4 The TCP-ABORT service . 23
6.2.5 The TCP-DATA service . 24
6.3 Protocol specification for the DLMS/COSEM TCP-based transport layer . 26
6.3.1 General . 26
6.3.2 The wrapper protocol data unit (WPDU) . 26
6.3.3 The DLMS/COSEM TCP-based transport layer protocol data unit . 27
6.3.4 Reserved wrapper port numbers . 27
6.3.5 Definition of the procedures . 27
Annex A (informative) Converting OSI-style TL services to and from RFC-style TCP
function calls. 32
A.1 Transport layer and TCP connection establishment . 32
A.2 Closing a transport layer and a TCP connection . 33
A.3 TCP connection abort . 34
A.4 Data transfer using the TCP-DATA service . 35
INDEX . 37
Bibliography . 38
Figure 1 – DLMS/COSEM as a standard Internet application protocol . 9
Figure 2 – Transport layers of the DLMS/COSEM_on_IP profile . 10
Figure 3 – Services of the DLMS/COSEM connection-less, UDP-based transport layer . 12
Figure 4 – The wrapper protocol data unit (WPDU) . 15
Figure 5 – The DLMS/COSEM connection-less, UDP-based transport layer PDU (UDP-
PDU) . 15
Figure 6 – Services of the DLMS/COSEM connection-oriented,TCP-based transport
layer . 18
Figure 7 – The TCP packet format . 27
Figure 8 – TCP connection establishment . 28
Figure 9 – TCP disconnection . 29
Figure 10 – Data transfer using the DLMS/COSEM TCP-based transport layer . 30
Figure 11 – High-level state transition diagram for the wrapper sublayer . 31
Figure A.1 – TCP connection state diagram . 32
Figure A.2 – MSC and state transitions for establishing a transport layer and TCP
connection . 33
Figure A.3 – MSC and state transitions for closing a transport layer and TCP
connection . 34
Figure A.4 – Polling the TCP sublayer for TCP abort indication . 34
Figure A.5 – Sending an APDU in three TCP packets . 35
Figure A.6 – Receiving the message in several packets . 36
Table 1 – Reserved wrapper port numbers in the UDP-based DLMS/COSEM TL . 16
– 4 – IEC 62056-4-7:2015 IEC 2015
INTERNATIONAL ELECTROTECHNICAL COMMISSION
____________
ELECTRICITY METERING DATA EXCHANGE –
THE DLMS/COSEM SUITE –
Part 4-7: DLMS/COSEM transport layer for IP networks
FOREWORD
1) The International Electrotechnical Commission (IEC) is a worldwide organization for standardization comprising
all national electrotechnical committees (IEC National Committees). The object of 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, IEC publishes International Standards, Technical Specifications,
Technical Reports, Publicly Available Specifications (PAS) and Guides (hereafter referred to as “IEC
Publication(s)”). 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. 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 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 IEC National Committees.
3) IEC Publications have the form of recommendations for international use and are accepted by IEC National
Committees in that sense. While all reasonable efforts are made to ensure that the technical content of IEC
Publications is accurate, IEC cannot be held responsible for the way in which they are used or for any
misinterpretation by any end user.
4) In order to promote international uniformity, IEC National Committees undertake to apply IEC Publications
transparently to the maximum extent possible in their national and regional publications. Any divergence
between any IEC Publication and the corresponding national or regional publication shall be clearly indicated in
the latter.
5) IEC itself does not provide any attestation of conformity. Independent certification bodies provide conformity
assessment services and, in some areas, access to IEC marks of conformity. IEC is not responsible for any
services carried out by independent certification bodies.
6) All users should ensure that they have the latest edition of this publication.
7) No liability shall attach to IEC or its directors, employees, servants or agents including individual experts and
members of its technical committees and IEC National Committees for any personal injury, property damage or
other damage of any nature whatsoever, whether direct or indirect, or for costs (including legal fees) and
expenses arising out of the publication, use of, or reliance upon, this IEC Publication or any other IEC
Publications.
8) Attention is drawn to the Normative references cited in this publication. Use of the referenced publications is
indispensable for the correct application of this publication.
9) Attention is drawn to the possibility that some of the elements of this IEC Publication may be the subject of
patent rights. IEC shall not be held responsible for identifying any or all such patent rights.
The International Electrotechnical Commission (IEC) draws attention to the fact that it is claimed that compliance
with this International Standard may involve the use of a maintenance service concerning the stack of protocols on
which the present standard IEC 62056-4-7 is based.
The IEC takes no position concerning the evidence, validity and scope of this maintenance service.
The provider of the maintenance service has assured the IEC that he is willing to provide services under
reasonable and non-discriminatory terms and conditions for applicants throughout the world. In this respect, the
statement of the provider of the maintenance service is registered with the IEC. Information may be obtained from:
DLMS User Association
Zug/Switzerland
www.dlms.com
International Standard IEC 62056-4-7 has been prepared by IEC technical committee 13:
Electrical energy measurement and control.
This first edition cancels and replaces IEC 62056-47 published in 2006. This edition
constitutes a technical revision.
This edition includes the following significant technical changes with respect to the previous
edition:
a) This standard is applicable now both for IP4 and IPv6 networks;
b) Latest editions of the IEC 62056 suite are referenced.
c) DLMS/COSEM IANA-registered port numbers added.
The text of this standard is based on the following documents:
CDV Report on voting
13/1570/CDV 13/1595/RVC
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 2.
A list of all parts in the IEC 62056 series, published under the general title Electricity metering
data exchange – The DLMS/COSEM suite, can be found on the IEC website.
The committee has decided that the contents of this publication will remain unchanged until
the stability date indicated on the IEC web site under "http://webstore.iec.ch" in the data
related to the specific publication. At this date, the publication will be
• reconfirmed,
• withdrawn,
• replaced by a revised edition, or
• amended.
IMPORTANT – The 'colour inside' logo on the cover page of this publication indicates
that it contains colours which are considered to be useful for the correct
understanding of its contents. Users should therefore print this document using a
colour printer.
– 6 – IEC 62056-4-7:2015 IEC 2015
INTRODUCTION
This standard specifies the DLMS/COSEM transport layer for IP (IPv4 or IPv6) networks. It
shall be read together with IEC 62056-9-7:2013, Electricity metering data exchange – The
DLMS/COSEM suite – Part 9-7: Communication profile for TCP-UDP/IP networks.
ELECTRICITY METERING DATA EXCHANGE –
THE DLMS/COSEM SUITE –
Part 4-7: DLMS/COSEM transport layer for IP networks
1 Scope
This part of IEC 62056 specifies a connection-less and a connection oriented transport layer
(TL) for DLMS/COSEM communication profiles used on IP networks.
These TLs provide OSI-style services to the service user DLMS/COSEM AL. The connection-
less TL is based on the Internet Standard User Datagram Protocol (UDP). The connection-
oriented TL is based on the Internet Standard Transmission Control Protocol (TCP).
The DLMS/COSEM TL consists of the UDP or TCP transport layer TCP and an additional
sublayer, called wrapper.
Annex A shows how the OSI-style TL services can be converted to and from UDP and TCP
function calls.
2 Normative references
The following documents, in whole or in part, are normatively referenced in this document and
are indispensable for its application. For dated references, only the edition cited applies. For
undated references, the latest edition of the referenced document (including any
amendments) applies.
IEC 60050-300:2001, International Electrotechnical Vocabulary (IEV) – Electrical and
electronic measurements and measuring instruments – Part 311: General terms relating to
measurements − Part 312: General terms relating to electrical measurements − Part 313:
Types of electrical measuring instruments − Part 314: Specific terms according to the type of
instrument
IEC TR 62051:1999, Electricity metering – Glossary of terms
IEC TR 62051-1:2004, Electricity metering – Data exchange for meter reading, tariff and load
control – Glossary of terms – Part 1: Terms related to data exchange with metering equipment
using DLMS/COSEM
IEC 62056-5-3:2013, Electricity metering data exchange – The DLMS/COSEM suite –
Part 5-3: DLMS/COSEM application layer
IEC 62056-6-2:2013, Electricity metering data exchange – The DLMS/COSEM suite –
Part 6-2: COSEM interface classes
______________
Edition 2 of IEC 62056-5-3 to be published.
Edition 2 of IEC 62056-6-2 to be published.
– 8 – IEC 62056-4-7:2015 IEC 2015
IEC 62056-9-7:2013, Electricity metering data exchange – the DLMS/COSEM suite –
Part 9-7: Communication profile for TCP-UDP/IP networks
STD 0006, User Datagram Protocol. Edited by Jon Postel, August 1980. Available from:
http://www.faqs.org/rfcs/std/std6.html
STD 0007, Transmission Control Protocol. Edited by Jon Postel, September 1981. Available
from: http://www.faqs.org/rfcs/std/std7.html
NOTE See also Bibliography for other related Internet RFCs.
3 Terms, definitions and abbreviations
3.1 Terms and definitions
For the purposes of this document, the terms and definitions given in IEC 60050-300,
IEC TR 62051 and IEC TR 62051-1 apply as well as the following:
3.1.1
application process
an element within a real open system which performs the information processing for a
particular application
[SOURCE: ISO/IEC 7498-1: 1994, 4.1.4]
3.1.2
application entity
system-independent application activities that are made available as application services to
the application agent, e.g., a set of application service elements that together perform all or
part of the communication aspects of an application process
3.2 Abbreviations
APDU Application Layer Protocol Data Unit
AL Application Layer
AP Application Process
AE Application Entity
COSEM COmpanion Specification for Energy Metering
DHCP Dynamic Host Configuration Protocol
DLMS Device Language Message Sepcification
COSEM_on_IP The TCP-UDP/IP based COSEM communication profile
FTP File Transfer Protocol
HTTP HyperText Transfer Protocol
IANA Internet Assigned Numbers Authority
IP Internet Protocol
PDU Protocol Data Unit
PAR Positive Acknowledgement with Retransmission
SNMP Simple Network Management Protocol
TCP Transmission Control Protocol
TFTP Trivial File Transfer Protocol
TL Transport Layer
UDP User Datagram Protocol
WPDU Wrapper Protocol Data Unit
4 Overview
In the DLMS/COSEM_on_IP profiles, the DLMS/COSEM AL uses the services of one of these
TLs, which use then the services of the Internet Protocol (IP) network layer to communicate
with other nodes connected to the abstract IP network.
When used in these profiles, the DLMS/COSEM AL can be considered as an Internet standard
application protocol (like the well-known HTTP, FTP or SNMP) and it may co-exist with other
Internet application protocols, as it is shown in Figure 1.
Application / Data models
WEB COSEM
Files
pages interface model
Standard application protocols
DLMS/COSEM AL
...
e.g. FTP e.g. HTTP
ACSE + xDLMS
Wrapper
Internet Transport Layer (UDP or TCP)
Internet Network Layer (IP)
Convergence / Adaptation Layer
Data Link Layer
Physical Layer
IEC
Figure 1 – DLMS/COSEM as a standard Internet application protocol
For DLMS/COSEM, the following port numbers have been registered by the IANA. See
http://www.iana.org/assignments/port-numbers.
• dlms/cosem 4059/TCP DLMS/COSEM
• dlms/cosem 4059/UDP DLMS/COSEM
As the DLMS/COSEM AL specified in IEC 62056-5-3 uses and provides OSI-style services, a
wrapper has been introduced between the UDP/TCP layers and the DLMS/COSEM AL.
Therefore, the DLMS/COSEM TLs consist of a wrapper sublayer and the UDP or TCP TL. The
– 10 – IEC 62056-4-7:2015 IEC 2015
wrapper sublayer is a lightweight, nearly state-less entity: its main function is to adapt the
OSI-style service set, provided by the DLMS/COSEM TL, to UDP or TCP function calls and
vice versa.
In addition, the wrapper sublayer has the following functions:
• it provides an additional addressing capability (wPort) on top of the UDP/TCP port;
• it provides information about the length of the data transported. This feature helps the
sender to send and the receiver to recognize the reception of a complete APDU, which
may be sent and received in multiple TCP packets.
As specified in IEC 62056-9-7:2013, Clause 6, the DLMS/COSEM AL is listening only on one
UDP or TCP port. On the other hand, as defined in IEC 62056-6-2:2013, 4.7, a DLMS/COSEM
physical device may host several client APs or server logical devices. The additional
addressing capability provided by the wrapper sublayer allows identifying these APs.
The structure of the DLMS/COSEM TL and their place in COSEM_on_IP is shown in Figure 2.
COSEM Application Process
COSEM Application Process
TCP Connection
Manager
COSEM application COSEM application
layer services layer services
DLMS/COSEM Application Layer DLMS/COSEM Application Layer
DLMS/COSEM
DLMS/COSEM connectionless TCP-
connection-oriented
transport services ABORT.ind
transport services
UDP-DATA.req/.ind/(.cnf)
TCP-DATA.req/.ind/(.cnf)
DLMS/COSEM UDP-based Transport Layer DLMS/COSEM TCP-based Transport Layer
Wrapper Wrapper
TCP function calls
UDP function calls
active/passive OPEN,
SEND, RECEIVE
SEND, RECEIVE
Internet UDP Internet TCP
IP and lower layers
IP and lower layers
a) the UDP-based profile b) the TCP-based profile
IEC
Figure 2 – Transport layers of the DLMS/COSEM_on_IP profile
The service user of both the UDP-DATA and the TCP-DATA services is the DLMS/COSEM
AL. On the other hand, the service user of the TCP-CONNECT and TCP-DISCONNECT
services is the TCP Connection Manager Process. The DLMS/COSEM TCP-based TL also
provides a TCP-ABORT service to the service user DLMS/COSEM AL.
5 The DLMS/COSEM connection-less, UDP-based transport layer
5.1 General
The DLMS/COSEM connection-less TL is based on the User Datagram Protocol (UDP) as
specified in STD 0006.
TCP-CONNECT services
TCP-DISCONNECT services
UDP provides a procedure for application programs to send messages to other programs with
a minimum of protocol mechanism. On the one hand, the protocol is transaction oriented, and
delivery and duplicate protection are not guaranteed. On the other hand, UDP is simple, it
adds a minimum of overhead, it is efficient and easy to use. Several well-known Internet
applications, like SNMP, DHCP, TFTP, etc., take advantage of these performance benefits,
either because some datagram applications do not need to be reliable or because the
required reliability mechanism is ensured by the application itself. Request/response type
applications, like a confirmed COSEM application association established on the
DLMS/COSEM UDP-based TL, then invoking confirmed xDLMS data transfer services is a
good example for this second category. Another advantage of UDP is that being connection-
less, it is easily capable of multi- and broadcasting.
UDP basically provides an upper interface to the IP layer, with an additional identification
capability, the UDP port number. This allows distinguishing between APs, hosted in the same
physical device and identified by its IP address.
NOTE The addressing/identification scheme for the COSEM_on_IP profiles is defined in IEC 62056-9-7:2013,
Clause 6.
5.2 Service specification for the DLMS/COSEM UDP-based transport layer
5.2.1 General
The DLMS/COSEM UDP-based TL provides only a data transfer service: the connection-less
UDP-DATA service. Consequently, the service specification for this service is the same for
both the client and server TLs, as it is shown in Figure 3.
The .request and .indication service primitives are mandatory. The implementation of the
local .confirm service primitive is optional.
The xDLMS APDU pre-fixed with the wrapper header shall fit in a single UDP datagram.
– 12 – IEC 62056-4-7:2015 IEC 2015
COSEM Client Application Process COSEM Server Application Process
DLMS/COSEM Client Application Layer DLMS/COSEM Server Application Layer
DLMS/COSEM UDP-based Transport Layer DLMS/COSEM UDP-based Transport Layer
Wrapper Wrapper
N M
UDP UDP
IP IP
Lower layers: Data link and Physical Lower layers: Data link and Physical
IEC
Figure 3 – Services of the DLMS/COSEM connection-less, UDP-based transport layer
5.2.2 The UDP-DATA service
5.2.2.1 UDP-DATA.request
Function
This primitive is the service request primitive for the connection-less mode data transfer
service.
Semantics of the service primitive
The primitive shall provide parameters as follows:
UDP-DATA.request (
Local_wPort,
Remote_wPort,
Local_UDP_Port,
Remote_UDP_Port,
Local_IP_Address,
Remote_IP_Address,
Data_Length,
Data
)
The Local_wPort, Local_UDP_Port and Local_IP_Address parameters indicate wrapper Port
number, UDP Port number and IP Address parameters belonging to the device /
DLMS/COSEM AE requesting to send the Data. The Remote_wPort, Remote_UDP_Port and
Remote_IP_Address parameters indicate the wrapper Port number, UDP Port number and IP
Address parameters belonging to the device / DLMS/COSEM AE to which the Data is to be
transmitted.
UDP-DATA.req
UDP-DATA.cnf
UDP-DATA.ind
UDP-DATA.req
UDP-DATA.cnf
UDP-DATA.ind
The Data_Length parameter indicates the length of the Data parameter in bytes.
The Data parameter contains the xDLMS APDU to be transferred to the peer AL.
Use
The UDP-DATA.request primitive is invoked by either the client or the server DLMS/COSEM
AL to request sending an APDU to a single peer AL, or, in the case of multi- or broadcasting,
to multiple peer ALs.
The reception of this service primitive shall cause the wrapper sublayer to pre-fix the wrapper
header to the APDU received, and then to call the SEND() function of the UDP sublayer with
the properly formed WPDU, see at 5.3.2, as DATA. The UDP sublayer shall transmit the
WPDU to the peer wrapper sublayer as described in STD 0006.
5.2.2.2 UDP-DATA.indication
Function
This primitive is the service indication primitive for the connection-less mode data transfer
service.
Semantics of the service primitive
The primitive shall provide parameters as follows:
UDP-DATA.indication (
Local_wPort,
Remote_wPort,
Local_UDP_Port,
Remote_UDP_Port,
Local_IP_Address,
Remote_IP_Address,
Data_Length,
Data
)
The Local_wPort, Local_UDP_Port and Local_IP_Address parameters indicate wrapper Port
number, UDP Port number and IP Address parameters belonging to the device /
DLMS/COSEM AE receiving the Data. The Remote_wPort, Remote_UDP_Port and
Remote_IP_Address parameters indicate the wrapper Port number, UDP Port number and IP
Address parameters belonging to the device / AE which has sent the data.
The Data_Length parameter indicates the length of the Data parameter in bytes.
The Data parameter contains the xDLMS APDU received from the peer AL.
Use
The UDP-DATA.indication primitive is generated by the DLMS/COSEM UDP based TL to
indicate to the service user DLMS/COSEM AL that an APDU from the peer layer entity has
been received.
The primitive is generated following the reception of an UDP Datagram by the UDP sublayer,
if both the Local_UDP_Port and Local_wPort parameters of the message received contain
valid port numbers, meaning that there is a DLMS/COSEM AE in the receiving device bound
to the given port numbers. Otherwise, the message received shall simply be discarded.
– 14 – IEC 62056-4-7:2015 IEC 2015
5.2.2.3 UDP-DATA.confirm
Function
This primitive is the optional service confirm primitive for connection-less mode data transfer
service.
Semantics of the service primitive
The primitive shall provide parameters as follows:
UDP-DATA.confirm (
Local_wPort,
Remote_wPort,
Local_UDP_Port,
Remote_UDP_Port,
Local_IP_Address,
Remote_IP_Address,
Result
)
The Local_wPort, Remote_wPort, Local_UDP_Port, Remote_UDP_Port, Local_IP_Address
and Remote_IP_Address parameters carry the same values as the corresponding UDP-
DATA.request service being confirmed.
The value of the Result parameter indicates whether the DLMS/COSEM UDP-based TL was
able to send the requested UDP Datagram (OK) or not (NOK).
Use
The UDP-DATA.confirm primitive is optional. If implemented, it is generated by the
DLMS/COSEM TL to confirm to the service user DLMS/COSEM AL the result of the previous
UDP-DATA.request. It is locally generated and indicates only whether the Data in the .request
primitive could be sent or not. In other words, an UDP-DATA.confirm with Result == OK
means only that the Data has been sent, and does not mean that the Data has been (or will
be) successfully delivered to the destination.
5.3 Protocol specification for the DLMS/COSEM UDP-based transport layer
5.3.1 General
As it is shown in Figure 2, the DLMS/COSEM UDP-based TL includes the Internet Standard
UDP layer, as specified in Internet Standard STD 0006, and the DLMS/COSEM-specific light-
weight wrapper sublayer.
In this communication profile, the wrapper sublayer is a state-less entity: its only roles are to
ensure source and destination DLMS/COSEM AE identification using the wPort numbers and
to provide conversion between the OSI-style UDP-DATA.xxx service invocations and the
SEND() and RECEIVE() interface functions provided by the standard UDP.
Although it is not necessary in the UDP-based profile, in order to have the same wrapper
protocol control information – in other words the wrapper header – in both TLs, the wrapper
sublayer shall also include the Data Length information in the wrapper protocol data unit.
5.3.2 The wrapper protocol data unit (WPDU)
The WPDU consists of two parts:
• the wrapper header part, containing the wrapper control information; and
• the data part, containing the DATA parameter – an xDLMS APDU – of the corresponding
UDP-DATA.xxx service invocation.
The wrapper header includes four fields, see Figure 4. Each field is a 16 bit long unsigned
integer value.
• Version: carries the version of the wrapper. Its value is controlled by the DLMS UA. The
current value is 0x0001. Note, that in later versions the wrapper header may have a
different structure;
• Source wPort: carries the wPort number identifying the sending DLMS/COSEM AE;
• Destination wPort: carries the wPort number identifying the receiving DLMS/COSEM AE;
• Data length: indicates the length of the DATA field of the WPDU (the xDLMS APDU
transported).
Wrapper control
Data field
information
Wrapper header DATA (APDU)
Version, 2 bytes
Source wPort, 2 bytes
Destination wPort: 2 bytes
Length: 2 bytes
IEC
NOTE The maximum length of the APDU should be eight bytes less than the maximum length of the UDP
datagram.
Figure 4 – The wrapper protocol data unit (WPDU)
5.3.3 The DLMS/COSEM UDP-based transport layer protocol data unit
In this profile, WPDUs shall be transmitted in UDP Datagrams, specified in Internet Standard
STD 0006. They shall encapsulate the WPDU, as shown in Figure 5.
UDP protocol control information Data field of the UDP PDU (WPDU)
Wrapper header
UDP header APDU
Source UDP Port, 2 bytes
Destination UDP Port: 2 bytes
UDP Length: 2 bytes
Checksum
IEC
Figure 5 – The DLMS/COSEM connection-less, UDP-based transport
layer PDU (UDP-PDU)
– 16 – IEC 62056-4-7:2015 IEC 2015
From the external point of view, the DLMS/COSEM connection-less TL PDU is an ordinary
UDP Datagram: any DLMS/COSEM specific element, including the wrapper-specific header is
inside the UDP Data field. Consequently, standard UDP implementations can be (re-)used to
easily implement this TL.
The Source and Destination UDP ports may refer to either local or remote UDP ports
depending on the direction of the data transfer: from the point of view of the sending device
the Source UDP port in a Datagram corresponds to the Local_UDP_port, but from the point of
view of the receiving device the Source UDP port in a Datagram corresponds to the
Remote_UDP_Port service parameter.
According to the UDP specification, filling the source UDP Port and Checksum fields with real
data is optional. A zero value – all bits are equal to zero – of these fields indicates that in the
given UDP Datagram the field is not used. However, in the DLMS/COSEM_on_IP profile, the
source UDP Port field shall always be filled with the source UDP port number.
5.3.4 Reserved wrapper port numbers (wPorts)
Reserved wPort Numbers are specified in Table 1:
Table 1 – Reserved wrapper port numbers in the UDP-based DLMS/COSEM TL
Client side reserved addresses
Wrapper Port Number
No-station 0x0000
Client Management Process 0x0001
Public Client 0x0010
0x02…0x0F
Open for client SAP assignment
0x11…0xFF
Server side reserved addresses
Wrapper Port Number
No-station 0x0000
Management Logical Device 0x0001
Reserved 0x0002.0x000F
Open for server SAP assignment 0x0010,,,0x007E
All-station (Broadcast) 0x007F
5.3.5 Protocol state machine
As the wrapper sublayer in this profile is state-less, for all other protocol related issues –
protocol state machine, etc. – the governing rules are as they are specified in the Internet
Standard STD 0006. The only supplementary rule is concerning discarding inappropriate
messages: messages with an invalid destination wPort number – meaning that there is no
DLMS/COSEM AE in the receiving device bound to this wPort number – shall be discarded by
the wrapper sublayer.
6 The DLMS/COSEM connection-oriented, TCP-based transport layer
6.1 General
The DLMS/COSEM connection-oriented TL is based on the connection-oriented Internet
transport protocol, called Transmission Control Protocol. TCP is an end-to-end reliable
protocol. This reliability is ensured by a conceptual “virtual circuit”, using a method called
PAR, Positive Acknowledgement with Retransmission. It provides acknowledged data
delivery, error detection, data re-transmission after an acknowledgement time-out, etc.
Therefore it deals with lost, delayed, duplicated or erroneous data packets. In addition, TCP
offers an efficient flow control mechanism and full-duplex operation, too.
TCP, as a connection-oriented transfer protocol involves three phases: connection
establishment, data exchange and connection release. Consequently, the DLMS/COSEM
TCP-based TL provides OSI-style services to the service user(s) for all three phases:
• for the connection establishment phase, the TCP-CONNECT service is provided to the
service user TCP connection manager process;
• for the data transfer phase, the TCP-DATA service is provided to the service user
DLMS/COSEM AL;
• for the connection closing phase, the TCP-DISCONNECT service is provided to the
service user TCP connection manager process;
• in addition, a TCP-ABORT service is provided to the service user DLMS/COSEM AL.
The DLMS/COSEM connection-oriented, TCP-based TL contains the same wrapper sublayer
as the DLMS/COSEM UDP-based TL. In addition to transforming OSI-style services to and
from TCP function calls, this wrapper provides additional addressing and length information.
The DLMS/COSEM connection-oriented, TCP-based TL is specified in terms of services and
protocols. The conversion between OSI-style services and TCP function calls is presented in
Annex A.
6.2 Service specification for the DLMS/COSEM TCP-based transport layer
6.2.1 General
The DLMS/COSEM connection-oriented, TCP-based TL provides the same set of services
both at the client and at the server sides, as it is shown in Figure 6.
– 18 – IEC 62056-4-7:2015 IEC 2015
COSEM Client COSEM Server
TCP Connection Manager TCP Connection Manager
Application Process Application Process
DLMS/COSEM Client DLMS/COSEM Server
Application Layer Application Layer
DLMS/COSEM TCP-based Transport Layer DLMS/COSEM TCP-based Transport Layer
Wrapper Wrapper
N M
TCP TCP
IP IP
Lower layers: Data link and Physical Lower layers: Data link and Physical
IEC
Figure 6 – Services of the DLMS/COSEM connection-oriented,TCP-based transport layer
In this communication profile, the full set of the service primitives of the TCP connection
management services (TCP-CONNECT and TCP-DISCONNECT) is provided both at the client
and at the server sides. This is to allow the server initiating and releasing a TCP connection,
too.
NOTE Application association establishment is performed by the client AE.
The service user of the TCP connection management services is not the DLMS/COSEM AL,
but the TCP connection manager process. The specification of this process is out of the scope
of this companion specification; however, the DLMS/COSEM AL sets some requirements
concerning this; see IEC 62056-9-7:2013, 9.1.
An additional COSEM-ABORT service is provided to indicate to the DLMS/COSEM AL the
disruption or disconnection of the supporting TCP connection.
Like in the DLMS/COSEM UDP-based TL, the TCP-DATA.confirm service primitive is also
optional. However, the TCP-DATA.request service can be confirmed either locally or remotely.
6.2.2 The TCP-CONNECT service
6.2.2.1 TCP-CONNECT.request
Function
This primitive is the service request primitive for the connection establishment service.
Semantics of the service primitive
TCP-CONNECT.req/.cnf
.ind/.res
TCP-DISCONNECT.req/.cnf
.ind/.res
TCP-ABORT.ind
TCP-DATA.req
TCP-DATA.cnf
TCP-DATA.ind
TCP-DATA.req
TCP-DATA.cnf
TCP-DATA.ind
TCP-ABORT.ind
TCP-DISCONNECT.req/.cnf
.ind/.res
TCP-CONNECT.req/.cnf
.ind/.res
The primitive shall provide parameters as follows:
TCP-CONNECT.request (
Local_TCP_Port,
Remote_TCP_Port
...








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...