Skip to content

Latest commit

 

History

History
217 lines (179 loc) · 14.3 KB

File metadata and controls

217 lines (179 loc) · 14.3 KB

ARIEC61850 C++ Migration Checklist

Status legend: [x] implemented and regression-tested, [~] implemented but awaiting external/CI or physical-lab evidence, [ ] not started. The C# repository remains the behavioral oracle until laboratory interoperability is complete.

Phase 0 — portable deterministic foundation

  • C++20 static library and CMake build.
  • Strict compiler warnings promoted to errors.
  • GitHub Actions matrix: GCC, Clang, and Windows MSVC.
  • BER primitives, Ethernet/VLAN/process-bus framing, and classic PCAP.

Phase 1 — deterministic process-bus core

  • MMS UTC time and recursive Data/AllData codec.
  • GOOSE wire codec and offline runtime supervision.
  • Sampled Values PDU/frame codec, quality, payload, counter, and stream diagnostics.
  • Synthetic PCAP equivalence, sanitizer, mutation, and libFuzzer hardening.
  • Real IED or vendor-simulator GOOSE/SV capture accepted.
  • Real-time SV publisher timing-health validation.

Phase 2 — engineering file formats

Phase 2A — SCL foundation

  • Bounded XML/SCL parser with DTD/entity rejection.
  • IED, DataSet, FCDA, GOOSE, SV, report-control, and Communication models.
  • Edition detection and DataTypeTemplates resolution.
  • DataSet binding, APPID/MAC/VLAN normalization, conflict diagnostics.
  • SCL deterministic mutation smoke and libFuzzer corpus.
  • Mutable SCL workspace and standards-aware export.

Phase 2B — COMTRADE foundation

  • CFG identity, channel, frequency, sample-rate, timestamp, file-type, and time-multiplier parsing.
  • ASCII DAT analog/digital decoding.
  • BINARY, BINARY32, and FLOAT32 DAT decoding.
  • Analog a * raw + b scaling and packed digital status words.
  • Multi-rate timestamp fallback and bounded record layout arithmetic.
  • Default voltage/current phase channel mapping.
  • SCL Sampled Values to COMTRADE channel mapping with confidence diagnostics.
  • C#-derived ASCII and binary fixtures.
  • Read-only COMTRADE human/JSON inspection CLI.
  • COMTRADE mutation smoke and LLVM libFuzzer corpus.

Phase 3 — MMS transport and association

Phase 3A — TPKT and COTP foundation

  • RFC 1006 TPKT encode/decode with exact length validation.
  • Incremental TPKT stream decoder for fragmented/coalesced byte streams.
  • COTP CR, CC, DT, DR, and ER TPDU decoding.
  • C#-compatible default Connection Request vector.
  • TPDU-size negotiation and C1/C2 TSAP selector mirroring.
  • Data TPDU segmentation with EOT and TPDU-number handling.
  • Bounded COTP reassembly by bytes, fragments, and empty non-final fragments.
  • Deterministic golden-vector and abuse-path regression tests.
  • OSI transport mutation smoke and LLVM libFuzzer corpus.

Phase 3B — session, presentation, and ACSE

  • ISO Session Connect/Accept SPDU codec with bounded parameter parsing.
  • Session data-transfer profile with optional Give Tokens prefix.
  • Presentation CP/CPA mode, selector, context-definition, and result codecs.
  • ACSE and MMS presentation-context negotiation with BER transfer syntax.
  • Fully-encoded-data PDV and P-DATA context routing.
  • Structured ACSE AARQ/AARE application-context and identity envelopes.
  • EXTERNAL user-information handling with opaque MMS Initiate payload boundary.
  • C#-compatible 184-byte request and deterministic 138-byte response vectors.
  • Session-parameter and presentation-context mirroring in association responses.
  • OSI association mutation smoke and LLVM libFuzzer corpus.

Phase 3C — MMS envelopes and services

  • MMS Initiate request/response with C# byte-exact request parity.
  • Confirmed request, response, and structured error envelopes.
  • Top-level PDU classification and invoke-ID extraction from MMS or P-DATA.
  • Bounded per-invoke and unmatched-result routing.
  • VMD, domain, and association-specific ObjectName codecs.
  • GetNameList request/response and continuation handling.
  • GetVariableAccessAttributes and bounded recursive TypeSpecification codecs.
  • Multi-variable Read with direct data and per-result access failures.
  • Multi-variable Write with per-variable success/failure results.
  • MMS-services mutation smoke and LLVM libFuzzer corpus.

Phase 4 — reporting, live discovery, control, and file service

Phase 4A — offline reporting foundation

  • DataSet and BRCB/URCB inventory from supplied discovery evidence.
  • GetNamedVariableListAttributes request/response and member normalization.
  • InformationReport unconfirmed-PDU codec with per-item failures.
  • OptFlds-driven report header, inclusion, value, data-reference, and reason mapping.
  • C# exact report-shape compatibility regression.
  • RCB attribute read-plan and typed state/availability mapping.
  • Sequence, configuration, DataSet, overflow, and segmentation continuity tracking.
  • Bounded offline report stream/frame retention.
  • MMS-reporting mutation smoke and LLVM libFuzzer corpus.

Phase 4B — association and subscription runtime

  • Transport-injected TPKT/COTP/Session/Presentation/ACSE/MMS lifecycle.
  • Negotiated TPDU and MMS association limits.
  • Deadline and std::stop_token cancellation paths.
  • Bounded invoke-ID allocation and confirmed-result routing.
  • InformationReport delivery while confirmed requests are pending.
  • RCB re-probe and occupied-control takeover protection.
  • URCB reservation, RptEna enable/disable, optional GI, and touched-state cleanup.
  • Persistent report polling and Phase 4A monitor ingestion.
  • Cleanup-required evidence and retry path after association loss.
  • BRCB retained-history replay, EntryID resume/rewind, PurgeBuf, replay-gap/overflow recovery, association ownership, ResvTms/Owner lifecycle, and recovery image v2 with legacy v1 restore.

Phase 4C — built-in TCP and live read-only discovery

  • Non-blocking Windows Winsock and POSIX TCP MmsByteTransport implementation.
  • IPv4/IPv6 resolution, TCP_NODELAY, keepalive, partial-send, and peer-close handling.
  • Deadline and cancellation-aware connect/send/receive readiness waits.
  • Bounded live GetNameList pagination for domains, variables, and DataSets.
  • Optional GetVariableAccessAttributes type probes.
  • Optional GetNamedVariableListAttributes DataSet directory reads.
  • Optional read-only RCB attribute inventory/state probes.
  • Read-only ariec61850_live_discover human/JSON CLI.
  • Discovery service allowlist regression proving no MMS Write request is emitted.

Phase 4C.1 — live-model parity and physical read-only interoperability

  • C#-compatible live-ied-model-v1 output schema.
  • Logical Device / Logical Node / Data Object / Data Attribute hierarchy.
  • IEC 61850 reference and functional-constraint normalization.
  • Direct and nested TypeSpecification mapping to discovered attributes.
  • Conservative IED identity and logical-device alias inference.
  • CDC inference with explicit confidence.
  • DataSet and BRCB/URCB evidence in the live model.
  • Deterministic canonical manifest and fingerprint.
  • C#↔C++ parity comparison script.
  • Reconnect-cycle physical read-only evidence runner for Windows/Linux.
  • Automated stability, warning-policy, coverage, and optional parity gates.
  • Bounded GO/SV/SG/LG deep reader using exact live MMS NameList variables only.
  • Machine-readable control-block runtime attribute/value/status overlay excluded from structural parity fingerprint.
  • GCC/Clang strict validation, sanitizer/libFuzzer smoke, and Windows MSVC matrix accepted on the feature branch.
  • Controlled physical IED read-only evidence accepted: OCR7SR12 RCB contention probe and SGCB 5/5 deep read.
  • Integrated live_discover --control-block-values physical OCR7SR12 run accepted: 1/1 SGCB complete, 5/5 attributes read, diagnostics=0, pending-value warning cleared.
  • C# and C++ same-IED OCR7SR12 structural/type/runtime comparison accepted with zero blocking findings.
  • Primary-vendor OCR7SR12 ten-cycle acceptance: 10/10 stable discovery cycles, full 286/286 RCB and control-block gates, 3/3 StableProceed contention cycles, and 13/13 fresh associations.
  • Controlled OCR7SR12 timeout/recovery evidence accepted: healthy baseline, post-association response withholding, client request timeout observed, fresh direct recovery, and identical 934b555dff76a46f structural fingerprint before/after recovery.
  • Pagination continuation evidence accepted on a target that requires more than one page.

Phase 4D-R — BRCB operational semantics

  • Retained bounded history with independent delivery cursor.
  • EntryID replay/resume and rewind-to-oldest semantics.
  • PurgeBuf and explicit replay-gap handling.
  • Association-aware reservation/ownership with ResvTms reconnect/expiry behavior.
  • MMS BRCB operational object exposure and association-context propagation.
  • TCP/reset/COTP-DR association-loss lifecycle bridge.
  • Recovery image v2 preserves retained replay history/cursor/gap and restores legacy v1.
  • [~] Physical ESP32-P4 BRCB raw-partition geometry/latency/endurance/power-loss evidence remains a separate NVM gate.

