README for TinyAODV Stack
Contact: Jasmeet Chhabra at email addr:  jasmeet.chhabra@intel. com

1. Introduction

	The TinyAODV stack implements a simplified version of the Ad-Hoc On
        Demand Vector (AODV) routing algorithm. It is a reactive algorithm, so
        it builds routes on demand when desired by source nodes. 
	
	It builds routes using route-request/route-reply messages. A source
	node desiring a route to the destination generates and broadcasts
	a route request(RREQ) message across the network. When the RREQ
	arrives at the destination or an intermediate node with the path to
	the destination, a route replay (RREP) message is generated and 
	propagated along the reverse path. The nodes propagating the RREP 
	back to the source add a route entry for the destination.
	
	More details on AODV can be found at
	http://moment.cs.ucsb.edu/AODV/aodv.html 


 2. Functionality

	The implementation of TinyAODV makes various simplifications in order 
	to implement the AODV protocol in a very small 
	footprint. The major simplifications in the current implementation 
	are listed below:

	1. RREP messages are only generated by the destination.
	2. Routes never expire.
	3. Only the hop count metric is used.
	4. No messages are generated to keep routes active because routes 
	   never expire. Route errors are generated when a data message
	   can no longer be sent over the path. This is detected using the 
	   TinyOS link level acknowledgements. 


3. Installation

      1) Applications should use AODV.nc to interface to the AODV routing
         module. The sender can use SendMHopMsg or the Send interface 
 	 to send packets. The example application uses the Send interface
	 to send the data packets to a single destination, SINK_NODE. 
	 It may use SendMHopMsg to send messages to any node in the network. 
	 In this usage scenario, the SINK_NODE in step 3 below can be ignored. 
      2) Include hsn/apps/MakeHSN inside Makefile; refer to hsn/apps/README
         for details.
      3) Compile sink node by 'make SINK_NODE=1 mica install.0'
      4) Compile the rest of the nodes by 'make mica install.x' where
         x is the node ID (must be unique and other than 0).


4. Compilation Flags

      The commonly used compilation flags are defined in MakeHSN. You can also
      alter the default value in steps 3 and 4 above while compiling the motes.

      SINK_NODE

         Set to 1 to compile the sink node. Default is 0.

      TXRES_VAL

         Sets the value of the radio strength potentiometer (0 - 100). 0 is
         largest, default is 70.


7. Known Issues

   -  A TinyAODV node can currently store a maximum of 7 route entries. 
      This can be increased by changing the definition of AODV_RTABLE_SIZE to
      some other number.
   -  A TinyAODV node can currently store a maximum of 7 RQCACHE entries. 
      This can be increased by changing the definition of AODV_RQCACHE_SIZE to
      some other number. The oldest entries are replaced in the cache when 
      it is full.


8. Core AODV Files

   -  tos/lib/AODV_Core.nc - The implementation of the core TinyAODV algorithm
   -  tos/lib/WSN_Messages.h - Definitions of the TinyAODV packet formats
   -  tos/lib/AODV_PacketForwarder.nc - Component that sends and processes data
      packets sent using TinyAODV
   -  tos/lib/AODV.h - TinyAODV-specific defines and data structures
   -  tos/lib/AODV.nc - TinyAODV top-level file
   -  tos/lib/TraceRoute_AODVM.nc - Main traceroute component
   -  tos/lib/TraceRouteAODV.nc - Top-level TraceRoute file
   -  apps/TraceRouteTestAODV/TraceRouteTest.nc - App component file
   -  apps/TraceRouteTestAODV/TraceRouteTestM.nc - Top-level app file




