Protocol Specification for Interfacing to Data Communication Networks

bugqueenNetworking and Communications

Oct 26, 2013 (3 years and 11 months ago)

328 views


1


2


3


4


5

ANSI Std C12.22
-
200x

6


7


8


9


10


11


12


13


14


15

Protocol Specification for

16

Interfacing to Data Communication Networks

17


18


19


20


21


22


23


24


25


26


27


28

Copyright © 1997 by the National Electrical Manufacturers Association

29

1300 North 17th Street, Suite 1847

30

Rosslyn, VA 22209, USA

31

All rights r
eserved

32


33


34


35


36


37

This is an unapproved draft of a proposed ANSI Standard, subject to change. Permission is hereby
38

granted for ANSI Standards Committee participants to reproduce this document for purposes of ANSI
39

standardization activities. Use of information c
ontained in this unapproved draft is at your own risk.

40


41


42


43


44


45


46


47

Modified
October 26, 2013

48


49

Standard Version 0.0

50


51

52

-

2

-



53

Table of contents

54


55

1.

Introduction

................................
................................
................................
................................
.......................

6

56

2.

Scope

................................
................................
................................
................................
...............................

6

57

3.

References

................................
................................
................................
................................
.......................

7

58

3.1.

Normative

................................
................................
................................
................................
...............

7

59

3.2.

Others

................................
................................
................................
................................
.....................

8

60

4.

Definitions And Syntax

................................
................................
................................
................................
.....

8

61

4.1.

Definitions

................................
................................
................................
................................
...............

8

62

4.2.

Document Syntax

................................
................................
................................
................................
.

12

63

4.3.

Table syntax
................................
................................
................................
................................
..........

13

64

5.

Reference Topology

................................
................................
................................
................................
.......

13

65

6.

C12.22 Node to C12.22 Network Segment Details

................................
................................
........................

15

66

6.1.

C12.22 Node to C12.22 Network Segment Reference

................................
................................
.........

15

67

6.2.

Data order

................................
................................
................................
................................
.............

15

68

6.3.

Layer 7
-

Application Layer

................................
................................
................................
...................

17

69

6.3.1.

Data Structure
-

Utility Industry Data Tables

................................
................................
.....................

17

70

6.3.2.

Protocol Specification For Electric Metering (PSEM)

................................
................................
........

17

71

6.3.2.1.

Request Codes

................................
................................
................................
...........................

17

72

6.3.2.2.

Response Codes

................................
................................
................................
........................

18

73

6.3.2.3.

Time
-
out

................................
................................
................................
................................
.....

20

74

6.3.2.3.1. Session Time
-
out

................................
................................
................................
.................

20

75

6.3.2.3.2. Application Layer Response Time
-
out

................................
................................
.................

21

76

6.3.2.4.

Services

................................
................................
................................
................................
......

22

77

6.3.2.4.1. Identif
ication Service

................................
................................
................................
............

22

78

6.3.2.4.2. Read Service

................................
................................
................................
.......................

24

79

6.3.2.4.3. Write Service

................................
................................
................................
.......................

26

80

6.3.2.4.4. Logon Service

................................
................................
................................
......................

27

81

6.3.2.4.5. Security Service

................................
................................
................................
...................

28

82

6.3.2.4.6. Logoff Service

................................
................................
................................
......................

28

83

6.3.2.4.7. Terminate Service

................................
................................
................................
...............

29

84

6.3.2.4.8. Disconnect Service

................................
................................
................................
..............

3
0

85

6.3.2.4.9. Wait Service

................................
................................
................................
........................

30

86

6.3.2.4.10. Registration Service

................................
................................
................................
...........

31

87

6.3.2.4.11. Deregistration Service

................................
................................
................................
.......

34

88

6.3.2.4.12. Resolve Service

................................
................................
................................
.................

35

89

6.3.2.4.13. Trace Service
................................
................................
................................
.....................

35

90

6.3.2.5.

Service sequence state control

................................
................................
................................
..

36

91

6.3.2.6.

Partial Table access using index/element
-
count Method

................................
...........................

38

92

6.3.2.7.

Partial Table access using offset/octet
-
count method

................................
................................

40

93

6.3.3.

Extended PSEM (EPSEM)

................................
................................
................................
................

41

94

6.3.4.

Association Control


Association Control Service Element (ACSE)

................................
................

42

95

6.3.4.1.

Application Context Element (A1
H
)

................................
................................
.............................

42

96

6.3.4.2.

Called AP Title Element (A2
H
)

................................
................................
................................
....

43

97

6.3.4.3.

Ca
lling AP Title Element (A6
H
)

................................
................................
................................
...

43

98

6.3.4.4.

Universal Identifier (06
H
)

................................
................................
................................
.............

43

99

6.3.4.5.

Relative Universal Identifier (0D
H
)

................................
................................
..............................

43

100

6.3.4.6.

Calling Application Entity Qualifier Element (A7
H
)

................................
................................
......

44

101

6.3.4.7.

Mechanism Name Element (AB
H
)

................................
................................
..............................

45

102

6.3.4.8.

Authentication Value Element (AC
H
)

................................
................................
..........................

45

103

6.3.4.8.1. C12.22 Security Mechanism (1.2.840.10066.2.1)

................................
..............................

46

104

6.3.4.8.2. C12.21 Security Mechanism (1.2.840.10066.2.0)

................................
..............................

47

105

6.3.4.9.

Called Invocation ID Elements (A4
H
)

................................
................................
..........................

48

106

6.3.4.10
.

Calling Invocation ID Elements (A8
H
)

................................
................................
.......................

49

107

6.3.4.11.

Application Data Element (BE
H
)

................................
................................
...............................

49

108

-

3

-


6.3.4.12.

Length Fields Encoding

................................
................................
................................
............

50

109

6.3.4.13.

Universal Identifiers Encoding

................................
................................
................................
..

50

110

6.3.4.14.

Use of Sub
-
Branches of a Registered ApTitle
................................
................................
..........

52

111

6.3.4.15.

C12.22 Security Mechanism
................................
................................
................................
.....

54

112

