UsersGuide: example1.tcl

File example1.tcl, 411 bytes (added by Ted Faber, 10 years ago)

Simple star topology

Line 
1source tb_compat.tcl
2set ns [new Simulator]
3
4# Create the center node (named by its variable name)
5set center [$ns node]
6
7# Connect 9 satellites
8for { set i 0} { $i < 9 } { incr i} {
9    # Create node n-1 (tcl n($i) becomes n-$i in the experiment)
10    set n($i) [$ns node]
11    # Connect center to $n($i)
12    ns duplex-link $center $n($i) 100Mb 10ms DropTail
13}
14
15# Creation boilerplate
16$ns rtptoto Static
17$ns run