Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Attachment / Tutorial / Basic.Ns

Basic.Ns

Plain Text icon — Plain Text, 1 KB

File contents

# This is a simple ns script. Comments start with #.
set ns [new Simulator]                  
source tb_compat.tcl

set nodeA [$ns node]
set nodeB [$ns node]
set nodeC [$ns node]
set nodeD [$ns node]

set link0 [$ns duplex-link $nodeB $nodeA 30Mb 50ms DropTail]
tb-set-link-loss $link0 0.01

set lan0 [$ns make-lan "$nodeD $nodeC $nodeB " 100Mb 0ms]

# Set the OS on a couple.
tb-set-node-os $nodeA FBSD-STD
tb-set-node-os $nodeC RHL-STD         

$ns rtproto Static

# Go!
$ns run