6.3.4.15.1. C12.22 Security Mechanism (1.2.840.10066.2.1)

................................
............................

54

113

6.3.4.15.2. C12.21 Security Mechanism (1.2.840.10066.2.0)

................................
............................

58

114

6.3.5. Application Segmentation Sub
-
Layer

................................
................................
................................

59

115

6.3.5.1. APDU Seg
mentation

................................
................................
................................
..................

59

116

6.3.5.2.

APDU Segment

................................
................................
................................
..........................

59

117

6.4.0.2.1 Segment Calling Invocation ID Elements (A8H)

................................
................................
...

59

118

6.3.5.2.1. Segment Application Data Element (BE
H
)

................................
................................
...........

60

119

6.3.5.3.

The Segmentation and Reassembly

................................
................................
..........................

61

120

6.3.5.3.1. The Segmentation Algorithm

................................
................................
...............................

61

121

6.3.5.3.2. The Reassembly Algorithm

................................
................................
................................
.

62

122

6.4.

Layer 6
-

Presentation Layer

................................
................................
................................
.................

63

123

6.5.

Layer 5
-

Session Layer

................................
................................
................................
........................

63

124

6.6.

Layer 4
-

Transport Layer

................................
................................
................................
.....................

64

125

6.7.

Lay
er 3
-

Network Layer

................................
................................
................................
........................

64

126

6.8.

Layer 2
-

Data link Layer

................................
................................
................................
.......................

64

127

6.9.

Layer 1
-

Physical Layer

................................
................................
................................
........................

64

128

7.

Protocol Details: C12.22 Device to C12.22 Communication Module Interface

................................
..............

65

129

7.1.

Interface Architecture

................................
................................
................................
............................

65

130

7.2.

Interface Diagram

................................
................................
................................
................................
.

65

131

7.3.

Implementation Guidelines

................................
................................
................................
...................

66

132

7.4.

Layer 7
-

Application Layer

................................
................................
................................
...................

67

133

7.5.

Layer 6
-

Presentation Layer

................................
................................
................................
.................

67

134

7.6.

Layer 5
-

Session Layer

................................
................................
................................
........................

67

135

7.7.

Layer 4
-

Tra
nsport Layer

................................
................................
................................
.....................

67

136

7.7.1.

Negotiate Service

................................
................................
................................
..............................

68

137

7.7.2.

Get Configuration Service

................................
................................
................................
.................

69

138

7.7.3.

Link Control Service

................................
................................
................................
..........................

72

139

7.7.4.

Send Message Service

................................
................................
................................
.....................

73

140

7.7.5.

Get Status Service

................................
................................
................................
............................

74

141

7.7.6.

Get Registration Status Service

................................
................................
................................
........

75

142

7.7.7.

Service Time Sequence Diagrams

................................
................................
................................
...

77

143

7.
7.8.

Service Sequence States

................................
................................
................................
..................

81

144

7.8.

Layer 3
-

Network Layer

................................
................................
................................
........................

82

145

7.9.

Layer 2
-

Data Link Layer

................................
................................
................................
......................

82

146

7.9.1.

Basic Data Information

................................
................................
................................
......................

83

147

7.9.1.1.

Fixed Settings

................................
................................
................................
.............................

83

148

7.9.1.2.

Variable Settings

................................
................................
................................
........................

83

149

7.9.2.

Packet Definition

................................
................................
................................
...............................

83

150

7.9.3.

CRC Selection

................................
................................
................................
................................
...

85

151

7.9.4.

Acknowled
gment

................................
................................
................................
...............................

85

152

7.9.5.

Retry Attempts

................................
................................
................................
................................
..

85

153

7.9.6.

Timeouts

................................
................................
................................
................................
...........

86

154

7.9.6.1.

Tr
affic Time
-
out

................................
................................
................................
..........................

86

155

7.9.6.2.

Inter
-
character Time
-
out

................................
................................
................................
.............

86

156

7.9.6.3.

Response Time
-
out

................................
................................
................................
....................

86

157

7.9.7.

Turn Around Delay

................................
................................
................................
............................

86

158

7.9.8.

Duplicate Packets

................................
................................
................................
.............................

86

159

7.9.9.

Transparency

................................
................................
................................
................................
....

86

160

7.9.10.

Supervision of the Communications Link

................................
................................
........................

86

161

7.9.11.

Local Routing

................................
................................
................................
................................
..

87

162

7.9.12.

Service S
equence States

................................
................................
................................
................

88

163

7.10.

Layer 1
-

Physical Layer

................................
................................
................................
......................

89

164

-

4

-


7.10.1.

Signal Definition

................................
................................
................................
..............................

89

165

7.10.2.

Electrical Properties of Connection

................................
................................
................................
.

89

166

7.10.3.

Mechanical and Environmental Properties

................................
................................
.....................

89

167

7.10.4.

Super
vision of the Communications Link

................................
................................
........................

90

168

8.

Local Port Communication Protocol Details

................................
................................
................................
...

91

169

8.1.

Protocol Definition

................................
................................
................................
................................

91

170

8.1.1.

Layer 7
-

Application Layer

................................
................................
................................
................

91

171

8.1.2.

Layer 6
-

Presentation Layer

................................
................................
................................
.............

91

172

8
.1.3.

Layer 5
-

Session Layer

................................
................................
................................
....................

91

173

8.1.4.

Layer 4
-

Transport Layer

................................
................................
................................
..................

91

174

8.1.5.

Layer 3
-

Network Layer

................................
................................
................................
....................

92

175

8.1.6.

Layer 2
-

Data Link Layer

................................
................................
................................
..................

92

176

8.1.7.

Layer 1
-

Physical Layer

................................
................................
................................
....................

92

177

8.2.

C12.22 Local
Port Communication Using a C12.18 Optical Port

................................
.........................

92

178

8.2.1.

Establishment of ANSI C12.18 Protocol Compatibility Mode

................................
............................

93

179

8.2.2.

Esta
blishment of ANSI C12.22 Protocol Compatibility Mode

................................
............................

93

180

9.

Backward Compatibility

................................
................................
................................
................................
..

94

181

ANNEX A
-

Relays

