<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Doubt with IV Index and sequence number</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121422/doubt-with-iv-index-and-sequence-number</link><description>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.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 May 2025 11:50:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121422/doubt-with-iv-index-and-sequence-number" /><item><title>RE: Doubt with IV Index and sequence number</title><link>https://devzone.nordicsemi.com/thread/535107?ContentTypeID=1</link><pubDate>Tue, 13 May 2025 11:50:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77e759f4-bbd3-4cd6-8e86-d7d643110cd7</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]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?[/quote]
&lt;p&gt;The IV Update, where the network moves from one IV Index to the next, is a time consuming process of at least 96 + 96 hours to do the full cycle. If you replace the node early enough, when the IV Update is in progress, the replacement would automatically take part of the IV Update. This assuming that the IV Index of the replacement is the IV Index which the network is transitioning away from at the moment.&lt;/p&gt;
&lt;p&gt;If the IV Index of the replacement is lagging behind by less than 42, the replacement will automatically, when getting the secure beacon with the current IV Index, initiate the IV Recovery Procedure.&lt;/p&gt;
&lt;p&gt;Thus, IV Index should not be an issue, provided that you backup the IV Index at least once every 336 days or so, which is the maximum rate at which an IV Index can fall out of the 42 wide interval range for allowing IV Recovery.&lt;/p&gt;
&lt;p&gt;If the IV Index is more than 42 behind the current one, IV Recovery is not possible (by spec) and the node must be reprovisioned into the network (appearing as a new device.)&lt;/p&gt;
[quote user=""]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?[/quote]
&lt;p&gt;This will already happen if lagging behind by 42 or less in IV Index.&lt;/p&gt;
&lt;p&gt;Please note that the mechanisms regarding IV Index, which I have described above, are first and foremost for the scenario of a node being turned off or otherwise removed from the network, for a prolonged period of time. While the IV Index mechanisms might make it easier to replace a node the way you draft in your question, there is still the issue of sequence number, which is not easily read out from the node.&lt;/p&gt;
[quote user=""]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)?[/quote]
&lt;p&gt;The best practice for this would be not to replace the node (including address and sequence number), but rather to provision the replacement master device into the network as a new node (with new unicast addresses.)&lt;/p&gt;
&lt;p&gt;Bluetooth mesh is made with this in mind: Instead of addressing messages to unicast addresses directly, it is encouraged to use group addresses (or for some use cases virtual addresses). The way it works, is that the node sending messages publish to a group (or virtual) address, and the node or nodes receiving messages subscribe to that same group (or virtual) address. Thus, in order to replace one node in the network, you only have to provision the new node into the network and set up the publications and/or subscriptions on that node, so that it inherits all roles and functionality of the old node.&lt;/p&gt;
&lt;p&gt;In your example with a &amp;quot;master node&amp;quot;, the preferred way to solve that would be to reserve a group address for the master node, and when installing the master node (or replacing it) to configure the models of the master node to subscribe to that group address. Then all other nodes can publish messages to the master node regardless of it being original or replacement, using the designated group address, without reconfiguration of any remaining node in the network.&lt;/p&gt;
[quote user=""]What practices do you recommend to ensure network continuity in case of master node failure, especially regarding IV Index, sequence number and node synchronization?[/quote]
&lt;p&gt;If the master node acts as provisioner and/or configurator, then I would make sure to backup the configuration database from that device, or keep the configuration database (or information therein) at a backup location. This would be information about some or all other nodes on the network, such as the Device Keys for configuring them, their unicast addresses, and so on. For instance, nRF Mesh for iOS/Android has functionality for exporting and importing the configuration database, so that one smartphone can seamlessly take over for a different smartphone by copying the configuration database over from the former to the new smartphone.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>