udmi

UDMI / Docs / Specs / UUFI

Unified UDMI Functional Interface (UUFI)

The Unified UDMI Functional Interface (UUFI) defines a standardized messaging mechanism for external applications (the Client) to integrate with a UDMI-managed system (the System). This needs to be said: this provides a ‘Unified Universal Device Management Interface Functional Interface’. This is essentially an application-side interface into UDMI in contrast to the on-prem device side interface… similar but slightly different.

1. Architecture

UUFI utilizes a messaging transport where Clients and Systems interact via dedicated topics and subscriptions.

Message Flow

2. Connectivity

2.1. Connection String

UUFI interfaces use a URL-like connection string format. Supported schemes: mqtt:// and pubsub://.

Format: scheme://[user@]host[:port][/path]

2.2. Protocol Mapping

PubSub (pubsub://)

MQTT (mqtt://)

3. Handshake Protocol

Handshake is Client-initiated. The System MUST NOT initiate a handshake unless acting as a Client.

Step 1: State Declaration

The Client publishes a UDMI state message to /uufi/c/state/udmi.

Step 2: Configuration Confirmation

The System publishes a UDMI config message to /uufi/c/config/udmi.

Retries: The Client SHOULD periodically republish the Step 1 state message (e.g., every 5 seconds) if a valid Step 2 confirmation has not been received, until the 60-second timeout.

Activation: The Client is Active when reply.transaction_id matches the original state.setup.transaction_id.

Registry ID Discovery

3.1 Interoperability Reminders

4. Message Encapsulation

All messages are wrapped in a UUFI Envelope.

Mandatory Payload Fields

Inner JSON payload object MUST include:

Transport Mapping

Transport Envelope Location Payload Location
PubSub Message Attributes Message Data (JSON)
MQTT JSON Wrapper Payload payload key

MQTT Constraints

5. Cloud Model Operations

5.1. Schema

5.2. Update Semantics (Partial Merge)

The UPDATE operation for the cloud subfolder is a partial merge at the device subsystem level. Existing fields not in the payload MUST NOT be modified.

6. UDMI to UUFI Mapping

UDMI Operation Envelope subType Envelope subFolder Direction
Handshake State state udmi Publish
Handshake Config config udmi Receive
Config Update config varies Publish
State Event state varies Receive
Telemetry events pointset Receive
Discovery events discovery Receive
Model Query query cloud Publish
Model Update model cloud Publish
Model Reply config cloud Receive
State Query query state Publish
Blobset Config config blobset Publish
Blobset State state blobset Receive

7. Reliability

MQTT QoS

Idempotency

8. Payload and Formatting Rules

8.1. Payload Structure

8.2. Timestamp Format

8.3. Type Safety and Fallbacks

8.4. MQTT Specific Rules


9. Test and Development

The UDMI repository provides a modular, multi-tier local development and testing workflow to isolate infrastructure, devices, and client applications.

9.1. Scope 1: Basic Local Setup (Infrastructure Only)

The first tier initializes a spec-compliant UUFI message broker and gateway processor. This establishes the bare-minimum messaging backbone without any active devices or tests, providing a clean black-box middleware layer for external applications.

Starting the Infrastructure

bin/start_local

This script performs the following actions:

  1. MQTT Broker: Starts a local Mosquitto broker on port 8883 with SSL enabled.
  2. Site Model: Uses the provided site model (e.g., sites/udmi_site_model) and configures it for local MQTT use.
  3. UDMIS: Starts the udmis service with the UufiProcessor enabled to act as the UUFI gateway.

Connection Details:


9.2. Scope 2: Local Setup with Pubber DUT (Device Under Test)

The second tier builds on top of Scope 1 by registering and launching a simulated on-premise device under the UDMI schema framework. This provides an active device stream for testing, receiving configuration updates, and reporting back telemetry.

Registering and Launching the Device

When running tests or manual sessions, the environment launches Pubber as the simulated Device Under Test (DUT). This client:

  1. Connects to the local MQTT broker as a device.
  2. Begins periodically publishing telemetry state (such as pointset events) on standard UDMI topics.
  3. Listens for configuration payloads routed through the UUFI system gateway.

9.3. Scope 3: Verification with the UUFI Test Client

The third tier performs active end-to-end integration testing of the UUFI interface by introducing a low-level test client that exchanges messages with the Pubber DUT (from Scope 2) over the active infrastructure (from Scope 1).

Running Automated UUFI Pipeline Verification

To verify the entire bidirectional pipeline (System Gateway -> Broker -> DUT -> Client), run:

bin/test_uufi

This command automatically orchestrates the following operations:

  1. System Initialization: Confirms that the Scope 1 local services are healthy.
  2. DUT Lifecycle: Registers and launches a Pubber device (Scope 2).
  3. Handshake Phase: Starts a low-level uufi_test_client which completes the standard Step 1 and Step 2 UUFI Handshake over the broker.
  4. Bidirectional Exchange:
    • Sends a UUFI-wrapped configuration update to the DUT.
    • Verifies that the gateway correctly routes the update to the Pubber device.
    • Captures the corresponding telemetry state returning from the Pubber device to confirm successful processing.

For modular, manual client-side testing against an already running environment, the standalone script can be run directly:

bin/uufi_test_client

9.4. Passive Observation and Trace Analysis

The bin/observe_uufi tool is a utility that provides a passive, real-time view of all messaging traffic on the UUFI topic tree, without actively participating in handshakes or sending configurations.

Running the Observer

bin/observe_uufi

The observer will:

  1. Subscribe: Connects to the local MQTT broker and subscribes to /uufi/#.
  2. Display: Outputs every message received sequentially to stdout in a raw, unbuffered line-by-line format ({topic}: {payload}), making it ideal for checking message boundaries and verifying format compliance.

9.5. Interactive Site Model Database Update Emulation

To emulate physical database mutations and trigger live model-update events, developers can use the bin/site_trigger utility. This allows verification of reactive system orchestrators (like Butler) sitting on top of the UUFI bus without modifying raw config files by hand.

Running the Site Model Trigger

bin/site_trigger update <site_path> <device_id> <blob_id> <version> [conn_spec]

This tool:

  1. Mutates Site Model: Locates the specified metadata.json file in the site directory (e.g., <site_path>/devices/{device_id}/metadata.json) and atomically updates its expected version tag (system.software.<blob_id> = <version>).
  2. Triggers Model Event: Synthesizes and publishes a corresponding model/cloud Model Update message to /uufi/c/model/cloud on the broker, enabling reactive orchestrators to instantly sync.

Appendix A: Schemas and Examples

This appendix references the formal JSON schemas and provides message examples for the UUFI protocol. The UDMI Schema Repository is the authoritative source for all message structures.

A.1. Examples

A.1.1. Handshake (PubSub)

Attributes:

{
  "subFolder": "udmi",
  "subType": "state",
  "transactionId": "UUFI:sess123:001",
  "source": "client-id",
  "principal": "client-id@"
}

Data:

{
  "version": "1.5.2",
  "timestamp": "2026-04-29T10:00:00Z",
  "setup": {
    "functions_ver": 9,
    "transaction_id": "UUFI:sess123:001",
    "msg_source": "client-id"
  }
}

A.1.2. Handshake (MQTT)

Topic: /uufi/c/state/udmi

Payload:

{
  "projectId": "vibrant",
  "transactionId": "UUFI:sess123:001",
  "publishTime": "2026-04-29T10:00:00Z",
  "source": "client-id",
  "principal": "client-id",
  "payload": {
    "version": "1.5.2",
    "timestamp": "2026-04-29T10:00:00Z",
    "setup": {
      "functions_ver": 9,
      "transaction_id": "UUFI:sess123:001",
      "msg_source": "client-id"
    }
  }
}

A.1.3. Pointset Config (PubSub)

Attributes:

{
  "subFolder": "pointset",
  "subType": "config",
  "transactionId": "UUFI:sess123:002",
  "source": "client-id",
  "principal": "client-id@",
  "deviceRegistryId": "reg-1",
  "deviceId": "dev-1"
}

Data:

{
  "version": "1.5.2",
  "timestamp": "2026-04-29T10:05:00Z",
  "points": {
    "temp": { "set_value": 22.5 }
  }
}

A.1.4. Pointset Config (MQTT)

Topic: /uufi/r/reg-1/d/dev-1/c/config/pointset

Payload:

{
  "transactionId": "UUFI:sess123:002",
  "principal": "client-id",
  "payload": {
    "version": "1.5.2",
    "timestamp": "2026-04-29T10:05:00Z",
    "points": {
      "temp": { "set_value": 22.5 }
    }
  }
}

A.1.5. Blobset Config (PubSub)

Attributes:

{
  "subFolder": "blobset",
  "subType": "config",
  "transactionId": "UUFI:sess123:003",
  "source": "client-id",
  "principal": "client-id@",
  "deviceRegistryId": "reg-1",
  "deviceId": "dev-1"
}

Data:

{
  "version": "1.5.2",
  "timestamp": "2026-04-29T10:10:00Z",
  "blobset": {
    "blobs": {
      "system": {
        "phase": "apply",
        "url": "file:///path/to/bundle.bin",
        "sha256": "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
        "generation": "2026-04-29T10:10:00Z"
      }
    }
  }
}

A.1.6. Blobset Config (MQTT)

Topic: /uufi/r/reg-1/d/dev-1/c/config/blobset

Payload:

{
  "transactionId": "UUFI:sess123:003",
  "principal": "client-id",
  "payload": {
    "version": "1.5.2",
    "timestamp": "2026-04-29T10:10:00Z",
    "blobset": {
      "blobs": {
        "system": {
          "phase": "apply",
          "url": "file:///path/to/bundle.bin",
          "sha256": "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
          "generation": "2026-04-29T10:10:00Z"
        }
      }
    }
  }
}

A.2. Authoritative Schemas

UUFI implementations MUST adhere to the following schemas from the UDMI repository:

UUFI Component Authoritative UDMI Schema
Message Envelope envelope.json
Handshake State state_udmi.json
Handshake Config config_udmi.json
Cloud Model model_cloud.json
Blobset Config config_blobset.json
Blobset State state_blobset.json