Chapters

26 OPC UA: Architecture, Models, and Security

applications
iiot
opc
ua
Listen
Uses your device's voice. Tap ▶ beside any paragraph to hear just that one.
  • Podcast audio coming soon
  • Character narration audio coming soon
Lecture
Video lecture coming soon. The slides are the lecture for now.
Ask AI
Pick a prompt. We copy it for you and open an AI service; paste it there. Nothing is sent to IoTClass.

26.1 Give the Two Speed Values Their Meaning

OPC Unified Architecture (OPC UA), standardized as IEC 62541, provides a vendor-neutral, platform-independent way to share industrial data with its meaning and protect access to it. This chapter follows the design from the machine model through communication patterns to a reviewable security baseline. The goal is to explain architecture, inspect nodes and relationships, compare client-server with publish-subscribe, and design secure integration between information technology (IT) and operational technology (OT).

Picture two factory lines that both report a value called speed. One means motor turns per minute; the other means belt metres per second. Joining the raw tags would create a quiet but dangerous error. A successful connection would only move that error more efficiently. Before choosing the exchange, identify the asset, value, unit, state, source, timestamp, quality and allowed action. Keep those facts together so another application can decide whether the reading is useful and whether it may change anything.

A protocol is an agreed set of rules for exchanging data. Transmission Control Protocol (TCP) provides an ordered byte stream between endpoints. Neither an ordered stream nor a shared tag name establishes what a machine value means. OPC UA adds a self-describing model: clients can discover capabilities, inspect context and use agreed services. It cannot repair an incorrect source model or silently turn one unit into another.

The factory therefore has three connected problems: preserve meaning across vendors, choose an exchange that fits each consumer, and maintain trust without giving remote systems unchecked control. We will model the two lines first, choose how local and remote consumers receive their data, then record identity, permissions and failure behavior. Fast or safety-related control stays near the machine when a remote link cannot own it. A lost link has a defined effect, and a stale value remains visibly stale.

26.2 Prerequisites

This route assumes industrial protocol families, Industry 4.0 and ISA-95 automation levels, and networking basics, including TCP/IP and client-server communication. We will use that foundation to follow a value from source to operational decision. The chapter is part 1 of 2; companion-model selection and implementation follow in the next chapter.

KEY CONCEPTS

  • Address space

    Objects, variables, methods and views form a browsable model.

  • NodeId

    A stable node identifier keeps clients attached to the intended value.

  • Reference

    Typed links connect components, properties and type definitions.

  • Secure channel

    Endpoint policy defines message signing and encryption.

  • Session

    The client context carries user identity for authorized service operations.

  • Monitored item

    Sampling, queues, dead bands and notification rules govern updates.

  • Companion specification

    Domain models standardize equipment types and semantics.

26.3 Learning Objectives

  • Explain OPC UA architecture and its role in industrial integration
  • Analyze the OPC UA information model and node structure
  • Compare client-server and publish-subscribe communication patterns
  • Implement OPC UA security features including authentication and encryption
  • Design OPC UA-based systems for IT/OT integration

26.4 Model the Plant Before Wiring Tags

Industrial equipment comes from dozens of vendors, often with proprietary protocols and naming conventions. A conveyor drive, robot cell, chiller or packaging machine may need to serve supervisory control and data acquisition (SCADA), human-machine interfaces (HMI), historians, manufacturing execution systems (MES), computerized maintenance management systems (CMMS), analytics and cloud services. Without a shared model, each new consumer can become another custom mapping and revalidation project. The useful question is whether downstream systems can understand and trust the data throughout equipment changes.

Begin with the objects that a client should see: Line 3, Filler 2, Motor M101, TemperatureSensor A or BatchRecipe. Attach variables and methods that operators, engineers and applications can interpret. The structure should reflect line, cell, station, equipment, sensor, actuator, recipe, alarm and maintenance context. Publishing thousands of raw programmable logic controller (PLC) tags leaves every consumer dependent on the control engineer’s private naming knowledge. A plant model makes that knowledge explicit and maintainable.

For the two speed values, name the source asset and engineering unit before joining them to an analytics job. For another example, register 40017 may contain a number, but the useful contract says it is motor current in amperes, sampled from a specific drive, valid at a particular time and linked to the packaging line. A temperature variable similarly needs its asset, unit, timestamp, quality code and access rules. A consumer should discover whether it is read-only, writable or used in a method call.

OPC UA supplies platform independence across operating systems, hardware and programming languages, with implementations ranging from embedded devices to cloud servers. Its service-oriented architecture combines semantic modeling, multiple interaction patterns, authentication, message protection and audit support. Those capabilities help data survive vendor changes, PLC upgrades and successive analytics tools. They do not remove the need to decide which source is authoritative, which team owns its names and which changes clients must detect.

The familiar translator analogy is useful within that limit. In a smart factory, the robot arm uses PROFINET, the temperature sensor Modbus, the conveyor belt EtherCAT and the cloud computer MQTT. OPC UA offers a common information contract, while adapters and gateways handle the different interfaces. Like a USB connection that works across devices, a common interface reduces repeated integration work; unlike a magical translator, it still needs a correct mapping. Encryption also needs identity and authorization controls before a machine command is trustworthy.

Choose the consumer and operational risk before exposing the interface. HMI and SCADA may need direct operational access; a historian needs normalized values with engineering units and quality flags; MES and maintenance systems may need ISA-95 equipment hierarchy. Record which data may leave the control network through an edge gateway or a demilitarized zone (DMZ) broker. Keep monitoring separate from control writes, with an explicit authorization, safety and change process for any approved write path.

For brownfield equipment, apply that same contract through a Modbus, PROFIBUS, PROFINET, EtherNet/IP or vendor-driver gateway. Relaying every register as a flat tag creates connectivity without a stable meaning. Attach asset names, units, timestamps, quality and references while the underlying equipment remains unchanged. Document the adapter so later source changes cannot silently change the unit or meaning seen by clients.

Before implementation, turn the opening questions into a design record. State which machine fact is shared, what its name means, which unit it uses, how fresh it must be and how quality is represented. Then name who may read it, who may change it, which certificate supports application identity and what happens when trust fails. Finally, record whether the local process can stay safe without the remote consumer. These questions belong together because a complete answer about the value does not by itself answer whether a particular application should act on it.

26.5 Make the Address Space Discoverable

The next step is to express the plant contract in a browsable address space: the server’s structure of objects, variables, methods, views, references and type definitions. The model is object-oriented and hierarchical. A client can browse to an asset, read variables, inspect data types and units, and discover methods rather than relying on vendor-specific register spreadsheets. Built-in and custom data types describe the values a consumer can expect.

26.6 OPC UA Reads Semantics

Each node has a NodeId, its identifier, along with a BrowseName, DisplayName, NodeClass, attributes and references. A variable’s DataType and ValueRank describe its value structure. Engineering units, access level, status and timestamps give the reading operational context. The Value attribute carries the value; a returned data value can include quality status and source and server timestamps. Preserve those distinctions so consumers can judge freshness and validity rather than treating every number as equally usable.

A reference is a typed relationship between nodes. HasComponent links a component, HasProperty links a property, Organizes groups nodes and HasTypeDefinition connects an instance to its type. Namespaces separate standard, vendor and site-specific definitions. A namespace owner must manage versions and NodeIds deliberately: careless identifier churn can break historians, dashboards and analytics jobs after a PLC or server update even when the physical machine still works.

The motor hierarchy below makes those relationships inspectable. Start at the object types and follow the motor object to its variables, methods and properties. The variable context supplies data type, unit, quality, timestamp and access level. A new client can discover the structure without a handwritten map, although its application still needs to interpret that structure correctly. Self-description exposes capabilities; it does not decide whether using a particular command is safe.

OPC UA hierarchy with object types, a motor object, variables, methods, properties, views and typed references.
The motor object connects variables and methods through typed references. Variable context includes data type, engineering unit, quality status, timestamp and access level.

Model ownership continues after commissioning. One team owns the names, each source has an owner, model changes receive a version and clients can detect that version. A local extension stays documented. Companion specifications act as domain phrase books: check OPC UA for Machinery, Robotics, PackML, PLCopen, MTConnect and ISA-95 before inventing custom structures. Reusing their terms helps production orders, downtime events and asset records share a vocabulary across systems.

Tools make the contract inspectable but do not own it. Teams commonly use UaExpert to test models and SDKs such as open62541, Eclipse Milo, node-opcua or vendor SDKs to build clients and servers. Production readiness needs source-controlled model definitions, namespace versions, certificate lifecycle procedures and a rollback plan for server updates. Test that a new machine preserves the contract and an old machine’s adapter still maps it correctly.

