How (not) to Simulate Wireless Networks with ns Brad Karp University College London ns Workshop MSR Cambridge 9 th December, 2005.

Slides:



Advertisements
Similar presentations
Introduction to the WatchGuard AP Device
Advertisements

Variations of the Turing Machine
Network Layer Delivery Forwarding and Routing
EE384y: Packet Switch Architectures
1 UNIT I (Contd..) High-Speed LANs. 2 Introduction Fast Ethernet and Gigabit Ethernet Fast Ethernet and Gigabit Ethernet Fibre Channel Fibre Channel High-speed.
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Routing in Multi-Radio, Multi-Hop Wireless Mesh Networks Richard Draves, Jitendra Padhye, and Brian Zill Microsoft Research.
Processes and Operating Systems
OSPF 1.
1 Hyades Command Routing Message flow and data translation.
1 The Case for Heterogeneous Wireless MACs Chun-cheng Chen Haiyun Luo Dept. of Computer Science, UIUC.
Scalable Routing In Delay Tolerant Networks
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Protocol layers and Wireshark Rahul Hiran TDTS11:Computer Networks and Internet Protocols 1 Note: T he slides are adapted and modified based on slides.
Break Time Remaining 10:00.
Mohamed Hauter CMPE 259 – Sensor Networks UCSC 1.
Turing Machines.
Table 12.1: Cash Flows to a Cash and Carry Trading Strategy.
Chapter 1: Introduction to Scaling Networks
Local Area Networks - Internetworking
PP Test Review Sections 6-1 to 6-6
1 Atomic Routing Games on Maximum Congestion Costas Busch Department of Computer Science Louisiana State University Collaborators: Rajgopal Kannan, LSU.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 2 The OSI Model and the TCP/IP.
Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI June 18, 1999.
CS 6143 COMPUTER ARCHITECTURE II SPRING 2014 ACM Principles and Practice of Parallel Programming, PPoPP, 2006 Panel Presentations Parallel Processing is.
Chapter 20 Network Layer: Internet Protocol
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 Standard Ad Hoc Network Scenario In Ns-2 Simulation Lubo Song (SH305)
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
IPv6 Routing.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 10 Routing Fundamentals and Subnets.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 3 Networking Media.
Page 1 of 43 To the ETS – Bidding Query by Map Online Training Course Welcome This training module provides the procedures for using Query by Map for a.
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.
1 © 2004, Cisco Systems, Inc. All rights reserved. CCNA 1 v3.1 Module 9 TCP/IP Protocol Suite and IP Addressing.
The DDS Benchmarking Environment James Edmondson Vanderbilt University Nashville, TN.
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
Wireless world in NS Padma Haldar USC/ISI.
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
Network Simulator (NS) Prof. Nelson L. S. da Fonseca State University of Campinas, Brazil.
1 GPSR: Greedy Perimeter Stateless Routing for Wireless Networks B. Karp, H. T. Kung Borrowed slides from Richard Yang.
Geo – Routing in ad hoc nets References: Brad Karp and H.T. Kung “GPSR: Greedy Perimeter Stateless Routing for Wireless Networks”, Mobicom 2000 M. Zorzi,
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.
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
Georouting in ad hoc nets References: Brad Karp and H.T. Kung “GPSR: Greedy Perimeter Stateless Routing for Wireless Networks”, Mobicom 2000 M. Zorzi,
CS 672 Paper Presentation Presented By Saif Iqbal “CarNet: A Scalable Ad Hoc Wireless Network System” Robert Morris, John Jannotti, Frans Kaashoek, Jinyang.
1 GPSR: Greedy Perimeter Stateless Routing for Wireless Networks B. Karp, H. T. Kung Borrowed some Richard Yang‘s slides.
Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999.
5-1 Data Link Layer r What is Data Link Layer? r Wireless Networks m Wi-Fi (Wireless LAN) r Comparison with Ethernet.
Geographic Routing: GPSR Brad Karp UCL Computer Science CS M038 / GZ06 19 th January, 2009.
A Simple and Effective Cross Layer Networking System for Mobile Ad Hoc Networks Wing Ho Yuen, Heung-no Lee and Timothy Andersen.
2008/2/191 Customizing a Geographical Routing Protocol for Wireless Sensor Networks Proceedings of the th International Conference on Information.
1 / 10 Mobile Networking in ns Speaker : Mark Yang
NS2 - Wireless Network Ming-Feng Yang. 2 2 Outline Basic wireless model Extensions wireless model Example - Ad hoc network Example – WLAN Example – Mobile.
MOBILE IP SOMULATION IN NS2 Presenter: 吳寶緣. Outlines  Overview  Hierarchical Address Format  Hierarchical Address Format-ex  MoblieIP Demo  Additional.
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.
GPSR: Greedy Perimeter Stateless Routing for Wireless Networks EECS 600 Advanced Network Research, Spring 2005 Shudong Jin February 14, 2005.
New and Improved Geographic Routing: CLDP Brad Karp UCL Computer Science CS 4038 / GZ06 16 th January, 2008.
Mobicom ‘99 Per Johansson, Tony Larsson, Nicklas Hedman
GPSR Greedy Perimeter Stateless Routing
A comparison of Ad-Hoc Routing Protocols
CMPE 252A : Computer Networks
CMPE 252A : Computer Networks
Presentation transcript:

