SlideShare a Scribd company logo
1
Introduction to
NS3
[Current release ns-3.21 ,Ongoing ns-3.22 tentative release Jan'15]
Rahul Hada
Mobile – 9001806370
Email – hada.rahul@gmail.com
Trainers
2
Workshop Outline
● Day-1
– Introduction to NS3
– Prerequisites of software/packages
– Installation of NS3
– Configure NS3 with eclipse
– NS3 Architecture
– Reading code sample topology code
● Day-2
– Mobility model
– Wifi Model
– Writing code [wireless network]
– Analysis of AODV routing protocol
– Attributes
– Tracing
– Gnuplot
3
RoadMap
● Session-1
– First Half
● Introduction
● Interface
● Installation
● Configuration
● Folder Structure
– Second Half
● Reading Code(Example-1)
● Writing Code (Example-2)
4
NS-3 Overview
● Network Simulator version 3
● Rewritten from scratch
● An open source discrete event simulator
– Event model packet transmission , receipt , timers etc.
– Future events maintained in sorted Event List
– Processing events results in zero or more new events
● Developed for research and education.
5
NS-3 Overview
● It is started in year mid 2006
– Still under heavy development
● Partially funded by US NSF “Community Resource
Initiative”(CRI) grant
● Official funded by partners:
– Univesity of Washington
● Tom Henderson , Craig Dowell
– INRIA,Sophia Antipolis
● Mathiey Lacage
– Georgia Tech University(Atlanta)
● Raj Bhattacharjea
6
NS-3 Basic
● Written in C++
– Extensive use of Templates , Smart Pointer
Callback
– C++ namespace (ns3)
● Simulation programs are C++ executables
● Python is used to bind public API's provided
● NS3 is built as a library which may be linked
to a C++ main program defines the simulation
topology and start the simulation.
7
Use of Library
NS3 Library
<linked>
Building Topology & Start Simulation
MySim.cc
Main Program
8
Key Features
● Trace output in ascii , or pcap format
– Using existing pcap tools (Wireshark)
● Numerous trace points enabled via callbacks
● Doxygen Documentation
● Quarterly Releases
● Attention to realism
● Emulation mode
– Integration with real network/packets
– Real-time scheduling
9
Installation of NS3
● Best Platform is Linux
– Step-1 Download
– Step-2 Build Projects
– Step-3 Testing
– Step-4 Run Example
Easy to Install!!!!
10
Prerequisite package for Ubuntu
● Mininal requirements:
– gcc,g++,python,python-dev
● Debugging and GNU Scientific Library (GSL) support:
– gdb valgrind,gsl-bin,libgsl0-dev,libgsl0ldbl
● Network Simulation Cradle (nsc):
– flex,bison
● Reading pcap packet traces:
– tcpdump,wireshark
● Database support for statistics framework:
– sqlite,sqlite3,libsqlite3-dev
● Xml-based version of the config store:
– libxml2,libxml2-dev
● A GTK-based configuration system:
– libgtk2.0-0, libgtk2.0-dev
11
Prerequisite
sudo apt-get install gcc g++ python python-dev
gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex
bison tcpdump sqlite sqlite3 libsqlite3-dev
libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev
vtun lxc doxygen graphviz imagemagick texlive 
texlive-latex-extra texlive-generic-extra 
texlive-generic-recommended texinfo dia 
texlive-extra-utils texi2html python-pygraphviz 
python-kiwi python-pygoocanvas libgoocanvas-dev 
mercurial bzr libboost-all-dev
12
NS3
Development Environment
● IDE
– Eclipse CDT
● To READ and MODIFY code easily
● Doxygen
– Documentation System for C,C++ etc.
● To UNDERSTAND the NS3 platform
13
Download
● Using a Tarball
– Download from following link
● http://www.nsnam.org/ns-3-21/
14
Building
● Building with build.py
– build.py program is used
– Command [goto directory ns-allinone/]
● ./build.py --enable-examples --enable-tests
– By default test and examples are not set to build
● Building with waf
– ./waf program is used
– Configure your project to build optimized version
● ./waf clean
● ./waf -d optimized –enable-example –enable-tests configure
● ./waf clean
● ./waf -d debug –enable-example –enable-tests configure
15
Open Ternimal
16
Goto ns3-allinone folder
17
18
Testing NS3
● By running
– ./test.py -c core
● Output
– 92 of 92 tests passed(92 passed , 0
failed , 0 crahed, 0 valgrind errors)
19
Running a Script
● Running Hello World Program
– ./waf –run hello-simulator
● Running Example
– Copy script's in example to scratch folder and it
will automatically be build it we run Waf.
● cp examples/tutorial/first.cc scratch/
– Now Run your first script
● ./waf –run scratch/first
– Check Output
20
Run Hello Simulator
Run first example
21
Output of first example program
22
Configure NS3 with Eclipse
● Download Linux version of Eclipse IDE for C/C++
Developer
– Step-1 Install Eclipse and Configure Mercurial
– Step-2 Configure Waf Builder
– Step-3 Configure Debugger
– Step-4 Create new source code and , run it
● Use Eclipse for creating new source code, but run ns-3
for running it
23
Install Eclipse
Using synaptic
Search eclipse
24
Configure Eclipse
● Open Eclipse
– Goto Help -> Install new Software
– http://cbes.javaforge.com/update
– Click add
– and , select mercurialeclipse
– Click Next ->Click Finish
● Create new C++ Project and with your preferred name
● Choose ns3 path
– /home/tiger/ns-allinone-3.xx/ns-3.xx
● Right click on the project and go to Team-Share
Project.Then click on Next and select local Mercurial.
25
Install Plug-in
[Mercurial]
26
Create C++ Project
27
NS3 Path
28
NS3 Source
29
Configure Waf Builder
● Right click on project and click on Properties.Then
click on C/C++ build.After that unchecked the boxes :
– Use default build command
– Generate make file automatically
● Insert this path as build command
– /home/xxxx/ns-allinone-3.xx/ns.xx/waf
● Insert this path as build directory
– /home/xxxx/ns-allinone-3.xx/ns.xx/build
● Click in Behavior tab and remove the all option in front
of the Build (Incremental build) checkbox and then
write build
30
31
Configure Debugger
● Go to Run-> Debug Configuration and create a New
configuration
● Click on Browse button under the project section and
select your project
● Click on the Search Project button under the C/C++
Application section and type scratch-simulator
● Go to Environment Tab and click on New button to
create a new variable.You will need these
– LD_LIBRARY_PATH
– /home/xxxx/ns-allinone3.xx/ns-3.xx/build
● Be sure the “Append Environment to native environment”
is selected
32
Configure Debugger
33
Install NetAnim
● Latest version: NetAnim 3.105
● Prerequisites
– Mercurial
● sudo apt-get install mercurial
– QT4 development packages
● sudo apt-get install qt4-dev-tools
● Download NetAnim
– http://code.nsnam.org/netanim
● Building and Starting NetAnim
– cd netanim
– make clean
– qmake NetAnim.pro
– make
34
Video Lectures
● Objective – Contribution of CODE and VIDEO in NS3
● Link
– https://newdemy.com/course/ns3-tutorials/
● Spreading Knowledge
● Free! Online Course on NS3
● Instructors
– Rahul Hada
– Hitesh Choudhary
35
36
● Write a command to build ns3 ?
● How many source file are in ns3?
● How to run example/second.cc topology
script ?
● Why we are using Eclipse and Doxygen ?
37
To be continued...

More Related Content

PDF
Building Complex Topology using NS3
PDF
Tutorial ns 3-tutorial-slides
PPTX
Ground to ns3 - Basic wireless topology implementation
PDF
NS3 Overview
PDF
ns-3 Tutorial
PDF
Building Topology in NS3
PDF
Ns3 implementation wifi
PDF
[OpenInfra Days Korea 2018] (Track 4) - FreeIPA와 함께 SSO 구성
Building Complex Topology using NS3
Tutorial ns 3-tutorial-slides
Ground to ns3 - Basic wireless topology implementation
NS3 Overview
ns-3 Tutorial
Building Topology in NS3
Ns3 implementation wifi
[OpenInfra Days Korea 2018] (Track 4) - FreeIPA와 함께 SSO 구성

What's hot (20)

PDF
Nova: Openstack Compute-as-a-service
PDF
CNIT 40: 2: DNS Protocol and Architecture
PPTX
WEB SERVICE SOAP, JAVA, XML, JAXWS
PDF
Openstack nova
PDF
Open vSwitch 패킷 처리 구조
PDF
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
PDF
Être productif avec JHipster - Devoxx France 2017
PPTX
OVN DBs HA with scale test
PDF
Inside neutron 2
PDF
Docker Swarm 0.2.0
PPTX
Successfully Implement Your API Strategy with NGINX
PDF
MAAS High Availability Overview
PPTX
Les Streams de Java 8
PPT
Manipulation des Données , cours sql oracle
PDF
OpenStack Networking
PDF
Introduction to hazelcast
PPTX
Introduction à Angular
PDF
Docker 101
DOCX
Test Lab Guide: Windows Server 2012 R2 Base Configuration
PDF
OpenStack Deployment in the Enterprise
Nova: Openstack Compute-as-a-service
CNIT 40: 2: DNS Protocol and Architecture
WEB SERVICE SOAP, JAVA, XML, JAXWS
Openstack nova
Open vSwitch 패킷 처리 구조
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Être productif avec JHipster - Devoxx France 2017
OVN DBs HA with scale test
Inside neutron 2
Docker Swarm 0.2.0
Successfully Implement Your API Strategy with NGINX
MAAS High Availability Overview
Les Streams de Java 8
Manipulation des Données , cours sql oracle
OpenStack Networking
Introduction to hazelcast
Introduction à Angular
Docker 101
Test Lab Guide: Windows Server 2012 R2 Base Configuration
OpenStack Deployment in the Enterprise
Ad

Viewers also liked (20)

PDF
Socio-technical System
PDF
Inheritance
PDF
Fundamental of Shell Programming
PDF
Software Engineering Introduction
PDF
Introduction of Cloud Computing
PDF
Socket Programming using Java
ODP
Introduction to Virtualization
PDF
Network Simulation NS3
PDF
ns-3: History and Future
PDF
Support formobility
PPT
PPT
PDF
Mobile transportlayer
PPT
Quality planning
PDF
WLAN - IEEE 802.11
PDF
Mobile Network Layer
PDF
NS3 Tech Talk
PDF
Xamarin.Mac Seminar
PPTX
Network simulation software
PDF
Introduction to Qualnet
Socio-technical System
Inheritance
Fundamental of Shell Programming
Software Engineering Introduction
Introduction of Cloud Computing
Socket Programming using Java
Introduction to Virtualization
Network Simulation NS3
ns-3: History and Future
Support formobility
Mobile transportlayer
Quality planning
WLAN - IEEE 802.11
Mobile Network Layer
NS3 Tech Talk
Xamarin.Mac Seminar
Network simulation software
Introduction to Qualnet
Ad

Similar to 1 session installation (20)

ODP
NovaProva, a new generation unit test framework for C programs
PDF
Chromium: NaCl and Pepper API
PDF
From Zero to Hero - All you need to do serious deep learning stuff in R
PDF
ContainerDayVietnam2016: Django Development with Docker
PDF
Modules and artifacts in NPM by Anton Cherednikov
PDF
Automating Mendix application deployments with Nix
PDF
NanoQplus Installation Guide - for Windows
PDF
Ansiblefest 2018 Network automation journey at roblox
PDF
Navigating container technology for enhanced security by Niklas Saari
PDF
Docker and-containers-for-development-and-deployment-scale12x
PDF
Introduction to Docker at the Azure Meet-up in New York
ODP
Speeding up ps and top
ODP
Speeding up ps and top
PDF
OpenNebula 5.4 Hands-on Tutorial
PDF
Terraforming your Infrastructure on GCP
PDF
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
PDF
Automating complex infrastructures with Puppet
PDF
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
PDF
VASCAN - Docker and Security
PDF
Automating Complex Setups with Puppet
NovaProva, a new generation unit test framework for C programs
Chromium: NaCl and Pepper API
From Zero to Hero - All you need to do serious deep learning stuff in R
ContainerDayVietnam2016: Django Development with Docker
Modules and artifacts in NPM by Anton Cherednikov
Automating Mendix application deployments with Nix
NanoQplus Installation Guide - for Windows
Ansiblefest 2018 Network automation journey at roblox
Navigating container technology for enhanced security by Niklas Saari
Docker and-containers-for-development-and-deployment-scale12x
Introduction to Docker at the Azure Meet-up in New York
Speeding up ps and top
Speeding up ps and top
OpenNebula 5.4 Hands-on Tutorial
Terraforming your Infrastructure on GCP
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
Automating complex infrastructures with Puppet
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
VASCAN - Docker and Security
Automating Complex Setups with Puppet

Recently uploaded (20)

PPTX
additive manufacturing of ss316l using mig welding
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Well-logging-methods_new................
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
additive manufacturing of ss316l using mig welding
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
bas. eng. economics group 4 presentation 1.pptx
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Well-logging-methods_new................
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
OOP with Java - Java Introduction (Basics)
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Structs to JSON How Go Powers REST APIs.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx

1 session installation

  • 1. 1 Introduction to NS3 [Current release ns-3.21 ,Ongoing ns-3.22 tentative release Jan'15] Rahul Hada Mobile – 9001806370 Email – hada.rahul@gmail.com Trainers
  • 2. 2 Workshop Outline ● Day-1 – Introduction to NS3 – Prerequisites of software/packages – Installation of NS3 – Configure NS3 with eclipse – NS3 Architecture – Reading code sample topology code ● Day-2 – Mobility model – Wifi Model – Writing code [wireless network] – Analysis of AODV routing protocol – Attributes – Tracing – Gnuplot
  • 3. 3 RoadMap ● Session-1 – First Half ● Introduction ● Interface ● Installation ● Configuration ● Folder Structure – Second Half ● Reading Code(Example-1) ● Writing Code (Example-2)
  • 4. 4 NS-3 Overview ● Network Simulator version 3 ● Rewritten from scratch ● An open source discrete event simulator – Event model packet transmission , receipt , timers etc. – Future events maintained in sorted Event List – Processing events results in zero or more new events ● Developed for research and education.
  • 5. 5 NS-3 Overview ● It is started in year mid 2006 – Still under heavy development ● Partially funded by US NSF “Community Resource Initiative”(CRI) grant ● Official funded by partners: – Univesity of Washington ● Tom Henderson , Craig Dowell – INRIA,Sophia Antipolis ● Mathiey Lacage – Georgia Tech University(Atlanta) ● Raj Bhattacharjea
  • 6. 6 NS-3 Basic ● Written in C++ – Extensive use of Templates , Smart Pointer Callback – C++ namespace (ns3) ● Simulation programs are C++ executables ● Python is used to bind public API's provided ● NS3 is built as a library which may be linked to a C++ main program defines the simulation topology and start the simulation.
  • 7. 7 Use of Library NS3 Library <linked> Building Topology & Start Simulation MySim.cc Main Program
  • 8. 8 Key Features ● Trace output in ascii , or pcap format – Using existing pcap tools (Wireshark) ● Numerous trace points enabled via callbacks ● Doxygen Documentation ● Quarterly Releases ● Attention to realism ● Emulation mode – Integration with real network/packets – Real-time scheduling
  • 9. 9 Installation of NS3 ● Best Platform is Linux – Step-1 Download – Step-2 Build Projects – Step-3 Testing – Step-4 Run Example Easy to Install!!!!
  • 10. 10 Prerequisite package for Ubuntu ● Mininal requirements: – gcc,g++,python,python-dev ● Debugging and GNU Scientific Library (GSL) support: – gdb valgrind,gsl-bin,libgsl0-dev,libgsl0ldbl ● Network Simulation Cradle (nsc): – flex,bison ● Reading pcap packet traces: – tcpdump,wireshark ● Database support for statistics framework: – sqlite,sqlite3,libsqlite3-dev ● Xml-based version of the config store: – libxml2,libxml2-dev ● A GTK-based configuration system: – libgtk2.0-0, libgtk2.0-dev
  • 11. 11 Prerequisite sudo apt-get install gcc g++ python python-dev gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc doxygen graphviz imagemagick texlive texlive-latex-extra texlive-generic-extra texlive-generic-recommended texinfo dia texlive-extra-utils texi2html python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev mercurial bzr libboost-all-dev
  • 12. 12 NS3 Development Environment ● IDE – Eclipse CDT ● To READ and MODIFY code easily ● Doxygen – Documentation System for C,C++ etc. ● To UNDERSTAND the NS3 platform
  • 13. 13 Download ● Using a Tarball – Download from following link ● http://www.nsnam.org/ns-3-21/
  • 14. 14 Building ● Building with build.py – build.py program is used – Command [goto directory ns-allinone/] ● ./build.py --enable-examples --enable-tests – By default test and examples are not set to build ● Building with waf – ./waf program is used – Configure your project to build optimized version ● ./waf clean ● ./waf -d optimized –enable-example –enable-tests configure ● ./waf clean ● ./waf -d debug –enable-example –enable-tests configure
  • 17. 17
  • 18. 18 Testing NS3 ● By running – ./test.py -c core ● Output – 92 of 92 tests passed(92 passed , 0 failed , 0 crahed, 0 valgrind errors)
  • 19. 19 Running a Script ● Running Hello World Program – ./waf –run hello-simulator ● Running Example – Copy script's in example to scratch folder and it will automatically be build it we run Waf. ● cp examples/tutorial/first.cc scratch/ – Now Run your first script ● ./waf –run scratch/first – Check Output
  • 20. 20 Run Hello Simulator Run first example
  • 21. 21 Output of first example program
  • 22. 22 Configure NS3 with Eclipse ● Download Linux version of Eclipse IDE for C/C++ Developer – Step-1 Install Eclipse and Configure Mercurial – Step-2 Configure Waf Builder – Step-3 Configure Debugger – Step-4 Create new source code and , run it ● Use Eclipse for creating new source code, but run ns-3 for running it
  • 24. 24 Configure Eclipse ● Open Eclipse – Goto Help -> Install new Software – http://cbes.javaforge.com/update – Click add – and , select mercurialeclipse – Click Next ->Click Finish ● Create new C++ Project and with your preferred name ● Choose ns3 path – /home/tiger/ns-allinone-3.xx/ns-3.xx ● Right click on the project and go to Team-Share Project.Then click on Next and select local Mercurial.
  • 29. 29 Configure Waf Builder ● Right click on project and click on Properties.Then click on C/C++ build.After that unchecked the boxes : – Use default build command – Generate make file automatically ● Insert this path as build command – /home/xxxx/ns-allinone-3.xx/ns.xx/waf ● Insert this path as build directory – /home/xxxx/ns-allinone-3.xx/ns.xx/build ● Click in Behavior tab and remove the all option in front of the Build (Incremental build) checkbox and then write build
  • 30. 30
  • 31. 31 Configure Debugger ● Go to Run-> Debug Configuration and create a New configuration ● Click on Browse button under the project section and select your project ● Click on the Search Project button under the C/C++ Application section and type scratch-simulator ● Go to Environment Tab and click on New button to create a new variable.You will need these – LD_LIBRARY_PATH – /home/xxxx/ns-allinone3.xx/ns-3.xx/build ● Be sure the “Append Environment to native environment” is selected
  • 33. 33 Install NetAnim ● Latest version: NetAnim 3.105 ● Prerequisites – Mercurial ● sudo apt-get install mercurial – QT4 development packages ● sudo apt-get install qt4-dev-tools ● Download NetAnim – http://code.nsnam.org/netanim ● Building and Starting NetAnim – cd netanim – make clean – qmake NetAnim.pro – make
  • 34. 34 Video Lectures ● Objective – Contribution of CODE and VIDEO in NS3 ● Link – https://newdemy.com/course/ns3-tutorials/ ● Spreading Knowledge ● Free! Online Course on NS3 ● Instructors – Rahul Hada – Hitesh Choudhary
  • 35. 35
  • 36. 36 ● Write a command to build ns3 ? ● How many source file are in ns3? ● How to run example/second.cc topology script ? ● Why we are using Eclipse and Doxygen ?