#!/usr/bin/perl 

# HTTP/FTP Background Traffic experiment (Section IV-D, Figure 9b RED)

@bkgflowset = (100,120,140,160,180,200);
$bnqueuetype = 2; # RED Bottleneck
$simtime = 1000.0;

qx!rm -f sim.data!;
foreach $bkgflows (@bkgflowset) {
	$httpflows = ( 75 * $bkgflows ) / 100;
	$ftpflows = ( 25 * $bkgflows ) / 100;
	$time = qx!date!; print("\nStart time: $time"); 
	print "\n>./ns http.tcl -bnqueuetype $bnqueuetype  -fgrtt 0.074990 -bnqueue 150 -bnbw 15Mb -ftpbkgflows $ftpflows -httpbkgflows $httpflows -simtime $simtime ";
	qx!rm bnlink.data!;
	$output = qx!./ns http.tcl -bnqueuetype $bnqueuetype  -fgrtt 0.074990 -bnqueue 150 -bnbw 15Mb -ftpbkgflows $ftpflows -httpbkgflows $httpflows -simtime $simtime !;
	print "\n$output\n";
	qx!cat bnlink.data >> sim.data !;
	$time = qx!date!; print("\nEnd time: $time"); 
}
