Hi all,
I am using a wireless sensor network simulator called SENSE to setup a simple network and perform some security measures. I am using the AODV routing protocol which is inbuilt in SENSE. The AODV routing protocol finds the shortest route from a given source to a given destination. But it doesn't output the route for me to use it for my work.
I am providing the entire code for the AODV routing protocol as an attachment. I made some changes to print the routing table in the Stop() function. But it is not outputting the correct result. I have assumed that node 54 is the source and node 200 is the destination. Here is my attempt to print the routing table:
template <class PLD>
void AODVI<PLD>::Stop()
{
routing_table_t::iterator it;
for ( it=m_routing_table.begin() ; it != m_routing_table.end(); it++ )
{
std::cout<<"first entry"<<(*it).first<<std::endl;
std::cout<<"second entry-dst_seq_num"<<(*it).second.dst_seq_num<<std::endl;
std::cout<<"second entry-valid_dst_seq"<<(*it).second.valid_dst_seq<< std::endl;
std::cout << "second entry - hop_count" <<(*it).second.hop_count << std::endl;
std::cout << "second entry - next_hop" <<(*it).second.next_hop << std::endl;
std::cout << "second entry - lifetime" <<(*it).second.lifetime << std::endl;
}
packet_buffer_t::iterator iter=m_packet_buffer.begin();
for(;iter!=m_packet_buffer.end();iter++)
(*iter)->free();
}
If I run this, I always get the next_hop to be 200, which the destination node.
Any help is appreciated.
Thanks.