Programming Assignment

Slides:



Advertisements
Similar presentations
Communication Networks Recitation 3 Bridges & Spanning trees.
Advertisements

University of Calgary – CPSC 441.  We need to break down big networks to sub-LANs  Limited amount of supportable traffic: on single LAN, all stations.
Ryu Book Chapter 1 Speaker: Chang, Cheng-Yu Date: 25/Nov./
Copyright 2014 Kenneth M. Chipps Ph.D. Software Defined Networking Lab Using Mininet and the POX Controller Last Update
Connecting LANs: Section Figure 15.1 Five categories of connecting devices.
CPSC 441 TUTORIAL TA: FANG WANG HUBS, SWITCHES AND BRIDGES Parts of the slides contents are courtesy of the following people: Jim Kurose, Keith Ross:
Project Overview CS5229 Lecturer: Dr. Richard MA TA: Mostafa Rezazad.
SDN and Openflow.
An Overview of Software-Defined Network
© 2002, Cisco Systems, Inc. All rights reserved..
Introduction to Computer Networks 09/23 Presenter: Fatemah Panahi.
Networking Components
1 LAN switching and Bridges Relates to Lab 6. Covers interconnection devices (at different layers) and the difference between LAN switching (bridging)
CECS 474 Computer Network Interoperability Tracy Bradley Maples, Ph.D. Computer Engineering & Computer Science Cal ifornia State University, Long Beach.
DataLink Layer1 Ethernet Technologies: 10Base2 10: 10Mbps; 2: 200 meters (actual is 185m) max distance between any two nodes without repeaters thin coaxial.
An Overview of Software-Defined Network Presenter: Xitao Wen.
Virtual LANs. VLAN introduction VLANs logically segment switched networks based on the functions, project teams, or applications of the organization regardless.
Connecting LANs, Backbone Networks, and Virtual LANs
© 2006 Cisco Systems, Inc. All rights reserved. ICND v2.3—1-1 Configuring Catalyst Switch Operations Introducing Basic Layer 2 Switching and Bridging Functions.
Network Redundancy Multiple paths may exist between systems. Redundancy is not a requirement of a packet switching network. Redundancy was part of the.
1 CS 4396 Computer Networks Lab LAN Switching and Bridges.
PA3: Router Junxian (Jim) Huang EECS 489 W11 /
Jon Turner, John DeHart, Fred Kuhns Computer Science & Engineering Washington University Wide Area OpenFlow Demonstration.
Review: –Ethernet What is the MAC protocol in Ethernet? –CSMA/CD –Binary exponential backoff Is there any relationship between the minimum frame size and.
15.1 Chapter 15 Connecting LANs, Backbone Networks, and Virtual LANs Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or.
1 Data Link Layer Lecture 23 Imran Ahmed University of Management & Technology.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
Mininet and Openflow Labs. Install Mininet (do not do this in class) Download VirtualBox Download Xming for windows (X11) Download Mininet VM for linux-ubuntu.
Introduction to Mininet, Open vSwitch, and POX
Computer Network Architecture Lecture 3: Network Connectivity Devices.
Jennifer Rexford Princeton University MW 11:00am-12:20pm Data-Plane Verification COS 597E: Software Defined Networking.
SPEAKER: MUHAMMAD REZA ZULMAN DATE: NOVEMBER 17, 2014 OPENFLOW SPECIFICATION.
5: DataLink Layer5-1 Link-layer switches. 5: DataLink Layer5-2 Hubs … physical-layer (“dumb”) repeaters: m bits coming in one link go out all other links.
1 LAN switching and Bridges Relates to Lab Outline Interconnection devices Bridges/LAN switches vs. Routers Bridges Learning Bridges Transparent.
Why Fabric? 1 Complicated technology/vendor/device specific provisioning for networks, especially heterogeneous network DC Network – STP, TRILL, SPB, VXLAN,
Programming Assignment 2 Zilong Ye. Traditional router Control plane and data plane embed in a blackbox designed by the vendor high-seed switching fabric.
Virtual Local Area Networks In Security By Mark Reed.
Chapter 3 Part 1 Switching and Bridging
SDN controllers App Network elements has two components: OpenFlow client, forwarding hardware with flow tables. The SDN controller must implement the network.
Programming SDN 1 Problems with programming with POX.
Mininet and Openflow Labs
What I Learned From Mininet
Software defined networking: Experimental research on QoS
Link Layer 5.1 Introduction and services
Heitor Moraes, Marcos Vieira, Italo Cunha, Dorgival Guedes
Programming Assignment
Networking Devices.
Scaling the Network: The Internet Protocol
Lab 2 – Hub/Switch Data Link Layer
MAC Addresses and ARP 32-bit IP address:
Network Data Plane Part 2
Chapter 4 Data Link Layer Switching
ARP: Address Resolution Protocol
Lab 2 – Hub/Switch Data Link Layer
Virtual LANs.
SDN Overview for UCAR IT meeting 19-March-2014
SDN basics and OpenFlow
Hubs Hubs are essentially physical-layer repeaters:
LAN switching and Bridges
Group 6-SDN Based Prioritized Information Dissemination
LAN switching and Bridges
Implementing an OpenFlow Switch on the NetFPGA platform
An Introduction to Software Defined Networking and OpenFlow
Scaling the Network: The Internet Protocol
LAN switching and Bridges
Ch 17 - Binding Protocol Addresses
CS434/534: Topics in Network Systems High-Level Programming for Programmable Networks Yang (Richard) Yang Computer Science Department Yale University.
Chapter 5 Data Link Layer – Hub, Switch
An Introduction to Software Defined Networking and OpenFlow
Chapter 4: outline 4.1 Overview of Network layer data plane
Presentation transcript:

