1_Intro_ns2 - Introduction to ns2 Network Simulation and...

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

View Full Document Right Arrow Icon
Introduction to ns2 Network Simulation and Simulator Internals 潘潘潘 jypan@comm.ccu.edu.tw Modified from Su Wen’s ns2 ppt  suwen@dcs.uky.edu haldar@isi.edu
Background image of page 1

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

View Full DocumentRight Arrow Icon
The Network Simulator - ns-2 http://www.isi.edu/nsnam/ns/ The source code and documentation is currently maintained by VINT project at ISI http://nsnam.isi.edu/nsnam/index.php/Main_Page Sept 3, 2007: ns-2.32 released. Mar 10, 2007: ns-2.31 released. July 2, 2006: ns-3 project announced. NS2 is a discrete event simulator targeted at networking research NS2 is an object oriented simulator, written in C++, with an OTcl interpreter as a frontend 潘潘 : ns2 潘潘
Background image of page 2
ns-2 Overview Collection of various protocols at multiple layers TCP(reno, tahoe, vegas, sack) MAC(802.11, 802.3, TDMA) Ad-hoc Routing (DSDV, DSR, AODV, TORA) Sensor Network (diffusion, gaf) Multicast protocols, Satellite protocols, and many others Codes are contributed from multiple research communities Good: Large set of simulation modules Bad: Level of support and documentation varies The source code and documentation is currently maintained by VINT project at ISI
Background image of page 3

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

View Full DocumentRight Arrow Icon
Documentation introductory: Marc Greis's tutorial reference: Ns Manual (formerly called "ns Notes and Documentation") ns by Example Practical Programming in Tcl and Tk ( http://www.beedub.com/book/ ) http://hpds.ee.ncku.edu.tw/~smallko/ns2/ns2.h
Background image of page 4
Current Status ns-2 (2.1b6) Simulator Core 100K lines of C++ 70K lines of OTcl 30K lines of test suite 20K lines of documentation Other Components Tcl/TK 8.x, OTcl, TclCL, nam-1 Tcl-debug, GT-ITM, xgraph, …
Background image of page 5

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

View Full DocumentRight Arrow Icon
ns Directory Structure TK8.0 OTcl tclcl Tcl8.0 ns-2 nam-1 tcl ex test lib ... ... examples validation tests C++ code OTcl code ns-allinone mcast simple.tcl
Background image of page 6
Running simulations with ns Compile the simulator core (“ns”) Write a simulation script in Otcl e.g. my-test.tcl Running the simulator e.g. ns my-test.tcl
Background image of page 7

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

View Full DocumentRight Arrow Icon
Hello World simple.tcl set sim [new Simulator] $sim at 1 “puts \“Hello World!\”” $sim at 1.5 “exit” $sim run arches 74% ns simple.tcl Hello World! arches 75%
Background image of page 8
Discrete Event Simulation Model world as events Simulator has list of events Process: take next one, run it, until done Each event happens in an instant of virtual (simulated) time , but takes an arbitrary amount of real time Ns uses simple model: single thread of control => no locking or race conditions to worry about (very easy)
Background image of page 9

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

View Full DocumentRight Arrow Icon
Discrete Event Examples Consider two nodes on an Ethernet: A B simple queuing model: t=1, A enqueues pkt on LAN t=1.01, LAN dequeues pkt and triggers B detailed CSMA/CD model: t=1.0: A sends pkt to NIC A’s NIC starts carrier sense t=1.005: A’s NIC concludes cs, starts tx t=1.006: B’s NIC begins reciving pkt t=1.01: B’s NIC concludes pkt B’s NIC passes pkt to app
Background image of page 10
ns-2 Environment Simulation  Scenario Tcl Script C++ Implementation
Background image of page 11

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

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

Page1 / 54

1_Intro_ns2 - Introduction to ns2 Network Simulation and...

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

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