2008年3月10日 星期一

設定BS的覆蓋範圍

由於我的論文主要是考慮two-tier架構,所以需要調整節點的接收threshold(RXThresh_),可偵測其他網路活動的範圍(CSThresh_)...等等參數.在/ns-2.29/tcl/lib/ns-default.tcl內有預設相對應數值:
# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set bandwidth_ 2e6
Phy/WirelessPhy set Pt_ 0.28183815
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0
Phy/WiredPhy set bandwidth_ 10e6


在ns-2.29/indep-utils/propagation/threshold.cc內可以得知,FreeSpace與TwoRayGround兩種model計算Pr的方式:

double TwoRay(double Pt, double Gt, double Gr, double ht, double hr, double L, double d, double lambda)
{
/*
* if d <>= crossover_dist, use two ray model
*
* Two-ray ground reflection model.
*
* Pt * Gt * Gr * (ht^2 * hr^2)
* Pr = ----------------------------
* d^4 * L
*
* The original equation in Rappaport's book assumes L = 1.
* To be consistant with the free space equation, L is added here.
*/

double Pr; // received power
double crossover_dist = (4 * M_PI * ht * hr) / lambda;

if (d < pr =" Friis(Pt," pr =" Pt">

Pr:在程式中即為RXThresh_也就是要在tcl所設定的數值
Pt = transmit power
Gt = transmit antenna gain
Gr = receive antenna gain
ht = transmit antenna height
hr = receive antenna height
d = distance (例如250m)

根據網路上鎖參考的資料,我們可以透過編譯threshold.cc來產生一個執行檔,再經由輸入相對應的參數至所產生的執行檔,即可得到RXThresh_,以下敘述如何產生出RXThresh_:

Step1.
ns-2.29/indep-utils/propagation/ 執行以下的編譯指令:
$g++ threshold.cc -o calculate

Step2.
若要執行計算某distance其相對應的RXThresh_,則執行以下指令:

$./calculate -m TwoRayGround -fr 3.5e+9 250

(計算model為TwoRayGround,且frequency為3.5MHz,距離250M)
如此即可計算出RXThresh_ .


reference:

http://hi.baidu.com/vvfang/blog/item/bf834c0fc3b4ab296159f344.html
http://blog.pixnet.net/NS2lab/post/10050300


End~



1 則留言:

匿名 提到...

這是我的msn:holiup119@hotmail.com
我也是研究生 也是用ns2模擬工具
專長是ad hoc wireless network, sensor network...
歡迎一起討論唷!
您的網誌很不錯!!
阿建