If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

# CC2430: CC2430 ZStack-1.4.3-1.2.1 Cskip and max Routers in tree topology

Part Number: CC2430

Hi everyone,

I need to know how many routers can I have in a Zigbee tree topology based on ZStack 1.4.3.

I am working with a coordinator and several routers, without ED. By default in the ZStack Lm (max depth) is 5, Cm (max children) is 20 and Rm (max Routers), so that means there are a max of 31101 addressable nodes (Coor + Routers + ED), using the Cskip formula. If depth is 5, a max of nodes can be addressed "vertically", from 1 to 5, in terms of topology. But my concern is how many routers can I have "vertically and horitzontally" in this topology, since children nodes can be Routers and children Routers.

So, is there any equation to calculate the max number of router + children routers using the Cskip params (Lm, Rm and Cm)? If, not is there an alternative?

Thanks.

Joaquim.

• Hi Joaquim,

since children nodes can be Routers and children Routers

Can you please explain your reasoning behind this?  My understanding is that children (or associated devices) are either routers or end devices.  MAX_ROUTERS is reserved for router association, and MAX_CHILDREN-MAX_ROUTERS is reserved for end device association.  Thus MAX_ROUTERS defines how many routers you can have "horizontally" at any given depth for a node.  Note that the Developer's Guide includes recommendations on variables which must be considered if altering the default values.  There are also practical limitations to implementing large networks regardless of theoretical maximum node capabilities.

Regards,
Ryan

• Hi Ryan,

Exactly the same that you say: "My understanding is that children (or associated devices) are either routers or end devices".

Now I understand that MAX_ROUTERS is "how many routers you can have "horizontally" at any given depth for a node". In addtion if I understand well, MAX_CHILDREN-MAX_ROUTER are the End Devices for each Router, isn't it?

My concern is, for example if Lm = 5, Rm = 2 and Cm = 3. So, let me expose the next points:

1. The coordinator can have associated 1 ED and 2 Routers.

2. Each Router can have 1 ED and 2 Routers.

3. Only a ED can be addressed for Coor and Routers.

4. According to the attached diagram, in the tree topology with this configuration I can have 1 Coor, 30 Routers and 31 ED, it is correct? I have calculated these number according to the Cskip values and points 1, 2 and 3.

5. But according to the Cskip equation, up to 95 nodes (1 coord + 94 nodes) can be addressed, whereas according my diagram I have 62 nodes (1 coor + 30 routers + 31 end devices).

What is wrong?

Thanks

Joaquim

• I think your diagram is missing one depth, as D5 should also have routers.  This results in a count of 46 routers (2 routers at depth 1, 4 routers at depth 2, 8 routers at depth 3, 16 routers at depth 4, 32 routers at depth 5), 1 coordinator, and 47 end devices (1 for each router and the coordinator) for a total of 94 which is much closer to the Cskip equation.

Regards,
Ryan

I though that at last Cskip level (d5) only can have ED, because the Cskip vakue is 0, so no address can be assigned and thus is not possible to have Routers. Please, see the attached image extracted from a Zigbee book. I highlighted in blue/red the explanation.

Concerning to the number of Routers and ED, sorry but I don't understand yet: adding (2 routers at depth 1, 4 routers at depth 2, 8 routers at depth 3, 16 routers at depth 4, 32 routers at depth 5) the result is 62 Routers (2+4+8+16+32 = 62). In addition, if each Router and Coordinator have 1 ED, there are 63 ED... so the total nodes are: 1 coor + 62 routers + 63 ED = 126 nodes -> far away from the 94 nodes of the Cskip equation.

So I have still these two concerns.

Thanks.

Joaquim.

• My apologies for the poor math!  And you are correct about the topology.  Please allow me to retry: with an excerpt from Zigbee Wireless Networking by Drew Gislason:

Using the formula maxNodes = 1 + Rm x Cskip(0) + (Cm-Rm) = 1 + 2 x 46 + 1 = 94, which is the same as what you've calculated before.

I believe I found the flaw in your diagram.  Do you see how in d4 you have two end devices connected per router, but no routers?  I think each router in d4 should branch off the same as d0/d1/d2/d3 with two routers (child-less this time) and one end device. This would make for 46 individual nodes on the left side of the tree, thus doubling for the right side and adding the coordinator and its own end device would result in a total of 46 x 2 + 2 = 94 nodes, the same as what is calculated.

I hope this helps,
Ryan

• No worry.

But in d4, I have already 2 Routers and 1 ED by Router: in total 8R and 8 ED. Do you mean that d5 depth must have 8R and 8ED? For me, is the only way to have 46 nodes by branch (in total 46 * 2 + 2), but this go against to have 2 child Routers by Router parent and 1 ED all them in "Horitzontally" way, isn't? If in d5 depth I put 2 Router (from d4) and 1 ED, then we have 24 nodes at d5, and in total 110 nodes.

Sorry, but I am going crazy...

Joaquim.

• d4 routers must each have two routers and one end device connected to match your topology definitions, and all of these would be located at d5.  Technically, I suppose each end device you've drawn should be placed one depth past the router it is connected to.

D0: 1 coordinator
D1: 1 end device, 2 routers
D2: 2 end devices, 4 routers
D3: 4 end devices, 8 routers
D4: 8 end devices, 16 routers
D5: 16 end devices, 32 routers

The last 32 routers cannot have any end device children because this would be D6 which violates the maximum depth.  No worries, I'm going crazy too...

Regards,
Ryan

• So, we can assume that:

1. Not all Routers can have 1 ED. If yes, the key here are the ED, because the Routers can have 2 child Routers, isn't?

2. It is not necessary or is not possible to have the same amount of EDin each branch of the tree. I mean that for instance, in D1 only a branch of the tree will/can have one ED, the other branch do not, or in D4 only 8 Routers (of 16) will/can have 1 ED each.

3. If above is true, that means the tree can be "asymmetric", I expected it has to be symmetric.

4. Finally, I understand that Cskip is a maximum value, and the addresses define the topology of the branches, either asymmetrical or symmetrical, isn't?

• 1. The routers in D5 couldn't have an ED, all others can

2. It should be possible to have the same amount of ED in each branch

3. The tree an still be symmetric (theoretically, of course practically there are multiple possibilities)

4. I don't quite understand your point here

Regards,
Ryan

• Hi Ryan,

Now all is clear. The ED for each Router or Coordinator has to be on the next depth of their parent... In my diagram the ED were in the same depth... This is the error...

Thank you very much for your support.

Joaquim.