Chinaunix首页 | 论坛 | 博客
  • 博客访问: 556003
  • 博文数量: 126
  • 博客积分: 2071
  • 博客等级: 大尉
  • 技术积分: 1522
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-24 16:09
文章分类
文章存档

2013年(8)

2012年(37)

2011年(80)

2010年(1)

分类: 网络与安全

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
    }
}

阅读(1557) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~