UsersGuide: example2.tcl

File example2.tcl, 411 bytes (added by Ted Faber, 7 years ago)

Example with 7 satellites

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 7 satellites
8for { set i 0} { $i < 7 } { 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