SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
Introduction to Network Simulator (NS2)
2 
Introduction to Network Simulator (NS2)
3 
Outline 
Introduction 
NS-2 : Components 
Installation of ns2 
Implementation of Wireless Sensor Network 
Design and develop code for mobility in DTN 
Schedule 
References
4 
NS2 –Network Simulator 
ns-2 is a discrete event network simulator for wired and wireless networks alike 
It is popular for its extensibility (due to its open source model) 
Supports an array of popular network protocols 
Popularly used in the simulation of routing and multicast protocols, and is heavily used in ad-hoc research 
ns-2 is written in C++ and OTcl 
OTcl = Tcl + OO 
C++ implements the code that executed frequently 
OTcl configures the system
5 
NS-2 : Components 
NS – Simulator 
NAM – Network AniMator 
 visual demonstration of NS output 
Preprocessing 
Handwritten TCL or 
Traffic and topology generators 
Post analysis 
Trace analysis using : 
Perl/TCL/AWK/MATLAB 
ProblemsSimulate the environmentRun with ns-2Analysis the resultFinishModifyNoFinish the simulationYes
6 
Basic Requirements: NS-2 
A computer which is having access to the Internet 
Minimum 512Mb RAM 
Operating system: Linux(Ubuntu 12.04) 
ns-2.34 package(ns-allinone) 
gcc-4.4.3
Installation 
Download NS-allinone-2.34 package 
http://www.isi.edu/nsnam/ns/ 
 for easy installation, download ns-allinone 
 includes Tcl, Otcl, TclCL, ns, nam, etc. 
Works on Unix and cygwin for windows 9x/2000/xp. 
After successful downloading and unzipping install allinone package , install NS by 
install by calling ~/ns-allinone-2.34/install 
After successful installation , Validate the scripts by running ./validate in ~/ns-allinone-2.34/ns-2.34/ 
 Its now all set to work with NS 
7
8 
Steps to set up the simulation for wireless script 
Mobile node at core of mobility model 
Mobile nodes can move in a given topology, receive/transmit signals from/to wireless channels 
Scenario : Simple 2 Nodes Simulation 
Simulate a very simple 2-node wireless scenario 
The topology consists of two mobile nodes 
The mobile nodes move about within 500mX500m area 
A TCP connection is setup between the two 
Mobile nodes. 
Packets are exchanged between the nodes as they come within hearing range of one another.
9 
Setting Up Variables 
 
set val(chan) Channel/WirelessChannel ;# channel type 
set val(prop) Propagation/TwoRayGround ;# radio-propagation model 
set val(ant) Antenna/OmniAntenna ;# Antenna type 
set val(ll) LL ;# Link layer type 
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type 
set val(ifqlen) 50 ;# max packet in ifq 
set val(netif) Phy/WirelessPhy ;# network interface type 
set val(mac) Mac/802_11 ;# MAC type 
set val(rp) DSDV ;# ad-hoc routing protocol 
set val(nn) 2 ;# number of mobilenodes 
set val(x) 500 ;# X dimension of topography 
set val(y) 500 ;# Y dimension of topography
10 
Setting Up Variables 
. 
. 
. 
. 
Define NS simulator 
•set ns_ [new Simulator] Define trace file 
•set tracefd [open simple.tr w] 
•$ns_ trace-all $tracefd Create topology object 
•set topo [new Topography] Topography object with (x=500, y=500) 
•$topo load_flatgrid 500 500
11 
God (General Operations Director) Object 
. 
. 
Create God object: 
create-god $val(nn) God object stores: 
number of mobile nodes 
table of shortest number of hops required to reach from one node to another 
Stores smallest number of hops from one node to another 
Optimal case to compare routing protocol performance
12 
Simple Configuration For Wireless Nodes 
 
$ns_ node-config -adhocRouting $val(rp)  
-llType $val(ll)  
-macType $val(mac)  
-ifqType $val(ifq)  
-ifqLen $val(ifqlen)  
-antType $val(ant)  
-propType $val(prop)  
-phyType $val(netif)  
-topoInstance $topo  
-channelType $val(chan)  
-agentTrace ON  
-routerTrace ON  
-macTrace OFF  
-movementTrace OFF
13 
Configuring Movement 
 Create two nodes 
Provide initial (X,Y, for now Z=0) co-ordinates 
for {set i 0} {$i < $val(nn) } {incr i} { 
set node_($i) [$ns_ node ] 
$node_($i) random-motion 0 ;# disable random motion 
} 
$node_(0) set X_ 5.0 
$node_(0) set Y_ 2.0 
$node_(0) set Z_ 0.0 
$node_(1) set X_ 390.0 
$node_(1) set Y_ 385.0 
$node_(1) set Z_ 0.0
14 
Produce some node movements 
 
Explanation: 
#Node_(1) starts to move towards node_(0) 
$ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0" 
$ns_ at 10.0 "$node_(0) setdest 20.0 18.0 1.0” 
#Node_(1) then starts to move away from node_(0) 
$ns_ at 100.0 "$node_(1) setdest 490.0 480.0 15.0“ 
$ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0" means at time 50.0s, node1 starts to move towards the destination (x=25,y=20) at a speed of 15m/s.
15 
Setup traffic flow 
TCP connections between node_(0) and node_(1) 
set tcp [new Agent/TCP] 
set sink [new Agent/TCPSink] 
$ns_ attach-agent $node_(0) $tcp 
$ns_ attach-agent $node_(1) $sink 
$ns_ connect $tcp $sink 
set ftp [new Application/FTP] 
$ftp attach-agent $tcp 
$ns_ at 10.0 "$ftp start"
16 
Set Stop Time and Start Simulation 
Tell nodes when the simulation ends 
Finally, Start The Simulation 
for {set i 0} {$i < $val(nn) } {incr i} { 
$ns_ at 150.0 "$node_($i) reset"; 
} 
$ns_ at 150.0001 "stop" 
$ns_ at 150.0002 "puts "NS EXITING...“ ; $ns_ halt" 
proc stop {} { 
global ns_ tracefd 
close $tracefd 
} 
puts "Starting Simulation..." 
$ns_ run
17 
Running the Script 
The file “simple-wireless.tcl” is under <root>/ns- allinone2.34/ns-2.34/simple-wireless.tcl 
 cd into the directory and type “ns simple-wireless.tcl” to run the simulation 
