[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ns exits early
Hi,
the attached script causes ns-2.0b18 to exit early (at ~4.5 seconds into
the simulation instead of continuing until 10 seconds as specified.)
Running the same script under ns-2.0a17 crashes ns with the following stack
crawl:
(gdb) bt
#0 0xef6dda70 in kill ()
#1 0xef6f56a4 in abort ()
#2 0x69c34 in _ABORT () at tclAppInit.cc:110
#3 0xf6bc in TcpAgent::rtt_timeout (this=0xe0818) at tcp.cc:236
#4 0x10190 in TcpAgent::set_rtx_timer (this=0xe0818) at tcp.cc:419
#5 0x1022c in TcpAgent::newtimer (this=0xe0818, pkt=0x133d40) at tcp.cc:431
#6 0x109ec in TcpAgent::newack (this=0xe0818, pkt=0x133d40) at tcp.cc:564
#7 0x10c18 in TcpAgent::recv_newack_helper (this=0xe0818, pkt=0x133d40) at tcp.cc:621
#8 0x13770 in RenoTcpAgent::recv (this=0xe0810, pkt=0x133d40) at tcp-reno.cc:77
#9 0x5510 in Classifier::recv (this=0xe54f0, p=0x133d40) at classifier.cc:105
#10 0x5510 in Classifier::recv (this=0xf8410, p=0x133d40) at classifier.cc:105
#11 0x94a4 in Connector::send (this=0xd0440, p=0x133d40, h=0x0) at connector.h:51
#12 0x1ff58 in TTLChecker::recv (this=0xd0440, p=0x133d40, h=0x0) at ttl.cc:59
#13 0x5174 in NsObject::handle (this=0xd0440, e=0x133d40) at object.cc:79
#14 0x2efc in ListScheduler::run (this=0xf6418) at scheduler.cc:204
#15 0x2864 in Scheduler::command (this=0xf6418, argc=2, argv=0xefffdea4) at scheduler.cc:90
#16 0x6a51c in TclClass::dispatch_cmd (clientData=0xf6418, interp=0xa8b80, argc=5, argv=0xefffde98) at Tcl.cc:288
#17 0x6d048 in OTclDispatch (cd=0xf6838, in=0xa8b80, argc=3, argv=0xefffdf60) at otcl.c:442
#18 0xef72b994 in Tcl_Eval ()
#19 0xef72cae0 in Tcl_CatchCmd ()
#20 0xef72b994 in Tcl_Eval ()
#21 0xef74ed28 in TclParseNestedCmd ()
#22 0xef74f164 in TclParseWords ()
#23 0xef72b748 in Tcl_Eval ()
#24 0xef7529b8 in InterpProc ()
#25 0x6d048 in OTclDispatch (cd=0xf6838, in=0xa8b80, argc=2, argv=0xefffe790) at otcl.c:442
#26 0xef72b994 in Tcl_Eval ()
#27 0xef74ed28 in TclParseNestedCmd ()
#28 0xef74f164 in TclParseWords ()
#29 0xef72b748 in Tcl_Eval ()
#30 0xef7529b8 in InterpProc ()
#31 0x6d048 in OTclDispatch (cd=0x132500, in=0xa8b80, argc=2, argv=0xefffedb0) at otcl.c:442
#32 0xef72b994 in Tcl_Eval ()
#33 0xef74b92c in Tcl_EvalFile ()
#34 0xef74def4 in Tcl_Main ()
#35 0x69ad4 in main (argc=2, argv=0xeffff62c) at tclAppInit.cc:51
Note that the bug only occurs if the queue limit between r1 and r2 is set
to 8 in the script below. Other values work fine (for example, 32.)
Here is the script:
--- cut here ---
# Topology (note that this may not really be up-to-date):
#
# n1-----------r1------------r2-----------n2
# 10Mb, 2ms 56K, 80ms 10MB, 2ms
#
# create new simulator
set ns [new Simulator]
# create tracefile
$ns trace-all [open tcp_test.tr w]
# set global defaults
Agent/TCP set tcpTick_ 500
Agent/TCP set window_ 16
# create nodes
set n1 [$ns node]
set n2 [$ns node]
set r1 [$ns node]
set r2 [$ns node]
# connect nodes
$ns duplex-link $n1 $r1 10Mb 2ms DropTail
$ns duplex-link $r1 $r2 56Kb 80ms DropTail
$ns duplex-link $r2 $n2 10Mb 2ms DropTail
# set up three TCP Reno connections from n1 to n2
set tcp_src_1 [new Agent/TCP/Reno]
set tcp_snk_1 [new Agent/TCPSink]
$ns attach-agent $n1 $tcp_src_1
$ns attach-agent $n2 $tcp_snk_1
$ns connect $tcp_src_1 $tcp_snk_1
set tcp_src_2 [new Agent/TCP/Reno]
set tcp_snk_2 [new Agent/TCPSink]
$ns attach-agent $n1 $tcp_src_2
$ns attach-agent $n2 $tcp_snk_2
$ns connect $tcp_src_2 $tcp_snk_2
#set tcp_src_3 [new Agent/TCP/Reno]
#set tcp_snk_3 [new Agent/TCPSink]
#$ns attach-agent $n1 $tcp_src_3
#$ns attach-agent $n2 $tcp_snk_3
#$ns connect $tcp_src_3 $tcp_snk_3
# create FTP sources at n1
set ftp_1 [$tcp_src_1 attach-source FTP]
set ftp_2 [$tcp_src_2 attach-source FTP]
#set ftp_3 [$tcp_src_3 attach-source FTP]
$ns queue-limit $r1 $r2 8
$tcp_src_1 trace [open src1.tcp_test.tr w]
$tcp_src_2 trace [open src2.tcp_test.tr w]
#$tcp_src_3 trace [open src3.tcp_test.tr w]
# run FTP sources
$ns at 0.0 "$ftp_1 start"
$ns at 2.0 "$ftp_2 start"
#$ns at 4.0 "$ftp_3 produce 100"
# run for 10 simulated seconds
$ns at 10 "exit 0"
$ns run
--- cut here ---
Ciao,
Lars
__________________________________________________________________________
Lars Eggert [email protected]
Information Sciences Institute http://www-scf.usc.edu/~larse/
University of Southern California Finger or email for PGP public key.