Hi Tarun,
      Thanks a lot for your reply.Can we implement this
concept even in TinyOS 1.x ? As i am working with tinyos1.x right now.
I am concentrating on TOSSIM simulations not on programming the code
into the motes.I am using Grid topology not linear one and the
information in routing table is constant , it doesnt change.In linear topology 
we can increment the
hop count but if i use grid topology how will the code be ? For Example:3 by 3 
grid
0   1   2 
3   4   5 
6   7   8
Now if want to add the routing table information into node2 and so on for all 
nodes too. how can i do it ? At Node2
Destination   Nexthop   hopcount
 0                    1                2
 1                    1                1
 2                    0                0
 3                    1                3
 4                    1                2
 5                    5                1 
 6                    1                4 
 7                    1                3 
 8                    5               2 
 The
information in the above table can be plotted manually.So now i want to
include this routing table directly  into node2.Hope this is clear? I
want to maintain the destination and hop numbers to reach it from a
particular node for every node. I want to include those values into
each and every node.Can you please let me know how i can do this ? If i
use Debug messages and put this values then can i store these values in
the nodes ?I may be wrong.Please let me know. 
Thanks,
Swetha.

________________________________
From: tarun sharma <[email protected]>
To: Swetha R <[email protected]>
Cc: [email protected]
Sent: Tuesday, May 12, 2009 12:02:10 AM
Subject: Re: [Tinyos-help] Routing table construction

Hi swetha
I once implemented a routing algorithm that required a routing table. My 
routing table was different from the one u specified but it wasn’t static so I 
used a setup phase to create it at ever node. Now disadvantage of this is that 
it makes the whole system more complicated coz you need to have a code AND a 
packet format for setup phase. But advantage that I felt was that I can load 
exacty the same code in all nodes and they can create there own routing table 
based on their location in the network.
Now since u want to programme nodes with a static tables, you’ll make the code 
easier but you’ll have to programme each node with a different code containing 
it’s own routing table  (assuming I’ve understood u correctly). Now coming to 
your question, I’m not sure if this is the best way to do it but when I 
implemented my routing algorithm I used a simple 2 dimensional array structure 
to store the routing table. Bellow is a small part of my code that I used to 
build the routing table: code is modified "blinktoradio" so you'll understand 
wat's going on

if (len == sizeof(BlinkToRadioMsg)) {
   BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
   printf("gat from %u at %u\n",btrpkt->sender,btrpkt->hop);
   if (btrpkt->type==0)  //if messege is type 0, that is setup messege
     { 
       uint8_t flag=0;
       uint8_t i,j,k;
if(call Timer0.isRunning())
 call Timer0.stop();
call Timer0.startOneShot(1000);
num+=1;
for(i=0;i<=index;i++)  //checking if the node already exists in routing table
 {
   if (rout[i][0]==btrpkt->sender) 
     {
               flag=1;
       break;
     }
 }
if(flag==0) //if node doesnt exist in routing table it is added at the end of 
the table along with hope count n some more algo specific info
 {
   rout[index][0]=btrpkt->sender;
   printf("sender %u \n",rout[index][0]);
           rout[index][1]=btrpkt->hop+1;
   printf("hop %u\n",rout[index][1]);
           dec[index][0]=(float)1/rout[index][1];
   index=index+1;

}
       else if(flag==1) //if node exists i table, it's infomatin might be 
updated if needed
 {
   if(rout[i][1]>btrpkt->hop+1)
     {
rout[i][1]=btrpkt->hop+1;
dec[i][0]=(float)1/rout[i][1];
     }
 }
if(hop>btrpkt->hop+1)
 {
   hop=btrpkt->hop+1;

Like i said, i dono if this is "The Perfect" way of making the routing table, 
but it worked for me :). wish u all the best!!

Tarun
    


On Tue, May 12, 2009 at 12:16 AM, Swetha R <[email protected]> wrote:
> I have one more question. If i create a static topology that means i know
> the location of all the nodes in my network and the topology will not change
> till the end of the simulation. Then can i manually store the routing table
> information at every node about the hop numbers to other neighboring nodes
> that i mentioned in my previous email in all the nodes? Is it possible to
> store the values entered by me in a routing table in all the nodes ? Is
> there any method to do this? Please let me know how i can implement this in
> my code?
> For example :
> 0 --> 1--> 2-->3-->4
> Node2  's routing table :
> Destination   Nexthop   hopcount
> 0                    1                2
> 1                    1                1
> 2                    0                0
> 3                    3                1
> 4                    3                2
> can i manually enter this information and store in node 2 ?
>
> Thanks a lot once again.
> Swetha.
> ________________________________
> From: Philip Levis <[email protected]>
> To: Swetha R <[email protected]>
> Cc: [email protected]
> Sent: Thursday, May 7, 2009 1:04:27 PM
> Subject: Re: [Tinyos-help] Routing table construction
>
>
> On May 7, 2009, at 11:56 AM, Swetha R wrote:
>
>> Hello Everyone ,
>>    I am new to TinyOS and would appreciate any kind of help to make me
>> understand the Routing protocols.I want to create a network topology by
>> using flooding where every node maintains a routing table which should
>> contain the following details :
>> destination node - to the node it has to send the data.
>> nexthop-  intermediate node to reach the destination.
>> hopcount- the number of hops to reach the destination.
>> For example :
>> 0 --> 1--> 2-->3-->4
>> Node2  's routing table :
>>
>>
>
> There's a huge amount of work in this area. The approach you describe was
> one of the first TinyOS routing protocols. There was then about 5 years of
> work that examined why it doesn't work well and how you can do better. The
> canonical paper is
>
> Deepak Ganesan, Bhaskar Krishnamachari, Alec Woo, David Culler, Deborah
> Estrin and Stephen Wicker,  Complex Behavior at Scale: An Experimental Study
> of Low-Power Wireless Sensor Networks ,  UCLA Computer Science Technical
> Report UCLA/CSD-TR 02-0013.
>
> Modern protocols use a distance vector approach based on ETX (expected
> transmissions) or related link cost function. TinyOS 2.x has CTP and
> MultihopLQI that do this: the latter uses chip error rates to estimate link
> cost. The Berkeley IP layer (blip) also does something similar, using a
> hybrid candidate parent approach, similar to as described in Jonathan Hui's
> SenSys 2008 paper.
>
> Phil
>
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>


      
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to