Bug 1316 - ns-2 mobility helper improvements
ns-2 mobility helper improvements
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: mobility models
pre-release
All All
: P5 normal
Assigned To: Pavel Boyko
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-16 14:51 EST by Tom Henderson
Modified: 2014-04-15 19:01 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2011-12-16 14:51:46 EST
Reported on ns-developers list on 16 Dec 2011:

First:
For Ns2MobilityHelper to work, we need to put
the first position lines at the beginning of the file.
That is, the following lines have to be at the beginning.
Some tools generate a ns-2 TCL file with these lines
at the end. So many users will forget to move them
at the beginning of the TCL file and have an
erroneous movement for nodes.
$node_(0)   set X_   <initPositionX>
$node_(0)   set Y_    <initPositionY>
$node_(0)   set Z_    0.0

Second:
Due to rounding error, the node get away from the
movement it should do. I used the TCL file than
Nicholas sent. Here are some results for the position
from the TCL script (second column) and the
Ns2MobilityHelper (third column):

Sim. Time       ns-2                    Ns2MobilityHelper
1.0                1.65 9.35              1.65, 9.35
2.0                1.65 13.12            1.65, 13.12
3.0                1.65 20.76            1.65, 20.76
4.0                1.65 28.120003    1.65, 28.12
5.0                1.65 36.66             1.65, 36.66
6.0                1.65 45.04             1.65, 45.04
7.0                1.65 51.65             1.65, 51.64
8.0                1.65 60.52             1.65, 60.51
9.0                1.65 68.04             1.65, 68.03
10.0              1.65 75.44             1.65, 75.43

As you can see, at the beginning, Ns2MobilityHelper
is doing a good job. Just few effect of the
rounding errors.

Look around simulation time 200.0, the node is still
not to far away from its required position.

Sim. Time       ns-2                      Ns2MobilityHelper
201.0              1.65 1547.12       1.65, 1547.05
202.0              1.65 1554.4302   1.65, 1554.35
203.0              1.65 1562.8099   1.65, 1562.74
204.0              1.65 1569.3          1.65, 1569.23
205.0              1.65 1576.04        1.65, 1575.97

But at simulation time 400, the node is already
far from the required position.

Sim. Time       ns-2                      Ns2MobilityHelper
401.0               1.65 3098.95      1.65, 3089.34
402.0               1.65 3106.38      1.65, 3096.77
403.0               1.65 3115.08       1.65, 3105.47
404.0               1.65 3123.33       1.65, 3113.72
405.0               1.65 3132.0898   1.65, 3122.48

And the situation is getting worst with time. Every
new movement starts at the COMPUTED last
position of the previous movement. It should start
at the SPECIFIED last position in the ns-2 TCL
script. So the effect of rounding error is corrected
in each movement specified in the ns-2 TCL file, and
there is no accumulation of rounding errors over time.
Comment 1 Nicholas Loulloudes 2012-01-09 04:08:12 EST
Hi Tom, Pavel.

Please let me know if you want some test-case traces 
to help in the resolution of this bug. I can generated them
via a number of mobility generators that I am using.

Nicholas.
Comment 2 Mathieu Lacage 2012-03-24 10:10:56 EDT
The only way to make this work is to implement a new mobility model in ns-3 that calculates the current position without being based on a velocity vector and that is based instead on a source and destination position.
Comment 3 Tom Henderson 2012-04-25 08:57:12 EDT
(In reply to comment #2)
> The only way to make this work is to implement a new mobility model in ns-3
> that calculates the current position without being based on a velocity vector
> and that is based instead on a source and destination position.


Why not use the WaypointMobilityModel instead of the ConstantVelocityMobilityModel?

Also, I have also observed that BonnMotion does not order the waypoints by time, but by node, leading to the situation described where initial node positions are not stored at the top of the file.  I have had to post-process BonnMotion scripts to get them into acceptable ns-3 format.
Comment 4 Tom Henderson 2012-04-25 09:05:03 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > The only way to make this work is to implement a new mobility model in ns-3
> > that calculates the current position without being based on a velocity vector
> > and that is based instead on a source and destination position.
> 
> 
> Why not use the WaypointMobilityModel instead of the
> ConstantVelocityMobilityModel?

Actually, nevermind this comment; the mobility is a set of destinations and speeds.  Probably the only way to try to align them is to port ns-2's calcdest to ns-3, and even then it may not align.
Comment 5 Mitch Watrous 2012-05-08 13:48:17 EDT
Bug closed.

Changeset:  140eea99f4f2
Comment 6 Mitch Watrous 2012-05-08 15:54:43 EDT
I closed the wrong bug.
Comment 7 Mitch Watrous 2012-05-10 15:32:03 EDT
The class now allows initial nodes to appear at the end of the trace file.

ns-3-dev changeset:  92405ffdac3a
Comment 8 Mitch Watrous 2012-09-18 14:00:34 EDT
(In reply to comment #0)
> Reported on ns-developers list on 16 Dec 2011:
> 
> First:
> For Ns2MobilityHelper to work, we need to put
> the first position lines at the beginning of the file.
> That is, the following lines have to be at the beginning.
> Some tools generate a ns-2 TCL file with these lines
> at the end. So many users will forget to move them
> at the beginning of the TCL file and have an
> erroneous movement for nodes.
> $node_(0)   set X_   <initPositionX>
> $node_(0)   set Y_    <initPositionY>
> $node_(0)   set Z_    0.0
> 
> Second:
> Due to rounding error, the node get away from the
> movement it should do. I used the TCL file than
> Nicholas sent. Here are some results for the position
> from the TCL script (second column) and the
> Ns2MobilityHelper (third column):
> 
> Sim. Time       ns-2                    Ns2MobilityHelper
> 1.0                1.65 9.35              1.65, 9.35
> 2.0                1.65 13.12            1.65, 13.12
> 3.0                1.65 20.76            1.65, 20.76
> 4.0                1.65 28.120003    1.65, 28.12
> 5.0                1.65 36.66             1.65, 36.66
> 6.0                1.65 45.04             1.65, 45.04
> 7.0                1.65 51.65             1.65, 51.64
> 8.0                1.65 60.52             1.65, 60.51
> 9.0                1.65 68.04             1.65, 68.03
> 10.0              1.65 75.44             1.65, 75.43
> 
> As you can see, at the beginning, Ns2MobilityHelper
> is doing a good job. Just few effect of the
> rounding errors.
> 
> Look around simulation time 200.0, the node is still
> not to far away from its required position.
> 
> Sim. Time       ns-2                      Ns2MobilityHelper
> 201.0              1.65 1547.12       1.65, 1547.05
> 202.0              1.65 1554.4302   1.65, 1554.35
> 203.0              1.65 1562.8099   1.65, 1562.74
> 204.0              1.65 1569.3          1.65, 1569.23
> 205.0              1.65 1576.04        1.65, 1575.97
> 
> But at simulation time 400, the node is already
> far from the required position.
> 
> Sim. Time       ns-2                      Ns2MobilityHelper
> 401.0               1.65 3098.95      1.65, 3089.34
> 402.0               1.65 3106.38      1.65, 3096.77
> 403.0               1.65 3115.08       1.65, 3105.47
> 404.0               1.65 3123.33       1.65, 3113.72
> 405.0               1.65 3132.0898   1.65, 3122.48
> 
> And the situation is getting worst with time. Every
> new movement starts at the COMPUTED last
> position of the previous movement. It should start
> at the SPECIFIED last position in the ns-2 TCL
> script. So the effect of rounding error is corrected
> in each movement specified in the ns-2 TCL file, and
> there is no accumulation of rounding errors over time.

Were these numbers created by running ns-2 and ns-3?  If so, can you attach the ns-2 and ns-3 scripts that were used?
Comment 9 Mitch Watrous 2012-09-26 12:27:46 EDT
These actions were taken to resolve this bug:

 - ns-2 mobility helper was verified to produce same output as ns-2
 - sample BonnMotion trace and example program added
 - documentation of ns-2 mobility trace reader was improved
 - new test code added
Comment 10 Wade Colson 2014-04-15 19:01:12 EDT
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/gay-video-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.