................................
................................
................................
................................
.............

95

182

A.1 Hierarchical Topology

................................
................................
................................
............................

95

183

A.2 C12.22 Master Relays

................................
................................
................................
...........................

95

184

A.3 Registration Notification

................................
................................
................................
........................

96

185

A.4 Registration Algorithm Details

................................
................................
................................
...............

96

186

A.5 C12.22 Node ApTitle Auto
-
assignment

................................
................................
................................
.

96

187

A.6 C12.22 Master Relay ApTitle Auto
-
assignment

................................
................................
....................

97

188

A.7 Obsolete Routes

................................
................................
................................
................................
....

97

189

A.8 Multiple Routes

................................
................................
................................
................................
......

97

190

A.9 Application Layer Supervision

................................
................................
................................
...............

97

191

A.10 Routing

................................
................................
................................
................................
................

97

192

ANNEX B
-

Routing Exam
ples

................................
................................
................................
...........................

99

193

B.1 C12.22 Relays With a Single Service Provider

................................
................................
.....................

99

194

B.2 C12.22 Relays Shared by Multiple Service Providers

................................
................................
...........

99

195

ANNEX C
-

Modifications And Extensions to C12.19
-

1997

................................
................................
............

101

196

ANNEX C1
-

DECADE 12: Node network Control Tables

................................
................................
.........

102

197

TABLE 120 Dimension Network Table

................................
................................
................................
.....

102

198

TABLE 121 Actual Network Table

................................
................................
................................
............

105

199

TABLE 122 Interf
ace Control Table

................................
................................
................................
..........

107

200

TABLE 123 Exception Report Table

................................
................................
................................
.........

109

201

TABLE 124 Filtering Rules Table

................................
................................
................................
..............

111

202

TABLE 125 Interface Status Table

................................
................................
................................
...........

113

203

TABLE 126 Registration Status Table

................................
................................
................................
......

116

204

TABLE 127 Network St
atistics Table

................................
................................
................................
........

118

205

ANNEX C2
-

DECADE 130
-

Relay Control Tables

................................
................................
...................

120

206

TABLE 130 Dimension Relay Table
................................
................................
................................
..........

12
0

207

TABLE 131 Actual Relay Rable

................................
................................
................................
................

122

208

TABLE 132 Registration List Table

................................
................................
................................
...........

123

209

TABLE 133 Static
Routing Table

................................
................................
................................
..............

126

210

TABLE 134 Host Notification Table

................................
................................
................................
..........

128

211

TABLE 135 Master Relay Assignment Table

................................
................................
............................

130

212

TABLE 136 Dynamic Routing Report Table

................................
................................
.............................

131

213

ANNEX C3
-

Universal ID Pattern Description of ApTitles

................................
................................
........

132

214

ANNEX C4
-

Additions to TABLE 07
-

Procedure Initiate Table

................................
................................

133

215

PROCEDURE 23 Register

................................
................................
................................
........................

133

216

PROCEDURE 24 Deregister

................................
................................
................................
....................

133

217

PROCEDURE 25 Network Interface Control

................................
................................
............................

134

218

PROCEDURE 26 Exception Report

................................
................................
................................
.........

135

219

ANNEX C5
-

Table 46: Key table)
................................
................................
................................
..............

136

220

-

5

-


ANNEX D
-

Universal Identifier

................................
................................
................................
........................

137

221

ANNEX E
-

One
-
way Devices

................................
................................
................................
..........................

139

222

ANNEX F
-

APDU Response Timeout Algorithm

................................
................................
.............................

141

223

ANNEX G
-

Communication Example

................................
................................
................................
..............

143

224

ANNEX H
-

ANSI C12.22 Application Layer Over TCP/IP (UNIX Implementation)

................................
.........

144

225

ANNEX I
-

CRC Examples

................................
................................
................................
...............................

146

226

I.1 Trace

................................
................................
................................
................................
.....................

146

227

I.2 C Code Example

................................
................................
................................
................................
...

147

228

ANNEX J


DES/CDC and DESede/CDC

................................
................................
................................
........

148

229

J.1 Data

Encryption Standard
-

DES

................................
................................
................................
.........

148

230

J.2 DESede

................................
................................
................................
................................
................

148

231

J.3 CBC

................................
................................
................................
................................
.....................

148

232

J.4 Le
gal Issues

................................
................................
................................
................................
.........

149

233

J.5 DES Implementation

................................
................................
................................
............................

149

234

J.6 DES Code Example

................................
................................
................................
.............................

153

235

J.7 DES Trace Example

................................
................................
................................
............................

156

236

J.8 CBC Code Example

................................
................................
................................
.............................

157

237

J.9 CBC Trace Example

................................
................................
................................
............................

159

238

239

-

6

-



240

1.

Introduction

241

Initially, communications with electronic metering devices consisted of transporting memory data via
242

proprietary protocols which were unique to each manufacturer. The desire for interoperability and support
243

for multiple manufacturers by re
ading and programming systems created a need for standardization of
244

data formats and transport protocols.

245


246

The first step was to standardize data formats. Internal data was abstracted as a set of Tables. A set of
247

standard Table contents and formats were de
fined in the “Utility Industry End Device Data Tables” (ANSI
248

C12.19).

249


250

In the ”Protocol Specification for ANSI Type 2 Optical Port” (ANSI C12.18) Standard, a point
-
to
-
point
251

protocol was developed to transport table data over an optical connection. This pro
tocol included an
252

application language called Protocol Specification for Electric Metering (PSEM) that allowed applications
253

to read and write Tables. ANSI C12.21 was then developed to allow metering devices to use PSEM to
254

transport Tables over telephone mo
dems.

255


256

This Standard extends the ANSI C12.18, ANSI C12.19 and the “Protocol Specification for Telephone
257

Modem Communication” (ANSI C12.21) standards to allow transport of Table data over any networking
258

communications system.

259


260

In addition, this Standard des
cribes an optionally exposed point
-
to
-
point interface between a C12.22
261

Device, e.g. a meter, and, a C12.22 Communications module, e.g. a network adaptor, designed to attach
262

to “any” network.

263


264

2.

Scope

265

This document defines interfaces between

ANSI C12.19 devices and network protocols.

266


267

Specific goals identified by this committee were:

268


269

1.

Defining a Datagram that may convey ANSI C12.19 da
ta Tables through any network.

270


271

This was accomplished by:

272



Assuming that the data source is ANSI C12.19 data Ta
bles.

273



Defining the Application Layer services (language).

274



Defining the interface lower layers; layers; 4 (Transport), 3 (Network), 2 (Data Link) and 1
275

(Physical).

276


277

2.

Providing a full stack definition for interfacing an end device to a “
Network Communication
Module”.

278


279

This was accomplished by:

280



Defining the physical interface requirements between the end device and the “Network
281

Communication Module”.

282



Defining the interface lower layers; 4 (network), 3 (transport), 2 (data link) and 1 (physical).

283


284

3.

Providing a fu
ll stack definition for point
-
to
-
point communication to

285

be used over local ports suc
h as optical ports, or modems.

286


287

This was accomplished by defining a Layer 4 (Transport Layer) and Layer 2 (Data Link Layer).

288


289

4.

Providing support for efficient one
-
way messag
ing (blurts)

290


291

This was accomplished by:

292

-

7

-




Defining a compact message format that can be easily transformed to a standard ANSI C12.22
293

Datagram.

294



Assuring that all needed layers defined in this Standard can support one
-
way messaging

295


296

5.

Providing network architect
ure compatible with this protocol.

297


298

This was accomplished by:

299



Defining different type of nodes such as C12.22 Relay, C12.22 Master Relay, C12.22 Host,
300

C12.22 Authentication Host, C12.22 Notification Host, C12.22 Gateway.

301



Defining the role and responsibilit
ies of each of these C12.22 Nodes.

302


303

6.

Providing data structure definitions in support of this protocol.

304


305

This was accomplished by:

306



Defining an ANSI C12.19 Decade to be used by C12.22 Nodes.

307



Defining an ANSI C12.19 Decade to be used by C12.22 Relays.

308



Defining

new procedures in support of this protocol.

309



Defining a new table for enhanced security.

310


311

3.

References

312


313

(Review this section just before publication to adjust dates)

314


315

3.1.

Normative

316

ANSI C12.18
-
1996

Protocol Specification for A
NSI Type 2 Optical Port.

317


318

ANSI C12.19
-
1997

Utility Industry End Device Data Tables.

319


320

ANSI C12.21
-
1999

Protocol Specification for Telephone Modem Communication.

321


322

ISO/IEC 7498
-
1

Information Technology


Open Systems Interconnection


Basic Reference
323

Model: T
he Basic Model

324


325

ISO 3309
-
1993(E)

Information Technology
-

Telecommunications and information exchange
326

between systems
-

High
-
level data link control (HDLC) procedures
-

Frame
327

Structure, Annex A Explanatory Notes On Implementation of the Frame
328

Checking Seq
uence

329


330

ANSI INCITS 92

Data Encryption Algorithm

331


332

ISO/IEC 8824
-
1
-
1997

Information technology


Abstract Syntax Notation One (ASN.1):
333

Specification of basic notation

334


335

ISO/IEC 8824
-
2
-
1997

Information technology
-

Abstract Syntax Notation One (ASN.1): Informa
tion
336

Object Specification

337


338

ISO/IEC 8824
-
3
-
1997

Information technology
-

Abstract Syntax Notation One (ASN.1): Constraint
339

specification

340


341

ISO/IEC 8824
-
4
-
1997

Information technology


Abstract Syntax Notation One (ASN.1):
342

Parameterization of ASN.1 specificat
ions

343


344

-

8

-


ISO/IEC 8825
-
1
-
1997

Information technology


ASN.1 encoding rules: Specification of Basic
345

Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished
346

Encoding Rules (DER)

347


348

ISO/IEC 8650

ACSE

349


350

ISO/IEC 10035
-
1

?

351


352

ISO/IEC 646: 1991

ASCII char
acter set

353


354

ATIS T1.667
-
1999

ATIS T1.667
-
2002
Intelligent Network (Revision of T1.667
-
1999):

May 2002.

355

3.2.

Others

356

(
Add Dictionary reference
)

357


358

4.

Definitions And Syntax

359

4.1.

Definitions

360

For the purposes of this Sta
ndard, the following definitions and terms are used.

361


362

Absolute UID:

Absolute encoding of a UID according to “Encoding of an object identifier
363

value” clause in ISO/IEC 10035
-
1.

364

ACSE:

Association Control Service Element encoded per “Connectionless protocol
365

f
or the association control service element: Protocol specification”, ISO/IEC
366

10035
-
1. Connectionless ACSE defines the Datagram encapsulation protocol
367

used in this Standard.

368


369

APDU Segment:

An Application Protocol Data Unit that is constructed using C12.22
370

S
egmentation as the process of breaking a C12.22 Datagram into smaller
371

units before transmission, see

C12.22 Datagram Segmentation and
372

Reassembly

.

373


374

Application Association:

See

Association

.

375


376

Application Context:

A set of service elements and supporting
information used on the Application
377

Association. It includes a description of the relationships and dependencies of
378

the C12.22 Application service elements, and a description of the logical
379

structure of information to be exchanged between co
-
operating Appl
ication
380

Entities.

381


382

Application Entity:

The system
-
independent application activities that are made available as
383

application services to the application agent; e.g., a set of application service
384

elements that together perform all or part of the communicatio
n aspects of an
385

application process. [ATIS T1.667
-
1999].

386


387

Application Entity Title:

ISO 7498
-
3, describes an application
-
entity title that is composed of an
388

application
-
process title and an application
-
entity qualifier. The ACSE
389

protocol provides for the
transfer of application
-
entity title values. The
390

Network Layer provides binding between Application Entity Titles (ApTitle)
391

and Network Entity Titles.

392


393

Application Process:

See

Application Entity

.

394


395

Application Protocol Data Unit (APDU): The Application P
rotocol Data Unit (APDU) is a Datagram that is
396

transferred error
-
free between network nodes. The C12.22 standard encodes
397

-

