Problems when use Spectrum Module. (Working right with Yans Module)

155 views
Skip to first unread message

ROCIO MARTINEZ MARTINEZ

unread,
Sep 30, 2020, 6:08:19 AM9/30/20
to ns-3-users

Hi everyone,

When I run the following code, I get the next fail: assert failed. cond="uid <= m_information.size () && uid != 0", file=../src/core/model/type-id.cc, line=458
terminate called without an active exception

The thing is that when I run the same code but using the Yans Module instead of the Spectrum one I get the program is runing okey. I only change the YansWifiPhyHelper for the SpectrumWifiPhyHelper, and the YansWifiChannelHelper for the SpectrumChannelHelper



NodeContainer Mynodes;
Mynodes.Create(4);

//PHY LAYER CONFIGURATION

SpectrumWifiPhyHelper spectrumPhy1 =  SpectrumWifiPhyHelper::Default ();

spectrumPhy1.Set ("TxPowerStart",DoubleValue (23.0));  
spectrumPhy1.Set ("TxPowerEnd", DoubleValue (23.0));
spectrumPhy1.Set ("RxNoiseFigure", DoubleValue (9));
spectrumPhy1.Set ("Frequency", UintegerValue (5860));
spectrumPhy1.Set ("CcaEdThreshold", DoubleValue (-85));
spectrumPhy1.Set ("RxSensitivity", DoubleValue (-85));

//CHANNEL CONFIGURATION

SpectrumChannelHelper SpChannel1 = SpectrumChannelHelper::Default();

SpChannel1.AddPropagationLoss ("ns3::FriisPropagationLossModel", "Frequency", DoubleValue (5.860e9));
SpChannel1.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");

Ptr<SpectrumChannel> SpChannelsm1 = SpChannel1.Create();

spectrumPhy1.SetChannel(SpChannelsm1);

NetDeviceContainer devices_spectrum1;
devices_spectrum1 = wifi.Install(spectrumPhy1, wifiMac, Mynodes);

InternetStackHelper internet;
internet.Install(Mynodes);


//ASSIGN IP ADDRESSES

Ipv4AddressHelper address;
NS_LOG_INFO("assign IP Addresses");

address.SetBase("10.0.0.0", "255.255.0.0");
Ipv4InterfaceContainer allInterfaces_spectrum1;
allInterfaces_spectrum1 = address.Assign(devices_spectrum1);



I have tried many different options but but I have not been able to solve it. Would someone here know what could be happening?

Thanks in advance,

Rocío

Matteus Montada

unread,
Sep 30, 2020, 7:38:56 AM9/30/20
to ns-3-users
I don't know the exact problem, but using gdb could help you understand whats happening.

Use the --gdb when running your script.

Then write run in the gdb console when it appears.
Wait until the error happens and write "where". this will print a trace that will tell you exactly where is the problem and may lead you to the concept problem in the script.

Cheers

ROCIO MARTINEZ MARTINEZ

unread,
Sep 30, 2020, 1:40:11 PM9/30/20
to ns-3-users
Hi,

First of all thank you for the help. I've follow your steps and I get the following trace:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff3408859 in __GI_abort () at abort.c:79
#2  0x00007ffff3802951 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff380e47c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff380e4e7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff54d814c in ns3::GlobalRouter::AnotherRouterOnLink (this=0x555555608760, nd=...) at ../src/internet/model/global-router-interface.cc:1480
#6  0x00007ffff54ced0b in ns3::GlobalRouter::ProcessSingleBroadcastLink (this=0x555555608760, nd=..., pLSA=0x5555556bd390, c=...) at ../src/internet/model/global-router-interface.cc:801
#7  0x00007ffff54ce24a in ns3::GlobalRouter::ProcessBroadcastLink (this=0x555555608760, nd=..., pLSA=0x5555556bd390, c=...) at ../src/internet/model/global-router-interface.cc:756
#8  0x00007ffff54cd357 in ns3::GlobalRouter::DiscoverLSAs (this=0x555555608760) at ../src/internet/model/global-router-interface.cc:697
#9  0x00007ffff54eaeb4 in ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase (this=0x5555556bcda0) at ../src/internet/model/global-route-manager-impl.cc:642
#10 0x00007ffff54e348d in ns3::GlobalRouteManager::BuildGlobalRoutingDatabase () at ../src/internet/model/global-route-manager.cc:50
#11 0x00007ffff550bbf7 in ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables () at ../src/internet/helper/ipv4-global-routing-helper.cc:63
#12 0x0000555555569b49 in main (argc=1, argv=0x7fffffffdea8) at ../scratch/spectrumRO.cc:323


The corresponding line (323) of my script spectrumRo is the one when I do:  Ipv4GlobalRoutingHelper::PopulateRoutingTables();
I do that after assign the Ip adresses. I also put a break point in the ipv4-global-routing-helper.cc file because I work with eclipse but I cannot see anyway where is the problem.

Thanks in advance,

Rocío

Tom Henderson

unread,
Sep 30, 2020, 2:15:09 PM9/30/20
to ns-3-...@googlegroups.com, ROCIO MARTINEZ MARTINEZ
On 9/30/20 3:08 AM, ROCIO MARTINEZ MARTINEZ wrote:
>
> Hi everyone,
>
> When I run the following code, I get the next fail: assert failed.
> cond="uid <= m_information.size () && uid != 0",
> file=../src/core/model/type-id.cc, line=458
> terminate called without an active exception
>
> The thing is that when I run the same code but using the Yans Module
> instead of the Spectrum one I get the program is runing okey. I only
> change the YansWifiPhyHelper for the SpectrumWifiPhyHelper, and the
> YansWifiChannelHelper for the SpectrumChannelHelper

The above error message is typically due to trying to create an object
from an object factory that hasn't been set with a TypeId yet.

For instance, if you forgot to do this:

SpectrumChannelHelper SpChannel1 = SpectrumChannelHelper::Default();

and instead did this:

SpectrumChannelHelper SpChannel1;
Ptr<SpectrumChannel> SpChannelsm1 = SpChannel1.Create();

you may get this error.

Note, if you had this line of code:
YansWifiChannelHelper wifiChannel;

and just changed it to

SpectrumChannelHelper wifiChannel;

and tried to use it that way, you would get such an error. The
SpectrumChannelHelper requires calling Default() or otherwise setting
the channel type ID explicitly.

Regarding your other error with global routing, I do not know offhand,
but please note that Ipv4GlobalRouting is designed to work with wired
and not wireless links. If you need IP routing over Wi-Fi networks, you
should consider to use OLSR.

- 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
> <mailto:ns-3-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/e3965e6e-4ef0-486c-a9b6-a4686cb81047n%40googlegroups.com
> <https://groups.google.com/d/msgid/ns-3-users/e3965e6e-4ef0-486c-a9b6-a4686cb81047n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rediet

unread,
Oct 1, 2020, 3:24:40 AM10/1/20
to ns-3-users
Hi Rocio, Tom,

Le mercredi 30 septembre 2020 à 20:15:09 UTC+2, Tom Henderson a écrit :

Regarding your other error with global routing, I do not know offhand,
but please note that Ipv4GlobalRouting is designed to work with wired
and not wireless links. If you need IP routing over Wi-Fi networks, you
should consider to use OLSR.

 A workaround I had employed for using global routing with SpectrumWifiPhy is to schedule the routing operation after the initialization. This is because, as Tom explained, the spectrum channel evaluates receivers upon Initialize call. You can define a function, that is scheduled through ScheduleNow, that simply calls the PopulateRoutingTables method.

Rediet

ROCIO MARTINEZ MARTINEZ

unread,
Oct 1, 2020, 11:51:46 AM10/1/20
to ns-3-users
Thank you very much to both,

I have change a few things of the SpectrumChannel: the SpectrumChannelHelper for the MultiModelSpectrumChannelHelper and some atributes. Also I have define a function where I call the PopulateRoutingTables method through ScheduleNow and now the script is working right.

Best regards,

Rocio
Reply all
Reply to author
Forward
0 new messages