Archive

Archive for September, 2012

Installing NS-3 in Ubuntu 12.04

September 11, 2012 47 comments

I like to write things down for myself. I am not working with NS-3 these days but if you have more questions, please  refer to the detailed installation guide from the NS website.

If you are reading this post, then I presume you already know what NS-3 is. I have followed the following steps to install and configure NS3 in Ubuntu 12.04.

Open a terminal and run the following commands to install the list of required packages (you may not need all the packages):

sudo apt-get install gcc g++ python              
sudo apt-get install gcc g++ python python-dev
sudo apt-get install mercurial
sudo apt-get install bzr
sudo apt-get install gdb valgrind
sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
sudo apt-get install flex bison libfl-dev
sudo apt-get install g++-3.4 gcc-3.4
sudo apt-get install tcpdump
sudo apt-get install sqlite sqlite3 libsqlite3-dev
sudo apt-get install libxml2 libxml2-dev
sudo apt-get install libgtk2.0-0 libgtk2.0-dev
sudo apt-get install vtun lxc
sudo apt-get install uncrustify
sudo apt-get install doxygen graphviz imagemagick sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
sudo apt-get install python-sphinx dia
sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
sudo apt-get install libboost-signals-dev libboost-filesystem-dev
sudo apt-get install openmpi*
 

You can either download and build development version or get a tarball directly and untar it.  I would recommend you to choose the second option initially.

Option 1: Using Mercurial

cd
mkdir repos
cd repos
hg clone http://code.nsnam.org/ns-3-allinone

Option 2: Downloading NS-3 using a tarball

cd
mkdir tarballs
cd tarballs wget
http://www.nsnam.org/release/ns-allinone-3.13.tar.bz2
tar xjf ns-allinone-3.13.tar.bz2
 

To build your NS-3, run the following command:

./build.py

Configuration with Waf:

./waf distclean
./waf configure    // (or use this > ./waf configure –enable-examples –enable-tests)
./waf build

Now, test your installation using:

./test.py   // or use this ( if you want to test core modules only) > ./test.py -c core
 

Get ready to run your  program. You need waf (a python based framework designed for configuring, compiling and installing applications). Use the following command to run your program:

./waf – -run filename

Your program must be in /scratch directory, because when you run waf they are build at the same time. For example, I am copying a myfirst.cc from a example directory to scratch directory to run the program. Go to your ns directory and run the command to copy, configure and run:

 
cp examples/tutorial/first.cc scratch/myfirst.cc
./waf
./waf –run scratch/myfirst

If you do everything correctly, you should be able to see the following in your command line.

Waf: Entering directory ‘/home/user/repos/ns-3-allinone/ns-3-dev/build’
Waf: Leaving directory ‘/home/userrepos/ns-3-allinone/ns-3-dev/build’
’build’ finished successfully (1.175s)
Sent 1024 bytes to 10.1.1.2
Received 1024 bytes from 10.1.1.1
Received 1024 bytes from 10.1.1.2

If you have something to visualize run the command : ./waf –run scratch/your_program –visualize, and to plot your output use: ./waf –run scratch/your_program | gnuplot

Cheers 🙂

 
 
 
Advertisements

Xorg and Gnome Installation in FreeBSD 9

I know it’s hard for most of you who are new to FreeBSD 9, and still struggling to get the graphical user interface. Don’t worry, just follow the following steps carefully to get what you desire for. Make sure, you are logged in as a root user.

  • Add dbus, hald, and gnome to /etc/rc.conf file. Just append the following lines at the end of your  file.

gnome_enable=”YES”
dbus_enable=”YES”
hald_enable=”YES”

  • Type sysinstall and press enter.
  • Select Configure>Packages>CD/DVD
  • Select Gnome and select all packages
  • Select X11, and select all packages
  • Press Install Button
  • Reboot and see the magic !

 

 

Categories: FreeBSD Tags: , ,

How to use a guest OS installed on Windows 7 – VirtualBox to another VirtualBox – Ubuntu

If you bumped into this post somehow, that means you really really want to use a guest operating system installed on your host operating system (i.e. Windows 7) using VirtualBox to another installed VirtualBox on different host operating system (i.e Ubuntu).

The process involves the following steps:

  1. Run VirtualBox in windows 7
  2. Select File Menu, and click Export Appliances
  3. Choose your desired guest operating system that you want to use.
  4. click next to create a ovf  (Open Virtualization Format) of your guest os.
  5. Now, copy your guestos.ovf file to Ubuntu and run VirtualBox.
  6. Select File Menu, and click Import Appliances
  7. Select guestos.ovf file and click next.
  8. Boom ! You got it !

Cheers !

Install VirtualBox in Ubuntu 12.04

September 10, 2012 1 comment

Installing VirtualBox in Ubuntu 12.04 is very easy, and what you need to do is to run the following commands in your terminal.

Open your terminal, login as  root, and run the command below to update your system:

apt-get update

After that, run the following commands to add VirtualBox repository’s key and VirtualBox repository in Ubuntu:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add –
sh -c ‘echo “deb http://download.virtualbox.org/virtualbox/debian precise contrib” >> /etc/apt/sources.list’

Now, you are ready to install VirtualBox in your system using the following command:

apt-get install virtualbox-4.1

Enjoy your installed VirtualBox to load and run Guest Operating System  in it’s own virtual environment.