没有合适的资源?快使用搜索试试~ 我知道了~
首页DLMS开发文档:协议详解与参考代码
DLMS开发文档:协议详解与参考代码
需积分: 9 39 下载量 111 浏览量
更新于2024-07-18
1
收藏 5.52MB PDF 举报
DLMS (Data Link Management System) 开发文档详细介绍了该通信协议在能源计量领域的应用,特别是DLMSUserAssociation (DLMS UA)部分,它是DLMS/COSEM架构和协议的组成部分,适用于第8.2版。这份文档于2017年1月19日发布,主要关注DLMS UA 1000-2 Ed.8.2标准。
文档的核心内容包括以下几个关键部分:
1. DLMS User Association (DLMSUA):这部分是用户与设备之间的接口,用于实现通信和数据交换。它定义了设备如何与DLMS兼容的智能电表或其他能源管理系统(EMS)设备进行交互,确保了数据的可靠传输和管理。
2. DLMS/COSEM架构:DLMS与通信系统和服务环境模型(COSEM)一起构成了整个通信架构,它定义了通信网络的结构、数据包格式以及安全机制,以支持能源计量设备的远程监控和控制。
3. 标准和技术规范:文档引用了一系列标准和定义,如通用DLMS/COSEM定义、加密安全相关的术语、Galois/Counter Mode (GCM)算法、椭圆曲线数字签名算法(ECDSA)、密钥协商算法等,这些都是保证协议安全性和互操作性的基础。
4. 语言和消息规范:文档还涵盖了语言和消息规格,即绿色书(Green Book),它提供了关于数据编码、消息格式、命令响应等的具体指导,以便开发者理解和实现DLMS通信协议的实现细节。
5. 内容概述:文档的前言部分可能会介绍DLMS的发展背景、目标和目标受众,随后的章节则逐步深入到技术细节,帮助读者掌握DLMS协议的开发流程和注意事项。
这份DLMS开发文档为想要在能源计量领域采用或开发基于DLMS协议的设备和系统的开发者提供了详尽的技术指南,涵盖了从协议架构到具体实现的关键要素,对于理解和实施DLMS通信至关重要。无论是理解协议工作原理、设计符合标准的通信模块,还是进行安全配置,这份文档都是不可或缺的参考资料。
DLMS User Association, DLMS/COSEM Architecture and Protocols, Edition 8.2
DLMS User Association 2017-01-19
DLMS UA 1000-2 Ed. 8.2 16/518
© Copyright 1997-2017 DLMS User Association
10.5 The wired and wireless M-Bus profile ............................................................. 407
Scope ........................................................................................... 407 10.5.1
Targeted communication environments ......................................... 407 10.5.2
Use of the communication layers for this profile ............................ 408 10.5.3
10.5.3.1
Information related to the use of the standard specifying the
lower layers .............................................................................. 408
10.5.3.2 Structure of the communication profiles .................................... 408
10.5.3.3 Lower protocol layers and their use ........................................... 409
10.5.3.3.1 Physical layer .......................................................... 409
10.5.3.3.2 Link layer ................................................................. 409
10.5.3.3.3 Transport layer ........................................................ 409
10.5.3.4 Service mapping and adaptation layers ..................................... 409
10.5.3.4.1 Overview ................................................................. 409
10.5.3.4.2 MBUS-DATA service primitives ................................ 410
10.5.3.4.2.1 MBUS-DATA.request ........................... 410
10.5.3.4.2.2 MBUS-DATA.indication ........................ 411
10.5.3.4.2.3 MBUS-DATA.confirm ........................... 412
10.5.3.4.3 MBUS-DATA protocol specification .......................... 412
10.5.3.4.3.1 Sending COSEM APDUs...................... 412
10.5.3.4.3.2 Receiving COSEM APDUs ................... 414
10.5.3.5 Registration and connection management ................................. 414
Identification and addressing scheme ........................................... 414 10.5.4
10.5.4.1
Overview ................................................................................... 414
10.5.4.2 Link Layer Address for wired M-Bus .......................................... 415
10.5.4.3 Link Layer Address for wireless M-Bus ...................................... 416
10.5.4.4 Link Layer Address for M-Bus broadcast ................................... 416
10.5.4.5 Transport layer address ............................................................ 417
10.5.4.6 Application addressing extension – M-Bus wrapper ................... 419
Specific considerations and constraints for using certain 10.5.5
services within profile ................................................................... 420
10.5.5.1 Overview ................................................................................... 420
10.5.5.2 Application association establishment and release: ACSE
services .................................................................................... 420
10.5.5.3 xDLMS services ........................................................................ 421
10.5.5.3.1 Request – response type services ........................... 421
10.5.5.3.2 Unsolicited services ................................................. 421
10.5.5.3.3 Broadcast messages................................................ 421
10.5.5.4 Security mechanisms ................................................................ 421
10.5.5.5 Transporting long application messages ................................... 422
10.5.5.6 Media access, bandwidth and timing considerations ................. 422
Communication configuration and management ............................ 422 10.5.6
M-Bus frame structures, addressing schemes and examples ........ 422 10.5.7
10.5.7.1
General ..................................................................................... 422
10.5.7.2 None, short or long M-Bus data header ..................................... 423
10.5.7.2.1 Wired M-Bus ............................................................ 423
10.5.7.3 Wireless M-Bus ......................................................................... 425
10.5.7.3.1 Extended Link Layer ................................................ 425
DLMS User Association, DLMS/COSEM Architecture and Protocols, Edition 8.2
DLMS User Association 2017-01-19
DLMS UA 1000-2 Ed. 8.2 17/518
© Copyright 1997-2017 DLMS User Association
10.5.7.3.2 Transport layer ........................................................ 427
10.5.7.4 Encoding example: Data-Notification carrying daily billing
data .......................................................................................... 427
10.5.7.4.1 Overview ................................................................. 427
10.5.7.4.2 Example: Daily billing data ....................................... 428
Message sequence charts ............................................................ 429 10.5.8
10.6
SMS short wrapper ........................................................................................ 432
10.7 Gateway protocol ........................................................................................... 433
General ........................................................................................ 433 10.7.1
The gateway protocol ................................................................... 434 10.7.2
HES in the WAN/NN acting as Initiator (Pull operation) ................. 435 10.7.3
End devices in the LAN acting as Initiators (Push operation) ........ 436 10.7.4
10.7.4.1
General ..................................................................................... 436
10.7.4.2 End device with WAN/NN knowledge ........................................ 436
10.7.4.3 End devices without WAN/NN knowledge .................................. 436
Security ........................................................................................ 436 10.7.5
11
AARQ and AARE encoding examples .......................................................................... 437
11.1 General .......................................................................................................... 437
11.2 Encoding of the xDLMS InitiateRequest / InitiateResponse APDU .................. 437
11.3 Specification of the AARQ and AARE APDU .................................................. 440
11.4 Data for the examples .................................................................................... 441
11.5 Encoding of the AARQ APDU ......................................................................... 442
11.6 Encoding of the AARE APDU ......................................................................... 445
12 Encoding examples: AARQ and AARE APDUs using a ciphered application
context ........................................................................................................................ 451
12.1 A-XDR encoding of the xDLMS InitiateRequest APDU, carrying a
dedicated key ................................................................................................ 451
12.2 Authenticated encryption of the xDLMS InitiateRequest APDU ....................... 451
12.3 The AARQ APDU ........................................................................................... 452
12.4 A-XDR encoding of the xDLMS InitiateResponse APDU ................................. 454
12.5 Authenticated encryption of the xDLMS InitiateResponse APDU .................... 455
12.6 The AARE APDU ........................................................................................... 456
12.7 The RLRQ APDU (carrying a ciphered xDLMS InitiateRequest APDU) ........... 457
12.8 The RLRE APDU (carrying a ciphered xDLMS InitiateResponse APDU) ......... 458
13 S-FSK PLC encoding examples ................................................................................... 459
13.1 CI-PDUs, ACSE APDUs and xDLMS APDUs carried by MAC frames
using the IEC 61334-4-32 LLC sublayer ......................................................... 459
13.2 CI-PDUs, ACSE APDUs and xDLMS APDUs carried by MAC frames
using the HDLC based LLC sublayer .............................................................. 464
13.3 Clear Alarm examples .................................................................................... 469
14 Data transfer service examples ................................................................................... 470
14.1 GET / Read, SET / Write examples ................................................................ 470
14.2 ACCESS service example .............................................................................. 483
14.3 Compact array encoding example .................................................................. 485
General ........................................................................................ 485 14.3.1
The specification of compact-array ............................................... 485 14.3.2
DLMS User Association, DLMS/COSEM Architecture and Protocols, Edition 8.2
DLMS User Association 2017-01-19
DLMS UA 1000-2 Ed. 8.2 18/518
© Copyright 1997-2017 DLMS User Association
Example 1: Compact array encoding an array of five long-14.3.3
unsigned values ............................................................................ 486
Example 2: Compact-array encoding of five octet-string values .... 487 14.3.4
Example 3: Encoding of the buffer of a Profile generic object ....... 487 14.3.5
Annex A (normative) NSA Suite B elliptic curves and domain parameters ........................... 490
Annex B (informative) Example of an End entity signature certificate using P-256
signed with P-256 ........................................................................................................ 492
Annex C (normative) Use of key agreement schemes in DLMS/COSEM .............................. 494
C.1 Ephemeral Unified Model C(2e, 0s, ECC CDH) scheme ................................. 494
C.2 One-Pass Diffie-Hellman C(1e, 1s, ECC CDH) scheme .................................. 497
C.3 Static Unified Model C(0e, 2s, ECC CDH) scheme ......................................... 501
Annex D (informative) Exchanging protected xDLMS APDUs between TP and server ......... 504
D.1 General .......................................................................................................... 504
D.2 Example 1: Protection is the same in the two directions ................................. 504
D.3 Example 2: Protection is different in the two directions .................................. 505
Bibliography ........................................................................................................................ 507
Index .................................................................................................................................. 511
Figure 1 – The three steps approach of COSEM: Modelling – Messaging –
Transporting ......................................................................................................................... 31
Figure 2 – Client–server model and communication protocols ............................................... 55
Figure 3 – Naming and addressing in DLMS/COSEM ............................................................ 56
Figure 4 – A complete communication session in the CO environment .................................. 58
Figure 5 – DLMS/COSEM messaging patterns ...................................................................... 60
Figure 6 – DLMS/COSEM generic communication profile ...................................................... 62
Figure 7 – Model of a DLMS/COSEM metering system.......................................................... 63
Figure 8 – DLMS/COSEM server model ................................................................................ 64
Figure 9 – Model of a DLMS/COSEM client using multiple protocol stacks ............................ 65
Figure 10 – Typical PSTN configuration ................................................................................ 68
Figure 11 – The location of the physical layer ....................................................................... 69
Figure 12 – Protocol layer services of the COSEM 3-layer connection-oriented profile .......... 70
Figure 13 – MSC for physical connection establishment ........................................................ 75
Figure 14 – MSC for IDENTIFY.request / .response message exchange ............................... 77
Figure 15 – Handling the Identification service at the server side .......................................... 77
Figure 16 – Partial state machine for the client side physical layer ........................................ 78
Figure 17 – MSC for physical connection request ................................................................. 80
Figure 18 – Physical connection establishment at the CALLING station ................................ 81
Figure 19 – MSC for physical connection establishment ........................................................ 82
Figure 20 – Data exchange between the calling and called stations ...................................... 82
Figure 21 – MSC for a physical disconnection ....................................................................... 84
Figure 22 – Entering protocol mode E (HDLC) ...................................................................... 85
Figure 23 – Flow chart and switchover to METERING HDLC in protocol mode E ................... 86
Figure 24 – Physical layer primitives ..................................................................................... 87
DLMS User Association, DLMS/COSEM Architecture and Protocols, Edition 8.2
DLMS User Association 2017-01-19
DLMS UA 1000-2 Ed. 8.2 19/518
© Copyright 1997-2017 DLMS User Association
Figure 25 – Physical layer primitives, simplified example with one mode change only ........... 87
Figure 26 – DLMS/COSEM as a standard Internet application protocol ................................. 89
Figure 27 – Transport layers of the DLMS/COSEM_on_IP profile .......................................... 90
Figure 28 – Services of the DLMS/COSEM connection-less, UDP-based transport layer ....... 91
Figure 29 – The wrapper protocol data unit (WPDU) ............................................................. 94
Figure 30 – The DLMS/COSEM connection-less, UDP-based transport layer PDU
(UDP-PDU) ........................................................................................................................... 95
Figure 31 – Services of the DLMS/COSEM connection-oriented, TCP-based transport
layer ..................................................................................................................................... 97
Figure 32 – The TCP packet format .................................................................................... 105
Figure 33 – TCP connection establishment ......................................................................... 106
Figure 34 – TCP disconnection ........................................................................................... 107
Figure 35 – Data transfer using the COSEM TCP-based transport layer.............................. 108
Figure 36 – High-level state transition diagram for the wrapper sublayer ............................. 109
Figure 37 – TCP connection state diagram ......................................................................... 110
Figure 38 – MSC and state transitions for establishing a transport layer and TCP
connection .......................................................................................................................... 110
Figure 39 – MSC and state transitions for closing a transport layer and TCP connection .... 111
Figure 40 – Polling the TCP sublayer for TCP abort indication ............................................ 112
Figure 41 – Sending an APDU in three TCP packets ........................................................... 113
Figure 42 – Receiving the message in several packets ....................................................... 114
Figure 43 – Data link layer services for data link connection ............................................... 118
Figure 44 – Data link layer services for data link disconnection ........................................... 122
Figure 45 – Data link layer data transfer services ............................................................... 126
Figure 46 – Physical layer services used by the MAC sublayer ........................................... 129
Figure 47 – The ISO/IEC 8802-2 LLC PDU format .............................................................. 129
Figure 48 – LLC format as used in DLMS/COSEM .............................................................. 129
Figure 49 – MAC sublayer frame format (HDLC frame format type 3) .................................. 131
Figure 50 – Multiple frames ................................................................................................ 131
Figure 51 – The frame format field ...................................................................................... 132
Figure 52 – Valid server address structures ........................................................................ 133
Figure 53 – Address example ............................................................................................. 134
Figure 54 – MSC for long MSDU transfer in a transparent manner ...................................... 145
Figure 55 – Example configuration to illustrate broadcasting ............................................... 146
Figure 56 – Sending out a pending UI frame with a .response data ..................................... 147
Figure 57 – Sending out a pending UI frame with a response to a RR frame ....................... 148
Figure 58 – Sending out a pending UI frame on receipt of an empty UI frame ..................... 149
Figure 59 – State transition diagram for the server MAC sublayer ....................................... 152
Figure 60 – Layer management services ............................................................................. 156
Figure 61 – The structure of the DLMS/COSEM application layers ...................................... 160
Figure 62 – The concept of composable xDLMS messages ................................................. 166
Figure 63 – Summary of DLMS/COSEM AL services ........................................................... 169
DLMS User Association, DLMS/COSEM Architecture and Protocols, Edition 8.2
DLMS User Association 2017-01-19
DLMS UA 1000-2 Ed. 8.2 20/518
© Copyright 1997-2017 DLMS User Association
Figure 64 – Authentication mechanisms .............................................................................. 171
Figure 65 – Client – server message security concept ........................................................ 174
Figure 66 – End-to-end message security concept .............................................................. 175
Figure 67 – Hash function ................................................................................................... 177
Figure 68 – Encryption and decryption ................................................................................ 178
Figure 69 – Message Authentication Codes (MACs)............................................................ 179
Figure 70 – GCM functions ................................................................................................. 180
Figure 71 – Digital signatures ............................................................................................. 186
Figure 72 – C(2e, 0s) scheme: each party contributes only an ephemeral key pair .............. 188
Figure 73 – C(1e, 1s) schemes: party U contributes an ephemeral key pair, and party V
contributes a static key pair ................................................................................................ 189
Figure 74 – C(0e, 2s) scheme: each party contributes only a static key pair........................ 191
Figure 75 – Architecture of a Public Key Infrastructure (example) ....................................... 201
Figure 76 – MSC for provisioning the server with CA certificates ........................................ 211
Figure 77 – MSC for security personalisation of the server ................................................. 212
Figure 78 – Provisioning the server with the certificate of the client .................................... 213
Figure 79 – Provisioning the client / third party with a certificate of the server .................... 214
Figure 80 – Remove certificate from the server ................................................................... 214
Figure 81 – Cryptographic protection of information using AES-GCM .................................. 218
Figure 82 – Structure of service-specific global / dedicated ciphering xDLMS APDUs ......... 220
Figure 83 – Structure of general-glo-ciphering and general-ded-ciphering xDLMS
APDUs ................................................................................................................................ 221
Figure 84 – Structure of general-ciphering xDLMS APDUs .................................................. 222
Figure 85 – Structure of general-signing APDUs ................................................................. 227
Figure 86 – Service primitives ............................................................................................. 232
Figure 87 – Time sequence diagrams ................................................................................. 233
Figure 88 – Additional service parameters to control cryptographic protection and GBT ...... 243
Figure 89 – Partial state machine for the client side control function ................................... 277
Figure 90 – Partial state machine for the server side control function .................................. 278
Figure 91 – MSC for successful AA establishment preceded by a successful lower
layer connection establishment ........................................................................................... 286
Figure 92 – Graceful AA release using the A-RELEASE service .......................................... 290
Figure 93 – Graceful AA release by disconnecting the supporting layer .............................. 291
Figure 94 – Aborting an AA following a PH-ABORT.indication ............................................. 292
Figure 95 – MSC of the GET service ................................................................................... 295
Figure 96 – MSC of the GET service with block transfer ..................................................... 296
Figure 97 – MSC of the GET service with block transfer, long GET aborted ........................ 298
Figure 98 – MSC of the SET service ................................................................................... 299
Figure 99 – MSC of the SET service with block transfer ...................................................... 299
Figure 100 – MSC of the ACTION service ........................................................................... 301
Figure 101 – MSC of the ACTION service with block transfer .............................................. 302
Figure 102 – Access Service with long response ................................................................ 303
剩余517页未读,继续阅读
点击了解资源详情
点击了解资源详情
点击了解资源详情
2021-10-11 上传
2022-09-19 上传
2021-09-29 上传
2021-09-30 上传
2022-07-15 上传
2018-08-19 上传
taxiangren80
- 粉丝: 1
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 西门子PLC工程实例源码第149期:s7-300工业过程控制程序案例.rar
- coco-manager:用于管理COCO数据集的Python脚本
- SagamoreTrade
- assignment:作业1
- discord-disconnect-users-v11:V11中的脚本可断开公会中的所有用户的连接
- 行业文档-设计装置-双轴斜式成槽机.zip
- scofield-blog:学生博客练习
- FtpClient:作为 Android 的cordova 插件实现的ftp 客户端
- SoftwareDevWeb:网络软件开发
- Macarbi:股票和价格跟踪应用程序
- 4-basic-classifiers-IRIS-dataset-Machine-Learning
- Tomcat压缩包,直接解压,打开bin目录的startup文件,不会乱码。
- 临床医学
- 在不安装bijoy软件的情况下以bijoy规则编写孟加拉Unicode
- Java-俩数的和.zip
- load-bid:设置您的负载出价
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功