]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Added scripts for testing transmission from multiple stations.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 11 Feb 2008 16:08:58 +0000 (17:08 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 11 Feb 2008 16:08:58 +0000 (17:08 +0100)
wme_test/more_sta/plot [new file with mode: 0755]
wme_test/more_sta/run [new file with mode: 0755]
wme_test/more_sta/wclientpar [new file with mode: 0755]
wme_test/plot

diff --git a/wme_test/more_sta/plot b/wme_test/more_sta/plot
new file mode 100755 (executable)
index 0000000..5b38edc
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+
+for pref in $(ls *.dat|grep -o '^[0-9]\+-..'|sort -u); do
+    echo $pref
+    ../plot -m -p -t "2 STAs;1 STA (a);1 STA (b)" $pref-paralel-*.dat $pref-1-onlylocal.dat $pref-2-onlylocal.dat
+done
diff --git a/wme_test/more_sta/run b/wme_test/more_sta/run
new file mode 100755 (executable)
index 0000000..e2787f2
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+export RUNAT="localhost/wlan1 192.168.1.103"
+dest=192.168.1.2
+
+for bw in 105 100 090 075 050; do
+    for ac in VO VI BE BK; do
+       params="-B $bw -b $ac -j 50 -s 100 -q -Q 5000 -c 30"
+       for i in $(seq $(echo $RUNAT|wc -w)); do
+           wclient -I wlan1 $params -o $bw-$ac-$i-onlylocal $dest &
+       done
+       wait
+       echo "____________________"
+       ./wclientpar $params -o $bw-$ac-paralel $dest
+       echo "===================="
+    done
+done
diff --git a/wme_test/more_sta/wclientpar b/wme_test/more_sta/wclientpar
new file mode 100755 (executable)
index 0000000..23dd71a
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+
+sub get_output {
+    my @a=@ARGV;
+    my $output = "delay_stats";
+    while ($#a >= 0) {
+       if ($a[0] eq "-o") {
+           $output = $a[1];
+       };
+       shift @a;
+    }
+    return $output;
+}
+
+@run_at = qw!localhost localhost localhost/wlan1!;
+@run_at = split(/ +/, $ENV{'RUNAT'}) if $ENV{'RUNAT'};
+
+$i = 0;
+my %outputs;
+foreach $run (@run_at) {
+    ($host, $iface) = split(/\//, $run, 2);
+    @args = ('ssh', $host) if ($host ne 'localhost');
+    push @args, ('wclient');
+    push @args, @ARGV;
+    if (defined $iface) { push @args, ('-I', $iface); }
+    $output = get_output();
+    $output .= sprintf("-%s%s", $host, defined $iface ? "-$iface":"");
+    if ($outputs{$output}) { $output .= sprintf("-%02d", $i); }
+    $outputs{$output} = 1;
+    push(@args, ('-o', $output));
+    if (fork() == 0) {
+       print "running ", join(' ', @args), "\n";
+       exec(@args);
+       exit();
+    }
+    $i++;
+}
+foreach $run (@run_at) {
+    wait();
+}
index 54dafe5e555e27a9329af26822b1748bf1e87cc3..3fb31f485cdeb1bfb864929fbcf62ae5290cbebe 100755 (executable)
@@ -9,9 +9,11 @@ $MULTIPDF_FILENAME="all.pdf";
 
 # Process command line options
 my %opt;
-getopts('bd:enso:pP', \%opt);
-
+getopts('bd:emnso:pPt:', \%opt);
+$PLOT_SINGLE_EXPERIMENT = $opt{'m'} ? 0 : 1;
+$EXPERIMENT_TITLES = $opt{'t'};
 $PLOT_BOTH_DIRECTIONS=1 if $opt{'b'};
+$
 $DELAY_BOUND="[0:".$opt{'d'}."]" if $opt{'d'};
 $SET_TERM_TEMPLATE='set term postscript color eps enhanced; set output "${FILE}.eps"' if $opt{'e'};
 $SET_TERM_TEMPLATE='set term png enhanced; set output "${FILE}.png"' if $opt{'n'};
@@ -77,6 +79,9 @@ set size 1,0.8
 unset label
 set label "${COMMAND}" noenhanced at graph 0,1.3
 set label "${STREAMS}" noenhanced at graph 0,1.2 font "Helvetica,9"
+/;
+    if ($PLOT_SINGLE_EXPERIMENT) {
+       print CMD qq/
 set style line 1  lt 1 lc rgb "red"
 set style line 2  lt 1 lc rgb "green"
 set style line 3  lt 1 lc rgb "blue"
@@ -90,15 +95,14 @@ set style line 10 lt 3 lc rgb "green" lw 2
 set style line 11 lt 3 lc rgb "blue" lw 2
 set style line 12 lt 3 lc rgb "magenta" lw 2
 /;
-
-    print CMD qq/plot $DELAY_BOUND [0.01:100]\\
+       print CMD qq/plot $DELAY_BOUND [0.01:100]\\
      "${FILE}.dat" index 0 with linespoints ls 1 title "AC\\\\_VO",\\
      "${FILE}.dat" index 1 with linespoints ls 2 title "AC\\\\_VI",\\
      "${FILE}.dat" index 2 with linespoints ls 3 title "AC\\\\_BE",\\
      "${FILE}.dat" index 3 with linespoints ls 4 title "AC\\\\_BK"/;
 
-    if ($PLOT_BOTH_DIRECTIONS) {
-       print CMD qq/,\\
+       if ($PLOT_BOTH_DIRECTIONS) {
+           print CMD qq/,\\
      "${FILE}.dat" index 0 using 1:3 with lines ls 5  title "AC\\\\_VO cs",\\
      "${FILE}.dat" index 1 using 1:3 with lines ls 6  title "AC\\\\_VI cs",\\
      "${FILE}.dat" index 2 using 1:3 with lines ls 7  title "AC\\\\_BE cs",\\
@@ -108,9 +112,52 @@ set style line 12 lt 3 lc rgb "magenta" lw 2
      "${FILE}.dat" index 2 using 1:4 with lines ls 11 title "AC\\\\_BE sc",\\
      "${FILE}.dat" index 3 using 1:4 with lines ls 12 title "AC\\\\_BK sc"
 /;
+       } else {
+           print CMD "\n";
+       }
     } else {
+       # Multiple experiments in a single plot
+       print CMD qq/
+set style line 1  lt 1 lc rgb "red" lw 2
+set style line 2  lt 1 lc rgb "green" lw 2
+set style line 3  lt 1 lc rgb "blue" lw 2
+set style line 4  lt 1 lc rgb "magenta" lw 2
+set style line 5  lt 2 lc rgb "red" lw 2
+set style line 6  lt 2 lc rgb "green" lw 2
+set style line 7  lt 2 lc rgb "blue" lw 2
+set style line 8  lt 2 lc rgb "magenta" lw 2
+set style line 9  lt 3 lc rgb "red" lw 2
+set style line 10 lt 3 lc rgb "green" lw 2
+set style line 11 lt 3 lc rgb "blue" lw 2
+set style line 12 lt 3 lc rgb "magenta" lw 2
+/;
+       my ($ls1, $ls2, $ls3, $ls4) = (1,2,3,4);
+       my @titles = split(/;/, $EXPERIMENT_TITLES);
+       my $experiment = 0;
+       my $t=$titles[$experiment];
+       $t = '' unless $t;
+       print CMD qq/plot $DELAY_BOUND [0.01:100]\\
+     "${FILE}.dat" index 0 with lines ls $ls1 title "AC\\\\_VO $t",\\
+     "${FILE}.dat" index 1 with lines ls $ls2 title "AC\\\\_VI $t",\\
+     "${FILE}.dat" index 2 with lines ls $ls3 title "AC\\\\_BE $t",\\
+     "${FILE}.dat" index 3 with lines ls $ls4 title "AC\\\\_BK $t"/;
+       foreach $dat_file (@ARGV[1,2]) {
+           last if (!defined $dat_file);
+           $experiment++;
+           $t=$titles[$experiment];
+           $t = '' unless $t;
+           ($FILE, , ) = fileparse($dat_file, (".dat"));
+           ($ls1, $ls2, $ls3, $ls4) = map($_+4, ($ls1, $ls2, $ls3, $ls4));
+           print CMD qq/,\\
+     "${FILE}.dat" index 0 with lines ls $ls1 title "AC\\\\_VO $t",\\
+     "${FILE}.dat" index 1 with lines ls $ls2 title "AC\\\\_VI $t",\\
+     "${FILE}.dat" index 2 with lines ls $ls3 title "AC\\\\_BE $t",\\
+     "${FILE}.dat" index 3 with lines ls $ls4 title "AC\\\\_BK $t"/;
+       }
        print CMD "\n";
+       last;
     }
+
     close CMD;
 }