Simulators for Sensor Networks Sagnik Bhattacharya 9/12/2001.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
Advertisements

COM vs. CORBA.
Wireless Communication : LAB 3
1 ns-2 Tutorial, part 2 Dave Anderson, Xiaowei Yang (Modified from Polly Huang’s slides)
An Introduction to NS-2 * Gayatri Swamynathan CS 276 TA *some slides are from a presentation by Haobo Yu & Nader Salehi, USC/ISI.
Brief Intro to ns2: The most widely used Network Simulator COMP5416 Advanced Network Technologies Based on: Marc Greis's
Ns-2 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
How to Add a New Protocol in NS2 Xu Leiming CSCW Lab. at CS Dept., Tsinghua Univ. June 1, 2001.
5-Jul-141 S.Pushpalatha, Associate Professor, PSNACET.
Introduction to NS. Information Main website Documentation, mailing list archive, tutorial Location of Source codes –C++ files.
Decentralized Reactive Clustering in Sensor Networks Yingyue Xu April 26, 2015.
Introduction to Wireless simulations Shao-Cheng Wang.
Simulation of GPRS MS-BS Interface Using ns-Network Simulator Dual Degree Presentation by Richa Jain (96D07007) Department of Electrical Engineering, Indian.
Emulatore di Protocolli di Routing per reti Ad-hoc Alessandra Giovanardi DI – Università di Ferrara Pattern Project Area 3: Problematiche di instradamento.
Network Simulator 2 Tejas Vasavada.
1 Network Simulator (NS-2). 2 講義 Network Simulator (NS2) Part 1: 下載 Part 2: 安裝與測試 Part 3: 劇本 Part 4: 數據.
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
CprE 543x – ns-2 Tutorial Zak Abichar, Dept of Electrical and Computer Engineering Iowa State University Ames,
1 Ns Tutorial Alhussein A. Abouzeid Elect. Eng. Dept./U. of Washington Parts of this educational presentation use examples available.
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
WSN Simulation Template for OMNeT++
Embedded Systems for Wireless Sensor Network Rabi Mahapatra.
Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999.
Wireless Sensor Network for Tracking the Traffic in INTERNET Network Routers Supervisor: Mark Shifrin Students: Yuriy Kipnis Nir Bar-Or Networked Software.
Ns Simulation of IEEE SC546 Project (Fall 2002) SOO IL KIM JISUN YOON
EstiNet Network Simulator & Emulator 2014/06/ 尉遲仲涵.
Network Simulator 2(NS2) Yingyue Xu 8/25/2015. Overview: The Network simulator (NS): discrete event simulator for networks. supports wired, wireless,
QualNet 2014/05/ 尉遲仲涵. Outline Directory Structure QualNet Basic Message & Event QualNet simulation architecture Protocol Model Programming.
OMNET++. Outline Introduction Overview The NED Language Simple Modules.
Wireless Networking and Systems CSE 590 ns2 tutorial.
10b_ns: CSci551 SP2002 Friday © 2002 John Heidemann1 NS Tutorial, Class 10 CSci551: Computer Networks SP2002 Friday Section John Heidemann.
Wave Relay System and General Project Details. Wave Relay System Provides seamless multi-hop connectivity Operates at layer 2 of networking stack Seamless.
NetSim ZigBee Simulation Code Walkthrough in 10 steps
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
1 Introduction to Ns-2 Zhibin WU WINLAB, ECE Dept. Rutgers U.
1 / 10 Mobile Networking in ns Speaker : Mark Yang
Introduction to Mobility & Network Simulator 2 (NS-2)
NS2 - Wireless Network Ming-Feng Yang. 2 2 Outline Basic wireless model Extensions wireless model Example - Ad hoc network Example – WLAN Example – Mobile.
Define options(1/2) #channel type set val(chan) Channel/WirelessChannel # radio-propagation model set val(prop) Propagation/TwoRayGround # network interface.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
MOBILE IP SOMULATION IN NS2 Presenter: 吳寶緣. Outlines  Overview  Hierarchical Address Format  Hierarchical Address Format-ex  MoblieIP Demo  Additional.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
Internet Computing KUT Youn-Hee Han
Chapter 15 The Addressing Structure in NS. The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for.
Quality evaluation of MPEG4 video transmission over GPRS networks.. Presented by: Abdullah M. Rana Multimedia Communication.
1 Network Simulation and Testing Polly Huang EE NTU
1 NS Fundamentals. USC INFORMATION SCIENCES INSTITUTE 2 OTcl and C++: The Duality C++ OTcl Pure C++ objects Pure OTcl objects C++/OTcl split objects ns.
Ns-2 Tutorial (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Jianping Wang, 2002 cs757 1.
1 Introduction to NS-2 r Tutorial overview of NS m Create basic NS simulation r Walk-through a simple example m Model specification m Execution and trace.
Performance Validation of Mobile IP Wireless Networks Presented by Syed Shahzad Ali Advisor Dr. Ravi Pendse.
Group Management in Mobile Ad Hoc Networks Revathi Ranganathan Preeti Venkateswaran.
CDA6530: Performance Models of Computers and Networks Chapter 10: Introduction to Network Simulator (NS2) TexPoint fonts used in EMF. Read the TexPoint.
The Creation of NS2 Simulated Environment ( 1 ) LI Chengbo
Computer Simulation of Networks ECE/CSC 777: Telecommunications Network Design Fall, 2013, Rudra Dutta.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
DSN & SensorWare Projects Rockwell Science Center –Charles Chien UCLA –Mani Srivastava, Miodrag Potkonjak USC/ISI –Brian Schott, Bob Parker Virginia Tech.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
David B. Johnson Rice University Department of Computer Science DSR Draft Status Monarch Project 57th IETF.
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
Overview of VANET Project(2011) on NS2 Perspective Part 1 of 2 Jae-Myeong Lee Human-centric Mobile Computing Lab.
(Modified from Polly Huang’s and last year’s original)
SDN challenges Deployment challenges
Simulators for Sensor Networks
Introduction to ns-2: “The” Network Simulator
Introduction to NS Srinath Perur.
Software Defined Networking (SDN)
Karthik Sadasivam Banuprasad Samudrala
TexPoint fonts used in EMF.
Connectors, Repeaters, Hubs, Bridges, Switches, Routers, NIC’s
Presentation transcript:

Simulators for Sensor Networks Sagnik Bhattacharya 9/12/2001

Overview What we need? How much effort should we put? Some existing network simulators. SensorSim. NS-2 primer. NS-2 issues and conclusion. -The first 90% of project takes 90% of the time, the last 10% takes the other 90% of the time.

What we want? It should perform simulations of our algorithms. (obviously) It should have models for wireless transmissions and battery models. It should be extremely scalable. It should be efficient for large simulations. There should be technical support. -A bug in the code is worth two in the documentation.

How much effort should we put in? Build battery and wireless models? (Preferably no) Implement routing? How much learning is involved? Change basic modules or just add our own modules? -A computer scientist is someone who fixes things that aren't broken.

JavaSim Pros –Very modular –Easy to use Cons –Geared for wired internetworks –No wireless support -All computers wait at the same speed.

GlomoSim Specific for mobile wireless networks. Built as a set of libraries. The libraries are built in Parsec( a C-based discrete event simulation language). Layered architecture with easy plug-in capability. -Any program that runs right is obsolete.

Propagation model Radio MAC Layer Network IP Transport Application Link Layer GloMoSim Library Modular, extensible library for network models Model each layer using abstract or detailed model Built-in statistics collection at each layer Cons : Fixed protocol layers. Application Processing Free space, TIREM EPLRS, WaveLAN,... IEEE , 802.3, … OSPF, AODV, … IP TCP, UDP, RSVP RTP Wrapper Packet Store/Forward Data Plane -Windows is NOT a virus. Viruses DO something.

NS - 2 De facto standard for network simulations Discrete Event Simulator Packet-level Wired and Wireless Size : (Current release adds around 10%) 100K lines of C++ 70K lines of OTcl 30K lines of test suites 20K lines of documentation -A program is never finished until the programmer dies.

NS Architecture Object-oriented (C++, OTcl) Scalability + Extensibility –Control/”data” separation –Split C++/OTcl object Modular approach –Fine-grained object composition –Reusability -You are making progress if each mistake is a new one.

C++ and OTcl Separation C++ for “data” –Per packet action OTcl for control –Periodic or triggered action +Compromise between composibility and speed –Learning and debugging -To err is human, but to really foul things up requires a computer.

OTcl and C++: The Duality C++ OTcl Pure C++ objects Pure OTcl objects C++/OTcl split objects ns -There were computers in Biblical times. Eve had an Apple.

SensorSim Extension to NS - 2. Provides battery models, radio propagation models and sensor channel models. Provides a lightweight protocol stack. Has support for hybrid simulation. To be integrated with NS There can never be a computer language in which you cannot write a bad program.

SensorSim Architecture monitor and control hybrid network (local or remote) Simulation Machine Gateway Machine ns modified event scheduler V R V V V GUI app R real sensor apps on virtual sensor nodes gateway socket comm serial comm HS Interface Ethernet RS232 Proxies for real sensor nodes GUI Interface app

Sensor Node Model in SensorSim Node Function Model Network Layer Micro Sensor Node Applications Power Model (Energy Consumers and Providers) Battery Model Radio Model CPU Model Sensor #1 Model Sensor #2 Model MAC Layer Physical Layer Sensor Layer Wireless Channel Sensor Channel Network Protocol Stack Sensor Protocol Stack Middleware Physical Layer State Change Status Check -There are two ways to write error-free programs; only the third one works.

Power Management Model Transmit Receive Off Idle BZR event receive done transmit done Without Power Management Transmit Receive Sleep Off Idle transmit timeout(3 sec) BZR event transmit done BZR event receive done receive timeout With Power Management -The program is absolutely right; therefore the computer must be wrong.

SensorSim Problems Still at pre-release stage. No Documentation. The software currently has a very specific application hard-coded. It caters to only one base station. -The definition of an upgrade: Take old bugs out, put new ones in.

NS-2 primer -Reference Manual: Object that raises the monitor to eye level. Also used to compensate for that short table leg.

Hello World - Interactive Mode % ns % set ns [new Simulator] _o3 % $ns at 1 “puts \“Hello World!\”” 1 % $ns at 1.5 “exit” 2 % $ns run Hello World! 72% -One person's error is another person's data.

Hello World - Batch Mode simple.tcl set ns [new Simulator] $ns at 1 “puts \“Hello World!\”” $ns at 1.5 “exit” $ns run 74% ns simple.tcl Hello World! 75% -Maintenance-free: When it breaks, it can't be fixed...

Basic tcl set a 43 set b 27 proc test { a b } { 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]” } } } test MACINTOSH stands for Most Applications Crash If Not The Operating System Hangs.

Basic OTcl Class Mom Mom instproc greet {} { $self instvar age_ puts “$age_ years old mom: How are you doing?” } Class Kid -superclass Mom Kid instproc greet {} { $self instvar age_ puts “$age_ years old kid: What’s up, dude?” } set mom [new Mom] $mom set age_ 45 set kid [new Kid] $kid set age_ 15 $mom greet $kid greet -It works! Now if only I could remember what I did...

Elements of ns-2 Create the event scheduler [Turn on tracing] Create network Setup routing Create transport connection Create traffic / Schedule events Transmit application-level data Start simulation -It is easier to write an incorrect program than understand a correct one.

Wireless simulation in NS-2 Very different from wired simulation. Central object called GOD(General Operations Director) contains global state information. Nodes are inherently mobile. -I finally made my stupid computer faster; I dropped it out of the window, and it went really fast.

An Example – Step 1 # Define Global Variables # create simulator set ns [new Simulator] # define traces set tracefd [open simple.tr w] $ns_ trace-all $tracefd # create a topology in a 100m x 100m area set topo [new Topography] $topo load_flatgrid If at first you don't succeed, call it version 1.0.

An Example – Step 2 # Create God create-god $val(nn) # Create channel set chan_1_ [new $val(chan)] -For any problem there is a solution that is simple, quick, and ultimately worse than the problem.

