Reference number: EXCERPT FROM DLMS UA 1000-2:2005, Fifth Edition
© Copyright 1997-2005 DLMS User Association
EXCERPT FROM
Companion Specification
for Energy Metering
COSEM
Architecture
and Protocols
DLMS User Association
device ™
language
message
specification
DLMS User Association, EXCERPT FROM COSEM Architecture and Protocols, Fifth Edition
DLMS User Association
EXCERPT
DLMS UA 1000-2 ed.5 2/55
© Copyright 1997-2005 DLMS User Association
Table of Contents
1. Foreword ......................................................................................................................................................................4
2. Scope ............................................................................................................................................................................5
3. Introduction..................................................................................................................................................................6
3.1 The COSEM communications framework ....................................................................................................................6
3.1.1 Client/server type operation, communication profiles................................................................................................6
3.1.2 Connection (association) oriented operation.............................................................................................................7
3.2 Interoperability and interconnectivity in COSEM ..........................................................................................................8
3.3 Ensuring interconnectivity: the protocol identification service.......................................................................................9
3.4 Referenced documents ................................................................................................................................................10
3.5 Terms, definitions and abbreviations............................................................................................................................11
4. Architecture for meter data exchange........................................................................................................................14
4.1 General ........................................................................................................................................................................14
4.2 Application models.......................................................................................................................................................14
4.3 Communication models................................................................................................................................................14
4.4 Model of DLMS/COSEM servers..................................................................................................................................16
4.5 Model of a DLMS/COSEM based client .......................................................................................................................17
4.6 Model of a DLMS/COSEM based data collection system.............................................................................................18
4.7 Access requirements....................................................................................................................................................20
4.8 System integration and meter installation.....................................................................................................................21
4.9 Migration ......................................................................................................................................................................21
5. Physical layer services and procedures for connection oriented asynchronous data exchange........................22
5.1 Overview......................................................................................................................................................................22
5.2 Service specification ....................................................................................................................................................23
5.2.1 List of services ..........................................................................................................................................................23
5.2.1.1 Connection establishment/release related services ...............................................................................................23
5.2.1.2 Data communication services ................................................................................................................................23
5.2.1.3 Layer management services ..................................................................................................................................23
5.2.2 Use of the physical layer services.............................................................................................................................24
6. Direct Local Connection (excerpt)..............................................................................................................................25
6.1 METERING HDLC protocol using protocol mode E for direct local data exchange......................................................25
6.1.1 Overview...................................................................................................................................................................26
6.1.2 Readout mode and programming mode....................................................................................................................26
6.2 Key to protocol mode E flow diagram...........................................................................................................................27
6.3 Physical layer - Introduction .........................................................................................................................................28
7. COSEM transport layers for IPv4 networks ...............................................................................................................29
7.1 Scope...........................................................................................................................................................................29
7.2 Overview......................................................................................................................................................................29
7.3 The COSEM connection-less, UDP-based Transport layer..........................................................................................31
7.3.1 General .....................................................................................................................................................................31
7.4 The COSEM connection-oriented, TCP-based Transport layer ...................................................................................32
7.4.1 General .....................................................................................................................................................................32
7.5 Converting OSI-style transport layer services to and from RFC-style TCP function calls.............................................33
7.5.1 Transport layer and TCP connection establishment..................................................................................................33
7.5.2 Closing a transport layer and a TCP connection.......................................................................................................34
7.5.3 TCP connection abort ...............................................................................................................................................35
7.5.4 Data communication – the TCP-DATA service .........................................................................................................35
8. Data Link Layer using HDLC-Protocol.......................................................................................................................38
8.1 Overview......................................................................................................................................................................38
8.2 Overview of the data link layer specification.................................................................................................................38
8.2.1 The LLC sub-layer.....................................................................................................................................................38
8.2.2 The MAC sub-layer ...................................................................................................................................................38
8.2.3 Specification method.................................................................................................................................................39
8.3 The LLC sub-layer........................................................................................................................................................39
8.3.1 The role of the LLC sub-layer....................................................................................................................................39
8.3.2 Service specification for the LLC sub-layer ...............................................................................................................40
8.3.2.1 Setting up the data link connection ........................................................................................................................40
8.3.2.1.1 Overview .............................................................................................................................................................40
8.4 The MAC sub-layer ......................................................................................................................................................41
8.4.1 HDLC selections .......................................................................................................................................................41
8.4.2 Service specification for the MAC sub-layer..............................................................................................................41
8.4.2.1 Setting up the MAC connection..............................................................................................................................41
DLMS User Association, EXCERPT FROM COSEM Architecture and Protocols, Fifth Edition
DLMS User Association
EXCERPT
DLMS UA 1000-2 ed.5 3/55
© Copyright 1997-2005 DLMS User Association
8.4.2.1.1 Overview.............................................................................................................................................................41
8.5 Data link layer management services ..........................................................................................................................42
8.5.1 Overview...................................................................................................................................................................42
9. COSEM application layer ............................................................................................................................................44
9.1 Overview......................................................................................................................................................................44
9.1.1 Specification method.................................................................................................................................................44
9.1.2 Application layer structure.........................................................................................................................................44
9.1.3 Service specification .................................................................................................................................................45
9.1.3.1 Services provided for application association establishment and release..............................................................45
9.1.3.2 Data communication services ................................................................................................................................45
9.1.4 Layer management services.....................................................................................................................................46
9.1.5 Protocol specification................................................................................................................................................47
9.2 COSEM application layer – Service specification ........................................................................................................47
9.2.1 Summary of services ................................................................................................................................................47
9.2.2 Application association establishment and release...................................................................................................48
9.2.3 Special application associations ...............................................................................................................................48
9.2.3.1 Confirmed application associations........................................................................................................................48
9.2.3.2 Non-confirmed application associations.................................................................................................................48
9.2.3.3 Pre-established application associations ...............................................................................................................49
9.2.3.4 Mandatory application associations .......................................................................................................................49
9.2.4 Data communication .................................................................................................................................................49
9.3 COSEM application layer protocol specification...........................................................................................................50
9.3.1 State definitions for the client side control function ...................................................................................................50
9.3.2 State definitions for the server side control function..................................................................................................52
9.3.3 Protocol for application association establishment/release.......................................................................................53
9.3.3.1 Establishment of a confirmed application association............................................................................................53
Figures
Figure 1 – The three steps approach of COSEM: Modelling - Messaging - Transporting....................................................5
Figure 2 – Client / server relationship in COSEM ................................................................................................................6
Figure 3 – Exchanging messages via the communication protocol .....................................................................................6
Figure 4 – The COSEM application layer on the top of various lower layer stacks..............................................................7
Figure 5 – A complete communications session in the CO environment.............................................................................8
Figure 6 – DLMS/COSEM application model of a data collection system and metering equipment .................................. 14
Figure 7 – Communication profile models in DLMS/COSEM.............................................................................................15
Figure 8 – DLMS/COSEM server model............................................................................................................................17
Figure 9 – Model of a DLMS/COSEM based client using multiple protocol stacks ............................................................18
Figure 10 – Model of a DLMS/COSEM based meter data collection system.....................................................................19
Figure 11 – Typical PSTN configuration ............................................................................................................................22
Figure 12 – The location of the physical layer....................................................................................................................23
Figure 13 – Protocol layer services of the COSEM 3-layer connection-oriented profile.....................................................24
Figure 14 – Entering protocol mode E (HDLC) ..................................................................................................................26
Figure 15 – Flow chart and switchover to METERING HDLC in protocol mode E.............................................................27
Figure 16 – Physical layer primitives .................................................................................................................................28
Figure 17 – Physical layer primitives, simplified example with one mode change only......................................................28
Figure 18 – COSEM as a standard Internet application protocol.......................................................................................30
Figure 19 – Transport layers of the COSEM_on_IP profile................................................................................................31
Figure 20 – TCP connection state diagram .......................................................................................................................33
Figure 21 – MSC and state transitions for establishing a transport layer and TCP connection..........................................34
Figure 22 – MSC and state transitions for closing a transport layer and TCP connection .................................................35
Figure 23 – Polling the TCP sub-layer for TCP abort indication ........................................................................................35
Figure 24 – Sending an APDU in three TCP packets ........................................................................................................36
Figure 25 – Receiving the message in several packets.....................................................................................................37
Figure 26 – Data link (LLC) services for setting up the data link connection .....................................................................40
Figure 27 – MAC sub-layer services for setting up the MAC (DL) connection at the client and server sides.....................42
Figure 28 – Layer management services...........................................................................................................................43
Figure 29 – The structure of the COSEM application layers..............................................................................................44
Figure 30 – Structure of the COSEM AL when the server is using SN references ............................................................46
Figure 32 – Summary of COSEM application layer services .............................................................................................47
Figure 33 – Normal service sequence for the COSEM-OPEN service ..............................................................................48
Figure 34 – Partial state machine for the client side control function.................................................................................51
Figure 35 – Partial state machine for the server side control function ...............................................................................52
Figure 36 - MSC for successful application association establishment preceded by a successful lower layer connection
establishment ....................................................................................................................................................................54
DLMS User Association, EXCERPT FROM COSEM Architecture and Protocols, Fifth Edition
DLMS User Association
EXCERPT
DLMS UA 1000-2 ed.5 4/55
© Copyright 1997-2005 DLMS User Association
1. Foreword
Copyright
© Copyright 1997-2005 DLMS User Association.
This document is confidential. It may not be copied, nor handed over to persons outside the
standardisation environment.
The copyright is enforced by national and international law. The "Berne Convention for the
Protection of Literary and Artistic Works", which is signed by 121 countries worldwide, and other
treaties apply.
Acknowledgement
The actual document has been established by a team of experts working for members of the DLMS
User Association and by working group members of standardisation bodies, for example IEC TC13
WG14, CEN TC294 WG2 and IEC TC57 WG9.
Status of standardization
This fifth edition of the "Green Book" includes the specification of the communication protocol
layers based on:
IEC 62056-42, Electricity metering - Data exchange for meter reading, tariff and load control - Part
42: Physical layer services and procedures for connection-oriented asynchronous data exchange;
IEC 62056-46 Ed 1.0, Electricity metering - Data exchange for meter reading, tariff and load control
- Part 46: Data link layer using HDLC protocol, as amended by 13/1336/CDV, draft Amendment 1;
draft IEC 62056-47 Ed.1.0, 13/1337/CDV, Electricity metering - Data exchange for meter reading,
tariff and load control - Part 47: COSEM transport layers for IPv4 networks
draft IEC 62056-53 ed. 2.0, 13/1338/CDV, Electricity metering - Data exchange for meter reading,
tariff and load control - Part 53: COSEM application layer
Annex E of IEC 62056-21, Electricity metering - Data exchange for meter reading, tariff and load
control Part 21: Direct local data exchange, is incorporated (Clause 6).
For easier use, in this edition, changes compared to Edition 4 are marked by highlighted text.
DLMS User Association, EXCERPT FROM COSEM Architecture and Protocols, Fifth Edition
DLMS User Association
EXCERPT
DLMS UA 1000-2 ed.5 5/55
© Copyright 1997-2005 DLMS User Association
2. Scope
The data model uses generic building
blocks to define the complex functionality
of the metering equipment. It provides a
view of this functionality of the meter as it
is available at its interface(s). The model
does not cover internal, implementation-
specific issues.
The communication protocol defines how
the data can be accessed and
exchanged.
The COSEM specifications follow a three
step approach as illustrated in Figure 1:
Step 1: The meter model and data
identification (data model);
Step 2: The mapping of the model into
protocol data units (PDU);
Step 3: The transportation of the bits and
bytes through the communication
channel.
Metering domain specific Interface
Objects are specified by the COSEM
specification "Identification System and
Interface Classes" DLMS UA 1000-1. The
functionality of the meter is defined by
the instances of these interface classes,
called COSEM objects. Logical names
(OBIS codes) identify the COSEM
objects.
Figure 1 – The three steps approach of COSEM: Modelling - Messaging - Transporting
- The attributes and methods of these COSEM objects can be accessed and used via the messaging
services of the application layer.
- The lower layers (data link layer, transport layer and physical layer) of the protocol transport the
information.
- The application layer, data link layer, transport layer and physical layer are described in this document.
- Conformance testing: see specification DLMS UA 1001-1 "COSEM Conformance Test Process".
- Terms are explained in DLMS UA 1002 "COSEM Glossary of Terms".
3. Transporting
C0 01 00 03 01 01 01 08 00 FF 02
2. Messaging
Protocol Services to access
attributes and methods
I
S
O
,
I
E
C
,
.
.
.
Communication Protocol
Messages :
Service_Id( Class_Id, Instance_Id, Attribute_Id/Method_Id )
Encoding: ( APDU )
1. Modelling
COSEM Interface Objects
Register 0..n Class_id=3, Version=0
Attribute(s) Data Type Min Max Def
1. logical_name
(
static
)
octet-string
2. value
(
d
y
n.
)
instance specific
3. scaler-unit
(
static
)
scal_unit_type
Method(s) m/o
1. reset o
D
L
M
S
U
s
e
r
A
s
s
o
c
i
a
t
i
o
n
评论0