SlideShare a Scribd company logo
1 of 24
Introduction to NS2
T S Pradeep Kumar
VIT University- Chennai campus
http://www.pradeepkumar.org
tspembedded@gmail.com
Overview
•Linux Vs Windows
•Network Simulation
•Introduction to NS2
•About NS2
•NS2 Architecture
•OTCL
Versus

Linux for
NS2

Windows for
NS2
Why not Windows?

• Verss

•Support has been stopped
beyond NS-2.27
•Package Configuration is tedious
•Use NS2 at your own risk


Linux for NS2
 Fedora (10, 12)



If DVD Version- no need of additional package installation
Install all the packages (if default installation selected, then additional packages have to be
installed)

 Ubuntu (9.04, 9.10, 10.04, 10.10)


Additional packages to be installed, there may be GCC Issues, xgraph and NAM issues

 Red Hat Enterprise Linux 5 (RHEL5)






Cent OS is the alternative for RHEL

Basic commands (ls, chmod, tar, rpm, make, gedit, vi, pwd, passwd, echo, cd, etc)
Directory structure and shell prompt
Path variables setting, Installation of packages and dependencies
Basic Linux Commands
•
•
•
•
•
•
•
•
•
•
•

ls – to list the directory contents
chmod – changing the mode of the file
tar – tape archive (to compress or decompress)
rpm – a type of installation file for linux
make – to compile or recompile in linux
gedit or vi – editors (similar like notepad)
pwd - present working directory
passwd – to change the user passwd
echo – to echo to the screen
cd – change directory
mkdir – to create a directory
Linux basics
• To run the install file within the directory
scope
• $prompt] ./install

• To run the install file in global scope is
– $prompt] install

TS PRADEEP KUMAR
Network Simulation
• Approaches

– Experiment

• Put all network Devices and measure the results/performance
• Pros - realistic
• Cons - Expensive/Sometime impossible

– Mathematical model

• Model devices using a graph model
• Insight
• Need to make assumptions

– Simulation

• Use programming to represent devices
• Easy and can be easily verified
• Not much insight, need to make assumptions
TS PRADEEP KUMAR
Network Simulation
• Network Simulation
– Time Driven
• Events occurs within the interval is assumed to be
occur at the end of the interval
• Simulation finishes at a pre-specified time
• a, b,c,d are events
• a is assumed to occur at t=2Δ

TS PRADEEP KUMAR
Network Simulation
• Network Simulation
– Event Driven

• Every event provide a reference to the next event (Example: using
pointer)

A

B
• Simulation finishes

– When there are no more events
– At pre-specified time
TS PRADEEP KUMAR

C
About NS2
• NS is a discrete event simulator
• It provides support for
– Simulation of TCP
– Routing
– Multicast Protocols over Wired and Wireless
networks

TS PRADEEP KUMAR
About NS2
• NS is not a polished and finished product, but
the result of an on-going effort of research
and development.
• In particular, bugs in the software are still
being discovered and corrected.
• Users of ns are responsible for verifying for
themselves that their simulations are not
invalidated by bugs
TS PRADEEP KUMAR
TS PRADEEP KUMAR
NS2 Architecture
• Network Simulator 2 is an event driven
Simulator
• It consists of
– C++ (Internally)
– OTCL (User Interface)
– TclCL (Interface between C++ and OTCL)

TS PRADEEP KUMAR
NS2 Architecture

TS PRADEEP KUMAR
NS2 Architecture

TS PRADEEP KUMAR
OTCL
• NS is a OTCL interpreter with network
simulation object libraries
• Relation between TCL and OTCL is similar to C
and C++
• A Simple example follows..
• To run these examples
– ns filename.tcl (or) tclsh filename.tcl
TCL Example
# Writing a procedure called "test“
proc test {} {

set a 43
set b 27
set c [expr $a + $b]
set d [expr [expr $a - $b] * $c]
for {set k 0} {$k < 10} {incr k} {
if {$k < 5} {
puts "k < 5, pow = [expr pow($d, $k)]"
} else {
puts "k >= 5, mod = [expr $d % $k]"
}}}