9

-


APDUs using ACSE to carry EPSEM services and C12.19 payloads between
398

C12.22 Nodes.

399


400

ApTitle:

In addition to the addressing constructs (
transport address and possibly
401

session and presentation selectors), the communicating application entities
402

have names
-

application
-
entity titles (AeTitle). These are carried by ACSE
403

as two fields
-

the Application
-
process titles (ApTitle) and the applica
tion
-
404

entity qualifier (AeQualifier). The AeTitle is compound, and the ApTitle
405

consists of all but the last element, which is the AeQualifier.

406


407

C12.22 ApTitles may be encoded absolutely using the <universal
-
id
-
element>
408

or relatively using the <relative
-
uid
-
element>. Relative UIDs shall be unique
409

only within the context of an ANSI C12.22 Network, C12.22 Network Segment

410

or inside C12.22 Nodes. C12.22 Relays, C12.22 Communication Modules or
411

C12.22 Transport Layers shall map Relative UIDs to other Relative UIDs
or
412

Absolute UIDs to ensure the uniqueness of the ApTitle within the context of
413

any network, a C12.22 Network or a C12.22 Network Segment as needed.

414


415

Association:

A cooperative relationship among peer (utilizing the same protocol)
416

Application Entities which

enables the communication of information and the
417

coordination of their joint operation for an instance of communication. This
418

relationship may be formed by the transfer of application protocol control
419

information during the establishment of a connection,
or transitionally, during
420

a single invocation through a connectionless service. Associations can also
421

be predefined and longstanding.

422


This Standard provides for Application Entities that communicate interactively
423

using connectionless communication, and it

provides for state information
424

that is shared between them for the duration of the communication.

425


426

Bit:

A Binary Digit. The unit of information of a computational quantity that can
427

take on one of two values, such as false and true or 0 and 1. A bit is sai
d to
428

be "set" if its value is true or 1, and "reset" or "clear" if its value is false or 0.
429

One speaks of setting and clearing bits. To toggle or "invert" a bit is to
430

change it, either from 0 to 1 or from 1 to 0.
(Reference: Computing
431

Dictionary)
.

432


433

BER:

Ba
sic Encoding Rules as defined by ISO/IEC 8825
-
1, describing methods
434

used to identify and encode data elements for transport.

435


436

Byte:

A group of 8 bits of data. When expressed in this Standard, bit 0 is the least
437

significant bit and it is written at the righ
t
-
most position of a bit sequence. Bit
438

7 is the most signification bit and it is written at the left
-
most position of the bit
439

sequence. The actual bit
-
signal transmission sequence and bit polarity, which
440

represents ones or zeroes, is determined by the char
acteristics of the
441

appropriate OSI Physical Layer used to transmit the byte.

442


443

Calling ApTitle:

The Calling ApTitle is encoded as an Absolute UID or Relative UID. It
444

uniquely identifies the initiator of an ACSE C12.22 Message.

445


446

Called ApTitle:

The Called Ap
Title is encoded as an Absolute UID or Relative UID. It uniquely
447

identifies the target of an ACSE C12.22 Message.

448


449

C12.19 Device Class:

A Relative UID that uniquely identifies a C12.19 Device Table set per the
450

MANUFACTURER field defined in Table 0 of ANSI
C12.19
-
1997 or the
451

DEVICE_CLASS field defined by version 2 of ANSI C12.19.

452


453

-

10

-


C12.22 Application:

An Application Entity that implements a set of services and procedures as
454

defined in this Standard permitting one or more well
-
defined devices (C12.22
455

Host,

C12.22 Relay, C12.22 Device, C12.22 Communication Module, etc.) to
456

interact within the framework of a C12.22 Network. It may also contain
457

C12.19 Tables.

458


459

C12.22 Authentication Host:

A C12.22 Host that is an authoritative administrative host for a register
ing
460

C12.22 Node in the C12.22 Master Relay domain. The C12.22 Authentication
461

Host may be embedded inside a C12.22 Master Relay or it may be a
462

separate C12.22 Node on the network.
There may be one or more C12.22
463

Authentication Hosts operating under the doma
in of a single C12.22 Master
464

Relay. Registration with C12.22 Master Relays can only succeed if at least
465

one C12.22 Authentication Host accepts registration on behalf of a C12.22
466

Node by a C12.22 Master Relay. (MOVE TO APPROPRIATE SECTION)

467


468

C12.22 Client:

A

C12.22 Node which initiates a Logon service request for the purpose of
469

establishing a session with a C12.22 Server.

470


471

C12.22 Communication Module:

Hardware module that attaches a C12.22 Device to a C12.22 Network
472

Segment. A C12.22 Communication Module can
be physically located inside
473

or outside the C12.22 Device enclosure. However, it is physically and logically
474

distinct from the C12.22 Device. The interface between the C12.22
475

Communication Module and the C12.22 Device is completely defined by this
476

Standard
. The combination of a C12.22 Device and a C12.22 Communication
477

module constitutes a C12.22 Node. If a C12.22 Communication Module
478

contain Tables, it is also a C12.22 Node.

479


480

C12.22 Device:

A module that hosts C12.22 Application(s) and provides at least one

Interface
481

to a C12.22 Communication Module.

482


483

C12.22 Gateway:

A C12.22 Node that translates the ANSI Standard C12.22 protocol to/from
484

other protocols. Gateways are required when a C12.22 Node needs to
485

communicate with non
-
C12.22 Nodes. C12.22 Gateways can
be attached
486

directly to the non
-
C12.22 Devices or they can provide their translation
487

services through any network segment.

488


489

C12.22 Host:

A C12.22 Node that may be a C12.22 Authentication Host or C12.22
490

Notification Host or both. A Host typically runs on a
computer instead of within
491

an embedded system (e.g. a meter).

492


493

C12.22 Master Relay:

A C12.22 Relay that operates at the top of a hierarchy of relays. It provides
494

registration services of all devices in its domain. It is also responsible for
495

issuing registr
ation service queries to C12.22 Authentication Hosts and
496

Deregistration service requests and notifications to C12.22 Notification Hosts
497

when registering a C12.22 Node. A C12.22 Master Relay can also act as a
498

C12.22 Host.

499


500

C12.22 Message:

Any notice, servic
e request, service response or device status sent from one
501

C12.22 Node to another C12.22 Node for the purpose of communication
502

across a C12.22 Network. The detailed encoding of C12.22 Messages is
503

defined by the appropriate encoding rules of the OSI Layer f
rom which they
504

are issued.

505


506

C12.22 Network:

A C12.22 communication infrastructure that is composed of C12.22 Network
507

Segments interconnected using C12.22 Relays. A C12.22 Network shall
508

include at least one C12.22 Master Relay.

509

-

11

-



510

C12.22 Network Segment:

A co
llection of C12.22 Nodes that can communicate with each other without
511

forwarding messages through a C12.22 Relay. A C12.22 Network Segment
512

may be either a LAN (Local Area Network) or a WAN (Wide Area Network)
513

and may include bridges or routers.

514


515

C12.22 Nod
e:

A point on the network that attaches to a C12.22 Network Segment. C12.22
516

Nodes contain one or more C12.22 Applications. Each C12.22 Node shall
517

have a unique ApTitle on a C12.22 Network.

518


519

C12.22 Notification Host:

A C12.22 Host, which contains an applica
tion that needs to be notified when
520

C12.22 Nodes are registered for the first time or deregistered. Each C12.22
521

Notification Host may add the registered C12.22 Node to its active client list
522

for subsequent processing by the C12.22 Host application.

523


524

C12.22

Relay:

A C12.22 Node that provides address resolution, Datagram segmentation
525

and optionally message forwarding services to other C12.22 Nodes. Address
526

resolution services consist of mapping Layer 7 addresses (ApTitle) to lower
527

layer addresses (Network Ent
ity Title).

528


529

C12.22 Datagram Segmentation and Reassembly: The process of breaking a C12.22 Datagram into
530

smaller units before transmission and then reassembling it into the proper
531

order at the receiving C12.22 Node. C12.22 Datagrams are made smaller
532

specif
ically because of specified packet size restrictions in a given path
533

across a channel. The transport protocol determines the size of the smallest
534

maximum Protocol Data Unit (PDU) supported by the underlying C12.22
535

Network Segment for the purpose of transmi
ssion to the target C12.22 Node.

536


537

C12.22 Server:

A C12.22 Node that is a recipient of a Logon service request from a C12.22
538

Client for the purpose of establishing a session with that client.

539


540

Channel:

A single path for transmitting signals, usually in dist
inction from other parallel
541

paths. Multiple channels may coexist on the same physical media.

542


The term channel may signify either a one
-
way path, providing transmission
543

in one direction only, or a two
-
way path, providing transmission in two
544

directions.

545


546

Co
nnection:

A logical and physical binding between two or more users of a service.

547


548

Datagram:

A self
-
contained, independent entity of application data carrying sufficient
549

information to be routed from the source Application Layer to the destination
550

Applicati
on Layer. This Standard encapsulates each Datagram as one or
551

more ACSE PDUs.

552


553

EPSEM:

Extended PSEM; Extended structures and services enabling transportation of
554

multiple requests and responses at the same time. There are also provisions
555

for response contr
ol and end device class. EPSEM messages are
556

encapsulated within ACSE PDUs.

557


558

Fragment:

See

APDU Segment

.

559


560

Interface:

The C12.22 Device hardware components used to manifest a C12.22 Node
561

on a C12.22 Network Segment.

562


563

Local Port:

A physical interface that i
s directly attached to the C12.22 Node; or, a
564

physical interface that is located in the immediate vicinity of the C12.22 Node
565

-

12

-


and attached to it by means of a dedicated short signal path (e.g. cable). The
566

main purpose of the Local Port is to provide direct

access to the application
567

process of the C12.22 Node. The C12.22 Node application process may
568

redirect C12.22 Messages that originate from a Local Port to other Local
569

Ports or other C12.22 Node interfaces. Similarly, the C12.22 Node application
570

process ma
y redirect incoming C12.22 Messages to Local Ports. The C12.22
571

Communication Module interface of a C12.22 Device is not a Local Port. All
572

Local Ports of a C12.22 Node shall access to the same C12.22 Application.
573

The physical Local Port characteristics (OSI

Layer 1) are not defined by this
574

Standard; however, the Data Link through Application Layers (Layers 2
-
7) is
575

fully defined by this Standard.

576


577

Network Entity Titles:

?

578


579

Other Device:

Devices that do not implement the ANSI C12.22 protocol.

580


581

PSEM:

Protocol S
pecification for Electric Metering Application language as originally
582

defined by ANSI C12.18
-
1996 and extended by ANSI standard C12.21 and in
583

this Standard.

584


585

Relative UID:

Relative encoding of a UID according to “Encoding of a relative object
586

identifier va
lue” in ISO/IEC 10035
-
1. The Relative UID is a subset of an
587

Absolute UID, e.g. the absolute object identifier 2.100.3.8571.3.2 contains the
588

relative object identifiers 8571.3.2.

589


590

Reliable Transfer:

To be defined

591


592

Segment:

In the context of a C12.22 Network
, a C12.22 Network Segment. In the
593

context of a C12.22 APDU, an APDU Segment.

594


595

Segmentation:

See

C12.22 Datagram Segmentation and Reassembly

.

596


597

Session:

A connection maintained while the two C12.22 Nodes are communicating
598

back and forth in a conversation
of some duration. Managing a session
599

includes setting up and taking down the connection between two
600

communicating C12.22 Nodes. Some connections and sessions last only
601

long enough to send a message in one direction. However, other sessions
602

may last longer,

usually with one or both of the communicatin
g parties able to
603

terminate it.

604


605

Transaction:

A unit of interaction that occurs individually and coherently.

606


607

UID:

Universal Identifiers (UIDs) are universally unique identifiers that are encoded
608

using BER. A UI
D may be formulated as an Absolute UID or a Relative UID
609

and can be used to specify C12.22 object identifiers such as Calling ApTitle,
610

Called ApTitle.

611


612

4.2.

Document Syntax

613

Document syntax is identical to that described in ANSI C12.18.

614


615

Desc
ribing data definitions is usually accomplished within the confines of a given language and the
616

grammar rules of that language. Since the data definitions embodied within this document are meant to
617

be independent of specific language and, hopefully, capab
le of being implemented within the confines of
618

any language, a method for describing the data definitions must be developed. A modified form of the
619

Backus
-
Naur Form (BNF) serves as the basis for building the descriptions used to construct the data
620

definit
ions.

621

-

13

-



622

The modified form of BNF has the following definitions:

623


624

Symbol

Meaning

625


626

< >

A string contained inside angle brackets is called a non
-
terminal. That is, while it may be viewed
627

as a single unit it can and should be redefined as consisting of one or
more simpler elements.

628


629

::=

This symbol is read as “is defined as.” The non
-
terminal which occurs on the left hand side (LHS)
630

of this symbol consists of the elements (non
-
terminals, terminals, or a combination of the two)
631

found on the right hand side (RHS
). A line containing an LHS, ::=, and an RHS is known as a
632

production rule.

633


634

|

The vertical bar is an “OR” symbol. The OR symbol always occurs on the right hand side of a
635

production where the left hand side can be defined in more than one way. The OR ba
r separates
636

valid alternative right hand sides.

637


638

[ ]

A symbol enclosed in square brackets is optional. The production is valid whether or not it is
639

included.

640


641

*

The superscript asterisk is known as the Kleene star. A symbol followed by the Kleene star ma
y
642

occur zero or more times without violating the grammar.

643


644

+

The superscript plus sign is known as the Kleene cross. A symbol followed by the Kleene cross
645

must occur one or more times.

646


647

+n

A symbol followed by the Kleene cross and any superscript number “
n” represents “n”
648

occurrences of the symbol.

649


650

{ }

The curly braces are used to enclose comments within the descriptions. Comments have no
651

impact on the productions.

652


653

4.3.

Table syntax

654

Table document form syntax is identical to that describe
d in ANSI C12.19.

655


656

5.

Reference Topology

657


658

Figure 5.1
describes the C12.22 Network and protocol topology within which C12.22 Nodes are expected
659

to operate.

660


661

This network topology accommodates interconnections among C12.22 Nodes that can

be located on the
662

same or on different networks. C12.22 Messages are forwarded between C12.22 Network Segments
663

using C12.22 Relays.

664


665

The network topology also accommodates C12.22 Gateways that translate the C12.22 protocol to other
666

protocols. C12.22 Devic
es and non
-
C12.22 Devices may be collocated on the same C12.22 Network
667

Segment and optionally provide C12.22 Gateway functionality.

668


669

The interface between a C12.22 Device and C12.22 Communication Module(s) is fully defined in this
670

Standard. However, the St
andard general definition of the interface of a C12.22 Node to a C12.22
671

Network Segment is limited to the Application, Presentation and Session Layers only (layers 7
-
5). The
672

interface between a C12.22 Device and a C12.22 Communication Module (Layers 1
-
4) i
s shown in the
673

Figure 5.1 using triple lines.

674


675

-

14

-


This Standard defines components of a C12.22 Network. Each component is defined with enough
676

flexibility to allow multiple components to be incorporated into one physical device.

677


678

In the case that a C12.22 Nod
e is connected to more than one C12.22 Network Segment, communication
679

through those segments shall be to the same C12.22 Application(s). Access to the C12.22 Node through
680

a Local Port shall also be to
the same C12.22 Application(s).

681


682

When a Local Port is

attached to a C12.22 Device, this port provides access to the C12.22 Application(s)
683

of this C12.22 Device and may optionally provide access to the attached C12.22 Communication Modules.
684

Similarly, when a Local Port is attached to a C12.22 Communication Mo
dule, this port provides access to
685

the C12.22 Application(s) of this C12.22 Communication Module and may optionally provide access to the
686

attached C12.22 Device.

687


688


689



690

Figure 5.1: Reference topology

691


692

693

-

15

-



694

6.

C12.22 Nod
e to C12.22 Network Segment Details

695


696

6.1.

C12.22 Node to C12.22 Network Segment Reference

697

The following diagram shows a C12.22 Node that is attached to a C12.22 Network Segment. It also shows
698

relay and gateway interface requirements needed t
o access remote networks (C12.22 Relay) and the
699

translation services that may exists in these networks (C12.22 Gateway).

700


701


702


703

Figure 6.1: C12.22 Reference network model

704


705

Annotations:

706


707

1.

C12.22 Node attached to a C12.22 Network Segmen
t

708

2.

C12.22 Application communicating using C12.19 Tables, C12.22 PSEM language and EPSEM/ACSE
709

encapsulation

710

3.

Layers 4 through 1 interfacing a C12.22 Application to an unspecified native network infrastructure
711

(e.g. TCP
-
IP/Ethernet, …)

712

4.

C12.22 Application of a
C12.22 Gateway

713

5.

Layers 4 through 1 of a C12.22 Relay

714

6.

C12.22 Gateway performing translation of the C12.22 Application to and from an other application

715

7.

C12.22 Relay performin
g layer 4 through 1 translation

716

8.

Other application of a C12.22 Gateway

717

9.

Remote (other)
network interface side of a C12.22 Gateway

and /or C12.22 Relay

718


719

6.2.

Data order

720

The data order is identical to that defined in ANSI C12.18 and ANSI C12.19.

721


722

Within the syntax definitions, multiple parameters shall be encoded in the order as

shown, from left to
723

right.

724


725

Parameters in all layers within the protocol definition are encoded most significant byte first. The order of
726

data fields within tables is dictated by ANSI C12.19.

727


728

-

16

-



729

<word24>

::=

<msbyte> <byte> <lsbyte>

730

<word16>

::=

<msbyte>
<lsbyte>

731


732

<msbyte>

::=

<byte> {most significant byte}

733

<lsbyte>

::=

<byte> {least significant byte}

734


735

<byte>

::=

<bit0> <bit1> <bit2> <bi
t3> <bit4> <bit5> <bit6> <bit7>

736

737

-

17

-



738

6.3.

