simulation of blackhole attacks in ns3 using Modified AODV

2,189 views
Skip to first unread message

suganya prabha

unread,
Oct 29, 2015, 4:22:56 AM10/29/15
to ns-3-users
sir,i need the simulation of blackhole attack patch or module in ns3 using modified AODV.

Mohit P. Tahiliani

unread,
Oct 29, 2015, 11:25:50 PM10/29/15
to ns-3-users
Hi,

One patch is available here: https://www.nsnam.org/wiki/Contributed_Code

- Mohit

suganya prabha

unread,
Oct 31, 2015, 2:36:50 AM10/31/15
to ns-3-users
sir,i can't able to find that patch in that following link.


suganya prabha

unread,
Oct 31, 2015, 5:06:22 AM10/31/15
to ns-3-users
Sir,i have a doubt in modified aodv.In modified aodv ,the concept is to set a threshold value in routing table to detect the malicious node.what is the procedure to define the threshold value inn it.

Mohit P. Tahiliani

unread,
Oct 31, 2015, 5:54:24 AM10/31/15
to ns-3-users
Hi Suganya,


To add a new field called "threshold" in the routing table of aodv - take a look at RoutingTableEntry method in aodv-rtable.h and proceed accordingly.

- Mohit

suganya prabha

unread,
Nov 1, 2015, 10:40:39 AM11/1/15
to ns-3-users
thank you sir.Is there any olsr or dsr patch in ns3 is available for simulating blackhole attack.

Mohit P. Tahiliani

unread,
Nov 2, 2015, 8:59:42 PM11/2/15
to ns-3-users
Hi Suganya,

To the best of my knowledge; there isn't one available for OLSR or DSR.

Regards,
Mohit P. Tahiliani

suganya prabha

unread,
Nov 2, 2015, 11:39:01 PM11/2/15
to ns-3-users
sir,i am having one doubt,why the implementation of blackhole attack simulation is investigated only in aodv.

suganya prabha

unread,
Nov 4, 2015, 1:57:35 AM11/4/15
to ns-3-users
In blackhole attack simulation using aodv,if malicious behavior is se to true the throughput getting will be 0.18mbps and if malicious behavior is set to false the throughput getting will be 0.26mbps,since the transmitted packets are successfully received without any loss,throughput getting will be 0.26,what is the reason sir.

Mohit P. Tahiliani

unread,
Nov 4, 2015, 2:22:25 AM11/4/15
to ns-3-users
Hi Suganya,

The impact of blackhole attack has been investigated in many other protocols; it's just that those codes are not openly available. Nevertheless, you can use blackhole attack code of AODV as a reference and try implementing with the protocol of your choice.

I did not understand your other question which is related to throughput. However, note that when attack is turned off, you should successfully receive all the transmitted bytes (compare transmitted bytes with received bytes using flowmonitor).

Hope it helps.

Regards,
Mohit P. Tahiliani

Tommaso Pecorella

unread,
Nov 4, 2015, 7:37:34 AM11/4/15
to ns-3-users
On Wednesday, November 4, 2015 at 7:57:35 AM UTC+1, suganya prabha wrote:
In blackhole attack simulation using aodv,if malicious behavior is se to true the throughput getting will be 0.18mbps and if malicious behavior is set to false the throughput getting will be 0.26mbps,since the transmitted packets are successfully received without any loss,throughput getting will be 0.26,what is the reason sir.


Because a Black Hole attack is a form of Packet Drop attack, duh !

Please, try to understand your research topic before doing some research on it.

T.

 

suganya prabha

unread,
Nov 4, 2015, 9:56:16 AM11/4/15
to ns-3-users

my question is when all packets are successfully transmitted,that is 5040 are successfully transmitted and received,then the throughput displayed is 0.26mbps

suganya prabha

unread,
Nov 4, 2015, 9:57:30 AM11/4/15
to ns-3-users
thank u sir

Tommaso Pecorella

unread,
Nov 4, 2015, 3:49:05 PM11/4/15
to ns-3-users
I'm sorry, but I don't understand the question. Please take your time to explain yourself clearly. Eventually ask a friend more fluent wit English to help you. We can give you some advices if and only if we can understand what is your problem. 


T.

suganya prabha

unread,
Nov 5, 2015, 12:43:58 AM11/5/15
to ns-3-users
sir,In Blackhole attack patch,when the attack is turned off,the transmitted packets are successfully received,but i am getting the throughput as 0.26 Mbps.
My question is throughput=total received packets/total transmitted packets,by that concept i need to get 1 Mbps right.

Tommaso Pecorella

unread,
Nov 5, 2015, 3:27:39 AM11/5/15
to ns-3-users
This is disturbing on many, many ways.
I mean, even the measure unit should point you to the simple fact that you're doing something deeply wrong. Mbps = Mega bit per second. if you divide packets and packets you'll get a "pure" number (and you should had done the ratio of sent and received bits anyway).

Please, go and read what wikipedia says about the "throughput", it will be... useful.

T.

Rakesh kumar

unread,
Feb 3, 2016, 2:01:02 AM2/3/16
to ns-3-users
Mam did you arrive at patch for blackhole attack in olsr. pls do let me know.


Garima Singh

unread,
Nov 28, 2016, 8:04:02 AM11/28/16
to ns-3-users
I want to apply some attacks on LTE network simulated through ns3 if anybody have any idea then please help me............

Konstantinos

unread,
Nov 28, 2016, 8:20:37 AM11/28/16
to ns-3-users
Dear Garima,

Please follow the posting guidelines

Is there a specific attack you are looking to investigate?
As far as I know, there is no (public) implementation of an attack to LTE network.
This topic was related to blackhole associated with AODV.
 
Regards,
K

kamrul hasan hasib

unread,
Dec 15, 2016, 11:54:08 PM12/15/16
to ns-3-users
Hi Mohit Sir, I am simulating blackhole attack with 20 nodes where 1 node is malicious. All the nodes are in fixed position. But the problem is setting the IsMalicious to false if I add malicious aodv in a different node then it is showing a different result. why is that Sir? The results should always remain same as I disabled malicious behaviour.

123pgp...@gmail.com

unread,
Feb 12, 2017, 2:21:23 PM2/12/17
to ns-3-users
Hi sir,
 In the given blackhole attack patch, the nodes are manually predefined as malicious and non malicious nodes. I want to define it based on the past behaviour of the nodes by giving some trust values like

  Number of successful packet transmission
  Probability of route breakage
  Relaying of at-least ' n ' packets in the T sessions and
  Ability to keep a route connected for minimum number of packets

for each node and a threshold is set to define whether the corresponding node is malicious or non-malicious. Would you please guide me ASAP that how can I do it??

Tommaso Pecorella

unread,
Feb 16, 2017, 10:17:34 AM2/16/17
to ns-3-users
"Would you please guide me ASAP that how can I do it?"

Sure thing.
1) Study and understand the tutorial, 
2) Check the differences between the "normal" AODV code and the one modified for backhoe attacks,
3) Plan your changes,
4) Implement them.

This, of course, assuming that you're fluent in C++. Otherwise, add a step 0: learn C++.

Happy coding,

T.

Anto Pravin

unread,
Mar 7, 2018, 7:10:57 AM3/7/18
to ns-3-users
Hi all, I am working on blackhole attack in ns3.
 I have downloaded the patch from http://mohittahiliani.blogspot.in/.

  I follow the instructions given in the above blogspot.

  When i patch the file,
  it got reply as hunk failed 1,2,3,4,5 and hunk 1, 2 failed
and again when i give ./waf command
../src/aodv/model/aodv-routing-protocol.cc: In static member function ‘static ns3::TypeId ns3::aodv::RoutingProtocol::GetTypeId()’:
../src/aodv/model/aodv-routing-protocol.cc:300:42: error: ‘SetMaliciousEnable’ is not a member of ‘ns3::aodv::RoutingProtocol’
                    MakeBooleanAccessor (&RoutingProtocol::SetMaliciousEnable, &RoutingProtocol::GetMaliciousEnable),
                                          ^
