Showing posts with label NS2. Show all posts
Showing posts with label NS2. Show all posts

Tuesday, 31 March 2015

SUMO 0.12.3 and MOVE installation in Ubuntu 12.04 LTS

This post will tell you how to install SUMO 0.12.3 and MOVE in Ubuntu 12.04 LTS. 

SUMO (Simulation of Urban MObility) is a free and open traffic simulation suite which is available since 2001. SUMO allows modelling of intermodal traffic systems including road vehicles, public transport and pedestrians. Included with SUMO is a wealth of supporting tools which handle tasks such as route finding, visualization, network import and emission calculation. SUMO can be enhanced with custom models and provides various APIs to remotely control the simulation.

MOVE allows users to rapidly generate realistic mobility models for VANETs simulations. MOVE is built on top of an open source micro-traffic simulator SUMO. The output of MOVE is a realistic mobility model and can be immediately used by popular network simulators such as NS-2.

Execute the following commands one by one 

sudo apt-get update

sudo apt-get install build-essential autoconf automake libxmu-dev default-jre g++-4.4 libproj-dev libgdal-dev libxerces-c2-dev libfox-1.6-dev

export CC=gcc-4.4 CXX=g++-4.4 

SUMO 0.12.3 Installation 

Download Sumo 0.12.3 from here

Extract the downloaded file using the following command

tar xzvf sumo-src-0.12.3.tar.gz 

Now go inside the extracted file using the command cd sumo-0.12.3/ and run the following command

./configure

make

sudo make install

The screenshots of sumo and sumo-gui after successful installation of sumo 0.12.3




MOVE Installation 

Download the MOVE Software from here.

The file that you have downloaded is a java executable file, so you need to run the following command to run the file

java -jar filename.jar (Java required, if you have not installed java click here)

This is the screenshot of MOVE




Wednesday, 11 March 2015

MOVE: A Practical Simulator for Mobility Model in VANETs

Vehicular Ad-Hoc Networks (VANETs) is surging in popularity, in which vehicles constitute the mobile nodes in the network. Due to the prohibitive cost of deploying and implementing such a system in real world, most research in VANETs relies on simulations for evaluation. A key component for VANETs simulations is a realistic vehicular mobility model that ensures conclusions drawn from simulation experiments will carry through to real deployments. In VANETs simulations, the mobility models used affect strongly the simulation output. Researchers need to decide what level of details are required for their simulations.

MOVE allows users to rapidly generate realistic mobility models for VANETs simulations. MOVE is built on top of an open source micro-traffic simulator SUMO. The output of MOVE is a realistic mobility model and can be immediately used by popular network simulators such as NS-2.

NOTE: MOVE supports only SUMO-0.12.3

MOVE Installation 
  • Download the MOVE Software from here.
  • The file that you have downloaded is a java executable file, so you need to run the following command to run the file
  • java -jar filename.jar (Java required, if you have not installed java click here)
  • Once the command is executed, a screen pop out 
This is how the screen looks like



Sunday, 1 March 2015

Creating Real Time Vehicular Traffic Simulation Using SUMO and Openstreetmap

This article is published in the "Open Source For you" magazine in India in this month August 2015 edition. This post will tell you how to create a real time traffic using SUMO and Openstreetmap.

I have used SUMO 0.22.0 for this simulation.

Prerequisite: SUMO required

Use openstreetmap to download your map

You need to select the map that you want to simulate and export it. After you export the map, it will ask for you to download it. Save the file.

Copy the downloaded file to your working directory.


Now run the following commands by seeing the video below

netconvert imports the road network stored in "map.osm" and stores the SUMO-network generated from this data into "map.net.xml":

netconvert --osm-files map.osm -o map.net.xml

OSM-data not only contains the road network but also a wide range of additional polygons such as buildings and rivers. These polygons can be imported using polyconvert and then added to a sumo-gui-configuration.

click here and copy the typemap file and save it to your working directory with the name typemap.xml

Using the file typemap.xml, polyconvert imports polygons from OSM-data and produces a Sumo-polygon file.

polyconvert --net-file map.net.xml --osm-files map.osm --type-file typemap.xml -o map.poly.xml

