//
archives

basic

This category contains 8 posts

Trace Analysis Utilities

Here is a collection of trace analysis utilities that have been useful: Much parsing is easy if you can extract columns. Here is a helper-perl utility called “column” that breaks a text output into columns, separated by whitespace. It is used by many of the scripts below. Here is a simple perl called stats.pl script … Continue reading

Trace Analysis Example

This section shows a trace analysis example. Example 4 is the same OTcl script as the one in the “Simple Simulation Example” section with a few lines added to open a trace file and write traces to it. For the network topology it generates and the simulation scenario, refer to Figure 4 in the “Simple … Continue reading

Packet

A NS packet is composed of a stack of headers, and an optional data space (see Figure 12). As briefly mentioned in the “Simple Simulation Example” section, a packet header format is initialized when a Simulator object is created, where a stack of all registered (or possibly useable) headers, such as the common header that … Continue reading

Network Components

This section talks about the NS components, mostly compound network components. Figure 6 shows a partial OTcl class hierarchy of NS, which will help understanding the basic network components. For a complete NS class hierarchy, visit http://www-sop.inria.fr/rodeo/personnel/Antoine.Clerget/ns. Figure 6. Class Hierarchy (Partial) The root of the hierarchy is the TclObject class that is the superclass … Continue reading

Event Scheduler

This section talks about the discrete event schedulers of NS. As described in the Overview section, the main users of an event scheduler are network components that simulate packet-handling delay or that need timers. Figure 5 shows each network object using an event scheduler. Note that a network object that issues an event is the … Continue reading

Simple Simulation Example

This section shows a simple NS simulation script and explains what each line does. Example 3 is an OTcl script that creates the simple network configuration and runs the simulation scenario in Figure 4. To run this simulation, download “ns-simple.tcl” and type “ns ns-simple.tcl” at your shell prompt. Figure 4. A Simple Network Topology and … Continue reading

OTcl: The User Language

As mentioned in the overview section, NS is basically an OTcl interpreter with network simulation object libraries. It is very useful to know how to program in OTcl to use NS. This section shows an example Tcl and OTcl script, from which one can get the basic idea of programming in OTcl. These examples are … Continue reading

What is ns-2?

NS is an event driven network simulator developed at UC Berkeley that simulates variety of IP networks. It implements network protocols such as TCP and UPD, traffic source behavior such as FTP, Telnet, Web, CBR and VBR, router queue management mechanism such as Drop Tail, RED and CBQ, routing algorithms such as Dijkstra, and more. … Continue reading