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

[ns] problem with pareto sources



Hi,

I have been experiencing this weird problem with pareto sources. Whenever
i have more than certain number of flow active it gives me a segmentation
fault. The threshold of number of flows is variable. On
tracing this error using gdb i traced it to rng.cc:
 
" Program received signal SIGSEGV, Segmentation fault.
 RNGImplementation::next (this=0x30) at rng.cc:136 "

I searched the mailing list and someone else had the same problem but with
10 to 11 sources (11th one gave him a segmentation fault). Someone replied
to him saying that that was a nam problem not a ns fault.

I am not using any nam stuff.....and am using ns-2.1b7.....plus it really
confuses me as some of my friends running ns-2.1b6 can run simulations
with hundreds of pareto on/off flows with no problems whatsoever. Do i
need to downgrade/upgrade (to current snapshot)....

Any feedback would be appreciated. I have attached my script below:

Thanks,
-Vikram

---------------------------------------------------------------------------

# Define Values
#
set val(flows)                      20;
set val(stop)                  30.00;# simulation time (sec)
set val(bandwidth)                 10;# link bandwidth (Mb)
set val(queue-length)               5;# Queue Length (pkts)            
set val(trace)                 out.tr;# trace file    

# Source detail for an ON/OFF source
set val(pktsize)                 250;# Packet size (bytes)
set val(burst)                    .5;# Burst time (sec)
set val(idle)                     .5;# Idle time (sec)
set val(peak)                     100;# Peak rate (Kbps)

# =======================================================================
# Main stuff
# ======================================================================

#Create a simulator object
set ns [new Simulator]

#Open the trace file
set tracefile [open $val(trace) w]
$ns trace-all $tracefile

#Queue limit
Queue set limit_ $val(queue-length)

#Create two nodes
set n0 [$ns node]
set n1 [$ns node]

#Create a simplex link between the nodes
$ns simplex-link $n0 $n1 ${val(bandwidth)}Mb 5ms DropTail

# Setting up flows from n1 to n0
for {set i 0} {$i < $val(flows) } {incr i} {

    #Create a Null agent (a traffic sink) and attach it to node n1
    set null_($i) [new Agent/Null]
    $ns attach-agent $n1 $null_($i)

    #Create a UDP agent and attach it to node n0
    set udp_($i) [new Agent/UDP]
    $ns attach-agent $n0 $udp_($i)
    
    # Create a pareto on/off traffic traffic source and attach it to udp_i
    set pareto_($i) [new Application/Traffic/Pareto]
    $pareto_($i) set packetSize_ $val(pktsize)
    $pareto_($i) set burst-time_ $val(burst)
    $pareto_($i) set idle-time_ $val(idle)
    $pareto_($i) set rate_ ${val(peak)}k
    $pareto_($i) set shape_ 1.5
    $pareto_($i) attach-agent $udp_($i)
 
    #Connect the traffic source with the traffic sink null0
    $ns connect $udp_($i) $null_($i)

    #Schedule events 
    $ns at 10.0 "$pareto_($i) start"
    $ns at $val(stop) "$pareto_($i) stop"
}

#Call the finish procedure at end of simulation time
$ns at $val(stop) "finish"


#Define a 'finish' procedure
proc finish {} {

    global ns tracefile qmon bandwidth stop buffer
    $ns flush-trace
    exit 0
}

#Run the simulation
$ns run



-- 

Department of ECE, Rice University | 713 348 3786 (O)| 713 664 5650(H)
WWW: http://www.ece.rice.edu/~kanodia