Chinaunix首页 | 论坛 | 博客
  • 博客访问: 214226
  • 博文数量: 46
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 679
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-16 13:11
文章分类
文章存档

2009年(19)

2008年(27)

我的朋友

分类: 系统运维

2009-04-22 18:29:24

This chapter describes the radio propagation models implemented in ns. These models are used to predict the received signal power of each packet. At the physical layer of each wireless node, there is a receiving threshold. When a packet is received, if its signal power is below the receiving threshold, it is marked as error and dropped by the MAC layer.

Up to now there are three propagation models in ns, which are the free space model, two-ray ground reflection model and the shadowing model. Their implementation can be found in ~ns/propagation.{cc,h}, ~ns/tworayground.{cc,h} and ~ns/shadowing.{cc,h}. This documentation reflects the APIs in ns-2.1b7.

1 Free space model

The free space propagation model assumes the ideal propagation condition that there is only one clear line-of-sight path between the transmitter and receiver. H. T. Friis presented the following equation to calculate the received signal power in free space at distance $d$ from the transmitter [].


\begin{displaymath}
P_r (d) = \frac{P_t G_t G_r \lambda^2}{(4\pi)^2 d^2 L}
\end{displaymath} (18.1)

where $P_t$ is the transmitted signal power. $G_t$ and $G_r$ are the antenna gains of the transmitter and the receiver respectively. $L (L\ge1)$ is the system loss, and $\lambda$ is the wavelength. It is common to select $G_t = G_r = 1$ and $L = 1$ in ns  simulations.

The free space model basically represents the communication range as a circle around the transmitter. If a receiver is within the circle, it receives all packets. Otherwise, it loses all packets

The OTcl interface for utilizing a propagation model is the node-config command. One way to use it here is

$ns_ node-config -propType Propagation/FreeSpace

Another way is

set prop [new Propagation/FreeSpace]
$ns_ node-config -propInstance $prop

2 Two-ray ground reflection model

A single line-of-sight path between two mobile nodes is seldom the only means of propation. The two-ray ground reflection model considers both the direct path and a ground reflection path. It is shown [] that this model gives more accurate prediction at a long distance than the free space model. The received power at distance $d$ is predicted by


\begin{displaymath}
P_r (d) = \frac{P_t G_t G_r {h_t}^2 {h_r}^2}{d^4 L}
\end{displaymath} (18.2)

where $h_t$ and $h_r$ are the heights of the transmit and receive antennas respectively. Note that the original equation in [] assumes $L = 1$. To be consistent with the free space model, $L$ is added here.

The above equation shows a faster power loss than Eqn. () as distance increases. However, The two-ray model does not give a good result for a short distance due to the oscillation caused by the constructive and destructive combination of the two rays. Instead, the free space model is still used when $d$ is small.

Therefore, a cross-over distance $d_c$ is calculated in this model. When $d < d_c$, Eqn. () is used. When $d > d_c$, Eqn. () is used. At the cross-over distance, Eqns. () and () give the same result. So $d_c$ can be calculated as


\begin{displaymath}
d_c = \left( 4\pi h_t h_r \right) / \lambda
\end{displaymath} (18.3)

Similarly, the OTcl interface for utilizing the two-ray ground reflection model is as follows.

$ns_ node-config -propType Propagation/TwoRayGround

Alternatively, the user can use

set prop [new Propagation/TwoRayGround] $ns_ node-config -propInstance $prop

The free space model and the two-ray model predict the received power as a deterministic function of distance. They both represent the communication range as an ideal circle. In reality, the received power at certain distance is a random variable due to multipath propagation effects, which is also known as fading effects. In fact, the above two models predicts the mean received power at distance $d$. A more general and widely-used model is called the shadowing model [].

The shadowing model consists of two parts. The first one is known as path loss model, which also predicts the mean received power at distance $d$, denoted by $\overline{P_r(d)}$. It uses a close-in distance $d_0$ as a reference. $\overline{P_r(d)}$ is computed relative to $P_r(d_0)$ as follows.


\begin{displaymath}
\frac{P_r(d_0)}{\overline{P_r(d)}} = {\left( \frac{d}{d_0} \right)}^\beta
\end{displaymath} (18.4)

$\beta $ is called the path loss exponent, and is usually empirically determined by field measurement. From Eqn. () we know that $\beta = 2$ for free space propagation. Table  gives some typical values of $\beta $. Larger values correspond to more obstructions and hence faster decrease in average received power as distance becomes larger. $P_r(d_0)$ can be computed from Eqn. ().


Table 18.1: Some typical values of path loss exponent $\beta $
Environment $\beta $
Outdoor Free space 2

