This homework will cover the some of the networking in cloud computing. In particular it will introduce you to software defined networking (SDN). Scott Shenker, professor at the UC Berkeley are giving a lot of good talks on SDN and why we need it, one of which you can find here. The homework is based on this Github turorial so if you find the instructions here confusing, I recommend that you look around in that one:)

Overview

The goal of this homework is to develop a network control application using OpenFlow. OpenFlow is an open interface for remotely controlling the forwarding tables in network switches, routers and access points. The network we will control will be built on Mininet, which creates a realistic virtual network on a single machine (VM).

There are a bunch of available controller platforms to build this application on. However, we recommend using POX (which is written in python). The rest of this homework will be based on it, but as usual, feel free to use whatever platform you wish!

The structure of the homework is as follows:

  1. Install all the necessary software
  2. Learn mininet, and create a topology (starting code exist)
  3. Learn how to connect a remote controller to your network switch
  4. Develop a learning switch (starting code exist)
  5. Develop a flow-based learning switch

Some platforms:

Java: Beacon, Floodlight

Python: POX, Ryu, Nox

Ruby: Trema

Deadline and Deliverables

Deadline for this homework is March 31. You will hand in the source code (usually just two files) and a short text (1/4 - 1/2 page) that answers the following questions:

Installing the necessary software

As with the privious homeworks this one does also reqwuire you to install some software. First off you will need to install a Virtual Machine (like VirualBox which is free, or VMware).

  1. Install a Virtual Machine - VirtualBox (is free and works on any platform)
  2. Download and install Mininet - great install instructions can be found here
  3. Make sure that you can ssh into your virtual machine!
  4. Read about mininet
  5. Go through the Mininet tutorial.
  6. Install POX (official tutorial here)
    1. Open a new terminal-window (W1) and ssh into your virtual machine (VM)
    2. In (W1): $ git clone http://github.com/noxrepo/pox

Create a topology in Mininet

There are many different ways of creating a network topology in mininet. Most of them are explained here

To prepare for the next homework assignment, we will learn how to create and define a topology using the mininet API, and Pyhton. Make sure to download and look through our file hw3_start.py (can be found here). In this file we have already created a topology corresponding to the figure below. It also contains some useful comments on how you can change the file so that the switches can use a remote controller - which is exactly what you want when you will create your learning switch!

Follow these steps to familiarize yourself with the topology, and the mininet API:

  1. ssh into your VM
  2. copy hw3_start.py into your VM - can be found here
  3. Run the file
  4. Open hw3_start.py in a text editor:
  5. Let’s now make things interesting!!

Connect a controller to your network

When running a remote controller it is up to you to make sure that you actually connect a controller. The controller you specified in your mininet topology (in hw3_start.py) will only ensure that your switch(es) listen for a connection from a remote controller.

These steps will guide you on how to connect a remote controller to your network switch. The remote controller that we will connect is the one that currently acts as a hub. You will later edit this controller so that it instead acts as a learning switch.

  1. Fire up 2 terminal windows and ssh into your VM on both of them
  2. (W1): This window will be used to run mininet
  3. (W2): This will be used to run your controller
  4. (W1): Try the following commands and see what happens:

Turing a Hub into a Learning Switch

This is the main part of the homework assignment. Here you will take the provided controller (of_tutorial.py) which acts as a hub and turn it into a learning switch. You should have done the above steps before doing this one!

  1. Fire up 2 terminal windows again, and ssh into your VM
  2. (W1): Will be used for mininet
  3. (W2): Will be used for POX

Python help

If you are unfamiliar with Python, you can check out some good commands below, or this turorial.

OpenFlow and POX help

I highly recommend the OpenFlow POX wiki for any question on OpenFlow and POX. However, I will list some useful commands below:

Installing a flow

To install a flow table entry into a switch you will have to send an ofp_flow_mod message to it. The message contains some fields that need to be set.

ofp_flow_mod message fields:

ofp_match fields:

Some examples of how to use these fields: