Installing PyViz in NS3

This post tells the method to install PyViz (or visualizer module) in ns3. Visualize is a module that shows the output in the form of animation and there are some packages need to be installed.
For installation of ns3, you may refer this link: http://www.nsnam.com/2014/08/ns3-installation-in-linux-mint-17.html
For another Animation NetAnim installation, follow this link: http://www.nsnam.com/2014/08/installing-netanim-software-for-ns3-in.html

Steps to install PyViz (visualizer)
1. Open the termina and execute the command one by one
pradeep@localhost $] sudo apt-get install python-dev python-kiwi python-pygoocanvas python-pygraphviz
pradeep@localhost $]  sudo apt-get install python-gnome2 python-gnomedesktop python-rsvg
Once installed, go to the ns-allinone-3.20 folder and execute this command 
pradeep@localhost $] cd ns-allinone-3.20
pradeep@localhost $] ./build.py --enable-examples --enable-tests

Thus "visualize" is installed successfully.
the general command to run the visualize is 
./waf --run myprogram --vis 
or
./waf --run myprogram --visualize

To see the output in the visualizer, here is the step
pradeep@localhost $] cd ns-allinone-3.20/ns-3.20
pradeep@localhost $] ./waf --run examples/tutorial/third --vis 
or 
pradeep@localhost $] ./waf --run examples/tutorial/third --visualize 
Here is the screenshot of the visualize.

PyViz
visualize on NS3






T S Pradeep Kumar

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

Installing NetAnim software for NS3 in Ubuntu 14.04

This post will tell you the installation instructions for NetAnim Software in Ubuntu.
NS3 is a discrete event simulator similar to ns2 and both vary depends on the languages in which they were used.
NS3 uses C++ with optional Python bindings, whereas ns2 uses OTCL with C++.
The ns2 comes with a default network animator called nam and it will be there in the allinone package of ns2.  But ns3 does not have any default animator, but there is a support from the NetAnim.

NetAnim is a software that process the xml files for graphical output which are generated through ns3. 

Method 1:
NetAnim can be downloaded from the URL http://code.nsnam.org/jabraham3/netanim-3.104

Method 2:
However, ubuntu or debian or Linux Mint solves this problem through apt-get itself.

Prerequisites:

  • NS3 compiled (or installed) 
  • OS Used: Ubuntu 14.04 64 bit
  • NS3 Version (ns-3.20)


pradeepkumar@pradeepkumar~$ sudo apt-get install NetAnim 
The above command is case sensitive (NetAnim)

To run once its installed
pradeepkumar@pradeepkumar:~$ NetAnim file.xml
if you already has a file.xml. 

Here are the screenshots 
NetAnim
NetAnim in Ubuntu 14.04

NetAnim
NetAnim in Ubuntu 14.04


T S Pradeep Kumar