Layer 7
-

Application Layer

739

The Application Layer provides a minima
l set of services and data structures required to support end
740

devices for purposes of configuration, programming and information retrie
val in a networked environment.

741


742

This layer is composed of the following four nested components:

743



ANSI C12.19 Table data s
tructure

744



PSEM as defined in this section

745



EPSEM as defined in this section

746



ACSE association control as defined by IEC 8650 and presented in this section

747


748

6.3.1.

Data Structure
-

Utility Industry Data Tables

749


750

The data structure transported by th
is protocol are Tables as defined in ANSI C12.19.

751


752

6.3.2.

Protocol Specification For Electric Metering (PSEM)

753


754

This standard defines thirteen PSEM services. Each service description consists of a request and a
755

response. Each of these request
s and responses is described in following sections.

756


757

<requests>

::=

<ident> |

{* Identification Service request}

758



<read> |

{ Read Service request}

759



<write> |

{ Write Service request}

760



<logon> |

{* Logon Service request}

761



<security> |

{ Security

Service request}

762



<logoff> |

{* Logoff Service request}

763



<terminate>

{* Terminate Service request}

764



<disconnect>

{* Disconnect Service request}

765



<wait> |

{* Wait Service request}

766



<register> |

{** Registration Service request}

767



<deregister> |

{*
* Deregistration Service}

768



<resolve> |

{** Resolve Service request}

769



<trace>

{** Trace Service request}

770


771


772

<responses>

::=

<ident
-
r> |

{* Identification Service response}

773



<read
-
r> |

{ Read Service response}

774



<write
-
r> |

{ Write Service response}

775



<logon
-
r> |

{* Logon Service response}

776



<security
-
r> |

{ Security Service response}

777



<logoff
-
r> |

{* Logoff Service response}

778



<terminate
-
r>

{* Terminate Service response}

779



<disconnect
-
r>

{* Disconnect Service response}

780



<wait
-
r> |

{* Wait Ser
vice response}

781



<register
-
r> |

{** Registration Service response}

782



<deregister
-
r> |

{** Deregistration Service response}

783



<resolve
-
r> |

{** Resolve Service response}

784



<trace
-
r>

{** Trace Service response}

785


786

Notes:

787

* Definition or content revised from A
NSI C12.18 and/or ANSI C12.21

788

** New in ANSI C12.22

789


790

6.3.2.1.

Request Codes

791


792

-

18

-


PSEM requests always include a one
-
byte request code. Code numbers are assigned as follows:

793


794

00
H
-
1F
H


Codes shall not be used to avoid confusion with response codes

795

2
0
H
-
7F
H


Codes are available for use within ANSI C12 protocols

796

80
H
-
FF
H

Codes shall be reserved for protocol extensions

797


798

6.3.2.2.

Response Codes

799


800

PSEM responses always include a one byte response code. These codes are listed below in a suggeste
d
801

order of priority. They represent an extension to the response codes available in ANSI C12.18 and ANSI
802

C12.21. When more than one response code is capable of indicating the error response condition of a
803

C12.22 Node, the response code having the highest p
riority (from left to right) may be provided as follows:

804


805

<nok>

::=

<sns>|<isss>|<iar>|<sme>|<isc>|<onp>|<bsy>|<dlk>|<dnr>|

806



<rno>|<uat>|<netr>|<nett>|<rqtl>|<rstl>|
<sgnp>|
<sgerr>|
<err>

807


808

For example, if a C12.22 Device with a C12.22 Application that conta
in ANSI C12.19 Tables; and Table 5
809

of this device is read
-
only and it is encoded in non
-
volatile memory then a Write Service request to Table
810

5 would fail. The C12.22 Device may consider the following codes as suitable responses: <err> to indicate
811

an error

condition or <dlk> to indicate that the data is locked in memory and cannot be changed, <iar> to
812

indicate that the action requested was not appropriate for this device design or <isc> to indicate that the
813

table access permission are “read
-
only” under the
current security policy. The correct response would be
814

<iar> as it is the highest priority among <iar>, <isc>, <dlk> and <err>. However, if there is a mechanism
815

for providing write access to Table 5, then <iar> should not be considered. Therefore, the resp
onse code
816

becomes <isc>.

817


818

Responses

819


820

<ok>

::=

00
H

{Acknowledge

821




No problems, request accepted.}

822


823

<err>

::=

01
H

{Error

824




This code is used to indicate rejection of the received
825

service request. The reason for the rejection is not
826

provided.}

827


828

<sns>

::=

0
2
H

{Service Not Supported

829




This
Application
-
level
error response will be sent to the
830

device when the requested service is not supported.
831

This error indicates that the message was valid, but the
832

request could not be honored.

The <sns> e
rror response
833

has special implications in the context of a response to a
834

Logoff, Terminate or Disconnect
s
ervice request.
835

Specifically, a C12.22 Node in the
S
ession
S
tate shall
836

not issue this error, but it is permitted if the C12.22 Node
837

only supports
sessionless communication.}

838


839

<isc>

::=

03
H

{Insufficient Security Clearance

840




This
Application
-
level
error indicates that the current
841

authorization level is insufficient to complete the
842

request.}

843


844

<onp>

::=

04
H

{Operation Not Possible

845




This
Application
-
level
error will be sent to the device
846

which requested an action that is not possible. This
847

error indicates that the message was valid, but the
848

-

19

-


message could not be processed

and c
overs conditions
849

such as:
invalid
<length> or invalid <offset>.

It can also
850

be issued if the operation is not possible under the
851

current C12.22 Node configuration.}

852


853

<iar>

::=

05
H

{Inappropriate Action Requested

854




This
Application
-
level
err
or indicates that the action
855

requested was inappropriate. Covers conditions such
as
856

a Write Service request
to a read
-
only Table or an invalid
857

Table identifier.}

858


859

<bsy>

::=

06
H

{Device Busy

860




This
Application
-
level
err
or indicates that the request was
861

not acted upon because the device was busy doing
862

something else. The operation may be retried at a later
863

time with success, as the data may then be ready for
864

transportation during this active communication.}

865


866

<dnr>

::=