1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
|
%----------------------------------------------------------------------------
\chapter{Radio Propagation Models}
\label{chap:propagation}
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\footnote{Based on the code contributed to \ns~from the CMU Monarch
project.}, two-ray ground reflection model\footnote{Contributed to \ns~from the
CMU Monarch project.} and the shadowing model\footnote{Implemented in \ns~by
Wei Ye at USC/ISI}. Their implementation can be found in \nsf{propagation.\{cc,h\}},
\nsf{tworayground.\{cc,h\}} and \nsf{shadowing.\{cc,h\}}. This documentation
reflects the APIs in ns-2.1b7.
%----------------------------------------------------------------------------
\section{Free space model}
\label{sec:freespace}
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 \cite{Friis46}.
\begin{equation}
P_r (d) = \frac{P_t G_t G_r \lambda^2}{(4\pi)^2 d^2 L}
\label{eqn:freespace}
\end{equation}
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 \code{node-config}
command. One way to use it here is
\begin{program}
$ns_ node-config -propType Propagation/FreeSpace
\end{program}
Another way is
\begin{program}
set prop [new Propagation/FreeSpace]
$ns_ node-config -propInstance $prop
\end{program}
%----------------------------------------------------------------------------
\section{Two-ray ground reflection model}
\label{sec:tworay}
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 \cite{Rappaport96} 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{equation}
P_r (d) = \frac{P_t G_t G_r {h_t}^2 {h_r}^2}{d^4 L}
\label{eqn:tworay}
\end{equation}
where $h_t$ and $h_r$ are the heights of the transmit and receive antennas
respectively. Note that the original equation in \cite{Rappaport96} 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. (\ref{eqn:freespace})
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. (\ref{eqn:freespace}) is used. When $d > d_c$, Eqn.
(\ref{eqn:tworay}) is used. At the cross-over distance, Eqns. (\ref{eqn:freespace})
and (\ref{eqn:tworay}) give the same result. So $d_c$ can be calculated as
\begin{equation}
% d_c = \frac{4\pi h_t h_r}{\lambda}
d_c = \left( 4\pi h_t h_r \right) / \lambda
\label{eqn:crossover}
\end{equation}
Similarly, the OTcl interface for utilizing the two-ray ground reflection model
is as follows.
\begin{program}
$ns_ node-config -propType Propagation/TwoRayGround
\end{program}
Alternatively, the user can use
\begin{program}
set prop [new Propagation/TwoRayGround]
$ns_ node-config -propInstance $prop
\end{program}
%----------------------------------------------------------------------------
\section{Shadowing model}
\label{sec:shadowing}
\subsection{Backgroud}
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~\cite{Rappaport96}.
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{equation}
\frac{P_r(d_0)}{\overline{P_r(d)}} = {\left( \frac{d}{d_0} \right)}^\beta
\label{eqn:pathloss}
\end{equation}
$\beta$ is called the path loss exponent, and is usually empirically
determined by field measurement. From Eqn. (\ref{eqn:freespace}) we
know that $\beta = 2$ for free space propagation. Table~\ref{tab:pathlossexp}
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. (\ref{eqn:freespace}).
\begin{table}
\begin{center}
\centering \small
\begin{tabular}{|l|l|c|}
\hline \multicolumn{2}{|c|}{\bf{Environment}} & $\beta$ \\
\hline Outdoor & Free space & 2 \\
\cline{2 - 3} & Shadowed urban area & 2.7 to 5 \\
\hline In building & Line-of-sight & 1.6 to 1.8 \\
\cline{2 - 3} & Obstructed & 4 to 6 \\ \hline
\end{tabular}
\caption{Some typical values of path loss exponent $\beta$}
\label{tab:pathlossexp}
\end{center}
\end{table}
\begin{table}
\begin{center}
\centering \small
\begin{tabular}{|l|c|}
\hline \bf{Environment} & $\sigma_{dB}$ (dB) \\
\hline Outdoor & 4 to 12 \\
\hline Office, hard partition & 7 \\
\hline Office, soft partition & 9.6 \\
\hline Factory, line-of-sight & 3 to 6 \\
\hline Factory, obstructed & 6.8 \\ \hline
\end{tabular}
\caption{Some typical values of shadowing deviation $\sigma_{dB}$}
\label{tab:stddb}
\end{center}
\end{table}
The path loss is usually measured in dB. So from Eqn. (\ref{eqn:pathloss})
we have
\begin{equation}
{\left[ \frac{\overline{P_r(d)}}{P_r(d_0)} \right]}_{dB} =
-10 \beta \log \left( \frac{d}{d_0} \right)
\label{eqn:pathlossdb}
\end{equation}
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{equation}
{\left[ \frac{P_r(d)}{P_r(d_0)} \right]}_{dB} =
-10 \beta \log \left( \frac{d}{d_0} \right) + X_{dB}
\label{eqn:shadowing}
\end{equation}
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
~\ref{tab:stddb} shows some typical values of $\sigma_{dB}$. Eqn.
(\ref{eqn:shadowing}) 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.
\subsection{Using shadowing model}
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 \code{node-config} command. One way to
use it is as follows, and the values for these parameters are just examples.
\begin{program}
# 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
\end{program}
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~\ref{sec:random}). The
above API only uses the pre-defined seed. If a user want different seeding
method, the following API can be used.
\begin{program}
set prop [new Propagation/Shadowing]
$prop set pathlossExp_ 2.0
$prop set std_db_ 4.0
$prop set dist0_ 1.0
$prop seed <seed-type> 0 ;# user can specify seeding method
$ns_ node-config -propInstance $prop
\end{program}
The \code{<seed-type>} above can be \code{raw}, \code{predef} or \code{heuristic}.
%--------------------------------------------------------------------------------
\section{Communication range}
\label{sec:commrange}
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, \ie,
\begin{program}
Phy/WirelessPhy set RXThresh_ <value>
\end{program}
A separate C program is provided at \nsf{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 \code{threshold}. You can use it to compute the threshold
as follows
\begin{program}
threshold -m <propagation-model> [other-options] distance
\end{program}
where \code{<propagation-model>} is either \code{FreeSpace}, \code{TwoRayGround}
or \code{Shadowing}, and the \code{distance} is the communication range in meter.
\code{[other-options]} are used to specify parameters other than their
default values. For the shadowing model there is a necessary parameter,
\code{-r <receive-rate>}, which specifies the rate of correct reception at the
\code{distance}. Because the communication range in the shadowing model is not
an ideal circle, an inverse Q-function \cite{Rappaport96} 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
\begin{program}
threshold -m Shadowing -r 0.95 50
\end{program}
Other available values of \code{[other-options]} are shown below
\begin{program}
-pl <path-loss-exponent> -std <shadowing-deviation> -Pt <transmit-power>
-fr <frequency> -Gt <transmit-antenna-gain> -Gr <receive-antenna-gain>
-L <system-loss> -ht <transmit-antenna-height> -hr <receive-antenna-height>
-d0 <reference-distance>
\end{program}
%-------------------------------------------------------------------------------
\section{Commands at a glance}
\label{sec:propcommand}
Following is a list of commands for propagation models.
\begin{flushleft}
\code{$ns_ node-config -propType <propagation-model>}\\
This command selects \code{<propagation-model>} in the simulation. the
\code{<propagation model>} can be \code{Propagation/FreeSpace},
\code{Propagation/TwoRayGround} or \code{Propagation/Shadowing}
\code{$ns_ node-config -propInstance $prop}\\
This command is another way to utilize a propagation model. \code{$prop} is
an instance of the \code{<propagation-model>}.
\code{$sprop_ seed <seed-type> <value>}\\
This command seeds the RNG. \code{$sprop_} is an instance of the shadowing model.
\code{threshold -m <propagation-model> [other-options] distance}\\
This is a separate program at \nsf{indep-utils/propagation/threshold.cc}, which
is used to compute the receiving threshold for a specified communication range.
\end{flushleft}
\endinput
%------------------------------------------------------------------------------
|