# The Unified Namespace

> How eaxScada implements the Unified Namespace with an embedded NATS broker, ISA-95 subjects, JetStream streams, Key-Value buckets and NKey authentication.

Product: Platform · Type: Explanation · Editions: Starter, Pro, Enterprise, Cloud
Source: https://eaxware.com/docs/platform/explanation/unified-namespace/
Status: migrated page, not yet verified against the current code.

The Unified Namespace (UNS) is the core architectural shift of Industry 4.0 and smart manufacturing. This page explains how **eaxScada** implements the UNS with an embedded, high-throughput **NATS** engine, JetStream persistence, Key-Value (KV) stores and NKey authentication.

**The complete embedded NATS UNS backbone is included in every edition, with unlimited tag channels and no throttling.**

---

## 1. The Unified Namespace paradigm

### 1.1 Moving away from the point-to-point Purdue stack

In automation architectures based on the ISA-95 Purdue model, data flows through rigid, hierarchical point-to-point layers (Level 0 sensors → Level 1 PLCs → Level 2 SCADA → Level 3 MES → Level 4 ERP).

**Diagram: The Unified Namespace at the centre of eaxScada** (system architecture)

The embedded NATS broker of eaxScada is the hub. The tag engine publishes each tag change on uns.telemetry and the alarm engine each alarm transition on uns.alarm. The driver manager takes the commands sent on uns.command.write and writes them to the controllers through the drivers. eaxPLC runtimes and other clients, such as an MES, connect to the same broker with their own identity and the subjects their rights allow.

**Parts**

- **Tag engine** (service or process, inside eaxScada server): publishes each change
- **Alarms** (service or process, inside eaxScada server): publish each transition
- **Unified Namespace** (bus or line, inside eaxScada server): embedded NATS broker uns.telemetry.>  uns.alarm.>  uns.command.write
- **Driver manager** (service or process, inside eaxScada server): takes the commands
- **eaxPLC runtimes** (product): own subjects plc.\<id>.>
- **MES and integrations** (external system): subjects of their role
- **Controllers** (device or controller): PLCs and devices

**Connections**

- **Tag engine → Unified Namespace** (data or telemetry): uns.telemetry
- **Alarms → Unified Namespace** (alarm or event): uns.alarm
- **Unified Namespace → Driver manager** (command to equipment): uns.command.write. The driver manager takes each command sent on uns.command.write; in an HA pair only the primary with quorum dispatches it.
- **Driver manager → Controllers** (command to equipment): writes. The driver manager writes the value through the driver of the tag, after the write checks.
- **eaxPLC runtimes ↔ Unified Namespace** (data or telemetry). An eaxPLC runtime publishes its own subjects and telemetry, and receives commands, over NATS with its own identity.
- **MES and integrations ↔ Unified Namespace** (data or telemetry). An MES or another integration subscribes to telemetry and alarms and sends commands on uns.command.write, with its own identity and the rules of its role.

One broker, one namespace: a client subscribes to the subjects it needs instead of polling each layer, and every command sent on NATS enters through the one subject uns.command.write and the write checks.

The Unified Namespace replaces this stack with an **event-driven, publish-subscribe single source of truth**. Every piece of equipment, sensor, computed KPI, active alarm and operator action publishes its current state into a standardised, contextualised namespace. Any NATS client with the right to (an MES, an integration, an eaxPLC runtime) subscribes to the exact subjects it needs. Inside eaxScada, the screens, the historian and the alarms take each change from the tag engine directly.

### 1.2 Why an embedded NATS broker?

Instead of requiring an external broker, eaxScada embeds the **NATS** server (`github.com/nats-io/nats-server/v2`) in-process:

- **In-process latency.** Internal subsystems exchange messages without leaving the process.
- **Single binary.** No external runtime, JVM or Erlang dependency: the broker is compiled into the Go binary.
- **JetStream and KV built in.** Persistent streams and Key-Value stores out of the box.
- **NKey security.** Ed25519 public-key authentication is part of the broker handshake.

---

## 2. ISA-95 topic taxonomy and naming

eaxScada uses a hierarchical topic structure that follows the ANSI/ISA-95 enterprise–control integration standard.

### 2.1 Canonical ISA-95 topic hierarchy

Full-context topics follow the format defined by `tagengine.FormatISA95`:

```
{domain}.v1.{enterprise}.{site}.{area}.{line}.{cell}.{entityType}.{entityID}.{actionOrStream}
```

| Segment | Description | Example |
|---|---|---|
| `domain` | Functional boundary of the payload. | `scada`, `alarm`, `audit`, `recipe`, `plc` |
| `version` | Wire format version. | `v1` |
| `enterprise` | Company or parent organisation. | `corp` |
| `site` | Plant or facility. | `plant`, `plant2` |
| `area` | Department or building. | `processing`, `packaging`, `utilities` |
| `line` | Production or process train. | `line1`, `areaA`, `reactor_bank` |
| `cell` | Work unit, skid or work cell. | `cell1`, `skid04`, `filler` |
| `entityType` | Class of the monitored entity. | `tag`, `alarm`, `equipment`, `batch` |
| `entityID` | Identifier or sub-path of the entity. | `Reactor1/Temperature`, `Tank101/Level` |
| `stream` | Action or stream qualifier. | `val`, `event`, `setpoint`, `cmd` |

#### Where it is used today

Nothing is published in this form any more. Tag values are on the normalised subjects of 2.2, and alarm transitions on `uns.alarm.<alarm id>.event` (end of 2.2). Earlier releases published every tag change on `scada.v1.corp.paris.processing.areaA.cell1.tag.<path>.val` and alarm transitions on `alarm.v1.corp.paris.processing.areaA.cell1.alarm.<alarm id>.event`, with fixed placeholder segments; eaxTags and internal tags moved from the first to `uns.telemetry.<path>`.

### 2.2 Normalised telemetry subjects

Every tag is published on a normalised, dot-separated UNS subject, each change once: a driver's values, an MQTT channel's values, a NATS channel's values when it reads another broker, eaxTags and internal tags alike, and the out-of-service quality of a disabled channel's tags. A NATS channel reading this server's own broker is not republished (the value is there already); a republished message carries this server's origin mark and no bridge takes it in again. For a tag no device produces, `device_id` and `address` are empty.

```
uns.telemetry.{enterprise}.{site}.{area}.{line}.{cell}.{tag}
```

Example:

```
uns.telemetry.Plant.Processing.AreaA.Reactor1.Temperature
```

Payload (`application/json`):

```json
{
  "path": "Plant/Processing/AreaA/Reactor1/Temperature",
  "value": 84.72,
  "unit": "°C",
  "quality": 192,
  "timestamp": 1726248000000000000,
  "device_id": "dev-reactor1",
  "address": "HR:100"
}
```

Quality code `192` (`0x00C0`) is the OPC UA `Good` quality. A String tag's `value` is its text, with `"is_text": true`.

#### Alarm transitions (`uns.alarm.>`)

Each alarm state transition (trip, acknowledge, return, shelve) is published on `uns.alarm.<alarm id>.event`, the alarm event as JSON, over core NATS (not in the `TELEMETRY` buffer).

### 2.3 Hardware command subject (`uns.command.write`)

A program that sends a command over NATS (an MES, an integration) publishes it on one subject, whatever the tag:

```
uns.command.write
```

The tag path is in the payload:

```json
{ "path": "Plant/Processing/AreaA/Tank1/Setpoint", "value": 42.5 }
```

A command can be signed by a person (`ticket`) or by an integration (`ts`, `nonce`, `signer`, `sig`); see [Signed commands](/docs/platform/reference/signed-commands/). Operator writes from the screens do not use this subject: they are sent to the server over HTTPS.

The driver manager (`internal/drivers/manager.go`) queue-subscribes `uns.command.write` (queue group `eaxscada-dispatch-workers`). The command passes the same write checks as any write, then goes to the driver of the tag (EtherNet/IP, S7 ISO-on-TCP or Modbus TCP).

In an HA pair:

- **Only the node that may dispatch is in the queue group:** the primary with quorum. The clustered brokers therefore route each command to it, whichever broker it was published to, and no command is written twice.
- **A starting HA node takes no commands** until the HA manager says it is the primary. A single server takes them from the start.
- **A command that still reaches a node that may not dispatch** (at a switch-over, or when quorum is lost) is refused and answered `{"ok": false, "error": "command refused: this node may not dispatch commands now ..."}`, never dropped. Such a node stays in the group, refusing, until the new primary has joined (about a lease TTL), then leaves; the refusal is counted with the reason `HA_NOT_PRIMARY`. Send the command again.
- **When no node dispatches**, a command sent as a request gets the broker's "no responders" error at once.

Send commands as NATS requests (with a reply subject) so that you get the answer: a plain publish has no reply, so a refused or lost command is not reported back to you.

