The left half of the state machine drawing corresponds to the status of the network layer. The Silicon Labs Thread Stack drives this
state machine, and the border-router management application has no direct control over it. Instead, the border router application can
indirectly influence the network state by calling various stack functions. These stack functions that influence the network state are
shown above the arrows drawn from the border-router state machine to the network state diagram.
Note that the network state diagram is incomplete and only shows states of interest to the border-router application.
The right half of the figure describes the state of the border-router management application. Each state is briefly described here:
RESET_NETWORK_STATE: Calls stack function emberResetNetworkState. This clears network information from the NCP and im-
mediately drops the border router from whatever network it was previously attached to.
User CLI command network-management reset is a method provided to users to achieve the same effect as going to the RE-
SET_NETWORK_STATE. It is essentially equivalent to calling stack function emberResetNetworkState.
RESUME_NETWORK: The border router always transitions to this state if the stack transitions to the EMBER_SAVED_NETWORK
state. It calls the stack function emberResumeNetworkState, which causes the stack to attempt to re-join a previously-known network.
This is usually what will happen if the border-router is rebooted during the UP_STATE.
FORM_NETWORK: The border router always transitions to this state if the stack transitions to the EMBER_NO_NETWORK state. De-
pending on the value of AUTO_FORM_NETWORK, the border router either attempts to form a network using default settings or to form
a network using manual settings. AUTO_FORM_NETWORK may be set in two ways:
1. In the /etc/siliconlabs/border-router.conf file.
2. Via the CLI commands set-auto-form-off and set-auto-form-on.
If AUTO_FORM_NETWORK = 1, then default settings are used. emberFormNetwork is called, which generates a random Network
Master Key
If AUTO_FORM_NETWORK = 0, then manual settings are used. The border-router will wait in the FORM_NETWORK state until
the user provides the network settings on the CLI by using the network-management commission command.
JOIN_NETWORK_COMPLETION: This state only applies to manual network formation. It is reached once the user enters appropriate
data using the network-management commission command, and tells the stack to use that data to join the network.
GET_COMMISSIONER: This state is always reached when the stack transitions to EMBER_JOINED_NETWORK_ATTACHED. The
transition to that network state means that the border router can communicate as a member of a Thread network, but has not yet con-
figured other settings appropriate for a border router. This state sets the commissioner pre-shared key.
CONFIGURE_BORDER_ROUTER: This state is reached upon successful completion of emberGetCommissioner. It informs the stack
of some of the services available, such as routing, DNS (domain name system) and SLAAC (stateless autoconfiguration) using a call to
emberConfigureGateway.
INITIALIZE_BORDER_ROTUER: Reached upon a successful call to emberConfigureGateway. It does some final configuration and
sets up DNS.
UP_STATE: The border-router should remain in this state as long as it is on a stable network and the user takes no action otherwise. A
heartbeat is issued periodically as long as we remain in this state.
3.2 Network Formation
To form a new network means to erase the network settings, such as the Network Master Key and Extended PAN ID, and generate
new ones. A border router will no longer be able to communicate with its old network after it forms a new one. The Silicon Labs Border
Router Add-On Kit provides two methods for network formation: Network formation with default settings, and network formation with
manual settings. Using default settings is the most secure because a random Network Master Key will be generated. Once generated,
the Silicon Labs Thread Stack does not provide any mechanism for retrieving the key. Even when new devices join, the Network Master
Key is shared with them over a secure DTLS connection and cannot be intercepted by a third party.
The state of AUTO_FORM_NETWORK determines whether default or manual settings are used to derive a new network:
set-auto-form-on means to use default network settings, including a randomly-generated Network Master Key
set-auto-form-off means to use manual network settings, including a manually-entered Network Master Key
The sections below describe how to set this variable from the CLI.
UG116: Developing Custom Border Router Applications
Operation
silabs.com | Building a more connected world. Rev. 0.3 | 6