Aodv Ipv6 AggregateObject issue

108 views
Skip to first unread message

Shashidhar B.L

unread,
Apr 13, 2015, 6:14:11 AM4/13/15
to ns-3-...@googlegroups.com
Hi,
In the aodv-helper class, I have introduced an object aodv6helper, which is a helper to install aodv ipv6 routing on nodes. When assigning the routing protocol to the nodes, during simulation, a pointer to the nodes has to be created and this has to be aggregated with the designed routing protocol i.e During simulation I have to make use of the "SetRoutingHelper", where i disable ipv4, inturn enabling only ipv6 and install this on the nodecontainer. But when i do this, the aodv-helper is not able to aggregate the pointer to routing protocol and the node pointer. To be more specific, please see this piece of code

Ptr<Ipv6RoutingProtocol>
Aodv6Helper::Create (Ptr<Node> node) const
{
  Ptr<aodv::RoutingProtocol6> agent = m_agentFactory.Create<aodv::RoutingProtocol6> ();
  node->AggregateObject (agent);
  return agent;
}

Where RoutingProtocol6 is the Ipv6 aodv routing protocol.

When i run the simulation i get a segmentation fault. I used gdb to debug it and it points to " node->AggregateObject (agent);" which inturn points to NS_ASSERT (!o->m_disposed); of the function AggregateObject. 

In my understanding, its not able to aggregate the two objects of node and agent because the object agent is not disposed (Please correct me if i am wrong). I am not able to find a solution to this issue, any suggestions could be of great help. 

Thanks in advance
Regards
Shashidhar B.L

Shashidhar B.L

unread,
Apr 13, 2015, 7:37:13 AM4/13/15
to ns-3-...@googlegroups.com
Hi,
Sorry, in the last two lines I meant that the object agent has been disposed. 

Void 
Object::AggregateObject (Ptr<Object> o)
{
  NS_LOG_FUNCTION (this << o);
  NS_ASSERT (!m_disposed);
  NS_ASSERT (!o->m_disposed);
  NS_ASSERT (CheckLoose ());
  NS_ASSERT (o->CheckLoose ());......

Here we can see that the   NS_ASSERT (!o->m_disposed); fails when condition in ASSERT fails, i.e when !o->m_disposed is false, meaning o->m_disposed is true. Which means that the DoDispose function is called for the object agent.

So, the object agent is already disposed, so it is not able to aggregate the objects.

Regards
Shashidhar B.L

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/EY6MD2W2qwo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Tommaso Pecorella

unread,
Apr 13, 2015, 1:15:33 PM4/13/15
to ns-3-...@googlegroups.com
Hi,

that assert means that the object is not anymore used, which is near-to-impossible.
I'm more inclined to think that there's a problem elsewhere.

Just a question. When you say "During simulation I have to make use of the "SetRoutingHelper"", you mean before using Simulator::Run, right ?
Moreover, please remember that there's no need to disable IPv4. Your nodes should be able to use AODV6 and have IPv4 without problems.
The choice to enable or disable IPv4 should be left to the user.

Cheers,

T.

Shashidhar B.L

unread,
Apr 13, 2015, 4:06:53 PM4/13/15
to ns-3-...@googlegroups.com
Hi,
Thank you for your response Tommaso.
I was unable to figure out why the assert is failing, like you said, something is quite not right. The "elsewhere" part am trying to figure out, have a feeling that some connection is missing between the internet stack and routing.

And yes, i meant SetRoutingHelper before Simulator::Run (improper sentence formation).

I will try to recheck the routing protocol implementation to make sure i havent missed anything. Meanwhile can you suggest any other way to debug this? probably point me to a direction which could lead me to the actual source of problem. It would be really helpful.

Regards
Shashidhar B.L

Tommaso Pecorella

unread,
Apr 13, 2015, 4:49:59 PM4/13/15
to ns-3-...@googlegroups.com
Hi,

the most "stupid" thing (I did it myself). Double check the class TypeId structure, a common mistake is a typo in the constructor name.

Cheers,

T.

Shashidhar B.L

unread,
Apr 14, 2015, 3:28:39 AM4/14/15
to ns-3-...@googlegroups.com
Hi,
That is indeed a common mistake, I had done it too and corrected it, also that will throw a build error. This is a run time error. 

Thank you
Regards
Shashidhar B.L

Shashidhar B.L

unread,
Apr 14, 2015, 5:57:15 AM4/14/15
to ns-3-...@googlegroups.com
Hi,
I resolved the problem. Indeed i made the same stupid mistake which you had pointed to, but slightly different, there was a mismatch in setting the parent. Am absolutely shocked that i dint get an error for that before.

For everyone reading this post, please ensure you double check this "TypeId", can make a simple error look like a disastrous fault of yours.

Thank you very much Tommaso for your response, it was really helpful. 

Regards
Shashidhar B.L

Tommaso Pecorella

unread,
Apr 14, 2015, 6:06:37 AM4/14/15
to ns-3-...@googlegroups.com
Hi,

I'm glad you fixed it. And no, it can't find it at compilation time. The TypeId is just a data structure, and you see what's wrong with it only when you try to build an object.
Only a different language than C++ could have helper, e.g., LIST or ObjectiveC, but that's another story (and the error wouldn't have been singled at compilation time anyway).

Cheers,

T.

Thomas

unread,
Aug 5, 2021, 11:03:19 AM8/5/21
to ns-3-users
Dear Shashidhar,
I am currently doing my research in networks. In my scenario, when using AODV protocol, i have to convert ipv4 address to ipv6 address to be displayed by the routing table. But it is not an easy task of conversion. I searched every where but only disappointment for me and desperate. You use AODV with ipv6 address, how did you manage  to do it. can you share the source code, so that it will be helpful for me in my research. Thanks a lot.
Reply all
Reply to author
Forward
0 new messages