Wireless Networking Lab 107: RF Propagation Models in ns2


The goal of this simple exercise is to look closely at some RF propagation models, and their implementation in ns2. The following models are implemented: Free-Space, TwoRayground, and Shadowing (you might find it useful to read through Chapter 18: "Radio Propagation Models" of the ns manual).

ns2 Instructions

Get the tcl script from here. A script "sim.tcl" is provided. This script takes one command-line argument: the value of x. Script usage is : ns sim.tcl -dist {x}

We consider the following topology:

    A -----------x m------------- B

A is engaged in a CBR conversation with B. From within the Tcl Script, you can set the propagation model to either of the three ( set $val(prop) to Propagation/FreeSpace, Propagation/TwoRayGround or Propagation/Shadowing ).

For the Shadowing model, there is a set of lines in the script that set various parameters.You should uncomment these when using the Shadowing model. Vary the shadowing deviation over values 2 dB, 4 dB and 8 dB.

Run the simulation for FreeSpace, TwoRayGround, and Shadowing (with different deviation values) with x= 75m, 100m, 125m, 150m, 200m, 250m. Obtain CBR throughput. (To calculate throughput, you need to calculate [num of received packets/num of sent packets]. Go through the sections 16.1.6 and 16.1.7 of the ns2 manual for understanding and using trace files. The command 'grep "^s" {trace file name} | wc -l' and 'grep "^r" {trace file name} | wc -l' will give the number of sent and received packets respectively.)
Describe what you observe.


1. Know ns2