LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2018, 10:42 AM   #1
ariefhi
LQ Newbie
 
Registered: Aug 2018
Posts: 9

Rep: Reputation: Disabled
How to select an energy based path in AODV routing protocol using NS2


Hi everyone
i'm beginner using ns 2.35, i'm working on researh about How to select an energy based path in AODV routing protocol using NS2.i try to implement energy based path in AODV routing protocol based on http://slogix.in/how-to-select-an-en...ocol-using-ns2
i can't solve this error :
aodv/aodv.cc: In member function ‘void AODV::sendPacket(Packet*, aodv_rt_entry*, double)’:
aodv/aodv.cc:91:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(ih->daddr() == IP_BROADCAST)
^
aodv/aodv.cc: In constructor ‘AODV::AODV(nsaddr_t)’:
aodv/aodv.cc:201:2: error: ‘iEnergy’ was not declared in this scope
iEnergy = 0.0;
^
aodv/aodv.cc:204:2: error: ‘iNode1’ was not declared in this scope
iNode1 = (MobileNode *) (Node::get_node_by_address(index));
^
aodv/aodv.cc:206:2: error: ‘residual_energy’ was not declared in this scope
residual_energy = iNode1->energy_model()->energy();
^
aodv/aodv.cc:208:39: error: ‘packet’ was not declared in this scope
if (residual_energy > 35.0) {forward(packet);}
^
aodv/aodv.cc:209:16: error: ‘packet’ was not declared in this scope
else {discard(packet);
^
aodv/aodv.cc:209:22: error: ‘discard’ was not declared in this scope
else {discard(packet);
^
aodv/aodv.cc:200:14: warning: unused variable ‘iNode’ [-Wunused-variable]
MobileNode *iNode;
^
aodv/aodv.cc: In member function ‘void AODV::recvError(Packet*)’:
aodv/aodv.cc:1048:45: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
while(pkt = ifqueue->filter(ih->saddr())) {
^
make: *** [aodv/aodv.o] Error 1
Ns make failed!
 
Old 08-28-2018, 03:57 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

Files, examples, etc. from "slogix" are often incomplete or faulty.

I guess you will have to declare the "not declared" stuff in e.g. aodv.h
 
Old 09-05-2018, 02:01 AM   #3
ariefhi
LQ Newbie
 
Registered: Aug 2018
Posts: 9

Original Poster
Rep: Reputation: Disabled
i wanna modify route discovery based energy, must i add declaration in aodv.h?

Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

Files, examples, etc. from "slogix" are often incomplete or faulty.

I guess you will have to declare the "not declared" stuff in e.g. aodv.h
 
  


Reply

Tags
ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NS2 Code for Energy Based Clustering Routing Protocol in Wireless Sensor Network Sudha Rajaram Programming 6 11-26-2014 04:55 AM
How to implement aodv routing protocol in leach in ns2.34 bayefalle Linux - Software 4 11-10-2014 09:52 AM
Modifying the RREQ paquet of AODV routing protocol in ns2 info_mimi Linux - Software 0 09-23-2013 10:45 PM
Energy Efficient Routing Protocol implementation in NS2 engrasafkhan Linux - Newbie 1 07-20-2012 08:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration