For a TCP connection over a link (1Mb, 100ms, queue_limit = 10), drop
loss should be observed when cwnd is near 23 (cwnd = bandwidth * delay
+ queue_limit = 12.5 + 10). But no loss is detected, even when cwnd is
more than 130 (after 100s). It is fine when delay is set as 10ms with
other parameters unchanged.  Is anything wrong? Below the TCL script
file (also in the attachment).

---------------------------------------------------------------------
#!/home/sim/ns-allinone-2.33/bin/ns
# This experiment is to verify the recovery time of TCP loss.
# Thu Feb 12 01:01:11 UTC 2009

proc finish {} {
       global ns tf wf
       $ns flush-trace
       close $tf
       close $wf
       exit 0
}

set ns [new Simulator]
set tf [open out.tr w]
$ns trace-all $tf

# File $wf is used for recording cwnd variable.
set wf [open out.cwnd w]

# Network Topology.
#   n0 --------------- n1
#       1Mb 100ms 10Q

set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 1Mb 100ms DropTail
$ns queue-limit $n0 $n1 10

set tcp [new Agent/TCP]
set sink [new Agent/TCPSink]
$ns attach-agent $n0 $tcp
$ns attach-agent $n1 $sink
$ns connect $tcp $sink

set ftp [new Application/FTP]
$ftp attach-agent $tcp

set time_start 0.5
set time_stop 100.0
set time_finish 101.5
set delta 0.1
set time 0

$ns at $time_start "$ftp start"
$ns at $time_stop "$ftp stop"
$ns at $time_finish "finish"

while {$time < $time_finish} {
       $ns at $time {puts $wf "[$ns now] [$tcp set cwnd_]"}
       set time [expr {$time + $delta}]
}

$ns run
---------------------------------------------------------------------

Reply via email to