In TCP Networks, the most important factor that determines behavior is its congestion window size . In NS2, we can handle it with using cwnd command. In NS, every TCP type classes have a variable named "cwnd" that contains the congestion window size of the TCP Module. In here we can use 'set' command to return a value. We can write it as; set tcp1 [new Agent/TCP/Reno] set cwnd1 [ $tcp1 set cwnd_ ] To obtain TCP's CWND value frquently; We can easily make the NS simulation system repeatedly read the value (say, after every 0.1 sec of simulation time). Schedule a read operation repeatedly Proc plotWindow {tcpSource outfile} { global ns set now [$ns now] set cwnd [$tcpSource set cwnd_] # Print TIME CWND for gnuplot to plot progressing on CWND puts $outfile "$now $cwnd" ...
When you’re curious, you find lots of interesting things to do.