12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

18.3.2 Using shadowing modelBefore using the model, the user should select the values of the p<strong>at</strong>h loss exponent β <strong>and</strong> the shadowing devi<strong>at</strong>ion σ dBaccording to the simul<strong>at</strong>ed environment.<strong>The</strong> OTcl interface is still the node-config comm<strong>and</strong>. One way to use it is as follows, <strong>and</strong> the values for these parametersare just examples.# first set values of shadowing modelPropag<strong>at</strong>ion/Shadowing set p<strong>at</strong>hlossExp_ 2.0Propag<strong>at</strong>ion/Shadowing set std_db_ 4.0Propag<strong>at</strong>ion/Shadowing set dist0_ 1.0Propag<strong>at</strong>ion/Shadowing set seed_ 0;# p<strong>at</strong>h loss exponent;# shadowing devi<strong>at</strong>ion (dB);# reference distance (m);# seed for RNG$<strong>ns</strong>_ node-config -propType Propag<strong>at</strong>ion/Shadowing<strong>The</strong> shadowing model cre<strong>at</strong>es a r<strong>and</strong>om number gener<strong>at</strong>or (RNG) object. <strong>The</strong> RNG has three types of seeds: raw seed,pre-defined seed (a set of known good seeds) <strong>and</strong> the huristic seed (details in Section 25.1). <strong>The</strong> above API only uses thepre-defined seed. If a user want different seeding method, the following API can be used.set prop [new Propag<strong>at</strong>ion/Shadowing]$prop set p<strong>at</strong>hlossExp_ 2.0$prop set std_db_ 4.0$prop set dist0_ 1.0$prop seed 0;# user can specify seeding method$<strong>ns</strong>_ node-config -propI<strong>ns</strong>tance $prop<strong>The</strong> above can be raw, predef or heuristic.18.4 Communic<strong>at</strong>ion rangeIn some applic<strong>at</strong>io<strong>ns</strong>, a user may want to specify the communic<strong>at</strong>ion range of wireless nodes. This can be done by set anappropri<strong>at</strong>e value of the receiving threshold in the network interface, i.e.,Phy/WirelessPhy set RXThresh_ A separ<strong>at</strong>e C program is provided <strong>at</strong> ~<strong>ns</strong>/indep-utils/propag<strong>at</strong>ion/threshold.cc to compute the receiving threshold. It can beused for all the propag<strong>at</strong>ion models discussed in this chapter. Assume you have compiled it <strong>and</strong> get the excutable named asthreshold. You can use it to compute the threshold as followsthreshold -m [other-optio<strong>ns</strong>] distancewhere is either FreeSpace, TwoRayGround or Shadowing, <strong>and</strong> the distance is thecommunic<strong>at</strong>ion range in meter.190

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!