For the speed example, follow the relationship back to the source rather than stopping at DisplayName. Two variables may display the same word while belonging to different assets and carrying different units. The client needs the node identity and context to distinguish them. Conversely, retaining a stable identifier is not enough if an undocumented model change alters what that identifier means. Review the namespace version and source mapping together, and include the historian, dashboard and analytics consumers in change testing. The contract must survive both a renamed display label and an updated controller without silently reinterpreting the data.

26.7 Match Services to the Consumer

With meaning established, choose how clients use it. SCADA, HMI, MES and enterprise resource planning (ERP) clients invoke service sets against the server’s address-space nodes. Browse, read, write, method-call and subscription services operate on that model rather than reaching directly into controller memory. The architecture separates the data contract from the services used to access it and the trust controls around those services.

SCADA, HMI, MES and ERP clients use service sets to access server nodes and references.
Clients access the server’s typed address space through browsing, reading, writing, method calls and subscriptions. The services operate on modeled nodes and references that retain plant data meaning.

In the client-server pattern, the client discovers server capabilities and establishes the channel and session needed for its operations. It browses the address space, reads current variable values and creates subscriptions for changes. A monitored item defines the sampling, queueing, dead-band behavior and notification rules for a node. Subscriptions add publishing intervals, keep-alives and sequence numbers. Those settings determine what is observed, held and delivered when values change or a client falls behind.

The seven-step workflow is connect, browse, read, subscribe, monitor, write and call. Monitoring receives data-change notifications; writes target approved writable nodes; calls invoke server methods. The diagram below separates the client’s session manager, browse, read/write and subscription management from the server’s session service, address space, data access, methods, notification engine and device-data layer. Notifications return in response to Publish requests the client has already submitted, rather than arriving as unsolicited traffic.

Client and server service workflow across a secure channel and session, from connect and browse to read, subscribe, monitor, write and call.
The client-server workflow separates discovery, data access, subscriptions and method calls. Subscription notifications answer client Publish requests, while channel trust and user permissions govern access.

This pattern fits SCADA, HMI and configuration tools because they need targeted request-response interaction as well as ongoing observation. A SCADA display can subscribe to selected nodes at a defined sampling interval, while an authorized configuration tool writes a specific value or calls a method. A successful read is useful only when the client also handles source timestamps, server timestamps, status codes and stale-data detection. Define behavior when a gateway restarts or a subscription queue overflows; otherwise the screen may keep displaying a plausible old speed.

The operational trace should now be complete: PLC or gateway source, namespace, secure session, historian or SCADA consumer, then the final decision. Retain units, quality, ownership and write authorization at every step. Keep fast or safety-related loops local when a link drops. Direct access gives a client useful services, but it also makes the scope of its permission a concrete plant design decision.

Sampling and delivery also answer different questions. The sampling interval describes observation of a monitored node, while the publishing interval belongs to subscription delivery. Queues, keep-alives and sequence numbers help clients manage the ongoing exchange. Preserve those settings in the operational record alongside quality and timestamps, rather than summarizing the arrangement as merely “live data.” When a gateway restarts or the queue overflows, the consuming application still needs an explicit response. For the speed reading, reviewers should be able to explain when the displayed value was obtained and whether its reported quality allows the intended decision.

Check knowledge

Check shared meaning, node structure, model ownership and the client-server service workflow.

Check knowledge

26.8 Separate Local Access from Cloud Streams

Direct machine access is not every consumer’s job. Publish-subscribe (PubSub) decouples publishers from subscribers so a producer does not need to know each downstream receiver. It fits cloud connectivity, analytics and mobile monitoring when those consumers need streams rather than individual machine sessions. One publisher can serve thousands of subscribers, subject to the chosen deployment’s capacity and transport.

OPC UA PubSub may use UADP or JSON mappings over UDP, MQTT or other supported transports. Broker-based arrangements can use MQTT or Advanced Message Queuing Protocol (AMQP): publishers send to a broker and subscribers receive through it. In an edge or DMZ design, outbound connections can make the cloud path easier to accommodate at a firewall than inbound sessions to controllers. Verify the chosen transport and firewall rules. PubSub is not inherently broker-based, and an outbound-only arrangement is a deployment choice rather than a guarantee of every mapping.

