Slide 1

Slide 1 text

1 / 61 EL-5244 Mininet Basics Eueung Mulyana https://telematika.org/remark/mininet CodeLabs | Attribution-ShareAlike CC BY-SA

Slide 2

Slide 2 text

Outline Introduction Getting Started MiniNAM OpenFlow Tutorial POX Controller 2 / 61

Slide 3

Slide 3 text

Mininet 2.2.2 on Ubuntu 14.04 LTS - 64 bit, o cial VM | POX 0.2.0 (carp) | OVS (Open vSwitch) 2.0.2 VirtualBox 5.2.6 on Ubuntu Xenial 16.04.3. Ref: [Mininet VM Images] 3 / 61

Slide 4

Slide 4 text

Introduction 4 / 61

Slide 5

Slide 5 text

Mininet provides a virtual test bed and development environment for SDN 5 / 61

Slide 6

Slide 6 text

6 / 61 Mininet enables Rapid prototyping of software-de ned networks Complex topology testing without the need to wire up a physical network Multiple concurrent developers to work independently on the same topology

Slide 7

Slide 7 text

7 / 61 Mininet networks run real code including standard Unix/Linux network applications as well as the real Linux kernel and network stack. Mininet provides an extensible Python API for network creation and experimentations. Ref: MININET - Open Networking Foundation

Slide 8

Slide 8 text

Getting Started 8 / 61

Slide 9

Slide 9 text

9 / 61 Mininet Setup Using Pre-Made VM Download a Mininet VM Image Import the Image (eg. into VirtualBox) Con gure Access (eg. port forwarding or host-only networking) Run the VM Access via SSH with Remote Display Forwarding Enabled Note: in the o cial Mininet VM image version 2.2.2, there is possibly a con guration bug if you're using VirtualBox. See comments by isams1 in this thread. So don't use host-only networking to access the VM.

Slide 10

Slide 10 text

Import Appliance 10 / 61

Slide 11

Slide 11 text

Import Appliance 11 / 61

Slide 12

Slide 12 text

Con gure Access 12 / 61

Slide 13

Slide 13 text

Con gure Access - Port Forwarding 13 / 61

Slide 14

Slide 14 text

Con gure Access - Port Forwarding 14 / 61

Slide 15

Slide 15 text

Run the VM 15 / 61

Slide 16

Slide 16 text

Access via SSH 16 / 61

Slide 17

Slide 17 text

Test 17 / 61

Slide 18

Slide 18 text

Test - Wireshark 18 / 61

Slide 19

Slide 19 text

19 / 61 Check $ ssh -Y -l mininet -p 2222 localhost mininet@mininet-vm:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.ori mininet@mininet-vm:~$ sudo sed -i 's/http:\/\/us.archive.ubuntu.com\/ubuntu\//http:\/\/kambing.u mininet@mininet-vm:~$ sudo apt-get update mininet@mininet-vm:~$ sudo apt-get install tree mininet@mininet-vm:~$ tree -L 1 . |-- install-mininet-vm.sh |-- loxigen |-- mininet |-- oflops |-- oftest |-- openflow |-- pox

Slide 20

Slide 20 text

20 / 61 Check mininet@mininet-vm:~/mininet$ tree -L 2 -d . |-- bin |-- build | |-- bdist.linux-x86_64 | |-- lib.linux-x86_64-2.7 | |-- scripts-2.7 |-- custom |-- debian | |-- source |-- dist |-- doc |-- examples | |-- test |-- mininet | |-- examples -> ../examples | |-- test |-- mininet.egg-info |-- util |-- kbuild |-- nox-patches |-- openflow-patches |-- sch_htb-ofbuf |-- vm

Slide 21

Slide 21 text

mininet@mininet-vm:~/mininet/examples$ ll total 364 drwxrwxr-x 3 mininet mininet 4096 Mar 21 2017 ./ drwxrwxr-x 13 mininet mininet 4096 Mar 21 2017 ../ -rw-rw-r-- 1 mininet mininet 4965 Mar 21 2017 README.md -rw-rw-r-- 1 mininet mininet 48 Mar 21 2017 __init__.py -rwxrwxr-x 1 mininet mininet 1074 Mar 21 2017 baresshd.py* -rwxrwxr-x 1 mininet mininet 2310 Mar 21 2017 bind.py* -rwxrwxr-x 1 mininet mininet 33427 Mar 21 2017 cluster.py* -rwxrwxr-x 1 mininet mininet 501 Mar 21 2017 clusterSanity.py* -rw-rw-r-- 1 mininet mininet 3875 Mar 21 2017 clustercli.py -rwxrwxr-x 1 mininet mininet 639 Mar 21 2017 clusterdemo.py* -rwxrwxr-x 1 mininet mininet 15612 Mar 21 2017 consoles.py* -rwxrwxr-x 1 mininet mininet 1061 Mar 21 2017 controllers.py* -rwxrwxr-x 1 mininet mininet 1612 Mar 21 2017 controllers2.py* -rwxrwxr-x 1 mininet mininet 4967 Mar 21 2017 controlnet.py* -rwxrwxr-x 1 mininet mininet 3725 Mar 21 2017 cpu.py* -rwxrwxr-x 1 mininet mininet 960 Mar 21 2017 emptynet.py* -rwxrwxr-x 1 mininet mininet 1549 Mar 21 2017 hwintf.py* -rwxrwxr-x 1 mininet mininet 1320 Mar 21 2017 intfoptions.py* -rwxrwxr-x 1 mininet mininet 2034 Mar 21 2017 limit.py* -rwxrwxr-x 1 mininet mininet 4062 Mar 21 2017 linearbandwidth.py* -rwxrwxr-x 1 mininet mininet 2826 Mar 21 2017 linuxrouter.py* -rwxrwxr-x 1 mininet mininet 154479 Mar 21 2017 miniedit.py* -rwxrwxr-x 1 mininet mininet 4198 Mar 21 2017 mobility.py* -rwxrwxr-x 1 mininet mininet 834 Mar 21 2017 multilink.py* -rwxrwxr-x 1 mininet mininet 2235 Mar 21 2017 multiping.py* -rwxrwxr-x 1 mininet mininet 2469 Mar 21 2017 multipoll.py* -rwxrwxr-x 1 mininet mininet 1049 Mar 21 2017 multitest.py* -rwxrwxr-x 1 mininet mininet 550 Mar 21 2017 nat.py* -rwxrwxr-x 1 mininet mininet 1948 Mar 21 2017 natnet.py* -rwxrwxr-x 1 mininet mininet 2330 Mar 21 2017 numberedports.py* -rwxrwxr-x 1 mininet mininet 1023 Mar 21 2017 popen.py* -rwxrwxr-x 1 mininet mininet 932 Mar 21 2017 popenpoll.py* -rwxrwxr-x 1 mininet mininet 2032 Mar 21 2017 scratchnet.py* -rwxrwxr-x 1 mininet mininet 2455 Mar 21 2017 scratchnetuser.py* -rwxrwxr-x 1 mininet mininet 1888 Mar 21 2017 simpleperf.py* -rwxrwxr-x 1 mininet mininet 3040 Mar 21 2017 sshd.py* drwxrwxr-x 2 mininet mininet 4096 Mar 21 2017 test/ -rwxrwxr-x 1 mininet mininet 522 Mar 21 2017 tree1024.py* -rwxrwxr-x 1 mininet mininet 950 Mar 21 2017 treeping64.py* -rwxrwxr-x 1 mininet mininet 3679 Mar 21 2017 vlanhost.py* 21 / 61 Check

Slide 22

Slide 22 text

