Courseinfo

Only available on StudyMode
  • Download(s) : 14
  • Published : March 19, 2013
Open Document
Text Preview
The ns Manual (formerly ns Notes and Documentation)1
The VINT Project A Collaboration between researchers at UC Berkeley, LBL, USC/ISI, and Xerox PARC. Kevin Fall kfall@ee.lbl.gov , Editor Kannan Varadhan kannan@catarina.usc.edu , Editor

November 4, 2011

ns c is LBNL’s Network Simulator [24]. The simulator is written in C++; it uses OTcl as a command and configuration interface. ns v2 has three substantial changes from ns v1: (1) the more complex objects in ns v1 have been decomposed into simpler components for greater flexibility and composability; (2) the configuration interface is now OTcl, an object oriented version of Tcl; and (3) the interface code to the OTcl interpreter is separate from the main simulator. Ns documentation is available in html, Postscript, and PDF formats. See http://www.isi.edu/nsnam/ns/ns-documentation. html for pointers to these.

1 The VINT project is a joint effort by people from UC Berkeley, USC/ISI, LBL, and Xerox PARC. The project is supported by the Defense Advanced Research Projects Agency (DARPA) at LBL under DARPA grant DABT63-96-C-0105, at USC/ISI under DARPA grant ABT63-96-C-0054, at Xerox PARC under DARPA grant DABT63-96-C-0105. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the DARPA.

Contents
1 2 Introduction Undocumented Facilities 12 16

I
3

Interface to the Interpreter
OTcl Linkage 3.1 Concept Overview . . . . . . . . . . . . . . . . . . . . 3.2 Code Overview . . . . . . . . . . . . . . . . . . . . . . 3.3 Class Tcl . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 Obtain a Reference to the class Tcl instance . . . 3.3.2 Invoking OTcl Procedures . . . . . . . . . . . . 3.3.3 Passing Results to/from the Interpreter . . . . . . 3.3.4 Error Reporting and Exit . . . . . . . . . . . . . 3.3.5 Hash Functions within the Interpreter . . . . . . 3.3.6 Other Operations on the Interpreter . . . . . . . 3.4 Class TclObject . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Creating and Destroying TclObjects . . . . . . . 3.4.2 Variable Bindings . . . . . . . . . . . . . . . . . 3.4.3 Variable Tracing . . . . . . . . . . . . . . . . . 3.4.4 commandMethods: Definition and Invocation . 3.5 Class TclClass . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 How to Bind Static C++ Class Member Variables 3.6 Class TclCommand . . . . . . . . . . . . . . . . . . . . 3.7 Class EmbeddedTcl . . . . . . . . . . . . . . . . . . . . 3.8 Class InstVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18
19 19 20 20 21 21 21 22 22 23 23 24 25 27 28 30 31 33 34 35

II
4

Simulator Basics
The Class Simulator 4.1 Simulator Initialization . . . . . . . . . . . . . . . 4.2 Schedulers and Events . . . . . . . . . . . . . . . 4.2.1 The List Scheduler . . . . . . . . . . . . . 4.2.2 the heap scheduler . . . . . . . . . . . . . 4.2.3 The...
tracking img