The chapter’s 500-machine factory illustrates why both patterns belong in one architecture. Its local SCADA system needs direct request-response access to individual machines; its cloud analytics platform needs aggregated sensor streams. Use client-server locally for targeted reads, writes, calls and subscriptions, and aggregate upstream PubSub through edge gateways. A cloud analytics pipeline may receive OPC UA PubSub over MQTT through a DMZ broker without maintaining direct sessions to all 500 machine servers.

That division preserves each consumer’s job. Making the cloud connect to every machine adds endpoint and session management when it only needs aggregates. Sending all traffic through PubSub does not supply SCADA’s direct browse, read, write and call service workflow. A mix is appropriate when operational access remains local and downstream consumers need decoupled telemetry. Decide the pattern from the required interaction, then preserve the same source meaning and quality through either route.

Legacy interfaces do not remove those responsibilities. OPC Classic, the COM/DCOM predecessor to OPC UA, is Windows-specific; REST APIs are separate interfaces rather than part of OPC UA’s standard service model. Introducing either requires its own integration decisions. Whichever route is selected, retain source and server timestamps, status codes and explicit stale-data behavior. A changed transport must not turn the two different speed values into apparently interchangeable data.

26.9 Establish Identity and Permission

A useful model and a suitable route still need a trust boundary. A secure channel is the message-security context negotiated between applications using endpoint policy and, for secured modes, certificates, signing and encryption. A session supplies the client conversation context and associated user identity. Authorization determines which operations that identity may perform on particular nodes. Protecting a connection and approving a setpoint write are distinct decisions.

Client access crosses certificates, a secure channel, session and user authorization at the server trust boundary.
Client access crosses a trust boundary through certificates, a secure channel, a session and user authorization. Connection protection, conversation identity and permission to perform operations are distinct checks.

X.509 application certificates identify endpoints. Certificate exchange presents those identities; administrator-managed trust lists establish which peers are accepted. Both client and server need ownership of their certificates and trust lists so either can reject an untrusted peer. Name the trust authority and the people responsible for issuance, renewal, revocation and rotation. Otherwise certificates can quietly expire in a running plant or obsolete trust can remain accepted after ownership changes.

The trust record below pairs every mechanism with an owner. Server trust and client trust are separate records. User identity answers who is connecting, roles limit which nodes that user may touch, and the endpoint policy fixes the message protection. A checked security-mode box is insufficient release evidence if nobody maintains the lifecycle behind it. Failed trust should remain visible, and local process behavior must remain defined when a connection is refused.

Trust authority, server and client trust, user identity, authorization roles and endpoint policy form an owned release record.
The trust record assigns ownership to application certificates, trust lists, user identity, authorization roles and endpoint policy. Renewal, revocation and audit evidence keep that protection maintainable after commissioning.

User authentication options include username/password, X.509 user certificates and issued identity tokens, with Kerberos or SAML support depending on the implementation and identity infrastructure. Check endpoint support rather than assuming every server accepts every option. Application certificates establish application identity; the session’s user identity is then subject to permissions. A trusted application still needs explicit user-role mapping and a documented list of writable nodes and callable methods.

Audit logging supplies evidence for that review. Configure records for security events, connection attempts, authentication failures and reads or writes on critical data. OPC UA supports audit events; retaining a complete operational audit trail requires configuration and collection. Logs make failed trust and critical access reviewable, while permissions govern access. A write to the wrong setpoint can affect real equipment, so review audit evidence alongside approved write paths and the identities allowed to use them.

Production planning must also include time synchronization, certificate rotation, trust-list maintenance and tests of recovery. Name who approves writes, who maps identities to roles and who validates namespace changes. Those responsibilities connect the model’s stable meaning to the security boundary: the approved user must reach the intended node and understand the value or action authorized there.

Review identity failures separately from permission failures. An untrusted application should fail the peer-trust check; an accepted application does not thereby gain permission for every user to write every node. The owner of certificate trust and the owner of user-role mapping may have different operational tasks, so identify both in the release evidence. Record the approved node operations and retain the relevant access records for review. That makes the trust record useful after commissioning, when a certificate rotates, a user changes role or an engineer needs to establish who changed a critical value.

26.10 Select and Validate Message Protection