The simulation will generate a trace file named “simple.tr”
18 
Schedule 
Phase 1 
Literature Review and Forming Objective 
Phase 2 
Implementation 
Phase 3 
Testing and Analysis 
Phase 4 
Report Writing
19 
References 
http://www.isi.edu/nsnam/ns 
Tutorials 
Marc Greis’s Tutorial (http://www.isi.edu/nsnam/ns/tutorial/index.html) 
Ns by example (http://nile.wpi.edu/NS/) 
Wireless Tutorial (http://www.isi.edu/nsnam/ns/ns- tutorial/wireless.ppt ) 
Doc: 
ns by Example 
http://nile.wpi.edu/NS/ 
NS Manual: 
 http://www.isi.edu/nsnam/ns/doc/index.html 
Workshop and presentations 
 http://www.isi.edu/nsnam/ns/ns-tutorial/index.html
20 
Q & A

Mais conteúdo relacionado

Mais procurados

Artificial intelligence Speech recognition system
Artificial intelligence Speech recognition systemArtificial intelligence Speech recognition system
Artificial intelligence Speech recognition systemREHMAT ULLAH
 
Switching hierarchy and routing
Switching hierarchy and routingSwitching hierarchy and routing
Switching hierarchy and routingSneheshDutta
 
Geo-Cast Routing Protocol
Geo-Cast Routing ProtocolGeo-Cast Routing Protocol
Geo-Cast Routing Protocolchirag bhatt
 
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts – ...
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts –  ...WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts –  ...
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts – ...ArunChokkalingam
 
Analysis of vertical and horizontal handoff
Analysis of vertical and horizontal handoff Analysis of vertical and horizontal handoff
Analysis of vertical and horizontal handoff Tauseef khan
 
WIRELESS ATM BY SAIKIRAN PANJALA
WIRELESS ATM BY SAIKIRAN PANJALAWIRELESS ATM BY SAIKIRAN PANJALA
WIRELESS ATM BY SAIKIRAN PANJALASaikiran Panjala
 
Mobility management in adhoc network
Mobility management in adhoc networkMobility management in adhoc network
Mobility management in adhoc networkAman Saurabh
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Divya Tiwari
 
ISSUES IN AD HOC WIRELESS NETWORKS
ISSUES IN  AD HOC WIRELESS  NETWORKS ISSUES IN  AD HOC WIRELESS  NETWORKS
ISSUES IN AD HOC WIRELESS NETWORKS Dushhyant Kumar
 
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA Space Division Multi Access,Frequ...
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA  Space Division Multi Access,Frequ...Mobile computing unit2,SDMA,FDMA,CDMA,TDMA  Space Division Multi Access,Frequ...
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA Space Division Multi Access,Frequ...Pallepati Vasavi
 
Heterogeneous mesh network (ad hoc)
Heterogeneous mesh network (ad hoc)Heterogeneous mesh network (ad hoc)
Heterogeneous mesh network (ad hoc)Javed Khan
 
Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks Divya Tiwari
 
Cluster based routing protocol
Cluster based routing protocolCluster based routing protocol
Cluster based routing protocolSudhansu Dash
 
Geographic Routing in WSN
Geographic Routing in WSNGeographic Routing in WSN
Geographic Routing in WSNMahbubur Rahman
 
Evolution of mobile radio communication
Evolution of mobile radio communicationEvolution of mobile radio communication
Evolution of mobile radio communicationjadhavmanoj01
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceSahil Kumar
 

Mais procurados (20)

Leach & Pegasis
Leach & PegasisLeach & Pegasis
Leach & Pegasis
 
Artificial intelligence Speech recognition system
Artificial intelligence Speech recognition systemArtificial intelligence Speech recognition system
Artificial intelligence Speech recognition system
 
Switching hierarchy and routing
Switching hierarchy and routingSwitching hierarchy and routing
Switching hierarchy and routing
 
Geo-Cast Routing Protocol
Geo-Cast Routing ProtocolGeo-Cast Routing Protocol
Geo-Cast Routing Protocol
 
Routing Protocols in WSN
Routing Protocols in WSNRouting Protocols in WSN
Routing Protocols in WSN
 
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts – ...
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts –  ...WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts –  ...
WSN NETWORK -MAC PROTOCOLS - Low Duty Cycle Protocols And Wakeup Concepts – ...
 
Analysis of vertical and horizontal handoff
Analysis of vertical and horizontal handoff Analysis of vertical and horizontal handoff
Analysis of vertical and horizontal handoff
 
WIRELESS ATM BY SAIKIRAN PANJALA
WIRELESS ATM BY SAIKIRAN PANJALAWIRELESS ATM BY SAIKIRAN PANJALA
WIRELESS ATM BY SAIKIRAN PANJALA
 
Multi-Hopping
Multi-HoppingMulti-Hopping
Multi-Hopping
 
Mobility management in adhoc network
Mobility management in adhoc networkMobility management in adhoc network
Mobility management in adhoc network
 
Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks Mac protocols for ad hoc wireless networks
Mac protocols for ad hoc wireless networks
 
ISSUES IN AD HOC WIRELESS NETWORKS
ISSUES IN  AD HOC WIRELESS  NETWORKS ISSUES IN  AD HOC WIRELESS  NETWORKS
ISSUES IN AD HOC WIRELESS NETWORKS
 
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA Space Division Multi Access,Frequ...
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA  Space Division Multi Access,Frequ...Mobile computing unit2,SDMA,FDMA,CDMA,TDMA  Space Division Multi Access,Frequ...
Mobile computing unit2,SDMA,FDMA,CDMA,TDMA Space Division Multi Access,Frequ...
 
Swarm Intelligence in Robotics
Swarm Intelligence in RoboticsSwarm Intelligence in Robotics
Swarm Intelligence in Robotics
 
Heterogeneous mesh network (ad hoc)
Heterogeneous mesh network (ad hoc)Heterogeneous mesh network (ad hoc)
Heterogeneous mesh network (ad hoc)
 
Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks Routing protocols for ad hoc wireless networks
Routing protocols for ad hoc wireless networks
 
Cluster based routing protocol
Cluster based routing protocolCluster based routing protocol
Cluster based routing protocol
 
Geographic Routing in WSN
Geographic Routing in WSNGeographic Routing in WSN
Geographic Routing in WSN
 
Evolution of mobile radio communication
Evolution of mobile radio communicationEvolution of mobile radio communication
Evolution of mobile radio communication
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 

Destaque

Eigrp Basics
Eigrp BasicsEigrp Basics
Eigrp BasicsAlp isik
 
Autonomus robotics
Autonomus roboticsAutonomus robotics
Autonomus roboticsSURYA DEEPAK
 
Fluxcharge - wireless chargers for mobile robotics
Fluxcharge - wireless chargers for mobile roboticsFluxcharge - wireless chargers for mobile robotics
Fluxcharge - wireless chargers for mobile roboticsArunabh Mishra
 
Router Virtualization With GNS3
Router Virtualization With GNS3Router Virtualization With GNS3
Router Virtualization With GNS3mrmouse
 
Adaptive Intelligent Mobile Robotics
Adaptive Intelligent Mobile RoboticsAdaptive Intelligent Mobile Robotics
Adaptive Intelligent Mobile Roboticsahmad bassiouny
 
Eigrp
EigrpEigrp
Eigrpfirey
 
1 session installation
1 session installation1 session installation
1 session installationRahul Hada
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3Rahul Hada
 
Mobile robotics printer
Mobile robotics printerMobile robotics printer
Mobile robotics printerAnshu Pandey
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)Respa Peter
 
Introductionto robotics a
Introductionto robotics aIntroductionto robotics a
Introductionto robotics aIftekhar Ali
 
Robotics & Embedded Systems
Robotics & Embedded SystemsRobotics & Embedded Systems
Robotics & Embedded Systemsanishgoel
 

Destaque (20)

Eigrp Basics
Eigrp BasicsEigrp Basics
Eigrp Basics
 
Autonomus robotics
Autonomus roboticsAutonomus robotics
Autonomus robotics
 
Mapping mobile robotics
Mapping mobile roboticsMapping mobile robotics
Mapping mobile robotics
 
Fluxcharge - wireless chargers for mobile robotics
Fluxcharge - wireless chargers for mobile roboticsFluxcharge - wireless chargers for mobile robotics
Fluxcharge - wireless chargers for mobile robotics
 
I beacons 101
I beacons 101I beacons 101
I beacons 101
 
Router Virtualization With GNS3
Router Virtualization With GNS3Router Virtualization With GNS3
Router Virtualization With GNS3
 
Adaptive Intelligent Mobile Robotics
Adaptive Intelligent Mobile RoboticsAdaptive Intelligent Mobile Robotics
Adaptive Intelligent Mobile Robotics
 
Eigrp
EigrpEigrp
Eigrp
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2
 
Gns3
Gns3Gns3
Gns3
 
1 session installation
1 session installation1 session installation
1 session installation
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3
 
Mobile robotics printer
Mobile robotics printerMobile robotics printer
Mobile robotics printer
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
 
NS3 Overview
NS3 OverviewNS3 Overview
NS3 Overview
 
Ns2
Ns2Ns2
Ns2
 
Case study 3
Case study 3Case study 3
Case study 3
 
Introductionto robotics a
Introductionto robotics aIntroductionto robotics a
Introductionto robotics a
 
Mobile Robotics Market Trends
Mobile Robotics Market TrendsMobile Robotics Market Trends
Mobile Robotics Market Trends
 
Robotics & Embedded Systems
Robotics & Embedded SystemsRobotics & Embedded Systems
Robotics & Embedded Systems
 

Semelhante a Ns2

Semelhante a Ns2 (20)

Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
Introduction to ns2
Introduction to ns2Introduction to ns2
Introduction to ns2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
Running wireless simulations in ns
Running wireless simulations in nsRunning wireless simulations in ns
Running wireless simulations in ns
 
Working with NS2
Working with NS2Working with NS2
Working with NS2
 
Error Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks reportError Control in Multimedia Communications using Wireless Sensor Networks report
Error Control in Multimedia Communications using Wireless Sensor Networks report
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.ppt
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
Ns2
Ns2Ns2
Ns2
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
NS2-tutorial.pdf
NS2-tutorial.pdfNS2-tutorial.pdf
NS2-tutorial.pdf
 
Ns2pre
Ns2preNs2pre
Ns2pre
 
study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
 
Ns2
Ns2Ns2
Ns2
 
Ns2: Introduction - Part I
Ns2: Introduction - Part INs2: Introduction - Part I
Ns2: Introduction - Part I
 
Venkat ns2
Venkat ns2Venkat ns2
Venkat ns2
 
Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorial
 
Ns 2 Network Simulator An Introduction
Ns 2 Network Simulator An IntroductionNs 2 Network Simulator An Introduction
Ns 2 Network Simulator An Introduction
 
Ns fundamentals 1
Ns fundamentals 1Ns fundamentals 1
Ns fundamentals 1
 

Último

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 

Último (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 

Ns2

  • 1. Introduction to Network Simulator (NS2)
  • 2. 2 Introduction to Network Simulator (NS2)
  • 3. 3 Outline Introduction NS-2 : Components Installation of ns2 Implementation of Wireless Sensor Network Design and develop code for mobility in DTN Schedule References
  • 4. 4 NS2 –Network Simulator ns-2 is a discrete event network simulator for wired and wireless networks alike It is popular for its extensibility (due to its open source model) Supports an array of popular network protocols Popularly used in the simulation of routing and multicast protocols, and is heavily used in ad-hoc research ns-2 is written in C++ and OTcl OTcl = Tcl + OO C++ implements the code that executed frequently OTcl configures the system
  • 5. 5 NS-2 : Components NS – Simulator NAM – Network AniMator  visual demonstration of NS output Preprocessing Handwritten TCL or Traffic and topology generators Post analysis Trace analysis using : Perl/TCL/AWK/MATLAB ProblemsSimulate the environmentRun with ns-2Analysis the resultFinishModifyNoFinish the simulationYes
  • 6. 6 Basic Requirements: NS-2 A computer which is having access to the Internet Minimum 512Mb RAM Operating system: Linux(Ubuntu 12.04) ns-2.34 package(ns-allinone) gcc-4.4.3
  • 7. Installation Download NS-allinone-2.34 package http://www.isi.edu/nsnam/ns/  for easy installation, download ns-allinone  includes Tcl, Otcl, TclCL, ns, nam, etc. Works on Unix and cygwin for windows 9x/2000/xp. After successful downloading and unzipping install allinone package , install NS by install by calling ~/ns-allinone-2.34/install After successful installation , Validate the scripts by running ./validate in ~/ns-allinone-2.34/ns-2.34/  Its now all set to work with NS 7
  • 8. 8 Steps to set up the simulation for wireless script Mobile node at core of mobility model Mobile nodes can move in a given topology, receive/transmit signals from/to wireless channels Scenario : Simple 2 Nodes Simulation Simulate a very simple 2-node wireless scenario The topology consists of two mobile nodes The mobile nodes move about within 500mX500m area A TCP connection is setup between the two Mobile nodes. Packets are exchanged between the nodes as they come within hearing range of one another.
  • 9. 9 Setting Up Variables  set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/TwoRayGround ;# radio-propagation model set val(ant) Antenna/OmniAntenna ;# Antenna type set val(ll) LL ;# Link layer type set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type set val(ifqlen) 50 ;# max packet in ifq set val(netif) Phy/WirelessPhy ;# network interface type set val(mac) Mac/802_11 ;# MAC type set val(rp) DSDV ;# ad-hoc routing protocol set val(nn) 2 ;# number of mobilenodes set val(x) 500 ;# X dimension of topography set val(y) 500 ;# Y dimension of topography
  • 10. 10 Setting Up Variables . . . . Define NS simulator •set ns_ [new Simulator] Define trace file •set tracefd [open simple.tr w] •$ns_ trace-all $tracefd Create topology object •set topo [new Topography] Topography object with (x=500, y=500) •$topo load_flatgrid 500 500
  • 11. 11 God (General Operations Director) Object . . Create God object: create-god $val(nn) God object stores: number of mobile nodes table of shortest number of hops required to reach from one node to another Stores smallest number of hops from one node to another Optimal case to compare routing protocol performance
  • 12. 12 Simple Configuration For Wireless Nodes  $ns_ node-config -adhocRouting $val(rp) -llType $val(ll) -macType $val(mac) -ifqType $val(ifq) -ifqLen $val(ifqlen) -antType $val(ant) -propType $val(prop) -phyType $val(netif) -topoInstance $topo -channelType $val(chan) -agentTrace ON -routerTrace ON -macTrace OFF -movementTrace OFF
  • 13. 13 Configuring Movement  Create two nodes Provide initial (X,Y, for now Z=0) co-ordinates for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node ] $node_($i) random-motion 0 ;# disable random motion } $node_(0) set X_ 5.0 $node_(0) set Y_ 2.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 390.0 $node_(1) set Y_ 385.0 $node_(1) set Z_ 0.0
  • 14. 14 Produce some node movements  Explanation: #Node_(1) starts to move towards node_(0) $ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0" $ns_ at 10.0 "$node_(0) setdest 20.0 18.0 1.0” #Node_(1) then starts to move away from node_(0) $ns_ at 100.0 "$node_(1) setdest 490.0 480.0 15.0“ $ns_ at 50.0 "$node_(1) setdest 25.0 20.0 15.0" means at time 50.0s, node1 starts to move towards the destination (x=25,y=20) at a speed of 15m/s.
  • 15. 15 Setup traffic flow TCP connections between node_(0) and node_(1) set tcp [new Agent/TCP] set sink [new Agent/TCPSink] $ns_ attach-agent $node_(0) $tcp $ns_ attach-agent $node_(1) $sink $ns_ connect $tcp $sink set ftp [new Application/FTP] $ftp attach-agent $tcp $ns_ at 10.0 "$ftp start"
  • 16. 16 Set Stop Time and Start Simulation Tell nodes when the simulation ends Finally, Start The Simulation for {set i 0} {$i < $val(nn) } {incr i} { $ns_ at 150.0 "$node_($i) reset"; } $ns_ at 150.0001 "stop" $ns_ at 150.0002 "puts "NS EXITING...“ ; $ns_ halt" proc stop {} { global ns_ tracefd close $tracefd } puts "Starting Simulation..." $ns_ run
  • 17. 17 Running the Script The file “simple-wireless.tcl” is under <root>/ns- allinone2.34/ns-2.34/simple-wireless.tcl  cd into the directory and type “ns simple-wireless.tcl” to run the simulation The simulation will generate a trace file named “simple.tr”
  • 18. 18 Schedule Phase 1 Literature Review and Forming Objective Phase 2 Implementation Phase 3 Testing and Analysis Phase 4 Report Writing
  • 19. 19 References http://www.isi.edu/nsnam/ns Tutorials Marc Greis’s Tutorial (http://www.isi.edu/nsnam/ns/tutorial/index.html) Ns by example (http://nile.wpi.edu/NS/) Wireless Tutorial (http://www.isi.edu/nsnam/ns/ns- tutorial/wireless.ppt ) Doc: ns by Example http://nile.wpi.edu/NS/ NS Manual:  http://www.isi.edu/nsnam/ns/doc/index.html Workshop and presentations  http://www.isi.edu/nsnam/ns/ns-tutorial/index.html
  • 20. 20 Q & A