An Example – Step 3 $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) \ -channel $chan_1_ \ -topoInstance $topo \ -agentTrace ON \ -routerTrace ON \ -macTrace OFF \ -movementTrace OFF\ -energyModel "EnergyModel" \ -initialEnergy $val(initialenergy) \ -rxPower $val(receivepower) \ -txPower $val(transmitpower) \ -idlePower $val(idlepower) -Excuse me for butting in, but I'm interrupt-driven.

An Example – Step 4 # Generating nodes for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node] } # Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes $node_(0) set X_ $node_(0) set Y_ $node_(0) set Z_ 0.0 $node_(1) set X_ : -Computers can figure out all kinds of problems, except the things in the world that just don't add up.

An Example – Step 5 #Create two ping agents and attach them to the nodes n0 and n2 set p0 [new Agent/Ping] $ns attach-agent $n0 $p0 set p1 [new Agent/Ping] $ns attach-agent $n2 $p1 #Connect the two agents $ns connect $p0 $p1 -Computer Science is no more about computers than astronomy is about telescopes. E. W. Dijkstra

An Example – Step 6 #Schedule events $ns_ at "puts \"hell-O\" " $ns_ at 10.2 "$p0 send" $ns_ at 10.4 "$p1 send" : #Run the Simulation puts "Starting Simulation..." $ns_ run -Build a system that even a fool can use, and only a fool will use it.

Ping Protocol Check out the handout. To add a new protocol : –Define packet header (PT_PING) –Define new agent class as a subclass of Agent in header file (ping.h) –Implement at least the following functions: int command ( int argc, const char*const* argc) void recv ( Packet * pkt, Handler* h) -To err is human, but to really foul things up requires a computer.

NS - 2 (contd.) Cons : –Comparatively difficult to learn and use. –Supposedly more useful for getting statistics for lower level protocols. –Originally built for wired networks, later extended for wireless. –Supposedly, does not work well for large topologies. -To err is human--and to blame it on a computer is even more so.

NS-2 problems and workarounds Large memory footprint 100 nodes 23MB 1000 nodes 412 MB Solutions : –Turn off tracing -routerTrace OFF \ -macTrace OFF \ –Remove packet headers remove-all-packet-headers add-packet-header DSDV Agent/Ping Mac/802_11 -Bug? That's not a bug, that's a feature.

Scalability of NS-2 Maximum number of nodes depends upon the traffic. Should be able to up to 500 nodes with reasonable(?) traffic. Running time? -Every time I type 'win', I loose...

To use NS….. Don’t worry about Otcl. Its easy.. Forget about Nam traces. Join the ns-user mailing list. Get started as soon as possible…. learning to use and modify it can take time. Just adding new protocols might not do. Some internal changes might need to be made. -A user friendly computer first requires a friendly user.

Conclusion Use SensorSim if you can. NS-2 can be used for simulation of the order of hundreds of nodes…. Not possible with motes. Can build more advanced protocols, for future motes which might have more memory. -ASCII stupid question, get a stupid ANSI!

URL’s This presentation: NS-2 home: -Every bug you find is the last one.

Questions? -Computer Science: solving today's problems tomorrow.