[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] ns-random



Ok, I've checked the archives, but nothng that applies _directly_ to this. I
run the following script, and the output is identical regardless of the
random seed used.

What am I doing wrong?

###################################
ns-random 23

set ns [new Simulator] ;
set f [open out.tr w]
$ns trace-all $f
Trace set show_tcphdr_ 1
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

$ns duplex-link $n0 $n2 5M 2ms DropTail
$ns duplex-link $n1 $n2 5M 2ms DropTail
$ns duplex-link $n2 $n3 1.5M 10ms DropTail

set udp0 [new Agent/UDP] ;
$ns attach-agent $n0 $udp0 ;
set cbr0 [new Application/Traffic/CBR] ;
$cbr0 attach-agent $udp0 ;
$udp0 set class_ 0 ;

set null0 [new Agent/Null] ;
$ns attach-agent $n3 $null0 ;
$ns connect $udp0 $null0
$ns at 1.0 "$cbr0 start"
puts [$cbr0 set packetSize_]
puts [$cbr0 set interval_]

set tcp [new Agent/TCP/FullTcp]
$ns attach-agent $n1 $tcp
set sink [new Agent/TCP/FullTcp]
$ns attach-agent $n3 $sink
set ftp [new Application/FTP] ;
$ftp attach-agent $tcp

$ns at 1.2 "$ftp start"
$ns connect $tcp $sink
$ns at 1.35 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"
$tcp set fid_ 0
$sink set fid_ 0
$sink listen ;
$tcp set window_ 100;
$tcp set segsize_ 1500

$ns at 3.0 "finish"
proc finish {} {
global ns f 
$ns flush-trace
close $f


exit 0
}

$ns run