LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-27-2013, 07:28 AM   #1
chenil
LQ Newbie
 
Registered: Apr 2013
Posts: 21

Rep: Reputation: Disabled
NS2: Blackhole aodv error


i want solution for given problem.

Hello
I was trying to add malicious node in current AODV which i have executed without any errors.

While doing changes as suggested in [URL="http://http://narentada.com/what-is-black-hole-attack-in-manets-my-code-for-adding-malicious-node-as-blackhole-in-aodv-protocol/"]

attaching my currnt files also.
I got the same output which was for AODV.

Where i am going wrong?
Please help me.
Attached Files
File Type: txt aodvtcl.txt (6.2 KB, 164 views)
File Type: txt aodvcc.txt (6.2 KB, 111 views)
File Type: txt aodvh.txt (9.6 KB, 72 views)

Last edited by chenil; 06-28-2013 at 03:44 AM.
 
Old 06-28-2013, 03:53 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Your link, @ Naren Tada
http://narentada.com/what-is-black-h...aodv-protocol/
.. refers to @Elmurod http://elmurod.net/en/index.php/archives/196

The attached file "aodvcc.txt" seems to be a copy of your tcl file.
Please attach the real aodv.cc as "aodv.cc.txt" : aodv<period>cc<period>txt.

Your exampple, "aodvtcl" : Already some files named aodv.tcl . Must have new name.
Suggest e.g. 'm-aodv-chenil.tcl'.

