SlideShare a Scribd company logo
Installation of Ubuntu, ns3 and
compiling first script for
Network Animator (nam)
JAWAD ALI
UNIVERSITY OF ENGINEERING AND TECHNOLOGY PESHAWAR
Portion covered in the presentation
 Vmware .exe and Ubuntu .iso downloading and installation
 Creating new machine for running Ubuntu
 Installation of Ubuntu
 Setting Ubuntu dimension for efficient use
 Installation of prerequisites for ns3 simulator
 Installation of ns3
 Compiling first script using ns3 (wap)
 Installation of network animator (NetAnim)
 Converting example script to NetAnim ready .xml animation
 Running .xml animation via NetAnim
Vmware installation
 Download fresh .exe copy of vmware workstation (likely to be VMWare WS 11)
from
https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vm
ware_workstation/11_0
 Install it on your machine in the regular manner
 Now, download Ubuntu 14.04 LTE or newer version from Ubuntu official site for
Free from http://www.ubuntu.com/download/desktop
Creating New machine for Ubuntu and
Ubuntu installation
 Open vmware workstation and go to File>New
 In the next window, select Ubuntu 14.04 - 32bit operating system and use
the default specifications for the machine except changing the SCSI hard
drive size to >15GB as shown in Fig. 1
 Locate the downloaded .iso of Ubuntu 32bit and proceed with making
machine.
 This above step will take few seconds. You need to power up your new
machine so that in installation begins
Figure 1
Setting Ubuntu dimensions for efficient
use
 After you are finished with the installation
process, you will see a login screen. Logging into
the Administrator account will lead you to your
newly installed Ubuntu desktop as shown in Fig.2.
 Now you need to set resolution of Ubuntu
desktop by right clock on the screen and making
it equal to your parent machine dimensions.
 The go to vmware preferences in the edit menu
and mark the resolution of guest for having full
screen Ubuntu environment on your vmware.
Figure 2
Installation of prerequisites for ns3
simulator
 There are several techniques followed now a days for installation of ns3 and
indeed several versions of ns3.
 We will install ns-3-dev as we are going to run developmental tasks on it
 Follow the instruction manual given on https://www.nsnam.org/wiki/Installation
 The core of ns-3 requires a gcc/g++ installation of 3.4 or greater, and Python 2.4
or greater
Installation of prerequisites for ns3
simulator (cont.)
 All Ubuntu download and install commands are
prefixed by sudo apt-get install <package
name> followed by your Admin password
 Install the following packages one by one using
the above syntax in terminal that can be found
by searching it in the computer programs by
clicking on the Ubuntu icon in the upper left
corner of the Ubuntu desktop screen.
 gcc g++ python
 Mercurial
 Python-dev
 Qt4-dev-tools
 Bzr
 Cmake libc6-dev libc6-dev-i386 g++-multilib
 7z
 Sqlite3 sqlite
 Valgrid gdb
 Flex bison tcpdump
