SlideShare a Scribd company logo
1 of 47
Download to read offline
Wireless Sensor Network And Its implementation
Overview 
•Introduction 
•Components of WSN 
•Wireless Sensor Network 
•Communication in Wireless Sensor Network 
•Network Architecture 
•WSN Protocol Stack 
•WSN Operating Systems 
•WSN Simulators 
•Operational Challenges of WSN 
•Wireless Sensor Networks Features 
•Applications of WSN
Introduction 
•A wireless sensor network is a collection of nodes organized into a cooperative network. 
•Each node has capability to sense data, process the data. These sensors work with each other to sense some physical phenomenon. 
•The nodes in the network are connected via Wireless communication channels.
Components of WSN 
• sensor 
–A transducer 
–converts physical phenomenon e.g. heat, light, motion, vibration, and sound into electrical signals 
•sensor node 
–basic unit in sensor network 
– contains on-board sensors, processor, memory, transceiver, and power supply 
•sensor network 
–consists of a large number of sensor nodes 
–nodes deployed either inside or very close to the sensed phenomenon
Wireless Sensor Network 
Wireless Sensor Network
Communication in Wireless Sensor Network 
TCP or UDP via Internet 
Sensing 
UDP type protocol 
Communication in Wireless Sensor Network
Network Architecture 
Flat Network Topology Where sensor nodes also act as routers and transfer data to a sink through multi-hop routing
Network Architecture 
Hierarchical Network Topology Higher nodes can be used to process and send the information while low energy nodes can be used to perform the sensing in the proximity of the target.
Node Architecture 
•Hardware components of a sensor node include 
–Sensing unit 
–Processing unit 
–Communication unit 
–Power unit.
Node Architecture (Components of Node) 
sensor 
ADC 
Memory 
Processor 
Radio 
Battery 
Sensing Unit 
Processing Unit 
Communication Unit 
Power Unit 
Figure10:- Architecture of Sensor Node 
10
WSN Protocol Stack 
Application Layer 
Transport Layer 
Network Layer 
Data-Link Layer 
Physical Layer
WSN Operating Systems 
•TinyOS 
•Contiki 
•MANTIS 
•BTnut 
•SOS 
•Nano-RK
TinyOS 
•TinyOS system and its programs written in nesC 
•Its having a component-based architecture 
•TinyOS programs are composed into event handlers and tasks with run-to-completion semantics. 
•free and open-source operating system
WSN Simulators 
•NS-2 
•GloMoSim 
•OPNET 
•SensorSim 
•J-Sim 
•OMNeT++
Introduction to Network Simulator (NS2)
overview 
•NS2- Network Simulator 
•Basic Requirements: NS-2 
•Download and Installation of NS2 
•''Ns'' Components 
•Basics of using NS2 
•Steps to set up the simulation 
•Script to start nam 
•Simple two node wired network 
•Adding traffic to the link 
•Record Simulation Trace 
•Simulate a simple topology
NS2- Network Simulator 
•A package of tools that simulates behavior of networks 
•One of the most popular simulator among networking researchers 
– Open source, free 
•Discrete event simulator targeted at networking research and education 
–Protocol design, traffic studies, etc 
–Wired and wireless networks 
•Back end is in C++ and front end is in oTcl
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
Download and Installation of NS2 
•http://www.isi.edu/nsnam/ns/ 
– For easy installation, download ns-allinone 
– Includes Tcl, Otcl, TclCL, ns, nam, etc. 
•Select the Operating System 
–NS2 is available for both Windows and Linux 
–Linux is desirable as C++ compiler is free and easy to debug
''Ns'' Components 
•ns, the simulator itself 
•nam, the Network AniMator 
–visualize ns (or other) output 
–GUI input simple ns scenarios 
•pre-processing: 
–traffic and topology generators 
•post-processing: 
–simple trace analysis, often in Awk, Perl, or Tcl
Basics of using NS2 
•Define Network topology in .tcl script 
•To run , 
$ ns simple.tcl 
•Output is in form of trace files
22 
Hello World – Batch mode 
#simple.tcl 
set ns [new Simulator] 
$ns at 1 “puts “Hello World!”” 
$ns at 1.5 “exit” 
$ns run 
linux21% ns simple.tcl 
Hello World! 
linux21%
Steps to set up the simulation 
•Initialize the simulator 
•Define files for output (tracing) 
•Set up the topology 
•Set up the “agents” 
•Set up the traffic between the nodes 
•Start the simulation 
•Analyze the trace files to compute the parameters of interest
Script to start nam 
#Create a simulator object 
set ns [new Simulator] 
#Open the NAM trace file 
set nf [open out.nam w] 
$ns namtrace-all $nf 
#Define a 'finish' procedure 
proc finish {} { 
global ns nf 
$ns flush-trace 
#Close the NAM trace file 
close $nf 
#Execute NAM on the trace file 
exec nam out.nam & 
exit 0 
} 
#call 'finish' procedure 
$ns at 12.0 “finish"
Simple two node wired network 
#Create a simulator object 
set ns [new Simulator] 
#Open trace files 
set f [open out.tr w] 
$ns trace-all $f 
#Define a 'finish' procedure 
proc finish {} { 
global ns 
$ns flush-trace 
close $f 
exit 0 
} 
#Create two nodes 
set n0 [$ns node] 
set n1 [$ns node] 
#Create a duplex link between the nodes 
$ns duplex-link $n0 $n1 1Mb 10ms DropTail 
#Call the finish procedure after 5 seconds of simulation time 
$ns at 5.0 "finish" 
#Run the simulation 
$ns run 
But we have no traffic !
Simple two node wired network 
# Create two nodes 
set n0 [$ns node] 
set n1 [$ns node] 
# Create a duplex link between the nodes 
$ns duplex-link $n0 $n1 1Mb 10ms DropTail 
n0 
n1
Adding traffic to the link 
# Create a UDP agent and attach it to node n0 
set udp0 [new Agent/UDP] 
$ns attach-agent $n0 $udp0 
udp 
n0 
n1 
null 
cbr
Adding traffic to the link 
# Create a CBR traffic source and attach it to udp0 
set cbr0 [new Application/Traffic/CBR] 
$cbr0 set packetSize_ 500 
$cbr0 set interval_ 0.005 
$cbr0 attach-agent $udp0 
udp 
n0 
n1 
null 
cbr
Adding traffic to the link 
# Create a Null agent (a traffic sink) and attach it to node n1 
set null0 [new Agent/Null] 
$ns attach-agent $n1 $null0 
udp 
n0 
n1 
null 
cbr
Adding traffic to the link 
#Connect the traffic source with the traffic sink 
$ns connect $udp0 $null0 
#Schedule events for the CBR agent 
$ns at 0.5 "$cbr0 start" 
$ns at 4.5 "$cbr0 stop” 
$ns at 5.0 "finish“ 
$ns run 
udp 
n0 
n1 
null 
cbr
Record Simulation Trace 
+ enqueue 
- dequeue r receive d drop 
time 
Nodes involved 
in this event 
Packet 
type 
packet 
length 
packet 
flags 
flow 
ID 
source/dest addresses 
seq number 
packet 
ID
32 
Simulate a simple topology
33 
Simulate a simple topology – (Contd.) 
#Create four nodes 
set n0 [$ns node] 
set n1 [$ns node] 
set n2 [$ns node] 
set n3 [$ns node] 
#Create links between the nodes 
$ns duplex-link $n0 $n2 2Mb 10ms DropTail 
$ns duplex-link $n1 $n2 2Mb 10ms DropTail 
$ns duplex-link $n2 $n3 1.7Mb 20ms DropTail 
#Set Queue Size of link (n2-n3) to 10 
$ns queue-limit $n2 $n3 10
34 
Simulate a simple topology – (Contd.) 
#Give node position (for NAM) 
$ns duplex-link-op $n0 $n2 orient right-down 
$ns duplex-link-op $n1 $n2 orient right-up 
$ns duplex-link-op $n2 $n3 orient right 
#Monitor the queue for link (n2-n3). (for NAM) 
$ns duplex-link-op $n2 $n3 queuePos 0.5 
#Setup a TCP connection 
set tcp [new Agent/TCP] 
$tcp set class_ 2 
$ns attach-agent $n0 $tcp 
set sink [new Agent/TCPSink] 
$ns attach-agent $n3 $sink 
$ns connect $tcp $sink 
$tcp set fid_ 1
35 
Simulate a simple topology – (Contd.) 
#Setup a FTP over TCP connection 
set ftp [new Application/FTP] 
$ftp attach-agent $tcp 
$ftp set type_ FTP 
#Setup a UDP connection 
set udp [new Agent/UDP] 
$ns attach-agent $n1 $udp 
set null [new Agent/Null] 
$ns attach-agent $n3 $null 
$ns connect $udp $null 
$udp set fid_ 2
36 
Simulate a simple topology – (Contd.) 
#Setup a CBR over UDP connection 
set cbr [new Application/Traffic/CBR] 
$cbr attach-agent $udp 
$cbr set type_ CBR 
$cbr set packet_size_ 1000 
$cbr set rate_ 1mb 
$cbr set random_ false 
#Schedule events for the CBR and FTP agents 
$ns at 0.1 "$cbr start" 
$ns at 1.0 "$ftp start" 
$ns at 4.0 "$ftp stop" 
$ns at 4.5 "$cbr stop"
37 
Simulate a simple topology – (Contd.) 
#Detach tcp and sink agents (not really necessary) 
$ns at 4.5 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink" 
#Call the finish procedure after 5 seconds of simulation time 
$ns at 5.0 "finish" 
#Print CBR packet size and interval 
puts "CBR packet size = [$cbr set packet_size_]" 
puts "CBR interval = [$cbr set interval_]" 
#Run the simulation 
$ns run
Operational Challenges of WSN 
•Heterogeneity 
•Distributed Processing 
•Low Bandwidth Communication 
•Large Scale Coordination 
•Utilization of Sensors 
•Real Time Computation
Wireless Sensor Networks Features 
•Much cheaper to deploy than wired sensors 
•Sensor nodes can be added or removed easily 
•Node location can be changed without rewiring 
•Can be configured into different network topologies 
•Large Network size 
•Self-organized 
•All nodes acts as routers 
•Potential multihop routes
Applications of WSNs 
•Intelligent (smart) buildings 
•Monitoring of structures 
•Monitoring of water quality 
•Health care 
•Disaster detection 
•Environmental monitoring 
•Social studiesPrecision agriculture 
•Habitat monitoring 
•Facility management 
•Logistics 
•Tracking of containers and boxes 
•Military applications
Applications of WSN 
Military Applications 
•Monitoring friendly forces, equipment, and ammunition 
•Battlefield surveillance 
•Reconnaissance of opposing forces and terrain 
•Targeting 
•Battle damage assessment 
•Nuclear, biological, and chemical attack detection
Applications of WSNs 
Industrial Sensing 
•To monitor the “health” of machines 
•To ensure safe operation. 
•Monitoring corrosion 
•prevent the incidents of contaminating the food supply chain 
•Eg.Rohrback Cosasco Systems (RCS) (Rohrback Cosasco Systems, n.d.) is the world leader in corrosion monitoring technology
Applications of WSNs 
Health Applications 
•Tracking and monitoring doctors and patients inside a hospital 
•Special kinds of sensors which can measure blood pressure, body temperature and electrocardiograph (ECG) can even be knitted into clothes to provide remote nursing for the elderly. 
•Drug administration in hospitals
Applications of WSNs 
Environmental Applications 
•Animal tracking 
•Weather forecasting. 
•Forest fire detection 
•Bio-complexity mapping of environment 
•Flood detection 
•Air and water pollution 
•Eg.University of Southampton have built a glacial environment monitoring system using WSNs in Norway
Many WSN Applications
Conclusion 
•WSNs possible today due to technological advancement in various domains 
•Envisioned to become an essential part of our lives 
• Design Constraints need to be satisfied for realization of sensor networks 
•Tremendous research efforts being made in different layers of WSNs protocol stack 
46 
WSNs possible today due to technological advancement in various domains Envisioned to become an essential part of our lives Design Constraints need to be satisfied for realization of sensor networks .ns2 can be use as one the simulation tool to analyze network behavior. Tremendous research efforts being made in different layers of WSNs protocol stack 
Conclusion
Conclusion 
•WSNs possible today due to technological advancement in various domains 
•Envisioned to become an essential part of our lives 
• Design Constraints need to be satisfied for realization of sensor networks 
•Tremendous research efforts being made in different layers of WSNs protocol stack 
47 
•Wireless Sensor Networks - An Introduction by QinghuaWang and Ilangko Balasingham. 
•System Architecture for Wireless Sensor Networks by Jason Lester Hill, University of California, Berkeley, 2003. 
•Networking Wireless Sensors by Bhaskar Krishnamachari, 2005. 
•A Survey of Wireless Sensor Networks Technology by I. Khemapech, I. Duncan and A. 
•Fundamentals of Wireless Sensor Networks: Theory and Practice, Waltenegus Dargie 
•Wireless Sensor Networks by F. L. LEWIS ,2004 
•Wikipedia 
•The VINT project, The ns manual 
•The network simulator - ns-2,( http://www.isi.edu/nsnam/ns/ ) 
•ns-2 Tutorial:( http://www.isi.edu/nsnam/ns/tutorial/nsindex.html ) 
•Marc Greis’s Tutorial (http://www.isi.edu/nsnam/ns/tutorial/index.html ) 
References

More Related Content

What's hot

Wireless sensor networks (Yogesh Chandra Fulara)
Wireless sensor networks (Yogesh Chandra Fulara)Wireless sensor networks (Yogesh Chandra Fulara)
Wireless sensor networks (Yogesh Chandra Fulara)Yogesh Fulara
 
Leach & Pegasis
Leach & PegasisLeach & Pegasis
Leach & PegasisReenaShekar
 
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
 
TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY
 TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY
TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEYijujournal
 
Directed diffusion for wireless sensor networking
Directed diffusion for wireless sensor networkingDirected diffusion for wireless sensor networking
Directed diffusion for wireless sensor networkingHabibur Rahman
 
Sensor Protocols for Information via Negotiation (SPIN)
Sensor Protocols for Information via Negotiation (SPIN)Sensor Protocols for Information via Negotiation (SPIN)
Sensor Protocols for Information via Negotiation (SPIN)rajivagarwal23dei
 
localization in wsn
localization in wsnlocalization in wsn
localization in wsnnehabsairam
 
WSN-IEEE 802.15.4 -MAC Protocol
WSN-IEEE 802.15.4 -MAC ProtocolWSN-IEEE 802.15.4 -MAC Protocol
WSN-IEEE 802.15.4 -MAC ProtocolArunChokkalingam
 
Satellite ppt
Satellite pptSatellite ppt
Satellite pptDivya Shukla
 
UMTS, Introduction.
UMTS, Introduction.UMTS, Introduction.
UMTS, Introduction.Mateen Shahid
 
Contention based MAC protocols
Contention based  MAC protocolsContention based  MAC protocols
Contention based MAC protocolsDarwin Nesakumar
 
SENSOR NETWORK PLATFORMS AND TOOLS
SENSOR NETWORK PLATFORMS AND TOOLSSENSOR NETWORK PLATFORMS AND TOOLS
SENSOR NETWORK PLATFORMS AND TOOLSjuno susi
 
Data aggregation in wireless sensor network , 11751 d5811
Data aggregation in wireless sensor network , 11751 d5811Data aggregation in wireless sensor network , 11751 d5811
Data aggregation in wireless sensor network , 11751 d5811praveen369
 
Lecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networksLecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networksChandra Meena
 
CS6003 AD HOC AND SENSOR NETWORKS
CS6003 AD HOC AND SENSOR NETWORKSCS6003 AD HOC AND SENSOR NETWORKS
CS6003 AD HOC AND SENSOR NETWORKSKathirvel Ayyaswamy
 

What's hot (20)

Wireless sensor networks (Yogesh Chandra Fulara)
Wireless sensor networks (Yogesh Chandra Fulara)Wireless sensor networks (Yogesh Chandra Fulara)
Wireless sensor networks (Yogesh Chandra Fulara)
 
Leach & Pegasis
Leach & PegasisLeach & Pegasis
Leach & Pegasis
 
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 – ...
 
TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY
 TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY
TIME SYNCHRONIZATION IN WIRELESS SENSOR NETWORKS: A SURVEY
 
WSN Routing Protocols
WSN Routing ProtocolsWSN Routing Protocols
WSN Routing Protocols
 
Ad-Hoc Networks
Ad-Hoc NetworksAd-Hoc Networks
Ad-Hoc Networks
 
Directed diffusion for wireless sensor networking
Directed diffusion for wireless sensor networkingDirected diffusion for wireless sensor networking
Directed diffusion for wireless sensor networking
 
Manet ppt
Manet pptManet ppt
Manet ppt
 
Sensor Protocols for Information via Negotiation (SPIN)
Sensor Protocols for Information via Negotiation (SPIN)Sensor Protocols for Information via Negotiation (SPIN)
Sensor Protocols for Information via Negotiation (SPIN)
 
localization in wsn
localization in wsnlocalization in wsn
localization in wsn
 
WSN-IEEE 802.15.4 -MAC Protocol
WSN-IEEE 802.15.4 -MAC ProtocolWSN-IEEE 802.15.4 -MAC Protocol
WSN-IEEE 802.15.4 -MAC Protocol
 
Satellite ppt
Satellite pptSatellite ppt
Satellite ppt
 
Unit 33-routing protocols for wsn
Unit 33-routing protocols for wsnUnit 33-routing protocols for wsn
Unit 33-routing protocols for wsn
 
UMTS, Introduction.
UMTS, Introduction.UMTS, Introduction.
UMTS, Introduction.
 
M2M technology in IOT
M2M technology in IOTM2M technology in IOT
M2M technology in IOT
 
Contention based MAC protocols
Contention based  MAC protocolsContention based  MAC protocols
Contention based MAC protocols
 
SENSOR NETWORK PLATFORMS AND TOOLS
SENSOR NETWORK PLATFORMS AND TOOLSSENSOR NETWORK PLATFORMS AND TOOLS
SENSOR NETWORK PLATFORMS AND TOOLS
 
Data aggregation in wireless sensor network , 11751 d5811
Data aggregation in wireless sensor network , 11751 d5811Data aggregation in wireless sensor network , 11751 d5811
Data aggregation in wireless sensor network , 11751 d5811
 
Lecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networksLecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networks
 
CS6003 AD HOC AND SENSOR NETWORKS
CS6003 AD HOC AND SENSOR NETWORKSCS6003 AD HOC AND SENSOR NETWORKS
CS6003 AD HOC AND SENSOR NETWORKS
 

Similar to Ns2

Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorialcscarcas
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2crescent000
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.pptWajath
 
link-state-routing-3.pdf
link-state-routing-3.pdflink-state-routing-3.pdf
link-state-routing-3.pdfJayaprasanna4
 
18CSL51 - Network Lab Manual.pdf
18CSL51 - Network Lab Manual.pdf18CSL51 - Network Lab Manual.pdf
18CSL51 - Network Lab Manual.pdfSelvaraj Seerangan
 
ns2-lecture.ppt
ns2-lecture.pptns2-lecture.ppt
ns2-lecture.pptAnniModgil
 
Cs757 ns2-tutorial-exercise
Cs757 ns2-tutorial-exerciseCs757 ns2-tutorial-exercise
Cs757 ns2-tutorial-exercisePratik Joshi
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2AAKASH S
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2AAKASH S
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2AAKASH S
 
Ns tutorial
Ns tutorialNs tutorial
Ns tutorialSAMMMATHEW
 
Working with NS2
Working with NS2Working with NS2
Working with NS2chanchal214
 

Similar to Ns2 (20)

Ns2pre
Ns2preNs2pre
Ns2pre
 
Network Simulator Tutorial
Network Simulator TutorialNetwork Simulator Tutorial
Network Simulator Tutorial
 
Tut hemant ns2
Tut hemant ns2Tut hemant ns2
Tut hemant ns2
 
NS2-tutorial.ppt
NS2-tutorial.pptNS2-tutorial.ppt
NS2-tutorial.ppt
 
NS2 (1).docx
NS2 (1).docxNS2 (1).docx
NS2 (1).docx
 
NS2-tutorial.pdf
NS2-tutorial.pdfNS2-tutorial.pdf
NS2-tutorial.pdf
 
Venkat ns2
Venkat ns2Venkat ns2
Venkat ns2
 
link-state-routing-3.pdf
link-state-routing-3.pdflink-state-routing-3.pdf
link-state-routing-3.pdf
 
18CSL51 - Network Lab Manual.pdf
18CSL51 - Network Lab Manual.pdf18CSL51 - Network Lab Manual.pdf
18CSL51 - Network Lab Manual.pdf
 
ns2-lecture.ppt
ns2-lecture.pptns2-lecture.ppt
ns2-lecture.ppt
 
Ns network simulator
Ns network simulatorNs network simulator
Ns network simulator
 
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
 
Cs757 ns2-tutorial-exercise
Cs757 ns2-tutorial-exerciseCs757 ns2-tutorial-exercise
Cs757 ns2-tutorial-exercise
 
Network simulator 2
Network simulator 2Network simulator 2
Network simulator 2
 
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
 
Ns tutorial
Ns tutorialNs tutorial
Ns tutorial
 
Working with NS2
Working with NS2Working with NS2
Working with NS2
 

Recently uploaded

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
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
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Ns2

  • 1. Wireless Sensor Network And Its implementation
  • 2. Overview •Introduction •Components of WSN •Wireless Sensor Network •Communication in Wireless Sensor Network •Network Architecture •WSN Protocol Stack •WSN Operating Systems •WSN Simulators •Operational Challenges of WSN •Wireless Sensor Networks Features •Applications of WSN
  • 3. Introduction •A wireless sensor network is a collection of nodes organized into a cooperative network. •Each node has capability to sense data, process the data. These sensors work with each other to sense some physical phenomenon. •The nodes in the network are connected via Wireless communication channels.
  • 4. Components of WSN • sensor –A transducer –converts physical phenomenon e.g. heat, light, motion, vibration, and sound into electrical signals •sensor node –basic unit in sensor network – contains on-board sensors, processor, memory, transceiver, and power supply •sensor network –consists of a large number of sensor nodes –nodes deployed either inside or very close to the sensed phenomenon
  • 5. Wireless Sensor Network Wireless Sensor Network
  • 6. Communication in Wireless Sensor Network TCP or UDP via Internet Sensing UDP type protocol Communication in Wireless Sensor Network
  • 7. Network Architecture Flat Network Topology Where sensor nodes also act as routers and transfer data to a sink through multi-hop routing
  • 8. Network Architecture Hierarchical Network Topology Higher nodes can be used to process and send the information while low energy nodes can be used to perform the sensing in the proximity of the target.
  • 9. Node Architecture •Hardware components of a sensor node include –Sensing unit –Processing unit –Communication unit –Power unit.
  • 10. Node Architecture (Components of Node) sensor ADC Memory Processor Radio Battery Sensing Unit Processing Unit Communication Unit Power Unit Figure10:- Architecture of Sensor Node 10
  • 11. WSN Protocol Stack Application Layer Transport Layer Network Layer Data-Link Layer Physical Layer
  • 12. WSN Operating Systems •TinyOS •Contiki •MANTIS •BTnut •SOS •Nano-RK
  • 13. TinyOS •TinyOS system and its programs written in nesC •Its having a component-based architecture •TinyOS programs are composed into event handlers and tasks with run-to-completion semantics. •free and open-source operating system
  • 14. WSN Simulators •NS-2 •GloMoSim •OPNET •SensorSim •J-Sim •OMNeT++
  • 15. Introduction to Network Simulator (NS2)
  • 16. overview •NS2- Network Simulator •Basic Requirements: NS-2 •Download and Installation of NS2 •''Ns'' Components •Basics of using NS2 •Steps to set up the simulation •Script to start nam •Simple two node wired network •Adding traffic to the link •Record Simulation Trace •Simulate a simple topology
  • 17. NS2- Network Simulator •A package of tools that simulates behavior of networks •One of the most popular simulator among networking researchers – Open source, free •Discrete event simulator targeted at networking research and education –Protocol design, traffic studies, etc –Wired and wireless networks •Back end is in C++ and front end is in oTcl
  • 18. 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
  • 19. Download and Installation of NS2 •http://www.isi.edu/nsnam/ns/ – For easy installation, download ns-allinone – Includes Tcl, Otcl, TclCL, ns, nam, etc. •Select the Operating System –NS2 is available for both Windows and Linux –Linux is desirable as C++ compiler is free and easy to debug
  • 20. ''Ns'' Components •ns, the simulator itself •nam, the Network AniMator –visualize ns (or other) output –GUI input simple ns scenarios •pre-processing: –traffic and topology generators •post-processing: –simple trace analysis, often in Awk, Perl, or Tcl
  • 21. Basics of using NS2 •Define Network topology in .tcl script •To run , $ ns simple.tcl •Output is in form of trace files
  • 22. 22 Hello World – Batch mode #simple.tcl set ns [new Simulator] $ns at 1 “puts “Hello World!”” $ns at 1.5 “exit” $ns run linux21% ns simple.tcl Hello World! linux21%
  • 23. Steps to set up the simulation •Initialize the simulator •Define files for output (tracing) •Set up the topology •Set up the “agents” •Set up the traffic between the nodes •Start the simulation •Analyze the trace files to compute the parameters of interest
  • 24. Script to start nam #Create a simulator object set ns [new Simulator] #Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf #Define a 'finish' procedure proc finish {} { global ns nf $ns flush-trace #Close the NAM trace file close $nf #Execute NAM on the trace file exec nam out.nam & exit 0 } #call 'finish' procedure $ns at 12.0 “finish"
  • 25. Simple two node wired network #Create a simulator object set ns [new Simulator] #Open trace files set f [open out.tr w] $ns trace-all $f #Define a 'finish' procedure proc finish {} { global ns $ns flush-trace close $f exit 0 } #Create two nodes set n0 [$ns node] set n1 [$ns node] #Create a duplex link between the nodes $ns duplex-link $n0 $n1 1Mb 10ms DropTail #Call the finish procedure after 5 seconds of simulation time $ns at 5.0 "finish" #Run the simulation $ns run But we have no traffic !
  • 26. Simple two node wired network # Create two nodes set n0 [$ns node] set n1 [$ns node] # Create a duplex link between the nodes $ns duplex-link $n0 $n1 1Mb 10ms DropTail n0 n1
  • 27. Adding traffic to the link # Create a UDP agent and attach it to node n0 set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 udp n0 n1 null cbr
  • 28. Adding traffic to the link # Create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetSize_ 500 $cbr0 set interval_ 0.005 $cbr0 attach-agent $udp0 udp n0 n1 null cbr
  • 29. Adding traffic to the link # Create a Null agent (a traffic sink) and attach it to node n1 set null0 [new Agent/Null] $ns attach-agent $n1 $null0 udp n0 n1 null cbr
  • 30. Adding traffic to the link #Connect the traffic source with the traffic sink $ns connect $udp0 $null0 #Schedule events for the CBR agent $ns at 0.5 "$cbr0 start" $ns at 4.5 "$cbr0 stop” $ns at 5.0 "finish“ $ns run udp n0 n1 null cbr
  • 31. Record Simulation Trace + enqueue - dequeue r receive d drop time Nodes involved in this event Packet type packet length packet flags flow ID source/dest addresses seq number packet ID
  • 32. 32 Simulate a simple topology
  • 33. 33 Simulate a simple topology – (Contd.) #Create four nodes set n0 [$ns node] set n1 [$ns node] set n2 [$ns node] set n3 [$ns node] #Create links between the nodes $ns duplex-link $n0 $n2 2Mb 10ms DropTail $ns duplex-link $n1 $n2 2Mb 10ms DropTail $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail #Set Queue Size of link (n2-n3) to 10 $ns queue-limit $n2 $n3 10
  • 34. 34 Simulate a simple topology – (Contd.) #Give node position (for NAM) $ns duplex-link-op $n0 $n2 orient right-down $ns duplex-link-op $n1 $n2 orient right-up $ns duplex-link-op $n2 $n3 orient right #Monitor the queue for link (n2-n3). (for NAM) $ns duplex-link-op $n2 $n3 queuePos 0.5 #Setup a TCP connection set tcp [new Agent/TCP] $tcp set class_ 2 $ns attach-agent $n0 $tcp set sink [new Agent/TCPSink] $ns attach-agent $n3 $sink $ns connect $tcp $sink $tcp set fid_ 1
  • 35. 35 Simulate a simple topology – (Contd.) #Setup a FTP over TCP connection set ftp [new Application/FTP] $ftp attach-agent $tcp $ftp set type_ FTP #Setup a UDP connection set udp [new Agent/UDP] $ns attach-agent $n1 $udp set null [new Agent/Null] $ns attach-agent $n3 $null $ns connect $udp $null $udp set fid_ 2
  • 36. 36 Simulate a simple topology – (Contd.) #Setup a CBR over UDP connection set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set type_ CBR $cbr set packet_size_ 1000 $cbr set rate_ 1mb $cbr set random_ false #Schedule events for the CBR and FTP agents $ns at 0.1 "$cbr start" $ns at 1.0 "$ftp start" $ns at 4.0 "$ftp stop" $ns at 4.5 "$cbr stop"
  • 37. 37 Simulate a simple topology – (Contd.) #Detach tcp and sink agents (not really necessary) $ns at 4.5 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink" #Call the finish procedure after 5 seconds of simulation time $ns at 5.0 "finish" #Print CBR packet size and interval puts "CBR packet size = [$cbr set packet_size_]" puts "CBR interval = [$cbr set interval_]" #Run the simulation $ns run
  • 38. Operational Challenges of WSN •Heterogeneity •Distributed Processing •Low Bandwidth Communication •Large Scale Coordination •Utilization of Sensors •Real Time Computation
  • 39. Wireless Sensor Networks Features •Much cheaper to deploy than wired sensors •Sensor nodes can be added or removed easily •Node location can be changed without rewiring •Can be configured into different network topologies •Large Network size •Self-organized •All nodes acts as routers •Potential multihop routes
  • 40. Applications of WSNs •Intelligent (smart) buildings •Monitoring of structures •Monitoring of water quality •Health care •Disaster detection •Environmental monitoring •Social studiesPrecision agriculture •Habitat monitoring •Facility management •Logistics •Tracking of containers and boxes •Military applications
  • 41. Applications of WSN Military Applications •Monitoring friendly forces, equipment, and ammunition •Battlefield surveillance •Reconnaissance of opposing forces and terrain •Targeting •Battle damage assessment •Nuclear, biological, and chemical attack detection
  • 42. Applications of WSNs Industrial Sensing •To monitor the “health” of machines •To ensure safe operation. •Monitoring corrosion •prevent the incidents of contaminating the food supply chain •Eg.Rohrback Cosasco Systems (RCS) (Rohrback Cosasco Systems, n.d.) is the world leader in corrosion monitoring technology
  • 43. Applications of WSNs Health Applications •Tracking and monitoring doctors and patients inside a hospital •Special kinds of sensors which can measure blood pressure, body temperature and electrocardiograph (ECG) can even be knitted into clothes to provide remote nursing for the elderly. •Drug administration in hospitals
  • 44. Applications of WSNs Environmental Applications •Animal tracking •Weather forecasting. •Forest fire detection •Bio-complexity mapping of environment •Flood detection •Air and water pollution •Eg.University of Southampton have built a glacial environment monitoring system using WSNs in Norway
  • 46. Conclusion •WSNs possible today due to technological advancement in various domains •Envisioned to become an essential part of our lives • Design Constraints need to be satisfied for realization of sensor networks •Tremendous research efforts being made in different layers of WSNs protocol stack 46 WSNs possible today due to technological advancement in various domains Envisioned to become an essential part of our lives Design Constraints need to be satisfied for realization of sensor networks .ns2 can be use as one the simulation tool to analyze network behavior. Tremendous research efforts being made in different layers of WSNs protocol stack Conclusion
  • 47. Conclusion •WSNs possible today due to technological advancement in various domains •Envisioned to become an essential part of our lives • Design Constraints need to be satisfied for realization of sensor networks •Tremendous research efforts being made in different layers of WSNs protocol stack 47 •Wireless Sensor Networks - An Introduction by QinghuaWang and Ilangko Balasingham. •System Architecture for Wireless Sensor Networks by Jason Lester Hill, University of California, Berkeley, 2003. •Networking Wireless Sensors by Bhaskar Krishnamachari, 2005. •A Survey of Wireless Sensor Networks Technology by I. Khemapech, I. Duncan and A. •Fundamentals of Wireless Sensor Networks: Theory and Practice, Waltenegus Dargie •Wireless Sensor Networks by F. L. LEWIS ,2004 •Wikipedia •The VINT project, The ns manual •The network simulator - ns-2,( http://www.isi.edu/nsnam/ns/ ) •ns-2 Tutorial:( http://www.isi.edu/nsnam/ns/tutorial/nsindex.html ) •Marc Greis’s Tutorial (http://www.isi.edu/nsnam/ns/tutorial/index.html ) References