NS2-tutorial - CDA6530: Performance Models of Computers and...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CDA6530: Performance Models of Computers and Networks Chapter 10: Introduction to Network Simulator (NS2) Some Contents are from…. USC ISI Network Simulator (ns) Tutorial 2002 http://www.isi.edu/nsnam/ns/ns-tutorial/tutorial-02/index.html Prof. Samir R. Das in Sonysb “CSE 590” www.cs.sunysb.edu/~samir/cse590/ns2-lecture.ppt Tcl/TK Tutorial www.umiacs.umd.edu/~hollingk/talks/tcl_tutorial.ppt http://www-scf.usc.edu/~bhuang www.isi.edu/nsnam/ ns / ns- tutorial / wireless .ppt Marc Greis' Tutorial for the UCB/LBNL/VINT Network Simulator "ns“ http://www.isi.edu/nsnam/ns/tutorial/index.html http://www.winlab.rutgers.edu/~zhibinwu/html/network_s imulator_2.html 2 Where to Run NS2 Our department unix server - eustis.eecs.ucf.edu has installed ns2 First, you need to change default configuration Modify the hidden file .profile under home directory Add the following configuration Run ns2: [email protected]:~$ ns Unix Based. Runs also in windows using cygwin Quit complicated to install in Windows Windows installation and usage not introduced here 3 export PATH=$PATH:/usr/local/ns2/bin:/usr/local/ns2/tcl8.4.18/unix:/usr/local/ns2/tk8.4.18/unix export LD_LIBRARY_PATH=/usr/local/ns2/otcl-1.13:/usr/local/ns2/lib export TCL_LIBRARY=/usr/local/ns2/tcl8.4.18/library ns2- Network Simulator One of the most popular simulator among networking researchers Open source, free Discrete event, Packet level simulator Events like ‘received an ack packet’, ‘enqueued a data packet’ Network protocol stack written in C++ Tcl (Tool Command Language) used for specifying scenarios and events. Simulates both wired and wireless networks. 4 Goal of this tutorial Understand how to write Tcl scripts to simulate simple network topologies and traffic patterns. Analyze the trace files and understand how to evaluate the performance of networking protocols and operations. 5 “Ns” Components Ns, the simulator itself Nam, the network animator Visualize ns (or other) output Nam editor: GUI interface to generate ns scripts Since we only run ns2 in remote Unix server, we will not introduce Nam usage in this class Pre-processing: Traffic and topology generators Post-processing: Simple trace analysis, often in Awk, Perl, or Tcl You can also use grep (under linux), or C/java 6 C++ and OTcl Separation “data” / control separation C++ for “data”: per packet processing, core of ns fast to run, detailed, complete control OTcl for control: Simulation scenario configurations Periodic or triggered action Manipulating existing C++ objects fast to write and change 7 Basic Tcl 8 variables: set x 10 set z x+10 # string ‘x+10’ to z set y [expr $x+10] puts “x is $x” functions and expressions: set y [expr pow($x, 2)] control flow: if {$x > 0} { return $x } else { return [expr -$x] } while { $x > 0 } {...
View Full Document

This note was uploaded on 01/14/2012 for the course CDA 6530 taught by Professor Zou during the Fall '11 term at University of Central Florida.

Page1 / 64

NS2-tutorial - CDA6530: Performance Models of Computers and...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online