Doubt with IV Index and sequence number

Hello,

I am working with a Bluetooth Mesh network where a master node (antenna) is in charge of setting up and managing the network of nodes. This master node also deploys a web server and an embedded system that allows to send commands to the nodes.

My goal is to be able to replace the master node in case of failure, connecting another one with the same key and performing exactly the same function, keeping the network intact and operational. That is, if the master node fails, I can replace it without losing the network or its functionality, and the new node that I incorporate will take the place of the previous one, as if nothing had happened.

The problem I encounter is related to the IV index and the sequence number. I understand that each message in the Bluetooth Mesh network includes an IV Index and a sequence number, which act as a counter to ensure security and avoid repeated messages. If the master node fails and I have no way of knowing the IV Index of the network and the sequence number that this master node was going by, when I connect a new master node that will have to be connected to the network. 
If the master node fails and I have no way of knowing the IV index of the network and the sequence number by which this master node was going, when connecting a new master node to replace it, it would need the IV index to be the same of the network and the sequence number to be at least greater than the last one handled by the previous master node. Otherwise, messages sent from this new node will not be accepted by the existing nodes in the network, as they expect a different IV Index and/or a sequence number higher than the last one used by the previous master node.

One option I had explored was to persist these two values in the master node. But the fact of being able to replace the antenna I want to do it in case the node breaks down (the micro). That is, I want to be able to replace it in case at some point, the node stops offering the slightest functionality. Therefore, persisting this data in the node itself, is not a valid option in this case.

I have investigated and understand that:

When a node joins an existing network, it must synchronize its IV Index with that of the network in order to communicate properly.

If a node has an outdated IV Index, it can listen to Secure Network Beacons containing the current IV Index and perform a recovery procedure to update its value.

Given this, my questions are:

Is the way to retrieve the current IV Index from the network to be able to manually configure it on a new master node in case of replacement, is it through the Secure Network Beacons? How could it be done?

Is it possible to force the new master node to listen to the Secure Network Beacons and update its IV Index automatically to the current network value?

How could it handle the sequence number so that it could replace the master node and have its messages listened to by all other nodes (i.e., load a valid sequence number)?

What practices do you recommend to ensure network continuity in case of master node failure, especially regarding IV Index, sequence number and node synchronization?

I thank you in advance for your help and guidance on this subject.

Best regards.

Related