ns2-mob.log and ns2-mobility-trace.cc in ns3

1,216 views
Skip to first unread message

Imene Boucetta

unread,
Apr 11, 2013, 9:21:20 AM4/11/13
to ns-3-...@googlegroups.com
HI,

so , i executed ns2-mobility-trace.cc in examples/mobility with my own file default.ns_movements (I've changed the extension .tcl to .ns2-mobility-trace.cc ) , it generate a file named ns2-mob.log.


my question is how to use the file generated in ns3 (
simulation of the mobility) is there any tutorials or sites that explain it ?


Thank you very much.


Cordially


Boucetta
Imene

Konstantinos

unread,
Apr 11, 2013, 9:38:34 AM4/11/13
to ns-3-...@googlegroups.com
Dear Imene,

What do you want to do? If you just wanted to use the ns-2 mobility file (.tcl file) inside ns-3 so that the nodes will move based on the ns-2 file, then you have done it.
You do not need to do something else with the ns2-mob.log. This is just an output from the ns2-mobility-trace.cc file that prints the position of the nodes. 

Regards,
Konstantinos

imene boucetta

unread,
Apr 11, 2013, 4:59:03 PM4/11/13
to ns-3-...@googlegroups.com
yes but when i tried to show mobility with netanim , it doesn't work it stays static :( and the nodes are not mobile , why ?


2013/4/11 Konstantinos <dinos.k...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/BDKWGB-pthE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Konstantinos

unread,
Apr 11, 2013, 5:02:58 PM4/11/13
to ns-3-...@googlegroups.com
which file do you use in netanim and are you sure that the .tcl file has moving nodes?

imene boucetta

unread,
Apr 11, 2013, 5:16:49 PM4/11/13
to ns-3-...@googlegroups.com
i used ns2-mobility-trace.cc in examples & for the tcl trace file i'm sure
nodes are moving , to ensure i would like to join you my .tcl file but it's to large for google groups i see so how ?  , i don't know how to use
ns-2  to verify it by my self but when reading the file i think it's moving
...


2013/4/11 Konstantinos <dinos.k...@gmail.com>

Konstantinos

unread,
Apr 11, 2013, 5:31:01 PM4/11/13
to ns-3-...@googlegroups.com
So, in order to visualize it in NetAnim add the following in the source code:

#include "ns3/netanim-module.h"

 AnimationInterface anim ("netanim-file.xml");

and in NetAnim open the netanim-file.xml that is created.

imene boucetta

unread,
Apr 11, 2013, 5:35:08 PM4/11/13
to ns-3-...@googlegroups.com
i did it with netanim and the nodes doesn't move ....... is there a possible probleme in converting tcl trace file to ns-3 with ns2-mobility trace ?


2013/4/11 Konstantinos <dinos.k...@gmail.com>

Konstantinos

unread,
Apr 11, 2013, 5:47:23 PM4/11/13
to ns-3-...@googlegroups.com
No, there is no problem with that. There are a lot of people using it (me included).
There are some limitations in the commands that ns2mobilityhelper can parse which are included in the documentation.

imene boucetta

unread,
Apr 11, 2013, 5:54:08 PM4/11/13
to ns-3-...@googlegroups.com
mmmm i used it for 360 nodes and 1000 micro-seconds of simulation ....10000 m and 4 lanes ....(VANET's) :


there is an extract from my tcl file :


$node_(0) set X_ 5088.0
$node_(0) set Y_ 10.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 490.0
$node_(1) set Y_ 0.0
$node_(1) set Z_ 0.0
$node_(2) set X_ 3542.0
$node_(2) set Y_ 20.0
$node_(2) set Z_ 0.0
$node_(3) set X_ 1000.0
$node_(3) set Y_ 20.0
$node_(3) set Z_ 0.0
$node_(4) set X_ 5486.0
$node_(4) set Y_ 20.0
$node_(4) set Z_ 0.0
$node_(5) set X_ 1571.0
$node_(5) set Y_ 20.0
$node_(5) set Z_ 0.0
*****************************
$ns_ at 1.0 "$node_(0) setdest 5105.697266 10.0 0.0" 
$ns_ at 1.0 "$node_(1) setdest 503.640259 0.0 0.0" 
$ns_ at 1.0 "$node_(2) setdest 3557.053223 20.0 0.0" 
$ns_ at 1.0 "$node_(3) setdest 1024.482910 20.0 0.0" 
$ns_ at 1.0 "$node_(4) setdest 5511.041992 20.0 0.0" 
$ns_ at 1.0 "$node_(5) setdest 1587.031738 20.0 0.0"
************************************
$ns_ at 2.0 "$node_(0) setdest 5123.394531 10.0 0.0" 
$ns_ at 2.0 "$node_(1) setdest 517.280518 0.0 0.0" 
$ns_ at 2.0 "$node_(2) setdest 3572.106445 20.0 0.0" 
$ns_ at 2.0 "$node_(3) setdest 1048.965820 20.0 0.0" 
$ns_ at 2.0 "$node_(4) setdest 5536.083984 20.0 0.0" 
$ns_ at 2.0 "$node_(5) setdest 1603.063477 20.0 0.0"

**************************************
$ns_ at 3.0 "$node_(0) setdest 5141.091797 10.0 0.0" 
$ns_ at 3.0 "$node_(1) setdest 530.920776 0.0 0.0" 
$ns_ at 3.0 "$node_(2) setdest 3587.159668 20.0 0.0" 
$ns_ at 3.0 "$node_(3) setdest 1073.448730 20.0 0.0" 
$ns_ at 3.0 "$node_(4) setdest 5561.125977 20.0 0.0" 
$ns_ at 3.0 "$node_(5) setdest 1619.095215 20.0 0.0"

etc ...etcc until  938.000000 time simulation is the syntax of my file right ?


 


2013/4/11 Konstantinos <dinos.k...@gmail.com>

Konstantinos

unread,
Apr 11, 2013, 6:02:04 PM4/11/13
to ns-3-...@googlegroups.com

http://www.nsnam.org/doxygen/classns3_1_1_ns2_mobility_helper.html

Valid trace files use the following ns2 statements:

  $node set X_ x1
  $node set Y_ y1
  $node set Z_ z1
  $ns at $time $node setdest x2 y2 speed
  $ns at $time $node set X_ x1
  $ns at $time $node set Y_ Y1
  $ns at $time $node set Z_ Z1

It seems that you have " .. " (quotes) so the file might not be parsed correctly. This should be outputted in the console when you run the problem.
something like "unrecognised command"

imene boucetta

unread,
Apr 11, 2013, 6:08:19 PM4/11/13
to ns-3-...@googlegroups.com
ok i'll try it thanks , i must read it carefully ... just a little question what it x2 and y2 ?


2013/4/11 Konstantinos <dinos.k...@gmail.com>

Konstantinos

unread,
Apr 11, 2013, 6:20:21 PM4/11/13
to ns-3-...@googlegroups.com
Read the documentation I posted. It's just the destination position of the node (x2, y2)

imene boucetta

unread,
Apr 11, 2013, 6:30:59 PM4/11/13
to ns-3-...@googlegroups.com
ok ok thank you very much Kanstantinos ^_^ i'll try it after completing the documentation


2013/4/11 Konstantinos <dinos.k...@gmail.com>

dio...@gmail.com

unread,
Apr 12, 2013, 12:39:18 PM4/12/13
to ns-3-...@googlegroups.com
Hi Imene,

The format of the trace file is OK.

Now you need to do the following for loading the .ns_movements that contains the mobility trace for your ns-3 simulation:

    string traceFile = "folder_trace_file_in_your_disk.ns_movements";
    Ns2MobilityHelper ns2 = Ns2MobilityHelper(traceFile);
    ns2.Install();

Best

Rishu Chhabra

unread,
Apr 15, 2013, 4:29:54 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...???

imene boucetta

unread,
Apr 15, 2013, 4:56:45 AM4/15/13
to ns-3-...@googlegroups.com
hi,

try to change the extention (.tcl) to (.ns_movements) and try to put it in the scratch folder ;)

Cordially


2013/4/15 Rishu Chhabra <rish...@gmail.com>
--

Rishu Chhabra

unread,
Apr 16, 2013, 5:43:24 AM4/16/13
to ns-3-...@googlegroups.com
i did that and also copied it to scratch still no main-ns2-mob.log??? please guide me with this

Rishu Chhabra

unread,
Apr 16, 2013, 6:02:50 AM4/16/13
to ns-3-...@googlegroups.com
in which file do we need to add this code????

string traceFile = "folder_trace_file_in_your_

imene boucetta

unread,
Apr 16, 2013, 3:42:44 PM4/16/13
to ns-3-...@googlegroups.com
Hi

I think you(ll fined ns-mob.log in ns-3.XX folder and not in the scratch folder ... have a look if you used ns2-mobility-trace :)

Regards


2013/4/16 Rishu Chhabra <rish...@gmail.com>

DEEPAK PUTHAL

unread,
Nov 26, 2013, 3:42:54 AM11/26/13
to ns-3-...@googlegroups.com
Hello,

Can you please help me regarding: include the mobility file in LTE implimentation. 

I want to add this mobility file during "NodeContainer ueNodes" and extract node to establish the connectivity with enb node.

Thanks,
Deepak

imene boucetta

unread,
Nov 26, 2013, 2:30:30 PM11/26/13
to ns-3-...@googlegroups.com
Hi,
it have been far i didn't use ns 3 , but the ns mobility trace generate a file that we can't use, but you can write a program and visualize your traffic (exchanged packet) in your simulation for me it was (nam).

if any question please e-mail me ^_^

Best Regards

Boucetta Sara Imene


2013/11/26 DEEPAK PUTHAL <dput...@gmail.com>

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--

Best Regards

Boucetta Sara Imene

aka...@mtu.edu

unread,
Jun 21, 2017, 3:31:14 PM6/21/17
to ns-3-users
Hi, I tried running the following command:

./waf --run "ns2-mobility-trace --traceFile=mobility.tcl --nodeNum=150 --duration=90.0 --logFile=main-ns2-mob.log"

The problem is that the log file is generated but I didn't get any animation file ("animation.xml") to run. I tried looking up for the file on the system but couldn't locate it any where. Even tried restarting the system and looking for it.

I have already included the following command in the ns2-mobility-trace.cc :

 #include "ns3/netanim-module.h"

  ns3::AnimationInterface anim ("animation.xml");

aka...@mtu.edu

unread,
Jun 21, 2017, 3:31:59 PM6/21/17
to ns-3-users
Hi, I tried running the following command:

./waf --run "ns2-mobility-trace --traceFile=mobility.tcl --nodeNum=150 --duration=90.0 --logFile=main-ns2-mob.log"

The problem is that the log file is generated but I didn't get any animation file ("animation.xml") to run. I tried looking up for the file on the system but couldn't locate it any where. Even tried restarting the system and looking for it.

I have already included the following command in the ns2-mobility-trace.cc :

 #include "ns3/netanim-module.h"

  ns3::AnimationInterface anim ("animation.xml");

aka...@mtu.edu

unread,
Jun 21, 2017, 3:32:26 PM6/21/17
to ns-3-users
Hi, I tried running the following command:

./waf --run "ns2-mobility-trace --traceFile=mobility.tcl --nodeNum=150 --duration=90.0 --logFile=main-ns2-mob.log"

The problem is that the log file is generated but I didn't get any animation file ("animation.xml") to run. I tried looking up for the file on the system but couldn't locate it any where. Even tried restarting the system and looking for it.

I have already included the following command in the ns2-mobility-trace.cc :

 #include "ns3/netanim-module.h"

  ns3::AnimationInterface anim ("animation.xml");

On Thursday, April 11, 2013 at 5:47:23 PM UTC-4, Konstantinos wrote:

Xiang Ding

unread,
Jun 22, 2017, 6:56:48 PM6/22/17
to ns-3-users
Hi,

You could try put the ns3::AnimationInterface.anim("animation.xml"); just before Simulator::Run();.

Best,
DX

在 2017年6月22日星期四 UTC+8上午3:32:26,aka...@mtu.edu写道:
Reply all
Reply to author
Forward
0 new messages