1 2nd European ns-2 Workshop Polly Huang ETH Zurich April 18 & 19, 2001.

Slides:



Advertisements
Similar presentations
Wireless Communication : LAB 3
Advertisements

NS-2 (network simulator) NS by example παρουσίαση Κων/νος Τρούλος.
Introduction to Network Simulator NS-2 Part I
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.
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.
5-Jul-141 S.Pushpalatha, Associate Professor, PSNACET.
Dongsoo S. Kim 1.
Winter 2008 Evaluation Tools1 Brief Overview of Networking Evaluation Methods and Tools.
Simulation of GPRS MS-BS Interface Using ns-Network Simulator Dual Degree Presentation by Richa Jain (96D07007) Department of Electrical Engineering, Indian.
NS TUTORIAL Padma Haldar USC/ISI 09/04/02.
15-744: Computer Networking ns-2 Tutorial Based on slides from John Heidemann, Polly Huang, and Amit Manjhi.
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
15-744: Computer Networking L-3 The network simulator ns-2 Slides loosely based on a tutorial by Polly Huang, ETH Zurich.
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:
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
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,
Network Simulator (NS2) 1 Tutorial on Network Simulator (NS2) Hemant Kumar Rath Infonet Lab, Dept of Electrical Engineering IIT Bombay, Mumbai
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.
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
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.
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.
NS-2 Tutorial. Motivation What’s NS-2 Network simulator –Discrete event simulator It covers multiple layers –Application layer, transport layer, network.
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-2 Tutorial Haobo Yu, Nader Salehi USC/ISI
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.
1 ns-2 Tutorial Polly Huang AT&T Labs Research 11 August, 1999.
Lab 2, Network Simulator ns2 Shiv Kalyanaraman Yong Xia (TA) Satish Raghunath Sept 4,
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.
University of Texas at Arlington CSE 5346/4346 High Performance Networks 1 NS-2 Tutorial Choe, Hyun Jung (Stella) Spring 2008 Spring 2008 High Performance.
The Creation of NS2 Simulated Environment ( 1 ) LI Chengbo
TNK092: Network Simulation - Nätverkssimulering Lecture #1: Course basics and a first taste of NS2 Vangelis Angelakis Ph.D.
The New NS2 Emulation Facility Kevin Fall NS2 is the simulation vehicle for the VINT project: –USC/ISI: Deborah Estrin, Mark Handley,
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.
Lab 2, Network Simulator ns2
© Algirdas Pakstas CS3026N Network Analysis, Design and Simulation 1 CT3020: Network Planning and Simulation Week 6b Prof.DrTech. Algirdas Pakštas.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
VINT: Status and Plans Deborah Estrin: Project overview Steve McCanne: ns architecture John Heidemann: scaling, visualization Audience: Comments and questions.
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
DMET 602: Networks and Media Lab
(Modified from Polly Huang’s and last year’s original)
Introduction to ns-2: “The” Network Simulator
NS2 (and possible directions for mobile routing simulation) Kevin Fall
Introduction to NS Srinath Perur.
Ns By Kulveer Singh.
Karthik Sadasivam Banuprasad Samudrala
TexPoint fonts used in EMF.
Presentation transcript:

1 2nd European ns-2 Workshop Polly Huang ETH Zurich April 18 & 19, 2001

2 Workshop Overview Welcome Gratitude Audience background –object-oriented programming? –tcl? –use ns-2 before? –tcl, c, or both? –research interest?

3 Workshop Intensity Intended audience –try to cover a wide range –researchers, developers, educators Cover –both API & internal –some could be too easy or too difficult –see them as review or preview

4 Schedule: Today overview/intro/essential/getting started tcl/otcl/ns-2 fundamentals examples - TCP, RED, multicast, web, wireless Lunch break lab 1 setup/running examples lab 2 tcl/otcl exercises lab 3 simple ns-2 exercise discussion/feedback

5 Schedule: Tomorrow recap/wired internal wireless internal/making changes extending ns-2/case studies Lunch break lab 4 intermediate ns-2 exercise lab 5 getting data you want lab 6 advanced topic (TBD) discussion/feedback

6 Outline: This Morning Introduction –the project, the software, the philosophy –software architecture –installation and getting started tcl/otcl/ns-2 fundamentals –programming tcl/otcl –programming ns-2 simulation scripts Example scripts –TCP, web traffic, RED, multicast, wireless

7 The VINT Project Virtual InterNet Testbed –a common platform for network research –focus on multi-protocol interactions and scale – Follow-up projects –SAMAN: scenario and performance –CONSER: educational use

8 Multi-state collaboration AT&T Research Lawrence Berkeley National Laboratory UC Berkeley USC/ISI Xerox PARC ETH TIK

9 VINT People Project leads and co-PIs –Lee Breslau (AT&T Labs-Research) –Deborah Estrin (USC/ISI) –Kevin Fall (UC Berkeley) –Sally Floyd (AT&T/ACIRI) –Mark Handley (AT&T/ACIRI) –John Heidemann (USC/ISI) –Scott Shenker (AT&T/ACIRI) Graduate students and staff members

10 Project Goal To support collaborative simulation effort –promote sharing incorporate recent simulation models –increase confidence in results establish regression test suite –establish common reference current and periodic availability of source code Base software is ns-2

11 ns-2 Discrete event simulator Packet level Link layer and up Wired and wireless

12 Development Status Columbia NEST UCB REAL ns-1 ns-2 –100K lines of C++ code –70K lines of otcl support code –30K lines of test suites –20K lines of documentation

13 Usage and Releases Users from approximately –600 institutes –50 countries Releases –periodic official releases –nightly snapshots (probably compiles and works, but buyers beware) –available from USC/ISI or UK mirror

14 Platforms Most UNIX and UNIX-like systems  FreeBSD or *BSD  Linux  Sun Solaris  HP, SGI Window 95/98/NT... Emulation only for FreeBSD for now

15 First Words of Caution While we have considerable confidence in ns, ns is not a polished and finished product, but the result of an ongoing effort of research and development. In particular, bugs in the software are still being discovered and corrected.

16 Second Words of Caution Users of ns are responsible for verifying for themselves that their simulations are not invalidated by bugs. We are working to help the user with this by significantly expanding and automating the validation tests and demos.

17 Third Words of Caution Similarly, users are responsible for verifying for themselves that their simulations are not invalidated because the model implemented in the simulator is not the model that they were expecting. The ongoing ns Notes and Documentation should help in this process.

18 Workshop Goals Caution to be taken Existing capability Design and implementation Extendibility Promote sharing

19 Outline: This Morning Introduction –the project, the software, the philosophy –software architecture –installation and getting started tcl/otcl/ns-2 fundamentals –programming tcl/otcl –programming ns-2 simulation scripts Example scripts –TCP, web traffic, RED, multicast, wireless

20 Object-Oriented +Reusability +Maintainability –Careful planning ahead –Performance

21 C++ and otcl Separation C++ for data –per packet action otcl for control –periodic or triggered action +Compromize between composibility and speed –Learning & debugging

22 otcl and C++: The Duality C++ otcl

23 tcl Interpreter With Extents otcl: Object-oriented support tclcl: C++ and otcl linkage Discrete event scheduler Data network components tcl8.0 otcl tclcl ns-2 Event Scheduler Network Component

24 Installation Getting the pieces –(tcl/tk8.0), otcl, tclcl, ns-2, (and nam-1) –‘subscribe ns-users’ in body

25 Hello World - Interactive Mode swallow 71% ns % set ns [new Simulator] _o3 % $ns at 1 “puts \“Hello World!\”” 1 % $ns at 1.5 “exit” 2 % $ns run Hello World! swallow 72%

26 Hello World - Passive Mode simple.tcl set ns [new Simulator] $ns at 1 “puts \“Hello World!\”” $ns at 1.5 “exit” $ns run swallow 74% ns simple.tcl Hello World! swallow 75%

27 Outline: This Morning Introduction –the project, the software, the philosophy –software architecture –installation and getting started tcl/otcl/ns-2 fundamentals –programming tcl/otcl –programming ns-2 simulation scripts Example scripts –TCP, web traffic, RED, multicast, wireless

28 Fundamentals tcl otcl –ftp://ftp.tns.lcs.mit.edu/pub/otcl/doc/tutorial.html ns-2 – – –

