can a random address conflict with other devices?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
maze_1672671
Level 4
Level 4
First like received 25 replies posted 25 sign-ins

Hello all,

I am using:

CYBLE_GAP_BD_ADDR_T ic = {

     .type = 1

} ;

if ( CYBLE_ERROR_OK !=

     CyBle_GapGenerateDeviceAddress(&ic,

                                    CYBLE_GAP_RANDOM_STATIC_ADDR,

                                    NULL) ) {

     DBG_ERR ;

}

to generate a random static address.

Can this address be equal to the address of another device in the neighborhood?

As an example, can I get a public address like  B4:B8:59:XX:XX:XX?

What about other devices generating random addresses?

0 Likes
1 Solution

Hello,

For a static address, 46 bits are the random part and two MSB bits are set to 1. The combination will be (2^46)-2 random values, so devices won't have the same address.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
6 Replies
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

There are two types of Random Device Addresses: Static Address and Private Address. The Static Address is a 48-bit randomly generated address with the two most significant bits of the 48-bit address set to 1. Public Device Addresses do not change over time. Static Addresses can change only when the device is power-cycled. Private Addresses changes at regular intervals to ensure that the BLE device cannot be tracked. Please refer to the section 7.2.1 Bluetooth address types in the datasheet for more information.

In the BLE Component, you can set the public address as B4:B8:59:XX:XX:XX. The last three bytes are Silicon generated “Company assigned” part of device address. When checked, the “Company assigned” part of the device address is generated using the factory programmed die X/Y location, wafer ID and lot ID of the silicon.

In STACK ON event we have used following sequence of APIs to generate random address.

        cyBle_discoveryParam.ownAddrType = CYBLE_GAP_ADDR_TYPE_RANDOM;
        CYBLE_GAP_BD_ADDR_T myaddress;    
        myaddress.type=0x01;
        CyBle_SetSeedForRandomGenerator(seed);
        CyBle_GapGenerateDeviceAddress(&myaddress, CYBLE_GAP_RANDOM_STATIC_ADDR, NULL);
        CyBle_GapSetIdAddress(&myaddress);
        CyBle_SetDeviceAddress(&myaddress);

What about other devices generating random addresses?
Ans: Could you please elaborate more on this ? Which devices you are talking about? Please refer to the BLE spec document for more information on the Random address generation(BLE Devices will follow the spec).

Thanks,
P Yugandhar.

0 Likes

Hello Yugandhar,

I am following all the steps, but I am not a bt expert, so I need some clarification.

"the two most significant bits of the 48-bit address set to 1": are these two bits used to signal the address type? It seems false because B4:B8:59 is the identifier of my employer, but Cypress defaults to 00:A0:50: the first two bits are different: can we say that the probability of a conflict is 2^-46?

"Private Addresses changes at regular intervals": what happens if two devices choose the same address?

Best regards

Massimo

0 Likes

does anyone know the answer?

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

1. The Public Device Addresses are comprised of a 24-bit company ID (an Organizationally Unique Identifier or OUI based on the IEEE 802-2001 standard) and a 24-bit company-assigned number (unique for each device) as shown in below attached image.


2. The Random device address may be of either of the following two sub-types:
  • Static address • Private address.

3. Static Device Address is a 48-bit randomly generated address and shall meet the following requirements:
  • The two most significant bits of the address shall be equal to 1
  • All bits of the random part of the address shall not be equal to 1
  • All bits of the random part of the address shall not be equal to 0 as shown in below attached image.
A device may choose to initialize its static address to a new value after each power cycle. A device shall not change its static address value once initialized until the device is power cycled.
Note: If the static address of a device is changed, then the address stored in peer devices will not be valid and the ability to reconnect using the old address will be lost.


4. Private Device Address may be of either Non-resolvable private address or Resolvable private address. Resolvable Private Addresses (RPA) can be changed at regular intervals, can be resolved and are used by Privacy enabled devices. A Non-Resolvable Private Address changes on every reconnection. Non-Resolvable Private Address cannot be resolved by the peer device and must be shared with the peer device during the preceding connection.
Please refer to the Vol 6, Part B, section 1.3 Device Address in BLE Spec 4.2 for more information. Also, please refer to the section 7.2 Privacy Concepts for more information on private address generation and resolution.

Please let me know if you have any questions I'm glad to help.

Thanks,
P Yugandhar.

Thank you Yugandhar

My question is: what happens if two devices (in range) choses the same address?

0 Likes

Hello,

For a static address, 46 bits are the random part and two MSB bits are set to 1. The combination will be (2^46)-2 random values, so devices won't have the same address.

Thanks,
P Yugandhar.

0 Likes