22 / 61 Notes Mininet Walkthrough $ sudo mn [--topo=minimal] $ sudo mn --test pingpair $ sudo mn --test iperf $ sudo mn --link tc,bw=10,delay=10ms $ sudo mn --test pingall --topo single,3 $ sudo mn --test pingall --topo mytopo --custom ~/mininet/custom/topo-2sw-2host.py $ sudo mn --mac mininet> h1 ping -c10 h2 mininet> pingall mininet> h1 python -m SimpleHTTPServer 80 & mininet> h2 wget -O - h1 mininet> iperf mininet> link s1 h1 down mininet> link s1 h1 up $ sudo ~/mininet/examples/sshd.py Ref: Mininet Walkthrough - Mininet

Slide 23

Slide 23 text

23 / 61 Notes Mininet Sample Work ow # Creating a Network $ sudo mn --switch ovs --controller ref --topo tree,depth=2,fanout=8 --test pingall # Interacting with a Network mininet> h2 ping h3 mininet> h2 python -m SimpleHTTPServer 80 >& /tmp/http.log & mininet> h3 wget -O - h2 # Customizing a Network from mininet.net import Mininet from mininet.topolib import TreeTopo tree4 = TreeTopo(depth=2,fanout=2) net = Mininet(topo=tree4) net.start() h1, h4 = net.hosts[0], net.hosts[3] print h1.cmd('ping -c1 %s' % h4.IP()) net.stop() Ref: Mininet Sample Work ow - Mininet

Slide 24

Slide 24 text

MiniNAM 24 / 61

Slide 25

Slide 25 text

25 / 61 MiniNAM A utility that provides real-time animation of any network created by the Mininet emulator. MiniNAM includes all the components required to initiate, visualize and modify Mininet network ows in real-time. MiniNAM provides a graphical user interface that allows dynamic modi cation of preferences and packet lters: a user can view selective ows with options to color code packets based on packet type and/or nodes (hosts). Ref: MiniNAM | University College Cork

Slide 26

Slide 26 text

26 / 61 Setup $ ssh -Y -l mininet -p 2222 localhost $ sudo apt-get install git python-imaging python-imaging-tk $ git clone https://github.com/uccmisl/MiniNAM.git mininet@mininet-vm:~/MiniNAM$ tree . |-- conf.config |-- Examples | |-- LoadBalancer | | |-- install.sh | | |-- MiniNAM.py | | |-- paping | | |-- README.md | |-- NAT | | |-- badNAT.py | | |-- conf.config | | |-- goodNAT.py | | |-- MiniNAM.py | | |-- README.md | |-- Routing | |-- MiniNAM.py | |-- README.md | |-- simple_switch_13.py | |-- simple_switch_stp_13.py | |-- spanning_tree.py |-- LICENSE |-- MiniNAM.py |-- README.md mininet@mininet-vm:~/MiniNAM$ sudo python MiniNAM.py

Slide 27

Slide 27 text

MiniNAM | h1 ping -c2 h2 27 / 61

Slide 28

Slide 28 text

OpenFlow Tutorial 28 / 61

Slide 29

Slide 29 text

sudo mn --topo single,3 --mac --switch ovsk --controller remote 29 / 61

Slide 30

Slide 30 text

sudo python ~/MiniNAM/MiniNAM.py ... | controller & wireshark issues 30 / 61

Slide 31

Slide 31 text

31 / 61 Manual Flow Entry mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1 NXST_FLOW reply (xid=0x4): mininet> h1 ping -c3 h2 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. From 10.0.0.1 icmp_seq=1 Destination Host Unreachable ... mininet@mininet-vm:~$ sudo ovs-ofctl add-flow s1 in_port=1,actions=output:2 mininet@mininet-vm:~$ sudo ovs-ofctl add-flow s1 in_port=2,actions=output:1 mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1 NXST_FLOW reply (xid=0x4): cookie=0x0, duration=25.666s, table=0, n_packets=0, n_bytes=0, idle_age=25, in_port=1 actions=o cookie=0x0, duration=11.374s, table=0, n_packets=0, n_bytes=0, idle_age=11, in_port=2 actions=o mininet> h1 ping -c3 h2 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.979 ms ... 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 0.099/0.402/0.979/0.408 ms

Slide 32

Slide 32 text

sudo wireshark & 32 / 61

Slide 33

Slide 33 text

Capture Interfaces - Loopback 33 / 61

Slide 34

Slide 34 text

34 / 61 Starting Controller OF Reference Controller $ controller ptcp: & # Issue: controller must first be run, before mininet # Could be an issue related with the image $ controller ptcp: & $ sudo mn --topo single,3 --mac --switch ovsk --controller remote # clean up arp mininet> h1 ip -s -s neigh flush all mininet> h2 ip -s -s neigh flush all # in case, there's still flow entries mininet@mininet-vm:~$ sudo ovs-ofctl del-flows s1 mininet> h1 ping -c1 h2

Slide 35

Slide 35 text

Filter - of 35 / 61

Slide 36

Slide 36 text

Inspect Packet 36 / 61

Slide 37

Slide 37 text

Inspect Packet 37 / 61

Slide 38

Slide 38 text

of and not (of10.echo_request.type or of10.echo_reply.type) 38 / 61

Slide 39

Slide 39 text

OF Packets Captured After : h1 ping -c1 h2 39 / 61

Slide 40

Slide 40 text

40 / 61 h1 ping -c1 h2

Slide 41

Slide 41 text

41 / 61 Flow Entries mininet> dpctl dump-flows mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1 NXST_FLOW reply (xid=0x4): cookie=0x0, duration=25.373s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=25, p cookie=0x0, duration=30.373s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=30, p cookie=0x0, duration=25.374s, table=0, n_packets=1, n_bytes=42, idle_timeout=60, idle_age=25, p cookie=0x0, duration=30.371s, table=0, n_packets=1, n_bytes=98, idle_timeout=60, idle_age=30, p cookie=0x0, duration=30.37s, table=0, n_packets=1, n_bytes=98, idle_timeout=60, idle_age=30, pr mininet@mininet-vm:~$ sudo ovs-ofctl dump-flows s1 NXST_FLOW reply (xid=0x4):

Slide 42

Slide 42 text

42 / 61 Benchmark kernel- vs. user- space mininet> iperf +++ Iperf: testing TCP bandwidth between h1 and h3 +++ Results: ['27.5 Gbits/sec', '27.6 Gbits/sec'] mininet> exit mininet@mininet-vm:~$ sudo mn --topo single,3 --controller remote --switch user mininet> iperf +++ Iperf: testing TCP bandwidth between h1 and h3 +++ Results: ['658 Mbits/sec', '659 Mbits/sec'] # Notes user-space: mininet> sh ovs-ofctl dump-flows s1 ovs-ofctl: s1 is not a bridge or a socket

Slide 43

Slide 43 text

Notes My personal notes with previous versions of Mininet. Some are not tested yet with the current version. 43 / 61

Slide 44

Slide 44 text

44 / 61 Notes mininet> xterm h1 h2 h3 h1# tcpdump -ne -i h1-eth0 mininet>1 h1 ping -c1 h2 mininet>1 h1 arp -na # deprecated?? $ sudo ovs-controller --verbose ptcp:& # $ sudo controller ptcp:& # $ sudo ovs-controller --hub ptcp:& # --noflow --normal --verbose $ sudo ovs-controller --hub --verbose ptcp:& $ sudo ovs-controller --noflow --verbose ptcp:&

Slide 45

Slide 45 text

45 / 61 Notes # IP-Source-Address-Based Rule --> may need Reset $ sudo ovs-ofctl del-flows s1 $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,dl_type=0x0800,nw_src=10.0.0.1,acti $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,dl_type=0x0800,nw_src=10.0.0.2,acti # IP-Dest-Address-Based Rule --> may need Reset $ sudo ovs-ofctl del-flows s1 $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,ip,nw_dst=10.0.0.3,actions=output:3 $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,ip,nw_dst=10.0.0.2,actions=output:2 $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,ip,nw_dst=10.0.0.1,actions=output:1 $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,arp,actions=NORMAL # Alternatives $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,dl_type=0x0806,actions=FLOOD $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,dl_type=0x0806,actions=ALL $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,dl_type=0x0800,nw_proto=1,actions=N $ sudo ovs-ofctl add-flow s1 idle_timeout=600,priority=33001,icmp,nw_dst=10.0.0.2,actions=output # NORMAL sends packet to non-openflow function of switch - not all switch # sudo ovs-ofctl del-flows s1 in_port=1 # sudo ovs-ofctl del-flows s1 dl_type=0x0800

Slide 46

Slide 46 text

46 / 61 Notes

Slide 47

Slide 47 text

47 / 61 Notes

Slide 48

Slide 48 text

POX Controller 48 / 61

Slide 49

Slide 49 text

49 / 61 POX Controller POX is a Python-based SDN controller platform geared towards research and education. POX provides a framework for communicating with SDN switches using either the OpenFlow or OVSDB protocol. Developers can use POX to create an SDN controller using the Python programming language. Ref: [brianlinkletter ]

Slide 50

Slide 50 text

50 / 61 POX Controller Files mininet@mininet-vm:~/pox/pox/misc$ ll total 76 drwxrwxr-x 3 mininet mininet 4096 Mar 21 2017 ./ drwxrwxr-x 15 mininet mininet 4096 Mar 21 2017 ../ -rw-rw-r-- 1 mininet mininet 689 Mar 21 2017 __init__.py -rw-rw-r-- 1 mininet mininet 1240 Mar 21 2017 cbench.py -rw-rw-r-- 1 mininet mininet 1079 Mar 21 2017 full_payload.py -rw-rw-r-- 1 mininet mininet 5214 Mar 21 2017 gephi_topo.py -rw-rw-r-- 1 mininet mininet 10251 Mar 21 2017 ip_loadbalancer.py -rw-rw-r-- 1 mininet mininet 3794 Mar 21 2017 mac_blocker.py -rw-rw-r-- 1 mininet mininet 14375 Mar 21 2017 nat.py -rw-rw-r-- 1 mininet mininet 4582 Mar 21 2017 of_tutorial.py -rw-rw-r-- 1 mininet mininet 2096 Mar 21 2017 pidfile.py drwxrwxr-x 2 mininet mininet 4096 Mar 21 2017 telnetd/ mininet@mininet-vm:~/pox/pox/forwarding$ ll total 96 drwxrwxr-x 2 mininet mininet 4096 Mar 21 2017 ./ drwxrwxr-x 15 mininet mininet 4096 Mar 21 2017 ../ -rw-rw-r-- 1 mininet mininet 651 Mar 21 2017 __init__.py -rw-rw-r-- 1 mininet mininet 1092 Mar 21 2017 hub.py -rw-rw-r-- 1 mininet mininet 4426 Mar 21 2017 l2_flowvisor.py -rw-rw-r-- 1 mininet mininet 6692 Mar 21 2017 l2_learning.py -rw-rw-r-- 1 mininet mininet 15558 Mar 21 2017 l2_multi.py -rw-rw-r-- 1 mininet mininet 4324 Mar 21 2017 l2_nx.py -rw-rw-r-- 1 mininet mininet 2105 Mar 21 2017 l2_nx_self_learning.py -rw-rw-r-- 1 mininet mininet 2882 Mar 21 2017 l2_pairs.py -rw-rw-r-- 1 mininet mininet 12330 Mar 21 2017 l3_learning.py -rw-rw-r-- 1 mininet mininet 14102 Mar 21 2017 topo_proactive.py

Slide 51

Slide 51 text

from pox.core import core import pox.openflow.libopenflow_01 as of log = core.getLogger() #============ class Tutorial (object): #------------------------------- def __init__ (self, connection): self.connection = connection connection.addListeners(self) self.mac_to_port = {} #------------------------------- def resend_packet (self, packet_in, out_port): msg = of.ofp_packet_out() msg.data = packet_in action = of.ofp_action_output(port = out_port) msg.actions.append(action) self.connection.send(msg) #------------------------------- def act_like_hub (self, packet, packet_in): self.resend_packet(packet_in, of.OFPP_ALL) #------------------------------- def act_like_switch (self, packet, packet_in): #------------------------------- def _handle_PacketIn (self, event): packet = event.parsed # This is the parsed packet data. if not packet.parsed: log.warning("Ignoring incomplete packet") return packet_in = event.ofp # The actual ofp_packet_in message. self.act_like_hub(packet, packet_in) #self.act_like_switch(packet, packet_in) #============ def launch (): def start_switch (event): log.debug("Controlling %s" % (event.connection,)) Tutorial(event.connection) core.openflow.addListenerByName("ConnectionUp", start_switch) 51 / 61 of_tutorial.py

Slide 52

Slide 52 text

52 / 61 POX Controller Hub Behavior mininet@mininet-vm:~/pox$ ./pox.py log.level --DEBUG misc.of_tutorial POX 0.2.0 (carp) / Copyright 2011-2013 James McCauley, et al. DEBUG:core:POX 0.2.0 (carp) going up... DEBUG:core:Running on CPython (2.7.6/Oct 26 2016 20:30:19) DEBUG:core:Platform is Linux-4.2.0-27-generic-x86_64-with-Ubuntu-14.04-trusty INFO:core:POX 0.2.0 (carp) is up. DEBUG:openflow.of_01:Listening on 0.0.0.0:6633 INFO:openflow.of_01:[None 1] closed INFO:openflow.of_01:[00-00-00-00-00-01 2] connected DEBUG:misc.of_tutorial:Controlling [00-00-00-00-00-01 2] $ sudo mn --topo single,3 --mac --switch ovsk --controller remote mininet> xterm h1 h2 h3 h1# tcpdump -XX -n -i h1-eth0 > h1.txt & h2# tcpdump -XX -n -i h2-eth0 > h2.txt h3# tcpdump -XX -n -i h3-eth0 > h3.txt h1# ping -c1 10.0.0.2

Slide 53

Slide 53 text

53 / 61 POX Controller Hub Behavior mininet@mininet-vm:~$ cat h1.txt 16:33:33.273970 ARP, Request who-has 10.0.0.2 tell 10.0.0.1, length 28 16:33:33.305723 ARP, Reply 10.0.0.2 is-at 00:00:00:00:00:02, length 28 16:33:33.305730 IP 10.0.0.1 > 10.0.0.2: ICMP echo request, id 4108, seq 1, length 64 16:33:33.306899 IP 10.0.0.2 > 10.0.0.1: ICMP echo reply, id 4108, seq 1, length 64 16:33:38.356385 ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 28 16:33:38.356425 ARP, Reply 10.0.0.1 is-at 00:00:00:00:00:01, length 28 mininet@mininet-vm:~$ cat h2.txt 16:33:33.305056 ARP, Request who-has 10.0.0.2 tell 10.0.0.1, length 28 16:33:33.305079 ARP, Reply 10.0.0.2 is-at 00:00:00:00:00:02, length 28 16:33:33.306329 IP 10.0.0.1 > 10.0.0.2: ICMP echo request, id 4108, seq 1, length 64 16:33:33.306344 IP 10.0.0.2 > 10.0.0.1: ICMP echo reply, id 4108, seq 1, length 64 16:33:38.317451 ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 28 16:33:38.359253 ARP, Reply 10.0.0.1 is-at 00:00:00:00:00:01, length 28 mininet@mininet-vm:~$ cat h3.txt 16:33:33.305054 ARP, Request who-has 10.0.0.2 tell 10.0.0.1, length 28 16:33:33.305722 ARP, Reply 10.0.0.2 is-at 00:00:00:00:00:02, length 28 16:33:33.306328 IP 10.0.0.1 > 10.0.0.2: ICMP echo request, id 4108, seq 1, length 64 16:33:33.306898 IP 10.0.0.2 > 10.0.0.1: ICMP echo reply, id 4108, seq 1, length 64 16:33:38.356378 ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 28 16:33:38.359247 ARP, Reply 10.0.0.1 is-at 00:00:00:00:00:01, length 28