### 2.4 eaxPLC subjects

When eaxScada runs with eaxPLC, cyclic telemetry and engineering calls use subjects scoped to the PLC:

- Telemetry: `plc.{plcID}.telemetry.{subsystem}` (for example `plc.plc-01.telemetry.scan_jitter`)
- Symbol table: `plc.{plcID}.rpc.symbols`
- Program deployment: `plc.{plcID}.rpc.deploy`
- Flight recorder: `plc.{plcID}.rpc.dvr`

An edge runtime may use only its own subjects (`plc.<id>.>`), publish UNS telemetry and receive UNS commands. See [Run an edge runtime next to eaxScada](/docs/eaxplc/how-to/run-an-edge-runtime/).

### 2.5 NATS wildcards

Subscribers can use the standard NATS wildcard tokens:

- `*` (single token) matches one token between dots.
  - `uns.telemetry.Plant.Processing.*.Reactor1.Temperature` matches any area.
- `>` (tail) matches one or more tokens at the end of a subject.
  - `uns.telemetry.Plant.Processing.AreaA.>` captures all telemetry under Area A.
  - `uns.command.>` matches the command subject `uns.command.write`.

---

## 3. Embedded NATS server and JetStream

### 3.1 In-process initialisation (`internal/natsengine`)

The embedded broker starts with the server. Internal subsystems connect to it over loopback with the server's own NKey identity, and internal publishing avoids external network hops.

### 3.2 JetStream persistence and streams

JetStream provides persistence, replay and consumer acknowledgements. In the broker's main account eaxScada keeps one stream, `TELEMETRY`:

| | `TELEMETRY` |
|---|---|
| Subjects | `uns.telemetry.>` |
| Retention | limits: at most 10 minutes, and at most `nats.telemetry_buffer` bytes (default 64 MB); the oldest messages go first |
| Storage | memory |

It buffers live tag telemetry, so a client that connects or reconnects can replay the last minutes instead of polling the PLCs. At a high change rate the size cap binds first: 64 MB is a few minutes at 1,000 changes per second. Raise `nats.telemetry_buffer` (for example `256MB`) for a longer replay, at the cost of server memory (about 1.5 times the cap). Alarms, the audit trail and commands are not JetStream streams: alarm transitions and commands go over core NATS (alarms on `uns.alarm.<alarm id>.event`, commands on `uns.command.write`), and the audit trail is kept by the server itself.

---

## 4. Key-Value buckets

In the broker's main account, the only Key-Value buckets eaxScada keeps are eaxTags':

| Bucket | What it holds |
|--------|---------------|
| `EAX_TAGS` | eaxTags tag definitions (key: tag path, with history). |
| `EAX_SCRIPTS` | eaxTags scripts (key: script id, with history). |
| `EAX_TAG_VALUES` | Values operators wrote to writable eaxTags tags. |
| `EAX_SCRIPT_STATE` | Each eaxTags script's state snapshot. |

Screens, the display tree (folders), UDTs and recipes are kept on each node's disk (in a high-availability cluster, replicated as part of the cluster's configuration, see below). No bucket holds them, and no watcher pushes a hot reload from the broker. Operator runtimes connected to a server are reloaded by that server over WebSocket (see [Operator runtime](/docs/eaxscada/explanation/operator-runtime/)).

Older releases created five more buckets: `scada_displays`, `scada_udts`, `scada_recipes`, `scada_wasm` and `ai_staged_actions`. Four were never used. `scada_displays` held a best-effort copy of the screens and of the display tree, and the tree was read back from it when the tree file was missing or had no folders, which could bring back deleted folders. On upgrade, eaxScada deletes these five buckets once, if they exist, and logs one line per bucket with its size: at start on a single server, and on the primary in a high-availability cluster. No other bucket is touched. If the display tree file is missing or unreadable, the tree starts empty; the screens are kept and listed outside any folder.

In a high-availability cluster, the state that is replicated between nodes lives in separate buckets in the `EAX_HA` broker account. See [What HA replicates](/docs/eaxscada/how-to/upgrade-ha-pair/#what-ha-replicates-and-what-you-must-keep-identical-on-every-node).

---

## 5. Authentication and access control on the broker

eaxScada checks every NATS client connection in the broker handshake (`internal/security/nats_auth.go`). Unauthenticated Modbus or OPC connections and shared static passwords have no place on the UNS.

### 5.1 How a connection is authenticated

The `NATSAuthEngine` implements the NATS `server.Authentication` interface. For each new client connection it accepts, in this order:

1. **An NKey with a valid signature** over the server's nonce. The key must be the SCADA core's own key, a registered device key (for example an eaxPLC runtime provisioned under `data/security/nkeys/<id>.nk`), a watcher key (`--nats-watcher`: subscribe to `plc.*.birth`, `plc.*.status` and `uns.telemetry.>` only, publish nothing; see [NATS identities on the broker](/docs/eaxscada/reference/server-configuration/#nats-identities-on-the-broker)), or the registered key of an active user.
2. **A session token** issued by eaxScada at sign-in.
3. **A username and password**, checked like a web sign-in (including lockout).

Everything else is rejected and logged: anonymous clients (also from localhost), identities that present only a name, and shared static tokens. A device gets only the permissions registered for it; an eaxPLC runtime, for example, may use its own `plc.<id>.>` subjects, publish UNS telemetry and receive UNS commands.

### 5.2 Ed25519 NKeys

NKeys use the Ed25519 signature system. A client proves its identity by signing a challenge, and never sends its private key over the network:

- **Public key prefix:** `U...` for user keys.
- **Stored with the user:** in the local user store.
- **Air-gap advantage:** operators and edge skids authenticate without reversible passwords stored on the edge device.

### 5.3 Subject-level access control (RBAC)

The security manager builds the broker permissions of a client that connects with its own user credentials or NKey from the topic rules of its effective roles (`internal/security/nats_auth.go`, `BrokerPermissions`):

| Rule | On the broker |
|---|---|
| `>` (or `*`) | `>`, as it is, except publishing telemetry and the broker's own subjects (the last two rows). |
| A subject (dots, no `/`), for example `uns.command.write`, `uns.alarm.>` | As it is. |
| A publish rule that names `uns.telemetry`, for example `uns.telemetry.Line1.>` | As it is: the only way a user may publish telemetry. An allow that only covers it (`>`, `uns.>`) does not; a user who has both (`>` from one role, `uns.telemetry.Line1.>` from another) publishes no telemetry, and the conflict is logged. |
| A tag path, for example `Plant/Area/>` | The tag's telemetry subjects: `uns.telemetry.Plant.Area.>`. `*` is one level, a trailing `>` the rest. |
| A tag-path deny with `*`, for example `Plant/*/Temp` | Everything under the levels before the `*`: `uns.telemetry.Plant.>`. A level that contains `.` is several tokens, which one `*` would not cover. |
| A tag path that is not a valid subject (an empty level, `Tank*`, `>` before the end) | Fails closed and is logged: an allow is dropped, a deny denies everything under the levels before the bad one. |
| A tag-path publish allow | Nothing: eaxScada publishes the telemetry, and a command carries its tag in the payload. Send commands with the subject rule `uns.command.write`. |
| Any rule, whatever the role | Never JetStream or the broker's own subjects: `$JS.>`, `$JSC.>`, `$KV.>`, `$O.>`, `$SYS.>`, `$SRV.>`, `$MQTT.>` and `$NRG.>` are denied both ways to every user. |

Every client also gets the PLC API subjects (publish `plc.*.api`, `plc.*.api.part`, `plc.*.telemetry.open`, `plc.*.telemetry.*.watch`; subscribe `plc.*.telemetry.*` and `_INBOX.>`), and nothing else: a role with no subscribe rule receives no telemetry. The HA cluster's subjects are denied to every client.

A tag name that contains `.` is published as several tokens, so it shares subjects with deeper paths: `Plant/Area/>` also covers `Plant/Area.X/...`. Protect sensitive tags with deny rules. Roles whose rules are only `>` or subjects, as on a new installation, keep what they had, except publishing telemetry and the broker's own subjects.

**Telemetry is produced by devices.** A program that publishes tag values, such as eaxPLC, connects as a device with its NKey, whose rights are its own and not built from a role. A NATS channel then ingests a message only when its subject names the tag of its payload: the subject is `uns.telemetry.` followed by the path with `/` as `.`, so `Plant/FT101.PV` travels on `uns.telemetry.Plant.FT101.PV`. A message whose two names differ is dropped, counted in `eaxscada_uns_ingest_refused_total{reason="TELEMETRY_SUBJECT_MISMATCH"}` and logged at most once every 10 seconds per channel and device: a publisher allowed only part of the namespace cannot set another tag by naming it in the payload. The registry of simulated PLCs follows the same rule.

**Precedence rule: an explicit DENY always overrides an ALLOW.**

#### Example permissions

```json
{
  "role": "Shift_Operator",
  "permissions": {
    "publish": {
      "allow": ["uns.command.write"]
    },
    "subscribe": {
      "allow": ["uns.telemetry.>", "uns.alarm.>"]
    }
  }
}
```

This role sends commands and reads live telemetry and alarms. It reads the telemetry as it is published, not the buffer of the `TELEMETRY` stream: the stream is JetStream, which no user gets.

The broker refuses a publish or a subscription on a subject the role does not allow. The tag path of a command is in its payload, not in the subject, so the broker does not decide which tags a command writes: the write checks of eaxScada do, after the broker (the tag exists, its limits and interlocks, and the signature the tag requires). For a command signed with a ticket, eaxScada also checks that the signer may write the tag, and records a refusal as `WRITE_DENIED` in the access audit. See [Signed commands](/docs/platform/reference/signed-commands/).

---

## 6. Software-defined DMZ and network topologies

This section describes the design of the eaxCloud connection, which is in development (early access 2027). Today eaxScada makes no leaf node connection: a `nats.leaf_nodes` list in its configuration is ignored. The design uses NATS leaf nodes and account isolation to link an air-gapped Purdue Level 2 network to Level 3 and corporate networks without weakening plant-floor security.

**Diagram: A site opens both connections to eaxCloud itself** (network topology)

An eaxScada node at the plant opens two outbound NATS leaf node connections over TLS to the same eaxCloud address and port: the fleet connection, which sends status out and imports nothing, and a separate remote-access connection that exists only while a remote-access switch at the site is on. A remote user reaches the site through a relay that sees ciphertext only. Commands cannot enter the plant from the cloud.

**Parts**

- **Plant site** (trust boundary)
- **eaxCloud** (trust boundary)
- **Remote user** (person or role): a browser
- **eaxScada node** (product, inside Plant site): own device key sign-in, rights, e-signatures, audit, remote-access check
- **Plant message broker** (service or process, inside Plant site): uns.command.>  plc.\<id>.api
- **Session relay** (service or process, inside eaxCloud): relays ciphertext only
- **Fleet account** (service or process, inside eaxCloud): one NATS account per customer imports nothing from the site link

**Connections**

- **Remote user ↔ Session relay** (data or telemetry): session. End-to-end encrypted between the browser and the site.
- **eaxScada node ↔ Session relay** (data or telemetry): only while a remote-access switch is on. The remote-access connection: a second outbound NATS leaf node connection over TLS, to the same address and port, with its own key, kept in memory and renewed daily.
- **eaxScada node → Fleet account** (data or telemetry): status out. The fleet connection: an outbound NATS leaf node connection over TLS, authenticated by a key the device generates itself.
- **Fleet account → Plant message broker** (command to equipment, not active): never imported. Command subjects can never be imported from the cloud.
- **eaxScada node → Plant message broker** (relation)

Both are outbound NATS leaf connections, same address and port. The remote connection has no route to the plant broker.

The plant firewall needs no inbound port. Turning the switches off at the site removes the remote connection within two seconds; the site keeps running locally.

- **Outbound-only leaf node.** The edge node will open an outbound TLS connection to eaxCloud, authenticated by a key it generates itself. The plant firewall needs **no inbound port**.
- **The site chooses what it exports.** Only the subjects the site exports, for example `uns.telemetry.Plant.Processing.>`, are sent upstream. Everything else stays at the edge.
- **Commands are never importable.** Command subjects (`uns.command.>` and `plc.<id>.api`) can never be imported from the cloud. While remote control is off, which is the default and a local setting the cloud cannot change, nothing from the cloud enters the site's namespace at all.
- **Revocation.** Revoking a node's key disconnects it from the cloud. The site keeps running locally.

See [eaxCloud](/docs/platform/explanation/eaxcloud/) for the status of each eaxCloud capability.

---

## 7. See also

- [Screen designer](/docs/eaxscada/explanation/screen-designer/): bind widgets to UNS topics.
- [Expression language](/docs/eaxscada/reference/expression-language/): how tag references in expressions resolve to UNS tags.
- [Historian](/docs/eaxscada/explanation/historian/): logging UNS telemetry.
- [Security and 21 CFR Part 11](/docs/platform/explanation/security-and-part-11/): the audit trail of UNS writes.
- [MCP AI gateway](/docs/eaxscada/explanation/mcp-ai-gateway/): how an AI assistant navigates this topic tree.
