Installing ipv4 stack causing index 0 out of bounds

56 views
Skip to first unread message

Nazmul Alam

unread,
Nov 14, 2016, 10:13:01 PM11/14/16
to ns-3-users
Hi,
I have a working topology with an AP connected to a router over a switch. DHCP server is installed in AP and DHCP client is installed in client STA.
Upon leasing an IP address I am adjusting the static route on AP, Router and Server so that a STA can communicate with the server over the router.
This topology is working fine and I am able to measure the tx throughput and delay etc stuff required for my course project.

Now I have another node connected to the switch at L2. I want to make it an AP but whenever I wanted to install the Ipv4 stack and try to run the simulation It crashes after a while giving the "index 0 out of bounds". If I go ahead and configure an IP address on that interface, the simulation crashed by giving following backtrace -

0x00007ffff2674232 in std::__cxx11::_List_base<ns3::Ipv4InterfaceAddress, std::allocator<ns3::Ipv4InterfaceAddress> >::_M_node_count (this=0x20)
    at /usr/include/c++/5/bits/stl_list.h:373
#1  0x00007ffff2673802 in std::__cxx11::list<ns3::Ipv4InterfaceAddress, std::allocator<ns3::Ipv4InterfaceAddress> >::size (this=0x20)
    at /usr/include/c++/5/bits/stl_list.h:947
#2  0x00007ffff26713cb in ns3::Ipv4Interface::GetNAddresses (this=0x0)
    at ../src/internet/model/ipv4-interface.cc:304
#3  0x00007ffff2686e47 in ns3::Ipv4L3Protocol::GetNAddresses (this=0x6d36d0,
    interface=4294967295) at ../src/internet/model/ipv4-l3-protocol.cc:1149

Obviously the highlighted line is causing the crash because this value is pointing to wrong pointer.
The following code are causing the crash according to the stacktrace
  Ptr<Ipv4Interface> iface = GetInterface (interface);
  return iface->GetNAddresses ();
And I think it is because GetInterface() is returning 0 (nullptr?).

Any suggestion on where to check?

Thanks in advance.

Nazmul Alam

unread,
Nov 16, 2016, 8:21:00 PM11/16/16
to ns-3-users
Apparently, This is a bug when you try to use DHCP with GlobalRouting Enabled. DHCP is not useful for beginners like me as it causes serious problem with routing over multiple subnets.

Hope this will help people in future.

Tommaso Pecorella

unread,
Nov 17, 2016, 12:10:10 PM11/17/16
to ns-3-users
Hi Nazrul,

DHCP is still being reviewed. If you find a bug, let the devs know. However, consider that without the script we can NOT know if the bug is real or it is a coding issue in your script. For this reason it would be interesting if you could attach it.

T.

Nazmul Alam

unread,
Nov 18, 2016, 9:20:41 PM11/18/16
to ns-3-users
Hi Tommaso,
I would love to but I changed my code which was causing the crash. May be if I can replicate it I will attach it here later.
One question, if I want to include the patch for manual dissociation for StaWifiMac, what should be the process.

Thanks and regards,

Tommaso Pecorella

unread,
Nov 20, 2016, 10:21:22 AM11/20/16
to ns-3-users
Hi,

I think this is a good starting point for you: https://www.nsnam.org/developers/

Cheers,

T.

Nazmul Alam

unread,
Nov 20, 2016, 12:50:23 PM11/20/16
to ns-3-...@googlegroups.com

Thank you T.


--
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 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/XWEZjoKUhsE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages