Historic archive of defunct list bismark-commits@lists.bufferbloat.net
 help / color / mirror / Atom feed
From: walter@svn.comics.unina.it
To: bismark-commits@lists.bufferbloat.net
Subject: [Bismark-commits] rev 329 - trunk/mserver trunk/mserver/bin trunk/mserver/etc trunk/mserver/scripts trunk/mserver/www
Date: Thu, 28 Apr 2011 00:16:58 +0200	[thread overview]
Message-ID: <E1QFD2Y-0004tO-Qn@svn.comics.unina.it> (raw)

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 @@
-<?php
-	// Check duration
-	$duration = $_GET['duration'];
-	if ($duration <= 1)
-		$duration = 2;
-	if ($duration >= 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 @@
-<?php
-
-$logname = "/tmp/stats";
-
-/* PUT data comes in on the stdin stream */
-$putdata = fopen("php://input", "r");
-$stats = fopen($logname, "w");
-
-/* Read the data 1 packet at a time */
-$int_start = microtime(true);
-$bytes = 0;
-while ($data = fread($putdata, 1420)) {
-	if (($curr = microtime(true)) > ($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 @@
+<?php
+	// Check duration
+	$duration = $_GET['duration'];
+	if ($duration <= 1)
+		$duration = 2;
+	if ($duration >= 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 @@
+<?php
+
+$logname = "/tmp/stats";
+
+/* PUT data comes in on the stdin stream */
+$putdata = fopen("php://input", "r");
+$stats = fopen($logname, "w");
+
+/* Read the data 1 packet at a time */
+$int_start = microtime(true);
+$bytes = 0;
+while ($data = fread($putdata, 1420)) {
+	if (($curr = microtime(true)) > ($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");
+?>


                 reply	other threads:[~2011-04-27 22:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1QFD2Y-0004tO-Qn@svn.comics.unina.it \
    --to=walter@svn.comics.unina.it \
    --cc=bismark-commits@lists.bufferbloat.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox