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 17

This post tells you how to install ns3 in Linux Mint 17 64 bit OS or Ubuntu 14.04. For both the OS, the installation procedure is same.

OS Used: Ubuntu 14.04 and Linux Mint 17
Instruction Set: 64 bits
NS3 Version: ns-allinone-3.20

Steps1: Open the Terminal and execute the command one by one
pradeep@localhost $] sudo apt-get update
pradeep@localhost $]sudo apt-get install build-essential autoconf automake libxmu-dev python-pygoocanvas python-pygraphviz cvs mercurial bzr git cmake NetAnim p7zip-full

the following screenshot shows the installation.
ns3 in mint
NS3 installation in Linux Mint
Step 2: Download the ns-allinone-3.20.tar.bz2 from the http://www.nsnam.org website.
Step 3: Copy the file to the /home/user/  and execute the commands one by one by opening the terminal
pradeep@localhost $] tar jxvf ns-allinone-3.20.tar.bz2
pradeep@localhost $] cd ns-allinone-3.20/
pradeep@localhost $] ./build.py --enable-examples --enable-tests


This process will take some amount of time to get it installed. Once installation is over, check a simple program to test whether ns3 is working,

pradeep@localhost $] cd ns-allinone-3.20/ns-3.20/
pradeep@localhost $] ./waf --run hello-simulator
ns3
ns3 hello simulator output
see the above output "Hello Simulator" that indicates the ns3 is installed and the output of a given example is shown.

To test other scripts or examples of ns3, you can go to the folder
~ns-3.20/examples/tutorial/ 
there are quite number of .cc files of various network. For example, you can copy the first.cc file to ~ns-3.20/scratch/ 
Once copied, execute the command from the ~ns-3.20/ folder.
pradeep@localhost $] cd ns-allinone-3.20/ns-3.20
pradeep@localhost $]./waf --run scratch/first
Waf: Entering directory `/home/nsnam/ns-allinone-3.20/ns-3.20/build'
Waf: Leaving directory `/home/nsnam/ns-allinone-3.20/ns-3.20/build'
'build' finished successfully (1.564s)
At time 2s client sent 1024 bytes to 10.1.1.2 port 9
At time 2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.00737s client received 1024 bytes from 10.1.1.2 port 9


and you can see the output as shown in the figure
ns3 example
UDPEcho Example in NS3

There are so many other examples in the examples/tutorial/ folder and you can try using these.
if you have anything more to share, please respond in the comment section below.

T S Pradeep Kumar

Popular posts from this blog

AWK Scripts for NS2 to process data from Trace Files

Xgraph

ns2 installation in Ubuntu 14.04