Get the SDK

Architecture/Self-provisioning

Architecture

Self-provisioning

The sequence through which a node configures its transport, discovers a network, and acquires its SID, DIN, and first mapping.

Self-provisioning coordinates local configuration, discovery, join, core startup, persistence, and recovery until a DaaS-IoT node becomes operational.

PhaseResponsibility
Local configurationPrepare drivers, endpoints, policies, and persisted configuration.
Core executionActivate the doPerform() loop required by the SDK.
DiscoveryLocate a segment and its ingress node.
JoinAcquire or confirm SID and DIN, synchronize time, and create the first mapping.
PersistenceSave the resulting configuration for a subsequent restart.
RecoveryValidate 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_SETUP
CORE_RUNNING
SEARCHING
NETWORK_FOUND
JOINING
ATTACHED_AND_OPERATIONAL

Each transition requires the expected evidence:

A timeout or error preserves the latest confirmed state and allows another attempt.

Local configuration

Before searching, the node prepares its local state:

  1. load a persisted configuration, if available;
  2. configure at least one driver with its local endpoint;
  3. set the discovery mode;
  4. set the acceptance policies;
  5. 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:

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:

  1. select the ingress node;
  2. temporarily bind negotiation to the selected host;
  3. perform dATS synchronization;
  4. receive the parameters through _NET_PARAM_RQ;
  5. determine the effective SID/DIN pair;
  6. respond with _NET_PARAM_RS;
  7. complete the mapping at the ingress node;
  8. 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:

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:

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:

loadconfiguration
validate usabledrivers and mappings
network reachableresume operation
otherwisediscovery and a new join
A saved configuration is a candidate, not a guarantee.

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

ConditionOutcome
No driversDiscovery has no usable transport.
discovery_offdiscovery() returns ERROR_DISCOVERY_DISABLED.
No networksThe node remains in its initial state.
Join timeoutTemporary SID and DIN values are discarded.
Network changePrevious communications and mappings may become invalid.
Stale persisted configurationThe node must repeat discovery and join.

Watch a node provision itself into a segment.

Open the Lab Simulator