[ns] Re: Mobiwan, How to print X Y Z from node ?

Ali Hamidian alexh at telecom.lth.se
Tue May 4 04:36:22 PDT 2004


Hi,

Warodom Werapun wrote:

>
>    Thank you Ali and Larbi.  :)
>
>>>    I notices, when I change position of nodes (in simple-mipv6.tcl), 
>>> no any changes with all nodes position. 
>>
>>
>> Do you mean that you cannot see the mobile node movement in NAM? Then 
>> the problem might be the NAM version which is included in the 
>> allinone version of ns-2.1b6(a). Download and install a newer NAM 
>> version and you will see the mobile nodes move.
>
>
>       Yes, I try to used nam (from ns-2.1b9a).  It's still freeze.  I 
> cannot see any nodes movement except packets movement.  On the 
> otherhand, I'm not sure that mobiwan script (simple-mipv6.tcl)  
> provide node movement?

You need to change from $ns namtrace-all $namf to $ns 
namtrace-all-wireless $namf 800 800. However, doing this the NAM layout 
will be destroyed a bit and you have to move the nodes in NAM manually 
by pressing the EDIT button and zooming in and out.

Also add these two lines so you can see the packet flow:
$ns node-config -macTrace ON
$ns node-config -routerTrace ON

> and I don't see the mobile node in NAM too.
> Have you ever seen the mobile node in NAM , created by simple-mipv6.tcl ? 

Yes, see my answer above.

>
>
>> So, I like to check out the actual position of nodes.  How I can 
>> print  X Y Z arguments from local_node ( mobile_ )  ? Try this:
>> *puts "x=[$local_node set X_]"*
>
>
>    It works!!  :)   but If I like to print  X_  from "mobile_" 
> instance.  I mean, I print X_ from simple-mipv6.tcl file.  Is it 
> possible to do?

Yes, it should be possible.

Regards
Ali

> because I notices that mobile_ node receives the return of $local_node.
>
>>> > /script/simple-mipv6.tcl
>>>
>>> set mobile_ [create-mobile 1.1.1 1.1.0 100 100 0 1 0.01]
>>>
>>> --------------------
>>>
>>> > /src/lib/proc-mipv6-config.tcl
>>>
>>> proc create-mobile {home_addr ha_addr X Y Z random args} {
>>>   global ns
>>>   def_mobile_config
>>>
>>>   # Home site
>>>   set channel [set_channel_by_addr $home_addr]
>>>   $ns set chan $channel
>>>   set local_node [$ns node $home_addr]
>>>   $local_node set-ha $ha_addr
>>>   $local_node set X_ $X
>>>   $local_node set Y_ $Y
>>>   $local_node set Z_ $Z 
>>
>>
>>
>> *puts "x=[$local_node set X_]"*
>>
>>>
>>>   $local_node random-motion $random
>>>
>>>   set start [lindex $args 0]
>>>
>>>   if { $random != 0 } {
>>>        $ns at $start "$local_node start"
>>>   }
>>>   return $local_node
>>> }
>>
>>


More information about the Ns-users mailing list