Last active
August 29, 2015 14:09
-
-
Save Stantheman/029d4817bdd94e14e4e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
choose_congestion_control="/proc/sys/net/ipv4/tcp_congestion_control" | |
ip=127.0.0.1 | |
iperf -s | |
iperf_pid=$! | |
for i in $(ls /lib/modules/3.2.0-4-amd64/kernel/net/ipv4/tcp*); do | |
# transform the path from /lib/.../tcp_bic.ko to bic | |
kernelname=${i##*/} | |
kernelname=${kernelname##tcp_} | |
kernelname=${kernelname%%.ko} | |
if [[ "$kernelname" == "diag" ]]; then | |
echo skipping | |
continue | |
fi | |
echo "testing $kernelname" | |
# iperf will set on the socket, otherwise I'd need: | |
# echo $kernelname > $choose_congestion_control | |
iperf -t5 -c $ip -Z $kernelname | tee $kernelname.txt | |
done | |
# since cubic is built-in, do that too | |
echo "testing cubic" | |
#echo cubic > $choose_congestion_control | |
iperf -t5 -c $ip -Z cubic | tee cubic.txt | |
kill $iperf_pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment