OPC UA .NET Standard Stack

repository·master·Indexed 25 days ago

https://github.com/opcfoundation/ua-.netstandard

The official OPC Foundation reference implementation of the OPC Unified Architecture for .NET. This certified, cross-platform solution provides a full-stack implementation for industrial, manufacturing, and IoT environments, including support for PubSub (Part 14), Historical Access (Part 11), State Machines (Part 16), and Global Discovery Server (GDS) functionality.

Tokens
348.4K
Snippets
607
Records
1.2K
Agent score
80%

What's inside OPC UA .NET Standard Stack

  1. Overview of OPC UA Profiles and Facets Support

    master

    The OPC UA .NET Standard Stack is a reference implementation targeting OPC UA specification version 1.05.07. It provides extensive support for various OPC UA parts and companion specifications.

    Version 2.0 includes full server- and client-side support for:

    • Part 9 (Alarms & Conditions)
    • Part 11 (Historical Access) + Part 13 (Aggregates)
    • Part 16 (State Machines)
    • Part 17 (Alias Names)
    • Part 18 (Role Management)
    • Part 20 (File Transfer)
    • Part 100 (Device Integration / Software Update)
    • OPC 10100-1 (WoT Connectivity)
    • Local Discovery Server (LDS)

    Profiles are identified by URIs. The URIs advertised in a server's ServerProfileArray are the canonical strings used for discovery and capability negotiation.

  2. What is the OPC UA PubSub Adapter

    master

    The OPCFoundation.NetStandard.Opc.Ua.PubSub.Adapter provides adapters that bind OPC UA PubSub publisher, subscriber, or action datasets to an external OPC UA server. This binding is achieved through a managed client session (Opc.Ua.Client.ManagedSession).

    It supports three primary roles:

    • Publisher: Reads nodes from an external server and publishes them as PubSub DataSets. It supports two source modes: cyclic Read calls or a client Subscription (monitored items) with affinity per WriterGroup (default) or DataSetWriter.
    • Subscriber: Writes received PubSub DataSet values back to an external server.
    • Actions: Maps inbound PubSub Action requests to method calls on the external server.
  3. Overview of OPC UA PubSub Diagnostics tooling

    master

    The OPCFoundation.NetStandard.Opc.Ua.PubSub.Diagnostics package provides tools for packet-capture, dissection, and replay of OPC UA PubSub (Part 14) traffic. It is designed to handle both UDP datagram and MQTT broker transports.

    Key capabilities include:

    • Capture: In-process capture via a zero-cost, opt-in tap on Opc.Ua.PubSub.Udp or Opc.Ua.PubSub.Mqtt transports, or capturing directly from a network interface.
    • Dissect: Converting captured UADP and JSON NetworkMessages into structured DataSetMessages / DataSets using standard PubSub decoders.
    • Decrypt: Decrypting encrypted UADP NetworkMessages (specifically PubSub-Aes128-CTR and PubSub-Aes256-CTR per Part 14 §8.3 / Annex A.2.2.5) by resolving the SecurityTokenId in the UADP SecurityHeader to the appropriate key.
    • Replay: Replaying recorded captures through the dissection pipeline.
  4. Overview of OPC UA .NET Standard Diagnostics

    master

    The OPC UA .NET Standard stack provides a diagnostics surface for monitoring and troubleshooting. This includes:

    • Telemetry context (ITelemetryContext): A mechanism to plumb logs, traces, and metrics through the stack.
    • OPC UA server audit events: Spec-defined events for auditing server activity.
    • Built-in diagnostics information model: A standard OPC UA information model for server diagnostics.
    • Packet capture, dissection, and replay: An engine provided by OPCFoundation.NetStandard.Opc.Ua.Core.Diagnostics for analyzing network traffic.
  5. Overview of the Fuzzing Infrastructure

    master

    The fuzzing infrastructure in this repository is designed to identify vulnerabilities in large untrusted-input surfaces, such as encoders, decoders, and network protocols. It currently utilizes SharpFuzz (which wraps afl-fuzz and libFuzzer) to perform fuzzing.

    Key components include:

    • fuzzing/common/Fuzz/: Contains the shared host (Program.cs, FuzzMethods.cs) which uses reflection-driven target discovery over FuzzableCode.
    • fuzzing/common/Fuzz.Tools/: Provides shared utilities for playback, logging, and testcase generation.
    • fuzzing/Encoders/Fuzz: The primary area currently being fuzzed, covering Binary, JSON, and XML decode/encode operations.
    • fuzzing/Encoders/Fuzz.Tests: A deterministic NUnit replay suite used to replay corpus data and assets (crashes, timeouts, etc.) through fuzzing targets. These tests are categorized with [Category("Fuzzing")].
  6. What is the OPC UA MCP Server?

    master
    The OPC UA MCP Server is an implementation of the Model Context Protocol (MCP) that exposes OPC UA Part 4 service calls as MCP tools. This allows Large Language Models (LLMs) like Claude, Copilot, or VS Code to interact directly with OPC UA servers by performing tasks such as browsing the address space, reading/writing values, and invoking methods through natural language or tool calls.
  7. Overview of OPC UA PubSub capabilities

    master

    The OPCFoundation.NetStandard.Opc.Ua.PubSub package implements the OPC 10000-14 (Part 14) publisher/subscriber side-channel. It operates independently of the standard Client/Server session model.

    Key features include:

    • Object Model: Uses IPubSubApplication with connection, writer-group, and reader-group abstractions.
    • Message Mappings: Supports UADP (binary) and JSON encodings.
    • Transports: Supports UDP, MQTT, and broker-less transports (via companion packages Opc.Ua.PubSub.Udp and Opc.Ua.PubSub.Mqtt).
    • Security & Management: Includes dataset filtering, AES-CTR message security with a Security Key Service, diagnostics, and persisted state.
  8. Overview of the OPC UA PubSub Library

    master

    The Opc.Ua.PubSub.* library implements the OPC UA Part 14 v1.05.06 specification. It provides a high-performance Publish/Subscribe model supporting various transports, encodings, and security mechanisms.

    Key Features

    • Transports: UDP (unicast, multicast, broadcast), DTLS over UDP, MQTT (3.1.1 and 5.0), Kafka, and Ethernet (Layer 2 UADP with 802.1Q VLAN).
    • Encodings: UADP and JSON, supporting Verbose, Compact, and RawData modes.
    • Security: AES-128-CTR / AES-256-CTR with HMAC-SHA-256 and replay-window enforcement. Includes support for Security Key Service (SKS) via pull/push clients and an in-memory SKS server.
    • Runtime: Supports Native AOT with zero IL2026 / IL3050 warnings.
    • Configuration: Uses a fluent PubSubApplicationBuilder and full Dependency Injection (DI) support.
  9. What is OPC UA PubSub Schema

    master

    The Opc.Ua.PubSub.Schema package provides runtime schema generation for OPC UA PubSub JSON message payloads. It produces JSON Schema (draft 2020-12) documents that describe the JSON DataSetMessage body based on DataSetMetaDataType metadata.

    This allows consumers like validators, code generators, and documentation tools to be driven directly from the live PubSub configuration. The library is built on the Opc.Ua.Core.Schema subsystem and is designed to be NativeAOT and trim-safe by avoiding reflection.

  10. Overview of OPC UA .NET Standard Stack features

    master

    The OPC UA .NET Standard Stack is a certified, cross-platform implementation of OPC UA. Key features include:

    • Full-stack support: Core, Client, Server, PubSub, GDS, LDS, Complex Types, and Device Integration.
    • Transports: Supports UA-TCP and HTTPS.
    • Cross-platform: Runs on .NET 10, .NET 9, .NET 8 (LTS), .NET Framework 4.8, and .NET Standard 2.1. It is designed to be Native-AOT friendly.
    • Modern API: Features Microsoft.Extensions.DependencyInjection hosting via services.AddOpcUa(), fluent builders for servers and clients, and source-generated NodeManagers and DataTypes.
    • Companion Specs: Includes coverage for Alarms & Conditions (Part 9), Historical Access (Part 11), Device Integration (Part 100), and ISA-95 Common Model (OPC-10030).
  11. Overview of OPC UA PubSub Transports

    master

    The OPC UA PubSub stack supports multiple transport protocols, each provided via specific packages. These transports allow for different communication profiles (UADP or JSON) and address schemes.

    TransportPackageProfilesAddress schemes
    UDP / UADPOpc.Ua.PubSub.Udppubsub-udp-uadpopc.udp://, opc.dtls://
    Ethernet / UADPOpc.Ua.PubSub.Ethpubsub-eth-uadpopc.eth://
    MQTT / UADP + JSONOpc.Ua.PubSub.Mqttpubsub-mqtt-uadp, pubsub-mqtt-jsonmqtt://, mqtts://, ws://, wss://
    Kafka / UADP + JSONOpc.Ua.PubSub.Kafkapubsub-kafka-uadp, pubsub-kafka-jsonkafka://, kafkas://
  12. Choose the right session type for your OPC UA client

    master

    The OPC UA client stack provides several ways to manage sessions depending on your requirements for reconnection, subscription engines, and lifecycle management. Use the following guide to select the appropriate type:

    TypeReconnect BehaviorSubscription EngineRecommended Use Case
    SessionNone (caller must drive via Session.ReconnectAsync or SessionReconnectHandler)ClassicSubscriptionEngine by defaultCallers that want full control over the session lifecycle and existing reconnect logic.
    ManagedSessionBuilt-in (uses ConnectionStateMachine and ReconnectPolicy)DefaultSubscriptionEngine (V2) by defaultNew code; long-lived clients requiring automatic reconnect and failover.
    SessionReconnectHandlerYes (drives an existing Session)
    Inherited from wrapped SessionLegacy callers that already own a raw Session object.
    ChannelManagerSessionFactoryChannel-level (via IClientChannelManager)
    Classic engineRaw sessions that need to share channels and coordinate transport reconnects centrally.
    ManagedSessionBuilt-in (via ConnectionStateMachine + ReconnectPolicy)
    DefaultSubscriptionEngine (V2) by defaultNew code; long-lived clients that need reconnect / failover.