modification in Blackhole attack patch

253 views
Skip to first unread message

Gopal Rawat

unread,
Apr 10, 2020, 2:13:01 PM4/10/20
to ns-3-users
Hi all,

I have used the patch for blackhole attack for a VANET scenario and it works fine on ns3.30.1. I am interested in achieving alternate packet drop so i tried modifying the aodv-routing-protocol.cc ( attached is the modified file).  I am using a  variable flag for the same. I get the following error after it builds successfully.

assert failed. cond="socket", file=../src/aodv/model/aodv-routing-protocol.cc, line=1541
terminate called without an active exception
Command ['/home/gsr/ns-allinone-3.30.1/ns-3.30.1/build/scratch/blackhole', '--RngRun=3'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

When i look for the details , i get to the point where i understand that the issue is here ;

 Ptr<Socket> socket = FindSocketWithInterfaceAddress (toDst.GetInterface ());
 NS_ASSERT
(socket);
 
  in SendReplyByIntermediateNode function. I am really lost after this. Would really appreciate any help/suggestions.
aodv-routing-protocol.cc

Gopal Rawat

unread,
Apr 11, 2020, 2:38:53 PM4/11/20
to ns-3-users
Update:

I have  managed to get rid of the error and ensure that the malicious node drops packet alternatively. The node successfully drops packet for first time and for second time when it doesn't drops packet , the packet gets dropped upon forwarding ( because no route to forward ). So i am not sure where do i need to make the changes now , in order to ensure that the packet is forwarded for second time ( like normal operation ) and dropped for first time and so on.

Attached are the modified file and sample program used.

Any suggestions on how to proceed from here ?

regards,
Gopal
blackhole.cc
aodv-routing-protocol.cc

yadavdh...@gmail.com

unread,
Mar 13, 2023, 3:33:42 AM3/13/23
to ns-3-users
Dear sir
Greetings

I am working on Blackhole attack. Please share me the patches of blackhole attack for ns3.30.1

Thanks sir
Reply all
Reply to author
Forward
0 new messages