Commit f84d9c96 authored by Jonathon Duerig's avatar Jonathon Duerig

Added scripts for gathering multiplex reactivity data and modelling it.

parent dd973038
/usr/testbed/bin/tevc -e $1/$2 now elabc clear
/usr/testbed/bin/tevc -w -e $1/$2 now elabc reset
/usr/testbed/bin/tevc -e $1/$2 now elabc create
#!/bin/sh
# Usage: multiplex-client.sh <port> <base-path> <dest> <duration> <dest-file>
echo `date` > /local/logs/$5.time
echo sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $1 '|' perl $2/count-retransmits.pl '>' /local/logs/$5.retransmit '&'
sudo /usr/sbin/tcpdump -n -tt -i vnet dst port $1 | perl $2/count-retransmits.pl > /local/logs/$5.retransmit &
DUMPPID=$!
echo perl $2/send-multiplex.pl $3 $1 $4 '>&' /local/logs/$5.graph '&'
perl $2/send-multiplex.pl $3 $1 $4 >& /local/logs/$5.graph &
IPERFPID=$!
trap "sudo kill $DUMPPID; sudo kill $IPERFPID" EXIT
wait
exit 0
This diff is collapsed.
#!/bin/sh
# Usage: multiplex-server.sh <port> <base-path>
echo $2/iperf -s -p $1 '&'
$2/iperf -s -p $1 &
IPERFPID=$!
trap "sudo kill $IPERFPID" EXIT
wait
exit 0
@nodeTotal = ();
@nodeInteresting = ();
for ($i = 0; $i < 1000; ++$i)
{
push(@nodeTotal, 0);
push(@nodeAnomaly, 0);
}
@normal = ();
@interesting = ();
while ($line = <STDIN>)
{
if ($line =~ /Normal: (.*)$/)
{
@normal = split(/ /, $1);
}
elsif ($line =~ /Interesting: (.*)$/)
{
@interesting = split(/ /, $1);
}
}
for ($i = 0; $i < scalar(@normal); ++$i)
{
$normal[$i] =~ /([0-9]*)-to-([0-9]*)\.graph/;
$nodeTotal[$1]++;
$nodeTotal[$2]++;
}
for ($i = 0; $i < scalar(@interesting); ++$i)
{
$interesting[$i] =~ /([0-9]*)-to-([0-9]*)\.graph/;
$nodeTotal[$1]++;
$nodeInteresting[$1]++;
$nodeTotal[$2]++;
$nodeInteresting[$2]++;
}
for ($i = 0; $i < 1000; ++$i)
{
if ($nodeTotal[$i] > 0)
{
print($nodeInteresting[$i]/$nodeTotal[$i] . "\t" . $nodeTotal[$i] . "\t" . $i . "\n");
}
}
$number = $ARGV[0];
$count = $ARGV[1];
for ($i = 1; $i <= $count; ++$i)
{
if ($i != $number)
{
system("/bw-bottleneck/iperf -c node-$i.multiplex-small.tbres.emulab.net -t 30 -f m -w 256k > /local/logs/$number-to-$i.result &");
}
}
$limit = @ARGV;
for ($i = 0; $i < $limit; ++$i)
{
$file = $ARGV[$i];
$file =~ /([0-9a-zA-Z\-]+)(\.[0-9a-zA-Z\-]*)?$/;
$name = $1;
system("rm plot.gpl");
open(PLOT, ">plot.gpl");
print PLOT "set title \"$name\"\n";
print PLOT "set xlabel \"# of streams\"\n";
print PLOT "set ylabel \"Throuhput (Mbps)\"\n";
print PLOT "set yrange [0:]\n";
print PLOT "set nokey\n";
# print PLOT "set term postscript enhanced eps 20 \"NimbusSanL-Regu\" fontfile \"/usr/local/share/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb\"\n";
print PLOT "set term postscript\n";
print PLOT "set output \"$name.ps\"\n";
print PLOT "plot \"$file\" with lines\n";
system("gnuplot plot.gpl");
}
# Usage: run-monitor.sh <pid> <eid> <node-number>
sudo /sbin/sysctl -w net.ipv4.tcp_no_metrics_save=1
sudo /sbin/ip route flush cache
#perl make-multiplex.pl $3
../libnetmon/netmond -v 3 -u -f 262144 | tee /local/logs/libnetmon.out | python multiplex-monitor.py --fake --initial=test-initial.txt --multiplex=multiplex-$3.txt --stub-ip=10.0.0.$3 --ip=10.0.0.$3 --experiment=$1/$2 --interface=elabc-elab-$3
#!/usr/bin/perl
# Runs iperfs between random pairs at each of 10 multiplex levels to
# see how the background traffic
$usage = <<"END_USAGE";
usage: scan-multiplex.pl <project> <experiment> <node-count> <run-number>
END_USAGE
if (@ARGV != 4)
{
die("Invalid number of arguments: ".@ARGV.$usage);
}
$proj = $ARGV[0];
$exp = $ARGV[1];
$nodeCount = $ARGV[2];
$run = $ARGV[3];
#open NODELIST, "<".$nodeFile;
#@nodes = <NODELIST>;
#$nodeCount = scalar(@nodes);
$serverPort = 1690;
# seconds per run
$duration = 60;
# First argument is the destination node (or
# Second argument is the command to change to (if "", no change).
sub startProgram
{
my $source = $_[0];
my $command = $_[1];
my $wait = $_[2];
my $string = "/usr/testbed/bin/tevc ";
if ($wait != 0)
{
$string = $string . '-w ';
}
my $string = $string."-e $proj/$exp now node-$source-agent start";
if ($command ne "")
{
$string = $string." COMMAND='".$command."'";
}
print("Starting program event: $string\n");
system($string);
}
sub stopProgram
{
my $source = $_[0];
system("/usr/testbed/bin/tevc -e $proj/$exp now node-$source-agent stop");
}
sub runTest
{
my $source = $_[0];
my $dest = $_[1];
my $num = $_[2];
startProgram($dest, "sh /bw-bottleneck/multiplex-server.sh $serverPort /bw-bottleneck", 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);
sleep($duration * 11);
stopProgram($dest);
stopProgram($source);
}
#-----------------------------------------------------------------------
$count = 0;
srand($run);
while (1)
{
$i = int(rand($nodeCount));
$j = int(rand($nodeCount));
if ($i != $j)
{
runTest($i, $j, $count);
++$count;
# runTest($nodes[$i], $nodes[$j]);
}
sleep(600);
}
$total = 7;
sub sendStream
{
my $streamCount = shift(@_);
my $dest = shift(@_);
my $out = shift(@_);
my $command = "cd /proj/tbres/duerig/testbed/pelab/monitor;".
" sh instrument.sh iperf -c 10.0.0.$dest -w 256k -P $streamCount -t 30 -f m > $out &";
print STDERR $command."\n";
system($command);
}
for ($i = 0; $i < $total; ++$i)
{
for ($j = 0; $j < $total - $i; ++$j)
{
for ($k = 0; $k < $total - $i - $j; ++$k)
{
$l = $total - $i - $j - $k - 1;
if ($i > 0)
{
$filename = "/proj/tbres/duerig/multiplex/bottle-all/$i-$j-$k-$l-2.txt";
sendStream($i, 2, $filename);
print $filename."\n";
}
if ($j > 0)
{
$filename = "/proj/tbres/duerig/multiplex/bottle-all/$i-$j-$k-$l-3.txt";
sendStream($j, 3, $filename);
print $filename."\n";
}
if ($k > 0)
{
$filename = "/proj/tbres/duerig/multiplex/bottle-all/$i-$j-$k-$l-4.txt";
sendStream($k, 4, $filename);
print $filename."\n";
}
if ($l > 0)
{
$filename = "/proj/tbres/duerig/multiplex/bottle-all/$i-$j-$k-$l-5.txt";
sendStream($l, 5, $filename);
print $filename."\n";
}
sleep(40);
}
}
}
$dest = $ARGV[0];
$port = $ARGV[1];
$duration = $ARGV[2];
for ($i = 1; $i < 11; ++$i)
{
if ($i > 1)
{
$rateLine = `/bw-bottleneck/iperf -c $dest -p $port -w 256k -i 10 -t $duration -P $i -f m | grep SUM | tail -n 1`;
}
else
{
$rateLine = `/bw-bottleneck/iperf -c $dest -p $port -w 256k -i 10 -t $duration -P $i -f m | tail -n 1`;
}
$rateLine =~ /([0-9.]+) Mbits\/sec$/;
$rate = $1;
print "$i $rate \n";
}
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