Assignment 8
Assignment 8
Tahoe:
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam&
exit 0
}
#Plot Window
proc plotWindow {tcpSource outfile}
{ global ns
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $outfile "$now $cwnd"
$ns at [expr $now+0.1] "plotWindow $tcpSource $outfile"
}
Reno:
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam&
exit 0
}
#Plot Window
proc plotWindow {tcpSource outfile}
{ global ns
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $outfile "$now $cwnd"
$ns at [expr $now+0.1] "plotWindow $tcpSource $outfile"
}
Topology:
Plotting Graph:
set terminal png
set output "plot.png"
set xlabel "Time in seconds"
set ylabel "Congestion window size"
plot "congestion_r.xg" using 1:2 with linespoints title "Reno","congestion_t.xg"
using 1:2 with linespoints title "Tahoe"
Output: