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 ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

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

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!