10-04-2017, 09:10 PM
Introduction to ns2
[attachment=16901]
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
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,
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
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)