ts20.tcl
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- # Generated by sgb2ns, created by Polly Huang
- # GRAPH (#nodes #edges id uu vv ww xx yy zz):
- # 20 44 transtub(0,3,0,0,{1,40,3,0.500,1.000,0.000},{2,20,3,0.600,1.000,0.000},{3,30,3,0.420,1.000,0.000}) 40 1 3 0
- proc create-topology {nsns node linkBW} {
- upvar $node n
- upvar $nsns ns
- set verbose 1
- if {$verbose} {
- puts "creating nodes..."
- }
- for {set i 0} {$i < 20} {incr i} {
- set n($i) [$ns node]
- }
- # EDGES (from-node to-node length a b):
- if {$verbose} {
- puts -nonewline "Creating links 0..."
- flush stdout
- }
- $ns duplex-link-of-interfaces $n(0) $n(12) $linkBW 230ms DropTail
- $ns duplex-link-of-interfaces $n(0) $n(9) $linkBW 160ms DropTail
- $ns duplex-link-of-interfaces $n(0) $n(7) $linkBW 60ms DropTail
- $ns duplex-link-of-interfaces $n(0) $n(2) $linkBW 200ms DropTail
- $ns duplex-link-of-interfaces $n(0) $n(1) $linkBW 180ms DropTail
- $ns duplex-link-of-interfaces $n(1) $n(15) $linkBW 60ms DropTail
- $ns duplex-link-of-interfaces $n(1) $n(14) $linkBW 120ms DropTail
- $ns duplex-link-of-interfaces $n(2) $n(3) $linkBW 100ms DropTail
- $ns duplex-link-of-interfaces $n(2) $n(4) $linkBW 140ms DropTail
- $ns duplex-link-of-interfaces $n(3) $n(5) $linkBW 150ms DropTail
- if {$verbose} { puts -nonewline "10..."; flush stdout }
- $ns duplex-link-of-interfaces $n(4) $n(5) $linkBW 30ms DropTail
- $ns duplex-link-of-interfaces $n(5) $n(6) $linkBW 220ms DropTail
- $ns duplex-link-of-interfaces $n(8) $n(9) $linkBW 40ms DropTail
- $ns duplex-link-of-interfaces $n(8) $n(10) $linkBW 260ms DropTail
- $ns duplex-link-of-interfaces $n(11) $n(12) $linkBW 270ms DropTail
- $ns duplex-link-of-interfaces $n(11) $n(13) $linkBW 70ms DropTail
- $ns duplex-link-of-interfaces $n(12) $n(13) $linkBW 230ms DropTail
- $ns duplex-link-of-interfaces $n(15) $n(17) $linkBW 90ms DropTail
- $ns duplex-link-of-interfaces $n(15) $n(19) $linkBW 280ms DropTail
- $ns duplex-link-of-interfaces $n(16) $n(18) $linkBW 160ms DropTail
- if {$verbose} { puts -nonewline "20..."; flush stdout }
- $ns duplex-link-of-interfaces $n(17) $n(18) $linkBW 140ms DropTail
- $ns duplex-link-of-interfaces $n(18) $n(19) $linkBW 160ms DropTail
- if {$verbose} {
- puts -nonewline "22..."
- flush stdout
- puts "starting"
- }
- return 20}