Search This Blog

Loading...

Automated Post Processing (APP) Tool for ns-2 trace files

0

Labels: , , , , , , , , ,

Reactions: 

Automated Post Processing (APP) Tool has been designed and developed by Wireless Information Networking Group (WiNG) at NITK, Surathkal with an aim to help the ns-2 users in processing the trace files and plotting graphs. 

Although several such tools already exist, APP has been designed with a few unique features that are distinct from other tools:

1. APP Tool does not require installation! Just download the APP folder and run the tool.

2. APP Tool helps you to obtain values / graphs for at least 20 parameters!

3. APP Tool uses AWK Scripts in the back end!

4. APP Tool's source code is free and flexible! i.e., you can also add your own AWK Script in APP Tool and use it for plotting a graph.

5. Front end of APP Tool is designed in Python! You can customize it as per your requirements.

6. You need only two packages installed on your machine to run APP Tool: python-gi and python-matplotlib.

A total of 20 AWK Scripts are provided in the APP Tool, one for each of the parameter shown in the image below:

[Click to enlarge the image]

Note: You may have to modify some of the AWK Scripts to meet your requirements. As mentioned before, you can also add your own AWK Script to APP with ease, in case you want to analyze a different parameter. Moreover, not every parameter among the 20 mentioned above need graphs. Hence, APP plots graphs only for the parameter for which graphs are required. 


Instructions on "How to run APP Tool" have been provided in the Readme file available on the download link given above.

APP Tool has been dual licensed under the MIT or GPL v3 Licenses. Contributors to this project: Sayan Paul, Jay Priyadarshi, Sasank Channapradaga, Spriha Awinpushpam and Mohit P. Tahiliani

Kindly Note: Please report to us in case you find any errors while working with the APP Tool. You can write to us at wing@nitk.ac.in or place a comment in this post itself.

Hope it helps.

Regards,
Mohit P. Tahiliani

[ns-3] TraceMetrics: A trace file analyzer for ns-3

0

Labels: , , ,

Reactions: 

TraceMetrics, developed in Java, is an open source trace file analyzer for analyzing the trace files (.tr) of ns-3 [1]. TraceMetrics does not require installation! You just need to have Java installed on your machine to use it.

Prerequisites for working with TraceMetrics: JDK 7 must be installed on your machine.

Command to install JDK 7 on Ubuntu OS is:

sudo apt-get install openjdk-7-jdk

Before we proceed to work with TraceMetrics, it is important that we have a ns-3 trace file which we can analyze with TraceMetrics. To get the ns-3 trace file, follow any one of the three options given below:

Option 1: If you have already installed ns-3, follow the steps given below:

1. Copy the file named

tcp-bulk-send.cc 

from this directory: ns-allinone-3.xx/ns-3.xx/examples/tcp

and paste it into the following directory: ns-allinone-3.xx/ns-3.xx/scratch

2. Go to ns-allinone-3.xx/ns-3.xx via terminal and give the following command to run tcp-bulk-send.cc

./waf --run "scratch/tcp-bulk-send --tracing=true"

3. If the above mentioned command is successful, search for a file named "tcp-bulk-send.tr" in your ns-allinone-3.xx/ns-3.xx directory.

If you find "tcp-bulk-send.tr", then your trace file is ready for analysis. "tcp-bulk-send.tr" is the trace file which will be analyzed by TraceMetrics.

You may Skip Option 2 and Option 3 and directly read "How to use TraceMetrics" Section!

Option 2: If you have not yet installed ns-3, follow the steps given below:

1. Install ns-3. I have written a separate post for installation of ns-3. Here is the link:


2. After successfully installing ns-3, follow the steps given in "Option 1" of this post.

Option 3: If you just want to see how TraceMetrics works and would like to generate your trace files at a later point, just download the "tcp-bulk-send.tr" from the link given below:

Download tcp-bulk-send.tr

How to use TraceMetrics

Follow the steps given below to start analyzing "tcp-bulk-send.tr" by using TraceMetrics:

1. Download TraceMetrics from the following link:


2. Unzip the downloaded file i.e., tracemetrics-1.3.0.zip.

3. Go in the extracted folder i.e., tracemetrics and open the file named "tracemetrics.jar". You should see tracemetrics loading like shown in the Image below:

[Click on the Image to enlarge]

and then the following window should open:

[Click on the Image to enlarge]

4. Select File -> Choose File and then navigate to the folder where you stored "tcp-bulk-send.tr". Select "tcp-bulk-send.tr"

5. The next window that appears will look like the Image shown below:

[Click on the Image to enlarge]

6. Click on "Execute analysis" button on the bottom right corner.

You are done with it!

NOTE: A wonderful tutorial on how to analyze the parameters is provided by the developers of TraceMetrics. You can download it from the following link:


References:

[1] TraceMetrics Official Webpage: http://www.tracemetrics.net/

Hope it helps.

Best Regards,
Mohit P. Tahiliani

[ns-3] Installing and Testing ns-3 with NetAnim on Ubuntu 14.04

1 |

Labels: , , , , , ,

Reactions: 

This post describes a step-by-step procedure to download, install and test ns-3 with NetAnim on Ubuntu 14.04 LTS.

ns-3 version considered: ns-allinone-3.20

List of Prerequisite Packages to be installed:
1. gcc
2. g++
3. python
4. python-dev (Optional: If you want to use Python as the main language for network configuration)
5. mercurial (Optional: If you choose Method 2 (explained below) for downloading and installing ns-3)
6. qt4-dev-tools (Optional: If you want to install *NetAnim* (animator for ns-3) along with ns-3)
7. tcpdump (Optional: Required for analyzing packet capture files (.pcap) generated by ns-3)
8. wireshark (Optional: Alternative to tcpdump. You can use anyone of these)
9. gnuplot (Optional: Required for plotting high quality graphs through *.dat* files generated by ns-3)

Installing Prerequisite Packages:
Give the following command to install the above mentioned packages:

sudo apt-get install gcc g++ python python-dev mercurial qt4-dev-tools tcpdump wireshark gnuplot

You may remove the optional package's name from the above command if it is not required!

Downloading ns-3:
ns-3 can be downloaded in at least two different ways [1]:

Method 1 (Recommended for beginners): Downloading a ns-3 tarball i.e., a zipped folder (We follow this method here)

Go to following link to download ns-allinone-3.20 tarball:

https://www.nsnam.org/release/ns-allinone-3.20.tar.bz2

For older versions of ns-3, you can download the tarball from the following link:

http://www.nsnam.org/releases/older/

Method 2: Downloading through *bake*

You need to have packages 4 and 5 from the list shown above to download ns-3 using bake. Once the prerequisite packages are installed, follow the instructions given on [1] to download ns-3:

Installing ns-3 and NetAnim:
ns-3 can be installed in three different ways [2]:

Method 1: by using build.py (We follow this method in this post)
Method 2: by using bake
Method 3: by using Waf

For Method 2 and Method 3 of installation, follow [2].

After you have followed Method 1 for downloading ns-allinone-3.20 tarball, you may keep your downloaded tarball on the Desktop and then follow the steps given below to install it:

NOTE: NetAnim (the animator for ns-3) package comes bundled in ns-allinone-3.xx tarball. So if you want to install *NetAnim* along with ns-allinone-3.20, then install qt4-dev-tools package before you proceed to the next steps because when you try to install ns-allinone-3.xx package, it first tries to install NetAnim. It searches for qt4-dev-tools package and if it is not found - NetAnim installation will be skipped! Alternatively, you can also choose to install NetAnim later via apt-get 

Step 1: Go to Desktop via terminal and unzip the ns-allinone-3.20.tar.bz2 tarball

cd Desktop

tar xjf ns-allinone-3.20.tar.bz2

Step 2: Go in ns-allinone-3.20 folder and give the following command for installation:

./build.py --enable-examples --enable-tests

After a while, you may see the following message

Leaving directory './ns-3.20'

which indicates that ns-3 is installed !!!

Testing ns-3:
To test whether all modules of ns-3 are installed successfully, follow the procedure as given below:

Step 1: Go to ns-allinone-3.20/ns-3.20 folder and give the following directory:

./test.py -c core

Some tests may be skipped while testing but that should not bother you if your module is not among those that were skipped!

Testing NetAnim (only for those users who installed qt4-dev-tools package before ns-3 installation):
To test whether NetAnim is installed successfully, follow the procedure given below:

Step 1: Go to ns-allinone-3.20/netanim-3.105 and give the following command:

./NetAnim

A window as shown below should open:

[Click on the Image to enlarge]

