An Introduction to Software Defined Networking and OpenFlow Vic Thomas vicraj.Thomas@gmail.com
Reserve Resources (Step 1 of Instructions) Slice 1: Controller Portal RSpec: XEN OpenFlow Controllers Slice 2: Network Portal RSpec: OpenFlow OVS all XEN Create both slices on the same InstaGENI rack Instructions at: https://tinyurl.com/geni-of-ryu
Software Defined Networking Basics OpenFlow
Software Defined Networking Basics
“The current Internet is at an impasse because new architecture cannot be deployed or even adequately evaluated” [PST04] [PST04]: Overcoming the Internet Impasse through Virtualization, Larry Peterson, Scott Shenker, Jonothan Turner. Hotnets 2004
Software Defined Networking… Enables innovation in networking Changes practice of networking A Purpose-Built Global Network: Google's Move to SDN CACM March 2016, pp 46–54
Smarts baked into switch SDN Basics Smarts baked into switch Network Switch
Smarts moved out of switch SDN Basics Open API Controller Smarts moved out of switch Network Switch
SDN Basics From: Forwarding table entries added by vendor provided logic internal to switch MATCH ACTION dst subnet X output port 48 dst subnet Y output port 47 dst MAC: 00:00:00:00:00:01 output port 2 output port 5 SDN To: Table entries added by external controller written by anyone src subnet Z drop TCP port 80 output port 10 Switch Forwarding Table
SDN Basics Controller One controller can manage many switches
SDN Enables Network Function Virtualization Controller NAT firewall DHCP DNS switch VPN router gateway proxy access point Network Device Many network functions can be implemented using a generic network device
NFV: Network Function Virtualization Slide from: http://docbox.etsi.org/Workshop/2013/201304_FNTWORKSHOP/S07_NFV/BT_REID.pdf
Software Defined Infrastructures Physical infrastructure User defined virtual networks with compute, storage, networking Everything is virtualized Highly optimized networks Dynamic reconfigurations Network snapshotting Network engineering ~ ~ Software engineering Orchestration Layer (e.g. ONOS) Figure adapted from http://www.slideshare.net/LarryCover/virtualizing-the-network-to-enable-a-software-defined-infrastructure-sdi?related=1
SDN Benefits* External control Centralized control Enables network Apps Fosters innovation: Not limited to vendor provided switch logic Leverages general-purpose computers (Moore’s Law) Drives down costs: Network hardware becomes a commodity Centralized control Enterprise-wide optimization and planning Dynamic network reconfiguration One place for apps to interact (auth & auth, etc) * OpenFlow: A radical New idea in Networking, Thomas A. Limoncelli CACM 08/12 (Vol 55 No. 8)
There an now many more ways of SDN Drawbacks Unexpected interactions between features Controller reliability and stability Controller security (runs on a general purpose computer and OS) There an now many more ways of messing up a nework
OpenFlow
OpenFlow is an SDN API OpenFlow is the most widely implemented controller-switch API
OpenFlow Versions (‘12/’13) OpenFlow 1.3.x (‘11) Open Networking Foundation (ONF) formed to shepherd standards (‘12/’13) OpenFlow 1.3.x Complex & support in progress (Dec ’09) OpenFlow 1.0.0 Simple & widely supported (Dec’ 14) OpenFlow 1.5 (Oct ‘13) OpenFlow 1.4 (Feb ‘11) OpenFlow 1.1.0 Not implemented by HW vendors (Nov‘13) OpenFlow 1.0.2 (Dec ‘11) OpenFlow 1.2 First ONF standard https://www.opennetworking.org/sdn-resources/technical-library
OpenFlow Protocol (SSL/TCP) The controller is responsible for populating forwarding table of the switch In a table miss the switch asks the controller Switch Data Path (Hardware) Control Path OpenFlow Any Host OpenFlow Controller OpenFlow Protocol (SSL/TCP) Modified slide from : http://www.deutsche-telekom-laboratories.de/~robert/GENI-Experimenters-Workshop.ppt
OpenFlow Protocol (SSL/TCP) OpenFlow in Action Host1 sends a packet If there are no rules for handling this packet Forward packet to the controller installs a rule on the forwarding table (flow table) Subsequent packets do not go through the controller Switch Data Path (Hardware) Control Path OpenFlow Any Host OpenFlow Controller OpenFlow Protocol (SSL/TCP) host2 host1 Modified slide from : http://www.deutsche-telekom-laboratories.de/~robert/GENI-Experimenters-Workshop.ppt
OpenFlow 1.0 Basics Rule Action Stats Packet + byte counters Forward packet to port(s) Encapsulate and forward to controller Drop packet Send to normal processing pipeline Modify Fields Switch Port VLAN ID VLAN PCP MAC src MAC dst Eth type IP Src IP Dst IP Prot IP ToS TCP sport TCP dport Now I’ll describe the API that tries to meet these goals. + mask what fields to match slide from : http://www.deutsche-telekom-laboratories.de/~robert/GENI-Experimenters-Workshop.ppt 21
OpenFlow controllers Open source controller frameworks NoX – C++ PoX - Python OpenDaylight - Java FloodLight - Java Trema – C / Ruby Maestro - Java Ryu - Python Proprietary controllers Mostly customized solutions based on Open Source frameworks ProgrammableFlow - NEC
Running OpenFlow Experiments Debugging OpenFlow experiments is hard: Network configuration debugging requires coordination Many networking elements in play No console access to the switch Before deploying your OpenFlow experiment test your controller. http://mininet.github.com/ http://openvswitch.org/
Exercise: Use the Ryu controller to set up simple flows
OpenFlow 1.0 Intro Exercise Write simple controllers to control the traffic between the three hosts.
Major Steps Step 2 of instructions 2. Configure your switch 2a. Connect switch ports to Ethernet interfaces of VM running switch 2b. Point switch to controller Controller can by anywhere on the Internet. Yours runs on a GENI VM in a different slice. host2 host1 OVS switch name: br0 controller host3
Run Experiments Simple learning switch Port forwarding Server proxy OVS switch acts as a regular switch: Learns which MAC addresses are connected to which ports and forwards traffic accordingly Port forwarding Traffic from Host 1 to Host 2 on Port 5000 gets forwarded to Port 6000 on Host 2 Server proxy Traffic from Host 1 to Host 2 gets forwarded to Host 3
Tips Cut and paste the curl commands Keep online version of instructions open http://tinyurl.com/geni-of-ryu You will have multiple terminals open to each of Hosts 1, 2, 3, controller and switch. Make sure your are typing your commands in the right window.
Instructions: http://tinyurl.com/geni-of-ryu