Basic usage
$Linux mode
mininet>:mininet commandsudo mn -h
:show all help commands
start a minimal topology:sudo mn
. create 1 openflow switch with 2 hosts.
nodes:show all nodes;
net:show all links;
dump:dump all information about all nodes;
nodename ifconfig -a:在指定节点上运行指定指令;
s1 arp/route:显示网关和硬件地址;
s1/h1 ps -a:显示当前进程的所有进程
s1 ping -c 1 h2:检测连接情况,-c为发送的全部数据包数目
ping的第一次要ARP,广播泛红所有请求到网络里面是所有的主机,找到目标主机应答相应的MAC address返回到controller再应答主机。
Host指令
模式下支持所有Bash指令。
Run a simple web server and client:1
2
3
4mininet> h1 python -m SimpleHTTPServer 80 &//创建一个新进程
mininet> h2 wget -O - h1
...
mininet> h1 kill %pythonsudo mn -c
clean up the host;
Analysis of network
self contained-regression test:sudo mn --test pingpair
:run all pairs ping test and return the total time and tore down situation.sudo mn --test iperf
:test bandwidth between each host pair.
regression test: sudo mn –topo single,3:1 switch and 3 hosts.
sudo mn –topo linear,4
Link variations:人为改变链路参数:sudo mn --link tc,bw=10,delay=10ms
tc:traffic control utility
Adjustable Verbosity:调整信息模式,默认是info.
sudo mn -v ouput/debug
Interact with mininet shell
the round trip time (RTT)py locals()
py dir(h1)
:methods and file avaliable from a hostpy h1.IP()
:evaluate a variable
Link up and down:For fault tolerance testing, it can be helpful to bring links up and down.link s1 h1 down
link s1 h1 up
建立链路
When running ping and Iperfer in Mininet, you must use IP addresses, not hostnames.
ping:send ICMP echo requests to hosts;-F flow to all hosts,-f flood ping