Getting to know OpenFlow Nick Rutherford – Mariano Vallés {nicholas,mariano}@ac.upc.edu OpenFlow Switching 1. A way to run experiments in the networks we use everyday. A “pragmatic” compromise Allow researchers to run experiments in their network… …without requiring vendors to expose internal workings. Basics An Ethernet switch (e.g. 128-ports of 1GE) An open protocol to remotely add/remove flow entries The Stanford Clean Slate Program http://cleanslate.stanford.edu The Ossified Network Routing, management, mobility management, access control, VPNs, … Feature Feature Million of lines of source code 5400 RFCs Barrier to entry Operating System Specialized Packet Forwarding Hardware Billions of gates Bloated Power Hungry Many complex functions baked into the infrastructure OSPF, BGP, multicast, differentiated services, Traffic Engineering, NAT, firewalls, MPLS, redundant layers, … An industry with a “mainframe-mentality”, reluctant to change 3 Ethernet Switch 4 Control Path (Software) Data Path (Hardware) 5 OpenFlow Controller OpenFlow Protocol (SSL/TCP) Control Path OpenFlow Data Path (Hardware) 6 Flow Table Entry “Type 0” OpenFlow Switch Rule Action Stats Packet + byte counters 1. 2. 3. 4. Switch MAC Port src + mask MAC dst The Stanford Clean Slate Program Forward packet to port(s) Encapsulate and forward to controller Drop packet Send to normal processing pipeline Eth type VLAN ID IP Src IP Dst IP Prot TCP sport http://cleanslate.stanford.edu TCP dport OpenFlow Switching Controller OpenFlow Switch specification OpenFlow Switch sw Secure Channel hw low F n e Op ocol t Pro SSL Flow Table The Stanford Clean Slate Program http://cleanslate.stanford.edu PC Step 1: Separate Control from Datapath Research Experiments Decision making is decoupled Step 2: Cache flow decisions in datapath “If header = x, send to port 4” “If header = y, overwrite header with z, send to ports 5,6” “If header = ?, send to me” Flow Flow Table Table Mininet simulator ● ● process-based virtualization: many hosts and switches on a single OS kernel Network namespaces: lightweight virtualization feature ● ● ● individual processes with separate network interfaces, routing tables, and ARP tables create kernel or user-space OpenFlow switches, controllers to control the switches, and hosts Full access to hosts → xterm, tcpdump Mininet Architecture Mininet ● ● ● ● ● simple and inexpensive network testbed for OpenFlow apps Topology aware and OpenFlow-aware CLI supports custom topologies, and includes a basic set of parametrized topologies Works out of the box provides a Python API for network creation and experimentation Sample Mininet custom topology #!/usr/bin/python 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() A small network (4 hosts, 3 switches in Tree topology), and pings one host from another Tutorial Setup Controller Controller c0 port6633 port6633 loopback (127.0.0.1:6633) OpenFlow Tutorial 3hosts-1switch topology s1 OpenFlow OpenFlowSwitch Switch s1-eth0 h1-eth0 h2 h2 10.0.0.2 10.0.0.2 s1-eth1 h3-eth0 h3 h3 10.0.0.3 10.0.0.3 virtual hosts loopback (127.0.0.1:6634) dpctl dpctl (user (userspace space process) process) s1-eth2 h4-eth0 h4 h4 10.0.0.4 10.0.0.4 15 Tutorial 16 Full set of slides and more info: ● ● OFELIA tutorial (demo) Openflow OFELIA tutorial slides(Berlin, Feb 2011) ● Nick McKeown's SDN slides ● Openflow intro slides ● Mininet overview ● Bob Lantz , Mininet presentation 2009 FlowVisor-based Virtualization Mariano’s Controller Nick's Controller Space Invader's Controller OpenFlow Protocol OpenFlow Switch OpenFlow FlowVisor & Policy Control OpenFlow Protocol OpenFlow Switch OpenFlow Switch 18 OpenFlow building blocks oftrace oftrace oflops oflops Monitoring/ debugging tools openseer openseer Stanford Provided ENVI ENVI (GUI) (GUI) NOX NOX LAVI LAVI Beacon Beacon FlowViso r Console Commercial Switches HP, HP,NEC, NEC,Pronto, Pronto, Juniper.. Juniper..and andmany many more more n-Casting n-Casting Helios Helios Expedient Expedient Applications SNAC SNAC Controller Maestro Maestro Slicing Software FlowVisor FlowVisor Stanford Provided Software Software Ref. Ref.Switch Switch NetFPGA NetFPGA Broadcom Broadcom Ref. Ref.Switch Switch OpenWRT OpenWRT PCEngine PCEngine WiFi WiFiAP AP OpenVSwitch OpenVSwitch OpenFlow Switches 19