I am trying to modify the AODV functionality  to consider energy of neighbor
nodes while deciding the next hop instead of the number of hop counts. I
wanted to know if I am on the right track by saying that the following code
in aodv.cc is responsible for choosing the next hop:

if ( (rq->rq_src_seqno >
rt0->rt_seqno<http://rp.lip6.fr/ns-doc/ns226-doc/html/classaodv__rt__entry.htm#aodv__rt__entryp1>)
||

00696         ((rq->rq_src_seqno == rt0->rt_seqno
<http://rp.lip6.fr/ns-doc/ns226-doc/html/classaodv__rt__entry.htm#aodv__rt__entryp1>)
&&
00697          (rq->rq_hop_count < rt0->rt_hops
<http://rp.lip6.fr/ns-doc/ns226-doc/html/classaodv__rt__entry.htm#aodv__rt__entryp2>))
) {
00698    // If we have a fresher seq no. or lesser #hops for the
00699    // same seq no., update the rt entry. Else don't bother.
00700 rt_update
<http://rp.lip6.fr/ns-doc/ns226-doc/html/classAODV.htm#AODVb3>(rt0,
rq->rq_src_seqno, rq->rq_hop_count, ih->saddr(),
00701                max
<http://rp.lip6.fr/ns-doc/ns226-doc/html/aodv_8cc.htm#a0>(rt0->rt_expire
<http://rp.lip6.fr/ns-doc/ns226-doc/html/classaodv__rt__entry.htm#aodv__rt__entryp6>,
(CURRENT_TIME <http://rp.lip6.fr/ns-doc/ns226-doc/html/aodv_8cc.htm#a1>
+ REV_ROUTE_LIFE
<http://rp.lip6.fr/ns-doc/ns226-doc/html/aodv_8h.htm#a5>)) );

[this code is on line 00695 at
http://rp.lip6.fr/ns-doc/ns226-doc/html/aodv_8cc-source.htm]

In that case I just change line 00697 to something like
"(rq->energymodel()->energy()>{some threshold} ) ) {"

Is this approach correct? Is this the only change required or do I have to
make some other changes as well?


Thank You.


-- 
Goel Rishabh D.
Graduate Student
School of Electrical and Computer Engineering
Georgia Institute of Technology
Tel: (404) 386 - 9354

Reply via email to