Architecture

Ingress, event routing,
and live sessions.

MQTT and TCP telemetry uses authenticated connections, versioned codecs and bounded memory routing. Business systems own durable data.

Runtime path

MQTT / TCP / UDP devices
          |
          v
transport framing and lifecycle
          |
          v
authentication / ACL / bound AuthContext
          |
          v
versioned DeviceCodec
          |
          v
DeviceEvent(event_id)
          |
          v
bounded EventBus and atomic required-sink admission
          |
          +------ confirmed HTTP webhook
          |
          +------ confirmed Business RPC stream

Selected workspace responsibilities

The workspace separates public protocols and clients from gateway runtime and transport implementation.

netbaiot-protocol

Public wire and domain types, stable errors, paths, and protocol version 1

crates/netbaiot-protocol

netbaiot-client

Business HTTP APIs and confirmed event-stream ownership

crates/netbaiot-client

netbaiot-device-sdk

Optional MQTT device client

crates/netbaiot-device-sdk

netbaiot-core

Domain types and the synchronous DeviceCodec trait

crates/netbaiot-core

netbaiot-codecs

Bounded vendor and device protocol codecs

crates/netbaiot-codecs

netbaiot-runtime

Caches, admission, event routing, sessions, commands, and metrics

crates/netbaiot-runtime

netbaiot-transports

Embedded MQTT, framed TCP, UDP, ACLs, and connection owners

crates/netbaiot-transports

netbaiot-server

Validated composition, business sinks, listeners, and graceful shutdown

apps/netbaiot-server

netbaiot-cli

Demo, configuration, server, and operator CLI

apps/netbaiot-cli

Embedded MQTT 3.1.1 and bounded 5.0 profile

The broker supports QoS 0, 1 and 2, retained messages, Will and persistent sessions within one process. Restart clears all MQTT state. MQTT QoS and business delivery are separate contracts.

v1/t/{tenant}/p/{product}/d/{device}/up
v1/t/{tenant}/p/{product}/d/{device}/up_ack
v1/t/{tenant}/p/{product}/d/{device}/down
v1/t/{tenant}/p/{product}/d/{device}/down_ack

Design priorities

No runtime state files, database, durable outbox or offline command storage. Planned shutdown waits for required sink ACKs in memory; a forced exit loses pending work.