(other packages are listed in
(https://www.nsnam.org/wiki/Installation))
Note: Copy/Paste works in terminal. Change the
copy/paste short cuts from keyboard shortcuts
settings in the Ubuntu as you are familiar with
Ctrl+C and Ctrl+V version of these shortcuts. By
default its Ctrl+Alt+C/V
Solving prerequisite issues using bake
(Cont.)
 Bake is one of the convenient way to install all packages and also installing ns3 into the machine
 Universal technique: if you get in trouble with downloading any package that you need on Ubuntu
and you are not aware of its presence on the Ubuntu github. You should use the following
universal search technique using terminal
apt-cache search <package name>
 This will give u a list of available packages ready to download. For example you want to download
vlc player and you don’t know its store name
 Type: apt-cache search vlc, and it will give you something like shown in Fig. 3.
 All you need to do is type sudo apt-get install vlc-nox and press enter plus password
Figure 3
Using bake (cont.)
 Download mercurial using the technique given in the previous slide if u haven’t
downloaded it till now.
 Go to home directory and then to resource in the terminal view using the below
command
Cd
Cd resource Note: just type: cd res<tab_key>
 Now, type hg clone http://code.nsname.org/bake bake
 Your resources now have Bake copied
Using bake (cont.)
 As you are now in resource directory, cd bake will lead you
to bake directory.
 Here type ./bake.py check and you will see the list of
dependencies that are currently required by ns3 for its
installation as shown in Fig. 4
 An ok to a module means that module is not required. You
can download the missing module by typing its name
prefixed by apt-cache search in the terminal. Then install it
using sudo apt-get install <package_name>
 Remember that you have to append the path of this folder
if you want to check dependencies outside this folder in
the terminal using procedure given on
https://www.nsnam.org/docs/bake/tutorial/html/bake-
tutorial.html
Figure 4
Using bake (cont.)
 Add module that you want to download using bake by typing bake.py configure –
e ns-3.17 or bake.py configure ns-3-dev
 The deploy the module by typing bake.py deploy
 If commands does not work with just there names start bake.py with a dot and a
forward slash like ./bake.py deploy
 The deploy is the convenience two commands bake.py download and bake.py
build as these two are combined in one
 Hurrah! You have configured ns3 in your resource folder
Compiling first script with ns3
Configuration of ns3 with waf tool for script compilation
 Waf is by default copied into your ns-3-dev folder so you don’t need to get it
again from ns3 site.
 Waf acknowledges g++ for its use for source coding
 Type these two strings one by one in your terminal after you cd into ns-3-dev
folder CXXFLAGS=“03” ./waf configure and then CXXX=g++3.4 ./waf configure
 Type ./waf –d optimized configure; ./waf while your are in ns-3-dev folder
 You have successfully built 2200 .cc files and you can find them all in your build
folder from desktop file explorer as well.
Compiling first script with ns3 (cont.)
 The test scripts are present in ~/resource/ns-3-dev/examples/tutorial/
 Copy first.cc in to the ~/resource/ns-3-dev/scratch/ and rename it to myfirst.cc or
whatever you prefer
 Run the following command in terminal while you cd in ns-3-dev ./waf –run
scratch/myfirst (“—” is a double minus and file name is without .cc) or just ./waf --
run myfirst
 Hurrah! Your script is ready and waiting for you in build directory
Converting example script to NetAnim
ready .xml animation
 Before you run ./waf command. Open the myfirst.cc in text editor and add this line
before simulation.run();
AnimationInterface anim (“animation.xml”);
anim SetConstantPosition (nodes.Get(0), 1.0, 2.0); //or any other coordinate
anim SetConstantPosition (nodes.Get(1), 2.0, 3.0);
 This will generate a .xml file ready to be used in network animator and the file will
be in the place where you are now in the terminal
Running .xml animation via NetAnim
 Cd into ~/resource/netanim/
Type:
1- make clean
2- qmake NetAnim.pro
3- make
-4 ./NetAnim (case sensetive)
(First 3 are one time only commands)
 Open animation.xml as shown in Fig. 5 and
run it.
It is a good practice that you copy the shortcut of
animator and place it on desktop
Figure 5
Running .xml animation via NetAnim
Figure 6: Animation

More Related Content

PDF
Prometheus - basics
PDF
NPM THE GUIDE
PDF
Integración LDAP + SAMBA
PDF
HCL Notes and Nomad Troubleshooting for Dummies
PDF
Introduction to Django CMS
PDF
How OpenShift SDN helps to automate
PDF
Domino Tech School - Upgrading to Notes/Domino V10: Best Practices
PDF
Infrastructure & System Monitoring using Prometheus
Prometheus - basics
NPM THE GUIDE
Integración LDAP + SAMBA
HCL Notes and Nomad Troubleshooting for Dummies
Introduction to Django CMS
How OpenShift SDN helps to automate
Domino Tech School - Upgrading to Notes/Domino V10: Best Practices
Infrastructure & System Monitoring using Prometheus

What's hot (20)

TXT
Interview questions
PDF
How to use the new Domino Query Language
PPTX
Docker introduction for the beginners
PDF
IBM Notes Traveler Administration and Log Troubleshooting tips - Part 2
PDF
Latex workshop: Essentials and Practices
PDF
Important tips on Router and SMTP mail routing
PPTX
Helm - Package manager in K8S
PDF
Linux Practical Manual
PPTX
NGINX: Basics and Best Practices
PDF
Docker swarm introduction
PPTX
Docker.pptx
PDF
Containers: The What, Why, and How
PDF
Engage2022 - Domino Admin Tips
PDF
OpenStack DevStack Install - 2부 (Multi-nodes)
PPT
File handling in c
PPTX
5 things you didn't know nginx could do
PPT
Linux Networking Commands
PDF
Implementing High Availability Caching with Memcached
PDF
Virtualized network with openvswitch
Interview questions
How to use the new Domino Query Language
Docker introduction for the beginners
IBM Notes Traveler Administration and Log Troubleshooting tips - Part 2
Latex workshop: Essentials and Practices
Important tips on Router and SMTP mail routing
Helm - Package manager in K8S
Linux Practical Manual
NGINX: Basics and Best Practices
Docker swarm introduction
Docker.pptx
Containers: The What, Why, and How
Engage2022 - Domino Admin Tips
OpenStack DevStack Install - 2부 (Multi-nodes)
File handling in c
5 things you didn't know nginx could do
Linux Networking Commands
Implementing High Availability Caching with Memcached
Virtualized network with openvswitch
Ad

Similar to Installation of ubuntu, ns3 and compiling first (20)

PDF
1 session installation
PDF
Steps to install ns3
ODT
Ns 3 installation procedure
PDF
Installation of ns2
PDF
Linux Desktop: From OS Install through Running the Applications
PDF
SUSE Studio - LinuxTag Berlin 2010
PDF
Diagnostics of a Linux System
PDF
Ci For The Web 2.0 Guy Or Gal
PDF
Configure, Pack and Distribute: An RPM Creation Workshop
PDF
PDF
PDF
PDF
Gns3 0.5-tutorial
PDF
Gns3 0.5-tutorial
PDF
Installing Software, Part 3: Command Line
PPT
Chapter 6 - INTRODUCTION TO NETWORK OPERATING SYSTEM - 0S and NOS.ppt
ODP
introduction to linux desktop draft 5
KEY
20111126 ns2installation-111125123338-phpapp02
1 session installation
Steps to install ns3
Ns 3 installation procedure
Installation of ns2
Linux Desktop: From OS Install through Running the Applications
SUSE Studio - LinuxTag Berlin 2010
Diagnostics of a Linux System
Ci For The Web 2.0 Guy Or Gal
Configure, Pack and Distribute: An RPM Creation Workshop
Gns3 0.5-tutorial
Gns3 0.5-tutorial
Installing Software, Part 3: Command Line
Chapter 6 - INTRODUCTION TO NETWORK OPERATING SYSTEM - 0S and NOS.ppt
introduction to linux desktop draft 5
20111126 ns2installation-111125123338-phpapp02
Ad

More from Jawad Khan (20)

PPTX
2.1 input and output in c
PPTX
2.2 variable arithmetics and logics
PPTX
1.2 programming fundamentals
PPTX
1.1 programming fundamentals
PPTX
7 8. emi - analog instruments and digital instruments
PPTX
6. emi instrument transformers (with marking)
PPTX
5 emi ac bridges (with marking)
PPTX
4. emi potentiometer and ac bridges
PPTX
3 .emi wattmeter and energy meter
PPTX
2. emi analog electromechanical instruments
PPTX
1. emi concept of measurement system
PPTX
Varibale frequency response lecturer 2 - audio+
PPTX
Variable frequency response lecture 3 - audio
PPTX
Varibale frequency response lecturer 1 - audio
PPTX
Two port network - part 3
PPTX
Two port network - part 2
PPTX
Two port network - part 1
PPTX
4. ideal transformer and load conversion
PPTX
3. magnetic coupled circuits examples
PPTX
2. magnetic coupled circuits
2.1 input and output in c
2.2 variable arithmetics and logics
1.2 programming fundamentals
1.1 programming fundamentals
7 8. emi - analog instruments and digital instruments
6. emi instrument transformers (with marking)
5 emi ac bridges (with marking)
4. emi potentiometer and ac bridges
3 .emi wattmeter and energy meter
2. emi analog electromechanical instruments
1. emi concept of measurement system
Varibale frequency response lecturer 2 - audio+
Variable frequency response lecture 3 - audio
Varibale frequency response lecturer 1 - audio
Two port network - part 3
Two port network - part 2
Two port network - part 1
4. ideal transformer and load conversion
3. magnetic coupled circuits examples
2. magnetic coupled circuits

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
Teaching material agriculture food technology
Advanced methodologies resolving dimensionality complications for autism neur...
MIND Revenue Release Quarter 2 2025 Press Release
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
“AI and Expert System Decision Support & Business Intelligence Systems”
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
Understanding_Digital_Forensics_Presentation.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology

Installation of ubuntu, ns3 and compiling first

  • 1. Installation of Ubuntu, ns3 and compiling first script for Network Animator (nam) JAWAD ALI UNIVERSITY OF ENGINEERING AND TECHNOLOGY PESHAWAR
  • 2. Portion covered in the presentation  Vmware .exe and Ubuntu .iso downloading and installation  Creating new machine for running Ubuntu  Installation of Ubuntu  Setting Ubuntu dimension for efficient use  Installation of prerequisites for ns3 simulator  Installation of ns3  Compiling first script using ns3 (wap)  Installation of network animator (NetAnim)  Converting example script to NetAnim ready .xml animation  Running .xml animation via NetAnim
  • 3. Vmware installation  Download fresh .exe copy of vmware workstation (likely to be VMWare WS 11) from https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vm ware_workstation/11_0  Install it on your machine in the regular manner  Now, download Ubuntu 14.04 LTE or newer version from Ubuntu official site for Free from http://www.ubuntu.com/download/desktop
  • 4. Creating New machine for Ubuntu and Ubuntu installation  Open vmware workstation and go to File>New  In the next window, select Ubuntu 14.04 - 32bit operating system and use the default specifications for the machine except changing the SCSI hard drive size to >15GB as shown in Fig. 1  Locate the downloaded .iso of Ubuntu 32bit and proceed with making machine.  This above step will take few seconds. You need to power up your new machine so that in installation begins Figure 1
  • 5. Setting Ubuntu dimensions for efficient use  After you are finished with the installation process, you will see a login screen. Logging into the Administrator account will lead you to your newly installed Ubuntu desktop as shown in Fig.2.  Now you need to set resolution of Ubuntu desktop by right clock on the screen and making it equal to your parent machine dimensions.  The go to vmware preferences in the edit menu and mark the resolution of guest for having full screen Ubuntu environment on your vmware. Figure 2
  • 6. Installation of prerequisites for ns3 simulator  There are several techniques followed now a days for installation of ns3 and indeed several versions of ns3.  We will install ns-3-dev as we are going to run developmental tasks on it  Follow the instruction manual given on https://www.nsnam.org/wiki/Installation  The core of ns-3 requires a gcc/g++ installation of 3.4 or greater, and Python 2.4 or greater
  • 7. Installation of prerequisites for ns3 simulator (cont.)  All Ubuntu download and install commands are prefixed by sudo apt-get install <package name> followed by your Admin password  Install the following packages one by one using the above syntax in terminal that can be found by searching it in the computer programs by clicking on the Ubuntu icon in the upper left corner of the Ubuntu desktop screen.  gcc g++ python  Mercurial  Python-dev  Qt4-dev-tools  Bzr  Cmake libc6-dev libc6-dev-i386 g++-multilib  7z  Sqlite3 sqlite  Valgrid gdb  Flex bison tcpdump (other packages are listed in (https://www.nsnam.org/wiki/Installation)) Note: Copy/Paste works in terminal. Change the copy/paste short cuts from keyboard shortcuts settings in the Ubuntu as you are familiar with Ctrl+C and Ctrl+V version of these shortcuts. By default its Ctrl+Alt+C/V
  • 8. Solving prerequisite issues using bake (Cont.)  Bake is one of the convenient way to install all packages and also installing ns3 into the machine  Universal technique: if you get in trouble with downloading any package that you need on Ubuntu and you are not aware of its presence on the Ubuntu github. You should use the following universal search technique using terminal apt-cache search <package name>  This will give u a list of available packages ready to download. For example you want to download vlc player and you don’t know its store name  Type: apt-cache search vlc, and it will give you something like shown in Fig. 3.  All you need to do is type sudo apt-get install vlc-nox and press enter plus password Figure 3
  • 9. Using bake (cont.)  Download mercurial using the technique given in the previous slide if u haven’t downloaded it till now.  Go to home directory and then to resource in the terminal view using the below command Cd Cd resource Note: just type: cd res<tab_key>  Now, type hg clone http://code.nsname.org/bake bake  Your resources now have Bake copied
  • 10. Using bake (cont.)  As you are now in resource directory, cd bake will lead you to bake directory.  Here type ./bake.py check and you will see the list of dependencies that are currently required by ns3 for its installation as shown in Fig. 4  An ok to a module means that module is not required. You can download the missing module by typing its name prefixed by apt-cache search in the terminal. Then install it using sudo apt-get install <package_name>  Remember that you have to append the path of this folder if you want to check dependencies outside this folder in the terminal using procedure given on https://www.nsnam.org/docs/bake/tutorial/html/bake- tutorial.html Figure 4
  • 11. Using bake (cont.)  Add module that you want to download using bake by typing bake.py configure – e ns-3.17 or bake.py configure ns-3-dev  The deploy the module by typing bake.py deploy  If commands does not work with just there names start bake.py with a dot and a forward slash like ./bake.py deploy  The deploy is the convenience two commands bake.py download and bake.py build as these two are combined in one  Hurrah! You have configured ns3 in your resource folder
  • 12. Compiling first script with ns3 Configuration of ns3 with waf tool for script compilation  Waf is by default copied into your ns-3-dev folder so you don’t need to get it again from ns3 site.  Waf acknowledges g++ for its use for source coding  Type these two strings one by one in your terminal after you cd into ns-3-dev folder CXXFLAGS=“03” ./waf configure and then CXXX=g++3.4 ./waf configure  Type ./waf –d optimized configure; ./waf while your are in ns-3-dev folder  You have successfully built 2200 .cc files and you can find them all in your build folder from desktop file explorer as well.
  • 13. Compiling first script with ns3 (cont.)  The test scripts are present in ~/resource/ns-3-dev/examples/tutorial/  Copy first.cc in to the ~/resource/ns-3-dev/scratch/ and rename it to myfirst.cc or whatever you prefer  Run the following command in terminal while you cd in ns-3-dev ./waf –run scratch/myfirst (“—” is a double minus and file name is without .cc) or just ./waf -- run myfirst  Hurrah! Your script is ready and waiting for you in build directory
  • 14. Converting example script to NetAnim ready .xml animation  Before you run ./waf command. Open the myfirst.cc in text editor and add this line before simulation.run(); AnimationInterface anim (“animation.xml”); anim SetConstantPosition (nodes.Get(0), 1.0, 2.0); //or any other coordinate anim SetConstantPosition (nodes.Get(1), 2.0, 3.0);  This will generate a .xml file ready to be used in network animator and the file will be in the place where you are now in the terminal
  • 15. Running .xml animation via NetAnim  Cd into ~/resource/netanim/ Type: 1- make clean 2- qmake NetAnim.pro 3- make -4 ./NetAnim (case sensetive) (First 3 are one time only commands)  Open animation.xml as shown in Fig. 5 and run it. It is a good practice that you copy the shortcut of animator and place it on desktop Figure 5
  • 16. Running .xml animation via NetAnim Figure 6: Animation