Skip to content

Port proven ARIEC61850 IED simulator discovery and wire parity - #61

Merged
masarray merged 14 commits into
agent/complete-server-consolidationfrom
agent/iedsim-wire-parity-current
Aug 11, 2026
Merged

masarray merged 14 commits into
agent/complete-server-consolidationfrom
agent/iedsim-wire-parity-current

Conversation

@masarray

@masarray masarray commented Aug 11, 2026 •

Copy link
Copy Markdown
Owner

Goal

Port the proven server-side interoperability behavior from masarray/ARIEC61850 onto the current static MMS server lineage, using the old IED simulator/server as a behavioral oracle rather than inventing a new engineering-client profile.

The old simulator is known from project history to have been browsable by external vendor external IEC 61850 client. This PR does not claim current live external IEC 61850 client acceptance until a new controlled live trial is captured.

Tranche 1 — IEC 61850 discovery hierarchy

The old simulator advertises Logical Nodes as domain-scoped MMS NamedVariables and exposes FC/DO/DA beneath each LN through its hierarchical TypeSpecification. The current static table also keeps flattened leaf aliases for exact Read/Write lookup, but those aliases must not be advertised as extra top-level NamedVariables when the corresponding LN root exists.

Implemented behavior:

  • GetNameList(NamedVariable) advertises root Logical Nodes such as LLN0, LPHD1, and GGIO1 when root objects exist;
  • flattened aliases such as GGIO1$ST$Ind1$stVal remain available to exact Read/Write lookup but are hidden from the top-level directory;
  • generic flat-only MMS profiles retain the previous behavior when no root object exists;
  • hard-profile regression covers both hierarchical IEC 61850 and flat-only fallback behavior.

Compatibility hooks

  • Added an explicit association compatibility API alongside the strict decoder; the strict parser remains the baseline for protocol-focused paths.
  • Added bounded caller-owned COTP reassembly storage to the connection policy without changing prior aggregate field ordering.
  • Further runtime wiring/segmentation and current-lineage Direct Control/URCB adapter work will land in follow-up commits on this draft PR after exact-head CI validates each tranche.

Evidence boundary

This PR is software/runtime work only at this stage. No IEC 61850 conformance, physical IED interoperability, or current external IEC 61850 client PASS is claimed until live terminal + PCAP evidence is captured.

Verified against the current repository MMS clients with full, embedded, security, reporting/control, and live loopback regression coverage.
@masarray
masarray marked this pull request as ready for review August 11, 2026 15:06
@masarray
masarray merged commit f000772 into agent/complete-server-consolidation Aug 11, 2026
26 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a31112b855

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/mms_urcb_server.cpp
Comment on lines +430 to +431
const auto report = mms::MmsStaticReportConnection::poll(
runtime, urcbs, monotonic_ms(), {}, report_frame, report_workspace);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Supply a timestamp when OptFlds requests one

When a client writes OptFlds with the report-time-stamp bit (0x20), which the writable URCB object currently accepts, every GI or integrity poll passes an empty report_time here. MmsInformationReportSpanCodec::validate_report requires exactly six bytes when that bit is selected, so encoding returns report_encode_failed, the emission plan remains pending, and the server never sends the report. Supply a six-byte BinaryTime value or reject the timestamp option.

Useful? React with 👍 / 👎.

Comment on lines +94 to +95
case MmsStaticUrcbAttribute::sequence_number:
return kUnsigned32Type;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Advertise SqNum as an 8-bit unsigned value

For a GVAA request on a URCB SqNum object, this branch advertises Unsigned(32), even though the runtime stores, increments, and wraps the sequence number as std::uint8_t and the URCB attribute is INT8U. Exact-model clients therefore receive an incorrect schema and may reject the RCB; introduce an unsigned-8 type specification here and align the root SqNum declaration in build_lln0_type().

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant