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.