* [Bismark-commits] rev 336 - trunk/device/OpenWrt_common/etc trunk/device/OpenWrt_common/scripts
@ 2011-05-17 21:55 walter
0 siblings, 0 replies; only message in thread
From: walter @ 2011-05-17 21:55 UTC (permalink / raw)
To: bismark-commits
Author: walter
Date: 2011-05-17 23:55:39 +0200 (Tue, 17 May 2011)
New Revision: 336
Removed:
trunk/device/OpenWrt_common/scripts/bismark-netperf-thread
Modified:
trunk/device/OpenWrt_common/etc/bismark.conf
trunk/device/OpenWrt_common/scripts/bismark-bootstrap
trunk/device/OpenWrt_common/scripts/bismark-ditg
trunk/device/OpenWrt_common/scripts/bismark-dns
trunk/device/OpenWrt_common/scripts/bismark-measure-active
trunk/device/OpenWrt_common/scripts/bismark-netperf
trunk/device/OpenWrt_common/scripts/bismark-ping
trunk/device/OpenWrt_common/scripts/bismark-sp
trunk/device/OpenWrt_common/scripts/bismark-tr
Log:
revised active measures (ditg disabled)
Modified: trunk/device/OpenWrt_common/etc/bismark.conf
===================================================================
--- trunk/device/OpenWrt_common/etc/bismark.conf 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/etc/bismark.conf 2011-05-17 21:55:39 UTC (rev 336)
@@ -4,7 +4,7 @@
# Local modifications can be applied overriding variables in local.conf
# Bismark Central Server
-SERVER=143.215.131.215
+SERVER=prober.projectbismark.net
USER=bismark
SSH_KEY=/etc/bismark/bismark_key
PROBE_PORTS="53 1028 1234 5353 54321"
Modified: trunk/device/OpenWrt_common/scripts/bismark-bootstrap
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-bootstrap 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-bootstrap 2011-05-17 21:55:39 UTC (rev 336)
@@ -8,7 +8,6 @@
# Create temporary tree
mkdir -p /tmp/bismark/var
-mkdir -p /tmp/bismark/data
# Pull device specific configuration from the server
#action config pull
Modified: trunk/device/OpenWrt_common/scripts/bismark-ditg
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-ditg 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-ditg 2011-05-17 21:55:39 UTC (rev 336)
@@ -7,6 +7,8 @@
. /etc/bismark/bismark.conf
. /usr/lib/bismark/functions.inc.sh
+# Settings
+DATA_DIR=/tmp/bismark/active/ditg
exit 0
# Help screen
[ $6 ] || {
@@ -25,7 +27,8 @@
'
# Change path
-cd /tmp
+mkdir -p $DATA_DIR
+cd $DATA_DIR
[ -e itgfifo ] || mkfifo itgfifo
get_ip
tstamp=$(date +%s)
@@ -41,14 +44,13 @@
up)
ITGSend -a $2 -rp 0 -T TCP -c $pkt_size -C $pkt_rate -t ${5}000 -x /tmp/${DEVICE_ID}_$tstamp.log >/dev/null 2>&1
echo "log /tmp/${DEVICE_ID}_$tstamp.log" | nc -n $2 $3 | awk "$filter"
- cat bitrate.dat | mstats BITRATE DITG $src $2 | grep -v nan
+ cat bitrate.dat | bismark-mstats BITRATE DITG $src $2 | grep -v nan
;;
dw)
- RANDOM=$(( `date +%s` % 32767 ))
- port=$(( RANDOM % 5000 + 10000 ))
+ port=$(random 5000 15000)
{ echo "send -H -Ssp $port -rp 0 -T TCP -c $pkt_size -C $pkt_rate -t ${5}000" ; sleep 1 ; } | nc $NC_OPTS $2 $3
ITGRecv -H $2 -Sp $port -l itgfifo 2>/dev/null | ITGDec itgfifo -b 1000 > /dev/null 2>&1
- awk '(NR > 1){ print $3 }' bitrate.dat | mstats BITRATE DITG $2 $src | grep -v nan
+ awk '(NR > 1){ print $3 }' bitrate.dat | bismark-mstats BITRATE DITG $2 $src | grep -v nan
;;
esac
;;
@@ -61,16 +63,16 @@
up)
ITGSend -a $2 -rp 0 -T UDP -c $pkt_size -C $pkt_rate -t ${5}000 -x /tmp/${DEVICE_ID}_$tstamp.log >/dev/null 2>&1
echo "log /tmp/${DEVICE_ID}_$tstamp.log" | nc -n $2 $3 | awk "$filter"
- cat jitter.dat | mstats JITTER DITG $src $2 | grep -v nan
- cat packetloss.dat | mstats PKTLOSS DITG $src $2 | grep -v nan
+ cat jitter.dat | bismark-mstats JITTER DITG $src $2 | grep -v nan
+ cat packetloss.dat | bismark-mstats PKTLOSS DITG $src $2 | grep -v nan
;;
dw)
RANDOM=$(( `date +%s` % 32767 ))
port=$(( RANDOM % 5000 + 10000 ))
{ echo "send -H -Ssp $port -rp 0 -T UDP -c $pkt_size -C $pkt_rate -t ${5}000" ; sleep 1 ; } | nc $NC_OPTS $2 $3
ITGRecv -H $2 -Sp $port -l itgfifo 2>/dev/null | ITGDec itgfifo -p 1000 -j 1000 > /dev/null 2>&1
- awk '(NR > 1){ print $3 }' jitter.dat | mstats JITTER DITG $2 $src | grep -v nan
- awk '(NR > 1){ print $3 }' packetloss.dat | mstats PKTLOSS DITG $2 $src | grep -v nan
+ awk '(NR > 1){ print $3 }' jitter.dat | bismark-mstats JITTER DITG $2 $src | grep -v nan
+ awk '(NR > 1){ print $3 }' packetloss.dat | bismark-mstats PKTLOSS DITG $2 $src | grep -v nan
;;
esac
;;
@@ -83,14 +85,14 @@
up)
ITGSend -a $2 -rp 0 -T UDP -c $pkt_size -C $pkt_rate -t ${5}000 -x /tmp/${DEVICE_ID}_$tstamp.log >/dev/null 2>&1
echo "log /tmp/${DEVICE_ID}_$tstamp.log" | nc -n $2 $3 | awk "$filter"
- cat bitrate.dat | mstats UDPBITRATE DITG $src $2 | grep -v nan
+ cat bitrate.dat | bismark-mstats UDPBITRATE DITG $src $2 | grep -v nan
;;
dw)
RANDOM=$(( `date +%s` % 32767 ))
port=$(( RANDOM % 5000 + 10000 ))
{ echo "send -H -Ssp $port -rp 0 -T UDP -c $pkt_size -C $pkt_rate -t ${5}000" ; sleep 1 ; } | nc $NC_OPTS $2 $3
ITGRecv -H $2 -Sp $port -l itgfifo 2>/dev/null | ITGDec itgfifo -b 1000 > /dev/null 2>&1
- awk '(NR > 1){ print $3 }' bitrate.dat | mstats UDPBITRATE DITG $2 $src | grep -v nan
+ awk '(NR > 1){ print $3 }' bitrate.dat | bismark-mstats UDPBITRATE DITG $2 $src | grep -v nan
;;
esac
;;
Modified: trunk/device/OpenWrt_common/scripts/bismark-dns
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-dns 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-dns 2011-05-17 21:55:39 UTC (rev 336)
@@ -1,37 +1,40 @@
#!/bin/ash
-# Bismark dns wrapper
-#
+# Bismark nslookup wrapper
+#
# author: walter.dedonato@unina.it
# Load configuration files
. /etc/bismark/bismark.conf
. /usr/lib/bismark/functions.inc.sh
+# Settings
+DATA_DIR=/tmp/bismark/active/nslookup
+mkdir -p $DATA_DIR
+
# Get IP and default DNS server
-get_ip
-[ -e /etc/resolv.conf ] && dds=$(awk '/^nameserver/{ print $2 ; exit }' /etc/resolv.conf)
+get_ip # Returns $src
+[ -e /etc/resolv.conf ] && local_dns=$(awk '/^nameserver/{ print $2 ; exit }' /etc/resolv.conf)
+
# Cycle DNS servers (default and OpenDNS)
-mkdir -p /tmp/host
-for s in "$dds" "8.8.8.8"; do
-
+for s in "$local_dns" "8.8.8.8"; do
# Cycle cache no-cache
for m in NC C; do
# Cycle top 10 hosts list
fail=0
count=0
- rm /tmp/host/delays
+ rm $DATA_DIR/delays
IFS=$'\n'
- for h in $(cat ~/conf/hosts.list); do
- ~/bin/time -f %e --append -o /tmp/host/delays host $h $s >/dev/null || : $((fail++))
+ for h in $(cat /usr/lib/bismark/hosts.list); do
+ time -f %e --append -o $DATA_DIR/delays nslookup $h $s >/dev/null || : $((fail++))
: $((count++))
done
# Output
[ $s ] || s="127.0.0.1"
- grep '^[0-9]' /tmp/host/delays | mstats DNSDELAY$m HOST $src $s
- awk 'BEGIN{ print ('$fail'/'$count') * 100 }' | mstats DNSFAIL$m HOST $src $s
+ grep '^[0-9]' $DATA_DIR/delays | bismark-mstats DNSDELAY$m HOST $src $s
+ awk 'BEGIN{ print ('$fail'/'$count') * 100 }' | bismark-mstats DNSFAIL$m HOST $src $s
done
done
Modified: trunk/device/OpenWrt_common/scripts/bismark-measure-active
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-measure-active 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-measure-active 2011-05-17 21:55:39 UTC (rev 336)
@@ -10,7 +10,7 @@
# Configuration
COUNTER="/tmp/bismark/var/counter"
MEASURE_REPLY="/tmp/bismark/var/mreply"
-XML_FILE="/tmp/bismark/data/${DEVICE_ID}_$(date +%s).xml"
+XML_FILE="/tmp/bismark/active/${DEVICE_ID}_$(date +%s).xml"
# --- Functions ---
@@ -31,6 +31,10 @@
# $dst, $info and $wait
get_target ()
{
+ # Select probe port
+ read port_counter < /tmp/bismark/var/port_counter
+ PROBE_PORT=$(echo $PROBE_PORTS | awk '{print $'$((port_counter + 1))'}')
+
# Send message
msg "$1 $2 $3 $4" | nc -u $NC_OPTS $SERVER $PROBE_PORT > $MEASURE_REPLY
@@ -76,7 +80,7 @@
</traceroute>
end
fi
- gwip=$(cat /tmp/gwip)
+ gwip=$(cat /tmp/bismark/active/gwip)
fi
# Reverse traceroute
@@ -96,20 +100,20 @@
# Get Gateway IP
if [ ! "$gwip" ]; then
bismark-tr "8.8.8.8" > /dev/null
- [ -e /tmp/gwip ] && gwip=$(cat /tmp/gwip)
+ [ -e /tmp/bismark/active/gwip ] && gwip=$(cat /tmp/bismark/active/gwip)
fi
# RTT measurements using PING
if get_target Bismark PING $ZONE 10 ; then
# Last mile RTT
if [ "$gwip" ]; then
- ( bismark-ping $gwip | bismark-mstats LMRTT PING $src $gwip > /tmp/lmrtt ; cat /tmp/lmrtt >> $XML_FILE ) &
+ ( bismark-ping $gwip | bismark-mstats LMRTT PING $src $gwip > /tmp/bismark/active/lmrtt ; cat /tmp/bismark/active/lmrtt >> $XML_FILE ) &
fi
# Geo-distributed servers RTT
- mkdir -p /tmp/gdrtt
+ mkdir -p /tmp/bismark/active/gdrtt
for srv in $(grep -v ^# /usr/lib/bismark/world_ips.list); do
- ( bismark-ping $srv | bismark-mstats RTT PING $src $srv > /tmp/gdrtt/$srv ; cat /tmp/gdrtt/$srv >> $XML_FILE ) &
+ ( bismark-ping $srv | bismark-mstats RTT PING $src $srv > /tmp/bismark/active/gdrtt/$srv ; cat /tmp/bismark/active/gdrtt/$srv >> $XML_FILE ) &
done
# MServer RTT
@@ -123,9 +127,9 @@
echo "Done DNS"
## Serial measurements ##
-if [ ! -e /tmp/mlock ]; then
+if [ ! -e /tmp/bismark/var/mlock ]; then
# Set measure lock
- echo $(date +%s) > /tmp/mlock
+ echo $(date +%s) > /tmp/bismark/var/mlock
# Bitrate
if [ $((count % BR_FQ)) -eq 0 ]; then
@@ -133,17 +137,18 @@
if get_target Bismark NETPERF $ZONE $BR_DURATION ; then
sleep $wait
( sleep 3 ; bismark-ping $dst | bismark-mstats ULRTTDW PING $src $dst >> $XML_FILE ) &
- bismark-netperf $BR_DURATION $NTHREADS $dst dw > /tmp/bismark/data/netperf-out
- cat /tmp/bismark/data/netperf-out | bismark-mstats BITRATE NETPERF $dst $src | grep -v nan >> $XML_FILE
+ bismark-netperf $BR_DURATION $NTHREADS $dst dw > /tmp/bismark/active/netperf-out
+ cat /tmp/bismark/active/netperf-out | bismark-mstats BITRATE NETPERF $dst $src | grep -v nan >> $XML_FILE
+ rm /tmp/bismark/active/netperf-out
fi
# Upstream bitrate using NETPERF
if get_target Bismark NETPERF $ZONE $BR_DURATION ; then
sleep $wait
( sleep 3 ; bismark-ping $dst | bismark-mstats ULRTTUP PING $src $dst >> $XML_FILE ) &
- bismark-netperf $BR_DURATION $NTHREADS $dst up > /tmp/bismark/data/netperf-out
- cat /tmp/bismark/data/netperf-out | bismark-mstats BITRATE NETPERF $src $dst | grep -v nan >> $XML_FILE
- rm /tmp/bismark/data/netperf-out
+ bismark-netperf $BR_DURATION $NTHREADS $dst up > /tmp/bismark/active/netperf-out
+ cat /tmp/bismark/active/netperf-out | bismark-mstats BITRATE NETPERF $src $dst | grep -v nan >> $XML_FILE
+ rm /tmp/bismark/active/netperf-out
fi
fi
@@ -171,14 +176,14 @@
fi
# Release measure lock
- rm /tmp/mlock
+ rm /tmp/bismark/var/mlock
else
# Check lock
- locktime=$(cat /tmp/mlock)
+ locktime=$(cat /tmp/bismark/var/mlock)
currtime=$(date +%s)
if [ $((currtime - locktime)) -gt 400 ]; then
killall netperf prober ITGRecv ITGSend
- rm /tmp/mlock
+ rm /tmp/bismark/var/mlock
fi
fi
echo "Done ALL"
Modified: trunk/device/OpenWrt_common/scripts/bismark-netperf
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-netperf 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-netperf 2011-05-17 21:55:39 UTC (rev 336)
@@ -1,12 +1,75 @@
#!/bin/ash
-# Bismark netperf wrapper
+# Bismark netperf multi-task wrapper
#
-# author: walter.dedonato@unina.it
+# author: srikanth@gatech.edu
+# last modified by: walter.dedonato@unina.it
# Load configuration files
. /etc/bismark/bismark.conf
# Help screen
-[ $4 ] || { echo "usage: $(basename $0) <duration> <nthreads> <dst_ip> <direction>" ; exit ; }
+[ $4 ] || { echo "usage: $(basename $0) <duration> <nthreads> <dst_ip> <up|dw>" ; exit ; }
-bismark-netperf-thread $1 $2 $3 $4
+# Settings
+DATA_DIR=/tmp/bismark/active
+cmd=netperf
+out="$DATA_DIR/netperf-out"
+err="$DATA_DIR/netperf-err"
+port=12345
+
+# Ausiliary functions
+clean() {
+ rm $out*
+ rm $err*
+}
+
+check() {
+ nlines=$1
+ c=1
+ while [ $c -le $N ]
+ do
+ ilines=`awk 'END{print NR}' ${out}-$c`
+ errors=`awk 'END{print NR}' ${err}-$c`
+ if [ $nlines -ne $ilines ] || [ $errors -gt 0 ]
+ then
+ echo "-1000"
+ clean
+ exit 1
+ fi
+ : $((c++))
+ done
+}
+
+parse() {
+ nlines=1
+ check $nlines
+ head -$c -q "$out"* | awk '{print $5}' | awk 'BEGIN{sum=0;}{sum+=$1}END{print sum}';
+}
+
+# Parse input parameters
+T=$1
+N=$2
+host=$3
+dir=$4
+keys=" -l$T -P0 -fk"
+case $dir in
+dw) keys=$keys' -t TCP_MAERTS' ;;
+up) keys=$keys' -t TCP_STREAM' ;;
+esac
+
+mkdir -p $DATA_DIR
+
+# Parallel tasks creatin loop
+c=1
+while [ $c -le $N ]; do
+ $cmd $keys -p$port -H $host > ${out}-$c 2> ${err}-$c &
+ : $((c++))
+done
+
+# Wait for tasks to complete their job
+wait
+
+# Parse measurement results and remove logs
+parse
+clean
+exit 0
Deleted: trunk/device/OpenWrt_common/scripts/bismark-netperf-thread
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-netperf-thread 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-netperf-thread 2011-05-17 21:55:39 UTC (rev 336)
@@ -1,63 +0,0 @@
-#!/usr/bin/env ash
-
-T=$1
-#i=$2
-N=$2
-host=$3
-dir=$4
-
-cmd=netperf
-out='/tmp/netperf-out'
-err='/tmp/netperf-err'
-port=12865
-
-clean() {
- rm $out*
- rm $err*
-}
-check() {
- nlines=$1
- c=1
- while [ $c -le $N ]
- do
- ilines=`awk 'END{print NR}' $out$c`
- errors=`awk 'END{print NR}' $err$c`
- if [ $nlines -ne $ilines ] || [ $errors -gt 0 ]
- then
- echo "-1000"
- clean
- exit 1
- fi
- c=`expr $c + 1`
- done
-}
-
-parse() {
- nlines=1
- check $nlines
- head -$c -q "$out"* | awk '{print $5}' | awk 'BEGIN{sum=0;}{sum+=$1}END{print sum}';
-}
-
-keys=" -l$T -P0 -fk"
-if [ $dir = 'dw' ]
-then
- keys=$keys' -t TCP_MAERTS'
-fi
-if [ $dir = 'up' ]
-then
- keys=$keys' -t TCP_STREAM'
-fi
-#echo $keys $host
-c=1
-while [ $c -le $N ]
-do
- #echo $c
- echo $cmd $keys -p$port $host
- $cmd $keys -p$port -H $host > $out$c 2>$err$c &
- c=`expr $c + 1`
- #port=`expr $port + 1`
-done
-wait
-parse
-clean
-exit 0
Modified: trunk/device/OpenWrt_common/scripts/bismark-ping
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-ping 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-ping 2011-05-17 21:55:39 UTC (rev 336)
@@ -13,7 +13,6 @@
opts="$opts -c $PING_COUNT"
opts="$opts -s $PING_PSIZE"
opts="$opts -W $PING_TIMEOUT"
-#[ -e /etc/openwrt_release ] || opts="$opts -i $PING_INTERVAL"
# Execute ping
ping $opts $1 | awk -F"=|ms" '/ttl/{ print $4 }'
Modified: trunk/device/OpenWrt_common/scripts/bismark-sp
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-sp 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-sp 2011-05-17 21:55:39 UTC (rev 336)
@@ -7,7 +7,9 @@
. /etc/bismark/bismark.conf
. /usr/lib/bismark/functions.inc.sh
-exit 0
+# Help screen
+[ $1 ] || { echo "usage: $(basename $0) <dst_ip>" ; exit ; }
+
# Get measure info
get_ip
dst=$1
@@ -20,4 +22,4 @@
/^Up:/{ print "\t<measurement param=SHAPERATE tool=SP srcip='$src' dstip='$dst' timestamp='$tstamp' avg=" $2 " std=0 min=" $2 " max=" $2 " med=" $2 " iqr=0 />" }
/^Down:/{ print "\t<measurement param=SHAPERATE tool=SP srcip='$dst' dstip='$src' timestamp='$tstamp' avg=" $2 " std=0 min=" $2 " max=" $2 " med=" $2 " iqr=0 />" }
'
-
+
Modified: trunk/device/OpenWrt_common/scripts/bismark-tr
===================================================================
--- trunk/device/OpenWrt_common/scripts/bismark-tr 2011-05-16 15:28:01 UTC (rev 335)
+++ trunk/device/OpenWrt_common/scripts/bismark-tr 2011-05-17 21:55:39 UTC (rev 336)
@@ -6,27 +6,35 @@
# Load configuration files
. /etc/bismark/bismark.conf
+# Settings
+DATA_DIR=/tmp/bismark/active
+
# Help screen
[ $1 ] || { echo "usage: $(basename $0) <dst_ip>" ; exit 1 ; }
# AWK filters
filter_common='
-if (! gwip) {
- if (! ($2 ~ /^10\./ || $2 ~ /^192\.168/ || $2 ~ /^172\.16/) ) {
- gwip=$2
- print gwip > "/tmp/gwip"
+ if (! gwip) {
+ if (! ($2 ~ /^10\./ || $2 ~ /^192\.168/ || $2 ~ /^172\.16/) ) {
+ gwip=$2
+ print gwip > "'$DATA_DIR'/gwip"
+ }
}
-}'
+'
filter_std='
-! /trace/{
- print "<hop id="$1" ip="$2" rtt="$3" />"
- '$filter_common'
-}'
-filter_tcp='{ rtt=$3 } ; /\[.*\]/{ rtt=$4 }
-{
- print "<hop id="$1" ip="$2" rtt="rtt" />"
- '$filter_common'
-}'
+ ! /trace/{
+ print "<hop id="$1" ip="$2" rtt="$3" />"
+ '$filter_common'
+ }
+'
+filter_tcp='
+ { rtt=$3 }
+ /\[.*\]/{ rtt=$4 }
+ {
+ print "<hop id="$1" ip="$2" rtt="rtt" />"
+ '$filter_common'
+ }
+'
# Select traceroute type
case $TR_TYPE in
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-17 21:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 21:55 [Bismark-commits] rev 336 - trunk/device/OpenWrt_common/etc trunk/device/OpenWrt_common/scripts walter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox