#!/usr/bin/perl 

# Bottleneck Buffer Size experiment (Section IV-H, Figure 13)

@bnqueueset = (25,50,75,100,125,150);  	# Bottleneck queue size limit
$bnqueuetype = 0;			# 0 for DropTail, 2 for RED
$simtime = 1000.0;			# Simulation time in seconds

qx!rm -f sim.data!;

# Number of background flows considered, and their types
$bkgflows = 100;
$httpflows = ( 50 * $bkgflows ) / 100;
$ftpflows = ( 50 * $bkgflows ) / 100;

foreach $bnqueuesize (@bnqueueset) {
	$time = qx!date!; print("\nStart time: $time"); 
	print "\n>./ns http.tcl -bnqueuetype $bnqueuetype  -fgrtt 0.074990 -bnqueue $bnqueuesize -bnbw 15Mb -ftpbkgflows $ftpflows -httpbkgflows $httpflows -simtime $simtime ";
	qx!rm bnlink.data!;
	$output = qx!./ns http.tcl -bnqueuetype $bnqueuetype  -fgrtt 0.074990 -bnqueue $bnqueuesize -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"); 
}
