Howdy all,
I have noticed that there are some limitations regarding the replay cache in BLE mesh devices.
Environment:
1. nrf52840
2. MESH_SDK V5.00
I have developed a PC application with a GUI interface which enables us to interact with Mesh devices. We have a USB device which is based on the NRF52840 and contains roughly 17 client models. The PC application together with this device can perform gang provisioning and configuration as well. What I have noticed is that the device stops receiving responses once I get to device number 40. After doing some digging, I found that the replay cache is full and therefore messages never make it to the access layer.
Also, if I provision a device with say unicast address 0x0020, then unprovision that device and reprovision it with the exact same unicast address, the previous data for that unicast address is still in the replay cache of the provisioner. Now I have to send a certain message a few times and wait for a response, eventually the sequence number of the message is higher than the one stored in the replay cache, and the message is processed..
I have been through the devzone, and some suggestions were to simply just clear the replay cache, but that poses a security risk. Also, we are currently on like 99% of RAM usage, so simply just increasing the number of maximum cache message (REPLAY_CACHE_ENTRIES) is not that simple. I mean I could just do a memory optimization on the firmware and increase that number, but it won't resolve the issue mentioned regarding the provisioner...
Perhaps the solution for the provisioner is never to reuse a previous unicast address? (I understand you cannot have duplicate addresses, that is not the case here... I am talking about one device on a network being provisioned, reset, and reprovisioned with the same unicast address).
Please can you advise on:
1. Is the proper solution to simply do a memory optimization and ramp the size of the replay cache up to the maximum number the memory allows for (REPLAY_CACHE_ENTRIES)? This will not solve the provisioner issue I am experiencing though... But we will be able to communicate with more devices...
2. In terms of good practice, should I maybe prevent the provisioner from using previously used unicast addresses, even if there is no node on the network using that unicast? This does not make sense to me at all and feels a bit "hacky"...
I am not sure what the answer is here, if you were to simply clear that replay cache then your device will not be mesh compliant and will pose a security risk.
Regards
Chris