Connector framework

This chapter captures the requirements for taktora-connector: a framework that connects taktora-executor applications to external protocols (MQTT, OPC UA, gRPC, fieldbus) through a controlled boundary, so messy network code lives outside the application’s deterministic core.

The decomposition is two-tier:

This round covers the framework core plus an MQTT reference connector (rumqttc-backed). OPC UA, gRPC, and Beckhoff ADS connectors are deferred to follow-on specs that will reuse the same five contracts.

Each capability cluster lives on its own page (see the toctree): envelope transport (Envelope transport (FEAT_0031)), codec abstraction (Codec abstraction (FEAT_0032)), the connector trait and routing (Connector trait and routing (FEAT_0033)), connection lifecycle (Connection lifecycle (FEAT_0034)), process-boundary deployments (Process boundary deployments (FEAT_0035)), connector cycle telemetry (Connector cycle telemetry (FEAT_0038)), host wiring and builder (Host wiring and builder (FEAT_0037)), and the reference connectors — MQTT (MQTT reference connector (FEAT_0036)), EtherCAT (EtherCAT reference connector (FEAT_0041)), Zenoh (Zenoh reference connector (FEAT_0042)), and CAN (CAN (SocketCAN) reference c... (FEAT_0046)). The deliberately rejected anti-goals, the umbrella-level traceability tables, and the safety refinements live on Cross-cutting and anti-goals.

Top-level umbrella

Feature: Connector framework FEAT_0030

A Rust framework that bridges taktora-executor applications to external protocols through a typed envelope carried over iceoryx2 shared memory. The framework provides five contracts — envelope, codec, routing, health, lifecycle — that every protocol connector instantiates as a plugin (in-app side) and a gateway (out-of-app side). Both halves are taktora-executor ExecutableItem consumers; protocol-specific async work runs on a tokio sidecar contained inside each connector crate.

Deployment chooses whether the gateway runs as a tokio task in-process alongside the plugin host, or as a separate gateway binary. The envelope contract is identical either way; only process-startup wiring differs.

This umbrella is a peer of PLC runtime heart on iceoryx2 (FEAT_0010) “PLC runtime heart”; the connector framework is a general-purpose mechanism, not PLC-specific. Fieldbus integration interface (FEAT_0023) “Fieldbus integration interface” is later expected to :refines: this umbrella once a fieldbus connector spec lands.

Requirements at a glance

Used filter:

ID

Title

Status

Satisfies

FEAT_0031

Envelope transport

open

FEAT_0030

FEAT_0032

Codec abstraction

open

FEAT_0030

FEAT_0033

Connector trait and routing

open

FEAT_0030

FEAT_0034

Connection lifecycle

open

FEAT_0030

FEAT_0035

Process boundary deployments

open

FEAT_0030

FEAT_0036

MQTT reference connector

open

FEAT_0030

FEAT_0037

Host wiring and builder

open

FEAT_0030

FEAT_0038

Connector cycle telemetry

open

FEAT_0030

FEAT_0041

EtherCAT reference connector

open

FEAT_0030

FEAT_0042

Zenoh reference connector

open

FEAT_0030

FEAT_0043

Zenoh pub/sub

open

FEAT_0042

FEAT_0044

Zenoh queries

open

FEAT_0042

FEAT_0045

Zenoh session topology and health

open

FEAT_0042

FEAT_0046

CAN (SocketCAN) reference connector

open

FEAT_0030

FEAT_0047

CAN frame transport (classical + FD)

open

FEAT_0046

FEAT_0048

Multi-interface gateway and per-channel filtering

open

FEAT_0046

FEAT_0049

Bus health, error frames, and reconnect

open

FEAT_0046

REQ_0200

ConnectorEnvelope is a POD type

open

FEAT_0031

REQ_0201

Per-channel max payload size

approved

FEAT_0031

REQ_0202

Sequence number monotonically increasing

implemented

FEAT_0031

REQ_0203

Timestamp recorded at send

implemented

FEAT_0031

REQ_0204

Correlation id is a passive carrier

