Skip to content

Instantly share code, notes, and snippets.

@ffund
Last active April 23, 2021 01:39
Show Gist options
  • Save ffund/c9d40b303944e8056e22f2c4cd91b9f4 to your computer and use it in GitHub Desktop.
Save ffund/c9d40b303944e8056e22f2c4cd91b9f4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Copa test
household="$1"
if [ "$#" -ne 1 ]; then
echo "Household ID needed to run copa_test."
exit
fi
duration=60
cd ~/digitaldivide
Price=$(python src/digitaldivideutil.py --houseid $household | grep "Estimated price per month" | cut -d" " -f5)
UpRate=$(python src/digitaldivideutil.py --houseid $household | grep "Upload rate" | cut -d" " -f9)
DownRate=$(python src/digitaldivideutil.py --houseid $household | grep "Download rate" | cut -d" " -f7)
RTT=$(python src/digitaldivideutil.py --houseid $household | grep "Round-trip delay" | cut -d" " -f6)
cd
cd ~/mvfst/_build/build/quic/tools/tperf
# echo CongestionControl,LatencyFactor,HouseholdNumber,Price,UploadRate,DownloadRate,RTT,Throughput,minRTT,avgRTT,maxRTT,std$
ping -c $duration 10.10.2.2 > ping-"$household"-cubic-0.txt &
cubictput=$(./tperf -mode=client -host=10.10.2.2 -port=5550 -pacing=true -duration=$duration -congestion=cubic 2>&1 | grep "Overall throughput" | cut -d" " -f7)
cubicping=$(cat ping-"$household"-cubic-0.txt | tail -n 1 | awk '{print $4}' | sed 's/\//,/g')
echo "cubic,0,$household,$Price,$UpRate,$DownRate,$RTT,$cubictput,$cubicping"
sleep 5
delta="2 5 8"
for d in $delta
do
ping -c 60 10.10.2.2 > ping-"$household"-copa-"$d".txt &
copatput=$(./tperf -mode=client -host=10.10.2.2 -port=555"$d" -pacing=true -duration=$duration -congestion=copa -latency_factor=0.$d 2>&1 | grep "Overall throughput" | cut -d" " -f7)
copaping=$(cat ping-"$household"-copa-"$d".txt | tail -n 1 | awk '{print $4}' | sed 's/\//,/g')
echo "copa,0.$d,$household,$Price,$UpRate,$DownRate,$RTT,$copatput,$copaping"
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment