IEC 61850 MMS Driver
Overview
IEC 61850 MMS (Manufacturing Message Specification) — the international standard for automation in power plants, substations, ESS, and wind farms. Runs on the full ISO stack (TPKT → COTP → ISO Session → ISO Presentation → ACSE → MMS). Uses an in-house Java ASN.1/BER implementation (no external dependencies).
| Item | Value |
|---|---|
opc_type | IEC61850 |
| Implementation class | plantpulse.driver.protocol.iec61850.IEC61850Driver |
| Library | In-house Java implementation (no external dependencies, ASN.1 BER written in-house) |
| Inheritance | BaseProtocolDriver |
| read | OK (ReadRequest → AccessResult(MmsValue), polling) |
| write | OK (isWriteSupported() = true) |
| Security | None (IEC 62351 not implemented) |
| Default port | 102 (TCP) |
In addition to polling reads, for each RCB specified in report-control-blocks the driver MMS-writes RptEna=true (plus the optional GI=true) on every connection, automatically restoring the report subscription. InformationReport (unsolicited push) messages are handled by the lastReportByVariable cache, and reads serve only cache entries fresher than the TTL (report-cache-ttl-ms) — on expiry it falls back to polling.
Class Structure (top-down)
TCP
└ ISO TPKT (RFC 1006) — Tpkt.java
└ ISO COTP (Class 0) — Cotp.java
└ ISO Session — IsoSession.java
└ ISO Presentation — IsoPresentation.java
└ ACSE — Acse.java
└ MMS (ASN.1 BER) — MmsPdu.java + Asn1.java + MmsAddress.java
Connection sequence (connect()): COTP CR → CC → Session CONNECT (encapsulating Presentation CP / ACSE AARQ / MMS Initiate-Request) → AARE → decode and validate MMS Initiate-Response. Constant DEFAULT_TPDU_SIZE = 0x0B (2048 bytes, as recommended by IEC 61850). Only a single session is used — transact() serializes transactions with synchronized and validates the response invokeID (mismatch = stale reject + socket invalidation).
OPC Registration Options
| Key | Default | Description |
|---|---|---|
opc_agent_ip / opc_agent_port | 102 if port is 0 | IED IP / port |
options.connect-timeout | 5000 ms | TCP connect timeout |
options.read-timeout | 5000 ms | read SO timeout |
options.enable-information-report | false | Whether BRCB/URCB reporting is enabled |
options.report-control-blocks | (none) | Comma-separated list of RCB references — e.g. LD0/LLN0$BR$brcb01 (dot notation allowed) |
options.report-gi | true | Performs a general interrogation (re-receive all current values) by writing GI=true immediately after RCB activation |
options.report-cache-ttl-ms | 30000 ms | Freshness TTL for the report cache — falls back to polling on expiry. <=0 disables expiry |
Tag plc_address Format
MmsAddress accepts both LD/LN.DO.DA[$FC] notation and wire notation (LD/LN$FC$DO$DA). A slash (/) separates domain and item; a dot (.) is replaced with $ during wire conversion.
| Notation | Meaning |
|---|---|
IED1Server/MMXU1.MX.A.phsA | Domain IED1Server / Item MMXU1$MX$A$phsA |
IED1Server/MMXU1$MX$A$phsA | Same in wire notation |
LD1/LLN0.Mod.stVal | LD LD1, LN LLN0, DO Mod, DA stVal |
The FC (Functional Constraint) is either stated explicitly with $FC or written by including its standard position ($MX / $ST, etc.).
Read / Write
- read:
buildReadRequest→transact()(synchronized) →parseReadResponse→ returnsAccessResult(MmsValue) as a string. An InformationReport arriving interleaved while awaiting a response is cached and the wait continues. Three consecutive read failures (READ_FAIL_STREAK_LIMIT) drop connected — triggering edge recovery (PLCRecovery). - write:
isWriteSupported() = true.data_type→ MmsValue mapping:
data_type alias | MmsValue |
|---|---|
boolean / bool | bool |
integer / int / long / short / byte | integer (parsed as long) |
unsigned / uint / ulong | unsigned |
float / double / real / floating-point | floating |
octet-string / octet / bytes | octet |
visible-string / string / "" / varchar | visible |
mms-string / utf8 | mmsString |
| Others | visible (fallback) |
data-access-error codes are exposed as WriteResponse.errorCode.
Unsupported Areas
- GOOSE / Sampled Values (multicast) — requires a separate raw-Ethernet stack.
- SCL (.icd / .scd) parsing — no automatic data model discovery; entries must be made manually by the user.
- IEC 62351-3/-6 — no TLS / authentication / integrity protection.
The ASN.1 BER utilities in this implementation are spec-accurate, but full wire-level interoperability with real IEDs is scheduled for a later phase. Thorough validation is recommended before production use.
References
- IEC 61850-7-2 (ACSI), -8-1 (mapping to MMS), ISO 9506 (MMS). ASN.1 BER — ITU-T X.690.
- Code:
plantpulse-edge-driver/src/plantpulse/driver/protocol/iec61850/.