Skip to content

Commit bca1abb

Browse files
committed
Technical review of Device Connect Server LP
1 parent f909c23 commit bca1abb

2 files changed

Lines changed: 127 additions & 70 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/device-connect-server/background.md

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,57 @@ weight: 2
66
layout: learningpathall
77
---
88

9-
## What D2D mode gives you, and where it stops
9+
## From device-to-device (D2D) to server
1010

11-
In device-to-device (D2D) mode, every Device Connect runtime is a peer on the same local network. Devices find each other through the messaging backend's local discovery (Zenoh's multicast scouting, or NATS running in a peer-to-peer configuration), exchange typed events, and call each other's RPCs directly. There is no central process to provision or maintain.
11+
The [device-to-device Learning Path](/learning-paths/embedded-and-microcontrollers/device-connect-d2d/) showed Device Connect in its simplest shape. Each runtime is a peer on the same local network. Devices find each other automatically, exchange typed events, and call each other's remote procedure calls (RPCs) directly. There is no broker, registry, or cloud service to run.
1212

13-
That is a great fit for prototyping, for small fleets on a shared LAN, and for time-sensitive applications where a cloud round-trip would be wasteful. It stops being a great fit when you need any of the following:
13+
That model is useful when everything is close together. It works well for prototypes, lab demos, and small fleets on one local area network (LAN). It is also a good fit when a cloud round-trip would add unnecessary delay.
1414

15-
- a **persistent registry** that survives device reboots and lets a new client list every device that has ever connected, not just the ones online right this second
16-
- **distributed state** shared between devices and agents, with leases and watches (for example, "which experiment is each device currently running?")
17-
- **multi-network reach** for devices and agents on different LANs, behind NAT, or in the cloud
18-
- **fleet-wide operations** like commissioning new devices, rotating credentials, or auditing every RPC that has ever been issued
19-
- **security guarantees** beyond TLS on the wire, including per-device cryptographic identity, PIN-based onboarding, role-based ACLs, and audit logs
15+
As soon as the fleet grows, D2D mode starts to run out of road. You may need devices on different networks to talk to each other. You may need a registry that remembers devices after they disconnect. You may also need stronger identity, credential rotation, or audit logs.
2016

