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

[ns] too many traffic-generators?



Hi there!
I am trying to simulate a topology where several tcp-senders (say 10 to 100)
send via one bottleneck-router to a tcp-sink. In order to analyze how the
TCP-Flowcontrol bahaves.
The problem ist, that when I start more than 4 traffic generators (using
pareto-distribution) ns crashes with a sementation fault. 4 generators are
fine, but not more. Below I've attached a simple simulation-script which
does the discribed.
Is there someone out there, who can help me?
PS: OS is LINUX 2.4 ns is 2.1b7a

------snip

set ns [new Simulator]

set sendercount 10
# windowsize
set windowsize 1000
# packetsize
set packsiz 1024
# fifo size
set buffersiz 16
# simulation time in sek
set simtime 100.0

$ns color 0 blue
$ns color 1 red

# generatin sendercount+2 nodes
for {set i 0} {$i < ($sendercount + 2)} {incr i} {
    set n($i) [$ns node]
}
# id of the router-node
set router [expr $sendercount+0]
# id of the sink-node
set sink [expr $sendercount+1]

set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf

$ns duplex-link $n($router) $n($sink) 100Mb 50ms DropTail
# queue-limit
$ns queue-limit $n($router) $n($sink) $buffersiz

for {set i 0} {$i < $sendercount} {incr i} {
    $ns duplex-link $n($i) $n($router) 10Mb 50ms DropTail
    $ns queue-limit $n($i) $n($router) 1000
}

$ns duplex-link-op $n($router) $n($sink) queuePos 0.5

set tcp [new Agent/TCP]
$tcp set class_ 0

set sinkAgent [new Agent/TCPSink]

for {set i 0} {$i < $sendercount} {incr i} {
    set tcpAgent($i) [new Agent/TCP]
    $ns attach-agent $n($i) $tcpAgent($i)
}
$ns attach-agent $n($sink) $sinkAgent
for {set i 0} {$i < $sendercount} {incr i} {
    $ns connect $tcpAgent($i) $sinkAgent
}

# Equivelant of
# set tcp [$ns create-connection TCP $n0 TCPSink $n3 0]

for {set i 0} {$i < $sendercount} {incr i} {
    set traff($i) [new Traffic/Pareto]
    $traff($i) attach-agent $tcpAgent($i)
}

proc startTraffic {} {
    global sendercount
    for {set i 0} {$i < $sendercount} {incr i} {
 upvar traff($i) t
 $t start
    }
}


proc stopTraffic {} {
    global sendercount ns sink sinkAgent
    upvar n($sink) sunk
    for {set i 0} {$i < $sendercount} {incr i} {
 upvar traff($i) t
 upvar tcpAgent($i) tc
 upvar n($i) node
 $ns detach-agent $node $tc
 $ns detach-agent $n3 $sink
    }
    $ns detach-agent $sunk $sinkAgent
}

$ns at 0.2 "startTraffic"

$ns at 1.2 "stopTraffic"

$ns at 3.0 "finish"

proc finish {} {
 global ns f nf
 $ns flush-trace
 close $f
 close $nf

 puts "running nam..."
 exec nam out.nam &
 exit 0
}

$ns run

------snap

--
Daniel H�llisch
                         Technische Universit�t M�nchen

Genion: 089 - 9 545 545 8
Mobil: 0179 -  240 640 5

home: http://www.danho.org
mailto:[email protected]
PGP Public Key: http://www.danho.org/Daniel_H�llisch_pgpKey.asc
*********************************************
AKTION: Pro Privatsph�re - Kontra BND & Co.
http://www.pgp.com