Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999.

Slides:



Advertisements
Similar presentations
Network Modeling and Simulation with Network Simulator 2 (ns2)
Advertisements

Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI June 18, 1999.
How (not) to Simulate Wireless Networks with ns Brad Karp University College London ns Workshop MSR Cambridge 9 th December, 2005.
Wireless world in NS Padma Haldar USC/ISI.
Wireless Communication : LAB 3
1 ns-2 Tutorial, part 2 Dave Anderson, Xiaowei Yang (Modified from Polly Huang’s slides)
Network Simulation One tool to simulation network protocols for the Internet is the network simulator (NS) The simulation environment needs to be set-
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 Exercise (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Adopted from Nicolas’s slides Jianping Wang,
NS Tutorial (For CMPE 252 A) By Duy Nguyen 10/25/2012.
Ns-2 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
Network Simulator (NS) Prof. Nelson L. S. da Fonseca State University of Campinas, Brazil.
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.
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.
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,
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
Yinfei Pan SUNY Binghamton Computer Science
Component-Based Routing for Mobile Ad Hoc Networks Chunyue Liu, Tarek Saadawi & Myung Lee CUNY, City College.
1 Network Simulator (NS-2) Tutorial These slides can be downloaded from:
1 2nd European ns-2 Workshop Polly Huang ETH Zurich April 18 & 19, 2001.
Ns Simulation of IEEE SC546 Project (Fall 2002) SOO IL KIM JISUN YOON
Introduction to Network Simulator NS-2 Part II
Simulators for Sensor Networks Sagnik Bhattacharya 9/12/2001.
Network Simulator 2(NS2) Yingyue Xu 8/25/2015. Overview: The Network simulator (NS): discrete event simulator for networks. supports wired, wireless,
Wireless Networking and Systems CSE 590 ns2 tutorial.
Introduction to ns-2 Noun Choi Oct. 11, Outline Background ns-2 Internals Short demo Troubleshooting Reference links Q & A.
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.
MOBILE IP SOMULATION IN NS2 Presenter: 吳寶緣. Outlines  Overview  Hierarchical Address Format  Hierarchical Address Format-ex  MoblieIP Demo  Additional.
NS2 - Appendix Ming-Feng Yang. 2 2 Outline NS2 Models NS2 Directory Structure Extending NS2 in OTcl Extending NS2 in C++ NS2 related links.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Internet Computing KUT Youn-Hee Han
Network Simulator ns-2. 2 Agenda Introduction Interface Tcl and OTcl TclCL Simulator Wired network Wireless network Program Assignment.
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.
Group Management in Mobile Ad Hoc Networks Revathi Ranganathan Preeti Venkateswaran.
Network Simulator Tutorial Wireless Networks. Acknowledgements Material is taken from the presentations by Jim Kurose, University of Massachusetts, Amherst.
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
Use of Mobility models in ns-2 Karthik Dantu Shyam Kapadia.
July 7, 2003 Building a Wireless LAN traffic test case in ns2 Radio Science Laboratory Department of Electrical and Computer Engineering The University.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
1 Network Simulator 2 Install Chao-Ying Chiu
DMET 602: Networks and Media Lab
(Modified from Polly Huang’s and last year’s original)
Analysis the performance of vehicles ad hoc network simulation based
Chapter 16 Mobile Networking in ns
NS : The Network Simulator
Mobicom ‘99 Per Johansson, Tony Larsson, Nicklas Hedman
Introduction to ns-2: “The” Network Simulator
Karthik Sadasivam Banuprasad Samudrala
Introduction to ns-2 Noun Choi Oct. 11, 2007.
TexPoint fonts used in EMF.
Presentation transcript:

Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999

Jump to first page Outlines n Use NS to simulate wireless network n Extend NS to support mobile and wireless application: Internal implementation n Get support for your NS simulation n Credit

Jump to first page Get started n Download the lastest ns snapshot from: u n Install ns in your system u Binary release is provided for windows 9x/NT u NS-allinone package is strongly recommended n Download nam if visualization is needed u u Included in ns-allinone package

Jump to first page TCL Basics n set a 123 ;#creates a variable whose name is a and whose value is 123 n set b $a ;#creates b whose value is a’s value n set c [expr $b+10] ;#evaluate the characters between the brackets as a TCL script and use the result as the value of c n for {set i 0} {$i < 3} {incr i} {puts $i}

Jump to first page A simple wireless simulation(1) n Scenario u containing 3 mobile nodes u moving within 670mX670m flat topology u using DSDV ad hoc routing protocol u Random Waypoint mobility model u TCP and CBR traffic u See: n ns-2/tcl/ex/wireless-demo-csci694.tcl

Jump to first page A simple wireless simulation(2) set ns_ [new Simulator] ; create a ns simulator instance #Define Global Variables set topo [new Topography] ; create a topology and $topo load_flatgrid ; define it in 670x670 area

Jump to first page A simple wireless simulation (3) #Define standard ns/nam trace set tracefd [open 694demo.tr w] $ns_ trace-all $tracefd set namtrace [open 694demo.nam w] $ns_ namtrace-all-wireless $namtrace

Jump to first page A simple wireless simulation (4) #Create “God” set god_ [create-god 3] God is used to store an array of the shortest number of hops required to reach from one node to an other. For example: $ns_ at “$god_ setdist 2 3 1”

Jump to first page A simple wireless simulation (5) #Define how a mobile node should be created $ns_ node-config -adhocRouting DSDV\ -llType LL \ -macType Mac/802_11\ -ifqLen 50 \ -ifqType Queue/DropTail/PriQueue \ -antType Antenna/OmniAntenna \ -propType Propagation/TwoRayGround \ -phyType Phy/WirelessPhy \ -channelType Channel/WirelessChannel \ -topoInstance $topo -agentTrace ON \ -routerTrace OFF \ -macTrace OFF

Jump to first page A simple wireless simulation (6) #Create a mobile node and attach it to the channel set node [$ns_ node] $node random-motion 0 ;# disable random motion – Use “for loop” to create 3 nodes: for {set i < 0} {$i<3} {incr i} { set node_($i) [$ns_ node] }

Jump to first page A simple wireless example(7) #Define traffic model source traffic-scenario-files #Define node movement model source movement-scenario-files

Jump to first page A simple wireless example(8) #Define node initial position in nam for {set i 0} {$i < 3 } { incr i} { $ns_ initial_node_position $node_($i) 20 } #Tell ns/nam the simulation stop time $ns_ at “$ns_ nam-end-wireless ” $ns_ at “$ns_ halt” #Start your simulation $ns_ run

Jump to first page Wireless Scenario Generator(1) n Mobile Movement Generator setdest -n -p pausetime -s -t -x -y See an example n Random movement $node start Source: See ns-2/indep-utils/cmu- scen-gen/setdest/

Jump to first page Wireless Scenario Generator(2) n Generating traffic pattern files u CBR traffic ns cbrgen.tcl [-type cbf|tcp] [-nn nodes] [-seed seed] [-mc connections] [-rate rate] u TCP traffic ns tcpgen.tcl [-nn nodes] [-seed seed] See an example Source: See ns-2/indep-utils/cmu-scen- gen/

Jump to first page Sensor Node extension n Node is energy-aware n Define node by adding new options: $ns_ node-config -energyModel EnergyModel -initialEnergy txPower0.6 -rxPower0.2

Jump to first page Summary of the API changes OLD API n dsr/dsdv/tora-create- mobile-node n strong global variable dependency n no nam support n no energy model n need global chan and prop New API n $ns_ node-config n $ns node n no global variable dependency n namtrace-all-wireless n Energy model support n No global definition of chan and prop

Jump to first page Network Components inside a mobilenode n Link Layer n ARP n Interface Queue n Mac Layer: IEEE n Network Interface n Radio Propagation Model u Friss-space attenuation(1/ ) at near distance u Two ray Ground (1/ ) at far distance

Jump to first page Visualize your simulation n Use nam to visualize: u mobilenode position u mobilenode moving direction and speed u control the speed of playback n See an example:

Jump to first page Feature summary(1) n Mac Layer:IEEE n Address Resolution Protocol (ARP) n Ad hoc routing protocols: DSDV, DSR,TORA n Radio Propagation Model u Friss-space attenuation at near distances u Two ray ground at far distances n Antenna: an omni-directional antenna having unity gain

Jump to first page Feature summary (2) n Scenario generator for traffic and node movement n Base station node to bridge wired domain and wireless domain n MobileIP n Symmetric architecture with wired LAN (IEEE 802.3)

Jump to first page Feature summary(3) n Visualization of node movement and reachability n Gridkeeper optimizer for some scenarios n Energy consumption model for sensor networks n Validation test-suites for dsdv, dsr, tora, base station, mobileIP, gridkeeper

Jump to first page Outlines n Use NS to simulate wireless network n Extend NS to support mobile and wireless application: Internal Implementation n Get support for your NS simulation n Credit

Jump to first page Abstract the real mobile world into your simulation n Node n Packets n Wireless channel and channel access n Forwarding and routing n Radio propagation model n Trace/Visualization n Event scheduler to make everything running

Jump to first page A mobile node abstraction n Location u coordinates (x,y,z) n Movement u speed,direction, starting/ending location,time... n Forwarding n Network stack for channel access u IEEE

Jump to first page Implementing mobile node by Extending “standard” NS node Classifier: Forwarding Agent: Protocol Entity Node Entry Node ARP Radio Propagation Model MobileNode LL MAC PHY LL CHANNEL LL MAC LL:Link layer object IFQ:Interface queue MAC:Mac object PHY PHY:Net interface Routing

Jump to first page Wireless Channel n Duplicate packets to all mobile nodes attached to the channel except the source itself. n It is the receiver’s responsibility to decide if it can receive the packet

Jump to first page NS split model in the MobileNode n Control/”Data” separation u control operations in otcl: plumbing u data pass through C++ object:composible

Jump to first page Extending NS Packet Format to support wireless simulation header data ip header ……... cmn headerts_ ptype_ uid_ size_ iface_ LL MAC 802_11 ……... ARP Example: Get the pointer to the Mac header: p->access(hdr_mac::offset_); Source: ns-2/mac.cc

Jump to first page Discrete Event Scheduler p = deque(); // get current event p->handler_->handle(p) head_ -> An example: node position handler node->update_position(); node->random_destination(); Insert new event back to the queue s = Scheduler::instance(); s.schedule(&node->handle, &node->pos_intr, interval); insert head_ ->

Jump to first page Outlines n Use NS to simulate wireless network n Extend NS to support mobile and wireless application: Internal Implementation n Get support for your NS simulator n Credit

Jump to first page Get Help n Main ns-2 web pages u u n Mailing lists u u n To subscribe u n Ask your classmates because ns is popular

Jump to first page Outlines n Use NS to simulate wireless network n Extend NS to support mobile and wireless application: Internal Implementation n Get support for your NS simulation n Credit

Jump to first page Who committed the code n CMU n UC Berkeley n Sun Microsystem Inc. n USC/ISI

Jump to first page Appendix A: Movement file $node_(2) set Z_ $node_(2) set Y_ $node_(2) set X_ $node_(1) set Z_ $node_(1) set Y_ $node_(1) set X_ $node_(0) set Z_ $node_(0) set Y_ $node_(0) set X_ $ns_ at "$node_(2) setdest " $ns_ at "$node_(1) setdest " $ns_ at "$node_(0) setdest "

Jump to first page Appendix B: Traffic Scenario set udp_(0) [new Agent/UDP] $ns_ attach-agent $node_(0) $udp_(0) set null_(0) [new Agent/Null] $ns_ attach-agent $node_(2) $null_(0) set cbr_(0) [new Application/Traffic/CBR] $cbr_(0) set packetSize_ 512 $cbr_(0) set interval_ 4.0 $cbr_(0) set random_ 1 $cbr_(0) set maxpkts_ $cbr_(0) attach-agent $udp_(0) $ns_ connect $udp_(0) $null_(0) $ns_ at "$cbr_(0) start" …….

Jump to first page Greedkeeper: an optimizer* * optimization depends on your scenario