How (not) to Simulate Wireless Networks with ns Brad Karp University College London ns Workshop MSR Cambridge 9 th December, 2005

2 Outline Overview of ns wireless functionality –History –Simple example –MobileNode configuration –Controlling mobility –Defining traffic workloads –MobileNode architecture –Trace file format Role of simulation in wireless research Case study of simulation’s pitfalls: GPSR ns overview material largely borrowed: ns Manual (Chapter 16) Padma Haldar’s tutorial (11/2002)

3 History of ns Wireless Support David Johnson’s Monarch group at CMU: –Free-space, two-ray ground reflection channel model – MAC layer –Random waypoint mobility model –ARP –Ad hoc routing: Dynamic Source Routing (DSR), TORA, … –&c. Other major supported protocols and links (outside scope of today’s talk): Mobile IP, Directed Diffusion, satellite links, &c.

4 ns Wireless Architecture MobileNode at core of mobility support MobileNodes can move in a given topology, receive/transmit signals to/from wireless channels Wireless network stack consists of LL, ARP, MAC, IFQ, &c. Allows simulations of multi-hop ad hoc networks, wireless LANs, sensor networks etc

5 Wireless Example: Ad hoc Routing Scenario –2 mobile nodes –moving within 500m x 500m flat topology –using DSDV ad hoc routing protocol –Random Waypoint mobility model –TCP traffic Examples: –ns-2/ns-tutorial/examples/simple-wireless.tcl –ns-2/tcl/ex/wireless-demo-csci694.tcl

6 An Example – Step 1 # Define Global Variables # create simulator set ns [new Simulator] # create flat topology in 670m x 670m area set topo [new Topography] $topo load_flatgrid

7 An Example – Step 2 # Define wireless ns trace # ns trace set tracefd [open simple.tr w] $ns trace-all $tracefd

8 GOD ( General Operations Director ) Stores all-pairs Dijkstra shortest path lengths Allows comparison of path length with optimal Automatically generated, contained in scenario file set god [create-god ] $god set-dist

9 Example –Step 3 Create god set god [create-god 2] $ns at “$god setdist 1 2 1” Create wireless channel set thechan [new Channel/WirelessChannel]

10 An Example – Step 4 # Define how a mobile node is configured $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 \ -channel $thechan \ -topoInstance $topo -agentTrace ON \ -routerTrace OFF \ -macTrace OFF \ -movementTrace OFF

11 An Example – Step 5 # Use “for” loop to create 3 nodes: for {set i 0} {$i < 2} {incr i} { set node($i) [$ns node] # disable random motion $node($i) random-motion 0 }

12 MobileNode Movement Node position defined in 3D Today, z axis not used $node set X_ $node set Y_ $node set Z_ $node at setdest Lots of these events over a simulation; manual generation tedious…

13 Random Waypoint Model Place nodes uniformly at random Node moves to uniformly randomly chosen destination, at velocity chosen uniformly at random Between move events, node stays put for “pause time” Meant to mimic user behavior: move, work, move…

14 Scenario Generator: Movement setdest: MobileNode movement generator setdest -n -p pausetime -M -t -x -y setdest -n -p pausetime -M -t -x -y ns-2/indep-utils/cmu-scen- gen/setdest/ Source: ns-2/indep-utils/cmu-scen- gen/setdest/

15 Example setdest Output $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_ $god_ set-dist $ns_ at "$node_(2) setdest " $ns_ at "$node_(1) setdest " $ns_ at "$node_(0) setdest "