Programming Assignment Wang Zixiao School of Computing National University of Singapore CS 4226: Internet Architecture

Variety of SDN Controllers NOX/POX Ryu Floodlight OpenDaylight Pyretic Frenetic Procera RouteFlow Trema

POX: Overview A platform for building network control applications using Python Supports OpenFlow v. 1.0 API Advantages: Widely used, maintained, supported Relatively easy to read and write code Disadvantages: Performance

Mininet Network POX Host Machine Virtual Machine s1 s4 s2 s3 h1 h3 h2 Virtual Network

Learn through an example Implement a switch What is a switch? What is a hub?

Simple hub Ethernet is a broadcast medium Hub is a flooding device

Example: Simple Switch Switch layer 2: A multiple port bridge learn about the MAC addresses on each ports passes MAC frames destined to those ports.

Self-learning, forwarding: example Source: A Dest: A’ A A’ B B’ C C’ 1 2 3 4 5 6 A A’ Frame Destination: A’ Location: unknown A A’ ➔ flood A A’ Frame Destination: A Location: 1 A A' A A’ A' A A A' ➔ selectively send on just one link MAC addr interface TTL A 1 60 switch table (initially empty) A’ 4 60

Learning Switch 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

OpenFlow Flow Entry A flow entry in the flow table looks like: Match field: packets are matched against: Header fields and metadata May be wildcarded (any) Priority: used for conflicts Action set: Lists of actions to apply immediately Sets of actions to add to the action set Modify pipeline processing (go to another flow table) A “default” entry: table-miss entry Match Fields Priority Counter Action Timeout

How it works? Controller Listener Event Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn) Step 2: Parse packet and execute control logics Step 3: Compose and send the OpenFlow message to the switch def launch (): 1- core.openflow.addListenerByName("PacketIn", _handle_PacketIn) 2- core.registerNew (Tutorial) Class Tutorial(EventMixin): //EventMixin is the class that raises events def __init__(self): self.listenTo(core.openflow) core.openflow_discovery.addListeners(self) //then implement all handlers you need….

Events Packet-in: For packets that do not have a matching flow entry Flow-Removed: For flow entries whose timeout expires Port-status: When port configuration state changes Connection-up: Upon connection startup

How it works? Controller Listener Control Logic Event Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn) Step 2: Parse packet and execute control logics Step 3: Compose and send the OpenFlow message to the switch def _handle_PacketIn (self, event): packet = event.parsed dst_port = table.get(packet.dst) def _handle_ConnectioUp (self, event) : log.debug(“Switch %s has come up.”, dpid_to_str(event.dpid)) Every switch connected to the controller has an id named dpid (data path id).

How it works? Listener Control Logic Messager Event Msg Step 1: Register event listeners to handle specific events (e.g. ConnectionUp, PacketIn) Step 2: Parse packet and execute control logics Step 3: Compose and send the OpenFlow message to the switch msg = of.ofp_flow_mod() <- This instructs a switch to install a flow table entry msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg)

Match in_port dl_src, dl_dst nw_src, nw_dst nw_proto tp_src, tp_dst

Match Manual Match Packet Match msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst Manual Match msg.match = ofp_match.from_packet(packet, in_port) Packet Match

Actions ofp_action_output() ofp_action_enqueue() ofp_action_dl_addr() ofp_action_nw_addr()

Example: Simple Switch def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn) def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst) msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg) Step 1: Register event listener

Example: Simple Switch def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn) def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst) msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg) Step 2: Parse the packet and execute control logics

Example: Simple Switch def launch (): core.openflow.addListenerByName("PacketIn", _handle_PacketIn) def _handle_PacketIn (event): packet = event.parsed dst_port = table.get(packet.dst) msg = of.ofp_flow_mod() msg.match.dl_src = packet.src msg.match.dl_dst = packet.dst msg.actions.append(of.ofp_action_output(port = dst_port)) event.connection.send(msg) Step 3: Compose and send OpenFlow message

Quality of Service Divide the production network into logical slices Each slice controls its own packet forwarding Enforce strong isolation between slices Actions in one slice do not affect another

QoS: Virtual Private Network (VPN) Multiple queues for multiple classes Guaranteed minimum bandwidth Queue configuration is not part of the openflow Configuration defines packet treatment Openflow maps flows to queues Ref:http://archive.openflow.org/wk/index.php/Slicing Controller Q1 Q2 Q3 Q4 Q5 DQ IF1 OF OpenFlow Switch IF2 IF3 IF1 IF4

VPN Create multiple queues for each interface (or port) Provide each queue with different bandwidth Separate traffics into two slices and assign to different interfaces Try to keep it simple.

Tips: controller net = Mininet(topo=topo, link = TCLink, controller=lambda name: RemoteController(name, ip='pox controller ip’), listenPort=6633, autoSetMacs=True) Fill in the field with the controller’s IP address

Tips: queues sudo ovs-vsctl – set Port eth0 qos=@newqos -- --id=@newqos create QoS type=linux-htb other- config:max-rate=1000000 queues=0=@q0,1=@q1 -- --id=@q0 create Queue other-config:max- rate=600000 other-config:min-rate=600000 -- --id=@q1 create Queue other-config:max- rate=400000 other-config:min-rate=200000 sudo ovs-vsctl --all destroy Qos sudo ovs-vsctl --all destroy Queue

Tips: priority msg.priority Give higher priorities to more important apps