Regarding net-anim in NS3

908 views
Skip to first unread message

psd prasad

unread,
Oct 16, 2012, 12:05:03 AM10/16/12
to ns-3-...@googlegroups.com
Hi Good morning,

is it possible to to show the LTE output in NetAnim lixe xgraph in ns2 is possible give me the guidelines 
if not then how to view the animation of LTE. suggest me any other way to show animation.

With Thanks & Regards

M. Prasad, 

Harsha Vardhan Gudivada

unread,
Oct 16, 2012, 10:16:07 AM10/16/12
to ns-3-...@googlegroups.com
Hi,
   
  Steps to view the LTE animation in netanim:
1. In the main function declare a string variable as shown below:
std::string animFile = "any name.xml";

2. Just before the code which starts the simulation, add these lines as shown below.
  
  AnimationInterface anim (animFile);
  Simulator::Stop(Seconds(simTime));
  Simulator::Run();

These steps will create a xml file which is later used by Netanim to view the simulation.

I guess you had already installed netanim animator. Start the animator, open the xml created in above steps. Then you may play with it. I am also a beginner. I am attaching a pdf which clearly explains about looking at the animation very clearly using netanim.




--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.



--
Regards
G.Harsha Vardhan
BTech 4th year
Department of CSE
IIT Hyderabad
India

ns-3-model-library.pdf

Rishu Chhabra

unread,
Apr 15, 2013, 4:28:52 AM4/15/13
to ns-3-...@googlegroups.com

Hi,

I am using ns2 mobility helper but when i run the command
./waf --run "scratch/ns2-mobility-trace --traceFile=/home/rishu/mobility.tcl --nodeNum=150 --duration=90.0 –logFile=/home/rish/main-ns2-mob.log"


the file main-ns2-mob.log is not created and then when i open the .xml file in Netanim...no nodes show up and the simulation completes...???

Konstantinos

unread,
Apr 15, 2013, 9:15:21 AM4/15/13
to ns-3-...@googlegroups.com
Does it give you any other output on the command line? For example any errors that the file could not be parsed or something like that?

Rishu Chhabra

unread,
Apr 16, 2013, 5:36:33 AM4/16/13
to ns-3-...@googlegroups.com
Hi,

there is no error and i get the output given below


Waf: Entering directory `/home/rishu/repos/ns-3-allinone/ns-3-dev/build'
Waf: Leaving directory `/home/rishu/repos/ns-3-allinone/ns-3-dev/build'
'build' finished successfully (4.700s)
Usage of /home/rishu/repos/ns-3-allinone/ns-3-dev/build/scratch/ns2-mobility-trace :

./waf --run "ns2-mobility-trace --traceFile=src/mobility/examples/default.ns_movements --nodeNum=2 --duration=100.0 --logFile=ns2-mob.log"

NOTE: ns2-traces-file could be an absolute or relative path. You could use the file default.ns_movements
      included in the same directory of this example file.

NOTE 2: Number of nodes present in the trace file must match with the command line argument and must
        be a positive number. Note that you must know it before to be able to load it.

NOTE 3: Duration must be a positive number. Note that you must know it before to be able to load it.

Rishu Chhabra

unread,
Apr 16, 2013, 6:26:56 AM4/16/13
to ns-3-...@googlegroups.com
actually i tried modifying the ns2-mobility-trace file....and the logfile empty() was returning true...and then i checked the output...so mobility model for few nodes is not defined....so i will check for that now

Konstantinos

unread,
Apr 16, 2013, 7:12:56 AM4/16/13
to ns-3-...@googlegroups.com
You have a major error. The program hasn't run. Probably you missed one of the required command line attributes.

You should run it using this format for the command as suggested:

./waf --run "ns2-mobility-trace --traceFile=src/mobility/examples/default.ns_movements --nodeNum=2 --duration=100.0 --logFile=ns2-mob.log" 

where src/mobility/examples/default.ns_movements should be the path to your trace file, give the number of nodes with --nodeNum, the duration of the simulation and the output file name.

Rishu Chhabra

unread,
Apr 23, 2013, 6:41:05 AM4/23/13
to ns-3-...@googlegroups.com
hi,

can u please tell me that the trace file is the .tcl file which i generated using trace exporter coz i used SUMO and converted .sumo.tr into netstate.xml and then further converted it into 3 .tcl files(mobility.tcl, activity.tcl and config.tcl)

and then  i copied mobility.tcl into scratch and changed the extension to .ns_movements and then ran the command

 

./waf --run "scratch/ns2-mobility-trace --traceFile=scratch/mobility.ns_movements --nodeNum=200 --duration=999.0 –logFile=/home/rishu/ns2-mob.log"


and I am getting the error ---"Log file not created"


I edited ns2-mobility-trace

if (logFile.empty ())
{ std::cout<<"Log file is not created";
return 0;
}



please help me with this and I am stuck and not able to proceed further with my work.

Konstantinos

unread,
Apr 23, 2013, 10:43:46 AM4/23/13
to ns-3-...@googlegroups.com
1) You do not have to change the ending from .tcl to .ns_movements
2) Where do you have this check for the logFile.empty() ? Is is before or after the Simulator::Run()?

Rishu Chhabra

unread,
Apr 24, 2013, 12:16:17 AM4/24/13
to ns-3-...@googlegroups.com
Please find attached ns2-mobility-trace.cc
ns2-mobility-trace.cc

Rishu Chhabra

unread,
Apr 24, 2013, 1:06:03 AM4/24/13
to ns-3-...@googlegroups.com
Sir,

I solved the problem and now i have the .log file.....so can you please tell me how to use that log file to obtain the results in ns-3



On Tuesday, October 16, 2012 9:35:06 AM UTC+5:30, prasad wrote:

GAURAV JAIN

unread,
Jul 2, 2013, 1:01:27 AM7/2/13
to ns-3-...@googlegroups.com
Hi Rishu

You have a problem in your command line arguments.
you probably have modified the mobility-trace.cc file according to your needs of vehicular network.
But if you go through the file, you ll see that the output which you get is in the case, when it has read the file,
however it didnot find any node to create and move.

Check your .tcl file and do one thing,  copy your .tcl file in some directory other than ns-3 and give its
complete path and save the logFile in the same directory.

Gaurav Jain
Reply all
Reply to author
Forward
0 new messages