# Calling the "test" procedure created above
test
OTCL Example
# Create a class call "mom" and add a member
function call "greet"
Class mom
mom instproc greet {} {
$self instvar age_
puts "$age_ years old mom say:
How are you doing?"
}
OTCL Example
# Create a child class of "mom" called "kid" and overide
the member function "greet"
Class kid -superclass mom
kid instproc greet {} {
$self instvar age_
puts "$age_ years old kid say:
What's up, dude?"
}
OTCL Example
•
•
•
•
•

# Create a mom and a kid object set each age
set a [new mom]
$a set age_ 45
set b [new kid]
$b set age_ 15

• # Calling member function "greet" of each object
• $a greet
• $b greet
OTCL Example
• class keyword is used to create a class
• instproc is used to create a instance procedure
(define a member function)
• $self is similar to “this” in C++
• instvar checks if the variable is already declared in its
class or superclass. If the variable name given is
already declared, the variable is referenced, if not a
new one is declared
Lets practice Linux for
sometime…..

TS PRADEEP KUMAR

More Related Content

What's hot (20)

Working with NS2
Working with NS2Working with NS2
Working with NS2
 
Ns2
Ns2Ns2
Ns2
 
Ns 2 Network Simulator An Introduction
Ns 2 Network Simulator An IntroductionNs 2 Network Simulator An Introduction
Ns 2 Network Simulator An Introduction
 
Ns2
Ns2Ns2
Ns2
 
Ns2
Ns2Ns2
Ns2
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
Ns2
Ns2Ns2
Ns2
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Venkat ns2
Venkat ns2Venkat ns2
Venkat ns2
 
Network Simulation
Network SimulationNetwork Simulation
Network Simulation
 
Simulation and Performance Analysis of AODV using NS-2.34
Simulation and Performance Analysis of AODV using NS-2.34Simulation and Performance Analysis of AODV using NS-2.34
Simulation and Performance Analysis of AODV using NS-2.34
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2
 
Ns2
Ns2Ns2
Ns2
 
Ns2pre
Ns2preNs2pre
Ns2pre
 
Profiling Ruby
Profiling RubyProfiling Ruby
Profiling Ruby
 
Ns fundamentals 1
Ns fundamentals 1Ns fundamentals 1
Ns fundamentals 1
 
#2 (UDP)
#2 (UDP)#2 (UDP)
#2 (UDP)
 
Extending ns
Extending nsExtending ns
Extending ns
 

Viewers also liked

Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMPrakhar Bansal
 
Wireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsWireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsCSCJournals
 
Use of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsUse of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsGiancarlo Romeo
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesTeerawat Issariyakul
 

Viewers also liked (13)

TinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIMTinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIM
 
Intoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIMIntoduction to TinyOS, nesC and TOSSIM
Intoduction to TinyOS, nesC and TOSSIM
 
Wireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and ComparisonsWireless Sensor Network Simulators: A Survey and Comparisons
Wireless Sensor Network Simulators: A Survey and Comparisons
 
Introduction to Qualnet
Introduction to QualnetIntroduction to Qualnet
Introduction to Qualnet
 
Begineers for Qualnet
Begineers for QualnetBegineers for Qualnet
Begineers for Qualnet
 
Introduction to Qualnet
Introduction to Qualnet Introduction to Qualnet
Introduction to Qualnet
 
NS2: Events and Handlers
NS2: Events and HandlersNS2: Events and Handlers
NS2: Events and Handlers
 
Use of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing AlgorithmsUse of NS-2 to Simulate MANET Routing Algorithms
Use of NS-2 to Simulate MANET Routing Algorithms
 
NS2--Event Scheduler
NS2--Event SchedulerNS2--Event Scheduler
NS2--Event Scheduler
 
NS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variablesNS2: Binding C++ and OTcl variables
NS2: Binding C++ and OTcl variables
 
Basic Packet Forwarding in NS2
Basic Packet Forwarding in NS2Basic Packet Forwarding in NS2
Basic Packet Forwarding in NS2
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
Manet ns2
Manet ns2Manet ns2
Manet ns2
 

Similar to Session 1 introduction to ns2

Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudRevolution Analytics
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveAlison Chaiken
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudBrendan Gregg
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksTim Callaghan
 
Introduction to Chainer
Introduction to ChainerIntroduction to Chainer
Introduction to ChainerShunta Saito
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin敬倫 林
 
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...Unai Lopez-Novoa
 
My network functions are virtualized, but are they cloud-ready
My network functions are virtualized, but are they cloud-readyMy network functions are virtualized, but are they cloud-ready
My network functions are virtualized, but are they cloud-readyOPNFV
 
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsTraining Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsContinuent
 
NCS: NEtwork Control System Hands-on Labs
NCS:  NEtwork Control System Hands-on Labs NCS:  NEtwork Control System Hands-on Labs
NCS: NEtwork Control System Hands-on Labs Cisco Canada
 
Automating Yourself Out of Trouble
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of TroubleJose De La Rosa
 
Addressing DHCP and DNS scalability issues in OpenStack Neutron
Addressing DHCP and DNS scalability issues in OpenStack NeutronAddressing DHCP and DNS scalability issues in OpenStack Neutron
Addressing DHCP and DNS scalability issues in OpenStack NeutronVikram G Hosakote
 
Moving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventuresMoving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventuresFrits Van Der Holst
 
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...DataStax Academy
 
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analyticsLeveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analyticsJulien Anguenot
 
1 session installation
1 session installation1 session installation
1 session installationRahul Hada
 
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J..."Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...Dataconomy Media
 

Similar to Session 1 introduction to ns2 (20)

Speed up R with parallel programming in the Cloud
Speed up R with parallel programming in the CloudSpeed up R with parallel programming in the Cloud
Speed up R with parallel programming in the Cloud
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloud
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just Works
 
Introduction to Chainer
Introduction to ChainerIntroduction to Chainer
Introduction to Chainer
 
Introduction to Chainer
Introduction to ChainerIntroduction to Chainer
Introduction to Chainer
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...
Contributions to the Efficient Use of General Purpose Coprocessors: KDE as Ca...
 
My network functions are virtualized, but are they cloud-ready
My network functions are virtualized, but are they cloud-readyMy network functions are virtualized, but are they cloud-ready
My network functions are virtualized, but are they cloud-ready
 
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering DeploymentsTraining Slides: Basics 104: Simple Tungsten Clustering Deployments
Training Slides: Basics 104: Simple Tungsten Clustering Deployments
 
NCS: NEtwork Control System Hands-on Labs
NCS:  NEtwork Control System Hands-on Labs NCS:  NEtwork Control System Hands-on Labs
NCS: NEtwork Control System Hands-on Labs
 
Automating Yourself Out of Trouble
Automating Yourself Out of TroubleAutomating Yourself Out of Trouble
Automating Yourself Out of Trouble
 
Sge
SgeSge
Sge
 
Addressing DHCP and DNS scalability issues in OpenStack Neutron
Addressing DHCP and DNS scalability issues in OpenStack NeutronAddressing DHCP and DNS scalability issues in OpenStack Neutron
Addressing DHCP and DNS scalability issues in OpenStack Neutron
 
Moving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventuresMoving from Jenkins 1 to 2 declarative pipeline adventures
Moving from Jenkins 1 to 2 declarative pipeline adventures
 
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
 
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analyticsLeveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
 
1 session installation
1 session installation1 session installation
1 session installation
 
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J..."Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
"Einstürzenden Neudaten: Building an Analytics Engine from Scratch", Tobias J...
 
Concurrency
ConcurrencyConcurrency
Concurrency
 

