The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
X Other 40347 Educational use of NS and NAM 40447.1 Using NS for educational purposes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.1.1 Installing/building/running ns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.1.2 The educational scripts’ inventory page: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.2 Using NAM for educational purposes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40511
Chapter 1IntroductionLet’s start at the very beginning,a very nice place to start,when you sing, you begin with A, B, C,when you simulate, you begin with the topology, 1. . .This document (ns Notes and Documentation) provides reference documentation for ns. Although we begin with a simplesimulation script, resources like Marc Greis’s tutorial web pages (originally at his web site, now at http://www.isi.edu/nsnam/ns/tutorial/) or the slides from one of the ns tutorials are problably better places to begin for the nsnovice.We first begin by showing a simple simulation script. This script is also available in the sources in ~ns/tcl/ex/simple.tcl.This script defines a simple topology of four nodes, and two agents, a UDP agent with a CBR traffic generator, and a TCPagent. The simulation runs for 3s. The output is two trace files, out.tr and out.nam. When the simulation completes atthe end of 3s, it will attempt to run a nam visualisation of the simulation on your screen.# The preambleset ns [new Simulator];# initialise the simulation# Predefine tracingset f [open out.tr w]$ns trace-all $fset nf [open out.nam w]$ns namtrace-all $nf1 with apologies to Rodgers and Hammerstein12
- Page 6 and 7: 18 Radio Propagation Models 17718.1
- Page 8 and 9: 30 Multicast Routing 25130.1 Multic
- Page 10 and 11: 38.2.5 An example . . . . . . . . .
- Page 14: # so, we lied. now, we define the t
- Page 17 and 18: Chapter 2Undocumented FacilitiesNs
- Page 19 and 20: Part IInterface to the Interpreter1
- Page 21 and 22: • if you can do what you want by
- Page 23 and 24: • tcl.result(const char* s)Pass t
- Page 25 and 26: By convention in ns, the class Agen
- Page 27 and 28: $object set bwvar 1500kb$object set
- Page 29 and 30: For a C++ variable to be traceable,
- Page 31 and 32: 3.5 Class TclClassThis compiled cla
- Page 33 and 34: class Packet {......static int hdrl
- Page 35 and 36: The actual arguments passed by the
- Page 37 and 38: class TclClass (Section 3.5) define
- Page 39 and 40: Chapter 4The Class SimulatorThe ove
- Page 41 and 42: 4.2.2 the heap schedulerThe heap sc
- Page 43 and 44: 4.4 Commands at a glanceSynopsis:ns
- Page 45 and 46: $ns_ dumpqCommand for dumping event
- Page 47 and 48: NODEPortClassifierAgentAgentAddrCla
- Page 49 and 50: The Node instance variable, entry_,
- Page 51 and 52: The default values for all the abov
- Page 53 and 54: The classify() method is pure virtu
- Page 55 and 56: };The class imposes no direct seman
- Page 57 and 58: flow-specific queuing disciplines a
- Page 59 and 60: 5.5 Routing Module and Classifier O
- Page 61 and 62: Module NameRtModule/BaseRtModule/Mc
X Other 40347 Educ<strong>at</strong>ional use of NS <strong>and</strong> NAM 40447.1 Using NS for educ<strong>at</strong>ional purposes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.1.1 I<strong>ns</strong>talling/building/running <strong>ns</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.1.2 <strong>The</strong> educ<strong>at</strong>ional scripts’ inventory page: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40447.2 Using NAM for educ<strong>at</strong>ional purposes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40511