[Tinyos-help] Random number

Aurélien Francillon aurelien.francillon at inrialpes.fr
Tue Dec 11 02:51:48 PST 2007


Le Tuesday 11 December 2007 05:59:05, vous avez écrit :
> Hi all
>
> I need to, during startup decides out of NUM_NODES nodes, which of the
> NUM_TASKERS nodes will perform certain tasks.
>
> Previously, I have identified these NUM_TASKERS inside the Makefile using
> -DTASK_NODE=1, -DTASK_NODE=6, ....
>
> However, I want the task nodes to be different for each run.

Well I'm not shure to understand exactely your needs ... 
> But, using Random () on each node might not work correctly here since the
> seeds for each node is different?

If you need a random number generator which is providing you a new set of 
random values at each run and different on each nodes, I can provide you the 
secure random number generator i developed 
(http://www.ist-ubisecsens.org/publications/TinyRNG.pdf).
It's not public yet because it still needs some testing, so I would be 
grateful to you if you can report your experience.
Please note that it won't work properly in simulation (and there are other 
ways to achieve this in simulation) but it works on real motes...
If you need similar random numbers on each node, but which changes at each 
reboot I can tell you how to perform this with slight modifications to 
TinyRNG.
If you think it can be useful to you i can send you the tgz archive by private 
Mail... 

Cheers
Aurélien



More information about the Tinyos-help mailing list