Recently uploaded

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Session 1 introduction to ns2

  • 1. Introduction to NS2 T S Pradeep Kumar VIT University- Chennai campus http://www.pradeepkumar.org tspembedded@gmail.com
  • 2. Overview •Linux Vs Windows •Network Simulation •Introduction to NS2 •About NS2 •NS2 Architecture •OTCL
  • 4. Why not Windows? • Verss •Support has been stopped beyond NS-2.27 •Package Configuration is tedious •Use NS2 at your own risk
  • 5.  Linux for NS2  Fedora (10, 12)   If DVD Version- no need of additional package installation Install all the packages (if default installation selected, then additional packages have to be installed)  Ubuntu (9.04, 9.10, 10.04, 10.10)  Additional packages to be installed, there may be GCC Issues, xgraph and NAM issues  Red Hat Enterprise Linux 5 (RHEL5)     Cent OS is the alternative for RHEL Basic commands (ls, chmod, tar, rpm, make, gedit, vi, pwd, passwd, echo, cd, etc) Directory structure and shell prompt Path variables setting, Installation of packages and dependencies
  • 6. Basic Linux Commands • • • • • • • • • • • ls – to list the directory contents chmod – changing the mode of the file tar – tape archive (to compress or decompress) rpm – a type of installation file for linux make – to compile or recompile in linux gedit or vi – editors (similar like notepad) pwd - present working directory passwd – to change the user passwd echo – to echo to the screen cd – change directory mkdir – to create a directory
  • 7. Linux basics • To run the install file within the directory scope • $prompt] ./install • To run the install file in global scope is – $prompt] install TS PRADEEP KUMAR
  • 8. Network Simulation • Approaches – Experiment • Put all network Devices and measure the results/performance • Pros - realistic • Cons - Expensive/Sometime impossible – Mathematical model • Model devices using a graph model • Insight • Need to make assumptions – Simulation • Use programming to represent devices • Easy and can be easily verified • Not much insight, need to make assumptions TS PRADEEP KUMAR
  • 9. Network Simulation • Network Simulation – Time Driven • Events occurs within the interval is assumed to be occur at the end of the interval • Simulation finishes at a pre-specified time • a, b,c,d are events • a is assumed to occur at t=2Δ TS PRADEEP KUMAR
  • 10. Network Simulation • Network Simulation – Event Driven • Every event provide a reference to the next event (Example: using pointer) A B • Simulation finishes – When there are no more events – At pre-specified time TS PRADEEP KUMAR C
  • 11. About NS2 • NS is a discrete event simulator • It provides support for – Simulation of TCP – Routing – Multicast Protocols over Wired and Wireless networks TS PRADEEP KUMAR
  • 12. About NS2 • NS is not a polished and finished product, but the result of an on-going effort of research and development. • In particular, bugs in the software are still being discovered and corrected. • Users of ns are responsible for verifying for themselves that their simulations are not invalidated by bugs TS PRADEEP KUMAR
  • 14. NS2 Architecture • Network Simulator 2 is an event driven Simulator • It consists of – C++ (Internally) – OTCL (User Interface) – TclCL (Interface between C++ and OTCL) TS PRADEEP KUMAR
  • 17.
  • 18. OTCL • NS is a OTCL interpreter with network simulation object libraries • Relation between TCL and OTCL is similar to C and C++ • A Simple example follows.. • To run these examples – ns filename.tcl (or) tclsh filename.tcl
  • 19. TCL Example # Writing a procedure called "test“ proc test {} { set a 43 set b 27 set c [expr $a + $b] set d [expr [expr $a - $b] * $c] for {set k 0} {$k < 10} {incr k} { if {$k < 5} { puts "k < 5, pow = [expr pow($d, $k)]" } else { puts "k >= 5, mod = [expr $d % $k]" }}} # Calling the "test" procedure created above test
  • 20. OTCL Example # Create a class call "mom" and add a member function call "greet" Class mom mom instproc greet {} { $self instvar age_ puts "$age_ years old mom say: How are you doing?" }
  • 21. OTCL Example # Create a child class of "mom" called "kid" and overide the member function "greet" Class kid -superclass mom kid instproc greet {} { $self instvar age_ puts "$age_ years old kid say: What's up, dude?" }
  • 22. OTCL Example • • • • • # Create a mom and a kid object set each age set a [new mom] $a set age_ 45 set b [new kid] $b set age_ 15 • # Calling member function "greet" of each object • $a greet • $b greet
  • 23. OTCL Example • class keyword is used to create a class • instproc is used to create a instance procedure (define a member function) • $self is similar to “this” in C++ • instvar checks if the variable is already declared in its class or superclass. If the variable name given is already declared, the variable is referenced, if not a new one is declared
  • 24. Lets practice Linux for sometime….. TS PRADEEP KUMAR