Phase 4D-C — guarded IEC 61850 Control Model parity

  • C1 association-aware, default-deny guarded-control safety state machine.
  • C1 Direct normal, SBO normal, Direct enhanced, and SBO enhanced lifecycle semantics.
  • C1 immutable selected sequence, ownership, timeout, Cancel, association-loss cleanup, and ctlNum 1..255 wrap.
  • C2 exact live-TypeSpecification Oper, SBOw, and Cancel structure builder.
  • C2 typed SPC/DPC/integer/unsigned/floating/step control values and conservative vendor-field rejection.
  • C2 exact origin, ctlNum, T, optional operTm, Test, and two-bit Check construction with golden MMS Data evidence.
  • C3 enhanced-security CommandTermination and LastApplError object correlation.
  • C3 standard ControlError and AddCause 0..27 mapping with raw unknown-code preservation.
  • C4 live ctlModel/GVAA/GetNameList/CF-timeout discovery over the production MMS association runtime.
  • C4 Direct/SBO/SBOw/Oper/Cancel orchestration, asynchronous application-error grace window, non-fatal enhanced termination timeout, and no automatic command retry.
  • C1-C4 integrated into the normal ARIEC61850::core build and GCC/Clang/MSVC CTest matrix.
  • C5 guarded live-interoperability harness implemented with read-only default, explicit arm token, typed values, status-before/after reads, deterministic control-Write counting, JSON evidence, Wireshark filter hint, and offline safety self-test.
  • C5 dedicated GCC/Clang/MSVC harness CI and build artifact workflow implemented.
  • C5 tested-simulator acceptance is recorded for Direct normal, SBO normal, Direct enhanced, and SBO enhanced; the complementary locally retained subset includes hashed JSON/PCAP for SBO enhanced SelectWithValue/Cancel, negative LastApplError/AddCause, Direct enhanced Oper/positive CommandTermination, exact Write counts, and state restoration.
  • [~] Association-loss, multi-client contention, physical-IED, and broader multi-vendor control cases remain pending.

Later Phase 4 work

  • MMS FileDirectory [77] codec with root/nested paths, attributes, moreFollows, and continueAfter.
  • Bounded FileDirectory pagination with deterministic order-preserving deduplication and no-progress detection.
  • MMS FileOpen/FileRead/FileClose [72-74] codecs with signed Integer32 FRSM parity.
  • Caller-owned streaming sink runtime with byte/read/block/diagnostic bounds and advertised-size validation.
  • Best-effort FileClose after read, validation, sink, and observed cancellation failures without replacing the primary error.
  • Precise file/file-non-existent rooted-backslash fallback before the first FileRead only.
  • Host list/download CLI, JSON evidence, dedicated regression suite, mutation smoke, and libFuzzer corpus.
  • Controlled live FileDirectory and small-file download with successful FileClose and local hash evidence.
  • Controlled live forced block-limit failure with zero local bytes and successful FileClose cleanup.
  • Multi-page physical FileDirectory continuation evidence.
  • Multi-vendor file-service acceptance and ESP32 device validation.
  • Dynamic DataSet define/delete parity and full dynamic RCB lifecycle parity where still missing from the C# surface.

Phase 5 — simulator and applications

Phase 5A — native deterministic simulator domain runtime

  • Native IedSimulatorProfile domain model ported from the C# simulation surface.

  • Native SCL-to-simulator profile builder uses the complete structural DataTypeTemplates projection; DataSets enrich but never shrink the model.

  • Selected/runtime IED identity remap, structural-only leaves, DataSets, URCB/BRCB metadata, configured ctlModel, Quality, and Timestamp defaults are regression-tested.

  • Deterministic IedSimulatorEngine reset/start/stop/manual mutation/step/snapshot state model ported without wall-clock dependencies in the core.

  • Qt simulator value presentation consumes the portable profile builder instead of maintaining a second leaf-discovery/default-classification implementation.

  • GCC strict regression plus Qt public-wire simulator regression guards the ported runtime adapter.

  • Deterministic IED simulation and read-only MMS server integration parity.

  • CLI/application parity and broader Windows Npcap abstraction where still required.

  • Native Engineering Workbench, simulator, discovery, and SV publisher UI parity where product scope still requires it.

Safety gate

SCL, COMTRADE, PCAP, and the Phase 4C/4C.1 discovery surface remain read-only. MMS file download is also remote-content read-only but has an active FileOpen/FileRead/FileClose resource lifecycle, so the host CLI requires an explicit remote path/destination and controlled-lab authorization. Phase 4D-C live control is an explicit, authorization-gated API and the C5 interoperability harness is read-only by default; it refuses a control Write without the exact laboratory arm token. RCB mutation, control, dynamic DataSet mutation, remote file mutation, Npcap transmission, and real-time process-bus scheduling retain separate explicit safety gates. Hosted CI does not constitute physical IED interoperability or IEC 61850 conformance certification.