mininetの使い方
mininetでよく使われるコマンドの使い方は以下の通りです。
フローエントリの表示
全てのスイッチのフローエントリが表示されます。
mininet> dpctl dump-flows *** s1 ------------------------------------------------------------------------ NXST_FLOW reply (xid=0x4): cookie=0x0, duration=102.893s, table=0, n_packets=7, n_bytes=630, priority=10,in_port=1,vlan_tci=0x0000,dl_src=92:24:bc:1b:53:e4,dl_dst=1e:d6:92:90:1e:fd actions=output:2 cookie=0x0, duration=102.913s, table=0, n_packets=7, n_bytes=630, priority=10,in_port=2,vlan_tci=0x0000,dl_src=1e:d6:92:90:1e:fd,dl_dst=92:24:bc:1b:53:e4 actions=output:1 *** s2 ------------------------------------------------------------------------ NXST_FLOW reply (xid=0x4): cookie=0x0, duration=102.892s, table=0, n_packets=7, n_bytes=630, hard_timeout=300,priority=10,in_port=1,vlan_tci=0x0000,dl_src=92:24:bc:1b:53:e4,dl_dst=1e:d6:92:90:1e:fd actions=output:3 cookie=0x0, duration=102.919s, table=0, n_packets=7, n_bytes=630, priority=10,in_port=3,vlan_tci=0x0000,dl_src=1e:d6:92:90:1e:fd,dl_dst=92:24:bc:1b:53:e4 actions=strip_vlan,output:1 *** s3 ------------------------------------------------------------------------ NXST_FLOW reply (xid=0x4): cookie=0x0, duration=102.904s, table=0, n_packets=7, n_bytes=630, priority=10,in_port=3,vlan_tci=0x0000,dl_src=92:24:bc:1b:53:e4,dl_dst=1e:d6:92:90:1e:fd actions=strip_vlan,output:1 cookie=0x0, duration=102.91s, table=0, n_packets=7, n_bytes=630, hard_timeout=300,priority=10,in_port=1,vlan_tci=0x0000,dl_src=1e:d6:92:90:1e:fd,dl_dst=92:24:bc:1b:53:e4 actions=output:3
ネットワークのノードの表示
全てのホストとスイッチのノードが表示されます。
mininet> nodes available nodes are: c0 h1 h2 h3 h4 s1 s2 s3
ネットワークのノード間接続の表示
全てのホストとスイッチがどのNICを介して繋がっているのかが表示されます。
mininet> net h1 h1-eth0:s2-eth1 h2 h2-eth0:s2-eth2 h3 h3-eth0:s3-eth1 h4 h4-eth0:s3-eth2 s1 lo: s1-eth1:s2-eth3 s1-eth2:s3-eth3 s2 lo: s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1 s3 lo: s3-eth1:h3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2 c0
全ホスト間でのicmpの疎通確認
マトリックス形式で疎通結果が表示されます。以下の結果だとh1<=>h3のみがつながっています。
mininet> pingall *** Ping: testing ping reachability h1 -> X h3 X h2 -> X X X h3 -> h1 X X h4 -> X X X