You are done with it!

References:

[1] Downloading ns-3, http://www.nsnam.org/docs/release/3.20/tutorial/singlehtml/index.html#downloading-ns3

[2] Building ns-3, http://www.nsnam.org/docs/release/3.20/tutorial/singlehtml/index.html#building-ns3 

Underwater Sensor Network Simulations in ns-2 using Aqua-Sim

4

Labels: , , , , ,

Reactions: 

This post describes a step-by-step procedure to simulate "Underwater Sensor Networks" in ns-2 by using Aqua-Sim tool [1]. Some of the outstanding features of Aqua-Sim are [2]:

1. Simulates acoustic signal attenuation and packet collisions in underwater sensor networks.
2. Supports 3D deployment.
3. Can be easily integrated with existing codes of ns-2.
4. Independent of CMU wireless simulation package of ns-2.
5. Changes in either of them do not affect the other packages.

NOTE: 
1. You do not need to have ns-2 pre-installed to work with Aqua-Sim.
2. Aqua-Sim tool is distributed as a *tarball* rather than a *patch* [2].
3. Aqua-Sim tarball = Original ns-2.30 tarball + Aqua-Sim Source Codes.
4. Installing the *tarball* distributed by Aqua-Sim developers is enough.
5. Source code for 3D deployment is not distributed inside the above mentioned tarball.
6. For 3D deployment, separate tarball called *Aqua-3D* is distributed [3].
7. First, this post explains the installation of Aqua-Sim tarball.
8. Secondly, this post explains the installation of Aqua-3D.

Follow the steps given below to install Aqua-Sim:

1. Download Aqua-Sim-1.0.tgz

2. Unzip Aqua-Sim-1.0.tgz. You will get a folder named Aqua-Sim-1.0

3. Give the following command:

./install

4. If you get error in *otcl* installation, then go to the following folder:

Aqua-Sim-1.0/otcl-1.12

and then open the *configure* file. Go to line number 5516 and replace

ld -shared

by

gcc -shared

then go back to Aqua-Sim-1.0 folder via terminal and try to re-install Aqua-Sim by giving the following command:

./install

5. You may or may not get further errors depending on the gcc version of your Linux flavor.

6. Once the installation is completed, go to following directory:

Aqua-Sim-1.0/ns-2.30

and give the following command (NOTE: this command requires *root* access):

make install 

7. Verify whether Aqua-Sim is installed successfully or not by going to the following folder:

Aqua-Sim-1.0/ns-2.30/underwatersensor/uw_tcl

and give the following command

ns vbf_example_5.tcl

If the above TCL Script works fine, Aqua-Sim has installed successfully!

Otherwise, please feel free to report the errors that you get during the installation procedure.

Following are the steps to install Aqua-3D:

1. Download Aqua3d-1.0.0-src.tgz

2. Depending on your Linux flavor, install the packages listed on the following link, before proceeding for installation:

http://obinet.engr.uconn.edu/wiki/index.php/Aqua-3D#Requirements

3. Unzip Aqua3d-1.0.0-src.tgz. You will get a folder named aqua3d-1.0.0-src

4. Go in aqua3d-1.0.0-src folder via terminal and give the following command:

make

5. If all packages were properly installed during Step 2, you will get a exectuable named *aqua3d* in aqua3d-1.0.0-src folder. Try running it by giving the following command;

./aqua3d

or just *double click* on aqua3d.

6. New window, like the one shown below, will open:

                                                          [Click on the image to enlarge]

7. Aqua-Sim takes *.nam* files as input. A Sample .nam file called *vbva.nam* is provided in the following folder:

aqua3d-1.0.0-src/trace_example

8. Using the *File -> Open Trace (no options)* option in the window shown above, open vbva.nam. A new window, as shown below, would open:

                                                         [Click on the image to enlarge]

9. Alternatively, you can also open the same file with *File -> Open Trace (with options)*

A very detailed and clear information about Aqua-Sim's features, architecture, support of routing protocols and mac protocols, mailing lists,  etc is provided on the following link:


A very clear and basic tutorial (contains explanation of the TCL scripts corresponding to Aqua-Sim) is available on the following link:


References / Acknowledgements:

[1] "Aqua-Sim 2: An NS-2 Based Simulator for Underwater Sensor Networks", Yibo Zhu, Xiaoyan Lu, Lina Pu, Yishan Su, Robert Martin, Michael Zuba, Zheng Peng and and Jun-Hong Cui, in Proc. of ACM WUWNet, Kaohsiung, Taiwan, 2013.

[2] Official webpage of Aqua-Sim: http://obinet.engr.uconn.edu/wiki/index.php/Aqua-Sim

[3] Official webpage of Aqua-3D: http://obinet.engr.uconn.edu/wiki/index.php/Aqua-3D

Hope it helps.

Regards,
Mohit P. Tahiliani

Blackhole Attack in ns-2

10

Labels: , , ,

Reactions: 

The patch provided in this post enables a ns-2 user to simulate "Blackhole Attack in ns-2" for Mobile Ad hoc Network (MANET) Simulations. Blackhole attack has been implemented using Ad hoc On demand Distance Vector (AODV) routing protocol. As of now the patch will only work on ns-2.35 version! Patches for older versions of ns-2 will be provided soon.

Material provided with this post:

1. A patch to simulate Blackhole attack in ns-2.35 and steps to apply that patch.
2. Sample TCL script to demonstrate how to configure a malicious nodes.
3. AWK Script that calculates Packet Delivery Ratio (to confirm whether the code really works!)

Follow the steps given below to apply Blackhole patch to ns-2.35:

1. Download ns-allinone-2.35.tar.gz

2. Download Blackhole.patch

3. Unzip ns-allinone-2.35.tar.gz. You will get a folder named ns-allinone-2.35

4. Paste the downloaded Blackhole patch in the above mentioned folder.

5. Give the following command:

patch -p1 -t < Blackhole.patch

6. Go in ns-allinone-2.35 via terminal and give the following command (It is always recommended to be in root mode while giving the below command):

./install

If you already have an installed copy of ns-allinone-2.35, then follow the steps given below to apply the Blackhole patch:

1. Paste the downloaded Blackhole patch in ns-allinone-2.35 directory.

2. Give the following command:

patch -p1 -t < Blackhole.patch

3. Go in ns-allinone-2.35/ns-2.35 directory and give the following commands:

./configure
make clean
make
make install

You are done with it!

Sample TCL Script and AWK Script to verify the working of Blackhole Patch:

Download blackhole.tcl and pdf.awk from the links given below and keep them in the same folder:

blackhole.tcl

pdf.awk

How to use these files for verification?

