From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-01-ewr.dyndns.com (mxout-059-ewr.mailhop.org [216.146.33.59]) by lists.bufferbloat.net (Postfix) with ESMTP id 5340C2E36A2 for ; Fri, 15 Apr 2011 05:16:47 -0700 (PDT) Received: from scan-01-ewr.mailhop.org (scanner [10.0.141.223]) by mail-01-ewr.dyndns.com (Postfix) with ESMTP id 3FCF01F9D1A for ; Fri, 15 Apr 2011 12:16:47 +0000 (UTC) X-Spam-Score: 0.1 () X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 143.225.229.147 Received: from svn.comics.unina.it (unknown [143.225.229.147]) by mail-01-ewr.dyndns.com (Postfix) with ESMTP id 6C5031F9D42 for ; Fri, 15 Apr 2011 12:16:46 +0000 (UTC) Received: from www-data by svn.comics.unina.it with local (Exim 4.69) (envelope-from ) id 1QAi0f-0002a2-4h for bismark-commits@lists.bufferbloat.net; Fri, 15 Apr 2011 14:20:25 +0200 To: bismark-commits@lists.bufferbloat.net From: walter@svn.comics.unina.it Message-Id: Date: Fri, 15 Apr 2011 14:20:25 +0200 Subject: [Bismark-commits] rev 323 - trunk/device/OpenWrt_common/scripts 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: Fri, 15 Apr 2011 12:16:48 -0000 Author: walter Date: 2011-04-15 14:20:25 +0200 (Fri, 15 Apr 2011) New Revision: 323 Modified: trunk/device/OpenWrt_common/scripts/bismark-measure-active trunk/device/OpenWrt_common/scripts/bismark-netperf-thread trunk/device/OpenWrt_common/scripts/bismark-ping Log: some measure-active fixes Modified: trunk/device/OpenWrt_common/scripts/bismark-measure-active =================================================================== --- trunk/device/OpenWrt_common/scripts/bismark-measure-active 2011-04-15 08:21:10 UTC (rev 322) +++ trunk/device/OpenWrt_common/scripts/bismark-measure-active 2011-04-15 12:20:25 UTC (rev 323) @@ -7,6 +7,13 @@ . /etc/bismark/bismark.conf . /usr/lib/bismark/functions.inc.sh +# Configuration +COUNTER="/tmp/bismark/var/counter" +MEASURE_REPLY="/tmp/bismark/var/mreply" +XML_FILE="/tmp/bismark/data/${DEVICE_ID}_$(date +%s).xml" + +# --- Functions --- + # Measure message generator # $1 = options msg () @@ -20,36 +27,37 @@ # $2 = type # $3 = zone # $4 = duration +# Outputs: +# $dst, $info and $wait get_target () { # Send message - msg "$1 $2 $3 $4" | nc -u $NC_OPTS $SERVER $PROBE_PORT > /tmp/mreply + msg "$1 $2 $3 $4" | nc -u $NC_OPTS $SERVER $PROBE_PORT > $MEASURE_REPLY # Get reply - read dst info wait < /tmp/mreply + read dst info wait < $MEASURE_REPLY [ $dst ] || return 1 } +# --- Main --- + # Create dirs and files -mkdir -p /tmp/measure -[ -e /tmp/measure/counter ] || echo 0 > /tmp/measure/counter +mkdir -p /tmp/bismark/active +[ -e $COUNTER ] || echo 0 > $COUNTER # Get and update count -count=$(cat /tmp/measure/counter) -echo $(( (count + 1) % 288 )) > /tmp/measure/counter +count=$(cat $COUNTER) +echo $(( (count + 1) % 288 )) > $COUNTER # Random wait -sleep $((RANDOM % 3)) +sleep $(random 0 3) -# Globals -xml_file="/tmp/${DEVICE_ID}_$(date +%s).xml" - # Get source IP get_ip # XML file header -cat > $xml_file <<-end - +cat > $XML_FILE <<-end + end @@ -62,7 +70,7 @@ hops=$(bismark-tr $dst) hops_cnt=$(echo "$hops" | wc -l) if [ $hops_cnt -gt 0 ]; then - cat >> $xml_file <<-end + cat >> $XML_FILE <<-end $(echo "$hops" | awk '{ print " " $0 }') @@ -76,7 +84,7 @@ hops=$(bismark-rtr $dst $info) hops_cnt=$(echo "$hops" | wc -l) if [ $hops_cnt -gt 0 ]; then - cat >> $xml_file <<-end + cat >> $XML_FILE <<-end $(echo "$hops" | awk '{ print " " $0 }') @@ -95,22 +103,22 @@ 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/lmrtt ; cat /tmp/lmrtt >> $XML_FILE ) & fi # Geo-distributed servers RTT mkdir -p /tmp/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/gdrtt/$srv ; cat /tmp/gdrtt/$srv >> $XML_FILE ) & done # MServer RTT - bismark-ping $dst | bismark-mstats RTT PING $src $dst >> $xml_file + bismark-ping $dst | bismark-mstats RTT PING $src $dst >> $XML_FILE fi echo "Done PING" # DNS delay and failure if [ $((count % DNS_FQ)) -eq 0 ]; then - bismark-dns >> $xml_file + bismark-dns >> $XML_FILE fi echo "Done DNS" @@ -124,15 +132,15 @@ # Downstream bitrate using NETPERF 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 | bismark-mstats BITRATE NETPERF $dst $src | grep -v nan >> $xml_file + ( sleep 3 ; bismark-ping $dst | bismark-mstats ULRTTDW PING $src $dst >> $XML_FILE ) & + bismark-netperf $BR_DURATION $NTHREADS $dst dw | bismark-mstats BITRATE NETPERF $dst $src | grep -v nan >> $XML_FILE 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 | bismark-mstats BITRATE NETPERF $src $dst | grep -v nan >> $xml_file + ( sleep 3 ; bismark-ping $dst | bismark-mstats ULRTTUP PING $src $dst >> $XML_FILE ) & + bismark-netperf $BR_DURATION $NTHREADS $dst up | bismark-mstats BITRATE NETPERF $src $dst | grep -v nan >> $XML_FILE fi fi @@ -141,13 +149,13 @@ # Downstream if get_target Bismark ITGDL $ZONE $UDP_DURATION ; then sleep $wait - bismark-ditg udp $dst $info dw $UDP_DURATION $UDP_PPS >> $xml_file + bismark-ditg udp $dst $info dw $UDP_DURATION $UDP_PPS >> $XML_FILE fi # Upstream if get_target Bismark ITGUL $ZONE $UDP_DURATION ; then sleep $wait - bismark-ditg udp $dst $info up $UDP_DURATION $UDP_PPS >> $xml_file + bismark-ditg udp $dst $info up $UDP_DURATION $UDP_PPS >> $XML_FILE fi fi @@ -155,7 +163,7 @@ if [ $((count % SP_FQ)) -eq 0 ]; then if get_target Bismark SP $ZONE 150 ; then sleep $wait - bismark-sp $dst >> $xml_file + bismark-sp $dst >> $XML_FILE fi fi @@ -173,13 +181,13 @@ echo "Done ALL" # XML file footer -cat >> $xml_file <<-end +cat >> $XML_FILE <<-end end -# Move file to measure folder +# Move file to data folder sleep 2 -mv $xml_file /tmp/measure +mv $XML_FILE /tmp/bismark/data # Upload result Modified: trunk/device/OpenWrt_common/scripts/bismark-netperf-thread =================================================================== --- trunk/device/OpenWrt_common/scripts/bismark-netperf-thread 2011-04-15 08:21:10 UTC (rev 322) +++ trunk/device/OpenWrt_common/scripts/bismark-netperf-thread 2011-04-15 12:20:25 UTC (rev 323) @@ -6,13 +6,13 @@ host=$3 dir=$4 -cmd=./netperf +cmd=netperf out='/tmp/netperf-out' err='/tmp/netperf-err' port=12865 clean() { - ls $out* + rm $out* } check() { nlines=$1 @@ -58,5 +58,5 @@ done wait parse -#clean +clean exit 0 Modified: trunk/device/OpenWrt_common/scripts/bismark-ping =================================================================== --- trunk/device/OpenWrt_common/scripts/bismark-ping 2011-04-15 08:21:10 UTC (rev 322) +++ trunk/device/OpenWrt_common/scripts/bismark-ping 2011-04-15 12:20:25 UTC (rev 323) @@ -13,7 +13,7 @@ opts="$opts -c $PING_COUNT" opts="$opts -s $PING_PSIZE" opts="$opts -W $PING_TIMEOUT" -[ -e /etc/openwrt_release ] || opts="$opts -i $PING_INTERVAL" +#[ -e /etc/openwrt_release ] || opts="$opts -i $PING_INTERVAL" # Execute ping ping $opts $1 | awk -F"=|ms" '/ttl/{ print $4 }'