20210308 Iperf
課堂資料
課堂練習
安裝 pip
安裝 ppa
add-apt-repository ppa:deadsnakes/ppa

Update packeges
apt-get update
apt-get upgrade

升級 python 2.x 到 python 3.x
apt-get install python3.6
apt-get install python3.6-gdbm


apt-get install python3.7
apt-get install python3.7-gdbm


apt install ansible

python -V
python3 -V
安裝 pip
apt-get install python3-pip
pip3 install --upgrade pip

設定優先順序
update-alternatives --install / usr / bin / python3 python3 /usr/bin/python3.6 1
update-alternatives --install / usr / bin / python3 python3 /usr/bin/python3.7 2

到 pip document 官方網站建議的載點下載 pip 安裝檔
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
啟動剛剛下載好的 get-pip.py 檔案
python3 get-pip.py

查看 pip 目前版本
python3 -m pip -V

額外補充

cd ..
cd mininet
Iperf
mn
net
xterm h1 h2
pingall

iperf -s -i 1

iperf -s -i 1 -u

iperf -s -i 1 -u -p 6666
-p
:port

xterm h1 h2 s1
iperf -s -i 1 -u -p 5555

exit
xterm h1 h2
iperf -s -i 1 -u -p 5555 > udp5555
^C
cat udp5555

cat udp5555 | grep sec

cat udp5555 | grep sec | grep -y 0.0-15

cat udp5555 | grep sec | head -n 14 > result.txt


cd mininet
mn
xterm h1 h2
xterm s1

h1 ifconfig

h1 ping 10.0.0.2 -c 3

ping 10.0.0.2
python -m SimpleHTTPServer 80


sh ls /tmp
pingall

Gnuplot
apt install gnuplot

exit
gnuplot
plot "result.txt"
set yrange [0:110]
set ytics 0,10,110
replot
set xrange [0:15]
set xtics 0,5,15
plot "result.txt" with linespoints
set xtics 0,1,15
replot
set xlabel "tine (sec)"
set ylabel "throughput (Mbis/sec)"
replot
set title "udp throughput"
replot
set terminal "gif"
type set to 'gif'
set output "result.gif"
replot
exit
Last updated
Was this helpful?