I. Open blackhole.tcl and comment the following line (remember: # is used for commenting)

$ns at 0.0 "[$n5 set ragent_] hacker"

$n5 in the above line represents node 5. The word "hacker" has been used to represent "attacker". You may try making any other node as an hacker also. 

0.0 in the above line indicates that from beginning of the simulation itself, node 5 acts an attacker in the network. Blackhole attack is mainly launched during the Route Establishment phase and hence it is important to configure a node to be an attacker from the beginning of the simulation.

We comment the above line so that we can first analyze the behavior of a normal network without Blackhole attack. At a later point, we will uncomment this line and analyze the behavior of the network when it is attacked by node 5.

II. Run blackhole.tcl by giving the following command:

ns blackhole.tcl

III. Give the following command to run the pdf.awk and note down the results:

awk -f pdf.awk blackhole.tr

IV. Open blackhole.tcl again and uncomment the line which you commented earlier (i.e., this time the attacker will attack the network)

V. Run blackhole.tcl by using the same command as mentioned in Step II.

VI. Note down new results by running the pdf.awk as mentioned in Step III.

You would observe that none of the packets are delivered and ratio turns out to be zero.

You can also verify the working of the patch by observing packet drops in NAM window. Here is one snapshot which shows the same:

[Click on the Image to enlarge]

Acknowledgements: 

1. Thanks to E. Talipov's link: http://elmurod.net/en/index.php/archives/196 using which a major part of the patch has been designed.

2. Thanks to Gaurav Gupta for designing the sample TCL script named "blackhole.tcl" and also for his assistance in shaping up this patch.

3. Thanks to Knud F. L. for his crucial feedback on the design of the patch.

Hope it helps.

Regards,
Mohit P. Tahiliani

CoDel's patch for ns-2.31 (to support TCP Evaluation Suite)

15

Reactions: 

Controlled Delay (CoDel) is a newly proposed AQM mechanism developed by Kathleen Nichols and Van Jacobson. CoDel is parameterless and controls the delay, while insensitive to round-trip delays, link rates, and traffic loads. CoDel's patch is originally designed for ns-2.35. The patch for ns-2.35, instructions for download and trying the sample TCL codes are available at the following link: http://www.pollere.net/CoDel.html

This patch is a slight modification of the original patch and is designed for ns-2.31, mainly to be used along with TCP Evaluation Suite, which is available for ns-2.31 only. However, you can also use it without the TCP Evaluation Suite. 

TCP Evaluation Suite is a standard tool used for the analysis of newly proposed TCP Variants, especially High-Speed TCP Variants. The simulation code of TCP Evaluation Suite is based on original Linux TCP Code. 

CoDel's ns-2.31 patch is designed mainly to assist the community to analyze the interaction of CoDel with existing TCP Variants while using TCP Evaluation Suite.

Contributed by: Dipesh Raghuvanshi

Following are the steps to be followed to apply given patch to ns-2.31:

1. Download ns-allinone-2.31.tar.gz

2. Download CoDel-ns-2.31.patch

3. Unzip ns-allinone-2.31.tar.gz. You will get a folder named ns-allinone-2.31

4. Paste the downloaded patch in this folder.

5. Give the following command:

    patch -p1 > CoDel-ns-2.31.patch

6. Then give ./install

If you already have an installed copy of ns-allinone-2.31, then follow the steps given below to apply the CoDel patch:

1. Paste the downloaded patch in ns-allinone-2.31 folder.

2. Give the following command:

    patch -p1 > CoDel-ns-2.31.patch

3. Go in ns-allinone-2.31/ns-2.31 directory.

4. Give the following commands:

    ./configure

    make clean

    make

    make install

You are done with it!

To verify the working of this patch, an example TCL Script named "codel.tcl" will now be available in ns-allione-2.31/ns-2.31 directory.

Go in ns-allinone-2.31/ns-2.31 directory and run the file by giving: ns codel.tcl

If you encounter any problem in downloading the patch from the link given above, please follow this link:


Hope it helps.

Regards,
Mohit P. Tahiliani

Rate Control Protocol (RCP) Patch for ns-2.35

33

Labels: , ,

Reactions: 

Rate Control Protocol (RCP) is a congestion control mechanism which focuses on minimizing the flow-completion time. It is designed and developed by Nandita Dukkipati, a Ph.D Student then, at Stanford University. Following is a link to the official page of RCP:

http://yuba.stanford.edu/rcp/

RCP's patch for ns-2 is available on the above link for ns-2.28 and ns-2.30 versions. Since installation procedure of these ns-2 versions on present Linux flavors hinders several researchers, I developed a RCP patch for ns-2.35 which is the latest version.

Follow the steps given below to apply RCP's patch to ns-2.35:

1. Download ns-allinone-2.35.tar.gz

2. Download rcp-ns2-35.patch

3. Unzip ns-allinone-2.35.tar.gz. You will get a folder named ns-allinone-2.35

4. Paste the downloaded RCP patch in the above mentioned folder.

5. Give the following command:

patch -p1 < rcp-ns2-35.patch

6. Go in ns-allinone-2.35 via terminal and give the following command (It is always recommended to be in root mode while giving the below command):

./install

If you already have an installed copy of ns-allinone-2.35, then follow the steps given below to apply the RCP patch:

1. Paste the downloaded RCP patch in ns-allinone-2.35 directory.

2. Give the following command:

patch -p1 < rcp-ns2-35.patch

3. Go in ns-allinone-2.35/ns-2.35 directory and give the following commands:

./configure
make clean
make
make install

You are done with it!

Sample TCL Scripts:
Use the sample TCL Scripts provided on the official website of RCP. Following is the link:

http://yuba.stanford.edu/rcp/#implementation

rcp-ns-2.30.tar.gz must be downloaded from the above link. It contains a folder named "example-tcl-files" which contains the sample TCL Scripts.

A Note on the installation of ns-allinone-2.35:
You may or may not get installation errors depending on which version of gcc is used in your OS. With Ubuntu 10.04 (gcc 4.4.3), the installation procedure did not give any error. However, with later versions of Ubuntu there are chances that you may get a few errors. If you do not find a solution for those errors, report it in the Comments section.

Hope it helps.

Regards,
Mohit P. Tahiliani

Guest Book...!!!