randomTrips.py generates a set of random trips for a given network (option -n). It does so by choosing source and destination edge either uniformly at random or weighted by length (option -l), by number of lanes (option -L) or both. The resulting trips are stored in an xml file (option -o, default trips.trips.xml) suitable for the DUAROUTER which is called automatically if the -r option (with a filename for the resulting route file) is given. The trips are distributed evenly in an interval defined by begin (option -b, default 0) and end time (option -e, default 3600) in seconds. The number of trips is defined by the repetition rate (option -p, default 1) in seconds. Every trip has an id consisting of a prefix (option --prefix, default "") and a running number.

python /home/kunal/sumo-0.22.0/tools/trip/randomTrips.py -n map.net.xml -e 100 -l

python /home/kunal/sumo-0.22.0/tools/trip/randomTrips.py -n map.net.xml -r map.rou.xml -e 100 -l

Now you need to make a sumo.cfg file for the configuration of sumo-gui. You can see that in the video below.

Now save the above file with a file name. I saved it with map.sumo.cfg

Now run the following command from terminal

sumo-gui map.sumo.cfg

After you enter the command, sumo GUI window will pop out.

You can have a look at this video for complete simulation


Share your experience with us, Any queries please comment below

Friday, 20 February 2015

Use Xgraph for Plotting Graphs in NS2

Xgraph is an X-Windows application that includes:

  • interactive plotting and graphing
  • animation and deritives
  • portability and bug fixes
To run xgraph you need to enter the following command in your terminal

$ xgraph [filename].xg

The following example shows the comparison between three protocols for temperature vs time. 

The three protocol that I have used is AODV, DSDV and LEACH.

Open a text editor and save the following values with a name, let’s say temperature.xg

Now run the command xgraph temperature.xg

TitleText: Temperature Vs Time
YUnitText: Temperature
XUnitText: Time
"LEACH"
0.101696 28.785601
0.111696 26.269455
0.121696 14.959191
0.131696 25.293587
0.141696 30.931101
0.151696 24.457528
0.161696 18.711203
0.177869 24.049889
0.187869 30.155190
0.197869 23.436181
0.207869 14.882664

"AODV"
0.105162 20.642021
0.115162 9.209109
0.125162 24.508792
0.135162 25.728884
0.147681 31.114854
0.157681 26.044112
0.177268 24.369410
0.187268 22.886387
0.197268 24.093065
0.207268 24.930244

"DSDV"
0.109013 23.600860
0.119013 21.985642
0.138179 25.826512
0.148179 25.370684
0.158179 28.402469
0.168179 24.851947
0.178179 30.817568
0.188179 34.148164
0.198179 27.616187
0.208179 29.777069

After you execute the command, your output window will be this


Share your experience with us, Any queries please comment below

Monday, 16 February 2015

Installing SUMO 0.22.0 in Linux Mint 64-bit Operating System

SUMO (Simulation of Urban MObility) is a free and open traffic simulation suite which is available since 2001. SUMO allows modelling of intermodal traffic systems including road vehicles, public transport and pedestrians. Included with SUMO is a wealth of supporting tools which handle tasks such as route finding, visualization, network import and emission calculation. SUMO can be enhanced with custom models and provides various APIs to remotely control the simulation.

The simulation platform SUMO offers many features:

  • Microscopic simulation - vehicles, pedestrians and public transport are modeled explicitly
  • Online interaction – control the simulation with TraCI
  • Simulation of multimodal traffic, e.g., vehicles, public transport and pedestrians
  • Time schedules of traffic lights can be imported or generated automatically by SUMO
  • No artificial limitations in network size and number of simulated vehicles
  • Supported import formats: OpenStreetMap, VISUM, VISSIM, NavTeq
  • SUMO is implemented in C++ and uses only portable libraries

Installation Steps

Step 1 : Download the latest version of SUMO from here.

Step 2 : Install the necessary packages by entering the following commands

sudo apt-get install libgdal1-dev libxerces-c2-dev libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev

Step 3 : Copy the downloaded file from your Downloads folder to your home folder, Unzip the tar file using the command

tar zxvf sumo-src-0.22.0.tar.gz

Step 4 : Get inside sumo-0.22.0 using the command cd sumo-0.22.0 and enter these commands one after the other
  1. ./configure
  2. make
  3. sudo make install
Step 5 : After the installation is over, Enter the following command in your terminal to view the GUI

sumo-gui

Sunday, 15 February 2015

Tracing Packet Loss, Packet Drop End to End Delay Using Tragegraph in NS2

This post will show you how to trace Packet Loss, Packet Drop and End to End Delay Using Tragegraph in NS2.

I have used the same wireless network topology which I created in the previous post. Using wireless.tr file, I have traced packet loss, packet dropped, end to end delay etc in tracegraph.

If you don't know how to install tracegraph, click here.


Now you can follow the video tutorial below for tracing Packet Loss, Packet Drop End to End Delay etc.


Share your experience with us, Any queries please comment below

Saturday, 14 February 2015

Creating Wireless Network Topology Using NSG2 For NS2

This post will tell you how to create a wireless network topology using NSG2 for NS-2.

Start your NSG2 by entering the following command in your terminal

java -jar NSG2.1.jar



The NSG window pops out and you can start making your required network topology. Check out the video below which tells you how to create a wireless network topology for NS-2.35.

I have created 11 nodes in which node number 1,7,9 is movable. I have used Ad hoc On-Demand Distance Vector (AODV) Routing protocol in this topology.


Share your experience with us, Any queries please comment below

Wednesday, 11 February 2015

Installing NS-2.35 in Ubuntu 14.04

This post will tell you how to install NS-2.35 in Ubuntu 14.04 64-bit operating system.

NS-2 is a discrete event simulator targeted at networking research. NS-2 provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.

Step 1 : Download NS-2.35 from here.

Step 2 : Copy the downloaded file from the Download folder to your home directory /home/sai folder ( in my case )

Step 3 : Open your Terminal and execute these commands one by one

sudo apt-get update

sudo apt-get install build-essential automake autoconf libxmu-dev

Step 4 : Untar ns-allinone-2.35.tar.gz using the command below

tar zxvf ns-allinone-2.35.tar.gz

Step 5 : Once the file is unzipped, here you need to make a small change in the source file . Go to the folder ns-2.35/linkstate/ and open ls.h using any editor ( gedit or nano or vi). Now go to line number 137 and make the following changes

Just add this-> before erase

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

Once this is done save your ls.h file and close the editor

Now you can install NS-2.35 in your system

Step 6 : Go inside ns-allinone-2.35 by using the command cd ns-allinone-2.35 from your terminal and enter the command ./install

Your installation will start and it will take some time for complete installation


Once the installation is over, you need to set the path for NS-2.35

Step 7 : As I am using Ubuntu, I need to paste the path in .bashrc file. Open .bashrc by entering the following command from your terminal

gedit .bashrc

Once the file is opened, you need to paste your path

export PATH=$PATH:/home/sai/ns-allinone-2.35/bin:/home/sai/ns-allinone-2.35/tcl8.5.10/unix:/home/sai/ns-allinone-2.35/tk8.5.10/unix

Now save your file and close it

From your terminal run the following command to save your changes in the file

source .bashrc

The installation is over, now you need to check whether NS2 is working or not. In order to check type the following commands in your terminal

Enter ns in your terminal, if % symbol comes after you press enter, your installation is successful.

Enter nam in your terminal, if a Nam window pops out, Nam is installed successfully.

For video tutorial click here.

Share your experience with us, Any queries please comment below

Tuesday, 10 February 2015

NSG2 Script Generator Tool for Generating TCL Script

This post will tell you how to use NSG2 tool for generating tcl script for NS2 simulations

NS2 Scenarios Generator 2(NSG2) is a JAVA based ns2 scenarios generator. Since NSG2 is written by JAVA language, you can run NSG on any platform. NSG2 is capable of generating both wired and wireless TCL scripts for ns2.

Some major functions of NSG2 are listed below:

  • Creating wired and wireless nodes
  • Creating connection between nodes
  • Creating links (Duplex-Link and Simplex-Link)
  • Creating agents (TCP and UDP)
  • Creating applications (CBR and FTP)
  • Node movement
You can download the latest version of NSG2 from here.

