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

[ns] Core dumped



Hi everyone,
I'm getting this error " Virtual memory exceeded in 'new' " when I try to run a simulation with the following scenario:
-360 nodes. 180 nodes are connected with links of 2Mb to a router and at the other end the other 180 nodes are connected to another router with links of 2Mb. The two routers are connected with a 100Mb link. Each of the nodes send 1 file/sec during 1 minute, using Normal TCP and FTP apllication. I have runned with 80 nodes at each end and it works, but when I try to run it with 180 nodes at each end it comes up the following error: " Virtual memory exceeded in 'new'  " or sometimes it creates a core dumped file "ns.core". Can anyone tell me what is going on? I think it's not the memory because I have 524Mb of RAM.
 
Thank you very much...
 
abel
 
 
 
I attached below the tcl script that I use:
 
#############################
 
set RunNumber $argv
puts "Offer Load: $RunNumber%"
set SimulationEndTime [expr 3*60];   # 3 minutes
set RefreshTime [expr $SimulationEndTime+30]
set MeanBytesPerFlow 150000.0;
set NumberOfFlows 180;   # Each host will send 180 flows
puts "Simulation End Time: $SimulationEndTime sec"
 
set ingress_rate 2Mb;   #ingress link bandwidth of 2Mb/s
set egress_rate 100Mb;      #egress link bandwidth of 100Mb/s
set LinkSpeed 2e6;
set ingress_delay 0.002;  #link delay of 2ms
set egress_delay 0.004;
set lattency [expr 2*$ingress_delay+$egress_delay]
puts "Lattency: $lattency sec"
set queue DropTail; #queue discipline
set Qsize 500;
set NumberOfNodes $RunNumber; #Number of nodes on each side of the bottleneck
 

set ns [new Simulator]
$ns set-address-format expanded
 
#set up files for trace results
set path results_out_tr/$RunNumber.tr
#set path /win/abel/ns/net5_14/results_out_tr/$RunNumber.tr
puts "Output Trace File: $path"
set f [open $path w]
$ns trace-all $f
#set nf [open out.nam w]
#$ns namtrace-all $nf
 
#create 2*$NumberOfNodes nodes
for {set i 0} {$i < 2*$NumberOfNodes} {incr i} {
    set n($i) [$ns node]
}
 
#create ingress and egress router nodes
set r1 [$ns node]
set r2 [$ns node]
 
#create links between servers and ingress router
for {set i 0} {$i < $NumberOfNodes} {incr i} {
    $ns duplex-link $n($i) $r1 $ingress_rate $ingress_delay $queue
    $ns queue-limit $n($i) $r1 100000
    $ns queue-limit $r1 $n($i) 100000
}
 
#create links between router and clients
for {set i $NumberOfNodes} {$i < 2*$NumberOfNodes} {incr i} {
    $ns duplex-link $r2 $n($i) $ingress_rate $ingress_delay $queue
    $ns queue-limit $n($i) $r2 100000
    $ns queue-limit $r2 $n($i) 100000
}
 
#create bottleneck link
$ns duplex-link $r1 $r2 $egress_rate $egress_delay $queue
$ns queue-limit $r1 $r2 $Qsize
$ns queue-limit $r2 $r1 $Qsize
puts "Simulation model created..."
 
set ranPareto [new RandomVariable/Pareto]
$ranPareto set avg_ $MeanBytesPerFlow
$ranPareto set shape_ 1.4
 
set ranExponential [new RandomVariable/Exponential]
$ranExponential set avg_ 0.4
 
 
proc NewFlow {StartTime i j npkts} {
    global ns SimulationEndTime n NumberOfNodes RefreshTime
  
       set src [new Agent/TCP]
       set sink [new Agent/TCPSink]
       $src set packetSize_ 576
       $ns attach-agent $n($j) $src
       $ns attach-agent $n([expr $j+$NumberOfNodes]) $sink
       $ns connect $src $sink
       $src set fid_ $i
       $sink set fid_ $i
       #$sink($j) listen   # Only for FullTCP
 

    set ftp [new Application/FTP]
    $ftp attach-agent $src
    $ns at $StartTime "$ftp produce $npkts"
    $ns at $RefreshTime "$ns detach-agent $n($j) $src ; $ns detach-agent $n([expr $j+10]) $sink"
}
 
#create and schedule flows at times uniformly distributed between 0 and $SimulatioEndTime
#first, left to right (note test flow is 0)
#for {set i 0} {$i < $NumberOfFlows} {incr i} {
set count 0
for {set j 0} {$j < $NumberOfNodes} {incr j} {
   set StartTimeOld 0
   for {set i 0} {$i < $NumberOfFlows} {incr i} {
      set ranvalue [$ranExponential value]
      set StartTime [expr $ranvalue+$StartTimeOld]
 
      #set StartTime [expr [$ranExponential value]+$StartTimeOld]
      #puts "StartTime $j,$i: $StartTime sec"
      set FileSize [$ranPareto value]
      set FileTime [expr $FileSize*8/$LinkSpeed]
      set StartTimeOld [expr $StartTime+$FileTime]
      set npkts [expr round($FileSize/576)]
      #puts $count,$StartTime,$StartTimeOld,$ranvalue,$FileTime,$FileSize
      NewFlow $StartTime $count $j $npkts
      incr count
 
   }
 

}
 
$ns at $RefreshTime "finish"
 
#schedule progress meter
proc progress {} {
    global ns SimulationEndTime RefreshTime
    set percentage [expr [$ns now]*100/$RefreshTime]
    puts "$percentage% done...\r"
    #puts [$ns now]
    $ns at [expr [$ns now] + $SimulationEndTime/10] "progress"
}
puts "Starting calculations..."
$ns at 0.0 "progress"
 
proc finish {} {
    global ns f NumberOfNodes RunNumber lattency path
    $ns flush-trace
    close $f
    #close $fsize
    #close $nf
    puts "Extracting information..."   
    set FileName0 results_new/$RunNumber
    set FileName1 results_queue_pkts/$RunNumber
##    catch {exec eff_rate5.awk $lattency [expr 2*$NumberOfNodes] $path $FileName0} result
##    catch {exec qlength2.awk pkts [expr 2*$NumberOfNodes] [expr (2*$NumberOfNodes)+1] $path $FileName1} result
    #puts "Compressing files..."
    #catch {exec gzip $path} result
    #catch {exec gzip $FileName0} result
    #catch {exec gzip $FileName1} result
    #puts "running nam..."
    #exec nam out.nam &
    exit 0
}
 
$ns run
 
########################
 

---
Abel Mayal de la Torre
 
BT Advanced Communications Technology Centre
B29 BT Adastral Park
Martlesham Heath
Ipswich
Suffolk
IP5 3RE
UK
 
Tph: 01473 647615
E-Mail: [email protected]