Trouble with 3 LAN csma multicast topology

147 views
Skip to first unread message

Gopika Pai

unread,
Aug 2, 2014, 5:52:08 AM8/2/14
to ns-3-...@googlegroups.com
Hi,


I am trying to simulate a three LAN topology ( A slight variant of the example src/csma/examples/csma-multicast.cc) of  where:

-Multicast source is at node n0
-Multicast forwarded by node n2 to LAN1 and n4 to LAN2
-Nodes n0, n1, n2, n3, n4, n5 and n6 receive the multicast frames.
-Node n6 listens for the data

I have not written any extra code other than those required to create the LANs, nodecontainers and nodes.(I modified csma-multicast.cc) The modified code is attached herewith.
It would of great help if you could point out the mistake I'm making(frankly, I'm not able to figure out anything wrong)
I tried to run the program, I got the following error.

Waf: Entering directory `/home/gopika/jujo/ns-allinone-3.20/ns-3.20/build'
[1605/1747] cxx: scratch/poj1.cc -> build/scratch/poj1.cc.2.o
[1720/1747] cxxprogram: build/scratch/poj1.cc.2.o -> build/scratch/poj1
Waf: Leaving directory `/home/gopika/jujo/ns-allinone-3.20/ns-3.20/build'
'build' finished successfully (3.146s)
Create nodes.
Build Topology.
Add IP Stack.
Assign IP Addresses.
Configure multicasting.
assert failed. cond="interface >= 0", msg="Ipv4StaticRoutingHelper::AddMulticastRoute():Expected an interface associated with the device nd", file=../src/internet/helper/ipv4-static-routing-helper.cc, line=106
terminate called without an active exception
Command ['/home/gopika/jujo/ns-allinone-3.20/ns-3.20/build/scratch/poj1'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").


Then I tried to run it under a debugger, when I got the following message :


Waf: Entering directory `/home/gopika/jujo/ns-allinone-3.20/ns-3.20/build'
Waf: Leaving directory `/home/gopika/jujo/ns-allinone-3.20/ns-3.20/build'
'build' finished successfully (1.105s)
.......
Reading symbols from /home/gopika/jujo/ns-allinone-3.20/ns-3.20/build/scratch/poj1...done.
(gdb) run
Starting program: /home/gopika/jujo/ns-allinone-3.20/ns-3.20/build/scratch/poj1 \<args\>
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Create nodes.
Build Topology.
Add IP Stack.
Assign IP Addresses.
Configure multicasting.
assert failed. cond="interface >= 0", msg="Ipv4StaticRoutingHelper::AddMulticastRoute():Expected an interface associated with the device nd", file=../src/internet/helper/ipv4-static-routing-helper.cc, line=106
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00007fffeb850f79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007fffeb850f79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007fffeb854388 in __GI_abort () at abort.c:89
#2  0x00007fffec37a6b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fffec378836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fffec378863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff2d4dbb3 in ns3::Ipv4StaticRoutingHelper::AddMulticastRoute (this=0x7fffffffd3e0, n=..., source=..., group=..., input=..., output=...)
    at ../src/internet/helper/ipv4-static-routing-helper.cc:104
#6  0x000000000040aa3b in main (argc=2, argv=0x7fffffffdca8) at ../scratch/poj1.cc:129


Thanks,
Gopika
poj1.cc

Tommaso Pecorella

unread,
Aug 3, 2014, 5:52:45 AM8/3/14
to ns-3-...@googlegroups.com
Hi,

I can't check for sure, but I have a clue. Please check it and let us know if it fixes the problem.

The clue is: interfaces aren't added to IP as soon as they're created. They're added during the simulation startup. As a consequence, AddMulticastRoute is failing, simply because the interfaces aren't there (yet).

Try scheduling the AddMulticastRoute after the Simulation start, e.g., at second 0.0001.

Hope it fixes, let us know.

Cheers,

T


On Saturday, August 2, 2014 11:52:08 AM UTC+2, Gopika Pai wrote:
Hi,


I am trying to simulate a three LAN topology ( A slight variant of the example src/csma/examples/csma-multicast.cc) of  where:

-Multicast source is at node n0
-Multicast forwarded by node n2 to LAN1 and n4 to LAN2
-Nodes n0, n1, n2, n3, n4, n5 and n6 receive the multicast frames.
-Node n6 listens for the data

I have not written any extra code other than those required to create the LANs, nodecontainers and nodes.(I modified csma-multicast.cc) The modified code is attached herewith.
It would of great help if you could point out the mistake I'm making(frankly, I'm not able to figure out anything wrong)
I tried to run the program, I got the following error.

[...] 

Thanks,
Gopika
Reply all
Reply to author
Forward
0 new messages