[e2e] Can TCP's congestion window go beyond receiver's maximum advertised window?

Stylianos Papanastasiou stelios at dcs.gla.ac.uk
Sun Apr 17 11:09:18 PDT 2005


I think you should direct similar questions to the ns-users mailing
list.
The short answer is:

The window() (and windowd()) functions return the avail. cwnd which is 
the min. of cwnd_ and window_ (or wnd_ in C++ space). This is the usable
cong. window for all purposes in NS2. Hence, even though your trace says
that cwnd_ reaches the value 24 (and it does), when for instance halving
the congestion window ns does min(24,20)/2, and so you get a value of 10
for the cwnd. Your traces will verify this.

Stelios


On Sat, 2005-04-16 at 10:12 +0000, Syed Faisal Hasan wrote:
> Dear Folks,
> 
> I was trying to do a simple simulation using NS-2.27 and  I found
> something interesting.
> 
> The topology is as follows
> [n0]---------------[n1]
> 
> n0 is running a ftp application on top of tcp.
> TCP receiver's advertised maximum window size is set to 20 (that is
> the default in NS)
> 
> Congestion window (cwnd) should never go beyond receive window (rwnd), 
> right?
> Then why in the simulation, cwnd grows beyond rwnd? cwnd reaches to
> 24, while rwnd is fixed at 20.
> 
> If this is a silly question, I 'm sorry for asking. But I 'ld like to
> have an explanation.
> 
> Faisal
> #==========================================
> #The NS script is below
> #===========================================
> set ns [new Simulator]
> 
> set file1 [open testout.tr w]
> $ns trace-all $file1
> 
> set file2 [open ./temp/namtest.nam w]
> $ns namtrace-all $file2
> set windowfile [ open ./temp/WindowFile w]
> 
> proc finish {} {
> 
> global ns file1 file2
> $ns flush-trace
> close $file1
> close $file2
> 
> exec nam ./temp/namtest.nam &
> exec xgraph ./temp/WindowFile -geometry 800x600 &
> exit 0
> 
> }
> 
> set n0 [$ns node]
> set n1 [$ns node]
> $ns duplex-link $n0 $n1 0.2Mb 500ms DropTail
> $ns duplex-link-op $n0 $n1 orient right
> 
> set tcp [new Agent/TCP/Sack1]
> $ns attach-agent $n0 $tcp
> $tcp set window_ 20
> 
> set tcpsink [new Agent/TCPSink]
> $ns attach-agent $n1 $tcpsink
> $ns connect $tcp $tcpsink
> 
> set ftp [new Application/FTP]
> $ftp attach-agent $tcp
> 
> proc getwindow {source file } {
> 
> global ns
> set now [$ns now]
> set time 0.1
> set cwnd [$source set cwnd_]
> puts $file "$now $cwnd"
> $ns at [expr $now+$time] "getwindow $source $file"
> 
> }
> 
> $ns at 0.1 "getwindow $tcp $windowfile"
> 
> $ns at 0.0 "$ftp start"
> $ns at 9.0 "$ftp stop"
> $ns at 10 "finish"
> $ns run
> #===================================
> 
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar - get it now! 
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> 



More information about the end2end-interest mailing list