About the line : #$ns_ at 0.0 “[$n2 set ragent_] malicious" :
The hash mark ( # ) is a "comment", and means : Do not use this line.
Please replace with something like : $ns at 0.0 "[$n(2) set ragent_] malicious"
I.e. the syntax must be adjusted to the syntax used in your tcl file :
Edit ns_ to ns ; $n2 to $n(2) ; “ to " .

In the Elmurod aodv.cc, `malicious` is defined as "hacker" :
if(strcmp(argv[1], "hacker") == 0) {
malicious = true;
return TCL_OK;
}
..... and the line in the tcl file must then be : $ns at 0.0 "[$n(2) set ragent_] hacker" :
$ ns233-maodv m-aodv-chenil.tcl : OK, and xgraph is OK.


Quote:
Where I am going wrong ?
Which result do you expect ? And where did you find the "aodv.tcl" ?
Which version of ns2 ? Which OS is used ? $ cat /etc/*release* ; $ uname -m

LQ, aodv-malicious : http://www.linuxquestions.org/questi...odv-malicious/
LQ, blackholeaodv http://www.linuxquestions.org/questi...blackholeaodv/
LQ, blackhole http://www.linuxquestions.org/questions/tags/blackhole/

Simulation examples, aodv-malicious-examples.tar.gz ( 5.3 kB )
https://docs.google.com/file/d/0B7S2...it?usp=sharing
blackholeaodv2005-examples.tar.gz ( 6.7 kB )
https://docs.google.com/file/d/0B7S2...it?usp=sharing

-
 
Old 06-28-2013, 04:58 AM   #3
chenil
LQ Newbie
 
Registered: Apr 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
error in aodv.cc

Now i am getting error after make as " expected ‘}’ at end of input
make: *** [aodv/aodv.o] Error 1

Please help me.
i have attached my aodv.cc.


Quote:
Originally Posted by knudfl View Post
Your link, @ Naren Tada
http://narentada.com/what-is-black-h...aodv-protocol/
.. refers to @Elmurod http://elmurod.net/en/index.php/archives/196

The attached file "aodvcc.txt" seems to be a copy of your tcl file.
Please attach the real aodv.cc as "aodv.cc.txt" : aodv<period>cc<period>txt.

Your exampple, "aodvtcl" : Already some files named aodv.tcl . Must have new name.
Suggest e.g. 'm-aodv-chenil.tcl'.

About the line : #$ns_ at 0.0 “[$n2 set ragent_] malicious" :
The hash mark ( # ) is a "comment", and means : Do not use this line.
Please replace with something like : $ns at 0.0 "[$n(2) set ragent_] malicious"
I.e. the syntax must be adjusted to the syntax used in your tcl file :
Edit ns_ to ns ; $n2 to $n(2) ; “ to " .

In the Elmurod aodv.cc, `malicious` is defined as "hacker" :
if(strcmp(argv[1], "hacker") == 0) {
malicious = true;
return TCL_OK;
}
..... and the line in the tcl file must then be : $ns at 0.0 "[$n(2) set ragent_] hacker" :
$ ns233-maodv m-aodv-chenil.tcl : OK, and xgraph is OK.



Which result do you expect ? And where did you find the "aodv.tcl" ?
Which version of ns2 ? Which OS is used ? $ cat /etc/*release* ; $ uname -m

LQ, aodv-malicious : http://www.linuxquestions.org/questi...odv-malicious/
LQ, blackholeaodv http://www.linuxquestions.org/questi...blackholeaodv/
LQ, blackhole http://www.linuxquestions.org/questions/tags/blackhole/

Simulation examples, aodv-malicious-examples.tar.gz ( 5.3 kB )
https://docs.google.com/file/d/0B7S2...it?usp=sharing
blackholeaodv2005-examples.tar.gz ( 6.7 kB )
https://docs.google.com/file/d/0B7S2...it?usp=sharing

-
Attached Files
File Type: txt aodv.cc.txt (35.0 KB, 52 views)
 
Old 06-28-2013, 05:48 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 3 : Please do not quote entire posts. Please edit.


Quote:
Now i am getting error after make as " expected ‘}’ at end of input
make: *** [aodv/aodv.o] Error 1
Which file is it about ? Which line number in that file ?

And, repeat from post #2 :
Which result do you expect ? And where did you find the "aodv.tcl" ?
Which version of ns2 ? Which OS is used ? :
$ cat /etc/*release*
$ uname -m


P.S. : Don't your post #1 say that you made a successful build ?

-
 
Old 06-28-2013, 07:56 AM   #5
chenil
LQ Newbie
 
Registered: Apr 2013
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thank you for replying.

I have executed aodv without any error as mentioned but after changing as mentioned in adding malicious node to aodv as mentined here http://narentada.com/what-is-black-h...aodv-protocol/i am getting error after make as:

aodv/aodv.cc:778: warning: this decimal constant is unsigned only in ISO C90
aodv/aodv.cc:837: warning: this decimal constant is unsigned only in ISO C90
aodv/aodv.cc: In member function ‘virtual void AODV::recv(Packet*, Handler*)’:
aodv/aodv.cc:579: warning: comparison between signed and unsigned integer expressions
aodv/aodv.cc:634: error: a function-definition is not allowed here before ‘{’ token
aodv/aodv.cc:1420: error: expected ‘}’ at end of input
make: *** [aodv/aodv.o] Error 1


As you asked ;

Which file is it about ?Which line number in that file ?
It is related with aodv.cc

And, repeat from post #2 :
Which result do you expect ?
I want blackhole should be added in plain AODV.

where did you find the "aodv.tcl" ?
Fromhttp://network-simulator-ns-2.7690.n...4-td10367.html



Which version of ns2 ? Which OS is used ? :
I am using NS-2.34 on Ubuntu 10.10

Last edited by chenil; 06-28-2013 at 09:46 AM.
 
Old 06-28-2013, 09:29 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Please edit post # 3 :
See post #4 : Hit the 'Edit' button, and delete the surplus "Quoted text".


? And : What is your output from the command $ uname -m <Enter>


How to type / copy a link, to be readable here at LQ, e.g.
http://network-simulator-ns-2.7690.n...4-td10367.html
→ → Either click 'select all' in the Internet browser address line.
Or use copy / paste, to grab the link.

-
 
  


Reply

Tags
aodv-malicious, malicious, 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
NS: blackhole in aodv error chenil Linux - Software 1 06-28-2013 12:12 AM
after doing some modifications in aodv.cc file in ns2.34 i will get error breeze259 Linux - Newbie 1 01-05-2012 08:04 PM
error in ns2-while trying to print routing table in aodv indumit18 Linux - Software 1 09-24-2011 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:36 PM.

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