If I run exactly your script (only removing $eilastlevelSecondo which is 
undefined) with ns-2.30-allinone and the latest version of the patch 
(20070301) I do not get such an error. The message indicates an error 
when you create the first wireless interface on node_AP(0). It is as if 
you had written "new Phy/WirelessPhy]". Maybe you modified 
ns-wireless.tcl? Does the mwnode test pass?

Note also that the way you have written your script all the interfaces 
have the same configuration val_b(phy/mac). For example,
$val_b(mac) set SlotTime_ ... and $val_a(mac) set SlotTime_ modify the 
same static tcl variable because val_a(...) and val_b(...) are equal. 
You do not actually need these variables but you need to change the 
static variables at the right place (create the interfaces with one 
configuration and then change it before you create the interfaces with a 
different mac/phy configuration.
Note that all this is not related to the MW-Node in particular.

Laurent Paquereau
Q2S Centre of Excellence, NTNU

Elena Putzolu wrote:
> Hi Laurent,
> Thank you very much for the answer, I have changed my script, but 
> doesn't work.
> According to you, because I from this type of mistake?
> 
> ns: new BiConnector/NetworkInterface2/FullStack/Wireless 0 _o21 _o33: 
> invalid command name "Phy/WirelessPhy]"
>     while executing
> "Phy/WirelessPhy] create _o37 "
>     invoked from within
> "catch "$className create $o $args" msg"
>     invoked from within
> "if [catch "$className create $o $args" msg] {
> if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
> delete $o
> return ""
> }
> global errorInfo
> error "class $..."
>     (procedure "new" line 3)
>     invoked from within
> "new [WirelessModule set wireless_param_(phy)]"
>     (procedure "_o36" line 11)
>     (BiConnector/NetworkInterface2/FullStack/ init line 11)
>     invoked from within
> "_o36 init 0 _o21 _o33"
>     (Class create line 1)
>     invoked from within
> "BiConnector/NetworkInterface2/FullStack/Wireless create _o36 0 _o21 _o33"
>     invoked from within
> "catch "$className create $o $args" msg"
>     invoked from within
> "if [catch "$className create $o $args" msg] {
> if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
> delete $o
> return ""
> }
> global errorInfo
> error "class $..."
>     (procedure "new" line 3)
>     invoked from within
> "new BiConnector/NetworkInterface2/FullStack/Wireless 0 _o21 _o33"
> 
> 
> My Script:
> global val_
> global val_a
> global val_b
> set val_(channel)        Channel/Wireless        ;# channel
> set val_(propagation) Propagation/TwoRayGround ;# radio-propagation model
> 
> set val_a(phy)             Phy/WirelessPhy ;# physical layer
> set val_b(phy)             Phy/WirelessPhy   ;# physical layer
> 
> set val_a(mac)             Mac/802_11               ;# mac layer
> set val_b(mac)             Mac/802_11               ;# mac layer
> 
> set val_(ifq)                  Queue/DropTail/PriQueue  ;# interface 
> queue type
> set val_(ll)                     LL                ;# link layer type
> set val_(antenna)         Antenna/OmniAntenna      ;# antenna model
> set val_(ifqlen)             50                ;# max packet in ifq
> 
> set val_(routing)          InterfaceWirelessRoutingProtocol       ;# routing
> 
> set val_(x)                    150
> set val_(y)                    150
> set val_(tr)                   esercizi/out4.tr            ;# trace file
> set val_(namtr)            esercizi/out4.nam       ;# nam trace file
> set val_(stopTime)       15
> 
> set chan_a   [new $val_(channel)]
> set chan_b   [new $val_(channel)]
> 
> proc init {} {
>     global val_ tracefd_ namfd_ ns_
>     set ns_ [new Simulator]
>     set tracefd_ [open ./$val_(tr) w]
>     $ns_ trace-all $tracefd_
>     set namfd_ [open ./$val_(namtr) w]
>     $ns_ namtrace-all-wireless $namfd_ $val_(x) $val_(y)
> }
> 
> proc finish {} {
>     global val_ tracefd_ namfd_ ns_ node_
>     for {set i 0} {$i < $val_(nMn) } {incr i} {
>     $ns_ at $val_(stopTime) "$node_($i) reset"
>     }
>     $ns_ flush-trace
>     close $tracefd_
>     close $namfd_
>     exit 0
> }
> 
> global ns_
> 
> init
> 
> 
>          $val_a(mac) set SlotTime_          0.000050        ;# 50us
>          $val_a(mac) set SIFS_              0.000028        ;# 28us
>          $val_a(mac) set PreambleLength_    0           ;# no preamble_
>          $val_a(mac) set PLCPHeaderLength_  128    ;# 128 bits
>          $val_a(mac) set PLCPDataRate_      1.0e6       ;# 1Mbps
>          $val_a(mac) set dataRate_          54.0e6          ;# 54Mbps
>          $val_a(mac) set basicRate_         1.0e6           ;# 1Mbps
> 
> ###################802.11b/g
>         
>          $val_b(mac) set SlotTime_          0.000020        ;# 20us
>          $val_b(mac) set SIFS_              0.000010        ;# 10us
>          $val_b(mac) set PreambleLength_    144             ;# 144 bits 
> preamble
>          $val_b(mac) set PLCPHeaderLength_  48              ;# 48 bits
>          $val_b(mac) set PLCPDataRate_      1.0e6           ;# 1Mbps
>          $val_b(mac) set dataRate_          11.0e6          ;# 11Mbps or 
> 54Mbps(802.11g)
>          $val_b(mac) set basicRate_         1.0e6           ;# 1Mbps
> 
>          $val_a(phy) set Pr_ 8.9175e-10 
>          $val_a(phy) set Pt_ 0.2818
>          $val_a(phy) set freq_ 5.0e+9
>                         # Receive sensitivity.
>      #./threshold.out -m TwoRayGround -r 0.95 -Pt 0.2818 -Gt 1 -Gr 1 -fr 
> 5.0e+9 200; Calcola RXThresh_
>          $val_a(phy) set RXThresh_  1.60607e-10                        
>          $val_a(phy) set CSThresh_ [expr 0.9*[$val_a(phy) set RXThresh_]]  
> 
>          $val_b(phy) set Pr_ 8.9175e-10 
>          $val_b(phy) set Pt_ 0.007214    
>          $val_b(phy) set freq_ 2.4e+9
>          $val_b(phy) set RXThresh_  7.138e-11
>          $val_b(phy) set CSThresh_ [expr 0.9*[$val_b(phy) set RXThresh_]]
> 
> ########## 802.11g
>          $val_b(phy) set DSSS_CWMin             15
>          $val_b(phy) set DSSS_CWMax             1023
>          $val_b(phy) set DSSS_SlotTime         0.000009   
>          $val_b(phy) set DSSS_CCATime          0.000003   
>          $val_b(phy) set DSSS_RxTxTurnaroundTime     0.000002   
>          $val_b(phy) set DSSS_SIFSTime         0.000016    
>          $val_b(phy) set DSSS_PreambleLength     96
>          $val_b(phy) set DSSS_PLCPHeaderLength     40   
>          #$val_b(phy) set DSSS_PLCPDataRate       6.0e6    // 6Mbps
>          #$val_b(phy) set DSSS_MaxPropagationDelay    0.0000005    // 0.5us
> 
> #---create topography
> set topography_ [new Topography]
> $topography_ load_flatgrid $val_(x) $val_(y)
> 
> $ns_ node-config -addressType hierarchical
> AddrParams set domain_num_ 1
> lappend cluster_num 2
> AddrParams set cluster_num_ $cluster_num
> lappend eilastlevel 3 2
> AddrParams set nodes_num_ $eilastlevelSecondo te, perchè mi da questo 
> tipo di errore?
> puts "Configuration of hierarchical addressing done"
> 
> 
> # init GOD
> create-god 5
> 
> $ns_ wireless-config    -routing        $val_(routing)\
>                         -mac            $val_a(mac)\
>                         -phy            $val_a(phy) \
>                         -channel        $chan_a \
>                         -propagation    [new $val_(propagation)] \
>                         -topography     $topography_ \
>                         -ll             $val_(ll) \
>                         -ifq            $val_(ifq) \
>                         -ifq-length     $val_(ifqlen) \
>                         -antenna        $val_(antenna) \
>                         -xyz-trace      on \
>                         -ifq-trace      on \
>                         -mac-trace      on \
>                         -rtm-trace      on \
>                         -eot-trace      off
> 
> 
> #---portal node
> $ns_ node-config -wireless +Portal
>  set node_AP(0) [$ns_ node 1.1.0]                                      
>    ;#Access Point(0)  with 2 interfaces
>  
>    set net_a(0) [$node_AP(0) add-interface "Wireless"]        ;# add 
> wireless interface
>    $node_AP(0) set-position 50.0 50.0 0.0
> 
>    ;#interface  802.11b/g
>    $ns_ wireless-config     -channel  $chan_b \
>                             -mac     $val_b(mac) \
>                             -phy     $val_b(phy)
> 
>    set net_b(0) [$node_AP(0) add-interface "Wireless"]
> 
> 
> #                         AP(1)
> $ns_ wireless-config -channel  $chan_a \
>                      -mac     $val_a(mac) \
>                      -phy     $val_a(phy)
> 
> $ns_ node-config -wireless +Portal     ;# enable Portal support
> set node_AP(1) [$ns_ node 1.2.0]
> 
> set net_a(1) [$node_AP(1) add-interface "Wireless"]   ;# add wireless 
> interface
> $node_AP(1) set-position [expr 80.0] 50.0 0.0
> 
> ;#interface 802.11b/g
>    $ns_ wireless-config     -channel $chan_b\
>                             -mac     $val_b(mac) \
>                             -phy     $val_b(phy)
> 
>    set net_b(1) [$node_AP(1) add-interface "Wireless"]
> 
> #---wireless and mobile node
> # enable base wireless and mobility support
> 
>  $ns_ wireless-config -channel $chan_b \
>                        -mac     $val_b(mac) \
>                        -phy     $val_b(phy)
> 
>   $ns_ node-config -wireless +Base -mobility +Base
>   set node_(0) [$ns_ node 1.1.1]
> 
>   set wif_b(0) [$node_(0) add-interface "Wireless"]           ;# add 
> wireless interface
>   $wif_b(0) add-default-route $node_AP(0)                        ;# use 
> node_AP(0) as a base station
> 
>   $node_(0) set-position 5.0 5.0 0.0
> 
> 
>   $ns_ wireless-config -channel  $chan_b \
>                        -mac     $val_b(mac) \
>                        -phy     $val_b(phy)
> 
>   $ns_ node-config -wireless +Base -mobility +Base
>   set node_(1) [$ns_ node 1.1.2]
> 
>   set wif_b(0) [$node_(1) add-interface "Wireless"]           ;# add 
> wireless interface
>   $wif_b(0) add-default-route $node_AP(0)                        ;# use 
> node_AP(0) as a base station
> 
>   $node_(1) set-position 20.0 5.0 0.0
> 
>  $ns_ node-config -wireless +Base -mobility +Base
>   set node_(2) [$ns_ node 1.2.1]
>   $ns_ wireless-config -channel  $chan_b \
>                        -mac     $val_b(mac) \
>                        -phy     $val_b(phy)
> 
>    set wif_b(1) [$node_(2) add-interface "Wireless"]   ;# add wireless 
> interface
>    $wif_b(1) add-default-route $node_AP(1)                ;# use 
> node_AP(1) as a base station
> 
>   $node_(2) set-position 100.0 0.0 0.0
> 
>  #----wireless nodes positioning
>  # $node_(0) set-position [expr 50.0] 0.0 0.0
> 
>   #----mobility
>   $ns_ at 0.0 "$node_(0) set-mobility [expr 60.0] [expr 60.0] 1.0"
>   $ns_ at 10.0 "$node_(0) set-speed 0.5"
> 
>  $net_a(0) add-default-route $node_AP(1)
>  $net_a(1) add-default-route $node_AP(0)
> ...............
> ........
> Elena

Reply via email to