# pantos06/iotedge architecture

> Architecture diagram of the GitHub repository pantos06/iotedge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pantos06/iotedge
- Repository: https://github.com/pantos06/iotedge

## Overview

IoT Edge runs cloud-configured workloads on devices and provides the local hub that connects modules and synchronizes device state with IoT Hub. The principal deployment path is desired configuration through the Edge Agent’s planning and command layers into a container/runtime backend, followed by reported status. Edge Hub separately handles device protocols, routing, connectivity, and twin synchronization; the security daemon supplies device-side management and certificate capabilities. The tree supports these subsystem boundaries, while sampled source confirms selected twin, persistence, identity, and Kubernetes operations; links between unsampled components are limited to documented product roles.

Main entry points: [`edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands`](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands) (Runtime Commands), [`edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs`](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs) (Hub Service), [`edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs`](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs) (Agent Controller), [`edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/TwinManager.cs`](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/TwinManager.cs) (Twin Synchronization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Edge Agent"]
  node_agent_service["Agent Service<br/>[Program.cs]"]
  node_agent_core["Agent Controller<br/>[Agent.cs]"]
  node_config["Config Sources<br/>[configsources]"]
  node_planner["Deployment Planner<br/>[planners]"]
  node_plan_runner["Plan Runner<br/>[planrunners]"]
  node_commands["Runtime Commands<br/>[commands]"]
  node_docker["Docker Backend"]
  node_kubernetes["Kubernetes Backend"]
  node_edgelet_backend["Edgelet Backend"]
  node_identities["Module Identities"]
  node_reporting["Status Reporting<br/>[IoTHubReporter.cs]"]
end

subgraph group_hub["Edge Hub"]
  node_hub_service["Hub Service"]
  node_protocols["Device Protocols"]
  node_routing["Message Routing"]
  node_connectivity["Cloud Connectivity"]
  node_twin["Twin Synchronization<br/>[TwinManager.cs]"]
  node_session_state["MQTT Session State"]
end

subgraph group_security["Security Daemon"]
  node_security_daemon["Edgelet Daemon"]
  node_certificates["Certificate Manager"]
  node_module_management["Module Management API"]
end

subgraph group_storage["State Storage"]
  node_rocksdb[("RocksDB Store")]
  node_twin_store[("Twin Store")]
  node_entity_store[("Entity Store")]
end

node_cloud(("IoT Hub"))
node_device(("Edge Device"))

node_cloud -->|"provides desired config"| node_config
node_config -->|"supplies config"| node_agent_core
node_agent_service -->|"hosts"| node_agent_core
node_agent_core -->|"requests plan"| node_planner
node_planner -->|"produces plan"| node_plan_runner
node_plan_runner -->|"executes commands"| node_commands
node_commands -->|"dispatches runtime"| node_docker
node_commands -->|"dispatches runtime"| node_kubernetes
node_commands -->|"dispatches runtime"| node_edgelet_backend
node_kubernetes -->|"manages modules"| node_module_management
node_edgelet_backend -->|"calls API"| node_module_management
node_identities -->|"manages identities"| node_cloud
node_agent_core -->|"reports status"| node_reporting
node_reporting -->|"sends status"| node_cloud
node_device -->|"connects using"| node_protocols
node_protocols -->|"enters hub"| node_hub_service
node_hub_service -->|"dispatches messages"| node_routing
node_hub_service -->|"uses connectivity"| node_connectivity
node_hub_service -->|"coordinates twin state"| node_twin
node_twin -->|"syncs twin"| node_cloud
node_twin -->|"reads and updates"| node_twin_store
node_session_state -->|"persists sessions"| node_entity_store
node_twin_store -.->|"stores records"| node_rocksdb
node_entity_store -.->|"stores records"| node_rocksdb
node_security_daemon -->|"manages certificates"| node_certificates
node_security_daemon -->|"serves management"| node_module_management

click node_agent_service "https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Service/Program.cs"
click node_agent_core "https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs"
click node_config "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/configsources"
click node_planner "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planners"
click node_plan_runner "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planrunners"
click node_commands "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands"
click node_docker "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Docker"
click node_kubernetes "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Kubernetes"
click node_edgelet_backend "https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet"
click node_identities "https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/ModuleIdentityLifecycleManager.cs"
click node_reporting "https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/reporters/IoTHubReporter.cs"
click node_hub_service "https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs"
click node_protocols "https://github.com/pantos06/iotedge/tree/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Amqp"
click node_routing "https://github.com/pantos06/iotedge/tree/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core"
click node_connectivity "https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/DeviceConnectivityManager.cs"
click node_twin "https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/TwinManager.cs"
click node_session_state "https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Mqtt/SessionStateStoragePersistenceProvider.cs"
click node_security_daemon "https://github.com/pantos06/iotedge/tree/master/edgelet"
click node_certificates "https://github.com/pantos06/iotedge/blob/master/edgelet/edgelet-http/src/certificate_manager.rs"
click node_module_management "https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs"
click node_rocksdb "https://github.com/pantos06/iotedge/blob/master/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs"
click node_twin_store "https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/twin/StoringTwinManager.cs"
click node_entity_store "https://github.com/pantos06/iotedge/blob/master/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent_service,node_agent_core,node_config,node_planner,node_plan_runner,node_commands,node_docker,node_kubernetes,node_edgelet_backend,node_identities,node_reporting toneBlue
class node_hub_service,node_protocols,node_routing,node_connectivity,node_twin,node_session_state toneAmber
class node_security_daemon,node_certificates,node_module_management toneMint
class node_rocksdb,node_twin_store,node_entity_store toneRose
class node_cloud,node_device toneIndigo
```

## Components

### Edge Agent

- [Agent Service](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Service/Program.cs): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Service/Program.cs`
- [Agent Controller](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/Agent.cs`
- [Config Sources](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/configsources): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/configsources`
- [Deployment Planner](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planners): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planners`
- [Plan Runner](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planrunners): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/planrunners`
- [Runtime Commands](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/commands`
- [Docker Backend](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Docker): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Docker`
- [Kubernetes Backend](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Kubernetes): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Kubernetes`
- [Edgelet Backend](https://github.com/pantos06/iotedge/tree/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet`
- [Module Identities](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/ModuleIdentityLifecycleManager.cs): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/ModuleIdentityLifecycleManager.cs`
- [Status Reporting](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/reporters/IoTHubReporter.cs): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/reporters/IoTHubReporter.cs`

### Edge Hub

- [Hub Service](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/DependencyManager.cs`
- [Device Protocols](https://github.com/pantos06/iotedge/tree/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Amqp): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Amqp`
- [Message Routing](https://github.com/pantos06/iotedge/tree/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core`
- [Cloud Connectivity](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/DeviceConnectivityManager.cs): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/DeviceConnectivityManager.cs`
- [Twin Synchronization](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/TwinManager.cs): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/TwinManager.cs`
- [MQTT Session State](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Mqtt/SessionStateStoragePersistenceProvider.cs): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Mqtt/SessionStateStoragePersistenceProvider.cs`

### Security Daemon

- [Edgelet Daemon](https://github.com/pantos06/iotedge/tree/master/edgelet): `edgelet`
- [Certificate Manager](https://github.com/pantos06/iotedge/blob/master/edgelet/edgelet-http/src/certificate_manager.rs): `edgelet/edgelet-http/src/certificate_manager.rs`
- [Module Management API](https://github.com/pantos06/iotedge/blob/master/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs): `edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Edgelet/ModuleManagementHttpClient.cs`

### State Storage

- [RocksDB Store](https://github.com/pantos06/iotedge/blob/master/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs): `edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs`
- [Twin Store](https://github.com/pantos06/iotedge/blob/master/edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/twin/StoringTwinManager.cs): `edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Core/twin/StoringTwinManager.cs`
- [Entity Store](https://github.com/pantos06/iotedge/blob/master/edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs): `edge-util/src/Microsoft.Azure.Devices.Edge.Storage.RocksDb/ColumnFamilyStorageRocksDbWrapper.cs`

### Other components

- **IoT Hub**
- **Edge Device**

## Connections

- IoT Hub → Config Sources: provides desired config
- Config Sources → Agent Controller: supplies config
- Agent Service → Agent Controller: hosts
- Agent Controller → Deployment Planner: requests plan
- Deployment Planner → Plan Runner: produces plan
- Plan Runner → Runtime Commands: executes commands
- Runtime Commands → Docker Backend: dispatches runtime
- Runtime Commands → Kubernetes Backend: dispatches runtime
- Runtime Commands → Edgelet Backend: dispatches runtime
- Kubernetes Backend → Module Management API: manages modules
- Edgelet Backend → Module Management API: calls API
- Module Identities → IoT Hub: manages identities
- Agent Controller → Status Reporting: reports status
- Status Reporting → IoT Hub: sends status
- Edge Device → Device Protocols: connects using
- Device Protocols → Hub Service: enters hub
- Hub Service → Message Routing: dispatches messages
- Hub Service → Cloud Connectivity: uses connectivity
- Hub Service → Twin Synchronization: coordinates twin state
- Twin Synchronization → IoT Hub: syncs twin
- Twin Synchronization → Twin Store: reads and updates
- MQTT Session State → Entity Store: persists sessions
- Twin Store → RocksDB Store: stores records
- Entity Store → RocksDB Store: stores records
- Edgelet Daemon → Certificate Manager: manages certificates
- Edgelet Daemon → Module Management API: serves management
