loop.ns 414 Bytes
Newer Older
1 2 3 4 5
# This is a simple ns script that demonstrates loops.
set ns [new Simulator]                  
source tb_compat.tcl

set maxnodes 3
6
set lanstr ""
7 8 9

for {set i 1} {$i <= $maxnodes} {incr i} {
    set node($i) [$ns node]
Timothy Stack's avatar
Timothy Stack committed
10
    append lanstr "$node($i) "
11
    tb-set-node-os $node($i) FBSD-STD
12 13
}

14 15
# Put all the nodes in a lan
set big-lan [$ns make-lan "$lanstr" 100Mb 0ms]
16 17 18

# Go!
$ns run