20210308 Iperf
課堂資料
課堂練習
安裝 pip
安裝 ppa

Update packeges

升級 python 2.x 到 python 3.x





安裝 pip

設定優先順序

到 pip document 官方網站建議的載點下載 pip 安裝檔
啟動剛剛下載好的 get-pip.py 檔案

查看 pip 目前版本

額外補充

Iperf
























Gnuplot

Last updated
安裝 ppa

Update packeges

升級 python 2.x 到 python 3.x





安裝 pip

設定優先順序

到 pip document 官方網站建議的載點下載 pip 安裝檔
啟動剛剛下載好的 get-pip.py 檔案

查看 pip 目前版本



























Last updated
add-apt-repository ppa:deadsnakes/ppaapt-get updateapt-get upgradeapt-get install python3.6apt-get install python3.6-gdbmapt-get install python3.7apt-get install python3.7-gdbmapt install ansiblepython -Vpython3 -Vapt-get install python3-pippip3 install --upgrade pipupdate-alternatives --install / usr / bin / python3 python3 /usr/bin/python3.6 1update-alternatives --install / usr / bin / python3 python3 /usr/bin/python3.7 2curl https://bootstrap.pypa.io/get-pip.py -o get-pip.pypython3 get-pip.pypython3 -m pip -Venconf tho R1do writint e0/2ip add dhcpno shutdo sh ip int briefexitusername cisco privile 15 password ciscoip domain-name test.comcrypto key generate rsaip ssh ver 2line vty 0 4login localtransport input sshping 192.168.8.140ssh cisco@192.168.8.140conf tint e0/0ip add 192.168.1.254 255.255.255.0no shutint e0/1ip add 192.168.2.254 255.255.255.0no shutdo sh ip int briexitexitexitpython3 -m pip install paramikopython3 -m pip install --upgrade pippython3import paramikoexitmkdir ciscocd ciscogedit hosts config_cisco.yml[cisco]
192.168.8.140 ansible_connection=local- hosts: 192.168.8.140
gather_facts: yes
vars:
- cisco_host_ip: 192.168.8.140
ssh_username: cisco
ssh_password: cisco
enable_open: yes
enable_password: cisco
roles:
- config_ciscomkdir config_ciscocd config_ciscomkdir taskscd tasksgedit main.yml- name: cisco_description_ssh_certification
set_fact:
cisco_verification:
host: "{{cisco_host_ip}}"
username: "{{ssh_username}}"
password: "{{ssh_password}}"
authorize: "{{enable_open}}"
auth_pass: "{{enable_password}}"
- name: config e0/0
ios_config:
provider: "{{cisco_verification}}"
parents: interface Ethernet 0/0
lines:
- ip addr 192.168.1.254 255.255.255.0
- no shut
- name: config e0/1
ios_config:
provider: "{{cisco_verification}}"
parents: interface Ethernet 0/1
lines:
- ip addr 192.168.2.254 255.255.255.0
- no shut
- name: show ip interface
ios_command:
provider: "{{cisco_verification}}"
commands: show ip interface brief
register: show_ip_log
- name: show_ip_log
debug:
var: show_ip_log.stdout_lines
with_items: show_ip_log.resultscd ..cd ..apt install treetreeansible-playbook config_cisco.yml -i hostsansible-playbook plyabook.yml -i hostscd ..cd mininetmnnetxterm h1 h2pingalliperf -s -i 1iperf -s -i 1 -uiperf -s -i 1 -u -p 6666iperf -c 10.0.0.2 -t 20iperf -c 10.0.0.2 -t 10 -u -b 100Miperf -c 10.0.0.2 -t 10 -u -b 100M -p 6666xterm h1 h2 s1iperf -s -i 1 -u -p 5555iperf -c 10.0.0.2 -t 10 -u -b 100M -p 5555exitxterm h1 h2iperf -s -i 1 -u -p 5555 > udp5555^Ccat udp5555cat udp5555 | grep seccat udp5555 | grep sec | grep -y 0.0-15 cat udp5555 | grep sec | head -n 14 > result.txtiperf -c 10.0.0.2 -t 15 -u -b 100M -p 5555cd mininetmnxterm h1 h2xterm s1h1 ifconfigh1 ping 10.0.0.2 -c 3ping 10.0.0.2python -m SimpleHTTPServer 80su - userfirefoxping 10.0.0.110.0.0.2:80sh ls /tmppingallapt install gnuplotexitgnuplotplot "result.txt"set yrange [0:110]set ytics 0,10,110replotset xrange [0:15]set xtics 0,5,15plot "result.txt" with linespointsset xtics 0,1,15replotset xlabel "tine (sec)"set ylabel "throughput (Mbis/sec)"replotset title "udp throughput"replotset terminal "gif"type set to 'gif'set output "result.gif"replotexit