Skip to content

Repository files navigation

profinet-interop - PROFINET IO Reference Implementations in Containers

License: MIT

Independent PROFINET IO implementations packaged as containers behind one command-line contract, so that a PROFINET implementation under test can be run against them on a real Layer 2 network: the IO-Device of rt-labs p-net and of pnio-rs, the IO-Controller and DCP tool of profinet-py, the DCP tool pnio-dcp, two MRP ring nodes, umrp and Microchip's mrp, the SNMP manager of Net-SNMP, and two independent decoders, scapy and tshark, that check every capture.

It serves otfabric/go-profinet, whose interop tests (make -C ../go-profinet interop) drive these images and write the results the interoperability matrix is generated from.

Docs: CONTAINER_CONTRACT.md (the commands and JSON documents every image exposes) · MATRIX.md (results) · INTEROPERABILITY.md (what each peer can and cannot test, the discrepancies found) · versions.yaml (pins) · THIRD_PARTY_NOTICES.md · go-profinet's support, feature and interop matrix (the results summarized peer by peer and feature by feature)

The implementations

Adapter Implementation Version Licence Role go-profinet tested as
pnet rt-labs p-net ea5e554 (2023-11-10) GPL-3.0-only or commercial IO-Device (C) IO-Controller, DCP requester, LLDP agent
pnio-rs pnio-rs v0.1.0 MIT OR Apache-2.0 IO-Device (Rust) IO-Controller, DCP requester
profinet-py profinet-py 0.6.6 GPL-3.0-only or commercial IO-Controller, DCP tool (Python) IO-Device, DCP responder
pnio-dcp pnio-dcp 1.2.0 MIT DCP tool (Python) DCP responder
scapy scapy contrib pnio 2.8.0 GPL-2.0-only decoder every capture
tshark Wireshark tshark 4.4.19 (Debian trixie 4.4.19-0+deb13u1) GPL-2.0-or-later decoder every capture
netsnmp Net-SNMP command-line manager 5.9.3 (Debian) BSD-style SNMP manager (C) SNMP agent of the IO-Device
umrp umrp with this repository's bridge ifdriver v4.0 GPL-2.0 MRP ring node, MRM, MRC or MRA (C, user space); any Linux kernel MRP manager, client and automatic manager in a ring
mrp microchip-ung/mrp with one fix (boeboe/mrp ee224a1, proposed upstream in microchip-ung/mrp#4) 177717e (after v1.2) GPL-2.0 MRP ring node, MRM, MRC or MRA (C, on the kernel's bridge MRP); needs a host kernel with CONFIG_BRIDGE_MRP and without CONFIG_NET_SWITCHDEV (Docker Desktop: no bridge MRP; GitHub-hosted runners: switchdev built in; go-profinet runs it in a micro-VM with its own kernel) MRP manager, client and automatic manager in a ring

Evaluated and not used: profinet-python (M256-Automation; no licence, a Connect that compliant devices reject, unmaintained) and the PI Community Stack (PROFIBUS & PROFINET International members only, under an agreement that excludes combination with copyleft code). See INTEROPERABILITY.md.

Use

make images

builds every image as profinet-interop-<adapter>:dev; the go-profinet interop tests use these names by default.

docker run --rm profinet-interop-pnet:dev print-capabilities

Each container needs --cap-add NET_RAW --cap-add NET_ADMIN and, except the MRP ring nodes (cabled with veth pairs, see the contract), a Docker bridge network:

docker network create --subnet 10.77.0.0/24 pn
docker run -d --name pnet --network pn --ip 10.77.0.10 --cap-add NET_RAW --cap-add NET_ADMIN profinet-interop-pnet:dev device --station pnet-dut
docker run --rm --network pn --ip 10.77.0.4 --cap-add NET_RAW --cap-add NET_ADMIN profinet-interop-pnio-dcp:dev dcp identify-all

OT Fabric's own stack

ghcr.io/otfabric/profinet-interop-otfabric is go-profinet behind the same contract (adapter otfabric: IO-Device, IO-Controller, DCP tool), so you can test your stack against ours the way we test ours against yours. It is the only image this repository publishes. Despite the name it shares with the reference images, it is not an independent implementation and not part of a release, so its tags are go-profinet versions: see own/go-profinet/README.md.

Cross-stack self-test

make images
make interop                       # pnio-dcp against pnio-rs
GATE=otfabric scripts/interop.sh otfabric pnio-dcp profinet-py pnio-rs   # with ADAPTER_IMAGE_otfabric=<image>

runs DCP and a cyclic AR between every pair of the given adapters (with GATE=<adapter>, only the pairs that involve it), each pair on its own Docker bridge network (tests/cases.tsv), and writes reports/results.json (interop-result-v1). It is small on purpose: go-profinet's interop suite is the behavioural test. CI (ci.yml, on a pull request that is not documentation only and on its schedule) runs make interop on amd64 and arm64 and fails on a fail, an infra-error or no pass at all.

Upstream candidates

A daily workflow (.github/workflows/candidate.yml, also on demand) compares every pin with the latest upstream: p-net with its newest GPL release tag (later p-net trees are evaluation snapshots without ports: reported and flagged), pnio-rs with its newest GitHub release, profinet-py, pnio-dcp and scapy with PyPI, tshark with the Debian trixie package (pinned by its Debian version) and netsnmp with the Debian bookworm package. Where a pin is behind, it builds the adapter on the latest upstream and checks it with the smoke test, its capability document and the contract against the other adapters at their pins, and pnio-dcp and pnio-rs also with the cross-stack self-test (go-profinet's interop suite is the behavioural test). The decision table goes to the Job Summary and to one issue that stays open while any pin is behind. The same workflow compares the digest of every pinned base image with the one its tag points to now (upstream-images of otfabric/.github), with its own issue, "Upstream base images: digests behind their tags". Pins are never moved automatically and no image is pushed.

make latest-upstream                                   # the decision table
make images
make candidate-scapy CANDIDATE_VERSION=2.8.0           # a release pin
make candidate-pnio-rs CANDIDATE_VERSION=<tag> CANDIDATE_SHA=<commit>

Every Dockerfile takes its upstream as UPSTREAM_VERSION and/or UPSTREAM_SHA (UPSTREAM_SHA256 for the pnio-dcp wheel). At the pin the release build and its hash checks are unchanged; any other value takes a candidate path that says candidate build: ... on stderr.

Licences

The adapters, scripts and documents of this repository are MIT licensed. The implementations keep their licences; none of their code is in this repository. The images fetch them by pinned commit or version (and hash) at build time and carry their licence under /licenses/. Images of GPL implementations are built locally and are not published, so that each user obtains the implementation from its source under its licence. The p-net tree used is the last complete public GPLv3 snapshot, older than the v1.0.2 security fixes: run it only on isolated test networks.

GSDML corpus

corpus/manifest.jsonl lists 191 public GSDML files and archives (132 in 32 GitHub repositories, pinned to commits, and 59 vendor downloads), with what verifies them; make corpus-fetch downloads them into a local cache, never into the repository, and a consumer tests its GSDML handling against that cache. See docs/CORPUS.md.

Releases

Tags vX.Y.Z are released by .github/workflows/release.yml from the notes in RELEASE.md: it checks that the tag, versions.yaml and the notes agree, builds and contract-checks every image on amd64 and arm64, and publishes the notes with versions.yaml and the matrix results. No image is published (see Licences); the own image is published apart from a release. go-profinet pins a release (INTEROP_REF).

Project structure

adapters/<name>/      Dockerfile and the adapter script of each implementation
docs/                 container contract, interoperability notes, matrix
matrix/results.json   the machine-readable matrix
matrix/interop-result-v1.json  the matrix as the organisation's interop-result-v1 (stable IDs: matrix/ids.tsv, waivers: tests/known-differences.tsv)
schemas/              interop-result-v1, and the capability document (capabilities.schema.json)
corpus/               the GSDML corpus manifest and its fetch tool (docs/CORPUS.md; no vendor file)
own/go-profinet/      OT Fabric's own stack behind the contract (published by hand, not released)
scripts/              version check, latest upstream, matrix generation, release notes, smoke and cross-stack self-test
tests/                cases of the self-test, known differences
versions.yaml         every pin, and the version of this repository
RELEASE.md            how a release is made; the notes of every version

When CI runs

Event Workflow What runs
Pull request pr.yml policy.yml (otfabric-policy) always; ci.yml unless every changed file is documentation; then OT Fabric Required Checks
Push to a branch none nothing; dispatch ci.yml to test a branch without a pull request
Push to main policy.yml the light checks; the merged commit was tested as the pull request's merge commit
Schedule candidate.yml, ci.yml the scheduled runs, on main
Release release.yml on a tag push or a manual run on main: refuses a tag that versions.yaml (interop_version) and RELEASE.md do not name, runs scripts/check-versions.sh, shellcheck and py_compile (make lint), then builds every image on amd64 and arm64 and checks it against the contract (make contract). No unit tests and no cross-stack self-test; no image is pushed

Documentation means an added or modified *.md file outside .github/, testdata/ and vendor/, other than AGENTS.md and CLAUDE.md. A deleted or renamed document, or any other file, runs everything. OT Fabric Required Checks fails unless every job that applies succeeded; its summary lists them.

Releases

Packages

Contributors

Languages