--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/4219c8cc-294f-4e37-8f5d-319e548d3fdbn%40googlegroups.com.
On startup, my REEDs send a Multicast "logon" message which only my host application will answer to exchange IP addresses. From then on I only unicast messages.I am seeing strange things happen occasionally.eg sometimes my Border Router/RCP and my REEDs start up with IP addresses which are completely different inclining the MS 16 bits.
Also last night my RCP and REED were running as Leader on the same ALOC. Is this ok? It doesn't sound right to me. My BR could receive multi-cast addresses but my Linux host app on BR could not reply for some reason. I tried restarting my REED a few times and in the end I had to power cycle my RCP to "fix" it. I am not doing "Anycasting".REED> statestateleaderDone> ipaddrfdde:ad00:beef:0:0:ff:fe00:fc00fdde:ad00:beef:0:0:ff:fe00:e000fdde:ad00:beef:0:46ac:c08:1a1a:8da7fe80:0:0:0:ec79:5abd:91be:afcaDoneOTBR> stateleaderDone> ipaddrfdde:ad00:beef:0:0:ff:fe00:fc00fdde:ad00:beef:0:0:ff:fe00:2000fdde:ad00:beef:0:a1da:7199:3f61:b522fe80:0:0:0:1040:1067:8652:978cDone
My application is for installation in an industrial control application where it is extremely unlikely there will be other Thread devices. I thought setting each nodes Mesh local prefix to be the same might help with establishing reliable communications. Again your experienced advice valued.
In my application my REEDs only talks to my host app, they don't talk to each other application wise (except for routing of course). Is there any way (and would it be useful), to stop the REEDs becoming the Leader?
My concern is if a REED starts up first as the Leader, and then my Border-Router and my other REEDs connect to the network from the Leader REED, if that REED goes down, what will happen? ie:
- Will my REEDs already on the network continue to talk with the BR Host while there is no Leader
- Will new REEDs not be able to connect to the network until a new Leader is established?
- How long should it take for a new Leader to be established?
I have a similar application – which I would describe as 'otbr-dependent', or ‘cloud-dependent’. That is, I don’t really care if my REEDs form a network if they can’t reach the border router (and in most cases, the internet).
While I know that multiple leaders operating with the same operational dataset *should* work things out and merge their partitions, I prefer to avoid my REEDs powering up (resetting) and becoming leaders of their own networks, using whatever operational dataset they found stored in their openthread flash. Instead, I really want REEDs to 'connect' or 'reconnect' to the network using credentials they had acquired earlier (Joiner/Commissioning).
My biggest breakthrough came when I figured out the role activetimestamp plays in ‘Forming’ vs. ‘connecting’ (see below). I have also started exclusively using the ‘dataset’ commands to configure operating parameters. Finally, you really only need the masterkey to connect to an existing Thread network (see https://github.com/openthread/openthread/issues/4036).
The otbr is the only device I program to “Form” a network. On otbr, I explicitly specify all parameters in the operational dataset using a series of ‘sudo ot-ctl dataset …’ commands, starting with ‘dataset new’. Any parameters you don’t specify here get filled in with defaults and random values – I specify them all so I can bring up redundant border routers on the same network.
I DO NOT allow my REEDs to autostart at boot. Autostart retrieves the entire last operational dataset from openthread flash, sets it as active and enables Thread. To prevent this, in my REED initialization I set autostart_disable=true (Nordic SDK, may be different on your platform) during Thread initialization.
I also DO NOT allow my REEDs to Form their own networks. After (re)boot, my REEDs perform the following process to ‘connect’ using only the stored masterkey:
- pull ONLY the existing masterkey out of openthread flash using otThreadGetMasterKey()
- create a new empty operational dataset buffer (type otOperationalDataset)
- Copy the existing masterkey into the buffer (copy to dataset.mMasterKey.m8)
- Set only the dataset.mComponents.mIsMasterKeyPresent flag
- Commit the incomplete dataset using otDatasetSetActive()
- bring up the interface with otIp6SetEnabled()
- Start Thread using otThreadSetEnabled();
- At this point, the REED will scan until it finds a network that accepts is masterkey
You can simulate this process using CLI dataset commands, but you have to remember to use ‘> dataset clear’ to start with an empty buffer (vs. ‘dataset new’). I prefer to have REEDs learn everything except the masterkey from the network, but you can specify as many dataset parameters as you want (if you don’t want to scan or leave them to chance), except for ‘activetimestamp’. Any dataset with activetimestamp set will cause the REED to become leader of its own new network partition.
Best,Thanks for this Rob.
I will do some tests along these lines.
--
You received this message because you are subscribed to a topic in the Google Groups "openthread-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openthread-users/5stsXhSoKXk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/ad8029ea-79ac-4478-93c3-812c3ecd8f9dn%40googlegroups.com.
Yes, once connected, your REEDs possess all the information they need to assume the Leader role and have the *duty* to do so if they believe the initial leader (the OTBR) becomes inoperable. Over time, I believe it is inevitable that due to momentary communications losses, interference, etc., the leader role will move from your OTBR to one of your REEDs (and from REED to REED and even back to the OTBR). This doesn't particularly bother me (it is central to Thread's robustness, and I don't try to prevent it). My only concern with having a network operating only with the REEDs left behind (because OTBR left) was that they might have memory of network settings (operational dataset) that were no longer correct/desired, potentially leading to a network partition that can't be merged when the OTBR comes back. The rest of this message describes how I dealt with that concern. Are there other reasons that you don't want your REEDs becoming leaders?Timestamps:I haven't always been so careful in setting my mesh prefixes, and learned that in cases where there is an existing Thread network operating with *similar* settings (say, hypothetically, a slightly different prefix), the settings that “win” depend on who has the higher activetimestamp in their operational dataset:*Note: I'm not sure what the spec says about this case -- the behavior is probably related to the fact that the new node is using a mis-matched prefix and really doesn't have full network connectivity.
- CASE 1: If the new node has a lower timestamp, it works and the new node inherits the settings from the network leader.
- CASE 2: If these timestamps are the same value, the connection can fail -- the new node gets stuck as a child
- CASE 3: If the new node node has a higher activetimestamp, it will probably connect, but its operational dataset may not be correctly propagated through the network unless/until the new node becomes a leader*
As discussed previously, my REEDs don't form networks (they can only connect to an existing network). Upon connection, my REEDs inherit the activetimestamp of the network they just joined. If the OTBR goes away, this timestamp would remain the same indefinitely. I wanted to ensure that if my OTBR rebooted, it would always use a higher activetimestamp (preventing the same/lower cases above) in Forming a network, ensuring it can connect. To handle this, I have the OTBR use its unix timestamp when Forming a network. This ensures the new node always falls into CASE 3 above, and the OTBR will connect to the network even if some of its operational dataset (like the prefix) is mis-matched. At that point, we can't be 100 percent sure full connectivity has been restored, if for example it is using a different prefix. That's where the next step comes in. . .Forcing Dataset Propagation when OTBR is not the LeaderSince the OTBR has no way of seizing the Leader role, I needed another way of resolving any discrepancies in the operational dataset. This can be accomplished using Commissioner, by simply incrementing the timestamp. Just after the OTBR forms the network, I add the border router prefix (ot-ctl prefix add ..., then ot-clt netdata register), then wait 5 seconds before starting the process below:
- sudo ot-ctl commissioner start # petition then check state to confirm we became commissioner
- sudo ot-ctl dataset init active # Set copy the OTBR's exiting active dataset to the buffer
- set "$pendingTimestamp" and "$activeTimestamp" to the current unix time
- sudo ot-ctl dataset pendingtimestamp "$pendingTimestamp"
- sudo ot-ctl dataset activetimestamp "$activeTimestamp" # probably an unnecessary step
- sudo ot-ctl dataset delay 5000
- sudo ot-ctl dataset commit pending
- sleep 5
- sudo ot-ctl commissioner stop
--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/5cb1e4d5-3790-4b77-a8c3-60ab7ed3f05en%40googlegroups.com.