iec61850-kit 0.8.1

IEC 61850 in Rust: GOOSE and Sampled Values on capture files and live interfaces, an MMS client and server over the full OSI stack, and SCL loading and editing. Panic-free, sans-IO, no_std-capable.
Documentation

iec61850-kit

CI License

IEC 61850 for Rust. Publish and subscribe to GOOSE and Sampled Values, connect to an IED over MMS, or serve an IED model from an SCL file. The protocol cores support no_std with alloc. The blocking client and server accept TCP connections and application-owned streams, including TLS.

Guide · API reference · Changelog

Install

Requires Rust 1.90 or later.

cargo add iec61850-kit

Install the ied command line with brew install hupe1980/tap/ied or cargo install iec61850-kit --features cli.

Use it

List the logical devices on a local MMS server:

use iec61850_kit::client::Client;

fn main() -> iec61850_kit::Result<()> {
    let mut client = Client::connect("127.0.0.1:8102")?;
    for device in client.server_directory()? {
        println!("{device}");
    }
    client.release()
}

To try both roles locally with a bundled SCL model, run cargo run --example server_from_scl from a checkout.

Features

Task Guide
Publish or subscribe over Ethernet or capture files GOOSE · Sampled Values
Browse data, receive reports, operate controls, transfer files, query logs or select setting groups MMS client · Server
Read daily FSCH tariffs on a blocking or async MMS association Tariff schedules
Load, validate or edit ICD, CID and SCD files while preserving formatting SCL
Simulate an IED or inspect a capture from the shell CLI reference

Verification

Run cargo test --all-features from a checkout. Capture, Wireshark and Docker tests need their respective fixtures or tools. The verification guide lists the tested peers, allocation measurements and hardware limitations. The crate has no IEC conformance certificate. Verification

Develop

cargo test --all-features                     # captures, tshark and Docker tests skip if absent

cargo test --all-features --test interop     # needs Docker; builds the peer images on first use
scripts/linux-test.sh --docker                # live GOOSE/SV over a veth pair, in a container

SIM_SEED=42 cargo test --test simulation      # replay one simulation seed
cargo +nightly fuzz run mms_association -- -max_total_time=60
cargo test --test regressions                 # every input a fuzzer once crashed on
cargo build --no-default-features --features goose,sv,mms --target thumbv7em-none-eabihf

IEC standards are copyrighted and are not part of this repository. scripts/fetch-references.sh fetches the freely available material — ITU-T recommendations, RFCs, public standard previews, sample captures and OpenSCD test fixtures — into a local reference corpus (IEC61850_REFERENCE chooses where). Tests that need it skip when it is absent.

Licence

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

An independent implementation, not affiliated with or endorsed by the IEC.