UsersGuide: example6.tcl

File example6.tcl, 504 bytes (added by Ted Faber, 12 years ago)

Packing example

Line 
1source tb_compat.tcl
2set ns [new Simulator]
3
4set center [$ns node]
5tb-add-node-attribute $center "containers:PartitionPass" 0
6
7
8for { set i 0} { $i < 3 } { incr i} {
9    set lanlist $center
10    for { set j 0 } { $j < 20} { incr j } {
11        set idx [expr $i * 20 + $j]
12        set n($idx) [$ns node]
13        tb-add-node-attribute $n($idx) "containers:PartitionPass" [expr $i + 1]
14        lappend lanlist $n($idx)
15    }
16    set lan($i) [$ns make-lan [join $lanlist " "] 100Mb 0]
17}
18
19# Creation boilerplate
20$ns rtptoto Static
21$ns run