Commit 7d64549a authored by Pramod R Sanaga's avatar Pramod R Sanaga

Changed the multiplexing script to test paths randomly - without repetition

parent dd913b71
......@@ -24,7 +24,7 @@ $run = $ARGV[3];
#$nodeCount = scalar(@nodes);
$serverPort = 1690;
# seconds per run
$duration = 60;
$duration = 30;
# First argument is the destination node (or
# Second argument is the command to change to (if "", no change).
......@@ -58,9 +58,9 @@ sub runTest
my $source = $_[0];
my $dest = $_[1];
my $num = $_[2];
startProgram($dest, "sh /bw-bottleneck/multiplex-server.sh $serverPort /bw-bottleneck", 0);
startProgram($dest, "sh /local/bw-bottleneck-wavelet/multiplex-server.sh $serverPort /local/bw-bottleneck-wavelet", 0);
sleep(2);
startProgram($source, "sh /bw-bottleneck/multiplex-client.sh $serverPort /bw-bottleneck node-$dest.$exp.$proj.emulab.net $duration $source-to-$dest-run-$run-$num", 0);
startProgram($source, "sh /local/bw-bottleneck-wavelet/multiplex-client.sh $serverPort /local/bw-bottleneck-wavelet node-$dest.$exp.$proj.emulab.net $duration $source-to-$dest-run-$run-$num", 0);
sleep($duration * 11);
stopProgram($dest);
......@@ -73,15 +73,33 @@ $count = 0;
srand($run);
my %PairHash = ();
my $iterLimit = $nodeCount*($nodeCount-1);
while (1)
{
$i = int(rand($nodeCount));
$j = int(rand($nodeCount));
$i = int(rand($nodeCount)) + 1;
$j = int(rand($nodeCount)) + 1;
if( keys(%PairHash) >= $iterLimit )
{
last;
}
if ($i != $j)
{
runTest($i, $j, $count);
++$count;
# runTest($nodes[$i], $nodes[$j]);
my $nodeString = $i . ":" . $j;
if( not ( $PairHash{$nodeString} ) )
{
$PairHash{$nodeString} = 1;
runTest($i, $j, $count);
++$count;
sleep(30);
}
else
{
next;
}
}
sleep(600);
}
......@@ -72,7 +72,7 @@ void handleUDP(struct pcap_pkthdr const *pcap_info, struct udphdr const *udpHdr,
tmpStrStream << origTimestamp;
actualTimeMaps[hostIndex][tmpStrStream.str()] = (unsigned long long)(secVal*1000 + usecVal/1000);
sendTimesArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] = (unsigned long long)(secVal*1000 + usecVal/1000);
printf("Recording Timestamp = %s for Host = %d, value = %llu\n", tmpStrStream.str().c_str(), hostIndex, actualTimeMaps[hostIndex][tmpStrStream.str()]);
//printf("Recording Timestamp = %s for Host = %d, value = %llu\n", tmpStrStream.str().c_str(), hostIndex, actualTimeMaps[hostIndex][tmpStrStream.str()]);
}
else if(packetType == '1')
{
......@@ -94,8 +94,8 @@ void handleUDP(struct pcap_pkthdr const *pcap_info, struct udphdr const *udpHdr,
delaySequenceArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] = oneWayDelay - ( actualTimeMaps[hostIndex][tmpStrStream.str()] - origTimestamp);
}
cout << " Onewaydelay for the ACK = " << oneWayDelay << " recorded = "<< delaySequenceArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] <<", host Index = "<< hostIndex << "\n";
cout <<" Orig timestamp was "<< tmpStrStream.str() << " , actual time = "<< actualTimeMaps[hostIndex][tmpStrStream.str()]<<"\n";
//cout << " Onewaydelay for the ACK = " << oneWayDelay << " recorded = "<< delaySequenceArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] <<", host Index = "<< hostIndex << "\n";
//cout <<" Orig timestamp was "<< tmpStrStream.str() << " , actual time = "<< actualTimeMaps[hostIndex][tmpStrStream.str()]<<"\n";
if(oneWayDelay < 50000 && oneWayDelay > -50000 && (delaySequenceArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] > 100000 || delaySequenceArray[hostIndex][packetTimeMaps[hostIndex][origTimestamp]] < -100000 ) )
{
......@@ -103,7 +103,7 @@ void handleUDP(struct pcap_pkthdr const *pcap_info, struct udphdr const *udpHdr,
}
cout <<"Packet time map Index = "<< packetTimeMaps[hostIndex][origTimestamp] << ", host index = " << hostIndex << " \n\n\n";
//cout <<"Packet time map Index = "<< packetTimeMaps[hostIndex][origTimestamp] << ", host index = " << hostIndex << " \n\n\n";
}
else
{
......@@ -349,6 +349,8 @@ int main(int argc, char **argv)
if (!(getTimeMilli() - lastSentTime > targetSleepTime))
{
timeoutValue = ( targetSleepTime - (getTimeMilli() - lastSentTime) )*1000 ;
if(timeoutValue < 0 || timeoutValue > targetSleepTime*1000)
timeoutValue = 0;
if(!firstWriteFlag)
disableWritesFlag = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment