**Simulation Framework for a Mobile Ad-Hoc Network**

**Jean-Sebastien Pegon and Madhavi W. Subbarao**

**Wireless Communications Technology Group**

**National Institute of Standards and Technology**

**100 Bureau Drive Stop 8920**

**Gaithersburg, MD 20899**

[jspegon@antd.nist.gov](mailto:Jspegon@antd.nist.gov) **and**
<subbarao@nist.gov>

> **Abstract**

Using OPNET a general framework has been developed to test MANET routing
efficiency for different physical layers, network topologies, and nodal
mobilities. With OPNET it is possible to design different physical
layers, MAC layers, and routing schemes, to compare end-to-end
statistics (end-to-end delay, throughput and power consumption), and
finally to determine the most efficient solution.

I.  **Introduction**

A mobile ad hoc network (MANET) is an autonomous collection of mobile
users (nodes) that communicate over bandwidth-constrained wireless
links. Due to nodal mobility, the network topology may change rapidly
and unpredictably over time. The network is decentralized, where network
organization and message delivery must be executed by the nodes
themselves. However, message routing in a decentralized environment
where the topology fluctuates is not a well-defined problem. While the
shortest path from a source to a destination based on a given cost
function in a static network is usually the optimal route, this idea is
not easily extended to MANETs. Factors such as power expended, variable
wireless link quality, propagation path loss, fading, multi-user
interference, and topological changes, become relevant issues. The
network should be able to adaptively alter routing paths to alleviate
any of these effects.

In this paper, we develop a general framework for executing routing in a
MANET in various channel conditions. Two forms of routing for a MANET
include hop-by-hop myopic routing and end-to-end source routing. In both
cases, routing decisions are made based on dynamic link cost functions.
The framework developed herein provides a mechanism to evaluate and
design different link cost metrics.

We consider a direct-sequence spread-spectrum MANET using the basic
ALOHA random access protocol. We employ BPSK signaling, adaptive
transmission power allocation, and a simple Rayleigh fading model. This
paper is organized as follows. In section II, we provide a description
of the two routing approaches: myopic routing and source routing. In
section III, we describe the simulation environment including the
network and node models. In section IV, we present our simulation model
for direct-sequence spread-spectrum modulation. In section V, we
describe our simple Rayleigh fading model. Finally, in section VI, we
present simulation results and a conclusion.

**II. Routing Approaches**

In the general simulation framework, we implement with OPNET two
different routing approaches for MANETs: hop-by-hop myopic routing and
end-to-end source routing.

-   Myopic Routing: Each node only determines the next hop a packet
    should take toward its final destination. A node must determine
    which nodes are within transmission range, and then determine the
    \"best\" neighbor who can forward the packet toward the destination.
    While all nodes within transmission range will receive the packet,
    only the chosen neighbor must forward the packet. The chosen
    neighbor is selected according to a given link cost metric.

-   Source Routing: The entire route of a packet is determined at the
    source node using the shortest path routing with given link cost
    metrics. A periodically updated table stores the routes to reach
    each destination.

Myopic routing is a reactive, hop-by-hop routing scheme, while source
routing is a proactive, end-to-end routing approach. It is interesting
to study how these routing schemes will behave in our global framework
and to compare their performances via different metrics. With the
framework provided, it will be easy to define and test different link
cost models for both approaches.

## 

## III. Simulation Environment

In this section we present the general framework developed to simulate a
MANET environment. As no final standards have been chosen for the
different MANET layers, this framework provides a convenient method to
test and compare different layer choices.

## Network Model

#### The network comprises N mobile nodes, named 0,....,N-1, that communicate over wireless links. For simplicity and to guarantee a reliable radio channel during the movement of the nodes, the topology is chosen such that nodes reside on one of three levels.

#### \*\*\*\*\*

#### the topology is simple : 3 levels ( y = 1,3,5). The nodes of different level can move on straight lines (y = 1,3,5 for x∈\[0,7\]). 

#### \*\*\*\*\*

#### A variation of the moving speed implies a variation of the network topology and allows us to measure the mobility of the network. Figure 1 represents the network model.

![](media/image1.png)

Figure 1 - Network model with unit scale in kilometers

The transmission range is chosen and depends on the network topology.

## B. Node Model

Each of the 10 nodes has the structure given in Figure 2 and is uniquely
identified by its user ID.

![](media/image2.png)

Figure 2 -- Mobile Node Model

-   The *source* module generates packets according to an interarrival
    exponential distribution. This interarrival time can be chosen
    during the simulation. The packet size is 100 bits and the packet
    format has six fields as shown in Figure 3: destination and next
    node address which contain the destination name and next node name
    respectively, power field which stores the transmitted power, hop
    field which memorizes the path of the packet, fading field which
    depends on the fading factor of the link, and the data field.

  ------------------------- --------------------------- ------------------
  Destination               Next node                   Power

  Hop                       Fading                      Data
  ------------------------- --------------------------- ------------------

Figure 3 -- Data Packet Fields

-   The *application* module sets a random destination address to the
    incoming packet and measures the number of total packets
    transmitted.

-   The *routing* module executes both routing approaches, myopic and
    source routing. Various link cost metrics can be tested and compared
    for both routing approaches.

-   The *MAC* module is used to simulate the random access channel
    protocol. In this simulation, a simple ALOHA has been used. Other
    MAC layer protocols such as CSMA/CD, 802.11 or FAMA can be tested.

-   The *power* module processes the spreading code allocation and
    estimates an optimum transmission power for each new packet. This
    module illustrates simulation of the physical layer and is described
    in more detail in the remainder of the paper.

-   The *radio_tx* module sends the packets on the radio channel through
    the antenna. The modulation is BPSK with spread spectrum.

-   The *antenna* module sends and receives packets from the defined
    channel. The antenna is an isotropic pattern.

-   The *radio_rx* module receives packets from the antenna.

-   The *receiver* module records various end-to-end statistics and
    destroys the packets.

**IV. Direct-Sequence Spread-Spectrum**

With OPNET it is possible to simulate direct-sequence spread-spectrum
communication in a simplistic way. Using the mechanisms provided by
OPNET, we assign a different spreading code for each node in the
network. Before transmitting a packet we determine the spreading code of
the intended receiver and transmit the packet using this code. Even if
the intended node receives a packet, multi-user interference is created
on the channel. This spread-spectrum effect is not simulated in this
simple model.

####### 

####### Figure 4 : Physical layer scheme

Consider the physical layer design shown in Figure 4. It is important to
understand the different pipeline stages of the channel simulation in
order to choose a « level » of simulation. Since the default OPNET model
does not allow us to simulate the whole modulation process, we have
chosen to simulate the channel at the chip level. Consequently, the
channel characteristics are set up at the chip level. The chip rate
(9.6Gchip/s) is the inverse of the bandwidth, e.g., packet size of 100
bits is equal to 100 Kchips. The processing gain is set to 30 dB. With
the characteristics chosen in this manner, the SNR at the receiver is
then at the *chip* level. However, the requirements are at the *bit*
level for the bit-error rate. Consequently, we must determine how to
compute the bit error rate knowing the SNR at the chip level.

### Theoretical study 

According to our model, OPNET provides the SNR at the *chip* error rate:
$\frac{E_{\text{ch}}}{N}$. We have the following relation between the
SNR at the chip level and the SNR at the channel level:

$\frac{E_{\text{ch}}}{N} \ast R_{\text{ch}} = \frac{E_{c}}{N} \ast R_{c}$,$$

and we have also
$R = \frac{k}{n} \ast R_{c} \Leftrightarrow R_{\text{ch}} = G \ast \frac{k}{n} \ast R_{c}$where
$G = \frac{R_{\text{ch}}}{R}$.

We deduce the desired relation of the SNR at the channel level:

$\frac{E_{c}}{N} = \frac{E_{\text{ch}}}{N} \ast G \ast \frac{k}{n}$. (1)

With this relation, it is then possible to use OPNET's modulation table
for BPSK to determine the channel bit error probability *p~c~:*
$p_{c} = Q\left( \sqrt{\frac{2E_{c}}{N_{o}}} \right)$.

Finaly we can compute the bit error probability:

$p_{b} = \frac{1}{n}\sum_{j = t + 1}^{n}j \ast C_{j}^{n} \ast p_{c}^{j}\left( 1 - p_{c} \right)^{n - j}$,
(2)

where t is the number of recoverable errors, e.g., t=2 for a (61,53)
code.

##### Implementation

#####  

With the aforementioned modifications, it is now possible to pass from
the chip SNR to the max BER threshold called "ECC threshold" in OPNET.
We modified the BER pipeline stage according to Equation (1) in order to
obtain the channel bit error probability as an output. We modified the
« dra_ber » pipeline stage file by adding the term *k/n* in the
effective SNR. Then we recompiled the new file « ber_bpsk » using the
op_mko OPNET command.

The ECC threshold should then be chosen at the channel level, and the
computation from equation (2) performed by the user. In this case, the
code allows t=2 errors every 63 bits, which means 3% errors at the bit
level. According to equation (2), this corresponds to 5% errors at the
channel level. Hence, we set the OPNET ECC threshold to 0.05.

This is the solution we use to simulate direct-sequence spread-spectrum
at the channel level. In the simulation section, we compare the
characteristics of this channel with a channel without direct-sequence
spread-spectrum modulation.

**V. Fading Simulation**

In this section, we present a simple way to simulate a fading effect in
a MANET as shown in Figure 5. We assume that each wireless link has the
same fading factor for a period τ seconds, which depends on how fast the
fading is changing.

To implement this phenomenon, we define a *fading table* of size (N\*N),
where N is the number of nodes in the network. Each entry (i, j)
represents the fading factor between node i and node j. In the
Initialization State, we compute a random fading factor according to the
Rayleigh distribution for each link. The table is updated every τ
seconds by recomputing new fading factors.

![](media/image3.png)

Figure 5 - Fading process

For every packet, the "fading field" is set to the value corresponding
to the wireless link on which it will be transmitted. We modified the
*power* pipeline stage so that the received power is multiplied by the
fading factor retrieved from the packet header. The interval time τ and
the variance of the Rayleigh fading process can be chosen at the
beginning of the simulation according to the type of fading to be
simulated (slow or fast fading).

**VI. Performance Metrics and Simulation Results**

In order to evaluate the performance of different routing protocols for
MANET, we need to consider different quantitative metrics. Indeed the
characteristics of a MANET imply that we have to take into account more
factors. In this global simulation framework, we compute the following
statistics:

-   end --to-end delay

-   end-to-end throughput

-   efficiency

-   mean transmitted power per packet

-   mean transmitted power per hop

-   number of hops in the packet path

-   distance of the packet path

-   amount of overhead

**\*\*\* Include Simulation Results \*\*\***

\- Comparison between the two channel model (simple one and SS-DS).

\- Comparison between myopic and source routing.

**Conclusion**

Extra Text:

In myopic routing, a routing decision is made by each node along a path
to the final destination. In contrast, in source routing all routing
decisions are made at the source node and the entire path is stored in
the header of the packet. The type of routing that is more suitable for
a given network depends on the dynamic network conditions.