Programming Assignment Wang Zixiao School of Computing National University of Singapore CS 4226: Internet Architecture
Overview: step 1 Build a virtual network with Mininet network emulation environment s1 dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s
Mininet network Node Link Switch 20 Mb/s 10 Mb/s h1 h3 h2 h4 h5 h6 h7 dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s Node Link Switch
Mininet network Host Machine Virtual Machine s1 s4 s2 s3 h1 h3 h2 h4 Virtua Network
Overview: step 2 Program the OpenFlow controller POX to implement three applications: Learning Switch, Firewall, VPN
Mininet network POX Host Machine Virtual Machine s1 s4 s2 s3 h1 h3 h2 Virtual Network
Learning Switch S1 Forward Table 20 Mb/s 10 Mb/s h1->h3 MAC Address dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s h1->h3 S1 Forward Table MAC Address Port
Learning Switch S1 Forward Table 20 Mb/s 10 Mb/s h1->h3 h1->h3 dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s h1->h3 h1->h3 h1->h3 S1 Forward Table MAC Address Port 00:00:00:00:00:01 1
Learning Switch S1 Forward Table 20 Mb/s 10 Mb/s h3->h1 dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s h3->h1 S1 Forward Table MAC Address Port 00:00:00:00:00:01 1 00:00:00:00:00:03 3
Firewall Block List: [10.0.0.1, 10.0.0.4, 80] 20 Mb/s 10 Mb/s dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s h1->h4:80
Firewall Block List: [10.0.0.1, 10.0.0.4, 80] 20 Mb/s 10 Mb/s dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s h1->h4:100
Virtual Private Network (VPN) s1 dpid:1 s4 dpid:4 s2 dpid:2 s3 dpid:3 h1 10.0.0.1 h3 10.0.0.3 h2 10.0.0.2 h4 10.0.0.4 h5 10.0.0.5 h6 10.0.0.6 h7 10.0.0.7 20 Mb/s 10 Mb/s What is the sample space? 36 (i,j) pairs. h1->h4 100 Mb/s h1->h4 50 Mb/s
Priority Firewall VPN Learning Switch > > What is the sample space? 36 (i,j) pairs. VPN > Learning Switch
Submission File: mininetTopo.py, controller.py Comments What is the sample space? 36 (i,j) pairs. Comments Report (1 page)
Demo Run mininetTopo.py, controller.py Network Topology + Learning Switch: topology.in ping all hosts ( pingall command) What is the sample space? 36 (i,j) pairs. Firewall: polocy.in One host sends data to another on certain ports (iperf ) VPN: polocy.in Hosts in the same company Vs. Hosts from different companies
Preview Packet sent to controller “PacketIn” event fired No flow table match Compose and send message Write flow table entry Action Flow table match Second packet arrives at switch Parse packet and execute control logic First packet arrives at switch Msg Listener Control Logic Messager POX OpenFlow OpenFlow OpenFlow PacketIn Control Plane Data Plane OpenFlow Switch OpenFlow Switch Entry 1 Mininet OpenFlow Switch 1 2
Mininet Creates a realistic network, running real kernel, switch and application code on a single machine Interact with the network using Mininet Command Line Interface (CLI) Support OpenFlow switches (OpenVSwitch) Support custom topologies
Important classes and functions Topo: the base class for Mininet topologies addSwitch(): adds a switch to a topology and returns the switch name addHost(): adds a host to a topology and returns the host name addLink(): adds a bidirectional link to a topology
Important classes and functions Mininet: the main class to create and manage a network start(): starts your network stop(): stops your network pingAll(): tests connectivity by trying to have all nodes ping each other
Setup: Mininet Download Virtualbox ( Recommended) Download Mininet Image ( FTP server) What is the sample space? 36 (i,j) pairs. Install the Mininet Appliance
Setup: POX Install Ubuntu (Recommended) What is the sample space? 36 (i,j) pairs. Checkout POX controller from github Checkout and install POXDest (optional)
Test your code Check the topology using POXDesk Test learning switch Test firewall Test VPN