21-
The [`device-connect-server`](https://github.com/arm/device-connect/tree/main/packages/device-connect-server) package is the layer that adds those capabilities on top of the edge SDK you already know.
17+
Use a Device Connect server when you need:
18+
19+
- a **persistent registry** that survives device reboots and lets new clients list known devices
20+
- **distributed state** shared between devices and agents, with leases and watches
21+
- **multi-network reach** for devices and agents on different LANs, behind network address translation (NAT), or in the cloud
22+
- **fleet-wide operations** such as commissioning devices and rotating credentials
23+
- **stronger security controls** such as per-device identity, JSON Web Token (JWT) credentials, role-based access control lists (ACLs), and audit logs
24+
25+
The [`device-connect-server`](https://github.com/arm/device-connect/tree/main/packages/device-connect-server) package is the layer that adds those capabilities on top of the edge software development kit (SDK) you already know.
2226

2327
## What the server adds
2428

25-
The server runtime ships as a small set of services you run alongside (or instead of) raw D2D scouting:
29+
The server does not change how you write device code. Devices still use `DeviceDriver`, `@rpc`, `@emit`, `@periodic`, and `@on`. Clients and artificial intelligence (AI) agents still use `discover_devices()` and `invoke_device()`.
30+
31+
The server changes how devices find and trust each other. In D2D mode, each runtime discovers nearby peers directly. With a server, every device and agent connects to a shared service.
32+
33+
That shared service gives you a few fleet-level building blocks:
2634

27-
- a **messaging router** (Zenoh by default; NATS or MQTT as alternatives) so devices on different networks can reach the same mesh
28-
- a **device registry service** that records every device, its identity, capabilities, and last-known status, in a persistent store
29-
- an **etcd-backed distributed state store** that any device or agent can read and write through the Python API
30-
- a **device commissioning flow** with PIN-based onboarding and per-device cryptographic identity (covered later in this Learning Path)
31-
- optional **security infrastructure**: TLS/mTLS for Zenoh, JWT auth for NATS, role-based access control, audit logging
35+
- **routing** so devices on different networks can join the same mesh
36+
- **registry** so clients can see known devices, their capabilities, and their last-known status
37+
- **shared state** so devices and agents can coordinate through a common store
38+
- **commissioning** so each device gets its own trusted credential
39+
- **security controls** such as Transport Layer Security (TLS), mutual TLS (mTLS), JSON Web Token (JWT) authentication, role-based access control, and audit logging
3240

33-
You can adopt these incrementally: run the dev-mode Docker Compose to get a router and registry running locally with no auth, then layer in TLS or JWT once you have the basics working.
41+
Device Connect supports different messaging backends, including Zenoh, NATS, and Message Queuing Telemetry Transport (MQTT). In this Learning Path, you will use the hosted portal with NATS credentials. That lets you focus on the device and agent code instead of running the server yourself.
3442

3543
## A note on commissioning
3644

37-
In a serious deployment, no device joins the mesh until it has been **commissioned**, meaning it has been given a cryptographic identity that the server trusts. The shape of that identity depends on the messaging backend:
45+
Commissioning means giving a device or agent a trusted identity before it joins the mesh. Without commissioning, a process is just code trying to connect. With commissioning, the server can decide whether that process is allowed to publish, subscribe, register itself, or call an RPC.
3846

39-
- with **Zenoh**, commissioning means issuing the device a client TLS certificate signed by a shared CA
47+
The credential format depends on the messaging backend:
48+
49+
- with **Zenoh**, commissioning means issuing the device a client TLS certificate signed by a shared certificate authority (CA)
4050
- with **NATS**, commissioning means issuing the device a JWT credential bound to its tenant
4151

42-
In both cases, the credential answers the question "is this device allowed on this tenant's mesh?" and prevents anyone else from impersonating it. In this Learning Path you will use the [Device Connect portal](https://portal.deviceconnect.dev/) to mint NATS credentials for your devices and your agent, then point each runtime at the tenant's NATS server. That replaces the local Docker setup with a hosted server you do not need to operate yourself.
52+
In both cases, the credential answers the same question: is this identity allowed on this mesh?
53+
54+
In this Learning Path, you will use the [Device Connect portal](https://portal.deviceconnect.dev/) to download NATS credentials for three default identities on your tenant. Two identities will run simulated robot arms. The third identity will run the Python client or agent.
4355

4456
## Where this sits in the architecture
4557

58+
In the diagram, pub/sub means publish/subscribe, KV means key-value, LC means LangChain, and MCP means Model Context Protocol.
59+
4660
```
4761
┌──────────────────┐ ┌──────────────────────┐ ┌─────────────────────┐
4862
│ Devices │ │ Device Connect │ │ AI agents │
@@ -55,7 +69,7 @@ In both cases, the credential answers the question "is this device allowed on th
5569

5670
Devices and agents still talk to each other through the same primitives (`@rpc`, `@emit`, `discover_devices`, `invoke_device`). The Device Connect server runs the pub/sub messaging, the persistent registry, the shared key-value store, and the security layer in one place.
5771

58-
The animation below shows the same idea end to end: a Device Connect server runs in Berlin (with Zenoh, NATS, or MQTT as the messaging backend), robots in San Francisco and Tokyo install `device-connect-edge` and register with it, and an AI agent in Bangalore installs `device-connect-agent-tools` and drives both robots through the server. Every `invoke_device` call and every event flows through Berlin.
72+
The animation below shows the same idea end to end. A Device Connect server runs in Berlin. Robots in San Francisco and Tokyo install `device-connect-edge` and register with it. An AI agent in Bangalore installs `device-connect-agent-tools` and drives both robots through the server. Every `invoke_device` call and every event flows through the server.
5973

6074
<video width="100%" controls muted playsinline>
6175
<source src="https://raw.githubusercontent.com/kavya-chennoju/arm-learning-path-assets/main/videos/device-connect-server-overview.mp4" type="video/mp4">
@@ -66,9 +80,10 @@ The animation below shows the same idea end to end: a Device Connect server runs
6680

6781
In the rest of this Learning Path you will:
6882

69-
- start the server stack locally with Docker Compose
70-
- connect a simulated number-generator device to it
71-
- discover the registered device from a short Python client using `device-connect-agent-tools`
72-
- attach a Strands AI agent that subscribes to events on the mesh
83+
- sign in to the Device Connect portal and identify your tenant slug
84+
- download credentials for the three default device identities
85+
- run two simulated robot arms with `device-connect-edge`
86+
- discover and invoke both devices from a Python client using `device-connect-agent-tools`
87+
- optionally attach a Strands AI agent to the same tenant
7388

7489
The next section walks through the setup.

0 commit comments

Comments
 (0)