Documente Academic
Documente Profesional
Documente Cultură
tcl
#read arguments
set seed 5555
Mac/802_16 set scan_iteration_ 2
set use_going_down 1
if {$use_going_down == 1} {
Mac/802_16 set lgd_factor_ 1.1
} else {
Mac/802_16 set lgd_factor_ 1.0
}
Mac/802_16 set scan_duration_ 50
Mac/802_16 set interleaving_interval_ 40
#define MAC 802_11 parametersx 10s, to replace the timer for looking at preamble
Mac/802_16 set client_timeout_ 50
# Handover
#Agent/MIHUser/IFMNGMT/MIPV6/Handover/Handover1 set case_ 1
Agent/MIHUser/IFMNGMT/MIPV6/Handover/Handover1 set case_ 3
#node Position
set MN_80211_X 500.0
set MN_80211_Y 1000.0
set MN_80211_Z 0.0
set quiet 0
# connect links
$ns duplex-link $router1 $CN 100MBit 30ms DropTail 1000
$ns duplex-link-op $CN $router1 orient down
# Create God
create-god [expr ($opt(nbMN) + $opt(nbAP) + 1)] ;
if { $opt(interference) == 1} {
set bstationPhy($i) [$bstation80211($i) set netif_(0)]
$bstationPhy($i) enableInterference
$bstationPhy($i) setTechno 802.11
}
}
if { $opt(interference) == 1} {
set MNPhy($i) [$80211_node set netif_(0)]
$MNPhy($i) enableInterference
$MNPhy($i) setTechno 802.11
}
if {$quiet == 0} {
puts "MN 802.11: tcl=$80211_node; id=[$80211_node id]; addr=[$80211_node node-
addr] X=$MN_80211_X Y=$MN_80211_Y"
}
if {$quiet == 0} {
puts "udp on node : $udp"
}
#traffic
##configure traffic
#sinkNode is transmitter
$ns attach-agent $CN $udp
$ns attach-agent $multiFaceNode_MN $null
#Start the application 1sec before the MN is entering the WLAN cell
$ns at [expr $moveStart - 1] "$cbr start"
#Stop the application according to another poisson distribution (note that we don't
leave the 802.11 cell)
$ns at [expr $moveStop + 1] "$cbr stop"