16 Scenario Generator: Traffic Generating traffic pattern files –CBR/TCP traffic ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed] [-mc connections] [-rate rate (pkt/s)] –CBR traffic ns cbrgen.tcl –type cbr –nn 20 –seed 1 –mc 8 -rate 4 -rate 4 –TCP traffic ns cbrgen.tcl –type tcp -nn 15 -seed 0 –mc 6 Default packet size: 512 bytes, hardwired in script! Start time uniform in [0, 180] s, hardwired in script! To evaluate routing, which traffic type would you use? ns-2/indep-utils/cmu-scen-gen/Source: ns-2/indep-utils/cmu-scen-gen/

17 A 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" …….

18 An Example – Step 6 # Define node movement model source # Define traffic model source

19 An Example – Step 7 # Tell ns the simulation stop time $ns at “$ns halt” # Start your simulation $ns run

20 Energy Extension Makes MobileNode energy-aware Enable by adding options: $ns_ node-config \ – energyModel EnergyModel - initialEnergy txPower0.6 -rxPower0.2

21 Outline Overview of ns wireless functionality –History –Simple example –MobileNode configuration –Controlling mobility –Defining traffic workloads –MobileNode architecture –Trace file format Role of simulation in wireless research Case study of simulation’s pitfalls: GPSR

22 Wireless Internals MobileNode –Basic entity with address and port de-muxes, routing agent, &c. –Stack of network components, including IFQ, LL, MAC, NetIF, radio propagation model, &c. Wireless channel

23 Portrait of A Mobile Node Node ARP Propagation and antenna models MobileNode LL MAC PHY LL CHANNEL LL MAC PHY Classifier: Forwarding Agent: Protocol Entity Node Entry LL: Link layer object IFQ: Interface queue MAC: Mac object PHY: Net interface protocol agent routing agent addr classifier port classifier 255 IFQ defaulttarget_ Radio propagation/ antenna models Prop/ant

24 Mobile Node : Components Classifiers defaulttarget_ points to routing agent object 255 is the port id assigned for rtagent_ Routing agent Ad hoc routing protocol, e.g., AODV, DSDV, DSR; or directed diffusion

25 Mobile Node: Components Link Layer –Same as LAN, but with a separate ARP module –Looks up IP-to-MAC mappings using ARP ARP –Resolves IP address to hardware (MAC) address –Broadcasts ARP query Interface queue (IFQ) –Gives priority to routing protocol packets –Has packet filtering (search and remove) capacity

26 Mobile Node: Components MAC – IEEE RTS/CTS/DATA/ACK for unicast Sends DATA directly for broadcast Network interface (PHY) –Used by MobileNode to access channel –Stamps outgoing packets with meta-data –Interface with radio/antenna models

27 Mobile Node: Components Radio Propagation Model –Friss-space model: attenuation at near distance –Two-ray ground reflection model: attenuation at far distance –Shadowing model: probabilistic Antenna –Omni-directional, unity-gain

28 Wireless Channel Duplicate packets to all mobile nodes attached to the channel except the sender It is the receiver’s responsibility to decide if it will accept the packet –Collision is handled at individual receiver –O(N 2 ) computation!

29 Wireless Trace Support CMU trace format differs from standard ns trace format! Configurable tracing: –MAC (very voluminous!) –Router forwarding –Agent events –Movement events Format described in detail in ns manual When in doubt, no substitute for reading the code! Shortest path lengths logged per pkt rx (cost in-core?) “New” wireless trace format –appears not to be in wide use yet –same information, formatted differently

30 Outline Overview of ns wireless functionality –History –Simple example –MobileNode configuration –Controlling mobility –Defining traffic workloads –MobileNode architecture –Trace file format Role of simulation in wireless research Case study of simulation’s pitfalls: GPSR

31 Simulation as Way to Enable Area Ad hoc routing: huge system deployment/debugging cost 1998 Broch et al. paper a watershed for ad hoc routing: first even comparison of wide field of protocols CMU ns wireless “extensions” the basis of most ad hoc networking research for next 5+ years

32 Simulation as Way to Kill Area Simulators don’t evaluate motivation! –Why are 500 laptops in a gymnasium not simply connecting to base stations? The founding of MobiHoc –cf. the founding of SIGMETRICS… The founding of MobiSys Secret tip: building a real system dramatically increases chances of acceptance! (because it’s HARD)

