In my final year project, I have to vary the transmission range value in order to study the protocol behaviour using simulation with NS-2.
This can be done using a separate C program that is provided at ~ns/indep-utils/propagation/threshold.cc to compute the receiving threshold. It can be used for all the propagation models as discussed in ns-manual 18.4.
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_ \
Compile threshold.cc using this command:
g++ threshold.cc -o threshold
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 thedistance.
Because the communication range in the shadowing model is not an ideal circle, an inverse Q-function [29] 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
Question: I wanted to know the procedure to get Xgraph or Gnuplot from trace file. Answer (by Mubashir Husain Rehmani, Paris, France):
As far as gnuplot is concerned, its very easy and there is no need of any
language to learn it. what you have to do is:
1. Install gnuplot in your linux (ubuntu) distribution.
2. Once you are in the directory of gnuplot, just write gnuplot at the command prompt
3. Then once you are in gnuplot command prompt then write load "Graph.p"
4. and see the graph.
====================
Code for file Graph.p
====================
set title "Relationship between Two functions"
set xlabel "First function"
set ylabel "Second function"
set xrange [0.0:100]
set yrange [0.00:10]
set grid
set boxwidth 15
plot "Graph.tr" using 1:2 with lines lt 1 lw 2 title ''; replot
set term post eps enhan color
set out "Graph.eps"; replot
=====================
Data present in Graph.tr
=====================
0 0
10 3.16
20 4.47
30 5.48
40 6.32
50 7.07
60 7.75
70 8.37
80 8.94
90 9.49
100 10
I came across this error during NS 2.34 installation on a machine with Centos 5.2. After several tries, I managed to solve this issue by running this commands.
yum install g-c++
it seems that the compiler is not installed in the machine.
I am using the setdest tool in ns-2 to generate a mobility scenario that has 200 users and lasts 1 hour. I used version 2. It took seven to eight hours to generate only800 seconds. Is this normal? I hope some people more experienced with this can give me help.
Solution:
Check the source code setdest.cc under indep-utils/cmu-scen-gen, you can comment out parts that display routing tables. This will dramatically reduce the time needed to generate the scenario.
Embedded below is my personal compilation of NS-2 installation error. Some are my own, while some are other's.
If anyone encountered any other error in different linux distro perhaps, plz email me.
Trace graph is a free network trace files analyser developed for network simulator ns-2 trace processing. Trace graph can support any trace format if converted to its own or ns-2 trace format. Trace graph runs under Windows, Linux, UNIX and MAC OS systems. Trace converter processes traces over 80x faster.
1. Download Tracegraph from tracegraph.com
2. Select Linux version and download two files : mglinstaller.gz, tracegraph202linux.tar.gz
3. Copy both files to your home directory i.e /home/user
4. Untar the file tracegraph202linux.tar.gz using this command : tar zxvf tracegraph202linux.tar.gz
5. Once done, you will have a folder called tracegraph202.
6. Now copy the mglinstaller.gz in /home/user to /home/user/tracegraph202
7. Next, unzip the mglinstaller.gz by using this command : gzip -d mglinstaller.gz
8. the above command will create a folder within the bin folder and set the following lines to the LD_LIBRARY_PATH variable export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user /tracegraph202/bin/glnx86
9. Now copy the lines to your .bashrc file by using either of this command gedit /home/user/.bashrc vi /home/user/.bashrc For root : gedit /root/.bash_profile
10.Now save the file and back to tracegraph202 folder and run tracegraph using this command : ./trgraph
Error you might encountered :
./trgraph: error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory