TopdlLibrary: ten.tcl

File ten.tcl, 412 bytes (added by faber, 12 years ago)

ns2 description of a 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 10 satellites
8for { set i 0} { $i < 10 } { 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 0ms DropTail
13}
14
15# Creation boilerplate
16$ns rtptoto Static
17$ns run