implemented

FEAT_0031

REQ_0205

Zero-copy publish via iceoryx2 loan

implemented

FEAT_0031

REQ_0206

One iceoryx2 service per channel direction

implemented

FEAT_0031

REQ_0210

PayloadCodec trait

implemented

FEAT_0032

REQ_0211

Codec is a generic parameter on connectors

open

FEAT_0032

REQ_0212

JsonCodec is the default codec

implemented

FEAT_0032

REQ_0213

Codec encode error variant

open

FEAT_0032

REQ_0214

Codec decode error variant

open

FEAT_0032

REQ_0220

Connector trait

open

FEAT_0033

REQ_0221

ChannelDescriptor carries typed routing

implemented

FEAT_0033

REQ_0222

Routing is a marker trait with bounds

open

FEAT_0033

REQ_0223

create_writer / create_reader return concrete handles

open

FEAT_0033

REQ_0224

Connector ships its own routing struct

approved

FEAT_0033

REQ_0230

ConnectorHealth state machine

approved

FEAT_0034

REQ_0231

subscribe_health returns a Channel of HealthEvent

approved

FEAT_0034

REQ_0232

ReconnectPolicy trait

open

FEAT_0034

REQ_0233

ExponentialBackoff default policy

open

FEAT_0034

REQ_0234

HealthEvent emitted on every transition

approved

FEAT_0034

REQ_0235

Stack-internal-reconnect connectors emit health uniformly

approved

FEAT_0034

REQ_0240

Same envelope contract for both deployments

approved

FEAT_0035

REQ_0241

In-process gateway is a tokio task

open

FEAT_0035

REQ_0242

Separate-process gateway is a self-contained binary

open

FEAT_0035

REQ_0243

Clean exit on SIGINT / SIGTERM on both sides

open

FEAT_0035

REQ_0244

No app↔gateway control-plane envelopes

approved

FEAT_0035

REQ_0250

MqttConnector implements Connector

open

FEAT_0036

REQ_0251

MqttRouting carries topic, qos, retained

open

FEAT_0036

REQ_0252

QoS 0 and 1 supported

open

FEAT_0036

REQ_0253

Retained-message publish supported

open

FEAT_0036

REQ_0254

Wildcard subscriptions supported

open

FEAT_0036

REQ_0255

Username/password authentication

open

FEAT_0036

REQ_0256

TLS is optional via cargo feature

open

FEAT_0036

REQ_0257

MQTT 3.1.1 baseline

open

FEAT_0036

REQ_0258

Tokio sidecar inside the gateway crate

open

FEAT_0036

REQ_0259

Bridge channels are bounded

open

FEAT_0036

REQ_0260

Outbound bridge saturation surfaces as BackPressure

open

FEAT_0036

REQ_0261

Inbound bridge saturation drops frames and signals Degraded

open

FEAT_0036

REQ_0262

Wire-round duration statistics

draft

FEAT_0038

REQ_0263

Working-counter quality counter

draft

FEAT_0038

REQ_0264

Freshness and staleness statistics

draft

FEAT_0038

REQ_0265

Connector statistics query API

draft

FEAT_0038

REQ_0266

Cycle-phase wait (slack) statistics

draft

FEAT_0038

REQ_0267

Connector push fault semantics

draft

FEAT_0038

REQ_0270

ConnectorHost builder API

approved

FEAT_0037

REQ_0271

ConnectorGateway builder API

approved

FEAT_0037

REQ_0272

Host registers connector items with the executor

approved

FEAT_0037

REQ_0273

Optional Observer adapter for tracing

open

FEAT_0037

REQ_0290

NO request/response matching by the framework

rejected

FEAT_0030

REQ_0291

NO app↔gateway control plane

rejected

FEAT_0030

REQ_0292

NO persistent outbox or durable buffering

rejected

FEAT_0030

REQ_0293

NO schema/contract enforcement across the boundary

rejected

FEAT_0030

REQ_0294

NO protocol-portable Channel<T>

rejected

FEAT_0030

REQ_0295

NO multi-broker / multi-tenant gateway

rejected

FEAT_0030

REQ_0296

NO supervision / panic recovery

rejected

FEAT_0030

REQ_0310

EthercatConnector implements Connector

approved

FEAT_0041

REQ_0311

EthercatRouting carries SubDevice and PDO addressing

implemented

FEAT_0041

REQ_0312

Single MainDevice per gateway instance

approved

FEAT_0041

REQ_0313

Bus reaches OP before serving traffic

approved

FEAT_0041

REQ_0314

Static PDO mapping per SubDevice

approved

FEAT_0041

REQ_0315

PDO mapping applied during PRE-OP to SAFE-OP transition

implemented

FEAT_0041

REQ_0316

Cycle time configurable with millisecond resolution

implemented

FEAT_0041

REQ_0317

Missed cycle ticks are skipped not queued

implemented

FEAT_0041

REQ_0318

Distributed Clocks bring-up is opt-in

approved

FEAT_0041

REQ_0319

Working-counter-based health policy

implemented

FEAT_0041

REQ_0320

Working-counter mismatch degrades health

approved

FEAT_0041

REQ_0321

Tokio sidecar contained inside the connector crate

approved

FEAT_0041

REQ_0322

Bridge channels are bounded

approved

FEAT_0041

REQ_0323

Outbound bridge saturation surfaces as BackPressure

approved

FEAT_0041

REQ_0324

Inbound bridge saturation drops PDUs and signals Degraded

implemented

FEAT_0041

REQ_0325

Linux raw socket required on gateway host

approved

FEAT_0041

REQ_0326

Outbound payload written to PDI bit slice per routing

implemented

FEAT_0041

REQ_0327

Inbound payload read from PDI bit slice per routing

implemented

FEAT_0041

REQ_0328

Per-channel routing registry on the gateway

approved

FEAT_0041

REQ_0329

Asymmetric working counter declared per SubDevice

implemented

FEAT_0041

REQ_0330

Distributed Clocks cycle path uses tx_rx_dc

open

FEAT_0041

REQ_0331

Bus-level recovery on cycle error

implemented

FEAT_0041

REQ_0332

Reconnect policy factory in connector options

implemented

FEAT_0041

REQ_0333

Health transitions during recovery

implemented

FEAT_0041

REQ_0400

ZenohConnector implements Connector

approved

FEAT_0043

REQ_0401

ZenohRouting carries key_expr and pub/sub QoS fields

open

FEAT_0043

REQ_0402

JsonCodec is the default codec for Zenoh

approved

FEAT_0043

REQ_0403

Tokio sidecar contained inside the Zenoh connector crate

implemented

FEAT_0043

REQ_0404

Zenoh bridge channels are bounded

approved

FEAT_0043

REQ_0405

Outbound bridge saturation surfaces as BackPressure

approved

FEAT_0043

REQ_0406

Inbound bridge saturation drops samples and signals Degraded

open

FEAT_0043

REQ_0407

Zenoh zero-copy publish via iceoryx2 loan

approved

FEAT_0043

REQ_0408

Zenoh gateway is byte-only on the inbound publish path

approved

FEAT_0043

REQ_0420

ZenohConnector exposes create_querier and create_queryable

implemented

FEAT_0044

REQ_0421

ZenohQuerier maps QueryId to envelope correlation_id

approved

FEAT_0044

REQ_0422

ZenohQueryable correlates replies via correlation_id

implemented

FEAT_0044

REQ_0423

Multi-reply per query supported

implemented

FEAT_0044

REQ_0424

Reply stream end-of-stream framed in payload

approved

FEAT_0044

REQ_0425

Query timeout sourced from options, overridable per-querier

approved

FEAT_0044

REQ_0426

terminate(id) finalizes the upstream zenoh::Query

implemented

FEAT_0044

REQ_0427

Codec applied to Q on send and to R on reply

approved

FEAT_0044

REQ_0428

Reply-side inbound saturation drops chunks and signals Degraded

open

FEAT_0044

REQ_0440