../src/aodv/model/aodv-routing-protocol.cc:300:80: error: ‘GetMaliciousEnable’ is not a member of ‘ns3::aodv::RoutingProtocol’
                    MakeBooleanAccessor (&RoutingProtocol::SetMaliciousEnable, &RoutingProtocol::GetMaliciousEnable),
                                                                                ^
../src/aodv/model/aodv-routing-protocol.cc: In member function ‘void ns3::aodv::RoutingProtocol::RecvReply(ns3::Ptr<ns3::Packet>, ns3::Ipv4Address, ns3::Ipv4Address)’:
../src/aodv/model/aodv-routing-protocol.cc:1566:23: error: return-statement with a value, in function returning 'void' [-fpermissive]
                return false;
                       ^


I got the above error.

Your help is appreciated

pdbarnes

unread,
Mar 7, 2018, 12:05:53 PM3/7/18
to ns-3-users
You need to read up on patching.

“Hunk failed” means the a section of the patch diff couldn’t be applied automatically. Usually this is because the right place to apply it is on a significantly different line than when the patch was created, or the section where it should be applied has changed significantly too much.

The solution is usually to read the diff, or the rejected hunks (they’re saved in a file) and make the edits by hand. There’s no point in running waf to build with the patch only partially applied, that’s almost surely going to fail.

Peter

Anto Pravin

unread,
Mar 12, 2018, 1:54:19 AM3/12/18
to ns-3-users
Thanks for the update Sir,

I am working on it.

Alfi Syahr Nuzula

unread,
Mar 16, 2018, 3:54:11 AM3/16/18
to ns-3-users
sir, i want to ask where the blackhole attack comes in the network,whether it appears itself or installed people?

Anto Pravin

unread,
Mar 28, 2018, 9:07:51 AM3/28/18
to ns-3-users
Finally succeeded. Done patch file for ns3.27 and executed blackhole attack in ns3.

Thanks for the support....

Madhavi Dhingra

unread,
Jul 9, 2018, 6:17:52 AM7/9/18
to ns-3-users
Sir ,
please share the code for it. I am getting the error as malicious_aodv.Set("IsMalicious",BooleanValue(true));

Sound Nwankwo

unread,
Nov 4, 2018, 6:08:29 PM11/4/18
to ns-3-users
sir, am looking for the simulation of sinkhole attack patch using any of the protocols wether AODV or PSO. i need your guide in the right direction


On Friday, 30 October 2015 04:25:50 UTC+1, Mohit P. Tahiliani wrote:
Hi,

One patch is available here: https://www.nsnam.org/wiki/Contributed_Code

- Mohit

sai rcew

unread,
Feb 12, 2019, 9:45:11 AM2/12/19
to ns-3-users
Sir im getting this error "msg="Invalid attribute set (IsMalicious) on ns3::aodv::RoutingProtocol", file=../src/core/model/object-factory.cc, line=75
terminate called without an active exception" can you help me to resolve this.

On Wednesday, March 28, 2018 at 6:37:51 PM UTC+5:30, Anto Pravin wrote:

ABHIRAJ M R

unread,
Mar 25, 2019, 5:39:07 AM3/25/19
to ns-3-users
how can we modify AODV to avoid black hole attack can you please share the codes


sujan shrestha

unread,
Mar 2, 2020, 9:23:22 AM3/2/20
to ns-3-users
could you help me, i am getting error as

sg="Invalid attribute set (IsMalicious) on ns3::aodv::RoutingProtocol", file=../src/core/model/object-factory.cc, line=89

terminate called without an active exception

your help will be appreciated. thanks

Ev A

unread,
Jan 28, 2022, 8:20:32 AM1/28/22
to ns-3-users
Hi
I need the simulation of Blackhole and Selective forwarding attack  module in ns3 using modified AODV and SAODV. Also, it must measure some of the matrices such as energy consumption, throughput, packet delivery ratio, end to end delay, precision, accuracy , recall and time overhead.

Please help me.

 Thank you

yadavdh...@gmail.com

unread,
Mar 12, 2022, 1:41:11 AM3/12/22
to ns-3-users
Hello sir
can you please share your code of black hole attack
thanks
Reply all
Reply to author
Forward
0 new messages