BLE Random Static Address as the BD_ADDR - clarification on MSB bits please

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

cross mob
colin_f
Level 1
Level 1
5 sign-ins First solution authored First reply posted

Hi, I would appreciate some clarification about using BLE Random Static Address as the BD_ADDR.

I understand that the 2 most significant bits of the 48 bit MAC address must be set to 1 (as described in [1] and [2]) to identify the address as a Random Static Address.

Having read around various posts and found the bit in the Bluetooth spec (described in Volume 6 Part B of the Bluetooth 4.0 specification (Section 1.3)), I am still confused as different sources seem to flip the order of bits as to which is LSB and MSB bits so I can't figure out what is correct for a MAC address as normally viewed.

So, for a given MAC address as reported by CySmart as Ax-xx-xx-xx-xx-xB (and most other tools), would byte A need to be 11xxxxxx or would byte B need to be xxxxxx11 or something else?

Also, are these 2 bits different to the U/L and I/G bit of the standard EUI-48 (MAC-48) address described on the wikipedia MAC address page here [3].

I appreciate this is probably a real noob question but I can't find anything anywhere that actually gives examples that are clear (for me at least) on this.

Any clarifications much appreciated.

thanks, Colin

MCU: PSoC4 - CYBLE-014008-00

[1]: https://www.novelbits.io/bluetooth-address-privacy-ble/
[2]: https://community.cypress.com/t5/Resource-Library/BD-ADDR-how-do-you-get-one/ta-p/246800
[3]: https://en.wikipedia.org/wiki/MAC_address

0 Likes
1 Solution
colin_f
Level 1
Level 1
5 sign-ins First solution authored First reply posted

After further study I think I have understood.  For a BLE device address displayed as Zx-xx-xx-xx-xx-xY, then the Static Random Address bits are set in the MS 2 bits of the MS byte.  So Z is the MS Byte, so setting the 2 MS bits to one would result in a bit pattern of 11xxxxxx (0xC).  

I believe I read that in lower layers of the BLE network stack the address is transmitted in Little Endian format, so in some articles the MSByte and LSByte are swapped so the LSByte leads.

The Cypress post does in fact answer my question about wifi MAC addresses and BLE devices (MAC) addresses.

Now let’s talk about the similarity and differences between the BD_ADDR and the WIFI MAC address. At a first level approximation – both are identical. The upper 24 bits are the OUI, and the lower 24-bits are a unique number that is assigned by the manufacturer for that device. However the WIFI MAC address does have a couple of bits in the OUI that can be different. Bit 0 of the MSB is used to indicate whether the address is a unicast address or a multicast address. And Bit 1 of the MSB is used to indicate whether the address is globally unique (OUI enforced) or locally administered. But for all practical purposes a globally unique unicast WIFI MAC address can be used as a BD_ADDR and vice-versa.

The globally unique unicast WIFI MAC address is key here I think.  If it is globally unique and unicast then the MAC address U/L and I/G bits are the same as they would be for a Public BLE device address.

In my case I need a Static Random Address for my BLE device so it is NOT equivalent to a Wifi MAC Address.

C.

View solution in original post

0 Likes
2 Replies
colin_f
Level 1
Level 1
5 sign-ins First solution authored First reply posted

After further study I think I have understood.  For a BLE device address displayed as Zx-xx-xx-xx-xx-xY, then the Static Random Address bits are set in the MS 2 bits of the MS byte.  So Z is the MS Byte, so setting the 2 MS bits to one would result in a bit pattern of 11xxxxxx (0xC).  

I believe I read that in lower layers of the BLE network stack the address is transmitted in Little Endian format, so in some articles the MSByte and LSByte are swapped so the LSByte leads.

The Cypress post does in fact answer my question about wifi MAC addresses and BLE devices (MAC) addresses.

Now let’s talk about the similarity and differences between the BD_ADDR and the WIFI MAC address. At a first level approximation – both are identical. The upper 24 bits are the OUI, and the lower 24-bits are a unique number that is assigned by the manufacturer for that device. However the WIFI MAC address does have a couple of bits in the OUI that can be different. Bit 0 of the MSB is used to indicate whether the address is a unicast address or a multicast address. And Bit 1 of the MSB is used to indicate whether the address is globally unique (OUI enforced) or locally administered. But for all practical purposes a globally unique unicast WIFI MAC address can be used as a BD_ADDR and vice-versa.

The globally unique unicast WIFI MAC address is key here I think.  If it is globally unique and unicast then the MAC address U/L and I/G bits are the same as they would be for a Public BLE device address.

In my case I need a Static Random Address for my BLE device so it is NOT equivalent to a Wifi MAC Address.

C.

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

Hello,

Yes, Static Random Address for the BLE device is NOT equivalent to a Wifi MAC Address. BLE Static random Address is a 48-bit randomly generated address with the two most significant bits of the 48-bit address set to 1. The remaining 46 bits are chosen randomly.

Yugandhar_0-1633949632936.png

 

Thanks,
P Yugandhar.

0 Likes