The final choice is how to protect messages on that route. Signing detects tampering; encryption protects confidentiality in transit. In the SHA-256 policies discussed here, symmetric message signing uses HMAC-SHA256 and encryption uses AES-256. The security policy defines cryptographic algorithms, while the message security mode chooses Sign or SignAndEncrypt. A policy that supports encryption does not mean encryption is enabled when the endpoint uses Sign alone.

Compare the available profiles before choosing a site-approved endpoint configuration:

Security policyMessage protection and deployment decision
NoneNo signing or encryption; isolated testing only.
Basic128Rsa15Supports signing and encryption, but is a legacy compatibility choice to avoid in new deployments.
Basic256Sha256Supports signing and encryption and is widely supported; verify approval under the site’s policy.
Aes256-Sha256-RsaPssSupports signing and encryption; prefer for new critical deployments when both endpoints support it and timing tests pass.

Do not use Security Policy None in production plant, enterprise or pharmaceutical systems. It removes OPC UA message signing and encryption and the protection those provide against reading or modifying messages in transit. User authentication can still be configured, so credentials alone do not prove that the channel is protected. Test with security enabled during development to discover certificate and endpoint integration problems early.

For critical infrastructure such as power plants, pharmaceuticals and water treatment, use the strongest site-approved policy both endpoints support, then validate timing and recovery on representative hardware. Manufacturing and logistics applications likewise need signing, encryption, managed application certificates, named user identities and tested trust-list operations. If a legacy device forces Basic128Rsa15, document a time-bounded exception, compensating controls, an owner and the replacement path.

Measure the overhead of secure modes rather than assuming insecure mode is operationally necessary. Message size and messages per second affect traffic volume; actual CPU cost and recovery behavior need endpoint measurements. The separate comparison activity lets you vary the policy and traffic assumptions. Its illustrative overhead and protection scores are learning assumptions, not assurance or hardware benchmarks. Stronger cryptography alone cannot establish compliance without roles, trust lists, audit evidence and change control.

Try it

Compare security policies and traffic assumptions before measuring the actual endpoints.

Compare policies

The comparison activity originally varies message sizes from 64 to 2048 bytes, with 256 bytes selected, and traffic from 1 to 1000 messages per second, with 100 selected. These controls let learners distinguish payload traffic from the additional traffic assumed by the model. They do not measure the CPU time of a real server. Use the activity to formulate a timing and bandwidth test, then run the chosen secure configuration on representative hardware before using its results in a deployment decision.

For the regulated batch-control example, Aes256-Sha256-RsaPss with certificate-based application and user authentication plus audit logging is the appropriate design direction when endpoint support and site policy permit it. Basic256Sha256 may be acceptable where approved, but disabling audit logging removes traceability. A legacy-compatible policy needs its exception process, and None does not become a production choice merely because username/password login works.

Finish the release record by naming the consumer, control limit, trust owner, local fallback, field test and change process. Confirm certificate rejection, trust-list operations, namespace stability, timing and recovery behavior rather than retaining only a successful connection screenshot. The two speed readings should still carry their different units, quality and timestamps at the consumer. Neither encryption nor a model update may change that meaning in secret.

Check knowledge

Check the 500-machine communication design, certificate trust, user authorization and security-policy release evidence.

Check knowledge

Summary

OPC UA connects industrial consumers through a shared information model, service patterns and managed security. Start with the asset and value contract, then preserve units, types, timestamps, quality, references and access rules through gateways and consumers. Stable namespaces and NodeIds let that contract survive equipment and software changes.

Client-server supports direct operational browse, read, write, call and subscription services. PubSub serves decoupled telemetry, including aggregated cloud streams. Application certificates, trust lists, user identity, authorization, message protection and audit evidence must work together throughout the deployment lifecycle. Release tests connect those mechanisms to owners and observable behavior when trust or communication fails.

A connected value becomes useful only when its meaning, freshness and permitted use remain clear. Keep the two speed units distinct, choose the exchange for the consumer, and maintain evidence of who may act on the machine.

Hi, I’m Ada. What do you need?

Find help

Let’s find what you need

Find a lesson or return to your module guide.

Give feedback

Help improve this chapter

Tell us what helped or what needs fixing.

Tips

Try a small next step

A few ways to get more from this chapter.

Ask AI

Continue the conversation

Take the conversation further with your preferred assistant.

AI help is available in supported modules when enabled in Settings.

No live person answers on independent study. Feedback does not promise a personal reply.

For welfare or safety concerns, follow your school’s procedures outside IoTClass.