29 Basic tcl proc test {} { set a 43 set b 27 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

30 Basic otcl Class mom mom instproc init {age} { $self instvar age_ set age_ $age } 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 a [new mom 45] set b [new kid 15] $a greet $b greet

31 Basic ns-2 Creating the event scheduler [Tracing] Creating network Computing routes Creating connection Creating traffic Inserting errors

32 Creating Event Scheduler Create scheduler –set ns [new Simulator] Schedule event –$ns at – : any legitimate ns/tcl commands Start scheduler –$ns run

33 Tracing Trace packets on all links –$ns trace-all [open test.out w] cbr cbr r cbr Trace packets on all links in nam-1 format –$ns namtrace-all [open test.nam w] Right after ‘set ns [new Simulator]’

34 Creating Network Nodes –set n0 [$ns node] –set n1 [$ns node] Links & Queuing –$ns duplex-link $n0 $n1 – : DropTail, RED, CBQ, FQ, SFQ, DRR

35 Tracing Specific links $ns trace-queue $n0 $n1 $ns namtrace-queue $n0 $n1

36 Creating Network: LAN LAN –$ns make-lan – : LL – : Queue/DropTail, – : MAC/802_3 – : Channel

37 Computing routes Unicast –$ns rtproto – : Static, Session, DV, cost, multi-path

38 Creating Connection: UDP UDP –set udp [new Agent/UDP] –set null [new Agent/NULL] –$ns attach-agent $n0 $udp –$ns attach-agent $n1 $null –$ns connect $udp $null

39 Creating Connection: TCP TCP –set tcp [new Agent/TCP] –set tcpsink [new Agent/TCPSink] –$ns attach-agent $n0 $tcp –$ns attach-agent $n1 $tcpsink –$ns connect $tcp $tcpsink

40 Creating Traffic: On Top of TCP FTP –set ftp [new Application/FTP] –$ftp attach-agent $tcp –$ns at “$ftp start” Telnet –set telnet [new Application/Telnet] –$telnet attach-agent $tcp

41 Creating Traffic: On Top of UDP CBR –set src [new Application/Traffic/CBR] Exponential or Pareto on-off –set src [new Application/Traffic/Exponential] –set src [new Application/Traffic/Pareto]

42 Creating Traffic: Trace Driven Trace driven –set tfile [new Tracefile] –$tfile filename –set src [new Application/Traffic/Trace] –$src attach-tracefile $tfile : –Binary format –inter-packet time (msec) and packet size (byte)

43 Inserting Errors Creating Error Module –set loss_module [new ErrorModel] –$loss_module set rate_ 0.01 –$loss_module unit pkt –$loss_module ranvar [new RandomVariable/Uniform] –$loss_module drop-target [new Agent/Null] Inserting Error Module –$ns lossmodel $loss_module $n0 $n1

44 Network Dynamics Link failures –route changes reflected automatically –can emulate node failure

45 Four Models $ns rtmodel-at $n0 $n1 $ns rtmodel Trace $n0 $n1 $ns rtmodel $n0 $n1 : Deterministic, Exponential : [ ] [ ]

46 Outlines Essentials Getting Started Fundamental tcl, otcl and ns-2 Case Studies - TCP, web traffic, RED

47 Case Studies TCP (tcp.tcl) Web (web.tcl & dumbbell.tcl) Queuing - RED (red.tcl)

48 Visualization Tools nam-1 (Network AniMator Version 1) xgraph

49 Basic ns-2: Special Topics multicast support application-level support wireless support

50 Multicast - 5 components enable multicast capability configure multicast routing create a multicast group/sender create a multicast receiver attach traffic source

51 Enabling multicast capability set ns [new Simulator -multicast on] or $ns multicast (right after [new Simulator])

52 Configuring multicast routing $ns mrtproto : CtrMcast, DM, ST, BST

53 Creating a multicast group set udp [new Agent/UDP] $ns attach-agent $n0 $udp set group [Node allocaddr] $udp set dst_addr_ $group

54 Creating a multicast receiver set rcvr [new Agent/NULL] $ns attach-agent $n1 $rcvr $ns at “$n1 join-group $rcvr $group”

55 Attaching a traffic source set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $ns at “$cbr start”

56 Application - 2 components two-way TCP Application/TcpApp

57 Application: Two-way TCP FullTcp connection –set tcp1 [new Agent/TCP/FullTcp] –set tcp2 [new Agent/TCP/FullTcp] –$ns attach-agent $n1 $tcp1 –$ns attach-agent $n2 $tcp2 –$ns connect $tcp1 $tcp2 –$tcp2 listen

58 Application: TcpApp User data transfer –set app1 [new Application/TcpApp $tcp1] –set app2 [new Application/TcpApp $tcp2] –$app1 connect $app2 –$ns at 1.0 “$app1 send \” \”” – : will be executed when received at the receiver TcpApp

59 Wireless - 5 components setup node configuration –layer 3-2, layer 1, tracing, energy node coordinates node movements nam tracing

60 Setup set ns [new Simulator] set topo [new Topography] $topo load_flatgrid

61 Node Configuration: Layer 3-2 $ns node-config –adhocRouting –llType LL –ifqType Queue/DropTail/PriQueue –ifqLen –macType Mac/802_11 : DSDV, DSR, TORA, AODV

62 Node Configuring: Layer 1 $ns node-config –phyType Phy/WirelessPhy –antType Antenna/OmniAntenna –propType –channelType Channel/WirelessChannel –topoInstance $topo : Propagation/TwoRayGround, Propagation/FrissSpaceAttenuation

63 Node Configuration: Tracing $ns node-config –agentTrace –routerTrace –macTrace

64 Node Configuration: Energy $ns node-config –energyModel EnergyModel –initialEnergy –txPower –rxPower

65 Creating Nodes set mnode [$ns node]

66 Node Coordinates $mnode set X_ $mnode set Y_ $mnode set Z_ 0

67 Node Movement Disable random motion –$mnode random-motion 0 Specified –$ns at 1.0 “$mnode setdest ” Random –$ns at 1.0 “$mnode start”

68 Tracing at the beginning –$ns namtrace-all-wireless [open test.nam w] initialize nodes –$ns initial_node_position $mnode 20 at the end –$ns at “$ns nam-end-wireless ”

69 Case Studies multicast (mcast.tcl) wireless (wireless-udp.tcl, wireless-tcp.tcl)

70 Basic ns-2: Not Covered mobile IP satellite DiffServ emulation

71 Lab Exercises Bookmark – tutorial/ftw-tutorial.html Setup –work under these 1/ 2/,...20/ –exec nam -a out.nam