分类: 网络与安全
2013-05-05 18:07:05
# Initialize the SharedMedia interface with parameters to make # it work like the 914MHz Lucent WaveLAN DSSS radio interface set RxT_ 3.652e-10 ;#Receiving Threshold which mostly is a hardware feature set Frequency_ 914e+6 ;# Signal Frequency which is also hardware feature Phy/WirelessPhy set CPThresh_ 10.0 Phy/WirelessPhy set CSThresh_ 1.559e-11 Phy/WirelessPhy set RXThresh_ $RxT_ ;# Receiving Threshold Phy/WirelessPhy set Rb_ 2*1e6 ;# Bandwidth Phy/WirelessPhy set freq_ $Frequency_ Phy/WirelessPhy set L_ 1.0 set opt(Pt) 61.0 ;# Transmission Power/Range in meters if { $opt(prop) == "Propagation/TwoRayGround" } { set SL_ 300000000.0 ;# Speed of Light set lambda [expr $SL_/$Frequency_] ;# wavelength set lambda_2 [expr $lambda*$lambda] ;# lambda^2 set CoD_ [expr 4.0*$PI*$opt(AnH)*$opt(AnH)/$lambda] ;# Cross Over Distance if { $opt(Pt) <= $CoD_ } {;#Free Space for short distance communication set temp [expr 4.0*$PI*$opt(Pt)] set TP_ [expr $RxT_*$temp*$temp/$lambda_2] Phy/WirelessPhy set Pt_ $TP_ ;#Set the Transmissiont Power w.r.t Distance } else { ;# TwoRayGround for communicating with far nodes set d4 [expr $opt(Pt)*$opt(Pt)*$opt(Pt)*$opt(Pt)] set hr2ht2 [expr $opt(AnH)*$opt(AnH)*$opt(AnH)*$opt(AnH)] set TP_ [expr $d4*$RxT_/$hr2ht2] Phy/WirelessPhy set Pt_ $TP_ ;#Set the Transmissiont Power w.r.t Distance } }