Zenoh session mode is a config knob

implemented

FEAT_0045

REQ_0441

NO ReconnectPolicy on Zenoh session loss

rejected

FEAT_0045

REQ_0442

HealthEvent emitted on every Zenoh session transition

implemented

FEAT_0045

REQ_0443

Connect and listen locators surfaced to zenoh::Config

open

FEAT_0045

REQ_0444

zenoh-integration cargo feature gates the real zenoh dep

implemented

FEAT_0045

REQ_0445

MockZenohSession ships unfeature-gated

implemented

FEAT_0045

REQ_0446

Linux, macOS, and Windows are supported host operating systems

implemented

FEAT_0045

REQ_0600

CanConnector implements Connector

approved

FEAT_0046

REQ_0601

CanRouting carries iface, can_id, mask, kind, fd_flags

approved

FEAT_0046

REQ_0602

Linux is the supported host OS for real I/O

open

FEAT_0046

REQ_0603

socketcan-integration cargo feature gates the real socketcan dep

approved

FEAT_0046

REQ_0604

MockCanInterface ships unfeature-gated

approved

FEAT_0046

REQ_0605

Tokio sidecar contained inside the CAN connector crate

approved

FEAT_0046

REQ_0606

CAN bridge channels are bounded

approved

FEAT_0046

REQ_0607

Outbound bridge saturation surfaces as BackPressure

approved

FEAT_0046

REQ_0608

Inbound bridge saturation drops frames and signals Degraded

open

FEAT_0046

REQ_0610

Classical CAN frames supported

approved

FEAT_0047

REQ_0611

CAN-FD frames supported

approved

FEAT_0047

REQ_0612

Channel payload sizing keyed on frame kind

open

FEAT_0047

REQ_0613

Outbound payload serialised to socketcan frame

approved

FEAT_0047

REQ_0614

Inbound gateway is byte-only on the publish path

approved

FEAT_0047

REQ_0615

CAN ID extended flag preserved end-to-end

approved

FEAT_0047

REQ_0620

Multiple interfaces per gateway

approved

FEAT_0048

REQ_0621

Routing identifies the interface

open

FEAT_0048

REQ_0622

Per-interface filter is the union of channel masks

approved

FEAT_0048

REQ_0623

Filter recomputed on channel add/remove

approved

FEAT_0048

REQ_0624

Inbound demux to all matching readers

approved

FEAT_0048

REQ_0625

Per-iface routing registry has stable iteration order

approved

FEAT_0048

REQ_0630

ConnectorHealth aggregates per-iface state via worst-of

approved

FEAT_0049

REQ_0631

Error frames consumed internally

approved

FEAT_0049

REQ_0632

error-passive transitions to Degraded

approved

FEAT_0049

REQ_0633

bus-off transitions to Down and triggers reconnect

approved

FEAT_0049

REQ_0634

ReconnectPolicy reused; ExponentialBackoff default

approved

FEAT_0049

REQ_0635

HealthEvent emitted on every transition

approved

FEAT_0049

REQ_0636

Error frames not exposed to plugin

approved

FEAT_0049

REQ_0640

NO DBC parsing or typed signal extraction in taktora-connector-can

rejected

FEAT_0046

REQ_0641

NO ISO-TP or J1939 support in taktora-connector-can

rejected

FEAT_0046

REQ_0642

NO CAN-XL support

rejected

FEAT_0046

REQ_0643

NO plugin-visible error-frame channel

rejected

FEAT_0049

REQ_0644

NO can-restart-ms management from the gateway

rejected

FEAT_0049

REQ_0841

SAFE-OP to OP transition exchanges cyclic process data

implemented

FEAT_0041

REQ_0842

Bring-up failure is observable via health

implemented

FEAT_0041

REQ_0846

Master programs the SubDevice SM-watchdog registers

implemented

FEAT_0041

REQ_0847

Health subscriptions are independent broadcast streams

implemented

FEAT_0034

REQ_0853

Operator-declared startup SDOs applied before PDO assignment

implemented

FEAT_0041