Introduction to ns-2

Michele Weigle
Department of Computer Science

Getting Started Scripts References Unix Tools Examples Source Code

Getting Started

Creating Simulation Scripts

Scripts to drive your simulations are written in OTcl.

Building Blocks

Simulation Script Outline

References and Tutorials



Helpful Unix Tools

(use man for more information on these tools)


Source Code Basics

In order to be effective at writing good simulation experiments with ns-2, you need to be familar with how ns-2 is written. The source code is a mix of C++ and OTcl (Object-oriented TCL - "oh tickle").

Important TCP Source Files and Directories

Modifying Source Code

Many variables are shared between C++ and OTcl, so when adding new variables, you may also need to add them to the OTcl side. The best source for learning about ns-2 is its own source code. Use things that are already implemented as examples for adding your own code.
Michele C. Weigle