#!/usr/bin/perl 

# System Scaling experiment (Section IV-G, Figure 12)

$bkgflows = 100;
$basebw  = 15;
$basebnqueue = 50;
$bnqueuetype = 0; 	# DropTail
$simtime = 1000.0;

qx!rm -f sim.data!;
for ($scale = 1; $scale <= 4 ; $scale++ ) {
	$time = qx!date!; print "\nStart time: $time";
	$bwvalue = $scale * $basebw;
        $bnbw = sprintf("%dMb",$bwvalue);
	$bnqueue = $scale * $basebnqueue;
	$httpflows = $scale * 9 * $bkgflows / 10;
	$ftpflows =  $scale * 1 * $bkgflows / 10;
	print "\n>./ns http.tcl -bnqueuetype $bnqueuetype  -bnbw $bnbw -bnqueue $bnqueue -ftpbkgflows $ftpflows -httpbkgflows $httpflows -simtime $simtime ";
	qx!rm bnlink.data!;
	$output = qx!./ns http.tcl -bnqueuetype $bnqueuetype  -bnbw $bnbw -bnqueue $bnqueue -ftpbkgflows $ftpflows -httpbkgflows $httpflows -simtime $simtime !;
	print "\n$output\n";
	qx!cat bnlink.data >> sim.data !;
	$time = qx!date!; print "\nEnd time: $time";
}

