From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from svn.comics.unina.it (unknown [143.225.229.147]) by huchra.bufferbloat.net (Postfix) with ESMTP id B2232201A3B for ; Wed, 27 Apr 2011 15:12:14 -0700 (PDT) Received: from www-data by svn.comics.unina.it with local (Exim 4.69) (envelope-from ) id 1QFD2Y-0004tO-Qn for bismark-commits@lists.bufferbloat.net; Thu, 28 Apr 2011 00:16:58 +0200 To: bismark-commits@lists.bufferbloat.net From: walter@svn.comics.unina.it Message-Id: Date: Thu, 28 Apr 2011 00:16:58 +0200 Subject: [Bismark-commits] rev 329 - trunk/mserver trunk/mserver/bin trunk/mserver/etc trunk/mserver/scripts trunk/mserver/www X-BeenThere: bismark-commits@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Commit log for the bismark source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2011 22:12:15 -0000 Author: walter Date: 2011-04-28 00:16:58 +0200 (Thu, 28 Apr 2011) New Revision: 329 Added: trunk/mserver/bin/ trunk/mserver/bin/ITGDec trunk/mserver/bin/ITGRecv trunk/mserver/bin/ITGSend trunk/mserver/bin/probeserver trunk/mserver/etc/ trunk/mserver/etc/crontab trunk/mserver/etc/mserver.conf trunk/mserver/scripts/ trunk/mserver/scripts/daemons trunk/mserver/scripts/ritg trunk/mserver/scripts/rtr trunk/mserver/scripts/setup_mlab trunk/mserver/scripts/uprate trunk/mserver/www/ trunk/mserver/www/download.php trunk/mserver/www/upload.php Removed: trunk/mserver/ITGDec trunk/mserver/ITGRecv trunk/mserver/ITGSend trunk/mserver/crontab trunk/mserver/daemons trunk/mserver/download.php trunk/mserver/pls_setup trunk/mserver/ritg trunk/mserver/rtr trunk/mserver/upload.php trunk/mserver/uprate Log: better mserver folders (step 1) Deleted: trunk/mserver/ITGDec =================================================================== (Binary files differ) Deleted: trunk/mserver/ITGRecv =================================================================== (Binary files differ) Deleted: trunk/mserver/ITGSend =================================================================== (Binary files differ) Copied: trunk/mserver/bin/ITGDec (from rev 328, trunk/mserver/ITGDec) =================================================================== (Binary files differ) Copied: trunk/mserver/bin/ITGRecv (from rev 328, trunk/mserver/ITGRecv) =================================================================== (Binary files differ) Copied: trunk/mserver/bin/ITGSend (from rev 328, trunk/mserver/ITGSend) =================================================================== (Binary files differ) Added: trunk/mserver/bin/probeserver =================================================================== (Binary files differ) Property changes on: trunk/mserver/bin/probeserver ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Deleted: trunk/mserver/crontab =================================================================== --- trunk/mserver/crontab 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/crontab 2011-04-27 22:16:58 UTC (rev 329) @@ -1,2 +0,0 @@ -# m h dom mon dow command -*/5 * * * * ./daemons >/dev/null 2>&1 & Deleted: trunk/mserver/daemons =================================================================== --- trunk/mserver/daemons 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/daemons 2011-04-27 22:16:58 UTC (rev 329) @@ -1,8 +0,0 @@ -#!/bin/bash -touch /tmp/itg.log -pgrep -f TCP-LISTEN:110 >/dev/null || ./rtr -pgrep -f TCP-LISTEN:143 >/dev/null || ./ritg -pgrep -f TCP-LISTEN:777 >/dev/null || ./uprate -pgrep -f ITGRecv >/dev/null || ( sudo ./ITGRecv >> /tmp/itg.log 2>&1 & ) -pgrep -f probeserver >/dev/null || ( ./probeserver >> /tmp/spserver.log 2>&1 & ) - Deleted: trunk/mserver/download.php =================================================================== --- trunk/mserver/download.php 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/download.php 2011-04-27 22:16:58 UTC (rev 329) @@ -1,30 +0,0 @@ -= 60) - $duration = 60; - - // Compute max transfer size - $rate = $_GET['kbps'] / 8; - $bytes = $rate * 1000 * $duration; - $size = 1460; - - // Set time variables - $start = time(); - $end = $start + $duration; - - // Create payload pattern - $str = ""; - for ($i=0;$i<=$size;$i++) - $str = sprintf("%s%c", $str, (48 + $i) % 78); - - // Generate payload - $bytes_left = $bytes; - do { - $countdown = $end - time(); - $bytes_left -= $size; - printf("%s", $str); - } while($countdown > 0 && $bytes_left > 0); -?> Copied: trunk/mserver/etc/crontab (from rev 328, trunk/mserver/crontab) =================================================================== --- trunk/mserver/etc/crontab (rev 0) +++ trunk/mserver/etc/crontab 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,2 @@ +# m h dom mon dow command +*/5 * * * * ~/scripts/daemons >/dev/null 2>&1 & Added: trunk/mserver/etc/mserver.conf =================================================================== --- trunk/mserver/etc/mserver.conf (rev 0) +++ trunk/mserver/etc/mserver.conf 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,16 @@ +# Bismark measurement server configuration + +IFNAME=eth0 + +# Web server options +HTTP_PORT=8080 + +# D-ITG options +ITG_DW_PORT=8889 +ITG_UP_PORT=143 + +# Traceroute options +RTR_PORT=110 + +# Uprate options +UPRATE_PORT=777 Deleted: trunk/mserver/pls_setup =================================================================== --- trunk/mserver/pls_setup 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/pls_setup 2011-04-27 22:16:58 UTC (rev 329) @@ -1,8 +0,0 @@ -#!/bin/sh - -sudo yum install curl lighttpd php-cli-5.2.6-2.fc8.i386 - -echo "cgi.fix_pathinfo = 1" >> /etc/php.ini - -# decommenta fcgi in lighttpd.conf - Deleted: trunk/mserver/ritg =================================================================== --- trunk/mserver/ritg 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/ritg 2011-04-27 22:16:58 UTC (rev 329) @@ -1,29 +0,0 @@ -#!/bin/bash - -if [ ! $1 ]; then - sudo socat TCP-LISTEN:143,fork,reuseaddr EXEC:"$0 run",su-d=bismark2,pipes & - exit -fi - -# Parse input -read cmd opt - -case $cmd in -send) - if [ ${opt:0:2} == "-H" ]; then - echo $opt >> /tmp/itg.log - ./ITGSend $opt >> /tmp/itg.log 2>&1 & - fi -;; -log) - echo $cmd - $opt >> /tmp/itg.log - ./ITGDec $opt -j 1000 $opt.jitter -p 1000 $opt.pktloss -b 1000 $opt.bitrate 2> /dev/null - echo bitrate - awk '(NR > 1){ print $3 }' $opt.bitrate - echo jitter - awk '(NR > 1){ print $3 }' $opt.jitter - echo pktloss - awk '(NR > 1){ print $3 }' $opt.pktloss - sudo rm $opt $opt.* -;; -esac Deleted: trunk/mserver/rtr =================================================================== --- trunk/mserver/rtr 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/rtr 2011-04-27 22:16:58 UTC (rev 329) @@ -1,16 +0,0 @@ -#!/bin/bash - -if [ ! $1 ]; then - sudo socat TCP-LISTEN:110,fork,reuseaddr EXEC:"$0 run",pipes & - exit -fi - -# Parse input -read type rest - -# Select traceroute type -case $type in -ICMP) traceroute -n -q1 -I $SOCAT_PEERADDR ;; -UDP) traceroute -n -q1 $SOCAT_PEERADDR ;; -TCP) traceroute -n -q1 -T $SOCAT_PEERADDR ;; -esac Copied: trunk/mserver/scripts/daemons (from rev 328, trunk/mserver/daemons) =================================================================== --- trunk/mserver/scripts/daemons (rev 0) +++ trunk/mserver/scripts/daemons 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,16 @@ +#!/bin/bash + +# Load configuration +. ~/etc/mserver.conf + +# Create log files +touch /tmp/itg.log + +# Check running daemons +pgrep -f TCP-LISTEN:$RTR_PORT >/dev/null || ~/scripts/rtr +pgrep -f TCP-LISTEN:$ITG_DW_PORT >/dev/null || ~/scripts/itg_dw +pgrep -f TCP-LISTEN:$UPRATE_PORT >/dev/null || ~/scripts/uprate +pgrep -f ITGRecv >/dev/null || ~/scripts/itg_up +#pgrep -f ITGRecv >/dev/null || ( sudo ./ITGRecv >> /tmp/itg.log 2>&1 & ) +pgrep -f probeserver >/dev/null || ( ~/bin/probeserver >> /tmp/spserver.log 2>&1 & ) + Copied: trunk/mserver/scripts/ritg (from rev 328, trunk/mserver/ritg) =================================================================== --- trunk/mserver/scripts/ritg (rev 0) +++ trunk/mserver/scripts/ritg 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ ! $1 ]; then + sudo socat TCP-LISTEN:143,fork,reuseaddr EXEC:"$0 run",su-d=bismark2,pipes & + exit +fi + +# Parse input +read cmd opt + +case $cmd in +send) + if [ ${opt:0:2} == "-H" ]; then + echo $opt >> /tmp/itg.log + ./ITGSend $opt >> /tmp/itg.log 2>&1 & + fi +;; +log) + echo $cmd - $opt >> /tmp/itg.log + ./ITGDec $opt -j 1000 $opt.jitter -p 1000 $opt.pktloss -b 1000 $opt.bitrate 2> /dev/null + echo bitrate + awk '(NR > 1){ print $3 }' $opt.bitrate + echo jitter + awk '(NR > 1){ print $3 }' $opt.jitter + echo pktloss + awk '(NR > 1){ print $3 }' $opt.pktloss + sudo rm $opt $opt.* +;; +esac Copied: trunk/mserver/scripts/rtr (from rev 328, trunk/mserver/rtr) =================================================================== --- trunk/mserver/scripts/rtr (rev 0) +++ trunk/mserver/scripts/rtr 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,16 @@ +#!/bin/bash + +if [ ! $1 ]; then + sudo socat TCP-LISTEN:110,fork,reuseaddr EXEC:"$0 run",pipes & + exit +fi + +# Parse input +read type rest + +# Select traceroute type +case $type in +ICMP) traceroute -n -q1 -I $SOCAT_PEERADDR ;; +UDP) traceroute -n -q1 $SOCAT_PEERADDR ;; +TCP) traceroute -n -q1 -T $SOCAT_PEERADDR ;; +esac Copied: trunk/mserver/scripts/setup_mlab (from rev 328, trunk/mserver/pls_setup) =================================================================== --- trunk/mserver/scripts/setup_mlab (rev 0) +++ trunk/mserver/scripts/setup_mlab 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,10 @@ +#!/bin/sh + +sudo yum -y install socat + +# lighttpd php-cli-5.2.6-2.fc8.i386 + +echo "cgi.fix_pathinfo = 1" >> /etc/php.ini + +# decommenta fcgi in lighttpd.conf + Copied: trunk/mserver/scripts/uprate (from rev 328, trunk/mserver/uprate) =================================================================== --- trunk/mserver/scripts/uprate (rev 0) +++ trunk/mserver/scripts/uprate 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,49 @@ +#!/bin/bash + +# Load configuration +. ~/etc/mserver.conf + +if [ ! $1 ]; then + ( sudo socat TCP-LISTEN:$UPRATE_PORT,fork,reuseaddr EXEC:"$0 run",su-d=$LOGNAME,pipes ) & + exit +fi + +ip=$SOCAT_PEERADDR + +# Parse input +read cmd opt + +case $cmd in +start) + ( sudo /usr/sbin/tcpdump -tt -n -i $IFNAME tcp and ip src $ip and dst port $HTTP_PORT >/tmp/$ip.rate 2>/dev/null ) & + echo $! +;; +stop) + sudo kill $opt + + awk ' + BEGIN{ + stime=0 + bytes=0 + } + { + if ($1 > 0) + ltime=$1 + if (stime == 0) + stime=ltime + if (ltime - stime > 1) { + print bytes/125 + bytes=0 + stime=ltime + } + bytes += $21 + } + END{ + if (ltime - stime > 0) + print ((bytes/125) / (ltime - stime)) + }' /tmp/$ip.rate + rm /tmp/$ip.rate +;; +esac + + Deleted: trunk/mserver/upload.php =================================================================== --- trunk/mserver/upload.php 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/upload.php 2011-04-27 22:16:58 UTC (rev 329) @@ -1,27 +0,0 @@ - ($int_start + 1)) { - fprintf($stats, "%u\n", $bytes * 8); - $int_start = $curr; - $bytes = 0; - } - $bytes += strlen($data); -} -$end = microtime(true); -fprintf($stats, "%f %f - %u %u\n", $int_start, $end, $bytes, ($bytes * 8)/($end - $int_start) ); - -fclose($putdata); -fclose($stats); - -Header("HTTP/1.1 201 Created"); -?> Deleted: trunk/mserver/uprate =================================================================== --- trunk/mserver/uprate 2011-04-20 02:57:47 UTC (rev 328) +++ trunk/mserver/uprate 2011-04-27 22:16:58 UTC (rev 329) @@ -1,46 +0,0 @@ -#!/bin/bash - -if [ ! $1 ]; then - ( sudo socat TCP-LISTEN:777,fork,reuseaddr EXEC:"$0 run",su-d=bismark2,pipes ) & - exit -fi - -ip=$SOCAT_PEERADDR - -# Parse input -read cmd opt - -case $cmd in -start) - ( sudo /usr/sbin/tcpdump -tt -n -i eth1 tcp and ip src $ip and dst port 8080 >/tmp/$ip.rate 2>/dev/null ) & - echo $! -;; -stop) - sudo kill $opt - - awk ' - BEGIN{ - stime=0 - bytes=0 - } - { - if ($1 > 0) - ltime=$1 - if (stime == 0) - stime=ltime - if (ltime - stime > 1) { - print bytes/125 - bytes=0 - stime=ltime - } - bytes += $21 - } - END{ - if (ltime - stime > 0) - print ((bytes/125) / (ltime - stime)) - }' /tmp/$ip.rate - rm /tmp/$ip.rate -;; -esac - - Copied: trunk/mserver/www/download.php (from rev 328, trunk/mserver/download.php) =================================================================== --- trunk/mserver/www/download.php (rev 0) +++ trunk/mserver/www/download.php 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,30 @@ += 60) + $duration = 60; + + // Compute max transfer size + $rate = $_GET['kbps'] / 8; + $bytes = $rate * 1000 * $duration; + $size = 1460; + + // Set time variables + $start = time(); + $end = $start + $duration; + + // Create payload pattern + $str = ""; + for ($i=0;$i<=$size;$i++) + $str = sprintf("%s%c", $str, (48 + $i) % 78); + + // Generate payload + $bytes_left = $bytes; + do { + $countdown = $end - time(); + $bytes_left -= $size; + printf("%s", $str); + } while($countdown > 0 && $bytes_left > 0); +?> Copied: trunk/mserver/www/upload.php (from rev 328, trunk/mserver/upload.php) =================================================================== --- trunk/mserver/www/upload.php (rev 0) +++ trunk/mserver/www/upload.php 2011-04-27 22:16:58 UTC (rev 329) @@ -0,0 +1,27 @@ + ($int_start + 1)) { + fprintf($stats, "%u\n", $bytes * 8); + $int_start = $curr; + $bytes = 0; + } + $bytes += strlen($data); +} +$end = microtime(true); +fprintf($stats, "%f %f - %u %u\n", $int_start, $end, $bytes, ($bytes * 8)/($end - $int_start) ); + +fclose($putdata); +fclose($stats); + +Header("HTTP/1.1 201 Created"); +?>