BT Mesh proxy node and sequence number questions

Greetings,

I've been trying to implement a cloud-based solution for Bluetooth Mesh. I've got two questions that I would like to receive some comments on and I would be grateful for any assistance.

1. Am I correct to understand that you can have as many proxy connections as there are nodes in the network? To rephrase, is it possible to have two or more smartphones connect to a single Mesh node over BT Mesh proxy functionality?

2. How should I deal with sequence numbers when having two smartphones connect over BT Mesh to a single node in sequence?

The problem I run into is as follows:

Say, I have two smartphones on an App with user account system that is able to save BT Mesh networks in the cloud using Nordic's Bluetooth Mesh library for Android. User retrieves the BT Mesh network data upon logging in. The following steps would be done on a single user account.

  1. On phone 1, I connect to a proxy node within the network and send/receive some Mesh packets to increase the sequence number.
  2. I stop using phone 1 at all, closing the app, BT connections and updating the Mesh network in the cloud.
  3. On phone 2, I sign on with the same user account, retrieving the previous Mesh data, connect to the same proxy node and attempt to send/receive Mesh packets.

In step 3, I would be unable to send/receive Mesh packets successfully due to invalid sequence number. The "export mesh network" functionality inside Nordic's Bluetooth Mesh library for Android does not save the sequence numbers that devices expect to receive.

Can you suggest me a way of going around this, so that phone 2 would be able to talk with the proxy node?

Would it be feasible to somehow reset the sequence number to zero upon a new connection to a proxy node?

Or maybe I should store the phone 1's sequence number in the cloud and have phone 2 retrieve it?

Thank you for reading and any replies.

  • Hi,

    1. Am I correct to understand that you can have as many proxy connections as there are nodes in the network? To rephrase, is it possible to have two or more smartphones connect to a single Mesh node over BT Mesh proxy functionality?

    A GATT Proxy node allows for one or more connections to GATT Central devices (such as e.g. smartphones.) A GATT Central device connected to a GATT Proxy node will participate on the Bluetooth Mesh network as any other node. All packets to and from the GATT Central gets sent over the GATT connection and bridged to the Bluetooth Mesh network.

    2. How should I deal with sequence numbers when having two smartphones connect over BT Mesh to a single node in sequence?

    Sequence numbers belong to the device, and must be strictly increasing. If a message is sent with a lower sequence number, then other devices will discard the message. (They assume it is a replay attempt.)

    If you have multiple smartphones connected to the network, then you should typically register those devices as separate nodes on the network. This should avoid any sequence number related issues. It would also prevent issues arising from having two smartphones concurrently interacting with the network, e.g. if both phones are switched on and connected to the network and sending messages in the same period of time.

    Can you suggest me a way of going around this, so that phone 2 would be able to talk with the proxy node?

    Use separate unicast addresses for the various phones.

    Would it be feasible to somehow reset the sequence number to zero upon a new connection to a proxy node?

    No. Starting from zero would make the situation even worse, if the device had already reached a higher sequence number. All sequence numbers are reset to zero after an IV Update, though, so performing IV Update could solve the situation. Please note however that IV Updates can only be performed every 192 hours, which corresponds to 8 days.

    Or maybe I should store the phone 1's sequence number in the cloud and have phone 2 retrieve it?

    This could also be a way to do it, but please note for it to work you must also make sure that the two phones are not connecting to the network at the same time. This would most likely put restrictions on the system, such as e.g. requiring contact with the cloud for the full duration of time interacting with the network. Asserting mutual exclusion between devices sharing the same user account, and at the same time handling situations where a phone is lost or gets broken while being granted access to the network, is not a trivial problem.

    Regards,
    Terje

  • Thank you for the reply.

    Very much appreciated.

Related