8Apr/09Off
NS2: Printing Routing Table in AODV
Actually you can find all this information in trace file which NS2 made, however using following code simplifies getting required informaiton during running time. The code stores
Add following code to aodv.h after void rt_down(aodv_rt_entry *rt);
void rt_print(nsaddr_t node_id);
Add following code to aodv.cc after void AODV::rt_down(aodv_rt_entry *rt)
void AODV::rt_print(nsaddr_t node_id) {
FILE * dumpFile;
char dumpFileName[50] = "rtable.txt";
dumpFile = fopen(dumpFileName, 'a');
aodv_rt_entry *rt;
fprintf(dumpFile, "=======================================================");
for (rt=rtable.head();rt; rt = rt->rt_link.le_next) {
fprintf(dumpFile, "NODE: %i\t %.4lf\t %i\t %i\t %i\t %i\t %i\t %.4lf\t %d \n", node_id, CURRENT_TIME, rt->rt_dst, rt->rt_nexthop, rt->rt_hops, rt->rt_seqno, rt->rt_expire, rt->rt_flags)
}
fclose(dumpFile);
}
The function (rt_print) can be used anywhere in AODV. For example, I am using the function, when route request generated node receives route reply message (RREP).
if (ih->daddr() == index) { // If I am the original source
// Update the route discovery latency statistics
// rp->rp_timestamp is the time of request origination
rt_print(index); // print this nodes whole routing table
rt->rt_disc_latency[(unsigned char)rt->hist_indx] = (CURRENT_TIME - rp->rp_timestamp)
/ (double) rp->rp_hop_count;
// increment indx for next time
rt->hist_indx = (rt->hist_indx + 1) % MAX_HISTORY;
}
August 17th, 2009 - 18:29
Hi Elmurod,
I am writing a thesis on AODV. I need a help from you on this. For the simulation of AODV i need a full version of simulator (Probably in C in LINUX). Can u please send me a link or simulator where i can simulate the AODV routing with full description on how to install and run.
Thanx a lot in advance
August 26th, 2009 - 16:23
Hi dear Elmurod.I’m beginner in ns2 and your web were very usefull for me.
I have one important project that I shoud do it in ns2.
I have one problem and demand u plz help me.
After using aodv in wsn, like your example, how we can extract path (from source to distination) from trace file. for example (n1 n7 n14 n38 n40)
regards
elnaz
February 3rd, 2010 - 15:23
hello sir……..
As you say, aodv is best to start ns2 for new comer, I want to understand code of aodv. If you dont , give me some resource to understand this code. I am familier with c/c++.
March 19th, 2010 - 14:13
hi
im master student and i have worked in ns2 . i have added new packet type in aodv every thing work ok
but after weeks when im run my code agian the following error apperaed
segmentation fault
im work in aodv protocol can you help me pleas
March 24th, 2010 - 18:37
i try with this code and it not work when im run ther is no error but where i can found rtable.txt
i want to ask if there is any library to include or i must create the rtabel.txt file in the same level of aodv.cc file ???????? help me plsssssssssssssssssssssssssss
March 25th, 2010 - 20:48
Dear Elmurod,
Can u please send me a link or source code for the AODV_ multipath routing for adhoc and IEEE802.15.4.
and to help me if there are the difference betwen this 2 AODV_multipath routing protocle.
Please help me i hope to have the positif response.
thank’s
March 26th, 2010 - 19:06
Just use AOMDV routing, which is already available in NS2 source tree.
March 26th, 2010 - 20:38
i also want to add some new entry. Is there any help regarding that.
April 16th, 2010 - 16:59
hi Mr.Elmurod Talipov,
I am doing my project for aodv by using ns2 recently.
Sorry for asking u a very simple question.I already study the aodv.cc andaodv.h inside this ns2.
But did u notice that the send hello and receive hello of this protocol is not working?
Because i got try to add a printf statement inside send hello and receive hello function in aodv.cc,but unfortunately nothing printed out.
The send hello and receive hello not even invoked within the whole simualtion process.
I am not sure about this whether is source code problem or some other problem…
can u tell me?Did u try to work on this send hello and receive hello function inside aodv.cc???
i am appreciating every helps from u…Thanks.
April 16th, 2010 - 17:08
sorry for leave a comment again,actually i am using NS-allinone-2.34…
thanks,I’m looking forward for ur positive response..
April 21st, 2010 - 18:53
Hello sir,
I want to know for any routing protocol for wireless sensor network how to broadcast hello message from the sink node and how to print the routing table from the .tcl file. and how to send the packect request for source node from sink node.
Kindly do give the needful information.