Tadam! Netem is now fully integrated into mfold.
authorVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Tue, 2 Mar 2010 16:31:24 +0000 (17:31 +0100)
committerVictor Grishchenko (mughal) <victor.grishchenko@gmail.com>
Tue, 2 Mar 2010 16:31:24 +0000 (17:31 +0100)
Use env.*.sh scripts to define network parameters of emulated peers.
Still TODO: uplink emulation.

14 files changed:
BUGS
mfold/build.default.sh
mfold/clean.default.sh
mfold/docmd
mfold/dohrv
mfold/env.1mbit.sh [new file with mode: 0644]
mfold/env.default.sh
mfold/env.lossy.sh [new file with mode: 0644]
mfold/env.messy.sh [new file with mode: 0644]
mfold/loggraphs
mfold/logreport
mfold/netem.default.sh [new file with mode: 0755]
mfold/run.default.sh
mfold/run.seeder.sh

diff --git a/BUGS b/BUGS
index d17adfb..a307743 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1,12 +1,14 @@
+    * min_owd TINT_NEVER is logged
+
     v hints, data for non-existing ranges
-    * opens multiple channels to the same address
+    v opens multiple channels to the same address
     v hints do not expire
     v RTT calculations need improvement (test)
     v google-log is unnecessary
     * reduce template use (peer queue)
     v hints do not expire
     v survive 10% loss
-    * unlimited ping pong
+    v unlimited ping pong
     v git sha-1
     v check hints agains ack_out?_
     v check data against ack_in
      0_11_10_575_703 #9 sendctrl loss detected
      0_11_10_575_703 #9 Tdata (0,194)
      0_11_10_575_703 #9 sendctrl may send 0 < 0.000000 & 1732919509_-49_-44_-700_-110 (rtt 59661)
-    * complete peer reconnects 1259967418.out.gz
+    v complete peer reconnects 1259967418.out.gz
     * underhinting causes repetition causes interarr underest causes underhinting
     * misterious initiating handshake bursts
     v whether sending is limited by cwnd or app
     * actually: whether packets are ACKed faster than sent
     * uproot DATA NONE: complicates and deceives
-    * r735 goes to github; r741
+    v r735 goes to github; r741
     * receiver is swapping => strange behavior
     v on high losses cwnd goes to silly fractions => slows down recovery
-    * code the pingpong<->keepalive<->slowstart transition
-    * empty datagram hammering (see at linode)
+    v code the pingpong<->keepalive<->slowstart transition
+    v empty datagram hammering (see at linode)
     * make a testkit!!!
     * never back from keepalive syndrome (because of underhashing)
     * HTTP daemon, combined select() loop
     * range requests, priorities
-    * LEDBAT
+    v LEDBAT
     * CUBIC
     v misterious mass packet losses (!data)
index 647633c..25a6039 100644 (file)
@@ -48,9 +48,9 @@ tests/connecttest || exit 8
 
 # TODO: one method
 if [ ! -e bin ]; then mkdir bin; fi
-g++ -I. *.cpp compat/*.cpp ext/seq_picker.cpp -pg -o bin/swift-pg &
-g++ -I. *.cpp compat/*.cpp ext/seq_picker.cpp -g -o bin/swift-dbg &
-g++ -I. *.cpp compat/*.cpp ext/seq_picker.cpp -O3 -o bin/swift-o3 &
+g++ -I. *.cpp ext/seq_picker.cpp -pg -o bin/swift-pg &
+g++ -I. *.cpp ext/seq_picker.cpp -g -o bin/swift-dbg &
+g++ -I. *.cpp ext/seq_picker.cpp -O2 -o bin/swift-o2 &
 wait
 
 echo done
index c2035fd..06cb6b1 100644 (file)
@@ -1,12 +1,10 @@
-if [ -e .netem-on ]; then
-    sudo tc qdisc del dev `cat .netem-on` root
-    rm .netem-on
+if [ $EMIF ]; then
+    sudo tc qdisc del dev $EMIF ingress
+    sudo tc qdisc del dev ifb0 root
 fi
 sudo iptables -F &
 cd swift
 rm -f chunk core
-killall leecher
-killall seeder
-killall swift-o3
+killall swift-o2
 killall swift-dbg
 echo DONE
index 51c21f0..6b81d1f 100755 (executable)
@@ -4,6 +4,10 @@ HOST=$1
 CMD=$2
 ENV=env.default.sh
 
+if [ -e env.$HOST.sh ]; then
+    ENV="$ENV env.$HOST.sh"
+fi
+
 if [ -e $CMD.$HOST.sh ] ; then 
     SHSC=$CMD.$HOST.sh ;
 else 
index 2e50856..c5713b6 100755 (executable)
@@ -8,12 +8,16 @@ if [ ! $SERVERS ]; then
     export SERVERS="servers.txt"
 fi
 
-rm -rf harvest
+mv harvest .hrv-old
+rm -rf .hrv-old &
 mkdir harvest
 
 for s in `grep -v '#' $SERVERS`; do
     mkfifo harvest/$s.fifo
+    # yas, yes, yes
+    ( scp ~/.ssh/config $s:.ssh/config > /dev/null ) &
 done
+wait
 
 for s in `grep -v '#' $SERVERS`; do
     (if ssh $s \
@@ -39,5 +43,6 @@ wait
 
 rm harvest/*.fifo
 cp report.css harvest
+scp -rq harvest mfold.libswift.org:/storage/mfold-granary/`date +%d%b_%H:%M`_`whoami` &
 
 echo DONE
diff --git a/mfold/env.1mbit.sh b/mfold/env.1mbit.sh
new file mode 100644 (file)
index 0000000..11c4ece
--- /dev/null
@@ -0,0 +1,4 @@
+EMIF=eth0
+EMBW=1mbit
+EMDELAY=50ms
+
index c402dce..f110e82 100644 (file)
@@ -1,7 +1,7 @@
 # This script sets up shared environment variables
 # at the servers
 export SEEDER=130.161.211.198
-export SEEDPORT=10004
-export RUNPORT=10008
-export BRANCH=master
+export SWFTPORT=10004
+export HASH=66b9644bb01eaad09269354df00172c8a924773b
+export BRANCH=ack-have
 export ORIGIN=git://github.com/gritzko/swift.git
diff --git a/mfold/env.lossy.sh b/mfold/env.lossy.sh
new file mode 100644 (file)
index 0000000..5ce737e
--- /dev/null
@@ -0,0 +1,3 @@
+EMIF=eth0
+EMBW=1mbit
+
diff --git a/mfold/env.messy.sh b/mfold/env.messy.sh
new file mode 100644 (file)
index 0000000..c75f27e
--- /dev/null
@@ -0,0 +1,5 @@
+EMIF=eth0
+EMBW=1mbit
+EMDELAY=100ms
+EMJTTR=20ms
+
index cd13b41..44c5066 100755 (executable)
@@ -4,6 +4,8 @@ if [ -z "$SERVERS" ]; then
     SERVERS="servers.txt"
 fi
 
+VERSION=`date`,`git log --summary | head -1`
+
 cd harvest
 
 HEAD=`head -1 *.log | grep -v '^$' | cut -f1 | sort | head -1`
@@ -26,6 +28,7 @@ for from in `grep -v '^#' ../$SERVERS`; do
         echo "set y2label 'packets'" >> $GP
         echo "set ylabel 'microseconds'" >> $GP
         echo "set xlabel 'run time millis'" >> $GP
+        echo "set title '$VERSION'" >> $GP
         #echo "set xrange [$HEAD:$TAIL]" >> $GP
         CWNDLOG="$from-$to-cwnd.log"
         echo -ne "plot '$CWNDLOG' using 1:2 with lines lt rgb '#00aa00' title 'cwnd'"\
@@ -43,7 +46,7 @@ for from in `grep -v '^#' ../$SERVERS`; do
         fi
         OWDLOG="$from-$to-owd.log"
         if [ -e $OWDLOG ]; then
-            echo -ne ", '$OWDLOG' using 1:2 with lines lt rgb '#8800ee' title 'owd' "\
+            echo -ne ", '$OWDLOG' using 1:2 with lines lt rgb '#ff00ee' title 'owd' "\
                 "axis x1y1, "\
                 "'$OWDLOG' using 1:3 with lines lw 2 lt rgb '#0044cc'  title 'min owd'"\
                 "axis x1y1, "\
@@ -63,12 +66,15 @@ for from in `grep -v '^#' ../$SERVERS`; do
                 "lt rgb '#ff0000' title 't-losses'"\
                 >> $GP
         fi
-        echo >> $GP
+        echo  >> $GP
 
         echo "set term png size 512,192" >> $GP
         PNG="$from-$to.thumb.png"
         if [ -e $PNG ]; then rm $PNG; fi
         echo "set out '$PNG'" >> $GP
+        echo "unset title" >> $GP
+        echo "unset xlabel" >> $GP
+        echo "unset ylabel" >> $GP
         echo "replot" >> $GP
 
         ( cat $GP | gnuplot ) &
index bb15497..19a857b 100755 (executable)
@@ -8,7 +8,7 @@ cd harvest
 
 echo '<html><head>'
 echo '<link rel="stylesheet" href="report.css" type="text/css">'
-echo '<title>Manifold: swarm tomography</title>'
+echo '<title>Manifold: swarm tomography' `date` `git log --summary | head -1` '</title>'
 echo '</head><body>'
 echo '<table id="main"><th>'
 for to in `grep -v '#' ../$SERVERS`; do
diff --git a/mfold/netem.default.sh b/mfold/netem.default.sh
new file mode 100755 (executable)
index 0000000..cbc563c
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+if [ ! $EMIF ] ; then
+    exit
+fi
+
+if [ ! $EMLOSS ]; then
+    EMLOSS=0%
+fi
+
+if [ ! $EMDELAY ]; then
+    EMDELAY=10ms
+fi
+
+if [ ! $EMBW ]; then
+    EMBW=10mbit
+fi
+
+if [ ! $EMJTTR ]; then
+    EMJTTR=0ms
+fi
+
+TC="sudo tc "
+
+echo ifb0 up
+sudo modprobe ifb
+sudo ip link set dev ifb0 up
+
+echo cleanup
+$TC qdisc del dev $EMIF ingress
+$TC qdisc del dev ifb0 root
+echo adding ingress
+$TC qdisc add dev $EMIF ingress || exit 1
+
+echo redirecting to ifb
+$TC filter add dev $EMIF parent ffff: protocol ip prio 1 u32 \
+       match ip sport $SWFTPORT 0xffff flowid 1:1 action mirred egress redirect dev ifb0 || exit 2
+echo adding netem for $EMDELAY - $EMLOSS
+$TC qdisc add dev ifb0 root handle 1:0 netem delay $EMDELAY $EMJTTR 25% loss $EMLOSS || exit 3
+echo adding tfb for $EMBW
+$TC qdisc add dev ifb0 parent 1:1 handle 10: tbf rate $EMBW buffer 102400 latency 40ms || exit 4
+
index 0ad6ddc..034d922 100644 (file)
@@ -1,12 +1,11 @@
 #!/bin/bash
 # This script runs a leecher at some server;
 # env variables are set in env.default.sh
-HASH=66b9644bb01eaad09269354df00172c8a924773b
 
 ulimit -c 1024000
 cd swift || exit 1
 rm -f core
 rm -f chunk
 sleep $(( $RANDOM % 5 ))
-bin/swift-dbg -w -h $HASH -f chunk -t $SEEDER:$SEEDPORT \
+bin/swift-o2 -w -h $HASH -f chunk -t $SEEDER:$SWFTPORT \
     -l 0.0.0.0:$RUNPORT -p -D 2>lerr | gzip > lout.gz || exit 2
index 3479952..c5ecaca 100644 (file)
@@ -6,6 +6,6 @@ if [ ! -e ScottKim_2008P.mp4 ]; then
     wget -c http://video.ted.com/talks/podcast/ScottKim_2008P.mp4 || exit 1
 fi
 
-bin/swift-dbg -w -f ScottKim_2008P.mp4 -p -D \
-    -l 0.0.0.0:$SEEDPORT 2>lerr | gzip > lout.gz || exit 2
+bin/swift-o2 -w -f ScottKim_2008P.mp4 -p -D \
+    -l 0.0.0.0:$SWFTPORT 2>lerr | gzip > lout.gz || exit 2
 exit