hi
I'm working on ns2.34 under ubuntu8.10 and I'm trying to create a handover
scenario using the IEEE802.11p
I get an error "invoked from within" while I'm creating the access point.
My TCL script is the following:
#-----------------------------------------------------
#802.11p default parameters
Phy/WirelessPhyExt set CSThresh_ 3.162e-12 ;#-85 dBm Wireless
interface sensitivity (sensitivity defined in the standard)
Phy/WirelessPhyExt set Pt_ 0.001
Phy/WirelessPhyExt set freq_ 5.9e+9
Phy/WirelessPhyExt set noise_floor_ 1.26e-13 ;#-99 dBm for 10MHz
bandwidth
Phy/WirelessPhyExt set L_ 1.0 ;#default radio
circuit gain/loss
Phy/WirelessPhyExt set PowerMonitorThresh_ 6.310e-14 ;#-102dBm power
monitor sensitivity
Phy/WirelessPhyExt set HeaderDuration_ 0.000040 ;#40 us
Phy/WirelessPhyExt set BasicModulationScheme_ 0
Phy/WirelessPhyExt set PreambleCaptureSwitch_ 1
Phy/WirelessPhyExt set DataCaptureSwitch_ 0
Phy/WirelessPhyExt set SINR_PreambleCapture_ 2.5118; ;# 4 dB
Phy/WirelessPhyExt set SINR_DataCapture_ 100.0; ;# 10 dB
Phy/WirelessPhyExt set trace_dist_ 1e6 ;# PHY trace until
distance of 1 Mio. km ("infinty")
Phy/WirelessPhyExt set PHY_DBG_ 0
Mac/802_11Ext set CWMin_ 15
Mac/802_11Ext set CWMax_ 1023
Mac/802_11Ext set SlotTime_ 0.000013
Mac/802_11Ext set SIFS_ 0.000032
Mac/802_11Ext set ShortRetryLimit_ 7
Mac/802_11Ext set LongRetryLimit_ 4
Mac/802_11Ext set HeaderDuration_ 0.000040
Mac/802_11Ext set SymbolDuration_ 0.000008
Mac/802_11Ext set BasicModulationScheme_ 0
Mac/802_11Ext set use_802_11a_flag_ true
Mac/802_11Ext set RTSThreshold_ 2346
Mac/802_11Ext set MAC_DBG 0
#=====================================================================
#configure RF model parameters
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0
Propagation/Nakagami set use_nakagami_dist_ false
Propagation/Nakagami set gamma0_ 2.0
Propagation/Nakagami set gamma1_ 2.0
Propagation/Nakagami set gamma2_ 2.0
Propagation/Nakagami set d0_gamma_ 200
Propagation/Nakagami set d1_gamma_ 500
Propagation/Nakagami set m0_ 1.0
Propagation/Nakagami set m1_ 1.0
Propagation/Nakagami set m2_ 1.0
Propagation/Nakagami set d0_m_ 80
Propagation/Nakagami set d1_m_ 200
#=======================================================================
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhyExt
set val(mac) Mac/802_11Ext
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(x) 1000 ;# X dimension of the topography
set val(y) 1000 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 3 ;# how many nodes are simulated
set val(rp) DumbAgent
set val(stop) 150 ;# simulation time
# =====================================================================
set ns [new Simulator]
set tracefd [open trace.tr w]
set namtrace [open out.nam w]
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
$ns namtrace-all $namtrace
# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
#God (General Operations Director) is the object that is used to store global
information about the state of the environment, network or nodes
create-god $val(nn)
# Create channel
set chan_ [new $val(chan)]
# nodes configuration
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel $chan_ \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace OFF \
-macTrace ON \
-movementTrace ON \
-phyTrace OFF
#Create nodes
for {set i 0} {$i < $val(nn) } { incr i } {
set node_($i) [$ns node]
$node_($i) random-motion 0 ;# disable random motion
set mac_($i) [$node_($i) getMac 0]
}
#Set node_(0) and node_(1) as the APs
set AP_ADDR1 [$mac_(0) id]
$mac_(0) ap $AP_ADDR1
$mac_(0) ScanType PASSIVE
set AP_ADDR2 [$mac_(1) id]
$mac_(1) ap $AP_ADDR2
$mac_(1) ScanType PASSIVE
#$ns at 4.0 "$mac_(2) ScanType ACTIVE"
# Provide initial location of mobile nodes
$node_(0) set X_ 100.0
$node_(0) set Y_ 400.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 400.0
$node_(1) set Y_ 400.0
$node_(1) set Z_ 0.0
$node_(2) set X_ 20.0
$node_(2) set Y_ 300.0
$node_(2) set Z_ 0.0
# Generation of movements
$ns at 5.0 "$node_(2) setdest 700.0 300.0 80.0"
for {set i 0} {$i < $val(nn) } {incr i} {
set agent_($i) [new Agent/PBC]
$ns attach-agent $node_($i) $agent_($i)
$agent_($i) set Pt_ 1e-4
$agent_($i) set payloadSize 1000
$agent_($i) set peroidcaBroadcastInterval 0.2
$agent_($i) set peroidcaBroadcastVariance 0.05
$agent_($i) set modulationScheme 1
$agent_($i) PeriodicBroadcast ON
}
# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {
# 30 defines the node size for nam
$ns initial_node_pos $node_($i) 30
}
# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$node_($i) reset";
}
# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.01 "puts \"end simulation\" ; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
exec nam out.nam &
}
$ns at 60 "stop"
$ns run
#------------------------------------------------------------------
I got the following error (while creating the access point):
(_o19 cmd line 1)
invoked from within
"_o19 cmd ap 0"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o19" line 2)
(SplitObject unknown line 2)
invoked from within
"$mac_(0) ap $AP_ADDR1"
(file "wave_ap.tcl" line 115)
-------------------------------------------------------
Note that, when i replace:
set val(netif) Phy/WirelessPhyExt by set val(netif)
Phy/WirelessPhy
and
set val(mac) Mac/802_11Ext by set val(mac)
Mac/802_11
I don't get any error and my program work well
how i should create an access point using the IEEE 802.11p extension?
thank you very much