IEC 62056 DLMS COSEM Workshop Part 6 Protocol
IEC 62056 DLMS COSEM Workshop Part 6 Protocol
language
message
specification
GET / SET
attribute {class_id, logical_name, attribute_id}
Class_id, version
Attribute(s) Read / Write /
1. logical_name x = base_name Unconfirmed Write
2. Attribute 2 Mapping x+8 {named variable}
n. Attribute n x + n*8
Specific method(s)
1. Method 1 x+ ...
n. Method n x + offset
ACTION
method {class_id, logical_name, method_id}
• Interoperability: negotiation of contexts and conformance block (list of services)
S A • Client-server environment
G E C
E T – Request: identifies the (list of)
T data; selective access possible
T I
O – Response: supplies the data
N with data type
Object – Requests and responses must
Name Read be paired in the DCS
• Event notification
Attribute 1
Write
• Common service set for all
... objects:
Attribute n – new interface classes can be
UnconfWrite easily added
Method(s)
LN referencing SN referencing
Attribute related
GET Read
SET Write
Attribute_0 with GET UnconfirmedWrite
Attribute_0 with SET
Block transfer with GET Block transfer with Read New
Block transfer with SET Block transfer with Write
Method related
ACTION Read
Block transfer with ACTION Write
UnconfirmedWrite
Ancillary
Selective access Parametrised access
Multiple references – selective access, block transfer
Priority management Multiple references
Non client-server (services initiated by the server)
EventNotification InformationReport
reserved 0
reserved 1
• Contains the services supported
reserved 2
read 3
write 4 • Services for SN referencing
unconfirmed-write 5
reserved 6
reserved 7 • Services for LN referencing
attribute0-with-set 8
priority-management 9
attribute0-with-get 10 • The conformance block is proposed
block-transfer-with-get 11 by the Client. ex: All SN services: 1C0320
block-transfer-with-set 12
block-transfer-with-action 13
multiple-references 14 • Client and the Server negotiate conformance
information-report 15
reserved 16 block: logical AND between proposed and
reserved 17 supported
parametrised-access 18 ex: Read and Write: 180000
get 19
set 20
selective-access 21 • The conformance block should be
event-notification 22
action 23 meaningful!
B1 B1 B2 B3
GET.conf(ONE-BLOCK, GET.res(ONE-BLOCK,
B.No = 1, B1) B.No = 1, B1)
Protocol
GET.req(NEXT, B.No=1) GET.ind(NEXT, B.No =1)
stack
B1 B2
GET.conf(ONE-BLOCK, GET.res(ONE-BLOCK,
B.No = 2, B2) success, B.No = 2, B2)
B1 B2 B3
GET.conf(LAST-BLOCK, GET.res(LAST-BLOCK,
B.No = 3, B3) success, B.No = 3, B3)
Data
File: TPAK6_DLMSProtocol_CLC_GK100625.ppt (C) DLMS-UA, made by GNARUS/G. Kmethy Slide No.: 8
xDLMS LN service types device
language
message
specification
Event
PH-CONNECT.req
PH-CONNECT.ind PH-CONNECT.cnf
EventNotification.req
DL-DATA.req
Trigger_EventNotificationSending.req PDU
pending
DL-DATA.req Authorize sending
ASCII 30 31 32 33 334 35 36 37 38 6B 57 68
A-XDR 06 00 BC 61 4E 02 02 0F 03 16 1E
Type codes
Some examples
Actaris (LN)C001C1000100002A0000FF0200
C401C1000A10534C423736314D413336303136383839
SLB761MA36016889
Enermet(LN)C001C1000100002A0000FF0200
C401C1000A10454D4F30303130303236303032383233
EMO0010026002823
Iskraemeco(LN)C001C1000100002A0000FF0200
C401C100091049534B54333732503030303030303030
ISKT372P00000000
specification
Data transport
SERVICE.request/indication
Client Server
application SERVICE.response/confirm application
SERVICE.request SERVICE.response
Profile 1 Profile 2 Profile n
PSTN, GSM,
Transport
Internet, PLC,
File: TPAK6_DLMSProtocol_CLC_GK100625.ppt media
xDxy(C) DLMS-UA, made by GNARUS/G. Kmethy Slide No.: 19
Data access and transport device
language
message
specification
C4010009060101480700FF
Supp. layer
AL
Wrapper
Appl. layer
Appl. layer
Appl. layer
TCP
• Media specific lower layers
IPv4
Supporting
layers
3-layer,
TCP-UDP/IP IEC 61334-5-1 S-FSK PLC profiles
CO HDLC
LLC LLC
MA-CONNECT/ MA-DATA MA-CONNECT/ MA-DATA
DISCONNECT .req/.ind DISCONNECT .req/.ind/.cnf
.req/.cnf .ind/.res
/(.ind) MAC-HDLC MAC-HDLC
Upper
Lower
R e s e r v e d H D L C a d d re s s e s (c lie n t a d d re s s e s )
O n e b y te
a d d re s s
0x00 N O _ S T A T IO N A d d re s s
0x01 C lie n t M a n a g e m e n t P r o c e s s
0x10 P u b lic c lie n t ( lo w e s t s e c u r it y le v e l)
0x7F A L L _ S T A T IO N ( B ro a d c a s t ) A d d re s s
Control field
Flag, 7E
Flag, 7E
I frames DL-DATA.req
D F3 (LAST-FRAGMENT) F3
Last I frame S = 0
DL-DATA.cnf
GET.cnf
TCP/UDP
Internet standards
IP
Wrapper
Physical Layer
TCP-DISCONNECT services
TCP-CONNECT services
COSEM Application Layer COSEM Application Layer
.ind/.res
.ind/.res
TCP-DISCONNECT.req/.cnf
TCP-DISCONNECT.req/.cnf
TCP-CONNECT.req/.cnf
TCP-CONNECT.req/.cnf
.ind/.res
.ind/.res
COSEM Client COSEM Server
Application Layer Application Layer
TCP-ABORT.ind
TCP-ABORT.ind
TCP-DATA.req
TCP-DATA.req
TCP-DATA.ind
TCP-DATA.cnf
TCP-DATA.cnf
TCP-DATA.ind
COSEM TCP-based Transport Layer 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
TCP-UDP
Other, lower layer headers IP header Wrapper header APDU Trailers
header
Length: 2 bytes
Data security
Access control
Key management
• Access control:
– role-based access: list of objects, access rights
• Access security - peer authentication:
• client only (LLS) or
• client / server (HLS)
• Security event logs
• Data transfer security
CtoS
Client LLS Server Client Server
StoC
secret
LLS HLS f(StoC) HLS
Secret secret (S) secret (S)
f(CtoS)
Association
Association
Name
Association
Device IdAssociation
Name
Name
Partner Id Id
Device Name
• Identify partners
Device Id
Object listDevice
Partner Id Id
Partner Id
ObjectPartner
Contexts list Id • Provides the list of visible
Object list
objects, with access rights
Secret Object list
Contexts
Contexts
Secret
AuthenticateContexts • Describes the rules and
Secret
Authenticate
Secret resources for the data exchange
Authenticate
Authenticate
• Controls peer authentication
Door Keeper
Utility A
Meter Telephone
Operator GSM
PLC
Internet
xDxy Utility B
Non-cryptographic: • Cryptographic:
Protection against Protection against
unintentional changes attacks
• Hash functions (digest)
• Parity bits • integrity
• Cyclic Redundancy • Symmetric key cryptography
Check (CRC) • confidentiality
• authentication
– suitable for larger
• authenticated encryption
streams of data
• Asymmetric (public) key
cryptography
• (encryption)
• digital signature
• non-repudiation (with TTP)
Security context
Encrypted
Encrypted APDU Tag Len SH
xDLMS APDU
Encrypted
Authenticated and encrypted APDU Tag Len SH T
xDLMS APDU
specification
specification
+ security options
+ security status
Message
• Symmetric key algorithm: Advanced
Encryption Standard (AES), 128 bit key,
Security
Ciphering / deciphering
context Galois/Counter Mode (NIST 800-38D)
Plaintext • Plain message
Unsecured message
Network
DCS
1290
Concentrator 1290
1290
• Encryption keys:
• Global key: used in several sessions (AAs); unicast - broadcast
• global unicast key encrypts dedicated key
• Dedicated key: used in a single session (AA), then destroyed
• Authentication key (optional with GCM)
• Global, unicast and broadcast
• Master key: pre-established, used only to wrap global keys
• NIST 800-38D
• Authenticated
encryption with
Associated data
• Provides assurance of
confidentiality of data
• Provides assurance of
authenticity of
confidential data
• Provides assurance of
authenticity of additional
data
specification
Authentication
SC-A AAD = SC-A II AK II APDU
only
Authenticated
SC-AE xDLMS APDU AAD = SC-AE II AK Fail
encryption
P A P
EK Galois / Counter EK Galois / Counter
mode mode
IV authenticated IV authenticated
Sys-T FC encryption Sys-T FC decryption
C T C T A
Ciphered APDU: Authentication only
Tag Len SC-A FC Unciph. APDU T AAD = SC-A II AK II APDU