What is the difference between the DEVICEID and DEVICEADDR? Are there any differences in terms of uniqueness/randomness/other characteristics? Do these values stay constant, or do they ever change?
What is the difference between the DEVICEID and DEVICEADDR? Are there any differences in terms of uniqueness/randomness/other characteristics? Do these values stay constant, or do they ever change?
Hi Himothy,
When accessed directly, the FICR DEVICEID and DEVICEADDR fields actually have very similar if not identical characteristics with regards to randomness/uniqueness.
First of all, the reason for their existence is that DEVICEID is intended as a generic "unique" (virtually) device identifier, while DEVICEADDR is used by the SoftDevice to derive its BLE address. For this address, the SoftDevice needs a 48-bit random number where the two most significant bits shall be "11" (specified by the BLE spec), which in practice means the BLE address is a random number with 46 actual bits of entropy.
Even though only 48 bits of the two 32 bit DEVICEADDR registers are used, I believe the registers are still populated with a full 64 bits in the exact same way as DEVICEID, and the "11" only gets added later. But I'm not 100% sure about this.
See this post for more details on DEVICEADDR --> BLE address:
RE: How to get 6 byte mac address at nrf51822
DEVICEID and DEVICEADDR are both randomly generated in a FIPS-compliant way during production.
Since they are randomly generated, they are not guaranteed to be unique - but the probability of ID collisions is so low that it can be considered unique in practice. The probability of two identical numbers being generated is microscopic, and the probability of any two devices having colliding IDs is still very small. (See: birthday problem).
As noted here and in the infocenter, FICR values are set by Nordic at the factory and cannot be changed afterwards, so these stay constant.
However, for anyone else reading, please note this doesn't mean that the BLE address is constant - the BLE address doesn't have to be based on DEVICEADDR, it may be reconfigured in software at any time.
For most of your "custom" use cases I would just use DEVICEID to avoid any confusion around DEVICEADDR. I don't see any benefit in using the latter.
The full field consists of two registers / 64 bits / 8 bytes, but you could use one register as a 32 bit random number if you like. It would only have 32 bits of entropy, but remain unbiased.
I hope this helps!
Best regards,
Raoul
Hi Himothy,
When accessed directly, the FICR DEVICEID and DEVICEADDR fields actually have very similar if not identical characteristics with regards to randomness/uniqueness.
First of all, the reason for their existence is that DEVICEID is intended as a generic "unique" (virtually) device identifier, while DEVICEADDR is used by the SoftDevice to derive its BLE address. For this address, the SoftDevice needs a 48-bit random number where the two most significant bits shall be "11" (specified by the BLE spec), which in practice means the BLE address is a random number with 46 actual bits of entropy.
Even though only 48 bits of the two 32 bit DEVICEADDR registers are used, I believe the registers are still populated with a full 64 bits in the exact same way as DEVICEID, and the "11" only gets added later. But I'm not 100% sure about this.
See this post for more details on DEVICEADDR --> BLE address:
RE: How to get 6 byte mac address at nrf51822
DEVICEID and DEVICEADDR are both randomly generated in a FIPS-compliant way during production.
Since they are randomly generated, they are not guaranteed to be unique - but the probability of ID collisions is so low that it can be considered unique in practice. The probability of two identical numbers being generated is microscopic, and the probability of any two devices having colliding IDs is still very small. (See: birthday problem).
As noted here and in the infocenter, FICR values are set by Nordic at the factory and cannot be changed afterwards, so these stay constant.
However, for anyone else reading, please note this doesn't mean that the BLE address is constant - the BLE address doesn't have to be based on DEVICEADDR, it may be reconfigured in software at any time.
For most of your "custom" use cases I would just use DEVICEID to avoid any confusion around DEVICEADDR. I don't see any benefit in using the latter.
The full field consists of two registers / 64 bits / 8 bytes, but you could use one register as a 32 bit random number if you like. It would only have 32 bits of entropy, but remain unbiased.
I hope this helps!
Best regards,
Raoul