LWMesh - Optimizations for a 1000 node network - Page 1
Forum section: electronics / general

author: fgargiulo
author_rank: Contributor
timestamp: February 15, 2017, 09:12:53 pm
content: Hi guys,I need to create a network of 1000 nodes, where everyone reports back to one particular node (gateway). I've developed a prototype using LWMesh stack, with a transceiver set a 250kbps. So far it's been ok. I've been able to handle 30 devices, all sending data to one hub every 30 minutes. But ever since i've read this posthttps://www.eevblog.com/forum/microcontrollers/lightweight-mesh-software-stack-in-real-life-how-many-nodes-max/msg1053312/#msg1053312i'm worried. I'm not sure how many more nodes i'll be able to add, and i don't have an easy way of testing the network with that many (at least not in a near future).In the current configuration, all nodes are routing nodes (NWK_ENABLE_ROUTING); and with native routing algorithm. In final application, the distance between nodes will be approximately 50 meters. Range distance is not an issue, since nodes can communicate to each other even at 100 meters. However, the number of hops is the bottleneck. The topology of the network is a static grid of homogeneous distribution. Once installed, nodes remain at the same position. The gateway will be at the centre, and i need to get to every node with less than 5 hops.When i tested the native routing algorithm using five nodes (each one 50 meters apart from the other), i noticed that every one routed the messages of his nearest neighbour, overloading the network since each one was, in theory, capable of avoid one hop and talk to the node located at 100 meters apart. I'm aware that this scenario is a consequence of the nature of the algorithm, since it's using the best LQI to define the path, but is unacceptable for the final application.I was wondering if there is a way of improving performance in order to achieve the goal of 1000 nodes in the same network.First option is to set the routing algorithm to AODV in order to minimise the number of hops. However, i'm not sure if this is enough.Second option is to limit the number of routing nodes (to 100) and the rest to non-routing ones. Despite this is probably the best option, it makes harder the maintenance of the network.Third option is to modify the routing algorithm. Perhaps implement an algorithm using all broadcast messages which contain the source/destiny information inside the payload. Sooner or later, the messages will get to the gateway.Someone thinks this is even possible? Any suggestions to achieve the goal are welcome.Thanks in advance.Frank

author: ataradov
author_rank: Super Contributor
timestamp: February 15, 2017, 09:40:27 pm
content: It all depends on how much time you want to invest into this.Absolute best approach is to do a custom routing algorithm. Since your network has a fixed topology, you can assgn addresses to the nodes in a deterministic way and configure static routes based on the nodes own address. This will be absolute best scenario, and you will get the most performance.It is not hard to do at all, stack already supports static routing (look at the list of APIs for details). All you need to do is assign fixed addresses to nodes and create static route records, and you are done.I can give other options, but you will have to give more detailed description of your network - how devices are configured and installed, how much data they need to communicate, etc.1000 nodes is not easy, it will involve tweaking, so make sure you have OTA update capability.

author: fgargiulo
author_rank: Contributor
timestamp: February 15, 2017, 11:14:56 pm
content: Thank you very much for the fast response. I'll have a look at the APIs you mention. I think it's a good starting point.It would be very helpful if you could guide me with other alternatives in order to develop the one that best fits for my specific application.Regarding the network detailed description i can tell you the following things:* It's aimed for street lighting* There will be one node per light, with a average of 1000 nodes per gateway. Every node reports data to the gateway. Sending data to other nodes is not mandatory, but it's a nice to have feature.* Each node is configured at the moment of installation. This includes parameters such as network address, pan id, security key, etc.* Nodes must send a status report every 30 minutes.* Nodes eventually receive commands from the gateway for specific operations.* Nodes are distributed in a grid of 10x10 blocks (aprox), with a number of 3 to 6 nodes per street.* The gateway is intended to be in the middle of the grid, but this may not be always the scenario.* The network must keep functioning if some of the nodes are offline (as random failures, power failures, etc)* OTA is a "must to have" featurePlease, let me know if there is something else that i may be missing. Thanks again.

author: ataradov
author_rank: Super Contributor
timestamp: February 16, 2017, 06:37:08 am
content: Quote from: fgargiulo on February 15, 2017, 11:14:56 pmThis alone makes things 1000% easier for you.What you do is assign addresses by range from the gateway. Format of the address is the following: 0xRRNN. RR is a distance from the gateway (in number of hops, or just some physical distance scaled into the range 0-250). NN is the number of the node at this distance.So basically nodes will form "rings" around the GW. Nodes in the closer ring will have addresses 0x0100, 0x0101, 0x0102, ... The next ring will be 0x0200, 0x0201, 0x0202, ... and so on.Now it is easy to see that for 0x0200 to reach the gateway, it needs to send data though one of 0x01xx. This can be either preconfigured, or each node of a level RR can keep a dynamic list of nodes with the level (RR-1) and it can try all of them in a row in case if currently selected one does not work.This sounds complicated, but it is not. It is much easier that trying to make generic 1000 node mesh network work.