[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new wireless API



Hi,

I tried the new wireless API with a simulation
using wired nodes , wireless and base stations

I had an error mesage (at the end of the mail)
The problem may be that I don't build my nodes
in a defined order and I have functions
that set node-gonfig each time. Here are my functions :

*********************************************************

set opt(rp) DSDV

$ns node-config -addressingType hierarchical

proc my_transit_node {address} {
   global ns
   puts "transit node $address" 

   $ns node-config -wiredRouting ON  

   return [$ns node $address]
}

proc my_border_node {address} {
   global ns
   puts "border node $address"

   $ns node-config -wiredRouting ON

   return [$ns node $address]
}

proc my_node {address} {
   global ns
   puts "node $address"

   $ns node-config -wiredRouting ON

   return [$ns node $address]
}

proc my_anchor {address} {
   global ns TOPOM chan prop topo tracefd opt
   puts "anchor node $address"

   $ns node-config -adhocRouting $opt(rp) \
                   -llType $opt(ll) \
                   -macType $opt(mac) \
                   -ifqType $opt(ifq) \
                   -ifqLen $opt(ifqlen) \
                   -antType $opt(ant) \
                   -propType $opt(prop) \
                   -phyType $opt(netif) \
                   -channelType $opt(chan) \
                   -topoInstance $topo \
                   -wiredRouting ON \
                   -agentTrace ON \
                   -routerTrace OFF \
                   -macTrace OFF 

   set local_anchor [$ns node $address]

   set local_ip_prefix [get_ip_prefix $address]
   set local_borders_list [$TOPOM tm_get_border_routers
$local_ip_prefix]
   set border_address [lindex $local_borders_list 0]
   set border_node [$TOPOM tm_get_node_by_address $border_address]
   $local_anchor random-motion 0 
   $ns duplex-link $border_node $local_anchor 5Mb 2ms DropTail

   return $local_anchor
}

set nb_mobiles 0

proc my_mobile {address other_params} {
   global ns chan prop TOPOM nb_mobiles topo opt
   puts "mobile node $address"

   $ns node-config -adhocRouting $opt(rp) \
                   -llType $opt(ll) \
                   -macType $opt(mac) \
                   -ifqType $opt(ifq) \
                   -ifqLen $opt(ifqlen) \
                   -antType $opt(ant) \
                   -propType $opt(prop) \
                   -phyType $opt(netif) \
                   -topoInstance $topo \
                   -channelType $opt(chan) \
                   -agentTrace ON \
                   -routerTrace ON \
                   -macTrace OFF \
                   -movementTrace OFF \
                   -wiredRouting OFF

   set mobile_node [$ns node $address]
   set ADD [AddrParams 0.2.6]
   incr nb_mobiles
   $mobile_node set X_ 1
   $mobile_node set Y_ 1
   $mobile_node set Z_ 1
   return $mobile_node
}

******************************************************************

The error message is clear but i don't
know how to fix the problem.

can't read "nifs_": no such variable
    while executing
"for {set i 0} {$i < $nifs_} {incr i} {
$netif_($i) reset
$mac_($i) reset
$ll_($i) reset
$ifq_($i) reset
if { [info exists opt(imep)] && $opt(imep) == ..."
    (procedure "_o87" line 6)
    (Node do-resetMobile line 6)
    invoked from within
"$self do-resetMobile"
    (procedure "_o87" line 2)
    (Node do-resetBase line 2)
    invoked from within
"$self do-reset$nodetype_"
    (procedure "_o87" line 4)
    (Node reset line 4)
    invoked from within
"$Node_($nn) reset"
    (procedure "_o5" line 11)
    (Simulator run line 11)
    invoked from within
"$ns run"
    (file "test_topogen.tcl" line 286)

Thanks,

-- 
Vera Mickael Stagiaire