[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Problem with Pareto sources?
Hi, everybody:
Is there any restriction to the number of Pareto sources that you can use in
a simulation? I have been making some tests with the following really simple
script and ns SegFaults when using more that ten Pareto sources, while, if I
change them to Exp or CBR I can use 100 sources without problem!!! (Note: I
have commented out the nam-trace because it grows huge with such number of
sources!!). I wrote this simple script because I was observing this behaviour
in a much complex script that I am using... The funny thing is that I observe
the SegFault point when changing exactly from 10 to 11 sources!!
Any idea?
Thanks in advance!!
/Nacho
#Create a simulator object
set ns [new Simulator]
set number 11
#Open the nam trace file
set nf [open out.nam w]
# $ns namtrace-all $nf
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
# exec nam out.nam &
exit 0
}
#Create two nodes
for {set i 1} {$i < ($number +1)} {incr i} {
set n($i) [$ns node]
}
set end [$ns node]
$end color red
#Create a duplex link between the nodes
for {set i 1} {$i < ($number +1)} {incr i} {
$ns duplex-link $n($i) $end 1Mb 10ms DropTail
}
#Create a traffic agent and attach it to node n($i)
for {set i 1} {$i < ($number +1)} {incr i} {
set udp($i) [new Agent/UDP]
$ns attach-agent $n($i) $udp($i)
set tg($i) [new Application/Traffic/Pareto]
$tg($i) attach-agent $udp($i)
}
#Create a Null agent (a traffic sink) and attach it to node end
set null0 [new Agent/Null]
$ns attach-agent $end $null0
#Connect the traffic source with the traffic sink
for {set i 1} {$i < ($number +1)} {incr i} {
$ns connect $udp($i) $null0
}
#Schedule events for the CBR agent
for {set i 1} {$i < ($number +1)} {incr i} {
$ns at 0.5 "$tg($i) start"
$ns at 1.5 "$tg($i) stop"
}
#Call the finish procedure after 5 seconds of simulation time
$ns at 2.0 "finish"
#Run the simulation
$ns run
Ignacio M�s Ivars
Department of Teleinformatics - Royal Institute of Technology (KTH/IT)
Electrum, 204 S-164 40 KISTA (Sweden)
Office phone: +46 8 7521497
Office fax: +46 8 7511793
E-mail: [email protected]
http://www.it.kth.se/~nacho/