Example Application: DSDV
The DSDV routing layer provides the implementation of the
Destination-Sequenced Distance Vector protocol to multi-hop
packets
back to a sink node. The current implementation provides
many-to-one routing for one destination at a time. It includes
a hop-count metric, a reliability metric, an energy metric,
and an HSN
(Sphere of Influence or SoI) metric, and it can be extended to
support
additional metrics.
To support the reliability metric, this package provides a
generic
mechanism for tracking the unidirectional and/or bidirectional
link
quality between neighboring nodes.
#include
"gen/cTraceRouteTest_TinyOSModule.h" #include "gen/cTraceRouteTest_Main.h" cTraceRouteTest_Main *m = new cTraceRouteTest_Main(this,main,"Main",getIndex()); m->StdControl_init(); m->StdControl_start(); |
NesCT is going to build all the classes in gen directory.
Replace "cp" with "copy" and slash (/) with backslash (\) for
windows operating system at the following instructions.
[root@sinan tictoc]# cd components/
[root@sinan components]# cp TraceRouteTest.nc
../Application.nc
[root@sinan components]# cd ..
[root@sinan tictoc]# ./nesct.exe Application.nc
done.
Type "make" to build the binary.
[root@sinan tictoc]# make
g++ -c -g -fpermissive -fPIC -DWITH_NETBUILDER -w
-DTOSNODES=1000 -DLINUX -DPLATFORM_OMNETPP -I./include
-I/root/projects/tinyos-1.x/tos/interfaces -I./include_tos
-I/opt/omnetpp-3.2/include simstart.cc
g++ tictoc1_n.o debug.o simstart.o tinyos.o tinyosmain.o
tossim.o txc1.o -g -L/opt/omnetpp-3.2/lib -lenvir -lcmdenv
-lsim_std -lnedxml -lxml2 -ldl -lstdc++ -lpthread -o tictoc
echo>.tstamp
Let's enable all debug options for demonstration purposes. Use "export" keyword for linux and "set" keyword for windows to change environment variable. You should see an output similar to this in TK window.
[root@sinan tictoc]# export DBG=all
[root@sinan tictoc]# ./tictoc