[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
No Subject
I am doing some simple tests with ns2.0b17 and the results I got are kind
of weird...
I am running 2 FTP connections in parallel from node n1 to node n2 (n1
and n2 are directly connected). The second FTP starts 5 seconds after the
first one.
When the window size is small, everything looks fine : They share
the bandwith and have the same throughput; no congestion occurs and the
congestion window grows steadily; both FTPs keep their window fully
opened.
When I increase the window size, the 2 FTPs can not maintain their
window fully opened and some losses occur. The problem is that only the
second connection seems to lose packets. The congestion window of the
first FTP grows steadily, while the 2nd one is experiencing slow starts
periodically. As a result, the throughput of the first FTP is much higher.
I was expecting the 2 FTPs to both experience some losses and slow starts,
and to have approximately the same throughput.
The script I used is following. Please tell me if my expectations are
wrong or if my script is not correct. Thanks for your help.
# test.tcl
set ns [new Simulator]
# topology : n1 ---500kb/10ms--- n2
set n1 [$ns node]
set n2 [$ns node]
$ns duplex-link $n1 $n2 500kb 10ms DropTail
# 1st connection : FTP from n1 to n2
set src1 [new Agent/TCP/Reno]
set snk1 [new Agent/TCPSink ]
$src1 set window_ 26
$src1 set packetSize_ 1400
$ns attach-agent $n1 $src1
$ns attach-agent $n2 $snk1
$ns connect $src1 $snk1
set ftp1 [new Source/FTP]
$ftp1 set agent_ $src1
# 2nd connection : FTP from n1 to n2
set src2 [new Agent/TCP/Reno]
set snk2 [new Agent/TCPSink ]
$src2 set window_ 26
$src2 set packetSize_ 1400
$ns attach-agent $n1 $src2
$ns attach-agent $n2 $snk2
$ns connect $src2 $snk2
set ftp2 [new Source/FTP]
$ftp2 set agent_ $src2
# trace
$src1 trace t_seqno_
$src1 trace ack_
$src1 trace cwnd_
set f1 [open trace1.tr w]
$src1 attach $f1
$src2 trace t_seqno_
$src2 trace ack_
$src2 trace cwnd_
set f2 [open trace2.tr w]
$src2 attach $f2
# start
$ns at 0.5 "$ftp1 start"
$ns at 5.5 "$ftp2 start"
$ns at 300.0 "finish"
# finish
proc finish {} {
global ns f1 f2
$ns flush-trace
close $f1
close $f2
exec awk {
{ if ($6 == "ack_")
print $1,$7
}
} trace1.tr > ack1.tr
exec awk {
{ if ($6 == "t_seqno_")
print $1,$7
}
} trace1.tr > seqno1.tr
exec awk {
{ if ($6 == "cwnd_")
print $1,$7
}
} trace1.tr > cwnd1.tr
exec awk {
{ if ($6 == "ack_")
print $1,$7
}
} trace2.tr > ack2.tr
exec awk {
{ if ($6 == "t_seqno_")
print $1,$7
}
} trace2.tr > seqno2.tr
exec awk {
{ if ($6 == "cwnd_")
print $1,$7
}
} trace2.tr > cwnd2.tr
exec xgraph cwnd1.tr cwnd2.tr &
exec xgraph seqno1.tr seqno2.tr &
exit 0
}
$ns run
Best regards,
Bruno
+------------------------------------------+
| Bruno HEMON [email protected] |
| |
| Graduate Student |
| Computer Science Department |
| University of California at Los Angeles |
| |
| Promotion 97 |
| Ecole Centrale Paris |
+------------------------------------------+