Slide 54

Slide 54 text

54 / 61 POX Controller Hub Behavior h1# ping -c1 10.0.0.5 mininet@mininet-vm:~$ cat h1.txt 16:45:33.285777 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:34.285666 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:35.285632 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 mininet@mininet-vm:~$ cat h3.txt 16:45:33.335877 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:34.310252 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:35.287537 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 mininet@mininet-vm:~$ cat h2.txt 16:45:33.335881 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:34.310257 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28 16:45:35.287542 ARP, Request who-has 10.0.0.5 tell 10.0.0.1, length 28

Slide 55

Slide 55 text

Packets Captured After : h1 ping -c1 10.0.0.2 55 / 61

Slide 56

Slide 56 text

Packets Captured After : h1 ping -c1 10.0.0.5 56 / 61

Slide 57

Slide 57 text

57 / 61 POX Controller Hub Behavior mininet> sh ovs-ofctl dump-flows s1 NXST_FLOW reply (xid=0x4): mininet> pingpair h1 -> h2 h2 -> h1 +++ Results: 0% dropped (2/2 received) mininet> pingall +++ Ping: testing ping reachability h1 -> h2 h3 h2 -> h1 h3 h3 -> h1 h2 +++ Results: 0% dropped (6/6 received) mininet> iperf +++ Iperf: testing TCP bandwidth between h1 and h3 +++ Results: ['19.0 Mbits/sec', '20.3 Mbits/sec'] mininet@mininet-vm:~$ sudo python MiniNAM/MiniNAM.py --topo single,3 --mac --switch ovsk --contr

Slide 58

Slide 58 text

def act_like_switch (self, packet, packet_in): self.mac_to_port[packet.src] = packet_in.in_port if packet.dst in self.mac_to_port: print("Packet sent to Control Plane") self.resend_packet(packet_in, self.mac_to_port[packet.dst]) # log.debug("Installing flow...") msg = of.ofp_flow_mod() msg.match.dl_dst = packet.dst # msg.match = of.ofp_match.from_packet(packet) msg.actions.append(of.ofp_action_output(port=self.mac_to_port[packet.dst])) self.connection.send(msg) else: self.resend_packet(packet_in, of.OFPP_ALL) 58 / 61 of_tutorial.py

Slide 59

Slide 59 text

Refs/Resources 59 / 61

Slide 60

Slide 60 text

Refs/Resources 1. Learn Development Tools - mininet/open ow-tutorial Wiki 2. Create a Learning Switch - mininet/open ow-tutorial Wiki 3. MININET - Open Networking Foundation 4. MiniNAM | University College Cork 5. uccmisl/MiniNAM: A Network Animator for Visualizing Real-Time Packet Flows in Mininet 6. FAQ - mininet/mininet Wiki 7. Learn Development Tools - mininet/open ow-tutorial Wiki 8. Create a Learning Switch - mininet/open ow-tutorial Wiki 60 / 61

Slide 61

Slide 61 text

61 / 61 END Eueung Mulyana https://telematika.org/remark/mininet CodeLabs | Attribution-ShareAlike CC BY-SA