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
Chapter 1IntroductionLet’s start <strong>at</strong> the very beginning,a very nice place to start,when you sing, you begin with A, B, C,when you simul<strong>at</strong>e, you begin with the topology, 1. . .This document (<strong>ns</strong> <strong>Notes</strong> <strong>and</strong> <strong>Document<strong>at</strong>ion</strong>) provides reference document<strong>at</strong>ion for <strong>ns</strong>. Although we begin with a simplesimul<strong>at</strong>ion script, resources like Marc Greis’s tutorial web pages (originally <strong>at</strong> his web site, now <strong>at</strong> http://www.isi.edu/<strong>ns</strong>nam/<strong>ns</strong>/tutorial/) or the slides from one of the <strong>ns</strong> tutorials are problably better places to begin for the <strong>ns</strong>novice.We first begin by showing a simple simul<strong>at</strong>ion script. This script is also available in the sources in ~<strong>ns</strong>/tcl/ex/simple.tcl.This script defines a simple topology of four nodes, <strong>and</strong> two agents, a UDP agent with a CBR traffic gener<strong>at</strong>or, <strong>and</strong> a TCPagent. <strong>The</strong> simul<strong>at</strong>ion ru<strong>ns</strong> for 3s. <strong>The</strong> output is two trace files, out.tr <strong>and</strong> out.nam. When the simul<strong>at</strong>ion completes <strong>at</strong>the end of 3s, it will <strong>at</strong>tempt to run a nam visualis<strong>at</strong>ion of the simul<strong>at</strong>ion on your screen.# <strong>The</strong> preambleset <strong>ns</strong> [new Simul<strong>at</strong>or];# initialise the simul<strong>at</strong>ion# Predefine tracingset f [open out.tr w]$<strong>ns</strong> trace-all $fset nf [open out.nam w]$<strong>ns</strong> namtrace-all $nf1 with apologies to Rodgers <strong>and</strong> Hammerstein12