To execute NSG2, you have to install JAVA first

After installing JAVA, run the following command from your terminal

java -jar NSG2.1.jar

You will get this screen after you press enter

NSG2,1
NSG2,1


Once you finish making your network topology, this is how it will look

I have created a wired network with two source nodes and two destination nodes. You can see the video below for creating a wired network topology step by step


Share your experience with us, Any queries please comment below

Sunday, 8 February 2015

Installing Tracegraph in Linux Mint 17.1 ( 64-bit machine )

This post will tell you how to install Tracegraph in Linux Mint 17.1 64-bit operating system.

Note : Installing Tracegraph in a 32-bit machine will not give you any errors but if you try to install Tracegraph in a 64-bit machine, you will get errors. This is because of 32-bit libraries dependencies for Tracegraph.

Step 1 : Download tracegraph.tar.gz file

Step 2 : Copy the downloaded file from the Download folder to your home directory /home/nabin folder ( in my case )

Step 3 : Untar tracegraph.tar.gz using the command below

tar zxvf tracegraph.tar.gz

Step 4 : Go inside tracegraph202 using the command cd tracegraph202

Step 5 : Now run tracegraph by entering the command ./trgraph

If you get an error, you neet to install 32-bit libraries

Step 6 : Install 32-bit libraries using the following command

sudo apt-get install ia32-libs

Step 7 : After the installation is over, repeat step 5, if you still get error you need to install the folliwing libraries

sudo apt-get install  lib32z1 lib32ncurses5 lib32bz2-1.0 libxi6 libxtst6 libxrender1 libxtst6:i386 libXp6:i386 libXt6:i386

Step 8 : You need to set the path for tracegraph. As I am using Linux Mint, I have to set my path in .profile file. Copy the path and paste it and save your file.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/nabin/tracegraph202/bin/glnx86

Step 9 : Now when you run ./trgraph, your tracegraph window should pop out


You can see the video below for complete installation of Tracegraph in Linux Mint 17.1 ( 64-bit machine )


Share your experience with us, Any queries please comment below

Installing NS-2.35 in Linux Mint 17.1

This post will tell you how to install NS-2.35 in Linux Mint 17.1 64-bit operating system.

NS-2 is a discrete event simulator targeted at networking research. NS-2 provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.

Step 1 : Download NS-2.35 from here.

Step 2 : Copy the downloaded file from the Download folder to your home directory /home/nabin folder ( in my case )

Step 3 : Open your Terminal and execute these commands one by one

sudo apt-get update

sudo apt-get install build-essential automake autoconf libxmu-dev

Step 4 : Untar ns-allinone-2.35.tar.gz using the command below

tar zxvf ns-allinone-2.35.tar.gz

Step 5 : Once the file is unzipped, here you need to make a small change in the source file . Go to the folder ns-2.35/linkstate/ and open ls.h using any editor ( gedit or nano or vi). Now go to line number 137 and make the following changes

Just add this->; before erase

void eraseAll() { this->;erase(baseMap::begin(), baseMap::end()); }

Once this is done save your ls.h file and close the editor

Now you can install NS-2.35 in your system

Step 6 : Go inside ns-allinone-2.35 by using the command cd ns-allinone-2.35 from your terminal and enter the command ./install

Your installation will start and it will take some time for complete installation


Once the installation is over, you need to set the path for NS-2.35

Step 7 : As I am using Linux Mint, I need to paste the path in .profile file. Open .profile by entering the following command from your terminal

gedit .profile

Once the file is opened, you need to paste your path

export PATH=$PATH:/home/nabin/ns-allinone-2.35/bin:/home/nabin/ns-allinone-2.35/tcl8.5.10/unix:/home/nabin/ns-allinone-2.35/tk8.5.10/unix

Now save your file and close it

From your terminal run the following command to save your changes in the file

source .profile

The installation is over, now you need to check whether NS2 is working or not. Inorder to check type the following commands in your terminal

Enter ns in your terminal, if % symbol comes after you press enter, your installation is successful.

Enter nam in your terminal, if a Nam window pops out, Nam is installed successfully.

You can see the video below for complete installation of NS-2.35 in Linux Mint 17.1


Share your experience with us, Any queries please comment below