This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

After receiving the packet in RELAY NODE, I want to edit the PACKET before relaying it to the next RELAY NODE.

Hi,

Basically, the setup of the mesh network is as follows,

  1. There are END NODES based on sensor server model.
  2. There are RELAY NODES based on the sensor client model.
  3. There is a PROXY NODE 

I am using ,

  1. NRF SDK 5 for MESH
  2. NRF CONNECT SDK 17.0.2
  3. NRF MESH mobile application for provisioning 
  4. SEGGER Embedded Studio for developing software
  5. nrf52840 dev kits as the different types of nodes.

So, suppose there is an END NODE 'E1' and there is a RELAY NODE 'R1', When E1 sends the packet and it is first received by R1 then I want to add the MAC Address of R1 in the packet before relaying it further.

FINAL OBJECTIVE : I want to know which is the first RELAY NODE encountered with a packet, sent by END NODE.

I have tried following things to solve the problem or get the solution,

1. Searched on the Devzone about the problem but didn't get any lead towards the solution.

2. I have read about the stack architecture from the Bluetooth mesh stack architecture and have understood that the packet coming in RELAY NODE, enters Bearer Layer and Network Layer only. 

3. I have traced the packet in Network layer and printed it on the logs, where it gets decrypted with network key. But as the packet gets relayed from Network layer itself without going in the Transport layer. 

4. So, as the packet doesn't enter the Transport layer it didn't get decrypted with Application key.

5. Therefore, I couldn't edit the packet to append the MAC address of the RELAY NODE in the packet to achieve my final objective as mentioned above " I want to know which is the  first RELAY NODE encountered with a packet, sent by END NODE."  

Thanks in advance !

Any leads towards the solution or link to the readable material useful in solving the problem will be highly appreciated. 

Regards !

Akbar

Parents
  • Hello,

    NRF CONNECT SDK 17.0.2

    I assume you mean nRF5 SDK 17.0.2.

    So you only want R1 to be added to the packet, as in just the first relay? (Not all the relays until it arrives at its destination).

    And by first you could mean several things. Are you talking about order or time? Are you referring to the first relay node to get the packet, or the first one to relay the packet so that it ultimately ends up in the final receiving node. If you are referring to the first to get the packet I guess you would have to add the time it was received as well, otherwise you wouldn't know which was first. There could be several packages heading towards a dead-end, or taking a detour and end up at nodes that have already relayed the message earlier.

    Either way, if you want this done by modifying the relay functionality you are immediately going against the spec, and making your own custom solution. If you still go ahead with this, you will also have to find a way to decrypt the message before adding the relay nodes MAC address to it. This sounds like a difficult route to take. 

    You could do this with the application layer instead. Send a message with TTL=0 (so that it won't be relayed), and that the nodes that receive the message create a new one that is sent with the same receiver as the previous one. When received by the final node, check the sending address of the message, which will be the address of the first relaying node (though you might get multiple similar messages from other relay nodes close by, and have to compare the time it was received etc.). The issue with this solution is that it won't work for any standard mesh message, and that it involves a delay after being received by the first set of relay nodes. 

    Btw, if your main goal with this is network health and diagnostics I would recommend heartbeat messages instead.

    Regards,

    Elfving

  • Thank you ! Elfving, for your quick support!

    I have figured out all of the options given in your advice. It is really helpful. I  am working on it, I will update once the development gets completed.

    Thank you once again!  

Reply Children
No Data
Related