URGENT: Getting errors while running blackhole.cc using updated aodv protocol

140 views
Skip to first unread message

Suman Dey

unread,
Apr 17, 2024, 3:37:26 AM4/17/24
to ns-3-users
While running the file blackhole.cc through ./ns3 run scratch/blachole getting the mentioned error:

zorin:~/ns-allinone-3.41/ns-3.41$ ./ns3 run scratch/blackhole [0/2] Re-checking globbed directories... ninja: no work to do. msg="Invalid attribute set (IsMalicious) on ns3::aodv::RoutingProtocol", +0.000000000s -1 file=/home/suman/ns-allinone-3.41/ns-3.41/src/core/model/object-factory.cc, line=73 NS_FATAL, terminating terminate called without an active exception Command 'build/scratch/ns3.41-blackhole-default' died with <Signals.SIGABRT: 6>.

Can anyone please mention how to properly configure the header files and run the program properly step by step from scratch?

And also if there is any coding problem, please let me know as it is very urgen!
aodv-routing-protocol_basic.cc
aodv-routing-protocol.h
myapp.h
README.md
blackhole.cc
aodv-routing-protocol_advance.cc

Gabriel Ferreira

unread,
Apr 17, 2024, 12:51:54 PM4/17/24
to ns-3-users
The error message is telling you what's wrong. Your routing protocol has no IsMalicious attribute to set. 
Which means you either forgot to copy or implement something. 

Suman Dey

unread,
Apr 17, 2024, 1:13:33 PM4/17/24
to ns-3-users
Thanks, Gabriel for your response.

But, IsMalicious is already implemented in the aodv-routing-protocol.h and aodv-routing-protocol_basic.cc / aodv-routing-protocol_advanced.cc.

Can you please check those files once and let me know if there is something wrong or not?
Message has been deleted

Tom Henderson

unread,
Apr 17, 2024, 4:59:20 PM4/17/24
to ns-3-...@googlegroups.com, Suman Dey
IsMalicious is not part of the AODV model in the ns-3 mainline; you must
have copied the file that is using it from somewhere else.

- Tom

On 4/17/24 10:13, Suman Dey wrote:
> Thanks, Gabriel for your response.
>
> But, *IsMalicious *is already implemented in the aodv-routing-protocol.h

Suman Dey

unread,
Apr 17, 2024, 5:13:51 PM4/17/24
to ns-3-users
Thanks Tom, for your response.

Yes, you are right, the files I have attached are manually updated and specially modified for implementing blackhole attack in ns3. I have copied and replaces the updated files (.h & .cc files) at the path ns3-3.41/src/aodv/model, but still I'm facing the error. My concern is, if there are any mistakes in the header files or in my source code? 

I'll be very grateful if anyone can figure out the issue.

Thanks.

Tom Henderson

unread,
Apr 17, 2024, 5:24:16 PM4/17/24
to ns-3-...@googlegroups.com
The mistake seems to be what Gabriel and the compiler pointed out earlier-- you may think that this attribute exists but the compiler thinks otherwise, so please check that you are setting the attribute of an object of the right type that has that attribute (whether it is the 'basic' or 'advanced' variant that you describe below).

If you have a Ptr to an object and want to know the type that is instantiated, you can do this:

Ptr p = ...;
std::cout << p->GetInstanceTypeId().GetName() << std::endl;

- Tom
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/e487b1e5-9369-4d53-bd83-fc436de032adn%40googlegroups.com.


Eugene Osei-Adjapong

unread,
Jan 1, 2025, 4:06:14 AM1/1/25
to ns-3-users
Hello Suman were you able to run this attach simulation??
Reply all
Reply to author
Forward
0 new messages