Commit df69ef18 authored by Joanne Hugé's avatar Joanne Hugé

Update wrapper scripts for client and server

parent c4e9143f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
script_dir=$(dirname $(realpath $0)) script_dir=$(dirname $(realpath $0))
usage() { usage() {
echo "Usage: $0 -e delta | -p [-b] [-i INTERVAL] [-t] [-d TX_BUFFER_LEN]" 1>&2; echo "Usage: $0 (-e delta | -p) [-bg] [-i INTERVAL] [-d TX_BUFFER_LEN] [emerald|slate|onyx]" 1>&2;
exit 1; exit 1;
} }
...@@ -12,9 +12,11 @@ interval=100000 ...@@ -12,9 +12,11 @@ interval=100000
# Default options # Default options
client_options="-a -p 99 -f eth0" client_options="-a -p 99 -f eth0"
redirect=""
qdisc_options="" qdisc_options=""
ip="192.168.99."
while getopts "bd:e:hi:pt" opt; do while getopts "bd:e:ghi:p" opt; do
case "${opt}" in case "${opt}" in
b ) b )
client_options+=" -b" client_options+=" -b"
...@@ -25,7 +27,12 @@ while getopts "bd:e:hi:pt" opt; do ...@@ -25,7 +27,12 @@ while getopts "bd:e:hi:pt" opt; do
e ) e )
use_etf=1 use_etf=1
client_options+=" -e -q 7" client_options+=" -e -q 7"
qdisc_options+="-e ${OPTARG}" delta=${OPTARG}
qdisc_options+="-e $delta"
;;
g )
client_options+=" -g -t"
use_histogram=1
;; ;;
h ) h )
usage usage
...@@ -39,9 +46,6 @@ while getopts "bd:e:hi:pt" opt; do ...@@ -39,9 +46,6 @@ while getopts "bd:e:hi:pt" opt; do
client_options+=" -q 1" client_options+=" -q 1"
qdisc_options+="-p" qdisc_options+="-p"
;; ;;
t )
client_options+=" -t"
;;
* ) * )
usage usage
;; ;;
...@@ -49,6 +53,22 @@ while getopts "bd:e:hi:pt" opt; do ...@@ -49,6 +53,22 @@ while getopts "bd:e:hi:pt" opt; do
done done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -n "$1" ]; then
if [ "$1" == "emerald" ]; then
ip+="25"
elif [ "$1" == "slate" ]; then
ip+="26"
elif [ "$1" == "onyx" ]; then
ip+="27"
else
usage
exit 1
fi
else
ip+="25"
fi
if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then
usage usage
fi fi
...@@ -56,8 +76,25 @@ if [ -n "${use_etf}" ] && [ -n "${use_pfast}" ]; then ...@@ -56,8 +76,25 @@ if [ -n "${use_etf}" ] && [ -n "${use_pfast}" ]; then
usage usage
fi fi
if [ -z "${use_histogram}" ]; then
client_options+=" -v"
else
output="client_i${interval}"
if [ -n "${use_pfast}" ]; then
output+="_pfast"
else
output+="_etf_${delta}"
fi
redirect+="> $output;mv $output ~/"
fi
client_options+=" -i $interval"
echo "create_qdisc $qdisc_options"; echo "create_qdisc $qdisc_options";
$script_dir/create_qdisc $qdisc_options; $script_dir/create_qdisc $qdisc_options;
echo "client_arm $client_options -i $interval 192.168.99.25"; echo "make client";
$script_dir/../packet-exchange/build/client_arm $client_options -i $interval 192.168.99.25; $script_dir/../packet-exchange/build/make client;
echo "client $client_options $ip $redirect";
$script_dir/../packet-exchange/build/client $client_options $ip $redirect;
...@@ -3,25 +3,37 @@ ...@@ -3,25 +3,37 @@
script_dir=$(dirname $(realpath $0)) script_dir=$(dirname $(realpath $0))
usage() { usage() {
echo "Usage: $0 [[-b] | -t NB_PACKETS]" 1>&2; echo "Usage: $0 [[-bt] [-g INTERVAL]] | -d NB_PACKETS]" 1>&2;
exit 1; exit 1;
} }
server_options="-a -p 99" # Default options
server_options="-a -p 99" server_options="-a -p 99 -f eth0"
redirect=""
ip="192.168.99."
while getopts "bht:" opt; do while getopts "b:htd:g:" opt; do
case "${opt}" in case "${opt}" in
b ) b )
server_options+=" -b 192.168.99.26" use_rtt=1
board=${OPTARG}
;;
d )
use_tcpdump=1
nb_packets=${OPTARG}
;;
g )
interval=${OPTARG}
server_options+=" -g -i $interval"
use_histogram=1
;; ;;
h ) h )
usage usage
exit 1 exit 1
;; ;;
t ) t )
use_tcpdump=1 server_options+=" -t"
nb_packets=${OPTARG} exit 1
;; ;;
* ) * )
usage usage
...@@ -31,14 +43,42 @@ done ...@@ -31,14 +43,42 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -n "${use_rtt}" ]; then
if [ "$board" == "emerald" ]; then
ip+="25"
elif [ "$board" == "slate" ]; then
ip+="26"
elif [ "$board" == "onyx" ]; then
ip+="27"
else
usage
exit 1
fi
server_options+=" -b $ip"
fi
if [ -z "${use_histogram}" ]; then
server_options+=" -v"
else
output="server_i${interval}"
redirect+="> $output;mv $output ~/"
fi
if [ -n "${use_tcpdump}" ]; then if [ -n "${use_tcpdump}" ]; then
echo "tcpdump -c $nb_packets -i eth0 -w tmp.pcap -tt --time-stamp-precision=nano udp port 50000"; echo "tcpdump -c $nb_packets -i eth0 -w tmp.pcap -tt --time-stamp-precision=nano udp port 50000";
tcpdump -c $nb_packets -i eth0 -w tmp.pcap -tt --time-stamp-precision=nano udp port 50000; tcpdump -c $nb_packets -i eth0 -w tmp.pcap -tt --time-stamp-precision=nano udp port 50000;
echo "tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out"; echo "tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out";
tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out; tshark -r tmp.pcap --disable-protocol dcp-etsi --disable-protocol dcp-pft -t e -E separator=, -T fields -e frame.number -e frame.time_epoch -e data.data > tmp.out;
echo "txtime_stats.py -f tmp.out";
$script_dir/txtime_stats.py -f tmp.out; echo "txtime_stats.py -f server_pcap_stats";
$script_dir/txtime_stats.py -f server_pcap_stats;
else else
echo "server_arm $server_options";
$script_dir/../packet-exchange/build/server_arm $server_options; echo "make server";
$script_dir/../packet-exchange/build/make server;
echo "server $server_options $redirect";
$script_dir/../packet-exchange/build/server $server_options $redirect;
fi fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment