Introduction to Wireless simulations Shao-Cheng Wang.

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.
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.
NS-2 Shahin Shayandeh December 2004 Session 2. Ns programming  Create the event scheduler  Turn on tracing  Create network  Setup routing  Insert.
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.
Network Simulator (NS) Prof. Nelson L. S. da Fonseca State University of Campinas, Brazil.
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.
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.
Day 3 Outline Multicast example (from Day 2) Wireless Misc. utilities
Yinfei Pan SUNY Binghamton Computer Science
1 Modified Schedule Day 2 Network AniMator (nam) Examples simple.tcl mcast.tcl Day 3 Wireless (ad-hoc)
Jump to first page NS Tutorial: mobile and wireless network simulation Ya Xu USC/ISI September 10th, 1999.
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.
EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.
Ns Simulation of IEEE SC546 Project (Fall 2002) SOO IL KIM JISUN YOON
Introduction to Network Simulator NS-2 Part II
Routing in Mobile Ad-Hoc Networks An M.Tech. Project by Srinath Perur Guide: Prof. Sridhar Iyer.
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.
JIA-HUI HUANG INSTITUTE OF COMPUTER SCIENCE AND INFORMATION ENGINEERING NATIONAL TAIPEI UNIVERSITY OF TECHNOLOGY Network Simulator – NS-2 1.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
NetFlow Very useful for traffic analysis Very useful for traffic analysis Standard sampler: Standard sampler: –Cisco Netflow –Juniper Traffic Sampling.
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.
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.
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.
IP-BASED MOBILITY FOR WIRELESS LANS WITH THE NETWORK SIMULATOR NS Frank Christahl, Andreas Huber, Matthias Rosenschon University of Applied Sciences Giessen-Friedberg.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
Network Simulator with Mobile IP 2003 Huang – Yu Liu.
FAMU-FSU COLLEGE OF ENGINEERING Department of Electrical and Computer Engineering Students: Hung Khong – Derek Vollmer Instructor: Dr Ming Yu Computer.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
Ch7: Link and Buffer Management. 2 Portrait of A Mobile Node Node ARP Propagation and antenna models MobileNode LL MAC PHY LL CHANNEL LL MAC PHY Classifier:
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
Basics of NS-2 Training in TCL script
NS : The Network Simulator
Mobicom ‘99 Per Johansson, Tony Larsson, Nicklas Hedman
Introduction to ns-2: “The” Network Simulator
Planned Activities on Computer Networks for Sunday Academy
Introduction to ns-2 Noun Choi Oct. 11, 2007.
Traffic Aware Authors: Date: /28/2006 6/28/2006
TexPoint fonts used in EMF.
Presentation transcript:

Introduction to Wireless simulations Shao-Cheng Wang

Wireless Simulations Before simulation Generate traffic files: cbrgen.tcl Generate mobility files: setdest & calcdest Simulation simple-wireless.tcl After simulation Trace formats Nam Marc Greis's tutorial Greis's tutorial

Traffic file cbrgen.tcl (~/ns/indep-util/cmu-trace) ns cbrgen.tcl [-type cbr|tcp] [-nn nodes] [-seed seed] [-mc connections] [-rate rate]

Traffic file (cont’d) > ns cbrgen.tcl -type cbr -nn 10 -seed 1.0 -mc 8 -rate 4.0 # 2 connecting to 3 at time set udp_(0) [new Agent/UDP] $ns_ attach-agent $node_(2) $udp_(0) set null_(0) [new Agent/Null] $ns_ attach-agent $node_(3) $null_(0) set cbr_(0) [new Application/Traffic/CBR] $cbr_(0) set packetSize_ 512 $cbr_(0) set interval_ 0.25 $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"

Mobility file./setdest [-n num_of_nodes] [-p pausetime] [-s maxspeed] [-t simtime] \ [-x maxx] [-y maxy] > [outdir/movement-file] $node_(0) x,y,z $ns_ at "$node_(0) setdest " $ns_ at "$god_ set-dist " calcdest

Wireless Simulations Before simulation Generate traffic files: cbrgen.tcl Generate mobility files: setdest & calcdest Simulation simple-wireless.tcl After simulation Trace formats Nam Marc Greis's tutorial Greis's tutorial

Wireless simulation set val(chan) Channel/WirelessChannel ;# channel type set val(prop) Propagation/TwoRayGround ;# radio-propagation model set val(ant) Antenna/OmniAntenna ;# Antenna type set val(ll) LL ;# Link layer type set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type set val(ifqlen) 50 ;# max packet in ifq set val(netif) Phy/WirelessPhy ;# network interface type set val(mac) Mac/802_11 ;# MAC type set val(rp) DSDV ;# ad-hoc routing protocol (optional) Phy/WirelessPhy set bandwidth_ Phy/WirelessPhy set Rb_ Mac/802_11 set dataRate_ Mac/802_11 set basicRate_ Agent/DSDV set min_update_periods_ 3 (ref: tcl/lan/ns-mac.tcl, tcl/mobility/dsdv.tcl)

Wireless simulation – cont’d set val(nn) 2 ;# number of mobilenodes set opt(x) 1300 ;# X dimension of the topography set opt(y) 1300 ;# Y dimension of the topography set val(cp) "example.scen" set val(trfile) "example.traffic" set ns_ [new Simulator] $ns_ trace-all $tracefd set topo[new Topography] $wtopo load_flatgrid $opt(x) $opt(y) create-god $val(nn)

$ns_ node-config -adhocRouting $val(rp) \ -llType $val(ll) \ -macType $val(mac) \ -ifqType $val(ifq) \ -ifqLen $val(ifqlen) \ -antType $val(ant) \ -propType $val(prop) \ -phyType $val(netif) \ -topoInstance $topo \ -channelType $val(chan) \ -agentTrace ON \ -routerTrace OFF \ -macTrace OFF \ -movementTrace OFF

for {set i 0} {$i < $val(nn) } {incr i} { set node_($i) [$ns_ node ] $node_($i) random-motion 0 ;# disable random motion } source $val(cp) source $val(trfile) for {set i 0} {$i < $val(nn) } {incr i} { $ns_ at "$node_($i) reset"; } $ns_ at "stop" $ns_ at "puts \"NS EXITING...\" ; $ns_ halt" proc stop {} { global ns_ tracefd close $tracefd} puts "Starting Simulation..." $ns_ run

Wireless Simulations Before simulation Generate traffic files: cbrgen.tcl Generate mobility files: setdest & calcdest Simulation simple-wireless.tcl After simulation Trace formats Nam Marc Greis's tutorial Greis's tutorial

After simulation – trace format Special parameter # Enables trace for congestion window. $tcp trace cwnd_ # Attaches trace file handle to agent. set tchan_ [open cwnd.tr w] $tcp attach $tchan_ set awkCode {{ if ($6 == "cwnd_") { print $1, $7 >> "temp.c"; } } exec awk $awkCode cwnd.tr Detailed trace format : ~/ns/cmu-trace.cc

Trace s _0_ RTR ZRP 84 [ ] [0:255 -1: ] [0x1 0 [0 0] ] (HELLO) -1 sprintf(wrk_ + offset, "[0x%x %d [%d %d] %f] (%s) %d", rp->rp_type, rp->rp_hop_count, rp->rp_dst, rp->rp_dst_seqno, rp->rp_lifetime, rp->rp_type == ZRPTYPE_RREP ? "REPLY IERP" : (rp->rp_type == ZRPTYPE_UREP ? "UNSOLICITED REPLY IERP" : "HELLO"),ih->daddr());

Nam $node color [color] ;# sets color of node $node shape [shape] ;# sets shape of node $node label [label] ;# sets label on node $node label-color [lcolor] ;# sets color of label $node label-at [ldirection] ;# sets position of label $node add-mark [name] [color] [shape] ;# adds a mark to node $node delete-mark [name] ;# deletes mark from node

More resources Doc: ns by Example NS Manual: Workshop and presentations Contributed Modules : e

Backup Slides

Mobile Node Abstraction Location Coordinates (x,y,z) Movement Speed, direction, starting/ending location, time...

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_

Mobile Node: Components Link Layer Same as LAN, but with a separate ARP module Interface queue Give priority to routing protocol packets Mac Layer IEEE RTS/CTS/DATA/ACK for all unicast packets DATA for all broadcast packets

Mobile Node: Components Network interface (PHY) Parameters based on Direct Sequence Spread Spectrum (WaveLan) Interface with: antenna and propagation models Update energy: transmission and reception Radio Propagation Model Friss-space attenuation(1/r 2 ) at near distance Two-ray Ground (1/r 4 ) at far distance Antenna Omni-directional, unity-gain

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 ) messages  grid keeper

Grid-keeper: An Optimization