Create a network

You are here:
Estimated reading time: 3 min

First of all, to start a Thread network it is necessary to configure a node as Leader which creates the network partition and establish the credentials. Then other nodes could become part of this network if they are successfully authenticated with the same network credentials.

KTWM102 modules have three ways of setting up a Thread Leader and a Thread network respectively:

  • Advanced: This mode obligates the user to set up all required settings manually. It is also called Out-of-band network configuration. So configuration of PAN ID, channel, network name, mesh local prefix, master key, extended PAN ID and commissioning credential are compulsory to set up a Thread network in this mode.
  • Basic (recommended): There are three useful settings: PAN ID, channel and network name, which could be configured by the user and make a network easily identifiable. These are not compulsory so the user can choose which one to configure. If some of them are not configured they will be automatically selected/randomized at the network start up.
  • Minimal: Configure the role only. If there are no requirements about the network settings this is the easiest way to set up a Thread network (also a Leader). All the network settings will be automatically selected/randomized at the start up. As cons, in this way network settings are unknown for the user so a show/read would be needed to know them.
Role is the only compulsory setting to start a node with the desired behavior in the network. If it is not set an error will be returned on the interface up (ifup) command execution.

To start a simple Thread network using the basic mode set the role as Leader and optionally set channel.

It is useful to activate all the debugging levels and modules of logs to observe the running processes that the node is performing. Type next commands in the terminal for all logs enabling:

kinos@local:~$ debug module all
kinos@local:~$ debug level all

 

Channel configuration

To top

Channel is an optional setting. If it is not specified the device performs an energy scan to pick a quiet channel.

kinos@local:~$ config channel 14

The other non specified network settings will be automatically generated on start-up.

 

Role configuration

To top

Only one Leader could exist in a network and it is the one which creates the network.

kinos@local:~$ config role leader

 

Thread interface up

To top

When network settings are configured Thread interface could be started-up.

kinos@local:~$ ifup
kinos@local:~$
#1422 inf: sys thread – set channel 14
#1424 inf: radio active scan ch=14 – network not found
#1424 inf: sys thread – set pan id b293
#1424 inf: sys kinos – user configuration stored
#1427 inf: sys thread – starting partition
#1427 inf: sys thread – set rloc16 0000
#1427 inf: sys thread – new direct route to 0
#1427 inf: sys thread – active leader
#1427 inf: sys kinos – active data set stored

If logs are enabled, active leader means the Leader is running and the Thread network is created and operating.

To know when the ifup process has finished it is recommended to execute show status command repeatedly until one among joined or none responses are replied.

kinos@local:~$ show status
joined

 

Network configuration

To top

If desired it is possible to show the current network configuration to check the automatically selected/randomized settings.

kinos@local:~$ show netconfig
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| MAC Layer Configuration                                    |
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| PAN ID           : 0x64b5
| Short Address    : 0x0000
| Extended Address : ea-81-14-fd-90-49-9c-45
| EUI-64 Address   : 84-04-d2-00-00-00-04-1a
| Role             : leader
| Running mode     : thread
| MAC security     : on
| Channel          : 14
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| Status                                                     |
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| Thread interface : up
| Auto joining     : off
| Node status      : joined
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| IPv6 Addresses                                             |
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| fe80::e881:14fd:9049:9c45
| fdea:acb4:f3e4:0:c19a:a320:3dd6:d5b4
| fdea:acb4:f3e4::ff:fe00:0
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| Thread Configuration                                       |
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+
| Active Timestamp : 0x0000000000010000
| Network Name     : kite_f380
| Extended PAN ID  : 0xca6b88699ed9061d
| PSKc             : 0xf49d21099b24367d1bee5f21e91a1e97
| Master Key       : 0xad28efdc7b30658c836457e247fa733c
| Mesh-Local ULA   : fdea:acb4:f3e4::/64
| Node Mesh IID    : c19a:a320:3dd6:d5b4
+––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––+

Now other nodes could be configured with this information to join the network.