Self-provisioning coordinates local configuration, discovery, join, core startup, persistence, and recovery until a DaaS-IoT node becomes operational.
| Phase | Responsibility |
|---|---|
| Local configuration | Prepare drivers, endpoints, policies, and persisted configuration. |
| Core execution | Activate the doPerform() loop required by the SDK. |
| Discovery | Locate a segment and its ingress node. |
| Join | Acquire or confirm SID and DIN, synchronize time, and create the first mapping. |
| Persistence | Save the resulting configuration for a subsequent restart. |
| Recovery | Validate the saved configuration or repeat discovery and join. |
The flow uses discovery to locate the network and continues with join and node activation.
Process states
LOCAL_SETUPCORE_RUNNINGSEARCHINGNETWORK_FOUNDJOININGATTACHED_AND_OPERATIONAL Each transition requires the expected evidence:
NETWORK_FOUND:networkDiscovered(host_din, sid, link)event;ATTACHED_AND_OPERATIONAL:nodeConnectedToNetwork(sid, din)event with the core already running;CORE_RUNNING:doPerform()active according to the execution mode selected by the SDK.
Local configuration
Before searching, the node prepares its local state:
- load a persisted configuration, if available;
- configure at least one driver with its local endpoint;
- set the discovery mode;
- set the acceptance policies;
- register the event handler required by the SDK.
The configuration may already contain SID, DIN, and mappings. Recovery uses these values as candidates and validates network and endpoint reachability before reusing them.
With SID and DIN initialized to zero, discovery and join assign the identity required for DaaS communication.
Network search
The node searches for a network through its active drivers:
discovery() -> all available links discovery(link) -> a specific link type discovery(sid) -> a specific segment
Each result provides three operational pieces of information:
- the ingress-node DIN;
- the SID of the exposed segment;
- the link through which it was detected.
When multiple results are available, the application selects a candidate using the desired SID and the link type specified by the configuration.
Join and parameter acquisition
After selecting a network, the node calls:
join(sid, link, timeout)
join() is blocking. If sid = 0, it attempts to use the first discovered network. If the node already belongs to a network, it first leaves the current one.
During the join, the protocol performs the following sequence:
- select the ingress node;
- temporarily bind negotiation to the selected host;
- perform dATS synchronization;
- receive the parameters through
_NET_PARAM_RQ; - determine the effective SID/DIN pair;
- respond with
_NET_PARAM_RS; - complete the mapping at the ingress node;
- emit
nodeConnectedToNetwork(sid, din).
The final event provides the current identity. The application retains SID and DIN as opaque 64-bit identifiers.
Creating and exposing a network
A node configured as discovery_receiver_only can expose its network; with discovery_full, it can both search and respond. Before accepting new participants, it must have valid SID and DIN values.
The responding node provides the ingress point to the segment. After the join, mappings and routing extend connectivity through other nodes and transports.
A typical configuration assigns:
discovery_sender_onlyto endpoints intended to join a network;discovery_receiver_onlyto stable gateways or hosts;discovery_fullto nodes authorized to perform both roles.
Core execution and initial mapping
The doPerform() loop must be active while the node handles discovery, events, and synchronization. It must run according to the SDK model:
- once in
PERFORM_CORE_THREAD; - cyclically in
PERFORM_CORE_NO_THREAD.
At the end of the join, the node knows its identity and the adjacency to the ingress node. The rest of the topology is learned progressively.
Mappings, locate(), and multi-hop routing subsequently add other peers and their paths to the local view.
The active processing loop handles traffic, events, and synchronization.
Policies during bootstrap
During discovery, libdaas receives messages from DINs whose mappings are still being established, temporarily applies trust_all, and restores the previous policy on completion or timeout.
This opening is limited to the discovery procedure. After the join, the configured rules for mapped nodes, same-SID nodes, routed traffic, and unknown origins become effective again.
Persistence and recovery
storeConfiguration() saves state through an IDepot implementation; loadConfiguration() restores it. The loaded configuration must still be validated against the current network.
On restart, the flow is:
A network change may alter SID, DIN, and the first mapping. After every successful join, the persisted configuration must be updated using the values returned by nodeConnectedToNetwork.
Failure conditions
| Condition | Outcome |
|---|---|
| No drivers | Discovery has no usable transport. |
discovery_off | discovery() returns ERROR_DISCOVERY_DISABLED. |
| No networks | The node remains in its initial state. |
| Join timeout | Temporary SID and DIN values are discarded. |
| Network change | Previous communications and mappings may become invalid. |
| Stale persisted configuration | The node must repeat discovery and join. |