Simulation can't stop, how to know what's left in the event set of the simulation core?

28 views
Skip to first unread message

Boyce Field

unread,
Mar 6, 2016, 7:50:25 AM3/6/16
to ns-3-users
I've wrote a simulate script as in the attached file "simu.cc" which is almost copyed from "first.cc" and "src/examples/wireless/wifi-ap.cc" . It can't stop when I run it.

I'v try to find the reason:
1.  Print the log to find out what's going on in the simulation using "export 'NS_LOG=*=level_all|prefix_func'" and "./waf --run simu". The problem is that the log is too many to understand as the simulation core is not fully describled in the manual.
2.  Using debug to find the underlying data structure, but it's also difficult for me.

I also find a similar problem, but I'm sure that all the time sequence is correct in my script.

There're must be some events in the simulation core, and is there some way to find it?

Could anyone tell me how to deal with it or help me to correct it?
simu.cc

Tommaso Pecorella

unread,
Mar 6, 2016, 8:20:46 AM3/6/16
to ns-3-users
Hi,

no need to use core module, or to go too deep into the simulation. Just use your logic. If the simulation doesn't stop and the applications are not generating packets, there must be something else.
Now, since you don't have FlowMonitor (which has its own internal timers preventing the simulation automatic stop) or any other packet generation system... or not ?

FlowMonitor: no, it's not there.
BUT you have an AP, and APs do something: they generate beacons (periodically). Just enable pcaps to see them.

The solution ?
Simulation::Stop (Seconds (something));
before Simulation::Start().

Cheers,

T.

Boyce Field

unread,
Mar 6, 2016, 8:34:48 AM3/6/16
to ns-3-users
I feel a little embarrassed because the solution seems so apparently. But thank you anyway.

Tommaso Pecorella

unread,
Mar 6, 2016, 12:27:52 PM3/6/16
to ns-3-users
Everything is easy if you know how to do it.
That's why students should always do some practice, just reading about something doesn't give the measure of how hard it is.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages