Inferensys

Glossary

Pub-Sub Model

A message-centric OPC UA communication pattern where a publisher sends data to message-oriented middleware, decoupling it from one or more subscribers without requiring direct sessions.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
OPC UA COMMUNICATION PATTERN

What is Pub-Sub Model?

The Pub-Sub Model is a message-centric OPC UA communication pattern that decouples data producers from consumers, enabling scalable, one-to-many distribution of industrial telemetry without requiring direct client-server sessions.

The Pub-Sub Model is an OPC UA communication pattern where a Publisher sends structured DataSet messages to a message-oriented middleware, such as an MQTT broker or UDP multicast group, without establishing direct sessions with recipients. This fundamentally decouples the data source from one or more Subscribers, which independently filter and consume only the messages relevant to their operational context.

Unlike the session-based Client-Server Model, Pub-Sub eliminates the overhead of point-to-point connections, making it ideal for high-throughput, many-to-many data distribution across cloud-to-edge architectures. The model supports multiple transport protocol mappings, including OPC UA PubSub over MQTT for cloud integration and OPC UA PubSub over TSN for deterministic, real-time controller-to-controller communication on the factory floor.

Architectural Principles

Core Characteristics of the Pub-Sub Model

The Pub-Sub model in OPC UA defines a fundamental shift from session-based polling to event-driven data distribution, enabling scalable, many-to-many communication for industrial IoT.

01

Loose Coupling

The defining characteristic of the Pub-Sub model is the decoupling of Publishers and Subscribers. A Publisher sends data to a Message-Oriented Middleware (broker) without knowledge of the number, identity, or location of Subscribers. Subscribers express interest in specific DataSets without establishing a direct session with the Publisher. This eliminates the tight binding of the Client-Server model, allowing systems to be added, removed, or updated independently without reconfiguring the entire network.

02

Message-Centric Communication

Unlike the connection-oriented Client-Server model, Pub-Sub is fundamentally message-centric. A Publisher assembles a DataSetMessage containing field-level data values and pushes it to the network as a self-contained payload. Key properties include:

  • One-to-Many Distribution: A single message is efficiently fanned out to multiple Subscribers by the broker.
  • NetworkMessage: The standardized OPC UA container that wraps one or more DataSetMessages for transport.
  • Payload Agnosticism: The broker does not interpret the payload; it only routes based on topic strings, preserving end-to-end data integrity.
03

Transport Protocol Flexibility

The OPC UA Pub-Sub model is transport-agnostic, decoupling the data model from the underlying network protocol. This allows architects to select the optimal transport for a given use case:

  • OPC UA PubSub over MQTT: Uses a lightweight MQTT broker for cloud-to-edge integration, ideal for bandwidth-constrained or high-latency networks.
  • OPC UA PubSub over TSN: Combines Pub-Sub with Time-Sensitive Networking to guarantee deterministic, bounded low-latency delivery for real-time control loops.
  • OPC UA PubSub over UDP: Supports multicast UDP for high-speed, local-area data distribution without a broker.
04

DataSet and Topic Structure

Data is organized into DataSets—pre-defined collections of related field values configured in the Publisher. Each DataSet is mapped to a Topic on the broker, which acts as the routing address. Subscribers listen on specific Topics to receive updates. This structure enables:

  • Semantic Grouping: Related variables (e.g., all sensors on a motor) are packaged together.
  • Selective Subscription: Subscribers receive only the data they need, minimizing processing overhead.
  • Standardized Encoding: DataSets are serialized using UA Binary or JSON Encoding before being embedded in NetworkMessages.
05

Security Model

Pub-Sub security is implemented at the message level rather than the transport level. Each NetworkMessage can be individually signed and encrypted using a Security Policy, ensuring end-to-end confidentiality and integrity regardless of the intermediary broker's trustworthiness. Key mechanisms include:

  • Message Signing: Guarantees the message originated from an authorized Publisher and has not been tampered with.
  • Message Encryption: Protects payload confidentiality as it traverses untrusted network segments.
  • Key Rotation: Supports periodic renewal of cryptographic keys without disrupting the data flow.
06

Deterministic Delivery with OPC UA FX

OPC UA FX (Field eXchange) extends the Pub-Sub model for high-performance, controller-to-controller communication. It standardizes deterministic data exchange by combining:

  • Scheduled Publishing: Messages are transmitted on a strict, time-triggered schedule.
  • Time-Sensitive Networking (TSN): Network infrastructure guarantees bounded latency and zero congestion loss.
  • Fail-Operational Redundancy: Supports redundant publishers and network paths for safety-critical applications. This makes Pub-Sub suitable for replacing hard-wired I/O and proprietary fieldbuses with open, interoperable Ethernet-based communication.
PUB-SUB MODEL EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about the OPC UA Pub-Sub communication pattern, designed for automation engineers and system architects evaluating decoupled industrial data architectures.

The OPC UA Pub-Sub model is a message-centric communication pattern where a Publisher sends data to a message-oriented middleware without establishing direct sessions with any specific receiver. Unlike the Client-Server model, which requires point-to-point connections, Pub-Sub decouples data producers from consumers entirely. A Publisher configures DataSets—collections of field-level values—and encodes them into Network Messages using either UA Binary or JSON encoding. These messages are then pushed to a middleware layer, typically an MQTT broker, AMQP queue, or a UDP multicast group. Subscribers listen to the middleware and filter incoming messages based on WriterGroup identifiers and DataSet metadata. This architecture eliminates the need for Subscribers to know the Publisher's network address, enabling true one-to-many and many-to-many communication topologies. The model is defined in Part 14 of the OPC UA specification and is particularly suited for high-volume telemetry, cloud ingestion, and controller-to-controller data exchange where deterministic latency is not the primary constraint.

COMMUNICATION PATTERN COMPARISON

Pub-Sub Model vs. Client-Server Model

A technical comparison of the two primary OPC UA communication patterns, highlighting their architectural differences, coupling characteristics, and suitability for various industrial automation scenarios.

FeaturePub-Sub ModelClient-Server Model

Communication Initiation

Publisher pushes data to Message-Oriented Middleware

Client initiates a Session and sends a service request to Server

Coupling Type

Space-decoupled: Publishers and Subscribers are anonymous

Tightly coupled: Client must know Server's Endpoint and establish a Session

Session Requirement

Data Flow Direction

Unidirectional: Publisher to Subscribers via broker

Bidirectional: Client can read, write, and call methods on Server

Typical Transport Protocols

MQTT, AMQP, UDP (with TSN for deterministic delivery)

UA TCP Binary, HTTPS, WebSockets

Scalability for One-to-Many

High: Single message reaches thousands of Subscribers via broker fan-out

Low: Server must manage individual Monitored Items and Subscriptions per Client

Network Overhead per Consumer

Constant: Publisher sends one message regardless of subscriber count

Linear: Each additional Client requires separate Session and notification delivery

Deterministic Delivery Guarantee

Achievable with OPC UA PubSub over TSN for bounded latency and jitter

Not inherently deterministic; relies on underlying transport and polling intervals

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.