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

Re: [ns] ns halting with no error information



What is the stop time you set in your simulation? Probably, you can post
your script, so that people can have a clear idea of what happened.

-chen xuan
----------

I'm not sure it will help since the script is fairly long, but I'll give it a 
try. The script is attached below. The stop time I set was 150 seconds. 

In the script, GTACK users (tacks,tackh,tackd) are a custom made protocol. I 
don't think the problem's in my code. I've had a similar problem before and 
tracked it down to regular ns code.

Thanks,

Julian

----------
#Creation of a large scale simulation, with 100 users on a wireless downlink
#with the wireline link connecting the router to the base station.

set ns [new Simulator]

set tracenam 0
set traceW 0
set delta 0.35
set mp 392
set df 1
set pf0 0.01
set pf1 0.01
set pr0 0.0
set pr1 0.0
set seed 124817
#set seed 123787
set totalTime 150.0
set HopDelayMax 0.08

ns-random $seed

$ns color 0 blue
$ns color 1 red
$ns color 2 orange
$ns color 3 yellow
$ns color 4 green
$ns color 5 purple
$ns color 6 black
$ns color 7 grey

if $tracenam { 
    #Open the nam trace file
    set nf [open out.nam w]
    $ns namtrace-all $nf
}

if $traceW {
    #Open the xgraph output files
}

proc finish {} {
    global ns nf tracenam traceW
    if $tracenam {
	$ns flush-trace
	#Close the trace file
	close $nf
	#Execute nam on the trace file
        exec nam out.nam &
    }
    if $traceW {
	#graphical output and closing of files
    }
    exit 0
}

proc setup {node} {
    global delta totalTime
    global mp
    $node set delta_ $delta
    $node set kappa1_ 4.0
    $node set l1_ 0.5
    $node set l2_ 0.1
    $node set l3_ 0.0
    $node set l4_ 0.66
    $node set rtx_to_mult_ 2.0
    $node set rho_ 1.0
    $node set chi_ 0.1
    $node set eta_ 0.8
    $node set eta2_ 0.5
    $node set epsilon_ 1.1
    $node set skips_ 2
    $node set wmax_proc_mult_ 0.5;
    $node set ttlTime_ $totalTime
    $node set nfast_ 10
    $node set ssipw_ 10.0
    $node set eff_init_ 0.8
    $node set alpha1_ 0.75 ; #/|\window>alpha1*eta*/|\goodput?/|\:\|/
    $node set alpha2_ -1
    $node set alpha3_ -1 ; #\|/window<alpha3*eta*\|/goodput?/|\:\|/
    $node set alpha4_ -1.0	
    $node set alpha5_ 0.1
    $node set alpha6_ 1
    $node set alpha7_ -0.1
    $node set alpha8_ 3.0
    $node set alpha9_ 0.05	
    $node set alpha10_ 1.0
    $node set alpha11_ 4	
    $node set maxpkts_ $mp
    $node set Window_ 0
}

proc setup2 {node} {
    global totalTime
    $node set ttlTime_ $totalTime
}

proc setup3 {node} {
    global HopDelayMax
    $node set overhead_ $HopDelayMax
    $node set packetSize_ 1000
}

#Create 104 users: 210 nodes

#source nodes

for {set i 0} {$i < 104} {incr i} {
    set s($i) [$ns node]
}

#destination nodes

for {set i 0} {$i < 104} {incr i} {
    set d($i) [$ns node]
}

#hop nodes to reduce phase effects

for {set i 0} {$i < 104} {incr i} {
    set h($i) [$ns node]
}

#Router node

set r [$ns node]

#Base station

set bs [$ns node]

#Connections. 52 TCP users, 52 GTACK Users: 13 each of 0.5, 0.75, 1.0, 1.25 s
#round-trip time delay

for {set i 0} {$i < 104} {incr i} {
    $ns simplex-link $s($i) $r 125kB 0.1 DropTail
}

$ns simplex-link $r $bs 1.25MB 0.1 DropTail

for {set i 0} {$i < 104} {incr i} {
    $ns simplex-link $bs $h($i) 12.5kB 0.1 DropTail
}

for {set i 0} {$i < 104} {incr i} {
    $ns simplex-link $h($i) $d($i) 12.5kB 0.1 DropTail
}

for {set i 0} {$i < 13} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.1 DropTail
}

for {set i 52} {$i < 65} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.1 DropTail
}

for {set i 13} {$i < 26} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.35 DropTail
}

for {set i 65} {$i < 78} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.35 DropTail
}

for {set i 26} {$i < 39} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.6 DropTail
}

for {set i 78} {$i < 91} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.6 DropTail
}

for {set i 39} {$i < 52} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.85 DropTail
}

