This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why does fixed group address "all-nodes" not route on BLE Mesh?

From looking at the code when a message is posted to "all-nodes" fixed group address of 0xFFFF it does not route.  I was unable to find this behavior specified anywhere in any BLE Mesh Specs so I would like to understand why it works this way?

It seems that if I send to "all-nodes" it would route to all nodes.  Perhaps the same as "all-routers".  But the current code groups those together as a local match and does not route them within the Mesh.

If someone could point out where this is documented that would be helpful. This refers to the implementation in the NCS.

Thanks

Parents
  • Hi,

    The all-nodes group address is used to address messages to the primary element of all nodes. The only exceptions regarding when the all-nodes address can be used, has to do with the configuration model. In any case the packets should get relayed just as any other packets using any group address.

    In order for me to investigate further:

    • Where in the NCS code did you find packets addressed to all-nodes not to be handled correctly?
    • Have you reproduced this behavior, to confirm that is what happens, and if so what was your setup?

    Regards,
    Terje

Reply
  • Hi,

    The all-nodes group address is used to address messages to the primary element of all nodes. The only exceptions regarding when the all-nodes address can be used, has to do with the configuration model. In any case the packets should get relayed just as any other packets using any group address.

    In order for me to investigate further:

    • Where in the NCS code did you find packets addressed to all-nodes not to be handled correctly?
    • Have you reproduced this behavior, to confirm that is what happens, and if so what was your setup?

    Regards,
    Terje

Children
  • Originally I setup publishing to address 0xFFFF, but it was not routing.  I have reconfigured to send to unicast 0x0001 which is base node and it routes as expected.  So I have verified that it does not route as I would have expected.

    As to the code:

    In net.c:835 is this code:

    	/* Relay if this was a group/virtual address, or if the destination
    	 * was neither a local element nor an LPN we're Friends for.
    	 */
    	if (!BT_MESH_ADDR_IS_UNICAST(rx.ctx.recv_dst) ||
    	    (!rx.local_match && !rx.friend_match)) {
    		net_buf_simple_restore(&buf, &state);
    		bt_mesh_net_relay(&buf, &rx);
    	}

    The issue appears to be on rx.local_match, which is determined at line 807

    	rx.local_match = (bt_mesh_fixed_group_match(rx.ctx.recv_dst) ||
    			  bt_mesh_elem_find(rx.ctx.recv_dst));
    

    So the local match seems correct in that the all-nodes address should be included.  However using the local_match in the logic for relay, causes the all-node and any other applicable fixed group address to not route. local_match should be replaced with different logic that takes into account if the fixed group address should continue to route such as "all-node" and "all-routers", etc.

  • Hi,

    Thank you for the detailed explanation.

    Unfortunately, I do not think that is a bug. That if statement checks if one of two is true:

    1. The address is not a unicast address
    2. The address is neither a local match nor a friend match

    For the first check, !BT_MESH_ADDR_IS_UNICAST would be true if address >= 0x8000, so it should trigger on the fixed group address 0xFFFF. If a node does not relay messages addressed to 0xFFFF then the reason for not relaying would be something else than that code.

    Since it works when using unicast address 0x0001, and address 0x0001 is the first valid unicast address, I expect that to be the primary element on the node, and so the node should definitely have reacted to that message. So I agree that something is clearly wrong.

    Do you get reception of the message on any node other than the originating node? I am thinking there might be an issue at the originating node, and not in relay nodes. If the node with the primary element at 0x0001 never receives the message, then maybe the message was never sent over the air. Especially if no other node receive the message either. I would do some more testing, maybe also with sniffer traces, in order to get more clues about the behavior of the nodes.

    Regards,
    Terje

Related