Queuing Models in NS2

Image
M/M/1 is a system with poisson arrival time, servicing exponentially and a queue of unlimited capacity and type of FIFO Queue. This is the simplest queuing system.  NS2 supports various distributions like pareto, exponential, constant, unifrom, etc to handle the network dynamics and metrics. So it is very easy to test the given network link to monitor a given queue using any of these queuing models. The listing 3 and 4 are monitoring the link when DropTail queue is used with a capacity of finite and infinite. Listing 13.3 uses infinite capacity and Listing 13.4 uses Finite capacity The output screen shot is shown below the scripts for further understanding
Listing 3 – M/M/1 Queuing Model #new Simulator creation set ns [new Simulator] #trace file creation for capturing the UDP data set tf [open out.tr w] $ns trace-all $tf
#setting the exponential distribution param set lambda 30.0 set mu     33.0
#creation of nodes set n1 [$ns node] set n2 [$ns node] #The queue limit is 1Lakh as the capacity is infin…

NS3 installation in Linux Mint 14 (64bit)

This blog is mainly dealing with Network Simulator 2 (NS2). However, more number of requests coming from my readers about the usage of NS3 for network simulation. So I started learning that too and here is the first post on NS3.

  • NS3 is also a discrete event simulator for internet systems and targeted for mainly Education and research purpose.
  • Ns3 uses two languages python and C++, whereas ns2 uses OTCL and C++.
  • The codes from NS2 will not be executing under NS3, however there are some codes have been converted from NS2 like OLSR, etc.
  • NS3 supports both IP and Non IP Based networks, protocols like OLSR, AODV, etc and networks like WiFi, WiMax, LTE, etc.
This post will tell you how to install Network Simulator 3 (NS3) to be installed on a Linux Mint 14 (64bit OS). May be it will work too good for Ubuntu 13.04 also.
  • The NS3 software can be downloaded from http://nsnam.org. It consists of good documentation too. The recent version is 3.17 (ns-allinone-3.17) . Here is the website snapshot.

  • Since the default build files will not be coming by default in Linux OS, they have to be installed before installing ns3. Here is the way to install as given.
    • sudo apt-get update
    • sudo apt-get install build-essential autoconf automake libxmu-dev
    • sudo apt-get install ia32-libs (Optional – This is to install the 32 bit libraries if you have a 64 bit Linux OS)
  • the downloaded file will be like this ns-allinone-3.17.tar.bz2. Once downloaded, extract it using the following command.
    • tar xjfv ns-allinone-3.17.tar.bz2 (This will create a folder called ns-allinone-3.17)
    • cd ns-allinone-3.17
    • ./build.py  (or alternatively you can use source build.py)
  • If everything works well as shown in the figure below, the installation will proceed.
  • After successful installation,  the build will show this screen. There may be some modules would not have built. In my case, brite, click, openflow and visualizer was not built and there were so many modules were built.
  • Most of the examples comes default in the NS3 source will be disabled by default, using the following command as shown in the figure, the examples may be enabled.
    • cd ns-allinone-3.17/ns-3.17/
    • ./waf configure – - enable-examples
  • Once done, as shown below, simply run the ./waf
    • ./waf
    • ./test.py (or source test.py)
    • this testing will compile some more modules.
  • The above command will take more time to PASS all the modules so that the examples may be run.
  • You can check a simple example or module that is running or not.
./waf –run hello-simulator   
the output will be “Hello Simulator”
That’s the successful installation of NS3. All the simulated modules are available in the folder ~ns-allinone-3.17/ns-3.17/. If you encounter any errors, let you post your queries in the comment section.
The next post will tell you about how to execute the modules either in C++ or Python.

Popular posts from this blog

AWK Scripts for NS2 to process data from Trace Files

Xgraph

ns2 installation in Ubuntu 14.04