for {set i 91} {$i < 104} {incr i} {
    $ns simplex-link $d($i) $s($i) 12.5kB 0.85 DropTail
}

#setup buffers

set bufferR [[$ns link $r $bs] queue]
$bufferR set limit_ 50
$bufferR set drop_front_ $df

for {set i 0} {$i < 104} {incr i} {
    set bufferbs($i) [[$ns link $bs $h($i)] queue]
    $bufferbs($i) set limit_ 5
    $bufferbs($i) set drop_front_ $df
}

for {set i 0} {$i < 104} {incr i} {
    set Q($i) [[$ns link $s($i) $r] queue]
    $Q($i) set limit_ 100
}

#setup sources

for {set i 0} {$i < 52} {incr i} {
    set tacks($i) [new Agent/TackSend]
    $ns attach-agent $s($i) $tacks($i)
    setup $tacks($i)
    $tacks($i) set rtt_ [expr 0.5 + $i / 13 * 0.25]
    $tacks($i) set fid_ 0
}

for {set i 52} {$i < 104} {incr i} {
    set tcps($i) [new Agent/TCP/FullTcp]
    $ns attach-agent $s($i) $tcps($i)
    $tcps($i) set segsize_ 960
    $tcps($i) set window_ 100
    $tcps($i) set fid_ 1
}

#setup hop agents

for {set i 0} {$i < 52} {incr i} {
    set tackh($i) [new Agent/TackHop]
    $ns attach-agent $h($i) $tackh($i)
    setup3 $tackh($i)
    $tackh($i) set fid_ 0
}

for {set i 52} {$i < 104} {incr i} {
    set tcph($i) [new Agent/TCPHop]
    $ns attach-agent $h($i) $tcph($i)
    $tcph($i) set overhead_ 0.08
    $tcph($i) set fid_ 1
}

#setup destinations

for {set i 0} {$i < 52} {incr i} {
    set tackd($i) [new Agent/TackSink]
    $ns attach-agent $d($i) $tackd($i)
    setup2 $tackd($i)
    $tackd($i) set rtt_ [expr 0.5 + $i / 13 * 0.25]
    $tackd($i) set fid_ 0
}

for {set i 52} {$i < 104} {incr i} {
    set tcpd($i) [new Agent/TCP/FullTcp]
    $ns attach-agent $d($i) $tcpd($i)
    $tcpd($i) listen
    $tcpd($i) set fid_ 1
    $tcpd($i) set window_ 100
}

#Setup ftp for TCP links

for {set i 52} {$i < 104} {incr i} {
    set ftp($i) [new Application/FTP]
    $ftp($i) attach-agent $tcps($i)
}

for {set i 0} {$i < 52} {incr i} {
    $ns simplex-connect $tacks($i) $tackh($i) 
    $ns simplex-connect $tackh($i) $tackd($i) 
    $ns simplex-connect $tackd($i) $tacks($i)
}

for {set i 52} {$i < 104} {incr i} {
    $ns simplex-connect $tcps($i) $tcph($i) 
    $ns simplex-connect $tcph($i) $tcpd($i)
    $ns simplex-connect $tcpd($i) $tcps($i)
}

for {set i 0} {$i < 52} {incr i} {
    set pf0l($i) [new ErrorModel]
    $pf0l($i) set rate_ $pf0
    $ns link-lossmodel $pf0l($i) $bs $h($i)
}

for {set i 52} {$i < 104} {incr i} {
    set pf1l($i) [new ErrorModel]
    $pf1l($i) set rate_ $pf1
    $ns link-lossmodel $pf1l($i) $bs $h($i)
}

for {set i 0} {$i < 52} {incr i} {
    set pr0l($i) [new ErrorModel]
    $pr0l($i) set rate_ $pr0
    $ns link-lossmodel $pr0l($i) $d($i) $s($i)
}

for {set i 52} {$i < 104} {incr i} {
    set pr1l($i) [new ErrorModel]
    $pr1l($i) set rate_ $pr1
    $ns link-lossmodel $pr1l($i) $d($i) $s($i)
}

set rng [new RNG]
$rng seed 123787

for {set i 0} {$i < 52} {incr i} {
    set k [$rng uniform 0 [expr 104*0.1]]
    $ns at $k "$tacks($i) start 5.0"
    $ns at $k "$tackd($i) start"
}

for {set i 52} {$i < 104} {incr i} {
    set k [$rng uniform 0 [expr 104*0.1]]
    $ns at $k "$ftp($i) start"
    $ns at [expr $k + 50.0] "ftp($i) stop"
}

proc inform {} {
    global ns 
    set now [$ns now]
    puts "$now"
    $ns at [expr $now+0.1] "inform"
}

$ns at 0.0 "inform"

$ns at totalTime "finish"

$ns run