Shadowed urban area 2.7 to 5
In building Line-of-sight 1.6 to 1.8

Obstructed 4 to 6


Table 18.2: Some typical values of shadowing deviation $\sigma _{dB}$
Environment $\sigma _{dB}$ (dB)
Outdoor 4 to 12
Office, hard partition 7
Office, soft partition 9.6
Factory, line-of-sight 3 to 6
Factory, obstructed 6.8

The path loss is usually measured in dB. So from Eqn. () we have


\begin{displaymath}
{\left[ \frac{\overline{P_r(d)}}{P_r(d_0)} \right]}_{dB} =
-10 \beta \log \left( \frac{d}{d_0} \right)
\end{displaymath} (18.5)

The second part of the shadowing model reflects the variation of the received power at certain distance. It is a log-normal random variable, that is, it is of Gaussian distribution if measured in dB. The overall shadowing model is represented by


\begin{displaymath}
{\left[ \frac{P_r(d)}{P_r(d_0)} \right]}_{dB} =
-10 \beta \log \left( \frac{d}{d_0} \right) + X_{dB}
\end{displaymath} (18.6)

where $X_{dB}$ is a Gaussian random variable with zero mean and standard deviation $\sigma _{dB}$. $\sigma _{dB}$ is called the shadowing deviation, and is also obtained by measurement. Table   shows some typical values of $\sigma _{dB}$. Eqn. () is also known as a log-normal shadowing model.

The shadowing model extends the ideal circle model to a richer statistic model: nodes can only probabilistically communicate when near the edge of the communication range.

Before using the model, the user should select the values of the path loss exponent $\beta $ and the shadowing deviation $\sigma _{dB}$ according to the simulated environment.

The OTcl interface is still the node-config command. One way to use it is as follows, and the values for these parameters are just examples.

# first set values of shadowing model
Propagation/Shadowing set pathlossExp_ 2.0 ;# path loss exponent
Propagation/Shadowing set std_db_ 4.0 ;# shadowing deviation (dB)
Propagation/Shadowing set dist0_ 1.0 ;# reference distance (m)
Propagation/Shadowing set seed_ 0 ;# seed for RNG

$ns_ node-config -propType Propagation/Shadowing

The shadowing model creates a random number generator (RNG) object. The RNG has three types of seeds: raw seed, pre-defined seed (a set of known good seeds) and the huristic seed (details in Section ). The above API only uses the pre-defined seed. If a user want different seeding method, the following API can be used.

set prop [new Propagation/Shadowing]
$prop set pathlossExp_ 2.0
$prop set std_db_ 4.0
$prop set dist0_ 1.0
$prop seed \ 0 ;# user can specify seeding method

$ns_ node-config -propInstance $prop

The seed-type above can be raw, predef or heuristic.

4 Communication range

In some applications, a user may want to specify the communication range of wireless nodes. This can be done by set an appropriate value of the receiving threshold in the network interface, ,

Phy/WirelessPhy set RXThresh_ \

A separate C program is provided at ~ns/indep-utils/propagation/threshold.cc to compute the receiving threshold. It can be used for all the propagation models discussed in this chapter. Assume you have compiled it and get the excutable named as threshold. You can use it to compute the threshold as follows

threshold -m \ [other-options] distance

where propagation-model is either FreeSpace, TwoRayGround or Shadowing, and the distance is the communication range in meter.

[other-options] are used to specify parameters other than their default values. For the shadowing model there is a necessary parameter, -r receive-rate, which specifies the rate of correct reception at the distance. Because the communication range in the shadowing model is not an ideal circle, an inverse Q-function [] is used to calculate the receiving threshold. For example, if you want 95% of packets can be correctly received at the distance of 50m, you can compute the threshold by

threshold -m Shadowing -r 0.95 50

Other available values of [other-options] are shown below

-pl \ -std \ -Pt \
-fr \ -Gt \ -Gr \
-L \ -ht \ -hr \
-d0 \

5 Commands at a glance

Following is a list of commands for propagation models.

$ns_ node-config -propType propagation-model
This command selects propagation-model in the simulation. the propagation model can be Propagation/FreeSpace, Propagation/TwoRayGround or Propagation/Shadowing

$ns_ node-config -propInstance $prop
This command is another way to utilize a propagation model. $prop is an instance of the propagation-model.

$sprop_ seed seed-type value
This command seeds the RNG. $sprop_ is an instance of the shadowing model.

threshold -m propagation-model [other-options] distance
This is a separate program at ~ns/indep-utils/propagation/threshold.cc, which is used to compute the receiving threshold for a specified communication range.


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