33 Things to Investigate Using ns Coarse notion of capacity Coarse notion of effect of mobility Fine-grained behavior of your routing (or other hop-by-hop) protocol –Only place you can easily have “centralized’ view!

34 Things Not to Investigate Using ns Realistic loss behavior (interference, multi- path fading, …) Broadcast Packet Delivery Probability Node Pair Roofnet measurements [SIGCOMM 2004]

35 Not in ns (cont’d) Realistic topology information –Roofnet finding: RTS/CTS useless in outdoor network! –Hidden terminal problem still mainstay of undergraduate networking courses everywhere… –GPSR free space ns simulation debacle (more later) Fine-grained mobility behavior –Random Waypoint corresponds little to reality –GPSR density anomaly (more later)

36 When to Roll Your Own Simulator GPSR greedy-only simulator –properties of node density, not of fine-grained radio propagation –~250 lines of C, a morning’s work –far faster than ns will ever be Simple visualization –GPSR topology visualizer find connected components show planar subgraphs animate forwarding

37 Outline Overview of ns wireless functionality –History –Simple example –MobileNode configuration –Controlling mobility –Defining traffic workloads –MobileNode architecture –Trace file format Role of simulation in wireless research Case study of simulation’s pitfalls: GPSR

38 Central idea:Machines can know their geographic locations. Route using geography. [MobiCom 2000] Packet destination field: location of destination Nodes all know own positions, e.g., –by GPS (outdoors) –by surveyed position (for non-mobile nodes) –by short-range localization (indoors, [AT&T Camb, 1997], [Priyantha et al., 2000]) –&c. Two forwarding algorithms: –Greedy mode simply chooses closest neighbor to destination –Perimeter mode recovers when no closer next hop available, by routing on planar subgraph of full network graph Scalability: tiny state per router; low routing protocol overhead; approximates shortest paths; high delivery success rate Greedy Perimeter Stateless Routing (GPSR)

39 Greedy Forwarding Nodes learn immediate neighbors’ positions from beaconing/piggybacking on data packets Locally optimal, greedy next hop choice: –Neighbor geographically nearest destination D x y

40 Greedy Forwarding Failure Greedy forwarding not always possible! Consider: D x z v void w y How can we circumnavigate voids? …based only on one-hop neighborhood?

41 Well-known graph traversal: right-hand rule Requires only neighbors’ positions Void Traversal: The Right-hand Rule x y z Doesn’t work when edges in graph cross one another!

42 Planarized Graphs: Example 200 nodes, placed uniformly at random on 2000-by-2000-meter region; 250-meter radio range Full Graph GG Subgraph RNG Subgraph

43 Packet Delivery Success Rate (50, 200; Dense)

44 GPSR: Making it Real We implemented full GPSR for Berkeley mote sensors [NSDI 2005] –3750 lines of nesC code –also includes: simple link thresholding, ARQ Deployed on Mica 2 “dot” mote testbeds –23-node, 50-node subsets of 100-node network in office building (Soda Hall; office walls; 433 MHz) –40-node network in office building (Intel Research Berkeley; cubicles; 900 MHz) Delivery success workload: 50 packets between all node pairs, serially

45 50-Node Testbed, Soda Hall GAME OVER Only 68.2% of node pairs connected!! What’s going on here?!

46 Planar, but Partitioned Output of GPSR’s Distributed GG (arrows denote unidirectional links) Absorption, reflection (multi-path), interference, antenna orientation differences, &c., lead to non-uniform radio ranges. RNG and GG partition graphs when radio ranges not uniform! Solution: entirely new protocol, CLDP, for removing crossing edges [NSDI 2005]. Provably correct on all connected graphs.

47 Key Lessons and Conclusion Understand your algorithm’s correctness assumptions Does the simulator model these properties accurately, or at least pessimistically? Fading, interference, loss rate particular pitfalls No substitute for building—even moreso than for Internet congestion control, as propagation too complex to model accurately

48 UCL: A Tradition of Great Networking Research in London Hiring junior and senior networking faculty Application deadline: 5 th January, 2006 Details at Why UCL? –Research: sdr, rat, Landmark Routing, NAT, XORP, TFRC, XCP, GPSR, CLDP, GHT, Autograph, Polygraph, … –Students (Paul Francis, Mark Handley, Jon Crowcroft, …) –LONDON